/* global React, Icon, StatusChip, Avatar, PageHeader, Banner, Drawer, DrawerHead, Meta, Tabs, PEOPLE, useToast */
const { useState: useStateEv } = React;

/* ============================================================
   Rule Evidence — governed evidence workflow (design only)
   Proves the regulatory TREATMENT behind each material metric/cell.
   No backend engine, no official formulas, no export writer.
   ============================================================ */

// export-eligibility per state (states themselves live in the shared StatusChip taxonomy)
const EV_STATE = {
  NEEDS_RULE_EVIDENCE: { export: false }, EVIDENCE_ATTACHED: { export: false }, REVIEW_PENDING: { export: false },
  RETURNED_FOR_CLARIFICATION: { export: false }, BANK_CONFIRMED: { export: true }, OFFICIAL_VERIFIED: { export: true },
  TEMPLATE_INFERRED: { export: false }, EXPIRED: { export: false }, CONFLICTING_EVIDENCE: { export: false },
};
function EvChip({ s }) { return <StatusChip s={s} />; }

const RULES = [
  { key: "LCR.HQLA1", module: "LCR / NSFR", treat: "HQLA Level 1 · 100% factor", rule: "NBE LRM §4.1", state: "OFFICIAL_VERIFIED", owner: "sara", checker: "hana", cells: 4, expires: "—" },
  { key: "LCR.RUNOFF.RETAIL", module: "LCR / NSFR", treat: "Retail deposit run-off · 10%", rule: "NBE LRM §5.2", state: "OFFICIAL_VERIFIED", owner: "sara", checker: "hana", cells: 3, expires: "—" },
  { key: "LCR.RUNOFF.SME", module: "LCR / NSFR", treat: "SME deposit outflow · 10%", rule: "—", state: "NEEDS_RULE_EVIDENCE", owner: "sara", checker: "—", cells: 2, expires: "—" },
  { key: "LCR.OUT.WHOLESALE", module: "LCR / NSFR", treat: "Operational wholesale · 25%", rule: "draft ref", state: "EVIDENCE_ATTACHED", owner: "sara", checker: "hana", cells: 2, expires: "—" },
  { key: "LCR.INFLOW.CAP", module: "LCR / NSFR", treat: "Inflow recognition · 75% cap", rule: "NBE LRM §6.1", state: "OFFICIAL_VERIFIED", owner: "dawit", checker: "sara", cells: 2, expires: "—" },
  { key: "CAR.FLOORS.SBB95", module: "Capital", treat: "CET1 7% · Tier 1 9% · total capital 11%", rule: "SBB/95/2025 § Minimum capital ratios", state: "OFFICIAL_VERIFIED", owner: "meron", checker: "hana", cells: 3, expires: "—" },
  { key: "CAR.T2.PROV", module: "Capital", treat: "Tier-2 general provisions · 1.25% cap", rule: "NBE CAR §8.4", state: "TEMPLATE_INFERRED", owner: "meron", checker: "—", cells: 1, expires: "—" },
  { key: "CAR.DED.INTANG", module: "Capital", treat: "Intangibles deduction from CET1", rule: "NBE CAR §2.1", state: "REVIEW_PENDING", owner: "meron", checker: "hana", cells: 1, expires: "—" },
  { key: "CR.RW.CORP", module: "Credit Risk", treat: "Corporate risk weight · 100%", rule: "NBE CR §7.1", state: "BANK_CONFIRMED", owner: "yonas", checker: "meron", cells: 6, expires: "—" },
  { key: "CR.CCF.GTEE", module: "Credit Risk", treat: "Direct credit substitutes · CCF 100%", rule: "NBE CR §OBS.6", state: "NEEDS_RULE_EVIDENCE", owner: "yonas", checker: "—", cells: 3, expires: "—" },
  { key: "CR.CCF.OTHER100", module: "Credit Risk", treat: "Other off-balance credit substitutes · CCF 100%", rule: "SBB/95/2025 Credit off-balance CCF ladder", state: "BANK_CONFIRMED", owner: "yonas", checker: "meron", cells: 1, expires: "—" },
  { key: "NOP.LIMIT", module: "Market / FX", treat: "Aggregate NOP limit · ±18% of Tier 1", rule: "SBB/95/2025 Market risk · NOP limit", state: "OFFICIAL_VERIFIED", owner: "abel", checker: "hana", cells: 4, expires: "—" },
  { key: "NOP.OLD.CIRCULAR", module: "Market / FX", treat: "Old NOP circular reference", rule: "NBE NOP §2.1", state: "EXPIRED", owner: "abel", checker: "hana", cells: 2, expires: "Superseded by SBB/95/2025" },
  { key: "OR.ALPHA", module: "Operational", treat: "SMA marginal coefficients · 12/15/18%", rule: "NBE OR §SMA.3", state: "BANK_CONFIRMED", owner: "robel", checker: "meron", cells: 2, expires: "—" },
  { key: "OR.ILM", module: "Operational", treat: "ILM = 1 (loss data < 5yr)", rule: "NBE OR §SMA.5", state: "CONFLICTING_EVIDENCE", owner: "robel", checker: "meron", cells: 1, expires: "—" },
  { key: "OR.SMA.FALLBACK", module: "Operational", treat: "Fallback RWA · BIC × 9.1 when ILM is not applicable", rule: "SBB/95/2025 Operational Risk SMA fallback", state: "BANK_CONFIRMED", owner: "robel", checker: "meron", cells: 1, expires: "—" },
  { key: "ELA.ELIGIBILITY", module: "Recovery / ELA", treat: "ELA eligibility gate and application pack", rule: "ELA/001/2024 eligibility and documents", state: "BANK_CONFIRMED", owner: "dawit", checker: "sara", cells: 7, expires: "—" },
  { key: "REC.COMMS.NBE", module: "Recovery", treat: "Public external communication requires NBE consent", rule: "SBB/93/2025 recovery communications", state: "BANK_CONFIRMED", owner: "dawit", checker: "hana", cells: 1, expires: "—" },
];

