feat(ui): rename Simulation→Suggestion, remove forward-test mode entirely (backend routes/store + frontend panel/option), fix stock-list overflow in allocation display
This commit is contained in:
1 parent
b1c8a91ed6
commit
7a3cfac19a
11 files changed
+59
-511
No files matched your search
+11
-112
@@ -142,10 +142,6 @@ def create_app(config: dict[str, Any] | None = None) -> Flask:
|
||||
app.extensions["paper_ledger"] = ledger
|
||||
app.extensions["paper_sessions"] = paper_sessions
|
||||
app.extensions["allowed_symbols"] = allowed_symbols
|
||||
from .forward_test import ForwardTestStore
|
||||
app.extensions["forward_store"] = ForwardTestStore(
|
||||
app.config.get("FORWARD_STORE_PATH") or (data_root / "forward" / "runs.json")
|
||||
)
|
||||
from .dividend_ledger import DividendLedger
|
||||
app.extensions["dividend_ledger"] = DividendLedger(
|
||||
app.config.get("DIVIDEND_LEDGER_PATH") or (data_root / "dividends" / "ledger.json")
|
||||
@@ -612,16 +608,17 @@ def create_app(config: dict[str, Any] | None = None) -> Flask:
|
||||
)
|
||||
|
||||
|
||||
@app.route("/api/v1/simulation", methods=["POST"])
|
||||
def simulation():
|
||||
"""Capital-allocation simulation (paper/backtest; never a real order).
|
||||
@app.route("/api/v1/suggestion", methods=["POST"])
|
||||
def suggestion():
|
||||
"""Capital-allocation suggestion (non-PIT live recommendation; paper).
|
||||
|
||||
Body: {capital: float, mode: "backtest"|"forward"}.
|
||||
Body: {capital: float}.
|
||||
Uses the SAME canonical combined score as /api/v1/dashboard (via
|
||||
`default_scores`) — not a separate 3-theme recompute — so the "จำลอง"
|
||||
allocation can never disagree with the board on which names rank highest.
|
||||
Prices come from the latest Yahoo snapshot; allocation uses the 50/20/30
|
||||
dividend buckets. Output is paper/backtest on revised history (non-PIT).
|
||||
`default_scores`) — not a separate 3-theme recompute — so the "จัดสรรทุน"
|
||||
(suggestion) can never disagree with the board on which names rank
|
||||
highest. Prices come from the latest Yahoo snapshot; allocation uses the
|
||||
50/20/30 dividend buckets. This is a live recommendation on current
|
||||
data (non-PIT), never a real order.
|
||||
"""
|
||||
from app import simulation as sim
|
||||
|
||||
@@ -630,7 +627,6 @@ def create_app(config: dict[str, Any] | None = None) -> Flask:
|
||||
capital = float(payload.get("capital", 0))
|
||||
except (TypeError, ValueError):
|
||||
return jsonify({"error": "capital must be a number"}), 400
|
||||
mode = payload.get("mode", "backtest") in ("backtest", "forward") and payload.get("mode", "backtest")
|
||||
if capital <= 0:
|
||||
return jsonify({"error": "capital must be > 0"}), 400
|
||||
|
||||
@@ -673,10 +669,10 @@ def create_app(config: dict[str, Any] | None = None) -> Flask:
|
||||
current = app.extensions.get("tourism_result") or {}
|
||||
return jsonify(
|
||||
{
|
||||
"mode": mode,
|
||||
"mode": "suggestion",
|
||||
"capital": capital,
|
||||
"as_of": current.get("as_of"),
|
||||
"data_note": "paper/backtest on revised vendor history (non-PIT) — not validated evidence",
|
||||
"data_note": "suggestion on current board (non-PIT) — not validated evidence",
|
||||
**result.to_dict(),
|
||||
}
|
||||
)
|
||||
@@ -931,103 +927,6 @@ def create_app(config: dict[str, Any] | None = None) -> Flask:
|
||||
runs = app.extensions.get("backtest_runs", [])
|
||||
return jsonify({"runs": runs})
|
||||
|
||||
@app.get("/api/v1/forward")
|
||||
def forward_list():
|
||||
"""List all durable forward-test runs (real lifecycle, not cosmetic)."""
|
||||
store = app.extensions["forward_store"]
|
||||
return jsonify({"runs": store.list()})
|
||||
|
||||
@app.get("/api/v1/forward/<run_id>")
|
||||
def forward_get(run_id: str):
|
||||
store = app.extensions["forward_store"]
|
||||
run = store.get(run_id)
|
||||
if run is None:
|
||||
return jsonify({"error": "unknown forward run"}), 404
|
||||
return jsonify(run)
|
||||
|
||||
@app.post("/api/v1/forward")
|
||||
def forward_create():
|
||||
"""CREATE + EXECUTE a forward run with frozen signals.
|
||||
|
||||
Body: {capital, use_pit: bool, as_of: "YYYY-MM-DD"}.
|
||||
Freezes the current (or PIT-as-of) combined per-symbol scores and fills
|
||||
the 50/20/30 buckets at post-freeze prices. The score set is immutable
|
||||
from this point (a real frozen-signal lifecycle).
|
||||
"""
|
||||
from .forward_test import ForwardError
|
||||
store = app.extensions["forward_store"]
|
||||
body = request.get_json(silent=True) or {}
|
||||
try:
|
||||
capital = float(body.get("capital", 0))
|
||||
except (TypeError, ValueError):
|
||||
return jsonify({"error": "capital must be a number"}), 400
|
||||
if capital <= 0:
|
||||
return jsonify({"error": "capital must be > 0"}), 400
|
||||
use_pit = bool(body.get("use_pit"))
|
||||
as_of = body.get("as_of")
|
||||
try:
|
||||
from app import simulation as sim
|
||||
series = sim.load_price_snapshot()
|
||||
prices = sim.latest_prices(series)
|
||||
if use_pit:
|
||||
from .pit_scorer import PitScoreProvider, make_pit_score_fn
|
||||
from .factor_vintages import FactorVintageStore
|
||||
from .siamchart_vintages import SiamchartVintageStore
|
||||
froot = Path(__file__).resolve().parents[1] / "data"
|
||||
sstore = SiamchartVintageStore(froot)
|
||||
_seed_siamchart_vintage(sstore)
|
||||
provider = PitScoreProvider(FactorVintageStore(froot),
|
||||
_load_siamchart_snapshot(),
|
||||
siamchart_store=sstore)
|
||||
score_fn = make_pit_score_fn(provider)
|
||||
score_by_symbol = score_fn(symbols=[], as_of=as_of) or {}
|
||||
non_pit = not any(
|
||||
isinstance(m, dict) and isinstance(m.get("pit_meta"), dict)
|
||||
and bool(m.get("pit_meta", {}).get("pit"))
|
||||
for m in score_by_symbol.values()
|
||||
)
|
||||
else:
|
||||
from .dashboard import default_scores
|
||||
score_by_symbol = default_scores(None) or {}
|
||||
non_pit = True
|
||||
frozen = {}
|
||||
for sym, meta in (score_by_symbol or {}).items():
|
||||
if sym in prices:
|
||||
frozen[sym] = {
|
||||
"combined": float(meta.get("combined", 0.0)),
|
||||
"is_dividend": bool(meta.get("is_dividend")),
|
||||
"dividend_yield": float(meta.get("dividend_yield") or 0.0),
|
||||
}
|
||||
run = store.create(capital, frozen, as_of=as_of or "now", non_pit=non_pit)
|
||||
executed = store.execute(run["id"], prices)
|
||||
return jsonify(executed), 201
|
||||
except (ForwardError, sim.SimulationError, OSError) as exc:
|
||||
return jsonify({"error": str(exc)}), 400
|
||||
|
||||
@app.post("/api/v1/forward/<run_id>/mark")
|
||||
def forward_mark(run_id: str):
|
||||
from .forward_test import ForwardError
|
||||
from app import simulation as sim
|
||||
store = app.extensions["forward_store"]
|
||||
try:
|
||||
series = sim.load_price_snapshot()
|
||||
prices = sim.latest_prices(series)
|
||||
return jsonify(store.mark(run_id, prices))
|
||||
except (ForwardError, sim.SimulationError, OSError) as exc:
|
||||
return jsonify({"error": str(exc)}), 400
|
||||
|
||||
@app.post("/api/v1/forward/<run_id>/mature")
|
||||
def forward_mature(run_id: str):
|
||||
from .forward_test import ForwardError
|
||||
from app import simulation as sim
|
||||
store = app.extensions["forward_store"]
|
||||
try:
|
||||
series = sim.load_price_snapshot()
|
||||
prices = sim.latest_prices(series)
|
||||
return jsonify(store.mature(run_id, prices))
|
||||
except (ForwardError, sim.SimulationError, OSError) as exc:
|
||||
return jsonify({"error": str(exc)}), 400
|
||||
|
||||
@app.post("/api/v1/dividends/update")
|
||||
def dividends_update():
|
||||
"""Fetch real dated dividend history for every snapshot symbol and
|
||||
|
||||
@@ -1,188 +0,0 @@
|
||||
"""Forward-test paper-portfolio lifecycle with frozen signals (real, not cosmetic).
|
||||
|
||||
The earlier "forward" mode was cosmetic: it ran the same single-pass
|
||||
backtest as "backtest", differing only in the `mode` string. This module
|
||||
implements a genuine forward lifecycle:
|
||||
|
||||
1. CREATE (freeze): capture the per-symbol combined scores / dividend
|
||||
flags **at a specific as_of** and persist them. The
|
||||
signal set is immutable from this point — later data
|
||||
cannot change what the run decided.
|
||||
2. EXECUTE (paper): use prices known *after* the freeze date to fill
|
||||
the 50/20/30 dividend buckets (the engine does NOT
|
||||
reach back to pick trades, it fills what the frozen
|
||||
signal said).
|
||||
3. MARK (mark-to-market): recompute portfolio equity against later
|
||||
prices, recording an equity series.
|
||||
|
||||
Each step is persisted to a durable store (JSON, atomic write) so runs
|
||||
survive restarts — replacing the in-memory backtest_runs list.
|
||||
|
||||
Honesty: a frozen forward run is paper and labelled as such. It uses the
|
||||
score source supplied at CREATE time; if that source is the current board it
|
||||
is non-PIT and the run is tagged `non_pit=true`.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import datetime as dt
|
||||
import math
|
||||
import threading
|
||||
from copy import deepcopy
|
||||
from pathlib import Path
|
||||
from typing import Any, Optional
|
||||
from uuid import uuid4
|
||||
|
||||
FORWARD_SCHEMA_VERSION = 1
|
||||
|
||||
# lifecycle statuses in order
|
||||
_ORDER = ["frozen", "executed", "marked", "matured"]
|
||||
|
||||
|
||||
class ForwardError(ValueError):
|
||||
pass
|
||||
|
||||
|
||||
def _now() -> str:
|
||||
return dt.datetime.now(dt.timezone.utc).isoformat(timespec="seconds")
|
||||
|
||||
|
||||
class ForwardTestStore:
|
||||
"""Durable, thread-safe JSON store of forward-test runs."""
|
||||
|
||||
def __init__(self, path: Path | str | None = None) -> None:
|
||||
self.path = Path(path).resolve() if path else None
|
||||
self._runs: dict[str, dict] = {}
|
||||
self._lock = threading.Lock()
|
||||
if self.path and self.path.is_file():
|
||||
self._load()
|
||||
|
||||
# -- persistence ------------------------------------------------------
|
||||
def _load(self) -> None:
|
||||
try:
|
||||
payload = json.loads(self.path.read_text(encoding="utf-8"))
|
||||
except (OSError, json.JSONDecodeError) as exc:
|
||||
raise ForwardError(f"forward store unreadable: {exc}") from exc
|
||||
if not isinstance(payload, dict) or payload.get("schema_version") != FORWARD_SCHEMA_VERSION:
|
||||
raise ForwardError("unsupported forward store schema")
|
||||
self._runs = deepcopy(payload.get("runs", {}))
|
||||
|
||||
def _persist(self) -> None:
|
||||
if not self.path:
|
||||
return
|
||||
self.path.parent.mkdir(parents=True, exist_ok=True)
|
||||
payload = {"schema_version": FORWARD_SCHEMA_VERSION, "runs": self._runs}
|
||||
tmp = self.path.with_name(f".{self.path.name}.tmp")
|
||||
tmp.write_text(json.dumps(payload, ensure_ascii=False, sort_keys=True) + "\n", encoding="utf-8")
|
||||
tmp.replace(self.path)
|
||||
|
||||
# -- lifecycle --------------------------------------------------------
|
||||
def create(self, capital: float, frozen: dict[str, dict], as_of: str,
|
||||
non_pit: bool, note: str = "") -> dict:
|
||||
"""CREATE: persist an immutable frozen-signal run."""
|
||||
with self._lock:
|
||||
if capital <= 0:
|
||||
raise ForwardError("capital must be > 0")
|
||||
run_id = f"fwd_{uuid4().hex[:12]}"
|
||||
run = {
|
||||
"id": run_id,
|
||||
"created_at": _now(),
|
||||
"capital": capital,
|
||||
"status": "frozen",
|
||||
"as_of": as_of,
|
||||
"non_pit": bool(non_pit),
|
||||
"note": note,
|
||||
"frozen_signals": deepcopy(frozen),
|
||||
"execution_prices": {},
|
||||
"holdings": {},
|
||||
"invested": 0.0,
|
||||
"equity_history": [{"date": as_of, "equity": capital}],
|
||||
}
|
||||
self._runs[run_id] = run
|
||||
self._persist()
|
||||
return deepcopy(run)
|
||||
|
||||
def execute(self, run_id: str, execution_prices: dict[str, float]) -> dict:
|
||||
"""EXECUTE: fill the frozen signals at prices provided (post-freeze).
|
||||
|
||||
Uses the canonical 50/20/30 dividend allocation over the frozen
|
||||
combined scores (mirrors simulation.allocate_capital). Frozen signals
|
||||
are NOT re-readable/changeable here — only execution prices vary.
|
||||
"""
|
||||
with self._lock:
|
||||
run = self._runs.get(run_id)
|
||||
if run is None:
|
||||
raise ForwardError(f"unknown forward run: {run_id}")
|
||||
if run["status"] != "frozen":
|
||||
raise ForwardError("run already executed")
|
||||
from . import simulation as sim
|
||||
candidates = []
|
||||
for sym, meta in (run.get("frozen_signals") or {}).items():
|
||||
price = execution_prices.get(sym)
|
||||
if price is None or price <= 0:
|
||||
continue
|
||||
candidates.append(sim.Candidate(
|
||||
symbol=sym, price=price,
|
||||
combined_score=float(meta.get("combined", 0.0)),
|
||||
is_dividend=bool(meta.get("is_dividend")),
|
||||
dividend_yield=float(meta.get("dividend_yield") or 0.0),
|
||||
))
|
||||
alloc = sim.allocate_capital(run["capital"], candidates)
|
||||
holdings = {o.symbol: o.qty for o in alloc.orders}
|
||||
invested = alloc.invested
|
||||
run["status"] = "executed"
|
||||
run["execution_prices"] = {s: float(execution_prices.get(s, 0)) for s in holdings}
|
||||
run["holdings"] = holdings
|
||||
run["invested"] = invested
|
||||
run["equity_history"].append({"date": _now(), "equity": invested})
|
||||
self._persist()
|
||||
return deepcopy(run)
|
||||
|
||||
def mark(self, run_id: str, prices: dict[str, float]) -> dict:
|
||||
"""MARK: recompute equity at provided (latest) prices and append."""
|
||||
with self._lock:
|
||||
run = self._runs.get(run_id)
|
||||
if run is None:
|
||||
raise ForwardError(f"unknown forward run: {run_id}")
|
||||
if run["status"] not in ("executed", "marked"):
|
||||
raise ForwardError("run not executed yet")
|
||||
equity = run["capital"]
|
||||
for sym, qty in (run.get("holdings") or {}).items():
|
||||
px = prices.get(sym)
|
||||
if px is None:
|
||||
continue
|
||||
equity += qty * (px - run["execution_prices"].get(sym, 0))
|
||||
run["status"] = "marked"
|
||||
run["equity_history"].append({"date": _now(), "equity": round(equity, 2)})
|
||||
self._persist()
|
||||
return deepcopy(run)
|
||||
|
||||
def mature(self, run_id: str, final_prices: dict[str, float]) -> dict:
|
||||
"""MATURE: close the run at final prices, freeze the outcome."""
|
||||
with self._lock:
|
||||
run = self._runs.get(run_id)
|
||||
if run is None:
|
||||
raise ForwardError(f"unknown forward run: {run_id}")
|
||||
if run["status"] not in ("executed", "marked"):
|
||||
raise ForwardError("run cannot mature before execution")
|
||||
equity = run["capital"]
|
||||
for sym, qty in (run.get("holdings") or {}).items():
|
||||
px = final_prices.get(sym)
|
||||
if px is None:
|
||||
continue
|
||||
equity += qty * (px - run["execution_prices"].get(sym, 0))
|
||||
run["status"] = "matured"
|
||||
run["final_equity"] = round(equity, 2)
|
||||
run["net_return"] = round((equity - run["capital"]) / run["capital"], 4) if run["capital"] else 0.0
|
||||
run["equity_history"].append({"date": _now(), "equity": round(equity, 2)})
|
||||
self._persist()
|
||||
return deepcopy(run)
|
||||
|
||||
# -- reads ------------------------------------------------------------
|
||||
def get(self, run_id: str) -> Optional[dict]:
|
||||
run = self._runs.get(run_id)
|
||||
return deepcopy(run) if run else None
|
||||
|
||||
def list(self) -> list[dict]:
|
||||
return [deepcopy(run) for run in sorted(self._runs.values(), key=lambda r: r.get("created_at", ""))]
|
||||
@@ -1,8 +1,7 @@
|
||||
"""Capital-allocation simulation/backtest engine.
|
||||
"""Capital-allocation engine for the "จัดสรรทุน (Suggestion)" endpoint.
|
||||
|
||||
Reusable for both backtest (historical) and forward test (paper, no MT5 send) —
|
||||
the user asked these share one engine, differing only in whether an MT5 order is
|
||||
dispatched. Pure local research; never sends a real order.
|
||||
Pure local research; never sends a real order. This is a live recommendation
|
||||
on the current board (non-PIT) — forward-test mode was removed per the user.
|
||||
|
||||
Allocation rules (confirmed by the user, 2026-08-25):
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ class ApiTests(unittest.TestCase):
|
||||
db = self.client.get("/api/v1/dashboard").get_json()
|
||||
self.assertEqual({t["id"] for t in th["themes"]}, {t["id"] for t in db["themes"]})
|
||||
|
||||
def test_simulation_allocates_capital(self):
|
||||
def test_suggestion_allocates_capital(self):
|
||||
from unittest.mock import patch
|
||||
class _FakeAuto:
|
||||
def to_dict(self):
|
||||
@@ -100,10 +100,11 @@ class ApiTests(unittest.TestCase):
|
||||
"Q2/2026": {"net_profit": 8000.0, "ebitda": 9000.0, "sales": 120000.0}}}
|
||||
with patch("app.auto_credit.fetch_auto_credit", return_value=_FakeAuto()), \
|
||||
patch("app.energy_thai.fetch_energy_thai", return_value=_FakeEnergy()):
|
||||
resp = self.client.post("/api/v1/simulation", json={"capital": 500000, "mode": "backtest"})
|
||||
resp = self.client.post("/api/v1/suggestion", json={"capital": 500000})
|
||||
self.assertEqual(resp.status_code, 200)
|
||||
payload = resp.get_json()
|
||||
self.assertEqual(payload["capital"], 500000)
|
||||
self.assertEqual(payload["mode"], "suggestion")
|
||||
self.assertIn("orders", payload)
|
||||
self.assertIn("unallocated_cash", payload)
|
||||
# invested + unallocated == capital
|
||||
@@ -112,12 +113,12 @@ class ApiTests(unittest.TestCase):
|
||||
for order in payload["orders"]:
|
||||
self.assertEqual(order["qty"] % 100, 0)
|
||||
|
||||
def test_simulation_rejects_invalid_capital(self):
|
||||
resp = self.client.post("/api/v1/simulation", json={"capital": 0})
|
||||
def test_suggestion_rejects_invalid_capital(self):
|
||||
resp = self.client.post("/api/v1/suggestion", json={"capital": 0})
|
||||
self.assertEqual(resp.status_code, 400)
|
||||
resp2 = self.client.post("/api/v1/simulation", json={"capital": -5})
|
||||
resp2 = self.client.post("/api/v1/suggestion", json={"capital": -5})
|
||||
self.assertEqual(resp2.status_code, 400)
|
||||
resp3 = self.client.post("/api/v1/simulation", json={"capital": "abc"})
|
||||
resp3 = self.client.post("/api/v1/suggestion", json={"capital": "abc"})
|
||||
self.assertEqual(resp3.status_code, 400)
|
||||
|
||||
def test_health_reports_research_mode(self):
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
"""Tests for the forward-test frozen-signal paper lifecycle."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import tempfile
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
|
||||
from app.forward_test import ForwardError, ForwardTestStore
|
||||
|
||||
|
||||
def _frozen():
|
||||
return {
|
||||
"A": {"combined": 1.0, "is_dividend": True, "dividend_yield": 5.0},
|
||||
"B": {"combined": 0.8, "is_dividend": False, "dividend_yield": 0.0},
|
||||
}
|
||||
|
||||
|
||||
class ForwardTestStoreTest(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self._tmp = tempfile.TemporaryDirectory()
|
||||
self.path = Path(self._tmp.name) / "forward.json"
|
||||
self.store = ForwardTestStore(self.path)
|
||||
|
||||
def tearDown(self):
|
||||
self._tmp.cleanup()
|
||||
|
||||
def test_create_freezes_and_persists(self):
|
||||
run = self.store.create(1_000_000, _frozen(), as_of="2026-06-01", non_pit=True)
|
||||
self.assertEqual(run["status"], "frozen")
|
||||
self.assertEqual(run["capital"], 1_000_000)
|
||||
# reloaded from disk still has the frozen signals
|
||||
reloaded = ForwardTestStore(self.path)
|
||||
got = reloaded.get(run["id"])
|
||||
self.assertEqual(got["frozen_signals"]["A"]["combined"], 1.0)
|
||||
self.assertEqual(got["status"], "frozen")
|
||||
|
||||
def test_execute_fills_frozen_signals_at_provided_prices(self):
|
||||
run = self.store.create(100_000, _frozen(), as_of="2026-06-01", non_pit=True)
|
||||
prices = {"A": 10.0, "B": 20.0}
|
||||
ex = self.store.execute(run["id"], prices)
|
||||
self.assertEqual(ex["status"], "executed")
|
||||
# A is dividend (bucket1 50%, 50k/10=5000); B non-dividend (bucket2 20%, 20k/20=1000)
|
||||
self.assertEqual(ex["holdings"].get("A"), 5000)
|
||||
self.assertEqual(ex["holdings"].get("B"), 1000)
|
||||
|
||||
def test_mark_changes_equity_with_prices(self):
|
||||
run = self.store.create(100_000, _frozen(), as_of="2026-06-01", non_pit=True)
|
||||
ex = self.store.execute(run["id"], {"A": 10.0, "B": 20.0})
|
||||
# B rises 20 -> 22 => +1000*2 = +2000
|
||||
marked = self.store.mark(run["id"], {"A": 10.0, "B": 22.0})
|
||||
last_equity = marked["equity_history"][-1]["equity"]
|
||||
self.assertEqual(last_equity, 100_000 + 2_000)
|
||||
|
||||
def test_mature_computes_net_return(self):
|
||||
run = self.store.create(100_000, _frozen(), as_of="2026-06-01", non_pit=True)
|
||||
self.store.execute(run["id"], {"A": 10.0, "B": 20.0})
|
||||
matured = self.store.mature(run["id"], {"A": 10.0, "B": 22.0})
|
||||
self.assertEqual(matured["status"], "matured")
|
||||
self.assertAlmostEqual(matured["final_equity"], 102_000.0, places=2)
|
||||
self.assertAlmostEqual(matured["net_return"], 0.02, places=4)
|
||||
|
||||
def test_frozen_signals_cannot_be_re_frozen_on_execute(self):
|
||||
run = self.store.create(100_000, _frozen(), as_of="2026-06-01", non_pit=True)
|
||||
self.store.execute(run["id"], {"A": 10.0, "B": 20.0})
|
||||
# a second execute must fail (lifecycle - signals already locked)
|
||||
with self.assertRaises(ForwardError):
|
||||
self.store.execute(run["id"], {"A": 11.0, "B": 20.0})
|
||||
|
||||
def test_execute_before_create_unknown_run(self):
|
||||
with self.assertRaises(ForwardError):
|
||||
self.store.execute("fwd_nope", {"A": 10.0})
|
||||
|
||||
def test_double_mark_allowed_and_appends(self):
|
||||
run = self.store.create(100_000, _frozen(), as_of="2026-06-01", non_pit=True)
|
||||
self.store.execute(run["id"], {"A": 10.0, "B": 20.0})
|
||||
self.store.mark(run["id"], {"A": 10.0, "B": 21.0})
|
||||
self.store.mark(run["id"], {"A": 10.0, "B": 22.0})
|
||||
marked = self.store.get(run["id"])
|
||||
self.assertEqual(marked["status"], "marked")
|
||||
# init + execute + 2 marks = 4 entries
|
||||
self.assertEqual(len(marked["equity_history"]), 4)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))n(l);new MutationObserver(l=>{for(const i of l)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&n(r)}).observe(document,{childList:!0,subtree:!0});function s(l){const i={};return l.integrity&&(i.integrity=l.integrity),l.referrerPolicy&&(i.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?i.credentials="include":l.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(l){if(l.ep)return;l.ep=!0;const i=s(l);fetch(l.href,i)}})();/**
|
||||
* @vue/shared v3.5.41
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/function mn(e){const t=Object.create(null);for(const s of e.split(","))t[s]=1;return s=>s in t}const Z={},Ft=[],We=()=>{},_l=()=>!1,Fs=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Ds=e=>e.startsWith("onUpdate:"),me=Object.assign,bn=(e,t)=>{const s=e.indexOf(t);s>-1&&e.splice(s,1)},Oi=Object.prototype.hasOwnProperty,G=(e,t)=>Oi.call(e,t),N=Array.isArray,Dt=e=>ls(e)==="[object Map]",Ls=e=>ls(e)==="[object Set]",jn=e=>ls(e)==="[object Date]",j=e=>typeof e=="function",re=e=>typeof e=="string",ze=e=>typeof e=="symbol",X=e=>e!==null&&typeof e=="object",ml=e=>(X(e)||j(e))&&j(e.then)&&j(e.catch),bl=Object.prototype.toString,ls=e=>bl.call(e),Pi=e=>ls(e).slice(8,-1),yl=e=>ls(e)==="[object Object]",yn=e=>re(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,qt=mn(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),$s=e=>{const t=Object.create(null);return(s=>t[s]||(t[s]=e(s)))},Ai=/-\w/g,Ie=$s(e=>e.replace(Ai,t=>t.slice(1).toUpperCase())),Ri=/\B([A-Z])/g,kt=$s(e=>e.replace(Ri,"-$1").toLowerCase()),xl=$s(e=>e.charAt(0).toUpperCase()+e.slice(1)),Js=$s(e=>e?`on${xl(e)}`:""),Ue=(e,t)=>!Object.is(e,t),Ss=(e,...t)=>{for(let s=0;s<e.length;s++)e[s](...t)},Sl=(e,t,s,n=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:n,value:s})},xn=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Hn;const Ns=()=>Hn||(Hn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function js(e){if(N(e)){const t={};for(let s=0;s<e.length;s++){const n=e[s],l=re(n)?Di(n):js(n);if(l)for(const i in l)t[i]=l[i]}return t}else if(re(e)||X(e))return e}const Mi=/;(?![^(]*\))/g,Ii=/:([^]+)/,Fi=/\/\*[^]*?\*\//g;function Di(e){const t={};return e.replace(Fi,"").split(Mi).forEach(s=>{if(s){const n=s.split(Ii);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function ne(e){let t="";if(re(e))t=e;else if(N(e))for(let s=0;s<e.length;s++){const n=ne(e[s]);n&&(t+=n+" ")}else if(X(e))for(const s in e)e[s]&&(t+=s+" ");return t.trim()}const Li="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",$i=mn(Li);function wl(e){return!!e||e===""}function Ni(e,t){if(e.length!==t.length)return!1;let s=!0;for(let n=0;s&&n<e.length;n++)s=is(e[n],t[n]);return s}function is(e,t){if(e===t)return!0;let s=jn(e),n=jn(t);if(s||n)return s&&n?e.getTime()===t.getTime():!1;if(s=ze(e),n=ze(t),s||n)return e===t;if(s=N(e),n=N(t),s||n)return s&&n?Ni(e,t):!1;if(s=X(e),n=X(t),s||n){if(!s||!n)return!1;const l=Object.keys(e).length,i=Object.keys(t).length;if(l!==i)return!1;for(const r in e){const a=e.hasOwnProperty(r),u=t.hasOwnProperty(r);if(a&&!u||!a&&u||!is(e[r],t[r]))return!1}}return String(e)===String(t)}function Cl(e,t){return e.findIndex(s=>is(s,t))}const Tl=e=>!!(e&&e.__v_isRef===!0),m=e=>re(e)?e:e==null?"":N(e)||X(e)&&(e.toString===bl||!j(e.toString))?Tl(e)?m(e.value):JSON.stringify(e,kl,2):String(e),kl=(e,t)=>Tl(t)?kl(e,t.value):Dt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((s,[n,l],i)=>(s[Ys(n,i)+" =>"]=l,s),{})}:Ls(t)?{[`Set(${t.size})`]:[...t.values()].map(s=>Ys(s))}:ze(t)?Ys(t):X(t)&&!N(t)&&!yl(t)?String(t):t,Ys=(e,t="")=>{var s;return ze(e)?`Symbol(${(s=e.description)!=null?s:t})`:e};/**
|
||||
* @vue/reactivity v3.5.41
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/let de;class ji{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&de&&(de.active?(this.parent=de,this.index=(de.scopes||(de.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,s;if(this.scopes){const n=this.scopes.slice();for(t=0,s=n.length;t<s;t++)n[t].pause()}for(t=0,s=this.effects.length;t<s;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,s;if(this.scopes){const l=this.scopes.slice();for(t=0,s=l.length;t<s;t++)l[t].resume()}const n=this.effects.slice();for(t=0,s=n.length;t<s;t++)n[t].resume()}}run(t){if(this._active){const s=de;try{return de=this,t()}finally{de=s}}}on(){++this._on===1&&(this.prevScope=de,de=this)}off(){if(this._on>0&&--this._on===0){if(de===this)de=this.prevScope;else{let t=de;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let s,n;for(s=0,n=this.effects.length;s<n;s++)this.effects[s].stop();for(this.effects.length=0,s=0,n=this.cleanups.length;s<n;s++)this.cleanups[s]();if(this.cleanups.length=0,this.scopes){const l=this.scopes.slice();for(s=0,n=l.length;s<n;s++)l[s].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const l=this.parent.scopes.pop();l&&l!==this&&(this.parent.scopes[this.index]=l,l.index=this.index)}this.parent=void 0}}}function Hi(){return de}let Q;const Xs=new WeakSet;class El{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,de&&(de.active?de.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Xs.has(this)&&(Xs.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Pl(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Vn(this),Al(this);const t=Q,s=Fe;Q=this,Fe=!0;try{return this.fn()}finally{Rl(this),Q=t,Fe=s,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Cn(t);this.deps=this.depsTail=void 0,Vn(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Xs.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){an(this)&&this.run()}get dirty(){return an(this)}}let Ol=0,zt,Gt;function Pl(e,t=!1){if(e.flags|=8,t){e.next=Gt,Gt=e;return}e.next=zt,zt=e}function Sn(){Ol++}function wn(){if(--Ol>0)return;if(Gt){let t=Gt;for(Gt=void 0;t;){const s=t.next;t.next=void 0,t.flags&=-9,t=s}}let e;for(;zt;){let t=zt;for(zt=void 0;t;){const s=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(n){e||(e=n)}t=s}}if(e)throw e}function Al(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Rl(e){let t,s=e.depsTail,n=s;for(;n;){const l=n.prevDep;n.version===-1?(n===s&&(s=l),Cn(n),Vi(n)):t=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=l}e.deps=t,e.depsTail=s}function an(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Ml(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Ml(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Zt)||(e.globalVersion=Zt,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!an(e))))return;e.flags|=2;const t=e.dep,s=Q,n=Fe;Q=e,Fe=!0;try{Al(e);const l=e.fn(e._value);(t.version===0||Ue(l,e._value))&&(e.flags|=128,e._value=l,t.version++)}catch(l){throw t.version++,l}finally{Q=s,Fe=n,Rl(e),e.flags&=-3}}function Cn(e,t=!1){const{dep:s,prevSub:n,nextSub:l}=e;if(n&&(n.nextSub=l,e.prevSub=void 0),l&&(l.prevSub=n,e.nextSub=void 0),s.subs===e&&(s.subs=n,!n&&s.computed)){s.computed.flags&=-5;for(let i=s.computed.deps;i;i=i.nextDep)Cn(i,!0)}!t&&!--s.sc&&s.map&&s.map.delete(s.key)}function Vi(e){const{prevDep:t,nextDep:s}=e;t&&(t.nextDep=s,e.prevDep=void 0),s&&(s.prevDep=t,e.nextDep=void 0)}let Fe=!0;const Il=[];function it(){Il.push(Fe),Fe=!1}function ot(){const e=Il.pop();Fe=e===void 0?!0:e}function Vn(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const s=Q;Q=void 0;try{t()}finally{Q=s}}}let Zt=0;class Bi{constructor(t,s){this.sub=t,this.dep=s,this.version=s.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Tn{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!Q||!Fe||Q===this.computed)return;let s=this.activeLink;if(s===void 0||s.sub!==Q)s=this.activeLink=new Bi(Q,this),Q.deps?(s.prevDep=Q.depsTail,Q.depsTail.nextDep=s,Q.depsTail=s):Q.deps=Q.depsTail=s,Fl(s);else if(s.version===-1&&(s.version=this.version,s.nextDep)){const n=s.nextDep;n.prevDep=s.prevDep,s.prevDep&&(s.prevDep.nextDep=n),s.prevDep=Q.depsTail,s.nextDep=void 0,Q.depsTail.nextDep=s,Q.depsTail=s,Q.deps===s&&(Q.deps=n)}return s}trigger(t){thLine truncated
|
||||
* @vue/runtime-core v3.5.41
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/function os(e,t,s,n){try{return n?e(...n):e()}catch(l){Vs(l,t,s)}}function Le(e,t,s,n){if(j(e)){const l=os(e,t,s,n);return l&&ml(l)&&l.catch(i=>{Vs(i,t,s)}),l}if(N(e)){const l=[];for(let i=0;i<e.length;i++)l.push(Le(e[i],t,s,n));return l}}function Vs(e,t,s,n=!0){const l=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||Z;if(t){let a=t.parent;const u=t.proxy,p=`https://vuejs.org/error-reference/#runtime-${s}`;for(;a;){const h=a.ec;if(h){for(let y=0;y<h.length;y++)if(h[y](e,u,p)===!1)return}a=a.parent}if(i){it(),os(i,null,10,[e,u,p]),ot();return}}go(e,s,l,n,r)}function go(e,t,s,n=!0,l=!1){if(l)throw e;console.error(e)}const xe=[];let Ve=-1;const Lt=[];let dt=null,It=0;const Bl=Promise.resolve();let Es=null;function vo(e){const t=Es||Bl;return e?t.then(this?e.bind(this):e):t}function _o(e){let t=Ve+1,s=xe.length;for(;t<s;){const n=t+s>>>1,l=xe[n],i=es(l);i<e||i===e&&l.flags&2?t=n+1:s=n}return t}function An(e){if(!(e.flags&1)){const t=es(e),s=xe[xe.length-1];!s||!(e.flags&2)&&t>=es(s)?xe.push(e):xe.splice(_o(t),0,e),e.flags|=1,Kl()}}function Kl(){Es||(Es=Bl.then(Wl))}function mo(e){if(!N(e))dt&&e.id===-1?dt.splice(It+1,0,e):e.flags&1||(Lt.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)Lt.push(e[t]);Kl()}function Kn(e,t,s=Ve+1){for(;s<xe.length;s++){const n=xe[s];if(n&&n.flags&2){if(e&&n.id!==e.uid)continue;xe.splice(s,1),s--,n.flags&4&&(n.flags&=-2),n(),n.flags&4||(n.flags&=-2)}}}function Ul(e){if(Lt.length){const t=[...new Set(Lt)].sort((s,n)=>es(s)-es(n));if(Lt.length=0,dt){for(let s=0;s<t.length;s++)dt.push(t[s]);return}for(dt=t,It=0;It<dt.length;It++){const s=dt[It];s.flags&4&&(s.flags&=-2),s.flags&8||s(),s.flags&=-2}dt=null,It=0}}const es=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Wl(e){try{for(Ve=0;Ve<xe.length;Ve++){const t=xe[Ve];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),os(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Ve<xe.length;Ve++){const t=xe[Ve];t&&(t.flags&=-2)}Ve=-1,xe.length=0,Ul(),Es=null,(xe.length||Lt.length)&&Wl()}}let Re=null,ql=null;function Os(e){const t=Re;return Re=e,ql=e&&e.type.__scopeId||null,t}function bo(e,t=Re,s){if(!t||e._n)return e;const n=(...l)=>{n._d&&el(-1);const i=Os(t),r=Tt.length;let a;try{a=e(...l)}finally{for(let u=Tt.length;u>r;u--)_i();Os(i),n._d&&el(1)}return a};return n._n=!0,n._c=!0,n._d=!0,n}function Mt(e,t){if(Re===null)return e;const s=qs(Re),n=e.dirs||(e.dirs=[]);for(let l=0;l<t.length;l++){let[i,r,a,u=Z]=t[l];i&&(j(i)&&(i={mounted:i,updated:i}),i.deep&<(r),n.push({dir:i,instance:s,value:r,oldValue:void 0,arg:a,modifiers:u}))}return e}function mt(e,t,s,n){const l=e.dirs,i=t&&t.dirs;for(let r=0;r<l.length;r++){const a=l[r];i&&(a.oldValue=i[r].value);let u=a.dir[n];u&&(it(),Le(u,s,8,[e.el,a,e,t]),ot())}}function yo(e,t){if(Se){let s=Se.provides;const n=Se.parent&&Se.parent.provides;n===s&&(s=Se.provides=Object.create(n)),s[e]=t}}function ws(e,t,s=!1){const n=mr();if(n||$t){let l=$t?$t._context.provides:n?n.parent==null||n.ce?n.vnode.appContext&&n.vnode.appContext.provides:n.parent.provides:void 0;if(l&&e in l)return l[e];if(arguments.length>1)return s&&j(t)?t.call(n&&n.proxy):t}}const xo=Symbol.for("v-scx"),So=()=>ws(xo);function en(e,t,s){return zl(e,t,s)}function zl(e,t,s=Z){const{immediate:n,deep:l,flush:i,once:r}=s,a=me({},s),u=t&&n||!t&&i!=="post";let p;if(ns){if(i==="sync"){const M=So();p=M.__watcherHandles||(M.__watcherHandles=[])}else if(!u){const M=()=>{};return M.stop=We,M.resume=We,M.pause=We,M}}const h=Se;a.call=(M,K,A)=>Le(M,h,K,A);let y=!1;i==="post"?a.scheduler=M=>{we(M,h&&h.suspense)}:i!=="sync"&&(y=!0,a.scheduler=(M,K)=>{K?M():An(M)}),a.augmentJob=M=>{t&&(M.flags|=4),y&&(M.flags|=2,h&&(M.id=h.uid,M.i=h))};const R=po(e,t,a);return ns&&(p?p.push(R):u&&R()),R}function wo(e,t,s){const n=this.proxy,l=re(e)?e.includes(".")?Gl(n,e):()=>n[e]:e.bind(n,n);let i;j(t)?i=t:(i=t.handler,s=t);const r=rs(this),a=zl(l,i.bind(n),s);return r(),a}function Gl(e,t){const s=t.split(".");return()=>{let n=e;for(let l=0;l<s.length&&n;l++)n=n[s[l]];return n}}const Co=Symbol("_vte"),Bs=e=>e.__isTeleport,tn=Symbol("_leaveCb");function To(e){let t=e[0];if(e.length>1){for(const s of e)if(s.type!==at){t=s;break}}return t}function Jl(e){if(!Mn(e))return Bs(e.type)&&e.children?To(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:s}=e;if(s){if(t&16)return s[0];if(t&32&&j(s.default))return s.default()}}function Rn(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const s=e.component.subTree;Rn(Bs(s.type)&&Jl(s)||s,t)}else e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Yl(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Un(e,t){let s;return!!((s=Object.getOwnPropertyDescriptor(e,t))&&!s.configurable)}const Ps=new WeakMap;function Jt(e,t,s,n,l=!1){if(N(e)){e.forEach((A,ee)=>Jt(A,t&&(N(t)?t[ee]:t),s,n,l));return}if(Yt(n)&&!l){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&Jt(e,t
Line truncated
|
||||
* @vue/runtime-dom v3.5.41
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/let _n;const nl=typeof window<"u"&&window.trustedTypes;if(nl)try{_n=nl.createPolicy("vue",{createHTML:e=>e})}catch{}const wi=_n?e=>_n.createHTML(e):e=>e,Tr="http://www.w3.org/2000/svg",kr="http://www.w3.org/1998/Math/MathML",tt=typeof document<"u"?document:null,ll=tt&&tt.createElement("template"),Er={insert:(e,t,s)=>{t.insertBefore(e,s||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,s,n)=>{const l=t==="svg"?tt.createElementNS(Tr,e):t==="mathml"?tt.createElementNS(kr,e):s?tt.createElement(e,{is:s}):tt.createElement(e);return e==="select"&&n&&n.multiple!=null&&l.setAttribute("multiple",n.multiple),l},createText:e=>tt.createTextNode(e),createComment:e=>tt.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>tt.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,s,n,l,i){const r=s?s.previousSibling:t.lastChild;if(l&&(l===i||l.nextSibling))for(;t.insertBefore(l.cloneNode(!0),s),!(l===i||!(l=l.nextSibling)););else{ll.innerHTML=wi(n==="svg"?`<svg>${e}</svg>`:n==="mathml"?`<math>${e}</math>`:e);const a=ll.content;if(n==="svg"||n==="mathml"){const u=a.firstChild;for(;u.firstChild;)a.appendChild(u.firstChild);a.removeChild(u)}t.insertBefore(a,s)}return[r?r.nextSibling:t.firstChild,s?s.previousSibling:t.lastChild]}},Or=Symbol("_vtc");function Pr(e,t,s){const n=e[Or];n&&(t=(t?[t,...n]:[...n]).join(" ")),t==null?e.removeAttribute("class"):s?e.setAttribute("class",t):e.className=t}const il=Symbol("_vod"),Ar=Symbol("_vsh"),Rr=Symbol(""),Mr=/(?:^|;)\s*display\s*:/;function Ir(e,t,s){const n=e.style,l=re(s);let i=!1;if(s&&!l){if(t)if(re(t))for(const r of t.split(";")){const a=r.slice(0,r.indexOf(":")).trim();s[a]==null&&Wt(n,a,"")}else for(const r in t)s[r]==null&&Wt(n,r,"");for(const r in s){r==="display"&&(i=!0);const a=s[r];a!=null?Dr(e,r,!re(t)&&t?t[r]:void 0,a)||Wt(n,r,a):Wt(n,r,"")}}else if(l){if(t!==s){const r=n[Rr];r&&(s+=";"+r),n.cssText=s,i=Mr.test(s)}}else t&&e.removeAttribute("style");il in e&&(e[il]=i?n.display:"",e[Ar]&&(n.display="none"))}const ol=/\s*!important$/;function Wt(e,t,s){if(N(s))s.forEach(n=>Wt(e,t,n));else if(s==null&&(s=""),t.startsWith("--"))e.setProperty(t,s);else{const n=Fr(e,t);ol.test(s)?e.setProperty(kt(n),s.replace(ol,""),"important"):e[n]=s}}const rl=["Webkit","Moz","ms"],ln={};function Fr(e,t){const s=ln[t];if(s)return s;let n=Ie(t);if(n!=="filter"&&n in e)return ln[t]=n;n=xl(n);for(let l=0;l<rl.length;l++){const i=rl[l]+n;if(i in e)return ln[t]=i}return t}function Dr(e,t,s,n){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&re(n)&&s===n}const al="http://www.w3.org/1999/xlink";function cl(e,t,s,n,l,i=$i(t)){n&&t.startsWith("xlink:")?s==null?e.removeAttributeNS(al,t.slice(6,t.length)):e.setAttributeNS(al,t,s):s==null||i&&!wl(s)?e.removeAttribute(t):e.setAttribute(t,i?"":ze(s)?String(s):s)}function ul(e,t,s,n,l){if(t==="innerHTML"||t==="textContent"){s!=null&&(e[t]=t==="innerHTML"?wi(s):s);return}const i=e.tagName;if(t==="value"&&i!=="PROGRESS"&&!i.includes("-")){const a=i==="OPTION"?e.getAttribute("value")||"":e.value,u=s==null?e.type==="checkbox"?"on":"":String(s);(a!==u||!("_value"in e))&&(e.value=u),s==null&&e.removeAttribute(t),e._value=s;return}let r=!1;if(s===""||s==null){const a=typeof e[t];a==="boolean"?s=wl(s):s==null&&a==="string"?(s="",r=!0):a==="number"&&(s=0,r=!0)}try{e[t]=s}catch{}r&&e.removeAttribute(l||t)}function xt(e,t,s,n){e.addEventListener(t,s,n)}function Lr(e,t,s,n){e.removeEventListener(t,s,n)}const fl=Symbol("_vei");function $r(e,t,s,n,l=null){const i=e[fl]||(e[fl]={}),r=i[t];if(n&&r)r.value=n;else{const[a,u]=Hr(t);if(n){const p=i[t]=Kr(n,l);xt(e,a,p,u)}else r&&(Lr(e,a,r,u),i[t]=void 0)}}const Nr=/(Once|Passive|Capture)$/,jr=/^on:?(?:Once|Passive|Capture)$/;function Hr(e){let t,s;for(;(s=e.match(Nr))&&!jr.test(e);)t||(t={}),e=e.slice(0,e.length-s[1].length),t[s[1].toLowerCase()]=!0;return[e[2]===":"?e.slice(3):kt(e.slice(2)),t]}let on=0;const Vr=Promise.resolve(),Br=()=>on||(Vr.then(()=>on=0),on=Date.now());function Kr(e,t){const s=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=s.attached)return;const l=s.value;if(N(l)){const i=n.stopImmediatePropagation;n.stopImmediatePropagation=()=>{i.call(n),n._stopped=!0};const r=l.slice(),a=[n];for(let u=0;u<r.length&&!n._stopped;u++){const p=r[u];p&&Le(p,t,5,a)}}else Le(l,t,5,[n])};return s.value=e,s.attached=Br(),s}const dl=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Ur=(e,t,s,n,l,i)=>{const r=l==="svg";t==="class"?Pr(e,n,r):t==="style"?Ir(e,s,n):Fs(t)?Ds(t)||$r(e,t,s,n,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Wr(e,t,n,r))?(ul(e,t,n),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&cl(e,t,n,r,i,t!=="value")):e._isVueCE&&(qr(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!re(n)))?ul(e,Ie(t),n,i,t):(t==="true-value"?e._trueValue=n:t==="false-value"&&(e._fals
Line truncated
|
||||
`))),e[St]=Is(l);const i=n||l.props&&l.props.type==="number";xt(e,t?"change":"input",r=>{r.target.composing||e[St](rn(e.value,s,i))}),(s||i)&&xt(e,"change",()=>{e.value=rn(e.value,s,i)}),t||(xt(e,"compositionstart",zr),xt(e,"compositionend",hl),xt(e,"change",hl))},mounted(e,{value:t,modifiers:{trim:s,number:n}}){const l=t??"",i=e[ys];delete e[ys],i!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==i?e[St](rn(e.value,s,n)):e.value=l},beforeUpdate(e,{value:t,oldValue:s,modifiers:{lazy:n,trim:l,number:i}},r){if(e[St]=Is(r),e.composing)return;const a=(i||e.type==="number")&&!/^0\d/.test(e.value)?xn(e.value):e.value,u=t??"";if(a===u)return;const p=e.getRootNode();(p instanceof Document||p instanceof ShadowRoot)&&p.activeElement===e&&e.type!=="range"&&(n&&t===s||l&&e.value.trim()===u)||(e.value=u)}},pl={deep:!0,created(e,t,s){e[St]=Is(s),xt(e,"change",()=>{const n=e._modelValue,l=Gr(e),i=e.checked,r=e[St];if(N(n)){const a=Cl(n,l),u=a!==-1;if(i&&!u)r(n.concat(l));else if(!i&&u){const p=[...n];p.splice(a,1),r(p)}}else if(Ls(n)){const a=new Set(n);i?a.add(l):a.delete(l),r(a)}else r(Ci(e,i))})},mounted:gl,beforeUpdate(e,t,s){e[St]=Is(s),gl(e,t,s)}};function gl(e,{value:t,oldValue:s},n){e._modelValue=t;let l;if(N(t))l=Cl(t,n.props.value)>-1;else if(Ls(t))l=t.has(n.props.value);else{if(t===s)return;l=is(t,Ci(e,!0))}e.checked!==l&&(e.checked=l)}function Gr(e){return"_value"in e?e._value:e.value}function Ci(e,t){const s=t?"_trueValue":"_falseValue";return s in e?e[s]:t}const Jr=["ctrl","shift","alt","meta"],Yr={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Jr.some(s=>e[`${s}Key`]&&!t.includes(s))},Xr=(e,t)=>{if(!e)return e;const s=e._withMods||(e._withMods={}),n=t.join(".");return s[n]||(s[n]=((l,...i)=>{for(let r=0;r<t.length;r++){const a=Yr[t[r]];if(a&&a(l,t))return}return e(l,...i)}))},Zr=me({patchProp:Ur},Er);let vl;function Qr(){return vl||(vl=ir(Zr))}const ea=((...e)=>{const t=Qr().createApp(...e),{mount:s}=t;return t.mount=n=>{const l=sa(n);if(!l)return;const i=t._component;!j(i)&&!i.render&&!i.template&&(i.template=l.innerHTML),l.nodeType===1&&(l.textContent="");const r=s(l,!1,ta(l));return l instanceof Element&&(l.removeAttribute("v-cloak"),l.setAttribute("data-v-app","")),r},t});function ta(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function sa(e){return re(e)?document.querySelector(e):e}const na={class:"app-shell"},la={class:"content",id:"overview"},ia={class:"topbar"},oa={class:"topbar-meta"},ra={class:"as-of"},aa={key:0,class:"state-card"},ca={key:1,class:"state-card error-state"},ua={class:"kpi-grid","aria-label":"Signal summary"},fa={class:"kpi-card accent-card"},da={class:"kpi-value"},ha={class:"kpi-foot"},pa={class:"long-count"},ga={class:"short-count"},va={class:"neutral-count"},_a={class:"kpi-card"},ma={class:"kpi-value"},ba={class:"kpi-foot"},ya={class:"panel theme-panel",id:"themes"},xa={class:"panel-header signal-header"},Sa={class:"status-tag"},wa={class:"theme-grid"},Ca={class:"theme-card-head"},Ta={class:"theme-chip"},ka={class:"theme-label-th"},Ea={class:"theme-surprise"},Oa={class:"theme-surprise-value"},Pa={class:"theme-read"},Aa={key:0,class:"theme-read-value"},Ra={key:1,class:"theme-read-value"},Ma={key:2,class:"theme-read-value"},Ia={key:3,class:"theme-read-value"},Fa={key:0,class:"theme-narrative"},Da={key:0,class:"macro-panel"},La={class:"macro-chips"},$a={class:"macro-chip"},Na={class:"macro-chip"},ja={class:"macro-chip"},Ha={class:"macro-chip"},Va={class:"macro-chip"},Ba={class:"panel stock-panel",id:"stocks"},Ka={class:"panel-header signal-header"},Ua={class:"stock-controls"},Wa={class:"toggle-filter"},qa={key:0,class:"empty-research"},za={key:1,class:"table-wrap"},Ga={class:"factor-table"},Ja=["onClick"],Ya={key:1,class:"muted-cell"},Xa={class:"combined-cell"},Za={class:"symbol-name"},Qa={key:0,class:"muted-cell"},ec={class:"score-cell"},tc={key:0,class:"dividend-dot",title:"จ่ายปันผล"},sc={class:"panel lineage-panel",id:"lineage"},nc={class:"panel-header signal-header"},lc={class:"status-tag"},ic={class:"table-wrap"},oc={class:"source-table"},rc={class:"source-name"},ac={class:"muted-cell"},cc={class:"muted-cell"},uc={class:"muted-cell"},fc={class:"muted-cell"},dc={class:"panel health-panel",id:"health"},hc={key:0,class:"empty-research muted-cell"},pc={key:1},gc={class:"source-table"},vc={class:"source-name"},_c={class:"muted-cell",style:{"font-size":"11px"}},mc={key:0,class:"status-tag",style:{background:"#1a7f37",color:"#fff"}},bc={key:1,class:"status-tag warning-tag"},yc={key:0,class:"muted-cell",style:{"font-size":"11px","word-break":"break-word"}},xc={class:"muted-cell"},Sc=["onClick"],wc={class:"panel sim-panel",id:"suggestion"},Cc={
Line truncated
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))n(l);new MutationObserver(l=>{for(const i of l)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&n(r)}).observe(document,{childList:!0,subtree:!0});function s(l){const i={};return l.integrity&&(i.integrity=l.integrity),l.referrerPolicy&&(i.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?i.credentials="include":l.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(l){if(l.ep)return;l.ep=!0;const i=s(l);fetch(l.href,i)}})();/**
|
||||
* @vue/shared v3.5.41
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/function bn(e){const t=Object.create(null);for(const s of e.split(","))t[s]=1;return s=>s in t}const ee={},Dt=[],Ge=()=>{},xl=()=>!1,$s=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Ls=e=>e.startsWith("onUpdate:"),_e=Object.assign,yn=(e,t)=>{const s=e.indexOf(t);s>-1&&e.splice(s,1)},Li=Object.prototype.hasOwnProperty,Y=(e,t)=>Li.call(e,t),L=Array.isArray,$t=e=>cs(e)==="[object Map]",Bt=e=>cs(e)==="[object Set]",Bn=e=>cs(e)==="[object Date]",j=e=>typeof e=="function",re=e=>typeof e=="string",Xe=e=>typeof e=="symbol",Z=e=>e!==null&&typeof e=="object",wl=e=>(Z(e)||j(e))&&j(e.then)&&j(e.catch),Sl=Object.prototype.toString,cs=e=>Sl.call(e),Ni=e=>cs(e).slice(8,-1),Cl=e=>cs(e)==="[object Object]",xn=e=>re(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Yt=bn(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ns=e=>{const t=Object.create(null);return(s=>t[s]||(t[s]=e(s)))},ji=/-\w/g,Fe=Ns(e=>e.replace(ji,t=>t.slice(1).toUpperCase())),Vi=/\B([A-Z])/g,Rt=Ns(e=>e.replace(Vi,"-$1").toLowerCase()),kl=Ns(e=>e.charAt(0).toUpperCase()+e.slice(1)),Ys=Ns(e=>e?`on${kl(e)}`:""),ze=(e,t)=>!Object.is(e,t),ks=(e,...t)=>{for(let s=0;s<e.length;s++)e[s](...t)},Tl=(e,t,s,n=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:n,value:s})},js=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Kn;const Vs=()=>Kn||(Kn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Hs(e){if(L(e)){const t={};for(let s=0;s<e.length;s++){const n=e[s],l=re(n)?Ui(n):Hs(n);if(l)for(const i in l)t[i]=l[i]}return t}else if(re(e)||Z(e))return e}const Hi=/;(?![^(]*\))/g,Bi=/:([^]+)/,Ki=/\/\*[^]*?\*\//g;function Ui(e){const t={};return e.replace(Ki,"").split(Hi).forEach(s=>{if(s){const n=s.split(Bi);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function Q(e){let t="";if(re(e))t=e;else if(L(e))for(let s=0;s<e.length;s++){const n=Q(e[s]);n&&(t+=n+" ")}else if(Z(e))for(const s in e)e[s]&&(t+=s+" ");return t.trim()}const Wi="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",qi=bn(Wi);function El(e){return!!e||e===""}function zi(e,t){if(e.length!==t.length)return!1;let s=!0;for(let n=0;s&&n<e.length;n++)s=Kt(e[n],t[n]);return s}function Kt(e,t){if(e===t)return!0;let s=Bn(e),n=Bn(t);if(s||n)return s&&n?e.getTime()===t.getTime():!1;if(s=Xe(e),n=Xe(t),s||n)return e===t;if(s=L(e),n=L(t),s||n)return s&&n?zi(e,t):!1;if(s=Z(e),n=Z(t),s||n){if(!s||!n)return!1;const l=Object.keys(e).length,i=Object.keys(t).length;if(l!==i)return!1;for(const r in e){const a=e.hasOwnProperty(r),u=t.hasOwnProperty(r);if(a&&!u||!a&&u||!Kt(e[r],t[r]))return!1}}return String(e)===String(t)}function wn(e,t){return e.findIndex(s=>Kt(s,t))}const Ol=e=>!!(e&&e.__v_isRef===!0),_=e=>re(e)?e:e==null?"":L(e)||Z(e)&&(e.toString===Sl||!j(e.toString))?Ol(e)?_(e.value):JSON.stringify(e,Pl,2):String(e),Pl=(e,t)=>Ol(t)?Pl(e,t.value):$t(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((s,[n,l],i)=>(s[Xs(n,i)+" =>"]=l,s),{})}:Bt(t)?{[`Set(${t.size})`]:[...t.values()].map(s=>Xs(s))}:Xe(t)?Xs(t):Z(t)&&!L(t)&&!Cl(t)?String(t):t,Xs=(e,t="")=>{var s;return Xe(e)?`Symbol(${(s=e.description)!=null?s:t})`:e};/**
|
||||
* @vue/reactivity v3.5.41
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/let pe;class Ji{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&pe&&(pe.active?(this.parent=pe,this.index=(pe.scopes||(pe.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,s;if(this.scopes){const n=this.scopes.slice();for(t=0,s=n.length;t<s;t++)n[t].pause()}for(t=0,s=this.effects.length;t<s;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,s;if(this.scopes){const l=this.scopes.slice();for(t=0,s=l.length;t<s;t++)l[t].resume()}const n=this.effects.slice();for(t=0,s=n.length;t<s;t++)n[t].resume()}}run(t){if(this._active){const s=pe;try{return pe=this,t()}finally{pe=s}}}on(){++this._on===1&&(this.prevScope=pe,pe=this)}off(){if(this._on>0&&--this._on===0){if(pe===this)pe=this.prevScope;else{let t=pe;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let s,n;for(s=0,n=this.effects.length;s<n;s++)this.effects[s].stop();for(this.effects.length=0,s=0,n=this.cleanups.length;s<n;s++)this.cleanups[s]();if(this.cleanups.length=0,this.scopes){const l=this.scopes.slice();for(s=0,n=l.length;s<n;s++)l[s].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const l=this.parent.scopes.pop();l&&l!==this&&(this.parent.scopes[this.index]=l,l.index=this.index)}this.parent=void 0}}}function Gi(){return pe}let te;const Zs=new WeakSet;class Al{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,pe&&(pe.active?pe.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Zs.has(this)&&(Zs.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Ml(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Un(this),Il(this);const t=te,s=De;te=this,De=!0;try{return this.fn()}finally{Fl(this),te=t,De=s,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)kn(t);this.deps=this.depsTail=void 0,Un(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Zs.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){cn(this)&&this.run()}get dirty(){return cn(this)}}let Rl=0,Xt,Zt;function Ml(e,t=!1){if(e.flags|=8,t){e.next=Zt,Zt=e;return}e.next=Xt,Xt=e}function Sn(){Rl++}function Cn(){if(--Rl>0)return;if(Zt){let t=Zt;for(Zt=void 0;t;){const s=t.next;t.next=void 0,t.flags&=-9,t=s}}let e;for(;Xt;){let t=Xt;for(Xt=void 0;t;){const s=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(n){e||(e=n)}t=s}}if(e)throw e}function Il(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Fl(e){let t,s=e.depsTail,n=s;for(;n;){const l=n.prevDep;n.version===-1?(n===s&&(s=l),kn(n),Yi(n)):t=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=l}e.deps=t,e.depsTail=s}function cn(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Dl(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Dl(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===ss)||(e.globalVersion=ss,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!cn(e))))return;e.flags|=2;const t=e.dep,s=te,n=De;te=e,De=!0;try{Il(e);const l=e.fn(e._value);(t.version===0||ze(l,e._value))&&(e.flags|=128,e._value=l,t.version++)}catch(l){throw t.version++,l}finally{te=s,De=n,Fl(e),e.flags&=-3}}function kn(e,t=!1){const{dep:s,prevSub:n,nextSub:l}=e;if(n&&(n.nextSub=l,e.prevSub=void 0),l&&(l.prevSub=n,e.nextSub=void 0),s.subs===e&&(s.subs=n,!n&&s.computed)){s.computed.flags&=-5;for(let i=s.computed.deps;i;i=i.nextDep)kn(i,!0)}!t&&!--s.sc&&s.map&&s.map.delete(s.key)}function Yi(e){const{prevDep:t,nextDep:s}=e;t&&(t.nextDep=s,e.prevDep=void 0),s&&(s.prevDep=t,e.nextDep=void 0)}let De=!0;const $l=[];function ot(){$l.push(De),De=!1}function rt(){const e=$l.pop();De=e===void 0?!0:e}function Un(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const s=te;te=void 0;try{t()}finally{te=s}}}let ss=0;class Xi{constructor(t,s){this.sub=t,this.dep=s,this.version=s.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Tn{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!te||!De||te===this.computed)return;let s=this.activeLink;if(s===void 0||s.sub!==te)s=this.activeLink=new Xi(te,this),te.deps?(s.prevDep=te.depsTail,te.depsTail.nextDep=s,te.depsTail=s):te.deps=te.depsTail=s,Ll(s);else if(s.version===-1&&(s.version=this.version,s.nextDep)){const n=s.nextDep;n.prevDep=s.prevDep,s.prevDep&&(s.prevDep.nextDep=n),s.prevDep=te.depsTail,s.nextDep=void 0,te.depsTail.nextDep=s,te.depsTail=s,te.deps===s&&(te.deps=Line truncated
|
||||
* @vue/runtime-core v3.5.41
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/function us(e,t,s,n){try{return n?e(...n):e()}catch(l){Ks(l,t,s)}}function Le(e,t,s,n){if(j(e)){const l=us(e,t,s,n);return l&&wl(l)&&l.catch(i=>{Ks(i,t,s)}),l}if(L(e)){const l=[];for(let i=0;i<e.length;i++)l.push(Le(e[i],t,s,n));return l}}function Ks(e,t,s,n=!0){const l=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||ee;if(t){let a=t.parent;const u=t.proxy,g=`https://vuejs.org/error-reference/#runtime-${s}`;for(;a;){const h=a.ec;if(h){for(let b=0;b<h.length;b++)if(h[b](e,u,g)===!1)return}a=a.parent}if(i){ot(),us(i,null,10,[e,u,g]),rt();return}}Co(e,s,l,n,r)}function Co(e,t,s,n=!0,l=!1){if(l)throw e;console.error(e)}const ye=[];let Ue=-1;const Lt=[];let vt=null,Ft=0;const Wl=Promise.resolve();let As=null;function ql(e){const t=As||Wl;return e?t.then(this?e.bind(this):e):t}function ko(e){let t=Ue+1,s=ye.length;for(;t<s;){const n=t+s>>>1,l=ye[n],i=ls(l);i<e||i===e&&l.flags&2?t=n+1:s=n}return t}function Rn(e){if(!(e.flags&1)){const t=ls(e),s=ye[ye.length-1];!s||!(e.flags&2)&&t>=ls(s)?ye.push(e):ye.splice(ko(t),0,e),e.flags|=1,zl()}}function zl(){As||(As=Wl.then(Gl))}function To(e){if(!L(e))vt&&e.id===-1?vt.splice(Ft+1,0,e):e.flags&1||(Lt.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)Lt.push(e[t]);zl()}function qn(e,t,s=Ue+1){for(;s<ye.length;s++){const n=ye[s];if(n&&n.flags&2){if(e&&n.id!==e.uid)continue;ye.splice(s,1),s--,n.flags&4&&(n.flags&=-2),n(),n.flags&4||(n.flags&=-2)}}}function Jl(e){if(Lt.length){const t=[...new Set(Lt)].sort((s,n)=>ls(s)-ls(n));if(Lt.length=0,vt){for(let s=0;s<t.length;s++)vt.push(t[s]);return}for(vt=t,Ft=0;Ft<vt.length;Ft++){const s=vt[Ft];s.flags&4&&(s.flags&=-2),s.flags&8||s(),s.flags&=-2}vt=null,Ft=0}}const ls=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Gl(e){try{for(Ue=0;Ue<ye.length;Ue++){const t=ye[Ue];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),us(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Ue<ye.length;Ue++){const t=ye[Ue];t&&(t.flags&=-2)}Ue=-1,ye.length=0,Jl(),As=null,(ye.length||Lt.length)&&Gl()}}let Me=null,Yl=null;function Rs(e){const t=Me;return Me=e,Yl=e&&e.type.__scopeId||null,t}function Eo(e,t=Me,s){if(!t||e._n)return e;const n=(...l)=>{n._d&&nl(-1);const i=Rs(t),r=At.length;let a;try{a=e(...l)}finally{for(let u=At.length;u>r;u--)xi();Rs(i),n._d&&nl(1)}return a};return n._n=!0,n._c=!0,n._d=!0,n}function Ct(e,t){if(Me===null)return e;const s=Js(Me),n=e.dirs||(e.dirs=[]);for(let l=0;l<t.length;l++){let[i,r,a,u=ee]=t[l];i&&(j(i)&&(i={mounted:i,updated:i}),i.deep&&it(r),n.push({dir:i,instance:s,value:r,oldValue:void 0,arg:a,modifiers:u}))}return e}function kt(e,t,s,n){const l=e.dirs,i=t&&t.dirs;for(let r=0;r<l.length;r++){const a=l[r];i&&(a.oldValue=i[r].value);let u=a.dir[n];u&&(ot(),Le(u,s,8,[e.el,a,e,t]),rt())}}function Oo(e,t){if(xe){let s=xe.provides;const n=xe.parent&&xe.parent.provides;n===s&&(s=xe.provides=Object.create(n)),s[e]=t}}function Ts(e,t,s=!1){const n=Tr();if(n||Nt){let l=Nt?Nt._context.provides:n?n.parent==null||n.ce?n.vnode.appContext&&n.vnode.appContext.provides:n.parent.provides:void 0;if(l&&e in l)return l[e];if(arguments.length>1)return s&&j(t)?t.call(n&&n.proxy):t}}const Po=Symbol.for("v-scx"),Ao=()=>Ts(Po);function tn(e,t,s){return Xl(e,t,s)}function Xl(e,t,s=ee){const{immediate:n,deep:l,flush:i,once:r}=s,a=_e({},s),u=t&&n||!t&&i!=="post";let g;if(rs){if(i==="sync"){const I=Ao();g=I.__watcherHandles||(I.__watcherHandles=[])}else if(!u){const I=()=>{};return I.stop=Ge,I.resume=Ge,I.pause=Ge,I}}const h=xe;a.call=(I,U,R)=>Le(I,h,U,R);let b=!1;i==="post"?a.scheduler=I=>{Ce(I,h&&h.suspense)}:i!=="sync"&&(b=!0,a.scheduler=(I,U)=>{U?I():Rn(I)}),a.augmentJob=I=>{t&&(I.flags|=4),b&&(I.flags|=2,h&&(I.id=h.uid,I.i=h))};const M=So(e,t,a);return rs&&(g?g.push(M):u&&M()),M}function Ro(e,t,s){const n=this.proxy,l=re(e)?e.includes(".")?Zl(n,e):()=>n[e]:e.bind(n,n);let i;j(t)?i=t:(i=t.handler,s=t);const r=fs(this),a=Xl(l,i.bind(n),s);return r(),a}function Zl(e,t){const s=t.split(".");return()=>{let n=e;for(let l=0;l<s.length&&n;l++)n=n[s[l]];return n}}const Mo=Symbol("_vte"),Us=e=>e.__isTeleport,sn=Symbol("_leaveCb");function Io(e){let t=e[0];if(e.length>1){for(const s of e)if(s.type!==ct){t=s;break}}return t}function Ql(e){if(!In(e))return Us(e.type)&&e.children?Io(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:s}=e;if(s){if(t&16)return s[0];if(t&32&&j(s.default))return s.default()}}function Mn(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const s=e.component.subTree;Mn(Us(s.type)&&Ql(s)||s,t)}else e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function ei(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function zn(e,t){let s;return!!((s=Object.getOwnPropertyDescriptor(e,t))&&!s.configurable)}const Ms=new WeakMap;function Qt(e,t,s,n,l=!1){if(L(e)){e.forEach((R,se)=>Qt(R,t&&(L(t)?t[se]:t),s,n,l));return}if(es(n)&&!l){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&Qt(
Line truncated
|
||||
* @vue/runtime-dom v3.5.41
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/let mn;const ol=typeof window<"u"&&window.trustedTypes;if(ol)try{mn=ol.createPolicy("vue",{createHTML:e=>e})}catch{}const Ei=mn?e=>mn.createHTML(e):e=>e,Ir="http://www.w3.org/2000/svg",Fr="http://www.w3.org/1998/Math/MathML",st=typeof document<"u"?document:null,rl=st&&st.createElement("template"),Dr={insert:(e,t,s)=>{t.insertBefore(e,s||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,s,n)=>{const l=t==="svg"?st.createElementNS(Ir,e):t==="mathml"?st.createElementNS(Fr,e):s?st.createElement(e,{is:s}):st.createElement(e);return e==="select"&&n&&n.multiple!=null&&l.setAttribute("multiple",n.multiple),l},createText:e=>st.createTextNode(e),createComment:e=>st.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>st.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,s,n,l,i){const r=s?s.previousSibling:t.lastChild;if(l&&(l===i||l.nextSibling))for(;t.insertBefore(l.cloneNode(!0),s),!(l===i||!(l=l.nextSibling)););else{rl.innerHTML=Ei(n==="svg"?`<svg>${e}</svg>`:n==="mathml"?`<math>${e}</math>`:e);const a=rl.content;if(n==="svg"||n==="mathml"){const u=a.firstChild;for(;u.firstChild;)a.appendChild(u.firstChild);a.removeChild(u)}t.insertBefore(a,s)}return[r?r.nextSibling:t.firstChild,s?s.previousSibling:t.lastChild]}},$r=Symbol("_vtc");function Lr(e,t,s){const n=e[$r];n&&(t=(t?[t,...n]:[...n]).join(" ")),t==null?e.removeAttribute("class"):s?e.setAttribute("class",t):e.className=t}const al=Symbol("_vod"),Nr=Symbol("_vsh"),jr=Symbol(""),Vr=/(?:^|;)\s*display\s*:/;function Hr(e,t,s){const n=e.style,l=re(s);let i=!1;if(s&&!l){if(t)if(re(t))for(const r of t.split(";")){const a=r.slice(0,r.indexOf(":")).trim();s[a]==null&&Gt(n,a,"")}else for(const r in t)s[r]==null&&Gt(n,r,"");for(const r in s){r==="display"&&(i=!0);const a=s[r];a!=null?Kr(e,r,!re(t)&&t?t[r]:void 0,a)||Gt(n,r,a):Gt(n,r,"")}}else if(l){if(t!==s){const r=n[jr];r&&(s+=";"+r),n.cssText=s,i=Vr.test(s)}}else t&&e.removeAttribute("style");al in e&&(e[al]=i?n.display:"",e[Nr]&&(n.display="none"))}const cl=/\s*!important$/;function Gt(e,t,s){if(L(s))s.forEach(n=>Gt(e,t,n));else if(s==null&&(s=""),t.startsWith("--"))e.setProperty(t,s);else{const n=Br(e,t);cl.test(s)?e.setProperty(Rt(n),s.replace(cl,""),"important"):e[n]=s}}const ul=["Webkit","Moz","ms"],on={};function Br(e,t){const s=on[t];if(s)return s;let n=Fe(t);if(n!=="filter"&&n in e)return on[t]=n;n=kl(n);for(let l=0;l<ul.length;l++){const i=ul[l]+n;if(i in e)return on[t]=i}return t}function Kr(e,t,s,n){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&re(n)&&s===n}const fl="http://www.w3.org/1999/xlink";function dl(e,t,s,n,l,i=qi(t)){n&&t.startsWith("xlink:")?s==null?e.removeAttributeNS(fl,t.slice(6,t.length)):e.setAttributeNS(fl,t,s):s==null||i&&!El(s)?e.removeAttribute(t):e.setAttribute(t,i?"":Xe(s)?String(s):s)}function pl(e,t,s,n,l){if(t==="innerHTML"||t==="textContent"){s!=null&&(e[t]=t==="innerHTML"?Ei(s):s);return}const i=e.tagName;if(t==="value"&&i!=="PROGRESS"&&!i.includes("-")){const a=i==="OPTION"?e.getAttribute("value")||"":e.value,u=s==null?e.type==="checkbox"?"on":"":String(s);(a!==u||!("_value"in e))&&(e.value=u),s==null&&e.removeAttribute(t),e._value=s;return}let r=!1;if(s===""||s==null){const a=typeof e[t];a==="boolean"?s=El(s):s==null&&a==="string"?(s="",r=!0):a==="number"&&(s=0,r=!0)}try{e[t]=s}catch{}r&&e.removeAttribute(l||t)}function _t(e,t,s,n){e.addEventListener(t,s,n)}function Ur(e,t,s,n){e.removeEventListener(t,s,n)}const hl=Symbol("_vei");function Wr(e,t,s,n,l=null){const i=e[hl]||(e[hl]={}),r=i[t];if(n&&r)r.value=n;else{const[a,u]=Jr(t);if(n){const g=i[t]=Xr(n,l);_t(e,a,g,u)}else r&&(Ur(e,a,r,u),i[t]=void 0)}}const qr=/(Once|Passive|Capture)$/,zr=/^on:?(?:Once|Passive|Capture)$/;function Jr(e){let t,s;for(;(s=e.match(qr))&&!zr.test(e);)t||(t={}),e=e.slice(0,e.length-s[1].length),t[s[1].toLowerCase()]=!0;return[e[2]===":"?e.slice(3):Rt(e.slice(2)),t]}let rn=0;const Gr=Promise.resolve(),Yr=()=>rn||(Gr.then(()=>rn=0),rn=Date.now());function Xr(e,t){const s=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=s.attached)return;const l=s.value;if(L(l)){const i=n.stopImmediatePropagation;n.stopImmediatePropagation=()=>{i.call(n),n._stopped=!0};const r=l.slice(),a=[n];for(let u=0;u<r.length&&!n._stopped;u++){const g=r[u];g&&Le(g,t,5,a)}}else Le(l,t,5,[n])};return s.value=e,s.attached=Yr(),s}const gl=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Zr=(e,t,s,n,l,i)=>{const r=l==="svg";t==="class"?Lr(e,n,r):t==="style"?Hr(e,s,n):$s(t)?Ls(t)||Wr(e,t,s,n,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Qr(e,t,n,r))?(pl(e,t,n),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&dl(e,t,n,r,i,t!=="value")):e._isVueCE&&(ea(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!re(n)))?pl(e,Fe(t),n,i,t):(t==="true-value"?e._trueValue=n:t==="false-value"&&(e._fals
Line truncated
|
||||
`))),e[Je]=Ht(l);const i=n||l.props&&l.props.type==="number";_t(e,t?"change":"input",r=>{r.target.composing||e[Je](an(e.value,s,i))}),(s||i)&&_t(e,"change",()=>{e.value=an(e.value,s,i)}),t||(_t(e,"compositionstart",ta),_t(e,"compositionend",vl),_t(e,"change",vl))},mounted(e,{value:t,modifiers:{trim:s,number:n}}){const l=t??"",i=e[Ss];delete e[Ss],i!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==i?e[Je](an(e.value,s,n)):e.value=l},beforeUpdate(e,{value:t,oldValue:s,modifiers:{lazy:n,trim:l,number:i}},r){if(e[Je]=Ht(r),e.composing)return;const a=(i||e.type==="number")&&!/^0\d/.test(e.value)?js(e.value):e.value,u=t??"";if(a===u)return;const g=e.getRootNode();(g instanceof Document||g instanceof ShadowRoot)&&g.activeElement===e&&e.type!=="range"&&(n&&t===s||l&&e.value.trim()===u)||(e.value=u)}},_l={deep:!0,created(e,t,s){e[Je]=Ht(s),_t(e,"change",()=>{const n=e._modelValue,l=as(e),i=e.checked,r=e[Je];if(L(n)){const a=wn(n,l),u=a!==-1;if(i&&!u)r(n.concat(l));else if(!i&&u){const g=[...n];g.splice(a,1),r(g)}}else if(Bt(n)){const a=new Set(n);i?a.add(l):a.delete(l),r(a)}else r(Oi(e,i))})},mounted:ml,beforeUpdate(e,t,s){e[Je]=Ht(s),ml(e,t,s)}};function ml(e,{value:t,oldValue:s},n){e._modelValue=t;let l;if(L(t))l=wn(t,n.props.value)>-1;else if(Bt(t))l=t.has(n.props.value);else{if(t===s)return;l=Kt(t,Oi(e,!0))}e.checked!==l&&(e.checked=l)}const sa={deep:!0,created(e,{value:t,modifiers:{number:s}},n){e._modelValue=t,_t(e,"change",()=>{const l=Array.prototype.filter.call(e.options,i=>i.selected).map(i=>s?js(as(i)):as(i));e[Je](e.multiple?Bt(e._modelValue)?new Set(l):l:l[0]),e._assigning=!0,ql(()=>{e._assigning=!1})}),e[Je]=Ht(n)},mounted(e,{value:t}){bl(e,t)},beforeUpdate(e,{value:t},s){e._modelValue=t,e[Je]=Ht(s)},updated(e,{value:t}){e._assigning||bl(e,t)}};function bl(e,t){const s=e.multiple,n=L(t);if(!(s&&!n&&!Bt(t))){for(let l=0,i=e.options.length;l<i;l++){const r=e.options[l],a=as(r);if(s)if(n){const u=typeof a;u==="string"||u==="number"?r.selected=t.some(g=>String(g)===String(a)):r.selected=wn(t,a)>-1}else r.selected=t.has(a);else if(Kt(as(r),t)){e.selectedIndex!==l&&(e.selectedIndex=l);return}}!s&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function as(e){return"_value"in e?e._value:e.value}function Oi(e,t){const s=t?"_trueValue":"_falseValue";return s in e?e[s]:t}const na=["ctrl","shift","alt","meta"],la={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>na.some(s=>e[`${s}Key`]&&!t.includes(s))},ia=(e,t)=>{if(!e)return e;const s=e._withMods||(e._withMods={}),n=t.join(".");return s[n]||(s[n]=((l,...i)=>{for(let r=0;r<t.length;r++){const a=la[t[r]];if(a&&a(l,t))return}return e(l,...i)}))},oa=_e({patchProp:Zr},Dr);let yl;function ra(){return yl||(yl=pr(oa))}const aa=((...e)=>{const t=ra().createApp(...e),{mount:s}=t;return t.mount=n=>{const l=ua(n);if(!l)return;const i=t._component;!j(i)&&!i.render&&!i.template&&(i.template=l.innerHTML),l.nodeType===1&&(l.textContent="");const r=s(l,!1,ca(l));return l instanceof Element&&(l.removeAttribute("v-cloak"),l.setAttribute("data-v-app","")),r},t});function ca(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function ua(e){return re(e)?document.querySelector(e):e}const fa={class:"app-shell"},da={class:"content",id:"overview"},pa={class:"topbar"},ha={class:"topbar-meta"},ga={class:"as-of"},va={key:0,class:"state-card"},_a={key:1,class:"state-card error-state"},ma={class:"kpi-grid","aria-label":"Signal summary"},ba={class:"kpi-card accent-card"},ya={class:"kpi-value"},xa={class:"kpi-foot"},wa={class:"long-count"},Sa={class:"short-count"},Ca={class:"neutral-count"},ka={class:"kpi-card"},Ta={class:"kpi-value"},Ea={class:"kpi-foot"},Oa={class:"panel theme-panel",id:"themes"},Pa={class:"panel-header signal-header"},Aa={class:"status-tag"},Ra={class:"theme-grid"},Ma={class:"theme-card-head"},Ia={class:"theme-chip"},Fa={class:"theme-label-th"},Da={class:"theme-surprise"},$a={class:"theme-surprise-value"},La={class:"theme-read"},Na={key:0,class:"theme-read-value"},ja={key:1,class:"theme-read-value"},Va={key:2,class:"theme-read-value"},Ha={key:3,class:"theme-read-value"},Ba={key:0,class:"theme-narrative"},Ka={key:0,class:"macro-panel"},Ua={class:"macro-chips"},Wa={class:"macro-chip"},qa={class:"macro-chip"},za={class:"macro-chip"},Ja={class:"macro-chip"},Ga={class:"macro-chip"},Ya={class:"panel stock-panel",id:"stocks"},Xa={class:"panel-header signal-header"},Za={class:"stock-controls"},Qa={class:"toggle-filter"},ec={key:0,class:"empty-research"},tc={key:1,class:"table-wrap"},sc={class:"factor-table"},nc=["onClick"],lc={key:1,class:"muted-cell"},ic={class:"combined-cell"},oc={class:"symbol-name"},rc={key:0,class:"muted-cell"},ac={class:"score-cell"},cc={key:0,cl
Line truncated
|
||||
+1
-1
@@ -1 +1 @@
|
||||
@import"https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&display=swap";:root{color-scheme:dark;font-family:Manrope,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,sans-serif;color:#edf2f7;background:#0b1018;font-synthesis:none;text-rendering:optimizeLegibility;--bg: #0b1018;--panel: #111925;--panel-soft: #151f2d;--line: #263344;--line-bright: #35465c;--text: #edf2f7;--muted: #8794a6;--faint: #5b6a7e;--mint: #52d6bd;--mint-soft: rgba(82, 214, 189, .12);--amber: #e6b96c;--amber-soft: rgba(230, 185, 108, .12);--red: #ef8b8b;--red-soft: rgba(239, 139, 139, .12)}*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;min-width:320px;background:var(--bg)}button,input{font:inherit}button{cursor:pointer}.app-shell{min-height:100vh;display:flex;background:radial-gradient(circle at 85% -10%,rgba(82,214,189,.08),transparent 32rem),var(--bg)}.sidebar{width:248px;flex:0 0 248px;min-height:100vh;padding:28px 18px 22px;border-right:1px solid var(--line);display:flex;flex-direction:column;background:#0b1018c2}.brand-lockup{display:flex;align-items:center;gap:11px;padding:0 9px 33px}.brand-mark{width:32px;height:32px;display:grid;place-items:center;border:1px solid rgba(82,214,189,.7);border-radius:9px;color:var(--mint);font:500 11px DM Mono,monospace;letter-spacing:-.08em;box-shadow:0 0 24px #52d6bd1f}.brand-name{font-size:13px;font-weight:800;letter-spacing:.01em}.brand-caption{margin-top:2px;color:var(--faint);font:10px DM Mono,monospace}.nav-stack{display:grid;gap:5px}.nav-item{display:flex;align-items:center;gap:11px;padding:11px 12px;border:1px solid transparent;border-radius:8px;color:var(--muted);text-decoration:none;font-size:12px;font-weight:600;transition:.2s ease}.nav-item:hover{color:var(--text);background:#ffffff06}.nav-item.active{color:var(--mint);background:var(--mint-soft);border-color:#52d6bd2e}.nav-glyph{width:16px;color:currentColor;font-size:15px;text-align:center}.sidebar-footer{margin-top:auto;padding:12px 8px 0}.mode-card{display:flex;gap:10px;align-items:center;padding:12px;border:1px solid var(--line);border-radius:10px;background:#ffffff05}.mode-dot,.freshness-dot{width:7px;height:7px;flex:0 0 7px;border-radius:99px;background:var(--mint);box-shadow:0 0 12px var(--mint)}.mode-label{font-size:11px;font-weight:700}.mode-detail,.version-line{margin-top:3px;color:var(--faint);font:10px DM Mono,monospace}.version-line{padding:14px 3px 0}.content{width:min(100%,1440px);margin:0 auto;padding:42px clamp(22px,4vw,64px) 70px}.topbar{display:flex;justify-content:space-between;gap:24px;align-items:flex-start;padding-bottom:35px}.eyebrow,.section-kicker{color:var(--mint);font:500 10px DM Mono,monospace;letter-spacing:.14em;text-transform:uppercase}h1,h2,p{margin:0}h1{margin-top:10px;font-size:clamp(28px,4vw,46px);line-height:1.04;letter-spacing:-.055em}h2{margin-top:7px;font-size:17px;letter-spacing:-.025em}.subtitle{max-width:560px;margin-top:12px;color:var(--muted);font-size:13px;line-height:1.7}.topbar-meta{text-align:right;color:var(--muted);font:10px DM Mono,monospace}.freshness-pill{display:inline-flex;align-items:center;gap:8px;padding:7px 10px;border:1px solid rgba(82,214,189,.25);border-radius:99px;color:var(--mint);background:var(--mint-soft)}.freshness-pill.pill-fixture{border-color:#e6b96c59;color:var(--amber);background:var(--amber-soft)}.freshness-pill.pill-fixture .freshness-dot{background:var(--amber);box-shadow:0 0 12px var(--amber)}.as-of{margin-top:10px}.kpi-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:12px}.kpi-card,.panel,.state-card{border:1px solid var(--line);background:linear-gradient(145deg,#151f2ddb,#0e151ff0);box-shadow:0 18px 42px #0000001f}.kpi-card{min-height:132px;padding:19px 19px 16px;border-radius:10px}.accent-card{border-color:#52d6bd4d;background:linear-gradient(145deg,#19383bcc,#0e1f26eb)}.kpi-label{color:var(--muted);font:10px DM Mono,monospace;text-transform:uppercase;letter-spacing:.08em}.kpi-value{margin-top:12px;color:var(--text);font-size:29px;font-weight:700;letter-spacing:-.055em}.kpi-unit{margin-left:4px;color:var(--mint);font:14px DM Mono,monospace}.quality-value{font-size:22px;text-transform:capitalize}.kpi-foot{margin-top:10px;color:var(--faint);font:10px DM Mono,monospace}.long-count,.positive-text{color:var(--mint)}.short-count,.negative-text{color:var(--red)}.hero-grid,.bottom-grid{display:grid;grid-template-columns:1.45fr 1fr;gap:12px;margin-bottom:12px}.panel{border-radius:10px;padding:22px}.panel-header{display:flex;justify-content:space-between;align-items:flex-start;gap:20px}.confidence-tag,.status-tag{padding:6px 8px;color:var(--mint);border:1px solid rgba(82,214,189,.22);border-radius:6px;background:var(--mint-soft);font:10px DM Mono,monospace;white-space:nowrap}.pulse-lead{display:flex;gap:15px;align-items:baseline;margin:26px 0 25px}.pulse-number{color:var(--mint);font-size:32px;font-weight:700;letter-spacing:-.06em}.pulse-copy{max-width:380px;cLine truncated
|
||||
@import"https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&display=swap";:root{color-scheme:dark;font-family:Manrope,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,sans-serif;color:#edf2f7;background:#0b1018;font-synthesis:none;text-rendering:optimizeLegibility;--bg: #0b1018;--panel: #111925;--panel-soft: #151f2d;--line: #263344;--line-bright: #35465c;--text: #edf2f7;--muted: #8794a6;--faint: #5b6a7e;--mint: #52d6bd;--mint-soft: rgba(82, 214, 189, .12);--amber: #e6b96c;--amber-soft: rgba(230, 185, 108, .12);--red: #ef8b8b;--red-soft: rgba(239, 139, 139, .12)}*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;min-width:320px;background:var(--bg)}button,input{font:inherit}button{cursor:pointer}.app-shell{min-height:100vh;display:flex;background:radial-gradient(circle at 85% -10%,rgba(82,214,189,.08),transparent 32rem),var(--bg)}.sidebar{width:248px;flex:0 0 248px;min-height:100vh;padding:28px 18px 22px;border-right:1px solid var(--line);display:flex;flex-direction:column;background:#0b1018c2}.brand-lockup{display:flex;align-items:center;gap:11px;padding:0 9px 33px}.brand-mark{width:32px;height:32px;display:grid;place-items:center;border:1px solid rgba(82,214,189,.7);border-radius:9px;color:var(--mint);font:500 11px DM Mono,monospace;letter-spacing:-.08em;box-shadow:0 0 24px #52d6bd1f}.brand-name{font-size:13px;font-weight:800;letter-spacing:.01em}.brand-caption{margin-top:2px;color:var(--faint);font:10px DM Mono,monospace}.nav-stack{display:grid;gap:5px}.nav-item{display:flex;align-items:center;gap:11px;padding:11px 12px;border:1px solid transparent;border-radius:8px;color:var(--muted);text-decoration:none;font-size:12px;font-weight:600;transition:.2s ease}.nav-item:hover{color:var(--text);background:#ffffff06}.nav-item.active{color:var(--mint);background:var(--mint-soft);border-color:#52d6bd2e}.nav-glyph{width:16px;color:currentColor;font-size:15px;text-align:center}.sidebar-footer{margin-top:auto;padding:12px 8px 0}.mode-card{display:flex;gap:10px;align-items:center;padding:12px;border:1px solid var(--line);border-radius:10px;background:#ffffff05}.mode-dot,.freshness-dot{width:7px;height:7px;flex:0 0 7px;border-radius:99px;background:var(--mint);box-shadow:0 0 12px var(--mint)}.mode-label{font-size:11px;font-weight:700}.mode-detail,.version-line{margin-top:3px;color:var(--faint);font:10px DM Mono,monospace}.version-line{padding:14px 3px 0}.content{width:min(100%,1440px);margin:0 auto;padding:42px clamp(22px,4vw,64px) 70px}.topbar{display:flex;justify-content:space-between;gap:24px;align-items:flex-start;padding-bottom:35px}.eyebrow,.section-kicker{color:var(--mint);font:500 10px DM Mono,monospace;letter-spacing:.14em;text-transform:uppercase}h1,h2,p{margin:0}h1{margin-top:10px;font-size:clamp(28px,4vw,46px);line-height:1.04;letter-spacing:-.055em}h2{margin-top:7px;font-size:17px;letter-spacing:-.025em}.subtitle{max-width:560px;margin-top:12px;color:var(--muted);font-size:13px;line-height:1.7}.topbar-meta{text-align:right;color:var(--muted);font:10px DM Mono,monospace}.freshness-pill{display:inline-flex;align-items:center;gap:8px;padding:7px 10px;border:1px solid rgba(82,214,189,.25);border-radius:99px;color:var(--mint);background:var(--mint-soft)}.freshness-pill.pill-fixture{border-color:#e6b96c59;color:var(--amber);background:var(--amber-soft)}.freshness-pill.pill-fixture .freshness-dot{background:var(--amber);box-shadow:0 0 12px var(--amber)}.as-of{margin-top:10px}.kpi-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:12px}.kpi-card,.panel,.state-card{border:1px solid var(--line);background:linear-gradient(145deg,#151f2ddb,#0e151ff0);box-shadow:0 18px 42px #0000001f}.kpi-card{min-height:132px;padding:19px 19px 16px;border-radius:10px}.accent-card{border-color:#52d6bd4d;background:linear-gradient(145deg,#19383bcc,#0e1f26eb)}.kpi-label{color:var(--muted);font:10px DM Mono,monospace;text-transform:uppercase;letter-spacing:.08em}.kpi-value{margin-top:12px;color:var(--text);font-size:29px;font-weight:700;letter-spacing:-.055em}.kpi-unit{margin-left:4px;color:var(--mint);font:14px DM Mono,monospace}.quality-value{font-size:22px;text-transform:capitalize}.kpi-foot{margin-top:10px;color:var(--faint);font:10px DM Mono,monospace}.long-count,.positive-text{color:var(--mint)}.short-count,.negative-text{color:var(--red)}.hero-grid,.bottom-grid{display:grid;grid-template-columns:1.45fr 1fr;gap:12px;margin-bottom:12px}.panel{border-radius:10px;padding:22px}.panel-header{display:flex;justify-content:space-between;align-items:flex-start;gap:20px}.confidence-tag,.status-tag{padding:6px 8px;color:var(--mint);border:1px solid rgba(82,214,189,.22);border-radius:6px;background:var(--mint-soft);font:10px DM Mono,monospace;white-space:nowrap}.pulse-lead{display:flex;gap:15px;align-items:baseline;margin:26px 0 25px}.pulse-number{color:var(--mint);font-size:32px;font-weight:700;letter-spacing:-.06em}.pulse-copy{max-width:380px;cLine truncated
|
||||
Vendored
+2
-2
@@ -5,8 +5,8 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="theme-color" content="#0b1018" />
|
||||
<title>SET50 Signal Lab</title>
|
||||
<script type="module" crossorigin src="/assets/index-DOVbTpbx.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-z73iDem3.css">
|
||||
<script type="module" crossorigin src="/assets/index-Ca0nIUj6.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-Dv48rkXC.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
+10
-89
@@ -22,7 +22,6 @@ const btRuns = ref([])
|
||||
// strict PIT backtest readiness (Task 1)
|
||||
const btReadiness = ref(null)
|
||||
const btUseLedger = ref(true)
|
||||
const simMode = ref('backtest')
|
||||
const simLoading = ref(false)
|
||||
const simResult = ref(null)
|
||||
const dividendOnly = ref(false)
|
||||
@@ -282,21 +281,11 @@ async function runSimulation() {
|
||||
simLoading.value = true
|
||||
simResult.value = null
|
||||
try {
|
||||
if (simMode.value === 'forward') {
|
||||
// REAL forward lifecycle (not cosmetic): freeze + execute a paper run.
|
||||
simResult.value = await fetchJson('/api/v1/forward', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ capital: Number(simCapital.value), use_pit: false }),
|
||||
})
|
||||
await loadForward()
|
||||
} else {
|
||||
simResult.value = await fetchJson('/api/v1/simulation', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ capital: Number(simCapital.value), mode: 'backtest' }),
|
||||
})
|
||||
}
|
||||
simResult.value = await fetchJson('/api/v1/suggestion', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ capital: Number(simCapital.value) }),
|
||||
})
|
||||
} catch (caught) {
|
||||
notice.value = caught.message
|
||||
} finally {
|
||||
@@ -304,38 +293,6 @@ async function runSimulation() {
|
||||
}
|
||||
}
|
||||
|
||||
// ---- real forward-test lifecycle (durable paper runs) ----
|
||||
const fwdRuns = ref([])
|
||||
const fwdLoading = ref(false)
|
||||
|
||||
async function loadForward() {
|
||||
fwdLoading.value = true
|
||||
try {
|
||||
const body = await fetchJson('/api/v1/forward')
|
||||
fwdRuns.value = body.runs ?? []
|
||||
} catch (caught) {
|
||||
notice.value = caught.message
|
||||
} finally {
|
||||
fwdLoading.value = false
|
||||
}
|
||||
}
|
||||
async function markForward(id) {
|
||||
try {
|
||||
await fetchJson(`/api/v1/forward/${id}/mark`, { method: 'POST' })
|
||||
await loadForward()
|
||||
} catch (caught) {
|
||||
notice.value = caught.message
|
||||
}
|
||||
}
|
||||
async function matureForward(id) {
|
||||
try {
|
||||
await fetchJson(`/api/v1/forward/${id}/mature`, { method: 'POST' })
|
||||
await loadForward()
|
||||
} catch (caught) {
|
||||
notice.value = caught.message
|
||||
}
|
||||
}
|
||||
|
||||
async function loadDashboard() {
|
||||
loading.value = true
|
||||
error.value = ''
|
||||
@@ -365,7 +322,6 @@ async function loadDashboard() {
|
||||
paperAuthWarning.value = sessionBody.warning || ''
|
||||
backtest.value = backtestBody
|
||||
researchRun.value = researchBody
|
||||
await loadForward() // load durable forward-test runs (not cosmetic)
|
||||
} catch (caught) {
|
||||
error.value = caught.message
|
||||
} finally {
|
||||
@@ -543,7 +499,7 @@ onMounted(async () => { await loadDashboard(); await Promise.all([loadBacktestRu
|
||||
<a class="nav-item" href="#lineage"><span class="nav-glyph">⌁</span>ที่มาข้อมูล</a>
|
||||
<a class="nav-item" href="#health"><span class="nav-glyph">⛨</span>สถานะข้อมูล</a>
|
||||
<a class="nav-item" href="#research-run"><span class="nav-glyph">✓</span>งานวิจัย</a>
|
||||
<a class="nav-item" href="#simulation"><span class="nav-glyph">➛</span>จำลอง</a>
|
||||
<a class="nav-item" href="#suggestion"><span class="nav-glyph">➛</span>จัดสรร</a>
|
||||
</nav>
|
||||
|
||||
<div class="sidebar-footer">
|
||||
@@ -753,12 +709,12 @@ onMounted(async () => { await loadDashboard(); await Promise.all([loadBacktestRu
|
||||
</section>
|
||||
|
||||
<!-- Sections 01-04 (tourism-only surprise, provenance, signal table, frozen research) removed per user: superseded by the 3-theme panel + sources table above. -->
|
||||
<section class="panel sim-panel" id="simulation">
|
||||
<section class="panel sim-panel" id="suggestion">
|
||||
<div class="panel-header signal-header">
|
||||
<div>
|
||||
<div class="section-kicker">การจำลองการลงทุน</div>
|
||||
<h2>จัดสรรทุน (Simulation)</h2>
|
||||
<p class="panel-subtitle">กรอกทุน และระบบจัดสรรตามสัดส่วน 50 / 20 / 30 — หุ้นที่ทำกำไรได้มากสุดแล้วจ่ายปันผล, หุ้นทำกำไรแต่ไม่ปันผล, และหุ้นปันผลสูงสุด (ไม่ซ้ำ) — ขั้นต่ำ 100 หุ้นต่อตัว.</p>
|
||||
<div class="section-kicker">คำแนะนำการลงทุน</div>
|
||||
<h2>จัดสรรทุน (Suggestion)</h2>
|
||||
<p class="panel-subtitle">กรอกทุน และระบบแนะนำสัดส่วน 50 / 20 / 30 — หุ้นที่ทำกำไรได้มากสุดแล้วจ่ายปันผล, หุ้นทำกำไรแต่ไม่ปันผล, และหุ้นปันผลสูงสุด (ไม่ซ้ำ) — ขั้นต่ำ 100 หุ้นต่อตัว.</p>
|
||||
</div>
|
||||
<span class="status-tag neutral-tag">{{ simResult ? 'ใช้ได้' : 'รอใส่ทุน' }}</span>
|
||||
</div>
|
||||
@@ -767,13 +723,6 @@ onMounted(async () => { await loadDashboard(); await Promise.all([loadBacktestRu
|
||||
<label>ทุน (บาท)</label>
|
||||
<input v-model="simCapital" type="number" min="1000" step="1000" />
|
||||
</div>
|
||||
<div class="sim-field">
|
||||
<label>โหมด</label>
|
||||
<select v-model="simMode">
|
||||
<option value="backtest">Backtest</option>
|
||||
<option value="forward">Forward test</option>
|
||||
</select>
|
||||
</div>
|
||||
<button class="primary-button" :disabled="simLoading" @click="runSimulation">{{ simLoading ? 'กำลังคำนวณ…' : 'คำนวณการจัดสรร' }}</button>
|
||||
</div>
|
||||
|
||||
@@ -820,34 +769,6 @@ onMounted(async () => { await loadDashboard(); await Promise.all([loadBacktestRu
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!simResult" class="empty-research">กด 'คำนวณการจัดสรร' เพื่อดูว่า 50/20/30 จัดสรรทุนของคุณไปที่หุ้นไหนบ้าง</div>
|
||||
|
||||
<!-- REAL forward-test lifecycle panel (not cosmetic) -->
|
||||
<div v-if="simMode === 'forward'" class="fwd-panel">
|
||||
<div class="section-kicker">Forward Test (Paper) — สัญญาณถูกตรึง ณ เวลาสร้าง</div>
|
||||
<p class="panel-subtitle">สร้าง forward run → สัญญาณ (คะแนน) ถูก freeze ทันทีที่สร้าง แล้ว execute ด้วยราคาหลัง freeze. กด Mark ตามราคาล่าสุด, Mature เพื่อปิด run. เป็น Paper เท่านั้น.</p>
|
||||
<div v-if="fwdRuns.length === 0" class="empty-research muted-cell">ยังไม่มี forward run — กด 'คำนวณการจัดสรร' ข้างบนเพื่อสร้าง</div>
|
||||
<table v-else class="source-table">
|
||||
<thead><tr><th>#</th><th>สถานะ</th><th>ทุน</th><th>ลงทุน</th><th>ถือ</th><th>ผลตอบแทน</th><th>ตรวจ</th></tr></thead>
|
||||
<tbody>
|
||||
<tr v-for="run in fwdRuns.slice().reverse()" :key="run.id">
|
||||
<td class="muted-cell">{{ run.id.slice(0, 12) }}</td>
|
||||
<td>
|
||||
<span class="status-tag" :class="run.status === 'matured' ? 'warning-tag' : (run.status === 'frozen' ? 'neutral-tag' : 'warning-tag')">{{ run.status }}</span>
|
||||
<span v-if="run.non_pit" class="status-tag warning-tag" title="ใช้คะแนนปัจจุบัน ไม่ใช่ PIT">non-PIT</span>
|
||||
</td>
|
||||
<td>{{ formatNumber(run.capital, 0) }}</td>
|
||||
<td class="positive-text">{{ formatNumber(run.invested, 0) }}</td>
|
||||
<td class="muted-cell">{{ Object.keys(run.holdings || {}).join(', ') || '—' }}</td>
|
||||
<td :class="pnlClass(run.net_return)">{{ run.net_return != null ? (run.net_return * 100).toFixed(2) + '%' : '—' }}</td>
|
||||
<td>
|
||||
<button v-if="run.status !== 'matured'" class="primary-btn" style="padding:2px 8px;margin-right:4px" @click="markForward(run.id)">Mark</button>
|
||||
<button v-if="run.status !== 'matured'" class="primary-btn" style="padding:2px 8px" @click="matureForward(run.id)">Mature</button>
|
||||
<span v-else class="muted-cell">ปิดแล้ว</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="panel backtest-panel" id="backtest">
|
||||
|
||||
@@ -221,15 +221,17 @@ tbody tr:hover { background: rgba(255,255,255,.025); }
|
||||
.sim-sum span { display: block; font-size: 11px; color: var(--faint); }
|
||||
.sim-sum strong { font-size: 20px; }
|
||||
.sim-note { font-size: 11px; color: var(--amber); font-style: italic; }
|
||||
.sim-buckets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
|
||||
.sim-bucket { border: 1px solid var(--line-bright); border-radius: 8px; padding: 10px; }
|
||||
.sim-buckets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; min-width: 0; }
|
||||
.sim-bucket { border: 1px solid var(--line-bright); border-radius: 8px; padding: 10px; min-width: 0; overflow: hidden; }
|
||||
.sim-bucket-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
|
||||
.sim-bucket-tag { font: 700 10px 'DM Mono', monospace; padding: 2px 6px; border-radius: 4px; }
|
||||
.sim-bucket-tag { font: 700 10px 'DM Mono', monospace; padding: 2px 6px; border-radius: 4px; flex: none; }
|
||||
.sim-bucket-tag.b1 { background: var(--accent-soft, rgba(63,161,255,.15)); color: var(--accent); }
|
||||
.sim-bucket-tag.b2 { background: var(--amber-soft, rgba(245,158,11,.15)); color: var(--amber); }
|
||||
.sim-bucket-tag.b3 { background: var(--mint-soft, rgba(94,234,212,.15)); color: var(--mint); }
|
||||
.sim-order-table { width: 100%; border-collapse: collapse; }
|
||||
.sim-order-table td { padding: 3px 4px; font-size: 12px; }
|
||||
.sim-order-table { width: 100%; table-layout: fixed; border-collapse: collapse; }
|
||||
.sim-order-table td { padding: 3px 4px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
|
||||
.sim-order-table td:first-child { text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||
.sim-bucket-head strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||
|
||||
@media (max-width: 720px) { .sim-buckets { grid-template-columns: 1fr; } }
|
||||
.row-action, .primary-button { padding: 8px 10px; border: 1px solid var(--line-bright); border-radius: 5px; color: var(--text); background: transparent; font-size: 10px; white-space: nowrap; transition: .2s ease; }
|
||||
|
||||
Reference in new issue
Block a user