showai-reader 0.10.0-reader.uevm5c4a → 0.10.0-reader.vnmihq4m

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/README.md +1 -1
  2. package/chunks/CardGrid-CBFTKZVN.js +2 -0
  3. package/chunks/CommandReference-EY22X3QM.js +3 -0
  4. package/chunks/ComparisonMatrix-L6NJIIZC.js +1 -0
  5. package/chunks/{EventTimeline-AEWZDJSH.js → EventTimeline-YADOF2QZ.js} +1 -1
  6. package/chunks/{ExperimentTracker-W2H5ZDFY.js → ExperimentTracker-4SSNBJ4M.js} +1 -1
  7. package/chunks/{ExternalDiagram-SIOOYLR7.js → ExternalDiagram-MQDNF7ZU.js} +3 -3
  8. package/chunks/Flowchart-HNUPZXJV.js +11 -0
  9. package/chunks/{G2Chart-CWQQA4ZV.js → G2Chart-UDU7DCPL.js} +2 -2
  10. package/chunks/LayerDiagram-AF2LXWXM.js +2 -0
  11. package/chunks/{Mindmap-7GTBDPMC.js → Mindmap-2LAHDLBK.js} +1 -1
  12. package/chunks/RichTextEditor-C4N2WZVN.js +157 -0
  13. package/chunks/{Roadmap-7TFBP7BZ.js → Roadmap-LP2GFEHZ.js} +1 -1
  14. package/chunks/{Scene3D-YUDPPF42.js → Scene3D-5YJOMYXR.js} +2 -2
  15. package/chunks/SequenceDiagram-SW2SZLVA.js +2 -0
  16. package/chunks/StatusTree-VSAUQHRZ.js +1 -0
  17. package/chunks/StepGuide-S6AHNGDL.js +1 -0
  18. package/chunks/StructureBrowser-TCH6NCWI.js +3 -0
  19. package/chunks/{Waterfall-T4FNP6RH.js → Waterfall-3WOZCSRE.js} +1 -1
  20. package/chunks/chunk-5CTTY5BQ.js +2 -0
  21. package/chunks/chunk-CFW5JGMW.js +4 -0
  22. package/chunks/chunk-GB7ZVF7X.js +1 -0
  23. package/chunks/{chunk-P2CMIXOU.js → chunk-IKXQEYHR.js} +1 -1
  24. package/chunks/{chunk-36N4B6F4.js → chunk-KK52BZYB.js} +2 -2
  25. package/chunks/{chunk-MGSP3OGB.js → chunk-KQR52I3G.js} +8 -8
  26. package/chunks/{chunk-VRAMSIGC.js → chunk-MXNP25YA.js} +1 -1
  27. package/chunks/chunk-OJMAZ5B2.js +2 -0
  28. package/chunks/{chunk-N2G7RUAJ.js → chunk-RKCLMBWU.js} +1 -1
  29. package/chunks/{chunk-LWAPR3HQ.js → chunk-RQY45SXE.js} +1 -1
  30. package/chunks/chunk-TUMMRXVT.js +1 -0
  31. package/chunks/chunk-UAOQCK47.js +1 -0
  32. package/chunks/chunk-XBPILGCT.js +354 -0
  33. package/chunks/{chunk-S4EP5SMX.js.LEGAL.txt → chunk-XBPILGCT.js.LEGAL.txt} +5 -0
  34. package/chunks/chunk-ZSTUMTZM.js +1 -0
  35. package/chunks/chunk-ZUTEJY6A.js +9 -0
  36. package/index.js +1 -1
  37. package/manifest.json +5 -5
  38. package/package.json +1 -1
  39. package/reader-VNMIHQ4M.js +51 -0
  40. package/chunks/CardGrid-B5ZPO2BI.js +0 -2
  41. package/chunks/CommandReference-HHKCV753.js +0 -3
  42. package/chunks/ComparisonMatrix-RIUGQRNA.js +0 -1
  43. package/chunks/Flowchart-6ZTZQZXC.js +0 -12
  44. package/chunks/LayerDiagram-GTULFZZP.js +0 -2
  45. package/chunks/RichTextEditor-PNTZXV2D.js +0 -155
  46. package/chunks/SequenceDiagram-RWUR35XN.js +0 -2
  47. package/chunks/StatusTree-VXXL53J4.js +0 -1
  48. package/chunks/StepGuide-GJ3LBGVS.js +0 -1
  49. package/chunks/StructureBrowser-LXVTJ4CR.js +0 -3
  50. package/chunks/chunk-2CCUVSMI.js +0 -1
  51. package/chunks/chunk-2YDDS4TW.js +0 -1
  52. package/chunks/chunk-DVIFPZLZ.js +0 -2
  53. package/chunks/chunk-IBO6QHGV.js +0 -4
  54. package/chunks/chunk-LSZMAKEI.js +0 -329
  55. package/chunks/chunk-S4EP5SMX.js +0 -21
  56. package/chunks/chunk-XI4I5HQF.js +0 -1
  57. package/reader-UEVM5C4A.js +0 -46
  58. /package/chunks/{G2Chart-CWQQA4ZV.js.LEGAL.txt → G2Chart-UDU7DCPL.js.LEGAL.txt} +0 -0
  59. /package/chunks/{Scene3D-YUDPPF42.js.LEGAL.txt → Scene3D-5YJOMYXR.js.LEGAL.txt} +0 -0
  60. /package/chunks/{Flowchart-6ZTZQZXC.js.LEGAL.txt → chunk-5CTTY5BQ.js.LEGAL.txt} +0 -0
  61. /package/chunks/{chunk-36N4B6F4.js.LEGAL.txt → chunk-KK52BZYB.js.LEGAL.txt} +0 -0
  62. /package/{reader-UEVM5C4A.js.LEGAL.txt → reader-VNMIHQ4M.js.LEGAL.txt} +0 -0
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  The [ShowAI](https://showai.renaissancemind.ai) page reader, built from ShowAI 0.10.0 as code-split ES modules. Inline conversation pages written by `render-artifact --cdn` import it and load each component's code only when the page uses it.
4
4
 
5
5
  ```js
6
- const { mount } = await import("https://cdn.jsdelivr.net/npm/showai-reader@0.10.0-reader.uevm5c4a/index.js");
6
+ const { mount } = await import("https://cdn.jsdelivr.net/npm/showai-reader@0.10.0-reader.vnmihq4m/index.js");
7
7
  mount(document.getElementById("page"), { artifact });
8
8
  ```
9
9
 
@@ -0,0 +1,2 @@
1
+ import{a as w}from"./chunk-TUMMRXVT.js";import{d as f,e as m}from"./chunk-RQY45SXE.js";import{a as d,b as k}from"./chunk-UAOQCK47.js";import{f as n,h as v}from"./chunk-ZSTUMTZM.js";import{Ab as h,a as b,mb as p}from"./chunk-XBPILGCT.js";import{a as x}from"./chunk-J6IRWTF7.js";import{c as g}from"./chunk-DCANE7XH.js";b(`.sb-block.cg-block :is(h3,h4,p,ul,ol,li,pre):not(svg){margin:0}.sb-block.cg-block li:not(svg){padding:0}.sb-block.cg-block pre:not(svg){border:0;border-radius:0;background:none;color:inherit}.sb-block.cg-block{--cg-text: var(--text, #222222);--cg-muted: var(--muted, #6a6a6a);--cg-faint: var(--subtle, #929292);--cg-line: var(--line, #dddddd);--cg-surface: var(--surface, #fafafa);--cg-accent: var(--accent, #120a8f);--cg-accent-soft: var(--accent-soft, #eeedf9);--cg-mono: var(--font-mono, ui-monospace, Menlo, Consolas, monospace);--cg-teal: #0d8579;--cg-teal-soft: #e6f4f2;--cg-warm: #bf6528;--cg-warm-soft: #fbefe6;--cg-violet: #7348d0;--cg-violet-soft: #f2edfc;--cg-rose: #c4415a;--cg-rose-soft: #fbebee;--cg-slate: #526476;--cg-slate-soft: #edf1f4;color:var(--cg-text);font-family:inherit;font-size:14px;line-height:1.7;padding:8px 0;container-type:inline-size}:root[data-theme=dark] .sb-block.cg-block,[data-theme=dark] .sb-block.cg-block{--cg-teal: #4fc4b6;--cg-teal-soft: #163734;--cg-warm: #e79c64;--cg-warm-soft: #3b2b1e;--cg-violet: #b497ff;--cg-violet-soft: #2e2648;--cg-rose: #f0839a;--cg-rose-soft: #3e222a;--cg-slate: #a2b2c2;--cg-slate-soft: #242d35}.sb-block.cg-block *{box-sizing:border-box}.sb-block.cg-block .cg-tone-brand{--tone: var(--cg-accent);--tone-soft: var(--cg-accent-soft)}.sb-block.cg-block .cg-tone-teal{--tone: var(--cg-teal);--tone-soft: var(--cg-teal-soft)}.sb-block.cg-block .cg-tone-warm{--tone: var(--cg-warm);--tone-soft: var(--cg-warm-soft)}.sb-block.cg-block .cg-tone-violet{--tone: var(--cg-violet);--tone-soft: var(--cg-violet-soft)}.sb-block.cg-block .cg-tone-rose{--tone: var(--cg-rose);--tone-soft: var(--cg-rose-soft)}.sb-block.cg-block .cg-tone-slate{--tone: var(--cg-slate);--tone-soft: var(--cg-slate-soft)}.sb-block.cg-block .cg-heading{margin:0 0 10px;font-size:17px;font-weight:700}.sb-block.cg-block .cg-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.sb-block.cg-block .cg-grid{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(var(--cg-columns, 3),minmax(0,1fr));gap:12px}.sb-block.cg-block .cg-item{display:flex;min-width:0;margin:0}.sb-block.cg-block .cg-card{position:relative;flex:1;min-width:0;display:flex;color:inherit;text-decoration:none;border:1px solid var(--cg-line);border-radius:10px;background:transparent;overflow-wrap:anywhere;transition:border-color .15s,background-color .15s}.sb-block.cg-block .cg-card.is-link{cursor:pointer}.sb-block.cg-block .cg-card.is-link:hover{border-color:color-mix(in srgb,var(--tone) 45%,var(--cg-line));background:var(--cg-surface)}.sb-block.cg-block .cg-card:focus-visible{outline:2px solid var(--cg-accent);outline-offset:2px}.sb-block.cg-block .cg-icon{flex:none;display:inline-grid;place-items:center;width:34px;height:34px;border-radius:8px;background:var(--tone-soft);font-size:17px;line-height:1;font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif}.sb-block.cg-block .cg-tag{flex:none;display:inline-block;font-size:11.5px;line-height:1;font-weight:600;color:var(--tone);background:var(--tone-soft);border-radius:4px;padding:4px 7px;white-space:nowrap}.sb-block.cg-block .cg-title{display:flex;align-items:center;gap:6px;min-width:0;font-size:16px;line-height:1.45;font-weight:600}.sb-block.cg-block .cg-body{display:block;font-size:13.5px;line-height:1.7;color:var(--cg-muted)}.sb-block.cg-block .cg-body strong{color:var(--cg-text);font-weight:600}.sb-block.cg-block .cg-body code{font-family:var(--cg-mono);font-size:.86em;color:var(--cg-text);background:var(--cg-surface);border:1px solid var(--cg-line);border-radius:4px;padding:0 4px;word-break:break-all}.sb-block.cg-block .cg-body a{color:var(--cg-accent);text-decoration:none;border-bottom:1px solid color-mix(in srgb,var(--cg-accent) 35%,transparent)}.sb-block.cg-block .cg-arrow{flex:none;width:15px;height:15px;fill:none;stroke:var(--tone);stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;opacity:0;transform:translate(-4px);transition:opacity .15s,transform .15s}.sb-block.cg-block .cg-card.is-link:hover .cg-arrow,.sb-block.cg-block .cg-card.is-link:focus-visible .cg-arrow{opacity:1;transform:none}@media(hover:none){.sb-block.cg-block .cg-arrow{opacity:.7;transform:none}}.sb-block.cg-block.cg-tile .cg-card{flex-direction:column;padding:18px 18px 16px}.sb-block.cg-block .cg-top{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:14px}.sb-block.cg-block.cg-tile .cg-body{margin-top:4px}.sb-block.cg-block.cg-row .cg-grid{gap:8px}.sb-block.cg-block.cg-row .cg-card{align-items:center;gap:14px;padding:12px 16px 12px 12px}.sb-block.cg-block.cg-row .cg-icon{width:36px;height:36px}.sb-block.cg-block.cg-row .cg-card:not(:has(.cg-icon)){padding-left:16px}.sb-block.cg-block .cg-text{flex:1;min-width:0;display:block}.sb-block.cg-block.cg-row .cg-title{font-size:15px;line-height:1.5;flex-wrap:wrap;gap:4px 8px}.sb-block.cg-block.cg-row .cg-tag{font-size:11px;padding:3px 6px}.sb-block.cg-block.cg-row .cg-body{font-size:13px;line-height:1.6}.sb-block.cg-block.cg-row .cg-arrow{opacity:.35;transform:none;stroke:var(--cg-faint)}.sb-block.cg-block.cg-row .cg-card.is-link:hover .cg-arrow,.sb-block.cg-block.cg-row .cg-card.is-link:focus-visible .cg-arrow{opacity:1;stroke:var(--tone);transform:translate(2px)}@container (max-width: 820px){.sb-block.cg-block[data-columns="4"] .cg-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@container (max-width: 560px){.sb-block.cg-block .cg-grid{grid-template-columns:minmax(0,1fr)}.sb-block.cg-block.cg-tile .cg-card{padding:14px 16px}.sb-block.cg-block.cg-tile .cg-card:has(.cg-icon){display:grid;grid-template-columns:34px minmax(0,1fr);grid-template-areas:"icon title" "icon body";column-gap:14px;align-items:start}.sb-block.cg-block.cg-tile .cg-card:has(.cg-icon) .cg-top{display:contents}.sb-block.cg-block.cg-tile .cg-card:has(.cg-icon) .cg-icon{grid-area:icon;margin-top:2px}.sb-block.cg-block.cg-tile .cg-card:has(.cg-icon) .cg-title{grid-area:title}.sb-block.cg-block.cg-tile .cg-card:has(.cg-icon) .cg-body{grid-area:body;margin-top:2px}.sb-block.cg-block.cg-tile .cg-card:has(.cg-icon) .cg-tag{position:absolute;top:15px;right:14px}.sb-block.cg-block.cg-tile .cg-card:has(.cg-icon):has(.cg-tag) .cg-title{padding-right:64px}.sb-block.cg-block.cg-tile .cg-top{margin-bottom:10px}}@media(prefers-reduced-motion:reduce){.sb-block.cg-block *{transition:none!important}}@media print{.sb-block.cg-block .cg-item{break-inside:avoid}.sb-block.cg-block .cg-arrow{display:none}.sb-block.cg-block.cg-row .cg-card.is-link{flex-wrap:wrap}.sb-block.cg-block .cg-card.is-link[href^=http]:after,.sb-block.cg-block .cg-card.is-link[href^="mailto:"]:after{content:attr(href);flex-basis:100%;color:var(--cg-faint);font-size:11px;overflow-wrap:anywhere}}
2
+ `);var u=x("cardGrid",{"zh-CN":{title:"\u5361\u7247\u5BFC\u822A",opensInNewTab:"\uFF08\u5728\u65B0\u6807\u7B7E\u9875\u6253\u5F00\uFF09"},en:{title:"Card grid",opensInNewTab:"(opens in a new tab)"}});var c=g(p(),1),y=()=>(0,c.jsx)("svg",{className:"cg-arrow",viewBox:"0 0 16 16","aria-hidden":"true",children:(0,c.jsx)("path",{d:"M3.5 8h9M8.5 4l4 4-4 4"})});function z({card:t,tile:s,linked:o}){let l=(0,c.jsx)("span",{className:"cg-body",children:(0,c.jsx)(w,{source:t.body,links:!o})}),a=t.icon&&(0,c.jsx)("span",{className:"cg-icon","aria-hidden":"true",children:t.icon}),e=t.tag&&(0,c.jsx)("span",{className:"cg-tag",children:(0,c.jsx)(n,{text:t.tag,focusable:!o})});return s?(0,c.jsxs)(c.Fragment,{children:[(a||e)&&(0,c.jsxs)("span",{className:"cg-top",children:[a||(0,c.jsx)("span",{}),e]}),(0,c.jsxs)("span",{className:"cg-title",children:[(0,c.jsx)("span",{children:(0,c.jsx)(n,{text:t.title,focusable:!o})}),o&&(0,c.jsx)(y,{})]}),l]}):(0,c.jsxs)(c.Fragment,{children:[a,(0,c.jsxs)("span",{className:"cg-text",children:[(0,c.jsxs)("span",{className:"cg-title",children:[(0,c.jsx)("span",{children:(0,c.jsx)(n,{text:t.title,focusable:!o})}),e]}),l]}),o&&(0,c.jsx)(y,{})]})}function A({data:t}){let s=h(u),o=t,l=o.variant==="row"?"row":"tile",a=m(o);return(0,c.jsxs)("section",{className:`sb-block cg-block cg-${l}`,"aria-label":v(o.title,s("title")),"data-columns":a,style:{"--cg-columns":a},children:[o.title&&(0,c.jsx)("h3",{className:"cg-heading",children:(0,c.jsx)(n,{text:o.title})}),(0,c.jsx)("ul",{className:"cg-grid",children:o.cards.map((e,N)=>{let C=f.includes(e.tone)?e.tone:"brand",r=e.href&&d(e.href)?e.href:null,i=(0,c.jsx)(z,{card:e,tile:l==="tile",linked:!!r});return(0,c.jsx)("li",{className:`cg-item cg-tone-${C}`,children:r&&k(r)?(0,c.jsxs)("a",{className:"cg-card is-link",href:r,target:"_blank",rel:"noopener noreferrer",children:[i,(0,c.jsx)("span",{className:"cg-hidden",children:s("opensInNewTab")})]}):r?(0,c.jsx)("a",{className:"cg-card is-link",href:r,children:i}):(0,c.jsx)("div",{className:"cg-card",children:i})},N)})})]})}export{A as CardGridBlock};
@@ -0,0 +1,3 @@
1
+ import{a as F}from"./chunk-CFW5JGMW.js";import{a as M}from"./chunk-TUMMRXVT.js";import{d as G,e as _,f as I}from"./chunk-RKCLMBWU.js";import"./chunk-UAOQCK47.js";import{f as U,h as V}from"./chunk-ZSTUMTZM.js";import{Ab as O,a as P,c as tr,mb as Z}from"./chunk-XBPILGCT.js";import{a as j}from"./chunk-J6IRWTF7.js";import{c as E}from"./chunk-DCANE7XH.js";var b=E(tr(),1);P(`.sb-block.cr-block :is(h3,h4,p,ul,ol,li,pre):not(svg){margin:0}.sb-block.cr-block li:not(svg){padding:0}.sb-block.cr-block pre:not(svg){border:0;border-radius:0;background:none;color:inherit}.sb-block.cr-block{--cr-text: var(--text, #222222);--cr-muted: var(--muted, #6a6a6a);--cr-faint: var(--subtle, #929292);--cr-line: var(--line, #dddddd);--cr-paper: var(--paper, #ffffff);--cr-surface: var(--surface, #fafafa);--cr-hover: var(--hover, #f7f7f7);--cr-accent: var(--accent, #120a8f);--cr-accent-soft: var(--accent-soft, #eeedf9);--cr-mark: #f3d9a4;--cr-mono: var(--font-mono, ui-monospace, monospace);color:var(--cr-text);font-family:inherit;font-size:14px;line-height:1.7;padding:8px 0;container-type:inline-size}:root[data-theme=dark] .sb-block.cr-block,[data-theme=dark] .sb-block.cr-block{--cr-mark: #5c4520}.sb-block.cr-block *{box-sizing:border-box}.sb-block.cr-block .cr-head{margin-bottom:12px}.sb-block.cr-block .cr-heading{margin:0;font-size:17px;font-weight:700}.sb-block.cr-block .cr-sub{margin:2px 0 0;color:var(--cr-muted);font-size:13px}.sb-block.cr-block strong{font-weight:650}.sb-block.cr-block a{color:var(--cr-accent);text-decoration:none;border-bottom:1px solid color-mix(in srgb,var(--cr-accent) 35%,transparent)}.sb-block.cr-block a:hover{border-bottom-color:var(--cr-accent)}.sb-block.cr-block mark{background:var(--cr-mark);color:inherit;border-radius:2px;padding:0}.sb-block.cr-block .cr-status{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);margin:0}.sb-block.cr-block .cr-search{display:flex;align-items:center;gap:8px;height:42px;padding:0 8px 0 13px;border:1px solid var(--cr-line);border-radius:8px;background:var(--cr-surface);transition:border-color .15s}.sb-block.cr-block .cr-search:focus-within{border-color:var(--cr-accent);outline:2px solid color-mix(in srgb,var(--cr-accent) 22%,transparent);outline-offset:1px}.sb-block.cr-block .cr-glass{flex:none;width:16px;height:16px;fill:none;stroke:var(--cr-muted);stroke-width:1.5;stroke-linecap:round}.sb-block.cr-block .cr-search input{flex:1;min-width:0;height:100%;padding:0;border:0;outline:0;background:transparent;color:var(--cr-text);font:inherit;font-size:14px}.sb-block.cr-block .cr-search input::placeholder{color:var(--cr-faint)}.sb-block.cr-block .cr-search input::-webkit-search-cancel-button{display:none}.sb-block.cr-block .cr-total{flex:none;padding-right:6px;font-size:12px;color:var(--cr-faint);font-variant-numeric:tabular-nums}.sb-block.cr-block .cr-clear{flex:none;display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;padding:0;border:0;border-radius:6px;background:transparent;color:var(--cr-muted);cursor:pointer}.sb-block.cr-block .cr-clear:hover{background:var(--cr-hover);color:var(--cr-text)}.sb-block.cr-block .cr-clear svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round}.sb-block.cr-block .cr-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px}.sb-block.cr-block .cr-chips button,.sb-block.cr-block .cr-emptyactions button{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 10px;border:1px solid var(--cr-line);border-radius:6px;background:transparent;color:var(--cr-text);font:inherit;font-size:12.5px;line-height:1;white-space:nowrap;cursor:pointer}.sb-block.cr-block .cr-chips button span{font-size:11px;color:var(--cr-faint);font-variant-numeric:tabular-nums}.sb-block.cr-block .cr-chips button:hover,.sb-block.cr-block .cr-emptyactions button:hover{background:var(--cr-hover)}.sb-block.cr-block .cr-chips button[aria-pressed=true]{background:var(--cr-accent-soft);border-color:color-mix(in srgb,var(--cr-accent) 30%,transparent);color:var(--cr-accent);font-weight:650}.sb-block.cr-block .cr-chips button[aria-pressed=true] span{color:var(--cr-accent);opacity:.75}.sb-block.cr-block .cr-chips button.is-zero{color:var(--cr-faint)}.sb-block.cr-block button:focus-visible{outline:2px solid var(--cr-accent);outline-offset:2px}.sb-block.cr-block .cr-list{margin-top:14px;border:1px solid var(--cr-line);border-radius:10px;overflow:hidden}.sb-block.cr-block .cr-section+.cr-section{border-top:1px solid var(--cr-line)}.sb-block.cr-block .cr-grouphead{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:8px 16px;background:var(--cr-surface);border-bottom:1px solid var(--cr-line);font-size:12px;font-weight:650;letter-spacing:.04em;color:var(--cr-muted);line-height:1.5}.sb-block.cr-block .cr-groupcount{font-weight:400;letter-spacing:0;color:var(--cr-faint);font-variant-numeric:tabular-nums}.sb-block.cr-block .cr-section ul{list-style:none;margin:0;padding:0}.sb-block.cr-block .cr-item+.cr-item{border-top:1px solid var(--cr-line)}.sb-block.cr-block .cr-item.is-open{background:var(--cr-surface)}.sb-block.cr-block .cr-row{display:flex;align-items:flex-start;gap:12px;width:100%;padding:12px 16px;border:0;background:none;color:inherit;font:inherit;text-align:left;cursor:pointer}.sb-block.cr-block .cr-row[data-static]{cursor:default}.sb-block.cr-block .cr-row:hover{background:var(--cr-hover)}.sb-block.cr-block .cr-row[data-static]:hover{background:none}.sb-block.cr-block .cr-row:focus-visible{outline-offset:-2px;border-radius:6px}.sb-block.cr-block .cr-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}.sb-block.cr-block .cr-cmd{display:block;padding:0;border-radius:0;background:none;color:inherit;font-family:var(--cr-mono);font-size:13px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere}.sb-block.cr-block .cr-cmd>span{white-space:nowrap}.sb-block.cr-block .cr-cmd>span.is-long{white-space:normal}.sb-block.cr-block .cr-verb{font-weight:700}.sb-block.cr-block .cr-prog,.sb-block.cr-block .cr-ph,.sb-block.cr-block .cr-arg{color:var(--cr-muted)}.sb-block.cr-block .cr-prog{color:var(--cr-faint)}.sb-block.cr-block .cr-summary{font-size:13px;line-height:1.55;color:var(--cr-muted)}.sb-block.cr-block .cr-paramhits{display:flex;flex-wrap:wrap;align-items:center;gap:4px 6px;margin-top:2px;font-size:11.5px;color:var(--cr-faint)}.sb-block.cr-block .cr-chev{flex:none;width:12px;height:12px;margin-top:6px;fill:none;stroke:var(--cr-faint);stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;transition:transform .15s}.sb-block.cr-block .cr-row:hover .cr-chev{stroke:var(--cr-muted)}.sb-block.cr-block .is-open .cr-chev{transform:rotate(180deg)}.sb-block.cr-block .cr-more{display:flex;align-items:center;gap:6px;width:100%;padding:9px 16px;border:0;border-top:1px solid var(--cr-line);background:none;font:inherit;font-size:12.5px;color:var(--cr-accent);text-align:left;cursor:pointer}.sb-block.cr-block .cr-more:hover{background:var(--cr-hover)}.sb-block.cr-block .cr-more:focus-visible{outline-offset:-2px}.sb-block.cr-block .cr-more svg{width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}.sb-block.cr-block .cr-detail{padding:0 16px 18px;margin-right:24px}.sb-block.cr-block .cr-detail[hidden]{display:none}.sb-block.cr-block .cr-para{margin:8px 0 0;font-size:13.5px;line-height:1.75}.sb-block.cr-block ul.cr-para{padding-left:18px}.sb-block.cr-block .cr-params{width:100%;border-collapse:collapse;margin-top:12px;font-size:13px}.sb-block.cr-block .cr-params thead th{padding:0 0 6px;font-size:11.5px;font-weight:500;color:var(--cr-faint);text-align:left;border-bottom:1px solid var(--cr-line)}.sb-block.cr-block .cr-params tbody th,.sb-block.cr-block .cr-params tbody td{padding:8px 0;border-bottom:1px solid var(--cr-line);vertical-align:top;text-align:left;line-height:1.6}.sb-block.cr-block .cr-params tbody th{width:1%;padding-right:20px;white-space:nowrap;font-weight:400}.sb-block.cr-block .cr-params tbody th code{font-size:12.5px;background:none;border:0;padding:0}.sb-block.cr-block .cr-detail .sg-code{margin-top:14px}.sb-block.cr-block .cr-summary code,.sb-block.cr-block .cr-detail :not(pre)>code,.sb-block.cr-block .cr-paramhits code,.sb-block.cr-block .cr-emptyhint code{font-family:var(--cr-mono);font-size:.9em;background:var(--cr-surface);border:1px solid var(--cr-line);border-radius:4px;padding:0 4px;overflow-wrap:anywhere}.sb-block.cr-block .cr-empty{margin-top:14px;padding:34px 20px 30px;border:1px solid var(--cr-line);border-radius:10px;text-align:center}.sb-block.cr-block .cr-empty svg{width:40px;height:40px;fill:none;stroke:var(--cr-faint);stroke-width:1.6;stroke-linecap:round}.sb-block.cr-block .cr-emptytitle{margin:8px 0 0;font-size:14.5px;font-weight:500;overflow-wrap:anywhere}.sb-block.cr-block .cr-emptyhint{margin:4px 0 0;font-size:12.5px;color:var(--cr-muted)}.sb-block.cr-block .cr-emptyactions{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin-top:14px}.sb-block.cr-block .cr-emptyactions:empty{display:none}@container (max-width: 640px){.sb-block.cr-block .cr-row{padding:11px 12px;gap:8px}.sb-block.cr-block .cr-total{display:none}.sb-block.cr-block .cr-detail{padding:0 12px 16px;margin-right:0}.sb-block.cr-block .cr-grouphead{padding:8px 12px}.sb-block.cr-block .cr-cmd{font-size:12.5px}.sb-block.cr-block .cr-params,.sb-block.cr-block .cr-params tbody,.sb-block.cr-block .cr-params tr,.sb-block.cr-block .cr-params tbody th,.sb-block.cr-block .cr-params tbody td{display:block;width:auto}.sb-block.cr-block .cr-params thead{display:none}.sb-block.cr-block .cr-params tr{padding:8px 0;border-bottom:1px solid var(--cr-line)}.sb-block.cr-block .cr-params tbody th,.sb-block.cr-block .cr-params tbody td{padding:0;border:0;white-space:normal}}@media(prefers-reduced-motion:reduce){.sb-block.cr-block *,.sb-block.cr-block *:after{transition:none!important}}@media print{.sb-block.cr-block .cr-search,.sb-block.cr-block .cr-chips,.sb-block.cr-block .cr-more,.sb-block.cr-block .cr-chev,.sb-block.cr-block .cr-emptyactions{display:none}.sb-block.cr-block .cr-item[hidden],.sb-block.cr-block .cr-detail[hidden]{display:block}.sb-block.cr-block .cr-list{border:0}.sb-block.cr-block .cr-item,.sb-block.cr-block .cr-section{break-inside:avoid}}
2
+ `);var Q=j("commandReference",{"zh-CN":{title:"\u547D\u4EE4\u53C2\u8003",placeholder:"\u641C\u7D22\u547D\u4EE4\u3001\u53C2\u6570\u6216\u7528\u9014",search:"\u641C\u7D22\u547D\u4EE4",clear:"\u6E05\u9664\u641C\u7D22",total:"{count} \u6761\u547D\u4EE4",found:"\u627E\u5230 {count} \u6761\u547D\u4EE4",filter:"\u6309\u5206\u7EC4\u7B5B\u9009",all:"\u5168\u90E8",params:"\u53C2\u6570",paramName:"\u53C2\u6570",paramMeaning:"\u8BF4\u660E",example:"\u793A\u4F8B",exampleName:"{command} \u7684\u793A\u4F8B",groupCount:"{shown} / {total}",showMore:"\u663E\u793A\u5176\u4F59 {count} \u6761{group}\u547D\u4EE4",noMatch:"\u6CA1\u6709\u4E0E\u300C{query}\u300D\u5339\u914D\u7684\u547D\u4EE4",noMatchIn:"\u6CA1\u6709\u4E0E\u300C{query}\u300D\u5339\u914D\u7684\u547D\u4EE4\uFF08{group}\uFF09",emptyGroup:"\u300C{group}\u300D\u4E2D\u6CA1\u6709\u547D\u4EE4",emptyHint:"\u8BD5\u8BD5\u66F4\u77ED\u7684\u5173\u952E\u8BCD\uFF0C\u6216\u641C\u7D22\u53C2\u6570\u540D\u3002",viewAll:"\u5728\u5168\u90E8\u5206\u7EC4\u4E2D\u67E5\u770B\uFF08{count} \u6761\uFF09"},en:{title:"Command reference",placeholder:"Search commands, parameters or purposes",search:"Search commands",clear:"Clear search",total:{one:"{count} command",other:"{count} commands"},found:{one:"{count} command found",other:"{count} commands found"},filter:"Filter by group",all:"All",params:"Parameters",paramName:"Parameter",paramMeaning:"Meaning",example:"Example",exampleName:"example of {command}",groupCount:"{shown} / {total}",showMore:"Show {count} more in {group}",noMatch:"No command matches \u201C{query}\u201D",noMatchIn:"No command matches \u201C{query}\u201D in {group}",emptyGroup:"{group} has no commands",emptyHint:"Try a shorter keyword, or search for a parameter name.",viewAll:"View in all groups ({count})"}});var r=E(Z(),1),g="\0all",T=6;function J(l,c,t=0,m=l.length,s="h"){let n=[],d=t,i=0;for(let[f,y]of c){if(y<=d||f>=m)continue;let x=Math.max(f,d),v=Math.min(y,m);x>d&&n.push(l.slice(d,x)),n.push((0,r.jsx)("mark",{children:l.slice(x,v)},`${s}${i++}`)),d=v}return d<m&&n.push(l.slice(d,m)),n}var ar=l=>l.length?(c,t)=>(0,r.jsx)("span",{children:J(c,I(c,l),0,c.length,t)},t):void 0;function nr({text:l,terms:c,program:t}){let m=I(l,c),s=[],n=/\S+/g,d,i=0,f=!0,y=!1,x=!0,v=0;for(;d=n.exec(l);){let u=d[0],w=d.index,k=w+u.length;w>i&&s.push(l.slice(i,w));let h;f&&t&&u===t?h="prog":!y&&/^[A-Za-z_][\w.-]*$/.test(u)&&!/^[A-Z][A-Z0-9_]*$/.test(u)?(h="verb",y=!0,/[_.]/.test(u)&&(x=!1)):x&&/^[a-z][a-z0-9-]*$/.test(u)?h="verb":(x=!1,h=/^\[?-{1,2}[A-Za-z]/.test(u)?"flag":/^[[<(]?[A-Z][A-Z0-9_]*(?:[|,.][A-Z0-9_]+)*[\]>)]?\]?$|^[[<].*[\]>]$/.test(u)?"ph":"arg"),f=!1,s.push((0,r.jsx)("span",{className:`cr-${h}${u.length>32?" is-long":""}`,children:J(l,m,w,k,`t${v}.`)},v)),v++,i=k}return i<l.length&&s.push(l.slice(i)),(0,r.jsx)("code",{className:"cr-cmd",children:s})}function lr({source:l}){return(0,r.jsx)(r.Fragment,{children:l.trim().split(/\n\s*\n/).map((c,t)=>{let m=c.split(`
3
+ `);return m.every(s=>/^\s*[-•]\s+/.test(s))?(0,r.jsx)("ul",{className:"cr-para",children:m.map((s,n)=>(0,r.jsx)("li",{children:(0,r.jsx)(M,{source:s.replace(/^\s*[-•]\s+/,"")})},n))},t):(0,r.jsx)("p",{className:"cr-para",children:m.map((s,n)=>(0,r.jsxs)("span",{children:[n>0&&(0,r.jsx)("br",{}),(0,r.jsx)(M,{source:s})]},n))},t)})})}function xr({data:l}){let c=O(Q),t=l,m=(0,b.useId)(),s=(0,b.useMemo)(()=>t.commands.map((e,a)=>({...e,key:e.id??`#${a}`})),[t.commands]),[n,d]=(0,b.useState)(""),[i,f]=(0,b.useState)(g),[y,x]=(0,b.useState)(()=>new Set),[v,u]=(0,b.useState)(()=>new Set),w=(0,b.useDeferredValue)(n),k=(0,b.useMemo)(()=>G(w),[w]),h=ar(k),$=(0,b.useRef)(null),B=(0,b.useRef)(null),z=(0,b.useMemo)(()=>k.length?s.filter(e=>_(e,k)):s,[s,k]),A=t.groups.map(e=>({...e,total:s.filter(a=>a.group===e.id).length,items:z.filter(a=>a.group===e.id)})),L=A.filter(e=>(i===g||e.id===i)&&e.items.length),W=L.reduce((e,a)=>e+a.items.length,0),R=A.find(e=>e.id===i)?.label,X=L.length>1||i===g,Y=(e,a)=>i===g&&!k.length&&!v.has(e)&&a>T+2,rr=e=>x(a=>{let o=new Set(a);return o.has(e)?o.delete(e):o.add(e),o}),D=()=>{d(""),$.current?.focus()},H=()=>[...B.current?.querySelectorAll(".cr-row:not([hidden] *)")??[]],er=e=>{if(e.key==="Escape"&&n&&(e.preventDefault(),d("")),e.key==="ArrowDown"){let a=H()[0];if(!a)return;e.preventDefault(),a.focus()}},or=e=>{if(e.key!=="ArrowDown"&&e.key!=="ArrowUp")return;let a=H(),o=a.indexOf(document.activeElement);o<0||(e.preventDefault(),e.key==="ArrowUp"&&o===0?$.current?.focus():a[Math.max(0,Math.min(a.length-1,o+(e.key==="ArrowDown"?1:-1)))]?.focus())};return(0,r.jsxs)("section",{className:"sb-block cr-block","aria-label":V(t.title,c("title")),children:[(t.title||t.description)&&(0,r.jsxs)("div",{className:"cr-head",children:[t.title&&(0,r.jsx)("h3",{className:"cr-heading",children:(0,r.jsx)(U,{text:t.title})}),t.description&&(0,r.jsx)("p",{className:"cr-sub",children:(0,r.jsx)(M,{source:t.description})})]}),(0,r.jsxs)("div",{className:"cr-search",children:[(0,r.jsxs)("svg",{className:"cr-glass",viewBox:"0 0 16 16","aria-hidden":"true",children:[(0,r.jsx)("circle",{cx:"7",cy:"7",r:"4.6"}),(0,r.jsx)("path",{d:"M10.4 10.4l3.3 3.3"})]}),(0,r.jsx)("input",{ref:$,type:"search",value:n,placeholder:t.placeholder??c("placeholder"),"aria-label":c("search"),"aria-controls":`${m}-list`,spellCheck:!1,autoComplete:"off",onChange:e=>d(e.currentTarget.value),onKeyDown:er}),n?(0,r.jsx)("button",{type:"button",className:"cr-clear",onClick:D,"aria-label":c("clear"),children:(0,r.jsx)("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M5 5l6 6M11 5l-6 6"})})}):(0,r.jsx)("span",{className:"cr-total",children:c("total",{count:s.length})})]}),(0,r.jsx)("p",{className:"cr-status",role:"status",children:k.length?c("found",{count:z.length}):""}),(0,r.jsxs)("div",{className:"cr-chips",role:"group","aria-label":c("filter"),children:[(0,r.jsxs)("button",{type:"button","aria-pressed":i===g,onClick:()=>f(g),children:[c("all"),(0,r.jsx)("span",{children:z.length})]}),A.map(e=>(0,r.jsxs)("button",{type:"button","aria-pressed":i===e.id,className:e.items.length?void 0:"is-zero",onClick:()=>f(a=>a===e.id?g:e.id),children:[e.label,(0,r.jsx)("span",{children:e.items.length})]},e.id))]}),W?(0,r.jsx)("div",{className:"cr-list",id:`${m}-list`,ref:B,onKeyDown:or,children:L.map(e=>{let a=Y(e.id,e.items.length);return(0,r.jsxs)("section",{className:"cr-section","aria-label":e.label,children:[X&&(0,r.jsxs)("div",{className:"cr-grouphead",children:[(0,r.jsx)("span",{children:e.label}),(0,r.jsx)("span",{className:"cr-groupcount",children:k.length?c("groupCount",{shown:e.items.length,total:e.total}):e.total})]}),(0,r.jsx)("ul",{children:e.items.map((o,cr)=>{let S=y.has(o.key),q=`${m}-d${o.key}`,N=!!(o.detail||o.params?.length||o.examples?.length),K=k.length?(o.params??[]).filter(p=>k.some(C=>!o.command.toLowerCase().includes(C)&&!o.summary.toLowerCase().includes(C)&&`${p.name} ${p.meaning}`.toLowerCase().includes(C))):[];return(0,r.jsxs)("li",{className:`cr-item${S?" is-open":""}`,hidden:a&&cr>=T,children:[(0,r.jsxs)("button",{type:"button",className:"cr-row","aria-expanded":N?S:void 0,"aria-controls":N?q:void 0,"data-static":N?void 0:"",onClick:()=>N&&rr(o.key),children:[(0,r.jsxs)("span",{className:"cr-main",children:[(0,r.jsx)(nr,{text:o.command,terms:k,program:t.program}),(0,r.jsx)("span",{className:"cr-summary",children:(0,r.jsx)(M,{source:o.summary,mark:h,links:!1})}),K.length>0&&(0,r.jsxs)("span",{className:"cr-paramhits",children:[c("params"),K.slice(0,4).map(p=>(0,r.jsx)("code",{children:h?h(p.name,p.name):p.name},p.name))]})]}),N&&(0,r.jsx)("svg",{className:"cr-chev",viewBox:"0 0 12 12","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M3 4.75L6 7.75 9 4.75"})})]}),N&&(0,r.jsxs)("div",{className:"cr-detail",id:q,hidden:!S,children:[o.detail&&(0,r.jsx)("div",{className:"cr-body",children:(0,r.jsx)(lr,{source:o.detail})}),o.params&&o.params.length>0&&(0,r.jsxs)("table",{className:"cr-params",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{scope:"col",children:c("paramName")}),(0,r.jsx)("th",{scope:"col",children:c("paramMeaning")})]})}),(0,r.jsx)("tbody",{children:o.params.map(p=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{scope:"row",children:(0,r.jsx)("code",{children:h?h(p.name,p.name):p.name})}),(0,r.jsx)("td",{children:(0,r.jsx)(M,{source:p.meaning})})]},p.name))})]}),o.examples&&o.examples.length>0&&(0,r.jsx)(F,{variants:o.examples.map((p,C)=>({label:p.label??(o.examples.length>1?`${c("example")} ${C+1}`:c("example")),code:p.code})),name:c("exampleName",{command:o.command})})]})]},o.key)})}),a&&(0,r.jsxs)("button",{type:"button",className:"cr-more",onClick:()=>u(o=>new Set(o).add(e.id)),children:[c("showMore",{count:e.items.length-T,group:e.label}),(0,r.jsx)("svg",{viewBox:"0 0 12 12","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M3 4.75L6 7.75 9 4.75"})})]})]},e.id)})}):(0,r.jsxs)("div",{className:"cr-empty",children:[(0,r.jsxs)("svg",{viewBox:"0 0 40 40","aria-hidden":"true",children:[(0,r.jsx)("circle",{cx:"18",cy:"18",r:"10"}),(0,r.jsx)("path",{d:"M25.5 25.5l7 7"}),(0,r.jsx)("path",{d:"M14 18h8"})]}),(0,r.jsx)("p",{className:"cr-emptytitle",children:n.trim()?i!==g&&R?c("noMatchIn",{query:n.trim(),group:R}):c("noMatch",{query:n.trim()}):c("emptyGroup",{group:R??""})}),(0,r.jsx)("p",{className:"cr-emptyhint",children:c("emptyHint")}),(0,r.jsxs)("div",{className:"cr-emptyactions",children:[i!==g&&z.length>0&&(0,r.jsx)("button",{type:"button",onClick:()=>f(g),children:c("viewAll",{count:z.length})}),n&&(0,r.jsx)("button",{type:"button",onClick:D,children:c("clear")})]})]})]})}export{xr as CommandReferenceBlock};
@@ -0,0 +1 @@
1
+ import{a as C}from"./chunk-IKXQEYHR.js";import{c as x}from"./chunk-KF47DKNH.js";import{f as w,h as v}from"./chunk-ZSTUMTZM.js";import{Ab as k,c as B,mb as N}from"./chunk-XBPILGCT.js";import"./chunk-J6IRWTF7.js";import{c as g}from"./chunk-DCANE7XH.js";var s=g(B(),1);var e=g(N(),1),c={yes:"\u2713",no:"\u2715",partial:"\u25D0",neutral:"\u2022",na:""},M={yes:"matrix.legend.yes",no:"matrix.legend.no",partial:"matrix.legend.partial",neutral:"matrix.legend.neutral",na:"matrix.legend.na"};function j({data:$}){let n=k(C),a=$,[i,u]=(0,s.useState)(null),[h,T]=(0,s.useState)(!1),R=(0,s.useMemo)(()=>new Map(a.cells.map(t=>[`${t.row}\0${t.column}`,t])),[a.cells]),b=(0,s.useMemo)(()=>new Set(x(a)),[a]),m=h?a.rows.filter(t=>b.has(t.id)):a.rows,S=Object.keys(c).filter(t=>a.cells.some(o=>o.tone===t)),p=a.cells.filter(t=>t.note),f=t=>[t.highlight?"is-highlight":"",i===t.id?"is-focus":""].filter(Boolean).join(" ")||void 0;return(0,e.jsxs)("section",{className:"sb-block an-block","aria-label":v(a.title,n("matrix.title")),children:[(0,e.jsxs)("div",{className:"an-head",children:[a.title&&(0,e.jsx)("h3",{className:"an-title",children:(0,e.jsx)(w,{text:a.title})}),a.description&&(0,e.jsx)("p",{className:"an-sub",children:a.description}),(0,e.jsxs)("div",{className:"an-tools",children:[(0,e.jsx)("button",{type:"button",className:"an-chip","aria-pressed":h,onClick:()=>T(t=>!t),children:n("matrix.diffOnly",{count:b.size,total:a.rows.length})}),i&&(0,e.jsx)("button",{type:"button",className:"an-chip",onClick:()=>u(null),children:n("matrix.clearFocus")})]})]}),(0,e.jsx)("div",{className:"an-matrix-scroll",children:(0,e.jsxs)("table",{className:`an-matrix${i?" has-focus":""}`,children:[(0,e.jsx)("thead",{children:(0,e.jsxs)("tr",{children:[(0,e.jsx)("th",{className:"an-rowhead",scope:"col",children:n("matrix.dimension")}),a.columns.map(t=>(0,e.jsxs)("th",{scope:"col",className:f(t),children:[(0,e.jsxs)("button",{type:"button",className:"an-col-button","aria-pressed":i===t.id,onClick:()=>u(i===t.id?null:t.id),children:[t.label,t.note&&(0,e.jsx)("span",{className:"an-col-note",children:t.note})]}),t.url&&(0,e.jsx)("a",{href:t.url,target:"_blank",rel:"noreferrer",className:"an-col-note",children:n("matrix.source")})]},t.id))]})}),(0,e.jsxs)("tbody",{children:[m.length===0&&(0,e.jsx)("tr",{children:(0,e.jsx)("td",{colSpan:a.columns.length+1,className:"an-empty",children:n("matrix.allSame")})}),m.map((t,o)=>{let O=t.group&&t.group!==m[o-1]?.group;return(0,e.jsxs)(s.Fragment,{children:[O&&(0,e.jsx)("tr",{className:"an-group-row",children:(0,e.jsx)("th",{colSpan:a.columns.length+1,scope:"rowgroup",children:t.group})}),(0,e.jsxs)("tr",{children:[(0,e.jsxs)("th",{className:"an-rowhead",scope:"row",children:[(0,e.jsx)("div",{className:"an-row-label",children:t.label}),t.hint&&(0,e.jsx)("div",{className:"an-row-hint",children:t.hint})]}),a.columns.map(d=>{let r=R.get(`${t.id}\0${d.id}`),l=r?.tone??"na",y=r?.note?p.indexOf(r)+1:0;return(0,e.jsxs)("td",{className:f(d),title:r?.note,children:[(0,e.jsxs)("span",{className:`an-cell an-tone-${l}`,children:[c[l]&&(0,e.jsx)("b",{"aria-hidden":"true",children:c[l]}),(0,e.jsx)("span",{children:r?.text??(l==="na"?"\u2014":a.legend?.[l]??n(M[l]))})]}),y>0&&(0,e.jsx)("sup",{className:"an-note-mark",children:y})]},d.id)})]})]},t.id)})]})]})}),(0,e.jsxs)("div",{className:"an-legend",children:[S.map(t=>(0,e.jsxs)("span",{className:`an-tone-${t}`,children:[c[t]?(0,e.jsx)("b",{children:c[t]}):"\u2014"," ",a.legend?.[t]??n(M[t])]},t)),(0,e.jsx)("span",{children:n("matrix.focusHint")})]}),p.length>0&&(0,e.jsx)("ol",{className:"an-static","aria-label":n("matrix.notes"),children:p.map(t=>(0,e.jsx)("li",{children:n("matrix.note",{column:a.columns.find(o=>o.id===t.column)?.label??"",row:a.rows.find(o=>o.id===t.row)?.label??"",note:t.note??""})},`${t.row}-${t.column}`))})]})}export{j as ComparisonMatrixBlock};
@@ -1,2 +1,2 @@
1
- import{a as oe,c as ne,d as le,e as se,f as ae}from"./chunk-JXKAISUX.js";import{d as be}from"./chunk-XI4I5HQF.js";import{a as ee,c as we,hb as te,jb as re,kb as ce}from"./chunk-S4EP5SMX.js";import{a as ie}from"./chunk-J6IRWTF7.js";import{c as U}from"./chunk-DCANE7XH.js";var h=U(we(),1);ee(`.sb-block.et-block :is(h3,h4,p,ul,ol,li,pre):not(svg){margin:0}.sb-block.et-block li:not(svg){padding:0}.sb-block.et-block pre:not(svg){border:0;border-radius:0;background:none;color:inherit}.sb-block.et-block{--et-text: var(--text, #222222);--et-muted: var(--muted, #6a6a6a);--et-line: var(--line, #dddddd);--et-paper: var(--paper, #ffffff);--et-surface: var(--surface, #fafafa);--et-focus: var(--accent, #120a8f);--et-neutral: #6b736d;--et-neutral-soft: #eef0ee;--et-info: #2c64a8;--et-info-soft: #dfeaf6;--et-good: #2f7d5b;--et-good-soft: #dcefe3;--et-warn: #94600f;--et-warn-soft: #f8ead0;--et-bad: #b53f2b;--et-bad-soft: #f8dfd9;--et-accent: var(--accent, #120a8f);--et-accent-soft: var(--accent-soft, #eeedf9);color:var(--et-text);font-family:inherit;font-size:14px;line-height:1.55;padding:8px 0;container-type:inline-size;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}:root[data-theme=dark] .sb-block.et-block,[data-theme=dark] .sb-block.et-block{--et-neutral: #a3aaa5;--et-neutral-soft: #2a2d2b;--et-info: #8bb8eb;--et-info-soft: #1f2d3d;--et-good: #7cc3a0;--et-good-soft: #20352b;--et-warn: #e0a96f;--et-warn-soft: #3a2c1e;--et-bad: #e48b83;--et-bad-soft: #3b2423}.sb-block.et-block *{box-sizing:border-box}.sb-block.et-block .et-head{margin-bottom:10px}.sb-block.et-block .et-title{font-size:17px;font-weight:700;margin:0}.sb-block.et-block .et-sub{color:var(--et-muted);font-size:13px;margin:2px 0 0}.sb-block.et-block .et-summary{display:flex;flex-wrap:wrap;gap:6px 28px;margin:0 0 12px;padding-bottom:10px;border-bottom:1px solid var(--et-line)}.sb-block.et-block .et-summary div{display:flex;align-items:baseline;gap:8px}.sb-block.et-block .et-summary dd{order:-1;margin:0;font-size:20px;font-weight:700;letter-spacing:-.01em}.sb-block.et-block .et-summary dt{font-size:12.5px;color:var(--et-muted)}.sb-block.et-block .et-body{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(0,1fr);gap:16px;align-items:start}.sb-block.et-block .et-body.is-single{grid-template-columns:minmax(0,1fr)}.sb-block.et-block .et-main{min-width:0}.sb-block.et-block .et-readout{display:flex;flex-wrap:wrap;align-items:center;gap:4px 14px;margin-bottom:4px;font-size:12.5px;color:var(--et-muted)}.sb-block.et-block .et-now{display:inline-flex;align-items:baseline;gap:6px}.sb-block.et-block .et-now b{font:700 15px ui-monospace,Menlo,monospace;color:var(--et-text)}.sb-block.et-block .et-phase-pill{border-radius:999px;padding:1px 9px;font-size:12px;font-weight:600;color:var(--et-text)}.sb-block.et-block .et-value{display:inline-flex;align-items:center;gap:5px}.sb-block.et-block .et-value i{width:8px;height:8px;border-radius:50%}.sb-block.et-block .et-value b{color:var(--et-text);font-weight:650}.sb-block.et-block .et-chart{min-width:0}.sb-block.et-block .et-chart svg{display:block;width:100%;height:auto;touch-action:pan-y;cursor:col-resize;user-select:none}.sb-block.et-block .et-grid{stroke:var(--et-line);stroke-width:1;opacity:.7}.sb-block.et-block .et-baseline{stroke:var(--et-line);stroke-width:1}.sb-block.et-block .et-tick{font:10.5px ui-monospace,Menlo,monospace;fill:var(--et-muted)}.sb-block.et-block .et-phase-label{font-size:10.5px;font-weight:650;fill:var(--et-muted)}.sb-block.et-block .et-area{fill:currentColor;opacity:.15}.sb-block.et-block .et-line{fill:none;stroke:currentColor;stroke-width:2;stroke-linejoin:round}.sb-block.et-block .et-line.is-dashed{stroke-width:1.8;stroke-dasharray:5 3}.sb-block.et-block .et-cursor{stroke:var(--et-text);stroke-width:1.2}.sb-block.et-block .et-cursor-dot,.sb-block.et-block .et-marker{stroke:var(--et-paper);stroke-width:1.5}.sb-block.et-block .et-marker{cursor:pointer}.sb-block.et-block .et-marker.is-future{opacity:.45}.sb-block.et-block .et-controls{display:flex;align-items:center;gap:8px;margin-top:6px}.sb-block.et-block .et-controls input{flex:1;min-width:0;accent-color:var(--et-text)}.sb-block.et-block .et-step{flex:none;width:28px;height:28px;border:1px solid var(--et-line);border-radius:8px;background:var(--et-paper);color:var(--et-text);font:inherit;font-size:16px;line-height:1;cursor:pointer}.sb-block.et-block .et-step:disabled{opacity:.35;cursor:default}.sb-block.et-block .et-legend{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;margin-top:8px;font-size:12px;color:var(--et-muted)}.sb-block.et-block .et-legend>span>i{display:inline-block;width:16px;border-top:2px solid currentColor;margin-right:6px;vertical-align:3px}.sb-block.et-block .et-legend>span>i.is-dashed{border-top-style:dashed}.sb-block.et-block .et-phases{display:flex;flex-wrap:wrap;gap:4px}.sb-block.et-block .et-phase-chip{border:1px solid transparent;border-radius:999px;padding:1px 9px;font:inherit;font-size:11.5px;font-weight:600;color:var(--et-text);cursor:pointer}.sb-block.et-block .et-phase-chip small{font:10.5px ui-monospace,Menlo,monospace;color:var(--et-muted);margin-left:5px}.sb-block.et-block .et-phase-chip[aria-pressed=true]{border-color:var(--et-text)}.sb-block.et-block .et-note{margin:6px 0 0;font-size:11.5px;color:var(--et-muted)}.sb-block.et-block .et-events{list-style:none;margin:0;padding:0 4px 0 0;max-height:380px;overflow-y:auto;border-left:2px solid var(--et-line);scrollbar-width:thin}.sb-block.et-block .et-events li{position:relative;padding-left:14px}.sb-block.et-block .et-events li:before{content:"";position:absolute;left:-6px;top:13px;width:10px;height:10px;border-radius:50%;background:var(--et-paper);border:2px solid var(--kind)}.sb-block.et-block .et-events li.is-open:before{background:var(--kind)}.sb-block.et-block .et-events li.is-future{opacity:.55}.sb-block.et-block .et-events button{display:grid;grid-template-columns:auto 1fr;column-gap:8px;row-gap:3px;align-items:center;width:100%;padding:7px 8px;border:0;border-radius:9px;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}.sb-block.et-block .et-events button:hover{background:var(--et-surface)}.sb-block.et-block .et-events li.is-open .et-card{background:var(--et-paper);box-shadow:0 0 0 1px var(--et-line);border-radius:9px}.sb-block.et-block .et-events li.is-open button:hover{background:transparent}.sb-block.et-block .et-events time{font:700 12px ui-monospace,Menlo,monospace;color:var(--et-text)}.sb-block.et-block .et-kind{justify-self:start;font-size:10.5px;font-weight:700;color:var(--kind);border:1px solid var(--kind);border-radius:999px;padding:0 7px;line-height:17px}.sb-block.et-block .et-events strong{grid-column:1 / -1;font-size:13px;font-weight:600;line-height:1.4}.sb-block.et-block .et-detail{display:none;margin:0 0 4px;padding:2px 8px 8px;font-size:12.5px;line-height:1.55;color:var(--et-muted)}.sb-block.et-block .et-events li.is-open .et-detail{display:block}.sb-block.et-block .et-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}.sb-block.et-block .et-step:focus-visible,.sb-block.et-block .et-phase-chip:focus-visible,.sb-block.et-block .et-events button:focus-visible,.sb-block.et-block .et-controls input:focus-visible{outline:2px solid var(--et-focus);outline-offset:2px}@container (max-width: 760px){.sb-block.et-block .et-body{grid-template-columns:minmax(0,1fr)}.sb-block.et-block .et-events{max-height:300px}.sb-block.et-block .et-summary{gap:6px 18px}.sb-block.et-block .et-summary dd{font-size:17px}}@media(prefers-reduced-motion:reduce){.sb-block.et-block .et-events{scroll-behavior:auto}}@media print{.sb-block.et-block .et-controls{display:none}.sb-block.et-block .et-body{grid-template-columns:minmax(0,1fr)}.sb-block.et-block .et-events{max-height:none;overflow:visible}.sb-block.et-block .et-events li{break-inside:avoid}.sb-block.et-block .et-events li.is-future{opacity:1}.sb-block.et-block .et-detail{display:block}.sb-block.et-block .et-events li.is-open .et-card{box-shadow:none}}
1
+ import{a as oe,c as ne,d as le,e as se,f as ae}from"./chunk-JXKAISUX.js";import{h as be}from"./chunk-ZSTUMTZM.js";import{Ab as ce,a as ee,c as we,mb as te,zb as re}from"./chunk-XBPILGCT.js";import{a as ie}from"./chunk-J6IRWTF7.js";import{c as U}from"./chunk-DCANE7XH.js";var h=U(we(),1);ee(`.sb-block.et-block :is(h3,h4,p,ul,ol,li,pre):not(svg){margin:0}.sb-block.et-block li:not(svg){padding:0}.sb-block.et-block pre:not(svg){border:0;border-radius:0;background:none;color:inherit}.sb-block.et-block{--et-text: var(--text, #222222);--et-muted: var(--muted, #6a6a6a);--et-line: var(--line, #dddddd);--et-paper: var(--paper, #ffffff);--et-surface: var(--surface, #fafafa);--et-focus: var(--accent, #120a8f);--et-neutral: #6b736d;--et-neutral-soft: #eef0ee;--et-info: #2c64a8;--et-info-soft: #dfeaf6;--et-good: #2f7d5b;--et-good-soft: #dcefe3;--et-warn: #94600f;--et-warn-soft: #f8ead0;--et-bad: #b53f2b;--et-bad-soft: #f8dfd9;--et-accent: var(--accent, #120a8f);--et-accent-soft: var(--accent-soft, #eeedf9);color:var(--et-text);font-family:inherit;font-size:14px;line-height:1.55;padding:8px 0;container-type:inline-size;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}:root[data-theme=dark] .sb-block.et-block,[data-theme=dark] .sb-block.et-block{--et-neutral: #a3aaa5;--et-neutral-soft: #2a2d2b;--et-info: #8bb8eb;--et-info-soft: #1f2d3d;--et-good: #7cc3a0;--et-good-soft: #20352b;--et-warn: #e0a96f;--et-warn-soft: #3a2c1e;--et-bad: #e48b83;--et-bad-soft: #3b2423}.sb-block.et-block *{box-sizing:border-box}.sb-block.et-block .et-head{margin-bottom:10px}.sb-block.et-block .et-title{font-size:17px;font-weight:700;margin:0}.sb-block.et-block .et-sub{color:var(--et-muted);font-size:13px;margin:2px 0 0}.sb-block.et-block .et-summary{display:flex;flex-wrap:wrap;gap:6px 28px;margin:0 0 12px;padding-bottom:10px;border-bottom:1px solid var(--et-line)}.sb-block.et-block .et-summary div{display:flex;align-items:baseline;gap:8px}.sb-block.et-block .et-summary dd{order:-1;margin:0;font-size:20px;font-weight:700;letter-spacing:-.01em}.sb-block.et-block .et-summary dt{font-size:12.5px;color:var(--et-muted)}.sb-block.et-block .et-body{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(0,1fr);gap:16px;align-items:start}.sb-block.et-block .et-body.is-single{grid-template-columns:minmax(0,1fr)}.sb-block.et-block .et-main{min-width:0}.sb-block.et-block .et-readout{display:flex;flex-wrap:wrap;align-items:center;gap:4px 14px;margin-bottom:4px;font-size:12.5px;color:var(--et-muted)}.sb-block.et-block .et-now{display:inline-flex;align-items:baseline;gap:6px}.sb-block.et-block .et-now b{font:700 15px ui-monospace,Menlo,monospace;color:var(--et-text)}.sb-block.et-block .et-phase-pill{border-radius:999px;padding:1px 9px;font-size:12px;font-weight:600;color:var(--et-text)}.sb-block.et-block .et-value{display:inline-flex;align-items:center;gap:5px}.sb-block.et-block .et-value i{width:8px;height:8px;border-radius:50%}.sb-block.et-block .et-value b{color:var(--et-text);font-weight:650}.sb-block.et-block .et-chart{min-width:0}.sb-block.et-block .et-chart svg{display:block;width:100%;height:auto;touch-action:pan-y;cursor:col-resize;user-select:none}.sb-block.et-block .et-grid{stroke:var(--et-line);stroke-width:1;opacity:.7}.sb-block.et-block .et-baseline{stroke:var(--et-line);stroke-width:1}.sb-block.et-block .et-tick{font:10.5px ui-monospace,Menlo,monospace;fill:var(--et-muted)}.sb-block.et-block .et-phase-label{font-size:10.5px;font-weight:650;fill:var(--et-muted)}.sb-block.et-block .et-area{fill:currentColor;opacity:.15}.sb-block.et-block .et-line{fill:none;stroke:currentColor;stroke-width:2;stroke-linejoin:round}.sb-block.et-block .et-line.is-dashed{stroke-width:1.8;stroke-dasharray:5 3}.sb-block.et-block .et-cursor{stroke:var(--et-text);stroke-width:1.2}.sb-block.et-block .et-cursor-dot,.sb-block.et-block .et-marker{stroke:var(--et-paper);stroke-width:1.5}.sb-block.et-block .et-marker{cursor:pointer}.sb-block.et-block .et-marker.is-future{opacity:.45}.sb-block.et-block .et-controls{display:flex;align-items:center;gap:8px;margin-top:6px}.sb-block.et-block .et-controls input{flex:1;min-width:0;accent-color:var(--et-text)}.sb-block.et-block .et-step{flex:none;width:28px;height:28px;border:1px solid var(--et-line);border-radius:8px;background:var(--et-paper);color:var(--et-text);font:inherit;font-size:16px;line-height:1;cursor:pointer}.sb-block.et-block .et-step:disabled{opacity:.35;cursor:default}.sb-block.et-block .et-legend{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;margin-top:8px;font-size:12px;color:var(--et-muted)}.sb-block.et-block .et-legend>span>i{display:inline-block;width:16px;border-top:2px solid currentColor;margin-right:6px;vertical-align:3px}.sb-block.et-block .et-legend>span>i.is-dashed{border-top-style:dashed}.sb-block.et-block .et-phases{display:flex;flex-wrap:wrap;gap:4px}.sb-block.et-block .et-phase-chip{border:1px solid transparent;border-radius:999px;padding:1px 9px;font:inherit;font-size:11.5px;font-weight:600;color:var(--et-text);cursor:pointer}.sb-block.et-block .et-phase-chip small{font:10.5px ui-monospace,Menlo,monospace;color:var(--et-muted);margin-left:5px}.sb-block.et-block .et-phase-chip[aria-pressed=true]{border-color:var(--et-text)}.sb-block.et-block .et-note{margin:6px 0 0;font-size:11.5px;color:var(--et-muted)}.sb-block.et-block .et-events{list-style:none;margin:0;padding:0 4px 0 0;max-height:380px;overflow-y:auto;border-left:2px solid var(--et-line);scrollbar-width:thin}.sb-block.et-block .et-events li{position:relative;padding-left:14px}.sb-block.et-block .et-events li:before{content:"";position:absolute;left:-6px;top:13px;width:10px;height:10px;border-radius:50%;background:var(--et-paper);border:2px solid var(--kind)}.sb-block.et-block .et-events li.is-open:before{background:var(--kind)}.sb-block.et-block .et-events li.is-future{opacity:.55}.sb-block.et-block .et-events button{display:grid;grid-template-columns:auto 1fr;column-gap:8px;row-gap:3px;align-items:center;width:100%;padding:7px 8px;border:0;border-radius:9px;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}.sb-block.et-block .et-events button:hover{background:var(--et-surface)}.sb-block.et-block .et-events li.is-open .et-card{background:var(--et-paper);box-shadow:0 0 0 1px var(--et-line);border-radius:9px}.sb-block.et-block .et-events li.is-open button:hover{background:transparent}.sb-block.et-block .et-events time{font:700 12px ui-monospace,Menlo,monospace;color:var(--et-text)}.sb-block.et-block .et-kind{justify-self:start;font-size:10.5px;font-weight:700;color:var(--kind);border:1px solid var(--kind);border-radius:999px;padding:0 7px;line-height:17px}.sb-block.et-block .et-events strong{grid-column:1 / -1;font-size:13px;font-weight:600;line-height:1.4}.sb-block.et-block .et-detail{display:none;margin:0 0 4px;padding:2px 8px 8px;font-size:12.5px;line-height:1.55;color:var(--et-muted)}.sb-block.et-block .et-events li.is-open .et-detail{display:block}.sb-block.et-block .et-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}.sb-block.et-block .et-step:focus-visible,.sb-block.et-block .et-phase-chip:focus-visible,.sb-block.et-block .et-events button:focus-visible,.sb-block.et-block .et-controls input:focus-visible{outline:2px solid var(--et-focus);outline-offset:2px}@container (max-width: 760px){.sb-block.et-block .et-body{grid-template-columns:minmax(0,1fr)}.sb-block.et-block .et-events{max-height:300px}.sb-block.et-block .et-summary{gap:6px 18px}.sb-block.et-block .et-summary dd{font-size:17px}}@media(prefers-reduced-motion:reduce){.sb-block.et-block .et-events{scroll-behavior:auto}}@media print{.sb-block.et-block .et-controls{display:none}.sb-block.et-block .et-body{grid-template-columns:minmax(0,1fr)}.sb-block.et-block .et-events{max-height:none;overflow:visible}.sb-block.et-block .et-events li{break-inside:avoid}.sb-block.et-block .et-events li.is-future{opacity:1}.sb-block.et-block .et-detail{display:block}.sb-block.et-block .et-events li.is-open .et-card{box-shadow:none}}
2
2
  `);var pe=ie("eventTimeline",{"zh-CN":{title:"\u4E8B\u4EF6\u65F6\u95F4\u7EBF",position:"\u4F4D\u7F6E",chart:"{series} \u968F{axis}\u53D8\u5316\uFF0C\u6807\u51FA {count} \u4E2A\u4E8B\u4EF6",chartNoSeries:"\u6CBF{axis}\u6392\u5217\u7684 {count} \u4E2A\u4E8B\u4EF6",summary:"\u8981\u70B9",scrub:"\u62D6\u52A8\u67E5\u770B\u5404\u65F6\u95F4\u70B9",scrubValue:"{point}\uFF0C{event}",noEvent:"\u5C1A\u65E0\u4E8B\u4EF6",previous:"\u4E0A\u4E00\u4E2A\u4E8B\u4EF6",next:"\u4E0B\u4E00\u4E2A\u4E8B\u4EF6",phases:"\u9636\u6BB5",jumpToPhase:"\u8DF3\u5230\u9636\u6BB5 {label}\uFF08{from}\u2013{to}\uFF09",events:"\u4E8B\u4EF6 \xB7 {count}",seriesWithUnit:"{label}\uFF08{unit}\uFF09",future:"\u5C1A\u672A\u53D1\u751F",noValue:"\u65E0\u6570\u636E"},en:{title:"Event timeline",position:"Position",chart:"{series} over {axis}, with {count} events marked",chartNoSeries:"{count} events along {axis}",summary:"Highlights",scrub:"Drag to step through the timeline",scrubValue:"{point}, {event}",noEvent:"No event yet",previous:"Previous event",next:"Next event",phases:"Phases",jumpToPhase:"Jump to phase {label} ({from}\u2013{to})",events:"Events \xB7 {count}",seriesWithUnit:"{label} ({unit})",future:"Not yet reached",noValue:"No data"}});var t=U(te(),1),q=(a="neutral")=>`var(--et-${a})`,K=(a="neutral")=>`var(--et-${a}-soft)`,Ne=["info","bad","good"],F=(a,l)=>a.color??q(a.tone??Ne[l]);function Me(){let a=(0,h.useRef)(null),[l,b]=(0,h.useState)(640);return(0,h.useEffect)(()=>{let n=a.current;if(!n)return;let r=new ResizeObserver(([d])=>b(d.contentRect.width));return r.observe(n),()=>r.disconnect()},[]),[a,l]}function Te(a,l){let b=a/l||1,n=10**Math.floor(Math.log10(b)),r=b/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function de(a){if(!a.length)return null;let l=a.flatMap(s=>s.values.filter(z=>z!==null)),b=Math.min(0,...l,...a.map(s=>s.min??0)),n=Math.max(...l,...a.map(s=>s.max??-1/0));n<=b&&(n=b+1);let r=Te(n-b,4);b=a.some(s=>s.min!==void 0)?Math.min(...a.map(s=>s.min??b)):Math.floor(b/r)*r,n=Math.ceil(n/r)*r;let d=[];for(let s=b;s<=n+r/2;s+=r)d.push(Number(s.toFixed(10)));return{lo:b,hi:n,ticks:d,unit:a.find(s=>s.unit)?.unit}}function $e(a,l,b){return(b==="date"?[1,2,7,14,28,56,91,182,364]:[1,2,5,10,15,20,30,60,120,180,240,360,720]).find(r=>(a-1)/r<=l)??Math.ceil((a-1)/l)}var G=(a,l)=>new Intl.NumberFormat(l,{maximumFractionDigits:Math.abs(a)<10?2:1}).format(a);function De({data:a}){let l=ce(pe),b=re(),n=a,r=n.series??[],d=n.phases??[],s=n.events,z=new Map((n.kinds??[]).map(e=>[e.id,e])),y=oe(n),g=e=>ae(n.axis,e,b),J=e=>{let o=e?z.get(e):void 0;return o?.color??q(o?.tone)},L=se(n),[ue,H]=(0,h.useState)(L),[D,j]=(0,h.useState)(null);(0,h.useEffect)(()=>{H(L),j(null)},[L,y]);let u=Math.min(ue,y-1),m=D!==null&&s[D]?.at===u?D:ne(s,u),T=le(d,u),A=e=>{j(null),H(Math.max(0,Math.min(y-1,e)))},$=e=>{j(e),H(s[e].at)},V=m>0?m-1:null,R=m<s.length-1?m+1:null,[me,X]=Me(),P=X<520,v=de(r.filter(e=>e.axis!=="right")),w=de(r.filter(e=>e.axis==="right")),c={l:v?P?34:42:14,r:w?P?34:42:14,t:d.length?24:12,b:26},x=Math.max(240,X),S=r.length?P?190:240:96,B=x-c.l-c.r,N=S-c.b,k=e=>c.l+e/(y-1)*B,M=e=>o=>N-(o-e.lo)/(e.hi-e.lo)*(N-c.t),Z=e=>e.axis==="right"?w:v,_=r.map(e=>{let o=M(Z(e)),i=o(Math.max(Z(e).lo,0)),p=[[]];e.values.forEach((f,E)=>{f===null?p.push([]):p[p.length-1].push([k(E),o(f)])});let C=p.filter(f=>f.length>0),ge=C.map(f=>f.map(([E,I],ye)=>`${ye?"L":"M"}${E.toFixed(1)},${I.toFixed(1)}`).join("")).join(""),ve=e.area?C.map(f=>`M${f[0][0].toFixed(1)},${i.toFixed(1)}`+f.map(([E,I])=>`L${E.toFixed(1)},${I.toFixed(1)}`).join("")+`L${f[f.length-1][0].toFixed(1)},${i.toFixed(1)}Z`).join(""):"";return{item:e,line:ge,area:ve,y:o}}),ke=$e(y,Math.max(2,Math.floor(B/(P?58:72))),n.axis.type),Q=[];for(let e=0;e<y;e+=ke)Q.push(e);let Y=e=>{let o=e.currentTarget.getBoundingClientRect(),i=(e.clientX-o.left-c.l*o.width/x)/(B*o.width/x);A(Math.round(i*(y-1)))},W=(0,h.useRef)(null);(0,h.useEffect)(()=>{let e=W.current,o=e?.children[Math.max(m,0)];if(!e||!o||e.scrollHeight<=e.clientHeight)return;let i=o.offsetTop-e.offsetTop;if(i<e.scrollTop||i+o.offsetHeight>e.scrollTop+e.clientHeight){let p=matchMedia("(prefers-reduced-motion: reduce)").matches;e.scrollTo({top:Math.max(0,i-32),behavior:p?"auto":"smooth"})}},[m]);let fe=e=>{let o={ArrowDown:m+1,ArrowUp:m-1,Home:0,End:s.length-1};if(!(e.key in o))return;e.preventDefault();let i=Math.max(0,Math.min(s.length-1,o[e.key]));$(i),W.current?.querySelectorAll("button")[i]?.focus()},O=n.axis.label??l("position"),he=r.length?l("chart",{series:r.map(e=>e.label).join(" / "),axis:O,count:s.length}):l("chartNoSeries",{axis:O,count:s.length}),xe=m>=0?s[m]:void 0;return(0,t.jsxs)("section",{className:"sb-block et-block","aria-label":be(n.title,l("title")),children:[(n.title||n.description)&&(0,t.jsxs)("div",{className:"et-head",children:[n.title&&(0,t.jsx)("h3",{className:"et-title",children:n.title}),n.description&&(0,t.jsx)("p",{className:"et-sub",children:n.description})]}),n.summary&&n.summary.length>0&&(0,t.jsx)("dl",{className:"et-summary","aria-label":l("summary"),children:n.summary.map(e=>(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{children:e.label}),(0,t.jsx)("dd",{style:e.tone?{color:q(e.tone)}:void 0,children:e.value})]},e.label))}),(0,t.jsxs)("div",{className:`et-body${s.length?"":" is-single"}`,children:[(0,t.jsxs)("div",{className:"et-main",children:[(0,t.jsxs)("div",{className:"et-readout","aria-live":"polite",children:[(0,t.jsxs)("span",{className:"et-now",children:[(0,t.jsx)("small",{children:O}),(0,t.jsx)("b",{children:g(u)})]}),T>=0&&(0,t.jsx)("span",{className:"et-phase-pill",style:{background:K(d[T].tone)},children:d[T].label}),r.map((e,o)=>{let i=e.values[u];return(0,t.jsxs)("span",{className:"et-value",children:[(0,t.jsx)("i",{style:{background:F(e,o)}}),e.label," ",(0,t.jsx)("b",{children:i===null?l("noValue"):`${G(i,b)}${e.unit??""}`})]},e.id)})]}),(0,t.jsx)("div",{className:"et-chart",ref:me,children:(0,t.jsxs)("svg",{width:x,height:S,viewBox:`0 0 ${x} ${S}`,role:"img","aria-label":he,onPointerDown:e=>{e.currentTarget.setPointerCapture(e.pointerId),Y(e)},onPointerMove:e=>{e.buttons&1&&Y(e)},children:[d.map((e,o)=>(0,t.jsx)("rect",{x:k(e.from),y:c.t-20,width:k(e.to)-k(e.from),height:N-c.t+20,fill:K(e.tone),opacity:o===T?1:.55},`band-${e.from}`)),d.map(e=>{let o=k(e.to)-k(e.from)-8,i=[...e.label].reduce((p,C)=>p+(C.charCodeAt(0)>11904?11:6.2),0);return o>=i?(0,t.jsx)("text",{x:k(e.from)+4,y:c.t-7,className:"et-phase-label",children:e.label},`phase-${e.from}`):null}),v?.ticks.map(e=>(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:c.l,x2:x-c.r,y1:M(v)(e),y2:M(v)(e),className:"et-grid"}),(0,t.jsx)("text",{x:c.l-6,y:M(v)(e),className:"et-tick",textAnchor:"end",dominantBaseline:"middle",children:G(e,b)})]},`l${e}`)),w?.ticks.map(e=>(0,t.jsxs)("g",{children:[!v&&(0,t.jsx)("line",{x1:c.l,x2:x-c.r,y1:M(w)(e),y2:M(w)(e),className:"et-grid"}),(0,t.jsx)("text",{x:x-c.r+6,y:M(w)(e),className:"et-tick",dominantBaseline:"middle",children:G(e,b)})]},`r${e}`)),v?.unit&&(0,t.jsx)("text",{x:c.l-6,y:c.t-7,className:"et-tick",textAnchor:"end",children:v.unit}),w?.unit&&(0,t.jsx)("text",{x:x-c.r+6,y:c.t-7,className:"et-tick",children:w.unit}),(0,t.jsx)("line",{x1:c.l,x2:x-c.r,y1:N,y2:N,className:"et-baseline"}),Q.map(e=>(0,t.jsx)("text",{x:k(e),y:S-8,className:"et-tick",textAnchor:e===0&&c.l<30?"start":"middle",children:g(e)},`x${e}`)),_.map(({item:e,line:o,area:i},p)=>(0,t.jsxs)("g",{style:{color:F(e,p)},children:[i&&(0,t.jsx)("path",{d:i,className:"et-area"}),(0,t.jsx)("path",{d:o,className:`et-line${e.dashed?" is-dashed":""}`})]},e.id)),(0,t.jsx)("line",{x1:k(u),x2:k(u),y1:d.length?c.t-20:c.t,y2:N,className:"et-cursor"}),_.map(({item:e,y:o},i)=>{let p=e.values[u];return p===null?null:(0,t.jsx)("circle",{cx:k(u),cy:o(p),r:4,className:"et-cursor-dot",style:{fill:F(e,i)}},`c-${e.id}`)}),s.map((e,o)=>(0,t.jsx)("circle",{cx:k(e.at),cy:N,r:o===m?6:4,className:`et-marker${e.at>u?" is-future":""}`,style:{fill:J(e.kind)},onPointerDown:i=>{i.stopPropagation(),$(o)},children:(0,t.jsx)("title",{children:`${g(e.at)} ${e.title}`})},`e${o}`))]})}),(0,t.jsxs)("div",{className:"et-controls",children:[(0,t.jsx)("button",{type:"button",className:"et-step","aria-label":l("previous"),title:l("previous"),disabled:V===null,onClick:()=>V!==null&&$(V),children:"\u2039"}),(0,t.jsx)("input",{type:"range",min:0,max:y-1,step:1,value:u,"aria-label":l("scrub"),"aria-valuetext":l("scrubValue",{point:g(u),event:xe?.title??l("noEvent")}),onChange:e=>A(Number(e.target.value))}),(0,t.jsx)("button",{type:"button",className:"et-step","aria-label":l("next"),title:l("next"),disabled:R===null,onClick:()=>R!==null&&$(R),children:"\u203A"})]}),(r.length>0||d.length>0)&&(0,t.jsxs)("div",{className:"et-legend",children:[r.map((e,o)=>(0,t.jsxs)("span",{children:[(0,t.jsx)("i",{className:e.dashed?"is-dashed":void 0,style:{color:F(e,o)}}),e.unit?l("seriesWithUnit",{label:e.label,unit:e.unit}):e.label]},e.id)),d.length>0&&(0,t.jsx)("span",{className:"et-phases",role:"group","aria-label":l("phases"),children:d.map((e,o)=>(0,t.jsxs)("button",{type:"button",className:"et-phase-chip",style:{background:K(e.tone)},"aria-pressed":o===T,"aria-label":l("jumpToPhase",{label:e.label,from:g(e.from),to:g(e.to)}),onClick:()=>A(e.from),children:[e.label,(0,t.jsxs)("small",{children:[g(e.from),"\u2013",g(e.to)]})]},`chip-${e.from}`))})]}),n.note&&(0,t.jsx)("p",{className:"et-note",children:n.note})]}),s.length>0&&(0,t.jsx)("ol",{className:"et-events",ref:W,"aria-label":l("events",{count:s.length}),onKeyDown:fe,children:s.map((e,o)=>{let i=e.kind?z.get(e.kind):void 0,p=o===m;return(0,t.jsx)("li",{className:`${p?"is-open":""}${e.at>u?" is-future":""}`,style:{"--kind":J(e.kind)},children:(0,t.jsxs)("div",{className:"et-card",children:[(0,t.jsxs)("button",{type:"button","aria-current":p?"step":void 0,"aria-expanded":e.detail?p:void 0,tabIndex:p||m===-1&&o===0?0:-1,onClick:()=>$(o),children:[(0,t.jsx)("time",{children:g(e.at)}),i&&(0,t.jsx)("span",{className:"et-kind",children:i.label}),e.at>u&&(0,t.jsx)("span",{className:"et-sr",children:l("future")}),(0,t.jsx)("strong",{children:e.title})]}),e.detail&&(0,t.jsx)("p",{className:"et-detail",children:e.detail})]})},`${e.at}-${o}`)})})]})]})}export{De as EventTimelineBlock};
@@ -1 +1 @@
1
- import{a as Z}from"./chunk-P2CMIXOU.js";import{e as rt}from"./chunk-KF47DKNH.js";import{d as lt}from"./chunk-XI4I5HQF.js";import{c as ut,hb as at,kb as Q}from"./chunk-S4EP5SMX.js";import{c as it}from"./chunk-J6IRWTF7.js";import{c as J}from"./chunk-DCANE7XH.js";var $=J(ut(),1);var t=J(at(),1),O={kept:"tracker.status.kept",discarded:"tracker.status.discarded",failed:"tracker.status.failed",running:"tracker.status.running",stopped:"tracker.status.stopped"},dt=["all","kept","running","discarded","failed","stopped"],X=["#2f6b4f","#3b74b8","#b0473f","#a86b34","#7061b0","#8a918c"],f=i=>Date.parse(i),z=i=>String(i).padStart(2,"0"),j=i=>{let r=new Date(i);return`${z(r.getMonth()+1)}-${z(r.getDate())} ${z(r.getHours())}:${z(r.getMinutes())}`},M=i=>i.toLocaleString(it(),{maximumFractionDigits:Math.abs(i)<10?3:1});function ot(){let i=(0,$.useRef)(null),[r,s]=(0,$.useState)(900);return(0,$.useEffect)(()=>{let h=i.current;if(!h)return;let b=new ResizeObserver(([N])=>s(N.contentRect.width));return b.observe(h),()=>b.disconnect()},[]),[i,r]}function mt({model:i,frontier:r,selected:s,onSelect:h}){let b=Q(Z),[N,x]=ot(),[u,p]=(0,$.useState)(null),H=360,o={l:44,r:16,t:18,b:52},y=28,g=H-o.t-o.b-y,w=i.metric.direction==="higher",B=i.experiments.filter(n=>n.score!==null),E=i.experiments.map(n=>f(n.start)),T=Math.min(...E),S=i.experiments.map(n=>f(n.start)+(n.minutes??0)*6e4),D=Math.max(i.updatedAt?f(i.updatedAt):0,...S,T+36e5),a=[...B.map(n=>n.score),...i.metric.baseline===void 0?[]:[i.metric.baseline]],A=(a.length?Math.max(...a)-Math.min(...a):0)*.1||Math.abs(a[0]??0)*.05||1,L=a.length?Math.min(...a)-A:0,W=a.length?Math.max(...a)+A:1,R=n=>o.l+(n-T)/(D-T)*(x-o.l-o.r),v=n=>o.t+(w?1-(n-L)/(W-L):(n-L)/(W-L))*g,C=o.t+g+y/2+6,G=new Map(i.experiments.map(n=>[n.id,n])),k=new Map((i.groups??[]).map(n=>[n.id,n])),U=new Map((i.runs??[]).map((n,m)=>[n.id,n.color??X[m%X.length]])),F=r.map(n=>G.get(n)),e="";F.forEach((n,m)=>{e+=m===0?`M${R(f(n.start))},${v(n.score)}`:`H${R(f(n.start))}V${v(n.score)}`}),F.length&&(e+=`H${R(D)}`);let l=new Set,c=-1/0;for(let n of F){let m=R(f(n.start));m-c>120&&(l.add(n.id),c=m)}let K=[],tt=(W-L)/5||1,et=Math.pow(10,Math.floor(Math.log10(tt))),Y=[1,2,5,10].map(n=>n*et).find(n=>n>=tt)??10*et;for(let n=Math.ceil(L/Y)*Y;n<=W;n+=Y)K.push(+n.toFixed(6));let nt=[],st=new Date(T);st.setHours(0,0,0,0);for(let n=st.getTime()+864e5;n<D;n+=864e5)nt.push(n);let ct=i.metric.unit??"";return(0,t.jsxs)("div",{className:"an-plot",ref:N,children:[(0,t.jsxs)("svg",{width:x,height:H,role:"img","aria-label":b("tracker.overTime",{metric:i.metric.label}),onMouseLeave:()=>p(null),children:[K.map(n=>(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{className:"an-grid-line",x1:o.l,x2:x-o.r,y1:v(n),y2:v(n)}),(0,t.jsx)("text",{x:o.l-8,y:v(n)+4,textAnchor:"end",children:M(n)})]},n)),nt.map(n=>(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:R(n),x2:R(n),y1:o.t,y2:o.t+g+y,stroke:"var(--an-line)"}),(0,t.jsx)("text",{x:R(n)+4,y:H-18,children:j(n).slice(0,5)})]},n)),(0,t.jsx)("rect",{className:"an-lane",x:o.l,y:o.t+g+6,width:Math.max(0,x-o.l-o.r),height:y,rx:6}),(0,t.jsx)("text",{x:o.l+8,y:C+4,children:b("tracker.noScore")}),i.metric.baseline!==void 0&&(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{className:"an-baseline",x1:o.l,x2:x-o.r,y1:v(i.metric.baseline),y2:v(i.metric.baseline)}),(0,t.jsx)("text",{className:"an-baseline-label",x:x-o.r-4,y:v(i.metric.baseline)-5,textAnchor:"end",children:b("tracker.baseline",{value:i.metric.baseline})})]}),e&&(0,t.jsx)("path",{className:"an-frontier",d:e}),i.experiments.map(n=>{let m=R(f(n.start)),_={onMouseEnter:()=>p(n),onClick:()=>h(n.id),className:"an-point"};if(n.score===null)return n.status==="failed"?(0,t.jsxs)("g",{..._,children:[(0,t.jsx)("path",{d:`M${m-5},${C-5}L${m+5},${C+5}M${m+5},${C-5}L${m-5},${C+5}`,stroke:"var(--an-bad)",strokeWidth:2.2}),(0,t.jsx)("circle",{cx:m,cy:C,r:9,fill:"transparent"})]},n.id):(0,t.jsxs)("g",{..._,children:[(0,t.jsx)("circle",{className:n.status==="running"?"an-ring":void 0,cx:m,cy:C,r:6,fill:"none",stroke:"var(--an-info)",strokeWidth:2}),(0,t.jsx)("circle",{cx:m,cy:C,r:3,fill:"var(--an-info)"})]},n.id);let I=v(n.score),V=k.get(n.group??"")?.shape==="diamond",q=U.get(n.id)??(n.status==="kept"?"var(--an-good)":n.status==="stopped"?"var(--an-warn)":"var(--an-idle)");return(0,t.jsxs)("g",{..._,children:[s===n.id&&(0,t.jsx)("circle",{cx:m,cy:I,r:13,fill:"none",stroke:"var(--an-text)",strokeWidth:1.5,strokeDasharray:"3 3"}),V?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("rect",{x:m-7,y:I-7,width:14,height:14,rx:3,transform:`rotate(45 ${m} ${I})`,fill:"var(--an-paper)",stroke:q,strokeWidth:3}),n.status==="running"&&(0,t.jsx)("circle",{className:"an-ring",cx:m,cy:I,r:11,fill:"none",stroke:q,strokeWidth:1.5})]}):n.status==="kept"?(0,t.jsx)("circle",{className:"an-point-kept",cx:m,cy:I,r:5.5}):(0,t.jsx)("circle",{className:"an-point-other",cx:m,cy:I,r:4}),(l.has(n.id)||V)&&(0,t.jsx)("text",{className:`an-point-label${l.has(n.id)?" is-frontier":""}`,x:m+10,y:I-8,style:V?{fill:q}:void 0,children:V?`${n.id} \xB7 ${M(n.score)}`:n.name.length>8?`${n.name.slice(0,8)}\u2026`:n.name})]},n.id)}),(0,t.jsx)("text",{x:o.l,y:H-2,children:b("tracker.startTime")})]}),u&&(0,t.jsxs)("div",{className:"an-tip",style:{left:Math.min(R(f(u.start))+14,x-230),top:u.score===null?C-120:Math.max(0,v(u.score)-20)},children:[(0,t.jsxs)("b",{children:[u.id," \xB7 ",u.name]}),(0,t.jsxs)("span",{children:[j(f(u.start)),u.minutes!==void 0&&` \xB7 ${b("tracker.minutes",{count:u.minutes})}`,u.resources!==void 0&&` \xB7 ${u.resources} ${i.resource?.unit??""}`]}),b("tracker.metricValue",{metric:i.metric.label,value:u.score===null?"\u2014":`${M(u.score)}${ct}`})," ","\xB7 ",b(O[u.status]),u.note&&(0,t.jsx)("span",{children:u.note})]})]})}function pt({chart:i,runs:r,colors:s,hoverStep:h,onHover:b}){let[N,x]=ot(),u=140,p={l:40,r:10,t:8,b:20},H=r.filter(a=>a.series[i.key]?.length),o=H.flatMap(a=>a.series[i.key]),y=Math.max(1,...H.flatMap(a=>a.steps));if(!o.length)return null;let g=Math.min(...o),w=Math.max(...o),B=(w-g)*.08||1;g-=B,w+=B;let E=a=>p.l+a/y*(x-p.l-p.r),T=a=>p.t+(1-(a-g)/(w-g))*(u-p.t-p.b),S=a=>Math.abs(w)<5?a.toFixed(2):M(Math.round(a)),D=a=>{if(h===null)return;let d=a.steps.findIndex(A=>A>=h);return d<0?void 0:{step:a.steps[d],value:a.series[i.key][d]}};return(0,t.jsxs)("div",{className:"an-panel an-mini",ref:N,children:[(0,t.jsxs)("p",{className:"an-panel-title",children:[i.label,i.unit&&(0,t.jsxs)("span",{className:"an-sub",children:[" \xB7 ",i.unit]})]}),(0,t.jsxs)("svg",{width:x,height:u,role:"img","aria-label":i.label,onMouseMove:a=>{let d=a.currentTarget.getBoundingClientRect();b(Math.max(0,Math.min(y,(a.clientX-d.left-p.l)/(x-p.l-p.r)*y)))},onMouseLeave:()=>b(null),children:[[g+(w-g)*.1,(g+w)/2,w-(w-g)*.1].map(a=>(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{className:"an-grid-line",x1:p.l,x2:x-p.r,y1:T(a),y2:T(a)}),(0,t.jsx)("text",{x:p.l-6,y:T(a)+3,textAnchor:"end",children:S(a)})]},a)),[0,y/2,y].map((a,d)=>(0,t.jsx)("text",{x:E(a),y:u-5,textAnchor:d===0?"start":d===2?"end":"middle",children:M(a)},a)),H.map(a=>(0,t.jsx)("path",{d:a.series[i.key].map((d,A)=>`${A?"L":"M"}${E(a.steps[A])},${T(d)}`).join(""),fill:"none",stroke:s.get(a.id),strokeWidth:2,strokeLinejoin:"round"},a.id)),h!==null&&(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:E(h),x2:E(h),y1:p.t,y2:u-p.b,stroke:"var(--an-text)",strokeOpacity:.35}),H.map(a=>{let d=D(a);return d?(0,t.jsx)("circle",{cx:E(d.step),cy:T(d.value),r:3.5,fill:s.get(a.id),stroke:"var(--an-paper)",strokeWidth:1.5},a.id):null})]})]}),(0,t.jsx)("div",{className:"an-mini-values",children:h!==null&&H.map(a=>{let d=D(a);return(0,t.jsxs)("span",{children:[(0,t.jsx)("b",{style:{color:s.get(a.id)},children:a.id})," ",d?S(d.value):"\u2014"]},a.id)})})]})}function P({label:i,value:r,unit:s,detail:h,wide:b,meter:N}){return(0,t.jsxs)("div",{className:`an-stat${b?" is-wide":""}`,children:[(0,t.jsx)("small",{children:i}),(0,t.jsxs)("div",{className:"an-stat-value",children:[r,s&&(0,t.jsx)("span",{className:"an-stat-unit",children:s})]}),h&&(0,t.jsx)("p",{children:h}),N!==void 0&&(0,t.jsx)("div",{className:"an-meter",children:(0,t.jsx)("i",{style:{width:`${Math.min(100,N*100)}%`}})})]})}function yt({data:i}){let r=Q(Z),s=i,[h,b]=(0,$.useState)("all"),[N,x]=(0,$.useState)(null),[u,p]=(0,$.useState)(new Set),[H,o]=(0,$.useState)(null),y=(0,$.useMemo)(()=>rt(s),[s]),g=s.runs??[],w=s.charts??[],B=new Map(g.map((e,l)=>[e.id,e.color??X[l%X.length]])),E=s.metric.direction==="higher",T=(e,l)=>E?e>l:e<l,S={all:s.experiments.length};for(let e of s.experiments)S[e.status]=(S[e.status]??0)+1;let D=s.experiments.filter(e=>h==="all"||e.status===h).sort((e,l)=>f(l.start)-f(e.start)),a=s.experiments.filter(e=>e.score!==null&&e.status!=="failed"),d=s.groups?.length?s.groups:[{id:"",label:r("tracker.best")}],A=d.map(e=>{let l=a.filter(c=>!s.groups?.length||c.group===e.id);return{group:e,best:l.reduce((c,K)=>!c||T(K.score,c.score)?K:c,null)}}),L=y.length?s.experiments.find(e=>e.id===y[y.length-1]):void 0,W=L&&s.metric.baseline!==void 0?(L.score-s.metric.baseline)*(E?1:-1):0,R=s.experiments.reduce((e,l)=>e+(l.minutes??0)/60*(l.resources??0),0),v=s.metric.unit??"",C=(0,$.useMemo)(()=>{let e=new Map;for(let l of s.experiments){if(!l.category)continue;let c=e.get(l.category)??{total:0,kept:0};c.total+=1,l.status==="kept"&&(c.kept+=1),e.set(l.category,c)}return[...e.entries()].sort((l,c)=>c[1].total-l[1].total)},[s.experiments]),G=Math.max(1,...C.map(([,e])=>e.total)),k=s.experiments.find(e=>e.id===N),U=g.filter(e=>!u.has(e.id)),F=e=>p(l=>{let c=new Set(l);return c.has(e)?c.delete(e):c.add(e),c});return(0,t.jsx)("section",{className:"sb-block an-block","aria-label":lt(s.title,r("tracker.title")),children:(0,t.jsxs)("div",{className:"an-tracker",children:[(0,t.jsxs)("div",{className:"an-head",children:[s.title&&(0,t.jsx)("h3",{className:"an-title",children:s.title}),s.subtitle&&(0,t.jsx)("p",{className:"an-sub",children:s.subtitle}),s.updatedAt&&(0,t.jsx)("p",{className:"an-sub an-tools",children:r("tracker.updatedAt",{time:j(f(s.updatedAt))})})]}),(0,t.jsxs)("div",{className:"an-tracker-grid",children:[(0,t.jsxs)("div",{className:"an-panel an-runs",children:[(0,t.jsxs)("div",{className:"an-runs-head",children:[(0,t.jsx)("p",{className:"an-panel-title",children:r("tracker.runs",{count:s.experiments.length})}),(0,t.jsx)("div",{className:"an-tools",style:{marginLeft:0},role:"group","aria-label":r("tracker.filterByStatus"),children:dt.filter(e=>e==="all"||S[e]).map(e=>(0,t.jsxs)("button",{type:"button",className:"an-chip","aria-pressed":h===e,onClick:()=>b(e),children:[r(e==="all"?"tracker.all":O[e])," ",S[e]??0]},e))})]}),(0,t.jsx)("div",{className:"an-runs-list",children:D.map(e=>{let l=g.find(c=>c.id===e.id);return(0,t.jsxs)("div",{role:"button",tabIndex:0,className:`an-row an-ex-${e.status}${N===e.id?" is-selected":""}`,onClick:()=>x(N===e.id?null:e.id),onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),x(N===e.id?null:e.id))},children:[l?(0,t.jsx)("input",{type:"checkbox","aria-label":r("tracker.showRun",{id:l.id}),checked:!u.has(l.id),onClick:c=>c.stopPropagation(),onChange:()=>F(l.id),style:{margin:0,accentColor:B.get(l.id)}}):(0,t.jsx)("span",{style:{width:8,height:8,borderRadius:4,background:"var(--tone)",justifySelf:"center"}}),(0,t.jsx)("b",{style:l?{color:B.get(l.id)}:void 0,children:e.id}),(0,t.jsxs)("span",{className:"an-row-name",children:[e.name,(0,t.jsxs)("small",{children:[j(f(e.start))," \xB7"," ",(0,t.jsx)("span",{className:"an-status",children:r(O[e.status])})]})]}),(0,t.jsx)("span",{className:"an-score",children:e.score===null?"\u2014":M(e.score)})]},e.id)})})]}),(0,t.jsxs)("div",{className:"an-main",children:[(0,t.jsxs)("div",{className:"an-panel",children:[(0,t.jsxs)("div",{className:"an-plot-legend",children:[(0,t.jsxs)("b",{children:[r("tracker.allExperiments",{metric:s.metric.label}),v?` (${v})`:""," \xB7"," ",r(E?"tracker.higherIsBetter":"tracker.lowerIsBetter")]}),y.length>0&&(0,t.jsx)("span",{children:r("tracker.frontier")}),(0,t.jsx)("span",{children:r("tracker.legendKept")}),(0,t.jsx)("span",{children:r("tracker.legendOther")}),s.groups?.some(e=>e.shape==="diamond")&&(0,t.jsxs)("span",{children:["\u25C7"," ",s.groups.filter(e=>e.shape==="diamond").map(e=>e.label).join(r("tracker.listSeparator"))]})]}),(0,t.jsx)(mt,{model:s,frontier:y,selected:N,onSelect:e=>x(N===e?null:e)})]}),w.length>0&&g.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"an-small-multiples",children:w.map(e=>(0,t.jsx)(pt,{chart:e,runs:U,colors:B,hoverStep:H,onHover:o},e.key))}),(0,t.jsxs)("div",{className:"an-legend",children:[g.map(e=>(0,t.jsxs)("span",{style:{opacity:u.has(e.id)?.35:1},children:[(0,t.jsx)("b",{style:{color:B.get(e.id)},children:"\u2501"})," ",e.id," \xB7"," ",e.name]},e.id)),(0,t.jsx)("span",{children:r("tracker.runsHint")})]})]})]}),(0,t.jsxs)("div",{className:"an-stats",children:[(0,t.jsxs)("div",{className:"an-stat-grid",children:[(0,t.jsx)(P,{label:r("tracker.total"),value:String(s.experiments.length),detail:d.length>1?d.map(e=>`${e.label} ${s.experiments.filter(l=>l.group===e.id).length}`).join(" \xB7 "):r("tracker.runningCount",{count:S.running??0})}),A.map(({group:e,best:l})=>l?(0,t.jsx)(P,{label:d.length>1?r("tracker.groupBest",{group:e.label}):r("tracker.currentBest"),value:M(l.score),unit:v,detail:`${l.id} \xB7 ${l.name}`},e.id):null),s.metric.baseline!==void 0&&L&&(0,t.jsx)(P,{label:r("tracker.gain"),value:`${W>=0?"+":"\u2212"}${M(Math.abs(W))}`,unit:v==="%"?"pt":v,detail:r("tracker.gainDetail",{best:M(L.score),baseline:s.metric.baseline})}),(0,t.jsx)(P,{label:r("tracker.keepRate"),value:String(Math.round((S.kept??0)/s.experiments.length*100)),unit:"%",detail:r("tracker.keepRateDetail",{kept:S.kept??0,running:S.running??0})}),s.resource&&(0,t.jsx)(P,{label:r("tracker.resourceHours",{unit:s.resource.unit}),value:M(Math.round(R)),detail:s.resource.budget?r("tracker.budget",{value:M(s.resource.budget)}):void 0,meter:s.resource.budget?R/s.resource.budget:void 0}),s.resource?.costPerHour!==void 0&&(0,t.jsx)(P,{wide:!0,label:r("tracker.cost"),value:`${s.resource.currency??"\xA5"}${M(Math.round(R*s.resource.costPerHour))}`,detail:r("tracker.costRate",{rate:`${s.resource.currency??"\xA5"}${s.resource.costPerHour}`,unit:s.resource.unit})})]}),C.length>0&&(0,t.jsxs)("div",{className:"an-panel",children:[(0,t.jsx)("p",{className:"an-panel-title",children:r("tracker.byCategory")}),C.map(([e,l])=>(0,t.jsxs)("div",{style:{fontSize:11.5,marginBottom:5},children:[(0,t.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[(0,t.jsx)("span",{children:e}),(0,t.jsxs)("span",{className:"an-sub",children:[l.kept," / ",l.total]})]}),(0,t.jsxs)("div",{className:"an-meter",children:[(0,t.jsx)("i",{className:"is-total",style:{width:`${l.total/G*100}%`}}),(0,t.jsx)("i",{style:{width:`${l.kept/G*100}%`}})]})]},e))]}),k&&(0,t.jsxs)("div",{className:"an-detail-card","aria-live":"polite",children:[(0,t.jsxs)("b",{children:[k.id," \xB7 ",k.name]}),(0,t.jsx)("span",{children:[k.category,s.groups?.find(e=>e.id===k.group)?.label].filter(Boolean).join(" \xB7 ")}),(0,t.jsxs)("span",{children:[j(f(k.start)),k.minutes!==void 0&&` \xB7 ${r("tracker.minutes",{count:k.minutes})}`,k.resources!==void 0&&` \xB7 ${k.resources} ${s.resource?.unit??""}`]}),r("tracker.metricValue",{metric:s.metric.label,value:k.score===null?"\u2014":M(k.score)})," ","\xB7 ",r(O[k.status]),k.note&&(0,t.jsx)("span",{children:k.note})]})]})]}),(0,t.jsxs)("details",{className:"an-static",children:[(0,t.jsx)("summary",{children:r("tracker.readTable",{count:s.experiments.length})}),(0,t.jsxs)("table",{children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{children:"ID"}),(0,t.jsx)("th",{children:r("tracker.column.name")}),(0,t.jsx)("th",{children:r("tracker.column.start")}),(0,t.jsx)("th",{children:r("tracker.column.status")}),(0,t.jsx)("th",{children:s.metric.label}),(0,t.jsx)("th",{children:r("tracker.column.note")})]})}),(0,t.jsx)("tbody",{children:[...s.experiments].sort((e,l)=>f(e.start)-f(l.start)).map(e=>(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{children:e.id}),(0,t.jsx)("td",{children:e.name}),(0,t.jsx)("td",{children:j(f(e.start))}),(0,t.jsx)("td",{children:r(O[e.status])}),(0,t.jsx)("td",{children:e.score===null?"\u2014":M(e.score)}),(0,t.jsx)("td",{children:e.note??""})]},e.id))})]})]})]})})}export{yt as ExperimentTrackerBlock};
1
+ import{a as Z}from"./chunk-IKXQEYHR.js";import{e as rt}from"./chunk-KF47DKNH.js";import{h as lt}from"./chunk-ZSTUMTZM.js";import{Ab as Q,c as ut,mb as at}from"./chunk-XBPILGCT.js";import{c as it}from"./chunk-J6IRWTF7.js";import{c as J}from"./chunk-DCANE7XH.js";var $=J(ut(),1);var t=J(at(),1),O={kept:"tracker.status.kept",discarded:"tracker.status.discarded",failed:"tracker.status.failed",running:"tracker.status.running",stopped:"tracker.status.stopped"},dt=["all","kept","running","discarded","failed","stopped"],X=["#2f6b4f","#3b74b8","#b0473f","#a86b34","#7061b0","#8a918c"],f=i=>Date.parse(i),z=i=>String(i).padStart(2,"0"),j=i=>{let r=new Date(i);return`${z(r.getMonth()+1)}-${z(r.getDate())} ${z(r.getHours())}:${z(r.getMinutes())}`},M=i=>i.toLocaleString(it(),{maximumFractionDigits:Math.abs(i)<10?3:1});function ot(){let i=(0,$.useRef)(null),[r,s]=(0,$.useState)(900);return(0,$.useEffect)(()=>{let h=i.current;if(!h)return;let b=new ResizeObserver(([N])=>s(N.contentRect.width));return b.observe(h),()=>b.disconnect()},[]),[i,r]}function mt({model:i,frontier:r,selected:s,onSelect:h}){let b=Q(Z),[N,x]=ot(),[u,p]=(0,$.useState)(null),H=360,o={l:44,r:16,t:18,b:52},y=28,g=H-o.t-o.b-y,w=i.metric.direction==="higher",B=i.experiments.filter(n=>n.score!==null),E=i.experiments.map(n=>f(n.start)),T=Math.min(...E),S=i.experiments.map(n=>f(n.start)+(n.minutes??0)*6e4),D=Math.max(i.updatedAt?f(i.updatedAt):0,...S,T+36e5),a=[...B.map(n=>n.score),...i.metric.baseline===void 0?[]:[i.metric.baseline]],A=(a.length?Math.max(...a)-Math.min(...a):0)*.1||Math.abs(a[0]??0)*.05||1,L=a.length?Math.min(...a)-A:0,W=a.length?Math.max(...a)+A:1,R=n=>o.l+(n-T)/(D-T)*(x-o.l-o.r),v=n=>o.t+(w?1-(n-L)/(W-L):(n-L)/(W-L))*g,C=o.t+g+y/2+6,G=new Map(i.experiments.map(n=>[n.id,n])),k=new Map((i.groups??[]).map(n=>[n.id,n])),U=new Map((i.runs??[]).map((n,m)=>[n.id,n.color??X[m%X.length]])),F=r.map(n=>G.get(n)),e="";F.forEach((n,m)=>{e+=m===0?`M${R(f(n.start))},${v(n.score)}`:`H${R(f(n.start))}V${v(n.score)}`}),F.length&&(e+=`H${R(D)}`);let l=new Set,c=-1/0;for(let n of F){let m=R(f(n.start));m-c>120&&(l.add(n.id),c=m)}let K=[],tt=(W-L)/5||1,et=Math.pow(10,Math.floor(Math.log10(tt))),Y=[1,2,5,10].map(n=>n*et).find(n=>n>=tt)??10*et;for(let n=Math.ceil(L/Y)*Y;n<=W;n+=Y)K.push(+n.toFixed(6));let nt=[],st=new Date(T);st.setHours(0,0,0,0);for(let n=st.getTime()+864e5;n<D;n+=864e5)nt.push(n);let ct=i.metric.unit??"";return(0,t.jsxs)("div",{className:"an-plot",ref:N,children:[(0,t.jsxs)("svg",{width:x,height:H,role:"img","aria-label":b("tracker.overTime",{metric:i.metric.label}),onMouseLeave:()=>p(null),children:[K.map(n=>(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{className:"an-grid-line",x1:o.l,x2:x-o.r,y1:v(n),y2:v(n)}),(0,t.jsx)("text",{x:o.l-8,y:v(n)+4,textAnchor:"end",children:M(n)})]},n)),nt.map(n=>(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:R(n),x2:R(n),y1:o.t,y2:o.t+g+y,stroke:"var(--an-line)"}),(0,t.jsx)("text",{x:R(n)+4,y:H-18,children:j(n).slice(0,5)})]},n)),(0,t.jsx)("rect",{className:"an-lane",x:o.l,y:o.t+g+6,width:Math.max(0,x-o.l-o.r),height:y,rx:6}),(0,t.jsx)("text",{x:o.l+8,y:C+4,children:b("tracker.noScore")}),i.metric.baseline!==void 0&&(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{className:"an-baseline",x1:o.l,x2:x-o.r,y1:v(i.metric.baseline),y2:v(i.metric.baseline)}),(0,t.jsx)("text",{className:"an-baseline-label",x:x-o.r-4,y:v(i.metric.baseline)-5,textAnchor:"end",children:b("tracker.baseline",{value:i.metric.baseline})})]}),e&&(0,t.jsx)("path",{className:"an-frontier",d:e}),i.experiments.map(n=>{let m=R(f(n.start)),_={onMouseEnter:()=>p(n),onClick:()=>h(n.id),className:"an-point"};if(n.score===null)return n.status==="failed"?(0,t.jsxs)("g",{..._,children:[(0,t.jsx)("path",{d:`M${m-5},${C-5}L${m+5},${C+5}M${m+5},${C-5}L${m-5},${C+5}`,stroke:"var(--an-bad)",strokeWidth:2.2}),(0,t.jsx)("circle",{cx:m,cy:C,r:9,fill:"transparent"})]},n.id):(0,t.jsxs)("g",{..._,children:[(0,t.jsx)("circle",{className:n.status==="running"?"an-ring":void 0,cx:m,cy:C,r:6,fill:"none",stroke:"var(--an-info)",strokeWidth:2}),(0,t.jsx)("circle",{cx:m,cy:C,r:3,fill:"var(--an-info)"})]},n.id);let I=v(n.score),V=k.get(n.group??"")?.shape==="diamond",q=U.get(n.id)??(n.status==="kept"?"var(--an-good)":n.status==="stopped"?"var(--an-warn)":"var(--an-idle)");return(0,t.jsxs)("g",{..._,children:[s===n.id&&(0,t.jsx)("circle",{cx:m,cy:I,r:13,fill:"none",stroke:"var(--an-text)",strokeWidth:1.5,strokeDasharray:"3 3"}),V?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("rect",{x:m-7,y:I-7,width:14,height:14,rx:3,transform:`rotate(45 ${m} ${I})`,fill:"var(--an-paper)",stroke:q,strokeWidth:3}),n.status==="running"&&(0,t.jsx)("circle",{className:"an-ring",cx:m,cy:I,r:11,fill:"none",stroke:q,strokeWidth:1.5})]}):n.status==="kept"?(0,t.jsx)("circle",{className:"an-point-kept",cx:m,cy:I,r:5.5}):(0,t.jsx)("circle",{className:"an-point-other",cx:m,cy:I,r:4}),(l.has(n.id)||V)&&(0,t.jsx)("text",{className:`an-point-label${l.has(n.id)?" is-frontier":""}`,x:m+10,y:I-8,style:V?{fill:q}:void 0,children:V?`${n.id} \xB7 ${M(n.score)}`:n.name.length>8?`${n.name.slice(0,8)}\u2026`:n.name})]},n.id)}),(0,t.jsx)("text",{x:o.l,y:H-2,children:b("tracker.startTime")})]}),u&&(0,t.jsxs)("div",{className:"an-tip",style:{left:Math.min(R(f(u.start))+14,x-230),top:u.score===null?C-120:Math.max(0,v(u.score)-20)},children:[(0,t.jsxs)("b",{children:[u.id," \xB7 ",u.name]}),(0,t.jsxs)("span",{children:[j(f(u.start)),u.minutes!==void 0&&` \xB7 ${b("tracker.minutes",{count:u.minutes})}`,u.resources!==void 0&&` \xB7 ${u.resources} ${i.resource?.unit??""}`]}),b("tracker.metricValue",{metric:i.metric.label,value:u.score===null?"\u2014":`${M(u.score)}${ct}`})," ","\xB7 ",b(O[u.status]),u.note&&(0,t.jsx)("span",{children:u.note})]})]})}function pt({chart:i,runs:r,colors:s,hoverStep:h,onHover:b}){let[N,x]=ot(),u=140,p={l:40,r:10,t:8,b:20},H=r.filter(a=>a.series[i.key]?.length),o=H.flatMap(a=>a.series[i.key]),y=Math.max(1,...H.flatMap(a=>a.steps));if(!o.length)return null;let g=Math.min(...o),w=Math.max(...o),B=(w-g)*.08||1;g-=B,w+=B;let E=a=>p.l+a/y*(x-p.l-p.r),T=a=>p.t+(1-(a-g)/(w-g))*(u-p.t-p.b),S=a=>Math.abs(w)<5?a.toFixed(2):M(Math.round(a)),D=a=>{if(h===null)return;let d=a.steps.findIndex(A=>A>=h);return d<0?void 0:{step:a.steps[d],value:a.series[i.key][d]}};return(0,t.jsxs)("div",{className:"an-panel an-mini",ref:N,children:[(0,t.jsxs)("p",{className:"an-panel-title",children:[i.label,i.unit&&(0,t.jsxs)("span",{className:"an-sub",children:[" \xB7 ",i.unit]})]}),(0,t.jsxs)("svg",{width:x,height:u,role:"img","aria-label":i.label,onMouseMove:a=>{let d=a.currentTarget.getBoundingClientRect();b(Math.max(0,Math.min(y,(a.clientX-d.left-p.l)/(x-p.l-p.r)*y)))},onMouseLeave:()=>b(null),children:[[g+(w-g)*.1,(g+w)/2,w-(w-g)*.1].map(a=>(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{className:"an-grid-line",x1:p.l,x2:x-p.r,y1:T(a),y2:T(a)}),(0,t.jsx)("text",{x:p.l-6,y:T(a)+3,textAnchor:"end",children:S(a)})]},a)),[0,y/2,y].map((a,d)=>(0,t.jsx)("text",{x:E(a),y:u-5,textAnchor:d===0?"start":d===2?"end":"middle",children:M(a)},a)),H.map(a=>(0,t.jsx)("path",{d:a.series[i.key].map((d,A)=>`${A?"L":"M"}${E(a.steps[A])},${T(d)}`).join(""),fill:"none",stroke:s.get(a.id),strokeWidth:2,strokeLinejoin:"round"},a.id)),h!==null&&(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:E(h),x2:E(h),y1:p.t,y2:u-p.b,stroke:"var(--an-text)",strokeOpacity:.35}),H.map(a=>{let d=D(a);return d?(0,t.jsx)("circle",{cx:E(d.step),cy:T(d.value),r:3.5,fill:s.get(a.id),stroke:"var(--an-paper)",strokeWidth:1.5},a.id):null})]})]}),(0,t.jsx)("div",{className:"an-mini-values",children:h!==null&&H.map(a=>{let d=D(a);return(0,t.jsxs)("span",{children:[(0,t.jsx)("b",{style:{color:s.get(a.id)},children:a.id})," ",d?S(d.value):"\u2014"]},a.id)})})]})}function P({label:i,value:r,unit:s,detail:h,wide:b,meter:N}){return(0,t.jsxs)("div",{className:`an-stat${b?" is-wide":""}`,children:[(0,t.jsx)("small",{children:i}),(0,t.jsxs)("div",{className:"an-stat-value",children:[r,s&&(0,t.jsx)("span",{className:"an-stat-unit",children:s})]}),h&&(0,t.jsx)("p",{children:h}),N!==void 0&&(0,t.jsx)("div",{className:"an-meter",children:(0,t.jsx)("i",{style:{width:`${Math.min(100,N*100)}%`}})})]})}function yt({data:i}){let r=Q(Z),s=i,[h,b]=(0,$.useState)("all"),[N,x]=(0,$.useState)(null),[u,p]=(0,$.useState)(new Set),[H,o]=(0,$.useState)(null),y=(0,$.useMemo)(()=>rt(s),[s]),g=s.runs??[],w=s.charts??[],B=new Map(g.map((e,l)=>[e.id,e.color??X[l%X.length]])),E=s.metric.direction==="higher",T=(e,l)=>E?e>l:e<l,S={all:s.experiments.length};for(let e of s.experiments)S[e.status]=(S[e.status]??0)+1;let D=s.experiments.filter(e=>h==="all"||e.status===h).sort((e,l)=>f(l.start)-f(e.start)),a=s.experiments.filter(e=>e.score!==null&&e.status!=="failed"),d=s.groups?.length?s.groups:[{id:"",label:r("tracker.best")}],A=d.map(e=>{let l=a.filter(c=>!s.groups?.length||c.group===e.id);return{group:e,best:l.reduce((c,K)=>!c||T(K.score,c.score)?K:c,null)}}),L=y.length?s.experiments.find(e=>e.id===y[y.length-1]):void 0,W=L&&s.metric.baseline!==void 0?(L.score-s.metric.baseline)*(E?1:-1):0,R=s.experiments.reduce((e,l)=>e+(l.minutes??0)/60*(l.resources??0),0),v=s.metric.unit??"",C=(0,$.useMemo)(()=>{let e=new Map;for(let l of s.experiments){if(!l.category)continue;let c=e.get(l.category)??{total:0,kept:0};c.total+=1,l.status==="kept"&&(c.kept+=1),e.set(l.category,c)}return[...e.entries()].sort((l,c)=>c[1].total-l[1].total)},[s.experiments]),G=Math.max(1,...C.map(([,e])=>e.total)),k=s.experiments.find(e=>e.id===N),U=g.filter(e=>!u.has(e.id)),F=e=>p(l=>{let c=new Set(l);return c.has(e)?c.delete(e):c.add(e),c});return(0,t.jsx)("section",{className:"sb-block an-block","aria-label":lt(s.title,r("tracker.title")),children:(0,t.jsxs)("div",{className:"an-tracker",children:[(0,t.jsxs)("div",{className:"an-head",children:[s.title&&(0,t.jsx)("h3",{className:"an-title",children:s.title}),s.subtitle&&(0,t.jsx)("p",{className:"an-sub",children:s.subtitle}),s.updatedAt&&(0,t.jsx)("p",{className:"an-sub an-tools",children:r("tracker.updatedAt",{time:j(f(s.updatedAt))})})]}),(0,t.jsxs)("div",{className:"an-tracker-grid",children:[(0,t.jsxs)("div",{className:"an-panel an-runs",children:[(0,t.jsxs)("div",{className:"an-runs-head",children:[(0,t.jsx)("p",{className:"an-panel-title",children:r("tracker.runs",{count:s.experiments.length})}),(0,t.jsx)("div",{className:"an-tools",style:{marginLeft:0},role:"group","aria-label":r("tracker.filterByStatus"),children:dt.filter(e=>e==="all"||S[e]).map(e=>(0,t.jsxs)("button",{type:"button",className:"an-chip","aria-pressed":h===e,onClick:()=>b(e),children:[r(e==="all"?"tracker.all":O[e])," ",S[e]??0]},e))})]}),(0,t.jsx)("div",{className:"an-runs-list",children:D.map(e=>{let l=g.find(c=>c.id===e.id);return(0,t.jsxs)("div",{role:"button",tabIndex:0,className:`an-row an-ex-${e.status}${N===e.id?" is-selected":""}`,onClick:()=>x(N===e.id?null:e.id),onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),x(N===e.id?null:e.id))},children:[l?(0,t.jsx)("input",{type:"checkbox","aria-label":r("tracker.showRun",{id:l.id}),checked:!u.has(l.id),onClick:c=>c.stopPropagation(),onChange:()=>F(l.id),style:{margin:0,accentColor:B.get(l.id)}}):(0,t.jsx)("span",{style:{width:8,height:8,borderRadius:4,background:"var(--tone)",justifySelf:"center"}}),(0,t.jsx)("b",{style:l?{color:B.get(l.id)}:void 0,children:e.id}),(0,t.jsxs)("span",{className:"an-row-name",children:[e.name,(0,t.jsxs)("small",{children:[j(f(e.start))," \xB7"," ",(0,t.jsx)("span",{className:"an-status",children:r(O[e.status])})]})]}),(0,t.jsx)("span",{className:"an-score",children:e.score===null?"\u2014":M(e.score)})]},e.id)})})]}),(0,t.jsxs)("div",{className:"an-main",children:[(0,t.jsxs)("div",{className:"an-panel",children:[(0,t.jsxs)("div",{className:"an-plot-legend",children:[(0,t.jsxs)("b",{children:[r("tracker.allExperiments",{metric:s.metric.label}),v?` (${v})`:""," \xB7"," ",r(E?"tracker.higherIsBetter":"tracker.lowerIsBetter")]}),y.length>0&&(0,t.jsx)("span",{children:r("tracker.frontier")}),(0,t.jsx)("span",{children:r("tracker.legendKept")}),(0,t.jsx)("span",{children:r("tracker.legendOther")}),s.groups?.some(e=>e.shape==="diamond")&&(0,t.jsxs)("span",{children:["\u25C7"," ",s.groups.filter(e=>e.shape==="diamond").map(e=>e.label).join(r("tracker.listSeparator"))]})]}),(0,t.jsx)(mt,{model:s,frontier:y,selected:N,onSelect:e=>x(N===e?null:e)})]}),w.length>0&&g.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"an-small-multiples",children:w.map(e=>(0,t.jsx)(pt,{chart:e,runs:U,colors:B,hoverStep:H,onHover:o},e.key))}),(0,t.jsxs)("div",{className:"an-legend",children:[g.map(e=>(0,t.jsxs)("span",{style:{opacity:u.has(e.id)?.35:1},children:[(0,t.jsx)("b",{style:{color:B.get(e.id)},children:"\u2501"})," ",e.id," \xB7"," ",e.name]},e.id)),(0,t.jsx)("span",{children:r("tracker.runsHint")})]})]})]}),(0,t.jsxs)("div",{className:"an-stats",children:[(0,t.jsxs)("div",{className:"an-stat-grid",children:[(0,t.jsx)(P,{label:r("tracker.total"),value:String(s.experiments.length),detail:d.length>1?d.map(e=>`${e.label} ${s.experiments.filter(l=>l.group===e.id).length}`).join(" \xB7 "):r("tracker.runningCount",{count:S.running??0})}),A.map(({group:e,best:l})=>l?(0,t.jsx)(P,{label:d.length>1?r("tracker.groupBest",{group:e.label}):r("tracker.currentBest"),value:M(l.score),unit:v,detail:`${l.id} \xB7 ${l.name}`},e.id):null),s.metric.baseline!==void 0&&L&&(0,t.jsx)(P,{label:r("tracker.gain"),value:`${W>=0?"+":"\u2212"}${M(Math.abs(W))}`,unit:v==="%"?"pt":v,detail:r("tracker.gainDetail",{best:M(L.score),baseline:s.metric.baseline})}),(0,t.jsx)(P,{label:r("tracker.keepRate"),value:String(Math.round((S.kept??0)/s.experiments.length*100)),unit:"%",detail:r("tracker.keepRateDetail",{kept:S.kept??0,running:S.running??0})}),s.resource&&(0,t.jsx)(P,{label:r("tracker.resourceHours",{unit:s.resource.unit}),value:M(Math.round(R)),detail:s.resource.budget?r("tracker.budget",{value:M(s.resource.budget)}):void 0,meter:s.resource.budget?R/s.resource.budget:void 0}),s.resource?.costPerHour!==void 0&&(0,t.jsx)(P,{wide:!0,label:r("tracker.cost"),value:`${s.resource.currency??"\xA5"}${M(Math.round(R*s.resource.costPerHour))}`,detail:r("tracker.costRate",{rate:`${s.resource.currency??"\xA5"}${s.resource.costPerHour}`,unit:s.resource.unit})})]}),C.length>0&&(0,t.jsxs)("div",{className:"an-panel",children:[(0,t.jsx)("p",{className:"an-panel-title",children:r("tracker.byCategory")}),C.map(([e,l])=>(0,t.jsxs)("div",{style:{fontSize:11.5,marginBottom:5},children:[(0,t.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[(0,t.jsx)("span",{children:e}),(0,t.jsxs)("span",{className:"an-sub",children:[l.kept," / ",l.total]})]}),(0,t.jsxs)("div",{className:"an-meter",children:[(0,t.jsx)("i",{className:"is-total",style:{width:`${l.total/G*100}%`}}),(0,t.jsx)("i",{style:{width:`${l.kept/G*100}%`}})]})]},e))]}),k&&(0,t.jsxs)("div",{className:"an-detail-card","aria-live":"polite",children:[(0,t.jsxs)("b",{children:[k.id," \xB7 ",k.name]}),(0,t.jsx)("span",{children:[k.category,s.groups?.find(e=>e.id===k.group)?.label].filter(Boolean).join(" \xB7 ")}),(0,t.jsxs)("span",{children:[j(f(k.start)),k.minutes!==void 0&&` \xB7 ${r("tracker.minutes",{count:k.minutes})}`,k.resources!==void 0&&` \xB7 ${k.resources} ${s.resource?.unit??""}`]}),r("tracker.metricValue",{metric:s.metric.label,value:k.score===null?"\u2014":M(k.score)})," ","\xB7 ",r(O[k.status]),k.note&&(0,t.jsx)("span",{children:k.note})]})]})]}),(0,t.jsxs)("details",{className:"an-static",children:[(0,t.jsx)("summary",{children:r("tracker.readTable",{count:s.experiments.length})}),(0,t.jsxs)("table",{children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{children:"ID"}),(0,t.jsx)("th",{children:r("tracker.column.name")}),(0,t.jsx)("th",{children:r("tracker.column.start")}),(0,t.jsx)("th",{children:r("tracker.column.status")}),(0,t.jsx)("th",{children:s.metric.label}),(0,t.jsx)("th",{children:r("tracker.column.note")})]})}),(0,t.jsx)("tbody",{children:[...s.experiments].sort((e,l)=>f(e.start)-f(l.start)).map(e=>(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{children:e.id}),(0,t.jsx)("td",{children:e.name}),(0,t.jsx)("td",{children:j(f(e.start))}),(0,t.jsx)("td",{children:r(O[e.status])}),(0,t.jsx)("td",{children:e.score===null?"\u2014":M(e.score)}),(0,t.jsx)("td",{children:e.note??""})]},e.id))})]})]})]})})}export{yt as ExperimentTrackerBlock};
@@ -1,4 +1,4 @@
1
- import{b as R,c as we,d as ve}from"./chunk-2YDDS4TW.js";import"./chunk-MGSP3OGB.js";import{b as x,j as Q}from"./chunk-SNEZ3O5V.js";import{d as ke,e as Ae}from"./chunk-VRAMSIGC.js";import"./chunk-5AW2WUSZ.js";import{c as Se,e as Le,g as S}from"./chunk-XI4I5HQF.js";import{J as me,a as pe,c as dt,eb as ue,hb as ge,kb as be}from"./chunk-S4EP5SMX.js";import{a as xe,f as ye}from"./chunk-J6IRWTF7.js";import{c as K}from"./chunk-DCANE7XH.js";var u=K(dt(),1);var Ee={html:`<!DOCTYPE html>
1
+ import{a as xe,b as ye}from"./chunk-GB7ZVF7X.js";import{b as R}from"./chunk-KQR52I3G.js";import{b as x,j as Q}from"./chunk-SNEZ3O5V.js";import{d as ke,e as Ae}from"./chunk-MXNP25YA.js";import"./chunk-5AW2WUSZ.js";import{d as Se,i as Le,k as S}from"./chunk-ZSTUMTZM.js";import{Ab as ve,L as me,a as pe,c as dt,ib as ue,mb as ge}from"./chunk-XBPILGCT.js";import{a as be,f as we}from"./chunk-J6IRWTF7.js";import{c as K}from"./chunk-DCANE7XH.js";var u=K(dt(),1);var Ee={html:`<!DOCTYPE html>
2
2
  <html lang="en" data-theme="dark" data-preset="[VISUAL PRESET]">
3
3
  <head>
4
4
  <meta charset="UTF-8">
@@ -29983,7 +29983,7 @@ ${a.items.map(i=>` <li>${v(i)}</li>`).join(`
29983
29983
  </div>`).join(`
29984
29984
 
29985
29985
  `)}
29986
- </div>`}var De=/ <!-- ARCHIFY:SVG_SLOT_START -->[\s\S]*? <!-- ARCHIFY:SVG_SLOT_END -->/,Ne=/ <!-- ARCHIFY:CARDS_SLOT_START -->[\s\S]*? <!-- ARCHIFY:CARDS_SLOT_END -->/,Fe=/^([ \t]*)<p class="subtitle">\[Subtitle description\]<\/p>[ \t]*(\r?\n)?/m,ae=" <!-- ARCHIFY:SOURCE_EVIDENCE_DATA -->",We=" <!-- ARCHIFY:I18N_DATA -->";function Be(e){return JSON.stringify(e).replaceAll("<","\\u003c").replaceAll(">","\\u003e").replaceAll("&","\\u0026")}var H=['<html lang="en" data-theme="dark" data-preset="[VISUAL PRESET]">',"<title>[PROJECT NAME] Architecture Diagram</title>","<h1>[PROJECT NAME] Architecture</h1>",We];function je(e,{title:t,subtitle:a,svg:i,cards:l,locale:d,visualPreset:n="classic",sourceEvidence:f=null}){if(!De.test(e))throw new Error("applyTemplate: template missing ARCHIFY:SVG_SLOT sentinel");if(!Ne.test(e))throw new Error("applyTemplate: template missing ARCHIFY:CARDS_SLOT sentinel");if(!Fe.test(e))throw new Error("applyTemplate: template missing subtitle placeholder");for(let M of H)if(!e.includes(M))throw new Error(`applyTemplate: template missing placeholder ${JSON.stringify(M)}`);if(f&&!e.includes(ae))throw new Error(`applyTemplate: repository evidence requires placeholder ${JSON.stringify(ae)}`);let p=Be(f),c=te(d),m=Be({locale:c,messages:Ge(c)}),h=typeof a=="string"&&a.trim()?`<p class="subtitle">${v(a)}</p>`:"",w=` <script id="archify-i18n-data" type="application/json">${m}<\/script>`;return Pe(e,c).replace(We,()=>w).replace(H[0],()=>`<html lang="${v(c)}" data-theme="dark" data-preset="${v(n)}">`).replace(H[1],()=>`<title>${v(ne(c,"page.title",{title:t}))}</title>`).replace(H[2],()=>`<h1>${v(t)}</h1>`).replace(Fe,(M,O,G="")=>h?`${O}${h}${G}`:"").replace(De,()=>i).replace(Ne,()=>l).replace(ae,()=>f?` <script id="archify-source-evidence-data" type="application/json">${p}<\/script>`:"")}var W=xe("diagram",{"zh-CN":{"family.archify":"Archify \u4EA4\u4E92\u67B6\u6784\u56FE","family.diagramDesign":"Diagram Design \u56FE\u5F62","family.fireworks":"Fireworks \u6280\u672F\u56FE",fileTooLarge:"\u8BF7\u9009\u62E9 8 MiB \u4EE5\u5185\u7684 HTML \u6216 SVG \u6587\u4EF6\u3002",changedElsewhere:"\u56FE\u5F62\u5DF2\u88AB\u5176\u4ED6\u4FEE\u6539\u66F4\u65B0\u3002\u8349\u7A3F\u5DF2\u4FDD\u7559\uFF0C\u8BF7\u91CD\u65B0\u8BFB\u53D6\u5E76\u5408\u5E76\u540E\u4FDD\u5B58\u3002",downloadSvg:"\u4E0B\u8F7D\u56FE\u5F62 SVG",downloadHtml:"\u4E0B\u8F7D\u5B8C\u6574\u56FE\u5F62 HTML",diagram:"\u56FE\u5F62",unlockDescription:"\u64CD\u4F5C\u56FE\u5F62\u5185\u7684\u63A2\u7D22\u3001\u7F29\u653E\u548C\u6EDA\u52A8",template:"\u6A21\u677F",diagramTemplate:"\u56FE\u5F62\u6A21\u677F",customTemplate:"\u5BFC\u5165\u6216\u81EA\u5B9A\u4E49\u56FE\u5F62",title:"\u6807\u9898",diagramTitle:"\u56FE\u5F62\u6807\u9898",height:"\u9AD8\u5EA6",diagramHeight:"\u56FE\u5F62\u9AD8\u5EA6",description:"\u8BF4\u660E",diagramDescription:"\u56FE\u5F62\u8BF4\u660E",labelsSummary:"\u56FE\u4E2D\u6587\u5B57\uFF08{count}\uFF09",labelField:"\u6587\u5B57 {index}",labelInput:"\u56FE\u4E2D\u6587\u5B57 {index}",source:"\u56FE\u5F62\u6E90\u7801",readLabels:"\u8BFB\u53D6\u56FE\u4E2D\u6587\u5B57",importFile:"\u5BFC\u5165 HTML / SVG",importFileInput:"\u5BFC\u5165\u56FE\u5F62\u6587\u4EF6",save:"\u4FDD\u5B58\u56FE\u5F62",cancel:"\u53D6\u6D88","error.missingSvg":"\u56FE\u5F62\u6E90\u7801\u7F3A\u5C11\u5B8C\u6574\u7684 SVG\u3002","error.invalidXml":"SVG \u7684 XML \u7ED3\u6784\u4E0D\u6B63\u786E\u3002","error.structureChanged":"\u56FE\u5F62\u7ED3\u6784\u5DF2\u53D8\u5316\uFF0C\u8BF7\u91CD\u65B0\u8BFB\u53D6\u6587\u5B57\u3002","presentation.notes":"\u8865\u5145\u8BF4\u660E","presentation.label":"\u56FE\u5F62\u5448\u73B0","presentation.compact":"\u7B80\u6D01\uFF1A\u6807\u9898\u4E0E\u8BF4\u660E\u653E\u5728\u56FE\u5916","presentation.original":"\u539F\u7248\uFF1A\u4FDD\u7559\u4E0A\u6E38\u5B8C\u6574\u56FE\u5F62","presentation.custom":"\u81EA\u5B9A\u4E49\u663E\u793A","presentation.titlePosition":"\u6807\u9898\u4F4D\u7F6E","presentation.descriptionPosition":"\u8BF4\u660E\u4F4D\u7F6E","presentation.outside":"\u653E\u5728\u56FE\u5916","presentation.inside":"\u4FDD\u7559\u5728\u56FE\u5185","presentation.hidden":"\u9690\u85CF","presentation.notesDisplay":"\u8865\u5145\u8BF4\u660E\u663E\u793A","presentation.details":"\u6298\u53E0\u5230\u56FE\u5916","presentation.inline":"\u4FDD\u7559\u539F\u4F4D\u7F6E","presentation.legend":"\u663E\u793A\u56FE\u4F8B","presentation.controls":"\u663E\u793A\u9605\u8BFB\u63A7\u4EF6"},en:{"family.archify":"Archify architecture diagram","family.diagramDesign":"Diagram Design graphic","family.fireworks":"Fireworks technical diagram",fileTooLarge:"Choose an HTML or SVG file of 8 MiB or less.",changedElsewhere:"The diagram was updated by another change. Your draft is kept. Reload and merge your changes, then save.",downloadSvg:"Download diagram SVG",downloadHtml:"Download full diagram HTML",diagram:"Diagram",unlockDescription:"Explore, zoom, and scroll inside the diagram",template:"Template",diagramTemplate:"Diagram template",customTemplate:"Import or customize a diagram",title:"Title",diagramTitle:"Diagram title",height:"Height",diagramHeight:"Diagram height",description:"Description",diagramDescription:"Diagram description",labelsSummary:"Text in diagram ({count})",labelField:"Text {index}",labelInput:"Diagram text {index}",source:"Diagram source",readLabels:"Read text from diagram",importFile:"Import HTML / SVG",importFileInput:"Import diagram file",save:"Save diagram",cancel:"Cancel","error.missingSvg":"The diagram source doesn't contain a complete SVG.","error.invalidXml":"The SVG's XML structure is invalid.","error.structureChanged":"The diagram structure has changed. Read the text again.","presentation.notes":"Notes","presentation.label":"Diagram display","presentation.compact":"Compact: title and description outside the diagram","presentation.original":"Original: keep the complete upstream diagram","presentation.custom":"Custom display","presentation.titlePosition":"Title position","presentation.descriptionPosition":"Description position","presentation.outside":"Outside the diagram","presentation.inside":"Inside the diagram","presentation.hidden":"Hidden","presentation.notesDisplay":"Notes display","presentation.details":"Collapsed outside the diagram","presentation.inline":"Keep in place","presentation.legend":"Show legend","presentation.controls":"Show reading controls"}});var j=ye(W);function U(e){let t=e.search(/\bclass\s*=\s*["'][^"']*\bdiagram-container\b/i),a=e.slice(t<0?0:t),i=a.search(/<svg\b/i);if(i<0)throw new Error(j("error.missingSvg"));let l=a.slice(i),d=/<!--[\s\S]*?-->|<!\[CDATA\[[\s\S]*?\]\]>|<\/?svg\b(?:[^>"']|"[^"]*"|'[^']*')*>/gi,n=0;for(let f of l.matchAll(d))if(!/^<!/.test(f[0])&&(/^<\/svg/i.test(f[0])?n--:/\/\s*>$/.test(f[0])||n++,n===0))return l.slice(0,f.index+f[0].length);throw new Error(j("error.missingSvg"))}function q(e){return U(e).replace(/<svg\b(?:[^>"']|"[^"]*"|'[^']*')*>/i,t=>/\bxmlns\s*=/.test(t)?t:t.replace(/\s*\/?>$/,a=>` xmlns="http://www.w3.org/2000/svg"${a}`))}function re(e){let t=q(e),a=new DOMParser().parseFromString(t,"image/svg+xml");if(a.querySelector("parsererror"))throw new Error(j("error.invalidXml"));return a}function Ue(e){return[...e.querySelectorAll("text")].flatMap(t=>{let a=[...t.querySelectorAll("tspan")];return a.length?a:[t]})}function oe(e){return Ue(re(e)).map(t=>t.textContent??"")}function qe(e,t){let a=U(e),i=re(e),l=Ue(i);if(t.length!==l.length)throw new Error(j("error.structureChanged"));l.forEach((n,f)=>{let p=n.textContent;if(p!==t[f]){n.textContent=t[f];for(let c=n;c&&c!==i.documentElement;c=c.parentElement){for(let h of["data-focus-label","aria-label"])c.getAttribute(h)===p&&c.setAttribute(h,t[f]);let m=["data-node-label","data-node-sublabel","data-node-tag"].filter(h=>p&&c.getAttribute(h)===p);if(m.length){for(let w of m)c.setAttribute(w,t[f]);let h=c.getAttribute("aria-label");h&&c.setAttribute("aria-label",h.replace(p,()=>t[f]));for(let w of c.querySelectorAll(":scope > title"))w.textContent?.includes(p)&&(w.textContent=w.textContent.replace(p,()=>t[f]))}for(let h of c.querySelectorAll(":scope > title"))h.textContent===p&&(h.textContent=t[f])}}});let d=new XMLSerializer().serializeToString(i.documentElement);return e.replace(a,()=>d)}function Ve(e){let t=re(e),a=[...e.matchAll(/<style\b[^>]*>([\s\S]*?)<\/style>/gi)].map(d=>d[1]).join(`
29986
+ </div>`}var De=/ <!-- ARCHIFY:SVG_SLOT_START -->[\s\S]*? <!-- ARCHIFY:SVG_SLOT_END -->/,Ne=/ <!-- ARCHIFY:CARDS_SLOT_START -->[\s\S]*? <!-- ARCHIFY:CARDS_SLOT_END -->/,Fe=/^([ \t]*)<p class="subtitle">\[Subtitle description\]<\/p>[ \t]*(\r?\n)?/m,ae=" <!-- ARCHIFY:SOURCE_EVIDENCE_DATA -->",We=" <!-- ARCHIFY:I18N_DATA -->";function Be(e){return JSON.stringify(e).replaceAll("<","\\u003c").replaceAll(">","\\u003e").replaceAll("&","\\u0026")}var H=['<html lang="en" data-theme="dark" data-preset="[VISUAL PRESET]">',"<title>[PROJECT NAME] Architecture Diagram</title>","<h1>[PROJECT NAME] Architecture</h1>",We];function je(e,{title:t,subtitle:a,svg:i,cards:l,locale:d,visualPreset:n="classic",sourceEvidence:f=null}){if(!De.test(e))throw new Error("applyTemplate: template missing ARCHIFY:SVG_SLOT sentinel");if(!Ne.test(e))throw new Error("applyTemplate: template missing ARCHIFY:CARDS_SLOT sentinel");if(!Fe.test(e))throw new Error("applyTemplate: template missing subtitle placeholder");for(let M of H)if(!e.includes(M))throw new Error(`applyTemplate: template missing placeholder ${JSON.stringify(M)}`);if(f&&!e.includes(ae))throw new Error(`applyTemplate: repository evidence requires placeholder ${JSON.stringify(ae)}`);let p=Be(f),c=te(d),m=Be({locale:c,messages:Ge(c)}),h=typeof a=="string"&&a.trim()?`<p class="subtitle">${v(a)}</p>`:"",w=` <script id="archify-i18n-data" type="application/json">${m}<\/script>`;return Pe(e,c).replace(We,()=>w).replace(H[0],()=>`<html lang="${v(c)}" data-theme="dark" data-preset="${v(n)}">`).replace(H[1],()=>`<title>${v(ne(c,"page.title",{title:t}))}</title>`).replace(H[2],()=>`<h1>${v(t)}</h1>`).replace(Fe,(M,O,G="")=>h?`${O}${h}${G}`:"").replace(De,()=>i).replace(Ne,()=>l).replace(ae,()=>f?` <script id="archify-source-evidence-data" type="application/json">${p}<\/script>`:"")}var W=be("diagram",{"zh-CN":{"family.archify":"Archify \u4EA4\u4E92\u67B6\u6784\u56FE","family.diagramDesign":"Diagram Design \u56FE\u5F62","family.fireworks":"Fireworks \u6280\u672F\u56FE",fileTooLarge:"\u8BF7\u9009\u62E9 8 MiB \u4EE5\u5185\u7684 HTML \u6216 SVG \u6587\u4EF6\u3002",changedElsewhere:"\u56FE\u5F62\u5DF2\u88AB\u5176\u4ED6\u4FEE\u6539\u66F4\u65B0\u3002\u8349\u7A3F\u5DF2\u4FDD\u7559\uFF0C\u8BF7\u91CD\u65B0\u8BFB\u53D6\u5E76\u5408\u5E76\u540E\u4FDD\u5B58\u3002",downloadSvg:"\u4E0B\u8F7D\u56FE\u5F62 SVG",downloadHtml:"\u4E0B\u8F7D\u5B8C\u6574\u56FE\u5F62 HTML",diagram:"\u56FE\u5F62",unlockDescription:"\u64CD\u4F5C\u56FE\u5F62\u5185\u7684\u63A2\u7D22\u3001\u7F29\u653E\u548C\u6EDA\u52A8",template:"\u6A21\u677F",diagramTemplate:"\u56FE\u5F62\u6A21\u677F",customTemplate:"\u5BFC\u5165\u6216\u81EA\u5B9A\u4E49\u56FE\u5F62",title:"\u6807\u9898",diagramTitle:"\u56FE\u5F62\u6807\u9898",height:"\u9AD8\u5EA6",diagramHeight:"\u56FE\u5F62\u9AD8\u5EA6",description:"\u8BF4\u660E",diagramDescription:"\u56FE\u5F62\u8BF4\u660E",labelsSummary:"\u56FE\u4E2D\u6587\u5B57\uFF08{count}\uFF09",labelField:"\u6587\u5B57 {index}",labelInput:"\u56FE\u4E2D\u6587\u5B57 {index}",source:"\u56FE\u5F62\u6E90\u7801",readLabels:"\u8BFB\u53D6\u56FE\u4E2D\u6587\u5B57",importFile:"\u5BFC\u5165 HTML / SVG",importFileInput:"\u5BFC\u5165\u56FE\u5F62\u6587\u4EF6",save:"\u4FDD\u5B58\u56FE\u5F62",cancel:"\u53D6\u6D88","error.missingSvg":"\u56FE\u5F62\u6E90\u7801\u7F3A\u5C11\u5B8C\u6574\u7684 SVG\u3002","error.invalidXml":"SVG \u7684 XML \u7ED3\u6784\u4E0D\u6B63\u786E\u3002","error.structureChanged":"\u56FE\u5F62\u7ED3\u6784\u5DF2\u53D8\u5316\uFF0C\u8BF7\u91CD\u65B0\u8BFB\u53D6\u6587\u5B57\u3002","presentation.notes":"\u8865\u5145\u8BF4\u660E","presentation.label":"\u56FE\u5F62\u5448\u73B0","presentation.compact":"\u7B80\u6D01\uFF1A\u6807\u9898\u4E0E\u8BF4\u660E\u653E\u5728\u56FE\u5916","presentation.original":"\u539F\u7248\uFF1A\u4FDD\u7559\u4E0A\u6E38\u5B8C\u6574\u56FE\u5F62","presentation.custom":"\u81EA\u5B9A\u4E49\u663E\u793A","presentation.titlePosition":"\u6807\u9898\u4F4D\u7F6E","presentation.descriptionPosition":"\u8BF4\u660E\u4F4D\u7F6E","presentation.outside":"\u653E\u5728\u56FE\u5916","presentation.inside":"\u4FDD\u7559\u5728\u56FE\u5185","presentation.hidden":"\u9690\u85CF","presentation.notesDisplay":"\u8865\u5145\u8BF4\u660E\u663E\u793A","presentation.details":"\u6298\u53E0\u5230\u56FE\u5916","presentation.inline":"\u4FDD\u7559\u539F\u4F4D\u7F6E","presentation.legend":"\u663E\u793A\u56FE\u4F8B","presentation.controls":"\u663E\u793A\u9605\u8BFB\u63A7\u4EF6"},en:{"family.archify":"Archify architecture diagram","family.diagramDesign":"Diagram Design graphic","family.fireworks":"Fireworks technical diagram",fileTooLarge:"Choose an HTML or SVG file of 8 MiB or less.",changedElsewhere:"The diagram was updated by another change. Your draft is kept. Reload and merge your changes, then save.",downloadSvg:"Download diagram SVG",downloadHtml:"Download full diagram HTML",diagram:"Diagram",unlockDescription:"Explore, zoom, and scroll inside the diagram",template:"Template",diagramTemplate:"Diagram template",customTemplate:"Import or customize a diagram",title:"Title",diagramTitle:"Diagram title",height:"Height",diagramHeight:"Diagram height",description:"Description",diagramDescription:"Diagram description",labelsSummary:"Text in diagram ({count})",labelField:"Text {index}",labelInput:"Diagram text {index}",source:"Diagram source",readLabels:"Read text from diagram",importFile:"Import HTML / SVG",importFileInput:"Import diagram file",save:"Save diagram",cancel:"Cancel","error.missingSvg":"The diagram source doesn't contain a complete SVG.","error.invalidXml":"The SVG's XML structure is invalid.","error.structureChanged":"The diagram structure has changed. Read the text again.","presentation.notes":"Notes","presentation.label":"Diagram display","presentation.compact":"Compact: title and description outside the diagram","presentation.original":"Original: keep the complete upstream diagram","presentation.custom":"Custom display","presentation.titlePosition":"Title position","presentation.descriptionPosition":"Description position","presentation.outside":"Outside the diagram","presentation.inside":"Inside the diagram","presentation.hidden":"Hidden","presentation.notesDisplay":"Notes display","presentation.details":"Collapsed outside the diagram","presentation.inline":"Keep in place","presentation.legend":"Show legend","presentation.controls":"Show reading controls"}});var j=we(W);function U(e){let t=e.search(/\bclass\s*=\s*["'][^"']*\bdiagram-container\b/i),a=e.slice(t<0?0:t),i=a.search(/<svg\b/i);if(i<0)throw new Error(j("error.missingSvg"));let l=a.slice(i),d=/<!--[\s\S]*?-->|<!\[CDATA\[[\s\S]*?\]\]>|<\/?svg\b(?:[^>"']|"[^"]*"|'[^']*')*>/gi,n=0;for(let f of l.matchAll(d))if(!/^<!/.test(f[0])&&(/^<\/svg/i.test(f[0])?n--:/\/\s*>$/.test(f[0])||n++,n===0))return l.slice(0,f.index+f[0].length);throw new Error(j("error.missingSvg"))}function q(e){return U(e).replace(/<svg\b(?:[^>"']|"[^"]*"|'[^']*')*>/i,t=>/\bxmlns\s*=/.test(t)?t:t.replace(/\s*\/?>$/,a=>` xmlns="http://www.w3.org/2000/svg"${a}`))}function re(e){let t=q(e),a=new DOMParser().parseFromString(t,"image/svg+xml");if(a.querySelector("parsererror"))throw new Error(j("error.invalidXml"));return a}function Ue(e){return[...e.querySelectorAll("text")].flatMap(t=>{let a=[...t.querySelectorAll("tspan")];return a.length?a:[t]})}function oe(e){return Ue(re(e)).map(t=>t.textContent??"")}function qe(e,t){let a=U(e),i=re(e),l=Ue(i);if(t.length!==l.length)throw new Error(j("error.structureChanged"));l.forEach((n,f)=>{let p=n.textContent;if(p!==t[f]){n.textContent=t[f];for(let c=n;c&&c!==i.documentElement;c=c.parentElement){for(let h of["data-focus-label","aria-label"])c.getAttribute(h)===p&&c.setAttribute(h,t[f]);let m=["data-node-label","data-node-sublabel","data-node-tag"].filter(h=>p&&c.getAttribute(h)===p);if(m.length){for(let w of m)c.setAttribute(w,t[f]);let h=c.getAttribute("aria-label");h&&c.setAttribute("aria-label",h.replace(p,()=>t[f]));for(let w of c.querySelectorAll(":scope > title"))w.textContent?.includes(p)&&(w.textContent=w.textContent.replace(p,()=>t[f]))}for(let h of c.querySelectorAll(":scope > title"))h.textContent===p&&(h.textContent=t[f])}}});let d=new XMLSerializer().serializeToString(i.documentElement);return e.replace(a,()=>d)}function Ve(e){let t=re(e),a=[...e.matchAll(/<style\b[^>]*>([\s\S]*?)<\/style>/gi)].map(d=>d[1]).join(`
29987
29987
  `),i=t.createElementNS("http://www.w3.org/2000/svg","style");i.textContent=a,t.documentElement.prepend(i);let l=e.match(/<html\b[^>]*>/i)?.[0]??"";for(let d of["data-theme","data-preset"]){let n=l.match(new RegExp(`${d}="([^"]*)"`))?.[1];n&&t.documentElement.setAttribute(d,n)}return new XMLSerializer().serializeToString(t.documentElement)}var L={title:"inside",description:"inside",notes:"inline",legend:!0,controls:!0},se={title:"outside",description:"outside",notes:"hidden",legend:!0,controls:!0};function k(e){return e.presentation?{...L,...e.presentation}:L}function ie(e){return new DOMParser().parseFromString(e.replace(/<[^>]*>/g,""),"text/html").body.textContent?.trim()??""}function Tt(e){let t=e.search(/<div\b[^>]*class=["'][^"']*\bcards\b[^"']*["'][^>]*>/i);if(t<0)return[];let a=e.slice(t),i=0;for(let l of a.matchAll(/<\/?div\b[^>]*>/gi))if(i+=/^<\//.test(l[0])?-1:1,i===0)return[ie(a.slice(0,l.index+l[0].length).replace(/<\/(?:h3|p|li)>/gi,"$& "))].filter(Boolean);return[]}function Ye(e){let t=new DOMParser().parseFromString(q(e),"image/svg+xml"),a=e.match(/<h1\b[^>]*>([\s\S]*?)<\/h1>/i),i=e.match(/<p\b[^>]*class=["'][^"']*\bsubtitle\b[^"']*["'][^>]*>([\s\S]*?)<\/p>/i);return{title:a?ie(a[1]):t.querySelector("svg > text.title, svg > g#title text.title, svg > title")?.textContent?.trim()??"",description:i?ie(i[1]):t.querySelector("svg > text.subtitle, svg > text.title + text.detail, svg > g#title text.subtitle, svg > desc")?.textContent?.trim()??"",notes:[...t.querySelectorAll("svg > text.footnote, svg > g#footer, svg > g.footer, svg > g[data-graph-role=legend] + text.detail")].map(l=>l.textContent?.trim()??"").filter(Boolean).concat(Tt(e))}}function Ke(e,t){if(JSON.stringify(t)===JSON.stringify(L))return e;let a=U(e),i=new DOMParser().parseFromString(q(e),"image/svg+xml"),l=i.documentElement,d=(c,m)=>{if(m)for(let h of i.querySelectorAll(c))h.setAttribute("data-showai-diagram-hidden","true")};d("svg > text.title, svg > g#title > text.title",t.title!=="inside"),d("svg > text.subtitle, svg > text.title + text.detail, svg > g#title > text.subtitle",t.description!=="inside"),d("svg > g#footer, svg > g.footer, svg > text.footnote, svg > g[data-graph-role=legend] + text.detail",t.notes!=="inline"),d("svg > g#legend, svg > g.legend, svg > g[data-graph-role=legend]",!t.legend);let n=i.createElementNS("http://www.w3.org/2000/svg","style");n.textContent="[data-showai-diagram-hidden=true]{display:none!important}",l.prepend(n);let f=[...i.querySelectorAll("svg > text[data-showai-diagram-hidden=true],svg > g#title > text[data-showai-diagram-hidden=true]")].filter(c=>c.matches(".title,.subtitle")||c.matches(".detail")&&c.previousElementSibling?.matches("text.title")),p=l.getAttribute("viewBox")?.split(/[ ,]+/).map(Number);if(p?.length===4&&f.length){let c=Math.max(...f.map(h=>Number(h.getAttribute("y")??0)+12)),m=[...i.querySelectorAll('[data-graph-role="node"],[data-graph-role="container"]')].map(h=>Number(h.getAttribute("data-graph-bounds")?.split(",")[1])).filter(Number.isFinite);if(m.length){let h=Math.min(c,Math.min(...m)-16);h>p[1]&&h<p[1]+p[3]&&l.setAttribute("viewBox",`${p[0]} ${h} ${p[2]} ${p[3]-(h-p[1])}`)}}return e.replace(a,()=>new XMLSerializer().serializeToString(l))}function Qe(e){return`${e.title!=="inside"?".header h1,.frame>h1,.frame>.eyebrow,.header .pulse-dot{display:none!important}":""}
29988
29988
  ${e.description!=="inside"?".header>p.subtitle,.frame>p.subtitle{display:none!important}":""}
29989
29989
  ${e.title!=="inside"&&e.description!=="inside"?".header,.header-row{margin:0!important;padding:0!important;min-height:0!important}.header:has(h1){display:none!important}":""}
@@ -30003,6 +30003,6 @@ ${l}`).join(`
30003
30003
  --><style>${X.css}</style>${t}`}function Je(e,t,a,i){let l=n=>n.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;");if(!t&&!a&&!i.length)return e;let d=`<section style="max-width:1120px;margin:20px auto;font-family:system-ui,sans-serif">${t?`<h2>${l(t)}</h2>`:""}${a?`<p>${l(a)}</p>`:""}${i.length?`<details><summary>\u8865\u5145\u8BF4\u660E</summary>${i.map(n=>`<p>${l(n)}</p>`).join("")}</details>`:""}</section>`;return/<body\b[^>]*>/i.test(e)?e.replace(/<body\b[^>]*>/i,n=>n+d):e.replace(/<style>/i,d+"<style>")}function _e(e,t,a=L){let i="default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline'; img-src data: blob:; font-src data:; connect-src 'none'; frame-src 'none'; base-uri 'none'; form-action 'none'",l=JSON.stringify(a)!==JSON.stringify(L),d=/<html\b|<body\b/i.test(t)?"":"body{margin:0;padding:12px}body>svg{display:block;width:100%;height:auto}";return`<!doctype html><meta charset="utf-8"><meta http-equiv="Content-Security-Policy" content="${i}"><!--
30004
30004
  ${de(e).replaceAll("--","\u2014")}
30005
30005
  -->${t}<style>${d}${l?Qe(a):""}</style>`}pe(`.sb-external-diagram{min-width:0;position:relative}.sb-diagram-frame{display:block;width:100%;border:0;border-radius:8px;background:var(--paper, #fff)}.sb-diagram-editor{display:grid;gap:12px;width:min(100%,520px);padding:12px}.sb-diagram-fields{display:grid;grid-template-columns:minmax(0,1fr) 100px;gap:10px}.sb-diagram-display-settings{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px}.sb-diagram-editor .sb-diagram-toggle{display:flex;align-items:center;gap:6px}.sb-diagram-editor .sb-diagram-toggle input{width:auto}.sb-diagram-notes{margin:8px 0;color:var(--muted)}.sb-diagram-editor select,.sb-diagram-editor input:not([type=file]),.sb-diagram-editor textarea{width:100%;min-width:0}.sb-diagram-editor details>summary{cursor:pointer;padding:8px 0;color:var(--text)}.sb-diagram-labels>div{display:grid;gap:8px;max-height:320px;overflow:auto;padding:4px}.sb-diagram-source{font-family:ui-monospace,monospace;font-size:12px;resize:vertical;margin-bottom:8px}.sb-diagram-upload{width:fit-content;cursor:pointer}.sb-diagram-upload input{display:none}.sb-diagram-editor .sb-editor-footer{display:flex;gap:8px}@media(max-width:420px){.sb-diagram-fields{grid-template-columns:minmax(0,1fr)}}@media print{.sb-external-diagram .viewport-lock-button{display:none}}
30006
- `);var r=K(ge(),1),It={archify:"family.archify","diagram-design":"family.diagramDesign","fireworks-tech-graph":"family.fireworks"};function ce({family:e,data:t,onChange:a,readOnly:i}){let l=(0,u.useRef)(null),[d]=(0,u.useState)(()=>crypto.randomUUID());ve(l,d);let n=be(W),f=n(It[e]),p=(0,u.useMemo)(()=>le(e),[e]),c=(0,u.useMemo)(()=>Xe(e,t),[e,t]),m=(0,u.useMemo)(()=>k(t),[t]),h=(0,u.useMemo)(()=>Ye(c),[c]),w=(0,u.useMemo)(()=>Ke(Ze(e,c),m),[e,c,m]),M=(0,u.useMemo)(()=>_e(e,w,m)+`<script>${we(d)}<\/script>`,[e,w,m,d]),O=m.title==="outside"?x(t.title,h.title):!t.presentation&&m.title==="inside"?x(t.title):"",G=m.description==="outside"?x(t.description,h.description):!t.presentation&&m.description==="inside"?x(t.description):"",T=ke(`diagram-${e}`),he=(0,u.useRef)(""),[P,I]=(0,u.useState)(!1),[g,b]=(0,u.useState)({}),[V,D]=(0,u.useState)([]),[$e,Y]=(0,u.useState)(!1),[N,A]=(0,u.useState)(""),[et,fe]=(0,u.useState)(!1),tt=!!(a&&!i);(0,u.useEffect)(()=>fe(!1),[M]);let F=o=>{try{D(oe(o)),Y(!1),A("")}catch(s){D([]),A(s instanceof Error?s.message:String(s))}},nt=()=>{if(P){I(!1);return}he.current=JSON.stringify(t),b({...t,source:c}),F(c),I(!0)},at=o=>{if(o==="custom"){b(y=>({...y,template:o}));return}let s=p.find(y=>y.id===o);b(y=>({...y,template:o,source:s.source})),F(s.source)},rt=async o=>{if(o.size>8*1024*1024){A(n("fileTooLarge"));return}try{let s=await o.text();R(e,{template:"custom",source:s}),b(y=>({...y,template:"custom",source:s})),F(s)}catch(s){A(s instanceof Error?s.message:String(s))}},ot=()=>{if(JSON.stringify(t)!==he.current){A(n("changedElsewhere"));return}try{let o={...g,source:$e?qe(x(g.source),V):x(g.source)};R(e,o),oe(o.source),a?.(o),I(!1),A("")}catch(o){A(o instanceof Error?o.message:String(o))}},it=()=>{try{let o=Ve(w);Q(`<!--
30006
+ `);var r=K(ge(),1),It={archify:"family.archify","diagram-design":"family.diagramDesign","fireworks-tech-graph":"family.fireworks"};function ce({family:e,data:t,onChange:a,readOnly:i}){let l=(0,u.useRef)(null),[d]=(0,u.useState)(()=>crypto.randomUUID());ye(l,d);let n=ve(W),f=n(It[e]),p=(0,u.useMemo)(()=>le(e),[e]),c=(0,u.useMemo)(()=>Xe(e,t),[e,t]),m=(0,u.useMemo)(()=>k(t),[t]),h=(0,u.useMemo)(()=>Ye(c),[c]),w=(0,u.useMemo)(()=>Ke(Ze(e,c),m),[e,c,m]),M=(0,u.useMemo)(()=>_e(e,w,m)+`<script>${xe(d)}<\/script>`,[e,w,m,d]),O=m.title==="outside"?x(t.title,h.title):!t.presentation&&m.title==="inside"?x(t.title):"",G=m.description==="outside"?x(t.description,h.description):!t.presentation&&m.description==="inside"?x(t.description):"",T=ke(`diagram-${e}`),he=(0,u.useRef)(""),[P,I]=(0,u.useState)(!1),[g,b]=(0,u.useState)({}),[V,D]=(0,u.useState)([]),[$e,Y]=(0,u.useState)(!1),[N,A]=(0,u.useState)(""),[et,fe]=(0,u.useState)(!1),tt=!!(a&&!i);(0,u.useEffect)(()=>fe(!1),[M]);let F=o=>{try{D(oe(o)),Y(!1),A("")}catch(s){D([]),A(s instanceof Error?s.message:String(s))}},nt=()=>{if(P){I(!1);return}he.current=JSON.stringify(t),b({...t,source:c}),F(c),I(!0)},at=o=>{if(o==="custom"){b(y=>({...y,template:o}));return}let s=p.find(y=>y.id===o);b(y=>({...y,template:o,source:s.source})),F(s.source)},rt=async o=>{if(o.size>8*1024*1024){A(n("fileTooLarge"));return}try{let s=await o.text();R(e,{template:"custom",source:s}),b(y=>({...y,template:"custom",source:s})),F(s)}catch(s){A(s instanceof Error?s.message:String(s))}},ot=()=>{if(JSON.stringify(t)!==he.current){A(n("changedElsewhere"));return}try{let o={...g,source:$e?qe(x(g.source),V):x(g.source)};R(e,o),oe(o.source),a?.(o),I(!1),A("")}catch(o){A(o instanceof Error?o.message:String(o))}},it=()=>{try{let o=Ve(w);Q(`<!--
30007
30007
  ${de(e).replaceAll("--","\u2014")}
30008
30008
  -->${o}`,`${e}.svg`,"image/svg+xml"),A("")}catch(o){A(o instanceof Error?o.message:String(o))}};return(0,r.jsxs)("section",{ref:T.ref,className:"sb-block sb-external-diagram","aria-label":x(t.title,f),"data-diagram-family":e,"data-viewport-lock-scope":`diagram-${e}`,"data-viewport-locked":T.locked,"data-diagram-ready":et,children:[(0,r.jsxs)(Le,{title:O||f,defaultTitle:f,description:G,editable:tt,editing:P,onEdit:nt,children:[(0,r.jsx)("button",{type:"button",className:"sb-icon-button","aria-label":n("downloadSvg"),title:n("downloadSvg"),onClick:it,children:(0,r.jsx)(me,{size:16})}),(0,r.jsx)("button",{type:"button",className:"sb-icon-button","aria-label":n("downloadHtml"),title:n("downloadHtml"),onClick:()=>Q(Je(M,O,G,m.notes==="details"?h.notes:[]),`${e}.html`,"text/html"),children:"HTML"})]}),m.notes==="details"&&h.notes.length>0&&(0,r.jsxs)("details",{className:"sb-diagram-notes",children:[(0,r.jsx)("summary",{children:n("presentation.notes")}),h.notes.map((o,s)=>(0,r.jsx)("p",{children:o},s))]}),(0,r.jsx)(Ae,{...T,label:n("diagram"),unlockDescription:n("unlockDescription")}),(0,r.jsx)("iframe",{ref:l,title:x(t.title,f),className:"sb-diagram-frame",sandbox:"allow-scripts allow-downloads",referrerPolicy:"no-referrer",srcDoc:M,style:{height:Number(t.height??560),pointerEvents:T.locked?"none":"auto"},tabIndex:T.locked?-1:0,onLoad:()=>fe(!0)}),N&&!P&&(0,r.jsx)("p",{className:"sb-error",role:"alert",children:N}),P&&(0,r.jsx)(Se,{children:(0,r.jsxs)("div",{className:"sb-diagram-editor",onKeyDown:o=>{o.stopPropagation(),o.key==="Escape"&&I(!1)},children:[(0,r.jsx)(S,{label:n("presentation.label"),children:(0,r.jsxs)("select",{"aria-label":n("presentation.label"),value:JSON.stringify(k(g))===JSON.stringify(L)?"original":JSON.stringify(k(g))===JSON.stringify(se)?"compact":"custom",onChange:o=>{o.target.value!=="custom"&&b(s=>({...s,presentation:o.target.value==="original"?L:se}))},children:[(0,r.jsx)("option",{value:"compact",children:n("presentation.compact")}),(0,r.jsx)("option",{value:"original",children:n("presentation.original")}),(0,r.jsx)("option",{value:"custom",children:n("presentation.custom")})]})}),(0,r.jsxs)("div",{className:"sb-diagram-display-settings",children:[[["title","presentation.titlePosition"],["description","presentation.descriptionPosition"]].map(([o,s])=>(0,r.jsx)(S,{label:n(s),children:(0,r.jsxs)("select",{"aria-label":n(s),value:k(g)[o],onChange:y=>b(C=>({...C,presentation:{...k(C),[o]:y.target.value}})),children:[(0,r.jsx)("option",{value:"outside",children:n("presentation.outside")}),(0,r.jsx)("option",{value:"inside",children:n("presentation.inside")}),(0,r.jsx)("option",{value:"hidden",children:n("presentation.hidden")})]})},o)),(0,r.jsx)(S,{label:n("presentation.notes"),children:(0,r.jsxs)("select",{"aria-label":n("presentation.notesDisplay"),value:k(g).notes,onChange:o=>b(s=>({...s,presentation:{...k(s),notes:o.target.value}})),children:[(0,r.jsx)("option",{value:"hidden",children:n("presentation.hidden")}),(0,r.jsx)("option",{value:"details",children:n("presentation.details")}),(0,r.jsx)("option",{value:"inline",children:n("presentation.inline")})]})}),[["legend","presentation.legend"],["controls","presentation.controls"]].map(([o,s])=>(0,r.jsxs)("label",{className:"sb-diagram-toggle",children:[(0,r.jsx)("input",{"aria-label":n(s),type:"checkbox",checked:k(g)[o],onChange:y=>b(C=>({...C,presentation:{...k(C),[o]:y.target.checked}}))}),n(s)]},o))]}),(0,r.jsx)(S,{label:n("template"),children:(0,r.jsxs)("select",{"aria-label":n("diagramTemplate"),value:x(g.template),onChange:o=>at(o.target.value),children:[p.map(o=>(0,r.jsx)("option",{value:o.id,children:o.name},o.id)),(0,r.jsx)("option",{value:"custom",children:n("customTemplate")})]})}),(0,r.jsxs)("div",{className:"sb-diagram-fields",children:[(0,r.jsx)(S,{label:n("title"),children:(0,r.jsx)("input",{"aria-label":n("diagramTitle"),value:x(g.title),onChange:o=>b(s=>({...s,title:o.target.value}))})}),(0,r.jsx)(S,{label:n("height"),children:(0,r.jsx)("input",{"aria-label":n("diagramHeight"),type:"number",min:240,max:1200,value:Number(g.height??560),onChange:o=>b(s=>({...s,height:Number(o.target.value)}))})})]}),(0,r.jsx)(S,{label:n("description"),children:(0,r.jsx)("textarea",{"aria-label":n("diagramDescription"),rows:2,value:x(g.description),onChange:o=>b(s=>({...s,description:o.target.value}))})}),(0,r.jsxs)("details",{className:"sb-diagram-labels",children:[(0,r.jsx)("summary",{children:n("labelsSummary",{count:V.length})}),(0,r.jsx)("div",{children:V.map((o,s)=>(0,r.jsx)(S,{label:n("labelField",{index:s+1}),children:(0,r.jsx)("input",{"aria-label":n("labelInput",{index:s+1}),value:o,onChange:y=>{D(C=>C.map((st,lt)=>lt===s?y.target.value:st)),Y(!0)}})},s))})]}),(0,r.jsxs)("details",{children:[(0,r.jsx)("summary",{children:n("source")}),(0,r.jsx)("textarea",{"aria-label":n("source"),className:"sb-diagram-source",rows:12,spellCheck:!1,value:x(g.source),onChange:o=>{b(s=>({...s,source:o.target.value})),D([]),Y(!1)}}),(0,r.jsx)("button",{type:"button",className:"sb-button",onClick:()=>F(x(g.source)),children:n("readLabels")})]}),(0,r.jsxs)("label",{className:"sb-button sb-diagram-upload",children:[(0,r.jsx)(ue,{size:14}),n("importFile"),(0,r.jsx)("input",{type:"file","aria-label":n("importFileInput"),accept:".html,.htm,.svg,text/html,image/svg+xml",onChange:o=>{let s=o.target.files?.[0];s&&rt(s),o.target.value=""}})]}),N&&(0,r.jsx)("p",{className:"sb-error",role:"alert",children:N}),(0,r.jsxs)("div",{className:"sb-editor-footer",children:[(0,r.jsx)("button",{type:"button",className:"sb-button",onClick:ot,children:n("save")}),(0,r.jsx)("button",{type:"button",className:"sb-button",onClick:()=>I(!1),children:n("cancel")})]})]})})]})}function Sn(e){return(0,r.jsx)(ce,{...e,family:"archify"})}function Ln(e){return(0,r.jsx)(ce,{...e,family:"diagram-design"})}function En(e){return(0,r.jsx)(ce,{...e,family:"fireworks-tech-graph"})}export{Sn as ArchifyBlock,Ln as DiagramDesignBlock,En as FireworksTechGraphBlock};