// used-by back-references
const USED_BY = {
  "LCR.RUNOFF.SME": [["LCR / NSFR", "SME deposits · outflow"], ["LCR / NSFR", "Total cash outflows (subtotal)"], ["Reg Reporting", "NBE Liquidity Return · cell 2.3"]],
  "CAR.FLOORS.SBB95": [["Capital", "CET1 ratio · floor 7%"], ["Capital", "Tier 1 ratio · floor 9%"], ["Capital", "Total CAR · floor 11%"], ["Reg Reporting", "Capital Adequacy Return"]],
  "CR.CCF.GTEE": [["Credit Risk", "OBS 6 · Direct credit substitutes"], ["Credit Risk", "Total off-balance RWA"], ["Capital", "Total RWA → CAR"], ["Reg Reporting", "Large Exposures Return"]],
  "CR.CCF.OTHER100": [["Credit Risk", "Other off-balance credit substitutes"], ["Credit Risk", "CCF 100% ladder"], ["Capital", "Total RWA → CAR"]],
  "NOP.LIMIT": [["Market / FX", "Aggregate NOP vs limit"], ["Stress Lab", "FX shock breach test"], ["Recovery Planning", "NOP indicator threshold"], ["Reg Reporting", "NOP Return · §2"]],
  "OR.SMA.FALLBACK": [["Operational", "NBE fallback if ILM is not applicable"], ["Capital", "Operational RWA equivalent"], ["Reg Reporting", "Operational Risk Return"]],
  "ELA.ELIGIBILITY": [["Recovery / ELA", "Eligibility gate"], ["Recovery / ELA", "Application pack checklist"], ["Recovery Planning", "Layer 3 ELA handoff"]],
  "REC.COMMS.NBE": [["Recovery Planning", "Communication/disclosure guardrail"], ["Recovery Planning", "Layer escalation workflow"]],
};

const EV_AUDIT = {
  "LCR.RUNOFF.SME": [["Jun 30 11:40", "sara", "Flagged — no reference", "NEEDS_RULE_EVIDENCE"], ["Jun 28 09:12", "system", "Inherited from template", "TEMPLATE_INFERRED"]],
  "NOP.LIMIT": [["Jun 03 15:20", "hana", "Verified against SBB/95/2025", "OFFICIAL_VERIFIED"], ["Mar 31", "hana", "Verified prior circular", "BANK_CONFIRMED"]],
  "NOP.OLD.CIRCULAR": [["Jun 30 08:00", "system", "Rule superseded by SBB/95/2025", "EXPIRED"], ["Mar 31", "hana", "Verified", "OFFICIAL_VERIFIED"]],
};

