diff --git a/README.md b/README.md index b6a968b..517603d 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ [![Data: openFDA, cached](https://img.shields.io/badge/data-openFDA_·_cached_offline-e7a948?style=flat-square&labelColor=0b1322)](data/PROVENANCE.md) [![License: MIT](https://img.shields.io/badge/license-MIT-f1ebdd?style=flat-square&labelColor=0b1322)](LICENSE) -**[The discovery](#the-discovery)** · **[Judge walkthrough](#judge-walkthrough)** · **[Why Relate](#why-relate)** · **[Architecture](#architecture)** · **[Results](#results-honestly)** · **[Docs](#go-deeper)** +**[The discovery](#the-discovery)** · **[Two hops deep](#two-hops-deep)** · **[Judge walkthrough](#judge-walkthrough)** · **[Why Relate](#why-relate)** · **[Architecture](#architecture)** · **[Results](#results-honestly)** · **[Docs](#go-deeper)** @@ -41,6 +41,33 @@ Every value in this table is asserted against the shipped store by [`tests/test_ **Why it matters.** FDA's September 2023 draft guidance on [selecting a predicate device](https://www.fda.gov/regulatory-information/search-fda-guidance-documents/best-practices-selecting-predicate-device-support-premarket-notification-510k-submission) recommends predicates without design-related recalls. [Kadakia et al. (JAMA 2023)](https://pubmed.ncbi.nlm.nih.gov/36625810/) found that devices cleared using predicates with Class I recalls had a 6.4× higher risk (RR 6.40, 95% CI 3.59–11.40) of a Class I recall of their own. Forebear is for the regulatory or quality engineer who has to check that before citing a predicate. +## Two hops deep + +BreathePal's predicate carries the recall itself, so a one-hop lookup already finds it. **SleepRes PAP System (K251770) is the case where only the graph does.** Its own predicate, the DreamStation 2, has no recall in the shipped FDA records. That predicate's predicates do: two REMstar clearances that FDA lists on Class I design recall **Z-1974-2021**. + +| Query depth | What it walks | Verdict for K251770 | +| --- | --- | --- | +| **1 generation** | K251770 → K200480 (no recall on file) | `NO_DESIGN_RECALL_SIGNAL`, marked **provisional** because grand-predicates were not traversed | +| **2 generations** | K251770 → K200480 → K130077 and K131982, both on Z-1974-2021 | `REVIEW_LINEAGE`, evidence complete | + +| | Evidence | Source | +| --- | --- | --- | +| **Candidate** | K251770 · SleepRes PAP System · Sleepres, Inc. · cleared 2025-12-15 | [FDA summary PDF](https://www.accessdata.fda.gov/cdrh_docs/pdf25/K251770.pdf#page=5) | +| **Hop 1** | p. 5: *"Predicate Device: Philips DreamStation 2 - K200480"* | same PDF, page 5 | +| **Predicate** | K200480 · DreamStation 2 System · Respironics · cleared 2020-07-10 | [FDA summary PDF](https://www.accessdata.fda.gov/cdrh_docs/pdf20/K200480.pdf#page=4) | +| **Hop 2** | p. 4: *"Primary Predicate Device: REMSTAR AUTO A-FLEX HT (K131982)"*, *"Secondary Predicate Device: REMSTAR SE (K130077)"* | K200480 PDF, page 4 | +| **Recall** | Z-1974-2021 · event 88058 · Class I · Device Design · initiated 2021-06-14 (PE-PUR foam). FDA's record lists K130077 and K131982, not K200480 | [FDA recall Z-1974-2021](https://www.accessdata.fda.gov/scripts/cdrh/cfdocs/cfRES/res.cfm?id=187815) | + +The recall began after the DreamStation 2 was cleared and 4 years 6 months before SleepRes was. The investigation page shows both depths side by side (*Why the graph matters*), with each hop's quote, a link to the FDA PDF at the cited page, and the recall record. The same simplified query as [below](#why-relate), with `*1..1` and then `*1..2`: + +```text +*1..1 (no rows) +*1..2 ['K251770', 'K200480', 'K131982'] Z-1974-2021 2021-06-14 + ['K251770', 'K200480', 'K130077'] Z-1974-2021 2021-06-14 +``` + +Every value here, including both verdicts and both query results, is asserted against the shipped store and the cached FDA page text by [`tests/test_two_hop_story.py`](tests/test_two_hop_story.py). As with BreathePal, FDA attributes the recall to product families that list these clearances; it is a question for the predicate rationale, not a finding that SleepRes is unsafe. + ## Judge walkthrough No API key, external database or other service is needed: the graph and the web build are committed. Pick one way to run it. @@ -67,10 +94,11 @@ powershell -ExecutionPolicy Bypass -File .\run.ps1 1. **Watch the thread.** A short opening film follows K252078 → K113053 → the 2021 Class I recall (Skip or Esc ends it). Deep link: [`#/check/K252078`](http://127.0.0.1:8765/#/check/K252078). 2. **Investigate K252078.** The verdict is **Review lineage**. Open the evidence graph or its *Timeline* mode: the recall diamonds sit *before* BreathePal's clearance. -3. **Open the evidence.** Select any thread for its verbatim quote, a link to the FDA PDF at the cited page, and the PDF's SHA-256. *What needs human review* lists every uncertainty. -4. **Write to the graph.** Click **Save assessment to graph**. Under *What K252078 cites*, reject the edge: the lineage and verdict change at once and the saved assessment is marked **stale**. Restore it. -5. **Trace recall reach.** Open **Recall reach** for [`88058,88071`](http://127.0.0.1:8765/#/reach/88058,88071), the Philips recall filed as two openFDA events: 14 recalled clearances, 26 later devices descend from them, 8 of those were cleared after the recall on their own lineage began. -6. **Optional, needs internet.** **Add a clearance** fetches an out-of-family ancestor's summary from FDA into `data/live/` and extends the tree. +3. **See what one more hop finds.** On the landing page, click **Two hops deep** under the hero (or open [`#/check/K251770`](http://127.0.0.1:8765/#/check/K251770)). *Why the graph matters* puts depth 1 (**No design-recall signal · provisional**) next to depth 2 (**Review lineage**, Class I design recall Z-1974-2021), with a PDF link at the cited page for each hop. +4. **Open the evidence.** Select any thread for its verbatim quote, a link to the FDA PDF at the cited page, and the PDF's SHA-256. *What needs human review* lists every uncertainty. +5. **Write to the graph.** Click **Save assessment to graph**. Under *What K252078 cites*, reject the edge: the lineage and verdict change at once and the saved assessment is marked **stale**. Restore it. +6. **Trace recall reach.** Open **Recall reach** for [`88058,88071`](http://127.0.0.1:8765/#/reach/88058,88071), the Philips recall filed as two openFDA events: 14 recalled clearances, 26 later devices descend from them, 8 of those were cleared after the recall on their own lineage began. +7. **Optional, needs internet.** **Add a clearance** fetches an out-of-family ancestor's summary from FDA into `data/live/` and extends the tree.
Manual setup, checks and the browser suite diff --git a/docs/UX_EXPERIENCE.md b/docs/UX_EXPERIENCE.md index 8830713..e93abca 100644 --- a/docs/UX_EXPERIENCE.md +++ b/docs/UX_EXPERIENCE.md @@ -62,6 +62,12 @@ the favicon. plain-language finding sentence, built only from the assessment payload. It names the page, the recall class, the root cause, the start date, and how long before the clearance the recall began. Coverage chips show evidence completeness, ancestors, unread summaries, doubtful links, conditional signals, and a jump link to the review queue. +- **Why the graph matters** (only when depth changes the verdict). The same deterministic rules run at depth 1 and + depth 2, side by side, joined by a *+1 hop* thread. Shown only when the depth-1 verdict differs and every strong + signal sits at generation 2 or deeper, so it never appears for a case like K252078 whose direct predicate already + carries the recall. Below the two verdicts, each hop is listed with a quote excerpt centred on the cited K-number, a + link to the FDA PDF at that page, and its provenance drawer, then the recall record. The shipped example is K251770 + (`#/check/K251770`); the landing page links to it under the hero as *Two hops deep*. - **Critical chain.** The route that raised the verdict, as cards joined by status-coded threads. Each card and each thread opens its provenance. - **Evidence graph.** Generation columns that fit the panel width. Status-coded threads, and nodes coloured by recall diff --git a/forebear/api.py b/forebear/api.py index 666928d..65bca88 100644 --- a/forebear/api.py +++ b/forebear/api.py @@ -23,7 +23,7 @@ from .ingest import IngestError from .investigation import runner as inv_runner from .investigation import store as inv_store -from .lineage import assess, compare, date_relation, recall_attribution, recall_reach +from .lineage import assess, citation_state, compare, date_relation, recall_attribution, recall_reach agent.load_env() use_live_cache() # live ingests never touch the committed data/raw cache @@ -265,12 +265,17 @@ class ReviewIn(BaseModel): @app.post("/api/citation/review") async def review(body: ReviewIn): src, dst = _norm_k(body.src), _norm_k(body.dst) - r = await run(lambda g: g.review_citation(src, dst, body.status, body.note, reviewer=body.via)) + + def write(g): # the review and the edge's new state are read in one store call + r = g.review_citation(src, dst, body.status, body.note, reviewer=body.via) + return r and r | {"citation": citation_state(g.citation_edge(src, dst))} + r = await run(write) if r is None: raise HTTPException(404, f"No citation {src} -> {dst}") return r + class TriageIn(BaseModel): src: str dst: str diff --git a/forebear/graph.py b/forebear/graph.py index db8ee39..dc5cbc8 100644 --- a/forebear/graph.py +++ b/forebear/graph.py @@ -231,6 +231,18 @@ def set_triage(self, src: str, dst: str, label: str, quote: str, model: str) -> {"src": src, "dst": dst, "label": label, "quote": quote, "model": model}) return rows[0] if rows else None + def citation_edge(self, src: str, dst: str) -> dict | None: + """The full current state of one citation edge, in the shape lineage hops use, plus how the lineage rules + treat it now. The authoritative record a client shows after reviewing the edge.""" + rows = self.q( + f"""MATCH (a:Device {{k:$src}})-[r:CITES]->(b:Device {{k:$dst}}) + RETURN {{{_HOP_FIELDS}}} AS hop, ({LINEAGE_EDGE}) AS in_lineage, ({ADVISORY_EDGE}) AS advisory, + toString(r.retired_at) AS retired_at""", {"src": src, "dst": dst}) + if not rows: + return None + r = rows[0] + return r["hop"] | {"in_lineage": bool(r["in_lineage"]), "advisory": bool(r["advisory"]), "retired_at": r["retired_at"]} + def citation(self, src: str, dst: str) -> dict | None: rows = self.q("""MATCH (a:Device {k:$src})-[c:CITES]->(b:Device {k:$dst}) RETURN c.kind AS kind, c.snippet AS snippet""", {"src": src, "dst": dst}) diff --git a/forebear/lineage.py b/forebear/lineage.py index 37970b6..a33d6d4 100644 --- a/forebear/lineage.py +++ b/forebear/lineage.py @@ -390,6 +390,17 @@ def trust(h: dict) -> str: return "uncertain" if doubt(h) else "extracted" +def citation_state(h: dict | None) -> dict | None: + """One citation edge (graph.citation_edge) labelled as the lineage rules treat it now: 'retired', 'advisory', a + trusted hop's trust() ('human_verified', 'extracted' or 'uncertain'), or None when it is out of lineage (rejected + by a person or removed by the audit).""" + if h is None: + return None + label = ("retired" if h.get("retired_at") else "advisory" if h.get("advisory") + else trust(h) if h.get("in_lineage") else None) + return h | {"trust": label} + + def advisory_basis(h: dict) -> list[str]: """Which automated sources call an untrusted citation a predicate.""" out = [] diff --git a/tests/test_api_journey.py b/tests/test_api_journey.py index 0bfd416..fbdbb4f 100644 --- a/tests/test_api_journey.py +++ b/tests/test_api_journey.py @@ -172,3 +172,14 @@ def test_phase35_source_corrected_assessments(client): assert {c["dst"]: c["kind"] for c in rt045["citations"]} == { "K060044": "predicate", "K130328": "reference", "K023135": "reference", } + + +def test_review_returns_the_authoritative_citation(client): + r = client.post("/api/citation/review", json={"src": "K200480", "dst": "K131982", "status": "rejected"}).json() + c = r["citation"] + assert (c["src"], c["dst"], c["review"], c["reviewer"], c["trust"], c["in_lineage"]) == \ + ("K200480", "K131982", "rejected", "user", None, False) + assert c["page"] == 4 and c["reviewed_source_sha256"] == c["source_sha256"] and len(c["source_sha256"]) == 64 + c = client.post("/api/citation/review", json={"src": "K200480", "dst": "K131982", "status": ""}).json()["citation"] + assert (c["review"], c["trust"], c["in_lineage"]) == (None, "extracted", True) + assert client.post("/api/citation/review", json={"src": "K200480", "dst": "K999999", "status": ""}).status_code == 404 diff --git a/tests/test_summary_refresh.py b/tests/test_summary_refresh.py index 05221c9..fe71698 100644 --- a/tests/test_summary_refresh.py +++ b/tests/test_summary_refresh.py @@ -8,7 +8,7 @@ import pytest from forebear import ingest, summaries -from forebear.lineage import assess, doubt +from forebear.lineage import assess, citation_state, doubt K = "K261000" URL_PATH = f"/cdrh_docs/pdf26/{K}.pdf" @@ -220,3 +220,32 @@ def test_a_citation_restored_from_the_reviewed_pdf_keeps_its_review(tiny, fda): ingest.add_clearance(tiny, K, refresh=True) h = _hop(tiny, "K000003") assert h["reviewed_source_sha256"] == h["source_sha256"] and doubt(h) == [] + + +# ---------------------------------------------------------------- the record a client shows after a review +def test_citation_state_reports_an_outdated_review_until_it_is_redone(tiny, fda): + ingest.add_clearance(tiny, K) + tiny.review_citation(K, "K000009", "confirmed", "read v1 p.1", reviewer="user") + c = citation_state(tiny.citation_edge(K, "K000009")) + assert (c["review"], c["reviewer"], c["trust"]) == ("confirmed", "user", "human_verified") + assert c["reviewed_source_sha256"] == c["source_sha256"] and c["in_lineage"] and not c["advisory"] + + fda.pdf = make_pdf(V2) + ingest.add_clearance(tiny, K, refresh=True) + c = citation_state(tiny.citation_edge(K, "K000009")) + assert c["review"] == "confirmed" and c["reviewed_source_sha256"] != c["source_sha256"] + assert c["trust"] == "uncertain" and "review_outdated" in doubt(c) + + tiny.review_citation(K, "K000009", "confirmed", "read v2 p.1", reviewer="user") + c = citation_state(tiny.citation_edge(K, "K000009")) + assert c["trust"] == "human_verified" and c["reviewed_source_sha256"] == c["source_sha256"] + + +def test_citation_state_labels_rejected_and_cleared_edges(tiny): + tiny.review_citation("K000005", "K000004", "rejected", None, reviewer="user") + c = citation_state(tiny.citation_edge("K000005", "K000004")) + assert (c["review"], c["in_lineage"], c["trust"]) == ("rejected", False, None) + tiny.review_citation("K000005", "K000004", "", None, reviewer="user") + c = citation_state(tiny.citation_edge("K000005", "K000004")) + assert (c["review"], c["in_lineage"], c["trust"]) == (None, True, "extracted") + assert citation_state(tiny.citation_edge("K000005", "K000001")) is None diff --git a/tests/test_two_hop_story.py b/tests/test_two_hop_story.py new file mode 100644 index 0000000..5b94f90 --- /dev/null +++ b/tests/test_two_hop_story.py @@ -0,0 +1,151 @@ +"""The two-hop showcase (K251770 -> K200480 -> REMstar -> Z-1974-2021) makes claims in the UI and README. +Each must match the shipped Relate store and the cached FDA evidence, and the depth-1 / depth-2 contrast it +demonstrates must stay true: a one-generation lookup finds no design-recall signal, two generations find one.""" +import glob +import json +import re + +import pytest + +from conftest import ROOT + +from forebear.graph import open_graph +from forebear.lineage import assess, provisional + +FACTS = json.loads((ROOT / "web" / "src" / "story" / "two-hop.json").read_text(encoding="utf-8")) +RAW = ROOT / "data" / "raw" +norm = lambda s: re.sub(r"\s+", " ", s or "").strip() # noqa: E731 + + +@pytest.fixture(scope="module") +def runs(tmp_path_factory): + import shutil + from conftest import SHIPPED + if not SHIPPED.exists(): + pytest.skip("shipped store missing; run scripts/build_graph.py") + p = tmp_path_factory.mktemp("two-hop") / "forebear.rl" + shutil.copy(SHIPPED, p) + g = open_graph(p, read_only=True) + k = FACTS["candidate"]["k"] + yield {1: assess(g, k, 1), 2: assess(g, k, 2), 4: assess(g, k, 4)} + g.close() + + +def _anc(a, k): + return next(x for x in a["ancestors"] if x["k"] == k) + + +def test_depth_one_finds_no_design_signal(runs): + a, f = runs[1], FACTS["depth1"] + assert a["depth"] == f["generations"] + assert a["verdict"] == f["verdict"] and provisional(a) is f["provisional"] + assert "shallow_traversal" in a["coverage"]["evidence_reasons"] + assert [x["k"] for x in a["ancestors"]] == [FACTS["predicate"]["k"]] + assert not [s for s in a["signals"] if s["severity"] in ("high", "medium")] + + +@pytest.mark.parametrize("depth", [2, 4]) +def test_depth_two_reveals_the_design_recall(runs, depth): + a = runs[depth] + assert a["verdict"] == FACTS["depth2"]["verdict"] and provisional(a) is FACTS["depth2"]["provisional"] + assert a["coverage"]["evidence"] == "complete" + r = FACTS["recall"] + raised = [s for s in a["signals"] if s["severity"] in ("high", "medium")] + holders = {s["chain"][-1] for s in raised if any(e.get("id") == r["id"] for e in s["evidence"])} + assert holders == set(r["holders"]) + for s in raised: + assert s["gen"] == 2 and s["chain"][:2] == [FACTS["candidate"]["k"], FACTS["predicate"]["k"]] + + +def test_candidate_and_predicate_match_store(runs): + a, c, p = runs[2], FACTS["candidate"], FACTS["predicate"] + d = a["device"] + assert (d["name"], d["applicant"], d["decision_date"]) == (c["name"], c["applicant"], c["decision_date"]) + assert (d["summary_url"], d["summary_sha256"]) == (c["summary_url"], c["summary_sha256"]) + pred = _anc(a, p["k"]) + assert pred["gen"] == 1 and pred["name"].startswith(p["name"]) + assert (pred["applicant"], pred["decision_date"]) == (p["applicant"], p["decision_date"]) + assert len(pred["recalls"]) == p["recalls"] + for gp in FACTS["grand_predicates"]: + x = _anc(a, gp["k"]) + assert x["gen"] == 2 and x["name"] == gp["name"] + assert (x["applicant"], x["decision_date"]) == (gp["applicant"], gp["decision_date"]) + + +def test_hops_match_store_and_cached_pdf_text(runs): + a = runs[2] + urls = {FACTS["candidate"]["k"]: FACTS["candidate"], FACTS["predicate"]["k"]: FACTS["predicate"]} + for h in FACTS["hops"]: + hop = next(x for x in _anc(a, h["dst"])["hops"] if x["src"] == h["src"] and x["dst"] == h["dst"]) + assert hop["page"] == h["page"] and hop["kind"] == "predicate" and hop["trust"] == "extracted" + assert h["quote"] in norm(hop["snippet"]) + assert hop["source_url"] == urls[h["src"]]["summary_url"] + assert hop["source_sha256"] == urls[h["src"]]["summary_sha256"] + # the quote is on the cited page of the cached FDA summary, whose hash is the one the graph records + raw = json.loads((RAW / "summaries" / f"{h['src']}.json").read_text(encoding="utf-8")) + assert raw["sha256"] == hop["source_sha256"] and raw["url"] == hop["source_url"] + assert h["quote"] in norm(raw["pages"][h["page"] - 1]) + + +def test_recall_matches_store(runs): + r, cand = FACTS["recall"], FACTS["candidate"] + for k in r["holders"]: + x = next(rec for rec in _anc(runs[2], k)["recalls"] if rec["id"] == r["id"]) + assert (x["event"], x["classification"], x["root_cause"]) == (r["event"], r["classification"], r["root_cause"]) + assert x["design_related"] and x["initiated"] == r["initiated"] and x["url"] == r["url"] + assert x["reason"].startswith(r["reason"]) + assert FACTS["predicate"]["decision_date"] < r["initiated"] < cand["decision_date"] + + +def test_recall_matches_cached_openfda_records(): + """FDA itself lists the grand-predicates, not the direct predicate, on the recall record: the signal can + only be found by walking a second generation.""" + r, pk = FACTS["recall"], FACTS["predicate"]["k"] + seen, names_pred = [], False + for f in glob.glob(str(RAW / "openfda" / "recall_*.json")): + for rec in json.loads(open(f, encoding="utf-8").read()).get("results", []): + ks = rec.get("k_numbers") or [] + names_pred |= pk in ks + if rec.get("product_res_number") == r["id"]: + seen.append(rec) + assert seen, "recall missing from the cached openFDA records" + for rec in seen: + assert set(r["holders"]) <= set(rec["k_numbers"]) and pk not in rec["k_numbers"] + assert rec["root_cause_description"] == r["root_cause"] and rec["event_date_initiated"] == r["initiated"] + assert not names_pred, f"a cached recall record now names {pk}; the two-hop framing needs revisiting" + + +def test_api_serves_both_depths(real_copy, monkeypatch): + import importlib + from fastapi.testclient import TestClient + monkeypatch.setenv("FOREBEAR_DB", str(real_copy)) + from forebear import api + importlib.reload(api) + k = FACTS["candidate"]["k"] + with TestClient(api.app) as c: + one = c.get(f"/api/assess/{k}", params={"depth": 1}).json() + two = c.get(f"/api/assess/{k}", params={"depth": 2}).json() + assert (one["verdict"], one["depth"]) == (FACTS["depth1"]["verdict"], 1) + assert (two["verdict"], two["depth"]) == (FACTS["depth2"]["verdict"], 2) + + +README_QUERY = """MATCH path = (d:Device {k: $k})-[:CITES*1..%d]->(a:Device) +WHERE all(c IN relationships(path) WHERE c.kind = 'predicate') +MATCH (a)-[:SUBJECT_OF]->(r:Recall) +WHERE r.classification = 'Class I' AND r.root_cause = 'Device Design' + AND r.initiated < d.decision_date +RETURN [n IN nodes(path) | n.k] AS chain, r.id AS recall""" + + +def test_readme_query_depth_one_empty_depth_two_finds_recall(real_copy): + """The simplified Cypher shown in the README returns nothing at depth 1 and the REMstar rows at depth 2.""" + g = open_graph(real_copy, read_only=True) + try: + k = FACTS["candidate"]["k"] + assert g.q(README_QUERY % 1, {"k": k}) == [] + rows = g.q(README_QUERY % 2, {"k": k}) + finally: + g.close() + chains = sorted(tuple(x["chain"]) for x in rows) + assert chains == sorted((k, FACTS["predicate"]["k"], h) for h in FACTS["recall"]["holders"]) + assert {x["recall"] for x in rows} == {FACTS["recall"]["id"]} diff --git a/web/dist/assets/History-DPVVy-wq.js b/web/dist/assets/History-B4TVd-Qw.js similarity index 98% rename from web/dist/assets/History-DPVVy-wq.js rename to web/dist/assets/History-B4TVd-Qw.js index 50eaad3..b61d375 100644 --- a/web/dist/assets/History-DPVVy-wq.js +++ b/web/dist/assets/History-B4TVd-Qw.js @@ -1 +1 @@ -import{r as i,j as e,V as p,d as b,c as j}from"./index-DD2rN9W6.js";function y({go:a}){const[n,d]=i.useState(null),[t,r]=i.useState(null),[l,h]=i.useState(null),[o,x]=i.useState(null),c=()=>{j.assessments().then(d).catch(s=>x(s.message)),j.investigations(null,50).then(r).catch(()=>r([])),j.proposals("pending_human_decision").then(h).catch(()=>h([]))};return i.useEffect(c,[]),e.jsxs("div",{children:[e.jsxs("div",{className:"page-head",children:[e.jsx("p",{className:"eyebrow",children:"Graph"}),e.jsx("h1",{children:"Investigation history"}),e.jsx("p",{children:"Saved assessments and their staleness against today's graph, then optional agent runs and the proposals they left for a person."})]}),o&&e.jsx("p",{className:"err",children:o}),e.jsxs("section",{className:"panel",children:[e.jsxs("div",{className:"panel-head",children:[e.jsxs("h2",{children:["Saved assessments ",e.jsx("span",{className:"count",children:(n==null?void 0:n.length)??"…"})]}),e.jsx("p",{className:"hint",children:"Stale means a citation in the ancestry was reviewed or re-ingested after saving."})]}),n&&n.length===0&&e.jsx("p",{className:"muted",children:"None yet. Save one from any investigation."}),n&&n.length>0&&e.jsx("div",{className:"tbl-wrap",children:e.jsxs("table",{className:"tbl",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Assessment"}),e.jsx("th",{children:"Device"}),e.jsx("th",{children:"Saved verdict"}),e.jsx("th",{children:"Now"}),e.jsx("th",{children:"Saved"})]})}),e.jsx("tbody",{children:n.map(s=>{var m,u,N,g;return e.jsxs("tr",{className:"click",tabIndex:0,onClick:()=>a("check",s.k),onKeyDown:v=>v.key==="Enter"&&a("check",s.k),children:[e.jsx("td",{className:"mono",children:s.id}),e.jsxs("td",{children:[e.jsx("span",{className:"k mono",children:s.k}),e.jsx("div",{className:"sub",children:s.name})]}),e.jsx("td",{children:e.jsx("span",{className:`chip tone-${((m=p[s.verdict])==null?void 0:m.tone)||"muted"}`,children:((u=p[s.verdict])==null?void 0:u.label)||s.verdict})}),e.jsx("td",{children:s.stale?e.jsxs("span",{className:"stale",children:["Stale",s.verdict_now!==s.verdict?` · now ${((N=p[s.verdict_now])==null?void 0:N.label)||s.verdict_now}`:""]}):e.jsx("span",{className:"ok",children:"Current"})}),e.jsx("td",{className:"sub num",children:(g=s.created_at)==null?void 0:g.slice(0,16).replace("T"," ")})]},s.id)})})]})})]}),e.jsxs("section",{className:"panel",children:[e.jsx("div",{className:"panel-head",children:e.jsxs("h2",{children:["Agent runs (optional) ",e.jsx("span",{className:"count",children:(t==null?void 0:t.length)??"…"})]})}),e.jsx("p",{className:"lede",children:"Machine findings, verified against tool results but never human-approved. Deterministic assessments remain the authoritative record."}),t&&t.length===0&&e.jsx("p",{className:"muted",children:"No agent runs in this store. They can be started from the command line or the API (see README)."}),t&&t.length>0&&e.jsx("div",{className:"tbl-wrap",children:e.jsxs("table",{className:"tbl",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Run"}),e.jsx("th",{children:"Target"}),e.jsx("th",{children:"Status"}),e.jsx("th",{children:"Mode"}),e.jsx("th",{children:"Pending proposals"}),e.jsx("th",{})]})}),e.jsx("tbody",{children:t.map(s=>{var m;return e.jsxs("tr",{children:[e.jsxs("td",{className:"mono",children:[s.id,e.jsx("div",{className:"sub",children:(m=s.created_at)==null?void 0:m.slice(0,16).replace("T"," ")})]}),e.jsx("td",{children:e.jsx("a",{href:`#/check/${s.target_k}`,className:"k mono",children:s.target_k})}),e.jsxs("td",{children:[e.jsx("span",{className:"chip",children:s.status}),s.stale&&e.jsx("span",{className:"stale",children:" · stale"})]}),e.jsxs("td",{className:"sub",children:[s.mode,s.model_used?` · ${s.model_used}`:""]}),e.jsx("td",{className:"num",children:s.pending_proposals}),e.jsx("td",{children:e.jsx("a",{href:b(s.id),target:"_blank",rel:"noreferrer",children:"Report ↗"})})]},s.id)})})]})})]}),e.jsxs("section",{className:"panel",children:[e.jsx("div",{className:"panel-head",children:e.jsxs("h2",{children:["Proposals awaiting a person ",e.jsx("span",{className:"count",children:(l==null?void 0:l.length)??"…"})]})}),l&&l.length===0&&e.jsx("p",{className:"muted",children:"None pending."}),l&&l.map(s=>e.jsx(k,{p:s,onDone:c},s.id))]})]})}function k({p:a,onDone:n}){const[d,t]=i.useState(""),[r,l]=i.useState(!1),[h,o]=i.useState(null),x=async c=>{try{await j.decide(a.id,c,d.trim()),o({ok:!0,text:`Recorded: ${c}.`}),n()}catch(s){o({ok:!1,text:s.message})}};return e.jsxs("div",{className:"review-item tone-muted",children:[e.jsxs("h3",{children:[e.jsx("span",{className:"sev sev-info",children:a.kind}),e.jsx("span",{className:"mono",children:a.id}),e.jsx("span",{children:a.k||`${a.src} → ${a.dst}`})]}),a.reason&&e.jsx("p",{className:"muted small",style:{margin:"0 0 8px"},children:a.reason}),e.jsxs("div",{className:"cit-a",children:[e.jsx("input",{className:"field",style:{maxWidth:220},placeholder:"Your name",value:d,onChange:c=>t(c.target.value),"aria-label":"Your name"}),e.jsxs("label",{className:"small",children:[e.jsx("input",{type:"checkbox",checked:r,onChange:c=>l(c.target.checked)})," I am a person deciding this"]}),e.jsx("button",{className:"btn btn-line btn-sm",disabled:!r||d.trim().length<2,onClick:()=>x("approve"),children:"Approve"}),e.jsx("button",{className:"btn btn-quiet btn-sm",disabled:!r||d.trim().length<2,onClick:()=>x("dismiss"),children:"Dismiss"})]}),h&&e.jsx("p",{className:h.ok?"ok":"err",children:h.text})]})}export{y as default}; +import{r as i,j as e,V as p,d as b,c as j}from"./index-Ch_7cPZN.js";function y({go:a}){const[n,d]=i.useState(null),[t,r]=i.useState(null),[l,h]=i.useState(null),[o,x]=i.useState(null),c=()=>{j.assessments().then(d).catch(s=>x(s.message)),j.investigations(null,50).then(r).catch(()=>r([])),j.proposals("pending_human_decision").then(h).catch(()=>h([]))};return i.useEffect(c,[]),e.jsxs("div",{children:[e.jsxs("div",{className:"page-head",children:[e.jsx("p",{className:"eyebrow",children:"Graph"}),e.jsx("h1",{children:"Investigation history"}),e.jsx("p",{children:"Saved assessments and their staleness against today's graph, then optional agent runs and the proposals they left for a person."})]}),o&&e.jsx("p",{className:"err",children:o}),e.jsxs("section",{className:"panel",children:[e.jsxs("div",{className:"panel-head",children:[e.jsxs("h2",{children:["Saved assessments ",e.jsx("span",{className:"count",children:(n==null?void 0:n.length)??"…"})]}),e.jsx("p",{className:"hint",children:"Stale means a citation in the ancestry was reviewed or re-ingested after saving."})]}),n&&n.length===0&&e.jsx("p",{className:"muted",children:"None yet. Save one from any investigation."}),n&&n.length>0&&e.jsx("div",{className:"tbl-wrap",children:e.jsxs("table",{className:"tbl",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Assessment"}),e.jsx("th",{children:"Device"}),e.jsx("th",{children:"Saved verdict"}),e.jsx("th",{children:"Now"}),e.jsx("th",{children:"Saved"})]})}),e.jsx("tbody",{children:n.map(s=>{var m,u,N,g;return e.jsxs("tr",{className:"click",tabIndex:0,onClick:()=>a("check",s.k),onKeyDown:v=>v.key==="Enter"&&a("check",s.k),children:[e.jsx("td",{className:"mono",children:s.id}),e.jsxs("td",{children:[e.jsx("span",{className:"k mono",children:s.k}),e.jsx("div",{className:"sub",children:s.name})]}),e.jsx("td",{children:e.jsx("span",{className:`chip tone-${((m=p[s.verdict])==null?void 0:m.tone)||"muted"}`,children:((u=p[s.verdict])==null?void 0:u.label)||s.verdict})}),e.jsx("td",{children:s.stale?e.jsxs("span",{className:"stale",children:["Stale",s.verdict_now!==s.verdict?` · now ${((N=p[s.verdict_now])==null?void 0:N.label)||s.verdict_now}`:""]}):e.jsx("span",{className:"ok",children:"Current"})}),e.jsx("td",{className:"sub num",children:(g=s.created_at)==null?void 0:g.slice(0,16).replace("T"," ")})]},s.id)})})]})})]}),e.jsxs("section",{className:"panel",children:[e.jsx("div",{className:"panel-head",children:e.jsxs("h2",{children:["Agent runs (optional) ",e.jsx("span",{className:"count",children:(t==null?void 0:t.length)??"…"})]})}),e.jsx("p",{className:"lede",children:"Machine findings, verified against tool results but never human-approved. Deterministic assessments remain the authoritative record."}),t&&t.length===0&&e.jsx("p",{className:"muted",children:"No agent runs in this store. They can be started from the command line or the API (see README)."}),t&&t.length>0&&e.jsx("div",{className:"tbl-wrap",children:e.jsxs("table",{className:"tbl",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Run"}),e.jsx("th",{children:"Target"}),e.jsx("th",{children:"Status"}),e.jsx("th",{children:"Mode"}),e.jsx("th",{children:"Pending proposals"}),e.jsx("th",{})]})}),e.jsx("tbody",{children:t.map(s=>{var m;return e.jsxs("tr",{children:[e.jsxs("td",{className:"mono",children:[s.id,e.jsx("div",{className:"sub",children:(m=s.created_at)==null?void 0:m.slice(0,16).replace("T"," ")})]}),e.jsx("td",{children:e.jsx("a",{href:`#/check/${s.target_k}`,className:"k mono",children:s.target_k})}),e.jsxs("td",{children:[e.jsx("span",{className:"chip",children:s.status}),s.stale&&e.jsx("span",{className:"stale",children:" · stale"})]}),e.jsxs("td",{className:"sub",children:[s.mode,s.model_used?` · ${s.model_used}`:""]}),e.jsx("td",{className:"num",children:s.pending_proposals}),e.jsx("td",{children:e.jsx("a",{href:b(s.id),target:"_blank",rel:"noreferrer",children:"Report ↗"})})]},s.id)})})]})})]}),e.jsxs("section",{className:"panel",children:[e.jsx("div",{className:"panel-head",children:e.jsxs("h2",{children:["Proposals awaiting a person ",e.jsx("span",{className:"count",children:(l==null?void 0:l.length)??"…"})]})}),l&&l.length===0&&e.jsx("p",{className:"muted",children:"None pending."}),l&&l.map(s=>e.jsx(k,{p:s,onDone:c},s.id))]})]})}function k({p:a,onDone:n}){const[d,t]=i.useState(""),[r,l]=i.useState(!1),[h,o]=i.useState(null),x=async c=>{try{await j.decide(a.id,c,d.trim()),o({ok:!0,text:`Recorded: ${c}.`}),n()}catch(s){o({ok:!1,text:s.message})}};return e.jsxs("div",{className:"review-item tone-muted",children:[e.jsxs("h3",{children:[e.jsx("span",{className:"sev sev-info",children:a.kind}),e.jsx("span",{className:"mono",children:a.id}),e.jsx("span",{children:a.k||`${a.src} → ${a.dst}`})]}),a.reason&&e.jsx("p",{className:"muted small",style:{margin:"0 0 8px"},children:a.reason}),e.jsxs("div",{className:"cit-a",children:[e.jsx("input",{className:"field",style:{maxWidth:220},placeholder:"Your name",value:d,onChange:c=>t(c.target.value),"aria-label":"Your name"}),e.jsxs("label",{className:"small",children:[e.jsx("input",{type:"checkbox",checked:r,onChange:c=>l(c.target.checked)})," I am a person deciding this"]}),e.jsx("button",{className:"btn btn-line btn-sm",disabled:!r||d.trim().length<2,onClick:()=>x("approve"),children:"Approve"}),e.jsx("button",{className:"btn btn-quiet btn-sm",disabled:!r||d.trim().length<2,onClick:()=>x("dismiss"),children:"Dismiss"})]}),h&&e.jsx("p",{className:h.ok?"ok":"err",children:h.text})]})}export{y as default}; diff --git a/web/dist/assets/Landing-0CfXrj7l.js b/web/dist/assets/Landing-0CfXrj7l.js new file mode 100644 index 0000000..6416e73 --- /dev/null +++ b/web/dist/assets/Landing-0CfXrj7l.js @@ -0,0 +1 @@ +import{r as h,m as M,j as e,W as q,f as N,p as L,R as T,M as B,_ as O}from"./index-Ch_7cPZN.js";import{u as re}from"./index-Ch_7cPZN.js";const K="Every claim the opening film makes. tests/test_story_facts.py checks each value against the shipped Relate store.",W={k:"K252078",name:"BreathePal Bilevel",applicant:"Compal Electronics, Inc.",decision_date:"2026-03-17",summary_url:"https://www.accessdata.fda.gov/cdrh_docs/pdf25/K252078.pdf",verdict:"REVIEW_LINEAGE"},V={src:"K252078",dst:"K113053",page:6,quote:"substantially equivalent to the legally marketed predicate device, BiPAP A30 Ventilatory support system (K113053)."},z={k:"K113053",name:"BiPAP A30 Ventilatory Support System",applicant:"Respironics, Inc.",decision_date:"2012-02-01"},Z={holder:"K113053",event:"88071",ids:["Z-1957-2021","Z-1958-2021"],classification:"Class I",root_cause:"Device Design",initiated:"2021-06-14",reason:"The polyester-based polyurethane (PE-PUR) foam may degrade into particles"},H=[{k:"K092818",name:"BiPAP AVAPS",decision_date:"2010-01-22"},{k:"K082660",name:"V60 Ventilator",decision_date:"2009-01-09"},{k:"K103167",name:"Stellar 150",decision_date:"2011-03-01"}],g={_note:K,candidate:W,citation:V,predicate:z,recall:Z,grand_predicates:H},Y={k:"K251770",name:"SleepRes PAP System"},G={id:"Z-1974-2021",classification:"Class I"},v={candidate:Y,recall:G},_=(()=>{let s=0;const a=new Set;return{set(t){t!==s&&(s=t,a.forEach(n=>n()))},get:()=>s,subscribe(t){return a.add(t),()=>a.delete(t)}}})(),$=()=>h.useSyncExternalStore(_.subscribe,_.get);function P(){const s=h.useRef(null);return h.useEffect(()=>{const a=s.current;if(!a||typeof IntersectionObserver>"u"){a==null||a.classList.add("in-frame");return}const t=new IntersectionObserver(([n])=>a.classList.toggle("in-frame",n.isIntersecting),{rootMargin:"-12% 0px -12% 0px"});return t.observe(a),()=>t.disconnect()},[]),s}function I(){const s=innerHeight;return[...document.querySelectorAll("[data-scene]")].map(a=>{const t=a.getBoundingClientRect(),n=t.top+scrollY,c=innerWidth<=860,l=a.dataset.align==="top"?0:c&&a.classList.contains("chapter-copy")?n-s*.55:n+t.height/2-s*.5;return[Math.max(0,l),Number(a.dataset.scene)]}).sort((a,t)=>a[1]-t[1]).map((a,t,n)=>t&&a[0]<=n[t-1][0]?[n[t-1][0]+1,a[1]]:a)}function U(){try{return!!document.createElement("canvas").getContext("2d")}catch{return!1}}function D(){const s=innerWidth,a=innerHeight,t=48,n=Math.max(24,s*.03),c={},l=document.querySelector(".hero-copy");if(l){const r=l.getBoundingClientRect();c[0]=[Math.min(s*.62,r.right+t),a*.18,s-n-40,a*.82]}document.querySelectorAll(".chapter-copy[data-scene]").forEach(r=>{const m=r.getBoundingClientRect(),i=Number(r.dataset.scene),d=m.left+m.width/2{if(s||!U()){document.documentElement.dataset.film="off";return}let d=!1;const x=matchMedia("(max-width: 860px), (pointer: coarse)").matches,u=/[?&]gl=1\b/.test(location.search);return O(async()=>{const{createFilm:j}=await import("./renderer-DE7JEwcd.js");return{createFilm:j}},[]).then(({createFilm:j})=>{var b;if(!(d||!l.current))try{r.current=j(l.current,{glCanvas:o.current,facts:g,deviceCount:((b=t==null?void 0:t.nodes)==null?void 0:b.Device)||1187,compact:x,forceGL:u,onScene:n,onRenderer:p=>{i(p),c&&c(p)}}),r.current.setAnchors(I()),r.current.setZones(D()),r.current.snap(),delete document.documentElement.dataset.film,i(r.current.kind),c&&c(r.current.kind)}catch{document.documentElement.dataset.film="off"}}).catch(()=>{document.documentElement.dataset.film="off"}),()=>{var j;d=!0,(j=r.current)==null||j.dispose(),r.current=null}},[s]),h.useEffect(()=>{var b;if(!m)return;const d=()=>{var p,k;(p=r.current)==null||p.setAnchors(I()),(k=r.current)==null||k.setZones(D())},x=new ResizeObserver(()=>{var p;(p=r.current)==null||p.resize(),d()});x.observe(document.body),(b=document.fonts)==null||b.ready.then(d);const u=p=>{var k;return(k=r.current)==null?void 0:k.setPointer(p.clientX,p.clientY,!0)},j=()=>{var p;return(p=r.current)==null?void 0:p.setPointer(-9999,-9999,!1)};return addEventListener("pointermove",u,{passive:!0}),document.addEventListener("pointerleave",j),()=>{x.disconnect(),removeEventListener("pointermove",u),document.removeEventListener("pointerleave",j)}},[!!m]),h.useEffect(()=>{var d;m&&a==="bloom"&&((d=r.current)==null||d.bloom())},[!!m,a]),e.jsxs("div",{className:"film-stage","aria-hidden":"true",children:[e.jsx("div",{className:"film-fallback",children:e.jsxs("svg",{viewBox:"0 0 560 320",children:[e.jsx("path",{d:"M520 60 C 380 60, 380 160, 240 160",stroke:"#7fa2ff",strokeWidth:"1.6",fill:"none"}),e.jsx("path",{d:"M240 160 C 160 160, 160 80, 80 80 M240 160 C 160 160, 160 250, 70 250",stroke:"#7fa2ff",strokeOpacity:".4",fill:"none"}),e.jsx("path",{d:"M240 160 L 420 160",stroke:"#e7a948",strokeDasharray:"2 4"}),e.jsx("path",{d:"M420 152 l8 8 -8 8 -8 -8z",fill:"#e7a948"}),e.jsx("circle",{cx:"520",cy:"60",r:"9",fill:"#f1ebdd",stroke:"#7fa2ff",strokeWidth:"3"}),e.jsx("circle",{cx:"240",cy:"160",r:"7",fill:"#e7a948"}),e.jsx("circle",{cx:"80",cy:"80",r:"6",fill:"#e7a948"}),e.jsx("circle",{cx:"70",cy:"250",r:"6",fill:"#9aa7c2"})]})}),e.jsx("canvas",{ref:o,className:"film-gl"+(m==="webgl"?" is-live":"")}),e.jsx("div",{className:"film-grid"}),e.jsx("canvas",{ref:l,className:"film-story"+(m?" is-live":""),"data-testid":"film-canvas","data-renderer":m||"fallback"}),e.jsx("div",{className:"film-vignette"})]})}const F=[{n:"00",name:"The field",read:s=>`${s.k} · one point among the store's clearances`},{n:"01",name:"The filing",read:(s,a)=>`${s.k} · 510(k) summary · page ${a.page}`},{n:"02",name:"The connection",read:(s,a,t)=>`${s.k} → ${t.k} · ${s.decision_date.slice(0,4)} → ${t.decision_date.slice(0,4)}`},{n:"03",name:"The discovery",read:(s,a,t,n)=>`${t.k} · ${n.classification} · ${n.root_cause} · ${n.initiated}`},{n:"04",name:"The handoff",read:()=>"generation columns · same layout as the workspace"}];function J(){const s=$(),[a,t]=h.useState(!1);h.useEffect(()=>{const c=document.querySelector(".paths");if(!c||typeof IntersectionObserver>"u")return;const l=new IntersectionObserver(([o])=>t(o.isIntersecting||o.boundingClientRect.top<0));return l.observe(c),()=>l.disconnect()},[]);const n=F[s]||F[0];return e.jsxs("div",{className:"film-hud"+(a?" is-away":""),"aria-hidden":"true",children:[e.jsxs("span",{className:"hud-n",children:["[",n.n," / 04]"]}),e.jsx("span",{className:"hud-name",children:n.name}),e.jsx("span",{className:"hud-read",children:n.read(g.candidate,g.citation,g.predicate,g.recall)})]})}function w({v:s}){const[a,t]=h.useState(0);return h.useEffect(()=>{if(s==null)return;if(matchMedia("(prefers-reduced-motion: reduce)").matches){t(s);return}let n,c;const l=o=>{c??(c=o);const r=Math.min(1,(o-c)/1100);t(Math.round(s*(1-Math.pow(1-r,3)))),r<1&&(n=requestAnimationFrame(l))};return n=requestAnimationFrame(l),()=>cancelAnimationFrame(n)},[s]),s==null?null:e.jsx("b",{children:a.toLocaleString("en-US")})}function Q({reduced:s}){const a=$();return e.jsx("nav",{className:"film-index","aria-label":"Film chapters",children:ee.map(([t,n],c)=>e.jsxs("a",{href:`#${t}`,className:a===c?"on":"","aria-current":a===c?"step":void 0,onClick:l=>{var o;l.preventDefault(),(o=document.getElementById(t==="top"?"top":`${t}-copy`))==null||o.scrollIntoView({block:"center",behavior:s?"auto":"smooth"})},children:[e.jsx("span",{children:n}),e.jsx("i",{})]},t))})}const A=({children:s})=>e.jsx("span",{className:"ln",children:e.jsx("span",{children:s})});function E({id:s,scene:a,mark:t,label:n,place:c,statement:l,children:o,foot:r}){const m=P();return e.jsx("article",{id:s,className:`chapter place-${c}`,"aria-labelledby":`${s}-title`,children:e.jsxs("div",{ref:m,className:"chapter-copy reveal","data-scene":a,id:`${s}-copy`,children:[e.jsxs("p",{className:"chapter-label",children:[e.jsxs("span",{children:[t," / 03"]}),n]}),e.jsx("h2",{className:"chapter-statement",id:`${s}-title`,children:l.map((i,d)=>e.jsxs(A,{children:[i," "]},d))}),o,r&&e.jsx("p",{className:"chapter-foot",children:r})]})})}const ee=[["top","Opening"],["the-filing","The filing"],["the-connection","The connection"],["the-discovery","The discovery"],["handoff","Investigate"]];function se({go:s,stats:a,introDone:t,reduced:n}){var S,R,C;const[c,l]=h.useState(!1),[o,r]=h.useState(null),m=P();h.useEffect(()=>{const f=()=>l(scrollY>40);return f(),addEventListener("scroll",f,{passive:!0}),()=>removeEventListener("scroll",f)},[]);const i=g.candidate,d=g.predicate,x=g.recall,u=g.citation,j=M(x.initiated,i.decision_date),b=Math.floor(j/12),p=j%12,k=u.quote.split(u.dst);return e.jsxs("div",{className:"film",id:"top",children:[e.jsx(X,{reduced:n,introDone:t,stats:a,onScene:_.set,onKind:r}),o&&e.jsx(J,{}),e.jsxs("header",{className:"film-top"+(c?" is-solid":""),children:[e.jsx("a",{href:"#/","aria-label":"Forebear, start of film",onClick:f=>{f.preventDefault(),scrollTo({top:0})},children:e.jsx(q,{size:26})}),e.jsx("span",{className:"spacer"}),e.jsxs("nav",{"aria-label":"Product",children:[e.jsx("a",{href:"#/check",children:"Investigate"}),e.jsx("a",{href:"#/reach/88058,88071",children:"Recall reach"}),e.jsx("a",{href:"#/watch",children:"Watchlist"}),e.jsx("a",{href:"#/method",children:"Method"})]}),e.jsxs("a",{className:"btn btn-primary btn-sm",href:"#/check","data-testid":"open-workspace",children:["Open workspace ",e.jsx("span",{className:"arr","aria-hidden":"true",children:"→"})]})]}),e.jsx(Q,{reduced:n}),e.jsxs("main",{id:"main",children:[e.jsx("section",{className:"hero","data-scene":"0","data-align":"top","aria-labelledby":"hero-title",children:e.jsxs("div",{className:"hero-copy",children:[e.jsx("p",{className:"eyebrow",children:"510(k) predicate due diligence"}),e.jsxs("h1",{id:"hero-title",tabIndex:-1,style:{outline:"none"},children:["Every clearance has ",e.jsx("em",{children:"a past."})]}),e.jsxs("p",{className:"hero-lede",children:["Forebear reads the predicates out of FDA 510(k) summaries, stores the family tree in a ",e.jsx("b",{children:"Relate graph"})," joined to FDA recall records, and shows in one query whether a predicate, or any of its ancestors, was recalled for a design problem, as far back as their summaries can be read: ",e.jsx("b",{children:"with the page and quote behind every link."})]}),e.jsxs("div",{className:"hero-actions",children:[e.jsxs("a",{className:"btn btn-primary",href:`#/check/${i.k}`,"data-testid":"hero-investigate",onClick:f=>{f.preventDefault(),s("check",i.k,{transition:!0})},children:["Investigate ",i.k," ",e.jsx("span",{className:"arr","aria-hidden":"true",children:"→"})]}),e.jsxs("a",{className:"btn btn-line",href:"#the-filing-copy",onClick:f=>{var y;f.preventDefault(),(y=document.getElementById("the-filing-copy"))==null||y.scrollIntoView({block:"center",behavior:n?"auto":"smooth"})},children:["Follow one thread ",e.jsx("span",{"aria-hidden":"true",children:"↓"})]})]}),e.jsxs("a",{className:"hero-alt",href:`#/check/${v.candidate.k}`,"data-testid":"hero-two-hop",onClick:f=>{f.preventDefault(),s("check",v.candidate.k,{transition:!0})},children:[e.jsx("span",{className:"hero-alt-tag",children:"Two hops deep"}),e.jsxs("span",{children:[e.jsx("span",{className:"k",children:v.candidate.k}),": at depth 1, no design-recall signal. At depth 2, a ",v.recall.classification," design recall (",v.recall.id,") on its predicate's predicates. ",e.jsx("b",{children:"See both depths →"})]})]}),a&&e.jsxs("div",{className:"hero-proof","aria-label":"What is in the shipped graph",children:[e.jsxs("div",{children:[e.jsx(w,{v:(S=a.nodes)==null?void 0:S.Device}),e.jsx("span",{children:"clearances in the graph"})]}),e.jsxs("div",{children:[e.jsx(w,{v:(R=a.citations_by_kind)==null?void 0:R.predicate}),e.jsx("span",{children:"predicate links, each with a page"})]}),e.jsxs("div",{children:[e.jsx(w,{v:(C=a.nodes)==null?void 0:C.Recall}),e.jsx("span",{children:"FDA recall records joined"})]})]})]})}),e.jsxs(E,{id:"the-filing",scene:1,mark:"01",label:"The filing",place:"left",statement:["One document","tells one step."],foot:"A 510(k) summary names its predicate. It does not tell you what became of it.",children:[e.jsxs("p",{className:"chapter-body",children:[i.name," (",e.jsx("span",{className:"k",children:i.k}),") was cleared on ",N(i.decision_date),". Its 510(k) summary names a single predicate, on page ",u.page,":"]}),e.jsxs("figure",{className:"doc","aria-label":`Quote from page ${u.page} of the ${i.k} summary`,children:[e.jsxs("div",{className:"doc-meta",children:[e.jsxs("span",{children:[i.k," · 510(k) summary"]}),e.jsxs("span",{children:["page ",u.page]})]}),e.jsxs("blockquote",{style:{margin:0},children:["“…",k[0],e.jsx("mark",{children:u.dst}),k[1],"”"]}),e.jsx("div",{style:{marginTop:10},children:e.jsxs("a",{href:L(i.summary_url,u.page),target:"_blank",rel:"noreferrer",children:["Open the FDA PDF at page ",u.page," ↗"]})})]})]}),e.jsx(E,{id:"the-connection",scene:2,mark:"02",label:"The connection",place:"right",statement:["Follow the thread","back in time."],foot:"Each thread is an edge in the graph, stored with its page, quote and source PDF.",children:e.jsxs("p",{className:"chapter-body",children:[e.jsx("span",{className:"k",children:i.k})," → ",e.jsx("span",{className:"k",children:d.k}),": the ",e.jsx("b",{children:d.name}),", cleared to ",d.applicant," on ",N(d.decision_date),". And ",d.k," cites predicates of its own: ",g.grand_predicates.map((f,y)=>e.jsxs(T.Fragment,{children:[y?y===g.grand_predicates.length-1?" and ":", ":"",e.jsx("span",{className:"k",children:f.k})]},f.k)),". FDA's databases answer one hop at a time. Relate walks them all in one variable-length query."]})}),e.jsxs(E,{id:"the-discovery",scene:3,mark:"03",label:"The discovery",place:"left",statement:["FDA recalls name",e.jsx("em",{children:"the predicate."},"e")],foot:"A recall on a predicate is not a finding about the new device. It is a question the predicate rationale should answer.",children:[e.jsxs("p",{className:"chapter-body",children:["On ",N(x.initiated)," a ",e.jsx("b",{children:x.classification})," recall of the BiPAP A30 began, root cause ",e.jsx("b",{children:x.root_cause}),": “",x.reason,"…” (event ",x.event,", records ",x.ids.join(" and "),")."]}),e.jsxs("div",{className:"fact-row",children:[e.jsxs("div",{className:"fact amber",children:[e.jsxs("b",{children:[b," yr ",p," mo"]}),e.jsxs("span",{children:["between recall start and ",i.k,"'s clearance"]})]}),e.jsxs("div",{className:"fact",children:[e.jsx("b",{children:"Review lineage"}),e.jsxs("span",{children:["deterministic verdict for ",i.k]})]})]}),e.jsx("p",{className:"chapter-body",style:{fontSize:14},children:"FDA's 2023 draft guidance recommends predicates not subject to design-related recalls."})]}),e.jsx("section",{id:"handoff",className:"handoff","aria-labelledby":"handoff-title",children:e.jsxs("div",{ref:m,className:"reveal","data-scene":"4",id:"handoff-copy",children:[e.jsxs("p",{className:"lead",id:"handoff-title",children:[e.jsx(A,{children:"Every fact above is real evidence."}),e.jsx(A,{children:e.jsx("em",{children:"Now work with it."})})]}),e.jsxs("a",{className:"btn btn-primary",href:`#/check/${i.k}`,"data-testid":"handoff-investigate",onClick:f=>{f.preventDefault(),s("check",i.k,{transition:!0})},children:["Open the investigation ",e.jsx("span",{className:"arr","aria-hidden":"true",children:"→"})]}),e.jsx("p",{className:"sub",children:"Every node, date and quote above is read from the shipped Relate store; the background field is illustrative."})]})}),e.jsxs("section",{className:"paths","aria-labelledby":"paths-title",children:[e.jsx("h2",{id:"paths-title",children:"Or start somewhere else"}),e.jsxs("div",{className:"path-grid",children:[e.jsxs("a",{className:"path-card",href:"#/reach/88058,88071",children:[e.jsx("span",{className:"k",children:"Recall 88058 + 88071"}),e.jsx("h3",{children:"Recall reach"}),e.jsx("p",{children:"From the June 2021 Philips foam recall: which later clearances descend from it?"})]}),e.jsxs("a",{className:"path-card",href:"#/watch",children:[e.jsx("span",{className:"k",children:"Watchlist"}),e.jsx("h3",{children:"Cited after a recall"}),e.jsx("p",{children:"Clearances whose predicate was already under a design-related recall."})]}),e.jsxs("a",{className:"path-card",href:"#/compare/K200480 K113053 K233643 K143677",children:[e.jsx("span",{className:"k",children:"Compare"}),e.jsx("h3",{children:"Choose a predicate"}),e.jsx("p",{children:"Candidate predicates side by side, with their own and inherited recalls."})]}),e.jsxs("a",{className:"path-card",href:`#/check/${v.candidate.k}`,children:[e.jsxs("span",{className:"k",children:[v.candidate.k," · two hops"]}),e.jsx("h3",{children:v.candidate.name}),e.jsxs("p",{children:["One hop finds nothing. Two hops reach the ",v.recall.classification," recall ",v.recall.id,"."]})]})]})]})]}),e.jsxs("footer",{className:"film-foot",children:[e.jsx("p",{children:"Public FDA data: openFDA 510(k), recall and enforcement records and 510(k) summary PDFs. Forebear reports documented lineage and recall history; it does not judge device safety. Not regulatory advice."}),e.jsx(B,{size:18})]})]})}export{se as default,re as useMedia}; diff --git a/web/dist/assets/Landing-mM6lZWLo.js b/web/dist/assets/Landing-mM6lZWLo.js deleted file mode 100644 index da7f4a5..0000000 --- a/web/dist/assets/Landing-mM6lZWLo.js +++ /dev/null @@ -1 +0,0 @@ -import{r as h,m as $,j as e,W as M,f as k,p as q,R as L,M as B,_ as K}from"./index-DD2rN9W6.js";import{u as se}from"./index-DD2rN9W6.js";const T="Every claim the opening film makes. tests/test_story_facts.py checks each value against the shipped Relate store.",O={k:"K252078",name:"BreathePal Bilevel",applicant:"Compal Electronics, Inc.",decision_date:"2026-03-17",summary_url:"https://www.accessdata.fda.gov/cdrh_docs/pdf25/K252078.pdf",verdict:"REVIEW_LINEAGE"},W={src:"K252078",dst:"K113053",page:6,quote:"substantially equivalent to the legally marketed predicate device, BiPAP A30 Ventilatory support system (K113053)."},V={k:"K113053",name:"BiPAP A30 Ventilatory Support System",applicant:"Respironics, Inc.",decision_date:"2012-02-01"},z={holder:"K113053",event:"88071",ids:["Z-1957-2021","Z-1958-2021"],classification:"Class I",root_cause:"Device Design",initiated:"2021-06-14",reason:"The polyester-based polyurethane (PE-PUR) foam may degrade into particles"},Z=[{k:"K092818",name:"BiPAP AVAPS",decision_date:"2010-01-22"},{k:"K082660",name:"V60 Ventilator",decision_date:"2009-01-09"},{k:"K103167",name:"Stellar 150",decision_date:"2011-03-01"}],g={_note:T,candidate:O,citation:W,predicate:V,recall:z,grand_predicates:Z},E=(()=>{let s=0;const a=new Set;return{set(t){t!==s&&(s=t,a.forEach(n=>n()))},get:()=>s,subscribe(t){return a.add(t),()=>a.delete(t)}}})(),D=()=>h.useSyncExternalStore(E.subscribe,E.get);function P(){const s=h.useRef(null);return h.useEffect(()=>{const a=s.current;if(!a||typeof IntersectionObserver>"u"){a==null||a.classList.add("in-frame");return}const t=new IntersectionObserver(([n])=>a.classList.toggle("in-frame",n.isIntersecting),{rootMargin:"-12% 0px -12% 0px"});return t.observe(a),()=>t.disconnect()},[]),s}function F(){const s=innerHeight;return[...document.querySelectorAll("[data-scene]")].map(a=>{const t=a.getBoundingClientRect(),n=t.top+scrollY,c=innerWidth<=860,l=a.dataset.align==="top"?0:c&&a.classList.contains("chapter-copy")?n-s*.55:n+t.height/2-s*.5;return[Math.max(0,l),Number(a.dataset.scene)]}).sort((a,t)=>a[1]-t[1]).map((a,t,n)=>t&&a[0]<=n[t-1][0]?[n[t-1][0]+1,a[1]]:a)}function H(){try{return!!document.createElement("canvas").getContext("2d")}catch{return!1}}function I(){const s=innerWidth,a=innerHeight,t=48,n=Math.max(24,s*.03),c={},l=document.querySelector(".hero-copy");if(l){const r=l.getBoundingClientRect();c[0]=[Math.min(s*.62,r.right+t),a*.18,s-n-40,a*.82]}document.querySelectorAll(".chapter-copy[data-scene]").forEach(r=>{const m=r.getBoundingClientRect(),i=Number(r.dataset.scene),d=m.left+m.width/2{if(s||!H()){document.documentElement.dataset.film="off";return}let d=!1;const x=matchMedia("(max-width: 860px), (pointer: coarse)").matches,f=/[?&]gl=1\b/.test(location.search);return K(async()=>{const{createFilm:j}=await import("./renderer-DE7JEwcd.js");return{createFilm:j}},[]).then(({createFilm:j})=>{var y;if(!(d||!l.current))try{r.current=j(l.current,{glCanvas:o.current,facts:g,deviceCount:((y=t==null?void 0:t.nodes)==null?void 0:y.Device)||1187,compact:x,forceGL:f,onScene:n,onRenderer:p=>{i(p),c&&c(p)}}),r.current.setAnchors(F()),r.current.setZones(I()),r.current.snap(),delete document.documentElement.dataset.film,i(r.current.kind),c&&c(r.current.kind)}catch{document.documentElement.dataset.film="off"}}).catch(()=>{document.documentElement.dataset.film="off"}),()=>{var j;d=!0,(j=r.current)==null||j.dispose(),r.current=null}},[s]),h.useEffect(()=>{var y;if(!m)return;const d=()=>{var p,v;(p=r.current)==null||p.setAnchors(F()),(v=r.current)==null||v.setZones(I())},x=new ResizeObserver(()=>{var p;(p=r.current)==null||p.resize(),d()});x.observe(document.body),(y=document.fonts)==null||y.ready.then(d);const f=p=>{var v;return(v=r.current)==null?void 0:v.setPointer(p.clientX,p.clientY,!0)},j=()=>{var p;return(p=r.current)==null?void 0:p.setPointer(-9999,-9999,!1)};return addEventListener("pointermove",f,{passive:!0}),document.addEventListener("pointerleave",j),()=>{x.disconnect(),removeEventListener("pointermove",f),document.removeEventListener("pointerleave",j)}},[!!m]),h.useEffect(()=>{var d;m&&a==="bloom"&&((d=r.current)==null||d.bloom())},[!!m,a]),e.jsxs("div",{className:"film-stage","aria-hidden":"true",children:[e.jsx("div",{className:"film-fallback",children:e.jsxs("svg",{viewBox:"0 0 560 320",children:[e.jsx("path",{d:"M520 60 C 380 60, 380 160, 240 160",stroke:"#7fa2ff",strokeWidth:"1.6",fill:"none"}),e.jsx("path",{d:"M240 160 C 160 160, 160 80, 80 80 M240 160 C 160 160, 160 250, 70 250",stroke:"#7fa2ff",strokeOpacity:".4",fill:"none"}),e.jsx("path",{d:"M240 160 L 420 160",stroke:"#e7a948",strokeDasharray:"2 4"}),e.jsx("path",{d:"M420 152 l8 8 -8 8 -8 -8z",fill:"#e7a948"}),e.jsx("circle",{cx:"520",cy:"60",r:"9",fill:"#f1ebdd",stroke:"#7fa2ff",strokeWidth:"3"}),e.jsx("circle",{cx:"240",cy:"160",r:"7",fill:"#e7a948"}),e.jsx("circle",{cx:"80",cy:"80",r:"6",fill:"#e7a948"}),e.jsx("circle",{cx:"70",cy:"250",r:"6",fill:"#9aa7c2"})]})}),e.jsx("canvas",{ref:o,className:"film-gl"+(m==="webgl"?" is-live":"")}),e.jsx("div",{className:"film-grid"}),e.jsx("canvas",{ref:l,className:"film-story"+(m?" is-live":""),"data-testid":"film-canvas","data-renderer":m||"fallback"}),e.jsx("div",{className:"film-vignette"})]})}const C=[{n:"00",name:"The field",read:s=>`${s.k} · one point among the store's clearances`},{n:"01",name:"The filing",read:(s,a)=>`${s.k} · 510(k) summary · page ${a.page}`},{n:"02",name:"The connection",read:(s,a,t)=>`${s.k} → ${t.k} · ${s.decision_date.slice(0,4)} → ${t.decision_date.slice(0,4)}`},{n:"03",name:"The discovery",read:(s,a,t,n)=>`${t.k} · ${n.classification} · ${n.root_cause} · ${n.initiated}`},{n:"04",name:"The handoff",read:()=>"generation columns · same layout as the workspace"}];function G(){const s=D(),[a,t]=h.useState(!1);h.useEffect(()=>{const c=document.querySelector(".paths");if(!c||typeof IntersectionObserver>"u")return;const l=new IntersectionObserver(([o])=>t(o.isIntersecting||o.boundingClientRect.top<0));return l.observe(c),()=>l.disconnect()},[]);const n=C[s]||C[0];return e.jsxs("div",{className:"film-hud"+(a?" is-away":""),"aria-hidden":"true",children:[e.jsxs("span",{className:"hud-n",children:["[",n.n," / 04]"]}),e.jsx("span",{className:"hud-name",children:n.name}),e.jsx("span",{className:"hud-read",children:n.read(g.candidate,g.citation,g.predicate,g.recall)})]})}function N({v:s}){const[a,t]=h.useState(0);return h.useEffect(()=>{if(s==null)return;if(matchMedia("(prefers-reduced-motion: reduce)").matches){t(s);return}let n,c;const l=o=>{c??(c=o);const r=Math.min(1,(o-c)/1100);t(Math.round(s*(1-Math.pow(1-r,3)))),r<1&&(n=requestAnimationFrame(l))};return n=requestAnimationFrame(l),()=>cancelAnimationFrame(n)},[s]),s==null?null:e.jsx("b",{children:a.toLocaleString("en-US")})}function U({reduced:s}){const a=D();return e.jsx("nav",{className:"film-index","aria-label":"Film chapters",children:X.map(([t,n],c)=>e.jsxs("a",{href:`#${t}`,className:a===c?"on":"","aria-current":a===c?"step":void 0,onClick:l=>{var o;l.preventDefault(),(o=document.getElementById(t==="top"?"top":`${t}-copy`))==null||o.scrollIntoView({block:"center",behavior:s?"auto":"smooth"})},children:[e.jsx("span",{children:n}),e.jsx("i",{})]},t))})}const _=({children:s})=>e.jsx("span",{className:"ln",children:e.jsx("span",{children:s})});function w({id:s,scene:a,mark:t,label:n,place:c,statement:l,children:o,foot:r}){const m=P();return e.jsx("article",{id:s,className:`chapter place-${c}`,"aria-labelledby":`${s}-title`,children:e.jsxs("div",{ref:m,className:"chapter-copy reveal","data-scene":a,id:`${s}-copy`,children:[e.jsxs("p",{className:"chapter-label",children:[e.jsxs("span",{children:[t," / 03"]}),n]}),e.jsx("h2",{className:"chapter-statement",id:`${s}-title`,children:l.map((i,d)=>e.jsxs(_,{children:[i," "]},d))}),o,r&&e.jsx("p",{className:"chapter-foot",children:r})]})})}const X=[["top","Opening"],["the-filing","The filing"],["the-connection","The connection"],["the-discovery","The discovery"],["handoff","Investigate"]];function Q({go:s,stats:a,introDone:t,reduced:n}){var A,S,R;const[c,l]=h.useState(!1),[o,r]=h.useState(null),m=P();h.useEffect(()=>{const u=()=>l(scrollY>40);return u(),addEventListener("scroll",u,{passive:!0}),()=>removeEventListener("scroll",u)},[]);const i=g.candidate,d=g.predicate,x=g.recall,f=g.citation,j=$(x.initiated,i.decision_date),y=Math.floor(j/12),p=j%12,v=f.quote.split(f.dst);return e.jsxs("div",{className:"film",id:"top",children:[e.jsx(Y,{reduced:n,introDone:t,stats:a,onScene:E.set,onKind:r}),o&&e.jsx(G,{}),e.jsxs("header",{className:"film-top"+(c?" is-solid":""),children:[e.jsx("a",{href:"#/","aria-label":"Forebear, start of film",onClick:u=>{u.preventDefault(),scrollTo({top:0})},children:e.jsx(M,{size:26})}),e.jsx("span",{className:"spacer"}),e.jsxs("nav",{"aria-label":"Product",children:[e.jsx("a",{href:"#/check",children:"Investigate"}),e.jsx("a",{href:"#/reach/88058,88071",children:"Recall reach"}),e.jsx("a",{href:"#/watch",children:"Watchlist"}),e.jsx("a",{href:"#/method",children:"Method"})]}),e.jsxs("a",{className:"btn btn-primary btn-sm",href:"#/check","data-testid":"open-workspace",children:["Open workspace ",e.jsx("span",{className:"arr","aria-hidden":"true",children:"→"})]})]}),e.jsx(U,{reduced:n}),e.jsxs("main",{id:"main",children:[e.jsx("section",{className:"hero","data-scene":"0","data-align":"top","aria-labelledby":"hero-title",children:e.jsxs("div",{className:"hero-copy",children:[e.jsx("p",{className:"eyebrow",children:"510(k) predicate due diligence"}),e.jsxs("h1",{id:"hero-title",tabIndex:-1,style:{outline:"none"},children:["Every clearance has ",e.jsx("em",{children:"a past."})]}),e.jsxs("p",{className:"hero-lede",children:["Forebear reads the predicates out of FDA 510(k) summaries, stores the family tree in a ",e.jsx("b",{children:"Relate graph"})," joined to FDA recall records, and shows in one query whether a predicate, or any of its ancestors, was recalled for a design problem, as far back as their summaries can be read: ",e.jsx("b",{children:"with the page and quote behind every link."})]}),e.jsxs("div",{className:"hero-actions",children:[e.jsxs("a",{className:"btn btn-primary",href:`#/check/${i.k}`,"data-testid":"hero-investigate",onClick:u=>{u.preventDefault(),s("check",i.k,{transition:!0})},children:["Investigate ",i.k," ",e.jsx("span",{className:"arr","aria-hidden":"true",children:"→"})]}),e.jsxs("a",{className:"btn btn-line",href:"#the-filing-copy",onClick:u=>{var b;u.preventDefault(),(b=document.getElementById("the-filing-copy"))==null||b.scrollIntoView({block:"center",behavior:n?"auto":"smooth"})},children:["Follow one thread ",e.jsx("span",{"aria-hidden":"true",children:"↓"})]})]}),a&&e.jsxs("div",{className:"hero-proof","aria-label":"What is in the shipped graph",children:[e.jsxs("div",{children:[e.jsx(N,{v:(A=a.nodes)==null?void 0:A.Device}),e.jsx("span",{children:"clearances in the graph"})]}),e.jsxs("div",{children:[e.jsx(N,{v:(S=a.citations_by_kind)==null?void 0:S.predicate}),e.jsx("span",{children:"predicate links, each with a page"})]}),e.jsxs("div",{children:[e.jsx(N,{v:(R=a.nodes)==null?void 0:R.Recall}),e.jsx("span",{children:"FDA recall records joined"})]})]})]})}),e.jsxs(w,{id:"the-filing",scene:1,mark:"01",label:"The filing",place:"left",statement:["One document","tells one step."],foot:"A 510(k) summary names its predicate. It does not tell you what became of it.",children:[e.jsxs("p",{className:"chapter-body",children:[i.name," (",e.jsx("span",{className:"k",children:i.k}),") was cleared on ",k(i.decision_date),". Its 510(k) summary names a single predicate, on page ",f.page,":"]}),e.jsxs("figure",{className:"doc","aria-label":`Quote from page ${f.page} of the ${i.k} summary`,children:[e.jsxs("div",{className:"doc-meta",children:[e.jsxs("span",{children:[i.k," · 510(k) summary"]}),e.jsxs("span",{children:["page ",f.page]})]}),e.jsxs("blockquote",{style:{margin:0},children:["“…",v[0],e.jsx("mark",{children:f.dst}),v[1],"”"]}),e.jsx("div",{style:{marginTop:10},children:e.jsxs("a",{href:q(i.summary_url,f.page),target:"_blank",rel:"noreferrer",children:["Open the FDA PDF at page ",f.page," ↗"]})})]})]}),e.jsx(w,{id:"the-connection",scene:2,mark:"02",label:"The connection",place:"right",statement:["Follow the thread","back in time."],foot:"Each thread is an edge in the graph, stored with its page, quote and source PDF.",children:e.jsxs("p",{className:"chapter-body",children:[e.jsx("span",{className:"k",children:i.k})," → ",e.jsx("span",{className:"k",children:d.k}),": the ",e.jsx("b",{children:d.name}),", cleared to ",d.applicant," on ",k(d.decision_date),". And ",d.k," cites predicates of its own: ",g.grand_predicates.map((u,b)=>e.jsxs(L.Fragment,{children:[b?b===g.grand_predicates.length-1?" and ":", ":"",e.jsx("span",{className:"k",children:u.k})]},u.k)),". FDA's databases answer one hop at a time. Relate walks them all in one variable-length query."]})}),e.jsxs(w,{id:"the-discovery",scene:3,mark:"03",label:"The discovery",place:"left",statement:["FDA recalls name",e.jsx("em",{children:"the predicate."},"e")],foot:"A recall on a predicate is not a finding about the new device. It is a question the predicate rationale should answer.",children:[e.jsxs("p",{className:"chapter-body",children:["On ",k(x.initiated)," a ",e.jsx("b",{children:x.classification})," recall of the BiPAP A30 began, root cause ",e.jsx("b",{children:x.root_cause}),": “",x.reason,"…” (event ",x.event,", records ",x.ids.join(" and "),")."]}),e.jsxs("div",{className:"fact-row",children:[e.jsxs("div",{className:"fact amber",children:[e.jsxs("b",{children:[y," yr ",p," mo"]}),e.jsxs("span",{children:["between recall start and ",i.k,"'s clearance"]})]}),e.jsxs("div",{className:"fact",children:[e.jsx("b",{children:"Review lineage"}),e.jsxs("span",{children:["deterministic verdict for ",i.k]})]})]}),e.jsx("p",{className:"chapter-body",style:{fontSize:14},children:"FDA's 2023 draft guidance recommends predicates not subject to design-related recalls."})]}),e.jsx("section",{id:"handoff",className:"handoff","aria-labelledby":"handoff-title",children:e.jsxs("div",{ref:m,className:"reveal","data-scene":"4",id:"handoff-copy",children:[e.jsxs("p",{className:"lead",id:"handoff-title",children:[e.jsx(_,{children:"Every fact above is real evidence."}),e.jsx(_,{children:e.jsx("em",{children:"Now work with it."})})]}),e.jsxs("a",{className:"btn btn-primary",href:`#/check/${i.k}`,"data-testid":"handoff-investigate",onClick:u=>{u.preventDefault(),s("check",i.k,{transition:!0})},children:["Open the investigation ",e.jsx("span",{className:"arr","aria-hidden":"true",children:"→"})]}),e.jsx("p",{className:"sub",children:"Every node, date and quote above is read from the shipped Relate store; the background field is illustrative."})]})}),e.jsxs("section",{className:"paths","aria-labelledby":"paths-title",children:[e.jsx("h2",{id:"paths-title",children:"Or start somewhere else"}),e.jsxs("div",{className:"path-grid",children:[e.jsxs("a",{className:"path-card",href:"#/reach/88058,88071",children:[e.jsx("span",{className:"k",children:"Recall 88058 + 88071"}),e.jsx("h3",{children:"Recall reach"}),e.jsx("p",{children:"From the June 2021 Philips foam recall: which later clearances descend from it?"})]}),e.jsxs("a",{className:"path-card",href:"#/watch",children:[e.jsx("span",{className:"k",children:"Watchlist"}),e.jsx("h3",{children:"Cited after a recall"}),e.jsx("p",{children:"Clearances whose predicate was already under a design-related recall."})]}),e.jsxs("a",{className:"path-card",href:"#/compare/K200480 K113053 K233643 K143677",children:[e.jsx("span",{className:"k",children:"Compare"}),e.jsx("h3",{children:"Choose a predicate"}),e.jsx("p",{children:"Candidate predicates side by side, with their own and inherited recalls."})]}),e.jsxs("a",{className:"path-card",href:"#/check/K251770",children:[e.jsx("span",{className:"k",children:"K251770"}),e.jsx("h3",{children:"SleepRes PAP System"}),e.jsx("p",{children:"Another 2025 clearance, another lineage."})]})]})]})]}),e.jsxs("footer",{className:"film-foot",children:[e.jsx("p",{children:"Public FDA data: openFDA 510(k), recall and enforcement records and 510(k) summary PDFs. Forebear reports documented lineage and recall history; it does not judge device safety. Not regulatory advice."}),e.jsx(B,{size:18})]})]})}export{Q as default,se as useMedia}; diff --git a/web/dist/assets/Views-Dyqeayth.js b/web/dist/assets/Views-Cl1sIo7q.js similarity index 99% rename from web/dist/assets/Views-Dyqeayth.js rename to web/dist/assets/Views-Cl1sIo7q.js index d9cffa6..047c100 100644 --- a/web/dist/assets/Views-Dyqeayth.js +++ b/web/dist/assets/Views-Cl1sIo7q.js @@ -1 +1 @@ -import{r as h,j as e,v as E,f as g,E as F,a as R,A as k,b as _,P as D,c as C,T as A}from"./index-DD2rN9W6.js";const y=({eyebrow:l,title:c,children:t})=>e.jsxs("div",{className:"page-head",children:[e.jsx("p",{className:"eyebrow",children:l}),e.jsx("h1",{children:c}),t&&e.jsx("p",{children:t})]}),S=l=>c=>{c.key==="Enter"&&l()};function $({initial:l,go:c}){const[t,o]=h.useState(l||"K200480 K113053 K233643 K143677"),[d,m]=h.useState(null),[p,n]=h.useState(null),[x,u]=h.useState(!1),a=(s=t)=>{const i=[...new Set(s.toUpperCase().match(/K\d{6}/g)||[])].slice(0,8);if(!i.length){n("Enter one or more K-numbers");return}n(null),u(!0),C.compare(i).then(m).catch(j=>n(j.message)).finally(()=>u(!1))};return h.useEffect(()=>{a(l||t)},[l]),e.jsxs("div",{children:[e.jsx(y,{eyebrow:"Investigate",title:"Compare candidate predicates",children:"FDA's draft guidance suggests documenting how each candidate predicate meets the selection best practices. This table covers the recall practice: each candidate's own recalls and those in its ancestry, computed live from the graph."}),e.jsxs("section",{className:"panel",children:[e.jsxs("form",{className:"row-in",onSubmit:s=>{s.preventDefault(),a()},children:[e.jsx("input",{className:"field",value:t,onChange:s=>o(s.target.value),"aria-label":"K-numbers to compare (up to 8)"}),e.jsx("button",{className:"btn btn-primary",disabled:x,children:x?"Comparing…":"Compare"})]}),p&&e.jsx("p",{className:"err",children:p})]}),d&&e.jsxs("section",{className:"panel",children:[e.jsx("div",{className:"tbl-wrap",children:e.jsxs("table",{className:"tbl",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Candidate"}),e.jsx("th",{children:"Cleared"}),e.jsx("th",{children:"Verdict"}),e.jsxs("th",{children:["Evidence",e.jsx("br",{}),"(verdict window)"]}),e.jsxs("th",{children:["Own recalls",e.jsx("br",{}),"(design)"]}),e.jsxs("th",{children:["Flagged ancestors",e.jsx("br",{}),"gen 1–2"]}),e.jsxs("th",{children:["Ancestors",e.jsx("br",{}),"(unread)"]}),e.jsx("th",{children:"Top signal"})]})}),e.jsx("tbody",{children:d.map(s=>{if(!s.found)return e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx("span",{className:"k mono",children:s.k})}),e.jsxs("td",{colSpan:7,className:"sub",children:["Not in the graph. ",e.jsx("a",{href:`#/ingest/${s.k}`,children:"Read it from FDA →"})]})]},s.k);const i=E(s.verdict,s.evidence);return e.jsxs("tr",{className:"click",tabIndex:0,"data-k":s.k,"data-evidence":s.evidence,onClick:()=>c("check",s.k),onKeyDown:S(()=>c("check",s.k)),children:[e.jsxs("td",{children:[e.jsx("span",{className:"k mono",children:s.k}),e.jsx("div",{className:"sub",children:s.name}),e.jsx("div",{className:"sub",children:s.applicant})]}),e.jsx("td",{className:"num",children:g(s.decision_date)}),e.jsxs("td",{children:[e.jsx("span",{className:`chip tone-${i.tone}`,"data-testid":"compare-verdict",children:i.label}),s.conditional&&e.jsx("div",{children:e.jsx("span",{className:"chip tone-violet",children:"conditional"})}),e.jsx("div",{className:"sub",style:{maxWidth:320},"data-testid":"compare-reason",children:s.verdict_reason})]}),e.jsxs("td",{children:[e.jsx("span",{className:`chip tone-${F[s.evidence]||"muted"}`,"data-testid":"compare-evidence",children:s.evidence}),(s.evidence_reasons||[]).map(j=>e.jsx("div",{className:"sub",children:R[j]||j},j))]}),e.jsxs("td",{className:"num",children:[s.own_recalls," ",e.jsxs("span",{className:"sub",children:["(",s.own_design_recalls,")"]})]}),e.jsx("td",{className:"num",children:s.flagged_ancestors_gen12}),e.jsxs("td",{className:"num",children:[s.ancestors," ",e.jsxs("span",{className:"sub",children:["(",s.lineage_unknown,")"]})]}),e.jsx("td",{className:"sub",style:{maxWidth:360},children:s.top_signal||"—"})]},s.k)})})]})}),e.jsx("p",{className:"graph-hint",children:"Verdicts are deterministic documentation signals; a lower count is not a statement that a device is safer. A verdict on partial or uncertain evidence is provisional: equal verdicts on unequal evidence are not equivalent."})]})]})}function K({initial:l,go:c}){const[t,o]=h.useState(l||"88058,88071"),[d,m]=h.useState(null),[p,n]=h.useState(null),x=(i=t)=>{n(null),m(null),C.recallEvent(i.replace(/\s/g,"")).then(m).catch(j=>n(j.message))};h.useEffect(()=>{o(l||"88058,88071"),x(l||"88058,88071")},[l]);const u=(d==null?void 0:d.descendants)||[],a=(d==null?void 0:d.counts)||{},s=[["after-supported","Cleared after the recall began · supported route",u.filter(i=>i.timing==="after"&&i.evidence==="supported"),'"After it began", not after it was resolved. A descendant is not recalled because of its ancestor.',!0],["after-conditional","Cleared after the recall began · conditional route only",u.filter(i=>i.timing==="after"&&i.evidence==="conditional"),"Every route to the recalled clearance runs through a citation the audit could not resolve.",!1],["same-day","Cleared the day the recall began",u.filter(i=>i.timing==="same_day"),"Same calendar day: the dates cannot order them, so these count as neither before nor after.",!1],["unknown","Timing unknown",u.filter(i=>i.timing==="unknown"),"A clearance date or recall start is missing.",!1],["before","Cleared before the recall began",u.filter(i=>i.timing==="before"),null,!0]];return e.jsxs("div",{children:[e.jsx(y,{eyebrow:"Recall evidence",title:"Recall reach",children:"Start from an FDA recall event. Forebear finds every clearance FDA lists on it, then every later clearance that cites one of them, up to three generations, and compares each clearance date with the recall start on its own supported route."}),e.jsxs("section",{className:"panel",children:[e.jsxs("form",{className:"row-in",onSubmit:i=>{i.preventDefault(),x()},children:[e.jsx("input",{className:"field",value:t,onChange:i=>o(i.target.value),"aria-label":"Recall event numbers, comma-separated"}),e.jsx("button",{className:"btn btn-primary",children:"Trace"})]}),e.jsxs("p",{className:"muted small",style:{marginBottom:0},children:["Examples: ",e.jsx("button",{className:"tag-btn",onClick:()=>{o("88058,88071"),x("88058,88071")},children:"88058,88071"})," Philips PE-PUR foam recall, June 2021 (openFDA files it as two events) ·"," ",e.jsx("button",{className:"tag-btn",onClick:()=>{o("86646"),x("86646")},children:"86646"})," ",e.jsx("button",{className:"tag-btn",onClick:()=>{o("84406"),x("84406")},children:"84406"})]}),p&&e.jsx("p",{className:"err",children:p})]}),!d&&!p&&e.jsxs("div",{className:"loading-thread",children:[e.jsx("i",{}),"Tracing descendants in Relate…"]}),d&&e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"panel","data-testid":"reach-stats",children:[e.jsxs("div",{className:"bigstats",children:[e.jsxs("div",{children:[e.jsx("b",{children:d.recalled.length}),e.jsxs("span",{children:["clearances FDA lists on recall event(s) ",d.event]})]}),e.jsxs("div",{children:[e.jsx("b",{children:u.length}),e.jsx("span",{children:"later clearances descend from them"})]}),e.jsxs("div",{className:"amber","data-testid":"reach-count-after",children:[e.jsx("b",{children:a.after_supported??0}),e.jsxs("span",{children:["cleared after the recall on a supported route began",d.initiated?` (earliest ${g(d.initiated)})`:""]})]}),e.jsxs("div",{className:"violet","data-testid":"reach-count-conditional",children:[e.jsx("b",{children:a.conditional??0}),e.jsxs("span",{children:["reached only through an unresolved citation (conditional)",a.after_conditional?`, ${a.after_conditional} of them cleared after`:""]})]}),(a.same_day>0||a.unknown>0)&&e.jsxs("div",{"data-testid":"reach-count-undetermined",children:[e.jsx("b",{children:(a.same_day||0)+(a.unknown||0)}),e.jsxs("span",{children:["timing not determinable (",a.same_day||0," same day, ",a.unknown||0," missing a date)"]})]})]}),e.jsx("div",{className:"tags",style:{marginTop:14},children:d.recalled.map(i=>e.jsxs("button",{className:"tag-btn",onClick:()=>c("check",i.k),"data-testid":"reach-holder",title:k[_(i)].text+(i.linked_before_clearance?" "+D.text:""),children:[e.jsx("span",{className:"k",children:i.k})," ",i.name," ",e.jsxs("span",{className:"muted",children:["· ",k[_(i)].short,i.linked_before_clearance?` · ${D.short.toLowerCase()}`:""]})]},i.k))}),e.jsx("p",{className:"muted small",style:{marginBottom:0},children:"FDA lists these clearances on the recall record. That is an association, not verified model identity: a name match is a fuzzy heuristic on the recall text, and a recall that began before a clearance does not by itself show whether that model was affected."})]}),e.jsx("section",{className:"panel",children:s.filter(([,,i,,j])=>j||i.length).map(([i,j,v,b],w)=>e.jsxs("div",{"data-testid":`reach-${i}`,children:[e.jsxs("div",{className:"panel-head",style:w?{marginTop:22}:void 0,children:[e.jsxs("h2",{children:[j," ",e.jsx("span",{className:"count",children:v.length})]}),b&&e.jsx("p",{className:"hint",children:b})]}),e.jsx(T,{rows:v,go:c})]},i))})]})]})}function T({rows:l,go:c}){return l.length?e.jsx("div",{className:"tbl-wrap",children:e.jsxs("table",{className:"tbl",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Device"}),e.jsx("th",{children:"Applicant"}),e.jsx("th",{children:"Cleared"}),e.jsxs("th",{children:["Recall began",e.jsx("br",{}),"on its route"]}),e.jsx("th",{children:"Distance"}),e.jsx("th",{children:"Descends from"})]})}),e.jsx("tbody",{children:l.map(t=>{var p;const o=t.evidence==="conditional",d=!o&&((p=t.conditional_via)==null?void 0:p.length)>0,m=t.supported_gen??t.gen;return e.jsxs("tr",{className:"click"+(o?" is-conditional":""),tabIndex:0,"data-k":t.k,"data-timing":t.timing,"data-evidence":t.evidence,onClick:()=>c("check",t.k),onKeyDown:S(()=>c("check",t.k)),children:[e.jsxs("td",{children:[e.jsx("span",{className:"k mono",children:t.k})," ",o&&e.jsx("span",{className:"chip tone-violet",children:"conditional"}),d&&e.jsx("span",{className:"chip tone-muted",title:"Some routes are supported, others rest on an unresolved citation",children:"mixed routes"}),e.jsx("div",{className:"sub",children:t.name})]}),e.jsx("td",{className:"sub",children:t.applicant}),e.jsx("td",{className:"num",children:g(t.decision_date)}),e.jsxs("td",{className:"num",children:[g(t.recall_started),e.jsx("div",{className:"sub",children:A[t.timing]}),d&&t.conditional_timing&&t.conditional_timing!==t.timing&&e.jsxs("div",{className:"sub",style:{color:"var(--violet)"},children:["Conditional route only: recall began ",g(t.conditional_recall_started),", ",A[t.conditional_timing]]})]}),e.jsx("td",{children:m===1?"direct predicate":`${m} generations`}),e.jsx("td",{className:"sub",children:t.via.map(n=>{var x,u;return e.jsxs("span",{style:(x=t.conditional_via)!=null&&x.includes(n)?{color:"var(--violet)"}:void 0,title:(u=t.conditional_via)!=null&&u.includes(n)?"Reached only through an unresolved citation":"Reached through a supported citation",children:[n," "]},n)})})]},t.k)})})]})}):e.jsx("p",{className:"muted",children:"None."})}function P({go:l}){const[c,t]=h.useState(null),[o,d]=h.useState(null),[m,p]=h.useState("all");h.useEffect(()=>{C.watchlist().then(t).catch(a=>d(a.message))},[]);const n=(c==null?void 0:c.rows)||[],x=n.filter(a=>m==="all"||m==="direct"&&a.supported_min_gen===1||m==="supported"&&!a.conditional||m==="conditional"&&a.conditional),u=(c==null?void 0:c.conditional)??n.filter(a=>a.conditional).length;return e.jsxs("div",{children:[e.jsx(y,{eyebrow:"Recall evidence",title:"Watchlist: cleared after a predicate recall began",children:"Clearances whose FDA decision date falls after a design-related recall had started on their predicate or grand-predicate. Only the clearance date is compared: it does not show when the predicate was chosen or cited, and the application's receipt date does not establish that either. Same-day dates are not counted as after. Close to, but not the same as, the JAMA study's measure (Class I predicate recalls, any cause). A question to ask, not a finding: the recall may have been fixed, or limited to lots or software versions."}),o&&e.jsx("p",{className:"err",children:o}),!c&&!o&&e.jsxs("div",{className:"loading-thread",children:[e.jsx("i",{}),"Querying the graph…"]}),c&&e.jsxs("section",{className:"panel",children:[e.jsxs("div",{className:"bigstats",children:[e.jsxs("div",{children:[e.jsx("b",{children:c.count}),e.jsx("span",{children:"clearances decided after a recall began on their lineage"})]}),e.jsxs("div",{className:"amber",children:[e.jsx("b",{children:c.direct_supported??c.direct}),e.jsx("span",{children:"cite a directly recalled predicate through a supported citation"})]}),e.jsxs("div",{className:"violet",children:[e.jsx("b",{children:u}),e.jsx("span",{children:"conditional: every route runs through an unresolved citation"})]})]}),e.jsx("div",{className:"seg",role:"group","aria-label":"Filter",style:{marginTop:14},children:[["all","All"],["direct","Direct predicate"],["supported","Supported routes"],["conditional","Conditional only"]].map(([a,s])=>e.jsx("button",{"aria-pressed":m===a,onClick:()=>p(a),children:s},a))})]}),c&&e.jsx("section",{className:"panel",children:e.jsx("div",{className:"tbl-wrap",children:e.jsxs("table",{className:"tbl",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Cleared device"}),e.jsx("th",{children:"Cleared · recall began"}),e.jsx("th",{children:"Recalled ancestor"}),e.jsx("th",{children:"Recall records"})]})}),e.jsx("tbody",{children:x.map(a=>e.jsxs("tr",{className:"click"+(a.conditional?" is-conditional":""),tabIndex:0,"data-k":a.k,onClick:()=>l("check",a.k),onKeyDown:S(()=>l("check",a.k)),children:[e.jsxs("td",{children:[e.jsx("span",{className:"k mono",children:a.k})," ",a.conditional&&e.jsx("span",{className:"chip tone-violet",children:"conditional"}),e.jsx("div",{className:"sub",children:a.name}),e.jsx("div",{className:"sub",children:a.applicant})]}),e.jsxs("td",{className:"num","data-testid":"watch-dates",children:["Cleared ",g(a.decision_date),e.jsxs("div",{className:"sub",children:["recall began ",g(a.recall_basis),a.days_after_recall!=null?`, ${a.days_after_recall} days earlier`:""]})]}),e.jsxs("td",{children:[e.jsx("span",{className:"mono",children:(a.conditional?a.ancestors:a.supported_ancestors||a.ancestors).join(", ")}),e.jsx("div",{className:"sub",children:a.conditional?"cited device · citation unresolved":a.supported_min_gen===1?"direct predicate":"grand-predicate"})]}),e.jsxs("td",{className:"sub",children:[a.recall_count>2&&e.jsxs("div",{className:"muted",children:[a.recall_count," recall routes; first two:"]}),a.recalls.slice(0,2).map(s=>e.jsxs("div",{children:[s.recall_id," · ",s.classification||"unclassified"," · ",s.root_cause," · ",g(s.initiated),s.conditional&&e.jsx("span",{style:{color:"var(--violet)"},children:" · conditional"}),e.jsxs("div",{className:"muted",title:k[_(s)].text+(s.linked_before_clearance?" "+D.text:""),"data-testid":"watch-attribution",children:[s.ancestor,": ",k[_(s)].short,s.linked_before_clearance?` · ${D.short.toLowerCase()}`:""]})]},s.recall_id+s.ancestor))]})]},a.k))})]})})})]})}function V({initial:l,go:c,onChanged:t}){var b,w;const[o,d]=h.useState(l||""),[m,p]=h.useState(!1),[n,x]=h.useState(null),[u,a]=h.useState(null),[s,i]=h.useState(!1);h.useEffect(()=>{l&&d(l)},[l]);const j=async()=>{p(!0),a(null),x(null);try{const r=await C.ingest(o,s);x(r),t&&t()}catch(r){a(r.message)}finally{p(!1)}},v=(r,f)=>Object.keys({...r,...f}).map(N=>[N,(f[N]||0)-(r[N]||0)]).filter(([,N])=>N);return e.jsxs("div",{children:[e.jsx(y,{eyebrow:"Graph",title:"Add a clearance",children:"Enter any 510(k) number. Forebear fetches its openFDA record and summary PDF live, extracts the predicates it cites, validates them against openFDA, links recalls, and MERGEs everything into the Relate store. Use it on an ancestor whose summary was not read to extend a lineage by one generation. Needs internet."}),e.jsxs("section",{className:"panel",children:[e.jsxs("form",{className:"row-in",onSubmit:r=>{r.preventDefault(),j()},children:[e.jsx("input",{className:"field",value:o,placeholder:"K-number, e.g. K241135",onChange:r=>d(r.target.value),"aria-label":"K-number to read from FDA"}),e.jsx("button",{className:"btn btn-primary",disabled:m||!o,children:m?"Reading from FDA…":"Read and add"})]}),e.jsxs("label",{className:"muted small",style:{display:"block",marginTop:8},children:[e.jsx("input",{type:"checkbox",checked:s,onChange:r=>i(r.target.checked),"data-testid":"ingest-refresh"})," ","Re-download the summary PDF from FDA to detect a changed document (otherwise the cached text is reused). Reviews made on an earlier version then need re-review."]}),m&&e.jsxs("div",{className:"loading-thread",children:[e.jsx("i",{}),"Downloading the summary PDF and extracting citations…"]}),u&&e.jsx("p",{className:"err",role:"alert",children:u})]}),n&&e.jsxs("section",{className:"panel",children:[e.jsx("div",{className:"panel-head",children:e.jsxs("h2",{children:[n.k,": ",n.was_present?n.lineage_was_known?"re-read":"lineage extended":"added to the graph"]})}),e.jsxs("p",{children:["Summary: ",e.jsx("b",{children:n.summary_status}),n.summary_url&&e.jsxs(e.Fragment,{children:[" · ",e.jsx("a",{href:n.summary_url,target:"_blank",rel:"noreferrer",children:"PDF ↗"})]})]}),n.refresh&&e.jsx("p",{className:"muted small","data-testid":"ingest-refresh-result",children:n.refresh.changed?`FDA's PDF changed (sha256 ${String(n.refresh.previous_sha256||"none").slice(0,12)} → ${String(n.summary_sha256).slice(0,12)}); citations were reconciled against the new text.`:"FDA's PDF is unchanged since it was cached."}),e.jsxs("p",{className:"muted",children:["Graph change: ",v(n.graph_before,n.graph_after).concat(v(n.rels_before,n.rels_after)).map(([r,f])=>`${f>0?"+":""}${f} ${r}`).join(" · ")||"no new nodes or relationships (already up to date)"]}),e.jsx("h3",{style:{fontSize:13},children:"Citations read from the summary"}),n.citations_added.length===0?e.jsxs("p",{className:"muted",children:["None found",n.summary_status!=="ok"?" (summary not machine-readable)":"","."]}):n.citations_added.map(r=>e.jsxs("div",{className:"cit",children:[e.jsxs("div",{className:"cit-h",children:[e.jsx("span",{className:"k mono",children:r.dst})," ",e.jsx("span",{className:"chip",children:r.kind})," ",e.jsxs("span",{className:"muted",children:["p.",r.page]})]}),e.jsxs("blockquote",{className:"quote",children:["“",r.snippet,"”"]})]},r.dst)),((w=(b=n.reconciliation)==null?void 0:b.retired)==null?void 0:w.length)>0&&e.jsxs(e.Fragment,{children:[e.jsx("h3",{style:{fontSize:13},children:"Citations no longer in the refreshed summary"}),e.jsxs("p",{className:"muted small","data-testid":"ingest-retired",children:["Retired from the lineage, kept with their reviews and provenance:"," ",n.reconciliation.retired.map(r=>`${r.dst}${r.review?` (${r.review} by ${r.reviewer||"unknown"})`:""}`).join(", "),"."]})]}),n.reconciliation&&!n.reconciliation.ran&&e.jsxs("p",{className:"muted small",children:[n.reconciliation.skipped_reason,"."]}),e.jsxs("p",{className:"muted small",children:[n.recalls_linked.length," recall record(s) linked."]}),e.jsxs("button",{className:"btn btn-primary",onClick:()=>c("check",n.k),children:["Investigate ",n.k," ",e.jsx("span",{className:"arr",children:"→"})]})]})]})}function L({stats:l}){return e.jsxs("div",{className:"method",children:[e.jsx(y,{eyebrow:"Method",title:"How Forebear decides, and what it does not",children:"Verdicts come from a small set of deterministic rules over Relate queries. They are documentation signals inside a stated scope, never safety findings."}),e.jsxs("section",{className:"panel",children:[e.jsx("div",{className:"panel-head",children:e.jsx("h2",{children:"What the verdict means"})}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("span",{className:"chip tone-alert",children:"Design-related recall on file"})," the candidate has a design-related recall of its own."]}),e.jsxs("li",{children:[e.jsx("span",{className:"chip tone-amber",children:"Review lineage"})," a direct or grand-predicate has a design-related recall (Class I/II or not yet classified), the direct predicate has a Class I recall, or the candidate has a Class I recall."]}),e.jsxs("li",{children:[e.jsx("span",{className:"chip tone-muted",children:"Lineage not checkable"})," the candidate's own predicates could not be read, or every direct predicate link rests on uncertain evidence, so nothing was checked."]}),e.jsxs("li",{children:[e.jsx("span",{className:"chip tone-calm",children:"No design-recall signal"})," none of the above in the readable ancestry. Lower-severity signals are still listed. Not a safety finding."]})]}),e.jsx("p",{className:"muted small",children:'"Design-related" means an openFDA root cause containing "design" but not "process". This is coarse. Lineage is limited to summaries that are online and machine-readable; gaps are reported, never filled in.'})]}),e.jsxs("section",{className:"panel",children:[e.jsx("div",{className:"panel-head",children:e.jsx("h2",{children:"How a thread is classified"})}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsxs("span",{className:"status status-confirmed",children:[e.jsx("span",{className:"line"}),"Confirmed"]})," a person confirmed the citation. Confirmations sent through the MCP client do not count."]}),e.jsxs("li",{children:[e.jsxs("span",{className:"status status-extracted",children:[e.jsx("span",{className:"line"}),"Machine-extracted"]})," read from the summary text, validated against openFDA, not yet reviewed."]}),e.jsxs("li",{children:[e.jsxs("span",{className:"status status-disputed",children:[e.jsx("span",{className:"line"}),"Disputed"]})," the cited device's FDA name is absent near the citation, it is in a different FDA panel, its K-number was corrected by the audit, or only an LLM labelled it a predicate."]}),e.jsxs("li",{children:[e.jsxs("span",{className:"status status-conditional",children:[e.jsx("span",{className:"line"}),"Conditional"]})," the extraction audit could not resolve the citation. Recalls reached only through it are marked conditional in assessments, the watchlist and recall reach."]}),e.jsxs("li",{children:[e.jsxs("span",{className:"status status-rejected",children:[e.jsx("span",{className:"line"}),"Rejected"]})," a reviewer removed it; it no longer counts in any lineage query."]})]})]}),e.jsxs("section",{className:"panel",children:[e.jsx("div",{className:"panel-head",children:e.jsx("h2",{children:"The optional agent"})}),e.jsx("p",{className:"lede",style:{margin:0},children:"An NVIDIA-hosted model can investigate a device by calling the same graph tools. Phase 3 evaluation found it unsuitable as the primary due-diligence workflow, so its findings appear only as history: never human-approved, never a verdict input, and unable to change lineage."})]}),e.jsxs("section",{className:"panel",children:[e.jsx("div",{className:"panel-head",children:e.jsx("h2",{children:"How it uses Relate"})}),e.jsxs("ol",{children:[e.jsxs("li",{children:[e.jsx("b",{children:"Ingest."})," openFDA 510(k), recall and enforcement records, and the text of each 510(k) summary PDF, with page-level evidence."]}),e.jsxs("li",{children:[e.jsx("b",{children:"Store."})," One single-file store, ",e.jsx("code",{children:"data/forebear.rl"}),": ",e.jsx("code",{children:"(:Device)-[:CITES]->(:Device)"}),", ",e.jsx("code",{children:"(:Device)-[:SUBJECT_OF]->(:Recall)"}),", saved ",e.jsx("code",{children:"(:Assessment)"})," nodes."]}),e.jsxs("li",{children:[e.jsx("b",{children:"Query."})," Variable-length Cypher walks the family tree both ways, joins recalls on every ancestor, compares dates."]}),e.jsxs("li",{children:[e.jsx("b",{children:"Update."})," Ingest, review a citation, save an assessment: each is a graph write the next query reads."]})]}),l&&e.jsxs("p",{className:"muted small",children:["Live: ",l.nodes.Device.toLocaleString("en-US")," devices, ",l.relationships.CITES.toLocaleString("en-US")," citation edges, ",l.nodes.Recall.toLocaleString("en-US")," recall records."]})]})]})}export{$ as CompareView,V as IngestView,L as MethodView,K as ReachView,P as WatchlistView}; +import{r as h,j as e,v as E,f as g,E as F,a as R,A as k,b as _,P as D,c as C,T as A}from"./index-Ch_7cPZN.js";const y=({eyebrow:l,title:c,children:t})=>e.jsxs("div",{className:"page-head",children:[e.jsx("p",{className:"eyebrow",children:l}),e.jsx("h1",{children:c}),t&&e.jsx("p",{children:t})]}),S=l=>c=>{c.key==="Enter"&&l()};function $({initial:l,go:c}){const[t,o]=h.useState(l||"K200480 K113053 K233643 K143677"),[d,m]=h.useState(null),[p,n]=h.useState(null),[x,u]=h.useState(!1),a=(s=t)=>{const i=[...new Set(s.toUpperCase().match(/K\d{6}/g)||[])].slice(0,8);if(!i.length){n("Enter one or more K-numbers");return}n(null),u(!0),C.compare(i).then(m).catch(j=>n(j.message)).finally(()=>u(!1))};return h.useEffect(()=>{a(l||t)},[l]),e.jsxs("div",{children:[e.jsx(y,{eyebrow:"Investigate",title:"Compare candidate predicates",children:"FDA's draft guidance suggests documenting how each candidate predicate meets the selection best practices. This table covers the recall practice: each candidate's own recalls and those in its ancestry, computed live from the graph."}),e.jsxs("section",{className:"panel",children:[e.jsxs("form",{className:"row-in",onSubmit:s=>{s.preventDefault(),a()},children:[e.jsx("input",{className:"field",value:t,onChange:s=>o(s.target.value),"aria-label":"K-numbers to compare (up to 8)"}),e.jsx("button",{className:"btn btn-primary",disabled:x,children:x?"Comparing…":"Compare"})]}),p&&e.jsx("p",{className:"err",children:p})]}),d&&e.jsxs("section",{className:"panel",children:[e.jsx("div",{className:"tbl-wrap",children:e.jsxs("table",{className:"tbl",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Candidate"}),e.jsx("th",{children:"Cleared"}),e.jsx("th",{children:"Verdict"}),e.jsxs("th",{children:["Evidence",e.jsx("br",{}),"(verdict window)"]}),e.jsxs("th",{children:["Own recalls",e.jsx("br",{}),"(design)"]}),e.jsxs("th",{children:["Flagged ancestors",e.jsx("br",{}),"gen 1–2"]}),e.jsxs("th",{children:["Ancestors",e.jsx("br",{}),"(unread)"]}),e.jsx("th",{children:"Top signal"})]})}),e.jsx("tbody",{children:d.map(s=>{if(!s.found)return e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx("span",{className:"k mono",children:s.k})}),e.jsxs("td",{colSpan:7,className:"sub",children:["Not in the graph. ",e.jsx("a",{href:`#/ingest/${s.k}`,children:"Read it from FDA →"})]})]},s.k);const i=E(s.verdict,s.evidence);return e.jsxs("tr",{className:"click",tabIndex:0,"data-k":s.k,"data-evidence":s.evidence,onClick:()=>c("check",s.k),onKeyDown:S(()=>c("check",s.k)),children:[e.jsxs("td",{children:[e.jsx("span",{className:"k mono",children:s.k}),e.jsx("div",{className:"sub",children:s.name}),e.jsx("div",{className:"sub",children:s.applicant})]}),e.jsx("td",{className:"num",children:g(s.decision_date)}),e.jsxs("td",{children:[e.jsx("span",{className:`chip tone-${i.tone}`,"data-testid":"compare-verdict",children:i.label}),s.conditional&&e.jsx("div",{children:e.jsx("span",{className:"chip tone-violet",children:"conditional"})}),e.jsx("div",{className:"sub",style:{maxWidth:320},"data-testid":"compare-reason",children:s.verdict_reason})]}),e.jsxs("td",{children:[e.jsx("span",{className:`chip tone-${F[s.evidence]||"muted"}`,"data-testid":"compare-evidence",children:s.evidence}),(s.evidence_reasons||[]).map(j=>e.jsx("div",{className:"sub",children:R[j]||j},j))]}),e.jsxs("td",{className:"num",children:[s.own_recalls," ",e.jsxs("span",{className:"sub",children:["(",s.own_design_recalls,")"]})]}),e.jsx("td",{className:"num",children:s.flagged_ancestors_gen12}),e.jsxs("td",{className:"num",children:[s.ancestors," ",e.jsxs("span",{className:"sub",children:["(",s.lineage_unknown,")"]})]}),e.jsx("td",{className:"sub",style:{maxWidth:360},children:s.top_signal||"—"})]},s.k)})})]})}),e.jsx("p",{className:"graph-hint",children:"Verdicts are deterministic documentation signals; a lower count is not a statement that a device is safer. A verdict on partial or uncertain evidence is provisional: equal verdicts on unequal evidence are not equivalent."})]})]})}function K({initial:l,go:c}){const[t,o]=h.useState(l||"88058,88071"),[d,m]=h.useState(null),[p,n]=h.useState(null),x=(i=t)=>{n(null),m(null),C.recallEvent(i.replace(/\s/g,"")).then(m).catch(j=>n(j.message))};h.useEffect(()=>{o(l||"88058,88071"),x(l||"88058,88071")},[l]);const u=(d==null?void 0:d.descendants)||[],a=(d==null?void 0:d.counts)||{},s=[["after-supported","Cleared after the recall began · supported route",u.filter(i=>i.timing==="after"&&i.evidence==="supported"),'"After it began", not after it was resolved. A descendant is not recalled because of its ancestor.',!0],["after-conditional","Cleared after the recall began · conditional route only",u.filter(i=>i.timing==="after"&&i.evidence==="conditional"),"Every route to the recalled clearance runs through a citation the audit could not resolve.",!1],["same-day","Cleared the day the recall began",u.filter(i=>i.timing==="same_day"),"Same calendar day: the dates cannot order them, so these count as neither before nor after.",!1],["unknown","Timing unknown",u.filter(i=>i.timing==="unknown"),"A clearance date or recall start is missing.",!1],["before","Cleared before the recall began",u.filter(i=>i.timing==="before"),null,!0]];return e.jsxs("div",{children:[e.jsx(y,{eyebrow:"Recall evidence",title:"Recall reach",children:"Start from an FDA recall event. Forebear finds every clearance FDA lists on it, then every later clearance that cites one of them, up to three generations, and compares each clearance date with the recall start on its own supported route."}),e.jsxs("section",{className:"panel",children:[e.jsxs("form",{className:"row-in",onSubmit:i=>{i.preventDefault(),x()},children:[e.jsx("input",{className:"field",value:t,onChange:i=>o(i.target.value),"aria-label":"Recall event numbers, comma-separated"}),e.jsx("button",{className:"btn btn-primary",children:"Trace"})]}),e.jsxs("p",{className:"muted small",style:{marginBottom:0},children:["Examples: ",e.jsx("button",{className:"tag-btn",onClick:()=>{o("88058,88071"),x("88058,88071")},children:"88058,88071"})," Philips PE-PUR foam recall, June 2021 (openFDA files it as two events) ·"," ",e.jsx("button",{className:"tag-btn",onClick:()=>{o("86646"),x("86646")},children:"86646"})," ",e.jsx("button",{className:"tag-btn",onClick:()=>{o("84406"),x("84406")},children:"84406"})]}),p&&e.jsx("p",{className:"err",children:p})]}),!d&&!p&&e.jsxs("div",{className:"loading-thread",children:[e.jsx("i",{}),"Tracing descendants in Relate…"]}),d&&e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"panel","data-testid":"reach-stats",children:[e.jsxs("div",{className:"bigstats",children:[e.jsxs("div",{children:[e.jsx("b",{children:d.recalled.length}),e.jsxs("span",{children:["clearances FDA lists on recall event(s) ",d.event]})]}),e.jsxs("div",{children:[e.jsx("b",{children:u.length}),e.jsx("span",{children:"later clearances descend from them"})]}),e.jsxs("div",{className:"amber","data-testid":"reach-count-after",children:[e.jsx("b",{children:a.after_supported??0}),e.jsxs("span",{children:["cleared after the recall on a supported route began",d.initiated?` (earliest ${g(d.initiated)})`:""]})]}),e.jsxs("div",{className:"violet","data-testid":"reach-count-conditional",children:[e.jsx("b",{children:a.conditional??0}),e.jsxs("span",{children:["reached only through an unresolved citation (conditional)",a.after_conditional?`, ${a.after_conditional} of them cleared after`:""]})]}),(a.same_day>0||a.unknown>0)&&e.jsxs("div",{"data-testid":"reach-count-undetermined",children:[e.jsx("b",{children:(a.same_day||0)+(a.unknown||0)}),e.jsxs("span",{children:["timing not determinable (",a.same_day||0," same day, ",a.unknown||0," missing a date)"]})]})]}),e.jsx("div",{className:"tags",style:{marginTop:14},children:d.recalled.map(i=>e.jsxs("button",{className:"tag-btn",onClick:()=>c("check",i.k),"data-testid":"reach-holder",title:k[_(i)].text+(i.linked_before_clearance?" "+D.text:""),children:[e.jsx("span",{className:"k",children:i.k})," ",i.name," ",e.jsxs("span",{className:"muted",children:["· ",k[_(i)].short,i.linked_before_clearance?` · ${D.short.toLowerCase()}`:""]})]},i.k))}),e.jsx("p",{className:"muted small",style:{marginBottom:0},children:"FDA lists these clearances on the recall record. That is an association, not verified model identity: a name match is a fuzzy heuristic on the recall text, and a recall that began before a clearance does not by itself show whether that model was affected."})]}),e.jsx("section",{className:"panel",children:s.filter(([,,i,,j])=>j||i.length).map(([i,j,v,b],w)=>e.jsxs("div",{"data-testid":`reach-${i}`,children:[e.jsxs("div",{className:"panel-head",style:w?{marginTop:22}:void 0,children:[e.jsxs("h2",{children:[j," ",e.jsx("span",{className:"count",children:v.length})]}),b&&e.jsx("p",{className:"hint",children:b})]}),e.jsx(T,{rows:v,go:c})]},i))})]})]})}function T({rows:l,go:c}){return l.length?e.jsx("div",{className:"tbl-wrap",children:e.jsxs("table",{className:"tbl",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Device"}),e.jsx("th",{children:"Applicant"}),e.jsx("th",{children:"Cleared"}),e.jsxs("th",{children:["Recall began",e.jsx("br",{}),"on its route"]}),e.jsx("th",{children:"Distance"}),e.jsx("th",{children:"Descends from"})]})}),e.jsx("tbody",{children:l.map(t=>{var p;const o=t.evidence==="conditional",d=!o&&((p=t.conditional_via)==null?void 0:p.length)>0,m=t.supported_gen??t.gen;return e.jsxs("tr",{className:"click"+(o?" is-conditional":""),tabIndex:0,"data-k":t.k,"data-timing":t.timing,"data-evidence":t.evidence,onClick:()=>c("check",t.k),onKeyDown:S(()=>c("check",t.k)),children:[e.jsxs("td",{children:[e.jsx("span",{className:"k mono",children:t.k})," ",o&&e.jsx("span",{className:"chip tone-violet",children:"conditional"}),d&&e.jsx("span",{className:"chip tone-muted",title:"Some routes are supported, others rest on an unresolved citation",children:"mixed routes"}),e.jsx("div",{className:"sub",children:t.name})]}),e.jsx("td",{className:"sub",children:t.applicant}),e.jsx("td",{className:"num",children:g(t.decision_date)}),e.jsxs("td",{className:"num",children:[g(t.recall_started),e.jsx("div",{className:"sub",children:A[t.timing]}),d&&t.conditional_timing&&t.conditional_timing!==t.timing&&e.jsxs("div",{className:"sub",style:{color:"var(--violet)"},children:["Conditional route only: recall began ",g(t.conditional_recall_started),", ",A[t.conditional_timing]]})]}),e.jsx("td",{children:m===1?"direct predicate":`${m} generations`}),e.jsx("td",{className:"sub",children:t.via.map(n=>{var x,u;return e.jsxs("span",{style:(x=t.conditional_via)!=null&&x.includes(n)?{color:"var(--violet)"}:void 0,title:(u=t.conditional_via)!=null&&u.includes(n)?"Reached only through an unresolved citation":"Reached through a supported citation",children:[n," "]},n)})})]},t.k)})})]})}):e.jsx("p",{className:"muted",children:"None."})}function P({go:l}){const[c,t]=h.useState(null),[o,d]=h.useState(null),[m,p]=h.useState("all");h.useEffect(()=>{C.watchlist().then(t).catch(a=>d(a.message))},[]);const n=(c==null?void 0:c.rows)||[],x=n.filter(a=>m==="all"||m==="direct"&&a.supported_min_gen===1||m==="supported"&&!a.conditional||m==="conditional"&&a.conditional),u=(c==null?void 0:c.conditional)??n.filter(a=>a.conditional).length;return e.jsxs("div",{children:[e.jsx(y,{eyebrow:"Recall evidence",title:"Watchlist: cleared after a predicate recall began",children:"Clearances whose FDA decision date falls after a design-related recall had started on their predicate or grand-predicate. Only the clearance date is compared: it does not show when the predicate was chosen or cited, and the application's receipt date does not establish that either. Same-day dates are not counted as after. Close to, but not the same as, the JAMA study's measure (Class I predicate recalls, any cause). A question to ask, not a finding: the recall may have been fixed, or limited to lots or software versions."}),o&&e.jsx("p",{className:"err",children:o}),!c&&!o&&e.jsxs("div",{className:"loading-thread",children:[e.jsx("i",{}),"Querying the graph…"]}),c&&e.jsxs("section",{className:"panel",children:[e.jsxs("div",{className:"bigstats",children:[e.jsxs("div",{children:[e.jsx("b",{children:c.count}),e.jsx("span",{children:"clearances decided after a recall began on their lineage"})]}),e.jsxs("div",{className:"amber",children:[e.jsx("b",{children:c.direct_supported??c.direct}),e.jsx("span",{children:"cite a directly recalled predicate through a supported citation"})]}),e.jsxs("div",{className:"violet",children:[e.jsx("b",{children:u}),e.jsx("span",{children:"conditional: every route runs through an unresolved citation"})]})]}),e.jsx("div",{className:"seg",role:"group","aria-label":"Filter",style:{marginTop:14},children:[["all","All"],["direct","Direct predicate"],["supported","Supported routes"],["conditional","Conditional only"]].map(([a,s])=>e.jsx("button",{"aria-pressed":m===a,onClick:()=>p(a),children:s},a))})]}),c&&e.jsx("section",{className:"panel",children:e.jsx("div",{className:"tbl-wrap",children:e.jsxs("table",{className:"tbl",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Cleared device"}),e.jsx("th",{children:"Cleared · recall began"}),e.jsx("th",{children:"Recalled ancestor"}),e.jsx("th",{children:"Recall records"})]})}),e.jsx("tbody",{children:x.map(a=>e.jsxs("tr",{className:"click"+(a.conditional?" is-conditional":""),tabIndex:0,"data-k":a.k,onClick:()=>l("check",a.k),onKeyDown:S(()=>l("check",a.k)),children:[e.jsxs("td",{children:[e.jsx("span",{className:"k mono",children:a.k})," ",a.conditional&&e.jsx("span",{className:"chip tone-violet",children:"conditional"}),e.jsx("div",{className:"sub",children:a.name}),e.jsx("div",{className:"sub",children:a.applicant})]}),e.jsxs("td",{className:"num","data-testid":"watch-dates",children:["Cleared ",g(a.decision_date),e.jsxs("div",{className:"sub",children:["recall began ",g(a.recall_basis),a.days_after_recall!=null?`, ${a.days_after_recall} days earlier`:""]})]}),e.jsxs("td",{children:[e.jsx("span",{className:"mono",children:(a.conditional?a.ancestors:a.supported_ancestors||a.ancestors).join(", ")}),e.jsx("div",{className:"sub",children:a.conditional?"cited device · citation unresolved":a.supported_min_gen===1?"direct predicate":"grand-predicate"})]}),e.jsxs("td",{className:"sub",children:[a.recall_count>2&&e.jsxs("div",{className:"muted",children:[a.recall_count," recall routes; first two:"]}),a.recalls.slice(0,2).map(s=>e.jsxs("div",{children:[s.recall_id," · ",s.classification||"unclassified"," · ",s.root_cause," · ",g(s.initiated),s.conditional&&e.jsx("span",{style:{color:"var(--violet)"},children:" · conditional"}),e.jsxs("div",{className:"muted",title:k[_(s)].text+(s.linked_before_clearance?" "+D.text:""),"data-testid":"watch-attribution",children:[s.ancestor,": ",k[_(s)].short,s.linked_before_clearance?` · ${D.short.toLowerCase()}`:""]})]},s.recall_id+s.ancestor))]})]},a.k))})]})})})]})}function V({initial:l,go:c,onChanged:t}){var b,w;const[o,d]=h.useState(l||""),[m,p]=h.useState(!1),[n,x]=h.useState(null),[u,a]=h.useState(null),[s,i]=h.useState(!1);h.useEffect(()=>{l&&d(l)},[l]);const j=async()=>{p(!0),a(null),x(null);try{const r=await C.ingest(o,s);x(r),t&&t()}catch(r){a(r.message)}finally{p(!1)}},v=(r,f)=>Object.keys({...r,...f}).map(N=>[N,(f[N]||0)-(r[N]||0)]).filter(([,N])=>N);return e.jsxs("div",{children:[e.jsx(y,{eyebrow:"Graph",title:"Add a clearance",children:"Enter any 510(k) number. Forebear fetches its openFDA record and summary PDF live, extracts the predicates it cites, validates them against openFDA, links recalls, and MERGEs everything into the Relate store. Use it on an ancestor whose summary was not read to extend a lineage by one generation. Needs internet."}),e.jsxs("section",{className:"panel",children:[e.jsxs("form",{className:"row-in",onSubmit:r=>{r.preventDefault(),j()},children:[e.jsx("input",{className:"field",value:o,placeholder:"K-number, e.g. K241135",onChange:r=>d(r.target.value),"aria-label":"K-number to read from FDA"}),e.jsx("button",{className:"btn btn-primary",disabled:m||!o,children:m?"Reading from FDA…":"Read and add"})]}),e.jsxs("label",{className:"muted small",style:{display:"block",marginTop:8},children:[e.jsx("input",{type:"checkbox",checked:s,onChange:r=>i(r.target.checked),"data-testid":"ingest-refresh"})," ","Re-download the summary PDF from FDA to detect a changed document (otherwise the cached text is reused). Reviews made on an earlier version then need re-review."]}),m&&e.jsxs("div",{className:"loading-thread",children:[e.jsx("i",{}),"Downloading the summary PDF and extracting citations…"]}),u&&e.jsx("p",{className:"err",role:"alert",children:u})]}),n&&e.jsxs("section",{className:"panel",children:[e.jsx("div",{className:"panel-head",children:e.jsxs("h2",{children:[n.k,": ",n.was_present?n.lineage_was_known?"re-read":"lineage extended":"added to the graph"]})}),e.jsxs("p",{children:["Summary: ",e.jsx("b",{children:n.summary_status}),n.summary_url&&e.jsxs(e.Fragment,{children:[" · ",e.jsx("a",{href:n.summary_url,target:"_blank",rel:"noreferrer",children:"PDF ↗"})]})]}),n.refresh&&e.jsx("p",{className:"muted small","data-testid":"ingest-refresh-result",children:n.refresh.changed?`FDA's PDF changed (sha256 ${String(n.refresh.previous_sha256||"none").slice(0,12)} → ${String(n.summary_sha256).slice(0,12)}); citations were reconciled against the new text.`:"FDA's PDF is unchanged since it was cached."}),e.jsxs("p",{className:"muted",children:["Graph change: ",v(n.graph_before,n.graph_after).concat(v(n.rels_before,n.rels_after)).map(([r,f])=>`${f>0?"+":""}${f} ${r}`).join(" · ")||"no new nodes or relationships (already up to date)"]}),e.jsx("h3",{style:{fontSize:13},children:"Citations read from the summary"}),n.citations_added.length===0?e.jsxs("p",{className:"muted",children:["None found",n.summary_status!=="ok"?" (summary not machine-readable)":"","."]}):n.citations_added.map(r=>e.jsxs("div",{className:"cit",children:[e.jsxs("div",{className:"cit-h",children:[e.jsx("span",{className:"k mono",children:r.dst})," ",e.jsx("span",{className:"chip",children:r.kind})," ",e.jsxs("span",{className:"muted",children:["p.",r.page]})]}),e.jsxs("blockquote",{className:"quote",children:["“",r.snippet,"”"]})]},r.dst)),((w=(b=n.reconciliation)==null?void 0:b.retired)==null?void 0:w.length)>0&&e.jsxs(e.Fragment,{children:[e.jsx("h3",{style:{fontSize:13},children:"Citations no longer in the refreshed summary"}),e.jsxs("p",{className:"muted small","data-testid":"ingest-retired",children:["Retired from the lineage, kept with their reviews and provenance:"," ",n.reconciliation.retired.map(r=>`${r.dst}${r.review?` (${r.review} by ${r.reviewer||"unknown"})`:""}`).join(", "),"."]})]}),n.reconciliation&&!n.reconciliation.ran&&e.jsxs("p",{className:"muted small",children:[n.reconciliation.skipped_reason,"."]}),e.jsxs("p",{className:"muted small",children:[n.recalls_linked.length," recall record(s) linked."]}),e.jsxs("button",{className:"btn btn-primary",onClick:()=>c("check",n.k),children:["Investigate ",n.k," ",e.jsx("span",{className:"arr",children:"→"})]})]})]})}function L({stats:l}){return e.jsxs("div",{className:"method",children:[e.jsx(y,{eyebrow:"Method",title:"How Forebear decides, and what it does not",children:"Verdicts come from a small set of deterministic rules over Relate queries. They are documentation signals inside a stated scope, never safety findings."}),e.jsxs("section",{className:"panel",children:[e.jsx("div",{className:"panel-head",children:e.jsx("h2",{children:"What the verdict means"})}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("span",{className:"chip tone-alert",children:"Design-related recall on file"})," the candidate has a design-related recall of its own."]}),e.jsxs("li",{children:[e.jsx("span",{className:"chip tone-amber",children:"Review lineage"})," a direct or grand-predicate has a design-related recall (Class I/II or not yet classified), the direct predicate has a Class I recall, or the candidate has a Class I recall."]}),e.jsxs("li",{children:[e.jsx("span",{className:"chip tone-muted",children:"Lineage not checkable"})," the candidate's own predicates could not be read, or every direct predicate link rests on uncertain evidence, so nothing was checked."]}),e.jsxs("li",{children:[e.jsx("span",{className:"chip tone-calm",children:"No design-recall signal"})," none of the above in the readable ancestry. Lower-severity signals are still listed. Not a safety finding."]})]}),e.jsx("p",{className:"muted small",children:'"Design-related" means an openFDA root cause containing "design" but not "process". This is coarse. Lineage is limited to summaries that are online and machine-readable; gaps are reported, never filled in.'})]}),e.jsxs("section",{className:"panel",children:[e.jsx("div",{className:"panel-head",children:e.jsx("h2",{children:"How a thread is classified"})}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsxs("span",{className:"status status-confirmed",children:[e.jsx("span",{className:"line"}),"Confirmed"]})," a person confirmed the citation. Confirmations sent through the MCP client do not count."]}),e.jsxs("li",{children:[e.jsxs("span",{className:"status status-extracted",children:[e.jsx("span",{className:"line"}),"Machine-extracted"]})," read from the summary text, validated against openFDA, not yet reviewed."]}),e.jsxs("li",{children:[e.jsxs("span",{className:"status status-disputed",children:[e.jsx("span",{className:"line"}),"Disputed"]})," the cited device's FDA name is absent near the citation, it is in a different FDA panel, its K-number was corrected by the audit, or only an LLM labelled it a predicate."]}),e.jsxs("li",{children:[e.jsxs("span",{className:"status status-conditional",children:[e.jsx("span",{className:"line"}),"Conditional"]})," the extraction audit could not resolve the citation. Recalls reached only through it are marked conditional in assessments, the watchlist and recall reach."]}),e.jsxs("li",{children:[e.jsxs("span",{className:"status status-rejected",children:[e.jsx("span",{className:"line"}),"Rejected"]})," a reviewer removed it; it no longer counts in any lineage query."]})]})]}),e.jsxs("section",{className:"panel",children:[e.jsx("div",{className:"panel-head",children:e.jsx("h2",{children:"The optional agent"})}),e.jsx("p",{className:"lede",style:{margin:0},children:"An NVIDIA-hosted model can investigate a device by calling the same graph tools. Phase 3 evaluation found it unsuitable as the primary due-diligence workflow, so its findings appear only as history: never human-approved, never a verdict input, and unable to change lineage."})]}),e.jsxs("section",{className:"panel",children:[e.jsx("div",{className:"panel-head",children:e.jsx("h2",{children:"How it uses Relate"})}),e.jsxs("ol",{children:[e.jsxs("li",{children:[e.jsx("b",{children:"Ingest."})," openFDA 510(k), recall and enforcement records, and the text of each 510(k) summary PDF, with page-level evidence."]}),e.jsxs("li",{children:[e.jsx("b",{children:"Store."})," One single-file store, ",e.jsx("code",{children:"data/forebear.rl"}),": ",e.jsx("code",{children:"(:Device)-[:CITES]->(:Device)"}),", ",e.jsx("code",{children:"(:Device)-[:SUBJECT_OF]->(:Recall)"}),", saved ",e.jsx("code",{children:"(:Assessment)"})," nodes."]}),e.jsxs("li",{children:[e.jsx("b",{children:"Query."})," Variable-length Cypher walks the family tree both ways, joins recalls on every ancestor, compares dates."]}),e.jsxs("li",{children:[e.jsx("b",{children:"Update."})," Ingest, review a citation, save an assessment: each is a graph write the next query reads."]})]}),l&&e.jsxs("p",{className:"muted small",children:["Live: ",l.nodes.Device.toLocaleString("en-US")," devices, ",l.relationships.CITES.toLocaleString("en-US")," citation edges, ",l.nodes.Recall.toLocaleString("en-US")," recall records."]})]})]})}export{$ as CompareView,V as IngestView,L as MethodView,K as ReachView,P as WatchlistView}; diff --git a/web/dist/assets/index-Ch_7cPZN.js b/web/dist/assets/index-Ch_7cPZN.js new file mode 100644 index 0000000..3193dc7 --- /dev/null +++ b/web/dist/assets/index-Ch_7cPZN.js @@ -0,0 +1,44 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const s of l)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(l){const s={};return l.integrity&&(s.integrity=l.integrity),l.referrerPolicy&&(s.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?s.credentials="include":l.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(l){if(l.ep)return;l.ep=!0;const s=n(l);fetch(l.href,s)}})();function td(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Lo={exports:{}},Sl={},Ro={exports:{}},z={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var dr=Symbol.for("react.element"),nd=Symbol.for("react.portal"),rd=Symbol.for("react.fragment"),ld=Symbol.for("react.strict_mode"),sd=Symbol.for("react.profiler"),id=Symbol.for("react.provider"),ad=Symbol.for("react.context"),od=Symbol.for("react.forward_ref"),ud=Symbol.for("react.suspense"),cd=Symbol.for("react.memo"),dd=Symbol.for("react.lazy"),da=Symbol.iterator;function fd(e){return e===null||typeof e!="object"?null:(e=da&&e[da]||e["@@iterator"],typeof e=="function"?e:null)}var Do={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},$o=Object.assign,zo={};function jn(e,t,n){this.props=e,this.context=t,this.refs=zo,this.updater=n||Do}jn.prototype.isReactComponent={};jn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};jn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Fo(){}Fo.prototype=jn.prototype;function fi(e,t,n){this.props=e,this.context=t,this.refs=zo,this.updater=n||Do}var pi=fi.prototype=new Fo;pi.constructor=fi;$o(pi,jn.prototype);pi.isPureReactComponent=!0;var fa=Array.isArray,Mo=Object.prototype.hasOwnProperty,hi={current:null},Io={key:!0,ref:!0,__self:!0,__source:!0};function Ao(e,t,n){var r,l={},s=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(s=""+t.key),t)Mo.call(t,r)&&!Io.hasOwnProperty(r)&&(l[r]=t[r]);var o=arguments.length-2;if(o===1)l.children=n;else if(1>>1,ee=T[X];if(0>>1;Xl(Vl,$))Rtl(gr,Vl)?(T[X]=gr,T[Rt]=$,X=Rt):(T[X]=Vl,T[Lt]=$,X=Lt);else if(Rtl(gr,$))T[X]=gr,T[Rt]=$,X=Rt;else break e}}return D}function l(T,D){var $=T.sortIndex-D.sortIndex;return $!==0?$:T.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var u=[],c=[],p=1,h=null,f=3,v=!1,y=!1,x=!1,C=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,d=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(T){for(var D=n(c);D!==null;){if(D.callback===null)r(c);else if(D.startTime<=T)r(c),D.sortIndex=D.expirationTime,t(u,D);else break;D=n(c)}}function w(T){if(x=!1,m(T),!y)if(n(u)!==null)y=!0,Ze(_);else{var D=n(c);D!==null&&F(w,D.startTime-T)}}function _(T,D){y=!1,x&&(x=!1,g(k),k=-1),v=!0;var $=f;try{for(m(D),h=n(u);h!==null&&(!(h.expirationTime>D)||T&&!I());){var X=h.callback;if(typeof X=="function"){h.callback=null,f=h.priorityLevel;var ee=X(h.expirationTime<=D);D=e.unstable_now(),typeof ee=="function"?h.callback=ee:h===n(u)&&r(u),m(D)}else r(u);h=n(u)}if(h!==null)var vr=!0;else{var Lt=n(c);Lt!==null&&F(w,Lt.startTime-D),vr=!1}return vr}finally{h=null,f=$,v=!1}}var E=!1,j=null,k=-1,R=5,P=-1;function I(){return!(e.unstable_now()-PT||125X?(T.sortIndex=$,t(c,T),n(u)===null&&T===n(c)&&(x?(g(k),k=-1):x=!0,F(w,$-X))):(T.sortIndex=ee,t(u,T),y||v||(y=!0,Ze(_))),T},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(T){var D=f;return function(){var $=f;f=D;try{return T.apply(this,arguments)}finally{f=$}}}})(Bo);Wo.exports=Bo;var Nd=Wo.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Sd=S,Ee=Nd;function N(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gs=Object.prototype.hasOwnProperty,_d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,ha={},ma={};function Ed(e){return gs.call(ma,e)?!0:gs.call(ha,e)?!1:_d.test(e)?ma[e]=!0:(ha[e]=!0,!1)}function Cd(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Td(e,t,n,r){if(t===null||typeof t>"u"||Cd(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function he(e,t,n,r,l,s,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=a}var se={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){se[e]=new he(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];se[t]=new he(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){se[e]=new he(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){se[e]=new he(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){se[e]=new he(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){se[e]=new he(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){se[e]=new he(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){se[e]=new he(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){se[e]=new he(e,5,!1,e.toLowerCase(),null,!1,!1)});var vi=/[\-:]([a-z])/g;function gi(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(vi,gi);se[t]=new he(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(vi,gi);se[t]=new he(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(vi,gi);se[t]=new he(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){se[e]=new he(e,1,!1,e.toLowerCase(),null,!1,!1)});se.xlinkHref=new he("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){se[e]=new he(e,1,!1,e.toLowerCase(),null,!0,!0)});function yi(e,t,n,r){var l=se.hasOwnProperty(t)?se[t]:null;(l!==null?l.type!==0:r||!(2o||l[a]!==s[o]){var u=` +`+l[a].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=a&&0<=o);break}}}finally{Hl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?$n(e):""}function Pd(e){switch(e.tag){case 5:return $n(e.type);case 16:return $n("Lazy");case 13:return $n("Suspense");case 19:return $n("SuspenseList");case 0:case 2:case 15:return e=Ql(e.type,!1),e;case 11:return e=Ql(e.type.render,!1),e;case 1:return e=Ql(e.type,!0),e;default:return""}}function ws(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case qt:return"Fragment";case Xt:return"Portal";case ys:return"Profiler";case xi:return"StrictMode";case xs:return"Suspense";case ks:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ko:return(e.displayName||"Context")+".Consumer";case Qo:return(e._context.displayName||"Context")+".Provider";case ki:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case wi:return t=e.displayName||null,t!==null?t:ws(e.type)||"Memo";case ct:t=e._payload,e=e._init;try{return ws(e(t))}catch{}}return null}function Ld(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ws(t);case 8:return t===xi?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function St(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Yo(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Rd(e){var t=Yo(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(a){r=""+a,s.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function kr(e){e._valueTracker||(e._valueTracker=Rd(e))}function Xo(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Yo(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Jr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function js(e,t){var n=t.checked;return Q({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function ga(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=St(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function qo(e,t){t=t.checked,t!=null&&yi(e,"checked",t,!1)}function Ns(e,t){qo(e,t);var n=St(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ss(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ss(e,t.type,St(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ya(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Ss(e,t,n){(t!=="number"||Jr(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var zn=Array.isArray;function on(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=wr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Yn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var In={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Dd=["Webkit","ms","Moz","O"];Object.keys(In).forEach(function(e){Dd.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),In[t]=In[e]})});function eu(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||In.hasOwnProperty(e)&&In[e]?(""+t).trim():t+"px"}function tu(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=eu(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var $d=Q({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Cs(e,t){if(t){if($d[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(N(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(N(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(N(61))}if(t.style!=null&&typeof t.style!="object")throw Error(N(62))}}function Ts(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ps=null;function ji(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ls=null,un=null,cn=null;function wa(e){if(e=hr(e)){if(typeof Ls!="function")throw Error(N(280));var t=e.stateNode;t&&(t=Ll(t),Ls(e.stateNode,e.type,t))}}function nu(e){un?cn?cn.push(e):cn=[e]:un=e}function ru(){if(un){var e=un,t=cn;if(cn=un=null,wa(e),t)for(e=0;e>>=0,e===0?32:31-(Hd(e)/Qd|0)|0}var jr=64,Nr=4194304;function Fn(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function nl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,s=e.pingedLanes,a=n&268435455;if(a!==0){var o=a&~l;o!==0?r=Fn(o):(s&=a,s!==0&&(r=Fn(s)))}else a=n&~l,a!==0?r=Fn(a):s!==0&&(r=Fn(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,s=t&-t,l>=s||l===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function fr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ue(t),e[t]=n}function Xd(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=On),La=" ",Ra=!1;function Nu(e,t){switch(e){case"keyup":return Sf.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Su(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Zt=!1;function Ef(e,t){switch(e){case"compositionend":return Su(t);case"keypress":return t.which!==32?null:(Ra=!0,La);case"textInput":return e=t.data,e===La&&Ra?null:e;default:return null}}function Cf(e,t){if(Zt)return e==="compositionend"||!Li&&Nu(e,t)?(e=wu(),Br=Ci=ht=null,Zt=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Fa(n)}}function Tu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Tu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Pu(){for(var e=window,t=Jr();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Jr(e.document)}return t}function Ri(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Mf(e){var t=Pu(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Tu(n.ownerDocument.documentElement,n)){if(r!==null&&Ri(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,s=Math.min(r.start,l);r=r.end===void 0?s:Math.min(r.end,l),!e.extend&&s>r&&(l=r,r=s,s=l),l=Ma(n,s);var a=Ma(n,r);l&&a&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Jt=null,Ms=null,Vn=null,Is=!1;function Ia(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Is||Jt==null||Jt!==Jr(r)||(r=Jt,"selectionStart"in r&&Ri(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Vn&&er(Vn,r)||(Vn=r,r=sl(Ms,"onSelect"),0tn||(e.current=Bs[tn],Bs[tn]=null,tn--)}function O(e,t){tn++,Bs[tn]=e.current,e.current=t}var _t={},ce=Tt(_t),ye=Tt(!1),Vt=_t;function mn(e,t){var n=e.type.contextTypes;if(!n)return _t;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},s;for(s in n)l[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function xe(e){return e=e.childContextTypes,e!=null}function al(){V(ye),V(ce)}function Ha(e,t,n){if(ce.current!==_t)throw Error(N(168));O(ce,t),O(ye,n)}function Au(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(N(108,Ld(e)||"Unknown",l));return Q({},n,r)}function ol(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||_t,Vt=ce.current,O(ce,e),O(ye,ye.current),!0}function Qa(e,t,n){var r=e.stateNode;if(!r)throw Error(N(169));n?(e=Au(e,t,Vt),r.__reactInternalMemoizedMergedChildContext=e,V(ye),V(ce),O(ce,e)):V(ye),O(ye,n)}var be=null,Rl=!1,ss=!1;function Ou(e){be===null?be=[e]:be.push(e)}function Yf(e){Rl=!0,Ou(e)}function Pt(){if(!ss&&be!==null){ss=!0;var e=0,t=A;try{var n=be;for(A=1;e>=a,l-=a,et=1<<32-Ue(t)+l|n<k?(R=j,j=null):R=j.sibling;var P=f(g,j,m[k],w);if(P===null){j===null&&(j=R);break}e&&j&&P.alternate===null&&t(g,j),d=s(P,d,k),E===null?_=P:E.sibling=P,E=P,j=R}if(k===m.length)return n(g,j),W&&$t(g,k),_;if(j===null){for(;kk?(R=j,j=null):R=j.sibling;var I=f(g,j,P.value,w);if(I===null){j===null&&(j=R);break}e&&j&&I.alternate===null&&t(g,j),d=s(I,d,k),E===null?_=I:E.sibling=I,E=I,j=R}if(P.done)return n(g,j),W&&$t(g,k),_;if(j===null){for(;!P.done;k++,P=m.next())P=h(g,P.value,w),P!==null&&(d=s(P,d,k),E===null?_=P:E.sibling=P,E=P);return W&&$t(g,k),_}for(j=r(g,j);!P.done;k++,P=m.next())P=v(j,g,k,P.value,w),P!==null&&(e&&P.alternate!==null&&j.delete(P.key===null?k:P.key),d=s(P,d,k),E===null?_=P:E.sibling=P,E=P);return e&&j.forEach(function(K){return t(g,K)}),W&&$t(g,k),_}function C(g,d,m,w){if(typeof m=="object"&&m!==null&&m.type===qt&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case xr:e:{for(var _=m.key,E=d;E!==null;){if(E.key===_){if(_=m.type,_===qt){if(E.tag===7){n(g,E.sibling),d=l(E,m.props.children),d.return=g,g=d;break e}}else if(E.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===ct&&Ya(_)===E.type){n(g,E.sibling),d=l(E,m.props),d.ref=Ln(g,E,m),d.return=g,g=d;break e}n(g,E);break}else t(g,E);E=E.sibling}m.type===qt?(d=Ut(m.props.children,g.mode,w,m.key),d.return=g,g=d):(w=Zr(m.type,m.key,m.props,null,g.mode,w),w.ref=Ln(g,d,m),w.return=g,g=w)}return a(g);case Xt:e:{for(E=m.key;d!==null;){if(d.key===E)if(d.tag===4&&d.stateNode.containerInfo===m.containerInfo&&d.stateNode.implementation===m.implementation){n(g,d.sibling),d=l(d,m.children||[]),d.return=g,g=d;break e}else{n(g,d);break}else t(g,d);d=d.sibling}d=ps(m,g.mode,w),d.return=g,g=d}return a(g);case ct:return E=m._init,C(g,d,E(m._payload),w)}if(zn(m))return y(g,d,m,w);if(_n(m))return x(g,d,m,w);Lr(g,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,d!==null&&d.tag===6?(n(g,d.sibling),d=l(d,m),d.return=g,g=d):(n(g,d),d=fs(m,g.mode,w),d.return=g,g=d),a(g)):n(g,d)}return C}var gn=Bu(!0),Hu=Bu(!1),dl=Tt(null),fl=null,ln=null,Fi=null;function Mi(){Fi=ln=fl=null}function Ii(e){var t=dl.current;V(dl),e._currentValue=t}function Ks(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function fn(e,t){fl=e,Fi=ln=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ge=!0),e.firstContext=null)}function ze(e){var t=e._currentValue;if(Fi!==e)if(e={context:e,memoizedValue:t,next:null},ln===null){if(fl===null)throw Error(N(308));ln=e,fl.dependencies={lanes:0,firstContext:e}}else ln=ln.next=e;return t}var It=null;function Ai(e){It===null?It=[e]:It.push(e)}function Qu(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,Ai(t)):(n.next=l.next,l.next=n),t.interleaved=n,st(e,r)}function st(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var dt=!1;function Oi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ku(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function nt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function kt(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,M&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,st(e,n)}return l=r.interleaved,l===null?(t.next=t,Ai(r)):(t.next=l.next,l.next=t),r.interleaved=t,st(e,n)}function Qr(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Si(e,n)}}function Xa(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?l=s=a:s=s.next=a,n=n.next}while(n!==null);s===null?l=s=t:s=s.next=t}else l=s=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function pl(e,t,n,r){var l=e.updateQueue;dt=!1;var s=l.firstBaseUpdate,a=l.lastBaseUpdate,o=l.shared.pending;if(o!==null){l.shared.pending=null;var u=o,c=u.next;u.next=null,a===null?s=c:a.next=c,a=u;var p=e.alternate;p!==null&&(p=p.updateQueue,o=p.lastBaseUpdate,o!==a&&(o===null?p.firstBaseUpdate=c:o.next=c,p.lastBaseUpdate=u))}if(s!==null){var h=l.baseState;a=0,p=c=u=null,o=s;do{var f=o.lane,v=o.eventTime;if((r&f)===f){p!==null&&(p=p.next={eventTime:v,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var y=e,x=o;switch(f=t,v=n,x.tag){case 1:if(y=x.payload,typeof y=="function"){h=y.call(v,h,f);break e}h=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=x.payload,f=typeof y=="function"?y.call(v,h,f):y,f==null)break e;h=Q({},h,f);break e;case 2:dt=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,f=l.effects,f===null?l.effects=[o]:f.push(o))}else v={eventTime:v,lane:f,tag:o.tag,payload:o.payload,callback:o.callback,next:null},p===null?(c=p=v,u=h):p=p.next=v,a|=f;if(o=o.next,o===null){if(o=l.shared.pending,o===null)break;f=o,o=f.next,f.next=null,l.lastBaseUpdate=f,l.shared.pending=null}}while(!0);if(p===null&&(u=h),l.baseState=u,l.firstBaseUpdate=c,l.lastBaseUpdate=p,t=l.shared.interleaved,t!==null){l=t;do a|=l.lane,l=l.next;while(l!==t)}else s===null&&(l.shared.lanes=0);Ht|=a,e.lanes=a,e.memoizedState=h}}function qa(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=as.transition;as.transition={};try{e(!1),t()}finally{A=n,as.transition=r}}function uc(){return Fe().memoizedState}function Jf(e,t,n){var r=jt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},cc(e))dc(t,n);else if(n=Qu(e,t,n,r),n!==null){var l=fe();Ve(n,e,r,l),fc(n,t,r)}}function bf(e,t,n){var r=jt(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(cc(e))dc(t,l);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var a=t.lastRenderedState,o=s(a,n);if(l.hasEagerState=!0,l.eagerState=o,We(o,a)){var u=t.interleaved;u===null?(l.next=l,Ai(t)):(l.next=u.next,u.next=l),t.interleaved=l;return}}catch{}finally{}n=Qu(e,t,l,r),n!==null&&(l=fe(),Ve(n,e,r,l),fc(n,t,r))}}function cc(e){var t=e.alternate;return e===H||t!==null&&t===H}function dc(e,t){Wn=ml=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function fc(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Si(e,n)}}var vl={readContext:ze,useCallback:ie,useContext:ie,useEffect:ie,useImperativeHandle:ie,useInsertionEffect:ie,useLayoutEffect:ie,useMemo:ie,useReducer:ie,useRef:ie,useState:ie,useDebugValue:ie,useDeferredValue:ie,useTransition:ie,useMutableSource:ie,useSyncExternalStore:ie,useId:ie,unstable_isNewReconciler:!1},ep={readContext:ze,useCallback:function(e,t){return Qe().memoizedState=[e,t===void 0?null:t],e},useContext:ze,useEffect:Ja,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Gr(4194308,4,lc.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Gr(4194308,4,e,t)},useInsertionEffect:function(e,t){return Gr(4,2,e,t)},useMemo:function(e,t){var n=Qe();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Qe();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Jf.bind(null,H,e),[r.memoizedState,e]},useRef:function(e){var t=Qe();return e={current:e},t.memoizedState=e},useState:Za,useDebugValue:Gi,useDeferredValue:function(e){return Qe().memoizedState=e},useTransition:function(){var e=Za(!1),t=e[0];return e=Zf.bind(null,e[1]),Qe().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=H,l=Qe();if(W){if(n===void 0)throw Error(N(407));n=n()}else{if(n=t(),ne===null)throw Error(N(349));Bt&30||qu(r,t,n)}l.memoizedState=n;var s={value:n,getSnapshot:t};return l.queue=s,Ja(Ju.bind(null,r,s,e),[e]),r.flags|=2048,or(9,Zu.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Qe(),t=ne.identifierPrefix;if(W){var n=tt,r=et;n=(r&~(1<<32-Ue(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ir++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Ke]=t,e[rr]=r,jc(e,t,!1,!1),t.stateNode=e;e:{switch(a=Ts(n,r),n){case"dialog":U("cancel",e),U("close",e),l=r;break;case"iframe":case"object":case"embed":U("load",e),l=r;break;case"video":case"audio":for(l=0;lkn&&(t.flags|=128,r=!0,Rn(s,!1),t.lanes=4194304)}else{if(!r)if(e=hl(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Rn(s,!0),s.tail===null&&s.tailMode==="hidden"&&!a.alternate&&!W)return ae(t),null}else 2*q()-s.renderingStartTime>kn&&n!==1073741824&&(t.flags|=128,r=!0,Rn(s,!1),t.lanes=4194304);s.isBackwards?(a.sibling=t.child,t.child=a):(n=s.last,n!==null?n.sibling=a:t.child=a,s.last=a)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=q(),t.sibling=null,n=B.current,O(B,r?n&1|2:n&1),t):(ae(t),null);case 22:case 23:return bi(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?je&1073741824&&(ae(t),t.subtreeFlags&6&&(t.flags|=8192)):ae(t),null;case 24:return null;case 25:return null}throw Error(N(156,t.tag))}function op(e,t){switch($i(t),t.tag){case 1:return xe(t.type)&&al(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return yn(),V(ye),V(ce),Wi(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Vi(t),null;case 13:if(V(B),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(N(340));vn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return V(B),null;case 4:return yn(),null;case 10:return Ii(t.type._context),null;case 22:case 23:return bi(),null;case 24:return null;default:return null}}var Dr=!1,ue=!1,up=typeof WeakSet=="function"?WeakSet:Set,L=null;function sn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){G(e,t,r)}else n.current=null}function ti(e,t,n){try{n()}catch(r){G(e,t,r)}}var uo=!1;function cp(e,t){if(As=rl,e=Pu(),Ri(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var a=0,o=-1,u=-1,c=0,p=0,h=e,f=null;t:for(;;){for(var v;h!==n||l!==0&&h.nodeType!==3||(o=a+l),h!==s||r!==0&&h.nodeType!==3||(u=a+r),h.nodeType===3&&(a+=h.nodeValue.length),(v=h.firstChild)!==null;)f=h,h=v;for(;;){if(h===e)break t;if(f===n&&++c===l&&(o=a),f===s&&++p===r&&(u=a),(v=h.nextSibling)!==null)break;h=f,f=h.parentNode}h=v}n=o===-1||u===-1?null:{start:o,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Os={focusedElem:e,selectionRange:n},rl=!1,L=t;L!==null;)if(t=L,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,L=e;else for(;L!==null;){t=L;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var x=y.memoizedProps,C=y.memoizedState,g=t.stateNode,d=g.getSnapshotBeforeUpdate(t.elementType===t.type?x:Ie(t.type,x),C);g.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(N(163))}}catch(w){G(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,L=e;break}L=t.return}return y=uo,uo=!1,y}function Bn(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var s=l.destroy;l.destroy=void 0,s!==void 0&&ti(t,n,s)}l=l.next}while(l!==r)}}function zl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function ni(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function _c(e){var t=e.alternate;t!==null&&(e.alternate=null,_c(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ke],delete t[rr],delete t[Ws],delete t[Kf],delete t[Gf])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ec(e){return e.tag===5||e.tag===3||e.tag===4}function co(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ec(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ri(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=il));else if(r!==4&&(e=e.child,e!==null))for(ri(e,t,n),e=e.sibling;e!==null;)ri(e,t,n),e=e.sibling}function li(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(li(e,t,n),e=e.sibling;e!==null;)li(e,t,n),e=e.sibling}var re=null,Ae=!1;function ot(e,t,n){for(n=n.child;n!==null;)Cc(e,t,n),n=n.sibling}function Cc(e,t,n){if(Ye&&typeof Ye.onCommitFiberUnmount=="function")try{Ye.onCommitFiberUnmount(El,n)}catch{}switch(n.tag){case 5:ue||sn(n,t);case 6:var r=re,l=Ae;re=null,ot(e,t,n),re=r,Ae=l,re!==null&&(Ae?(e=re,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):re.removeChild(n.stateNode));break;case 18:re!==null&&(Ae?(e=re,n=n.stateNode,e.nodeType===8?ls(e.parentNode,n):e.nodeType===1&&ls(e,n),Jn(e)):ls(re,n.stateNode));break;case 4:r=re,l=Ae,re=n.stateNode.containerInfo,Ae=!0,ot(e,t,n),re=r,Ae=l;break;case 0:case 11:case 14:case 15:if(!ue&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var s=l,a=s.destroy;s=s.tag,a!==void 0&&(s&2||s&4)&&ti(n,t,a),l=l.next}while(l!==r)}ot(e,t,n);break;case 1:if(!ue&&(sn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){G(n,t,o)}ot(e,t,n);break;case 21:ot(e,t,n);break;case 22:n.mode&1?(ue=(r=ue)||n.memoizedState!==null,ot(e,t,n),ue=r):ot(e,t,n);break;default:ot(e,t,n)}}function fo(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new up),t.forEach(function(r){var l=xp.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function Me(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=a),r&=~s}if(r=l,r=q()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*fp(r/1960))-r,10e?16:e,mt===null)var r=!1;else{if(e=mt,mt=null,xl=0,M&6)throw Error(N(331));var l=M;for(M|=4,L=e.current;L!==null;){var s=L,a=s.child;if(L.flags&16){var o=s.deletions;if(o!==null){for(var u=0;uq()-Zi?Ot(e,0):qi|=n),ke(e,t)}function Fc(e,t){t===0&&(e.mode&1?(t=Nr,Nr<<=1,!(Nr&130023424)&&(Nr=4194304)):t=1);var n=fe();e=st(e,t),e!==null&&(fr(e,t,n),ke(e,n))}function yp(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Fc(e,n)}function xp(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(N(314))}r!==null&&r.delete(t),Fc(e,n)}var Mc;Mc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ye.current)ge=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ge=!1,ip(e,t,n);ge=!!(e.flags&131072)}else ge=!1,W&&t.flags&1048576&&Uu(t,cl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Yr(e,t),e=t.pendingProps;var l=mn(t,ce.current);fn(t,n),l=Hi(null,t,r,e,l,n);var s=Qi();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,xe(r)?(s=!0,ol(t)):s=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Oi(t),l.updater=$l,t.stateNode=l,l._reactInternals=t,Ys(t,r,e,n),t=Zs(null,t,r,!0,s,n)):(t.tag=0,W&&s&&Di(t),de(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Yr(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=wp(r),e=Ie(r,e),l){case 0:t=qs(null,t,r,e,n);break e;case 1:t=io(null,t,r,e,n);break e;case 11:t=lo(null,t,r,e,n);break e;case 14:t=so(null,t,r,Ie(r.type,e),n);break e}throw Error(N(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ie(r,l),qs(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ie(r,l),io(e,t,r,l,n);case 3:e:{if(xc(t),e===null)throw Error(N(387));r=t.pendingProps,s=t.memoizedState,l=s.element,Ku(e,t),pl(t,r,null,n);var a=t.memoizedState;if(r=a.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){l=xn(Error(N(423)),t),t=ao(e,t,r,n,l);break e}else if(r!==l){l=xn(Error(N(424)),t),t=ao(e,t,r,n,l);break e}else for(Ne=xt(t.stateNode.containerInfo.firstChild),_e=t,W=!0,Oe=null,n=Hu(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(vn(),r===l){t=it(e,t,n);break e}de(e,t,r,n)}t=t.child}return t;case 5:return Gu(t),e===null&&Qs(t),r=t.type,l=t.pendingProps,s=e!==null?e.memoizedProps:null,a=l.children,Us(r,l)?a=null:s!==null&&Us(r,s)&&(t.flags|=32),yc(e,t),de(e,t,a,n),t.child;case 6:return e===null&&Qs(t),null;case 13:return kc(e,t,n);case 4:return Ui(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=gn(t,null,r,n):de(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ie(r,l),lo(e,t,r,l,n);case 7:return de(e,t,t.pendingProps,n),t.child;case 8:return de(e,t,t.pendingProps.children,n),t.child;case 12:return de(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,s=t.memoizedProps,a=l.value,O(dl,r._currentValue),r._currentValue=a,s!==null)if(We(s.value,a)){if(s.children===l.children&&!ye.current){t=it(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var o=s.dependencies;if(o!==null){a=s.child;for(var u=o.firstContext;u!==null;){if(u.context===r){if(s.tag===1){u=nt(-1,n&-n),u.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var p=c.pending;p===null?u.next=u:(u.next=p.next,p.next=u),c.pending=u}}s.lanes|=n,u=s.alternate,u!==null&&(u.lanes|=n),Ks(s.return,n,t),o.lanes|=n;break}u=u.next}}else if(s.tag===10)a=s.type===t.type?null:s.child;else if(s.tag===18){if(a=s.return,a===null)throw Error(N(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),Ks(a,n,t),a=s.sibling}else a=s.child;if(a!==null)a.return=s;else for(a=s;a!==null;){if(a===t){a=null;break}if(s=a.sibling,s!==null){s.return=a.return,a=s;break}a=a.return}s=a}de(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,fn(t,n),l=ze(l),r=r(l),t.flags|=1,de(e,t,r,n),t.child;case 14:return r=t.type,l=Ie(r,t.pendingProps),l=Ie(r.type,l),so(e,t,r,l,n);case 15:return vc(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ie(r,l),Yr(e,t),t.tag=1,xe(r)?(e=!0,ol(t)):e=!1,fn(t,n),pc(t,r,l),Ys(t,r,l,n),Zs(null,t,r,!0,e,n);case 19:return wc(e,t,n);case 22:return gc(e,t,n)}throw Error(N(156,t.tag))};function Ic(e,t){return cu(e,t)}function kp(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Re(e,t,n,r){return new kp(e,t,n,r)}function ta(e){return e=e.prototype,!(!e||!e.isReactComponent)}function wp(e){if(typeof e=="function")return ta(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ki)return 11;if(e===wi)return 14}return 2}function Nt(e,t){var n=e.alternate;return n===null?(n=Re(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Zr(e,t,n,r,l,s){var a=2;if(r=e,typeof e=="function")ta(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case qt:return Ut(n.children,l,s,t);case xi:a=8,l|=8;break;case ys:return e=Re(12,n,t,l|2),e.elementType=ys,e.lanes=s,e;case xs:return e=Re(13,n,t,l),e.elementType=xs,e.lanes=s,e;case ks:return e=Re(19,n,t,l),e.elementType=ks,e.lanes=s,e;case Go:return Ml(n,l,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Qo:a=10;break e;case Ko:a=9;break e;case ki:a=11;break e;case wi:a=14;break e;case ct:a=16,r=null;break e}throw Error(N(130,e==null?e:typeof e,""))}return t=Re(a,n,t,l),t.elementType=e,t.type=r,t.lanes=s,t}function Ut(e,t,n,r){return e=Re(7,e,r,t),e.lanes=n,e}function Ml(e,t,n,r){return e=Re(22,e,r,t),e.elementType=Go,e.lanes=n,e.stateNode={isHidden:!1},e}function fs(e,t,n){return e=Re(6,e,null,t),e.lanes=n,e}function ps(e,t,n){return t=Re(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function jp(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Gl(0),this.expirationTimes=Gl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gl(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function na(e,t,n,r,l,s,a,o,u){return e=new jp(e,t,n,o,u),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Re(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Oi(s),e}function Np(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Vc)}catch(e){console.error(e)}}Vc(),Vo.exports=Ce;var Wc=Vo.exports,Bc,ko=Wc;Bc=ko.createRoot,ko.hydrateRoot;const Tp="modulepreload",Pp=function(e){return"/"+e},wo={},Ft=function(t,n,r){let l=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),o=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));l=Promise.allSettled(n.map(u=>{if(u=Pp(u),u in wo)return;wo[u]=!0;const c=u.endsWith(".css"),p=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${p}`))return;const h=document.createElement("link");if(h.rel=c?"stylesheet":Tp,c||(h.as="script"),h.crossOrigin="",h.href=u,o&&h.setAttribute("nonce",o),document.head.appendChild(h),c)return new Promise((f,v)=>{h.addEventListener("load",f),h.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return l.then(a=>{for(const o of a||[])o.status==="rejected"&&s(o.reason);return t().catch(s)})};async function oe(e,t={}){const n=await fetch(e,{headers:{"content-type":"application/json"},...t,body:t.body?JSON.stringify(t.body):void 0});let r=null;try{r=await n.json()}catch{}if(!n.ok){const l=r!=null&&r.detail?typeof r.detail=="string"?r.detail:JSON.stringify(r.detail):`HTTP ${n.status}`;throw new Error(l)}return r}const Se={stats:()=>oe("/api/stats"),search:e=>oe(`/api/search?q=${encodeURIComponent(e)}`),assess:(e,t=4)=>oe(`/api/assess/${e}?depth=${t}`),compare:e=>oe("/api/compare",{method:"POST",body:{ks:e}}),recallEvent:e=>oe(`/api/recall-event/${e}`),watchlist:()=>oe("/api/watchlist"),ingest:(e,t=!1)=>oe("/api/ingest",{method:"POST",body:{k:e,refresh:t}}),review:(e,t,n,r)=>oe("/api/citation/review",{method:"POST",body:{src:e,dst:t,status:n,note:r}}),triage:(e,t)=>oe("/api/citation/triage",{method:"POST",body:{src:e,dst:t}}),save:(e,t)=>oe("/api/assessments",{method:"POST",body:{k:e,note:t}}),assessments:e=>oe(`/api/assessments${e?`?k=${e}`:""}`),investigations:(e,t=30)=>oe(`/api/investigations?limit=${t}${e?`&k=${e}`:""}`),investigation:e=>oe(`/api/investigations/${e}`),startInvestigation:(e,t,n="auto")=>oe("/api/investigations",{method:"POST",body:{k:e,request:t,mode:n}}),proposals:e=>oe(`/api/proposals${e?`?status=${e}`:""}`),decide:(e,t,n,r)=>oe(`/api/proposals/${e}/decision`,{method:"POST",body:{decision:t,reviewer:n,human:!0,note:r}})},Hc=e=>`https://www.accessdata.fda.gov/scripts/cdrh/cfdocs/cfpmn/pmn.cfm?ID=${e}`,Lp=(e,t=!0)=>`/api/investigations/${e}/report${t?"?format=markdown":""}`,ui={nodes:[{id:"a",x:11,y:7,r:3.6},{id:"b",x:27,y:7,r:2.8},{id:"c",x:11,y:19,r:3},{id:"d",x:23,y:19,r:2.6},{id:"e",x:11,y:31,r:3.4,past:!0}],threads:[["a","b"],["a","c"],["c","d"],["c","e"]]},Fr=Object.fromEntries(ui.nodes.map(e=>[e.id,e]));function Qc({size:e=28,className:t="",title:n}){return i.jsxs("svg",{className:"mark "+t,width:e,height:e,viewBox:"0 0 38 38",role:n?"img":void 0,"aria-hidden":n?void 0:!0,"aria-label":n,children:[ui.threads.map(([r,l],s)=>i.jsx("line",{className:`mark-thread t${s}`,x1:Fr[r].x,y1:Fr[r].y,x2:Fr[l].x,y2:Fr[l].y,pathLength:"1"},s)),ui.nodes.map((r,l)=>i.jsx("circle",{className:`mark-node n${l}${r.past?" past":""}`,cx:r.x,cy:r.y,r:r.r},r.id))]})}function Rp({size:e=28,className:t=""}){return i.jsxs("span",{className:"wordmark "+t,children:[i.jsx(Qc,{size:e}),i.jsx("span",{className:"wordmark-name",children:"Forebear"})]})}const ia="forebear:intro",Dp=3e3,jo=2450;function $p(){try{return!!sessionStorage.getItem(ia)}catch{return!0}}function zp(){try{sessionStorage.setItem(ia,"seen")}catch{}}function Fp(){try{sessionStorage.removeItem(ia)}catch{}}function Mp({onDone:e}){const[t,n]=S.useState(!1),r=S.useRef(!1),l=S.useRef(null),s=()=>{r.current||(r.current=!0,zp(),n(!0),e())};S.useEffect(()=>{var h;const c=setTimeout(s,jo),p=f=>{(f.key==="Escape"||f.key==="Enter"||f.key===" ")&&(f.preventDefault(),s())};return addEventListener("keydown",p),(h=l.current)==null||h.focus({preventScroll:!0}),()=>{clearTimeout(c),removeEventListener("keydown",p)}},[]);const[a,o]=S.useState(!1);if(S.useEffect(()=>{if(!t)return;const c=setTimeout(()=>o(!0),Dp-jo+100);return()=>clearTimeout(c)},[t]),a)return null;const u="Forebear".split("");return i.jsxs("div",{className:"intro"+(t?" is-leaving":""),"data-testid":"intro",onClick:s,role:"dialog","aria-modal":"true","aria-label":"Forebear opening",children:[i.jsxs("div",{className:"intro-lockup","aria-hidden":"true",children:[i.jsx(Qc,{className:"intro-mark",size:116}),i.jsx("div",{className:"intro-word",children:u.map((c,p)=>i.jsx("span",{style:{animationDelay:`${.95+p*.045}s`},children:c},p))}),i.jsx("p",{className:"intro-tag",children:i.jsxs("span",{children:["Every clearance has ",i.jsx("em",{children:"a past."})]})})]}),i.jsx("span",{className:"sr-only",role:"status",children:"Forebear. Every clearance has a past."}),i.jsxs("button",{ref:l,className:"btn btn-line btn-sm intro-skip",onClick:c=>{c.stopPropagation(),s()},children:["Skip intro ",i.jsx("span",{"aria-hidden":"true",children:"→"})]})]})}function Ip(e){const[t,n]=S.useState(()=>typeof matchMedia<"u"&&matchMedia(e).matches);return S.useEffect(()=>{const r=matchMedia(e),l=()=>n(r.matches);return l(),r.addEventListener("change",l),()=>r.removeEventListener("change",l)},[e]),t}const cr=["mcp-client"],Kn={DESIGN_RECALL_ON_FILE:{tone:"alert",label:"Design-related recall on file",plain:"The candidate itself has a design-related recall on file."},REVIEW_LINEAGE:{tone:"amber",label:"Review lineage",plain:"A recall in the predicate lineage warrants documented review."},INSUFFICIENT_LINEAGE:{tone:"muted",label:"Lineage not checkable",plain:"The ancestry could not be checked from readable evidence."},NO_DESIGN_RECALL_SIGNAL:{tone:"calm",label:"No design-recall signal",plain:"No design-related recall in the readable verdict window. Not a safety finding."}},Kc={audit_unresolved:"The extraction audit could not resolve whether this is the predicate",audit_correction:"K-number supplied by the audit, not as printed in the PDF",name_mismatch:"The cited device's FDA name does not appear near the citation",different_fda_panel:"Cited device sits in a different FDA review panel",llm_label_only:"A predicate only because an LLM labelled the mention",client_confirmation_only:"Confirmed only through the automated MCP client, not a person",client_rejection_pending:"Rejected through the automated MCP client; kept until a person decides",review_outdated:"A person reviewed an earlier version of the FDA summary; it needs re-review"};function Ap(e){if(!e)return[];if(e.review==="confirmed"&&Ge(e))return[];const t=[];return Gc(e)&&t.push("review_outdated"),e.audit==="unresolved"&&t.push("audit_unresolved"),e.audit==="corrected"&&t.push("audit_correction"),e.name_check==="mismatch"&&!["variant","corrected"].includes(e.audit)&&t.push("name_mismatch"),e.panel_check==="different"&&!["variant","corrected"].includes(e.audit)&&t.push("different_fda_panel"),e.kind!=null&&e.kind!=="predicate"&&e.ai_label==="predicate"&&t.push("llm_label_only"),e.kind!=null&&e.kind!=="predicate"&&e.review==="confirmed"&&cr.includes(e.reviewer)&&t.push("client_confirmation_only"),e.review==="rejected"&&cr.includes(e.reviewer)&&t.push("client_rejection_pending"),t}const Ge=e=>!!(e!=null&&e.review)&&!cr.includes(e.reviewer)&&(e.reviewed_source_sha256||"")===(e.source_sha256||""),Gc=e=>!!(e!=null&&e.review)&&!cr.includes(e.reviewer)&&!Ge(e),$e={confirmed:{label:"Confirmed by a person",short:"Confirmed"},extracted:{label:"Machine-extracted",short:"Extracted"},disputed:{label:"Disputed evidence",short:"Disputed"},conditional:{label:"Conditional route",short:"Conditional"},rejected:{label:"Rejected by a person",short:"Rejected"},advisory:{label:"Advisory: suggested by an LLM or the MCP client, awaiting a person; not a verdict input",short:"Advisory"},retired:{label:"Retired: the refreshed FDA summary no longer cites it; kept for the record",short:"Retired"}};function Et(e){if(e!=null&&e.retired_at||(e==null?void 0:e.trust)==="retired")return{key:"retired",reasons:[]};if((e==null?void 0:e.review)==="rejected"&&Ge(e))return{key:"rejected",reasons:[]};if(e!=null&&e.advisory||(e==null?void 0:e.trust)==="advisory")return{key:"advisory",reasons:[]};const t=Ap(e);return t.includes("audit_unresolved")?{key:"conditional",reasons:t}:t.length?{key:"disputed",reasons:t}:(e==null?void 0:e.review)==="confirmed"&&Ge(e)?{key:"confirmed",reasons:t}:{key:"extracted",reasons:t}}function Op(e){return e.design_related?"design":e.classification==="Class I"?"class1":"other"}function aa(e){const t=e.recalls||[];return t.some(n=>n.design_related)?"design":t.length?"recall":"clean"}function oa(e){return{events:new Set(e.map(n=>n.event||n.id)).size,records:e.length}}const Up=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function we(e){if(!e)return"—";const[t,n,r]=String(e).slice(0,10).split("-").map(Number);return t?`${r} ${Up[(n||1)-1]} ${t}`:String(e)}const Yc=e=>e?String(e).slice(0,4):"";function No(e,t){if(!e||!t)return null;const[n,r,l]=e.slice(0,10).split("-").map(Number),[s,a,o]=t.slice(0,10).split("-").map(Number);return(s-n)*12+(a-r)-(or?1:0}function ua(e,t){const n=Vp(e,t);if(n==null)return null;if(n===0)return{relation:"same-day",months:0,duration:""};const r=n<0?No(e,t):No(t,e);return{relation:n<0?"before":"after",months:r,duration:Wp(r)}}function Xc(e,t,n="clause"){if(!e)return"";const{relation:r,duration:l}=e;return n==="chip"?r==="same-day"?`Recall began on the day of ${t}'s clearance`:`Recall began ${l} ${r} ${t}'s clearance`:r==="same-day"?`on the day ${t} was cleared`:`${l} ${r} ${t} was cleared`}function Wp(e){if(e==null)return"";const t=e<0,n=Math.abs(e),r=Math.floor(n/12),l=n%12,s=[r?`${r} yr`:"",l?`${l} mo`:""].filter(Boolean).join(" ")||"<1 mo";return t?`-${s}`:s}function jl(e,t){const n=e.filter(s=>s.design_related),r=n.length?n:e.filter(s=>s.classification==="Class I");return r.filter(s=>s.initiated&&t&&s.initiateds.initiated.localeCompare(a.initiated))[0]||[...r].sort((s,a)=>(a.initiated||"").localeCompare(s.initiated||""))[0]||null}const ci=(e,t)=>e?t?`${e}#page=${t}`:e:null,Bp={pdf_text_layer:"PDF text layer",ocr:"Local OCR of the scanned PDF",embedded_pdf_attachment:"Summary embedded in a PDF Portfolio"};function qe(e,t=30){const n=(e||"").replace(/\s+/g," ").trim();return n.length>t?n.slice(0,t-1)+"…":n}function Hp(e,t){return e==="NO_DESIGN_RECALL_SIGNAL"&&t!=="complete"}function qc(e,t){const n=Kn[e];return n?Hp(e,t)?{tone:"muted",label:`${n.label} · provisional`,provisional:!0}:{tone:n.tone,label:n.label,provisional:!1}:{tone:"muted",label:e||"Unknown",provisional:!1}}const Th={complete:"calm",partial:"amber",uncertain:"alert",none:"muted"},Qp={direct_predicate_links_all_uncertain:"every direct predicate link rests on uncertain evidence",unresolved_predicate_citations:"predicate citations within two generations could not be resolved",direct_predicate_summaries_unread:"a direct predicate's own summary was not read",doubtful_links_in_window:"links within two generations rest on doubtful evidence",recall_cause_or_class_unknown:"a recall has no stated cause or FDA class",unattributed_recalls_in_product_code:"design-related recalls in the product code name no 510(k)",shallow_traversal:"grand-predicates were not traversed",advisory_links_pending_review:"predicate links suggested only by an LLM or the MCP client await a person",human_confirmed_citation_retired:"a citation a person confirmed is no longer in the refreshed FDA summary"},Zc={name_token_match:{short:"FDA-listed · name match (heuristic)",tone:"other",text:"FDA lists this 510(k) on the recall. A distinctive word of its FDA device name appears in the recall text, possibly as a fuzzy match. This heuristic does not verify that the recall names this exact model."},name_token_absent:{short:"FDA-listed · name not found (heuristic)",tone:"muted",text:"FDA lists this 510(k) on the recall, but no distinctive word of its FDA device name was found in the recall text. The recalled model may differ, or the text may name it differently."},name_not_checkable:{short:"FDA-listed · name not checked",tone:"muted",text:"FDA lists this 510(k) on the recall. No name check is available: its FDA device name has no distinctive word to look for, or no check was recorded for this link. Which model was recalled is not established here."}},hs={short:"Recall began before this clearance",text:"This recall began before this 510(k) was cleared, yet FDA lists it on the record. The dates alone do not establish whether this cleared model was affected: read the FDA record."},Ph={after:"cleared after the recall began",before:"cleared before the recall began",same_day:"cleared the day the recall began (order unknown)",unknown:"timing unknown (a date is missing)"};function So(e){return e!=null&&e.attribution&&Zc[e.attribution]?e.attribution:(e==null?void 0:e.link_name_check)==="match"?"name_token_match":(e==null?void 0:e.link_name_check)==="mismatch"?"name_token_absent":"name_not_checkable"}const ms=70,Mr=110,_o=46,Kp=62,Gp=190,Eo=300;function Yp(e){return e.signals.filter(t=>{var n;return(t.severity==="high"||t.severity==="medium")&&((n=t.chain)==null?void 0:n.length)>1}).map(t=>t.chain)}function Xp(e,{depth:t,descendants:n}){const r=new Map,l=Yp(e),s=new Set(l.flat()),a=new Set;l.forEach(h=>h.slice(1).forEach((f,v)=>a.add(h[v]+">"+f))),r.set(e.k,{...e.device,k:e.k,gen:0,side:"self",recalls:e.device.recalls||[]});let o=0,u=new Set;for(const h of e.ancestors)h.gen<=t||s.has(h.k)?r.set(h.k,{...h,side:"up"}):(o++,u.add(h.gen));if(n)for(const h of e.descendants)r.set(h.k,{...h,side:"down"});const c=new Map,p=h=>{for(const f of h||[]){if(!r.has(f.src)||!r.has(f.dst))continue;const v=f.src+">"+f.dst;c.has(v)||c.set(v,{id:v,hop:f,status:Et(f),critical:a.has(v)})}};for(const h of e.ancestors)r.has(h.k)&&p(h.hops);if(n)for(const h of e.descendants)p(h.hops);return{nodes:r,edges:c,hidden:o,hiddenGens:[...u].sort(),critK:s,critE:a}}function qp(e,t){var E;const{nodes:n,edges:r}=e,l=new Map;for(const j of n.values())((E=j.chain)==null?void 0:E.length)>1&&l.set(j.k,j.chain[j.chain.length-2]);const s=[...n.values()].filter(j=>j.side==="up").map(j=>j.gen),a=[...n.values()].filter(j=>j.side==="down").map(j=>j.gen),o=s.length?Math.max(...s):0,u=a.length?Math.max(...a):0,c=j=>j.side==="self"?o:j.side==="up"?o-j.gen:o+j.gen,p=new Map;for(const j of n.values()){const k=c(j);p.has(k)||p.set(k,[]),p.get(k).push(j)}const h=new Map([[[...n.values()].find(j=>j.side==="self").k,0]]),f=[...p.keys()].sort((j,k)=>Math.abs(j-o)-Math.abs(k-o)),v=Math.max(...[...p.values()].map(j=>j.length));for(const j of f){const k=p.get(j);k.sort((R,P)=>{const I=h.get(l.get(R.k))??0,K=h.get(l.get(P.k))??0;return I-K||(P.decision_date||"").localeCompare(R.decision_date||"")}),k.forEach((R,P)=>{R.side!=="self"&&h.set(R.k,(P-(k.length-1)/2)*ms)})}const y=o+u,x=y?Math.max(Gp,Math.min(Eo,(t-Mr*2)/y)):Eo,C=Math.max(t,Mr*2+y*x),g=Mr+(C-(Mr*2+y*x))/2,d=_o+Kp+Math.max(1,v)*ms,m=_o+Math.max(1,v)*ms/2,w=new Map([...n.values()].map(j=>[j.k,{x:g+c(j)*x,y:m+h.get(j.k)}])),_=[...p.keys()].map(j=>{const k=j-o;return{x:g+j*x,label:k===0?"Candidate":k<0?k===-1?"Predicates":k===-2?"Grand-predicates":`Generation ${-k}`:`Cites it · +${k}`}});return{pos:w,width:C,height:d,colLabels:_,edges:r}}function Zp({a:e,depth:t,onDepth:n,descendants:r,selected:l,onSelect:s,focusChain:a}){const o=S.useMemo(()=>Xp(e,{depth:t,descendants:r}),[e,t,r]),u=S.useRef(null),[c,p]=S.useState(900);S.useEffect(()=>{const d=()=>u.current&&p(u.current.clientWidth);d();const m=new ResizeObserver(d);return m.observe(u.current),()=>m.disconnect()},[]);const h=S.useMemo(()=>qp(o,c),[o,c]),[f,v]=S.useState(null);S.useEffect(()=>{const d=u.current;d&&(d.scrollLeft=d.scrollWidth)},[e.k,h.width]);const y=S.useMemo(()=>{const d=f||null;if(!d)return a?new Set(a):null;const m=o.nodes.get(d);return new Set((m==null?void 0:m.chain)||[d])},[f,o,a]),x=d=>{if(!y)return!0;const[m,w]=d.split(">");return y.has(m)&&y.has(w)},C=d=>{const m=d.recalls||[],w=m.filter(_=>_.design_related).length;return`${d.k}, ${d.name||"unnamed"}, cleared ${d.decision_date||"date unknown"}. `+(d.side==="self"?"Candidate. ":d.side==="up"?`Generation ${d.gen} predicate. `:`Cites the candidate, ${d.gen} generation(s) later. `)+(m.length?`${m.length} recall record(s), ${w} design-related. `:"No recall records. ")+(d.lineage_known===!1?"Its own predicates were not read.":"")},g=d=>m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),d())};return i.jsxs("div",{children:[i.jsx("div",{className:"graph-wrap",ref:u,"data-testid":"evidence-graph",children:i.jsxs("svg",{width:h.width,height:h.height,role:"group","aria-label":`Predicate lineage graph for ${e.k}: ${o.nodes.size} devices, ${o.edges.size} citations`,children:[h.colLabels.map(d=>i.jsxs("g",{children:[i.jsx("line",{className:"g-col-rule",x1:d.x,x2:d.x,y1:30,y2:h.height-10}),i.jsx("text",{className:"g-col-label",x:d.x,y:20,textAnchor:"middle",children:d.label})]},d.x)),[...o.edges.values()].map(d=>{const m=h.pos.get(d.hop.src),w=h.pos.get(d.hop.dst),_=(m.x+w.x)/2,E=`M${m.x-12},${m.y} C${_},${m.y} ${_},${w.y} ${w.x+12},${w.y}`,j=d.status.key,k=!x(d.id),R=(l==null?void 0:l.type)==="edge"&&l.id===d.id;return i.jsxs("g",{className:"g-edge-g",tabIndex:0,role:"button","aria-label":`Citation: ${d.hop.src} cites ${d.hop.dst}${d.hop.page?`, page ${d.hop.page}`:""}. ${$e[j].label}. Open provenance.`,"aria-pressed":R,onClick:()=>s({type:"edge",id:d.id,hop:d.hop}),onKeyDown:g(()=>s({type:"edge",id:d.id,hop:d.hop})),children:[i.jsx("path",{d:E,className:`g-edge st-${j}${d.critical?" is-critical":""}${k?" is-dim":""}`,style:R?{opacity:1,strokeWidth:3.2}:void 0}),d.critical&&!k&&i.jsx("path",{d:E,className:"g-flow"}),i.jsx("path",{d:E,className:"g-edge-hit"}),i.jsx("rect",{x:_-22,y:(m.y+w.y)/2-9,width:44,height:18,rx:9,fill:"transparent",style:{cursor:"pointer"}}),i.jsx("title",{children:`${d.hop.src} → ${d.hop.dst} · p.${d.hop.page??"?"} · ${$e[j].label}`})]},d.id)}),[...o.nodes.values()].map(d=>{const m=h.pos.get(d.k),w=aa(d),_=d.side==="self",E=_?11:8,j=y&&!y.has(d.k),k=(l==null?void 0:l.type)==="node"&&l.k===d.k;return i.jsxs("g",{transform:`translate(${m.x},${m.y})`,tabIndex:0,role:"button","aria-label":C(d),"aria-pressed":k,className:`g-node${_?" is-self":""}${j?" is-dim":""}${k?" is-selected":""}`,"data-k":d.k,onMouseEnter:()=>v(d.k),onMouseLeave:()=>v(null),onFocus:()=>v(d.k),onBlur:()=>v(null),onClick:()=>s({type:"node",k:d.k}),onKeyDown:g(()=>s({type:"node",k:d.k})),children:[w==="design"&&!_&&i.jsx("circle",{className:"glow",r:E*2.2}),i.jsx("circle",{className:"halo",r:E+5}),i.jsx("circle",{className:`dot tone-${w}${d.lineage_known===!1?" unread":""}`,r:E}),i.jsx("text",{className:"lk",y:-E-9,textAnchor:"middle",children:d.k}),i.jsxs("text",{className:"ln",y:E+16,textAnchor:"middle",children:[qe(d.name,26)," · ",Yc(d.decision_date)]})]},d.k)}),o.hidden>0&&i.jsxs("g",{className:"g-more",tabIndex:0,role:"button",transform:`translate(14, ${h.height-40})`,"aria-label":`Show ${o.hidden} more ancestors in generations ${o.hiddenGens.join(", ")}`,onClick:()=>n(Math.max(...o.hiddenGens)),onKeyDown:g(()=>n(Math.max(...o.hiddenGens))),children:[i.jsx("rect",{width:"212",height:"28",rx:"14"}),i.jsxs("text",{x:"106",y:"18.5",textAnchor:"middle",children:["+ ",o.hidden," more in generation",o.hiddenGens.length>1?`s ${o.hiddenGens[0]}–${o.hiddenGens[o.hiddenGens.length-1]}`:` ${o.hiddenGens[0]}`]})]})]})}),i.jsxs("div",{className:"g-legend","aria-label":"Legend",children:[i.jsxs("span",{className:"sw",children:[i.jsx("i",{className:"lg-design"}),"design-related recall"]}),i.jsxs("span",{className:"sw",children:[i.jsx("i",{className:"lg-recall"}),"other recall"]}),i.jsxs("span",{className:"sw",children:[i.jsx("i",{className:"lg-clean"}),"no recall record"]}),i.jsxs("span",{className:"sw",children:[i.jsx("i",{className:"lg-unread"}),"own predicates unread"]}),i.jsx("span",{className:"sep","aria-hidden":"true"}),["confirmed","extracted","disputed","conditional"].map(d=>i.jsxs("span",{className:`status status-${d}`,children:[i.jsx("span",{className:"line"}),$e[d].short]},d)),i.jsxs("span",{className:"status",style:{color:"var(--amber)"},children:[i.jsx("span",{className:"line"}),"critical chain"]})]}),i.jsx("div",{className:"graph-hint",children:"Select any device or thread for its record, quote, page and source PDF. Tab moves between them; Enter opens."})]})}const Dt=28,Ir=34,vs=260,ut=e=>e?Date.parse(e.slice(0,10)+"T00:00:00Z"):null;function Jp(e,t){const n=new Map,r=(u,c,p,h)=>{n.has(u.k)||n.set(u.k,{...u,side:c,gen:p,parent:h,children:[]})};r({...e.device,k:e.k},"self",0,null);for(const u of e.ancestors)u.gen<=t&&r(u,"up",u.gen,u.chain[u.chain.length-2]);for(const u of e.descendants)r(u,"down",u.gen,u.chain[u.chain.length-2]);for(const u of n.values())u.parent&&n.has(u.parent)&&n.get(u.parent).children.push(u.k);const l=(u,c)=>(n.get(u).decision_date||"").localeCompare(n.get(c).decision_date||""),s=[],a=u=>{for(const c of n.get(u).children.filter(p=>n.get(p).side==="down").sort(l).reverse())a(c),s.push(c)},o=u=>{for(const c of n.get(u).children.filter(p=>n.get(p).side==="up").sort(l).reverse())s.push(c),o(c)};return a(e.k),s.push(e.k),o(e.k),{nodes:n,order:s}}function bp({a:e,depth:t,highlight:n,onSelect:r}){const l=S.useRef(null),[s,a]=S.useState(1e3);S.useEffect(()=>{const k=()=>l.current&&a(Math.max(760,l.current.clientWidth));k();const R=new ResizeObserver(k);return R.observe(l.current),()=>R.disconnect()},[]);const{nodes:o,order:u}=S.useMemo(()=>Jp(e,t),[e,t]),c=new Map(u.map((k,R)=>[k,R])),p=[];for(const k of o.values()){k.decision_date&&p.push(ut(k.decision_date));for(const R of k.recalls||[])R.initiated&&p.push(ut(R.initiated))}const h=new Date(Math.min(...p)).getUTCFullYear(),f=new Date(Math.max(...p)).getUTCFullYear()+1,v=Date.UTC(h,0,1),y=Date.UTC(f,0,1),x=s-vs-40,C=k=>16+(k-v)/(y-v)*x,g=k=>Ir+k*Dt+Dt/2,d=Ir+u.length*Dt+16,m=new Set(n||[]),w=new Set;if(n)for(let k=0;k+1"+n[k+1]);const _=f-h>24?4:f-h>12?2:1,E=[];for(let k=h;k<=f;k+=_)E.push(k);const j=C(ut(e.device.decision_date));return i.jsx("div",{className:"graph-wrap",ref:l,"data-testid":"timeline",children:i.jsxs("svg",{width:s,height:d,role:"group","aria-label":`Lineage timeline for ${e.k}`,children:[E.map(k=>i.jsxs("g",{children:[i.jsx("line",{className:"tl-grid",x1:C(Date.UTC(k,0,1)),x2:C(Date.UTC(k,0,1)),y1:Ir-8,y2:d-8}),i.jsx("text",{className:"tl-axis",x:C(Date.UTC(k,0,1)),y:18,textAnchor:"middle",children:k})]},k)),i.jsx("rect",{x:0,y:g(c.get(e.k))-Dt/2,width:s,height:Dt,className:"tl-band"}),i.jsx("line",{className:"tl-clear",x1:j,x2:j,y1:Ir-8,y2:d-8}),[...o.values()].filter(k=>k.parent&&o.has(k.parent)).map(k=>{const[R,P]=k.side==="up"?[k.parent,k.k]:[k.k,k.parent],I=o.get(R),K=o.get(P);if(!I.decision_date||!K.decision_date)return null;const me=C(ut(I.decision_date)),Be=g(c.get(R)),Y=C(ut(K.decision_date)),Ze=g(c.get(P)),F=(me+Y)/2;return i.jsx("path",{d:`M${me-6},${Be} C${F},${Be} ${F},${Ze} ${Y+7},${Ze}`,className:"tl-edge"+(w.has(R+">"+P)?" on":"")},R+P)}),u.map((k,R)=>{const P=o.get(k);if(!P.decision_date)return null;const I=C(ut(P.decision_date)),K=g(R),me=aa(P),Be=m.size&&!m.has(k);return i.jsxs("g",{className:"tl-row g-node",style:{opacity:Be?.3:1},tabIndex:0,role:"button","aria-label":`${k} ${P.name}, cleared ${P.decision_date}, ${(P.recalls||[]).length} recall records`,onClick:()=>r({type:"node",k}),onKeyDown:Y=>{(Y.key==="Enter"||Y.key===" ")&&(Y.preventDefault(),r({type:"node",k}))},children:[i.jsx("rect",{className:"tl-rowhit",x:0,y:K-Dt/2,width:s,height:Dt}),(P.recalls||[]).map(Y=>Y.initiated&&i.jsxs("g",{children:[i.jsx("line",{className:"tl-rlink",x1:I,x2:C(ut(Y.initiated)),y1:K,y2:K}),i.jsx("path",{d:`M${C(ut(Y.initiated))},${K-5} l5,5 l-5,5 l-5,-5 z`,className:"tl-dia "+(Y.design_related?"design":"other"),children:i.jsx("title",{children:`${Y.id} · ${Y.classification||"unclassified"} · ${Y.root_cause} · began ${Y.initiated}`})})]},Y.id)),i.jsx("circle",{cx:I,cy:K,r:k===e.k?7:5.5,className:`dot tone-${me}${P.lineage_known===!1?" unread":""}`,style:k===e.k?{fill:"var(--ivory)",stroke:"var(--blue)",strokeWidth:3}:void 0}),i.jsxs("text",{x:s-vs+8,y:K+4,className:"tl-label",children:[i.jsx("tspan",{className:"lk",children:k}),i.jsx("tspan",{dx:"7",children:qe(P.name,24)})]}),i.jsx("text",{x:s-vs-6,y:K+4,textAnchor:"end",className:"tl-gen",children:P.side==="self"?"candidate":P.side==="up"?`G-${P.gen}`:`D+${P.gen}`})]},k)})]})})}const Nl=e=>(e.severity==="high"||e.severity==="medium")&&!e.conditional;function eh(e,t){var v,y;if(!e||!t||e.k!==t.k||e.depth!==1||t.depth<2||e.verdict===t.verdict)return null;const n=t.signals.filter(x=>{var C;return Nl(x)&&((C=x.chain)==null?void 0:C.length)>2});if(!n.length||t.signals.some(x=>{var C;return Nl(x)&&(((C=x.chain)==null?void 0:C.length)||0)<=2}))return null;const r=n[0],l=jl(r.evidence.filter(x=>x.type==="recall"),t.device.decision_date);if(!l)return null;const s=x=>t.ancestors.find(C=>C.k===x),a=(x,C)=>{var g,d;return((d=(g=s(C))==null?void 0:g.hops)==null?void 0:d.find(m=>m.src===x&&m.dst===C))||null},o=r.chain.slice(0,-1),u=o[o.length-1],c=n.filter(x=>x.chain.slice(0,-1).join(">")===o.join(">")&&x.evidence.some(C=>C.type==="recall"&&C.id===l.id)).map(x=>s(x.chain[x.chain.length-1])).filter(Boolean),p=o.slice(1).map((x,C)=>({device:s(x),hop:a(o[C],x)})),h=c.map(x=>({device:x,hop:a(u,x.k)})).filter(x=>x.hop),f=s(r.chain[1]);return{k:t.k,device:t.device,shallow:e,deep:t,recall:l,steps:p,fanout:h,predicate:f,predicateOnRecall:!!((v=f==null?void 0:f.recalls)!=null&&v.some(x=>x.id===l.id)),predicateRecalls:((y=f==null?void 0:f.recalls)==null?void 0:y.length)||0,timing:ua(l.initiated,t.device.decision_date),gen:r.gen}}function th(e,t,n=64,r=16){const l=(e||"").replace(/\s+/g," ").trim(),s=l.indexOf(t);if(s<0)return{head:qe(l,140),k:"",tail:""};let a=Math.max(0,s-n),o=Math.min(l.length,s+t.length+r);return a>0&&(a=l.indexOf(" ",a)+1||a),os+t.length?l.lastIndexOf(" ",o):o),{head:(a>0?"…":"")+l.slice(a,s),k:t,tail:l.slice(s+t.length,o)+(oe.length<2?e:e.flatMap((t,n)=>n===0?[t]:[n===e.length-1?" and ":", ",t]);function nh({a:e,onSelect:t}){var h;const[n,r]=S.useState(null),l=e.depth>=2&&e.signals.some(f=>{var v;return Nl(f)&&((v=f.chain)==null?void 0:v.length)>2})&&!e.signals.some(f=>{var v;return Nl(f)&&(((v=f.chain)==null?void 0:v.length)||0)<=2});S.useEffect(()=>{if(!l)return;let f=!0;return Promise.all([Se.assess(e.k,1),Se.assess(e.k,2)]).then(([v,y])=>{f&&r({of:e,one:v,two:y})}).catch(()=>{f&&r(null)}),()=>{f=!1}},[e,l]);const s=l&&(n==null?void 0:n.of)===e?eh(n.one,n.two):null;if(!s)return null;const{recall:a,predicate:o,timing:u}=s,c=f=>t({type:"edge",id:f.src+">"+f.dst,hop:f}),p=s.fanout.map(f=>i.jsx("span",{className:"k",children:f.device.k},f.device.k));return i.jsxs("section",{className:"panel depth-contrast corner-marks","aria-labelledby":"dc-title","data-testid":"depth-contrast",children:[i.jsxs("div",{className:"panel-head",children:[i.jsxs("h2",{id:"dc-title",children:["Why the graph matters ",i.jsx("span",{className:"count",children:"same clearance, same rules, one generation deeper"})]}),i.jsx("p",{className:"hint",children:"Depth is the number of predicate generations the Relate query walks."})]}),i.jsxs("div",{className:"dc-grid",children:[i.jsxs("div",{className:"dc-col","data-testid":"depth-1",children:[i.jsxs("p",{className:"dc-depth",children:[i.jsx("b",{children:"Depth 1"})," · direct predicates only"]}),i.jsx(Co,{a:s.shallow}),i.jsxs("p",{children:[i.jsx("span",{className:"k",children:s.k})," cites ",i.jsx("span",{className:"k",children:o.k})," (",o.name.split(",")[0],")."," ",s.predicateRecalls===0?i.jsxs(i.Fragment,{children:["FDA's recall records in this dataset name no recall for ",o.k,"."]}):i.jsxs(i.Fragment,{children:["FDA's recall records list ",s.predicateRecalls," record(s) for ",o.k,", none of them design-related."]})," ","A one-hop lookup stops here."]})]}),i.jsx("div",{className:"dc-step","aria-hidden":"true",children:i.jsx("span",{children:"+1 hop"})}),i.jsxs("div",{className:"dc-col is-deep","data-testid":"depth-2",children:[i.jsxs("p",{className:"dc-depth",children:[i.jsx("b",{children:"Depth 2"})," · one Relate query, two hops"]}),i.jsx(Co,{a:s.deep}),i.jsxs("p",{children:[i.jsx("span",{className:"k",children:o.k})," itself cites ",Po(p),"."," ","FDA lists ",s.fanout.length>1?"both":"it"," on ",i.jsx("a",{className:"mono",href:a.url,target:"_blank",rel:"noreferrer",children:a.id}),", a"," ",i.jsxs("span",{className:"amber",children:[a.classification," · ",a.root_cause]})," recall that began ",we(a.initiated),(u==null?void 0:u.relation)==="before"&&i.jsxs(i.Fragment,{children:[", ",i.jsxs("span",{className:"amber",children:[u.duration," before"]})," ",s.k," was cleared"]}),"."]})]})]}),i.jsxs("ol",{className:"dc-route","aria-label":"Evidence route, from the candidate's summary to the recall",children:[s.steps.map(({device:f,hop:v})=>v&&i.jsxs("li",{children:[i.jsxs("span",{className:"dc-n mono",children:[v.src," → ",f.k]}),i.jsx(To,{hop:v}),i.jsxs("span",{className:"dc-a",children:[i.jsxs("a",{href:ci(v.source_url,v.page),target:"_blank",rel:"noreferrer",children:[v.src," summary PDF, p.",v.page," ↗"]}),i.jsx("button",{className:"btn btn-quiet btn-sm",onClick:()=>c(v),children:"Provenance"})]})]},v.src+v.dst)),s.fanout.map(({device:f,hop:v})=>i.jsxs("li",{children:[i.jsxs("span",{className:"dc-n mono",children:[v.src," → ",f.k]}),i.jsx(To,{hop:v}),i.jsxs("span",{className:"dc-a",children:[i.jsxs("a",{href:ci(v.source_url,v.page),target:"_blank",rel:"noreferrer",children:[v.src," summary PDF, p.",v.page," ↗"]}),i.jsx("button",{className:"btn btn-quiet btn-sm",onClick:()=>c(v),children:"Provenance"})]})]},v.src+v.dst)),i.jsxs("li",{className:"is-recall",children:[i.jsx("span",{className:"dc-n mono",children:a.id}),i.jsxs("span",{className:"dc-q",children:[a.classification," · ",a.root_cause," · event ",a.event," · began ",we(a.initiated),". FDA's record lists ",Po(p),s.predicateOnRecall?i.jsxs(i.Fragment,{children:[", and ",i.jsx("span",{className:"k",children:o.k})]}):i.jsxs(i.Fragment,{children:[", not ",i.jsx("span",{className:"k",children:o.k})]}),"."]}),i.jsxs("span",{className:"dc-a",children:[i.jsx("a",{href:a.url,target:"_blank",rel:"noreferrer",children:"FDA recall record ↗"}),i.jsxs("button",{className:"btn btn-quiet btn-sm",onClick:()=>{var f;return t({type:"node",k:(f=s.fanout[0])==null?void 0:f.device.k})},children:["Open ",(h=s.fanout[0])==null?void 0:h.device.k]})]})]})]}),i.jsxs("p",{className:"dc-foot muted small",children:["A documentation signal for the predicate rationale, not a safety finding about ",s.k,". FDA attributes the recall to product families that list these clearances; it does not say which model was affected."]})]})}function Jc({text:e,k:t,ocr:n}){if(!e)return i.jsx("p",{className:"quote muted",children:"No quote stored for this citation."});const r=t?e.split(new RegExp(`(${t.replace(/^K/,"K\\s?")})`)):[e];return i.jsxs("blockquote",{className:"quote"+(n?" is-ocr":""),children:["“",/^[a-z]/.test(e)?"…":"",r.map((l,s)=>s%2?i.jsx("mark",{children:l},s):i.jsx(_l.Fragment,{children:l},s)),"”"]})}function rh({hop:e}){const t=Et(e);return i.jsxs("span",{className:`status status-${t.key}`,children:[i.jsx("span",{className:"line"}),$e[t.key].label]})}function bc({r:e}){const t=Op(e),n=Zc[So(e)];return i.jsxs("div",{className:"recall","data-attribution":So(e),children:[i.jsxs("div",{className:"recall-h",children:[i.jsx("span",{className:`chip tone-${t}`,children:t==="design"?"Design-related":t==="class1"?"Class I, other cause":"Other cause"}),i.jsx("span",{className:"k mono",children:e.id}),i.jsxs("span",{className:"muted",children:[e.classification||"Unclassified"," · ",e.root_cause||"cause not stated"," · began ",we(e.initiated)]}),e.url&&i.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer",children:"FDA record ↗"})]}),i.jsxs("div",{className:"recall-r",children:[i.jsx("span",{className:`chip tone-${n.tone}`,title:n.text,children:n.short})," ",i.jsx("span",{className:"muted small",children:n.text})]}),e.linked_before_clearance&&i.jsxs("div",{className:"recall-r","data-testid":"recall-predates",children:[i.jsx("span",{className:"chip tone-muted",title:hs.text,children:hs.short})," ",i.jsx("span",{className:"muted small",children:hs.text})]}),e.reason&&i.jsx("div",{className:"recall-r",children:e.reason}),e.status&&i.jsxs("div",{className:"recall-r",children:["Status: ",e.status,e.event?` · event ${e.event}`:"",e.firm?` · ${e.firm}`:""]})]})}function wn(e,t){return t===e.k?{...e.device,k:e.k,gen:0,side:"self"}:e.ancestors.find(n=>n.k===t)&&{...e.ancestors.find(n=>n.k===t),side:"up"}||e.descendants.find(n=>n.k===t)&&{...e.descendants.find(n=>n.k===t),side:"down"}||null}function lh({sel:e,a:t,onClose:n,go:r,reload:l,onSelect:s}){const a=S.useRef(null),o=S.useRef(null);return S.useEffect(()=>{var p;const u=document.activeElement;(p=o.current)==null||p.focus();const c=h=>{if(h.key==="Escape"&&n(),h.key==="Tab"&&a.current){const f=a.current.querySelectorAll('a[href], button:not([disabled]), input, textarea, [tabindex="0"]');if(!f.length)return;const v=f[0],y=f[f.length-1];h.shiftKey&&document.activeElement===v?(h.preventDefault(),y.focus()):!h.shiftKey&&document.activeElement===y&&(h.preventDefault(),v.focus())}};return addEventListener("keydown",c),()=>{var h;removeEventListener("keydown",c),(h=u==null?void 0:u.focus)==null||h.call(u)}},[]),i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"drawer-scrim",onClick:n}),i.jsx("aside",{className:"drawer",ref:a,role:"dialog","aria-modal":"true","aria-labelledby":"drawer-title","data-testid":"provenance",children:e.type==="edge"?i.jsx(sh,{sel:e,a:t,closeBtn:o,onClose:n,go:r,reload:l,onSelect:s}):i.jsx(ih,{sel:e,a:t,closeBtn:o,onClose:n,go:r,onSelect:s})})]})}function di({eyebrow:e,children:t,closeBtn:n,onClose:r}){return i.jsxs("div",{className:"drawer-head",children:[i.jsxs("div",{className:"t",children:[i.jsx("p",{className:"eyebrow",children:e}),i.jsx("h2",{id:"drawer-title",children:t})]}),i.jsx("button",{ref:n,className:"btn btn-quiet",onClick:r,"aria-label":"Close provenance (Escape)",children:"✕"})]})}function sh({sel:e,a:t,closeBtn:n,onClose:r,go:l,reload:s,onSelect:a}){const o=e.hop,u=wn(t,o.src)||{},c=wn(t,o.dst)||{},p=Et(o),[h,f]=S.useState(!1),[v,y]=S.useState(null),x=o.source_url||u.summary_url,C=(o.text_source||u.text_source)&&(o.text_source||u.text_source)!=="pdf_text_layer",g=async d=>{f(!0),y(null);try{const m=await Se.review(o.src,o.dst,d);m!=null&&m.citation&&a({...e,hop:m.citation}),y(m!=null&&m.citation?{ok:!0,text:d?`Recorded: ${d}. The assessment has been recomputed from the graph.`:"Review cleared. The assessment has been recomputed."}:{ok:!1,text:"The review was sent, but the graph did not return the citation. Reopen it to see its current state."}),s()}catch(m){y({ok:!1,text:m.message})}finally{f(!1)}};return i.jsxs(i.Fragment,{children:[i.jsxs(di,{eyebrow:"Citation provenance",closeBtn:n,onClose:r,children:[i.jsx("span",{className:"k",children:o.src})," cites ",i.jsx("span",{className:"k",children:o.dst})]}),i.jsxs("div",{className:"drawer-body",children:[i.jsxs("div",{className:"drawer-sec",children:[i.jsx(rh,{hop:o}),p.reasons.length>0&&i.jsx("ul",{style:{margin:"8px 0 0",paddingLeft:18,color:"var(--ink-2)",fontSize:12.5},children:p.reasons.map(d=>i.jsx("li",{children:Kc[d]||d},d))}),p.key==="conditional"&&i.jsxs("p",{className:"note-box violet",style:{marginTop:10},children:["Recall signals reached through this thread are ",i.jsx("b",{children:"conditional"}),": they hold only if this citation is a predicate. Read the page, then confirm or reject it: your review rewrites the verdict."]})]}),i.jsxs("div",{className:"drawer-sec",children:[i.jsx("h3",{children:"What the summary says"}),i.jsx(Jc,{text:o.quote||o.snippet,k:o.dst,ocr:C})]}),x&&i.jsxs("a",{className:"page-card",href:ci(x,o.page),target:"_blank",rel:"noreferrer","data-testid":"pdf-page-link",children:[i.jsx("span",{className:"sheet",children:i.jsxs("b",{children:["p.",o.page??"?"]})}),i.jsxs("span",{className:"tx",children:[i.jsxs("b",{children:["Open the original FDA PDF",o.page?` at page ${o.page}`:""," ↗"]}),i.jsxs("span",{children:[o.src," 510(k) summary · accessdata.fda.gov"]})]})]}),i.jsxs("div",{className:"drawer-sec",children:[i.jsx("h3",{children:"Source and extraction"}),i.jsxs("dl",{className:"prov-grid",children:[i.jsx("dt",{children:"Citing device"}),i.jsxs("dd",{children:[o.src," · ",qe(u.name,40),u.decision_date?` · ${we(u.decision_date)}`:""]}),i.jsx("dt",{children:"Cited device"}),i.jsxs("dd",{children:[o.dst," · ",qe(c.name,40),c.decision_date?` · ${we(c.decision_date)}`:""]}),i.jsx("dt",{children:"Role"}),i.jsx("dd",{children:o.kind||"predicate"}),i.jsx("dt",{children:"Page"}),i.jsx("dd",{children:o.page??"not recorded"}),i.jsx("dt",{children:"Text source"}),i.jsx("dd",{children:Bp[o.text_source||u.text_source]||o.text_source||u.text_source||"not recorded"}),i.jsx("dt",{children:"Extraction"}),i.jsxs("dd",{children:[o.method||"—",o.confidence!=null?` · confidence ${o.confidence}`:""]}),i.jsx("dt",{children:"Name check"}),i.jsx("dd",{children:o.name_check||"—"}),i.jsx("dt",{children:"FDA panel"}),i.jsx("dd",{children:o.panel_check||"—"}),o.audit&&i.jsxs(i.Fragment,{children:[i.jsx("dt",{children:"Audit"}),i.jsxs("dd",{children:[o.audit,o.audit_note?` — ${o.audit_note}`:""]})]}),o.ai_label&&i.jsxs(i.Fragment,{children:[i.jsx("dt",{children:"LLM label"}),i.jsxs("dd",{children:[o.ai_label,o.ai_model?` · ${o.ai_model}`:""," (advisory; never a verdict input until a person confirms)"]})]}),i.jsx("dt",{children:"Review"}),i.jsx("dd",{"data-testid":"edge-review",children:o.review?`${o.review} by ${o.reviewer||"unknown"}${cr.includes(o.reviewer)?" (automated client; advisory)":Gc(o)?" on an earlier version of the summary; needs re-review":""}`:"not reviewed by a person"}),i.jsx("dt",{children:"Trust"}),i.jsx("dd",{"data-testid":"edge-trust",children:$e[Et(o).key].label}),o.retired_at&&i.jsxs(i.Fragment,{children:[i.jsx("dt",{children:"Retired"}),i.jsxs("dd",{children:[we(o.retired_at)," · no longer cited by the refreshed summary"]})]}),u.summary_sha256&&i.jsxs(i.Fragment,{children:[i.jsx("dt",{children:"PDF SHA-256"}),i.jsx("dd",{children:i.jsx("span",{className:"mono",children:u.summary_sha256})})]})]})]}),i.jsxs("div",{className:"drawer-sec",children:[i.jsx("h3",{children:"Your review"}),i.jsxs("div",{className:"drawer-acts",children:[i.jsx("button",{className:"btn btn-line btn-sm",disabled:h,onClick:()=>g(o.review==="confirmed"&&Ge(o)?"":"confirmed"),children:o.review==="confirmed"&&Ge(o)?"Clear confirmation":"Confirm citation"}),i.jsx("button",{className:"btn btn-line btn-sm",disabled:h,onClick:()=>g(o.review==="rejected"&&Ge(o)?"":"rejected"),children:o.review==="rejected"&&Ge(o)?"Restore citation":"Reject citation"})]}),i.jsx("p",{className:"note",style:{marginTop:8},children:"A review is a write to the Relate graph. Every lineage query, verdict and saved-assessment staleness check reads it immediately."}),v&&i.jsx("p",{className:v.ok?"ok":"err",role:"status",children:v.text})]}),i.jsxs("div",{className:"drawer-acts",children:[i.jsxs("button",{className:"btn btn-quiet btn-sm",onClick:()=>a({type:"node",k:o.dst}),children:[o.dst," record →"]}),i.jsxs("button",{className:"btn btn-quiet btn-sm",onClick:()=>a({type:"node",k:o.src}),children:[o.src," record →"]})]})]})]})}function ih({sel:e,a:t,closeBtn:n,onClose:r,go:l,onSelect:s}){var h,f;const a=wn(t,e.k);if(!a)return i.jsxs(i.Fragment,{children:[i.jsx(di,{eyebrow:"Device",closeBtn:n,onClose:r,children:e.k}),i.jsx("div",{className:"drawer-body",children:"Not in this view."})]});const o=[...a.recalls||[]].sort((v,y)=>y.design_related-v.design_related||(v.initiated||"").localeCompare(y.initiated||"")),u=oa(o),c=a.side==="self"?"Candidate":a.side==="up"?{1:"Direct predicate",2:"Grand-predicate"}[a.gen]||`Generation ${a.gen} ancestor`:`Later device citing this lineage (+${a.gen})`,p=o.filter(v=>v.initiated&&t.device.decision_date&&v.initiated1&&i.jsxs(i.Fragment,{children:[i.jsx("dt",{children:"Route"}),i.jsx("dd",{className:"mono",style:{fontSize:12},children:a.chain.join(" → ")})]})]}),i.jsxs("div",{className:"drawer-acts",children:[a.k!==t.k&&i.jsxs("button",{className:"btn btn-primary btn-sm",onClick:()=>l("check",a.k),children:["Investigate ",a.k," ",i.jsx("span",{className:"arr","aria-hidden":"true",children:"→"})]}),i.jsx("a",{className:"btn btn-line btn-sm",href:Hc(a.k),target:"_blank",rel:"noreferrer",children:"FDA 510(k) record ↗"}),a.summary_url&&i.jsx("a",{className:"btn btn-line btn-sm",href:a.summary_url,target:"_blank",rel:"noreferrer",children:"Summary PDF ↗"}),a.lineage_known===!1&&i.jsx("button",{className:"btn btn-line btn-sm",onClick:()=>l("ingest",a.k),children:"Try to read its summary"})]}),((f=a.hops)==null?void 0:f.length)>0&&i.jsxs("div",{className:"drawer-sec",children:[i.jsx("h3",{children:"How it is reached"}),i.jsx("div",{className:"tags",children:a.hops.map(v=>i.jsxs("button",{className:"tag-btn",onClick:()=>s({type:"edge",id:v.src+">"+v.dst,hop:v}),children:[i.jsx("span",{className:"k",children:v.src})," → ",i.jsx("span",{className:"k",children:v.dst})," · p.",v.page??"?"," · ",$e[Et(v).key].short]},v.src+v.dst))})]}),i.jsxs("div",{className:"drawer-sec",children:[i.jsxs("h3",{children:["Recall records on which FDA lists this 510(k) · ",u.events," event(s), ",u.records," product record(s)"]}),a.side!=="self"&&p.length>0&&i.jsxs("p",{className:"note-box amber",style:{marginBottom:10},children:[p.length," of these record(s) began before ",t.k," was cleared on ",we(t.device.decision_date),"."]}),o.length===0?i.jsx("p",{className:"muted",children:"openFDA lists this 510(k) on no recall record."}):i.jsx("div",{style:{display:"grid",gap:8},children:o.slice(0,20).map(v=>i.jsx(bc,{r:v},v.id))}),o.length>20&&i.jsxs("p",{className:"muted small",children:["+ ",o.length-20," more record(s): open the device to see all."]})]})]})]})}const ah={rejected_by_reviewer:"rejected by a reviewer",audit_not_predicate:"the audit found it is not a predicate citation",audit_error:"the audit found a K-number error",audit_unresolved:"the audit could not resolve it",not_in_openfda:"K-number not found in openFDA",cleared_after_citing_device:"K-number cleared after the citing device",audit_variant:"audit marked it a naming variant",audit_corrected:"K-number corrected by the audit"};function ed(e){const t=[];for(const n of e.signals)switch(n.code){case"DIRECT_RECALL":if(n.severity==="info")break;t.push({id:n.code,tone:n.severity==="high"?"alert":"amber",sev:n.severity,title:n.title,what:"The candidate itself appears in FDA recall records.",why:n.severity==="high"?"A design-related recall on the device you would cite is what FDA's 2023 draft guidance asks you to avoid or explain.":"A Class I recall on the candidate is a documented question for any submission that cites it.",todo:"Open each recall record and document how it is addressed (scope, lots, corrective action).",node:e.k});break;case"ANCESTOR_RECALL":if(n.severity!=="medium")break;t.push({id:n.code+n.chain.join(),tone:n.conditional?"violet":"amber",sev:n.severity,title:n.title,conditional:n.conditional,what:n.conditional?"The recall holder is reached only through a citation the audit could not resolve.":`A ${n.gen===1?"direct predicate":"grand-predicate"} carries recall records the verdict rules treat as review-worthy.`,why:n.conditional?"If that citation is not a predicate, this recall does not belong to the lineage; if it is, it does.":"Reviewers expect the predicate rationale to address design-related recalls in the lineage (FDA 2023 draft guidance; Kadakia et al., JAMA 2023, an association).",todo:n.conditional?"Open the uncertain thread, read the PDF page, and confirm or reject it.":"Verify the citation on its PDF page, read the recall records, and record how the rationale addresses them.",chain:n.chain,hops:n.evidence.filter(r=>r.type==="citation")});break;case"UNCERTAIN_LINK_IN_LINEAGE":case"NAME_MISMATCH_IN_LINEAGE":t.push({id:n.code,tone:"alert",sev:"info",title:n.title,what:"Threads in this ancestry rest on evidence that conflicts with FDA records or needed correction.",why:"A doubtful thread may route the lineage to the wrong device, and the right one may be missing; these links never count as checked.",todo:"Open each thread, compare the quote with the cited device, then confirm or reject it.",hops:n.evidence.filter(r=>r.type==="citation")});break;case"ADVISORY_LINK_PENDING_REVIEW":t.push({id:n.code,tone:"violet",sev:"info",title:n.title,what:"An LLM label or the automated MCP client calls these citations predicates; no person has decided.",why:"They are not used for the verdict. If one is a real predicate, its recalls belong in the lineage and the verdict could change.",todo:"Open each link, read the PDF page, and confirm or reject it yourself.",hops:n.evidence.filter(r=>r.type==="advisory_citation")});break;case"CITATION_RETIRED_BY_REINGEST":t.push({id:n.code,tone:"muted",sev:"info",title:n.title,what:"Re-reading the citing device's FDA summary no longer found these citations, so they were retired from the lineage.",why:"Earlier reviews, labels and provenance are kept for the record; a review made on the old text may no longer apply.",todo:"Compare the refreshed summary with the earlier one and record a new review if the citation still matters.",hops:n.evidence});break;case"PREDICATE_CITATION_UNRESOLVED":t.push({id:n.code,tone:"muted",sev:"info",title:n.title,what:"Predicate citations printed in a summary did not become lineage threads.",why:"A missing thread means part of the ancestry is invisible: a recall there would not show.",todo:"Check each quote. If the citation is real and the K-number valid, add that clearance to extend the graph.",missing:n.evidence});break;case"LINEAGE_UNKNOWN":case"LINEAGE_TRUNCATED":t.push({id:n.code,tone:"muted",sev:"info",title:n.title,what:"Some summaries are not machine-readable, so the ancestry stops there.",why:"Recalls further up those branches cannot be seen. The verdict reports this gap; it never fills it in.",todo:"Try reading each summary live (needs internet), which extends the lineage by one generation.",ingest:n.code==="LINEAGE_UNKNOWN"?[{k:e.k}]:n.evidence});break;case"UNATTRIBUTED_RECALLS_IN_PRODUCT_CODE":t.push({id:n.code,tone:"muted",sev:"info",title:n.title,what:"FDA filed these recalls under the product code without naming a 510(k) number.",why:"No lineage query can attribute them; one may still concern a device in this lineage.",todo:"Read the product descriptions and check whether any names a device in this ancestry.",recalls:n.evidence});break;case"RECALL_CAUSE_OR_CLASS_UNKNOWN":t.push({id:n.code,tone:"muted",sev:"info",title:n.title,what:"Recall records without a stated root cause or FDA classification.",why:"They cannot be ruled out as design-related or Class I, so they could change the verdict once classified.",todo:"Re-check the FDA records for an updated classification or root cause.",recalls:n.evidence});break;case"DEEPER_ANCESTRY_GAPS":t.push({id:n.code,tone:"muted",sev:"info",title:n.title,what:"Gaps beyond the two-generation verdict window.",why:"They cannot change the verdict, but the lower-severity list may be incomplete.",todo:"Expand the graph to deeper generations if the deeper ancestry matters to your rationale."});break}return t}function oh({a:e,onSelect:t,go:n,onFocusChain:r}){const l=ed(e);return l.length?i.jsx("div",{"data-testid":"review-queue",children:l.map(s=>{var a,o,u,c;return i.jsxs("section",{className:`review-item tone-${s.tone}`,onMouseEnter:()=>s.chain&&r(s.chain),onMouseLeave:()=>r(null),children:[i.jsxs("h3",{children:[i.jsx("span",{className:`sev sev-${s.sev}`,children:s.conditional?"conditional":s.sev==="info"?"gap":s.sev}),i.jsx("span",{children:s.title})]}),i.jsxs("dl",{children:[i.jsx("dt",{children:"Conflict"}),i.jsx("dd",{children:s.what}),i.jsx("dt",{children:"Why it matters"}),i.jsx("dd",{children:s.why}),i.jsx("dt",{children:"Next step"}),i.jsx("dd",{children:s.todo})]}),((a=s.hops)==null?void 0:a.length)>0&&i.jsx("div",{className:"links",children:s.hops.slice(0,8).map(p=>{const h=Et(p);return i.jsxs("button",{className:"tag-btn",onClick:()=>t({type:"edge",id:p.src+">"+p.dst,hop:p}),title:h.reasons.map(f=>Kc[f]).join("; ")||$e[h.key].label,children:[i.jsx("span",{className:"k",children:p.src})," → ",i.jsx("span",{className:"k",children:p.dst})," · p.",p.page??"?"," · ",i.jsx("span",{className:`status-${h.key}`,children:$e[h.key].short})]},p.src+p.dst)})}),((o=s.missing)==null?void 0:o.length)>0&&i.jsx("div",{className:"links",children:s.missing.slice(0,8).map(p=>i.jsxs("button",{className:"tag-btn",title:p.quote||"",onClick:()=>n("ingest",p.cited),children:[i.jsx("span",{className:"k",children:p.src})," → ",i.jsx("span",{className:"k",children:p.cited})," · ",ah[p.reason]||p.reason]},p.src+p.cited))}),((u=s.ingest)==null?void 0:u.length)>0&&i.jsx("div",{className:"links",children:s.ingest.slice(0,10).map(p=>i.jsxs("button",{className:"tag-btn",onClick:()=>n("ingest",p.k),children:[i.jsx("span",{className:"k",children:p.k}),p.summary_status?` · ${p.summary_status}`:""," · read now"]},p.k))}),((c=s.recalls)==null?void 0:c.length)>0&&i.jsx("div",{className:"links",children:s.recalls.slice(0,8).map(p=>p.url?i.jsxs("a",{className:"tag-btn",href:p.url,target:"_blank",rel:"noreferrer",children:[p.id," ↗"]},p.id):i.jsx("span",{className:"tag-btn",children:p.id},p.id))}),s.node&&i.jsx("div",{className:"acts",children:i.jsx("button",{className:"btn btn-line btn-sm",onClick:()=>t({type:"node",k:s.node}),children:"Open recall records"})}),s.chain&&i.jsx("div",{className:"acts",children:i.jsxs("button",{className:"btn btn-line btn-sm",onClick:()=>t({type:"node",k:s.chain[s.chain.length-1]}),children:["Open ",s.chain[s.chain.length-1]," records"]})})]},s.id)})}):i.jsx("p",{className:"muted",children:"Nothing in this lineage needs a person's attention under the current rules."})}function ca(e){const t=e.signals.filter(n=>{var r;return(n.severity==="high"||n.severity==="medium")&&((r=n.chain)==null?void 0:r.length)>1});return t.find(n=>!n.conditional)||t[0]||null}function uh({a:e}){const t=e.device,n=ca(e),r=e.signals.find(l=>l.code==="DIRECT_RECALL"&&l.severity!=="info"&&l.severity!=="low");if(r&&(!n||r.severity==="high")){const l=jl(r.evidence.filter(s=>s.type==="recall"),null);return i.jsxs("p",{className:"finding-sentence","data-testid":"finding-sentence",children:[i.jsx("span",{className:"k",children:e.k})," itself appears in FDA recall records",l&&i.jsxs(i.Fragment,{children:[": a ",i.jsxs("span",{className:"amber",children:[l.classification||"unclassified"," ",l.root_cause]})," recall began ",we(l.initiated)]}),"."," ","Citing it as a predicate would need that addressed."]})}if(n){const l=wn(e,n.chain[n.chain.length-1]),s=n.evidence.filter(p=>p.type==="recall"),a=jl(s,t.decision_date),o=n.evidence.find(p=>p.type==="citation"&&p.src===e.k),u=a?ua(a.initiated,t.decision_date):null,c=oa(s);return i.jsxs("p",{className:"finding-sentence","data-testid":"finding-sentence",children:[qe(t.name,48)," cites ",i.jsx("span",{className:"k",children:n.chain[1]}),o!=null&&o.page?i.jsxs(i.Fragment,{children:[" on page ",o.page," of its summary"]}):null,"."," ",n.conditional?i.jsxs(i.Fragment,{children:["The cited device ",i.jsx("span",{className:"k",children:l==null?void 0:l.k}),", reached through a citation the audit could not resolve,"]}):n.chain.length>2?i.jsxs(i.Fragment,{children:["Through it, ",n.gen===2?"grand-predicate":`generation-${n.gen} ancestor`," ",i.jsx("span",{className:"k",children:l==null?void 0:l.k})]}):i.jsx(i.Fragment,{children:"That predicate"})," ","(",qe(l==null?void 0:l.name,52),") is listed by FDA on ",c.events," recall event",c.events===1?"":"s"," in this signal",a&&i.jsxs(i.Fragment,{children:[", including a ",i.jsxs("span",{className:"amber",children:[a.classification||"unclassified"," ",a.root_cause]})," recall that began ",we(a.initiated),u&&i.jsxs(i.Fragment,{children:[", ",u.relation==="before"?i.jsxs(i.Fragment,{children:[i.jsxs("span",{className:"amber",children:[u.duration," before"]})," ",e.k," was cleared"]}):Xc(u,e.k)]})]}),".",n.conditional&&i.jsxs(i.Fragment,{children:[" This route is ",i.jsx("b",{style:{color:"var(--violet)"},children:"conditional"}),": it holds only if that citation is a predicate."]})]})}return i.jsx("p",{className:"finding-sentence","data-testid":"finding-sentence",children:e.verdict_reason})}function ch({a:e,onSelect:t}){const n=ca(e);if(!n)return null;const r=n.evidence.filter(c=>c.type==="citation"),l=(c,p)=>{var h,f;return r.find(v=>v.src===c&&v.dst===p)||((f=(h=wn(e,p))==null?void 0:h.hops)==null?void 0:f.find(v=>v.src===c&&v.dst===p))},s=n.chain[n.chain.length-1],a=n.evidence.filter(c=>c.type==="recall"),o=jl(a,e.device.decision_date),u=o?ua(o.initiated,e.device.decision_date):null;return i.jsxs("section",{className:"panel corner-marks","aria-labelledby":"chain-title","data-testid":"critical-chain",children:[i.jsxs("div",{className:"panel-head",children:[i.jsxs("h2",{id:"chain-title",children:["Critical chain ",i.jsx("span",{className:"count",children:"predicate → recall, the route that raised the verdict"})]}),i.jsx("p",{className:"hint",children:"Select a thread for its page and quote."})]}),i.jsx("div",{className:"chain",children:n.chain.map((c,p)=>{const h=wn(e,c)||{},f=p===0?"Candidate":n.conditional?"Cited device · citation unresolved":p===1?"Direct predicate":p===2?"Grand-predicate":`Generation ${p}`,v=c===s,y=v?aa({recalls:a}):"none",x=p>0?l(n.chain[p-1],c):null,C=x?Et(x):null;return i.jsxs(_l.Fragment,{children:[p>0&&i.jsxs("button",{className:`chain-link st-${(C==null?void 0:C.key)||"extracted"}`,onClick:()=>x&&t({type:"edge",id:x.src+">"+x.dst,hop:x}),"aria-label":`${n.chain[p-1]} cites ${c}${x!=null&&x.page?` on page ${x.page}`:""}, ${$e[(C==null?void 0:C.key)||"extracted"].label}. Open provenance.`,children:[i.jsxs("span",{className:"lbl",children:["cites",x!=null&&x.page?` · p.${x.page}`:""]}),i.jsx("span",{className:"sub",children:$e[(C==null?void 0:C.key)||"extracted"].short})]}),i.jsxs("button",{className:`chain-node${p===0?" is-self":""}${y==="design"?" tone-design":""}`,onClick:()=>t({type:"node",k:c}),children:[i.jsx("span",{className:"role",children:f}),i.jsx("span",{className:"k",children:c}),i.jsx("span",{className:"nm",children:qe(h.name,44)}),i.jsxs("span",{className:"dt",children:["Cleared ",we(h.decision_date)]}),v&&o&&i.jsxs("span",{className:"rc",children:[i.jsxs("span",{className:`chip tone-${o.design_related?"design":"class1"}`,children:[o.classification||"Unclassified"," · ",o.root_cause]}),i.jsxs("span",{className:"dt",children:["Recall began ",we(o.initiated)," · ",i.jsx("span",{className:"mono",children:o.id})]})]})]})]},c)})}),o&&u&&i.jsxs("div",{className:"chain-timing",children:[i.jsxs("span",{className:"chip tone-amber",children:[i.jsx("span",{className:"glyph"}),Xc(u,e.k,"chip")]}),i.jsxs("span",{className:"muted",children:[oa(a).events," recall event(s) · ",a.length," product record(s) in this signal. Documentation signal, not a safety finding."]})]})]})}function dh({k:e,go:t,onChanged:n}){var Y,Ze;const[r,l]=S.useState(null),[s,a]=S.useState(null),[o,u]=S.useState(!1),[c,p]=S.useState(4),[h,f]=S.useState(2),[v,y]=S.useState("graph"),[x,C]=S.useState(!1),[g,d]=S.useState(null),[m,w]=S.useState(null),[_,E]=S.useState([]),[j,k]=S.useState([]),R=()=>{u(!0),a(null),Se.assess(e,c).then(F=>{l(F)}).catch(F=>{l(null),a(F.message)}).finally(()=>u(!1)),Se.assessments(e).then(E).catch(()=>E([])),Se.investigations(e,10).then(k).catch(()=>k([]))};if(S.useEffect(()=>{d(null),f(2),R()},[e,c]),s)return i.jsxs("div",{className:"panel",role:"alert",children:[i.jsx("p",{className:"err",style:{fontSize:15},children:s}),s.includes("not in the graph")&&i.jsxs("button",{className:"btn btn-primary",onClick:()=>t("ingest",e),children:["Read ",e," from FDA now ",i.jsx("span",{className:"arr",children:"→"})]})]});if(!r)return i.jsxs("div",{"aria-busy":"true",children:[i.jsxs("div",{className:"loading-thread",children:[i.jsx("i",{}),"Walking ",e,"'s lineage in the Relate graph…"]}),i.jsx("div",{className:"skeleton",style:{height:210,marginBottom:16}}),i.jsx("div",{className:"skeleton",style:{height:160,marginBottom:16}}),i.jsx("div",{className:"skeleton",style:{height:380}})]});const P=r.device,I=r.coverage,K={...Kn[r.verdict],...qc(r.verdict,I.evidence)},me=ed(r).length,Be=r.signals.filter(F=>F.conditional).length;return i.jsxs("div",{className:"investigation","aria-busy":o,children:[i.jsxs("section",{className:`finding tone-${K.tone}`,"aria-labelledby":"finding-title","data-testid":"finding",children:[i.jsxs("div",{className:"finding-top",children:[i.jsxs("div",{className:"finding-id",children:[i.jsxs("div",{className:"kline",children:[i.jsx("span",{className:"k",children:r.k}),i.jsxs("span",{children:[P.product_code,(Y=P.product)!=null&&Y.name?` · ${P.product.name}`:""]})]}),i.jsx("h1",{id:"finding-title",children:P.name}),i.jsxs("div",{className:"meta",children:[i.jsx("span",{children:P.applicant}),i.jsxs("span",{children:["Cleared ",we(P.decision_date)]}),i.jsx("span",{children:P.clearance_type||"510(k)"}),i.jsx("a",{href:Hc(r.k),target:"_blank",rel:"noreferrer",children:"FDA record ↗"}),P.summary_url&&i.jsx("a",{href:P.summary_url,target:"_blank",rel:"noreferrer",children:"510(k) summary PDF ↗"})]})]}),i.jsxs("div",{className:`verdict tone-${K.tone}`,"data-testid":"verdict",children:[i.jsxs("div",{className:"verdict-label",children:[i.jsx("i",{"aria-hidden":"true"}),K.label]}),i.jsx("p",{className:"verdict-reason",children:r.verdict_reason}),i.jsx("div",{className:"verdict-actions",children:i.jsx("button",{className:"btn btn-line btn-sm",onClick:()=>t("compare",r.k),children:"Compare with other candidates"})}),i.jsxs("div",{className:"authority",children:[i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6","aria-hidden":"true",children:i.jsx("path",{d:"M8 1.5l5.5 2v4.2c0 3.3-2.3 5.8-5.5 6.8-3.2-1-5.5-3.5-5.5-6.8V3.5z M5.5 8l1.8 1.8L10.8 6.3"})}),i.jsxs("span",{children:[i.jsx("b",{children:"Deterministic assessment"})," · ",r.rules_version,". Authoritative within its documented scope: ",I.evidence_scope,", from machine-readable FDA records. A documentation signal, not a safety determination."]})]})]})]}),i.jsx(uh,{a:r}),i.jsxs("div",{className:"coverage-row","aria-label":"Evidence coverage",children:[i.jsxs("span",{className:`chip tone-${I.evidence==="complete"?"calm":I.evidence==="uncertain"?"alert":"muted"}`,title:"Completeness of evidence inside the verdict window",children:["Evidence ",I.evidence]}),(I.evidence_reasons||[]).map(F=>i.jsx("span",{className:"chip tone-muted","data-testid":"evidence-reason",children:Qp[F]||F},F)),i.jsxs("span",{className:"chip",children:[I.ancestors," ancestors · ",I.generations_traversed," generations"]}),I.ancestors_lineage_unknown>0&&i.jsxs("span",{className:"chip tone-muted",children:[I.ancestors_lineage_unknown," with unread summaries"]}),I.doubtful_links>0&&i.jsxs("span",{className:"chip tone-alert",children:[I.doubtful_links," doubtful link(s)"]}),Be>0&&i.jsxs("span",{className:"chip tone-violet",children:[Be," conditional signal(s)"]}),me>0&&i.jsxs("a",{className:"chip tone-blue",href:"#review",onClick:F=>{var T;F.preventDefault(),(T=document.getElementById("review"))==null||T.scrollIntoView({block:"start"})},children:[me," item(s) need human review ↓"]})]})]}),i.jsx(nh,{a:r,onSelect:d}),i.jsx(ch,{a:r,onSelect:d}),i.jsxs("section",{className:"panel","aria-labelledby":"graph-title",children:[i.jsxs("div",{className:"panel-head",children:[i.jsxs("h2",{id:"graph-title",children:["Evidence graph ",i.jsxs("span",{className:"count",children:[r.ancestors.length," ancestors · ",r.descendants.length," later devices"]})]}),i.jsxs("div",{className:"graph-tools",children:[i.jsxs("div",{className:"seg",role:"group","aria-label":"View",children:[i.jsx("button",{"aria-pressed":v==="graph",onClick:()=>y("graph"),children:"Graph"}),i.jsx("button",{"aria-pressed":v==="timeline",onClick:()=>y("timeline"),children:"Timeline"})]}),i.jsxs("label",{className:"small muted",children:["Show ",i.jsx("select",{className:"field",value:h,onChange:F=>f(+F.target.value),"aria-label":"Generations shown",children:Array.from({length:c},(F,T)=>T+1).map(F=>i.jsxs("option",{value:F,children:[F," gen"]},F))})]}),i.jsxs("label",{className:"small muted",children:["Query ",i.jsx("select",{className:"field",value:c,onChange:F=>p(+F.target.value),"aria-label":"Generations traversed by the query",children:[2,3,4,5,6].map(F=>i.jsxs("option",{value:F,children:[F," gen"]},F))})]}),v==="graph"&&r.descendants.length>0&&i.jsxs("button",{className:"btn btn-line btn-sm","aria-pressed":x,onClick:()=>C(!x),children:[x?"Hide":"Show"," later devices"]})]})]}),v==="graph"?i.jsx(Zp,{a:r,depth:h,onDepth:f,descendants:x,selected:g,onSelect:d,focusChain:m}):i.jsx(bp,{a:r,depth:h,highlight:m||((Ze=ca(r))==null?void 0:Ze.chain),onSelect:d}),i.jsxs("p",{className:"graph-hint",children:["By hand, this is ",1+r.ancestors.filter(F=>F.lineage_known).length," summary PDFs opened one generation at a time and ",1+r.ancestors.length," separate recall searches. Here it is one Relate query."]})]}),i.jsxs("div",{className:"grid-main",children:[i.jsxs("div",{style:{minWidth:0},children:[i.jsxs("section",{className:"panel",id:"review","aria-labelledby":"review-title",style:{scrollMarginTop:120},children:[i.jsxs("div",{className:"panel-head",children:[i.jsxs("h2",{id:"review-title",children:["What needs human review ",i.jsx("span",{className:"count",children:me})]}),i.jsx("p",{className:"hint",children:"What conflicts, why it matters, and what to do next."})]}),i.jsx(oh,{a:r,onSelect:d,go:t,onFocusChain:w})]}),i.jsx(fh,{a:r,onSelect:d})]}),i.jsxs("aside",{style:{minWidth:0},children:[i.jsx(hh,{a:r,reload:R,go:t,onSelect:d}),i.jsx(mh,{a:r,onSaved:()=>{Se.assessments(e).then(E),n&&n()}}),i.jsx(vh,{a:r,assessments:_,runs:j,go:t})]})]}),g&&i.jsx(lh,{sel:g,a:r,onClose:()=>d(null),go:(F,T)=>{d(null),t(F,T)},reload:R,onSelect:d})]})}function fh({a:e,onSelect:t}){const n=e.signals.filter(r=>r.severity==="high"||r.severity==="medium"||r.severity==="low");return i.jsxs("section",{className:"panel","aria-labelledby":"signals-title",children:[i.jsxs("div",{className:"panel-head",children:[i.jsxs("h2",{id:"signals-title",children:["Recall signals ",i.jsxs("span",{className:"count",children:[n.length," in the readable ancestry"]})]}),i.jsx("p",{className:"hint",children:"Every recall record behind the verdict, by generation."})]}),n.length===0&&i.jsx("p",{className:"muted",children:"No recall records anywhere in the readable ancestry."}),n.map((r,l)=>i.jsx(ph,{s:r,onSelect:t},l))]})}function ph({s:e,onSelect:t}){var s;const[n,r]=S.useState(e.severity==="high"),l=e.evidence.filter(a=>a.type==="recall");return i.jsxs("div",{className:"signal",children:[i.jsxs("button",{className:"signal-head","aria-expanded":n,onClick:()=>r(!n),children:[i.jsx("span",{className:`sev sev-${e.severity}`,children:e.conditional?"cond.":e.severity}),i.jsx("span",{className:"t",children:e.title}),i.jsx("svg",{className:"chev",width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",children:i.jsx("path",{d:"M4 2l4 4-4 4",stroke:"currentColor",fill:"none",strokeWidth:"1.5"})})]}),n&&i.jsxs("div",{className:"signal-body",children:[((s=e.chain)==null?void 0:s.length)>1&&i.jsx("div",{className:"tags",children:e.chain.map((a,o)=>i.jsxs(_l.Fragment,{children:[o>0&&i.jsx("span",{className:"muted small","aria-hidden":"true",children:"→"}),i.jsx("button",{className:"tag-btn",onClick:()=>t({type:"node",k:a}),children:i.jsx("span",{className:"k",children:a})})]},a))}),l.slice(0,6).map(a=>i.jsx(bc,{r:a},a.id)),l.length>6&&i.jsxs("p",{className:"muted small",children:["+ ",l.length-6," more record(s): open ",e.chain[e.chain.length-1]," for all."]})]})]})}const Ar=(e,t)=>e.review===t&&Ge(e);function hh({a:e,reload:t,go:n,onSelect:r}){const[l,s]=S.useState(null),[a,o]=S.useState(null),u=async(c,p,h)=>{s(c.dst+h),o(null);try{const f=await p();o(h==="ai"?{ok:!0,text:`LLM labelled ${c.dst} "${f.ai_label}" (${f.model.split("/")[1]}, ${f.seconds}s). Advisory only: it is not used for the verdict until a person confirms the citation.`}:null),t()}catch(f){o({ok:!1,text:f.message})}finally{s(null)}};return i.jsxs("section",{className:"panel","aria-labelledby":"cites-title",children:[i.jsx("div",{className:"panel-head",children:i.jsxs("h2",{id:"cites-title",children:["What ",e.k," cites ",i.jsx("span",{className:"count",children:e.citations.length})]})}),i.jsx("p",{className:"lede",children:"Read from its 510(k) summary. Your review is written to the graph and changes every lineage query."}),e.device.lineage_known===!1&&i.jsxs("p",{className:"note-box",children:["Summary not machine-readable (",e.device.summary_status,")."," ",i.jsx("button",{className:"btn btn-quiet btn-sm",onClick:()=>n("ingest",e.k),children:"Try reading it now →"})]}),a&&i.jsx("p",{className:a.ok?"ok":"err",role:"status",children:a.text}),e.citations.map(c=>{const p={...c,src:e.k},h=c.in_lineage??c.kind==="predicate",f=Et(p);return i.jsxs("div",{className:"cit"+(c.review==="rejected"&&Ge(c)?" is-rejected":""),children:[i.jsxs("div",{className:"cit-h",children:[i.jsx("button",{className:"k mono",onClick:()=>r({type:"edge",id:e.k+">"+c.dst,hop:p}),children:c.dst}),i.jsx("span",{className:`chip ${c.kind==="predicate"?"tone-blue":"tone-muted"}`,children:c.kind}),h||f.key==="advisory"||f.key==="retired"?i.jsxs("span",{className:`status status-${f.key}`,title:$e[f.key].label,"data-testid":`cit-status-${c.dst}`,children:[i.jsx("span",{className:"line"}),$e[f.key].short]}):i.jsx("span",{className:"status status-rejected",title:"Reference devices and mentions are not lineage links","data-testid":`cit-status-${c.dst}`,children:"Not a lineage link"}),c.ai_label&&i.jsxs("span",{className:"chip tone-violet",title:c.ai_quote,children:["LLM: ",c.ai_label]}),i.jsxs("span",{className:"muted small",children:[qe(c.name,34)," · ",Yc(c.dst_decision_date)]})]}),i.jsx(Jc,{text:c.quote||c.snippet,k:c.dst,ocr:c.text_source&&c.text_source!=="pdf_text_layer"}),i.jsxs("div",{className:"cit-a",children:[i.jsx("button",{className:"btn btn-line btn-sm",disabled:!!l,onClick:()=>u(c,()=>Se.review(e.k,c.dst,Ar(c,"confirmed")?"":"confirmed"),"ok"),children:Ar(c,"confirmed")?"Unconfirm":"Confirm"}),i.jsx("button",{className:"btn btn-line btn-sm",disabled:!!l,onClick:()=>u(c,()=>Se.review(e.k,c.dst,Ar(c,"rejected")?"":"rejected"),"no"),children:Ar(c,"rejected")?"Restore":"Reject"}),c.kind!=="predicate"&&i.jsx("button",{className:"btn btn-quiet btn-sm",disabled:!!l,onClick:()=>u(c,()=>Se.triage(e.k,c.dst),"ai"),children:l===c.dst+"ai"?"Asking…":"Ask LLM to label"}),i.jsxs("button",{className:"btn btn-quiet btn-sm",onClick:()=>r({type:"edge",id:e.k+">"+c.dst,hop:p}),children:["Provenance · p.",c.page]})]})]},c.dst)})]})}function mh({a:e,onSaved:t}){const[n,r]=S.useState(!1),[l,s]=S.useState(""),[a,o]=S.useState(null),[u,c]=S.useState(!1);S.useEffect(()=>{o(null),r(!1),s("")},[e.k]);const p=async()=>{c(!0);try{const f=await Se.save(e.k,l);o(f),r(!1),s(""),t()}catch(f){o({error:f.message})}finally{c(!1)}},h=e.memo.headline+` + +`+e.memo.paragraphs.map(f=>f.text).join(` + +`);return i.jsxs("section",{className:"panel memo","aria-labelledby":"memo-title",children:[i.jsx("div",{className:"panel-head",children:i.jsx("h2",{id:"memo-title",children:"Due-diligence note"})}),i.jsx("div",{className:"src",children:e.memo.source}),i.jsx("p",{children:i.jsx("b",{children:e.memo.headline})}),e.memo.paragraphs.slice(0,2).map((f,v)=>i.jsx("p",{children:f.text},v)),e.memo.paragraphs.length>2&&i.jsxs("p",{className:"muted small",children:["+ ",e.memo.paragraphs.length-2," more paragraph(s) in the copied note."]}),i.jsxs("div",{className:"cit-a",style:{marginTop:8},children:[i.jsx("button",{className:"btn btn-primary btn-sm",onClick:()=>r(!n),"aria-expanded":n,children:"Save assessment to graph"}),i.jsx("button",{className:"btn btn-line btn-sm",onClick:()=>{var f;return(f=navigator.clipboard)==null?void 0:f.writeText(h)},children:"Copy note"})]}),n&&i.jsxs("div",{style:{marginTop:10,display:"grid",gap:8},children:[i.jsx("label",{className:"small muted",htmlFor:"analyst-note",children:"Optional analyst note, stored with the assessment"}),i.jsx("textarea",{id:"analyst-note",className:"field",rows:3,value:l,onChange:f=>s(f.target.value),maxLength:1e3}),i.jsxs("div",{className:"cit-a",children:[i.jsx("button",{className:"btn btn-primary btn-sm",disabled:u,onClick:p,children:u?"Saving…":"Save to Relate"}),i.jsx("button",{className:"btn btn-quiet btn-sm",onClick:()=>r(!1),children:"Cancel"})]})]}),a&&(a.error?i.jsx("p",{className:"err",children:a.error}):i.jsxs("p",{className:"ok",role:"status",children:["Saved ",a.id,": linked to ",a.flagged_recalls.length," flagged recall record(s)."]}))]})}function vh({a:e,assessments:t,runs:n,go:r}){return i.jsxs("section",{className:"panel","aria-labelledby":"hist-title",children:[i.jsxs("div",{className:"panel-head",children:[i.jsx("h2",{id:"hist-title",children:"Investigation history"}),i.jsx("a",{className:"small",href:"#/history",children:"All history →"})]}),i.jsx("h3",{className:"eyebrow",style:{fontSize:10.5,margin:"0 0 8px"},children:"Saved assessments"}),t.length===0?i.jsxs("p",{className:"muted small",children:["None saved for ",e.k," yet."]}):t.map(l=>{var s,a,o,u,c,p;return i.jsxs("div",{className:"hist",children:[i.jsxs("div",{className:"hist-h",children:[i.jsx("span",{className:"k mono",children:l.id}),i.jsx("span",{className:"muted",children:(s=l.created_at)==null?void 0:s.slice(0,16).replace("T"," ")}),i.jsx("span",{className:`chip tone-${((a=Kn[l.verdict])==null?void 0:a.tone)||"muted"}`,children:((o=Kn[l.verdict])==null?void 0:o.label)||l.verdict})]}),l.stale&&i.jsxs("div",{className:"stale",children:["Stale: the graph changed after this was saved",l.verdict_now!==l.verdict&&i.jsxs(i.Fragment,{children:[" (verdict now ",((u=Kn[l.verdict_now])==null?void 0:u.label)||l.verdict_now,")"]}),((c=l.changed_edges)==null?void 0:c.length)>0&&i.jsxs(i.Fragment,{children:[" · reviewed links: ",l.changed_edges.join(", ")]}),((p=l.reingested)==null?void 0:p.length)>0&&i.jsxs(i.Fragment,{children:[" · re-ingested: ",l.reingested.join(", ")]})]})]},l.id)}),i.jsx("h3",{className:"eyebrow",style:{fontSize:10.5,margin:"16px 0 8px"},children:"Agent runs (optional)"}),i.jsx("p",{className:"muted small",style:{margin:"0 0 6px"},children:"Machine findings, never human-approved. The verdict above does not depend on them."}),n.length===0?i.jsxs("p",{className:"muted small",children:["No agent runs examined ",e.k," in this store."]}):n.map(l=>i.jsxs("div",{className:"hist",children:[i.jsxs("div",{className:"hist-h",children:[i.jsx("span",{className:"k mono",children:l.id}),i.jsx("span",{className:"chip",children:l.status}),l.stale&&i.jsx("span",{className:"stale",children:"stale"}),i.jsx("a",{href:Lp(l.id),target:"_blank",rel:"noreferrer",children:"Report ↗"})]}),i.jsx("div",{className:"muted",children:(l.request||"").slice(0,110)})]},l.id))]})}function gh({go:e,stats:t}){const n=[["K252078","BreathePal Bilevel","Cleared 2026 · direct predicate under a Class I design recall"],["K251770","SleepRes PAP System","Cleared 2025 · depth 1 finds no signal; depth 2 finds a Class I design recall"],["K200480","DreamStation 2","Cleared 2020, before the June 2021 recall began"]];return i.jsxs("div",{className:"home-hero",children:[i.jsxs("div",{className:"page-head",children:[i.jsx("p",{className:"eyebrow",children:"Investigate"}),i.jsx("h1",{children:"Check a predicate's ancestry before you cite it."}),i.jsxs("p",{children:["Search any clearance above (press ",i.jsx("code",{children:"/"}),"), or open one of the real cases in the shipped dataset of CPAP, BiPAP and ventilator clearances."]})]}),i.jsxs("div",{className:"home-cases",children:[n.map(([r,l,s])=>i.jsxs("button",{className:"case",onClick:()=>e("check",r),children:[i.jsx("span",{className:"k mono",children:r}),i.jsx("h3",{children:l}),i.jsx("p",{children:s})]},r)),i.jsxs("button",{className:"case",onClick:()=>e("reach","88058,88071"),children:[i.jsx("span",{className:"k mono",children:"Recall 88058 + 88071"}),i.jsx("h3",{children:"Philips foam recall reach"}),i.jsx("p",{children:"Who descends from the June 2021 recall?"})]})]}),t&&i.jsxs("p",{className:"muted small",style:{marginTop:18},children:[t.nodes.Device.toLocaleString("en-US")," clearances · ",t.citations_by_kind.predicate.toLocaleString("en-US")," predicate links · ",t.nodes.Recall.toLocaleString("en-US")," recall records in the Relate store."]})]})}const yh={compare:S.lazy(()=>Ft(()=>import("./Views-Cl1sIo7q.js"),[]).then(e=>({default:e.CompareView}))),reach:S.lazy(()=>Ft(()=>import("./Views-Cl1sIo7q.js"),[]).then(e=>({default:e.ReachView}))),watch:S.lazy(()=>Ft(()=>import("./Views-Cl1sIo7q.js"),[]).then(e=>({default:e.WatchlistView}))),ingest:S.lazy(()=>Ft(()=>import("./Views-Cl1sIo7q.js"),[]).then(e=>({default:e.IngestView}))),history:S.lazy(()=>Ft(()=>import("./History-B4TVd-Qw.js"),[])),method:S.lazy(()=>Ft(()=>import("./Views-Cl1sIo7q.js"),[]).then(e=>({default:e.MethodView})))},xh={check:i.jsx("path",{d:"M11 11l4 4M7 12.5A5.5 5.5 0 107 1.5a5.5 5.5 0 000 11z"}),compare:i.jsx("path",{d:"M2 3h5v10H2zM9 3h5v10H9z"}),reach:i.jsx("path",{d:"M3 8a5 5 0 1010 0A5 5 0 003 8zm3 0a2 2 0 104 0 2 2 0 00-4 0z"}),watch:i.jsx("path",{d:"M1.5 8S4 3 8 3s6.5 5 6.5 5S12 13 8 13 1.5 8 1.5 8zM8 10a2 2 0 100-4 2 2 0 000 4z"}),ingest:i.jsx("path",{d:"M8 2v8m0 0l-3-3m3 3l3-3M2 12v2h12v-2"}),history:i.jsx("path",{d:"M8 4v4l2.5 2M2.5 8a5.5 5.5 0 105.5-5.5A5.6 5.6 0 003 6M3 2.5V6h3.5"}),method:i.jsx("path",{d:"M3 2h7l3 3v9H3zM10 2v3h3M5.5 8h5M5.5 11h5"})},kh=({name:e})=>i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:xh[e]}),wh=[["Investigate",[["check","Predicate check"],["compare","Compare predicates"]]],["Recall evidence",[["reach","Recall reach"],["watch","Watchlist"]]],["Graph",[["ingest","Add a clearance"],["history","History"],["method","Method"]]]];function jh({route:e,go:t,stats:n,statsErr:r,refreshStats:l,onReplay:s}){var u,c;const a=S.useRef(null);S.useEffect(()=>{var p;(p=a.current)==null||p.focus({preventScroll:!0})},[e.tab]);const o=yh[e.tab];return i.jsxs("div",{className:"ws",children:[i.jsxs("header",{className:"ws-top",children:[i.jsx("a",{className:"brand",href:"#/","aria-label":"Forebear home: the film",children:i.jsx(Rp,{size:24})}),i.jsx(Nh,{go:t}),i.jsx("span",{className:"spacer"}),i.jsxs("div",{className:"store-chip",title:"Live counts from the Relate single-file store",children:[i.jsx("i",{className:"dot"+(r?" off":""),"aria-hidden":"true"}),n?i.jsxs("span",{className:"counts",children:[i.jsx("b",{children:(u=n.nodes.Device)==null?void 0:u.toLocaleString("en-US")})," devices · ",i.jsx("b",{children:(c=n.nodes.Recall)==null?void 0:c.toLocaleString("en-US")})," recalls · Relate"]}):i.jsx("span",{children:r?"API unavailable":"Connecting…"})]})]}),i.jsxs("nav",{className:"ws-rail","aria-label":"Workspace",children:[wh.map(([p,h])=>i.jsxs(_l.Fragment,{children:[i.jsx("div",{className:"group",children:p}),h.map(([f,v])=>i.jsxs("a",{href:`#/${f}`,"aria-current":e.tab===f?"page":void 0,children:[i.jsx(kh,{name:f}),v]},f))]},p)),i.jsxs("div",{className:"rail-foot",children:["Verdicts are deterministic documentation signals from FDA records, not safety findings.",!matchMedia("(prefers-reduced-motion: reduce)").matches&&i.jsx("div",{style:{marginTop:10},children:i.jsx("button",{onClick:s,children:"Replay the film"})})]})]}),i.jsxs("main",{className:"ws-main",id:"main",ref:a,tabIndex:-1,style:{outline:"none"},children:[e.tab==="check"&&(e.arg?i.jsx(dh,{k:e.arg.toUpperCase(),go:t,onChanged:l}):i.jsx(gh,{go:t,stats:n})),o&&i.jsx(S.Suspense,{fallback:i.jsxs("div",{className:"loading-thread",children:[i.jsx("i",{}),"Loading…"]}),children:i.jsx(o,{initial:e.arg,go:t,onChanged:l,stats:n})}),!o&&e.tab!=="check"&&i.jsx("div",{className:"panel",children:i.jsxs("p",{children:["Unknown page. ",i.jsx("a",{href:"#/check",children:"Go to the workspace →"})]})}),i.jsx("footer",{className:"ws-foot",children:"Public FDA data: openFDA 510(k), recall and enforcement records; 510(k) summary PDFs. Forebear reports documented lineage and recall history; it does not judge device safety. Not regulatory advice."})]})]})}function Nh({go:e}){const[t,n]=S.useState(""),[r,l]=S.useState([]),[s,a]=S.useState(!1),[o,u]=S.useState(0),c=S.useRef(null),p=S.useRef(null);S.useEffect(()=>{if(clearTimeout(p.current),t.trim().length<2){l([]);return}let v=!0;return p.current=setTimeout(()=>Se.search(t).then(y=>{v&&(l(y),u(0))}).catch(()=>v&&l([])),160),()=>{v=!1}},[t]),S.useEffect(()=>{const v=y=>{var x,C;y.key==="/"&&!/INPUT|TEXTAREA|SELECT/.test((x=document.activeElement)==null?void 0:x.tagName)&&(y.preventDefault(),(C=c.current)==null||C.focus())};return addEventListener("keydown",v),()=>removeEventListener("keydown",v)},[]);const h=v=>{var y;a(!1),n(""),(y=c.current)==null||y.blur(),e("check",v)},f=s&&r.length>0;return i.jsxs("div",{className:"search",role:"search",children:[i.jsx("svg",{className:"icon",width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6","aria-hidden":"true",children:i.jsx("path",{d:"M11 11l4 4M7 12.5A5.5 5.5 0 107 1.5a5.5 5.5 0 000 11z"})}),i.jsx("input",{ref:c,className:"field",value:t,placeholder:"Search a device or K-number","aria-label":"Search devices by name or K-number",role:"combobox","aria-expanded":f,"aria-controls":"search-results","aria-activedescendant":f?`sr-${o}`:void 0,"aria-autocomplete":"list",onChange:v=>{n(v.target.value),a(!0)},onFocus:()=>a(!0),onBlur:()=>setTimeout(()=>a(!1),150),onKeyDown:v=>{if(v.key==="ArrowDown")v.preventDefault(),u(y=>Math.min(y+1,r.length-1));else if(v.key==="ArrowUp")v.preventDefault(),u(y=>Math.max(y-1,0));else if(v.key==="Escape")a(!1),v.currentTarget.blur();else if(v.key==="Enter"){const y=t.trim().toUpperCase();/^K\d{6}$/.test(y)?h(y):r[o]&&h(r[o].k)}}}),!t&&i.jsx("kbd",{"aria-hidden":"true",children:"/"}),f&&i.jsx("ul",{className:"search-results",id:"search-results",role:"listbox",children:r.map((v,y)=>i.jsxs("li",{id:`sr-${y}`,role:"option","aria-selected":y===o,onMouseDown:()=>h(v.k),onMouseEnter:()=>u(y),children:[i.jsxs("span",{children:[i.jsx("span",{className:"k",children:v.k})," ",v.name]}),i.jsxs("small",{children:[v.applicant," · ",v.decision_date," · ",v.product_code]})]},v.k))})]})}const Sh=S.lazy(()=>Ft(()=>import("./Landing-0CfXrj7l.js"),[])),_h={about:"method"};function Or(e=window.location.hash){if(!e.startsWith("#/"))return{tab:"film",arg:""};const t=e.replace(/^#\/?/,"");if(!t)return{tab:"film",arg:""};const[n,...r]=t.split("/");return{tab:_h[n]||n||"film",arg:decodeURIComponent(r.join("/")||"")}}const Eh=(e,t)=>e==="film"?"#/":`#/${e}${t?"/"+t:""}`;function Ch(){const[e,t]=S.useState(Or),[n,r]=S.useState(null),[l,s]=S.useState(null),a=Ip("(prefers-reduced-motion: reduce)"),[o,u]=S.useState(()=>e.tab==="film"&&!$p()&&!matchMedia("(prefers-reduced-motion: reduce)").matches),[c,p]=S.useState(o?"pending":"none");S.useEffect(()=>{document.documentElement.dataset.motion=a?"reduced":"full"},[a]),S.useEffect(()=>{const y=()=>t(Or());return addEventListener("hashchange",y),()=>removeEventListener("hashchange",y)},[]);const h=S.useCallback((y=0)=>Se.stats().then(x=>{r(x),s(null)}).catch(x=>{y<5?setTimeout(()=>h(y+1),800*(y+1)):s(x.message)}),[]);S.useEffect(()=>{h()},[h]),S.useEffect(()=>{const y={film:"Forebear · Every clearance has a past",check:e.arg?`${e.arg} · Forebear`:"Investigate · Forebear",compare:"Compare predicates · Forebear",reach:"Recall reach · Forebear",watch:"Watchlist · Forebear",ingest:"Add a clearance · Forebear",history:"History · Forebear",method:"Method · Forebear"};document.title=y[e.tab]||"Forebear"},[e]);const f=S.useCallback((y,x="",C={})=>{const g=Eh(y,x),d=()=>{history.pushState(null,"",g),t(Or(g)),window.scrollTo(0,0)};C.transition&&!a&&document.startViewTransition?document.startViewTransition(()=>Wc.flushSync(d)):d()},[a]);S.useEffect(()=>{const y=()=>t(Or());return addEventListener("popstate",y),()=>removeEventListener("popstate",y)},[]);const v=()=>{Fp(),e.tab!=="film"&&f("film"),window.scrollTo(0,0),a||(p("pending"),u(!0))};return i.jsxs(i.Fragment,{children:[i.jsx("a",{className:"skip-link",href:"#main",onClick:y=>{var x;y.preventDefault(),(x=document.getElementById("main"))==null||x.focus()},children:"Skip to content"}),o&&i.jsx(Mp,{onDone:()=>{p("bloom"),setTimeout(()=>u(!1),700),requestAnimationFrame(()=>{var y;return(y=document.getElementById("hero-title"))==null?void 0:y.focus({preventScroll:!0})})}}),i.jsx("div",{inert:o&&c==="pending"?"":void 0,style:{display:"contents"},children:e.tab==="film"?i.jsx(S.Suspense,{fallback:i.jsx("div",{style:{minHeight:"100vh"}}),children:i.jsx(Sh,{go:f,stats:n,introDone:c,reduced:a})}):i.jsx(jh,{route:e,go:f,stats:n,statsErr:l,refreshStats:h,onReplay:v})})]})}Bc(document.getElementById("root")).render(i.jsx(Ch,{}));export{Zc as A,Th as E,Qc as M,hs as P,_l as R,Ph as T,Kn as V,Rp as W,Ft as _,Qp as a,So as b,Se as c,Lp as d,we as f,i as j,No as m,ci as p,S as r,Ip as u,qc as v}; diff --git a/web/dist/assets/index-DD2rN9W6.js b/web/dist/assets/index-DD2rN9W6.js deleted file mode 100644 index eccb401..0000000 --- a/web/dist/assets/index-DD2rN9W6.js +++ /dev/null @@ -1,44 +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"]'))r(l);new MutationObserver(l=>{for(const i of l)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(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 r(l){if(l.ep)return;l.ep=!0;const i=n(l);fetch(l.href,i)}})();function Xc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Sa={exports:{}},jl={},_a={exports:{}},z={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var dr=Symbol.for("react.element"),Zc=Symbol.for("react.portal"),Jc=Symbol.for("react.fragment"),qc=Symbol.for("react.strict_mode"),bc=Symbol.for("react.profiler"),ed=Symbol.for("react.provider"),td=Symbol.for("react.context"),nd=Symbol.for("react.forward_ref"),rd=Symbol.for("react.suspense"),ld=Symbol.for("react.memo"),id=Symbol.for("react.lazy"),ao=Symbol.iterator;function sd(e){return e===null||typeof e!="object"?null:(e=ao&&e[ao]||e["@@iterator"],typeof e=="function"?e:null)}var Ea={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ca=Object.assign,Ta={};function jn(e,t,n){this.props=e,this.context=t,this.refs=Ta,this.updater=n||Ea}jn.prototype.isReactComponent={};jn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};jn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Pa(){}Pa.prototype=jn.prototype;function cs(e,t,n){this.props=e,this.context=t,this.refs=Ta,this.updater=n||Ea}var ds=cs.prototype=new Pa;ds.constructor=cs;Ca(ds,jn.prototype);ds.isPureReactComponent=!0;var uo=Array.isArray,La=Object.prototype.hasOwnProperty,fs={current:null},Ra={key:!0,ref:!0,__self:!0,__source:!0};function Da(e,t,n){var r,l={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)La.call(t,r)&&!Ra.hasOwnProperty(r)&&(l[r]=t[r]);var a=arguments.length-2;if(a===1)l.children=n;else if(1>>1,ee=C[X];if(0>>1;Xl(Ol,$))Rtl(gr,Ol)?(C[X]=gr,C[Rt]=$,X=Rt):(C[X]=Ol,C[Lt]=$,X=Lt);else if(Rtl(gr,$))C[X]=gr,C[Rt]=$,X=Rt;else break e}}return D}function l(C,D){var $=C.sortIndex-D.sortIndex;return $!==0?$:C.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var u=[],d=[],f=1,p=null,h=3,g=!1,y=!1,k=!1,L=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(C){for(var D=n(d);D!==null;){if(D.callback===null)r(d);else if(D.startTime<=C)r(d),D.sortIndex=D.expirationTime,t(u,D);else break;D=n(d)}}function w(C){if(k=!1,m(C),!y)if(n(u)!==null)y=!0,Ze(S);else{var D=n(d);D!==null&&M(w,D.startTime-C)}}function S(C,D){y=!1,k&&(k=!1,v(x),x=-1),g=!0;var $=h;try{for(m(D),p=n(u);p!==null&&(!(p.expirationTime>D)||C&&!I());){var X=p.callback;if(typeof X=="function"){p.callback=null,h=p.priorityLevel;var ee=X(p.expirationTime<=D);D=e.unstable_now(),typeof ee=="function"?p.callback=ee:p===n(u)&&r(u),m(D)}else r(u);p=n(u)}if(p!==null)var vr=!0;else{var Lt=n(d);Lt!==null&&M(w,Lt.startTime-D),vr=!1}return vr}finally{p=null,h=$,g=!1}}var E=!1,j=null,x=-1,R=5,T=-1;function I(){return!(e.unstable_now()-TC||125X?(C.sortIndex=$,t(d,C),n(u)===null&&C===n(d)&&(k?(v(x),x=-1):k=!0,M(w,$-X))):(C.sortIndex=ee,t(u,C),y||g||(y=!0,Ze(S))),C},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(C){var D=h;return function(){var $=h;h=D;try{return C.apply(this,arguments)}finally{h=$}}}})(Ia);Fa.exports=Ia;var gd=Fa.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var yd=_,Se=gd;function N(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),mi=Object.prototype.hasOwnProperty,xd=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,fo={},po={};function wd(e){return mi.call(po,e)?!0:mi.call(fo,e)?!1:xd.test(e)?po[e]=!0:(fo[e]=!0,!1)}function kd(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function jd(e,t,n,r){if(t===null||typeof t>"u"||kd(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function he(e,t,n,r,l,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var ie={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ie[e]=new he(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ie[t]=new he(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ie[e]=new he(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ie[e]=new he(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ie[e]=new he(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ie[e]=new he(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ie[e]=new he(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ie[e]=new he(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ie[e]=new he(e,5,!1,e.toLowerCase(),null,!1,!1)});var hs=/[\-:]([a-z])/g;function ms(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(hs,ms);ie[t]=new he(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(hs,ms);ie[t]=new he(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(hs,ms);ie[t]=new he(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ie[e]=new he(e,1,!1,e.toLowerCase(),null,!1,!1)});ie.xlinkHref=new he("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ie[e]=new he(e,1,!1,e.toLowerCase(),null,!0,!0)});function vs(e,t,n,r){var l=ie.hasOwnProperty(t)?ie[t]:null;(l!==null?l.type!==0:r||!(2a||l[s]!==i[a]){var u=` -`+l[s].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=s&&0<=a);break}}}finally{Wl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?$n(e):""}function Nd(e){switch(e.tag){case 5:return $n(e.type);case 16:return $n("Lazy");case 13:return $n("Suspense");case 19:return $n("SuspenseList");case 0:case 2:case 15:return e=Bl(e.type,!1),e;case 11:return e=Bl(e.type.render,!1),e;case 1:return e=Bl(e.type,!0),e;default:return""}}function xi(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Zt:return"Fragment";case Xt:return"Portal";case vi:return"Profiler";case gs:return"StrictMode";case gi:return"Suspense";case yi:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ua:return(e.displayName||"Context")+".Consumer";case Oa:return(e._context.displayName||"Context")+".Provider";case ys:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case xs:return t=e.displayName||null,t!==null?t:xi(e.type)||"Memo";case ct:t=e._payload,e=e._init;try{return xi(e(t))}catch{}}return null}function Sd(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return xi(t);case 8:return t===gs?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function St(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Wa(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function _d(e){var t=Wa(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function wr(e){e._valueTracker||(e._valueTracker=_d(e))}function Ba(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Wa(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function qr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function wi(e,t){var n=t.checked;return Q({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function mo(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=St(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Ha(e,t){t=t.checked,t!=null&&vs(e,"checked",t,!1)}function ki(e,t){Ha(e,t);var n=St(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ji(e,t.type,n):t.hasOwnProperty("defaultValue")&&ji(e,t.type,St(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function vo(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function ji(e,t,n){(t!=="number"||qr(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var zn=Array.isArray;function an(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=kr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Yn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var In={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ed=["Webkit","ms","Moz","O"];Object.keys(In).forEach(function(e){Ed.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),In[t]=In[e]})});function Ya(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||In.hasOwnProperty(e)&&In[e]?(""+t).trim():t+"px"}function Xa(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=Ya(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Cd=Q({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function _i(e,t){if(t){if(Cd[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(N(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(N(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(N(61))}if(t.style!=null&&typeof t.style!="object")throw Error(N(62))}}function Ei(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ci=null;function ws(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ti=null,un=null,cn=null;function xo(e){if(e=hr(e)){if(typeof Ti!="function")throw Error(N(280));var t=e.stateNode;t&&(t=Tl(t),Ti(e.stateNode,e.type,t))}}function Za(e){un?cn?cn.push(e):cn=[e]:un=e}function Ja(){if(un){var e=un,t=cn;if(cn=un=null,xo(e),t)for(e=0;e>>=0,e===0?32:31-(Ad(e)/Od|0)|0}var jr=64,Nr=4194304;function Mn(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function nl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~l;a!==0?r=Mn(a):(i&=s,i!==0&&(r=Mn(i)))}else s=n&~l,s!==0?r=Mn(s):i!==0&&(r=Mn(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,i=t&-t,l>=i||l===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function fr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ue(t),e[t]=n}function Bd(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=On),To=" ",Po=!1;function gu(e,t){switch(e){case"keyup":return yf.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function yu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Jt=!1;function wf(e,t){switch(e){case"compositionend":return yu(t);case"keypress":return t.which!==32?null:(Po=!0,To);case"textInput":return e=t.data,e===To&&Po?null:e;default:return null}}function kf(e,t){if(Jt)return e==="compositionend"||!Ts&&gu(e,t)?(e=mu(),Br=_s=ht=null,Jt=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=$o(n)}}function ju(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ju(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Nu(){for(var e=window,t=qr();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=qr(e.document)}return t}function Ps(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Lf(e){var t=Nu(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ju(n.ownerDocument.documentElement,n)){if(r!==null&&Ps(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,i=Math.min(r.start,l);r=r.end===void 0?i:Math.min(r.end,l),!e.extend&&i>r&&(l=r,r=i,i=l),l=zo(n,i);var s=zo(n,r);l&&s&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,qt=null,zi=null,Vn=null,Mi=!1;function Mo(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Mi||qt==null||qt!==qr(r)||(r=qt,"selectionStart"in r&&Ps(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Vn&&er(Vn,r)||(Vn=r,r=il(zi,"onSelect"),0tn||(e.current=Vi[tn],Vi[tn]=null,tn--)}function O(e,t){tn++,Vi[tn]=e.current,e.current=t}var _t={},ce=Tt(_t),ye=Tt(!1),Vt=_t;function mn(e,t){var n=e.type.contextTypes;if(!n)return _t;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},i;for(i in n)l[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function xe(e){return e=e.childContextTypes,e!=null}function ol(){V(ye),V(ce)}function Wo(e,t,n){if(ce.current!==_t)throw Error(N(168));O(ce,t),O(ye,n)}function Du(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(N(108,Sd(e)||"Unknown",l));return Q({},n,r)}function al(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||_t,Vt=ce.current,O(ce,e),O(ye,ye.current),!0}function Bo(e,t,n){var r=e.stateNode;if(!r)throw Error(N(169));n?(e=Du(e,t,Vt),r.__reactInternalMemoizedMergedChildContext=e,V(ye),V(ce),O(ce,e)):V(ye),O(ye,n)}var qe=null,Pl=!1,ri=!1;function $u(e){qe===null?qe=[e]:qe.push(e)}function Wf(e){Pl=!0,$u(e)}function Pt(){if(!ri&&qe!==null){ri=!0;var e=0,t=A;try{var n=qe;for(A=1;e>=s,l-=s,be=1<<32-Ue(t)+l|n<x?(R=j,j=null):R=j.sibling;var T=h(v,j,m[x],w);if(T===null){j===null&&(j=R);break}e&&j&&T.alternate===null&&t(v,j),c=i(T,c,x),E===null?S=T:E.sibling=T,E=T,j=R}if(x===m.length)return n(v,j),W&&$t(v,x),S;if(j===null){for(;xx?(R=j,j=null):R=j.sibling;var I=h(v,j,T.value,w);if(I===null){j===null&&(j=R);break}e&&j&&I.alternate===null&&t(v,j),c=i(I,c,x),E===null?S=I:E.sibling=I,E=I,j=R}if(T.done)return n(v,j),W&&$t(v,x),S;if(j===null){for(;!T.done;x++,T=m.next())T=p(v,T.value,w),T!==null&&(c=i(T,c,x),E===null?S=T:E.sibling=T,E=T);return W&&$t(v,x),S}for(j=r(v,j);!T.done;x++,T=m.next())T=g(j,v,x,T.value,w),T!==null&&(e&&T.alternate!==null&&j.delete(T.key===null?x:T.key),c=i(T,c,x),E===null?S=T:E.sibling=T,E=T);return e&&j.forEach(function(K){return t(v,K)}),W&&$t(v,x),S}function L(v,c,m,w){if(typeof m=="object"&&m!==null&&m.type===Zt&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case xr:e:{for(var S=m.key,E=c;E!==null;){if(E.key===S){if(S=m.type,S===Zt){if(E.tag===7){n(v,E.sibling),c=l(E,m.props.children),c.return=v,v=c;break e}}else if(E.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===ct&&Ko(S)===E.type){n(v,E.sibling),c=l(E,m.props),c.ref=Ln(v,E,m),c.return=v,v=c;break e}n(v,E);break}else t(v,E);E=E.sibling}m.type===Zt?(c=Ut(m.props.children,v.mode,w,m.key),c.return=v,v=c):(w=Jr(m.type,m.key,m.props,null,v.mode,w),w.ref=Ln(v,c,m),w.return=v,v=w)}return s(v);case Xt:e:{for(E=m.key;c!==null;){if(c.key===E)if(c.tag===4&&c.stateNode.containerInfo===m.containerInfo&&c.stateNode.implementation===m.implementation){n(v,c.sibling),c=l(c,m.children||[]),c.return=v,v=c;break e}else{n(v,c);break}else t(v,c);c=c.sibling}c=di(m,v.mode,w),c.return=v,v=c}return s(v);case ct:return E=m._init,L(v,c,E(m._payload),w)}if(zn(m))return y(v,c,m,w);if(_n(m))return k(v,c,m,w);Lr(v,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,c!==null&&c.tag===6?(n(v,c.sibling),c=l(c,m),c.return=v,v=c):(n(v,c),c=ci(m,v.mode,w),c.return=v,v=c),s(v)):n(v,c)}return L}var gn=Iu(!0),Au=Iu(!1),dl=Tt(null),fl=null,ln=null,$s=null;function zs(){$s=ln=fl=null}function Ms(e){var t=dl.current;V(dl),e._currentValue=t}function Hi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function fn(e,t){fl=e,$s=ln=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ge=!0),e.firstContext=null)}function $e(e){var t=e._currentValue;if($s!==e)if(e={context:e,memoizedValue:t,next:null},ln===null){if(fl===null)throw Error(N(308));ln=e,fl.dependencies={lanes:0,firstContext:e}}else ln=ln.next=e;return t}var It=null;function Fs(e){It===null?It=[e]:It.push(e)}function Ou(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,Fs(t)):(n.next=l.next,l.next=n),t.interleaved=n,lt(e,r)}function lt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var dt=!1;function Is(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Uu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function tt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function wt(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,F&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,lt(e,n)}return l=r.interleaved,l===null?(t.next=t,Fs(r)):(t.next=l.next,l.next=t),r.interleaved=t,lt(e,n)}function Qr(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,js(e,n)}}function Go(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?l=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?l=i=t:i=i.next=t}else l=i=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function pl(e,t,n,r){var l=e.updateQueue;dt=!1;var i=l.firstBaseUpdate,s=l.lastBaseUpdate,a=l.shared.pending;if(a!==null){l.shared.pending=null;var u=a,d=u.next;u.next=null,s===null?i=d:s.next=d,s=u;var f=e.alternate;f!==null&&(f=f.updateQueue,a=f.lastBaseUpdate,a!==s&&(a===null?f.firstBaseUpdate=d:a.next=d,f.lastBaseUpdate=u))}if(i!==null){var p=l.baseState;s=0,f=d=u=null,a=i;do{var h=a.lane,g=a.eventTime;if((r&h)===h){f!==null&&(f=f.next={eventTime:g,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=e,k=a;switch(h=t,g=n,k.tag){case 1:if(y=k.payload,typeof y=="function"){p=y.call(g,p,h);break e}p=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=k.payload,h=typeof y=="function"?y.call(g,p,h):y,h==null)break e;p=Q({},p,h);break e;case 2:dt=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=l.effects,h===null?l.effects=[a]:h.push(a))}else g={eventTime:g,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},f===null?(d=f=g,u=p):f=f.next=g,s|=h;if(a=a.next,a===null){if(a=l.shared.pending,a===null)break;h=a,a=h.next,h.next=null,l.lastBaseUpdate=h,l.shared.pending=null}}while(!0);if(f===null&&(u=p),l.baseState=u,l.firstBaseUpdate=d,l.lastBaseUpdate=f,t=l.shared.interleaved,t!==null){l=t;do s|=l.lane,l=l.next;while(l!==t)}else i===null&&(l.shared.lanes=0);Ht|=s,e.lanes=s,e.memoizedState=p}}function Yo(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=ii.transition;ii.transition={};try{e(!1),t()}finally{A=n,ii.transition=r}}function rc(){return ze().memoizedState}function Kf(e,t,n){var r=jt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},lc(e))ic(t,n);else if(n=Ou(e,t,n,r),n!==null){var l=fe();Ve(n,e,r,l),sc(n,t,r)}}function Gf(e,t,n){var r=jt(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(lc(e))ic(t,l);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,n);if(l.hasEagerState=!0,l.eagerState=a,We(a,s)){var u=t.interleaved;u===null?(l.next=l,Fs(t)):(l.next=u.next,u.next=l),t.interleaved=l;return}}catch{}finally{}n=Ou(e,t,l,r),n!==null&&(l=fe(),Ve(n,e,r,l),sc(n,t,r))}}function lc(e){var t=e.alternate;return e===H||t!==null&&t===H}function ic(e,t){Wn=ml=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function sc(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,js(e,n)}}var vl={readContext:$e,useCallback:se,useContext:se,useEffect:se,useImperativeHandle:se,useInsertionEffect:se,useLayoutEffect:se,useMemo:se,useReducer:se,useRef:se,useState:se,useDebugValue:se,useDeferredValue:se,useTransition:se,useMutableSource:se,useSyncExternalStore:se,useId:se,unstable_isNewReconciler:!1},Yf={readContext:$e,useCallback:function(e,t){return Qe().memoizedState=[e,t===void 0?null:t],e},useContext:$e,useEffect:Zo,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Gr(4194308,4,qu.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Gr(4194308,4,e,t)},useInsertionEffect:function(e,t){return Gr(4,2,e,t)},useMemo:function(e,t){var n=Qe();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Qe();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Kf.bind(null,H,e),[r.memoizedState,e]},useRef:function(e){var t=Qe();return e={current:e},t.memoizedState=e},useState:Xo,useDebugValue:Qs,useDeferredValue:function(e){return Qe().memoizedState=e},useTransition:function(){var e=Xo(!1),t=e[0];return e=Qf.bind(null,e[1]),Qe().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=H,l=Qe();if(W){if(n===void 0)throw Error(N(407));n=n()}else{if(n=t(),ne===null)throw Error(N(349));Bt&30||Hu(r,t,n)}l.memoizedState=n;var i={value:n,getSnapshot:t};return l.queue=i,Zo(Ku.bind(null,r,i,e),[e]),r.flags|=2048,ar(9,Qu.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Qe(),t=ne.identifierPrefix;if(W){var n=et,r=be;n=(r&~(1<<32-Ue(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=sr++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Ke]=t,e[rr]=r,vc(e,t,!1,!1),t.stateNode=e;e:{switch(s=Ei(n,r),n){case"dialog":U("cancel",e),U("close",e),l=r;break;case"iframe":case"object":case"embed":U("load",e),l=r;break;case"video":case"audio":for(l=0;lwn&&(t.flags|=128,r=!0,Rn(i,!1),t.lanes=4194304)}else{if(!r)if(e=hl(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Rn(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!W)return oe(t),null}else 2*Z()-i.renderingStartTime>wn&&n!==1073741824&&(t.flags|=128,r=!0,Rn(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Z(),t.sibling=null,n=B.current,O(B,r?n&1|2:n&1),t):(oe(t),null);case 22:case 23:return Js(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ke&1073741824&&(oe(t),t.subtreeFlags&6&&(t.flags|=8192)):oe(t),null;case 24:return null;case 25:return null}throw Error(N(156,t.tag))}function np(e,t){switch(Rs(t),t.tag){case 1:return xe(t.type)&&ol(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return yn(),V(ye),V(ce),Us(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Os(t),null;case 13:if(V(B),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(N(340));vn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return V(B),null;case 4:return yn(),null;case 10:return Ms(t.type._context),null;case 22:case 23:return Js(),null;case 24:return null;default:return null}}var Dr=!1,ue=!1,rp=typeof WeakSet=="function"?WeakSet:Set,P=null;function sn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){G(e,t,r)}else n.current=null}function bi(e,t,n){try{n()}catch(r){G(e,t,r)}}var oa=!1;function lp(e,t){if(Fi=rl,e=Nu(),Ps(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,a=-1,u=-1,d=0,f=0,p=e,h=null;t:for(;;){for(var g;p!==n||l!==0&&p.nodeType!==3||(a=s+l),p!==i||r!==0&&p.nodeType!==3||(u=s+r),p.nodeType===3&&(s+=p.nodeValue.length),(g=p.firstChild)!==null;)h=p,p=g;for(;;){if(p===e)break t;if(h===n&&++d===l&&(a=s),h===i&&++f===r&&(u=s),(g=p.nextSibling)!==null)break;p=h,h=p.parentNode}p=g}n=a===-1||u===-1?null:{start:a,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ii={focusedElem:e,selectionRange:n},rl=!1,P=t;P!==null;)if(t=P,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,P=e;else for(;P!==null;){t=P;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var k=y.memoizedProps,L=y.memoizedState,v=t.stateNode,c=v.getSnapshotBeforeUpdate(t.elementType===t.type?k:Fe(t.type,k),L);v.__reactInternalSnapshotBeforeUpdate=c}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(N(163))}}catch(w){G(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,P=e;break}P=t.return}return y=oa,oa=!1,y}function Bn(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var i=l.destroy;l.destroy=void 0,i!==void 0&&bi(t,n,i)}l=l.next}while(l!==r)}}function Dl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function es(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function xc(e){var t=e.alternate;t!==null&&(e.alternate=null,xc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ke],delete t[rr],delete t[Ui],delete t[Uf],delete t[Vf])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function wc(e){return e.tag===5||e.tag===3||e.tag===4}function aa(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||wc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ts(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=sl));else if(r!==4&&(e=e.child,e!==null))for(ts(e,t,n),e=e.sibling;e!==null;)ts(e,t,n),e=e.sibling}function ns(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(ns(e,t,n),e=e.sibling;e!==null;)ns(e,t,n),e=e.sibling}var re=null,Ie=!1;function at(e,t,n){for(n=n.child;n!==null;)kc(e,t,n),n=n.sibling}function kc(e,t,n){if(Ye&&typeof Ye.onCommitFiberUnmount=="function")try{Ye.onCommitFiberUnmount(Sl,n)}catch{}switch(n.tag){case 5:ue||sn(n,t);case 6:var r=re,l=Ie;re=null,at(e,t,n),re=r,Ie=l,re!==null&&(Ie?(e=re,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):re.removeChild(n.stateNode));break;case 18:re!==null&&(Ie?(e=re,n=n.stateNode,e.nodeType===8?ni(e.parentNode,n):e.nodeType===1&&ni(e,n),qn(e)):ni(re,n.stateNode));break;case 4:r=re,l=Ie,re=n.stateNode.containerInfo,Ie=!0,at(e,t,n),re=r,Ie=l;break;case 0:case 11:case 14:case 15:if(!ue&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var i=l,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&bi(n,t,s),l=l.next}while(l!==r)}at(e,t,n);break;case 1:if(!ue&&(sn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){G(n,t,a)}at(e,t,n);break;case 21:at(e,t,n);break;case 22:n.mode&1?(ue=(r=ue)||n.memoizedState!==null,at(e,t,n),ue=r):at(e,t,n);break;default:at(e,t,n)}}function ua(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new rp),t.forEach(function(r){var l=pp.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function Me(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=s),r&=~i}if(r=l,r=Z()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*sp(r/1960))-r,10e?16:e,mt===null)var r=!1;else{if(e=mt,mt=null,xl=0,F&6)throw Error(N(331));var l=F;for(F|=4,P=e.current;P!==null;){var i=P,s=i.child;if(P.flags&16){var a=i.deletions;if(a!==null){for(var u=0;uZ()-Xs?Ot(e,0):Ys|=n),we(e,t)}function Pc(e,t){t===0&&(e.mode&1?(t=Nr,Nr<<=1,!(Nr&130023424)&&(Nr=4194304)):t=1);var n=fe();e=lt(e,t),e!==null&&(fr(e,t,n),we(e,n))}function fp(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Pc(e,n)}function pp(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(N(314))}r!==null&&r.delete(t),Pc(e,n)}var Lc;Lc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ye.current)ge=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ge=!1,ep(e,t,n);ge=!!(e.flags&131072)}else ge=!1,W&&t.flags&1048576&&zu(t,cl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Yr(e,t),e=t.pendingProps;var l=mn(t,ce.current);fn(t,n),l=Ws(null,t,r,e,l,n);var i=Bs();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,xe(r)?(i=!0,al(t)):i=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Is(t),l.updater=Rl,t.stateNode=l,l._reactInternals=t,Ki(t,r,e,n),t=Xi(null,t,r,!0,i,n)):(t.tag=0,W&&i&&Ls(t),de(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Yr(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=mp(r),e=Fe(r,e),l){case 0:t=Yi(null,t,r,e,n);break e;case 1:t=la(null,t,r,e,n);break e;case 11:t=na(null,t,r,e,n);break e;case 14:t=ra(null,t,r,Fe(r.type,e),n);break e}throw Error(N(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Fe(r,l),Yi(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Fe(r,l),la(e,t,r,l,n);case 3:e:{if(pc(t),e===null)throw Error(N(387));r=t.pendingProps,i=t.memoizedState,l=i.element,Uu(e,t),pl(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){l=xn(Error(N(423)),t),t=ia(e,t,r,n,l);break e}else if(r!==l){l=xn(Error(N(424)),t),t=ia(e,t,r,n,l);break e}else for(je=xt(t.stateNode.containerInfo.firstChild),Ne=t,W=!0,Ae=null,n=Au(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(vn(),r===l){t=it(e,t,n);break e}de(e,t,r,n)}t=t.child}return t;case 5:return Vu(t),e===null&&Bi(t),r=t.type,l=t.pendingProps,i=e!==null?e.memoizedProps:null,s=l.children,Ai(r,l)?s=null:i!==null&&Ai(r,i)&&(t.flags|=32),fc(e,t),de(e,t,s,n),t.child;case 6:return e===null&&Bi(t),null;case 13:return hc(e,t,n);case 4:return As(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=gn(t,null,r,n):de(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Fe(r,l),na(e,t,r,l,n);case 7:return de(e,t,t.pendingProps,n),t.child;case 8:return de(e,t,t.pendingProps.children,n),t.child;case 12:return de(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,i=t.memoizedProps,s=l.value,O(dl,r._currentValue),r._currentValue=s,i!==null)if(We(i.value,s)){if(i.children===l.children&&!ye.current){t=it(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var u=a.firstContext;u!==null;){if(u.context===r){if(i.tag===1){u=tt(-1,n&-n),u.tag=2;var d=i.updateQueue;if(d!==null){d=d.shared;var f=d.pending;f===null?u.next=u:(u.next=f.next,f.next=u),d.pending=u}}i.lanes|=n,u=i.alternate,u!==null&&(u.lanes|=n),Hi(i.return,n,t),a.lanes|=n;break}u=u.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(N(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Hi(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}de(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,fn(t,n),l=$e(l),r=r(l),t.flags|=1,de(e,t,r,n),t.child;case 14:return r=t.type,l=Fe(r,t.pendingProps),l=Fe(r.type,l),ra(e,t,r,l,n);case 15:return cc(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Fe(r,l),Yr(e,t),t.tag=1,xe(r)?(e=!0,al(t)):e=!1,fn(t,n),oc(t,r,l),Ki(t,r,l,n),Xi(null,t,r,!0,e,n);case 19:return mc(e,t,n);case 22:return dc(e,t,n)}throw Error(N(156,t.tag))};function Rc(e,t){return lu(e,t)}function hp(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Pe(e,t,n,r){return new hp(e,t,n,r)}function bs(e){return e=e.prototype,!(!e||!e.isReactComponent)}function mp(e){if(typeof e=="function")return bs(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ys)return 11;if(e===xs)return 14}return 2}function Nt(e,t){var n=e.alternate;return n===null?(n=Pe(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Jr(e,t,n,r,l,i){var s=2;if(r=e,typeof e=="function")bs(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Zt:return Ut(n.children,l,i,t);case gs:s=8,l|=8;break;case vi:return e=Pe(12,n,t,l|2),e.elementType=vi,e.lanes=i,e;case gi:return e=Pe(13,n,t,l),e.elementType=gi,e.lanes=i,e;case yi:return e=Pe(19,n,t,l),e.elementType=yi,e.lanes=i,e;case Va:return zl(n,l,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Oa:s=10;break e;case Ua:s=9;break e;case ys:s=11;break e;case xs:s=14;break e;case ct:s=16,r=null;break e}throw Error(N(130,e==null?e:typeof e,""))}return t=Pe(s,n,t,l),t.elementType=e,t.type=r,t.lanes=i,t}function Ut(e,t,n,r){return e=Pe(7,e,r,t),e.lanes=n,e}function zl(e,t,n,r){return e=Pe(22,e,r,t),e.elementType=Va,e.lanes=n,e.stateNode={isHidden:!1},e}function ci(e,t,n){return e=Pe(6,e,null,t),e.lanes=n,e}function di(e,t,n){return t=Pe(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function vp(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ql(0),this.expirationTimes=Ql(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ql(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function eo(e,t,n,r,l,i,s,a,u){return e=new vp(e,t,n,a,u),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Pe(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Is(i),e}function gp(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Mc)}catch(e){console.error(e)}}Mc(),Ma.exports=_e;var Fc=Ma.exports,Ic,ga=Fc;Ic=ga.createRoot,ga.hydrateRoot;const jp="modulepreload",Np=function(e){return"/"+e},ya={},Mt=function(t,n,r){let l=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),a=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));l=Promise.allSettled(n.map(u=>{if(u=Np(u),u in ya)return;ya[u]=!0;const d=u.endsWith(".css"),f=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${f}`))return;const p=document.createElement("link");if(p.rel=d?"stylesheet":jp,d||(p.as="script"),p.crossOrigin="",p.href=u,a&&p.setAttribute("nonce",a),document.head.appendChild(p),d)return new Promise((h,g)=>{p.addEventListener("load",h),p.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${u}`)))})}))}function i(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return l.then(s=>{for(const a of s||[])a.status==="rejected"&&i(a.reason);return t().catch(i)})};async function ae(e,t={}){const n=await fetch(e,{headers:{"content-type":"application/json"},...t,body:t.body?JSON.stringify(t.body):void 0});let r=null;try{r=await n.json()}catch{}if(!n.ok){const l=r!=null&&r.detail?typeof r.detail=="string"?r.detail:JSON.stringify(r.detail):`HTTP ${n.status}`;throw new Error(l)}return r}const Oe={stats:()=>ae("/api/stats"),search:e=>ae(`/api/search?q=${encodeURIComponent(e)}`),assess:(e,t=4)=>ae(`/api/assess/${e}?depth=${t}`),compare:e=>ae("/api/compare",{method:"POST",body:{ks:e}}),recallEvent:e=>ae(`/api/recall-event/${e}`),watchlist:()=>ae("/api/watchlist"),ingest:(e,t=!1)=>ae("/api/ingest",{method:"POST",body:{k:e,refresh:t}}),review:(e,t,n,r)=>ae("/api/citation/review",{method:"POST",body:{src:e,dst:t,status:n,note:r}}),triage:(e,t)=>ae("/api/citation/triage",{method:"POST",body:{src:e,dst:t}}),save:(e,t)=>ae("/api/assessments",{method:"POST",body:{k:e,note:t}}),assessments:e=>ae(`/api/assessments${e?`?k=${e}`:""}`),investigations:(e,t=30)=>ae(`/api/investigations?limit=${t}${e?`&k=${e}`:""}`),investigation:e=>ae(`/api/investigations/${e}`),startInvestigation:(e,t,n="auto")=>ae("/api/investigations",{method:"POST",body:{k:e,request:t,mode:n}}),proposals:e=>ae(`/api/proposals${e?`?status=${e}`:""}`),decide:(e,t,n,r)=>ae(`/api/proposals/${e}/decision`,{method:"POST",body:{decision:t,reviewer:n,human:!0,note:r}})},Ac=e=>`https://www.accessdata.fda.gov/scripts/cdrh/cfdocs/cfpmn/pmn.cfm?ID=${e}`,Sp=(e,t=!0)=>`/api/investigations/${e}/report${t?"?format=markdown":""}`,os={nodes:[{id:"a",x:11,y:7,r:3.6},{id:"b",x:27,y:7,r:2.8},{id:"c",x:11,y:19,r:3},{id:"d",x:23,y:19,r:2.6},{id:"e",x:11,y:31,r:3.4,past:!0}],threads:[["a","b"],["a","c"],["c","d"],["c","e"]]},Mr=Object.fromEntries(os.nodes.map(e=>[e.id,e]));function Oc({size:e=28,className:t="",title:n}){return o.jsxs("svg",{className:"mark "+t,width:e,height:e,viewBox:"0 0 38 38",role:n?"img":void 0,"aria-hidden":n?void 0:!0,"aria-label":n,children:[os.threads.map(([r,l],i)=>o.jsx("line",{className:`mark-thread t${i}`,x1:Mr[r].x,y1:Mr[r].y,x2:Mr[l].x,y2:Mr[l].y,pathLength:"1"},i)),os.nodes.map((r,l)=>o.jsx("circle",{className:`mark-node n${l}${r.past?" past":""}`,cx:r.x,cy:r.y,r:r.r},r.id))]})}function _p({size:e=28,className:t=""}){return o.jsxs("span",{className:"wordmark "+t,children:[o.jsx(Oc,{size:e}),o.jsx("span",{className:"wordmark-name",children:"Forebear"})]})}const lo="forebear:intro",Ep=3e3,xa=2450;function Cp(){try{return!!sessionStorage.getItem(lo)}catch{return!0}}function Tp(){try{sessionStorage.setItem(lo,"seen")}catch{}}function Pp(){try{sessionStorage.removeItem(lo)}catch{}}function Lp({onDone:e}){const[t,n]=_.useState(!1),r=_.useRef(!1),l=_.useRef(null),i=()=>{r.current||(r.current=!0,Tp(),n(!0),e())};_.useEffect(()=>{var p;const d=setTimeout(i,xa),f=h=>{(h.key==="Escape"||h.key==="Enter"||h.key===" ")&&(h.preventDefault(),i())};return addEventListener("keydown",f),(p=l.current)==null||p.focus({preventScroll:!0}),()=>{clearTimeout(d),removeEventListener("keydown",f)}},[]);const[s,a]=_.useState(!1);if(_.useEffect(()=>{if(!t)return;const d=setTimeout(()=>a(!0),Ep-xa+100);return()=>clearTimeout(d)},[t]),s)return null;const u="Forebear".split("");return o.jsxs("div",{className:"intro"+(t?" is-leaving":""),"data-testid":"intro",onClick:i,role:"dialog","aria-modal":"true","aria-label":"Forebear opening",children:[o.jsxs("div",{className:"intro-lockup","aria-hidden":"true",children:[o.jsx(Oc,{className:"intro-mark",size:116}),o.jsx("div",{className:"intro-word",children:u.map((d,f)=>o.jsx("span",{style:{animationDelay:`${.95+f*.045}s`},children:d},f))}),o.jsx("p",{className:"intro-tag",children:o.jsxs("span",{children:["Every clearance has ",o.jsx("em",{children:"a past."})]})})]}),o.jsx("span",{className:"sr-only",role:"status",children:"Forebear. Every clearance has a past."}),o.jsxs("button",{ref:l,className:"btn btn-line btn-sm intro-skip",onClick:d=>{d.stopPropagation(),i()},children:["Skip intro ",o.jsx("span",{"aria-hidden":"true",children:"→"})]})]})}function Rp(e){const[t,n]=_.useState(()=>typeof matchMedia<"u"&&matchMedia(e).matches);return _.useEffect(()=>{const r=matchMedia(e),l=()=>n(r.matches);return l(),r.addEventListener("change",l),()=>r.removeEventListener("change",l)},[e]),t}const cr=["mcp-client"],Kn={DESIGN_RECALL_ON_FILE:{tone:"alert",label:"Design-related recall on file",plain:"The candidate itself has a design-related recall on file."},REVIEW_LINEAGE:{tone:"amber",label:"Review lineage",plain:"A recall in the predicate lineage warrants documented review."},INSUFFICIENT_LINEAGE:{tone:"muted",label:"Lineage not checkable",plain:"The ancestry could not be checked from readable evidence."},NO_DESIGN_RECALL_SIGNAL:{tone:"calm",label:"No design-recall signal",plain:"No design-related recall in the readable verdict window. Not a safety finding."}},Uc={audit_unresolved:"The extraction audit could not resolve whether this is the predicate",audit_correction:"K-number supplied by the audit, not as printed in the PDF",name_mismatch:"The cited device's FDA name does not appear near the citation",different_fda_panel:"Cited device sits in a different FDA review panel",llm_label_only:"A predicate only because an LLM labelled the mention",client_confirmation_only:"Confirmed only through the automated MCP client, not a person",client_rejection_pending:"Rejected through the automated MCP client; kept until a person decides",review_outdated:"A person reviewed an earlier version of the FDA summary; it needs re-review"};function Dp(e){if(!e)return[];if(e.review==="confirmed"&&Ge(e))return[];const t=[];return Vc(e)&&t.push("review_outdated"),e.audit==="unresolved"&&t.push("audit_unresolved"),e.audit==="corrected"&&t.push("audit_correction"),e.name_check==="mismatch"&&!["variant","corrected"].includes(e.audit)&&t.push("name_mismatch"),e.panel_check==="different"&&!["variant","corrected"].includes(e.audit)&&t.push("different_fda_panel"),e.kind!=null&&e.kind!=="predicate"&&e.ai_label==="predicate"&&t.push("llm_label_only"),e.kind!=null&&e.kind!=="predicate"&&e.review==="confirmed"&&cr.includes(e.reviewer)&&t.push("client_confirmation_only"),e.review==="rejected"&&cr.includes(e.reviewer)&&t.push("client_rejection_pending"),t}const Ge=e=>!!(e!=null&&e.review)&&!cr.includes(e.reviewer)&&(e.reviewed_source_sha256||"")===(e.source_sha256||""),Vc=e=>!!(e!=null&&e.review)&&!cr.includes(e.reviewer)&&!Ge(e),Re={confirmed:{label:"Confirmed by a person",short:"Confirmed"},extracted:{label:"Machine-extracted",short:"Extracted"},disputed:{label:"Disputed evidence",short:"Disputed"},conditional:{label:"Conditional route",short:"Conditional"},rejected:{label:"Rejected by a person",short:"Rejected"},advisory:{label:"Advisory: suggested by an LLM or the MCP client, awaiting a person; not a verdict input",short:"Advisory"},retired:{label:"Retired: the refreshed FDA summary no longer cites it; kept for the record",short:"Retired"}};function Et(e){if(e!=null&&e.retired_at||(e==null?void 0:e.trust)==="retired")return{key:"retired",reasons:[]};if((e==null?void 0:e.review)==="rejected"&&Ge(e))return{key:"rejected",reasons:[]};if(e!=null&&e.advisory||(e==null?void 0:e.trust)==="advisory")return{key:"advisory",reasons:[]};const t=Dp(e);return t.includes("audit_unresolved")?{key:"conditional",reasons:t}:t.length?{key:"disputed",reasons:t}:(e==null?void 0:e.review)==="confirmed"&&Ge(e)?{key:"confirmed",reasons:t}:{key:"extracted",reasons:t}}function $p(e){return e.design_related?"design":e.classification==="Class I"?"class1":"other"}function io(e){const t=e.recalls||[];return t.some(n=>n.design_related)?"design":t.length?"recall":"clean"}function so(e){return{events:new Set(e.map(n=>n.event||n.id)).size,records:e.length}}const zp=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function De(e){if(!e)return"—";const[t,n,r]=String(e).slice(0,10).split("-").map(Number);return t?`${r} ${zp[(n||1)-1]} ${t}`:String(e)}const Wc=e=>e?String(e).slice(0,4):"";function wa(e,t){if(!e||!t)return null;const[n,r,l]=e.slice(0,10).split("-").map(Number),[i,s,a]=t.slice(0,10).split("-").map(Number);return(i-n)*12+(s-r)-(ar?1:0}function Bc(e,t){const n=Mp(e,t);if(n==null)return null;if(n===0)return{relation:"same-day",months:0,duration:""};const r=n<0?wa(e,t):wa(t,e);return{relation:n<0?"before":"after",months:r,duration:Fp(r)}}function Hc(e,t,n="clause"){if(!e)return"";const{relation:r,duration:l}=e;return n==="chip"?r==="same-day"?`Recall began on the day of ${t}'s clearance`:`Recall began ${l} ${r} ${t}'s clearance`:r==="same-day"?`on the day ${t} was cleared`:`${l} ${r} ${t} was cleared`}function Fp(e){if(e==null)return"";const t=e<0,n=Math.abs(e),r=Math.floor(n/12),l=n%12,i=[r?`${r} yr`:"",l?`${l} mo`:""].filter(Boolean).join(" ")||"<1 mo";return t?`-${i}`:i}const Ip=(e,t)=>e?t?`${e}#page=${t}`:e:null,Ap={pdf_text_layer:"PDF text layer",ocr:"Local OCR of the scanned PDF",embedded_pdf_attachment:"Summary embedded in a PDF Portfolio"};function st(e,t=30){const n=(e||"").replace(/\s+/g," ").trim();return n.length>t?n.slice(0,t-1)+"…":n}function Op(e,t){return e==="NO_DESIGN_RECALL_SIGNAL"&&t!=="complete"}function Up(e,t){const n=Kn[e];return n?Op(e,t)?{tone:"muted",label:`${n.label} · provisional`,provisional:!0}:{tone:n.tone,label:n.label,provisional:!1}:{tone:"muted",label:e||"Unknown",provisional:!1}}const kh={complete:"calm",partial:"amber",uncertain:"alert",none:"muted"},Vp={direct_predicate_links_all_uncertain:"every direct predicate link rests on uncertain evidence",unresolved_predicate_citations:"predicate citations within two generations could not be resolved",direct_predicate_summaries_unread:"a direct predicate's own summary was not read",doubtful_links_in_window:"links within two generations rest on doubtful evidence",recall_cause_or_class_unknown:"a recall has no stated cause or FDA class",unattributed_recalls_in_product_code:"design-related recalls in the product code name no 510(k)",shallow_traversal:"grand-predicates were not traversed",advisory_links_pending_review:"predicate links suggested only by an LLM or the MCP client await a person",human_confirmed_citation_retired:"a citation a person confirmed is no longer in the refreshed FDA summary"},Qc={name_token_match:{short:"FDA-listed · name match (heuristic)",tone:"other",text:"FDA lists this 510(k) on the recall. A distinctive word of its FDA device name appears in the recall text, possibly as a fuzzy match. This heuristic does not verify that the recall names this exact model."},name_token_absent:{short:"FDA-listed · name not found (heuristic)",tone:"muted",text:"FDA lists this 510(k) on the recall, but no distinctive word of its FDA device name was found in the recall text. The recalled model may differ, or the text may name it differently."},name_not_checkable:{short:"FDA-listed · name not checked",tone:"muted",text:"FDA lists this 510(k) on the recall. No name check is available: its FDA device name has no distinctive word to look for, or no check was recorded for this link. Which model was recalled is not established here."}},fi={short:"Recall began before this clearance",text:"This recall began before this 510(k) was cleared, yet FDA lists it on the record. The dates alone do not establish whether this cleared model was affected: read the FDA record."},jh={after:"cleared after the recall began",before:"cleared before the recall began",same_day:"cleared the day the recall began (order unknown)",unknown:"timing unknown (a date is missing)"};function ka(e){return e!=null&&e.attribution&&Qc[e.attribution]?e.attribution:(e==null?void 0:e.link_name_check)==="match"?"name_token_match":(e==null?void 0:e.link_name_check)==="mismatch"?"name_token_absent":"name_not_checkable"}const pi=70,Fr=110,ja=46,Wp=62,Bp=190,Na=300;function Hp(e){return e.signals.filter(t=>{var n;return(t.severity==="high"||t.severity==="medium")&&((n=t.chain)==null?void 0:n.length)>1}).map(t=>t.chain)}function Qp(e,{depth:t,descendants:n}){const r=new Map,l=Hp(e),i=new Set(l.flat()),s=new Set;l.forEach(p=>p.slice(1).forEach((h,g)=>s.add(p[g]+">"+h))),r.set(e.k,{...e.device,k:e.k,gen:0,side:"self",recalls:e.device.recalls||[]});let a=0,u=new Set;for(const p of e.ancestors)p.gen<=t||i.has(p.k)?r.set(p.k,{...p,side:"up"}):(a++,u.add(p.gen));if(n)for(const p of e.descendants)r.set(p.k,{...p,side:"down"});const d=new Map,f=p=>{for(const h of p||[]){if(!r.has(h.src)||!r.has(h.dst))continue;const g=h.src+">"+h.dst;d.has(g)||d.set(g,{id:g,hop:h,status:Et(h),critical:s.has(g)})}};for(const p of e.ancestors)r.has(p.k)&&f(p.hops);if(n)for(const p of e.descendants)f(p.hops);return{nodes:r,edges:d,hidden:a,hiddenGens:[...u].sort(),critK:i,critE:s}}function Kp(e,t){var E;const{nodes:n,edges:r}=e,l=new Map;for(const j of n.values())((E=j.chain)==null?void 0:E.length)>1&&l.set(j.k,j.chain[j.chain.length-2]);const i=[...n.values()].filter(j=>j.side==="up").map(j=>j.gen),s=[...n.values()].filter(j=>j.side==="down").map(j=>j.gen),a=i.length?Math.max(...i):0,u=s.length?Math.max(...s):0,d=j=>j.side==="self"?a:j.side==="up"?a-j.gen:a+j.gen,f=new Map;for(const j of n.values()){const x=d(j);f.has(x)||f.set(x,[]),f.get(x).push(j)}const p=new Map([[[...n.values()].find(j=>j.side==="self").k,0]]),h=[...f.keys()].sort((j,x)=>Math.abs(j-a)-Math.abs(x-a)),g=Math.max(...[...f.values()].map(j=>j.length));for(const j of h){const x=f.get(j);x.sort((R,T)=>{const I=p.get(l.get(R.k))??0,K=p.get(l.get(T.k))??0;return I-K||(T.decision_date||"").localeCompare(R.decision_date||"")}),x.forEach((R,T)=>{R.side!=="self"&&p.set(R.k,(T-(x.length-1)/2)*pi)})}const y=a+u,k=y?Math.max(Bp,Math.min(Na,(t-Fr*2)/y)):Na,L=Math.max(t,Fr*2+y*k),v=Fr+(L-(Fr*2+y*k))/2,c=ja+Wp+Math.max(1,g)*pi,m=ja+Math.max(1,g)*pi/2,w=new Map([...n.values()].map(j=>[j.k,{x:v+d(j)*k,y:m+p.get(j.k)}])),S=[...f.keys()].map(j=>{const x=j-a;return{x:v+j*k,label:x===0?"Candidate":x<0?x===-1?"Predicates":x===-2?"Grand-predicates":`Generation ${-x}`:`Cites it · +${x}`}});return{pos:w,width:L,height:c,colLabels:S,edges:r}}function Gp({a:e,depth:t,onDepth:n,descendants:r,selected:l,onSelect:i,focusChain:s}){const a=_.useMemo(()=>Qp(e,{depth:t,descendants:r}),[e,t,r]),u=_.useRef(null),[d,f]=_.useState(900);_.useEffect(()=>{const c=()=>u.current&&f(u.current.clientWidth);c();const m=new ResizeObserver(c);return m.observe(u.current),()=>m.disconnect()},[]);const p=_.useMemo(()=>Kp(a,d),[a,d]),[h,g]=_.useState(null);_.useEffect(()=>{const c=u.current;c&&(c.scrollLeft=c.scrollWidth)},[e.k,p.width]);const y=_.useMemo(()=>{const c=h||null;if(!c)return s?new Set(s):null;const m=a.nodes.get(c);return new Set((m==null?void 0:m.chain)||[c])},[h,a,s]),k=c=>{if(!y)return!0;const[m,w]=c.split(">");return y.has(m)&&y.has(w)},L=c=>{const m=c.recalls||[],w=m.filter(S=>S.design_related).length;return`${c.k}, ${c.name||"unnamed"}, cleared ${c.decision_date||"date unknown"}. `+(c.side==="self"?"Candidate. ":c.side==="up"?`Generation ${c.gen} predicate. `:`Cites the candidate, ${c.gen} generation(s) later. `)+(m.length?`${m.length} recall record(s), ${w} design-related. `:"No recall records. ")+(c.lineage_known===!1?"Its own predicates were not read.":"")},v=c=>m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),c())};return o.jsxs("div",{children:[o.jsx("div",{className:"graph-wrap",ref:u,"data-testid":"evidence-graph",children:o.jsxs("svg",{width:p.width,height:p.height,role:"group","aria-label":`Predicate lineage graph for ${e.k}: ${a.nodes.size} devices, ${a.edges.size} citations`,children:[p.colLabels.map(c=>o.jsxs("g",{children:[o.jsx("line",{className:"g-col-rule",x1:c.x,x2:c.x,y1:30,y2:p.height-10}),o.jsx("text",{className:"g-col-label",x:c.x,y:20,textAnchor:"middle",children:c.label})]},c.x)),[...a.edges.values()].map(c=>{const m=p.pos.get(c.hop.src),w=p.pos.get(c.hop.dst),S=(m.x+w.x)/2,E=`M${m.x-12},${m.y} C${S},${m.y} ${S},${w.y} ${w.x+12},${w.y}`,j=c.status.key,x=!k(c.id),R=(l==null?void 0:l.type)==="edge"&&l.id===c.id;return o.jsxs("g",{className:"g-edge-g",tabIndex:0,role:"button","aria-label":`Citation: ${c.hop.src} cites ${c.hop.dst}${c.hop.page?`, page ${c.hop.page}`:""}. ${Re[j].label}. Open provenance.`,"aria-pressed":R,onClick:()=>i({type:"edge",id:c.id,hop:c.hop}),onKeyDown:v(()=>i({type:"edge",id:c.id,hop:c.hop})),children:[o.jsx("path",{d:E,className:`g-edge st-${j}${c.critical?" is-critical":""}${x?" is-dim":""}`,style:R?{opacity:1,strokeWidth:3.2}:void 0}),c.critical&&!x&&o.jsx("path",{d:E,className:"g-flow"}),o.jsx("path",{d:E,className:"g-edge-hit"}),o.jsx("rect",{x:S-22,y:(m.y+w.y)/2-9,width:44,height:18,rx:9,fill:"transparent",style:{cursor:"pointer"}}),o.jsx("title",{children:`${c.hop.src} → ${c.hop.dst} · p.${c.hop.page??"?"} · ${Re[j].label}`})]},c.id)}),[...a.nodes.values()].map(c=>{const m=p.pos.get(c.k),w=io(c),S=c.side==="self",E=S?11:8,j=y&&!y.has(c.k),x=(l==null?void 0:l.type)==="node"&&l.k===c.k;return o.jsxs("g",{transform:`translate(${m.x},${m.y})`,tabIndex:0,role:"button","aria-label":L(c),"aria-pressed":x,className:`g-node${S?" is-self":""}${j?" is-dim":""}${x?" is-selected":""}`,"data-k":c.k,onMouseEnter:()=>g(c.k),onMouseLeave:()=>g(null),onFocus:()=>g(c.k),onBlur:()=>g(null),onClick:()=>i({type:"node",k:c.k}),onKeyDown:v(()=>i({type:"node",k:c.k})),children:[w==="design"&&!S&&o.jsx("circle",{className:"glow",r:E*2.2}),o.jsx("circle",{className:"halo",r:E+5}),o.jsx("circle",{className:`dot tone-${w}${c.lineage_known===!1?" unread":""}`,r:E}),o.jsx("text",{className:"lk",y:-E-9,textAnchor:"middle",children:c.k}),o.jsxs("text",{className:"ln",y:E+16,textAnchor:"middle",children:[st(c.name,26)," · ",Wc(c.decision_date)]})]},c.k)}),a.hidden>0&&o.jsxs("g",{className:"g-more",tabIndex:0,role:"button",transform:`translate(14, ${p.height-40})`,"aria-label":`Show ${a.hidden} more ancestors in generations ${a.hiddenGens.join(", ")}`,onClick:()=>n(Math.max(...a.hiddenGens)),onKeyDown:v(()=>n(Math.max(...a.hiddenGens))),children:[o.jsx("rect",{width:"212",height:"28",rx:"14"}),o.jsxs("text",{x:"106",y:"18.5",textAnchor:"middle",children:["+ ",a.hidden," more in generation",a.hiddenGens.length>1?`s ${a.hiddenGens[0]}–${a.hiddenGens[a.hiddenGens.length-1]}`:` ${a.hiddenGens[0]}`]})]})]})}),o.jsxs("div",{className:"g-legend","aria-label":"Legend",children:[o.jsxs("span",{className:"sw",children:[o.jsx("i",{className:"lg-design"}),"design-related recall"]}),o.jsxs("span",{className:"sw",children:[o.jsx("i",{className:"lg-recall"}),"other recall"]}),o.jsxs("span",{className:"sw",children:[o.jsx("i",{className:"lg-clean"}),"no recall record"]}),o.jsxs("span",{className:"sw",children:[o.jsx("i",{className:"lg-unread"}),"own predicates unread"]}),o.jsx("span",{className:"sep","aria-hidden":"true"}),["confirmed","extracted","disputed","conditional"].map(c=>o.jsxs("span",{className:`status status-${c}`,children:[o.jsx("span",{className:"line"}),Re[c].short]},c)),o.jsxs("span",{className:"status",style:{color:"var(--amber)"},children:[o.jsx("span",{className:"line"}),"critical chain"]})]}),o.jsx("div",{className:"graph-hint",children:"Select any device or thread for its record, quote, page and source PDF. Tab moves between them; Enter opens."})]})}const Dt=28,Ir=34,hi=260,ut=e=>e?Date.parse(e.slice(0,10)+"T00:00:00Z"):null;function Yp(e,t){const n=new Map,r=(u,d,f,p)=>{n.has(u.k)||n.set(u.k,{...u,side:d,gen:f,parent:p,children:[]})};r({...e.device,k:e.k},"self",0,null);for(const u of e.ancestors)u.gen<=t&&r(u,"up",u.gen,u.chain[u.chain.length-2]);for(const u of e.descendants)r(u,"down",u.gen,u.chain[u.chain.length-2]);for(const u of n.values())u.parent&&n.has(u.parent)&&n.get(u.parent).children.push(u.k);const l=(u,d)=>(n.get(u).decision_date||"").localeCompare(n.get(d).decision_date||""),i=[],s=u=>{for(const d of n.get(u).children.filter(f=>n.get(f).side==="down").sort(l).reverse())s(d),i.push(d)},a=u=>{for(const d of n.get(u).children.filter(f=>n.get(f).side==="up").sort(l).reverse())i.push(d),a(d)};return s(e.k),i.push(e.k),a(e.k),{nodes:n,order:i}}function Xp({a:e,depth:t,highlight:n,onSelect:r}){const l=_.useRef(null),[i,s]=_.useState(1e3);_.useEffect(()=>{const x=()=>l.current&&s(Math.max(760,l.current.clientWidth));x();const R=new ResizeObserver(x);return R.observe(l.current),()=>R.disconnect()},[]);const{nodes:a,order:u}=_.useMemo(()=>Yp(e,t),[e,t]),d=new Map(u.map((x,R)=>[x,R])),f=[];for(const x of a.values()){x.decision_date&&f.push(ut(x.decision_date));for(const R of x.recalls||[])R.initiated&&f.push(ut(R.initiated))}const p=new Date(Math.min(...f)).getUTCFullYear(),h=new Date(Math.max(...f)).getUTCFullYear()+1,g=Date.UTC(p,0,1),y=Date.UTC(h,0,1),k=i-hi-40,L=x=>16+(x-g)/(y-g)*k,v=x=>Ir+x*Dt+Dt/2,c=Ir+u.length*Dt+16,m=new Set(n||[]),w=new Set;if(n)for(let x=0;x+1"+n[x+1]);const S=h-p>24?4:h-p>12?2:1,E=[];for(let x=p;x<=h;x+=S)E.push(x);const j=L(ut(e.device.decision_date));return o.jsx("div",{className:"graph-wrap",ref:l,"data-testid":"timeline",children:o.jsxs("svg",{width:i,height:c,role:"group","aria-label":`Lineage timeline for ${e.k}`,children:[E.map(x=>o.jsxs("g",{children:[o.jsx("line",{className:"tl-grid",x1:L(Date.UTC(x,0,1)),x2:L(Date.UTC(x,0,1)),y1:Ir-8,y2:c-8}),o.jsx("text",{className:"tl-axis",x:L(Date.UTC(x,0,1)),y:18,textAnchor:"middle",children:x})]},x)),o.jsx("rect",{x:0,y:v(d.get(e.k))-Dt/2,width:i,height:Dt,className:"tl-band"}),o.jsx("line",{className:"tl-clear",x1:j,x2:j,y1:Ir-8,y2:c-8}),[...a.values()].filter(x=>x.parent&&a.has(x.parent)).map(x=>{const[R,T]=x.side==="up"?[x.parent,x.k]:[x.k,x.parent],I=a.get(R),K=a.get(T);if(!I.decision_date||!K.decision_date)return null;const me=L(ut(I.decision_date)),Be=v(d.get(R)),Y=L(ut(K.decision_date)),Ze=v(d.get(T)),M=(me+Y)/2;return o.jsx("path",{d:`M${me-6},${Be} C${M},${Be} ${M},${Ze} ${Y+7},${Ze}`,className:"tl-edge"+(w.has(R+">"+T)?" on":"")},R+T)}),u.map((x,R)=>{const T=a.get(x);if(!T.decision_date)return null;const I=L(ut(T.decision_date)),K=v(R),me=io(T),Be=m.size&&!m.has(x);return o.jsxs("g",{className:"tl-row g-node",style:{opacity:Be?.3:1},tabIndex:0,role:"button","aria-label":`${x} ${T.name}, cleared ${T.decision_date}, ${(T.recalls||[]).length} recall records`,onClick:()=>r({type:"node",k:x}),onKeyDown:Y=>{(Y.key==="Enter"||Y.key===" ")&&(Y.preventDefault(),r({type:"node",k:x}))},children:[o.jsx("rect",{className:"tl-rowhit",x:0,y:K-Dt/2,width:i,height:Dt}),(T.recalls||[]).map(Y=>Y.initiated&&o.jsxs("g",{children:[o.jsx("line",{className:"tl-rlink",x1:I,x2:L(ut(Y.initiated)),y1:K,y2:K}),o.jsx("path",{d:`M${L(ut(Y.initiated))},${K-5} l5,5 l-5,5 l-5,-5 z`,className:"tl-dia "+(Y.design_related?"design":"other"),children:o.jsx("title",{children:`${Y.id} · ${Y.classification||"unclassified"} · ${Y.root_cause} · began ${Y.initiated}`})})]},Y.id)),o.jsx("circle",{cx:I,cy:K,r:x===e.k?7:5.5,className:`dot tone-${me}${T.lineage_known===!1?" unread":""}`,style:x===e.k?{fill:"var(--ivory)",stroke:"var(--blue)",strokeWidth:3}:void 0}),o.jsxs("text",{x:i-hi+8,y:K+4,className:"tl-label",children:[o.jsx("tspan",{className:"lk",children:x}),o.jsx("tspan",{dx:"7",children:st(T.name,24)})]}),o.jsx("text",{x:i-hi-6,y:K+4,textAnchor:"end",className:"tl-gen",children:T.side==="self"?"candidate":T.side==="up"?`G-${T.gen}`:`D+${T.gen}`})]},x)})]})})}function Kc({text:e,k:t,ocr:n}){if(!e)return o.jsx("p",{className:"quote muted",children:"No quote stored for this citation."});const r=t?e.split(new RegExp(`(${t.replace(/^K/,"K\\s?")})`)):[e];return o.jsxs("blockquote",{className:"quote"+(n?" is-ocr":""),children:["“",/^[a-z]/.test(e)?"…":"",r.map((l,i)=>i%2?o.jsx("mark",{children:l},i):o.jsx(Nl.Fragment,{children:l},i)),"”"]})}function Zp({hop:e}){const t=Et(e);return o.jsxs("span",{className:`status status-${t.key}`,children:[o.jsx("span",{className:"line"}),Re[t.key].label]})}function Gc({r:e}){const t=$p(e),n=Qc[ka(e)];return o.jsxs("div",{className:"recall","data-attribution":ka(e),children:[o.jsxs("div",{className:"recall-h",children:[o.jsx("span",{className:`chip tone-${t}`,children:t==="design"?"Design-related":t==="class1"?"Class I, other cause":"Other cause"}),o.jsx("span",{className:"k mono",children:e.id}),o.jsxs("span",{className:"muted",children:[e.classification||"Unclassified"," · ",e.root_cause||"cause not stated"," · began ",De(e.initiated)]}),e.url&&o.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer",children:"FDA record ↗"})]}),o.jsxs("div",{className:"recall-r",children:[o.jsx("span",{className:`chip tone-${n.tone}`,title:n.text,children:n.short})," ",o.jsx("span",{className:"muted small",children:n.text})]}),e.linked_before_clearance&&o.jsxs("div",{className:"recall-r","data-testid":"recall-predates",children:[o.jsx("span",{className:"chip tone-muted",title:fi.text,children:fi.short})," ",o.jsx("span",{className:"muted small",children:fi.text})]}),e.reason&&o.jsx("div",{className:"recall-r",children:e.reason}),e.status&&o.jsxs("div",{className:"recall-r",children:["Status: ",e.status,e.event?` · event ${e.event}`:"",e.firm?` · ${e.firm}`:""]})]})}function kn(e,t){return t===e.k?{...e.device,k:e.k,gen:0,side:"self"}:e.ancestors.find(n=>n.k===t)&&{...e.ancestors.find(n=>n.k===t),side:"up"}||e.descendants.find(n=>n.k===t)&&{...e.descendants.find(n=>n.k===t),side:"down"}||null}function Jp({sel:e,a:t,onClose:n,go:r,reload:l,onSelect:i}){const s=_.useRef(null),a=_.useRef(null);return _.useEffect(()=>{var f;const u=document.activeElement;(f=a.current)==null||f.focus();const d=p=>{if(p.key==="Escape"&&n(),p.key==="Tab"&&s.current){const h=s.current.querySelectorAll('a[href], button:not([disabled]), input, textarea, [tabindex="0"]');if(!h.length)return;const g=h[0],y=h[h.length-1];p.shiftKey&&document.activeElement===g?(p.preventDefault(),y.focus()):!p.shiftKey&&document.activeElement===y&&(p.preventDefault(),g.focus())}};return addEventListener("keydown",d),()=>{var p;removeEventListener("keydown",d),(p=u==null?void 0:u.focus)==null||p.call(u)}},[]),o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"drawer-scrim",onClick:n}),o.jsx("aside",{className:"drawer",ref:s,role:"dialog","aria-modal":"true","aria-labelledby":"drawer-title","data-testid":"provenance",children:e.type==="edge"?o.jsx(qp,{sel:e,a:t,closeBtn:a,onClose:n,go:r,reload:l,onSelect:i}):o.jsx(bp,{sel:e,a:t,closeBtn:a,onClose:n,go:r,onSelect:i})})]})}function as({eyebrow:e,children:t,closeBtn:n,onClose:r}){return o.jsxs("div",{className:"drawer-head",children:[o.jsxs("div",{className:"t",children:[o.jsx("p",{className:"eyebrow",children:e}),o.jsx("h2",{id:"drawer-title",children:t})]}),o.jsx("button",{ref:n,className:"btn btn-quiet",onClick:r,"aria-label":"Close provenance (Escape)",children:"✕"})]})}function qp({sel:e,a:t,closeBtn:n,onClose:r,go:l,reload:i,onSelect:s}){const a=e.hop,u=kn(t,a.src)||{},d=kn(t,a.dst)||{},f=Et(a),[p,h]=_.useState(!1),[g,y]=_.useState(null),k=a.source_url||u.summary_url,L=(a.text_source||u.text_source)&&(a.text_source||u.text_source)!=="pdf_text_layer",v=async c=>{h(!0),y(null);try{const m=await Oe.review(a.src,a.dst,c);y({ok:!0,text:c?`Recorded: ${c}. The assessment has been recomputed from the graph.`:"Review cleared. The assessment has been recomputed."}),s({...e,hop:{...a,review:(m==null?void 0:m.review)??(c||null),reviewer:(m==null?void 0:m.reviewer)??(c?"user":null)}}),i()}catch(m){y({ok:!1,text:m.message})}finally{h(!1)}};return o.jsxs(o.Fragment,{children:[o.jsxs(as,{eyebrow:"Citation provenance",closeBtn:n,onClose:r,children:[o.jsx("span",{className:"k",children:a.src})," cites ",o.jsx("span",{className:"k",children:a.dst})]}),o.jsxs("div",{className:"drawer-body",children:[o.jsxs("div",{className:"drawer-sec",children:[o.jsx(Zp,{hop:a}),f.reasons.length>0&&o.jsx("ul",{style:{margin:"8px 0 0",paddingLeft:18,color:"var(--ink-2)",fontSize:12.5},children:f.reasons.map(c=>o.jsx("li",{children:Uc[c]||c},c))}),f.key==="conditional"&&o.jsxs("p",{className:"note-box violet",style:{marginTop:10},children:["Recall signals reached through this thread are ",o.jsx("b",{children:"conditional"}),": they hold only if this citation is a predicate. Read the page, then confirm or reject it: your review rewrites the verdict."]})]}),o.jsxs("div",{className:"drawer-sec",children:[o.jsx("h3",{children:"What the summary says"}),o.jsx(Kc,{text:a.quote||a.snippet,k:a.dst,ocr:L})]}),k&&o.jsxs("a",{className:"page-card",href:Ip(k,a.page),target:"_blank",rel:"noreferrer","data-testid":"pdf-page-link",children:[o.jsx("span",{className:"sheet",children:o.jsxs("b",{children:["p.",a.page??"?"]})}),o.jsxs("span",{className:"tx",children:[o.jsxs("b",{children:["Open the original FDA PDF",a.page?` at page ${a.page}`:""," ↗"]}),o.jsxs("span",{children:[a.src," 510(k) summary · accessdata.fda.gov"]})]})]}),o.jsxs("div",{className:"drawer-sec",children:[o.jsx("h3",{children:"Source and extraction"}),o.jsxs("dl",{className:"prov-grid",children:[o.jsx("dt",{children:"Citing device"}),o.jsxs("dd",{children:[a.src," · ",st(u.name,40),u.decision_date?` · ${De(u.decision_date)}`:""]}),o.jsx("dt",{children:"Cited device"}),o.jsxs("dd",{children:[a.dst," · ",st(d.name,40),d.decision_date?` · ${De(d.decision_date)}`:""]}),o.jsx("dt",{children:"Role"}),o.jsx("dd",{children:a.kind||"predicate"}),o.jsx("dt",{children:"Page"}),o.jsx("dd",{children:a.page??"not recorded"}),o.jsx("dt",{children:"Text source"}),o.jsx("dd",{children:Ap[a.text_source||u.text_source]||a.text_source||u.text_source||"not recorded"}),o.jsx("dt",{children:"Extraction"}),o.jsxs("dd",{children:[a.method||"—",a.confidence!=null?` · confidence ${a.confidence}`:""]}),o.jsx("dt",{children:"Name check"}),o.jsx("dd",{children:a.name_check||"—"}),o.jsx("dt",{children:"FDA panel"}),o.jsx("dd",{children:a.panel_check||"—"}),a.audit&&o.jsxs(o.Fragment,{children:[o.jsx("dt",{children:"Audit"}),o.jsxs("dd",{children:[a.audit,a.audit_note?` — ${a.audit_note}`:""]})]}),a.ai_label&&o.jsxs(o.Fragment,{children:[o.jsx("dt",{children:"LLM label"}),o.jsxs("dd",{children:[a.ai_label,a.ai_model?` · ${a.ai_model}`:""," (advisory; never a verdict input until a person confirms)"]})]}),o.jsx("dt",{children:"Review"}),o.jsx("dd",{children:a.review?`${a.review} by ${a.reviewer||"unknown"}${cr.includes(a.reviewer)?" (automated client; advisory)":Vc(a)?" on an earlier version of the summary; needs re-review":""}`:"not reviewed by a person"}),o.jsx("dt",{children:"Trust"}),o.jsx("dd",{"data-testid":"edge-trust",children:Re[Et(a).key].label}),a.retired_at&&o.jsxs(o.Fragment,{children:[o.jsx("dt",{children:"Retired"}),o.jsxs("dd",{children:[De(a.retired_at)," · no longer cited by the refreshed summary"]})]}),u.summary_sha256&&o.jsxs(o.Fragment,{children:[o.jsx("dt",{children:"PDF SHA-256"}),o.jsx("dd",{children:o.jsx("span",{className:"mono",children:u.summary_sha256})})]})]})]}),o.jsxs("div",{className:"drawer-sec",children:[o.jsx("h3",{children:"Your review"}),o.jsxs("div",{className:"drawer-acts",children:[o.jsx("button",{className:"btn btn-line btn-sm",disabled:p,onClick:()=>v(a.review==="confirmed"&&Ge(a)?"":"confirmed"),children:a.review==="confirmed"&&Ge(a)?"Clear confirmation":"Confirm citation"}),o.jsx("button",{className:"btn btn-line btn-sm",disabled:p,onClick:()=>v(a.review==="rejected"&&Ge(a)?"":"rejected"),children:a.review==="rejected"&&Ge(a)?"Restore citation":"Reject citation"})]}),o.jsx("p",{className:"note",style:{marginTop:8},children:"A review is a write to the Relate graph. Every lineage query, verdict and saved-assessment staleness check reads it immediately."}),g&&o.jsx("p",{className:g.ok?"ok":"err",role:"status",children:g.text})]}),o.jsxs("div",{className:"drawer-acts",children:[o.jsxs("button",{className:"btn btn-quiet btn-sm",onClick:()=>s({type:"node",k:a.dst}),children:[a.dst," record →"]}),o.jsxs("button",{className:"btn btn-quiet btn-sm",onClick:()=>s({type:"node",k:a.src}),children:[a.src," record →"]})]})]})]})}function bp({sel:e,a:t,closeBtn:n,onClose:r,go:l,onSelect:i}){var p,h;const s=kn(t,e.k);if(!s)return o.jsxs(o.Fragment,{children:[o.jsx(as,{eyebrow:"Device",closeBtn:n,onClose:r,children:e.k}),o.jsx("div",{className:"drawer-body",children:"Not in this view."})]});const a=[...s.recalls||[]].sort((g,y)=>y.design_related-g.design_related||(g.initiated||"").localeCompare(y.initiated||"")),u=so(a),d=s.side==="self"?"Candidate":s.side==="up"?{1:"Direct predicate",2:"Grand-predicate"}[s.gen]||`Generation ${s.gen} ancestor`:`Later device citing this lineage (+${s.gen})`,f=a.filter(g=>g.initiated&&t.device.decision_date&&g.initiated1&&o.jsxs(o.Fragment,{children:[o.jsx("dt",{children:"Route"}),o.jsx("dd",{className:"mono",style:{fontSize:12},children:s.chain.join(" → ")})]})]}),o.jsxs("div",{className:"drawer-acts",children:[s.k!==t.k&&o.jsxs("button",{className:"btn btn-primary btn-sm",onClick:()=>l("check",s.k),children:["Investigate ",s.k," ",o.jsx("span",{className:"arr","aria-hidden":"true",children:"→"})]}),o.jsx("a",{className:"btn btn-line btn-sm",href:Ac(s.k),target:"_blank",rel:"noreferrer",children:"FDA 510(k) record ↗"}),s.summary_url&&o.jsx("a",{className:"btn btn-line btn-sm",href:s.summary_url,target:"_blank",rel:"noreferrer",children:"Summary PDF ↗"}),s.lineage_known===!1&&o.jsx("button",{className:"btn btn-line btn-sm",onClick:()=>l("ingest",s.k),children:"Try to read its summary"})]}),((h=s.hops)==null?void 0:h.length)>0&&o.jsxs("div",{className:"drawer-sec",children:[o.jsx("h3",{children:"How it is reached"}),o.jsx("div",{className:"tags",children:s.hops.map(g=>o.jsxs("button",{className:"tag-btn",onClick:()=>i({type:"edge",id:g.src+">"+g.dst,hop:g}),children:[o.jsx("span",{className:"k",children:g.src})," → ",o.jsx("span",{className:"k",children:g.dst})," · p.",g.page??"?"," · ",Re[Et(g).key].short]},g.src+g.dst))})]}),o.jsxs("div",{className:"drawer-sec",children:[o.jsxs("h3",{children:["Recall records on which FDA lists this 510(k) · ",u.events," event(s), ",u.records," product record(s)"]}),s.side!=="self"&&f.length>0&&o.jsxs("p",{className:"note-box amber",style:{marginBottom:10},children:[f.length," of these record(s) began before ",t.k," was cleared on ",De(t.device.decision_date),"."]}),a.length===0?o.jsx("p",{className:"muted",children:"openFDA lists this 510(k) on no recall record."}):o.jsx("div",{style:{display:"grid",gap:8},children:a.slice(0,20).map(g=>o.jsx(Gc,{r:g},g.id))}),a.length>20&&o.jsxs("p",{className:"muted small",children:["+ ",a.length-20," more record(s): open the device to see all."]})]})]})]})}const eh={rejected_by_reviewer:"rejected by a reviewer",audit_not_predicate:"the audit found it is not a predicate citation",audit_error:"the audit found a K-number error",audit_unresolved:"the audit could not resolve it",not_in_openfda:"K-number not found in openFDA",cleared_after_citing_device:"K-number cleared after the citing device",audit_variant:"audit marked it a naming variant",audit_corrected:"K-number corrected by the audit"};function Yc(e){const t=[];for(const n of e.signals)switch(n.code){case"DIRECT_RECALL":if(n.severity==="info")break;t.push({id:n.code,tone:n.severity==="high"?"alert":"amber",sev:n.severity,title:n.title,what:"The candidate itself appears in FDA recall records.",why:n.severity==="high"?"A design-related recall on the device you would cite is what FDA's 2023 draft guidance asks you to avoid or explain.":"A Class I recall on the candidate is a documented question for any submission that cites it.",todo:"Open each recall record and document how it is addressed (scope, lots, corrective action).",node:e.k});break;case"ANCESTOR_RECALL":if(n.severity!=="medium")break;t.push({id:n.code+n.chain.join(),tone:n.conditional?"violet":"amber",sev:n.severity,title:n.title,conditional:n.conditional,what:n.conditional?"The recall holder is reached only through a citation the audit could not resolve.":`A ${n.gen===1?"direct predicate":"grand-predicate"} carries recall records the verdict rules treat as review-worthy.`,why:n.conditional?"If that citation is not a predicate, this recall does not belong to the lineage; if it is, it does.":"Reviewers expect the predicate rationale to address design-related recalls in the lineage (FDA 2023 draft guidance; Kadakia et al., JAMA 2023, an association).",todo:n.conditional?"Open the uncertain thread, read the PDF page, and confirm or reject it.":"Verify the citation on its PDF page, read the recall records, and record how the rationale addresses them.",chain:n.chain,hops:n.evidence.filter(r=>r.type==="citation")});break;case"UNCERTAIN_LINK_IN_LINEAGE":case"NAME_MISMATCH_IN_LINEAGE":t.push({id:n.code,tone:"alert",sev:"info",title:n.title,what:"Threads in this ancestry rest on evidence that conflicts with FDA records or needed correction.",why:"A doubtful thread may route the lineage to the wrong device, and the right one may be missing; these links never count as checked.",todo:"Open each thread, compare the quote with the cited device, then confirm or reject it.",hops:n.evidence.filter(r=>r.type==="citation")});break;case"ADVISORY_LINK_PENDING_REVIEW":t.push({id:n.code,tone:"violet",sev:"info",title:n.title,what:"An LLM label or the automated MCP client calls these citations predicates; no person has decided.",why:"They are not used for the verdict. If one is a real predicate, its recalls belong in the lineage and the verdict could change.",todo:"Open each link, read the PDF page, and confirm or reject it yourself.",hops:n.evidence.filter(r=>r.type==="advisory_citation")});break;case"CITATION_RETIRED_BY_REINGEST":t.push({id:n.code,tone:"muted",sev:"info",title:n.title,what:"Re-reading the citing device's FDA summary no longer found these citations, so they were retired from the lineage.",why:"Earlier reviews, labels and provenance are kept for the record; a review made on the old text may no longer apply.",todo:"Compare the refreshed summary with the earlier one and record a new review if the citation still matters.",hops:n.evidence});break;case"PREDICATE_CITATION_UNRESOLVED":t.push({id:n.code,tone:"muted",sev:"info",title:n.title,what:"Predicate citations printed in a summary did not become lineage threads.",why:"A missing thread means part of the ancestry is invisible: a recall there would not show.",todo:"Check each quote. If the citation is real and the K-number valid, add that clearance to extend the graph.",missing:n.evidence});break;case"LINEAGE_UNKNOWN":case"LINEAGE_TRUNCATED":t.push({id:n.code,tone:"muted",sev:"info",title:n.title,what:"Some summaries are not machine-readable, so the ancestry stops there.",why:"Recalls further up those branches cannot be seen. The verdict reports this gap; it never fills it in.",todo:"Try reading each summary live (needs internet), which extends the lineage by one generation.",ingest:n.code==="LINEAGE_UNKNOWN"?[{k:e.k}]:n.evidence});break;case"UNATTRIBUTED_RECALLS_IN_PRODUCT_CODE":t.push({id:n.code,tone:"muted",sev:"info",title:n.title,what:"FDA filed these recalls under the product code without naming a 510(k) number.",why:"No lineage query can attribute them; one may still concern a device in this lineage.",todo:"Read the product descriptions and check whether any names a device in this ancestry.",recalls:n.evidence});break;case"RECALL_CAUSE_OR_CLASS_UNKNOWN":t.push({id:n.code,tone:"muted",sev:"info",title:n.title,what:"Recall records without a stated root cause or FDA classification.",why:"They cannot be ruled out as design-related or Class I, so they could change the verdict once classified.",todo:"Re-check the FDA records for an updated classification or root cause.",recalls:n.evidence});break;case"DEEPER_ANCESTRY_GAPS":t.push({id:n.code,tone:"muted",sev:"info",title:n.title,what:"Gaps beyond the two-generation verdict window.",why:"They cannot change the verdict, but the lower-severity list may be incomplete.",todo:"Expand the graph to deeper generations if the deeper ancestry matters to your rationale."});break}return t}function th({a:e,onSelect:t,go:n,onFocusChain:r}){const l=Yc(e);return l.length?o.jsx("div",{"data-testid":"review-queue",children:l.map(i=>{var s,a,u,d;return o.jsxs("section",{className:`review-item tone-${i.tone}`,onMouseEnter:()=>i.chain&&r(i.chain),onMouseLeave:()=>r(null),children:[o.jsxs("h3",{children:[o.jsx("span",{className:`sev sev-${i.sev}`,children:i.conditional?"conditional":i.sev==="info"?"gap":i.sev}),o.jsx("span",{children:i.title})]}),o.jsxs("dl",{children:[o.jsx("dt",{children:"Conflict"}),o.jsx("dd",{children:i.what}),o.jsx("dt",{children:"Why it matters"}),o.jsx("dd",{children:i.why}),o.jsx("dt",{children:"Next step"}),o.jsx("dd",{children:i.todo})]}),((s=i.hops)==null?void 0:s.length)>0&&o.jsx("div",{className:"links",children:i.hops.slice(0,8).map(f=>{const p=Et(f);return o.jsxs("button",{className:"tag-btn",onClick:()=>t({type:"edge",id:f.src+">"+f.dst,hop:f}),title:p.reasons.map(h=>Uc[h]).join("; ")||Re[p.key].label,children:[o.jsx("span",{className:"k",children:f.src})," → ",o.jsx("span",{className:"k",children:f.dst})," · p.",f.page??"?"," · ",o.jsx("span",{className:`status-${p.key}`,children:Re[p.key].short})]},f.src+f.dst)})}),((a=i.missing)==null?void 0:a.length)>0&&o.jsx("div",{className:"links",children:i.missing.slice(0,8).map(f=>o.jsxs("button",{className:"tag-btn",title:f.quote||"",onClick:()=>n("ingest",f.cited),children:[o.jsx("span",{className:"k",children:f.src})," → ",o.jsx("span",{className:"k",children:f.cited})," · ",eh[f.reason]||f.reason]},f.src+f.cited))}),((u=i.ingest)==null?void 0:u.length)>0&&o.jsx("div",{className:"links",children:i.ingest.slice(0,10).map(f=>o.jsxs("button",{className:"tag-btn",onClick:()=>n("ingest",f.k),children:[o.jsx("span",{className:"k",children:f.k}),f.summary_status?` · ${f.summary_status}`:""," · read now"]},f.k))}),((d=i.recalls)==null?void 0:d.length)>0&&o.jsx("div",{className:"links",children:i.recalls.slice(0,8).map(f=>f.url?o.jsxs("a",{className:"tag-btn",href:f.url,target:"_blank",rel:"noreferrer",children:[f.id," ↗"]},f.id):o.jsx("span",{className:"tag-btn",children:f.id},f.id))}),i.node&&o.jsx("div",{className:"acts",children:o.jsx("button",{className:"btn btn-line btn-sm",onClick:()=>t({type:"node",k:i.node}),children:"Open recall records"})}),i.chain&&o.jsx("div",{className:"acts",children:o.jsxs("button",{className:"btn btn-line btn-sm",onClick:()=>t({type:"node",k:i.chain[i.chain.length-1]}),children:["Open ",i.chain[i.chain.length-1]," records"]})})]},i.id)})}):o.jsx("p",{className:"muted",children:"Nothing in this lineage needs a person's attention under the current rules."})}function oo(e){const t=e.signals.filter(n=>{var r;return(n.severity==="high"||n.severity==="medium")&&((r=n.chain)==null?void 0:r.length)>1});return t.find(n=>!n.conditional)||t[0]||null}function us(e,t){const n=e.filter(i=>i.design_related),r=n.length?n:e.filter(i=>i.classification==="Class I");return r.filter(i=>i.initiated&&t&&i.initiatedi.initiated.localeCompare(s.initiated))[0]||[...r].sort((i,s)=>(s.initiated||"").localeCompare(i.initiated||""))[0]||null}function nh({a:e}){const t=e.device,n=oo(e),r=e.signals.find(l=>l.code==="DIRECT_RECALL"&&l.severity!=="info"&&l.severity!=="low");if(r&&(!n||r.severity==="high")){const l=us(r.evidence.filter(i=>i.type==="recall"),null);return o.jsxs("p",{className:"finding-sentence","data-testid":"finding-sentence",children:[o.jsx("span",{className:"k",children:e.k})," itself appears in FDA recall records",l&&o.jsxs(o.Fragment,{children:[": a ",o.jsxs("span",{className:"amber",children:[l.classification||"unclassified"," ",l.root_cause]})," recall began ",De(l.initiated)]}),"."," ","Citing it as a predicate would need that addressed."]})}if(n){const l=kn(e,n.chain[n.chain.length-1]),i=n.evidence.filter(f=>f.type==="recall"),s=us(i,t.decision_date),a=n.evidence.find(f=>f.type==="citation"&&f.src===e.k),u=s?Bc(s.initiated,t.decision_date):null,d=so(i);return o.jsxs("p",{className:"finding-sentence","data-testid":"finding-sentence",children:[st(t.name,48)," cites ",o.jsx("span",{className:"k",children:n.chain[1]}),a!=null&&a.page?o.jsxs(o.Fragment,{children:[" on page ",a.page," of its summary"]}):null,"."," ",n.conditional?o.jsxs(o.Fragment,{children:["The cited device ",o.jsx("span",{className:"k",children:l==null?void 0:l.k}),", reached through a citation the audit could not resolve,"]}):n.chain.length>2?o.jsxs(o.Fragment,{children:["Through it, ",n.gen===2?"grand-predicate":`generation-${n.gen} ancestor`," ",o.jsx("span",{className:"k",children:l==null?void 0:l.k})]}):o.jsx(o.Fragment,{children:"That predicate"})," ","(",st(l==null?void 0:l.name,52),") is listed by FDA on ",d.events," recall event",d.events===1?"":"s"," in this signal",s&&o.jsxs(o.Fragment,{children:[", including a ",o.jsxs("span",{className:"amber",children:[s.classification||"unclassified"," ",s.root_cause]})," recall that began ",De(s.initiated),u&&o.jsxs(o.Fragment,{children:[", ",u.relation==="before"?o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"amber",children:[u.duration," before"]})," ",e.k," was cleared"]}):Hc(u,e.k)]})]}),".",n.conditional&&o.jsxs(o.Fragment,{children:[" This route is ",o.jsx("b",{style:{color:"var(--violet)"},children:"conditional"}),": it holds only if that citation is a predicate."]})]})}return o.jsx("p",{className:"finding-sentence","data-testid":"finding-sentence",children:e.verdict_reason})}function rh({a:e,onSelect:t}){const n=oo(e);if(!n)return null;const r=n.evidence.filter(d=>d.type==="citation"),l=(d,f)=>{var p,h;return r.find(g=>g.src===d&&g.dst===f)||((h=(p=kn(e,f))==null?void 0:p.hops)==null?void 0:h.find(g=>g.src===d&&g.dst===f))},i=n.chain[n.chain.length-1],s=n.evidence.filter(d=>d.type==="recall"),a=us(s,e.device.decision_date),u=a?Bc(a.initiated,e.device.decision_date):null;return o.jsxs("section",{className:"panel corner-marks","aria-labelledby":"chain-title","data-testid":"critical-chain",children:[o.jsxs("div",{className:"panel-head",children:[o.jsxs("h2",{id:"chain-title",children:["Critical chain ",o.jsx("span",{className:"count",children:"predicate → recall, the route that raised the verdict"})]}),o.jsx("p",{className:"hint",children:"Select a thread for its page and quote."})]}),o.jsx("div",{className:"chain",children:n.chain.map((d,f)=>{const p=kn(e,d)||{},h=f===0?"Candidate":n.conditional?"Cited device · citation unresolved":f===1?"Direct predicate":f===2?"Grand-predicate":`Generation ${f}`,g=d===i,y=g?io({recalls:s}):"none",k=f>0?l(n.chain[f-1],d):null,L=k?Et(k):null;return o.jsxs(Nl.Fragment,{children:[f>0&&o.jsxs("button",{className:`chain-link st-${(L==null?void 0:L.key)||"extracted"}`,onClick:()=>k&&t({type:"edge",id:k.src+">"+k.dst,hop:k}),"aria-label":`${n.chain[f-1]} cites ${d}${k!=null&&k.page?` on page ${k.page}`:""}, ${Re[(L==null?void 0:L.key)||"extracted"].label}. Open provenance.`,children:[o.jsxs("span",{className:"lbl",children:["cites",k!=null&&k.page?` · p.${k.page}`:""]}),o.jsx("span",{className:"sub",children:Re[(L==null?void 0:L.key)||"extracted"].short})]}),o.jsxs("button",{className:`chain-node${f===0?" is-self":""}${y==="design"?" tone-design":""}`,onClick:()=>t({type:"node",k:d}),children:[o.jsx("span",{className:"role",children:h}),o.jsx("span",{className:"k",children:d}),o.jsx("span",{className:"nm",children:st(p.name,44)}),o.jsxs("span",{className:"dt",children:["Cleared ",De(p.decision_date)]}),g&&a&&o.jsxs("span",{className:"rc",children:[o.jsxs("span",{className:`chip tone-${a.design_related?"design":"class1"}`,children:[a.classification||"Unclassified"," · ",a.root_cause]}),o.jsxs("span",{className:"dt",children:["Recall began ",De(a.initiated)," · ",o.jsx("span",{className:"mono",children:a.id})]})]})]})]},d)})}),a&&u&&o.jsxs("div",{className:"chain-timing",children:[o.jsxs("span",{className:"chip tone-amber",children:[o.jsx("span",{className:"glyph"}),Hc(u,e.k,"chip")]}),o.jsxs("span",{className:"muted",children:[so(s).events," recall event(s) · ",s.length," product record(s) in this signal. Documentation signal, not a safety finding."]})]})]})}function lh({k:e,go:t,onChanged:n}){var Y,Ze;const[r,l]=_.useState(null),[i,s]=_.useState(null),[a,u]=_.useState(!1),[d,f]=_.useState(4),[p,h]=_.useState(2),[g,y]=_.useState("graph"),[k,L]=_.useState(!1),[v,c]=_.useState(null),[m,w]=_.useState(null),[S,E]=_.useState([]),[j,x]=_.useState([]),R=()=>{u(!0),s(null),Oe.assess(e,d).then(M=>{l(M)}).catch(M=>{l(null),s(M.message)}).finally(()=>u(!1)),Oe.assessments(e).then(E).catch(()=>E([])),Oe.investigations(e,10).then(x).catch(()=>x([]))};if(_.useEffect(()=>{c(null),h(2),R()},[e,d]),i)return o.jsxs("div",{className:"panel",role:"alert",children:[o.jsx("p",{className:"err",style:{fontSize:15},children:i}),i.includes("not in the graph")&&o.jsxs("button",{className:"btn btn-primary",onClick:()=>t("ingest",e),children:["Read ",e," from FDA now ",o.jsx("span",{className:"arr",children:"→"})]})]});if(!r)return o.jsxs("div",{"aria-busy":"true",children:[o.jsxs("div",{className:"loading-thread",children:[o.jsx("i",{}),"Walking ",e,"'s lineage in the Relate graph…"]}),o.jsx("div",{className:"skeleton",style:{height:210,marginBottom:16}}),o.jsx("div",{className:"skeleton",style:{height:160,marginBottom:16}}),o.jsx("div",{className:"skeleton",style:{height:380}})]});const T=r.device,I=r.coverage,K={...Kn[r.verdict],...Up(r.verdict,I.evidence)},me=Yc(r).length,Be=r.signals.filter(M=>M.conditional).length;return o.jsxs("div",{className:"investigation","aria-busy":a,children:[o.jsxs("section",{className:`finding tone-${K.tone}`,"aria-labelledby":"finding-title","data-testid":"finding",children:[o.jsxs("div",{className:"finding-top",children:[o.jsxs("div",{className:"finding-id",children:[o.jsxs("div",{className:"kline",children:[o.jsx("span",{className:"k",children:r.k}),o.jsxs("span",{children:[T.product_code,(Y=T.product)!=null&&Y.name?` · ${T.product.name}`:""]})]}),o.jsx("h1",{id:"finding-title",children:T.name}),o.jsxs("div",{className:"meta",children:[o.jsx("span",{children:T.applicant}),o.jsxs("span",{children:["Cleared ",De(T.decision_date)]}),o.jsx("span",{children:T.clearance_type||"510(k)"}),o.jsx("a",{href:Ac(r.k),target:"_blank",rel:"noreferrer",children:"FDA record ↗"}),T.summary_url&&o.jsx("a",{href:T.summary_url,target:"_blank",rel:"noreferrer",children:"510(k) summary PDF ↗"})]})]}),o.jsxs("div",{className:`verdict tone-${K.tone}`,"data-testid":"verdict",children:[o.jsxs("div",{className:"verdict-label",children:[o.jsx("i",{"aria-hidden":"true"}),K.label]}),o.jsx("p",{className:"verdict-reason",children:r.verdict_reason}),o.jsx("div",{className:"verdict-actions",children:o.jsx("button",{className:"btn btn-line btn-sm",onClick:()=>t("compare",r.k),children:"Compare with other candidates"})}),o.jsxs("div",{className:"authority",children:[o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6","aria-hidden":"true",children:o.jsx("path",{d:"M8 1.5l5.5 2v4.2c0 3.3-2.3 5.8-5.5 6.8-3.2-1-5.5-3.5-5.5-6.8V3.5z M5.5 8l1.8 1.8L10.8 6.3"})}),o.jsxs("span",{children:[o.jsx("b",{children:"Deterministic assessment"})," · ",r.rules_version,". Authoritative within its documented scope: ",I.evidence_scope,", from machine-readable FDA records. A documentation signal, not a safety determination."]})]})]})]}),o.jsx(nh,{a:r}),o.jsxs("div",{className:"coverage-row","aria-label":"Evidence coverage",children:[o.jsxs("span",{className:`chip tone-${I.evidence==="complete"?"calm":I.evidence==="uncertain"?"alert":"muted"}`,title:"Completeness of evidence inside the verdict window",children:["Evidence ",I.evidence]}),(I.evidence_reasons||[]).map(M=>o.jsx("span",{className:"chip tone-muted","data-testid":"evidence-reason",children:Vp[M]||M},M)),o.jsxs("span",{className:"chip",children:[I.ancestors," ancestors · ",I.generations_traversed," generations"]}),I.ancestors_lineage_unknown>0&&o.jsxs("span",{className:"chip tone-muted",children:[I.ancestors_lineage_unknown," with unread summaries"]}),I.doubtful_links>0&&o.jsxs("span",{className:"chip tone-alert",children:[I.doubtful_links," doubtful link(s)"]}),Be>0&&o.jsxs("span",{className:"chip tone-violet",children:[Be," conditional signal(s)"]}),me>0&&o.jsxs("a",{className:"chip tone-blue",href:"#review",onClick:M=>{var C;M.preventDefault(),(C=document.getElementById("review"))==null||C.scrollIntoView({block:"start"})},children:[me," item(s) need human review ↓"]})]})]}),o.jsx(rh,{a:r,onSelect:c}),o.jsxs("section",{className:"panel","aria-labelledby":"graph-title",children:[o.jsxs("div",{className:"panel-head",children:[o.jsxs("h2",{id:"graph-title",children:["Evidence graph ",o.jsxs("span",{className:"count",children:[r.ancestors.length," ancestors · ",r.descendants.length," later devices"]})]}),o.jsxs("div",{className:"graph-tools",children:[o.jsxs("div",{className:"seg",role:"group","aria-label":"View",children:[o.jsx("button",{"aria-pressed":g==="graph",onClick:()=>y("graph"),children:"Graph"}),o.jsx("button",{"aria-pressed":g==="timeline",onClick:()=>y("timeline"),children:"Timeline"})]}),o.jsxs("label",{className:"small muted",children:["Show ",o.jsx("select",{className:"field",value:p,onChange:M=>h(+M.target.value),"aria-label":"Generations shown",children:Array.from({length:d},(M,C)=>C+1).map(M=>o.jsxs("option",{value:M,children:[M," gen"]},M))})]}),o.jsxs("label",{className:"small muted",children:["Query ",o.jsx("select",{className:"field",value:d,onChange:M=>f(+M.target.value),"aria-label":"Generations traversed by the query",children:[2,3,4,5,6].map(M=>o.jsxs("option",{value:M,children:[M," gen"]},M))})]}),g==="graph"&&r.descendants.length>0&&o.jsxs("button",{className:"btn btn-line btn-sm","aria-pressed":k,onClick:()=>L(!k),children:[k?"Hide":"Show"," later devices"]})]})]}),g==="graph"?o.jsx(Gp,{a:r,depth:p,onDepth:h,descendants:k,selected:v,onSelect:c,focusChain:m}):o.jsx(Xp,{a:r,depth:p,highlight:m||((Ze=oo(r))==null?void 0:Ze.chain),onSelect:c}),o.jsxs("p",{className:"graph-hint",children:["By hand, this is ",1+r.ancestors.filter(M=>M.lineage_known).length," summary PDFs opened one generation at a time and ",1+r.ancestors.length," separate recall searches. Here it is one Relate query."]})]}),o.jsxs("div",{className:"grid-main",children:[o.jsxs("div",{style:{minWidth:0},children:[o.jsxs("section",{className:"panel",id:"review","aria-labelledby":"review-title",style:{scrollMarginTop:120},children:[o.jsxs("div",{className:"panel-head",children:[o.jsxs("h2",{id:"review-title",children:["What needs human review ",o.jsx("span",{className:"count",children:me})]}),o.jsx("p",{className:"hint",children:"What conflicts, why it matters, and what to do next."})]}),o.jsx(th,{a:r,onSelect:c,go:t,onFocusChain:w})]}),o.jsx(ih,{a:r,onSelect:c})]}),o.jsxs("aside",{style:{minWidth:0},children:[o.jsx(oh,{a:r,reload:R,go:t,onSelect:c}),o.jsx(ah,{a:r,onSaved:()=>{Oe.assessments(e).then(E),n&&n()}}),o.jsx(uh,{a:r,assessments:S,runs:j,go:t})]})]}),v&&o.jsx(Jp,{sel:v,a:r,onClose:()=>c(null),go:(M,C)=>{c(null),t(M,C)},reload:R,onSelect:c})]})}function ih({a:e,onSelect:t}){const n=e.signals.filter(r=>r.severity==="high"||r.severity==="medium"||r.severity==="low");return o.jsxs("section",{className:"panel","aria-labelledby":"signals-title",children:[o.jsxs("div",{className:"panel-head",children:[o.jsxs("h2",{id:"signals-title",children:["Recall signals ",o.jsxs("span",{className:"count",children:[n.length," in the readable ancestry"]})]}),o.jsx("p",{className:"hint",children:"Every recall record behind the verdict, by generation."})]}),n.length===0&&o.jsx("p",{className:"muted",children:"No recall records anywhere in the readable ancestry."}),n.map((r,l)=>o.jsx(sh,{s:r,onSelect:t},l))]})}function sh({s:e,onSelect:t}){var i;const[n,r]=_.useState(e.severity==="high"),l=e.evidence.filter(s=>s.type==="recall");return o.jsxs("div",{className:"signal",children:[o.jsxs("button",{className:"signal-head","aria-expanded":n,onClick:()=>r(!n),children:[o.jsx("span",{className:`sev sev-${e.severity}`,children:e.conditional?"cond.":e.severity}),o.jsx("span",{className:"t",children:e.title}),o.jsx("svg",{className:"chev",width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",children:o.jsx("path",{d:"M4 2l4 4-4 4",stroke:"currentColor",fill:"none",strokeWidth:"1.5"})})]}),n&&o.jsxs("div",{className:"signal-body",children:[((i=e.chain)==null?void 0:i.length)>1&&o.jsx("div",{className:"tags",children:e.chain.map((s,a)=>o.jsxs(Nl.Fragment,{children:[a>0&&o.jsx("span",{className:"muted small","aria-hidden":"true",children:"→"}),o.jsx("button",{className:"tag-btn",onClick:()=>t({type:"node",k:s}),children:o.jsx("span",{className:"k",children:s})})]},s))}),l.slice(0,6).map(s=>o.jsx(Gc,{r:s},s.id)),l.length>6&&o.jsxs("p",{className:"muted small",children:["+ ",l.length-6," more record(s): open ",e.chain[e.chain.length-1]," for all."]})]})]})}const Ar=(e,t)=>e.review===t&&Ge(e);function oh({a:e,reload:t,go:n,onSelect:r}){const[l,i]=_.useState(null),[s,a]=_.useState(null),u=async(d,f,p)=>{i(d.dst+p),a(null);try{const h=await f();a(p==="ai"?{ok:!0,text:`LLM labelled ${d.dst} "${h.ai_label}" (${h.model.split("/")[1]}, ${h.seconds}s). Advisory only: it is not used for the verdict until a person confirms the citation.`}:null),t()}catch(h){a({ok:!1,text:h.message})}finally{i(null)}};return o.jsxs("section",{className:"panel","aria-labelledby":"cites-title",children:[o.jsx("div",{className:"panel-head",children:o.jsxs("h2",{id:"cites-title",children:["What ",e.k," cites ",o.jsx("span",{className:"count",children:e.citations.length})]})}),o.jsx("p",{className:"lede",children:"Read from its 510(k) summary. Your review is written to the graph and changes every lineage query."}),e.device.lineage_known===!1&&o.jsxs("p",{className:"note-box",children:["Summary not machine-readable (",e.device.summary_status,")."," ",o.jsx("button",{className:"btn btn-quiet btn-sm",onClick:()=>n("ingest",e.k),children:"Try reading it now →"})]}),s&&o.jsx("p",{className:s.ok?"ok":"err",role:"status",children:s.text}),e.citations.map(d=>{const f={...d,src:e.k},p=d.in_lineage??d.kind==="predicate",h=Et(f);return o.jsxs("div",{className:"cit"+(d.review==="rejected"&&Ge(d)?" is-rejected":""),children:[o.jsxs("div",{className:"cit-h",children:[o.jsx("button",{className:"k mono",onClick:()=>r({type:"edge",id:e.k+">"+d.dst,hop:f}),children:d.dst}),o.jsx("span",{className:`chip ${d.kind==="predicate"?"tone-blue":"tone-muted"}`,children:d.kind}),p||h.key==="advisory"||h.key==="retired"?o.jsxs("span",{className:`status status-${h.key}`,title:Re[h.key].label,"data-testid":`cit-status-${d.dst}`,children:[o.jsx("span",{className:"line"}),Re[h.key].short]}):o.jsx("span",{className:"status status-rejected",title:"Reference devices and mentions are not lineage links","data-testid":`cit-status-${d.dst}`,children:"Not a lineage link"}),d.ai_label&&o.jsxs("span",{className:"chip tone-violet",title:d.ai_quote,children:["LLM: ",d.ai_label]}),o.jsxs("span",{className:"muted small",children:[st(d.name,34)," · ",Wc(d.dst_decision_date)]})]}),o.jsx(Kc,{text:d.quote||d.snippet,k:d.dst,ocr:d.text_source&&d.text_source!=="pdf_text_layer"}),o.jsxs("div",{className:"cit-a",children:[o.jsx("button",{className:"btn btn-line btn-sm",disabled:!!l,onClick:()=>u(d,()=>Oe.review(e.k,d.dst,Ar(d,"confirmed")?"":"confirmed"),"ok"),children:Ar(d,"confirmed")?"Unconfirm":"Confirm"}),o.jsx("button",{className:"btn btn-line btn-sm",disabled:!!l,onClick:()=>u(d,()=>Oe.review(e.k,d.dst,Ar(d,"rejected")?"":"rejected"),"no"),children:Ar(d,"rejected")?"Restore":"Reject"}),d.kind!=="predicate"&&o.jsx("button",{className:"btn btn-quiet btn-sm",disabled:!!l,onClick:()=>u(d,()=>Oe.triage(e.k,d.dst),"ai"),children:l===d.dst+"ai"?"Asking…":"Ask LLM to label"}),o.jsxs("button",{className:"btn btn-quiet btn-sm",onClick:()=>r({type:"edge",id:e.k+">"+d.dst,hop:f}),children:["Provenance · p.",d.page]})]})]},d.dst)})]})}function ah({a:e,onSaved:t}){const[n,r]=_.useState(!1),[l,i]=_.useState(""),[s,a]=_.useState(null),[u,d]=_.useState(!1);_.useEffect(()=>{a(null),r(!1),i("")},[e.k]);const f=async()=>{d(!0);try{const h=await Oe.save(e.k,l);a(h),r(!1),i(""),t()}catch(h){a({error:h.message})}finally{d(!1)}},p=e.memo.headline+` - -`+e.memo.paragraphs.map(h=>h.text).join(` - -`);return o.jsxs("section",{className:"panel memo","aria-labelledby":"memo-title",children:[o.jsx("div",{className:"panel-head",children:o.jsx("h2",{id:"memo-title",children:"Due-diligence note"})}),o.jsx("div",{className:"src",children:e.memo.source}),o.jsx("p",{children:o.jsx("b",{children:e.memo.headline})}),e.memo.paragraphs.slice(0,2).map((h,g)=>o.jsx("p",{children:h.text},g)),e.memo.paragraphs.length>2&&o.jsxs("p",{className:"muted small",children:["+ ",e.memo.paragraphs.length-2," more paragraph(s) in the copied note."]}),o.jsxs("div",{className:"cit-a",style:{marginTop:8},children:[o.jsx("button",{className:"btn btn-primary btn-sm",onClick:()=>r(!n),"aria-expanded":n,children:"Save assessment to graph"}),o.jsx("button",{className:"btn btn-line btn-sm",onClick:()=>{var h;return(h=navigator.clipboard)==null?void 0:h.writeText(p)},children:"Copy note"})]}),n&&o.jsxs("div",{style:{marginTop:10,display:"grid",gap:8},children:[o.jsx("label",{className:"small muted",htmlFor:"analyst-note",children:"Optional analyst note, stored with the assessment"}),o.jsx("textarea",{id:"analyst-note",className:"field",rows:3,value:l,onChange:h=>i(h.target.value),maxLength:1e3}),o.jsxs("div",{className:"cit-a",children:[o.jsx("button",{className:"btn btn-primary btn-sm",disabled:u,onClick:f,children:u?"Saving…":"Save to Relate"}),o.jsx("button",{className:"btn btn-quiet btn-sm",onClick:()=>r(!1),children:"Cancel"})]})]}),s&&(s.error?o.jsx("p",{className:"err",children:s.error}):o.jsxs("p",{className:"ok",role:"status",children:["Saved ",s.id,": linked to ",s.flagged_recalls.length," flagged recall record(s)."]}))]})}function uh({a:e,assessments:t,runs:n,go:r}){return o.jsxs("section",{className:"panel","aria-labelledby":"hist-title",children:[o.jsxs("div",{className:"panel-head",children:[o.jsx("h2",{id:"hist-title",children:"Investigation history"}),o.jsx("a",{className:"small",href:"#/history",children:"All history →"})]}),o.jsx("h3",{className:"eyebrow",style:{fontSize:10.5,margin:"0 0 8px"},children:"Saved assessments"}),t.length===0?o.jsxs("p",{className:"muted small",children:["None saved for ",e.k," yet."]}):t.map(l=>{var i,s,a,u,d,f;return o.jsxs("div",{className:"hist",children:[o.jsxs("div",{className:"hist-h",children:[o.jsx("span",{className:"k mono",children:l.id}),o.jsx("span",{className:"muted",children:(i=l.created_at)==null?void 0:i.slice(0,16).replace("T"," ")}),o.jsx("span",{className:`chip tone-${((s=Kn[l.verdict])==null?void 0:s.tone)||"muted"}`,children:((a=Kn[l.verdict])==null?void 0:a.label)||l.verdict})]}),l.stale&&o.jsxs("div",{className:"stale",children:["Stale: the graph changed after this was saved",l.verdict_now!==l.verdict&&o.jsxs(o.Fragment,{children:[" (verdict now ",((u=Kn[l.verdict_now])==null?void 0:u.label)||l.verdict_now,")"]}),((d=l.changed_edges)==null?void 0:d.length)>0&&o.jsxs(o.Fragment,{children:[" · reviewed links: ",l.changed_edges.join(", ")]}),((f=l.reingested)==null?void 0:f.length)>0&&o.jsxs(o.Fragment,{children:[" · re-ingested: ",l.reingested.join(", ")]})]})]},l.id)}),o.jsx("h3",{className:"eyebrow",style:{fontSize:10.5,margin:"16px 0 8px"},children:"Agent runs (optional)"}),o.jsx("p",{className:"muted small",style:{margin:"0 0 6px"},children:"Machine findings, never human-approved. The verdict above does not depend on them."}),n.length===0?o.jsxs("p",{className:"muted small",children:["No agent runs examined ",e.k," in this store."]}):n.map(l=>o.jsxs("div",{className:"hist",children:[o.jsxs("div",{className:"hist-h",children:[o.jsx("span",{className:"k mono",children:l.id}),o.jsx("span",{className:"chip",children:l.status}),l.stale&&o.jsx("span",{className:"stale",children:"stale"}),o.jsx("a",{href:Sp(l.id),target:"_blank",rel:"noreferrer",children:"Report ↗"})]}),o.jsx("div",{className:"muted",children:(l.request||"").slice(0,110)})]},l.id))]})}function ch({go:e,stats:t}){const n=[["K252078","BreathePal Bilevel","Cleared 2026 · direct predicate under a Class I design recall"],["K251770","SleepRes PAP System","Cleared 2025 · a second real lineage"],["K200480","DreamStation 2","Cleared 2020, before the June 2021 recall began"]];return o.jsxs("div",{className:"home-hero",children:[o.jsxs("div",{className:"page-head",children:[o.jsx("p",{className:"eyebrow",children:"Investigate"}),o.jsx("h1",{children:"Check a predicate's ancestry before you cite it."}),o.jsxs("p",{children:["Search any clearance above (press ",o.jsx("code",{children:"/"}),"), or open one of the real cases in the shipped dataset of CPAP, BiPAP and ventilator clearances."]})]}),o.jsxs("div",{className:"home-cases",children:[n.map(([r,l,i])=>o.jsxs("button",{className:"case",onClick:()=>e("check",r),children:[o.jsx("span",{className:"k mono",children:r}),o.jsx("h3",{children:l}),o.jsx("p",{children:i})]},r)),o.jsxs("button",{className:"case",onClick:()=>e("reach","88058,88071"),children:[o.jsx("span",{className:"k mono",children:"Recall 88058 + 88071"}),o.jsx("h3",{children:"Philips foam recall reach"}),o.jsx("p",{children:"Who descends from the June 2021 recall?"})]})]}),t&&o.jsxs("p",{className:"muted small",style:{marginTop:18},children:[t.nodes.Device.toLocaleString("en-US")," clearances · ",t.citations_by_kind.predicate.toLocaleString("en-US")," predicate links · ",t.nodes.Recall.toLocaleString("en-US")," recall records in the Relate store."]})]})}const dh={compare:_.lazy(()=>Mt(()=>import("./Views-Dyqeayth.js"),[]).then(e=>({default:e.CompareView}))),reach:_.lazy(()=>Mt(()=>import("./Views-Dyqeayth.js"),[]).then(e=>({default:e.ReachView}))),watch:_.lazy(()=>Mt(()=>import("./Views-Dyqeayth.js"),[]).then(e=>({default:e.WatchlistView}))),ingest:_.lazy(()=>Mt(()=>import("./Views-Dyqeayth.js"),[]).then(e=>({default:e.IngestView}))),history:_.lazy(()=>Mt(()=>import("./History-DPVVy-wq.js"),[])),method:_.lazy(()=>Mt(()=>import("./Views-Dyqeayth.js"),[]).then(e=>({default:e.MethodView})))},fh={check:o.jsx("path",{d:"M11 11l4 4M7 12.5A5.5 5.5 0 107 1.5a5.5 5.5 0 000 11z"}),compare:o.jsx("path",{d:"M2 3h5v10H2zM9 3h5v10H9z"}),reach:o.jsx("path",{d:"M3 8a5 5 0 1010 0A5 5 0 003 8zm3 0a2 2 0 104 0 2 2 0 00-4 0z"}),watch:o.jsx("path",{d:"M1.5 8S4 3 8 3s6.5 5 6.5 5S12 13 8 13 1.5 8 1.5 8zM8 10a2 2 0 100-4 2 2 0 000 4z"}),ingest:o.jsx("path",{d:"M8 2v8m0 0l-3-3m3 3l3-3M2 12v2h12v-2"}),history:o.jsx("path",{d:"M8 4v4l2.5 2M2.5 8a5.5 5.5 0 105.5-5.5A5.6 5.6 0 003 6M3 2.5V6h3.5"}),method:o.jsx("path",{d:"M3 2h7l3 3v9H3zM10 2v3h3M5.5 8h5M5.5 11h5"})},ph=({name:e})=>o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:fh[e]}),hh=[["Investigate",[["check","Predicate check"],["compare","Compare predicates"]]],["Recall evidence",[["reach","Recall reach"],["watch","Watchlist"]]],["Graph",[["ingest","Add a clearance"],["history","History"],["method","Method"]]]];function mh({route:e,go:t,stats:n,statsErr:r,refreshStats:l,onReplay:i}){var u,d;const s=_.useRef(null);_.useEffect(()=>{var f;(f=s.current)==null||f.focus({preventScroll:!0})},[e.tab]);const a=dh[e.tab];return o.jsxs("div",{className:"ws",children:[o.jsxs("header",{className:"ws-top",children:[o.jsx("a",{className:"brand",href:"#/","aria-label":"Forebear home: the film",children:o.jsx(_p,{size:24})}),o.jsx(vh,{go:t}),o.jsx("span",{className:"spacer"}),o.jsxs("div",{className:"store-chip",title:"Live counts from the Relate single-file store",children:[o.jsx("i",{className:"dot"+(r?" off":""),"aria-hidden":"true"}),n?o.jsxs("span",{className:"counts",children:[o.jsx("b",{children:(u=n.nodes.Device)==null?void 0:u.toLocaleString("en-US")})," devices · ",o.jsx("b",{children:(d=n.nodes.Recall)==null?void 0:d.toLocaleString("en-US")})," recalls · Relate"]}):o.jsx("span",{children:r?"API unavailable":"Connecting…"})]})]}),o.jsxs("nav",{className:"ws-rail","aria-label":"Workspace",children:[hh.map(([f,p])=>o.jsxs(Nl.Fragment,{children:[o.jsx("div",{className:"group",children:f}),p.map(([h,g])=>o.jsxs("a",{href:`#/${h}`,"aria-current":e.tab===h?"page":void 0,children:[o.jsx(ph,{name:h}),g]},h))]},f)),o.jsxs("div",{className:"rail-foot",children:["Verdicts are deterministic documentation signals from FDA records, not safety findings.",!matchMedia("(prefers-reduced-motion: reduce)").matches&&o.jsx("div",{style:{marginTop:10},children:o.jsx("button",{onClick:i,children:"Replay the film"})})]})]}),o.jsxs("main",{className:"ws-main",id:"main",ref:s,tabIndex:-1,style:{outline:"none"},children:[e.tab==="check"&&(e.arg?o.jsx(lh,{k:e.arg.toUpperCase(),go:t,onChanged:l}):o.jsx(ch,{go:t,stats:n})),a&&o.jsx(_.Suspense,{fallback:o.jsxs("div",{className:"loading-thread",children:[o.jsx("i",{}),"Loading…"]}),children:o.jsx(a,{initial:e.arg,go:t,onChanged:l,stats:n})}),!a&&e.tab!=="check"&&o.jsx("div",{className:"panel",children:o.jsxs("p",{children:["Unknown page. ",o.jsx("a",{href:"#/check",children:"Go to the workspace →"})]})}),o.jsx("footer",{className:"ws-foot",children:"Public FDA data: openFDA 510(k), recall and enforcement records; 510(k) summary PDFs. Forebear reports documented lineage and recall history; it does not judge device safety. Not regulatory advice."})]})]})}function vh({go:e}){const[t,n]=_.useState(""),[r,l]=_.useState([]),[i,s]=_.useState(!1),[a,u]=_.useState(0),d=_.useRef(null),f=_.useRef(null);_.useEffect(()=>{if(clearTimeout(f.current),t.trim().length<2){l([]);return}let g=!0;return f.current=setTimeout(()=>Oe.search(t).then(y=>{g&&(l(y),u(0))}).catch(()=>g&&l([])),160),()=>{g=!1}},[t]),_.useEffect(()=>{const g=y=>{var k,L;y.key==="/"&&!/INPUT|TEXTAREA|SELECT/.test((k=document.activeElement)==null?void 0:k.tagName)&&(y.preventDefault(),(L=d.current)==null||L.focus())};return addEventListener("keydown",g),()=>removeEventListener("keydown",g)},[]);const p=g=>{var y;s(!1),n(""),(y=d.current)==null||y.blur(),e("check",g)},h=i&&r.length>0;return o.jsxs("div",{className:"search",role:"search",children:[o.jsx("svg",{className:"icon",width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6","aria-hidden":"true",children:o.jsx("path",{d:"M11 11l4 4M7 12.5A5.5 5.5 0 107 1.5a5.5 5.5 0 000 11z"})}),o.jsx("input",{ref:d,className:"field",value:t,placeholder:"Search a device or K-number","aria-label":"Search devices by name or K-number",role:"combobox","aria-expanded":h,"aria-controls":"search-results","aria-activedescendant":h?`sr-${a}`:void 0,"aria-autocomplete":"list",onChange:g=>{n(g.target.value),s(!0)},onFocus:()=>s(!0),onBlur:()=>setTimeout(()=>s(!1),150),onKeyDown:g=>{if(g.key==="ArrowDown")g.preventDefault(),u(y=>Math.min(y+1,r.length-1));else if(g.key==="ArrowUp")g.preventDefault(),u(y=>Math.max(y-1,0));else if(g.key==="Escape")s(!1),g.currentTarget.blur();else if(g.key==="Enter"){const y=t.trim().toUpperCase();/^K\d{6}$/.test(y)?p(y):r[a]&&p(r[a].k)}}}),!t&&o.jsx("kbd",{"aria-hidden":"true",children:"/"}),h&&o.jsx("ul",{className:"search-results",id:"search-results",role:"listbox",children:r.map((g,y)=>o.jsxs("li",{id:`sr-${y}`,role:"option","aria-selected":y===a,onMouseDown:()=>p(g.k),onMouseEnter:()=>u(y),children:[o.jsxs("span",{children:[o.jsx("span",{className:"k",children:g.k})," ",g.name]}),o.jsxs("small",{children:[g.applicant," · ",g.decision_date," · ",g.product_code]})]},g.k))})]})}const gh=_.lazy(()=>Mt(()=>import("./Landing-mM6lZWLo.js"),[])),yh={about:"method"};function Or(e=window.location.hash){if(!e.startsWith("#/"))return{tab:"film",arg:""};const t=e.replace(/^#\/?/,"");if(!t)return{tab:"film",arg:""};const[n,...r]=t.split("/");return{tab:yh[n]||n||"film",arg:decodeURIComponent(r.join("/")||"")}}const xh=(e,t)=>e==="film"?"#/":`#/${e}${t?"/"+t:""}`;function wh(){const[e,t]=_.useState(Or),[n,r]=_.useState(null),[l,i]=_.useState(null),s=Rp("(prefers-reduced-motion: reduce)"),[a,u]=_.useState(()=>e.tab==="film"&&!Cp()&&!matchMedia("(prefers-reduced-motion: reduce)").matches),[d,f]=_.useState(a?"pending":"none");_.useEffect(()=>{document.documentElement.dataset.motion=s?"reduced":"full"},[s]),_.useEffect(()=>{const y=()=>t(Or());return addEventListener("hashchange",y),()=>removeEventListener("hashchange",y)},[]);const p=_.useCallback((y=0)=>Oe.stats().then(k=>{r(k),i(null)}).catch(k=>{y<5?setTimeout(()=>p(y+1),800*(y+1)):i(k.message)}),[]);_.useEffect(()=>{p()},[p]),_.useEffect(()=>{const y={film:"Forebear · Every clearance has a past",check:e.arg?`${e.arg} · Forebear`:"Investigate · Forebear",compare:"Compare predicates · Forebear",reach:"Recall reach · Forebear",watch:"Watchlist · Forebear",ingest:"Add a clearance · Forebear",history:"History · Forebear",method:"Method · Forebear"};document.title=y[e.tab]||"Forebear"},[e]);const h=_.useCallback((y,k="",L={})=>{const v=xh(y,k),c=()=>{history.pushState(null,"",v),t(Or(v)),window.scrollTo(0,0)};L.transition&&!s&&document.startViewTransition?document.startViewTransition(()=>Fc.flushSync(c)):c()},[s]);_.useEffect(()=>{const y=()=>t(Or());return addEventListener("popstate",y),()=>removeEventListener("popstate",y)},[]);const g=()=>{Pp(),e.tab!=="film"&&h("film"),window.scrollTo(0,0),s||(f("pending"),u(!0))};return o.jsxs(o.Fragment,{children:[o.jsx("a",{className:"skip-link",href:"#main",onClick:y=>{var k;y.preventDefault(),(k=document.getElementById("main"))==null||k.focus()},children:"Skip to content"}),a&&o.jsx(Lp,{onDone:()=>{f("bloom"),setTimeout(()=>u(!1),700),requestAnimationFrame(()=>{var y;return(y=document.getElementById("hero-title"))==null?void 0:y.focus({preventScroll:!0})})}}),o.jsx("div",{inert:a&&d==="pending"?"":void 0,style:{display:"contents"},children:e.tab==="film"?o.jsx(_.Suspense,{fallback:o.jsx("div",{style:{minHeight:"100vh"}}),children:o.jsx(gh,{go:h,stats:n,introDone:d,reduced:s})}):o.jsx(mh,{route:e,go:h,stats:n,statsErr:l,refreshStats:p,onReplay:g})})]})}Ic(document.getElementById("root")).render(o.jsx(wh,{}));export{Qc as A,kh as E,Oc as M,fi as P,Nl as R,jh as T,Kn as V,_p as W,Mt as _,Vp as a,ka as b,Oe as c,Sp as d,De as f,o as j,wa as m,Ip as p,_ as r,Rp as u,Up as v}; diff --git a/web/dist/assets/index-CVW0ffI2.css b/web/dist/assets/index-DIORaQow.css similarity index 93% rename from web/dist/assets/index-CVW0ffI2.css rename to web/dist/assets/index-DIORaQow.css index 5bdc04a..b062d1a 100644 --- a/web/dist/assets/index-CVW0ffI2.css +++ b/web/dist/assets/index-DIORaQow.css @@ -1 +1 @@ -@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2) format("woff2-variations");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2) format("woff2-variations");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2) format("woff2-variations");unicode-range:U+1F00-1FFF}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/inter-greek-wght-normal-CkhJZR-_.woff2) format("woff2-variations");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2) format("woff2-variations");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2) format("woff2-variations");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/inter-latin-wght-normal-Dx4kXJAl.woff2) format("woff2-variations");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Newsreader Variable;font-style:normal;font-display:swap;font-weight:200 800;src:url(/assets/newsreader-vietnamese-wght-normal-Czsa-EzN.woff2) format("woff2-variations");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Newsreader Variable;font-style:normal;font-display:swap;font-weight:200 800;src:url(/assets/newsreader-latin-ext-wght-normal-C-3rgBeH.woff2) format("woff2-variations");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Newsreader Variable;font-style:normal;font-display:swap;font-weight:200 800;src:url(/assets/newsreader-latin-wght-normal-CCVVNp6i.woff2) format("woff2-variations");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Newsreader Variable;font-style:italic;font-display:swap;font-weight:200 800;src:url(/assets/newsreader-vietnamese-wght-italic-xAqemagA.woff2) format("woff2-variations");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Newsreader Variable;font-style:italic;font-display:swap;font-weight:200 800;src:url(/assets/newsreader-latin-ext-wght-italic-DFS986qL.woff2) format("woff2-variations");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Newsreader Variable;font-style:italic;font-display:swap;font-weight:200 800;src:url(/assets/newsreader-latin-wght-italic-Bxi8ein9.woff2) format("woff2-variations");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}:root{--night-0: #070c17;--night-1: #0b1322;--night-2: #101a2e;--night-3: #16233b;--night-4: #1e2e4b;--rule: rgba(236, 228, 210, .09);--rule-2: rgba(236, 228, 210, .16);--ivory: #f1ebdd;--ivory-2: #e6dcc7;--paper: #f6f1e5;--paper-ink: #22252b;--paper-mute: #6c6656;--ink: #ece6d8;--ink-2: rgba(236, 230, 216, .74);--ink-3: rgba(236, 230, 216, .64);--ink-4: rgba(236, 230, 216, .55);--blue: #7fa2ff;--blue-2: #5b82f0;--blue-soft: rgba(127, 162, 255, .14);--amber: #e7a948;--amber-2: #c98a2c;--amber-soft: rgba(231, 169, 72, .14);--alert: #e98a6f;--alert-soft: rgba(233, 138, 111, .14);--sage: #8fc1a3;--sage-soft: rgba(143, 193, 163, .14);--violet: #b7a4f5;--serif: "Newsreader Variable", "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;--sans: "Inter Variable", "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;--mono: "Cascadia Mono", "SFMono-Regular", ui-monospace, Consolas, monospace;--r-s: 6px;--r-m: 10px;--r-l: 16px;--ease-out: cubic-bezier(.16, 1, .3, 1);--ease-io: cubic-bezier(.65, 0, .35, 1);--shadow: 0 18px 50px -20px rgba(0, 0, 0, .6), 0 2px 8px rgba(0, 0, 0, .25);color-scheme:dark;font-family:var(--sans);font-feature-settings:"cv11","ss01"}*{box-sizing:border-box}html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}@media (prefers-reduced-motion: reduce){html{scroll-behavior:auto}}body{margin:0;background:var(--night-1);color:var(--ink);font-size:14px;line-height:1.5;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}::selection{background:#7fa2ff59;color:#fff}a{color:var(--blue);text-decoration:none;text-underline-offset:3px}a:hover{text-decoration:underline}button,input,select,textarea{font:inherit;color:inherit}:focus-visible{outline:2px solid var(--blue);outline-offset:2px;border-radius:4px}q{quotes:"“" "”"}code{font-family:var(--mono);font-size:.92em;background:var(--night-3);padding:1px 5px;border-radius:4px}.k,.mono{font-family:var(--mono);font-variant-numeric:tabular-nums slashed-zero;letter-spacing:-.01em}.num{font-variant-numeric:tabular-nums}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}.skip-link{position:fixed;left:12px;top:-60px;z-index:200;background:var(--ivory);color:var(--night-1);padding:8px 14px;border-radius:var(--r-s);font-weight:600;transition:top .2s}.skip-link:focus{top:12px}.muted{color:var(--ink-3)}.small{font-size:12px}.mark{display:block;overflow:visible}.mark-thread{stroke:var(--blue);stroke-width:1.6;stroke-linecap:round}.mark-node{fill:var(--ivory)}.mark-node.past{fill:var(--amber)}.wordmark{display:inline-flex;align-items:center;gap:10px}.wordmark-name{font-family:var(--serif);font-size:21px;font-weight:500;letter-spacing:-.01em;color:var(--ivory)}.btn{display:inline-flex;align-items:center;gap:8px;border:1px solid transparent;border-radius:999px;padding:8px 16px;font-weight:560;font-size:13.5px;cursor:pointer;white-space:nowrap;transition:background .2s var(--ease-out),border-color .2s,color .2s,transform .2s var(--ease-out);text-decoration:none!important}.btn:active{transform:translateY(1px)}.btn-primary{background:var(--ivory);color:var(--night-1)}.btn-primary:hover{background:#fff}.btn-line{border-color:var(--rule-2);color:var(--ink);background:transparent}.btn-line:hover{border-color:var(--ink-3);background:#ffffff08}.btn-quiet{background:transparent;color:var(--ink-2);padding:6px 10px;border-radius:var(--r-s)}.btn-quiet:hover{color:var(--ink);background:var(--night-3)}.btn-sm{padding:5px 11px;font-size:12.5px}.btn:disabled{opacity:.45;cursor:default}.btn .arr{transition:transform .25s var(--ease-out)}.btn:hover .arr{transform:translate(3px)}.field{width:100%;background:var(--night-2);border:1px solid var(--rule-2);border-radius:var(--r-m);padding:10px 14px;color:var(--ink);transition:border-color .2s,background .2s}.field::placeholder{color:var(--ink-4)}.field:focus{outline:none;border-color:var(--blue);background:var(--night-3)}select.field{padding:6px 10px;width:auto}.chip{display:inline-flex;align-items:center;gap:6px;font-size:11.5px;font-weight:560;line-height:1;padding:5px 9px;border-radius:999px;background:var(--night-3);color:var(--ink-2);white-space:nowrap}.chip .glyph{width:8px;height:8px;border-radius:50%;background:currentColor;flex:none}.chip.tone-design,.chip.tone-amber,.chip.tone-class1{background:var(--amber-soft);color:var(--amber)}.chip.tone-other{background:var(--night-3);color:var(--ink-2)}.chip.tone-alert{background:var(--alert-soft);color:var(--alert)}.chip.tone-calm{background:var(--sage-soft);color:var(--sage)}.chip.tone-blue{background:var(--blue-soft);color:var(--blue)}.chip.tone-muted{background:var(--night-3);color:var(--ink-3)}.chip.tone-violet{background:#b7a4f524;color:var(--violet)}.status{display:inline-flex;align-items:center;gap:7px;font-size:11.5px;font-weight:560;white-space:nowrap}.status .line{width:22px;height:0;border-top:2px solid currentColor;flex:none}.status-confirmed{color:var(--sage)}.status-extracted{color:var(--blue)}.status-disputed{color:var(--alert)}.status-disputed .line{border-top-style:dashed}.status-conditional{color:var(--violet)}.status-conditional .line{border-top-style:dotted;border-top-width:3px}.status-rejected{color:var(--ink-4)}.status-rejected .line{border-top-style:dashed;opacity:.6}.status-advisory{color:var(--violet)}.status-advisory .line{border-top-style:dotted;opacity:.7}.status-retired{color:var(--ink-4)}.status-retired .line{border-top-style:dotted;opacity:.4}.intro{position:fixed;top:0;right:0;bottom:0;left:0;z-index:100;display:grid;place-items:center;background:radial-gradient(ellipse at 50% 46%,#101b31 0%,var(--night-0) 70%);transition:opacity .55s var(--ease-io),visibility .55s}.intro.is-leaving{opacity:0;visibility:hidden;pointer-events:none}.intro-lockup{display:grid;justify-items:center;gap:22px;transform:translateY(-2vh)}.intro-mark{width:116px;height:116px}.intro-mark .mark-thread{stroke-dasharray:1;stroke-dashoffset:1;animation:draw .62s var(--ease-out) forwards;stroke-width:1.1}.intro-mark .mark-node{transform-box:fill-box;transform-origin:center;transform:scale(0);opacity:0;animation:pop .55s var(--ease-out) forwards}.intro-mark .n0{animation-delay:.05s}.intro-mark .n2{animation-delay:.22s}.intro-mark .n4{animation-delay:.39s}.intro-mark .n1{animation-delay:.62s}.intro-mark .n3{animation-delay:.74s}.intro-mark .t1{animation-delay:.4s}.intro-mark .t3{animation-delay:.58s}.intro-mark .t0{animation-delay:.8s}.intro-mark .t2{animation-delay:.92s}.intro-mark .mark-node.past{animation:pop .55s var(--ease-out) .39s forwards,ember 1.6s ease-in-out 1.15s 1}.intro-word{font-family:var(--serif);font-size:clamp(34px,6vw,52px);font-weight:420;letter-spacing:-.02em;color:var(--ivory);display:flex;overflow:hidden}.intro-word span{display:inline-block;transform:translateY(105%);animation:rise .8s var(--ease-out) forwards}.intro-tag{font-family:var(--serif);font-style:italic;font-size:clamp(17px,2.4vw,22px);color:var(--ink-2);margin:0;overflow:hidden}.intro-tag span{display:inline-block;opacity:0;transform:translateY(40%);animation:fadeRise .9s var(--ease-out) 1.55s forwards}.intro-tag em{color:var(--amber);font-style:italic}.intro-skip{position:absolute;right:22px;bottom:22px}@keyframes draw{to{stroke-dashoffset:0}}@keyframes pop{to{transform:scale(1);opacity:1}}@keyframes rise{to{transform:translateY(0)}}@keyframes fadeRise{to{opacity:1;transform:none}}@keyframes ember{0%,to{filter:none}45%{filter:drop-shadow(0 0 6px rgba(231,169,72,.9))}}.film{position:relative}.film-stage{position:fixed;top:0;right:0;bottom:0;left:0;z-index:0;pointer-events:none}.film-stage canvas{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;opacity:0;transition:opacity 1.2s var(--ease-io)}.film-stage canvas.is-live{opacity:1}.film-fallback{position:absolute;top:0;right:0;bottom:0;left:0;background:radial-gradient(1200px 700px at 72% 30%,rgba(91,130,240,.1),transparent 60%),radial-gradient(900px 600px at 15% 85%,rgba(231,169,72,.05),transparent 60%),var(--night-1)}.film-fallback svg{position:absolute;right:6vw;top:18vh;width:min(46vw,560px);opacity:.5}.film-vignette{position:absolute;top:0;right:0;bottom:0;left:0;background:radial-gradient(ellipse at 50% 50%,transparent 55%,rgba(4,7,14,.55) 100%)}.film>main,.film>footer{position:relative;z-index:1}.film-top{position:fixed;top:0;left:0;right:0;z-index:30!important;display:flex;align-items:center;gap:16px;padding:16px clamp(16px,4vw,44px);transition:background .4s,backdrop-filter .4s,border-color .4s;border-bottom:1px solid transparent}.film-top.is-solid{background:#090f1bb8;-webkit-backdrop-filter:blur(14px) saturate(1.2);backdrop-filter:blur(14px) saturate(1.2);border-color:var(--rule)}.film-top .spacer{flex:1}.film-top nav{display:flex;gap:4px}.film-top nav a{color:var(--ink-2);font-size:13px;padding:6px 10px;border-radius:var(--r-s)}.film-top nav a:hover{color:var(--ink);text-decoration:none;background:#ffffff0a}.hero{position:relative;min-height:100svh;display:grid;align-content:center;padding:96px clamp(16px,6vw,88px) 72px;max-width:1240px}.eyebrow{font-size:12px;letter-spacing:.14em;text-transform:uppercase;color:var(--ink-3);font-weight:600;margin:0 0 22px;display:flex;gap:12px;align-items:center}.eyebrow:before{content:"";width:28px;height:1px;background:var(--blue)}.hero h1{font-family:var(--serif);font-weight:380;font-size:clamp(42px,6.4vw,86px);line-height:.98;letter-spacing:-.035em;margin:0;max-width:11.5ch;color:var(--ivory)}.hero h1 em{font-style:italic;color:var(--amber);font-weight:360}.hero-lede{font-size:clamp(16px,1.6vw,19px);line-height:1.55;color:var(--ink-2);max-width:40em;margin:28px 0 0}.hero-lede b{color:var(--ink);font-weight:600}.hero-actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:34px;align-items:center}.hero-proof{animation:fadeIn .6s var(--ease-out);display:flex;gap:clamp(20px,4vw,48px);flex-wrap:wrap;margin-top:40px;padding-top:24px;border-top:1px solid var(--rule);max-width:760px}.hero-proof div{display:grid;gap:2px}.hero-proof b{font-family:var(--serif);font-size:30px;font-weight:400;color:var(--ivory);font-variant-numeric:tabular-nums}.hero-proof span{font-size:12px;color:var(--ink-3)}.chapter{min-height:150svh;display:flex;align-items:center;padding:0 clamp(16px,6vw,88px)}.chapter.place-left{justify-content:flex-start}.chapter.place-right{justify-content:flex-end}.chapter-copy{max-width:460px;padding:30px 0}.chapter-label{display:flex;gap:14px;align-items:baseline;font-size:12px;letter-spacing:.14em;text-transform:uppercase;color:var(--ink-3);font-weight:600;margin:0 0 18px}.chapter-label span{font-family:var(--mono);color:var(--blue);letter-spacing:0}.chapter-statement{font-family:var(--serif);font-weight:380;font-size:clamp(34px,4.6vw,58px);line-height:1.02;letter-spacing:-.03em;margin:0 0 22px;color:var(--ivory)}.chapter-statement em{font-style:italic;color:var(--amber)}.chapter-body{font-size:16px;line-height:1.65;color:var(--ink-2);margin:0 0 18px}.chapter-body b{color:var(--ink);font-weight:600}.chapter-foot{font-size:12.5px;color:var(--ink-3);margin:0;padding-left:14px;border-left:1px solid var(--rule-2)}.ln{display:block;overflow:hidden;padding-bottom:.06em}.ln>span{display:inline-block;transform:translateY(110%);transition:transform 1s var(--ease-out)}.reveal .chapter-body,.reveal .chapter-foot,.reveal .doc,.reveal .fact-row{opacity:0;transform:translateY(14px);transition:opacity .9s var(--ease-out) .18s,transform .9s var(--ease-out) .18s}.reveal.in-frame .ln>span{transform:none}.reveal.in-frame .ln:nth-child(2)>span{transition-delay:.08s}.reveal.in-frame .chapter-body,.reveal.in-frame .chapter-foot,.reveal.in-frame .doc,.reveal.in-frame .fact-row{opacity:1;transform:none}html[data-film=off] .ln>span,html[data-motion=reduced] .ln>span{transform:none;transition:none}html[data-film=off] .reveal *,html[data-motion=reduced] .reveal *{opacity:1!important;transform:none!important;transition:none!important}.doc{background:var(--paper);color:var(--paper-ink);border-radius:4px;padding:18px 20px 16px;box-shadow:var(--shadow);font-family:var(--serif);font-size:15.5px;line-height:1.5;margin:22px 0 18px;position:relative}.doc:before{content:"";position:absolute;inset:0 auto 0 0;width:3px;background:var(--blue-2);border-radius:4px 0 0 4px}.doc-meta{font-family:var(--sans);font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--paper-mute);display:flex;justify-content:space-between;gap:12px;margin-bottom:8px}.doc mark{background:#5b82f029;color:#1d3f9e;padding:0 2px;border-radius:2px;font-family:var(--mono);font-size:.9em}.doc a{color:#2d56c4;font-family:var(--sans);font-size:12px}.fact-row{display:flex;gap:18px;flex-wrap:wrap;margin:14px 0 18px}.fact{display:grid;gap:2px}.fact b{font-family:var(--serif);font-size:24px;font-weight:400;color:var(--ivory);font-variant-numeric:tabular-nums}.fact span{font-size:11.5px;color:var(--ink-3)}.fact.amber b{color:var(--amber)}.handoff{min-height:120svh;display:grid;align-content:end;padding-bottom:16svh!important;justify-items:center;text-align:center;padding:0 20px}.handoff p.lead{font-family:var(--serif);font-weight:380;font-size:clamp(30px,4.4vw,54px);line-height:1.06;letter-spacing:-.03em;margin:0 0 30px;color:var(--ivory)}.handoff p.lead em{color:var(--blue);font-style:italic}.handoff .sub{color:var(--ink-3);font-size:13px;margin-top:18px;max-width:520px}.paths{padding:40px clamp(16px,6vw,88px) 60px;max-width:1240px;margin:0 auto}.paths h2{font-family:var(--serif);font-weight:400;font-size:28px;letter-spacing:-.02em;margin:0 0 20px}.path-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:14px}.path-card{background:#101a2ec7;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);border:1px solid var(--rule);border-radius:var(--r-l);padding:20px;color:var(--ink);text-decoration:none!important;display:grid;gap:8px;transition:border-color .25s,transform .3s var(--ease-out),background .25s}.path-card:hover{border-color:var(--rule-2);transform:translateY(-2px);background:#16233bd9}.path-card .k{color:var(--blue);font-size:12px}.path-card h3{margin:0;font-family:var(--serif);font-weight:450;font-size:20px;letter-spacing:-.01em}.path-card p{margin:0;color:var(--ink-3);font-size:13px}.film-index{position:fixed;right:clamp(10px,2vw,24px);top:50%;transform:translateY(-50%);z-index:20!important;display:grid;gap:10px}.film-index a{display:flex;align-items:center;justify-content:flex-end;gap:10px;color:var(--ink-4);font-size:11px;letter-spacing:.08em;text-transform:uppercase;text-decoration:none!important}.film-index a i{width:6px;height:6px;border-radius:50%;border:1px solid currentColor;transition:background .3s,transform .3s}.film-index a span{opacity:0;transform:translate(6px);transition:opacity .3s,transform .3s}.film-index a:hover span,.film-index a:focus-visible span,.film-index a.on span{opacity:1;transform:none}.film-index a.on{color:var(--ink)}.film-index a.on i{background:var(--blue);border-color:var(--blue);transform:scale(1.3)}@media (max-width: 860px){.film-index{display:none}}.film-foot{padding:30px clamp(16px,6vw,88px) 40px;border-top:1px solid var(--rule);display:flex;gap:20px;flex-wrap:wrap;justify-content:space-between;color:var(--ink-3);font-size:12px;background:linear-gradient(transparent,#070c17cc)}.film-foot p{margin:0;max-width:640px}html[data-film=off] .chapter{min-height:auto;padding-top:60px;padding-bottom:60px}html[data-film=off] .handoff{min-height:60svh}@media (max-width: 860px){.chapter{min-height:130svh;justify-content:flex-start!important;align-items:flex-end;padding-bottom:12svh}.chapter-copy{background:#090f1bd1;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border:1px solid var(--rule);border-radius:var(--r-l);padding:22px;max-width:none}.film-top nav{display:none}.hero{padding-top:100px}}.ws{min-height:100vh;display:grid;grid-template-columns:232px minmax(0,1fr);grid-template-rows:auto 1fr;background:radial-gradient(1400px 600px at 80% -10%,rgba(91,130,240,.07),transparent 60%),var(--night-1)}.ws-top{grid-column:1 / -1;position:sticky;top:0;z-index:40;display:flex;align-items:center;gap:16px;padding:10px 20px;background:#090f1bd1;-webkit-backdrop-filter:blur(14px) saturate(1.2);backdrop-filter:blur(14px) saturate(1.2);border-bottom:1px solid var(--rule)}.ws-top .brand{display:flex;align-items:center;gap:10px;color:var(--ivory);text-decoration:none!important}.ws-top .brand .wordmark-name{font-size:19px}.ws-top .spacer{flex:1}.store-chip{display:flex;gap:12px;align-items:center;font-size:12px;color:var(--ink-3)}.store-chip b{color:var(--ink-2);font-weight:600;font-variant-numeric:tabular-nums}.store-chip .dot{width:7px;height:7px;border-radius:50%;background:var(--sage);box-shadow:0 0 0 3px var(--sage-soft)}.store-chip .dot.off{background:var(--alert);box-shadow:0 0 0 3px var(--alert-soft)}.search{position:relative;flex:0 1 460px;min-width:200px}.search .field{padding:8px 12px 8px 34px;border-radius:999px;font-size:13px}.search .icon{position:absolute;left:12px;top:50%;transform:translateY(-50%);color:var(--ink-4);pointer-events:none}.search kbd{position:absolute;right:10px;top:50%;transform:translateY(-50%);font-family:var(--mono);font-size:11px;color:var(--ink-4);border:1px solid var(--rule-2);border-radius:4px;padding:0 5px}.search-results{position:absolute;z-index:50;top:calc(100% + 6px);left:0;right:0;background:var(--night-2);border:1px solid var(--rule-2);border-radius:var(--r-m);list-style:none;margin:0;padding:6px;box-shadow:var(--shadow);max-height:60vh;overflow:auto}.search-results li{padding:8px 10px;border-radius:var(--r-s);cursor:pointer;display:grid;gap:1px}.search-results li[aria-selected=true],.search-results li:hover{background:var(--night-3)}.search-results li .k{color:var(--blue);font-size:12px}.search-results li span{font-size:13px}.search-results li small{color:var(--ink-3);font-size:11.5px}.ws-rail{position:sticky;top:57px;align-self:start;height:calc(100vh - 57px);padding:18px 12px;border-right:1px solid var(--rule);display:flex;flex-direction:column;gap:2px;overflow-y:auto}.ws-rail .group{font-size:10.5px;letter-spacing:.14em;text-transform:uppercase;color:var(--ink-4);font-weight:600;padding:14px 10px 6px}.ws-rail a{display:flex;align-items:center;gap:10px;color:var(--ink-2);padding:8px 10px;border-radius:var(--r-s);font-size:13.5px;text-decoration:none!important;transition:background .15s,color .15s}.ws-rail a svg{flex:none;opacity:.7}.ws-rail a:hover{background:var(--night-2);color:var(--ink)}.ws-rail a[aria-current=page]{background:var(--night-3);color:var(--ivory)}.ws-rail a[aria-current=page] svg{opacity:1;color:var(--blue)}.ws-rail .rail-foot{margin-top:auto;padding:14px 10px 4px;font-size:11.5px;color:var(--ink-4);line-height:1.5;border-top:1px solid var(--rule)}.ws-rail .rail-foot button{background:none;border:0;color:var(--ink-3);padding:0;cursor:pointer;text-decoration:underline;text-underline-offset:3px}.ws-main{min-width:0;padding:26px clamp(16px,3vw,36px) 60px}.ws-main>*{max-width:1320px}.ws-foot{margin-top:48px;padding-top:18px;border-top:1px solid var(--rule);color:var(--ink-4);font-size:12px;max-width:900px}@media (max-width: 980px){.ws{grid-template-columns:1fr}.ws-rail{position:sticky;top:53px;z-index:35;height:auto;flex-direction:row;overflow-x:auto;padding:6px 10px;border-right:0;border-bottom:1px solid var(--rule);background:#090f1beb;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);scrollbar-width:none}.ws-rail::-webkit-scrollbar{display:none}.ws-rail .group,.ws-rail .rail-foot{display:none}.ws-rail a{white-space:nowrap;padding:7px 11px;font-size:13px}.store-chip .counts{display:none}}@media (max-width: 640px){.ws-top{flex-wrap:wrap;gap:10px;padding:10px 14px}.ws-top .search{order:3;flex:1 1 100%}.ws-top .brand .wordmark-name{display:none}.ws-rail{top:99px}.ws-main{padding:18px 14px 50px}}.page-head{margin:0 0 22px;display:grid;gap:6px}.page-head .eyebrow{margin:0}.page-head h1{font-family:var(--serif);font-weight:400;font-size:clamp(28px,3.2vw,38px);letter-spacing:-.025em;line-height:1.08;margin:0;color:var(--ivory)}.page-head p{margin:4px 0 0;color:var(--ink-2);max-width:760px;font-size:14.5px}.panel{background:#101a2eb8;border:1px solid var(--rule);border-radius:var(--r-l);padding:20px;margin-bottom:16px}.panel-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:14px}.panel-head h2{margin:0;font-size:15px;font-weight:620;letter-spacing:-.005em;display:flex;gap:10px;align-items:baseline}.panel-head h2 .count{font-weight:450;color:var(--ink-3);font-size:12.5px}.panel-head .hint{color:var(--ink-3);font-size:12.5px;margin:0}.panel .lede{color:var(--ink-2);margin:-6px 0 14px;font-size:13.5px;max-width:820px}.grid-main{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(320px,1fr);gap:16px;align-items:start}@media (max-width: 1180px){.grid-main{grid-template-columns:1fr}}.finding{position:relative;border-radius:var(--r-l);padding:26px 26px 22px;margin-bottom:16px;overflow:hidden;border:1px solid var(--rule);background:linear-gradient(135deg,#16233be6,#0d1525e6)}.finding:after{content:"";position:absolute;right:-120px;top:-140px;width:420px;height:420px;border-radius:50%;background:radial-gradient(closest-side,var(--glow, rgba(127, 162, 255, .12)),transparent);pointer-events:none}.finding.tone-amber{--glow: rgba(231, 169, 72, .16)}.finding.tone-alert{--glow: rgba(233, 138, 111, .18)}.finding.tone-calm{--glow: rgba(143, 193, 163, .12)}.finding-top{display:flex;gap:24px;justify-content:space-between;flex-wrap:wrap;position:relative;z-index:1}.finding-id{min-width:0;flex:1 1 380px}.finding-id .kline{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-bottom:8px;color:var(--ink-3);font-size:12.5px}.finding-id .kline .k{color:var(--blue);font-size:14px;font-weight:600}.finding-id h1{font-family:var(--serif);font-weight:400;font-size:clamp(28px,3.4vw,42px);letter-spacing:-.025em;line-height:1.05;margin:0 0 8px;color:var(--ivory)}.finding-id .meta{color:var(--ink-3);font-size:13px;display:flex;gap:6px 14px;flex-wrap:wrap}.finding-id .meta a{font-size:13px}.verdict{flex:0 1 400px;min-width:280px;border-left:1px solid var(--rule-2);padding-left:24px;display:grid;gap:8px;align-content:start}.verdict-label{font-family:var(--serif);font-size:30px;font-weight:450;letter-spacing:-.02em;line-height:1.05;display:flex;gap:10px;align-items:center}.verdict-label i{width:12px;height:12px;border-radius:50%;background:currentColor;box-shadow:0 0 0 5px color-mix(in srgb,currentColor 18%,transparent);flex:none}.verdict.tone-amber .verdict-label{color:var(--amber)}.verdict.tone-alert .verdict-label{color:var(--alert)}.verdict.tone-calm .verdict-label{color:var(--sage)}.verdict.tone-muted .verdict-label{color:var(--ink-2)}.verdict-reason{color:var(--ink-2);font-size:13px;margin:0}.authority{display:flex;gap:8px;align-items:flex-start;font-size:11.5px;color:var(--ink-3);background:#ffffff08;border:1px solid var(--rule);border-radius:var(--r-m);padding:8px 10px}.authority svg{flex:none;color:var(--sage);margin-top:1px}.authority b{color:var(--ink-2);font-weight:600}.verdict-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:4px}.finding-sentence{position:relative;z-index:1;margin:22px 0 0;padding-top:18px;border-top:1px solid var(--rule);font-family:var(--serif);font-size:clamp(17px,1.6vw,20px);line-height:1.45;color:var(--ink);max-width:980px}.finding-sentence .k{font-size:.86em;color:var(--blue)}.finding-sentence .amber{color:var(--amber)}.coverage-row{position:relative;z-index:1;display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}.chain{display:flex;align-items:stretch;gap:0;overflow-x:auto;padding:4px 2px 10px;scrollbar-width:thin}.chain-node{flex:1 1 240px;min-width:220px;max-width:380px;background:var(--night-2);border:1px solid var(--rule);border-radius:var(--r-m);padding:14px;display:grid;gap:6px;align-content:start;cursor:pointer;text-align:left;color:inherit;transition:border-color .2s,background .2s}.chain-node:hover,.chain-node:focus-visible{border-color:var(--rule-2);background:var(--night-3)}.chain-node.is-self{border-color:#7fa2ff59}.chain-node.tone-design{border-color:#e7a94873;box-shadow:inset 0 0 0 1px #e7a9481a,0 0 40px -18px #e7a94880}.chain-node .role{font-size:10.5px;letter-spacing:.12em;text-transform:uppercase;color:var(--ink-3);font-weight:600}.chain-node .k{font-size:15px;color:var(--ivory);font-weight:600}.chain-node .nm{font-size:12.5px;color:var(--ink-2);line-height:1.35}.chain-node .dt{font-size:12px;color:var(--ink-3)}.chain-node .rc{margin-top:4px;display:grid;gap:4px}.chain-link{flex:0 0 auto;width:150px;display:grid;align-content:center;justify-items:center;gap:4px;padding:0 6px;position:relative;background:none;border:0;cursor:pointer;color:inherit}.chain-link:before{content:"";position:absolute;left:0;right:0;top:50%;border-top:2px solid var(--blue);opacity:.8}.chain-link.st-disputed:before{border-top-style:dashed;border-color:var(--alert)}.chain-link.st-conditional:before{border-top-style:dotted;border-top-width:3px;border-color:var(--violet)}.chain-link.st-confirmed:before{border-color:var(--sage)}.chain-link .lbl{position:relative;background:var(--night-1);padding:3px 8px;border-radius:999px;border:1px solid var(--rule-2);font-size:11.5px;color:var(--ink-2);transition:border-color .2s,color .2s}.chain-link:hover .lbl,.chain-link:focus-visible .lbl{border-color:var(--blue);color:var(--ink)}.chain-link .sub{position:relative;font-size:10.5px;color:var(--ink-3);background:var(--night-1);padding:0 6px;margin-top:22px}.chain-timing{margin-top:10px;display:flex;gap:10px;align-items:center;flex-wrap:wrap;font-size:13px;color:var(--ink-2)}.chain-timing .amber{color:var(--amber);font-weight:600}.graph-tools{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.seg{display:inline-flex;background:var(--night-2);border:1px solid var(--rule);border-radius:999px;padding:3px}.seg button{background:none;border:0;color:var(--ink-3);padding:5px 12px;border-radius:999px;font-size:12.5px;font-weight:560;cursor:pointer}.seg button[aria-pressed=true]{background:var(--night-4);color:var(--ivory)}.graph-wrap{position:relative;overflow:auto;border-radius:var(--r-m);background:radial-gradient(900px 400px at 85% 50%,rgba(127,162,255,.06),transparent 70%),var(--night-0);border:1px solid var(--rule);scrollbar-width:thin}.graph-wrap svg{display:block}.g-col-label{fill:var(--ink-4);font-size:10.5px;letter-spacing:.12em;text-transform:uppercase;font-weight:600}.g-col-rule{stroke:var(--rule);stroke-dasharray:2 5}.g-edge{fill:none;stroke-linecap:round;transition:opacity .25s,stroke-width .2s}.g-edge.st-extracted{stroke:var(--blue);stroke-width:1.4;opacity:.55}.g-edge.st-confirmed{stroke:var(--sage);stroke-width:1.8;opacity:.8}.g-edge.st-disputed{stroke:var(--alert);stroke-width:1.6;stroke-dasharray:6 5;opacity:.85}.g-edge.st-conditional{stroke:var(--violet);stroke-width:2;stroke-dasharray:1 5;opacity:.9}.g-edge.is-critical{stroke:var(--amber);opacity:1;stroke-width:2.4;filter:drop-shadow(0 0 6px rgba(231,169,72,.45))}.g-edge.is-dim{opacity:.1}.g-edge-hit{fill:none;stroke:transparent;stroke-width:14;cursor:pointer}.g-edge-g:hover .g-edge,.g-edge-g:focus-visible .g-edge{opacity:1;stroke-width:3}.g-edge-g:focus-visible{outline:none}.g-edge-g:focus-visible .g-edge{filter:drop-shadow(0 0 4px var(--blue))}.g-node{cursor:pointer}.g-node:focus-visible{outline:none}.g-node .halo{fill:transparent;stroke:transparent;stroke-width:2;transition:stroke .2s}.g-node:hover .halo,.g-node:focus-visible .halo,.g-node.is-selected .halo{stroke:var(--blue)}.g-node .dot{stroke:var(--night-0);stroke-width:2;transition:r .2s}.g-node .dot.tone-clean{fill:#9aa7c2}.g-node .dot.tone-recall{fill:var(--night-0);stroke:var(--amber);stroke-width:2}.g-node .dot.tone-design{fill:var(--amber)}.g-node .dot.unread{stroke-dasharray:2.5 2.5;stroke:var(--ink-3);stroke-width:1.6}.g-node.is-self .dot{fill:var(--ivory);stroke:var(--blue);stroke-width:3}.g-node .glow{fill:var(--amber);opacity:.22;filter:blur(6px)}.g-node .lk{fill:var(--ink);font-family:var(--mono);font-size:11.5px;font-weight:600}.g-node .ln{fill:var(--ink-3);font-size:10.5px}.g-node.is-dim{opacity:.2}.g-node.is-self .lk{fill:var(--ivory);font-size:12.5px}.g-more{cursor:pointer}.g-more rect{fill:var(--night-2);stroke:var(--rule-2)}.g-more text{fill:var(--ink-2);font-size:11.5px}.g-more:hover rect,.g-more:focus-visible rect{stroke:var(--blue)}.g-legend{display:flex;gap:8px 16px;flex-wrap:wrap;margin-top:12px;font-size:11.5px;color:var(--ink-3);align-items:center}.g-legend .sw{display:inline-flex;align-items:center;gap:6px}.g-legend .sw i{width:10px;height:10px;border-radius:50%;display:inline-block}.g-legend .sw i.lg-design{background:var(--amber)}.g-legend .sw i.lg-recall{border:2px solid var(--amber)}.g-legend .sw i.lg-clean{background:#9aa7c2}.g-legend .sw i.lg-unread{border:1.5px dashed var(--ink-3)}.g-legend .sep{width:1px;height:14px;background:var(--rule-2)}.graph-hint{font-size:12px;color:var(--ink-4);margin-top:8px}.tl-grid{stroke:var(--rule)}.tl-axis{fill:var(--ink-4);font-size:10.5px;font-variant-numeric:tabular-nums}.tl-band{fill:#7fa2ff0f}.tl-rowhit{fill:transparent}.tl-row:hover .tl-rowhit,.tl-row:focus-visible .tl-rowhit{fill:#ffffff08}.tl-row:focus-visible{outline:none}.tl-edge{fill:none;stroke:var(--ink-4);stroke-width:1.1}.tl-edge.on{stroke:var(--amber);stroke-width:2}.tl-dia.design{fill:var(--amber)}.tl-dia.other{fill:none;stroke:var(--amber);stroke-width:1.3}.tl-rlink{stroke:var(--amber);stroke-width:1;stroke-dasharray:2 3;opacity:.7}.tl-label{fill:var(--ink-2);font-size:11.5px}.tl-label .lk{font-family:var(--mono);fill:var(--ink);font-weight:600}.tl-gen{fill:var(--ink-4);font-size:10px}.tl-clear{stroke:var(--blue);stroke-dasharray:3 3;opacity:.7}.review-item{border:1px solid var(--rule);border-radius:var(--r-m);padding:14px 16px;margin-bottom:10px;background:var(--night-2)}.review-item.tone-amber{border-left:3px solid var(--amber)}.review-item.tone-violet{border-left:3px solid var(--violet)}.review-item.tone-alert{border-left:3px solid var(--alert)}.review-item.tone-muted{border-left:3px solid var(--ink-4)}.review-item h3{margin:0 0 8px;font-size:13.5px;font-weight:620;line-height:1.4;display:flex;gap:8px;align-items:baseline}.review-item dl{margin:0;display:grid;grid-template-columns:92px 1fr;gap:4px 12px;font-size:12.5px}.review-item dt{color:var(--ink-4);font-size:10.5px;letter-spacing:.1em;text-transform:uppercase;font-weight:600;padding-top:2px}.review-item dd{margin:0;color:var(--ink-2)}.review-item .acts{display:flex;gap:6px;flex-wrap:wrap;margin-top:10px}.review-item .links{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px}@media (max-width: 520px){.review-item dl{grid-template-columns:1fr}}.signal{border-top:1px solid var(--rule);padding:12px 0}.signal:first-of-type{border-top:0}.signal-head{display:flex;gap:10px;align-items:flex-start;width:100%;background:none;border:0;padding:0;color:inherit;text-align:left;cursor:pointer}.signal-head .t{flex:1;font-size:13.5px;line-height:1.45}.signal-head .chev{color:var(--ink-4);transition:transform .25s var(--ease-out);flex:none;margin-top:2px}.signal-head[aria-expanded=true] .chev{transform:rotate(90deg)}.sev{font-size:10px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;padding:3px 6px;border-radius:4px;flex:none;margin-top:1px}.sev-high{background:var(--alert-soft);color:var(--alert)}.sev-medium{background:var(--amber-soft);color:var(--amber)}.sev-low{background:var(--night-3);color:var(--amber-2)}.sev-info{background:var(--night-3);color:var(--ink-3)}.signal-body{padding:10px 0 2px;display:grid;gap:8px}.recall{display:grid;gap:4px;padding:10px 12px;border-radius:var(--r-s);background:var(--night-1);border:1px solid var(--rule)}.recall-h{display:flex;gap:8px;flex-wrap:wrap;align-items:center;font-size:12.5px}.recall-h .k{color:var(--ink);font-weight:600}.recall-r{font-size:12.5px;color:var(--ink-3);line-height:1.45}.cit{border-top:1px solid var(--rule);padding:12px 0;display:grid;gap:8px}.cit:first-of-type{border-top:0;padding-top:0}.cit.is-rejected{opacity:.55}.cit-h{display:flex;gap:8px;align-items:center;flex-wrap:wrap;font-size:13px}.cit-h .k{color:var(--blue);font-weight:600;cursor:pointer;background:none;border:0;padding:0}.cit-a{display:flex;gap:6px;align-items:center;flex-wrap:wrap}.quote{font-family:var(--serif);font-size:14.5px;line-height:1.5;color:var(--paper-ink);background:var(--paper);border-radius:4px;padding:10px 12px 10px 14px;position:relative;margin:0}.quote:before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--blue-2);border-radius:4px 0 0 4px}.quote mark{background:#5b82f02e;color:#1d3f9e;font-family:var(--mono);font-size:.88em;padding:0 2px;border-radius:2px}.quote.is-ocr:before{background:var(--amber-2)}.memo p{margin:0 0 10px;font-family:var(--serif);font-size:15px;line-height:1.55;color:var(--ink)}.memo .src{font-size:11.5px;color:var(--ink-3);margin-bottom:10px}.hist{border-top:1px solid var(--rule);padding:10px 0;display:grid;gap:4px;font-size:12.5px}.hist:first-of-type{border-top:0;padding-top:0}.hist-h{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.hist-h .k{color:var(--ink);font-weight:600}.stale{color:var(--amber);font-size:12px}.drawer-scrim{position:fixed;top:0;right:0;bottom:0;left:0;z-index:60;background:#03060c80;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);animation:fadeIn .25s ease}.drawer{position:fixed;z-index:61;top:0;right:0;bottom:0;width:min(520px,100vw);background:var(--night-2);border-left:1px solid var(--rule-2);box-shadow:-30px 0 80px -30px #000000b3;display:flex;flex-direction:column;animation:slideIn .4s var(--ease-out)}.drawer-head{display:flex;align-items:flex-start;gap:12px;padding:18px 20px 14px;border-bottom:1px solid var(--rule)}.drawer-head .t{flex:1;min-width:0}.drawer-head .eyebrow{margin:0 0 6px}.drawer-head h2{margin:0;font-family:var(--serif);font-weight:420;font-size:24px;letter-spacing:-.02em;line-height:1.15;color:var(--ivory)}.drawer-head h2 .k{font-size:.82em;color:var(--blue)}.drawer-body{padding:18px 20px 30px;overflow-y:auto;display:grid;gap:18px;align-content:start}.drawer-sec h3{font-size:10.5px;letter-spacing:.14em;text-transform:uppercase;color:var(--ink-4);margin:0 0 8px;font-weight:650}.prov-grid{display:grid;grid-template-columns:120px 1fr;gap:6px 14px;font-size:12.5px;margin:0}.prov-grid dt{color:var(--ink-3)}.prov-grid dd{margin:0;color:var(--ink);word-break:break-word}.prov-grid dd .mono{font-size:11.5px;color:var(--ink-2)}.page-card{display:flex;gap:14px;align-items:center;background:var(--paper);color:var(--paper-ink);border-radius:var(--r-m);padding:12px 14px;text-decoration:none!important;transition:transform .25s var(--ease-out),box-shadow .25s;box-shadow:var(--shadow)}.page-card:hover{transform:translateY(-1px)}.page-card .sheet{width:42px;height:54px;flex:none;background:#fff;border:1px solid #d9d1bf;border-radius:2px;position:relative;box-shadow:2px 2px #e6dcc7;display:grid;place-items:center;font-family:var(--mono);font-size:11px;color:#2d56c4;font-weight:600}.page-card .sheet:before{content:"";position:absolute;left:7px;right:7px;top:9px;height:18px;background:repeating-linear-gradient(#e7e0d0 0 2px,transparent 2px 5px)}.page-card .sheet b{position:relative;margin-top:22px}.page-card .tx{display:grid;gap:2px;font-size:13px}.page-card .tx b{font-weight:650}.page-card .tx span{font-size:11.5px;color:var(--paper-mute)}.drawer-acts{display:flex;gap:8px;flex-wrap:wrap}.drawer .note{font-size:12px;color:var(--ink-3)}@keyframes slideIn{0%{transform:translate(40px);opacity:0}to{transform:none;opacity:1}}@keyframes fadeIn{0%{opacity:0}}@media (prefers-reduced-motion: reduce){.drawer,.drawer-scrim{animation:none}}.tbl-wrap{overflow-x:auto;margin:0 -4px}.tbl{width:100%;border-collapse:collapse;font-size:13px}.tbl th{text-align:left;font-size:10.5px;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-4);font-weight:650;border-bottom:1px solid var(--rule-2);padding:8px 10px;vertical-align:bottom;white-space:nowrap}.tbl td{border-bottom:1px solid var(--rule);padding:11px 10px;vertical-align:top}.tbl tr.click{cursor:pointer;transition:background .15s}.tbl tr.click:hover,.tbl tr.click:focus-visible{background:#7fa2ff0d;outline:none}.tbl td .k{color:var(--blue);font-weight:600}.tbl td .sub{color:var(--ink-3);font-size:12px}.tbl tr.is-conditional td:first-child{box-shadow:inset 3px 0 0 var(--violet)}.bigstats{display:flex;gap:clamp(20px,4vw,52px);flex-wrap:wrap;margin:4px 0 6px}.bigstats div{display:grid;gap:2px}.bigstats b{font-family:var(--serif);font-size:40px;font-weight:400;line-height:1;color:var(--ivory);font-variant-numeric:tabular-nums}.bigstats .amber b{color:var(--amber)}.bigstats .violet b{color:var(--violet)}.bigstats span{font-size:12px;color:var(--ink-3);max-width:220px}.row-in{display:flex;gap:8px;flex-wrap:wrap}.row-in .field{flex:1 1 260px}.tags{display:flex;flex-wrap:wrap;gap:6px}.tag-btn{background:var(--night-3);border:1px solid var(--rule);color:var(--ink-2);font-size:12px;padding:5px 10px;border-radius:999px;cursor:pointer}.tag-btn:hover{border-color:var(--rule-2);color:var(--ink)}.tag-btn .k{color:var(--blue)}.note-box{font-size:12.5px;color:var(--ink-2);background:var(--night-1);border:1px solid var(--rule);border-radius:var(--r-m);padding:10px 12px}.note-box.amber{border-color:#e7a9484d}.note-box.violet{border-color:#b7a4f54d}.err{color:var(--alert);font-size:13px}.ok{color:var(--sage);font-size:12.5px}.skeleton{background:linear-gradient(90deg,var(--night-2),var(--night-3),var(--night-2));background-size:200% 100%;animation:shimmer 1.4s linear infinite;border-radius:var(--r-m)}@keyframes shimmer{to{background-position:-200% 0}}@media (prefers-reduced-motion: reduce){.skeleton{animation:none}}.loading-thread{display:flex;gap:10px;align-items:center;color:var(--ink-3);font-size:13px;padding:30px 0}.loading-thread i{width:60px;height:2px;background:linear-gradient(90deg,transparent,var(--blue),transparent);background-size:200% 100%;animation:shimmer 1.2s linear infinite}.home-hero{padding:10px 0 6px}.home-cases{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:12px;margin-top:6px}.case{background:var(--night-2);border:1px solid var(--rule);border-radius:var(--r-l);padding:16px;display:grid;gap:6px;text-align:left;color:inherit;cursor:pointer;transition:border-color .2s,transform .3s var(--ease-out)}.case:hover,.case:focus-visible{border-color:var(--rule-2);transform:translateY(-2px)}.case .k{color:var(--blue);font-size:12.5px}.case h3{margin:0;font-family:var(--serif);font-weight:450;font-size:19px}.case p{margin:0;font-size:12.5px;color:var(--ink-3)}.method ol,.method ul{padding-left:20px;color:var(--ink-2)}.method li{margin-bottom:8px}.method li b{color:var(--ink)}.method h3{font-size:14px;margin:18px 0 8px}::view-transition-old(root),::view-transition-new(root){animation-duration:.6s;animation-timing-function:var(--ease-io)}@media (prefers-reduced-motion: reduce){::view-transition-old(root),::view-transition-new(root){animation:none}}@media (max-width: 640px){.finding{padding:20px 18px 18px}.verdict{border-left:0;padding-left:0;border-top:1px solid var(--rule-2);padding-top:16px;flex-basis:100%}.verdict-label{font-size:26px}.panel{padding:16px}}@media (pointer: coarse){.search kbd{display:none}}@media (max-width: 980px){.ws-rail{-webkit-mask-image:linear-gradient(90deg,#000 85%,transparent);mask-image:linear-gradient(90deg,#000 85%,transparent);padding-right:40px}}.film-stage .film-gl,.film-stage .film-story{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%}.film-grid{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;background-image:linear-gradient(rgba(236,228,210,.032) 1px,transparent 1px),linear-gradient(90deg,rgba(236,228,210,.032) 1px,transparent 1px);background-size:96px 96px;background-position:center;-webkit-mask-image:radial-gradient(ellipse at 55% 45%,#000 20%,transparent 75%);mask-image:radial-gradient(ellipse at 55% 45%,#000 20%,transparent 75%)}.film-hud{position:fixed;left:clamp(16px,4vw,44px);bottom:18px;z-index:20;display:flex;gap:12px;align-items:center;font-family:var(--mono);font-size:11px;letter-spacing:.02em;color:var(--ink-3);padding:7px 12px;border-radius:999px;background:#070c178c;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border:1px solid var(--rule);max-width:calc(100vw - 32px);overflow:hidden;white-space:nowrap}.film-hud .hud-n{color:var(--blue)}.film-hud .hud-name{color:var(--ivory);font-family:var(--sans);font-weight:600;letter-spacing:.08em;text-transform:uppercase;font-size:10.5px}.film-hud .hud-read{color:var(--ink-2);overflow:hidden;text-overflow:ellipsis}@media (max-width: 860px){.film-hud .hud-read{display:none}.film-hud{bottom:12px}}.chapter-label span{font-size:12px}.chapter-copy{position:relative}.chapter-copy:before{content:"";position:absolute;left:-18px;top:34px;width:1px;height:64px;background:linear-gradient(var(--blue),transparent)}.doc{position:relative}.doc:after{content:"";position:absolute;top:-6px;right:-6px;bottom:-6px;left:-6px;border:1px solid rgba(127,162,255,.25);border-radius:8px;pointer-events:none;-webkit-mask:linear-gradient(#000 0 0) top left / 14px 14px no-repeat,linear-gradient(#000 0 0) bottom right / 14px 14px no-repeat;mask:linear-gradient(#000 0 0) top left / 14px 14px no-repeat,linear-gradient(#000 0 0) bottom right / 14px 14px no-repeat}@media (max-width: 860px){.chapter-copy:before{display:none}}.chapter.place-right{padding-right:clamp(16px,9vw,150px)}.handoff{min-height:135svh}@media (max-width: 860px){.chapter{min-height:190svh;align-items:flex-start;padding-top:105svh;padding-bottom:20svh}.handoff{padding-top:40svh}}.g-flow{fill:none;stroke:#ffd79a;stroke-width:2.6;stroke-linecap:round;stroke-dasharray:2 26;opacity:.9;animation:g-flow 2.4s linear infinite;pointer-events:none;filter:drop-shadow(0 0 4px rgba(231,169,72,.9))}@keyframes g-flow{to{stroke-dashoffset:28}}.chain-link.st-extracted:after,.chain-link.st-confirmed:after{content:"";position:absolute;left:0;right:0;top:calc(50% - 1px);height:2px;background:linear-gradient(90deg,transparent,rgba(255,215,154,.95),transparent);background-size:40% 100%;background-repeat:no-repeat;animation:chain-signal 2.6s var(--ease-io) infinite;animation-direction:reverse;pointer-events:none}@keyframes chain-signal{0%{background-position:-40% 0}to{background-position:140% 0}}.finding{isolation:isolate}.finding:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1;pointer-events:none;background-image:linear-gradient(rgba(236,228,210,.03) 1px,transparent 1px),linear-gradient(90deg,rgba(236,228,210,.03) 1px,transparent 1px);background-size:48px 48px;-webkit-mask-image:linear-gradient(110deg,transparent 30%,#000 75%);mask-image:linear-gradient(110deg,transparent 30%,#000 75%)}.finding:after{animation:glow-drift 18s ease-in-out infinite alternate}@keyframes glow-drift{0%{transform:translate(0)}to{transform:translate(-90px,40px) scale(1.15)}}.finding .kline:before{content:"[ dossier ]";font-family:var(--mono);color:var(--ink-4);font-size:11px;margin-right:2px}.panel{position:relative}.finding,.panel#review{background-clip:padding-box}.corner-marks:after{content:"";position:absolute;top:8px;right:8px;bottom:8px;left:8px;pointer-events:none;border:1px solid rgba(127,162,255,.35);border-radius:10px;-webkit-mask:linear-gradient(#000 0 0) top left / 12px 12px no-repeat,linear-gradient(#000 0 0) top right / 12px 12px no-repeat,linear-gradient(#000 0 0) bottom left / 12px 12px no-repeat,linear-gradient(#000 0 0) bottom right / 12px 12px no-repeat;mask:linear-gradient(#000 0 0) top left / 12px 12px no-repeat,linear-gradient(#000 0 0) top right / 12px 12px no-repeat,linear-gradient(#000 0 0) bottom left / 12px 12px no-repeat,linear-gradient(#000 0 0) bottom right / 12px 12px no-repeat}@media (prefers-reduced-motion: reduce){.g-flow{animation:none;stroke-dasharray:none;opacity:.35}.chain-link:after{animation:none!important;display:none}.finding:after{animation:none}}.film-top.is-solid{-webkit-backdrop-filter:none;backdrop-filter:none;background:#080d18eb}.film-hud{transition:opacity .4s var(--ease-out),transform .4s var(--ease-out)}.film-hud.is-away{opacity:0;transform:translateY(10px);pointer-events:none} +@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2) format("woff2-variations");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2) format("woff2-variations");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2) format("woff2-variations");unicode-range:U+1F00-1FFF}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/inter-greek-wght-normal-CkhJZR-_.woff2) format("woff2-variations");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2) format("woff2-variations");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2) format("woff2-variations");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/inter-latin-wght-normal-Dx4kXJAl.woff2) format("woff2-variations");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Newsreader Variable;font-style:normal;font-display:swap;font-weight:200 800;src:url(/assets/newsreader-vietnamese-wght-normal-Czsa-EzN.woff2) format("woff2-variations");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Newsreader Variable;font-style:normal;font-display:swap;font-weight:200 800;src:url(/assets/newsreader-latin-ext-wght-normal-C-3rgBeH.woff2) format("woff2-variations");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Newsreader Variable;font-style:normal;font-display:swap;font-weight:200 800;src:url(/assets/newsreader-latin-wght-normal-CCVVNp6i.woff2) format("woff2-variations");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Newsreader Variable;font-style:italic;font-display:swap;font-weight:200 800;src:url(/assets/newsreader-vietnamese-wght-italic-xAqemagA.woff2) format("woff2-variations");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Newsreader Variable;font-style:italic;font-display:swap;font-weight:200 800;src:url(/assets/newsreader-latin-ext-wght-italic-DFS986qL.woff2) format("woff2-variations");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Newsreader Variable;font-style:italic;font-display:swap;font-weight:200 800;src:url(/assets/newsreader-latin-wght-italic-Bxi8ein9.woff2) format("woff2-variations");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}:root{--night-0: #070c17;--night-1: #0b1322;--night-2: #101a2e;--night-3: #16233b;--night-4: #1e2e4b;--rule: rgba(236, 228, 210, .09);--rule-2: rgba(236, 228, 210, .16);--ivory: #f1ebdd;--ivory-2: #e6dcc7;--paper: #f6f1e5;--paper-ink: #22252b;--paper-mute: #6c6656;--ink: #ece6d8;--ink-2: rgba(236, 230, 216, .74);--ink-3: rgba(236, 230, 216, .64);--ink-4: rgba(236, 230, 216, .55);--blue: #7fa2ff;--blue-2: #5b82f0;--blue-soft: rgba(127, 162, 255, .14);--amber: #e7a948;--amber-2: #c98a2c;--amber-soft: rgba(231, 169, 72, .14);--alert: #e98a6f;--alert-soft: rgba(233, 138, 111, .14);--sage: #8fc1a3;--sage-soft: rgba(143, 193, 163, .14);--violet: #b7a4f5;--serif: "Newsreader Variable", "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;--sans: "Inter Variable", "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;--mono: "Cascadia Mono", "SFMono-Regular", ui-monospace, Consolas, monospace;--r-s: 6px;--r-m: 10px;--r-l: 16px;--ease-out: cubic-bezier(.16, 1, .3, 1);--ease-io: cubic-bezier(.65, 0, .35, 1);--shadow: 0 18px 50px -20px rgba(0, 0, 0, .6), 0 2px 8px rgba(0, 0, 0, .25);color-scheme:dark;font-family:var(--sans);font-feature-settings:"cv11","ss01"}*{box-sizing:border-box}html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}@media (prefers-reduced-motion: reduce){html{scroll-behavior:auto}}body{margin:0;background:var(--night-1);color:var(--ink);font-size:14px;line-height:1.5;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}::selection{background:#7fa2ff59;color:#fff}a{color:var(--blue);text-decoration:none;text-underline-offset:3px}a:hover{text-decoration:underline}button,input,select,textarea{font:inherit;color:inherit}:focus-visible{outline:2px solid var(--blue);outline-offset:2px;border-radius:4px}q{quotes:"“" "”"}code{font-family:var(--mono);font-size:.92em;background:var(--night-3);padding:1px 5px;border-radius:4px}.k,.mono{font-family:var(--mono);font-variant-numeric:tabular-nums slashed-zero;letter-spacing:-.01em}.num{font-variant-numeric:tabular-nums}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}.skip-link{position:fixed;left:12px;top:-60px;z-index:200;background:var(--ivory);color:var(--night-1);padding:8px 14px;border-radius:var(--r-s);font-weight:600;transition:top .2s}.skip-link:focus{top:12px}.muted{color:var(--ink-3)}.small{font-size:12px}.mark{display:block;overflow:visible}.mark-thread{stroke:var(--blue);stroke-width:1.6;stroke-linecap:round}.mark-node{fill:var(--ivory)}.mark-node.past{fill:var(--amber)}.wordmark{display:inline-flex;align-items:center;gap:10px}.wordmark-name{font-family:var(--serif);font-size:21px;font-weight:500;letter-spacing:-.01em;color:var(--ivory)}.btn{display:inline-flex;align-items:center;gap:8px;border:1px solid transparent;border-radius:999px;padding:8px 16px;font-weight:560;font-size:13.5px;cursor:pointer;white-space:nowrap;transition:background .2s var(--ease-out),border-color .2s,color .2s,transform .2s var(--ease-out);text-decoration:none!important}.btn:active{transform:translateY(1px)}.btn-primary{background:var(--ivory);color:var(--night-1)}.btn-primary:hover{background:#fff}.btn-line{border-color:var(--rule-2);color:var(--ink);background:transparent}.btn-line:hover{border-color:var(--ink-3);background:#ffffff08}.btn-quiet{background:transparent;color:var(--ink-2);padding:6px 10px;border-radius:var(--r-s)}.btn-quiet:hover{color:var(--ink);background:var(--night-3)}.btn-sm{padding:5px 11px;font-size:12.5px}.btn:disabled{opacity:.45;cursor:default}.btn .arr{transition:transform .25s var(--ease-out)}.btn:hover .arr{transform:translate(3px)}.field{width:100%;background:var(--night-2);border:1px solid var(--rule-2);border-radius:var(--r-m);padding:10px 14px;color:var(--ink);transition:border-color .2s,background .2s}.field::placeholder{color:var(--ink-4)}.field:focus{outline:none;border-color:var(--blue);background:var(--night-3)}select.field{padding:6px 10px;width:auto}.chip{display:inline-flex;align-items:center;gap:6px;font-size:11.5px;font-weight:560;line-height:1;padding:5px 9px;border-radius:999px;background:var(--night-3);color:var(--ink-2);white-space:nowrap}.chip .glyph{width:8px;height:8px;border-radius:50%;background:currentColor;flex:none}.chip.tone-design,.chip.tone-amber,.chip.tone-class1{background:var(--amber-soft);color:var(--amber)}.chip.tone-other{background:var(--night-3);color:var(--ink-2)}.chip.tone-alert{background:var(--alert-soft);color:var(--alert)}.chip.tone-calm{background:var(--sage-soft);color:var(--sage)}.chip.tone-blue{background:var(--blue-soft);color:var(--blue)}.chip.tone-muted{background:var(--night-3);color:var(--ink-3)}.chip.tone-violet{background:#b7a4f524;color:var(--violet)}.status{display:inline-flex;align-items:center;gap:7px;font-size:11.5px;font-weight:560;white-space:nowrap}.status .line{width:22px;height:0;border-top:2px solid currentColor;flex:none}.status-confirmed{color:var(--sage)}.status-extracted{color:var(--blue)}.status-disputed{color:var(--alert)}.status-disputed .line{border-top-style:dashed}.status-conditional{color:var(--violet)}.status-conditional .line{border-top-style:dotted;border-top-width:3px}.status-rejected{color:var(--ink-4)}.status-rejected .line{border-top-style:dashed;opacity:.6}.status-advisory{color:var(--violet)}.status-advisory .line{border-top-style:dotted;opacity:.7}.status-retired{color:var(--ink-4)}.status-retired .line{border-top-style:dotted;opacity:.4}.intro{position:fixed;top:0;right:0;bottom:0;left:0;z-index:100;display:grid;place-items:center;background:radial-gradient(ellipse at 50% 46%,#101b31 0%,var(--night-0) 70%);transition:opacity .55s var(--ease-io),visibility .55s}.intro.is-leaving{opacity:0;visibility:hidden;pointer-events:none}.intro-lockup{display:grid;justify-items:center;gap:22px;transform:translateY(-2vh)}.intro-mark{width:116px;height:116px}.intro-mark .mark-thread{stroke-dasharray:1;stroke-dashoffset:1;animation:draw .62s var(--ease-out) forwards;stroke-width:1.1}.intro-mark .mark-node{transform-box:fill-box;transform-origin:center;transform:scale(0);opacity:0;animation:pop .55s var(--ease-out) forwards}.intro-mark .n0{animation-delay:.05s}.intro-mark .n2{animation-delay:.22s}.intro-mark .n4{animation-delay:.39s}.intro-mark .n1{animation-delay:.62s}.intro-mark .n3{animation-delay:.74s}.intro-mark .t1{animation-delay:.4s}.intro-mark .t3{animation-delay:.58s}.intro-mark .t0{animation-delay:.8s}.intro-mark .t2{animation-delay:.92s}.intro-mark .mark-node.past{animation:pop .55s var(--ease-out) .39s forwards,ember 1.6s ease-in-out 1.15s 1}.intro-word{font-family:var(--serif);font-size:clamp(34px,6vw,52px);font-weight:420;letter-spacing:-.02em;color:var(--ivory);display:flex;overflow:hidden}.intro-word span{display:inline-block;transform:translateY(105%);animation:rise .8s var(--ease-out) forwards}.intro-tag{font-family:var(--serif);font-style:italic;font-size:clamp(17px,2.4vw,22px);color:var(--ink-2);margin:0;overflow:hidden}.intro-tag span{display:inline-block;opacity:0;transform:translateY(40%);animation:fadeRise .9s var(--ease-out) 1.55s forwards}.intro-tag em{color:var(--amber);font-style:italic}.intro-skip{position:absolute;right:22px;bottom:22px}@keyframes draw{to{stroke-dashoffset:0}}@keyframes pop{to{transform:scale(1);opacity:1}}@keyframes rise{to{transform:translateY(0)}}@keyframes fadeRise{to{opacity:1;transform:none}}@keyframes ember{0%,to{filter:none}45%{filter:drop-shadow(0 0 6px rgba(231,169,72,.9))}}.film{position:relative}.film-stage{position:fixed;top:0;right:0;bottom:0;left:0;z-index:0;pointer-events:none}.film-stage canvas{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;opacity:0;transition:opacity 1.2s var(--ease-io)}.film-stage canvas.is-live{opacity:1}.film-fallback{position:absolute;top:0;right:0;bottom:0;left:0;background:radial-gradient(1200px 700px at 72% 30%,rgba(91,130,240,.1),transparent 60%),radial-gradient(900px 600px at 15% 85%,rgba(231,169,72,.05),transparent 60%),var(--night-1)}.film-fallback svg{position:absolute;right:6vw;top:18vh;width:min(46vw,560px);opacity:.5}.film-vignette{position:absolute;top:0;right:0;bottom:0;left:0;background:radial-gradient(ellipse at 50% 50%,transparent 55%,rgba(4,7,14,.55) 100%)}.film>main,.film>footer{position:relative;z-index:1}.film-top{position:fixed;top:0;left:0;right:0;z-index:30!important;display:flex;align-items:center;gap:16px;padding:16px clamp(16px,4vw,44px);transition:background .4s,backdrop-filter .4s,border-color .4s;border-bottom:1px solid transparent}.film-top.is-solid{background:#090f1bb8;-webkit-backdrop-filter:blur(14px) saturate(1.2);backdrop-filter:blur(14px) saturate(1.2);border-color:var(--rule)}.film-top .spacer{flex:1}.film-top nav{display:flex;gap:4px}.film-top nav a{color:var(--ink-2);font-size:13px;padding:6px 10px;border-radius:var(--r-s)}.film-top nav a:hover{color:var(--ink);text-decoration:none;background:#ffffff0a}.hero{position:relative;min-height:100svh;display:grid;align-content:center;padding:96px clamp(16px,6vw,88px) 72px;max-width:1240px}.eyebrow{font-size:12px;letter-spacing:.14em;text-transform:uppercase;color:var(--ink-3);font-weight:600;margin:0 0 22px;display:flex;gap:12px;align-items:center}.eyebrow:before{content:"";width:28px;height:1px;background:var(--blue)}.hero h1{font-family:var(--serif);font-weight:380;font-size:clamp(42px,6.4vw,86px);line-height:.98;letter-spacing:-.035em;margin:0;max-width:11.5ch;color:var(--ivory)}.hero h1 em{font-style:italic;color:var(--amber);font-weight:360}.hero-lede{font-size:clamp(16px,1.6vw,19px);line-height:1.55;color:var(--ink-2);max-width:40em;margin:28px 0 0}.hero-lede b{color:var(--ink);font-weight:600}.hero-actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:34px;align-items:center}.hero-proof{animation:fadeIn .6s var(--ease-out);display:flex;gap:clamp(20px,4vw,48px);flex-wrap:wrap;margin-top:40px;padding-top:24px;border-top:1px solid var(--rule);max-width:760px}.hero-proof div{display:grid;gap:2px}.hero-proof b{font-family:var(--serif);font-size:30px;font-weight:400;color:var(--ivory);font-variant-numeric:tabular-nums}.hero-proof span{font-size:12px;color:var(--ink-3)}.chapter{min-height:150svh;display:flex;align-items:center;padding:0 clamp(16px,6vw,88px)}.chapter.place-left{justify-content:flex-start}.chapter.place-right{justify-content:flex-end}.chapter-copy{max-width:460px;padding:30px 0}.chapter-label{display:flex;gap:14px;align-items:baseline;font-size:12px;letter-spacing:.14em;text-transform:uppercase;color:var(--ink-3);font-weight:600;margin:0 0 18px}.chapter-label span{font-family:var(--mono);color:var(--blue);letter-spacing:0}.chapter-statement{font-family:var(--serif);font-weight:380;font-size:clamp(34px,4.6vw,58px);line-height:1.02;letter-spacing:-.03em;margin:0 0 22px;color:var(--ivory)}.chapter-statement em{font-style:italic;color:var(--amber)}.chapter-body{font-size:16px;line-height:1.65;color:var(--ink-2);margin:0 0 18px}.chapter-body b{color:var(--ink);font-weight:600}.chapter-foot{font-size:12.5px;color:var(--ink-3);margin:0;padding-left:14px;border-left:1px solid var(--rule-2)}.ln{display:block;overflow:hidden;padding-bottom:.06em}.ln>span{display:inline-block;transform:translateY(110%);transition:transform 1s var(--ease-out)}.reveal .chapter-body,.reveal .chapter-foot,.reveal .doc,.reveal .fact-row{opacity:0;transform:translateY(14px);transition:opacity .9s var(--ease-out) .18s,transform .9s var(--ease-out) .18s}.reveal.in-frame .ln>span{transform:none}.reveal.in-frame .ln:nth-child(2)>span{transition-delay:.08s}.reveal.in-frame .chapter-body,.reveal.in-frame .chapter-foot,.reveal.in-frame .doc,.reveal.in-frame .fact-row{opacity:1;transform:none}html[data-film=off] .ln>span,html[data-motion=reduced] .ln>span{transform:none;transition:none}html[data-film=off] .reveal *,html[data-motion=reduced] .reveal *{opacity:1!important;transform:none!important;transition:none!important}.doc{background:var(--paper);color:var(--paper-ink);border-radius:4px;padding:18px 20px 16px;box-shadow:var(--shadow);font-family:var(--serif);font-size:15.5px;line-height:1.5;margin:22px 0 18px;position:relative}.doc:before{content:"";position:absolute;inset:0 auto 0 0;width:3px;background:var(--blue-2);border-radius:4px 0 0 4px}.doc-meta{font-family:var(--sans);font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--paper-mute);display:flex;justify-content:space-between;gap:12px;margin-bottom:8px}.doc mark{background:#5b82f029;color:#1d3f9e;padding:0 2px;border-radius:2px;font-family:var(--mono);font-size:.9em}.doc a{color:#2d56c4;font-family:var(--sans);font-size:12px}.fact-row{display:flex;gap:18px;flex-wrap:wrap;margin:14px 0 18px}.fact{display:grid;gap:2px}.fact b{font-family:var(--serif);font-size:24px;font-weight:400;color:var(--ivory);font-variant-numeric:tabular-nums}.fact span{font-size:11.5px;color:var(--ink-3)}.fact.amber b{color:var(--amber)}.handoff{min-height:120svh;display:grid;align-content:end;padding-bottom:16svh!important;justify-items:center;text-align:center;padding:0 20px}.handoff p.lead{font-family:var(--serif);font-weight:380;font-size:clamp(30px,4.4vw,54px);line-height:1.06;letter-spacing:-.03em;margin:0 0 30px;color:var(--ivory)}.handoff p.lead em{color:var(--blue);font-style:italic}.handoff .sub{color:var(--ink-3);font-size:13px;margin-top:18px;max-width:520px}.paths{padding:40px clamp(16px,6vw,88px) 60px;max-width:1240px;margin:0 auto}.paths h2{font-family:var(--serif);font-weight:400;font-size:28px;letter-spacing:-.02em;margin:0 0 20px}.path-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:14px}.path-card{background:#101a2ec7;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);border:1px solid var(--rule);border-radius:var(--r-l);padding:20px;color:var(--ink);text-decoration:none!important;display:grid;gap:8px;transition:border-color .25s,transform .3s var(--ease-out),background .25s}.path-card:hover{border-color:var(--rule-2);transform:translateY(-2px);background:#16233bd9}.path-card .k{color:var(--blue);font-size:12px}.path-card h3{margin:0;font-family:var(--serif);font-weight:450;font-size:20px;letter-spacing:-.01em}.path-card p{margin:0;color:var(--ink-3);font-size:13px}.film-index{position:fixed;right:clamp(10px,2vw,24px);top:50%;transform:translateY(-50%);z-index:20!important;display:grid;gap:10px}.film-index a{display:flex;align-items:center;justify-content:flex-end;gap:10px;color:var(--ink-4);font-size:11px;letter-spacing:.08em;text-transform:uppercase;text-decoration:none!important}.film-index a i{width:6px;height:6px;border-radius:50%;border:1px solid currentColor;transition:background .3s,transform .3s}.film-index a span{opacity:0;transform:translate(6px);transition:opacity .3s,transform .3s}.film-index a:hover span,.film-index a:focus-visible span,.film-index a.on span{opacity:1;transform:none}.film-index a.on{color:var(--ink)}.film-index a.on i{background:var(--blue);border-color:var(--blue);transform:scale(1.3)}@media (max-width: 860px){.film-index{display:none}}.film-foot{padding:30px clamp(16px,6vw,88px) 40px;border-top:1px solid var(--rule);display:flex;gap:20px;flex-wrap:wrap;justify-content:space-between;color:var(--ink-3);font-size:12px;background:linear-gradient(transparent,#070c17cc)}.film-foot p{margin:0;max-width:640px}html[data-film=off] .chapter{min-height:auto;padding-top:60px;padding-bottom:60px}html[data-film=off] .handoff{min-height:60svh}@media (max-width: 860px){.chapter{min-height:130svh;justify-content:flex-start!important;align-items:flex-end;padding-bottom:12svh}.chapter-copy{background:#090f1bd1;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border:1px solid var(--rule);border-radius:var(--r-l);padding:22px;max-width:none}.film-top nav{display:none}.hero{padding-top:100px}}.ws{min-height:100vh;display:grid;grid-template-columns:232px minmax(0,1fr);grid-template-rows:auto 1fr;background:radial-gradient(1400px 600px at 80% -10%,rgba(91,130,240,.07),transparent 60%),var(--night-1)}.ws-top{grid-column:1 / -1;position:sticky;top:0;z-index:40;display:flex;align-items:center;gap:16px;padding:10px 20px;background:#090f1bd1;-webkit-backdrop-filter:blur(14px) saturate(1.2);backdrop-filter:blur(14px) saturate(1.2);border-bottom:1px solid var(--rule)}.ws-top .brand{display:flex;align-items:center;gap:10px;color:var(--ivory);text-decoration:none!important}.ws-top .brand .wordmark-name{font-size:19px}.ws-top .spacer{flex:1}.store-chip{display:flex;gap:12px;align-items:center;font-size:12px;color:var(--ink-3)}.store-chip b{color:var(--ink-2);font-weight:600;font-variant-numeric:tabular-nums}.store-chip .dot{width:7px;height:7px;border-radius:50%;background:var(--sage);box-shadow:0 0 0 3px var(--sage-soft)}.store-chip .dot.off{background:var(--alert);box-shadow:0 0 0 3px var(--alert-soft)}.search{position:relative;flex:0 1 460px;min-width:200px}.search .field{padding:8px 12px 8px 34px;border-radius:999px;font-size:13px}.search .icon{position:absolute;left:12px;top:50%;transform:translateY(-50%);color:var(--ink-4);pointer-events:none}.search kbd{position:absolute;right:10px;top:50%;transform:translateY(-50%);font-family:var(--mono);font-size:11px;color:var(--ink-4);border:1px solid var(--rule-2);border-radius:4px;padding:0 5px}.search-results{position:absolute;z-index:50;top:calc(100% + 6px);left:0;right:0;background:var(--night-2);border:1px solid var(--rule-2);border-radius:var(--r-m);list-style:none;margin:0;padding:6px;box-shadow:var(--shadow);max-height:60vh;overflow:auto}.search-results li{padding:8px 10px;border-radius:var(--r-s);cursor:pointer;display:grid;gap:1px}.search-results li[aria-selected=true],.search-results li:hover{background:var(--night-3)}.search-results li .k{color:var(--blue);font-size:12px}.search-results li span{font-size:13px}.search-results li small{color:var(--ink-3);font-size:11.5px}.ws-rail{position:sticky;top:57px;align-self:start;height:calc(100vh - 57px);padding:18px 12px;border-right:1px solid var(--rule);display:flex;flex-direction:column;gap:2px;overflow-y:auto}.ws-rail .group{font-size:10.5px;letter-spacing:.14em;text-transform:uppercase;color:var(--ink-4);font-weight:600;padding:14px 10px 6px}.ws-rail a{display:flex;align-items:center;gap:10px;color:var(--ink-2);padding:8px 10px;border-radius:var(--r-s);font-size:13.5px;text-decoration:none!important;transition:background .15s,color .15s}.ws-rail a svg{flex:none;opacity:.7}.ws-rail a:hover{background:var(--night-2);color:var(--ink)}.ws-rail a[aria-current=page]{background:var(--night-3);color:var(--ivory)}.ws-rail a[aria-current=page] svg{opacity:1;color:var(--blue)}.ws-rail .rail-foot{margin-top:auto;padding:14px 10px 4px;font-size:11.5px;color:var(--ink-4);line-height:1.5;border-top:1px solid var(--rule)}.ws-rail .rail-foot button{background:none;border:0;color:var(--ink-3);padding:0;cursor:pointer;text-decoration:underline;text-underline-offset:3px}.ws-main{min-width:0;padding:26px clamp(16px,3vw,36px) 60px}.ws-main>*{max-width:1320px}.ws-foot{margin-top:48px;padding-top:18px;border-top:1px solid var(--rule);color:var(--ink-4);font-size:12px;max-width:900px}@media (max-width: 980px){.ws{grid-template-columns:1fr}.ws-rail{position:sticky;top:53px;z-index:35;height:auto;flex-direction:row;overflow-x:auto;padding:6px 10px;border-right:0;border-bottom:1px solid var(--rule);background:#090f1beb;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);scrollbar-width:none}.ws-rail::-webkit-scrollbar{display:none}.ws-rail .group,.ws-rail .rail-foot{display:none}.ws-rail a{white-space:nowrap;padding:7px 11px;font-size:13px}.store-chip .counts{display:none}}@media (max-width: 640px){.ws-top{flex-wrap:wrap;gap:10px;padding:10px 14px}.ws-top .search{order:3;flex:1 1 100%}.ws-top .brand .wordmark-name{display:none}.ws-rail{top:99px}.ws-main{padding:18px 14px 50px}}.page-head{margin:0 0 22px;display:grid;gap:6px}.page-head .eyebrow{margin:0}.page-head h1{font-family:var(--serif);font-weight:400;font-size:clamp(28px,3.2vw,38px);letter-spacing:-.025em;line-height:1.08;margin:0;color:var(--ivory)}.page-head p{margin:4px 0 0;color:var(--ink-2);max-width:760px;font-size:14.5px}.panel{background:#101a2eb8;border:1px solid var(--rule);border-radius:var(--r-l);padding:20px;margin-bottom:16px}.panel-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:14px}.panel-head h2{margin:0;font-size:15px;font-weight:620;letter-spacing:-.005em;display:flex;gap:10px;align-items:baseline}.panel-head h2 .count{font-weight:450;color:var(--ink-3);font-size:12.5px}.panel-head .hint{color:var(--ink-3);font-size:12.5px;margin:0}.panel .lede{color:var(--ink-2);margin:-6px 0 14px;font-size:13.5px;max-width:820px}.grid-main{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(320px,1fr);gap:16px;align-items:start}@media (max-width: 1180px){.grid-main{grid-template-columns:1fr}}.finding{position:relative;border-radius:var(--r-l);padding:26px 26px 22px;margin-bottom:16px;overflow:hidden;border:1px solid var(--rule);background:linear-gradient(135deg,#16233be6,#0d1525e6)}.finding:after{content:"";position:absolute;right:-120px;top:-140px;width:420px;height:420px;border-radius:50%;background:radial-gradient(closest-side,var(--glow, rgba(127, 162, 255, .12)),transparent);pointer-events:none}.finding.tone-amber{--glow: rgba(231, 169, 72, .16)}.finding.tone-alert{--glow: rgba(233, 138, 111, .18)}.finding.tone-calm{--glow: rgba(143, 193, 163, .12)}.finding-top{display:flex;gap:24px;justify-content:space-between;flex-wrap:wrap;position:relative;z-index:1}.finding-id{min-width:0;flex:1 1 380px}.finding-id .kline{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-bottom:8px;color:var(--ink-3);font-size:12.5px}.finding-id .kline .k{color:var(--blue);font-size:14px;font-weight:600}.finding-id h1{font-family:var(--serif);font-weight:400;font-size:clamp(28px,3.4vw,42px);letter-spacing:-.025em;line-height:1.05;margin:0 0 8px;color:var(--ivory)}.finding-id .meta{color:var(--ink-3);font-size:13px;display:flex;gap:6px 14px;flex-wrap:wrap}.finding-id .meta a{font-size:13px}.verdict{flex:0 1 400px;min-width:280px;border-left:1px solid var(--rule-2);padding-left:24px;display:grid;gap:8px;align-content:start}.verdict-label{font-family:var(--serif);font-size:30px;font-weight:450;letter-spacing:-.02em;line-height:1.05;display:flex;gap:10px;align-items:center}.verdict-label i{width:12px;height:12px;border-radius:50%;background:currentColor;box-shadow:0 0 0 5px color-mix(in srgb,currentColor 18%,transparent);flex:none}.verdict.tone-amber .verdict-label{color:var(--amber)}.verdict.tone-alert .verdict-label{color:var(--alert)}.verdict.tone-calm .verdict-label{color:var(--sage)}.verdict.tone-muted .verdict-label{color:var(--ink-2)}.verdict-reason{color:var(--ink-2);font-size:13px;margin:0}.authority{display:flex;gap:8px;align-items:flex-start;font-size:11.5px;color:var(--ink-3);background:#ffffff08;border:1px solid var(--rule);border-radius:var(--r-m);padding:8px 10px}.authority svg{flex:none;color:var(--sage);margin-top:1px}.authority b{color:var(--ink-2);font-weight:600}.verdict-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:4px}.finding-sentence{position:relative;z-index:1;margin:22px 0 0;padding-top:18px;border-top:1px solid var(--rule);font-family:var(--serif);font-size:clamp(17px,1.6vw,20px);line-height:1.45;color:var(--ink);max-width:980px}.finding-sentence .k{font-size:.86em;color:var(--blue)}.finding-sentence .amber{color:var(--amber)}.coverage-row{position:relative;z-index:1;display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}.chain{display:flex;align-items:stretch;gap:0;overflow-x:auto;padding:4px 2px 10px;scrollbar-width:thin}.chain-node{flex:1 1 240px;min-width:220px;max-width:380px;background:var(--night-2);border:1px solid var(--rule);border-radius:var(--r-m);padding:14px;display:grid;gap:6px;align-content:start;cursor:pointer;text-align:left;color:inherit;transition:border-color .2s,background .2s}.chain-node:hover,.chain-node:focus-visible{border-color:var(--rule-2);background:var(--night-3)}.chain-node.is-self{border-color:#7fa2ff59}.chain-node.tone-design{border-color:#e7a94873;box-shadow:inset 0 0 0 1px #e7a9481a,0 0 40px -18px #e7a94880}.chain-node .role{font-size:10.5px;letter-spacing:.12em;text-transform:uppercase;color:var(--ink-3);font-weight:600}.chain-node .k{font-size:15px;color:var(--ivory);font-weight:600}.chain-node .nm{font-size:12.5px;color:var(--ink-2);line-height:1.35}.chain-node .dt{font-size:12px;color:var(--ink-3)}.chain-node .rc{margin-top:4px;display:grid;gap:4px}.chain-link{flex:0 0 auto;width:150px;display:grid;align-content:center;justify-items:center;gap:4px;padding:0 6px;position:relative;background:none;border:0;cursor:pointer;color:inherit}.chain-link:before{content:"";position:absolute;left:0;right:0;top:50%;border-top:2px solid var(--blue);opacity:.8}.chain-link.st-disputed:before{border-top-style:dashed;border-color:var(--alert)}.chain-link.st-conditional:before{border-top-style:dotted;border-top-width:3px;border-color:var(--violet)}.chain-link.st-confirmed:before{border-color:var(--sage)}.chain-link .lbl{position:relative;background:var(--night-1);padding:3px 8px;border-radius:999px;border:1px solid var(--rule-2);font-size:11.5px;color:var(--ink-2);transition:border-color .2s,color .2s}.chain-link:hover .lbl,.chain-link:focus-visible .lbl{border-color:var(--blue);color:var(--ink)}.chain-link .sub{position:relative;font-size:10.5px;color:var(--ink-3);background:var(--night-1);padding:0 6px;margin-top:22px}.chain-timing{margin-top:10px;display:flex;gap:10px;align-items:center;flex-wrap:wrap;font-size:13px;color:var(--ink-2)}.chain-timing .amber{color:var(--amber);font-weight:600}.graph-tools{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.seg{display:inline-flex;background:var(--night-2);border:1px solid var(--rule);border-radius:999px;padding:3px}.seg button{background:none;border:0;color:var(--ink-3);padding:5px 12px;border-radius:999px;font-size:12.5px;font-weight:560;cursor:pointer}.seg button[aria-pressed=true]{background:var(--night-4);color:var(--ivory)}.graph-wrap{position:relative;overflow:auto;border-radius:var(--r-m);background:radial-gradient(900px 400px at 85% 50%,rgba(127,162,255,.06),transparent 70%),var(--night-0);border:1px solid var(--rule);scrollbar-width:thin}.graph-wrap svg{display:block}.g-col-label{fill:var(--ink-4);font-size:10.5px;letter-spacing:.12em;text-transform:uppercase;font-weight:600}.g-col-rule{stroke:var(--rule);stroke-dasharray:2 5}.g-edge{fill:none;stroke-linecap:round;transition:opacity .25s,stroke-width .2s}.g-edge.st-extracted{stroke:var(--blue);stroke-width:1.4;opacity:.55}.g-edge.st-confirmed{stroke:var(--sage);stroke-width:1.8;opacity:.8}.g-edge.st-disputed{stroke:var(--alert);stroke-width:1.6;stroke-dasharray:6 5;opacity:.85}.g-edge.st-conditional{stroke:var(--violet);stroke-width:2;stroke-dasharray:1 5;opacity:.9}.g-edge.is-critical{stroke:var(--amber);opacity:1;stroke-width:2.4;filter:drop-shadow(0 0 6px rgba(231,169,72,.45))}.g-edge.is-dim{opacity:.1}.g-edge-hit{fill:none;stroke:transparent;stroke-width:14;cursor:pointer}.g-edge-g:hover .g-edge,.g-edge-g:focus-visible .g-edge{opacity:1;stroke-width:3}.g-edge-g:focus-visible{outline:none}.g-edge-g:focus-visible .g-edge{filter:drop-shadow(0 0 4px var(--blue))}.g-node{cursor:pointer}.g-node:focus-visible{outline:none}.g-node .halo{fill:transparent;stroke:transparent;stroke-width:2;transition:stroke .2s}.g-node:hover .halo,.g-node:focus-visible .halo,.g-node.is-selected .halo{stroke:var(--blue)}.g-node .dot{stroke:var(--night-0);stroke-width:2;transition:r .2s}.g-node .dot.tone-clean{fill:#9aa7c2}.g-node .dot.tone-recall{fill:var(--night-0);stroke:var(--amber);stroke-width:2}.g-node .dot.tone-design{fill:var(--amber)}.g-node .dot.unread{stroke-dasharray:2.5 2.5;stroke:var(--ink-3);stroke-width:1.6}.g-node.is-self .dot{fill:var(--ivory);stroke:var(--blue);stroke-width:3}.g-node .glow{fill:var(--amber);opacity:.22;filter:blur(6px)}.g-node .lk{fill:var(--ink);font-family:var(--mono);font-size:11.5px;font-weight:600}.g-node .ln{fill:var(--ink-3);font-size:10.5px}.g-node.is-dim{opacity:.2}.g-node.is-self .lk{fill:var(--ivory);font-size:12.5px}.g-more{cursor:pointer}.g-more rect{fill:var(--night-2);stroke:var(--rule-2)}.g-more text{fill:var(--ink-2);font-size:11.5px}.g-more:hover rect,.g-more:focus-visible rect{stroke:var(--blue)}.g-legend{display:flex;gap:8px 16px;flex-wrap:wrap;margin-top:12px;font-size:11.5px;color:var(--ink-3);align-items:center}.g-legend .sw{display:inline-flex;align-items:center;gap:6px}.g-legend .sw i{width:10px;height:10px;border-radius:50%;display:inline-block}.g-legend .sw i.lg-design{background:var(--amber)}.g-legend .sw i.lg-recall{border:2px solid var(--amber)}.g-legend .sw i.lg-clean{background:#9aa7c2}.g-legend .sw i.lg-unread{border:1.5px dashed var(--ink-3)}.g-legend .sep{width:1px;height:14px;background:var(--rule-2)}.graph-hint{font-size:12px;color:var(--ink-4);margin-top:8px}.tl-grid{stroke:var(--rule)}.tl-axis{fill:var(--ink-4);font-size:10.5px;font-variant-numeric:tabular-nums}.tl-band{fill:#7fa2ff0f}.tl-rowhit{fill:transparent}.tl-row:hover .tl-rowhit,.tl-row:focus-visible .tl-rowhit{fill:#ffffff08}.tl-row:focus-visible{outline:none}.tl-edge{fill:none;stroke:var(--ink-4);stroke-width:1.1}.tl-edge.on{stroke:var(--amber);stroke-width:2}.tl-dia.design{fill:var(--amber)}.tl-dia.other{fill:none;stroke:var(--amber);stroke-width:1.3}.tl-rlink{stroke:var(--amber);stroke-width:1;stroke-dasharray:2 3;opacity:.7}.tl-label{fill:var(--ink-2);font-size:11.5px}.tl-label .lk{font-family:var(--mono);fill:var(--ink);font-weight:600}.tl-gen{fill:var(--ink-4);font-size:10px}.tl-clear{stroke:var(--blue);stroke-dasharray:3 3;opacity:.7}.review-item{border:1px solid var(--rule);border-radius:var(--r-m);padding:14px 16px;margin-bottom:10px;background:var(--night-2)}.review-item.tone-amber{border-left:3px solid var(--amber)}.review-item.tone-violet{border-left:3px solid var(--violet)}.review-item.tone-alert{border-left:3px solid var(--alert)}.review-item.tone-muted{border-left:3px solid var(--ink-4)}.review-item h3{margin:0 0 8px;font-size:13.5px;font-weight:620;line-height:1.4;display:flex;gap:8px;align-items:baseline}.review-item dl{margin:0;display:grid;grid-template-columns:92px 1fr;gap:4px 12px;font-size:12.5px}.review-item dt{color:var(--ink-4);font-size:10.5px;letter-spacing:.1em;text-transform:uppercase;font-weight:600;padding-top:2px}.review-item dd{margin:0;color:var(--ink-2)}.review-item .acts{display:flex;gap:6px;flex-wrap:wrap;margin-top:10px}.review-item .links{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px}@media (max-width: 520px){.review-item dl{grid-template-columns:1fr}}.signal{border-top:1px solid var(--rule);padding:12px 0}.signal:first-of-type{border-top:0}.signal-head{display:flex;gap:10px;align-items:flex-start;width:100%;background:none;border:0;padding:0;color:inherit;text-align:left;cursor:pointer}.signal-head .t{flex:1;font-size:13.5px;line-height:1.45}.signal-head .chev{color:var(--ink-4);transition:transform .25s var(--ease-out);flex:none;margin-top:2px}.signal-head[aria-expanded=true] .chev{transform:rotate(90deg)}.sev{font-size:10px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;padding:3px 6px;border-radius:4px;flex:none;margin-top:1px}.sev-high{background:var(--alert-soft);color:var(--alert)}.sev-medium{background:var(--amber-soft);color:var(--amber)}.sev-low{background:var(--night-3);color:var(--amber-2)}.sev-info{background:var(--night-3);color:var(--ink-3)}.signal-body{padding:10px 0 2px;display:grid;gap:8px}.recall{display:grid;gap:4px;padding:10px 12px;border-radius:var(--r-s);background:var(--night-1);border:1px solid var(--rule)}.recall-h{display:flex;gap:8px;flex-wrap:wrap;align-items:center;font-size:12.5px}.recall-h .k{color:var(--ink);font-weight:600}.recall-r{font-size:12.5px;color:var(--ink-3);line-height:1.45}.cit{border-top:1px solid var(--rule);padding:12px 0;display:grid;gap:8px}.cit:first-of-type{border-top:0;padding-top:0}.cit.is-rejected{opacity:.55}.cit-h{display:flex;gap:8px;align-items:center;flex-wrap:wrap;font-size:13px}.cit-h .k{color:var(--blue);font-weight:600;cursor:pointer;background:none;border:0;padding:0}.cit-a{display:flex;gap:6px;align-items:center;flex-wrap:wrap}.quote{font-family:var(--serif);font-size:14.5px;line-height:1.5;color:var(--paper-ink);background:var(--paper);border-radius:4px;padding:10px 12px 10px 14px;position:relative;margin:0}.quote:before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--blue-2);border-radius:4px 0 0 4px}.quote mark{background:#5b82f02e;color:#1d3f9e;font-family:var(--mono);font-size:.88em;padding:0 2px;border-radius:2px}.quote.is-ocr:before{background:var(--amber-2)}.memo p{margin:0 0 10px;font-family:var(--serif);font-size:15px;line-height:1.55;color:var(--ink)}.memo .src{font-size:11.5px;color:var(--ink-3);margin-bottom:10px}.hist{border-top:1px solid var(--rule);padding:10px 0;display:grid;gap:4px;font-size:12.5px}.hist:first-of-type{border-top:0;padding-top:0}.hist-h{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.hist-h .k{color:var(--ink);font-weight:600}.stale{color:var(--amber);font-size:12px}.drawer-scrim{position:fixed;top:0;right:0;bottom:0;left:0;z-index:60;background:#03060c80;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);animation:fadeIn .25s ease}.drawer{position:fixed;z-index:61;top:0;right:0;bottom:0;width:min(520px,100vw);background:var(--night-2);border-left:1px solid var(--rule-2);box-shadow:-30px 0 80px -30px #000000b3;display:flex;flex-direction:column;animation:slideIn .4s var(--ease-out)}.drawer-head{display:flex;align-items:flex-start;gap:12px;padding:18px 20px 14px;border-bottom:1px solid var(--rule)}.drawer-head .t{flex:1;min-width:0}.drawer-head .eyebrow{margin:0 0 6px}.drawer-head h2{margin:0;font-family:var(--serif);font-weight:420;font-size:24px;letter-spacing:-.02em;line-height:1.15;color:var(--ivory)}.drawer-head h2 .k{font-size:.82em;color:var(--blue)}.drawer-body{padding:18px 20px 30px;overflow-y:auto;display:grid;gap:18px;align-content:start}.drawer-sec h3{font-size:10.5px;letter-spacing:.14em;text-transform:uppercase;color:var(--ink-4);margin:0 0 8px;font-weight:650}.prov-grid{display:grid;grid-template-columns:120px 1fr;gap:6px 14px;font-size:12.5px;margin:0}.prov-grid dt{color:var(--ink-3)}.prov-grid dd{margin:0;color:var(--ink);word-break:break-word}.prov-grid dd .mono{font-size:11.5px;color:var(--ink-2)}.page-card{display:flex;gap:14px;align-items:center;background:var(--paper);color:var(--paper-ink);border-radius:var(--r-m);padding:12px 14px;text-decoration:none!important;transition:transform .25s var(--ease-out),box-shadow .25s;box-shadow:var(--shadow)}.page-card:hover{transform:translateY(-1px)}.page-card .sheet{width:42px;height:54px;flex:none;background:#fff;border:1px solid #d9d1bf;border-radius:2px;position:relative;box-shadow:2px 2px #e6dcc7;display:grid;place-items:center;font-family:var(--mono);font-size:11px;color:#2d56c4;font-weight:600}.page-card .sheet:before{content:"";position:absolute;left:7px;right:7px;top:9px;height:18px;background:repeating-linear-gradient(#e7e0d0 0 2px,transparent 2px 5px)}.page-card .sheet b{position:relative;margin-top:22px}.page-card .tx{display:grid;gap:2px;font-size:13px}.page-card .tx b{font-weight:650}.page-card .tx span{font-size:11.5px;color:var(--paper-mute)}.drawer-acts{display:flex;gap:8px;flex-wrap:wrap}.drawer .note{font-size:12px;color:var(--ink-3)}@keyframes slideIn{0%{transform:translate(40px);opacity:0}to{transform:none;opacity:1}}@keyframes fadeIn{0%{opacity:0}}@media (prefers-reduced-motion: reduce){.drawer,.drawer-scrim{animation:none}}.tbl-wrap{overflow-x:auto;margin:0 -4px}.tbl{width:100%;border-collapse:collapse;font-size:13px}.tbl th{text-align:left;font-size:10.5px;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-4);font-weight:650;border-bottom:1px solid var(--rule-2);padding:8px 10px;vertical-align:bottom;white-space:nowrap}.tbl td{border-bottom:1px solid var(--rule);padding:11px 10px;vertical-align:top}.tbl tr.click{cursor:pointer;transition:background .15s}.tbl tr.click:hover,.tbl tr.click:focus-visible{background:#7fa2ff0d;outline:none}.tbl td .k{color:var(--blue);font-weight:600}.tbl td .sub{color:var(--ink-3);font-size:12px}.tbl tr.is-conditional td:first-child{box-shadow:inset 3px 0 0 var(--violet)}.bigstats{display:flex;gap:clamp(20px,4vw,52px);flex-wrap:wrap;margin:4px 0 6px}.bigstats div{display:grid;gap:2px}.bigstats b{font-family:var(--serif);font-size:40px;font-weight:400;line-height:1;color:var(--ivory);font-variant-numeric:tabular-nums}.bigstats .amber b{color:var(--amber)}.bigstats .violet b{color:var(--violet)}.bigstats span{font-size:12px;color:var(--ink-3);max-width:220px}.row-in{display:flex;gap:8px;flex-wrap:wrap}.row-in .field{flex:1 1 260px}.tags{display:flex;flex-wrap:wrap;gap:6px}.tag-btn{background:var(--night-3);border:1px solid var(--rule);color:var(--ink-2);font-size:12px;padding:5px 10px;border-radius:999px;cursor:pointer}.tag-btn:hover{border-color:var(--rule-2);color:var(--ink)}.tag-btn .k{color:var(--blue)}.note-box{font-size:12.5px;color:var(--ink-2);background:var(--night-1);border:1px solid var(--rule);border-radius:var(--r-m);padding:10px 12px}.note-box.amber{border-color:#e7a9484d}.note-box.violet{border-color:#b7a4f54d}.err{color:var(--alert);font-size:13px}.ok{color:var(--sage);font-size:12.5px}.skeleton{background:linear-gradient(90deg,var(--night-2),var(--night-3),var(--night-2));background-size:200% 100%;animation:shimmer 1.4s linear infinite;border-radius:var(--r-m)}@keyframes shimmer{to{background-position:-200% 0}}@media (prefers-reduced-motion: reduce){.skeleton{animation:none}}.loading-thread{display:flex;gap:10px;align-items:center;color:var(--ink-3);font-size:13px;padding:30px 0}.loading-thread i{width:60px;height:2px;background:linear-gradient(90deg,transparent,var(--blue),transparent);background-size:200% 100%;animation:shimmer 1.2s linear infinite}.home-hero{padding:10px 0 6px}.home-cases{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:12px;margin-top:6px}.case{background:var(--night-2);border:1px solid var(--rule);border-radius:var(--r-l);padding:16px;display:grid;gap:6px;text-align:left;color:inherit;cursor:pointer;transition:border-color .2s,transform .3s var(--ease-out)}.case:hover,.case:focus-visible{border-color:var(--rule-2);transform:translateY(-2px)}.case .k{color:var(--blue);font-size:12.5px}.case h3{margin:0;font-family:var(--serif);font-weight:450;font-size:19px}.case p{margin:0;font-size:12.5px;color:var(--ink-3)}.method ol,.method ul{padding-left:20px;color:var(--ink-2)}.method li{margin-bottom:8px}.method li b{color:var(--ink)}.method h3{font-size:14px;margin:18px 0 8px}::view-transition-old(root),::view-transition-new(root){animation-duration:.6s;animation-timing-function:var(--ease-io)}@media (prefers-reduced-motion: reduce){::view-transition-old(root),::view-transition-new(root){animation:none}}@media (max-width: 640px){.finding{padding:20px 18px 18px}.verdict{border-left:0;padding-left:0;border-top:1px solid var(--rule-2);padding-top:16px;flex-basis:100%}.verdict-label{font-size:26px}.panel{padding:16px}}@media (pointer: coarse){.search kbd{display:none}}@media (max-width: 980px){.ws-rail{-webkit-mask-image:linear-gradient(90deg,#000 85%,transparent);mask-image:linear-gradient(90deg,#000 85%,transparent);padding-right:40px}}.film-stage .film-gl,.film-stage .film-story{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%}.film-grid{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;background-image:linear-gradient(rgba(236,228,210,.032) 1px,transparent 1px),linear-gradient(90deg,rgba(236,228,210,.032) 1px,transparent 1px);background-size:96px 96px;background-position:center;-webkit-mask-image:radial-gradient(ellipse at 55% 45%,#000 20%,transparent 75%);mask-image:radial-gradient(ellipse at 55% 45%,#000 20%,transparent 75%)}.film-hud{position:fixed;left:clamp(16px,4vw,44px);bottom:18px;z-index:20;display:flex;gap:12px;align-items:center;font-family:var(--mono);font-size:11px;letter-spacing:.02em;color:var(--ink-3);padding:7px 12px;border-radius:999px;background:#070c178c;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border:1px solid var(--rule);max-width:calc(100vw - 32px);overflow:hidden;white-space:nowrap}.film-hud .hud-n{color:var(--blue)}.film-hud .hud-name{color:var(--ivory);font-family:var(--sans);font-weight:600;letter-spacing:.08em;text-transform:uppercase;font-size:10.5px}.film-hud .hud-read{color:var(--ink-2);overflow:hidden;text-overflow:ellipsis}@media (max-width: 860px){.film-hud .hud-read{display:none}.film-hud{bottom:12px}}.chapter-label span{font-size:12px}.chapter-copy{position:relative}.chapter-copy:before{content:"";position:absolute;left:-18px;top:34px;width:1px;height:64px;background:linear-gradient(var(--blue),transparent)}.doc{position:relative}.doc:after{content:"";position:absolute;top:-6px;right:-6px;bottom:-6px;left:-6px;border:1px solid rgba(127,162,255,.25);border-radius:8px;pointer-events:none;-webkit-mask:linear-gradient(#000 0 0) top left / 14px 14px no-repeat,linear-gradient(#000 0 0) bottom right / 14px 14px no-repeat;mask:linear-gradient(#000 0 0) top left / 14px 14px no-repeat,linear-gradient(#000 0 0) bottom right / 14px 14px no-repeat}@media (max-width: 860px){.chapter-copy:before{display:none}}.chapter.place-right{padding-right:clamp(16px,9vw,150px)}.handoff{min-height:135svh}@media (max-width: 860px){.chapter{min-height:190svh;align-items:flex-start;padding-top:105svh;padding-bottom:20svh}.handoff{padding-top:40svh}}.g-flow{fill:none;stroke:#ffd79a;stroke-width:2.6;stroke-linecap:round;stroke-dasharray:2 26;opacity:.9;animation:g-flow 2.4s linear infinite;pointer-events:none;filter:drop-shadow(0 0 4px rgba(231,169,72,.9))}@keyframes g-flow{to{stroke-dashoffset:28}}.chain-link.st-extracted:after,.chain-link.st-confirmed:after{content:"";position:absolute;left:0;right:0;top:calc(50% - 1px);height:2px;background:linear-gradient(90deg,transparent,rgba(255,215,154,.95),transparent);background-size:40% 100%;background-repeat:no-repeat;animation:chain-signal 2.6s var(--ease-io) infinite;animation-direction:reverse;pointer-events:none}@keyframes chain-signal{0%{background-position:-40% 0}to{background-position:140% 0}}.finding{isolation:isolate}.finding:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1;pointer-events:none;background-image:linear-gradient(rgba(236,228,210,.03) 1px,transparent 1px),linear-gradient(90deg,rgba(236,228,210,.03) 1px,transparent 1px);background-size:48px 48px;-webkit-mask-image:linear-gradient(110deg,transparent 30%,#000 75%);mask-image:linear-gradient(110deg,transparent 30%,#000 75%)}.finding:after{animation:glow-drift 18s ease-in-out infinite alternate}@keyframes glow-drift{0%{transform:translate(0)}to{transform:translate(-90px,40px) scale(1.15)}}.finding .kline:before{content:"[ dossier ]";font-family:var(--mono);color:var(--ink-4);font-size:11px;margin-right:2px}.panel{position:relative}.finding,.panel#review{background-clip:padding-box}.corner-marks:after{content:"";position:absolute;top:8px;right:8px;bottom:8px;left:8px;pointer-events:none;border:1px solid rgba(127,162,255,.35);border-radius:10px;-webkit-mask:linear-gradient(#000 0 0) top left / 12px 12px no-repeat,linear-gradient(#000 0 0) top right / 12px 12px no-repeat,linear-gradient(#000 0 0) bottom left / 12px 12px no-repeat,linear-gradient(#000 0 0) bottom right / 12px 12px no-repeat;mask:linear-gradient(#000 0 0) top left / 12px 12px no-repeat,linear-gradient(#000 0 0) top right / 12px 12px no-repeat,linear-gradient(#000 0 0) bottom left / 12px 12px no-repeat,linear-gradient(#000 0 0) bottom right / 12px 12px no-repeat}@media (prefers-reduced-motion: reduce){.g-flow{animation:none;stroke-dasharray:none;opacity:.35}.chain-link:after{animation:none!important;display:none}.finding:after{animation:none}}.film-top.is-solid{-webkit-backdrop-filter:none;backdrop-filter:none;background:#080d18eb}.film-hud{transition:opacity .4s var(--ease-out),transform .4s var(--ease-out)}.film-hud.is-away{opacity:0;transform:translateY(10px);pointer-events:none}.depth-contrast{border-color:#e7a94847;background:linear-gradient(135deg,#16233bd1,#0d1525d1)}.dc-grid{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:14px;align-items:stretch}.dc-col{background:var(--night-2);border:1px solid var(--rule);border-radius:var(--r-m);padding:16px;display:grid;gap:10px;align-content:start}.dc-col.is-deep{border-color:#e7a94873;box-shadow:inset 0 0 0 1px #e7a94814,0 0 48px -22px #e7a9488c}.dc-col p{margin:0;font-size:14px;line-height:1.55;color:var(--ink-2)}.dc-col .k{color:var(--blue)}.dc-col .amber{color:var(--amber);font-weight:600}.dc-depth{font-size:11px!important;letter-spacing:.12em;text-transform:uppercase;color:var(--ink-3)!important;font-weight:600}.dc-depth b{color:var(--ivory);font-weight:650}.dc-verdict{font-family:var(--serif);font-size:24px;font-weight:450;letter-spacing:-.015em;line-height:1.1;display:flex;gap:10px;align-items:center}.dc-verdict i{width:10px;height:10px;border-radius:50%;background:currentColor;box-shadow:0 0 0 4px color-mix(in srgb,currentColor 18%,transparent);flex:none}.dc-verdict.tone-amber{color:var(--amber)}.dc-verdict.tone-alert{color:var(--alert)}.dc-verdict.tone-calm{color:var(--sage)}.dc-verdict.tone-muted{color:var(--ink-2)}.dc-step{display:grid;align-content:center;justify-items:center;position:relative;width:84px}.dc-step:before{content:"";position:absolute;left:0;right:0;top:50%;border-top:2px solid var(--amber);opacity:.7}.dc-step span{position:relative;background:var(--night-1);border:1px solid rgba(231,169,72,.5);color:var(--amber);border-radius:999px;padding:3px 9px;font-size:11.5px;white-space:nowrap}.dc-route{list-style:none;margin:14px 0 0;padding:0;display:grid;gap:0}.dc-route li{display:grid;grid-template-columns:190px minmax(0,1fr) auto;gap:6px 14px;align-items:baseline;padding:10px 2px;border-top:1px solid var(--rule);font-size:13px}.dc-route .dc-n{color:var(--ivory);font-size:12.5px}.dc-route .dc-q{color:var(--ink-2);font-family:var(--serif);font-size:14.5px;line-height:1.4}.dc-route .is-recall .dc-n{color:var(--amber)}.dc-route .is-recall .dc-q{font-family:inherit;font-size:13px}.dc-route .dc-q .k{color:var(--blue);font-size:12.5px}.dc-route .dc-a{display:flex;gap:6px;align-items:center;flex-wrap:wrap;justify-content:flex-end}.dc-route .dc-a a{font-size:12.5px;white-space:nowrap}.dc-foot{margin:10px 0 0}@media (max-width: 860px){.dc-grid{grid-template-columns:1fr}.dc-step{width:auto;height:34px}.dc-step:before{left:50%;right:auto;top:0;bottom:0;border-top:0;border-left:2px solid var(--amber)}.dc-route li{grid-template-columns:1fr}.dc-route .dc-a{justify-content:flex-start}}.hero-alt{display:flex;gap:12px;align-items:baseline;flex-wrap:wrap;margin-top:20px;max-width:40em;padding:10px 14px;border:1px solid rgba(231,169,72,.3);border-radius:var(--r-m);background:#090f1b8c;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);color:var(--ink-2);font-size:14px;line-height:1.5;text-decoration:none!important;transition:border-color .2s,background .2s}.hero-alt:hover,.hero-alt:focus-visible{border-color:#e7a94899;background:#101a2ebf}.hero-alt .k{color:var(--blue)}.hero-alt b{color:var(--amber);font-weight:600;white-space:nowrap}.hero-alt-tag{font-size:10.5px;letter-spacing:.14em;text-transform:uppercase;color:var(--amber);font-weight:650;white-space:nowrap}.dc-route .dc-q mark{background:#7fa2ff29;color:var(--ivory);border-radius:3px;padding:0 3px;font-family:var(--mono);font-size:.86em}.dc-col a.mono{white-space:nowrap} diff --git a/web/dist/index.html b/web/dist/index.html index e2b7847..3b46a58 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -7,8 +7,8 @@ - - + +
diff --git a/web/e2e/review-state.spec.js b/web/e2e/review-state.spec.js new file mode 100644 index 0000000..b53d9cf --- /dev/null +++ b/web/e2e/review-state.spec.js @@ -0,0 +1,113 @@ +import { test, expect } from '@playwright/test' +import { startIsolatedApi } from './server.mjs' + +/* + After a review the provenance drawer shows the citation exactly as the graph now stores it: the review, the + reviewer and the PDF version the review was made on. The review buttons and status follow that record, never a + locally patched copy of the old one. + K200480 -> K131982 and K200480 -> K130077 are machine-extracted, never-reviewed predicate links in K251770's + lineage (the two-hop showcase); each test uses its own, because clearing a review still records the PDF version. + K251889 -> K251661 is seeded by e2e/seed_outdated_review.py: a person confirmed it on an earlier PDF version. + Re-reviewing it makes the review current, and nothing in the API can make a review outdated again, so that test + runs against its own API on a freshly seeded store copy: every attempt, retry or repeat starts from the same state. +*/ +const SRC = 'K200480', DST = 'K131982', DST2 = 'K130077' + +async function openHop(page, dst = DST) { + await page.goto('/#/check/K251770') + const row = page.getByTestId('depth-contrast').locator('.dc-route li').filter({ hasText: `${SRC} → ${dst}` }) + await row.getByRole('button', { name: 'Provenance' }).click() + const drawer = page.getByTestId('provenance') + await expect(drawer).toBeVisible() + await expect(drawer.getByTestId('edge-review')).toHaveText('not reviewed by a person') + await expect(drawer.getByTestId('edge-trust')).toHaveText('Machine-extracted') + return drawer +} + +test.describe('provenance review state', () => { + // clear only the edge a test reviewed: clearing records the PDF version too, so it must not touch the others + const touched = new Set() + test.afterEach(async ({ request }) => { + for (const dst of touched) await request.post('/api/citation/review', { data: { src: SRC, dst, status: '' } }) + touched.clear() + }) + + test('reject then restore follows the graph', async ({ page }) => { + touched.add(DST) + const drawer = await openHop(page) + const panel = page.getByTestId('depth-contrast') + + await drawer.getByRole('button', { name: 'Reject citation' }).click() + await expect(drawer.getByRole('status')).toContainText('Recorded: rejected') + await expect(drawer.getByTestId('edge-review')).toHaveText('rejected by user') + await expect(drawer.getByTestId('edge-trust')).toHaveText('Rejected by a person') + await expect(drawer.getByRole('button', { name: 'Restore citation' })).toBeVisible() + await expect(drawer.getByRole('button', { name: 'Reject citation' })).toHaveCount(0) + await expect(drawer).not.toContainText('earlier version') + await expect(panel.locator('.dc-route .dc-n', { hasText: `${SRC} → ${DST}` })).toHaveCount(0) + + await drawer.getByRole('button', { name: 'Restore citation' }).click() + await expect(drawer.getByRole('status')).toContainText('Review cleared') + await expect(drawer.getByTestId('edge-review')).toHaveText('not reviewed by a person') + await expect(drawer.getByTestId('edge-trust')).toHaveText('Machine-extracted') + await expect(drawer.getByRole('button', { name: 'Reject citation' })).toBeVisible() + await expect(panel.locator('.dc-route')).toContainText(`${SRC} → ${DST}`) // the depth contrast follows too + }) + + test('confirm then unconfirm follows the graph', async ({ page }) => { + touched.add(DST2) + const drawer = await openHop(page, DST2) + + await drawer.getByRole('button', { name: 'Confirm citation' }).click() + await expect(drawer.getByRole('status')).toContainText('Recorded: confirmed') + await expect(drawer.getByTestId('edge-review')).toHaveText('confirmed by user') + await expect(drawer.getByTestId('edge-trust')).toHaveText('Confirmed by a person') + await expect(drawer.getByRole('button', { name: 'Clear confirmation' })).toBeVisible() + await expect(drawer).not.toContainText('earlier version') + + await drawer.getByRole('button', { name: 'Clear confirmation' }).click() + await expect(drawer.getByRole('status')).toContainText('Review cleared') + await expect(drawer.getByTestId('edge-review')).toHaveText('not reviewed by a person') + await expect(drawer.getByTestId('edge-trust')).toHaveText('Machine-extracted') + await expect(drawer.getByRole('button', { name: 'Confirm citation' })).toBeVisible() + }) + + test('the review response carries the authoritative edge, with both PDF versions', async ({ request }) => { + touched.add(DST) + const r = await (await request.post('/api/citation/review', { data: { src: SRC, dst: DST, status: 'rejected' } })).json() + const c = r.citation + expect([c.src, c.dst, c.review, c.reviewer, c.trust, c.in_lineage]).toEqual([SRC, DST, 'rejected', 'user', null, false]) + expect(c.source_sha256).toMatch(/^[0-9a-f]{64}$/) + expect(c.reviewed_source_sha256).toBe(c.source_sha256) + expect(c.page).toBe(4) + }) +}) + +const withOutdatedReview = test.extend({ + // test-scoped: started before and torn down after each attempt, so a retry never sees a consumed seed + outdatedApi: async ({}, use) => { + const api = await startIsolatedApi({ seed: 'seed_outdated_review.py' }) + try { await use(api.url) } finally { await api.stop() } + }, +}) + +withOutdatedReview('a review made on an earlier PDF is shown as outdated until a person reviews it again', async ({ page, outdatedApi }) => { + await page.goto(`${outdatedApi}/#/check/K251889`) + const cit = page.locator('.cit', { has: page.getByTestId('cit-status-K251661') }) + await cit.getByRole('button', { name: /Provenance/ }).click() + const drawer = page.getByTestId('provenance') + await expect(drawer.getByTestId('edge-review')).toHaveText('confirmed by user on an earlier version of the summary; needs re-review') + await expect(drawer).toContainText('A person reviewed an earlier version of the FDA summary; it needs re-review') + await expect(drawer.getByTestId('edge-trust')).not.toHaveText('Confirmed by a person') + // an outdated confirmation is not a current one: the drawer offers to confirm, not to clear + await expect(drawer.getByRole('button', { name: 'Confirm citation' })).toBeVisible() + await expect(drawer.getByRole('button', { name: 'Clear confirmation' })).toHaveCount(0) + + await drawer.getByRole('button', { name: 'Confirm citation' }).click() + await expect(drawer.getByRole('status')).toContainText('Recorded: confirmed') + await expect(drawer.getByTestId('edge-review')).toHaveText('confirmed by user') + await expect(drawer.getByTestId('edge-trust')).toHaveText('Confirmed by a person') + await expect(drawer).not.toContainText('earlier version') + await expect(drawer.getByRole('button', { name: 'Clear confirmation' })).toBeVisible() + await expect(page.getByTestId('cit-status-K251661')).toHaveText('Confirmed') +}) diff --git a/web/e2e/seed_outdated_review.py b/web/e2e/seed_outdated_review.py new file mode 100644 index 0000000..da1545e --- /dev/null +++ b/web/e2e/seed_outdated_review.py @@ -0,0 +1,24 @@ +"""Give the throwaway e2e store one genuinely outdated review: a person's confirmation of K251889 -> K251661 +recorded against an earlier version of K251889's summary PDF. This is the state a summary refresh leaves behind +when the PDF changed (tests/test_summary_refresh.py); the browser suite cannot fetch FDA, so it is set directly. +Run by e2e/server.mjs startIsolatedApi on a fresh store copy before its API opens it; never on data/forebear.rl.""" +import sys +from pathlib import Path + +sys.path.insert(0, str(Path(__file__).resolve().parents[2])) +from forebear.graph import open_graph # noqa: E402 + +SRC, DST = "K251889", "K251661" +EARLIER_SHA256 = "0" * 64 + +db = Path(sys.argv[1]).resolve() +if db.name == "forebear.rl" and db.parent.name == "data": + sys.exit("refusing to seed the shipped store") +g = open_graph(db) +rows = g.q("""MATCH (:Device {k:$src})-[r:CITES]->(:Device {k:$dst}) + SET r.review = 'confirmed', r.reviewer = 'user', r.review_note = 'e2e seed: reviewed an earlier PDF', + r.reviewed_at = datetime(), r.reviewed_source_sha256 = $old + RETURN r.source_sha256 AS current""", {"src": SRC, "dst": DST, "old": EARLIER_SHA256}) +g.close() +if not rows or not rows[0]["current"] or rows[0]["current"] == EARLIER_SHA256: + sys.exit(f"could not seed an outdated review on {SRC} -> {DST}") diff --git a/web/e2e/serve.mjs b/web/e2e/serve.mjs index 144d12e..131c84a 100644 --- a/web/e2e/serve.mjs +++ b/web/e2e/serve.mjs @@ -1,19 +1,7 @@ -// Starts the real FastAPI app on a throwaway copy of the shipped store, so end-to-end writes -// (reviews, saved assessments) never touch the committed data/forebear.rl. -import { copyFileSync, mkdirSync } from 'node:fs' -import { spawn } from 'node:child_process' -import { resolve } from 'node:path' +// The shared API for the browser suite (playwright.config.js webServer), on a throwaway copy of the shipped store. +import { freshStore, spawnApi } from './server.mjs' -const root = resolve(import.meta.dirname, '..', '..') -const live = resolve(root, 'data', 'live') -mkdirSync(live, { recursive: true }) -const db = resolve(live, 'e2e.rl') -copyFileSync(resolve(root, 'data', 'forebear.rl'), db) -const py = process.platform === 'win32' ? resolve(root, '.venv', 'Scripts', 'python.exe') : resolve(root, '.venv', 'bin', 'python') -const port = process.env.E2E_PORT || '8767' -const child = spawn(py, ['-m', 'uvicorn', 'forebear.api:app', '--port', port], { - cwd: root, stdio: 'inherit', env: { ...process.env, FOREBEAR_DB: db }, -}) +const child = spawnApi(freshStore('e2e.rl'), process.env.E2E_PORT || '8767') const stop = () => child.kill() process.on('SIGINT', stop); process.on('SIGTERM', stop); process.on('exit', stop) child.on('exit', (code) => process.exit(code ?? 0)) diff --git a/web/e2e/server.mjs b/web/e2e/server.mjs new file mode 100644 index 0000000..a3fd7b4 --- /dev/null +++ b/web/e2e/server.mjs @@ -0,0 +1,59 @@ +// Starting the real FastAPI app for the browser suite, always on a throwaway copy of the shipped store, so +// end-to-end writes (reviews, saved assessments) never touch the committed data/forebear.rl. +import { copyFileSync, mkdirSync, rmSync } from 'node:fs' +import { spawn, spawnSync } from 'node:child_process' +import { once } from 'node:events' +import { createServer } from 'node:net' +import { resolve } from 'node:path' + +export const root = resolve(import.meta.dirname, '..', '..') +const live = resolve(root, 'data', 'live') +const py = process.platform === 'win32' ? resolve(root, '.venv', 'Scripts', 'python.exe') : resolve(root, '.venv', 'bin', 'python') + +/** Copy the shipped store to data/live/ (gitignored) and return its path. */ +export function freshStore(name) { + mkdirSync(live, { recursive: true }) + const db = resolve(live, name) + copyFileSync(resolve(root, 'data', 'forebear.rl'), db) + return db +} + +/** Run the API on `db`. The API is the store's only writer, so a store is seeded before this, never during. */ +export function spawnApi(db, port, extra = []) { + return spawn(py, ['-m', 'uvicorn', 'forebear.api:app', '--port', String(port), ...extra], { + cwd: root, stdio: 'inherit', env: { ...process.env, FOREBEAR_DB: db }, + }) +} + +async function freePort() { + const s = createServer().listen(0, '127.0.0.1') + await once(s, 'listening') + const { port } = s.address() + s.close() + await once(s, 'close') + return port +} + +/** A private API on a fresh copy of the store, for a test whose starting state its own steps consume. + `seed` names a script in this folder that prepares the copy before the API opens it. */ +export async function startIsolatedApi({ seed } = {}) { + const db = freshStore(`e2e-isolated-${process.pid}-${Date.now()}.rl`) + const stop = async (child) => { + if (child && child.exitCode === null) { child.kill(); await once(child, 'exit') } + rmSync(db, { force: true }) + } + if (seed) { + const r = spawnSync(py, [resolve(import.meta.dirname, seed), db], { cwd: root, stdio: 'inherit' }) + if (r.status !== 0) { await stop(null); throw new Error(`seed ${seed} failed with status ${r.status}`) } + } + const port = await freePort() + const child = spawnApi(db, port, ['--log-level', 'warning']) + const url = `http://127.0.0.1:${port}` + for (let i = 0; i < 200; i++) { + if (child.exitCode !== null) break + try { if ((await fetch(`${url}/api/health`)).ok) return { url, stop: () => stop(child) } } catch { /* not up yet */ } + await new Promise((r) => setTimeout(r, 100)) + } + await stop(child) + throw new Error(`isolated API on ${url} did not become healthy`) +} diff --git a/web/e2e/two-hop.spec.js b/web/e2e/two-hop.spec.js new file mode 100644 index 0000000..14b972d --- /dev/null +++ b/web/e2e/two-hop.spec.js @@ -0,0 +1,132 @@ +import { test, expect } from '@playwright/test' +import facts from '../src/story/two-hop.json' with { type: 'json' } +import { depthContrast, excerpt } from '../src/workspace/depth.js' + +/* + The two-hop showcase: K251770's direct predicate has no recall on file, so a one-generation query reports no + design-recall signal; one more hop reaches two REMstar clearances on Class I design recall Z-1974-2021. + Values come from src/story/two-hop.json, which tests/test_two_hop_story.py checks against the shipped store. +*/ +const c = facts.candidate, p = facts.predicate, r = facts.recall + +test.describe('two-hop discovery', () => { + test('landing to the depth-1 vs depth-2 contrast in under 15 seconds', async ({ page }) => { + const t0 = Date.now() + await page.goto('/') + await page.keyboard.press('Escape') // the opening film is skippable + await page.getByTestId('hero-two-hop').click() + await expect(page).toHaveURL(new RegExp(`#/check/${c.k}$`)) + const panel = page.getByTestId('depth-contrast') + await expect(panel).toBeVisible() + await expect(panel.getByTestId('depth-1')).toContainText('No design-recall signal · provisional') + await expect(panel.getByTestId('depth-2')).toContainText('Review lineage') + await expect(panel.getByTestId('depth-2')).toContainText(`${r.classification} · ${r.root_cause}`) + expect(Date.now() - t0).toBeLessThan(15_000) + await page.screenshot({ path: `test-results/shots/${test.info().project.name}-two-hop.png` }) + }) + + test('every claim links to the original FDA evidence', async ({ page }) => { + await page.goto(`/#/check/${c.k}`) + const panel = page.getByTestId('depth-contrast') + await expect(panel).toBeVisible() + await expect(panel.getByTestId('depth-1')).toContainText(`no recall for ${p.k}`) + for (const h of facts.hops) { + const src = h.src === c.k ? c : p + await expect(panel.locator(`a[href="${src.summary_url}#page=${h.page}"]`).first()).toBeVisible() + await expect(panel.locator('.dc-route')).toContainText(`${h.src} → ${h.dst}`) + } + const rec = panel.locator(`a[href="${r.url}"]`) + await expect(rec).toHaveCount(2) // in the depth-2 sentence and on the recall step + await expect(panel.locator('.dc-route .is-recall')).toContainText(`not ${p.k}`) + + // the provenance drawer opens on the second hop with its page-anchored PDF link + await panel.locator('.dc-route li').filter({ hasText: `${p.k} → ${facts.hops[2].dst}` }).getByRole('button', { name: 'Provenance' }).click() + const drawer = page.getByTestId('provenance') + await expect(drawer).toBeVisible() + await expect(drawer.getByTestId('pdf-page-link')).toHaveAttribute('href', `${p.summary_url}#page=${facts.hops[2].page}`) + }) + + test('a case whose direct predicate already carries the recall shows no contrast', async ({ page }) => { + const shallow = [] + page.on('request', (req) => { if (/\/api\/assess\/K252078\?depth=[12]$/.test(req.url())) shallow.push(req.url()) }) + await page.goto('/#/check/K252078') + await expect(page.getByTestId('verdict')).toContainText('Review lineage') + await page.waitForTimeout(500) + await expect(page.getByTestId('depth-contrast')).toHaveCount(0) + expect(shallow).toEqual([]) // depth 1 already finds this signal: no extra queries + }) + + test('rejecting one REMstar path refreshes the contrast to the remaining supported path', async ({ page }) => { + const [kept, dropped] = facts.recall.holders.includes('K130077') ? ['K130077', 'K131982'] : facts.recall.holders + await page.goto(`/#/check/${c.k}`) + const panel = page.getByTestId('depth-contrast') + const route = panel.locator('.dc-route') + await expect(route).toContainText(`${p.k} → ${dropped}`) + await expect(panel.getByTestId('depth-2')).toContainText(`${p.k} itself cites ${kept} and ${dropped}`) + try { + await route.locator('li').filter({ hasText: `${p.k} → ${dropped}` }).getByRole('button', { name: 'Provenance' }).click() + const drawer = page.getByTestId('provenance') + await drawer.getByRole('button', { name: 'Reject citation' }).click() + await expect(drawer.getByRole('status')).toContainText('Recorded: rejected') + // no reload: the panel re-queries both depths from the updated graph + await expect(panel.getByTestId('depth-2')).toContainText(`${p.k} itself cites ${kept}.`) + await expect(panel.getByTestId('depth-2')).toContainText(`FDA lists it on ${r.id}`) + await expect(panel.getByTestId('depth-2')).toContainText('Review lineage') + await expect(panel.getByTestId('depth-1')).toContainText('No design-recall signal · provisional') + await expect(route.locator('.dc-n')).toHaveText([`${c.k} → ${p.k}`, `${p.k} → ${kept}`, r.id]) + await expect(route.locator('.is-recall')).toContainText(`FDA's record lists ${kept}, not ${p.k}`) + } finally { + const res = await page.request.post('/api/citation/review', { data: { src: p.k, dst: dropped, status: '' } }) + expect(res.ok()).toBeTruthy() + } + }) + + test('the workspace home offers the case', async ({ page }) => { + await page.goto('/#/check') + await page.getByRole('button', { name: new RegExp(c.k) }).click() + await expect(page.getByTestId('depth-contrast')).toBeVisible() + }) +}) + +test.describe('two-hop pure rules', () => { + const sig = (chain, rec) => ({ code: 'ANCESTOR_RECALL', severity: 'medium', conditional: false, chain, gen: chain.length - 1, + evidence: [{ type: 'recall', ...rec }] }) + const rec = { id: 'Z-1', classification: 'Class I', root_cause: 'Device Design', design_related: true, initiated: '2021-01-01' } + const deep = { + k: 'K3', depth: 2, verdict: 'REVIEW_LINEAGE', device: { decision_date: '2025-01-01' }, + signals: [sig(['K3', 'K2', 'K1'], rec)], + ancestors: [{ k: 'K2', gen: 1, recalls: [], hops: [{ src: 'K3', dst: 'K2', page: 5 }] }, + { k: 'K1', gen: 2, recalls: [rec], hops: [{ src: 'K3', dst: 'K2' }, { src: 'K2', dst: 'K1', page: 4 }] }], + } + const shallow = { k: 'K3', depth: 1, verdict: 'NO_DESIGN_RECALL_SIGNAL', signals: [] } + + test('depth matters only when the verdict changes through a deeper route', () => { + const x = depthContrast(shallow, deep) + expect(x.recall.id).toBe('Z-1') + expect(x.fanout.map((f) => f.device.k)).toEqual(['K1']) + expect(x.predicateOnRecall).toBe(false) + expect(x.timing.relation).toBe('before') + expect(depthContrast({ ...shallow, verdict: 'REVIEW_LINEAGE' }, deep)).toBeNull() + expect(depthContrast(shallow, { ...deep, signals: [...deep.signals, sig(['K3', 'K2'], rec)] })).toBeNull() + expect(depthContrast({ ...shallow, depth: 2 }, deep)).toBeNull() + }) + + test('excerpts centre on the cited K-number', () => { + const x = excerpt('Classification BZD Predicate Device: Philips DreamStation 2 - K200480 Common/Usual Name: CPAP and much more text', 'K200480') + expect(x.k).toBe('K200480') + expect(x.head).toContain('Predicate Device: Philips DreamStation 2 - ') + expect(excerpt('no number here', 'K1').k).toBe('') + }) +}) + +test.describe('two-hop responsive @responsive', () => { + test('the contrast fits the viewport', async ({ page }) => { + await page.goto(`/#/check/${c.k}`) + const panel = page.getByTestId('depth-contrast') + await expect(panel).toBeVisible() + const overflow = await page.evaluate(() => document.documentElement.scrollWidth - document.documentElement.clientWidth) + expect(overflow).toBeLessThanOrEqual(1) + await panel.scrollIntoViewIfNeeded() + await page.screenshot({ path: `test-results/shots/${test.info().project.name}-two-hop-panel.png` }) + }) +}) diff --git a/web/src/evidence.js b/web/src/evidence.js index 72d136d..be17a7b 100644 --- a/web/src/evidence.js +++ b/web/src/evidence.js @@ -157,6 +157,14 @@ export function spanText(months) { return neg ? `-${s}` : s } +/** The recall a reviewer should read first: the earliest design-related one that began before the clearance. */ +export function keyRecall(recs, clearance) { + const design = recs.filter((r) => r.design_related) + const pool = design.length ? design : recs.filter((r) => r.classification === 'Class I') + const before = pool.filter((r) => r.initiated && clearance && r.initiated < clearance).sort((p, q) => p.initiated.localeCompare(q.initiated)) + return before[0] || [...pool].sort((p, q) => (q.initiated || '').localeCompare(p.initiated || ''))[0] || null +} + /** The PDF link opens the original FDA document at the cited page. */ export const pdfAt = (url, page) => (url ? (page ? `${url}#page=${page}` : url) : null) diff --git a/web/src/film/Landing.jsx b/web/src/film/Landing.jsx index ec2a820..ec1fa21 100644 --- a/web/src/film/Landing.jsx +++ b/web/src/film/Landing.jsx @@ -13,6 +13,7 @@ const sceneStore = (() => { })() const useScene = () => useSyncExternalStore(sceneStore.subscribe, sceneStore.get) import facts from '../story/facts.json' +import twoHop from '../story/two-hop.json' import { Wordmark, Mark } from '../brand/Mark.jsx' import { fmtDate, monthsBetween, pdfAt } from '../evidence.js' export { useMedia } from '../hooks.js' @@ -260,6 +261,12 @@ export default function Landing({ go, stats, introDone, reduced }) { Follow one thread + { e.preventDefault(); go('check', twoHop.candidate.k, { transition: true }) }}> + Two hops deep + {twoHop.candidate.k}: at depth 1, no design-recall signal. At depth 2, a {twoHop.recall.classification} design + recall ({twoHop.recall.id}) on its predicate's predicates. See both depths → + {stats && ( diff --git a/web/src/story/two-hop.json b/web/src/story/two-hop.json new file mode 100644 index 0000000..adf66c7 --- /dev/null +++ b/web/src/story/two-hop.json @@ -0,0 +1,41 @@ +{ + "_note": "The two-hop discovery: a one-generation lookup finds nothing, the graph finds a Class I design recall two citations back. tests/test_two_hop_story.py checks every value against the shipped Relate store and the cached FDA evidence in data/raw/.", + "candidate": { + "k": "K251770", + "name": "SleepRes PAP System", + "applicant": "Sleepres, Inc.", + "decision_date": "2025-12-15", + "summary_url": "https://www.accessdata.fda.gov/cdrh_docs/pdf25/K251770.pdf", + "summary_sha256": "73647d0b389e327183174ec57cc9a3d79f04f17f06202db8a7bbef99a7a273d1" + }, + "depth1": { "generations": 1, "verdict": "NO_DESIGN_RECALL_SIGNAL", "provisional": true }, + "depth2": { "generations": 2, "verdict": "REVIEW_LINEAGE", "provisional": false }, + "predicate": { + "k": "K200480", + "name": "DreamStation 2 System", + "applicant": "Respironics, Inc.", + "decision_date": "2020-07-10", + "summary_url": "https://www.accessdata.fda.gov/cdrh_docs/pdf20/K200480.pdf", + "summary_sha256": "923bbcfbbaea7deaf5a1b208872bda1afcf8433ff7c413ac5831cdc6c69bd1cb", + "recalls": 0 + }, + "hops": [ + { "src": "K251770", "dst": "K200480", "page": 5, "quote": "Predicate Device: Philips DreamStation 2 - K200480" }, + { "src": "K200480", "dst": "K131982", "page": 4, "quote": "Primary Predicate Device: REMSTAR AUTO A-FLEX HT (K131982)" }, + { "src": "K200480", "dst": "K130077", "page": 4, "quote": "Secondary Predicate Device: REMSTAR SE (K130077)" } + ], + "grand_predicates": [ + { "k": "K131982", "name": "REMSTAR AUTO A-FLEX HT", "applicant": "Respironics, Inc.", "decision_date": "2013-10-18" }, + { "k": "K130077", "name": "REMSTAR SE", "applicant": "Respironics, Inc.", "decision_date": "2013-05-21" } + ], + "recall": { + "id": "Z-1974-2021", + "event": "88058", + "classification": "Class I", + "root_cause": "Device Design", + "initiated": "2021-06-14", + "url": "https://www.accessdata.fda.gov/scripts/cdrh/cfdocs/cfRES/res.cfm?id=187815", + "holders": ["K131982", "K130077"], + "reason": "The polyester-based polyurethane (PE-PUR) foam may degrade into particles" + } +} diff --git a/web/src/styles.css b/web/src/styles.css index d1bd7c1..38a54b7 100644 --- a/web/src/styles.css +++ b/web/src/styles.css @@ -669,3 +669,47 @@ html[data-film="off"] .handoff { min-height: 60svh; } .film-top.is-solid { backdrop-filter: none; background: rgba(8, 13, 24, 0.92); } .film-hud { transition: opacity .4s var(--ease-out), transform .4s var(--ease-out); } .film-hud.is-away { opacity: 0; transform: translateY(10px); pointer-events: none; } + +/* Depth contrast: the same clearance at one and two predicate generations */ +.depth-contrast { border-color: rgba(231, 169, 72, .28); background: linear-gradient(135deg, rgba(22, 35, 59, .82), rgba(13, 21, 37, .82)); } +.dc-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 14px; align-items: stretch; } +.dc-col { background: var(--night-2); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 16px; display: grid; gap: 10px; align-content: start; } +.dc-col.is-deep { border-color: rgba(231, 169, 72, .45); box-shadow: inset 0 0 0 1px rgba(231, 169, 72, .08), 0 0 48px -22px rgba(231, 169, 72, .55); } +.dc-col p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink-2); } +.dc-col .k { color: var(--blue); } +.dc-col .amber { color: var(--amber); font-weight: 600; } +.dc-depth { font-size: 11px !important; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3) !important; font-weight: 600; } +.dc-depth b { color: var(--ivory); font-weight: 650; } +.dc-verdict { font-family: var(--serif); font-size: 24px; font-weight: 450; letter-spacing: -0.015em; line-height: 1.1; display: flex; gap: 10px; align-items: center; } +.dc-verdict i { width: 10px; height: 10px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 18%, transparent); flex: none; } +.dc-verdict.tone-amber { color: var(--amber); } +.dc-verdict.tone-alert { color: var(--alert); } +.dc-verdict.tone-calm { color: var(--sage); } +.dc-verdict.tone-muted { color: var(--ink-2); } +.dc-step { display: grid; align-content: center; justify-items: center; position: relative; width: 84px; } +.dc-step::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px solid var(--amber); opacity: .7; } +.dc-step span { position: relative; background: var(--night-1); border: 1px solid rgba(231, 169, 72, .5); color: var(--amber); border-radius: 999px; padding: 3px 9px; font-size: 11.5px; white-space: nowrap; } +.dc-route { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 0; } +.dc-route li { display: grid; grid-template-columns: 190px minmax(0, 1fr) auto; gap: 6px 14px; align-items: baseline; padding: 10px 2px; border-top: 1px solid var(--rule); font-size: 13px; } +.dc-route .dc-n { color: var(--ivory); font-size: 12.5px; } +.dc-route .dc-q { color: var(--ink-2); font-family: var(--serif); font-size: 14.5px; line-height: 1.4; } +.dc-route .is-recall .dc-n { color: var(--amber); } +.dc-route .is-recall .dc-q { font-family: inherit; font-size: 13px; } +.dc-route .dc-q .k { color: var(--blue); font-size: 12.5px; } +.dc-route .dc-a { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; } +.dc-route .dc-a a { font-size: 12.5px; white-space: nowrap; } +.dc-foot { margin: 10px 0 0; } +@media (max-width: 860px) { + .dc-grid { grid-template-columns: 1fr; } + .dc-step { width: auto; height: 34px; } + .dc-step::before { left: 50%; right: auto; top: 0; bottom: 0; border-top: 0; border-left: 2px solid var(--amber); } + .dc-route li { grid-template-columns: 1fr; } + .dc-route .dc-a { justify-content: flex-start; } +} +.hero-alt { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-top: 20px; max-width: 40em; padding: 10px 14px; border: 1px solid rgba(231, 169, 72, .3); border-radius: var(--r-m); background: rgba(9, 15, 27, .55); backdrop-filter: blur(8px); color: var(--ink-2); font-size: 14px; line-height: 1.5; text-decoration: none !important; transition: border-color .2s, background .2s; } +.hero-alt:hover, .hero-alt:focus-visible { border-color: rgba(231, 169, 72, .6); background: rgba(16, 26, 46, .75); } +.hero-alt .k { color: var(--blue); } +.hero-alt b { color: var(--amber); font-weight: 600; white-space: nowrap; } +.hero-alt-tag { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--amber); font-weight: 650; white-space: nowrap; } +.dc-route .dc-q mark { background: rgba(127, 162, 255, .16); color: var(--ivory); border-radius: 3px; padding: 0 3px; font-family: var(--mono); font-size: .86em; } +.dc-col a.mono { white-space: nowrap; } diff --git a/web/src/workspace/DepthContrast.jsx b/web/src/workspace/DepthContrast.jsx new file mode 100644 index 0000000..ca28f11 --- /dev/null +++ b/web/src/workspace/DepthContrast.jsx @@ -0,0 +1,102 @@ +import React, { useEffect, useState } from 'react' +import { api } from '../api.js' +import { fmtDate, pdfAt, verdictView } from '../evidence.js' +import { depthContrast, excerpt, strong } from './depth.js' + +function Verdict({ a }) { + const v = verdictView(a.verdict, a.coverage.evidence) + return