function Evidence({ go, info }) {
  const [filter, setFilter] = useStateEv("All");
  const [sel, setSel] = useStateEv(null);
  const blocking = RULES.filter(r => !EV_STATE[r.state].export);
  const verified = RULES.filter(r => r.state === "OFFICIAL_VERIFIED" || r.state === "BANK_CONFIRMED").length;
  const inferred = RULES.filter(r => r.state === "TEMPLATE_INFERRED").length;
  const missing = RULES.filter(r => r.state === "NEEDS_RULE_EVIDENCE").length;
  const stale = RULES.filter(r => r.state === "EXPIRED" || r.state === "CONFLICTING_EVIDENCE").length;
  const mods = ["All", "LCR / NSFR", "Capital", "Credit Risk", "Market / FX", "Operational", "Recovery", "Recovery / ELA"];
  const list = filter === "All" ? RULES : RULES.filter(r => r.module === filter);

  return (
    <div className="main-inner">
      <PageHeader eyebrow="Governance" title="Rule Evidence"
        onInfo={() => info({ title: "Rule Evidence", purpose: "Proves the regulatory treatment behind each material metric/cell — which NBE rule supports each factor, weight, cap and limit, whether it is verified, inferred, missing or expired, who owns it, which cells depend on it, and whether it blocks official export.", first: "Read the coverage dashboard, then the export-blocking items. Attached evidence is not the same as verified evidence; template-inferred is not official.", terms: [["Verified", "Attached and checked by a different reviewer."], ["Template-inferred", "Carried from a template — not yet verified."], ["Used-by", "The workpaper rows / cells that depend on this rule."]], next: ["Open a rule to see its directive, used-by cells, and review state.", "Attach evidence and assign a checker.", "Clear export-blocking and expired rules."], connections: ["Feeds the export gate's rule-evidence check.", "Pairs with source lineage from the Harmonizer.", "Stress assumptions need evidence but stay analysis-only."], guardrail: "Rule evidence does not replace source lineage. Attached ≠ verified. Template-inferred ≠ official. Unknown references block official export." })}
        right={<button className="btn btn-primary btn-sm" onClick={() => setSel({ attach: true })}><Icon name="clipboard" size={15} /> Attach evidence</button>} />

      {/* coverage dashboard */}
      <div className="grid g4 mb16">
        <Cov label="Verified (official / bank)" v={verified + " / " + RULES.length} foot="Export-eligible references" tone="green" />
        <Cov label="Template-inferred" v={inferred} foot="Carried from template · not official" tone="amber" />
        <Cov label="Missing references" v={missing} foot="No rule attached — blocking" tone="red" />
        <Cov label="Expired / conflicting" v={stale} foot="Need re-verification" tone="red" />
      </div>
      <div style={{ marginBottom: 18 }}><Banner kind="red" icon="lock"><b>{blocking.length} rules block official export.</b> Missing, inferred, expired and conflicting references cannot feed an official return. Attached evidence is not verified evidence — a different checker must confirm each one.</Banner></div>

      {/* module filter */}
      <div className="center gap8 wrap mb12">
        {mods.map(m => <button key={m} className={"chip chip-lg " + (filter === m ? "chip-ink" : "chip-neutral")} style={{ cursor: "pointer" }} onClick={() => setFilter(m)}>{m}</button>)}
      </div>

      {/* registry */}
      <div className="card">
        <table className="tbl">
          <thead><tr><th>Metric key</th><th>Module</th><th>Treatment</th><th>Rule</th><th>Used by</th><th>Export</th><th>State</th><th></th></tr></thead>
          <tbody>
            {list.map(r => { const exp = EV_STATE[r.state].export; return (
              <tr key={r.key} className="click" onClick={() => setSel(r)}>
                <td className="mono" style={{ fontSize: 12 }}>{r.key}</td>
                <td className="muted">{r.module}</td>
                <td style={{ fontWeight: 600 }}>{r.treat}</td>
                <td className="mono" style={{ fontSize: 12, color: r.rule === "—" ? "var(--red)" : r.rule.includes("draft") ? "var(--amber)" : "var(--ink-2)" }}>{r.rule}</td>
                <td className="tnum">{r.cells} cell{r.cells > 1 ? "s" : ""}</td>
                <td>{exp ? <span className="chip chip-green"><span className="dot" />Eligible</span> : <span className="chip chip-red"><Icon name="lock" size={11} /> Blocked</span>}</td>
                <td><EvChip s={r.state} /></td>
                <td className="num"><span className="jump">Open <Icon name="arrowR" size={13} /></span></td>
              </tr>
            ); })}
          </tbody>
        </table>
      </div>

      {sel && !sel.attach && <RuleDrawer rule={sel} onClose={() => setSel(null)} go={go} onAttach={() => setSel({ attach: true })} />}
      {sel && sel.attach && <AttachDrawer onClose={() => setSel(null)} />}
    </div>
  );
}

function RuleDrawer({ rule, onClose, go, onAttach }) {
  const [tab, setTab] = useStateEv("Overview");
  const [toastNode, showToast] = useToast();
  const exp = EV_STATE[rule.state].export;
  const usedBy = USED_BY[rule.key] || [[rule.module, rule.treat]];
  const audit = EV_AUDIT[rule.key] || [["—", rule.owner, "Created", rule.state]];
  return (
    <Drawer open={!!rule} onClose={onClose} wide>
      <DrawerHead title={rule.treat} sub={rule.key + " · " + rule.module} chip={<EvChip s={rule.state} />} onClose={onClose} />
      <Tabs tabs={["Overview", "Directive", "Used by", "Review", "Audit"]} active={tab} onChange={setTab} />
      <div className="drawer-body">
        {tab === "Overview" && <React.Fragment>
          {!exp && <Banner kind={rule.state === "EXPIRED" || rule.state === "CONFLICTING_EVIDENCE" ? "red" : "amber"} icon="lock">
            {rule.state === "NEEDS_RULE_EVIDENCE" ? <span><b>No rule reference.</b> This treatment has no NBE directive behind it — it blocks official export for {rule.cells} cell(s).</span>
              : rule.state === "TEMPLATE_INFERRED" ? <span><b>Template-inferred.</b> Carried from a template but never verified — not official until a checker confirms the directive.</span>
              : rule.state === "EXPIRED" ? <span><b>Rule expired.</b> {rule.expires}. Impacted metrics must be re-verified against the new directive.</span>
              : rule.state === "CONFLICTING_EVIDENCE" ? <span><b>Conflicting evidence.</b> Two references disagree on this treatment — resolve before official use.</span>
              : <span><b>Evidence attached, not verified.</b> Awaiting checker confirmation.</span>}
          </Banner>}
          <div className="mt16"><Meta rows={[
            ["Metric key", <span className="mono">{rule.key}</span>],
            ["Module", rule.module],
            ["Treatment", rule.treat],
            ["Rule reference", <span className="mono">{rule.rule}</span>],
            ["Export eligibility", exp ? "Eligible" : "Blocked"],
            ["Owner", <span className="center gap8"><Avatar name={PEOPLE[rule.owner] ? PEOPLE[rule.owner].name : "?"} size={20} /> {PEOPLE[rule.owner] ? PEOPLE[rule.owner].name : "—"}</span>],
            ["Checker", rule.checker === "—" ? "Not assigned" : PEOPLE[rule.checker] ? PEOPLE[rule.checker].name : rule.checker],
            ["Used by", rule.cells + " cell(s)"],
          ]} /></div>
        </React.Fragment>}

        {tab === "Directive" && (rule.rule === "—"
          ? <Banner kind="red" icon="alert"><b>No directive attached.</b> Attach the NBE rule reference (section / page / clause) and assign a checker.</Banner>
          : <React.Fragment>
              <div className="evi-row"><span className="ic-wrap" style={{ color: exp ? "var(--green-ink)" : "var(--amber)" }}><Icon name="clipboard" size={15} /></span><div className="grow"><div className="t mono">{rule.rule}</div><div className="d">{rule.module} directive · section reference</div></div>{exp ? <Icon name="checkCirc" size={18} style={{ color: "var(--green)" }} /> : <span className="chip chip-amber">unverified</span>}</div>
              {rule.state === "EXPIRED" && <div className="mt12"><Banner kind="red" icon="refresh"><b>Superseded.</b> {rule.expires}. A newer NBE circular replaces this reference — re-verify the impacted metrics.</Banner>
                <div className="card card-pad mt12" style={{ background: "var(--surface-2)" }}>
                  <div className="section-label mb8">Re-verification</div>
                  <div className="meta" style={{ gridTemplateColumns: "120px 1fr" }}>
                    <dt className="muted">Old reference</dt><dd className="mono" style={{ textDecoration: "line-through", color: "var(--ink-3)" }}>{rule.rule}</dd>
                    <dt className="muted">New reference</dt><dd><input placeholder="e.g. NBE NOP §2.1 (rev. Jun 2026)" style={{ width: "100%", padding: "6px 9px", border: "1px solid var(--border-strong)", borderRadius: 6, fontSize: 13 }} /></dd>
                    <dt className="muted">Impacted</dt><dd>{rule.cells} cell(s) re-open for checker review</dd>
                  </div>
                  <button className="btn btn-primary btn-sm mt12" onClick={() => showToast("Re-verification request sent to checker")}><Icon name="refresh" size={14} /> Re-verify against new circular</button>
                </div></div>}
              {rule.state === "CONFLICTING_EVIDENCE" && <div className="mt12"><Banner kind="red" icon="alert"><b>Conflicting evidence.</b> Two references disagree on this treatment — resolve before official use.</Banner>
                <div className="card card-pad mt12" style={{ background: "var(--surface-2)" }}>
                  <div className="section-label mb8">Resolve conflict</div>
                  {[["NBE OR §SMA.5", "ILM = 1 (loss data < 5yr)", "robel"], ["Internal model memo", "ILM computed from 5yr proxy", "meron"]].map((c, i) => (
                    <label key={i} className="cl" style={{ cursor: "pointer" }}><input type="radio" name="conf" defaultChecked={i === 0} style={{ marginRight: 6 }} /><div className="grow"><div style={{ fontWeight: 600, fontSize: 13 }} className="mono">{c[0]}</div><div className="muted" style={{ fontSize: 12 }}>{c[1]} · {PEOPLE[c[2]].name}</div></div></label>
                  ))}
                  <div className="muted" style={{ fontSize: 11.5, margin: "8px 0" }}>Pick the authoritative reference; the other is archived with a note. The checker confirms the resolution.</div>
                  <button className="btn btn-primary btn-sm" onClick={() => showToast("Conflict resolution sent to checker")}><Icon name="check" size={14} /> Resolve &amp; send to checker</button>
                </div></div>}
            </React.Fragment>)}

        {tab === "Used by" && <div>
          <div className="section-label mb8">Cells &amp; rows depending on this rule</div>
          {usedBy.map((u, i) => (
            <div key={i} className="cl"><span className="cl-ic" style={{ background: "var(--surface-2)", color: "var(--ink-2)" }}><Icon name="hash" size={15} /></span>
              <div className="grow"><div style={{ fontWeight: 600, fontSize: 13 }}>{u[1]}</div><div className="muted" style={{ fontSize: 12 }}>{u[0]}</div></div>
              <button className="btn btn-quiet btn-sm" onClick={() => go(u[0].includes("LCR") ? "lcr" : u[0].includes("Capital") ? "capital" : u[0].includes("Credit") ? "credit" : u[0].includes("Market") ? "market" : u[0].includes("Reg") ? "export" : u[0].includes("Stress") ? "stress" : u[0].includes("ELA") ? "ela" : "recovery")}><Icon name="arrowR" size={13} /></button>
            </div>
          ))}
          <div className="mt12"><Banner kind="indigo" icon="info">Changing or losing this reference re-opens every cell above. That's why a rule can't be edited without re-verifying its dependents.</Banner></div>
        </div>}

        {tab === "Review" && <div>
          <div className="section-label mb8">Maker-checker state</div>
          <div className="approval mb16">
            <div className="seg"><div className="lbl">Owner (maker)</div><div className="who">{PEOPLE[rule.owner] ? PEOPLE[rule.owner].name : "—"}</div></div>
            <div className="seg"><div className="lbl">Checker</div><div className="who" style={{ color: rule.checker === "—" ? "var(--amber)" : "var(--ink)" }}>{rule.checker === "—" ? "Unassigned" : PEOPLE[rule.checker] ? PEOPLE[rule.checker].name : rule.checker}</div></div>
            <div className="seg"><div className="lbl">State</div><div className="who"><EvChip s={rule.state} /></div></div>
          </div>
          <div className="center gap8 wrap">
            <button className="btn btn-ghost btn-sm" onClick={() => showToast("Returned to maker for clarification")}>Return for clarification</button>
            <button className="btn btn-ghost btn-sm" onClick={() => showToast("Marked bank-confirmed for internal review")}>Mark bank-confirmed</button>
            <button className="btn btn-green btn-sm" onClick={() => showToast("Reference verification recorded internally") }><Icon name="check" size={14} /> Verify (official)</button>
          </div>
          <div className="mt16"><Banner kind="amber" icon="lock">Verifying records an audit entry and flips export eligibility. The checker must differ from the owner.</Banner></div>
        </div>}

        {tab === "Audit" && <div>
          <div className="section-label mb8">Evidence audit trail</div>
          {audit.map((a, i) => { const p = a[1] === "system" ? null : PEOPLE[a[1]]; return (
            <div key={i} className="center gap12" style={{ padding: "11px 0", borderBottom: "1px solid var(--border)" }}>
              <span style={{ width: 26, height: 26, borderRadius: 7, background: "var(--surface-2)", border: "1px solid var(--border)", display: "grid", placeItems: "center", flex: "0 0 auto" }}><Icon name="clock" size={13} /></span>
              <div className="grow"><div style={{ fontSize: 13 }}><b>{p ? p.name : "System"}</b> · {a[2]}</div><div className="muted" style={{ fontSize: 11.5 }}><EvChip s={a[3]} /></div></div>
              <span className="mono muted" style={{ fontSize: 11.5 }}>{a[0]}</span>
            </div>
          ); })}
        </div>}
      </div>
      <div className="drawer-foot">
        <button className="btn btn-ghost" onClick={() => go("export")}><Icon name="fileText" size={14} /> Export gate impact</button>
        {!exp && <button className="btn btn-primary" style={{ marginLeft: "auto" }} onClick={onAttach}><Icon name="clipboard" size={14} /> Attach evidence</button>}
      </div>
      {toastNode}
    </Drawer>
  );
}

function AttachDrawer({ onClose }) {
  return (
    <Drawer open={true} onClose={onClose}>
      <DrawerHead title="Attach rule evidence" sub="evidence ≠ verified until a checker confirms" chip={<EvChip s="EVIDENCE_ATTACHED" />} onClose={onClose} />
      <div className="drawer-body">
        <Banner kind="indigo" icon="info">Attaching evidence moves the rule to <b>Review pending</b>. It is not official until a different checker verifies it.</Banner>
        <div className="field mt16"><label>Evidence type</label><select><option>NBE directive / circular</option><option>Board-approved bank policy</option><option>Regulatory letter</option><option>Internal memo</option></select></div>
        <div className="field"><label>Directive section / page / clause</label><input placeholder="e.g. NBE LRM §5.2, p.14, clause (b)" /></div>
        <div className="field"><label>Attach / link file</label><div className="cl" style={{ cursor: "pointer", borderStyle: "dashed" }}><span className="cl-ic" style={{ background: "var(--surface-2)", color: "var(--ink-3)" }}><Icon name="upload" size={15} /></span><div className="grow muted" style={{ fontSize: 12.5 }}>Drop a PDF or link the directive…</div></div></div>
        <div className="field"><label>Note</label><input placeholder="Why this reference supports the treatment" /></div>
        <div className="field"><label>Assign checker</label><select><option>Hana Girma · Treasury Head</option><option>Meron Haile · Finance Control</option></select></div>
      </div>
      <div className="drawer-foot"><button className="btn btn-ghost" onClick={onClose}>Cancel</button><button className="btn btn-primary" style={{ marginLeft: "auto" }} onClick={onClose}>Submit for review</button></div>
    </Drawer>
  );
}

function Cov({ label, v, foot, tone }) {
  const c = { green: "var(--green-ink)", amber: "var(--amber)", red: "var(--red)" }[tone] || "var(--ink)";
  return <div className="card card-pad" style={{ padding: "15px 18px" }}><div className="section-label">{label}</div><div className="big-num tnum" style={{ marginTop: 6, color: c, fontSize: 26 }}>{v}</div><div className="muted" style={{ fontSize: 11.5, marginTop: 4 }}>{foot}</div></div>;
}

window.Evidence = Evidence;
