@meetquinn/animactl 0.1.30 → 0.1.31

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 (116) hide show
  1. package/dist/server/cli/cli-errors.js +4 -0
  2. package/dist/server/messages/contact-policy.service.d.ts +9 -0
  3. package/dist/server/messages/contact-policy.service.d.ts.map +1 -1
  4. package/dist/server/messages/contact-policy.service.js +44 -16
  5. package/dist/server/tests/contact-policy.test.js +45 -4
  6. package/dist/web/assets/{FileViewer-2hthjdQD.js → FileViewer-BtzV0xCy.js} +3 -3
  7. package/dist/web/assets/{OwnerPickerForm-BOG15_5q.js → OwnerPickerForm-Dad51XVK.js} +1 -1
  8. package/dist/web/assets/{SlackTimeline-DJMHtjVN.js → SlackTimeline-CEQmQliZ.js} +1 -1
  9. package/dist/web/assets/{UsageHeatmap-DIM_N0fI.js → UsageHeatmap-BW-EDtlf.js} +1 -1
  10. package/dist/web/assets/{activity-CF_uXyqx.js → activity-DxOg0Zpw.js} +1 -1
  11. package/dist/web/assets/{arc-DN3rV-nI.js → arc-fS3jqr6M.js} +1 -1
  12. package/dist/web/assets/architecture-7EHR7CIX-JFavxCHZ.js +1 -0
  13. package/dist/web/assets/{architectureDiagram-3BPJPVTR-BjOQPVOb.js → architectureDiagram-3BPJPVTR-CDsOHh13.js} +1 -1
  14. package/dist/web/assets/arrow-right-rNbgcgPM.js +1 -0
  15. package/dist/web/assets/{blockDiagram-GPEHLZMM-CxnJJyNZ.js → blockDiagram-GPEHLZMM-Dafvh8yC.js} +1 -1
  16. package/dist/web/assets/{c4Diagram-AAUBKEIU-MJtkpqPP.js → c4Diagram-AAUBKEIU-BqFnkKWL.js} +1 -1
  17. package/dist/web/assets/channel-CM3nHrAD.js +1 -0
  18. package/dist/web/assets/{channels-DAmTOZbW.js → channels-CFYn9Uzy.js} +1 -1
  19. package/dist/web/assets/{chunk-2J33WTMH-DH7F6Toz.js → chunk-2J33WTMH-BEmf3Qku.js} +1 -1
  20. package/dist/web/assets/{chunk-3OPIFGDE-SXmEESKD.js → chunk-3OPIFGDE-CtmMZbUU.js} +1 -1
  21. package/dist/web/assets/{chunk-4BX2VUAB-DB0OPa2S.js → chunk-4BX2VUAB-CacBYgOE.js} +1 -1
  22. package/dist/web/assets/{chunk-55IACEB6-DGr-WOhv.js → chunk-55IACEB6-BXURqjLZ.js} +1 -1
  23. package/dist/web/assets/{chunk-5ZQYHXKU-Vgr4jBt1.js → chunk-5ZQYHXKU-D_5qZ4Zv.js} +1 -1
  24. package/dist/web/assets/{chunk-727SXJPM-CWaX9Qk5.js → chunk-727SXJPM-BU31EEG5.js} +1 -1
  25. package/dist/web/assets/{chunk-AQP2D5EJ-CFTKUNkn.js → chunk-AQP2D5EJ-DTtKK5xv.js} +1 -1
  26. package/dist/web/assets/{chunk-BSJP7CBP-DD2WqzXl.js → chunk-BSJP7CBP-C5nluir4.js} +1 -1
  27. package/dist/web/assets/{chunk-CSCIHK7Q-xxNdF5BX.js → chunk-CSCIHK7Q-BeNiRoDm.js} +3 -3
  28. package/dist/web/assets/{chunk-FMBD7UC4-D637Lg0-.js → chunk-FMBD7UC4-LV5XAtCz.js} +1 -1
  29. package/dist/web/assets/{chunk-KSCS5N6A-B9pu9Zdk.js → chunk-KSCS5N6A-D80hU7za.js} +1 -1
  30. package/dist/web/assets/{chunk-L5ZTLDWV-DYHe5z-p.js → chunk-L5ZTLDWV-DtSiy2JS.js} +1 -1
  31. package/dist/web/assets/{chunk-LZXEDZCA-C2A3MD3P.js → chunk-LZXEDZCA-CFWlwpSj.js} +2 -2
  32. package/dist/web/assets/{chunk-ND2GUHAM-CzVnJeg1.js → chunk-ND2GUHAM-Cks69kWo.js} +1 -1
  33. package/dist/web/assets/{chunk-NZK2D7GU-Bi3zqbUv.js → chunk-NZK2D7GU-BKDBTHUK.js} +1 -1
  34. package/dist/web/assets/{chunk-O5CBEL6O-B7YJjftf.js → chunk-O5CBEL6O-Dh_KkhDf.js} +1 -1
  35. package/dist/web/assets/chunk-QZHKN3VN-CXmYofd4.js +1 -0
  36. package/dist/web/assets/chunk-WU5MYG2G-BAvj0V8I.js +1 -0
  37. package/dist/web/assets/{chunk-XPW4576I-BRwQ5uRX.js → chunk-XPW4576I-BaeieIoE.js} +1 -1
  38. package/dist/web/assets/classDiagram-4FO5ZUOK-CqWCXo7M.js +1 -0
  39. package/dist/web/assets/classDiagram-v2-Q7XG4LA2-CqWCXo7M.js +1 -0
  40. package/dist/web/assets/{copy-CrJlq9AF.js → copy-DI3PIiTH.js} +1 -1
  41. package/dist/web/assets/{cose-bilkent-S5V4N54A-T1Va7b5W.js → cose-bilkent-S5V4N54A-Illz9lmk.js} +1 -1
  42. package/dist/web/assets/{dagre-BM42HDAG-BP0-K47r.js → dagre-BM42HDAG-uzpuT_vy.js} +1 -1
  43. package/dist/web/assets/{diagram-2AECGRRQ-CezL6GWB.js → diagram-2AECGRRQ-BCPKQqtp.js} +1 -1
  44. package/dist/web/assets/{diagram-5GNKFQAL-DAToGWTN.js → diagram-5GNKFQAL-ComD16wh.js} +1 -1
  45. package/dist/web/assets/{diagram-KO2AKTUF-CkbuKqVt.js → diagram-KO2AKTUF-BzSas2Wg.js} +1 -1
  46. package/dist/web/assets/{diagram-LMA3HP47-Ccw5LzTI.js → diagram-LMA3HP47-Di6iEw3F.js} +1 -1
  47. package/dist/web/assets/{diagram-OG6HWLK6-DM8PEKD_.js → diagram-OG6HWLK6-BiJvsy5z.js} +1 -1
  48. package/dist/web/assets/{dist-CwHmnwO6.js → dist-BVWlbvC4.js} +1 -1
  49. package/dist/web/assets/{erDiagram-TEJ5UH35-DtZHusNf.js → erDiagram-TEJ5UH35-2dFfOUHh.js} +1 -1
  50. package/dist/web/assets/eventmodeling-FCH6USID-BHZ_hWV_.js +1 -0
  51. package/dist/web/assets/{files-BySZvVoJ.js → files-fW_iAV7E.js} +1 -1
  52. package/dist/web/assets/{flowDiagram-I6XJVG4X-BtiRpY_v.js → flowDiagram-I6XJVG4X-DENcgZKO.js} +1 -1
  53. package/dist/web/assets/{ganttDiagram-6RSMTGT7-CvsbKTJa.js → ganttDiagram-6RSMTGT7-CGsf5ccc.js} +1 -1
  54. package/dist/web/assets/gitGraph-WXDBUCRP-DhWA66Cy.js +1 -0
  55. package/dist/web/assets/{gitGraphDiagram-PVQCEYII-D2UEiEmu.js → gitGraphDiagram-PVQCEYII-BQIgIegs.js} +1 -1
  56. package/dist/web/assets/{index-CbAhFc-0.js → index-DlHETnHC.js} +2 -2
  57. package/dist/web/assets/info-J43DQDTF-CEcqsbJ5.js +1 -0
  58. package/dist/web/assets/{infoDiagram-5YYISTIA-C1JIXj0K.js → infoDiagram-5YYISTIA-MrkM0y-m.js} +1 -1
  59. package/dist/web/assets/{ishikawaDiagram-YF4QCWOH-CrV-BAK2.js → ishikawaDiagram-YF4QCWOH-Dr8UsvPX.js} +1 -1
  60. package/dist/web/assets/{journeyDiagram-JHISSGLW-C5UZDjPg.js → journeyDiagram-JHISSGLW-DGypTGb1.js} +1 -1
  61. package/dist/web/assets/{kanban-definition-UN3LZRKU-CmAcW_Gm.js → kanban-definition-UN3LZRKU-yYXyv91m.js} +1 -1
  62. package/dist/web/assets/{kb-CrNRBaRa.js → kb-f003GncV.js} +1 -1
  63. package/dist/web/assets/{lightbulb-BZTBGg7G.js → lightbulb-17VUUl6S.js} +1 -1
  64. package/dist/web/assets/{line-BeG27-zH.js → line-CX3cghIS.js} +1 -1
  65. package/dist/web/assets/{linear-D6Qub4j1.js → linear-87q8d4nG.js} +1 -1
  66. package/dist/web/assets/{login-DF6d0xuk.js → login-DptYMeSz.js} +1 -1
  67. package/dist/web/assets/{mermaid-parser.core-OQrfCf7Q.js → mermaid-parser.core-DZTDfv4-.js} +2 -2
  68. package/dist/web/assets/{mermaid.core-DnM6i6kF.js → mermaid.core-BhLaljEz.js} +3 -3
  69. package/dist/web/assets/{mindmap-definition-RKZ34NQL-C90Pg8IG.js → mindmap-definition-RKZ34NQL-Cgrh68Ws.js} +1 -1
  70. package/dist/web/assets/{onboarding-Ds4m8CzL.js → onboarding-CGAqAgFX.js} +1 -1
  71. package/dist/web/assets/packet-YPE3B663-BmMYdqRg.js +1 -0
  72. package/dist/web/assets/pie-LRSECV5Y-1wIF2xtw.js +1 -0
  73. package/dist/web/assets/{pieDiagram-4H26LBE5-DMHbg7t6.js → pieDiagram-4H26LBE5-CsIniA7U.js} +1 -1
  74. package/dist/web/assets/{profile-D8xJTQW-.js → profile-BCiWQjvh.js} +1 -1
  75. package/dist/web/assets/{quadrantDiagram-W4KKPZXB-CdlyTllG.js → quadrantDiagram-W4KKPZXB-ppRpf4TS.js} +1 -1
  76. package/dist/web/assets/radar-GUYGQ44K-p1z2JqZu.js +1 -0
  77. package/dist/web/assets/{reminders-Cls3R6H7.js → reminders-CYmvRDWq.js} +1 -1
  78. package/dist/web/assets/{requirementDiagram-4Y6WPE33-CJJ8Lrck.js → requirementDiagram-4Y6WPE33-lnX3NUSy.js} +1 -1
  79. package/dist/web/assets/{sankeyDiagram-5OEKKPKP-BGraj5n6.js → sankeyDiagram-5OEKKPKP-DGuhoGFR.js} +1 -1
  80. package/dist/web/assets/search-BB_1c6y5.js +1 -0
  81. package/dist/web/assets/{sequenceDiagram-3UESZ5HK-B8g-XwoX.js → sequenceDiagram-3UESZ5HK-C-LlJv8b.js} +1 -1
  82. package/dist/web/assets/{settings-9rtkfxfO.js → settings-BfsiJmaF.js} +1 -1
  83. package/dist/web/assets/{src-DOSXYjwH.js → src-B2YqOS_g.js} +1 -1
  84. package/dist/web/assets/{stateDiagram-AJRCARHV-tzHGG25a.js → stateDiagram-AJRCARHV-m_XE9xkX.js} +1 -1
  85. package/dist/web/assets/stateDiagram-v2-BHNVJYJU-eKkkGk4l.js +1 -0
  86. package/dist/web/assets/{timeline-definition-PNZ67QCA-Bm5F6kuI.js → timeline-definition-PNZ67QCA-BD126VRM.js} +1 -1
  87. package/dist/web/assets/treeView-BLDUP644-Bt9NKcs-.js +1 -0
  88. package/dist/web/assets/treemap-LRROVOQU-Bw9RdNCX.js +1 -0
  89. package/dist/web/assets/{useInfiniteQuery-D4aujXNJ.js → useInfiniteQuery-BYCmT0Iw.js} +1 -1
  90. package/dist/web/assets/{useNow-BwVNU1Kt.js → useNow-BbEkaqh-.js} +1 -1
  91. package/dist/web/assets/{vennDiagram-CIIHVFJN-CD9fmg50.js → vennDiagram-CIIHVFJN-DLM0FNBN.js} +1 -1
  92. package/dist/web/assets/wardley-L42UT6IY-DpsUZBpc.js +1 -0
  93. package/dist/web/assets/{wardleyDiagram-YWT4CUSO-CKu3d4sB.js → wardleyDiagram-YWT4CUSO-DQgt20IC.js} +1 -1
  94. package/dist/web/assets/{xychartDiagram-2RQKCTM6-CRRLjHSX.js → xychartDiagram-2RQKCTM6-CUCAmkCj.js} +1 -1
  95. package/dist/web/index.html +1 -1
  96. package/docs/agent/guide.md +1 -2
  97. package/docs/guide/working-with-your-agent.md +1 -1
  98. package/package.json +1 -1
  99. package/dist/web/assets/architecture-7EHR7CIX-DU_giWjw.js +0 -1
  100. package/dist/web/assets/arrow-right-Da05Wwlp.js +0 -1
  101. package/dist/web/assets/channel-BfxUxG5f.js +0 -1
  102. package/dist/web/assets/chunk-QZHKN3VN-NhFAU-9O.js +0 -1
  103. package/dist/web/assets/chunk-WU5MYG2G-CZXAqd3y.js +0 -1
  104. package/dist/web/assets/classDiagram-4FO5ZUOK-Dy777uwp.js +0 -1
  105. package/dist/web/assets/classDiagram-v2-Q7XG4LA2-Dy777uwp.js +0 -1
  106. package/dist/web/assets/eventmodeling-FCH6USID-CDO-goTv.js +0 -1
  107. package/dist/web/assets/gitGraph-WXDBUCRP-Cn7wn299.js +0 -1
  108. package/dist/web/assets/info-J43DQDTF-BHUyVizh.js +0 -1
  109. package/dist/web/assets/packet-YPE3B663-B_2RTGcc.js +0 -1
  110. package/dist/web/assets/pie-LRSECV5Y-ieCDED7Y.js +0 -1
  111. package/dist/web/assets/radar-GUYGQ44K-CpqbrBX-.js +0 -1
  112. package/dist/web/assets/search-BoEnT13J.js +0 -1
  113. package/dist/web/assets/stateDiagram-v2-BHNVJYJU-DeLaPJhU.js +0 -1
  114. package/dist/web/assets/treeView-BLDUP644-WRDNuShD.js +0 -1
  115. package/dist/web/assets/treemap-LRROVOQU-BlaZCSii.js +0 -1
  116. package/dist/web/assets/wardley-L42UT6IY-C-Xkgr9M.js +0 -1
@@ -1 +1 @@
1
- import{Bn as e,Er as t,Sr as n,an as r,ar as i,fr as a,kr as o,lr as s,un as c,xr as l}from"./index-CbAhFc-0.js";import{c as u,t as d}from"./useNow-BwVNU1Kt.js";var f=c(`repeat`,[[`path`,{d:`m17 2 4 4-4 4`,key:`nntrym`}],[`path`,{d:`M3 11v-1a4 4 0 0 1 4-4h14`,key:`84bu3i`}],[`path`,{d:`m7 22-4-4 4-4`,key:`1wqhfi`}],[`path`,{d:`M21 13v1a4 4 0 0 1-4 4H3`,key:`1rx37r`}]]),p=o(t(),1),m=a(),h=12;function g(e,t){if(e.kind===`once`)return t?new Date(t).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}):`One-shot`;if(e.kind===`interval`||e.kind===`windowed_interval`){let t=Math.round(e.intervalMs/6e4),n;if(t<60)n=`Every ${t} minute${t===1?``:`s`}`;else{let e=Math.round(t/60);if(e<24)n=`Every ${e} hour${e===1?``:`s`}`;else{let t=Math.round(e/24);n=`Every ${t} day${t===1?``:`s`}`}}return e.kind===`windowed_interval`?`${n} · ${e.windowRule} (${e.timezone})`:n}return e.kind===`daily`?`Daily at ${e.time}`:e.kind===`weekly`?`Weekly ${e.weekdays.map(e=>e.charAt(0).toUpperCase()+e.slice(1,3)).join(`, `)} at ${e.time}`:`Scheduled`}function _({agentId:e,reminder:t,onViewStream:n}){let r=l();return(0,m.jsxs)(`div`,{className:`space-y-3 border-l-2 border-border-soft pl-4`,children:[(0,m.jsx)(`div`,{className:`font-serif whitespace-pre-wrap break-words text-[14px] leading-[1.6] text-text`,children:t.instructions}),t.preflight&&(0,m.jsxs)(`div`,{className:`font-sans text-[12px] text-text-muted`,children:[(0,m.jsx)(`span`,{className:`chrome uppercase tracking-[0.12em] text-text-subtle`,children:`Run only when`}),(0,m.jsx)(`div`,{className:`mt-1 font-mono text-[12px] break-all text-text`,children:t.preflight.command}),t.preflightLastResult&&(0,m.jsxs)(`div`,{className:`mt-1 text-[11px]`,children:[`Last preflight: `,(0,m.jsx)(`span`,{className:`font-mono`,children:t.preflightLastResult.status}),t.preflightLastResult.exitCode===void 0?``:` · exit ${t.preflightLastResult.exitCode}`,t.preflightLastResult.timedOut?` · timed out`:``]}),t.preflightError&&(0,m.jsx)(`div`,{className:`mt-1 text-[11px] text-health-warn`,children:`Needs attention · preflight-error`})]}),(0,m.jsxs)(`div`,{className:`font-sans flex flex-wrap items-baseline gap-x-2 gap-y-0.5 text-[11px] tracking-wide text-text-muted`,children:[(0,m.jsxs)(`span`,{children:[`Fired `,(0,m.jsx)(`span`,{className:`font-mono`,children:t.firedCount}),t.firedCount===1?` time`:` times`]}),t.lastFiredAt&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`span`,{"aria-hidden":!0,className:`text-text-subtle`,children:`·`}),(0,m.jsxs)(`span`,{children:[`last `,new Date(t.lastFiredAt).toLocaleString()]})]})]}),(0,m.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-5 gap-y-1`,children:[t.provenance&&(0,m.jsx)(`button`,{onClick:()=>r(`/agents/${e}/channels?c=${encodeURIComponent(t.provenance.channelId)}`),className:`chrome flex min-h-[44px] items-center text-[11px] uppercase tracking-[0.12em] text-text-muted underline decoration-border-soft underline-offset-4 hover:text-accent hover:decoration-accent md:min-h-0`,children:`View conversation →`}),t.lastFiredAt&&(0,m.jsx)(`button`,{onClick:n,className:`chrome flex min-h-[44px] items-center text-[11px] uppercase tracking-[0.12em] text-text-muted underline decoration-border-soft underline-offset-4 hover:text-accent hover:decoration-accent md:min-h-0`,children:`View activity stream →`})]})]})}function v({agentId:e,reminder:t,now:n,onViewStream:i}){let[a,o]=(0,p.useState)(!1),s=t.schedule.kind!==`once`,c=t.nextDueAt;return(0,m.jsxs)(`div`,{className:`border-b border-border-soft last:border-b-0`,children:[(0,m.jsxs)(`button`,{onClick:()=>o(e=>!e),"aria-expanded":a,className:`grid w-full grid-cols-[1fr_auto] items-start gap-3 px-1 py-3.5 text-left hover:bg-surface-elevated/40`,children:[(0,m.jsxs)(`div`,{className:`min-w-0`,children:[(0,m.jsx)(`div`,{className:`font-serif text-[15px] leading-snug text-text`,children:t.title}),(0,m.jsxs)(`div`,{className:`font-sans mt-1 flex flex-wrap items-baseline gap-x-2 gap-y-0.5 text-[11px] tracking-wide text-text-muted`,children:[s&&(0,m.jsx)(f,{"aria-label":`Recurring`,className:`h-3 w-3 self-center text-text-subtle`}),(0,m.jsx)(`span`,{children:g(t.schedule,t.nextDueAt)}),c&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`span`,{"aria-hidden":!0,className:`text-text-subtle`,children:`·`}),(0,m.jsxs)(`span`,{children:[`next `,u(c,n)]})]}),s&&t.lastFiredAt&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`span`,{"aria-hidden":!0,className:`text-text-subtle`,children:`·`}),(0,m.jsxs)(`span`,{children:[`last fired `,u(t.lastFiredAt,n)]})]})]})]}),(0,m.jsx)(r,{className:`mt-1.5 h-3.5 w-3.5 shrink-0 text-text-subtle transition-transform ${a?`rotate-90`:``}`})]}),a&&(0,m.jsx)(`div`,{className:`px-1 pb-4`,children:(0,m.jsx)(_,{agentId:e,reminder:t,onViewStream:i})})]})}function y({agentId:e,reminder:t,now:n,onViewStream:i}){let[a,o]=(0,p.useState)(!1),s=t.status===`cancelled`,c=t.cancelledAt??t.lastFiredAt??t.updatedAt;return(0,m.jsxs)(`div`,{className:`border-b border-border-soft/60 last:border-b-0`,children:[(0,m.jsxs)(`button`,{onClick:()=>o(e=>!e),"aria-expanded":a,className:`flex w-full items-baseline gap-2.5 px-1 py-2 text-left hover:bg-surface-elevated/40`,children:[(0,m.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-serif text-[14px] leading-snug ${s?`text-text-muted`:`text-text`}`,children:t.title}),(0,m.jsx)(`span`,{className:`chrome shrink-0 text-[10px] uppercase tracking-[0.1em] text-text-muted`,children:t.status}),(0,m.jsx)(`span`,{className:`font-sans shrink-0 text-[11px] tracking-wide text-text-muted`,children:u(c,n)}),(0,m.jsx)(r,{className:`h-3 w-3 shrink-0 self-center text-text-subtle/70 transition-transform ${a?`rotate-90`:``}`})]}),a&&(0,m.jsx)(`div`,{className:`px-1 pb-4 pt-1`,children:(0,m.jsx)(_,{agentId:e,reminder:t,onViewStream:i})})]})}function b({title:e,count:t}){return(0,m.jsxs)(`div`,{className:`mb-3 flex items-baseline gap-4`,children:[(0,m.jsxs)(`h2`,{className:`caps text-text-muted`,children:[e,(0,m.jsx)(`span`,{className:`ml-2 font-mono text-[11px] tracking-normal text-text-subtle`,children:t})]}),(0,m.jsx)(`span`,{className:`h-px flex-1 bg-border-soft`})]})}function x(){let t=(0,p.useRef)(null),{agentId:r}=n(),a=l(),[o,c]=(0,p.useState)(null),u=o!=null&&o===r;(0,p.useEffect)(()=>{t.current?.scrollTo(0,0)},[r]);let f=d(),{data:g=[],error:_}=s({queryKey:i.agentReminders(r??``),queryFn:()=>e(r),enabled:!!r}),{active:x,past:S}=(0,p.useMemo)(()=>({active:g.filter(e=>e.status===`scheduled`).sort((e,t)=>(e.nextDueAt??e.updatedAt).localeCompare(t.nextDueAt??t.updatedAt)),past:g.filter(e=>e.status===`fired`||e.status===`cancelled`).sort((e,t)=>t.updatedAt.localeCompare(e.updatedAt))}),[g]);if(!r)return null;let C=u?S:S.slice(0,h),w=S.length-h;return(0,m.jsx)(`div`,{ref:t,className:`bg-surface h-full overflow-y-auto px-6 py-8 md:px-10 md:py-10`,children:(0,m.jsxs)(`div`,{className:`max-w-3xl`,children:[_&&(0,m.jsx)(`div`,{className:`mb-6 rounded-sm border border-border-soft bg-surface-raised px-4 py-3 text-[13px] text-text-subtle`,children:_ instanceof Error?_.message:String(_)}),(0,m.jsxs)(`section`,{className:`first:mt-0`,children:[(0,m.jsx)(b,{title:`Active`,count:x.length}),x.length===0?(0,m.jsx)(`div`,{className:`font-serif italic py-3 text-[14px] text-text-subtle`,children:`No active reminders.`}):(0,m.jsx)(`div`,{className:`divide-y divide-border-soft border-b border-border-soft`,children:x.map(e=>(0,m.jsx)(v,{agentId:r,reminder:e,now:f,onViewStream:()=>a(`/agents/${r}/activity`)},e.reminderId))})]}),S.length>0&&(0,m.jsxs)(`section`,{className:`mt-10`,children:[(0,m.jsx)(b,{title:`Past`,count:S.length}),(0,m.jsx)(`div`,{className:`divide-y divide-border-soft/60 border-b border-border-soft/60`,children:C.map(e=>(0,m.jsx)(y,{agentId:r,reminder:e,now:f,onViewStream:()=>a(`/agents/${r}/activity`)},e.reminderId))}),w>0&&(0,m.jsx)(`button`,{type:`button`,onClick:()=>c(u?null:r),"aria-expanded":u,className:`mt-3 font-sans text-[11px] text-text-subtle underline decoration-text-subtle/40 underline-offset-2 hover:text-text-muted hover:decoration-text-muted/40`,children:u?`Show fewer`:`Show all ${S.length}`})]})]})})}export{x as default};
1
+ import{Bn as e,Er as t,Sr as n,an as r,ar as i,fr as a,kr as o,lr as s,un as c,xr as l}from"./index-DlHETnHC.js";import{c as u,t as d}from"./useNow-BbEkaqh-.js";var f=c(`repeat`,[[`path`,{d:`m17 2 4 4-4 4`,key:`nntrym`}],[`path`,{d:`M3 11v-1a4 4 0 0 1 4-4h14`,key:`84bu3i`}],[`path`,{d:`m7 22-4-4 4-4`,key:`1wqhfi`}],[`path`,{d:`M21 13v1a4 4 0 0 1-4 4H3`,key:`1rx37r`}]]),p=o(t(),1),m=a(),h=12;function g(e,t){if(e.kind===`once`)return t?new Date(t).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}):`One-shot`;if(e.kind===`interval`||e.kind===`windowed_interval`){let t=Math.round(e.intervalMs/6e4),n;if(t<60)n=`Every ${t} minute${t===1?``:`s`}`;else{let e=Math.round(t/60);if(e<24)n=`Every ${e} hour${e===1?``:`s`}`;else{let t=Math.round(e/24);n=`Every ${t} day${t===1?``:`s`}`}}return e.kind===`windowed_interval`?`${n} · ${e.windowRule} (${e.timezone})`:n}return e.kind===`daily`?`Daily at ${e.time}`:e.kind===`weekly`?`Weekly ${e.weekdays.map(e=>e.charAt(0).toUpperCase()+e.slice(1,3)).join(`, `)} at ${e.time}`:`Scheduled`}function _({agentId:e,reminder:t,onViewStream:n}){let r=l();return(0,m.jsxs)(`div`,{className:`space-y-3 border-l-2 border-border-soft pl-4`,children:[(0,m.jsx)(`div`,{className:`font-serif whitespace-pre-wrap break-words text-[14px] leading-[1.6] text-text`,children:t.instructions}),t.preflight&&(0,m.jsxs)(`div`,{className:`font-sans text-[12px] text-text-muted`,children:[(0,m.jsx)(`span`,{className:`chrome uppercase tracking-[0.12em] text-text-subtle`,children:`Run only when`}),(0,m.jsx)(`div`,{className:`mt-1 font-mono text-[12px] break-all text-text`,children:t.preflight.command}),t.preflightLastResult&&(0,m.jsxs)(`div`,{className:`mt-1 text-[11px]`,children:[`Last preflight: `,(0,m.jsx)(`span`,{className:`font-mono`,children:t.preflightLastResult.status}),t.preflightLastResult.exitCode===void 0?``:` · exit ${t.preflightLastResult.exitCode}`,t.preflightLastResult.timedOut?` · timed out`:``]}),t.preflightError&&(0,m.jsx)(`div`,{className:`mt-1 text-[11px] text-health-warn`,children:`Needs attention · preflight-error`})]}),(0,m.jsxs)(`div`,{className:`font-sans flex flex-wrap items-baseline gap-x-2 gap-y-0.5 text-[11px] tracking-wide text-text-muted`,children:[(0,m.jsxs)(`span`,{children:[`Fired `,(0,m.jsx)(`span`,{className:`font-mono`,children:t.firedCount}),t.firedCount===1?` time`:` times`]}),t.lastFiredAt&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`span`,{"aria-hidden":!0,className:`text-text-subtle`,children:`·`}),(0,m.jsxs)(`span`,{children:[`last `,new Date(t.lastFiredAt).toLocaleString()]})]})]}),(0,m.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-5 gap-y-1`,children:[t.provenance&&(0,m.jsx)(`button`,{onClick:()=>r(`/agents/${e}/channels?c=${encodeURIComponent(t.provenance.channelId)}`),className:`chrome flex min-h-[44px] items-center text-[11px] uppercase tracking-[0.12em] text-text-muted underline decoration-border-soft underline-offset-4 hover:text-accent hover:decoration-accent md:min-h-0`,children:`View conversation →`}),t.lastFiredAt&&(0,m.jsx)(`button`,{onClick:n,className:`chrome flex min-h-[44px] items-center text-[11px] uppercase tracking-[0.12em] text-text-muted underline decoration-border-soft underline-offset-4 hover:text-accent hover:decoration-accent md:min-h-0`,children:`View activity stream →`})]})]})}function v({agentId:e,reminder:t,now:n,onViewStream:i}){let[a,o]=(0,p.useState)(!1),s=t.schedule.kind!==`once`,c=t.nextDueAt;return(0,m.jsxs)(`div`,{className:`border-b border-border-soft last:border-b-0`,children:[(0,m.jsxs)(`button`,{onClick:()=>o(e=>!e),"aria-expanded":a,className:`grid w-full grid-cols-[1fr_auto] items-start gap-3 px-1 py-3.5 text-left hover:bg-surface-elevated/40`,children:[(0,m.jsxs)(`div`,{className:`min-w-0`,children:[(0,m.jsx)(`div`,{className:`font-serif text-[15px] leading-snug text-text`,children:t.title}),(0,m.jsxs)(`div`,{className:`font-sans mt-1 flex flex-wrap items-baseline gap-x-2 gap-y-0.5 text-[11px] tracking-wide text-text-muted`,children:[s&&(0,m.jsx)(f,{"aria-label":`Recurring`,className:`h-3 w-3 self-center text-text-subtle`}),(0,m.jsx)(`span`,{children:g(t.schedule,t.nextDueAt)}),c&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`span`,{"aria-hidden":!0,className:`text-text-subtle`,children:`·`}),(0,m.jsxs)(`span`,{children:[`next `,u(c,n)]})]}),s&&t.lastFiredAt&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`span`,{"aria-hidden":!0,className:`text-text-subtle`,children:`·`}),(0,m.jsxs)(`span`,{children:[`last fired `,u(t.lastFiredAt,n)]})]})]})]}),(0,m.jsx)(r,{className:`mt-1.5 h-3.5 w-3.5 shrink-0 text-text-subtle transition-transform ${a?`rotate-90`:``}`})]}),a&&(0,m.jsx)(`div`,{className:`px-1 pb-4`,children:(0,m.jsx)(_,{agentId:e,reminder:t,onViewStream:i})})]})}function y({agentId:e,reminder:t,now:n,onViewStream:i}){let[a,o]=(0,p.useState)(!1),s=t.status===`cancelled`,c=t.cancelledAt??t.lastFiredAt??t.updatedAt;return(0,m.jsxs)(`div`,{className:`border-b border-border-soft/60 last:border-b-0`,children:[(0,m.jsxs)(`button`,{onClick:()=>o(e=>!e),"aria-expanded":a,className:`flex w-full items-baseline gap-2.5 px-1 py-2 text-left hover:bg-surface-elevated/40`,children:[(0,m.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-serif text-[14px] leading-snug ${s?`text-text-muted`:`text-text`}`,children:t.title}),(0,m.jsx)(`span`,{className:`chrome shrink-0 text-[10px] uppercase tracking-[0.1em] text-text-muted`,children:t.status}),(0,m.jsx)(`span`,{className:`font-sans shrink-0 text-[11px] tracking-wide text-text-muted`,children:u(c,n)}),(0,m.jsx)(r,{className:`h-3 w-3 shrink-0 self-center text-text-subtle/70 transition-transform ${a?`rotate-90`:``}`})]}),a&&(0,m.jsx)(`div`,{className:`px-1 pb-4 pt-1`,children:(0,m.jsx)(_,{agentId:e,reminder:t,onViewStream:i})})]})}function b({title:e,count:t}){return(0,m.jsxs)(`div`,{className:`mb-3 flex items-baseline gap-4`,children:[(0,m.jsxs)(`h2`,{className:`caps text-text-muted`,children:[e,(0,m.jsx)(`span`,{className:`ml-2 font-mono text-[11px] tracking-normal text-text-subtle`,children:t})]}),(0,m.jsx)(`span`,{className:`h-px flex-1 bg-border-soft`})]})}function x(){let t=(0,p.useRef)(null),{agentId:r}=n(),a=l(),[o,c]=(0,p.useState)(null),u=o!=null&&o===r;(0,p.useEffect)(()=>{t.current?.scrollTo(0,0)},[r]);let f=d(),{data:g=[],error:_}=s({queryKey:i.agentReminders(r??``),queryFn:()=>e(r),enabled:!!r}),{active:x,past:S}=(0,p.useMemo)(()=>({active:g.filter(e=>e.status===`scheduled`).sort((e,t)=>(e.nextDueAt??e.updatedAt).localeCompare(t.nextDueAt??t.updatedAt)),past:g.filter(e=>e.status===`fired`||e.status===`cancelled`).sort((e,t)=>t.updatedAt.localeCompare(e.updatedAt))}),[g]);if(!r)return null;let C=u?S:S.slice(0,h),w=S.length-h;return(0,m.jsx)(`div`,{ref:t,className:`bg-surface h-full overflow-y-auto px-6 py-8 md:px-10 md:py-10`,children:(0,m.jsxs)(`div`,{className:`max-w-3xl`,children:[_&&(0,m.jsx)(`div`,{className:`mb-6 rounded-sm border border-border-soft bg-surface-raised px-4 py-3 text-[13px] text-text-subtle`,children:_ instanceof Error?_.message:String(_)}),(0,m.jsxs)(`section`,{className:`first:mt-0`,children:[(0,m.jsx)(b,{title:`Active`,count:x.length}),x.length===0?(0,m.jsx)(`div`,{className:`font-serif italic py-3 text-[14px] text-text-subtle`,children:`No active reminders.`}):(0,m.jsx)(`div`,{className:`divide-y divide-border-soft border-b border-border-soft`,children:x.map(e=>(0,m.jsx)(v,{agentId:r,reminder:e,now:f,onViewStream:()=>a(`/agents/${r}/activity`)},e.reminderId))})]}),S.length>0&&(0,m.jsxs)(`section`,{className:`mt-10`,children:[(0,m.jsx)(b,{title:`Past`,count:S.length}),(0,m.jsx)(`div`,{className:`divide-y divide-border-soft/60 border-b border-border-soft/60`,children:C.map(e=>(0,m.jsx)(y,{agentId:r,reminder:e,now:f,onViewStream:()=>a(`/agents/${r}/activity`)},e.reminderId))}),w>0&&(0,m.jsx)(`button`,{type:`button`,onClick:()=>c(u?null:r),"aria-expanded":u,className:`mt-3 font-sans text-[11px] text-text-subtle underline decoration-text-subtle/40 underline-offset-2 hover:text-text-muted hover:decoration-text-muted/40`,children:u?`Show fewer`:`Show all ${S.length}`})]})]})})}export{x as default};
@@ -1,4 +1,4 @@
1
- import{g as e,h as t,m as n}from"./src-DOSXYjwH.js";import{H as r,K as i,U as a,a as o,b as s,v as c,w as l,x as u,y as d}from"./chunk-CSCIHK7Q-xxNdF5BX.js";import{g as f}from"./chunk-5ZQYHXKU-Vgr4jBt1.js";import"./chunk-O5CBEL6O-B7YJjftf.js";import"./chunk-BSJP7CBP-DD2WqzXl.js";import"./chunk-L5ZTLDWV-DYHe5z-p.js";import{t as p}from"./chunk-55IACEB6-DGr-WOhv.js";import{t as m}from"./chunk-2J33WTMH-DH7F6Toz.js";import"./chunk-NZK2D7GU-Bi3zqbUv.js";import"./chunk-3OPIFGDE-SXmEESKD.js";import"./chunk-KSCS5N6A-B9pu9Zdk.js";import{r as h,t as g}from"./chunk-LZXEDZCA-C2A3MD3P.js";var _=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,3],r=[1,4],i=[1,5],a=[1,6],o=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],s=[1,22],c=[2,7],l=[1,26],u=[1,27],d=[1,28],f=[1,29],p=[1,33],m=[1,34],h=[1,35],g=[1,36],_=[1,37],v=[1,38],y=[1,24],b=[1,31],x=[1,32],S=[1,30],C=[1,39],w=[1,40],T=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],E=[1,61],D=[89,90],O=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],k=[27,29],ee=[1,70],A=[1,71],te=[1,72],ne=[1,73],re=[1,74],ie=[1,75],ae=[1,76],j=[1,83],M=[1,80],N=[1,84],P=[1,85],F=[1,86],I=[1,87],L=[1,88],R=[1,89],z=[1,90],B=[1,91],V=[1,92],oe=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],H=[63,64],se=[1,101],ce=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],U=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],W=[1,110],G=[1,106],K=[1,107],q=[1,108],J=[1,109],Y=[1,111],X=[1,116],Z=[1,117],Q=[1,114],$=[1,115],le={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:`error`,5:`NEWLINE`,6:`RD`,8:`EOF`,9:`acc_title`,10:`acc_title_value`,11:`acc_descr`,12:`acc_descr_value`,13:`acc_descr_multiline_value`,21:`direction_tb`,22:`direction_bt`,23:`direction_rl`,24:`direction_lr`,27:`STRUCT_START`,29:`STYLE_SEPARATOR`,31:`ID`,32:`COLONSEP`,34:`TEXT`,36:`RISK`,38:`VERIFYMTHD`,40:`STRUCT_STOP`,41:`REQUIREMENT`,42:`FUNCTIONAL_REQUIREMENT`,43:`INTERFACE_REQUIREMENT`,44:`PERFORMANCE_REQUIREMENT`,45:`PHYSICAL_REQUIREMENT`,46:`DESIGN_CONSTRAINT`,47:`LOW_RISK`,48:`MED_RISK`,49:`HIGH_RISK`,50:`VERIFY_ANALYSIS`,51:`VERIFY_DEMONSTRATION`,52:`VERIFY_INSPECTION`,53:`VERIFY_TEST`,54:`ELEMENT`,57:`TYPE`,59:`DOCREF`,61:`END_ARROW_L`,63:`LINE`,64:`END_ARROW_R`,65:`CONTAINS`,66:`COPIES`,67:`DERIVES`,68:`SATISFIES`,69:`VERIFIES`,70:`REFINES`,71:`TRACES`,72:`CLASSDEF`,74:`CLASS`,75:`ALPHA`,76:`COMMA`,77:`STYLE`,80:`NUM`,81:`COLON`,82:`UNIT`,83:`SPACE`,84:`BRKT`,85:`PCT`,86:`MINUS`,87:`LABEL`,88:`SEMICOLON`,89:`unqString`,90:`qString`},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 4:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 5:case 6:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:r.setDirection(`TB`);break;case 18:r.setDirection(`BT`);break;case 19:r.setDirection(`RL`);break;case 20:r.setDirection(`LR`);break;case 21:r.addRequirement(a[s-3],a[s-4]);break;case 22:r.addRequirement(a[s-5],a[s-6]),r.setClass([a[s-5]],a[s-3]);break;case 23:r.setNewReqId(a[s-2]);break;case 24:r.setNewReqText(a[s-2]);break;case 25:r.setNewReqRisk(a[s-2]);break;case 26:r.setNewReqVerifyMethod(a[s-2]);break;case 29:this.$=r.RequirementType.REQUIREMENT;break;case 30:this.$=r.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=r.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=r.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=r.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=r.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=r.RiskLevel.LOW_RISK;break;case 36:this.$=r.RiskLevel.MED_RISK;break;case 37:this.$=r.RiskLevel.HIGH_RISK;break;case 38:this.$=r.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=r.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=r.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=r.VerifyType.VERIFY_TEST;break;case 42:r.addElement(a[s-3]);break;case 43:r.addElement(a[s-5]),r.setClass([a[s-5]],a[s-3]);break;case 44:r.setNewElementType(a[s-2]);break;case 45:r.setNewElementDocRef(a[s-2]);break;case 48:r.addRelationship(a[s-2],a[s],a[s-4]);break;case 49:r.addRelationship(a[s-2],a[s-4],a[s]);break;case 50:this.$=r.Relationships.CONTAINS;break;case 51:this.$=r.Relationships.COPIES;break;case 52:this.$=r.Relationships.DERIVES;break;case 53:this.$=r.Relationships.SATISFIES;break;case 54:this.$=r.Relationships.VERIFIES;break;case 55:this.$=r.Relationships.REFINES;break;case 56:this.$=r.Relationships.TRACES;break;case 57:this.$=a[s-2],r.defineClass(a[s-1],a[s]);break;case 58:r.setClass(a[s-1],a[s]);break;case 59:r.setClass([a[s-2]],a[s]);break;case 60:case 62:this.$=[a[s]];break;case 61:case 63:this.$=a[s-2].concat([a[s]]);break;case 64:this.$=a[s-2],r.setCssStyle(a[s-1],a[s]);break;case 65:this.$=[a[s]];break;case 66:a[s-2].push(a[s]),this.$=a[s-2];break;case 68:this.$=a[s-1]+a[s];break}},`anonymous`),table:[{3:1,4:2,6:n,9:r,11:i,13:a},{1:[3]},{3:8,4:2,5:[1,7],6:n,9:r,11:i,13:a},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(o,[2,6]),{3:12,4:2,6:n,9:r,11:i,13:a},{1:[2,2]},{4:17,5:s,7:13,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},e(o,[2,4]),e(o,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:s,7:42,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:43,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:44,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:45,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:46,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:47,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:48,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:49,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:50,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},e(T,[2,17]),e(T,[2,18]),e(T,[2,19]),e(T,[2,20]),{30:60,33:62,75:E,89:C,90:w},{30:63,33:62,75:E,89:C,90:w},{30:64,33:62,75:E,89:C,90:w},e(D,[2,29]),e(D,[2,30]),e(D,[2,31]),e(D,[2,32]),e(D,[2,33]),e(D,[2,34]),e(O,[2,81]),e(O,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},e(k,[2,79]),e(k,[2,80]),{27:[1,67],29:[1,68]},e(k,[2,85]),e(k,[2,86]),{62:69,65:ee,66:A,67:te,68:ne,69:re,70:ie,71:ae},{62:77,65:ee,66:A,67:te,68:ne,69:re,70:ie,71:ae},{30:78,33:62,75:E,89:C,90:w},{73:79,75:j,76:M,78:81,79:82,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V},e(oe,[2,60]),e(oe,[2,62]),{73:93,75:j,76:M,78:81,79:82,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V},{30:94,33:62,75:E,76:M,89:C,90:w},{5:[1,95]},{30:96,33:62,75:E,89:C,90:w},{5:[1,97]},{30:98,33:62,75:E,89:C,90:w},{63:[1,99]},e(H,[2,50]),e(H,[2,51]),e(H,[2,52]),e(H,[2,53]),e(H,[2,54]),e(H,[2,55]),e(H,[2,56]),{64:[1,100]},e(T,[2,59],{76:M}),e(T,[2,64],{76:se}),{33:103,75:[1,102],89:C,90:w},e(ce,[2,65],{79:104,75:j,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V}),e(U,[2,67]),e(U,[2,69]),e(U,[2,70]),e(U,[2,71]),e(U,[2,72]),e(U,[2,73]),e(U,[2,74]),e(U,[2,75]),e(U,[2,76]),e(U,[2,77]),e(U,[2,78]),e(T,[2,57],{76:se}),e(T,[2,58],{76:M}),{5:W,28:105,31:G,34:K,36:q,38:J,40:Y},{27:[1,112],76:M},{5:X,40:Z,56:113,57:Q,59:$},{27:[1,118],76:M},{33:119,89:C,90:w},{33:120,89:C,90:w},{75:j,78:121,79:82,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V},e(oe,[2,61]),e(oe,[2,63]),e(U,[2,68]),e(T,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:W,28:126,31:G,34:K,36:q,38:J,40:Y},e(T,[2,28]),{5:[1,127]},e(T,[2,42]),{32:[1,128]},{32:[1,129]},{5:X,40:Z,56:130,57:Q,59:$},e(T,[2,47]),{5:[1,131]},e(T,[2,48]),e(T,[2,49]),e(ce,[2,66],{79:104,75:j,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V}),{33:132,89:C,90:w},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},e(T,[2,27]),{5:W,28:145,31:G,34:K,36:q,38:J,40:Y},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},e(T,[2,46]),{5:X,40:Z,56:152,57:Q,59:$},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},e(T,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},e(T,[2,43]),{5:W,28:159,31:G,34:K,36:q,38:J,40:Y},{5:W,28:160,31:G,34:K,36:q,38:J,40:Y},{5:W,28:161,31:G,34:K,36:q,38:J,40:Y},{5:W,28:162,31:G,34:K,36:q,38:J,40:Y},{5:X,40:Z,56:163,57:Q,59:$},{5:X,40:Z,56:164,57:Q,59:$},e(T,[2,23]),e(T,[2,24]),e(T,[2,25]),e(T,[2,26]),e(T,[2,44]),e(T,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,ee,A;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var te=``;for(O in A=[],s[w])this.terminals_[O]&&O>f&&A.push(`'`+this.terminals_[O]+`'`);te=h.showPosition?`Parse error on line `+(l+1)+`:
1
+ import{g as e,h as t,m as n}from"./src-B2YqOS_g.js";import{H as r,K as i,U as a,a as o,b as s,v as c,w as l,x as u,y as d}from"./chunk-CSCIHK7Q-BeNiRoDm.js";import{g as f}from"./chunk-5ZQYHXKU-D_5qZ4Zv.js";import"./chunk-O5CBEL6O-Dh_KkhDf.js";import"./chunk-BSJP7CBP-C5nluir4.js";import"./chunk-L5ZTLDWV-DtSiy2JS.js";import{t as p}from"./chunk-55IACEB6-BXURqjLZ.js";import{t as m}from"./chunk-2J33WTMH-BEmf3Qku.js";import"./chunk-NZK2D7GU-BKDBTHUK.js";import"./chunk-3OPIFGDE-CtmMZbUU.js";import"./chunk-KSCS5N6A-D80hU7za.js";import{r as h,t as g}from"./chunk-LZXEDZCA-CFWlwpSj.js";var _=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,3],r=[1,4],i=[1,5],a=[1,6],o=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],s=[1,22],c=[2,7],l=[1,26],u=[1,27],d=[1,28],f=[1,29],p=[1,33],m=[1,34],h=[1,35],g=[1,36],_=[1,37],v=[1,38],y=[1,24],b=[1,31],x=[1,32],S=[1,30],C=[1,39],w=[1,40],T=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],E=[1,61],D=[89,90],O=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],k=[27,29],ee=[1,70],A=[1,71],te=[1,72],ne=[1,73],re=[1,74],ie=[1,75],ae=[1,76],j=[1,83],M=[1,80],N=[1,84],P=[1,85],F=[1,86],I=[1,87],L=[1,88],R=[1,89],z=[1,90],B=[1,91],V=[1,92],oe=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],H=[63,64],se=[1,101],ce=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],U=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],W=[1,110],G=[1,106],K=[1,107],q=[1,108],J=[1,109],Y=[1,111],X=[1,116],Z=[1,117],Q=[1,114],$=[1,115],le={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:`error`,5:`NEWLINE`,6:`RD`,8:`EOF`,9:`acc_title`,10:`acc_title_value`,11:`acc_descr`,12:`acc_descr_value`,13:`acc_descr_multiline_value`,21:`direction_tb`,22:`direction_bt`,23:`direction_rl`,24:`direction_lr`,27:`STRUCT_START`,29:`STYLE_SEPARATOR`,31:`ID`,32:`COLONSEP`,34:`TEXT`,36:`RISK`,38:`VERIFYMTHD`,40:`STRUCT_STOP`,41:`REQUIREMENT`,42:`FUNCTIONAL_REQUIREMENT`,43:`INTERFACE_REQUIREMENT`,44:`PERFORMANCE_REQUIREMENT`,45:`PHYSICAL_REQUIREMENT`,46:`DESIGN_CONSTRAINT`,47:`LOW_RISK`,48:`MED_RISK`,49:`HIGH_RISK`,50:`VERIFY_ANALYSIS`,51:`VERIFY_DEMONSTRATION`,52:`VERIFY_INSPECTION`,53:`VERIFY_TEST`,54:`ELEMENT`,57:`TYPE`,59:`DOCREF`,61:`END_ARROW_L`,63:`LINE`,64:`END_ARROW_R`,65:`CONTAINS`,66:`COPIES`,67:`DERIVES`,68:`SATISFIES`,69:`VERIFIES`,70:`REFINES`,71:`TRACES`,72:`CLASSDEF`,74:`CLASS`,75:`ALPHA`,76:`COMMA`,77:`STYLE`,80:`NUM`,81:`COLON`,82:`UNIT`,83:`SPACE`,84:`BRKT`,85:`PCT`,86:`MINUS`,87:`LABEL`,88:`SEMICOLON`,89:`unqString`,90:`qString`},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 4:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 5:case 6:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:r.setDirection(`TB`);break;case 18:r.setDirection(`BT`);break;case 19:r.setDirection(`RL`);break;case 20:r.setDirection(`LR`);break;case 21:r.addRequirement(a[s-3],a[s-4]);break;case 22:r.addRequirement(a[s-5],a[s-6]),r.setClass([a[s-5]],a[s-3]);break;case 23:r.setNewReqId(a[s-2]);break;case 24:r.setNewReqText(a[s-2]);break;case 25:r.setNewReqRisk(a[s-2]);break;case 26:r.setNewReqVerifyMethod(a[s-2]);break;case 29:this.$=r.RequirementType.REQUIREMENT;break;case 30:this.$=r.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=r.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=r.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=r.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=r.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=r.RiskLevel.LOW_RISK;break;case 36:this.$=r.RiskLevel.MED_RISK;break;case 37:this.$=r.RiskLevel.HIGH_RISK;break;case 38:this.$=r.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=r.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=r.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=r.VerifyType.VERIFY_TEST;break;case 42:r.addElement(a[s-3]);break;case 43:r.addElement(a[s-5]),r.setClass([a[s-5]],a[s-3]);break;case 44:r.setNewElementType(a[s-2]);break;case 45:r.setNewElementDocRef(a[s-2]);break;case 48:r.addRelationship(a[s-2],a[s],a[s-4]);break;case 49:r.addRelationship(a[s-2],a[s-4],a[s]);break;case 50:this.$=r.Relationships.CONTAINS;break;case 51:this.$=r.Relationships.COPIES;break;case 52:this.$=r.Relationships.DERIVES;break;case 53:this.$=r.Relationships.SATISFIES;break;case 54:this.$=r.Relationships.VERIFIES;break;case 55:this.$=r.Relationships.REFINES;break;case 56:this.$=r.Relationships.TRACES;break;case 57:this.$=a[s-2],r.defineClass(a[s-1],a[s]);break;case 58:r.setClass(a[s-1],a[s]);break;case 59:r.setClass([a[s-2]],a[s]);break;case 60:case 62:this.$=[a[s]];break;case 61:case 63:this.$=a[s-2].concat([a[s]]);break;case 64:this.$=a[s-2],r.setCssStyle(a[s-1],a[s]);break;case 65:this.$=[a[s]];break;case 66:a[s-2].push(a[s]),this.$=a[s-2];break;case 68:this.$=a[s-1]+a[s];break}},`anonymous`),table:[{3:1,4:2,6:n,9:r,11:i,13:a},{1:[3]},{3:8,4:2,5:[1,7],6:n,9:r,11:i,13:a},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(o,[2,6]),{3:12,4:2,6:n,9:r,11:i,13:a},{1:[2,2]},{4:17,5:s,7:13,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},e(o,[2,4]),e(o,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:s,7:42,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:43,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:44,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:45,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:46,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:47,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:48,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:49,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:50,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},e(T,[2,17]),e(T,[2,18]),e(T,[2,19]),e(T,[2,20]),{30:60,33:62,75:E,89:C,90:w},{30:63,33:62,75:E,89:C,90:w},{30:64,33:62,75:E,89:C,90:w},e(D,[2,29]),e(D,[2,30]),e(D,[2,31]),e(D,[2,32]),e(D,[2,33]),e(D,[2,34]),e(O,[2,81]),e(O,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},e(k,[2,79]),e(k,[2,80]),{27:[1,67],29:[1,68]},e(k,[2,85]),e(k,[2,86]),{62:69,65:ee,66:A,67:te,68:ne,69:re,70:ie,71:ae},{62:77,65:ee,66:A,67:te,68:ne,69:re,70:ie,71:ae},{30:78,33:62,75:E,89:C,90:w},{73:79,75:j,76:M,78:81,79:82,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V},e(oe,[2,60]),e(oe,[2,62]),{73:93,75:j,76:M,78:81,79:82,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V},{30:94,33:62,75:E,76:M,89:C,90:w},{5:[1,95]},{30:96,33:62,75:E,89:C,90:w},{5:[1,97]},{30:98,33:62,75:E,89:C,90:w},{63:[1,99]},e(H,[2,50]),e(H,[2,51]),e(H,[2,52]),e(H,[2,53]),e(H,[2,54]),e(H,[2,55]),e(H,[2,56]),{64:[1,100]},e(T,[2,59],{76:M}),e(T,[2,64],{76:se}),{33:103,75:[1,102],89:C,90:w},e(ce,[2,65],{79:104,75:j,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V}),e(U,[2,67]),e(U,[2,69]),e(U,[2,70]),e(U,[2,71]),e(U,[2,72]),e(U,[2,73]),e(U,[2,74]),e(U,[2,75]),e(U,[2,76]),e(U,[2,77]),e(U,[2,78]),e(T,[2,57],{76:se}),e(T,[2,58],{76:M}),{5:W,28:105,31:G,34:K,36:q,38:J,40:Y},{27:[1,112],76:M},{5:X,40:Z,56:113,57:Q,59:$},{27:[1,118],76:M},{33:119,89:C,90:w},{33:120,89:C,90:w},{75:j,78:121,79:82,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V},e(oe,[2,61]),e(oe,[2,63]),e(U,[2,68]),e(T,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:W,28:126,31:G,34:K,36:q,38:J,40:Y},e(T,[2,28]),{5:[1,127]},e(T,[2,42]),{32:[1,128]},{32:[1,129]},{5:X,40:Z,56:130,57:Q,59:$},e(T,[2,47]),{5:[1,131]},e(T,[2,48]),e(T,[2,49]),e(ce,[2,66],{79:104,75:j,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V}),{33:132,89:C,90:w},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},e(T,[2,27]),{5:W,28:145,31:G,34:K,36:q,38:J,40:Y},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},e(T,[2,46]),{5:X,40:Z,56:152,57:Q,59:$},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},e(T,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},e(T,[2,43]),{5:W,28:159,31:G,34:K,36:q,38:J,40:Y},{5:W,28:160,31:G,34:K,36:q,38:J,40:Y},{5:W,28:161,31:G,34:K,36:q,38:J,40:Y},{5:W,28:162,31:G,34:K,36:q,38:J,40:Y},{5:X,40:Z,56:163,57:Q,59:$},{5:X,40:Z,56:164,57:Q,59:$},e(T,[2,23]),e(T,[2,24]),e(T,[2,25]),e(T,[2,26]),e(T,[2,44]),e(T,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,ee,A;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var te=``;for(O in A=[],s[w])this.terminals_[O]&&O>f&&A.push(`'`+this.terminals_[O]+`'`);te=h.showPosition?`Parse error on line `+(l+1)+`:
2
2
  `+h.showPosition()+`
3
3
  Expecting `+A.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(te,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:A})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),ee=s[r[r.length-2]][r[r.length-1]],r.push(ee);break;case 3:return!0}}return!0},`parse`)};le.lexer=(function(){return{EOF:1,parseError:t(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:t(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:t(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:t(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:t(function(){return this._more=!0,this},`more`),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:t(function(e){this.unput(this.match.slice(e))},`less`),pastInput:t(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:t(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:t(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
@@ -1,4 +1,4 @@
1
- import{h as e,p as t}from"./src-DOSXYjwH.js";import{H as n,J as r,K as i,U as a,a as o,d as s,s as c,v as l,w as u,x as d,y as f}from"./chunk-CSCIHK7Q-xxNdF5BX.js";import{t as p}from"./ordinal-hYBb2elL.js";function m(e){for(var t=e.length/6|0,n=Array(t),r=0;r<t;)n[r]=`#`+e.slice(r*6,++r*6);return n}var h=m(`4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab`);function g(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n<t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function _(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n>t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function v(e,t){let n=0;if(t===void 0)for(let t of e)(t=+t)&&(n+=t);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}function y(e){return e.target.depth}function b(e){return e.depth}function x(e,t){return t-1-e.height}function S(e,t){return e.sourceLinks.length?e.depth:t-1}function C(e){return e.targetLinks.length?e.depth:e.sourceLinks.length?_(e.sourceLinks,y)-1:0}function w(e){return function(){return e}}function T(e,t){return D(e.source,t.source)||e.index-t.index}function E(e,t){return D(e.target,t.target)||e.index-t.index}function D(e,t){return e.y0-t.y0}function O(e){return e.value}function k(e){return e.index}function A(e){return e.nodes}function j(e){return e.links}function M(e,t){let n=e.get(t);if(!n)throw Error(`missing: `+t);return n}function N({nodes:e}){for(let t of e){let e=t.y0,n=e;for(let n of t.sourceLinks)n.y0=e+n.width/2,e+=n.width;for(let e of t.targetLinks)e.y1=n+e.width/2,n+=e.width}}function P(){let e=0,t=0,n=1,r=1,i=24,a=8,o,s=k,c=S,l,u,d=A,f=j,p=6;function m(){let e={nodes:d.apply(null,arguments),links:f.apply(null,arguments)};return h(e),y(e),b(e),x(e),F(e),N(e),e}m.update=function(e){return N(e),e},m.nodeId=function(e){return arguments.length?(s=typeof e==`function`?e:w(e),m):s},m.nodeAlign=function(e){return arguments.length?(c=typeof e==`function`?e:w(e),m):c},m.nodeSort=function(e){return arguments.length?(l=e,m):l},m.nodeWidth=function(e){return arguments.length?(i=+e,m):i},m.nodePadding=function(e){return arguments.length?(a=o=+e,m):a},m.nodes=function(e){return arguments.length?(d=typeof e==`function`?e:w(e),m):d},m.links=function(e){return arguments.length?(f=typeof e==`function`?e:w(e),m):f},m.linkSort=function(e){return arguments.length?(u=e,m):u},m.size=function(i){return arguments.length?(e=t=0,n=+i[0],r=+i[1],m):[n-e,r-t]},m.extent=function(i){return arguments.length?(e=+i[0][0],n=+i[1][0],t=+i[0][1],r=+i[1][1],m):[[e,t],[n,r]]},m.iterations=function(e){return arguments.length?(p=+e,m):p};function h({nodes:e,links:t}){for(let[t,n]of e.entries())n.index=t,n.sourceLinks=[],n.targetLinks=[];let n=new Map(e.map((t,n)=>[s(t,n,e),t]));for(let[e,r]of t.entries()){r.index=e;let{source:t,target:i}=r;typeof t!=`object`&&(t=r.source=M(n,t)),typeof i!=`object`&&(i=r.target=M(n,i)),t.sourceLinks.push(r),i.targetLinks.push(r)}if(u!=null)for(let{sourceLinks:t,targetLinks:n}of e)t.sort(u),n.sort(u)}function y({nodes:e}){for(let t of e)t.value=t.fixedValue===void 0?Math.max(v(t.sourceLinks,O),v(t.targetLinks,O)):t.fixedValue}function b({nodes:e}){let t=e.length,n=new Set(e),r=new Set,i=0;for(;n.size;){for(let e of n){e.depth=i;for(let{target:t}of e.sourceLinks)r.add(t)}if(++i>t)throw Error(`circular link`);n=r,r=new Set}}function x({nodes:e}){let t=e.length,n=new Set(e),r=new Set,i=0;for(;n.size;){for(let e of n){e.height=i;for(let{source:t}of e.targetLinks)r.add(t)}if(++i>t)throw Error(`circular link`);n=r,r=new Set}}function C({nodes:t}){let r=g(t,e=>e.depth)+1,a=(n-e-i)/(r-1),o=Array(r);for(let n of t){let t=Math.max(0,Math.min(r-1,Math.floor(c.call(null,n,r))));n.layer=t,n.x0=e+t*a,n.x1=n.x0+i,o[t]?o[t].push(n):o[t]=[n]}if(l)for(let e of o)e.sort(l);return o}function P(e){let n=_(e,e=>(r-t-(e.length-1)*o)/v(e,O));for(let i of e){let e=t;for(let t of i){t.y0=e,t.y1=e+t.value*n,e=t.y1+o;for(let e of t.sourceLinks)e.width=e.value*n}e=(r-e+o)/(i.length+1);for(let t=0;t<i.length;++t){let n=i[t];n.y0+=e*(t+1),n.y1+=e*(t+1)}H(i)}}function F(e){let n=C(e);o=Math.min(a,(r-t)/(g(n,e=>e.length)-1)),P(n);for(let e=0;e<p;++e){let t=.99**e,r=Math.max(1-t,(e+1)/p);L(n,t,r),I(n,t,r)}}function I(e,t,n){for(let r=1,i=e.length;r<i;++r){let i=e[r];for(let e of i){let n=0,r=0;for(let{source:t,value:i}of e.targetLinks){let a=i*(e.layer-t.layer);n+=U(t,e)*a,r+=a}if(!(r>0))continue;let i=(n/r-e.y0)*t;e.y0+=i,e.y1+=i,V(e)}l===void 0&&i.sort(D),R(i,n)}}function L(e,t,n){for(let r=e.length-2;r>=0;--r){let i=e[r];for(let e of i){let n=0,r=0;for(let{target:t,value:i}of e.sourceLinks){let a=i*(t.layer-e.layer);n+=W(e,t)*a,r+=a}if(!(r>0))continue;let i=(n/r-e.y0)*t;e.y0+=i,e.y1+=i,V(e)}l===void 0&&i.sort(D),R(i,n)}}function R(e,n){let i=e.length>>1,a=e[i];B(e,a.y0-o,i-1,n),z(e,a.y1+o,i+1,n),B(e,r,e.length-1,n),z(e,t,0,n)}function z(e,t,n,r){for(;n<e.length;++n){let i=e[n],a=(t-i.y0)*r;a>1e-6&&(i.y0+=a,i.y1+=a),t=i.y1+o}}function B(e,t,n,r){for(;n>=0;--n){let i=e[n],a=(i.y1-t)*r;a>1e-6&&(i.y0-=a,i.y1-=a),t=i.y0-o}}function V({sourceLinks:e,targetLinks:t}){if(u===void 0){for(let{source:{sourceLinks:e}}of t)e.sort(E);for(let{target:{targetLinks:t}}of e)t.sort(T)}}function H(e){if(u===void 0)for(let{sourceLinks:t,targetLinks:n}of e)t.sort(E),n.sort(T)}function U(e,t){let n=e.y0-(e.sourceLinks.length-1)*o/2;for(let{target:r,width:i}of e.sourceLinks){if(r===t)break;n+=i+o}for(let{source:r,width:i}of t.targetLinks){if(r===e)break;n-=i}return n}function W(e,t){let n=t.y0-(t.targetLinks.length-1)*o/2;for(let{source:r,width:i}of t.targetLinks){if(r===e)break;n+=i+o}for(let{target:r,width:i}of e.sourceLinks){if(r===t)break;n-=i}return n}return m}var F=Math.PI,I=2*F,L=1e-6,R=I-L;function z(){this._x0=this._y0=this._x1=this._y1=null,this._=``}function B(){return new z}z.prototype=B.prototype={constructor:z,moveTo:function(e,t){this._+=`M`+(this._x0=this._x1=+e)+`,`+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+=`Z`)},lineTo:function(e,t){this._+=`L`+(this._x1=+e)+`,`+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+=`Q`+ +e+`,`+ +t+`,`+(this._x1=+n)+`,`+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,a){this._+=`C`+ +e+`,`+ +t+`,`+ +n+`,`+ +r+`,`+(this._x1=+i)+`,`+(this._y1=+a)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(i<0)throw Error(`negative radius: `+i);if(this._x1===null)this._+=`M`+(this._x1=e)+`,`+(this._y1=t);else if(d>L)if(!(Math.abs(u*s-c*l)>L)||!i)this._+=`L`+(this._x1=e)+`,`+(this._y1=t);else{var f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((F-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>L&&(this._+=`L`+(e+y*l)+`,`+(t+y*u)),this._+=`A`+i+`,`+i+`,0,0,`+ +(u*f>l*p)+`,`+(this._x1=e+b*s)+`,`+(this._y1=t+b*c)}},arc:function(e,t,n,r,i,a){e=+e,t=+t,n=+n,a=!!a;var o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;if(n<0)throw Error(`negative radius: `+n);this._x1===null?this._+=`M`+c+`,`+l:(Math.abs(this._x1-c)>L||Math.abs(this._y1-l)>L)&&(this._+=`L`+c+`,`+l),n&&(d<0&&(d=d%I+I),d>R?this._+=`A`+n+`,`+n+`,0,1,`+u+`,`+(e-o)+`,`+(t-s)+`A`+n+`,`+n+`,0,1,`+u+`,`+(this._x1=c)+`,`+(this._y1=l):d>L&&(this._+=`A`+n+`,`+n+`,0,`+ +(d>=F)+`,`+u+`,`+(this._x1=e+n*Math.cos(i))+`,`+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+=`M`+(this._x0=this._x1=+e)+`,`+(this._y0=this._y1=+t)+`h`+ +n+`v`+ +r+`h`+-n+`Z`},toString:function(){return this._}};function V(e){return function(){return e}}function H(e){return e[0]}function U(e){return e[1]}var W=Array.prototype.slice;function G(e){return e.source}function ee(e){return e.target}function te(e){var t=G,n=ee,r=H,i=U,a=null;function o(){var o,s=W.call(arguments),c=t.apply(this,s),l=n.apply(this,s);if(a||=o=B(),e(a,+r.apply(this,(s[0]=c,s)),+i.apply(this,s),+r.apply(this,(s[0]=l,s)),+i.apply(this,s)),o)return a=null,o+``||null}return o.source=function(e){return arguments.length?(t=e,o):t},o.target=function(e){return arguments.length?(n=e,o):n},o.x=function(e){return arguments.length?(r=typeof e==`function`?e:V(+e),o):r},o.y=function(e){return arguments.length?(i=typeof e==`function`?e:V(+e),o):i},o.context=function(e){return arguments.length?(a=e??null,o):a},o}function ne(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function re(){return te(ne)}function ie(e){return[e.source.x1,e.y0]}function ae(e){return[e.target.x0,e.y1]}function K(){return re().source(ie).target(ae)}var q=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,9],r=[1,10],i=[1,5,10,12],a={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:`error`,4:`SANKEY`,5:`NEWLINE`,10:`EOF`,11:`field[source]`,12:`COMMA`,13:`field[target]`,14:`field[value]`,18:`DQUOTE`,19:`ESCAPED_TEXT`,20:`NON_ESCAPED_TEXT`},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 7:let e=r.findOrCreateNode(a[s-4].trim().replaceAll(`""`,`"`)),t=r.findOrCreateNode(a[s-2].trim().replaceAll(`""`,`"`)),n=parseFloat(a[s].trim());r.addLink(e,t,n);break;case 8:case 9:case 11:this.$=a[s];break;case 10:this.$=a[s-1];break}},`anonymous`),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:n,20:r},{1:[2,6],7:11,10:[1,12]},t(r,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(i,[2,8]),t(i,[2,9]),{19:[1,16]},t(i,[2,11]),{1:[2,1]},{1:[2,5]},t(r,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:n,20:r},{15:18,16:7,17:8,18:n,20:r},{18:[1,19]},t(r,[2,3]),{12:[1,20]},t(i,[2,10]),{15:21,16:7,17:8,18:n,20:r},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
1
+ import{h as e,p as t}from"./src-B2YqOS_g.js";import{H as n,J as r,K as i,U as a,a as o,d as s,s as c,v as l,w as u,x as d,y as f}from"./chunk-CSCIHK7Q-BeNiRoDm.js";import{t as p}from"./ordinal-hYBb2elL.js";function m(e){for(var t=e.length/6|0,n=Array(t),r=0;r<t;)n[r]=`#`+e.slice(r*6,++r*6);return n}var h=m(`4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab`);function g(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n<t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function _(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n>t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function v(e,t){let n=0;if(t===void 0)for(let t of e)(t=+t)&&(n+=t);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}function y(e){return e.target.depth}function b(e){return e.depth}function x(e,t){return t-1-e.height}function S(e,t){return e.sourceLinks.length?e.depth:t-1}function C(e){return e.targetLinks.length?e.depth:e.sourceLinks.length?_(e.sourceLinks,y)-1:0}function w(e){return function(){return e}}function T(e,t){return D(e.source,t.source)||e.index-t.index}function E(e,t){return D(e.target,t.target)||e.index-t.index}function D(e,t){return e.y0-t.y0}function O(e){return e.value}function k(e){return e.index}function A(e){return e.nodes}function j(e){return e.links}function M(e,t){let n=e.get(t);if(!n)throw Error(`missing: `+t);return n}function N({nodes:e}){for(let t of e){let e=t.y0,n=e;for(let n of t.sourceLinks)n.y0=e+n.width/2,e+=n.width;for(let e of t.targetLinks)e.y1=n+e.width/2,n+=e.width}}function P(){let e=0,t=0,n=1,r=1,i=24,a=8,o,s=k,c=S,l,u,d=A,f=j,p=6;function m(){let e={nodes:d.apply(null,arguments),links:f.apply(null,arguments)};return h(e),y(e),b(e),x(e),F(e),N(e),e}m.update=function(e){return N(e),e},m.nodeId=function(e){return arguments.length?(s=typeof e==`function`?e:w(e),m):s},m.nodeAlign=function(e){return arguments.length?(c=typeof e==`function`?e:w(e),m):c},m.nodeSort=function(e){return arguments.length?(l=e,m):l},m.nodeWidth=function(e){return arguments.length?(i=+e,m):i},m.nodePadding=function(e){return arguments.length?(a=o=+e,m):a},m.nodes=function(e){return arguments.length?(d=typeof e==`function`?e:w(e),m):d},m.links=function(e){return arguments.length?(f=typeof e==`function`?e:w(e),m):f},m.linkSort=function(e){return arguments.length?(u=e,m):u},m.size=function(i){return arguments.length?(e=t=0,n=+i[0],r=+i[1],m):[n-e,r-t]},m.extent=function(i){return arguments.length?(e=+i[0][0],n=+i[1][0],t=+i[0][1],r=+i[1][1],m):[[e,t],[n,r]]},m.iterations=function(e){return arguments.length?(p=+e,m):p};function h({nodes:e,links:t}){for(let[t,n]of e.entries())n.index=t,n.sourceLinks=[],n.targetLinks=[];let n=new Map(e.map((t,n)=>[s(t,n,e),t]));for(let[e,r]of t.entries()){r.index=e;let{source:t,target:i}=r;typeof t!=`object`&&(t=r.source=M(n,t)),typeof i!=`object`&&(i=r.target=M(n,i)),t.sourceLinks.push(r),i.targetLinks.push(r)}if(u!=null)for(let{sourceLinks:t,targetLinks:n}of e)t.sort(u),n.sort(u)}function y({nodes:e}){for(let t of e)t.value=t.fixedValue===void 0?Math.max(v(t.sourceLinks,O),v(t.targetLinks,O)):t.fixedValue}function b({nodes:e}){let t=e.length,n=new Set(e),r=new Set,i=0;for(;n.size;){for(let e of n){e.depth=i;for(let{target:t}of e.sourceLinks)r.add(t)}if(++i>t)throw Error(`circular link`);n=r,r=new Set}}function x({nodes:e}){let t=e.length,n=new Set(e),r=new Set,i=0;for(;n.size;){for(let e of n){e.height=i;for(let{source:t}of e.targetLinks)r.add(t)}if(++i>t)throw Error(`circular link`);n=r,r=new Set}}function C({nodes:t}){let r=g(t,e=>e.depth)+1,a=(n-e-i)/(r-1),o=Array(r);for(let n of t){let t=Math.max(0,Math.min(r-1,Math.floor(c.call(null,n,r))));n.layer=t,n.x0=e+t*a,n.x1=n.x0+i,o[t]?o[t].push(n):o[t]=[n]}if(l)for(let e of o)e.sort(l);return o}function P(e){let n=_(e,e=>(r-t-(e.length-1)*o)/v(e,O));for(let i of e){let e=t;for(let t of i){t.y0=e,t.y1=e+t.value*n,e=t.y1+o;for(let e of t.sourceLinks)e.width=e.value*n}e=(r-e+o)/(i.length+1);for(let t=0;t<i.length;++t){let n=i[t];n.y0+=e*(t+1),n.y1+=e*(t+1)}H(i)}}function F(e){let n=C(e);o=Math.min(a,(r-t)/(g(n,e=>e.length)-1)),P(n);for(let e=0;e<p;++e){let t=.99**e,r=Math.max(1-t,(e+1)/p);L(n,t,r),I(n,t,r)}}function I(e,t,n){for(let r=1,i=e.length;r<i;++r){let i=e[r];for(let e of i){let n=0,r=0;for(let{source:t,value:i}of e.targetLinks){let a=i*(e.layer-t.layer);n+=U(t,e)*a,r+=a}if(!(r>0))continue;let i=(n/r-e.y0)*t;e.y0+=i,e.y1+=i,V(e)}l===void 0&&i.sort(D),R(i,n)}}function L(e,t,n){for(let r=e.length-2;r>=0;--r){let i=e[r];for(let e of i){let n=0,r=0;for(let{target:t,value:i}of e.sourceLinks){let a=i*(t.layer-e.layer);n+=W(e,t)*a,r+=a}if(!(r>0))continue;let i=(n/r-e.y0)*t;e.y0+=i,e.y1+=i,V(e)}l===void 0&&i.sort(D),R(i,n)}}function R(e,n){let i=e.length>>1,a=e[i];B(e,a.y0-o,i-1,n),z(e,a.y1+o,i+1,n),B(e,r,e.length-1,n),z(e,t,0,n)}function z(e,t,n,r){for(;n<e.length;++n){let i=e[n],a=(t-i.y0)*r;a>1e-6&&(i.y0+=a,i.y1+=a),t=i.y1+o}}function B(e,t,n,r){for(;n>=0;--n){let i=e[n],a=(i.y1-t)*r;a>1e-6&&(i.y0-=a,i.y1-=a),t=i.y0-o}}function V({sourceLinks:e,targetLinks:t}){if(u===void 0){for(let{source:{sourceLinks:e}}of t)e.sort(E);for(let{target:{targetLinks:t}}of e)t.sort(T)}}function H(e){if(u===void 0)for(let{sourceLinks:t,targetLinks:n}of e)t.sort(E),n.sort(T)}function U(e,t){let n=e.y0-(e.sourceLinks.length-1)*o/2;for(let{target:r,width:i}of e.sourceLinks){if(r===t)break;n+=i+o}for(let{source:r,width:i}of t.targetLinks){if(r===e)break;n-=i}return n}function W(e,t){let n=t.y0-(t.targetLinks.length-1)*o/2;for(let{source:r,width:i}of t.targetLinks){if(r===e)break;n+=i+o}for(let{target:r,width:i}of e.sourceLinks){if(r===t)break;n-=i}return n}return m}var F=Math.PI,I=2*F,L=1e-6,R=I-L;function z(){this._x0=this._y0=this._x1=this._y1=null,this._=``}function B(){return new z}z.prototype=B.prototype={constructor:z,moveTo:function(e,t){this._+=`M`+(this._x0=this._x1=+e)+`,`+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+=`Z`)},lineTo:function(e,t){this._+=`L`+(this._x1=+e)+`,`+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+=`Q`+ +e+`,`+ +t+`,`+(this._x1=+n)+`,`+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,a){this._+=`C`+ +e+`,`+ +t+`,`+ +n+`,`+ +r+`,`+(this._x1=+i)+`,`+(this._y1=+a)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(i<0)throw Error(`negative radius: `+i);if(this._x1===null)this._+=`M`+(this._x1=e)+`,`+(this._y1=t);else if(d>L)if(!(Math.abs(u*s-c*l)>L)||!i)this._+=`L`+(this._x1=e)+`,`+(this._y1=t);else{var f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((F-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>L&&(this._+=`L`+(e+y*l)+`,`+(t+y*u)),this._+=`A`+i+`,`+i+`,0,0,`+ +(u*f>l*p)+`,`+(this._x1=e+b*s)+`,`+(this._y1=t+b*c)}},arc:function(e,t,n,r,i,a){e=+e,t=+t,n=+n,a=!!a;var o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;if(n<0)throw Error(`negative radius: `+n);this._x1===null?this._+=`M`+c+`,`+l:(Math.abs(this._x1-c)>L||Math.abs(this._y1-l)>L)&&(this._+=`L`+c+`,`+l),n&&(d<0&&(d=d%I+I),d>R?this._+=`A`+n+`,`+n+`,0,1,`+u+`,`+(e-o)+`,`+(t-s)+`A`+n+`,`+n+`,0,1,`+u+`,`+(this._x1=c)+`,`+(this._y1=l):d>L&&(this._+=`A`+n+`,`+n+`,0,`+ +(d>=F)+`,`+u+`,`+(this._x1=e+n*Math.cos(i))+`,`+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+=`M`+(this._x0=this._x1=+e)+`,`+(this._y0=this._y1=+t)+`h`+ +n+`v`+ +r+`h`+-n+`Z`},toString:function(){return this._}};function V(e){return function(){return e}}function H(e){return e[0]}function U(e){return e[1]}var W=Array.prototype.slice;function G(e){return e.source}function ee(e){return e.target}function te(e){var t=G,n=ee,r=H,i=U,a=null;function o(){var o,s=W.call(arguments),c=t.apply(this,s),l=n.apply(this,s);if(a||=o=B(),e(a,+r.apply(this,(s[0]=c,s)),+i.apply(this,s),+r.apply(this,(s[0]=l,s)),+i.apply(this,s)),o)return a=null,o+``||null}return o.source=function(e){return arguments.length?(t=e,o):t},o.target=function(e){return arguments.length?(n=e,o):n},o.x=function(e){return arguments.length?(r=typeof e==`function`?e:V(+e),o):r},o.y=function(e){return arguments.length?(i=typeof e==`function`?e:V(+e),o):i},o.context=function(e){return arguments.length?(a=e??null,o):a},o}function ne(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function re(){return te(ne)}function ie(e){return[e.source.x1,e.y0]}function ae(e){return[e.target.x0,e.y1]}function K(){return re().source(ie).target(ae)}var q=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,9],r=[1,10],i=[1,5,10,12],a={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:`error`,4:`SANKEY`,5:`NEWLINE`,10:`EOF`,11:`field[source]`,12:`COMMA`,13:`field[target]`,14:`field[value]`,18:`DQUOTE`,19:`ESCAPED_TEXT`,20:`NON_ESCAPED_TEXT`},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 7:let e=r.findOrCreateNode(a[s-4].trim().replaceAll(`""`,`"`)),t=r.findOrCreateNode(a[s-2].trim().replaceAll(`""`,`"`)),n=parseFloat(a[s].trim());r.addLink(e,t,n);break;case 8:case 9:case 11:this.$=a[s];break;case 10:this.$=a[s-1];break}},`anonymous`),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:n,20:r},{1:[2,6],7:11,10:[1,12]},t(r,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(i,[2,8]),t(i,[2,9]),{19:[1,16]},t(i,[2,11]),{1:[2,1]},{1:[2,5]},t(r,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:n,20:r},{15:18,16:7,17:8,18:n,20:r},{18:[1,19]},t(r,[2,3]),{12:[1,20]},t(i,[2,10]),{15:21,16:7,17:8,18:n,20:r},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
2
2
  `+h.showPosition()+`
3
3
  Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};a.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
@@ -0,0 +1 @@
1
+ import{un as e}from"./index-DlHETnHC.js";var t=e(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]);export{t};
@@ -1,4 +1,4 @@
1
- import{g as e,h as t,p as n}from"./src-DOSXYjwH.js";import{A as r,F as i,G as a,H as o,K as s,O as c,U as l,a as u,b as d,c as f,i as p,r as m,s as h,v as g,w as _,x as v,y,z as b}from"./chunk-CSCIHK7Q-xxNdF5BX.js";import{t as x}from"./dist-CwHmnwO6.js";import{g as S,p as C}from"./chunk-5ZQYHXKU-Vgr4jBt1.js";import{a as w,c as T,i as E,n as D,r as O,s as k}from"./chunk-ND2GUHAM-CzVnJeg1.js";import{t as A}from"./chunk-QZHKN3VN-NhFAU-9O.js";import{n as j,t as M}from"./chunk-XPW4576I-BRwQ5uRX.js";var N=x(),P=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,2],r=[1,3],i=[1,4],a=[2,4],o=[1,9],s=[1,11],c=[1,12],l=[1,14],u=[1,15],d=[1,17],f=[1,18],p=[1,19],m=[1,25],h=[1,26],g=[1,27],_=[1,28],v=[1,29],y=[1,30],b=[1,31],x=[1,32],S=[1,33],C=[1,34],w=[1,35],T=[1,36],E=[1,37],D=[1,38],O=[1,39],k=[1,40],A=[1,42],j=[1,43],M=[1,44],N=[1,45],P=[1,46],F=[1,47],I=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],L=[1,74],ee=[1,80],R=[1,81],te=[1,82],ne=[1,83],z=[1,84],B=[1,85],V=[1,86],re=[1,87],H=[1,88],U=[1,89],W=[1,90],ie=[1,91],ae=[1,92],oe=[1,93],G=[1,94],se=[1,95],K=[1,96],ce=[1,97],le=[1,98],ue=[1,99],de=[1,100],fe=[1,101],pe=[1,102],me=[1,103],he=[1,104],ge=[1,105],_e=[2,78],ve=[4,5,17,51,53,54],ye=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],be=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],xe=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],Se=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],Ce=[5,52],q=[70,71,72,73],J=[1,151],we={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACE`,5:`NEWLINE`,6:`SD`,10:`INVALID`,14:`create`,15:`box`,16:`restOfLine`,17:`end`,19:`autonumber`,20:`NUM`,21:`off`,22:`activate`,24:`deactivate`,30:`title`,31:`legacy_title`,32:`acc_title`,33:`acc_title_value`,34:`acc_descr`,35:`acc_descr_value`,36:`acc_descr_multiline_value`,37:`loop`,38:`rect`,39:`opt`,40:`alt`,42:`par`,44:`par_over`,45:`critical`,47:`break`,48:`option`,49:`and`,50:`else`,51:`participant`,52:`AS`,53:`participant_actor`,54:`destroy`,56:`note`,59:`over`,61:`links`,62:`link`,63:`properties`,64:`details`,66:`,`,67:`left_of`,68:`right_of`,70:`+`,71:`-`,72:`()`,73:`ACTOR`,75:`CONFIG_START`,76:`CONFIG_CONTENT`,77:`CONFIG_END`,78:`SOLID_OPEN_ARROW`,79:`DOTTED_OPEN_ARROW`,80:`SOLID_ARROW`,81:`SOLID_ARROW_TOP`,82:`SOLID_ARROW_BOTTOM`,83:`STICK_ARROW_TOP`,84:`STICK_ARROW_BOTTOM`,85:`SOLID_ARROW_TOP_DOTTED`,86:`SOLID_ARROW_BOTTOM_DOTTED`,87:`STICK_ARROW_TOP_DOTTED`,88:`STICK_ARROW_BOTTOM_DOTTED`,89:`SOLID_ARROW_TOP_REVERSE`,90:`SOLID_ARROW_BOTTOM_REVERSE`,91:`STICK_ARROW_TOP_REVERSE`,92:`STICK_ARROW_BOTTOM_REVERSE`,93:`SOLID_ARROW_TOP_REVERSE_DOTTED`,94:`SOLID_ARROW_BOTTOM_REVERSE_DOTTED`,95:`STICK_ARROW_TOP_REVERSE_DOTTED`,96:`STICK_ARROW_BOTTOM_REVERSE_DOTTED`,97:`BIDIRECTIONAL_SOLID_ARROW`,98:`DOTTED_ARROW`,99:`BIDIRECTIONAL_DOTTED_ARROW`,100:`SOLID_CROSS`,101:`DOTTED_CROSS`,102:`SOLID_POINT`,103:`DOTTED_POINT`,104:`TXT`},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:return r.apply(a[s]),a[s];case 4:case 10:this.$=[];break;case 5:case 11:a[s-1].push(a[s]),this.$=a[s-1];break;case 6:case 7:case 12:case 13:this.$=a[s];break;case 8:case 9:case 14:this.$=[];break;case 16:a[s].type=`createParticipant`,this.$=a[s];break;case 17:a[s-1].unshift({type:`boxStart`,boxData:r.parseBoxData(a[s-2])}),a[s-1].push({type:`boxEnd`,boxText:a[s-2]}),this.$=a[s-1];break;case 19:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-2]),sequenceIndexStep:Number(a[s-1]),sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 20:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 21:this.$={type:`sequenceIndex`,sequenceVisible:!1,signalType:r.LINETYPE.AUTONUMBER};break;case 22:this.$={type:`sequenceIndex`,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 23:this.$={type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor};break;case 24:this.$={type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-1].actor};break;case 30:r.setDiagramTitle(a[s].substring(6)),this.$=a[s].substring(6);break;case 31:r.setDiagramTitle(a[s].substring(7)),this.$=a[s].substring(7);break;case 32:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 33:case 34:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 35:a[s-1].unshift({type:`loopStart`,loopText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.LOOP_START}),a[s-1].push({type:`loopEnd`,loopText:a[s-2],signalType:r.LINETYPE.LOOP_END}),this.$=a[s-1];break;case 36:a[s-1].unshift({type:`rectStart`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_START}),a[s-1].push({type:`rectEnd`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_END}),this.$=a[s-1];break;case 37:a[s-1].unshift({type:`optStart`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_START}),a[s-1].push({type:`optEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_END}),this.$=a[s-1];break;case 38:a[s-1].unshift({type:`altStart`,altText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.ALT_START}),a[s-1].push({type:`altEnd`,signalType:r.LINETYPE.ALT_END}),this.$=a[s-1];break;case 39:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 40:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_OVER_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 41:a[s-1].unshift({type:`criticalStart`,criticalText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.CRITICAL_START}),a[s-1].push({type:`criticalEnd`,signalType:r.LINETYPE.CRITICAL_END}),this.$=a[s-1];break;case 42:a[s-1].unshift({type:`breakStart`,breakText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_START}),a[s-1].push({type:`breakEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_END}),this.$=a[s-1];break;case 44:this.$=a[s-3].concat([{type:`option`,optionText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.CRITICAL_OPTION},a[s]]);break;case 46:this.$=a[s-3].concat([{type:`and`,parText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.PAR_AND},a[s]]);break;case 48:this.$=a[s-3].concat([{type:`else`,altText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.ALT_ELSE},a[s]]);break;case 49:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 50:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 51:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 52:case 57:a[s-1].draw=`actor`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 53:a[s-1].type=`destroyParticipant`,this.$=a[s-1];break;case 54:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 55:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 56:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 58:this.$=[a[s-1],{type:`addNote`,placement:a[s-2],actor:a[s-1].actor,text:a[s]}];break;case 59:a[s-2]=[].concat(a[s-1],a[s-1]).slice(0,2),a[s-2][0]=a[s-2][0].actor,a[s-2][1]=a[s-2][1].actor,this.$=[a[s-1],{type:`addNote`,placement:r.PLACEMENT.OVER,actor:a[s-2].slice(0,2),text:a[s]}];break;case 60:this.$=[a[s-1],{type:`addLinks`,actor:a[s-1].actor,text:a[s]}];break;case 61:this.$=[a[s-1],{type:`addALink`,actor:a[s-1].actor,text:a[s]}];break;case 62:this.$=[a[s-1],{type:`addProperties`,actor:a[s-1].actor,text:a[s]}];break;case 63:this.$=[a[s-1],{type:`addDetails`,actor:a[s-1].actor,text:a[s]}];break;case 66:this.$=[a[s-2],a[s]];break;case 67:this.$=a[s];break;case 68:this.$=r.PLACEMENT.LEFTOF;break;case 69:this.$=r.PLACEMENT.RIGHTOF;break;case 70:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0},{type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor}];break;case 71:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s]},{type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-4].actor}];break;case 72:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor}];break;case 73:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s],activate:!1,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-4].actor}];break;case 74:this.$=[a[s-5],a[s-1],{type:`addMessage`,from:a[s-5].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-5].actor}];break;case 75:this.$=[a[s-3],a[s-1],{type:`addMessage`,from:a[s-3].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s]}];break;case 76:this.$={type:`addParticipant`,actor:a[s-1],config:a[s]};break;case 77:this.$=a[s-1].trim();break;case 78:this.$={type:`addParticipant`,actor:a[s]};break;case 79:this.$=r.LINETYPE.SOLID_OPEN;break;case 80:this.$=r.LINETYPE.DOTTED_OPEN;break;case 81:this.$=r.LINETYPE.SOLID;break;case 82:this.$=r.LINETYPE.SOLID_TOP;break;case 83:this.$=r.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=r.LINETYPE.STICK_TOP;break;case 85:this.$=r.LINETYPE.STICK_BOTTOM;break;case 86:this.$=r.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=r.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=r.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=r.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=r.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=r.LINETYPE.DOTTED;break;case 100:this.$=r.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=r.LINETYPE.SOLID_CROSS;break;case 102:this.$=r.LINETYPE.DOTTED_CROSS;break;case 103:this.$=r.LINETYPE.SOLID_POINT;break;case 104:this.$=r.LINETYPE.DOTTED_POINT;break;case 105:this.$=r.parseMessage(a[s].trim().substring(1));break}},`anonymous`),table:[{3:1,4:n,5:r,6:i},{1:[3]},{3:5,4:n,5:r,6:i},{3:6,4:n,5:r,6:i},e([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],a,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},e(I,[2,5]),{9:48,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},e(I,[2,7]),e(I,[2,8]),e(I,[2,9]),e(I,[2,15]),{13:49,51:D,53:O,54:k},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:F},{23:56,73:F},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},e(I,[2,30]),e(I,[2,31]),{33:[1,62]},{35:[1,63]},e(I,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:L},{23:75,55:76,73:L},{23:77,73:F},{69:78,72:[1,79],78:ee,79:R,80:te,81:ne,82:z,83:B,84:V,85:re,86:H,87:U,88:W,89:ie,90:ae,91:oe,92:G,93:se,94:K,95:ce,96:le,97:ue,98:de,99:fe,100:pe,101:me,102:he,103:ge},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:F},{23:111,73:F},{23:112,73:F},{23:113,73:F},e([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],_e),e(I,[2,6]),e(I,[2,16]),e(ve,[2,10],{11:114}),e(I,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},e(I,[2,22]),{5:[1,118]},{5:[1,119]},e(I,[2,25]),e(I,[2,26]),e(I,[2,27]),e(I,[2,28]),e(I,[2,29]),e(I,[2,32]),e(I,[2,33]),e(ye,a,{7:120}),e(ye,a,{7:121}),e(ye,a,{7:122}),e(be,a,{41:123,7:124}),e(xe,a,{43:125,7:126}),e(xe,a,{7:126,43:127}),e(Se,a,{46:128,7:129}),e(ye,a,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},e(Ce,_e,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:F},{69:146,78:ee,79:R,80:te,81:ne,82:z,83:B,84:V,85:re,86:H,87:U,88:W,89:ie,90:ae,91:oe,92:G,93:se,94:K,95:ce,96:le,97:ue,98:de,99:fe,100:pe,101:me,102:he,103:ge},e(q,[2,79]),e(q,[2,80]),e(q,[2,81]),e(q,[2,82]),e(q,[2,83]),e(q,[2,84]),e(q,[2,85]),e(q,[2,86]),e(q,[2,87]),e(q,[2,88]),e(q,[2,89]),e(q,[2,90]),e(q,[2,91]),e(q,[2,92]),e(q,[2,93]),e(q,[2,94]),e(q,[2,95]),e(q,[2,96]),e(q,[2,97]),e(q,[2,98]),e(q,[2,99]),e(q,[2,100]),e(q,[2,101]),e(q,[2,102]),e(q,[2,103]),e(q,[2,104]),{23:147,73:F},{23:149,60:148,73:F},{73:[2,68]},{73:[2,69]},{58:150,104:J},{58:152,104:J},{58:153,104:J},{58:154,104:J},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:D,53:O,54:k},{5:[1,160]},e(I,[2,20]),e(I,[2,21]),e(I,[2,23]),e(I,[2,24]),{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,161],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,162],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,163],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,164]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,47],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,50:[1,165],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,166]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,45],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,49:[1,167],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,168]},{17:[1,169]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,43],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,48:[1,170],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,171],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{16:[1,172]},e(I,[2,50]),{16:[1,173]},e(I,[2,55]),e(Ce,[2,76]),{76:[1,174]},{16:[1,175]},e(I,[2,52]),{16:[1,176]},e(I,[2,57]),e(I,[2,53]),{23:177,73:F},{23:178,73:F},{23:179,73:F},{58:180,104:J},{23:181,72:[1,182],73:F},{58:183,104:J},{58:184,104:J},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},e(I,[2,17]),e(ve,[2,11]),{13:186,51:D,53:O,54:k},e(ve,[2,13]),e(ve,[2,14]),e(I,[2,19]),e(I,[2,35]),e(I,[2,36]),e(I,[2,37]),e(I,[2,38]),{16:[1,187]},e(I,[2,39]),{16:[1,188]},e(I,[2,40]),e(I,[2,41]),{16:[1,189]},e(I,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:J},{58:196,104:J},{58:197,104:J},{5:[2,75]},{58:198,104:J},{23:199,73:F},{5:[2,58]},{5:[2,59]},{23:200,73:F},e(ve,[2,12]),e(be,a,{7:124,41:201}),e(xe,a,{7:126,43:202}),e(Se,a,{7:129,46:203}),e(I,[2,49]),e(I,[2,54]),e(Ce,[2,77]),e(I,[2,51]),e(I,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:J},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
1
+ import{g as e,h as t,p as n}from"./src-B2YqOS_g.js";import{A as r,F as i,G as a,H as o,K as s,O as c,U as l,a as u,b as d,c as f,i as p,r as m,s as h,v as g,w as _,x as v,y,z as b}from"./chunk-CSCIHK7Q-BeNiRoDm.js";import{t as x}from"./dist-BVWlbvC4.js";import{g as S,p as C}from"./chunk-5ZQYHXKU-D_5qZ4Zv.js";import{a as w,c as T,i as E,n as D,r as O,s as k}from"./chunk-ND2GUHAM-Cks69kWo.js";import{t as A}from"./chunk-QZHKN3VN-CXmYofd4.js";import{n as j,t as M}from"./chunk-XPW4576I-BaeieIoE.js";var N=x(),P=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,2],r=[1,3],i=[1,4],a=[2,4],o=[1,9],s=[1,11],c=[1,12],l=[1,14],u=[1,15],d=[1,17],f=[1,18],p=[1,19],m=[1,25],h=[1,26],g=[1,27],_=[1,28],v=[1,29],y=[1,30],b=[1,31],x=[1,32],S=[1,33],C=[1,34],w=[1,35],T=[1,36],E=[1,37],D=[1,38],O=[1,39],k=[1,40],A=[1,42],j=[1,43],M=[1,44],N=[1,45],P=[1,46],F=[1,47],I=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],L=[1,74],ee=[1,80],R=[1,81],te=[1,82],ne=[1,83],z=[1,84],B=[1,85],V=[1,86],re=[1,87],H=[1,88],U=[1,89],W=[1,90],ie=[1,91],ae=[1,92],oe=[1,93],G=[1,94],se=[1,95],K=[1,96],ce=[1,97],le=[1,98],ue=[1,99],de=[1,100],fe=[1,101],pe=[1,102],me=[1,103],he=[1,104],ge=[1,105],_e=[2,78],ve=[4,5,17,51,53,54],ye=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],be=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],xe=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],Se=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],Ce=[5,52],q=[70,71,72,73],J=[1,151],we={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACE`,5:`NEWLINE`,6:`SD`,10:`INVALID`,14:`create`,15:`box`,16:`restOfLine`,17:`end`,19:`autonumber`,20:`NUM`,21:`off`,22:`activate`,24:`deactivate`,30:`title`,31:`legacy_title`,32:`acc_title`,33:`acc_title_value`,34:`acc_descr`,35:`acc_descr_value`,36:`acc_descr_multiline_value`,37:`loop`,38:`rect`,39:`opt`,40:`alt`,42:`par`,44:`par_over`,45:`critical`,47:`break`,48:`option`,49:`and`,50:`else`,51:`participant`,52:`AS`,53:`participant_actor`,54:`destroy`,56:`note`,59:`over`,61:`links`,62:`link`,63:`properties`,64:`details`,66:`,`,67:`left_of`,68:`right_of`,70:`+`,71:`-`,72:`()`,73:`ACTOR`,75:`CONFIG_START`,76:`CONFIG_CONTENT`,77:`CONFIG_END`,78:`SOLID_OPEN_ARROW`,79:`DOTTED_OPEN_ARROW`,80:`SOLID_ARROW`,81:`SOLID_ARROW_TOP`,82:`SOLID_ARROW_BOTTOM`,83:`STICK_ARROW_TOP`,84:`STICK_ARROW_BOTTOM`,85:`SOLID_ARROW_TOP_DOTTED`,86:`SOLID_ARROW_BOTTOM_DOTTED`,87:`STICK_ARROW_TOP_DOTTED`,88:`STICK_ARROW_BOTTOM_DOTTED`,89:`SOLID_ARROW_TOP_REVERSE`,90:`SOLID_ARROW_BOTTOM_REVERSE`,91:`STICK_ARROW_TOP_REVERSE`,92:`STICK_ARROW_BOTTOM_REVERSE`,93:`SOLID_ARROW_TOP_REVERSE_DOTTED`,94:`SOLID_ARROW_BOTTOM_REVERSE_DOTTED`,95:`STICK_ARROW_TOP_REVERSE_DOTTED`,96:`STICK_ARROW_BOTTOM_REVERSE_DOTTED`,97:`BIDIRECTIONAL_SOLID_ARROW`,98:`DOTTED_ARROW`,99:`BIDIRECTIONAL_DOTTED_ARROW`,100:`SOLID_CROSS`,101:`DOTTED_CROSS`,102:`SOLID_POINT`,103:`DOTTED_POINT`,104:`TXT`},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:return r.apply(a[s]),a[s];case 4:case 10:this.$=[];break;case 5:case 11:a[s-1].push(a[s]),this.$=a[s-1];break;case 6:case 7:case 12:case 13:this.$=a[s];break;case 8:case 9:case 14:this.$=[];break;case 16:a[s].type=`createParticipant`,this.$=a[s];break;case 17:a[s-1].unshift({type:`boxStart`,boxData:r.parseBoxData(a[s-2])}),a[s-1].push({type:`boxEnd`,boxText:a[s-2]}),this.$=a[s-1];break;case 19:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-2]),sequenceIndexStep:Number(a[s-1]),sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 20:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 21:this.$={type:`sequenceIndex`,sequenceVisible:!1,signalType:r.LINETYPE.AUTONUMBER};break;case 22:this.$={type:`sequenceIndex`,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 23:this.$={type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor};break;case 24:this.$={type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-1].actor};break;case 30:r.setDiagramTitle(a[s].substring(6)),this.$=a[s].substring(6);break;case 31:r.setDiagramTitle(a[s].substring(7)),this.$=a[s].substring(7);break;case 32:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 33:case 34:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 35:a[s-1].unshift({type:`loopStart`,loopText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.LOOP_START}),a[s-1].push({type:`loopEnd`,loopText:a[s-2],signalType:r.LINETYPE.LOOP_END}),this.$=a[s-1];break;case 36:a[s-1].unshift({type:`rectStart`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_START}),a[s-1].push({type:`rectEnd`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_END}),this.$=a[s-1];break;case 37:a[s-1].unshift({type:`optStart`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_START}),a[s-1].push({type:`optEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_END}),this.$=a[s-1];break;case 38:a[s-1].unshift({type:`altStart`,altText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.ALT_START}),a[s-1].push({type:`altEnd`,signalType:r.LINETYPE.ALT_END}),this.$=a[s-1];break;case 39:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 40:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_OVER_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 41:a[s-1].unshift({type:`criticalStart`,criticalText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.CRITICAL_START}),a[s-1].push({type:`criticalEnd`,signalType:r.LINETYPE.CRITICAL_END}),this.$=a[s-1];break;case 42:a[s-1].unshift({type:`breakStart`,breakText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_START}),a[s-1].push({type:`breakEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_END}),this.$=a[s-1];break;case 44:this.$=a[s-3].concat([{type:`option`,optionText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.CRITICAL_OPTION},a[s]]);break;case 46:this.$=a[s-3].concat([{type:`and`,parText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.PAR_AND},a[s]]);break;case 48:this.$=a[s-3].concat([{type:`else`,altText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.ALT_ELSE},a[s]]);break;case 49:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 50:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 51:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 52:case 57:a[s-1].draw=`actor`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 53:a[s-1].type=`destroyParticipant`,this.$=a[s-1];break;case 54:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 55:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 56:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 58:this.$=[a[s-1],{type:`addNote`,placement:a[s-2],actor:a[s-1].actor,text:a[s]}];break;case 59:a[s-2]=[].concat(a[s-1],a[s-1]).slice(0,2),a[s-2][0]=a[s-2][0].actor,a[s-2][1]=a[s-2][1].actor,this.$=[a[s-1],{type:`addNote`,placement:r.PLACEMENT.OVER,actor:a[s-2].slice(0,2),text:a[s]}];break;case 60:this.$=[a[s-1],{type:`addLinks`,actor:a[s-1].actor,text:a[s]}];break;case 61:this.$=[a[s-1],{type:`addALink`,actor:a[s-1].actor,text:a[s]}];break;case 62:this.$=[a[s-1],{type:`addProperties`,actor:a[s-1].actor,text:a[s]}];break;case 63:this.$=[a[s-1],{type:`addDetails`,actor:a[s-1].actor,text:a[s]}];break;case 66:this.$=[a[s-2],a[s]];break;case 67:this.$=a[s];break;case 68:this.$=r.PLACEMENT.LEFTOF;break;case 69:this.$=r.PLACEMENT.RIGHTOF;break;case 70:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0},{type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor}];break;case 71:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s]},{type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-4].actor}];break;case 72:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor}];break;case 73:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s],activate:!1,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-4].actor}];break;case 74:this.$=[a[s-5],a[s-1],{type:`addMessage`,from:a[s-5].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-5].actor}];break;case 75:this.$=[a[s-3],a[s-1],{type:`addMessage`,from:a[s-3].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s]}];break;case 76:this.$={type:`addParticipant`,actor:a[s-1],config:a[s]};break;case 77:this.$=a[s-1].trim();break;case 78:this.$={type:`addParticipant`,actor:a[s]};break;case 79:this.$=r.LINETYPE.SOLID_OPEN;break;case 80:this.$=r.LINETYPE.DOTTED_OPEN;break;case 81:this.$=r.LINETYPE.SOLID;break;case 82:this.$=r.LINETYPE.SOLID_TOP;break;case 83:this.$=r.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=r.LINETYPE.STICK_TOP;break;case 85:this.$=r.LINETYPE.STICK_BOTTOM;break;case 86:this.$=r.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=r.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=r.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=r.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=r.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=r.LINETYPE.DOTTED;break;case 100:this.$=r.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=r.LINETYPE.SOLID_CROSS;break;case 102:this.$=r.LINETYPE.DOTTED_CROSS;break;case 103:this.$=r.LINETYPE.SOLID_POINT;break;case 104:this.$=r.LINETYPE.DOTTED_POINT;break;case 105:this.$=r.parseMessage(a[s].trim().substring(1));break}},`anonymous`),table:[{3:1,4:n,5:r,6:i},{1:[3]},{3:5,4:n,5:r,6:i},{3:6,4:n,5:r,6:i},e([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],a,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},e(I,[2,5]),{9:48,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},e(I,[2,7]),e(I,[2,8]),e(I,[2,9]),e(I,[2,15]),{13:49,51:D,53:O,54:k},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:F},{23:56,73:F},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},e(I,[2,30]),e(I,[2,31]),{33:[1,62]},{35:[1,63]},e(I,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:L},{23:75,55:76,73:L},{23:77,73:F},{69:78,72:[1,79],78:ee,79:R,80:te,81:ne,82:z,83:B,84:V,85:re,86:H,87:U,88:W,89:ie,90:ae,91:oe,92:G,93:se,94:K,95:ce,96:le,97:ue,98:de,99:fe,100:pe,101:me,102:he,103:ge},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:F},{23:111,73:F},{23:112,73:F},{23:113,73:F},e([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],_e),e(I,[2,6]),e(I,[2,16]),e(ve,[2,10],{11:114}),e(I,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},e(I,[2,22]),{5:[1,118]},{5:[1,119]},e(I,[2,25]),e(I,[2,26]),e(I,[2,27]),e(I,[2,28]),e(I,[2,29]),e(I,[2,32]),e(I,[2,33]),e(ye,a,{7:120}),e(ye,a,{7:121}),e(ye,a,{7:122}),e(be,a,{41:123,7:124}),e(xe,a,{43:125,7:126}),e(xe,a,{7:126,43:127}),e(Se,a,{46:128,7:129}),e(ye,a,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},e(Ce,_e,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:F},{69:146,78:ee,79:R,80:te,81:ne,82:z,83:B,84:V,85:re,86:H,87:U,88:W,89:ie,90:ae,91:oe,92:G,93:se,94:K,95:ce,96:le,97:ue,98:de,99:fe,100:pe,101:me,102:he,103:ge},e(q,[2,79]),e(q,[2,80]),e(q,[2,81]),e(q,[2,82]),e(q,[2,83]),e(q,[2,84]),e(q,[2,85]),e(q,[2,86]),e(q,[2,87]),e(q,[2,88]),e(q,[2,89]),e(q,[2,90]),e(q,[2,91]),e(q,[2,92]),e(q,[2,93]),e(q,[2,94]),e(q,[2,95]),e(q,[2,96]),e(q,[2,97]),e(q,[2,98]),e(q,[2,99]),e(q,[2,100]),e(q,[2,101]),e(q,[2,102]),e(q,[2,103]),e(q,[2,104]),{23:147,73:F},{23:149,60:148,73:F},{73:[2,68]},{73:[2,69]},{58:150,104:J},{58:152,104:J},{58:153,104:J},{58:154,104:J},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:D,53:O,54:k},{5:[1,160]},e(I,[2,20]),e(I,[2,21]),e(I,[2,23]),e(I,[2,24]),{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,161],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,162],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,163],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,164]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,47],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,50:[1,165],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,166]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,45],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,49:[1,167],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,168]},{17:[1,169]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,43],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,48:[1,170],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,171],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{16:[1,172]},e(I,[2,50]),{16:[1,173]},e(I,[2,55]),e(Ce,[2,76]),{76:[1,174]},{16:[1,175]},e(I,[2,52]),{16:[1,176]},e(I,[2,57]),e(I,[2,53]),{23:177,73:F},{23:178,73:F},{23:179,73:F},{58:180,104:J},{23:181,72:[1,182],73:F},{58:183,104:J},{58:184,104:J},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},e(I,[2,17]),e(ve,[2,11]),{13:186,51:D,53:O,54:k},e(ve,[2,13]),e(ve,[2,14]),e(I,[2,19]),e(I,[2,35]),e(I,[2,36]),e(I,[2,37]),e(I,[2,38]),{16:[1,187]},e(I,[2,39]),{16:[1,188]},e(I,[2,40]),e(I,[2,41]),{16:[1,189]},e(I,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:J},{58:196,104:J},{58:197,104:J},{5:[2,75]},{58:198,104:J},{23:199,73:F},{5:[2,58]},{5:[2,59]},{23:200,73:F},e(ve,[2,12]),e(be,a,{7:124,41:201}),e(xe,a,{7:126,43:202}),e(Se,a,{7:129,46:203}),e(I,[2,49]),e(I,[2,54]),e(Ce,[2,77]),e(I,[2,51]),e(I,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:J},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
2
2
  `+h.showPosition()+`
3
3
  Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};we.lexer=(function(){return{EOF:1,parseError:t(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:t(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:t(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:t(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:t(function(){return this._more=!0,this},`more`),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:t(function(e){this.unput(this.match.slice(e))},`less`),pastInput:t(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:t(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:t(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
@@ -1 +1 @@
1
- import{t as e}from"./arrow-right-Da05Wwlp.js";import{a as t,c as n,i as r,n as i,o as a,r as o,s,t as c,u as l}from"./UsageHeatmap-DIM_N0fI.js";import{t as u}from"./search-BoEnT13J.js";import{$t as d,A as f,At as p,C as m,Ct as h,D as g,Dt as _,E as v,Er as y,Et as b,Ft as x,Ht as S,Jt as C,Kt as w,Mt as ee,Nt as te,O as T,On as E,S as D,Sr as O,St as ne,T as k,Tt as re,Ut as A,_t as ie,a as ae,an as oe,ar as j,br as se,cr as M,d as ce,dr as N,f as le,fr as P,gt as F,ht as ue,i as de,ir as fe,jt as pe,k as me,kn as I,kr as L,kt as R,l as z,lr as B,mt as V,on as H,p as U,rr as W,sr as he,t as ge,tn as G,u as K,un as q,vn as _e,vt as ve,w as ye,wt as be,xr as xe,xt as Se,yr as Ce,yt as we}from"./index-CbAhFc-0.js";import{d as Te,f as Ee,t as De,u as J}from"./useNow-BwVNU1Kt.js";var Oe=q(`chart-column`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]]),ke=q(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),Ae=q(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),je=q(`shield-off`,[[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71`,key:`1jlk70`}],[`path`,{d:`M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264`,key:`18rp1v`}]]),Y=L(y(),1),Me=3600*1e3;function Ne(){return B({queryKey:j.providerCliStatus(),queryFn:Se,refetchInterval:Me,staleTime:300*1e3})}var Pe=5*6e4,Fe=3e3;function Ie(){return B({queryKey:j.runtimeUpgrade(),queryFn:b,staleTime:6e4,refetchInterval:e=>{let t=e.state.data?.operation.status;return t===`scheduled`||t===`running`?Fe:Pe}})}function Le(){let{data:e}=Ie();return e?.state===`available`}var X=P(),Re=3e4,ze=1e3;function Be({compact:e=!1}){let[t,n]=(0,Y.useState)(`idle`),[r,i]=(0,Y.useState)(!1),[a,o]=(0,Y.useState)(null),s=(0,Y.useRef)(0),{data:c=[]}=I(),{data:l=[]}=E(),u=Ve(c,l);function d(){t===`idle`&&(u.length>0?i(!0):f())}async function f(){i(!1),o(null);try{await pe(),s.current=Date.now(),n(`restarting`)}catch(e){o(e instanceof Error?e.message:String(e)),n(`failed`)}}return(0,Y.useEffect)(()=>{if(t!==`restarting`)return;let e=!1,r=null;async function i(){if(Date.now()-s.current>Re){o(`Restart timed out after 30s. Check logs.`),n(`failed`);return}if(!await R())e=!0;else if(e){n(`recovered`),window.location.reload();return}r=setTimeout(i,ze)}return r=setTimeout(i,ze),()=>{r&&clearTimeout(r)}},[t]),(0,X.jsxs)(X.Fragment,{children:[e?(0,X.jsx)(`button`,{onClick:d,disabled:t===`restarting`,className:[`group flex min-h-[44px] items-center focus-visible:outline-none md:min-h-0`,t===`restarting`?`cursor-wait`:`cursor-pointer`].join(` `),title:t===`failed`&&a?a:`Restart Anima services`,children:(0,X.jsxs)(`span`,{className:[`flex items-center gap-1 rounded-sm px-1.5 py-0.5 text-[11px] transition-colors`,t===`restarting`?`text-text-subtle`:`border border-border-soft/60 text-text-muted group-hover:border-border-soft group-hover:text-text group-focus-visible:ring-1 group-focus-visible:ring-accent`].join(` `),children:[(0,X.jsx)(w,{className:`h-2.5 w-2.5 ${t===`restarting`?`animate-spin`:``}`}),(0,X.jsx)(`span`,{children:t===`restarting`?`Restarting…`:`Restart`})]})}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`button`,{onClick:d,disabled:t===`restarting`,className:[`chrome flex w-full items-center gap-2 rounded-sm px-2.5 py-1.5 text-left text-[11px] uppercase tracking-[0.1em] transition-colors`,t===`restarting`?`cursor-wait text-text-on-spine-subtle`:`cursor-pointer text-text-on-spine-muted hover:bg-spine-elevated hover:text-text-on-spine focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent`].join(` `),title:`Restart Anima services`,children:[(0,X.jsx)(w,{className:`h-3.5 w-3.5 ${t===`restarting`?`animate-spin`:``}`}),(0,X.jsx)(`span`,{children:t===`restarting`?`Restarting…`:`Restart services`})]}),t===`failed`&&a&&(0,X.jsx)(`div`,{className:`mt-1 px-2 text-[11px] text-health-error`,children:a})]}),r&&(0,X.jsx)(z,{kind:`restart`,runningNames:u,onCancel:()=>i(!1),onConfirm:()=>void f()}),t===`restarting`&&(0,X.jsx)(K,{title:`Restarting Anima services…`,body:`Any working agents are asked to pause and resume where they left off. The web app reloads automatically when services are back.`})]})}function Ve(e,t){let n=new Map(e.map(e=>[e.id,D(e)])),r=[];for(let e of t)e.currentItemId&&r.push(n.get(e.agentId)??e.agentId);return r}var He=3e5,Ue=1500;function We(){let e=N(),{data:t,isLoading:n}=Ie(),{data:r=[]}=I(),[i,a]=(0,Y.useState)(`idle`),[o,s]=(0,Y.useState)(null),[c,l]=(0,Y.useState)(null),[u,d]=(0,Y.useState)(null),f=t?.operation.status,p=t?.latestOnTrack??t?.operation.targetVersion;async function m(){s(null),l(null);try{await F(),d(p??null),a(`applying`)}catch(e){a(`idle`),e instanceof V&&e.status===409?s(`An agent started working. Try again once idle.`):e instanceof V&&e.status===503?s(`Update is unavailable right now.`):s(e instanceof Error?e.message:`Upgrade failed to start.`)}}(0,Y.useEffect)(()=>{if(i!==`applying`)return;let t=!1,n=!1,r=Date.now(),o=null;async function s(){if(!n){if(Date.now()-r>He){window.location.reload();return}try{let r=await b();if(n)return;if(t){window.location.reload();return}if(r.operation.status===`failed`){l(r.operation),a(`idle`),e.invalidateQueries({queryKey:j.runtimeUpgrade()});return}}catch{t=!0}o=setTimeout(s,Ue)}}return o=setTimeout(s,Ue),()=>{n=!0,o&&clearTimeout(o)}},[i,e]);let h=t?Ge(t.gate.blockers,r):[];function g(){h.length>0?a(`confirming`):m()}let _=f===`scheduled`||f===`running`;return{status:t,isLoading:n,phase:i,applyError:o,installFailure:c,runningNames:h,availableTarget:p,inProgressTarget:_?t?.operation.targetVersion??u??p:u??p,inProgress:i===`applying`||_,requestUpgrade:g,performUpgrade:m,cancelConfirm:()=>a(`idle`)}}function Ge(e,t){let n=new Map(t.map(e=>[e.id,D(e)]));return e.filter(e=>e.status===`running`).map(e=>n.get(e.agentId)??e.agentId)}var Ke=60*6e4;function qe(){let{status:e,isLoading:t,phase:n,applyError:r,runningNames:i,availableTarget:a,inProgressTarget:o,inProgress:s,requestUpgrade:c,performUpgrade:l,cancelConfirm:u}=We(),d=M({mutationFn:we,onSuccess:e=>{he.setQueryData(j.runtimeUpgrade(),e)}});if(t&&!e)return(0,X.jsxs)(Z,{children:[(0,X.jsx)(w,{"aria-hidden":!0,className:`h-3 w-3 animate-spin text-text-subtle`}),(0,X.jsx)(`span`,{className:`font-serif text-[14px] text-text-muted`,children:`Checking for updates…`})]});if(!e)return null;let f=e.operation.status,p=e.operation.completedAt,m=f===`failed`&&tt(p),h=d.isError,g=s?void 0:(0,X.jsx)(Ze,{checking:d.isPending,onCheck:()=>d.mutate()}),_=ce(et(e.operation)),v=_?.kind===`resumed`?_.count:null,y;return y=s?(0,X.jsxs)(Z,{children:[(0,X.jsx)(w,{"aria-hidden":!0,className:`h-3 w-3 animate-spin text-accent`}),(0,X.jsx)(`span`,{className:`font-serif text-[14px] text-text`,children:o?`Updating to ${o}…`:`Updating…`})]}):m?(0,X.jsx)(Ye,{currentVersion:e.currentVersion,error:e.operation.error,rollback:e.operation.rollback,logPath:e.operation.logPath,onRetry:c}):e.state===`unsupported`?(0,X.jsx)(Z,{children:(0,X.jsx)(`span`,{className:`font-serif text-[14px] text-text-muted`,title:e.unsupportedReason,children:`Managed updates unavailable`})}):e.state===`error`?(0,X.jsxs)(Z,{action:g,children:[(0,X.jsx)(`span`,{className:`font-serif text-[14px] text-text-muted`,title:e.checkError?.message,children:`Update check unavailable`}),h&&(0,X.jsx)(Qe,{})]}):e.state===`available`&&a?(0,X.jsx)(Je,{currentVersion:e.currentVersion,target:a,releaseNotesUrl:e.releaseNotesUrl,error:r,onUpgrade:c,action:g,checkFailed:h}):(0,X.jsxs)(Z,{action:g,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`h-2 w-2 shrink-0 rounded-full bg-health-ok`}),(0,X.jsx)(`span`,{className:`font-serif text-[14px] text-text`,children:`Up to date`}),v!==null&&(0,X.jsxs)(`span`,{className:`font-sans text-[11px] text-text-subtle`,children:[`· `,le(v)]}),h&&(0,X.jsx)(Qe,{})]}),(0,X.jsxs)(X.Fragment,{children:[y,n===`confirming`&&a&&(0,X.jsx)(z,{kind:`upgrade`,runningNames:i,target:a,onCancel:u,onConfirm:()=>void l()}),n===`applying`&&(0,X.jsx)(K,{above:!0,title:a?`Installing ${a}…`:`Installing update…`,body:`Your current version keeps running while Anima installs and verifies the new one, then asks any working agents to pause before restart. The dashboard reloads automatically when it's back.`})]})}function Je({currentVersion:e,target:t,releaseNotesUrl:n,error:r,onUpgrade:i,action:a,checkFailed:o}){let s=$e(e,t);return(0,X.jsxs)(`div`,{className:`rounded-sm border border-accent/30 bg-accent/[0.06] p-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`h-1.5 w-1.5 shrink-0 rounded-full bg-accent`}),(0,X.jsx)(`span`,{className:`font-serif text-[14px] font-medium text-text`,children:`Update available`})]}),(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[!s&&(0,X.jsx)(Xe,{from:e,to:t}),a]})]}),s&&(0,X.jsx)(`div`,{className:`mt-1.5`,children:(0,X.jsx)(Xe,{from:e,to:t,stacked:!0})}),(0,X.jsxs)(`div`,{className:`mt-2.5`,children:[(0,X.jsxs)(`button`,{type:`button`,onClick:i,className:`flex w-full items-center justify-center gap-1.5 rounded-sm bg-accent px-3 py-1.5 text-[12px] font-medium text-white transition-colors hover:bg-accent/90 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-page`,children:[(0,X.jsx)(G,{"aria-hidden":!0,className:`h-3 w-3`}),`Upgrade & restart`]}),n&&(0,X.jsxs)(`a`,{href:n,target:`_blank`,rel:`noreferrer`,className:`mt-1.5 flex items-center justify-center gap-1 font-sans text-[11px] text-text-subtle transition-colors hover:text-text focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent`,children:[(0,X.jsx)(d,{"aria-hidden":!0,className:`h-3 w-3`}),`Release notes`]}),r&&(0,X.jsx)(`p`,{className:`mt-1.5 font-sans text-[11px] text-health-error`,children:r}),o&&(0,X.jsx)(`p`,{className:`mt-1.5 font-sans text-[11px] text-text-subtle`,children:`Check failed: showing last known.`})]})]})}function Ye({currentVersion:e,error:t,rollback:n,logPath:r,onRetry:i}){return(0,X.jsxs)(`div`,{className:`rounded-sm border border-health-error/40 bg-health-error/[0.06] p-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,X.jsx)(A,{"aria-hidden":!0,className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-health-error`}),n===`failed`?(0,X.jsx)(`span`,{className:`font-serif text-[14px] font-medium text-text`,children:`Update failed and rollback didn't complete. The runtime may need attention.`}):(0,X.jsxs)(`span`,{className:`font-serif text-[14px] font-medium text-text`,children:[`Update failed: still on`,` `,(0,X.jsx)(`span`,{className:`font-mono text-[12px] text-text-muted`,children:e}),` · nothing else changed`]})]}),t&&(0,X.jsx)(`p`,{className:`mt-1.5 break-words font-mono text-[10px] leading-relaxed text-text-muted`,children:t}),r&&(0,X.jsxs)(`p`,{className:`mt-1 break-all font-mono text-[10px] leading-relaxed text-text-subtle`,children:[`log: `,r]}),(0,X.jsx)(`div`,{className:`mt-2.5`,children:(0,X.jsxs)(`button`,{type:`button`,onClick:i,className:`flex items-center gap-1.5 rounded-sm border border-border-soft px-2.5 py-1 text-[12px] text-text-muted transition-colors hover:border-border-soft hover:text-text focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent`,children:[(0,X.jsx)(w,{"aria-hidden":!0,className:`h-3 w-3`}),`Try again`]})})]})}function Xe({from:e,to:t,stacked:n=!1}){return n?(0,X.jsxs)(`div`,{className:`font-mono text-[11px] leading-snug`,children:[(0,X.jsx)(`div`,{className:`break-all text-text-subtle`,children:e}),(0,X.jsxs)(`div`,{className:`break-all text-text`,children:[(0,X.jsx)(`span`,{className:`text-text-subtle`,children:`→`}),` `,t]})]}):(0,X.jsxs)(`span`,{className:`shrink-0 whitespace-nowrap font-mono text-[12px] text-text-muted`,children:[e,` `,(0,X.jsx)(`span`,{className:`text-text-subtle`,children:`→`}),` `,t]})}function Z({children:e,action:t}){return(0,X.jsxs)(`div`,{className:`group/update-row flex items-center gap-3`,children:[(0,X.jsx)(`span`,{className:`w-14 shrink-0 font-sans text-[11px] text-text-subtle`,children:`Update`}),(0,X.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center gap-x-2 gap-y-0.5`,children:e}),t]})}function Ze({checking:e,onCheck:t}){return(0,X.jsx)(`button`,{type:`button`,onClick:t,disabled:e,"aria-label":e?`Checking for updates`:`Check for updates`,title:e?`Checking for updates…`:`Check for updates`,className:`flex h-[44px] w-[44px] shrink-0 items-center justify-center rounded-sm text-text-subtle opacity-40 transition hover:bg-surface-elevated hover:text-text hover:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent disabled:cursor-default disabled:opacity-70 group-hover/update-row:opacity-100 md:h-6 md:w-6 [@media(hover:none)]:opacity-100`,children:(0,X.jsx)(w,{"aria-hidden":!0,className:`h-3.5 w-3.5 ${e?`animate-spin`:``}`})})}function Qe(){return(0,X.jsx)(`span`,{className:`font-sans text-[11px] text-text-subtle`,children:`Check failed: showing last known.`})}function $e(e,t){return e.length>12||t.length>12||e.length+t.length>22}function et(e){return{completedAt:e.completedAt,fallbackToIdle:e.restart?.fallbackToIdle,interruptedCount:e.restart?.interruptedCount,mode:e.restart?.mode,resumedCount:e.restart?.resumedCount}}function tt(e){return!e||Date.now()-Date.parse(e)<Ke}function nt(){let{data:e}=B({queryKey:j.health(),queryFn:R,staleTime:5e3}),{data:t}=B({queryKey:j.serverInfo(),queryFn:_,staleTime:6e4}),n=e===void 0?`loading`:e?`ok`:`error`,r=De(),i=n===`loading`?`var(--color-health-idle)`:n===`ok`?`var(--color-health-ok)`:`var(--color-health-error)`,a=n===`loading`?`Checking…`:n===`ok`?`Healthy`:`Unreachable`,o=t?.version&&t.version!==`0.0.0`?t.version:null,s=o?t?.track?`${t.track} · ${o}`:o:t?.track??null;return(0,X.jsxs)(`div`,{className:[`divide-y divide-border-soft transition-opacity duration-150 ease-out`,e!==void 0&&t?`opacity-100`:`opacity-0`].join(` `),children:[(0,X.jsxs)(`div`,{className:`flex items-start justify-between gap-4 py-5`,children:[(0,X.jsxs)(`div`,{className:`space-y-1`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`h-2.5 w-2.5 shrink-0 rounded-full`,style:{background:i}}),(0,X.jsx)(`span`,{className:`font-serif text-[18px] font-semibold text-text`,children:a})]}),t?.startedAt&&(0,X.jsxs)(`div`,{className:`pl-[18px] font-sans text-[11px] tracking-wide text-text-subtle`,title:Ee(t.startedAt),children:[`up `,Te(t.startedAt,r)]})]}),(0,X.jsx)(Be,{compact:!0})]}),(0,X.jsx)(`div`,{className:`py-5`,children:(0,X.jsxs)(`dl`,{className:`grid grid-cols-[72px_1fr] gap-x-4 gap-y-5`,children:[(0,X.jsxs)(rt,{label:`Version`,children:[s&&(0,X.jsx)(`div`,{className:`min-w-0 break-all font-mono text-[12px] text-text`,children:s}),(0,X.jsx)(`div`,{className:s?`mt-2`:``,children:(0,X.jsx)(qe,{})})]}),t&&(0,X.jsx)(rt,{label:`Home`,children:(0,X.jsx)(`div`,{className:`min-w-0 break-all font-mono text-[12px] text-text`,title:t.animaHome,children:t.animaHome})})]})})]})}function rt({label:e,children:t}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`dt`,{className:`pt-0.5 font-sans text-[10px] font-medium uppercase tracking-widest text-text-subtle`,children:e}),(0,X.jsx)(`dd`,{className:`min-w-0`,children:t})]})}var it=2e3;function at(){return B({queryKey:j.providerLogin(),queryFn:()=>h(),staleTime:3e4,refetchInterval:e=>e.state.data?.providers.some(e=>e.operation.status===`running`)?it:!1})}function ot(){return(0,X.jsxs)(`div`,{className:`animate-pulse space-y-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,X.jsx)(`div`,{className:`h-7 w-7 rounded-md bg-surface-elevated`}),(0,X.jsx)(`div`,{className:`h-3 w-24 rounded bg-surface-elevated`})]}),(0,X.jsxs)(`div`,{className:`space-y-2 pl-[42px]`,children:[(0,X.jsx)(`div`,{className:`h-1.5 w-full rounded-full bg-surface-elevated`}),(0,X.jsx)(`div`,{className:`h-1.5 w-2/3 rounded-full bg-surface-elevated`})]})]})}var st=`anima.usagePanel.expandedProviders`;function ct(){try{let e=window.localStorage.getItem(st);if(!e)return{};let t=JSON.parse(e);if(!t||typeof t!=`object`||Array.isArray(t))return{};let n={};for(let[e,r]of Object.entries(t))r===!0&&(n[e]=!0);return n}catch{return{}}}function lt(e){try{window.localStorage.setItem(st,JSON.stringify(e))}catch{}}function ut(){let e=N(),{confirm:t,modal:r}=de(),[i,a]=(0,Y.useState)(ct),[o,s]=(0,Y.useState)(),[c,u]=(0,Y.useState)(),[d,f]=(0,Y.useState)(),[m,h]=(0,Y.useState)(),{data:g,isLoading:_,isFetching:v}=Ne(),{data:y,isFetching:b,refetch:S}=at(),[C,T]=(0,Y.useState)(),[E,D]=(0,Y.useState)(),{data:O,isLoading:k,isFetching:A}=B({queryKey:j.providerUsage(),queryFn:re,staleTime:6e4}),{data:ae,isFetching:oe,refetch:se}=B({queryKey:j.providerRuntimeCommands(),queryFn:be,staleTime:3e4}),{data:M,isFetching:ce,refetch:le}=B({queryKey:j.providerContextLimits(),queryFn:ne,staleTime:3e4}),P=De(),F=O?.providers.reduce((e,t)=>e?t.checkedAt>e?t.checkedAt:e:t.checkedAt,void 0);async function fe(){let[t,,,n]=await Promise.all([p(),le(),se(),ve(),S()]);e.setQueryData(j.providerUsage(),t),e.setQueryData(j.providerCliStatus(),n)}function pe(e){a(t=>{let n={...t};return n[e]?delete n[e]:n[e]=!0,lt(n),n})}async function me(t,n){s(t.provider),u(void 0);try{let r=await ee(t.provider,n);e.setQueryData(j.providerContextLimits(),r)}catch(e){u({message:e instanceof Error?e.message:`Could not save context limit`,provider:t.provider})}finally{s(void 0)}}async function I(t,n,r){f(t),h(void 0);try{let i=await te(t,n,r);e.setQueryData(j.providerRuntimeCommands(),i)}catch(e){h({message:e instanceof Error?e.message:`Could not save runtime command`,provider:t})}finally{f(void 0)}}async function L(t,n){T(t),D(void 0);try{let r=n===`cancel`?await ie(t):await x(t,n);e.setQueryData(j.providerLogin(),r)}catch(e){D({message:e instanceof Error?e.message:`Could not run the provider sign-in`,provider:t})}finally{T(void 0)}}function R(n){let r=n.agents.filter(e=>e.enabled);t({title:`Update ${n.label}?`,description:(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsxs)(`p`,{children:[`Update the machine-wide `,n.label,` binary from v`,n.installedVersion,` to v`,n.latestVersion,`. This affects `,r.length,` `,r.length===1?`agent`:`agents`,`:`,` `,r.map(e=>e.name).join(`, `)||`none`,`.`]}),(0,X.jsx)(`p`,{children:`Running work is not interrupted. New versions take effect when each provider session next restarts. Login credentials and provider configuration are not changed.`})]}),variant:`warn`,confirmVariant:`default`,confirmLabel:`Update provider`,busyLabel:`Installing…`,onConfirm:async()=>{await ue(n.provider),await e.invalidateQueries({queryKey:j.providerCliStatus()})}})}let z=new Map;for(let e of O?.providers??[]){let t=z.get(e.provider)??[];t.push(e),z.set(e.provider,t)}let V=(g?.providers??[]).filter(e=>e.state!==`not_installed`),H=[F,...V.map(e=>e.checkedAt)].filter(e=>!!e).sort().at(-1),U=A||v||ce||oe||b;return(0,X.jsxs)(Y.Fragment,{children:[(0,X.jsxs)(`div`,{className:`flex min-h-[44px] items-center justify-end gap-2 border-b border-border-soft`,children:[H&&(0,X.jsxs)(`span`,{className:`font-sans text-[10px] text-text-subtle`,children:[`checked `,l(H,P)]}),(0,X.jsx)(`button`,{onClick:()=>void fe(),disabled:U,className:`flex h-[44px] w-[44px] items-center justify-center rounded-sm text-text-muted hover:bg-surface-elevated hover:text-text focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent disabled:opacity-40 md:h-7 md:w-7`,"aria-label":`Refresh providers`,title:`Refresh`,children:(0,X.jsx)(w,{className:`h-3.5 w-3.5 ${U?`animate-spin`:``}`})})]}),(0,X.jsx)(`div`,{className:`py-5`,children:k||_?(0,X.jsxs)(`div`,{className:`space-y-6`,children:[(0,X.jsx)(ot,{}),(0,X.jsx)(ot,{})]}):V.length>0?(0,X.jsx)(`div`,{className:`divide-y divide-border-soft`,children:V.map((e,t)=>(0,X.jsx)(`div`,{className:t===0?`pb-4`:`py-4 last:pb-1`,children:(0,X.jsx)(n,{contextLimit:M?.providers.find(t=>t.provider===e.provider),contextLimitError:c?.provider===e.provider?c.message:void 0,contextLimitSaving:o===e.provider,expanded:!!i[e.provider],globallyLocked:g?.upgradeLocked,management:e,now:P,onApply:()=>R(e),onCopyCommand:()=>{e.manualCommand&&navigator.clipboard.writeText(e.manualCommand)},onToggleExpanded:()=>pe(e.provider),usages:z.get(e.provider)??[],onContextLimitChange:t=>{let n=M?.providers.find(t=>t.provider===e.provider);n&&me(n,t)},runtimeCommand:ae?.providers.find(t=>t.provider===e.provider)??{args:[],command:null,defaultCommand:_e(e.provider)?.command??e.provider,provider:e.provider},runtimeCommandError:m?.provider===e.provider?m.message:void 0,runtimeCommandSaving:d===e.provider,onRuntimeCommandSave:(t,n)=>{I(e.provider,t,n)},login:y?.providers.find(t=>t.provider===e.provider),loginBusy:C===e.provider,loginError:E?.provider===e.provider?E.message:void 0,onLoginStart:t=>{L(e.provider,t)},onLoginCancel:()=>{L(e.provider,`cancel`)}})},e.provider))}):(0,X.jsx)(`p`,{className:`font-serif italic text-[13px] text-text-subtle`,children:`No provider CLIs found.`})}),r]})}var dt=10,ft=`Past 52 weeks`;function pt(){let n=xe(),l=a(),{data:u,isLoading:d,isError:f}=B({queryKey:j.tokenUsage(l.from,l.through,l.timezone),queryFn:()=>s(l),refetchInterval:3e4}),p=r(u?.agents.map(e=>e.days)??[]),h=_t(u?.agents.map(e=>e.coverageStartedAt)??[]),g=t(p),_=mt(u?.agents??[]).slice(0,dt),v=u?.totalTokens??0;return(0,X.jsxs)(`div`,{className:`pt-2`,children:[d&&(0,X.jsx)(`div`,{className:`h-64 animate-pulse rounded-sm bg-surface-elevated`}),f&&(0,X.jsx)(`p`,{className:`font-serif text-[14px] text-text-muted`,children:`Token usage is unavailable right now.`}),u&&(0,X.jsxs)(`div`,{className:`space-y-8`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-end gap-x-14 gap-y-5`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`div`,{className:`font-serif text-[40px] leading-none tabular-nums text-text`,children:J(v)}),(0,X.jsx)(`div`,{className:`mt-1.5 font-sans text-[10px] uppercase tracking-[0.13em] text-text-subtle`,children:ft})]}),g&&(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`div`,{className:`font-serif text-[26px] leading-none tabular-nums text-text-muted`,children:J(g.totalTokens)}),(0,X.jsxs)(`div`,{className:`mt-1.5 font-sans text-[10px] uppercase tracking-[0.13em] text-text-subtle`,children:[`Busiest day · `,o(g.date)]})]})]}),(0,X.jsx)(`div`,{className:`pb-3`,children:(0,X.jsx)(i,{coverageStartedAt:h,days:p,from:l.from,through:l.through})}),(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`div`,{className:`mb-1 border-b border-border-soft pb-2 font-sans text-[10px] uppercase tracking-[0.13em] text-text-muted`,children:`Top agents`}),(0,X.jsx)(`div`,{className:`divide-y divide-border-soft`,children:_.map((r,i)=>{let a=v>0?r.totalTokens/v*100:0,o=t(r.days);return(0,X.jsxs)(`button`,{type:`button`,onClick:()=>{n(`/agents/${encodeURIComponent(r.agentId)}/profile`)},className:`group grid w-full items-center gap-x-4 gap-y-2 py-3.5 text-left hover:bg-surface-elevated/40 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-accent md:grid-cols-[minmax(150px,0.5fr)_1fr_112px_16px] md:px-1`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,X.jsx)(`span`,{className:`w-[12px] shrink-0 text-right font-mono text-[10px] tabular-nums text-text-subtle`,children:i+1}),r.avatarUrl?(0,X.jsx)(`img`,{src:r.avatarUrl,alt:``,className:`h-7 w-7 shrink-0 rounded-lg object-cover ring-1 ring-border-soft`}):(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-lg font-sans text-[10px] font-bold text-white`,style:{background:m(i)},children:ye(r.agentName)}),(0,X.jsx)(`span`,{className:`truncate font-serif text-[15px] leading-tight text-text`,children:r.agentName})]}),(0,X.jsx)(`div`,{className:`h-[7px] w-full overflow-hidden rounded-full`,style:{background:c[0]},"aria-hidden":!0,children:(0,X.jsx)(`div`,{className:`h-full rounded-full`,style:{background:c[4],width:gt(a)}})}),(0,X.jsxs)(`div`,{className:`md:text-right`,children:[(0,X.jsx)(`div`,{className:`font-mono text-[13px] tabular-nums text-text`,children:J(r.totalTokens)}),(0,X.jsxs)(`div`,{className:`mt-0.5 font-mono text-[9px] tabular-nums text-text-subtle`,children:[ht(a),`%`,o?` · peak ${J(o.totalTokens)}`:``]})]}),(0,X.jsx)(e,{className:`hidden h-3.5 w-3.5 text-text-subtle transition-transform group-hover:translate-x-0.5 group-hover:text-text md:block`})]},r.agentId)})})]})]})]})}function mt(e){return[...e].sort((e,t)=>t.totalTokens-e.totalTokens||e.agentName.localeCompare(t.agentName))}function ht(e){return e<1?e.toFixed(1):e.toFixed(0)}function gt(e){return e<=0?`0%`:`${Math.max(1,e)}%`}function _t(e){if(!(e.length===0||e.some(e=>!e)))return e.sort().at(-1)}async function vt(){return(await W(`/api/do-not-contact`)).workspaces}function yt(e){return W(`/api/do-not-contact/${encodeURIComponent(e)}/users`)}function bt(e,t,n){return W(`/api/do-not-contact/${encodeURIComponent(e)}/members`,fe(n===`add`?`POST`:`DELETE`,{userId:t}))}var xt=[`do-not-contact`],Q=`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent`,St=`inline-flex min-h-[44px] items-center gap-1.5 rounded-sm border border-border-soft bg-surface px-3 text-[12px] text-text hover:bg-surface-elevated disabled:cursor-not-allowed disabled:opacity-50 md:min-h-[32px] ${Q}`,Ct=`flex min-h-[44px] min-w-[44px] shrink-0 items-center justify-center rounded-[3px] text-text-subtle opacity-0 transition-opacity hover:bg-surface-raised hover:text-text focus-visible:opacity-100 disabled:cursor-not-allowed md:min-h-7 md:min-w-7 [@media(hover:none)]:opacity-100 ${Q}`,wt=`${Ct} group-hover/ws:opacity-100 group-focus-within/ws:opacity-100 disabled:group-hover/ws:opacity-40 disabled:[@media(hover:none)]:opacity-40`,Tt=`${Ct} group-hover/row:opacity-100 group-focus-within/row:opacity-100`;function Et(){let e=B({queryKey:xt,queryFn:vt,retry:!1}),t=e.data??[];return(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`p`,{className:`text-[13px] leading-relaxed text-text`,children:[`Agents will not DM or @mention the people listed here. Incoming messages and ordinary channel posts are unaffected.`,(0,X.jsx)(`span`,{className:`mt-1.5 block text-[11px] leading-relaxed text-text-subtle`,children:`Applies to every agent in this Anima instance, per Slack workspace. Changes take effect immediately.`})]}),e.isPending&&(0,X.jsx)(`p`,{role:`status`,className:`mt-6 border-t border-border-strong pt-4 text-[12px] text-text-muted`,children:`Loading list…`}),e.isError&&(0,X.jsxs)(`div`,{role:`alert`,className:`mt-6 flex flex-wrap items-center gap-x-3 gap-y-2 border-l-2 border-health-error pl-3 text-[12px] leading-relaxed text-health-error`,children:[(0,X.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Could not load the do-not-contact list. Existing restrictions have not been changed.`}),(0,X.jsx)(`button`,{type:`button`,className:St,onClick:()=>void e.refetch(),children:`Retry`})]}),!e.isPending&&!e.isError&&t.length===0&&(0,X.jsx)(`p`,{className:`mt-6 border-t border-border-strong pt-4 text-[12px] text-text-muted`,children:`Connect an agent to Slack to manage a workspace’s list.`}),!e.isError&&t.length>0&&(0,X.jsx)(`div`,{className:`mt-6 border-t border-border-strong`,children:t.map(e=>(0,X.jsx)(Dt,{workspace:e},e.id))})]})}function Dt({workspace:e}){let t=N(),n=B({queryKey:[`contact-directory`,e.id],queryFn:()=>yt(e.id),enabled:e.canLookup,retry:!1,staleTime:6e4}),[r,i]=(0,Y.useState)(!1),[a,o]=(0,Y.useState)(``),[s,c]=(0,Y.useState)(``),[l,d]=(0,Y.useState)(null),f=M({mutationFn:({action:t,user:n})=>bt(e.id,n.slackUserId,t),onSuccess:async(e,n)=>{c(n.action===`add`?`Added. Restriction is active.`:`Removed. Restriction lifted.`),d(null),o(``),await t.invalidateQueries({queryKey:xt})}}),p=n.data?.users??[],m=e.memberIds.map(e=>{let t=p.find(t=>t.slackUserId===e);return t?{user:t,resolved:!0}:{user:{slackUserId:e,displayName:e},resolved:!1}}),h=p.filter(t=>!e.memberIds.includes(t.slackUserId)),g=a.trim().toLocaleLowerCase().replace(/^@/,``),_=h.filter(e=>`${e.displayName} ${e.handle??``} ${e.slackUserId}`.toLocaleLowerCase().includes(g)),v=e.canLookup&&n.isSuccess&&!n.isError,y=m.length,b=n.isSuccess?`Not found in the Slack directory · still restricted`:`Saved ID · still restricted`;function x(e,t){f.reset(),c(``),d({action:e,user:t})}return(0,X.jsxs)(`section`,{"aria-labelledby":`ws-${e.id}`,className:`group/ws border-b border-border-soft py-4 last:border-b-0`,children:[(0,X.jsxs)(`div`,{className:`flex min-h-7 items-center gap-2`,children:[(0,X.jsx)(`h2`,{id:`ws-${e.id}`,className:`min-w-0 truncate text-[13px] font-semibold text-text`,children:e.name}),(0,X.jsxs)(`span`,{className:`ml-auto shrink-0 text-[11px] text-text-subtle`,children:[y,` `,y===1?`person`:`people`]}),(0,X.jsx)(`button`,{type:`button`,className:`${wt} -mr-2 md:-mr-1.5 ${r?`opacity-100`:``}`,disabled:!e.canLookup,"aria-expanded":r,"aria-label":r?`Close search in ${e.name}`:`Add a person to ${e.name}`,title:r?`Close search`:`Add a person`,onClick:()=>{i(!r),o(``)},children:r?(0,X.jsx)(S,{"aria-hidden":!0,className:`h-3.5 w-3.5`}):(0,X.jsx)(C,{"aria-hidden":!0,className:`h-3.5 w-3.5`})})]}),!e.canLookup&&(0,X.jsx)(`p`,{role:`status`,className:`mt-2 border-l-2 border-border-strong pl-3 text-[12px] leading-relaxed text-text-muted`,children:`No Slack connection is available for this workspace. Saved IDs remain restricted.`}),n.isError&&(0,X.jsxs)(`div`,{role:`alert`,className:`mt-2 flex flex-wrap items-center gap-x-3 gap-y-2 border-l-2 border-health-error pl-3 text-[12px] leading-relaxed text-health-error`,children:[(0,X.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Slack directory unavailable. Saved IDs remain restricted.`}),(0,X.jsx)(`button`,{type:`button`,className:St,onClick:()=>void n.refetch(),children:`Retry lookup`})]}),r&&(0,X.jsxs)(`div`,{className:`mt-2 rounded-sm border border-border-soft bg-surface-elevated`,children:[(0,X.jsxs)(`label`,{className:`relative block`,children:[(0,X.jsx)(u,{"aria-hidden":!0,className:`pointer-events-none absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-text-subtle`}),(0,X.jsx)(`input`,{"aria-label":`Search Slack members in ${e.name}`,className:`min-h-[44px] w-full min-w-0 border-b border-border-soft bg-transparent pl-9 pr-3 text-[13px] text-text placeholder:text-text-subtle md:min-h-[36px] ${Q}`,placeholder:`Name or @username`,autoFocus:!0,value:a,onChange:e=>o(e.target.value)})]}),n.isPending&&e.canLookup&&(0,X.jsx)(`p`,{role:`status`,className:`px-3 py-3 text-[12px] text-text-muted`,children:`Loading Slack members…`}),v&&(0,X.jsxs)(`ul`,{"aria-label":`Slack search results · ${e.name}`,className:`max-h-60 divide-y divide-border-soft overflow-y-auto`,children:[_.slice(0,50).map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,className:`group flex min-h-[44px] w-full items-center gap-3 px-3 py-1.5 text-left hover:bg-surface md:min-h-[40px] ${Q}`,onClick:()=>x(`add`,e),children:[(0,X.jsx)(Ot,{user:e}),(0,X.jsxs)(`span`,{className:`ml-auto inline-flex shrink-0 items-center gap-1 text-[11px] text-text-subtle group-hover:text-accent`,children:[(0,X.jsx)(C,{"aria-hidden":!0,className:`h-3 w-3`}),` Add`]})]})},e.slackUserId)),_.length===0&&(0,X.jsx)(`li`,{className:`px-3 py-3 text-[12px] text-text-muted`,children:`No matching members.`}),_.length>50&&(0,X.jsx)(`li`,{className:`px-3 py-2 text-[11px] text-text-subtle`,children:`Keep typing to narrow the results.`})]})]}),m.length>0?(0,X.jsx)(`ul`,{"aria-label":`Do-not-contact members · ${e.name}`,className:`mt-1.5`,children:m.map(({user:e,resolved:t})=>(0,X.jsxs)(`li`,{className:`group/row flex items-center gap-2.5 border-t border-border-soft py-1.5`,children:[(0,X.jsx)(Ot,{user:e,unresolvedNote:t?void 0:b}),(0,X.jsx)(`button`,{type:`button`,"aria-label":`Remove ${e.displayName}`,title:`Remove`,className:`${Tt} -mr-2 ml-auto md:-mr-1.5`,onClick:()=>x(`remove`,e),children:(0,X.jsx)(S,{"aria-hidden":!0,className:`h-3 w-3`})})]},e.slackUserId))}):(0,X.jsx)(`p`,{className:`mt-1.5 border-t border-border-soft pb-1 pt-2.5 text-[12px] text-text-subtle`,children:`No one listed. Agents may contact anyone in this workspace.`}),s&&(0,X.jsxs)(`p`,{role:`status`,className:`mt-2 flex items-center gap-2 text-[12px] text-text-muted`,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`inline-block h-1.5 w-1.5 rounded-full bg-health-ok`}),s]}),(0,X.jsx)(ae,{open:l!==null,title:l?.action===`add`?`Add to do-not-contact list?`:`Remove from do-not-contact list?`,description:l&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`span`,{className:`mb-2 block font-medium`,children:[l.user.displayName,` `,(0,X.jsxs)(`span`,{className:`font-mono text-[11px]`,children:[`(`,l.user.slackUserId,`)`]})]}),l.action===`add`?`All agents in this Anima instance connected to ${e.name} will be restricted from contacting this person through Anima tools.`:`This lifts the restriction for all agents in this Anima instance connected to ${e.name}.`]}),variant:`warn`,confirmVariant:l?.action===`remove`?`destructive`:`default`,confirmLabel:l?.action===`add`?`Add member`:`Remove member`,busy:f.isPending,error:f.error?.message,onCancel:()=>{f.isPending||d(null)},onConfirm:()=>{l&&!f.isPending&&f.mutate(l)}})]})}function Ot({user:e,unresolvedNote:t}){let n=t!==void 0;return(0,X.jsxs)(X.Fragment,{children:[e.avatarUrl?(0,X.jsx)(`img`,{src:e.avatarUrl,alt:``,className:`h-7 w-7 shrink-0 rounded-[3px] object-cover ring-1 ring-border-soft`}):(0,X.jsx)(`span`,{"aria-hidden":!0,className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-[3px] ring-1 ring-border-soft ${n?`bg-surface font-mono text-[10px] text-text-subtle`:`bg-surface-elevated text-[12px] font-semibold text-text-muted`}`,children:n?`?`:e.displayName.trim().slice(0,1).toLocaleUpperCase()}),(0,X.jsx)(`span`,{className:`min-w-0 leading-tight`,children:n?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`block truncate font-mono text-[12px] text-text`,children:e.slackUserId}),(0,X.jsx)(`span`,{className:`block truncate text-[11px] text-text-subtle`,children:t})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`block truncate text-[13px] text-text`,children:e.displayName}),(0,X.jsxs)(`span`,{className:`block truncate text-[11px] text-text-subtle`,children:[e.handle&&(0,X.jsxs)(`span`,{className:`text-text-muted`,children:[`@`,e.handle]}),e.handle&&` · `,(0,X.jsx)(`span`,{className:`font-mono text-[10px]`,children:e.slackUserId})]})]})})]})}function kt(){let{status:e,phase:t,applyError:n,installFailure:r,runningNames:i,availableTarget:a,inProgressTarget:o,inProgress:s,requestUpgrade:c,performUpgrade:l,cancelConfirm:u}=We();if(!e)return null;let d=e.state===`available`&&!!a;if(!d&&!(t!==`idle`||r!==null||n!==null))return null;let f=d||t!==`idle`;return(0,X.jsxs)(`div`,{className:`border-t border-border-soft p-2`,children:[f&&(0,X.jsxs)(`button`,{type:`button`,onClick:c,disabled:s,"aria-label":s?`Updating Anima to ${o??a}`:`Update Anima, ${e.currentVersion} to ${a}`,title:s?void 0:`Install the update and restart`,className:[`flex min-h-[44px] w-full items-center gap-2.5 rounded-sm bg-surface px-2.5 py-1.5 text-left font-sans text-[12px] text-text ring-1 ring-border-soft transition-colors`,s?`cursor-wait`:`hover:bg-surface-raised hover:ring-border-strong`,`focus-visible:outline-none focus-visible:ring-accent`].join(` `),children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-accent text-white`,children:s?(0,X.jsx)(w,{className:`h-[11px] w-[11px] animate-spin`,strokeWidth:2.2}):(0,X.jsx)(G,{className:`h-[11px] w-[11px]`,strokeWidth:2.2})}),(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col leading-tight`,children:[(0,X.jsx)(`span`,{className:`truncate`,children:s?`Updating Anima…`:`Update Anima`}),!s&&a&&(0,X.jsxs)(`span`,{"aria-hidden":!0,className:`truncate font-mono text-[10px] text-text-subtle`,children:[jt(e.currentVersion),` → `,jt(a)]})]})]}),r&&t!==`applying`&&(0,X.jsx)(At,{currentVersion:e.currentVersion,error:r.error,rollback:r.rollback,onRetry:f?void 0:c}),n&&t!==`applying`&&(0,X.jsxs)(`div`,{role:`alert`,className:`mt-1.5 px-1 font-sans text-[11px] leading-snug text-health-error`,children:[(0,X.jsx)(`p`,{children:n}),!f&&(0,X.jsx)($,{onRetry:c})]}),t===`confirming`&&(0,X.jsx)(z,{kind:`upgrade`,runningNames:i,target:a??o??``,onCancel:u,onConfirm:()=>void l()}),t===`applying`&&(0,X.jsx)(K,{above:!0,title:`Installing ${o??a}…`,body:`Your current version keeps running while Anima installs and verifies the new one, then asks any working agents to pause before restart. The dashboard reloads automatically when it's back.`})]})}function At({currentVersion:e,error:t,rollback:n,onRetry:r}){return(0,X.jsxs)(`div`,{role:`alert`,className:`mt-1.5 rounded-sm border border-health-error/40 bg-health-error/[0.06] px-2 py-1.5 font-sans text-[11px] leading-snug text-text`,children:[(0,X.jsxs)(`div`,{className:`flex items-start gap-1.5`,children:[(0,X.jsx)(A,{"aria-hidden":!0,className:`mt-px h-3 w-3 shrink-0 text-health-error`}),n===`failed`?(0,X.jsx)(`span`,{children:`Update failed and rollback didn't complete. The runtime may need attention.`}):(0,X.jsxs)(`span`,{children:[`Update failed: still on `,(0,X.jsx)(`span`,{className:`font-mono text-[10px]`,children:e})]})]}),t&&(0,X.jsx)(`p`,{className:`mt-1 break-words font-mono text-[10px] leading-relaxed text-text-muted`,children:t}),r&&(0,X.jsx)($,{onRetry:r})]})}function $({onRetry:e}){return(0,X.jsxs)(`button`,{type:`button`,onClick:e,className:`mt-1.5 flex min-h-[44px] items-center gap-1.5 rounded-sm border border-border-soft px-2 py-0.5 text-[11px] md:min-h-[28px] text-text-muted transition-colors hover:text-text focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent`,children:[(0,X.jsx)(w,{"aria-hidden":!0,className:`h-3 w-3`}),`Try again`]})}function jt(e){return e.replace(/\.[0-9a-f]{7,}$/i,``)}var Mt={server:Ae,providers:ke,"token-usage":Oe,"outreach-limits":je},Nt={server:nt,providers:ut,"token-usage":pt,"outreach-limits":Et};function Pt(){let{page:e}=O(),t=se(),n=xe(),r=ge(),i=me(t.state);if(e!==void 0&&!T(e))return(0,X.jsx)(Ce,{to:g(),replace:!0,state:t.state});let a=T(e)?e:null;if(!r&&a===null)return(0,X.jsx)(Ce,{to:g(k),replace:!0,state:t.state});let o=()=>n(i),s=e=>n(g(e),{state:t.state});if(r)return a===null?(0,X.jsx)(zt,{onBack:o,onSelect:s}):(0,X.jsx)(Bt,{page:a,onBack:()=>n(g(),{state:t.state})});let c=a??`server`;return(0,X.jsxs)(`div`,{className:`flex h-dvh w-screen overflow-hidden bg-surface text-text`,children:[(0,X.jsxs)(`nav`,{"aria-label":`Settings`,className:`flex w-[256px] shrink-0 flex-col border-r border-border-soft bg-surface-elevated`,children:[(0,X.jsxs)(`div`,{className:`flex h-14 shrink-0 items-center gap-2 border-b border-border-soft px-4`,children:[(0,X.jsx)(Lt,{label:`Back`,onClick:o}),(0,X.jsx)(`span`,{className:`caps ml-auto text-text`,children:`Settings`})]}),(0,X.jsx)(`div`,{className:`flex-1 overflow-y-auto pb-2`,children:v.map(e=>(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`div`,{className:`px-4 pb-1 pt-4 font-sans text-[10px] uppercase tracking-[0.14em] text-text-subtle`,children:e.label}),(0,X.jsx)(`ul`,{className:`space-y-0.5 px-2`,children:e.pages.map(e=>{let t=Mt[e.id],n=e.id===c;return(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,onClick:()=>s(e.id),"aria-current":n?`page`:void 0,className:[`flex h-[34px] w-full items-center gap-2.5 rounded-sm px-2 text-left font-sans text-[13px] transition-colors`,n?`bg-surface text-text ring-1 ring-border-soft`:`text-text-muted hover:bg-surface-hover hover:text-text`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent`].join(` `),children:[(0,X.jsx)(t,{"aria-hidden":!0,className:`h-[13px] w-[13px] shrink-0`}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),(0,X.jsx)(It,{page:e.id})]})},e.id)})})]},e.label))}),(0,X.jsx)(kt,{})]}),(0,X.jsx)(`main`,{className:`min-w-0 flex-1 overflow-y-auto`,children:(0,X.jsx)(`div`,{className:`max-w-[680px] px-10 pb-12 pt-9`,children:(0,X.jsx)(Ft,{page:c})})})]})}function Ft({page:e,hideTitle:t=!1}){let n=Nt[e],r=(0,Y.useRef)(null);return(0,Y.useEffect)(()=>{t||r.current?.focus()},[e,t]),(0,X.jsxs)(U,{children:[!t&&(0,X.jsx)(`h1`,{ref:r,tabIndex:-1,className:`display mb-1.5 text-[24px] font-semibold tracking-[-0.01em] text-text focus-visible:outline-none`,children:f(e)}),(0,X.jsx)(n,{})]},e)}function It({page:e,mobile:t=!1}){let{data:n}=Ne(),r=Le(),i=n?.providers.some(e=>e.updateAvailable)??!1;return e===`providers`&&i||t&&e===`server`&&r?(0,X.jsx)(`span`,{className:`shrink-0 rounded-[2px] border border-accent px-1.5 py-px font-sans text-[10px] tracking-[0.04em] text-accent`,children:`Update`}):null}function Lt({label:e,onClick:t}){return(0,X.jsxs)(`button`,{type:`button`,onClick:t,className:`-ml-2 flex min-h-[44px] items-center gap-1 rounded-sm pl-1 pr-2 font-sans text-[12px] text-text-muted transition-colors hover:text-text focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent md:min-h-8`,children:[(0,X.jsx)(H,{"aria-hidden":!0,className:`h-4 w-4`}),(0,X.jsx)(`span`,{children:e})]})}function Rt({title:e,backLabel:t,onBack:n}){return(0,X.jsxs)(`div`,{className:`sticky top-0 z-10 grid h-[calc(3.5rem+env(safe-area-inset-top))] shrink-0 grid-cols-[1fr_auto_1fr] items-center border-b border-border-soft bg-surface px-3 pt-[env(safe-area-inset-top)]`,children:[(0,X.jsx)(`div`,{className:`flex justify-start`,children:(0,X.jsx)(Lt,{label:t,onClick:n})}),(0,X.jsx)(`span`,{className:`caps text-text`,children:e}),(0,X.jsx)(`span`,{"aria-hidden":!0})]})}function zt({onBack:e,onSelect:t}){return(0,X.jsxs)(`div`,{className:`flex h-dvh flex-col bg-surface text-text`,children:[(0,X.jsx)(Rt,{title:`Settings`,backLabel:`Back`,onBack:e}),(0,X.jsx)(`nav`,{"aria-label":`Settings`,className:`flex-1 overflow-y-auto pb-[env(safe-area-inset-bottom)]`,children:v.map(e=>(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`div`,{className:`px-4 pb-1.5 pt-[18px] font-sans text-[10px] uppercase tracking-[0.14em] text-text-subtle`,children:e.label}),(0,X.jsx)(`ul`,{className:`divide-y divide-border-soft border-y border-border-soft`,children:e.pages.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,onClick:()=>t(e.id),className:`flex min-h-12 w-full items-center gap-3 px-4 text-left font-sans text-[14px] text-text hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-accent`,children:[(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),(0,X.jsx)(It,{page:e.id,mobile:!0}),(0,X.jsx)(oe,{"aria-hidden":!0,className:`h-4 w-4 shrink-0 text-text-subtle`})]})},e.id))})]},e.label))})]})}function Bt({page:e,onBack:t}){return(0,X.jsxs)(`div`,{className:`flex h-dvh flex-col bg-surface text-text`,children:[(0,X.jsx)(Rt,{title:f(e),backLabel:`Settings`,onBack:t}),(0,X.jsx)(`main`,{className:`flex-1 overflow-y-auto px-4 pb-[calc(2rem+env(safe-area-inset-bottom))] pt-5`,children:(0,X.jsx)(Ft,{page:e,hideTitle:!0})})]})}export{Pt as default};
1
+ import{t as e}from"./arrow-right-rNbgcgPM.js";import{a as t,c as n,i as r,n as i,o as a,r as o,s,t as c,u as l}from"./UsageHeatmap-BW-EDtlf.js";import{t as u}from"./search-BB_1c6y5.js";import{$t as d,A as f,At as p,C as m,Ct as h,D as g,Dt as _,E as v,Er as y,Et as b,Ft as x,Ht as S,Jt as C,Kt as w,Mt as ee,Nt as te,O as T,On as E,S as D,Sr as O,St as ne,T as k,Tt as re,Ut as A,_t as ie,a as ae,an as oe,ar as j,br as se,cr as M,d as ce,dr as N,f as le,fr as P,gt as F,ht as ue,i as de,ir as fe,jt as pe,k as me,kn as I,kr as L,kt as R,l as z,lr as B,mt as V,on as H,p as U,rr as W,sr as he,t as ge,tn as G,u as K,un as q,vn as _e,vt as ve,w as ye,wt as be,xr as xe,xt as Se,yr as Ce,yt as we}from"./index-DlHETnHC.js";import{d as Te,f as Ee,t as De,u as J}from"./useNow-BbEkaqh-.js";var Oe=q(`chart-column`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]]),ke=q(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),Ae=q(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),je=q(`shield-off`,[[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71`,key:`1jlk70`}],[`path`,{d:`M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264`,key:`18rp1v`}]]),Y=L(y(),1),Me=3600*1e3;function Ne(){return B({queryKey:j.providerCliStatus(),queryFn:Se,refetchInterval:Me,staleTime:300*1e3})}var Pe=5*6e4,Fe=3e3;function Ie(){return B({queryKey:j.runtimeUpgrade(),queryFn:b,staleTime:6e4,refetchInterval:e=>{let t=e.state.data?.operation.status;return t===`scheduled`||t===`running`?Fe:Pe}})}function Le(){let{data:e}=Ie();return e?.state===`available`}var X=P(),Re=3e4,ze=1e3;function Be({compact:e=!1}){let[t,n]=(0,Y.useState)(`idle`),[r,i]=(0,Y.useState)(!1),[a,o]=(0,Y.useState)(null),s=(0,Y.useRef)(0),{data:c=[]}=I(),{data:l=[]}=E(),u=Ve(c,l);function d(){t===`idle`&&(u.length>0?i(!0):f())}async function f(){i(!1),o(null);try{await pe(),s.current=Date.now(),n(`restarting`)}catch(e){o(e instanceof Error?e.message:String(e)),n(`failed`)}}return(0,Y.useEffect)(()=>{if(t!==`restarting`)return;let e=!1,r=null;async function i(){if(Date.now()-s.current>Re){o(`Restart timed out after 30s. Check logs.`),n(`failed`);return}if(!await R())e=!0;else if(e){n(`recovered`),window.location.reload();return}r=setTimeout(i,ze)}return r=setTimeout(i,ze),()=>{r&&clearTimeout(r)}},[t]),(0,X.jsxs)(X.Fragment,{children:[e?(0,X.jsx)(`button`,{onClick:d,disabled:t===`restarting`,className:[`group flex min-h-[44px] items-center focus-visible:outline-none md:min-h-0`,t===`restarting`?`cursor-wait`:`cursor-pointer`].join(` `),title:t===`failed`&&a?a:`Restart Anima services`,children:(0,X.jsxs)(`span`,{className:[`flex items-center gap-1 rounded-sm px-1.5 py-0.5 text-[11px] transition-colors`,t===`restarting`?`text-text-subtle`:`border border-border-soft/60 text-text-muted group-hover:border-border-soft group-hover:text-text group-focus-visible:ring-1 group-focus-visible:ring-accent`].join(` `),children:[(0,X.jsx)(w,{className:`h-2.5 w-2.5 ${t===`restarting`?`animate-spin`:``}`}),(0,X.jsx)(`span`,{children:t===`restarting`?`Restarting…`:`Restart`})]})}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`button`,{onClick:d,disabled:t===`restarting`,className:[`chrome flex w-full items-center gap-2 rounded-sm px-2.5 py-1.5 text-left text-[11px] uppercase tracking-[0.1em] transition-colors`,t===`restarting`?`cursor-wait text-text-on-spine-subtle`:`cursor-pointer text-text-on-spine-muted hover:bg-spine-elevated hover:text-text-on-spine focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent`].join(` `),title:`Restart Anima services`,children:[(0,X.jsx)(w,{className:`h-3.5 w-3.5 ${t===`restarting`?`animate-spin`:``}`}),(0,X.jsx)(`span`,{children:t===`restarting`?`Restarting…`:`Restart services`})]}),t===`failed`&&a&&(0,X.jsx)(`div`,{className:`mt-1 px-2 text-[11px] text-health-error`,children:a})]}),r&&(0,X.jsx)(z,{kind:`restart`,runningNames:u,onCancel:()=>i(!1),onConfirm:()=>void f()}),t===`restarting`&&(0,X.jsx)(K,{title:`Restarting Anima services…`,body:`Any working agents are asked to pause and resume where they left off. The web app reloads automatically when services are back.`})]})}function Ve(e,t){let n=new Map(e.map(e=>[e.id,D(e)])),r=[];for(let e of t)e.currentItemId&&r.push(n.get(e.agentId)??e.agentId);return r}var He=3e5,Ue=1500;function We(){let e=N(),{data:t,isLoading:n}=Ie(),{data:r=[]}=I(),[i,a]=(0,Y.useState)(`idle`),[o,s]=(0,Y.useState)(null),[c,l]=(0,Y.useState)(null),[u,d]=(0,Y.useState)(null),f=t?.operation.status,p=t?.latestOnTrack??t?.operation.targetVersion;async function m(){s(null),l(null);try{await F(),d(p??null),a(`applying`)}catch(e){a(`idle`),e instanceof V&&e.status===409?s(`An agent started working. Try again once idle.`):e instanceof V&&e.status===503?s(`Update is unavailable right now.`):s(e instanceof Error?e.message:`Upgrade failed to start.`)}}(0,Y.useEffect)(()=>{if(i!==`applying`)return;let t=!1,n=!1,r=Date.now(),o=null;async function s(){if(!n){if(Date.now()-r>He){window.location.reload();return}try{let r=await b();if(n)return;if(t){window.location.reload();return}if(r.operation.status===`failed`){l(r.operation),a(`idle`),e.invalidateQueries({queryKey:j.runtimeUpgrade()});return}}catch{t=!0}o=setTimeout(s,Ue)}}return o=setTimeout(s,Ue),()=>{n=!0,o&&clearTimeout(o)}},[i,e]);let h=t?Ge(t.gate.blockers,r):[];function g(){h.length>0?a(`confirming`):m()}let _=f===`scheduled`||f===`running`;return{status:t,isLoading:n,phase:i,applyError:o,installFailure:c,runningNames:h,availableTarget:p,inProgressTarget:_?t?.operation.targetVersion??u??p:u??p,inProgress:i===`applying`||_,requestUpgrade:g,performUpgrade:m,cancelConfirm:()=>a(`idle`)}}function Ge(e,t){let n=new Map(t.map(e=>[e.id,D(e)]));return e.filter(e=>e.status===`running`).map(e=>n.get(e.agentId)??e.agentId)}var Ke=60*6e4;function qe(){let{status:e,isLoading:t,phase:n,applyError:r,runningNames:i,availableTarget:a,inProgressTarget:o,inProgress:s,requestUpgrade:c,performUpgrade:l,cancelConfirm:u}=We(),d=M({mutationFn:we,onSuccess:e=>{he.setQueryData(j.runtimeUpgrade(),e)}});if(t&&!e)return(0,X.jsxs)(Z,{children:[(0,X.jsx)(w,{"aria-hidden":!0,className:`h-3 w-3 animate-spin text-text-subtle`}),(0,X.jsx)(`span`,{className:`font-serif text-[14px] text-text-muted`,children:`Checking for updates…`})]});if(!e)return null;let f=e.operation.status,p=e.operation.completedAt,m=f===`failed`&&tt(p),h=d.isError,g=s?void 0:(0,X.jsx)(Ze,{checking:d.isPending,onCheck:()=>d.mutate()}),_=ce(et(e.operation)),v=_?.kind===`resumed`?_.count:null,y;return y=s?(0,X.jsxs)(Z,{children:[(0,X.jsx)(w,{"aria-hidden":!0,className:`h-3 w-3 animate-spin text-accent`}),(0,X.jsx)(`span`,{className:`font-serif text-[14px] text-text`,children:o?`Updating to ${o}…`:`Updating…`})]}):m?(0,X.jsx)(Ye,{currentVersion:e.currentVersion,error:e.operation.error,rollback:e.operation.rollback,logPath:e.operation.logPath,onRetry:c}):e.state===`unsupported`?(0,X.jsx)(Z,{children:(0,X.jsx)(`span`,{className:`font-serif text-[14px] text-text-muted`,title:e.unsupportedReason,children:`Managed updates unavailable`})}):e.state===`error`?(0,X.jsxs)(Z,{action:g,children:[(0,X.jsx)(`span`,{className:`font-serif text-[14px] text-text-muted`,title:e.checkError?.message,children:`Update check unavailable`}),h&&(0,X.jsx)(Qe,{})]}):e.state===`available`&&a?(0,X.jsx)(Je,{currentVersion:e.currentVersion,target:a,releaseNotesUrl:e.releaseNotesUrl,error:r,onUpgrade:c,action:g,checkFailed:h}):(0,X.jsxs)(Z,{action:g,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`h-2 w-2 shrink-0 rounded-full bg-health-ok`}),(0,X.jsx)(`span`,{className:`font-serif text-[14px] text-text`,children:`Up to date`}),v!==null&&(0,X.jsxs)(`span`,{className:`font-sans text-[11px] text-text-subtle`,children:[`· `,le(v)]}),h&&(0,X.jsx)(Qe,{})]}),(0,X.jsxs)(X.Fragment,{children:[y,n===`confirming`&&a&&(0,X.jsx)(z,{kind:`upgrade`,runningNames:i,target:a,onCancel:u,onConfirm:()=>void l()}),n===`applying`&&(0,X.jsx)(K,{above:!0,title:a?`Installing ${a}…`:`Installing update…`,body:`Your current version keeps running while Anima installs and verifies the new one, then asks any working agents to pause before restart. The dashboard reloads automatically when it's back.`})]})}function Je({currentVersion:e,target:t,releaseNotesUrl:n,error:r,onUpgrade:i,action:a,checkFailed:o}){let s=$e(e,t);return(0,X.jsxs)(`div`,{className:`rounded-sm border border-accent/30 bg-accent/[0.06] p-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`h-1.5 w-1.5 shrink-0 rounded-full bg-accent`}),(0,X.jsx)(`span`,{className:`font-serif text-[14px] font-medium text-text`,children:`Update available`})]}),(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[!s&&(0,X.jsx)(Xe,{from:e,to:t}),a]})]}),s&&(0,X.jsx)(`div`,{className:`mt-1.5`,children:(0,X.jsx)(Xe,{from:e,to:t,stacked:!0})}),(0,X.jsxs)(`div`,{className:`mt-2.5`,children:[(0,X.jsxs)(`button`,{type:`button`,onClick:i,className:`flex w-full items-center justify-center gap-1.5 rounded-sm bg-accent px-3 py-1.5 text-[12px] font-medium text-white transition-colors hover:bg-accent/90 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-page`,children:[(0,X.jsx)(G,{"aria-hidden":!0,className:`h-3 w-3`}),`Upgrade & restart`]}),n&&(0,X.jsxs)(`a`,{href:n,target:`_blank`,rel:`noreferrer`,className:`mt-1.5 flex items-center justify-center gap-1 font-sans text-[11px] text-text-subtle transition-colors hover:text-text focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent`,children:[(0,X.jsx)(d,{"aria-hidden":!0,className:`h-3 w-3`}),`Release notes`]}),r&&(0,X.jsx)(`p`,{className:`mt-1.5 font-sans text-[11px] text-health-error`,children:r}),o&&(0,X.jsx)(`p`,{className:`mt-1.5 font-sans text-[11px] text-text-subtle`,children:`Check failed: showing last known.`})]})]})}function Ye({currentVersion:e,error:t,rollback:n,logPath:r,onRetry:i}){return(0,X.jsxs)(`div`,{className:`rounded-sm border border-health-error/40 bg-health-error/[0.06] p-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,X.jsx)(A,{"aria-hidden":!0,className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-health-error`}),n===`failed`?(0,X.jsx)(`span`,{className:`font-serif text-[14px] font-medium text-text`,children:`Update failed and rollback didn't complete. The runtime may need attention.`}):(0,X.jsxs)(`span`,{className:`font-serif text-[14px] font-medium text-text`,children:[`Update failed: still on`,` `,(0,X.jsx)(`span`,{className:`font-mono text-[12px] text-text-muted`,children:e}),` · nothing else changed`]})]}),t&&(0,X.jsx)(`p`,{className:`mt-1.5 break-words font-mono text-[10px] leading-relaxed text-text-muted`,children:t}),r&&(0,X.jsxs)(`p`,{className:`mt-1 break-all font-mono text-[10px] leading-relaxed text-text-subtle`,children:[`log: `,r]}),(0,X.jsx)(`div`,{className:`mt-2.5`,children:(0,X.jsxs)(`button`,{type:`button`,onClick:i,className:`flex items-center gap-1.5 rounded-sm border border-border-soft px-2.5 py-1 text-[12px] text-text-muted transition-colors hover:border-border-soft hover:text-text focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent`,children:[(0,X.jsx)(w,{"aria-hidden":!0,className:`h-3 w-3`}),`Try again`]})})]})}function Xe({from:e,to:t,stacked:n=!1}){return n?(0,X.jsxs)(`div`,{className:`font-mono text-[11px] leading-snug`,children:[(0,X.jsx)(`div`,{className:`break-all text-text-subtle`,children:e}),(0,X.jsxs)(`div`,{className:`break-all text-text`,children:[(0,X.jsx)(`span`,{className:`text-text-subtle`,children:`→`}),` `,t]})]}):(0,X.jsxs)(`span`,{className:`shrink-0 whitespace-nowrap font-mono text-[12px] text-text-muted`,children:[e,` `,(0,X.jsx)(`span`,{className:`text-text-subtle`,children:`→`}),` `,t]})}function Z({children:e,action:t}){return(0,X.jsxs)(`div`,{className:`group/update-row flex items-center gap-3`,children:[(0,X.jsx)(`span`,{className:`w-14 shrink-0 font-sans text-[11px] text-text-subtle`,children:`Update`}),(0,X.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center gap-x-2 gap-y-0.5`,children:e}),t]})}function Ze({checking:e,onCheck:t}){return(0,X.jsx)(`button`,{type:`button`,onClick:t,disabled:e,"aria-label":e?`Checking for updates`:`Check for updates`,title:e?`Checking for updates…`:`Check for updates`,className:`flex h-[44px] w-[44px] shrink-0 items-center justify-center rounded-sm text-text-subtle opacity-40 transition hover:bg-surface-elevated hover:text-text hover:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent disabled:cursor-default disabled:opacity-70 group-hover/update-row:opacity-100 md:h-6 md:w-6 [@media(hover:none)]:opacity-100`,children:(0,X.jsx)(w,{"aria-hidden":!0,className:`h-3.5 w-3.5 ${e?`animate-spin`:``}`})})}function Qe(){return(0,X.jsx)(`span`,{className:`font-sans text-[11px] text-text-subtle`,children:`Check failed: showing last known.`})}function $e(e,t){return e.length>12||t.length>12||e.length+t.length>22}function et(e){return{completedAt:e.completedAt,fallbackToIdle:e.restart?.fallbackToIdle,interruptedCount:e.restart?.interruptedCount,mode:e.restart?.mode,resumedCount:e.restart?.resumedCount}}function tt(e){return!e||Date.now()-Date.parse(e)<Ke}function nt(){let{data:e}=B({queryKey:j.health(),queryFn:R,staleTime:5e3}),{data:t}=B({queryKey:j.serverInfo(),queryFn:_,staleTime:6e4}),n=e===void 0?`loading`:e?`ok`:`error`,r=De(),i=n===`loading`?`var(--color-health-idle)`:n===`ok`?`var(--color-health-ok)`:`var(--color-health-error)`,a=n===`loading`?`Checking…`:n===`ok`?`Healthy`:`Unreachable`,o=t?.version&&t.version!==`0.0.0`?t.version:null,s=o?t?.track?`${t.track} · ${o}`:o:t?.track??null;return(0,X.jsxs)(`div`,{className:[`divide-y divide-border-soft transition-opacity duration-150 ease-out`,e!==void 0&&t?`opacity-100`:`opacity-0`].join(` `),children:[(0,X.jsxs)(`div`,{className:`flex items-start justify-between gap-4 py-5`,children:[(0,X.jsxs)(`div`,{className:`space-y-1`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`h-2.5 w-2.5 shrink-0 rounded-full`,style:{background:i}}),(0,X.jsx)(`span`,{className:`font-serif text-[18px] font-semibold text-text`,children:a})]}),t?.startedAt&&(0,X.jsxs)(`div`,{className:`pl-[18px] font-sans text-[11px] tracking-wide text-text-subtle`,title:Ee(t.startedAt),children:[`up `,Te(t.startedAt,r)]})]}),(0,X.jsx)(Be,{compact:!0})]}),(0,X.jsx)(`div`,{className:`py-5`,children:(0,X.jsxs)(`dl`,{className:`grid grid-cols-[72px_1fr] gap-x-4 gap-y-5`,children:[(0,X.jsxs)(rt,{label:`Version`,children:[s&&(0,X.jsx)(`div`,{className:`min-w-0 break-all font-mono text-[12px] text-text`,children:s}),(0,X.jsx)(`div`,{className:s?`mt-2`:``,children:(0,X.jsx)(qe,{})})]}),t&&(0,X.jsx)(rt,{label:`Home`,children:(0,X.jsx)(`div`,{className:`min-w-0 break-all font-mono text-[12px] text-text`,title:t.animaHome,children:t.animaHome})})]})})]})}function rt({label:e,children:t}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`dt`,{className:`pt-0.5 font-sans text-[10px] font-medium uppercase tracking-widest text-text-subtle`,children:e}),(0,X.jsx)(`dd`,{className:`min-w-0`,children:t})]})}var it=2e3;function at(){return B({queryKey:j.providerLogin(),queryFn:()=>h(),staleTime:3e4,refetchInterval:e=>e.state.data?.providers.some(e=>e.operation.status===`running`)?it:!1})}function ot(){return(0,X.jsxs)(`div`,{className:`animate-pulse space-y-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,X.jsx)(`div`,{className:`h-7 w-7 rounded-md bg-surface-elevated`}),(0,X.jsx)(`div`,{className:`h-3 w-24 rounded bg-surface-elevated`})]}),(0,X.jsxs)(`div`,{className:`space-y-2 pl-[42px]`,children:[(0,X.jsx)(`div`,{className:`h-1.5 w-full rounded-full bg-surface-elevated`}),(0,X.jsx)(`div`,{className:`h-1.5 w-2/3 rounded-full bg-surface-elevated`})]})]})}var st=`anima.usagePanel.expandedProviders`;function ct(){try{let e=window.localStorage.getItem(st);if(!e)return{};let t=JSON.parse(e);if(!t||typeof t!=`object`||Array.isArray(t))return{};let n={};for(let[e,r]of Object.entries(t))r===!0&&(n[e]=!0);return n}catch{return{}}}function lt(e){try{window.localStorage.setItem(st,JSON.stringify(e))}catch{}}function ut(){let e=N(),{confirm:t,modal:r}=de(),[i,a]=(0,Y.useState)(ct),[o,s]=(0,Y.useState)(),[c,u]=(0,Y.useState)(),[d,f]=(0,Y.useState)(),[m,h]=(0,Y.useState)(),{data:g,isLoading:_,isFetching:v}=Ne(),{data:y,isFetching:b,refetch:S}=at(),[C,T]=(0,Y.useState)(),[E,D]=(0,Y.useState)(),{data:O,isLoading:k,isFetching:A}=B({queryKey:j.providerUsage(),queryFn:re,staleTime:6e4}),{data:ae,isFetching:oe,refetch:se}=B({queryKey:j.providerRuntimeCommands(),queryFn:be,staleTime:3e4}),{data:M,isFetching:ce,refetch:le}=B({queryKey:j.providerContextLimits(),queryFn:ne,staleTime:3e4}),P=De(),F=O?.providers.reduce((e,t)=>e?t.checkedAt>e?t.checkedAt:e:t.checkedAt,void 0);async function fe(){let[t,,,n]=await Promise.all([p(),le(),se(),ve(),S()]);e.setQueryData(j.providerUsage(),t),e.setQueryData(j.providerCliStatus(),n)}function pe(e){a(t=>{let n={...t};return n[e]?delete n[e]:n[e]=!0,lt(n),n})}async function me(t,n){s(t.provider),u(void 0);try{let r=await ee(t.provider,n);e.setQueryData(j.providerContextLimits(),r)}catch(e){u({message:e instanceof Error?e.message:`Could not save context limit`,provider:t.provider})}finally{s(void 0)}}async function I(t,n,r){f(t),h(void 0);try{let i=await te(t,n,r);e.setQueryData(j.providerRuntimeCommands(),i)}catch(e){h({message:e instanceof Error?e.message:`Could not save runtime command`,provider:t})}finally{f(void 0)}}async function L(t,n){T(t),D(void 0);try{let r=n===`cancel`?await ie(t):await x(t,n);e.setQueryData(j.providerLogin(),r)}catch(e){D({message:e instanceof Error?e.message:`Could not run the provider sign-in`,provider:t})}finally{T(void 0)}}function R(n){let r=n.agents.filter(e=>e.enabled);t({title:`Update ${n.label}?`,description:(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsxs)(`p`,{children:[`Update the machine-wide `,n.label,` binary from v`,n.installedVersion,` to v`,n.latestVersion,`. This affects `,r.length,` `,r.length===1?`agent`:`agents`,`:`,` `,r.map(e=>e.name).join(`, `)||`none`,`.`]}),(0,X.jsx)(`p`,{children:`Running work is not interrupted. New versions take effect when each provider session next restarts. Login credentials and provider configuration are not changed.`})]}),variant:`warn`,confirmVariant:`default`,confirmLabel:`Update provider`,busyLabel:`Installing…`,onConfirm:async()=>{await ue(n.provider),await e.invalidateQueries({queryKey:j.providerCliStatus()})}})}let z=new Map;for(let e of O?.providers??[]){let t=z.get(e.provider)??[];t.push(e),z.set(e.provider,t)}let V=(g?.providers??[]).filter(e=>e.state!==`not_installed`),H=[F,...V.map(e=>e.checkedAt)].filter(e=>!!e).sort().at(-1),U=A||v||ce||oe||b;return(0,X.jsxs)(Y.Fragment,{children:[(0,X.jsxs)(`div`,{className:`flex min-h-[44px] items-center justify-end gap-2 border-b border-border-soft`,children:[H&&(0,X.jsxs)(`span`,{className:`font-sans text-[10px] text-text-subtle`,children:[`checked `,l(H,P)]}),(0,X.jsx)(`button`,{onClick:()=>void fe(),disabled:U,className:`flex h-[44px] w-[44px] items-center justify-center rounded-sm text-text-muted hover:bg-surface-elevated hover:text-text focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent disabled:opacity-40 md:h-7 md:w-7`,"aria-label":`Refresh providers`,title:`Refresh`,children:(0,X.jsx)(w,{className:`h-3.5 w-3.5 ${U?`animate-spin`:``}`})})]}),(0,X.jsx)(`div`,{className:`py-5`,children:k||_?(0,X.jsxs)(`div`,{className:`space-y-6`,children:[(0,X.jsx)(ot,{}),(0,X.jsx)(ot,{})]}):V.length>0?(0,X.jsx)(`div`,{className:`divide-y divide-border-soft`,children:V.map((e,t)=>(0,X.jsx)(`div`,{className:t===0?`pb-4`:`py-4 last:pb-1`,children:(0,X.jsx)(n,{contextLimit:M?.providers.find(t=>t.provider===e.provider),contextLimitError:c?.provider===e.provider?c.message:void 0,contextLimitSaving:o===e.provider,expanded:!!i[e.provider],globallyLocked:g?.upgradeLocked,management:e,now:P,onApply:()=>R(e),onCopyCommand:()=>{e.manualCommand&&navigator.clipboard.writeText(e.manualCommand)},onToggleExpanded:()=>pe(e.provider),usages:z.get(e.provider)??[],onContextLimitChange:t=>{let n=M?.providers.find(t=>t.provider===e.provider);n&&me(n,t)},runtimeCommand:ae?.providers.find(t=>t.provider===e.provider)??{args:[],command:null,defaultCommand:_e(e.provider)?.command??e.provider,provider:e.provider},runtimeCommandError:m?.provider===e.provider?m.message:void 0,runtimeCommandSaving:d===e.provider,onRuntimeCommandSave:(t,n)=>{I(e.provider,t,n)},login:y?.providers.find(t=>t.provider===e.provider),loginBusy:C===e.provider,loginError:E?.provider===e.provider?E.message:void 0,onLoginStart:t=>{L(e.provider,t)},onLoginCancel:()=>{L(e.provider,`cancel`)}})},e.provider))}):(0,X.jsx)(`p`,{className:`font-serif italic text-[13px] text-text-subtle`,children:`No provider CLIs found.`})}),r]})}var dt=10,ft=`Past 52 weeks`;function pt(){let n=xe(),l=a(),{data:u,isLoading:d,isError:f}=B({queryKey:j.tokenUsage(l.from,l.through,l.timezone),queryFn:()=>s(l),refetchInterval:3e4}),p=r(u?.agents.map(e=>e.days)??[]),h=_t(u?.agents.map(e=>e.coverageStartedAt)??[]),g=t(p),_=mt(u?.agents??[]).slice(0,dt),v=u?.totalTokens??0;return(0,X.jsxs)(`div`,{className:`pt-2`,children:[d&&(0,X.jsx)(`div`,{className:`h-64 animate-pulse rounded-sm bg-surface-elevated`}),f&&(0,X.jsx)(`p`,{className:`font-serif text-[14px] text-text-muted`,children:`Token usage is unavailable right now.`}),u&&(0,X.jsxs)(`div`,{className:`space-y-8`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-end gap-x-14 gap-y-5`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`div`,{className:`font-serif text-[40px] leading-none tabular-nums text-text`,children:J(v)}),(0,X.jsx)(`div`,{className:`mt-1.5 font-sans text-[10px] uppercase tracking-[0.13em] text-text-subtle`,children:ft})]}),g&&(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`div`,{className:`font-serif text-[26px] leading-none tabular-nums text-text-muted`,children:J(g.totalTokens)}),(0,X.jsxs)(`div`,{className:`mt-1.5 font-sans text-[10px] uppercase tracking-[0.13em] text-text-subtle`,children:[`Busiest day · `,o(g.date)]})]})]}),(0,X.jsx)(`div`,{className:`pb-3`,children:(0,X.jsx)(i,{coverageStartedAt:h,days:p,from:l.from,through:l.through})}),(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`div`,{className:`mb-1 border-b border-border-soft pb-2 font-sans text-[10px] uppercase tracking-[0.13em] text-text-muted`,children:`Top agents`}),(0,X.jsx)(`div`,{className:`divide-y divide-border-soft`,children:_.map((r,i)=>{let a=v>0?r.totalTokens/v*100:0,o=t(r.days);return(0,X.jsxs)(`button`,{type:`button`,onClick:()=>{n(`/agents/${encodeURIComponent(r.agentId)}/profile`)},className:`group grid w-full items-center gap-x-4 gap-y-2 py-3.5 text-left hover:bg-surface-elevated/40 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-accent md:grid-cols-[minmax(150px,0.5fr)_1fr_112px_16px] md:px-1`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,X.jsx)(`span`,{className:`w-[12px] shrink-0 text-right font-mono text-[10px] tabular-nums text-text-subtle`,children:i+1}),r.avatarUrl?(0,X.jsx)(`img`,{src:r.avatarUrl,alt:``,className:`h-7 w-7 shrink-0 rounded-lg object-cover ring-1 ring-border-soft`}):(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-lg font-sans text-[10px] font-bold text-white`,style:{background:m(i)},children:ye(r.agentName)}),(0,X.jsx)(`span`,{className:`truncate font-serif text-[15px] leading-tight text-text`,children:r.agentName})]}),(0,X.jsx)(`div`,{className:`h-[7px] w-full overflow-hidden rounded-full`,style:{background:c[0]},"aria-hidden":!0,children:(0,X.jsx)(`div`,{className:`h-full rounded-full`,style:{background:c[4],width:gt(a)}})}),(0,X.jsxs)(`div`,{className:`md:text-right`,children:[(0,X.jsx)(`div`,{className:`font-mono text-[13px] tabular-nums text-text`,children:J(r.totalTokens)}),(0,X.jsxs)(`div`,{className:`mt-0.5 font-mono text-[9px] tabular-nums text-text-subtle`,children:[ht(a),`%`,o?` · peak ${J(o.totalTokens)}`:``]})]}),(0,X.jsx)(e,{className:`hidden h-3.5 w-3.5 text-text-subtle transition-transform group-hover:translate-x-0.5 group-hover:text-text md:block`})]},r.agentId)})})]})]})]})}function mt(e){return[...e].sort((e,t)=>t.totalTokens-e.totalTokens||e.agentName.localeCompare(t.agentName))}function ht(e){return e<1?e.toFixed(1):e.toFixed(0)}function gt(e){return e<=0?`0%`:`${Math.max(1,e)}%`}function _t(e){if(!(e.length===0||e.some(e=>!e)))return e.sort().at(-1)}async function vt(){return(await W(`/api/do-not-contact`)).workspaces}function yt(e){return W(`/api/do-not-contact/${encodeURIComponent(e)}/users`)}function bt(e,t,n){return W(`/api/do-not-contact/${encodeURIComponent(e)}/members`,fe(n===`add`?`POST`:`DELETE`,{userId:t}))}var xt=[`do-not-contact`],Q=`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent`,St=`inline-flex min-h-[44px] items-center gap-1.5 rounded-sm border border-border-soft bg-surface px-3 text-[12px] text-text hover:bg-surface-elevated disabled:cursor-not-allowed disabled:opacity-50 md:min-h-[32px] ${Q}`,Ct=`flex min-h-[44px] min-w-[44px] shrink-0 items-center justify-center rounded-[3px] text-text-subtle opacity-0 transition-opacity hover:bg-surface-raised hover:text-text focus-visible:opacity-100 disabled:cursor-not-allowed md:min-h-7 md:min-w-7 [@media(hover:none)]:opacity-100 ${Q}`,wt=`${Ct} group-hover/ws:opacity-100 group-focus-within/ws:opacity-100 disabled:group-hover/ws:opacity-40 disabled:[@media(hover:none)]:opacity-40`,Tt=`${Ct} group-hover/row:opacity-100 group-focus-within/row:opacity-100`;function Et(){let e=B({queryKey:xt,queryFn:vt,retry:!1}),t=e.data??[];return(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`p`,{className:`text-[13px] leading-relaxed text-text`,children:[`Agents will not DM or @mention the people listed here. Incoming messages and ordinary channel posts are unaffected.`,(0,X.jsx)(`span`,{className:`mt-1.5 block text-[11px] leading-relaxed text-text-subtle`,children:`Applies to every agent in this Anima instance, per Slack workspace. Changes take effect immediately.`})]}),e.isPending&&(0,X.jsx)(`p`,{role:`status`,className:`mt-6 border-t border-border-strong pt-4 text-[12px] text-text-muted`,children:`Loading list…`}),e.isError&&(0,X.jsxs)(`div`,{role:`alert`,className:`mt-6 flex flex-wrap items-center gap-x-3 gap-y-2 border-l-2 border-health-error pl-3 text-[12px] leading-relaxed text-health-error`,children:[(0,X.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Could not load the do-not-contact list. Existing restrictions have not been changed.`}),(0,X.jsx)(`button`,{type:`button`,className:St,onClick:()=>void e.refetch(),children:`Retry`})]}),!e.isPending&&!e.isError&&t.length===0&&(0,X.jsx)(`p`,{className:`mt-6 border-t border-border-strong pt-4 text-[12px] text-text-muted`,children:`Connect an agent to Slack to manage a workspace’s list.`}),!e.isError&&t.length>0&&(0,X.jsx)(`div`,{className:`mt-6 border-t border-border-strong`,children:t.map(e=>(0,X.jsx)(Dt,{workspace:e},e.id))})]})}function Dt({workspace:e}){let t=N(),n=B({queryKey:[`contact-directory`,e.id],queryFn:()=>yt(e.id),enabled:e.canLookup,retry:!1,staleTime:6e4}),[r,i]=(0,Y.useState)(!1),[a,o]=(0,Y.useState)(``),[s,c]=(0,Y.useState)(``),[l,d]=(0,Y.useState)(null),f=M({mutationFn:({action:t,user:n})=>bt(e.id,n.slackUserId,t),onSuccess:async(e,n)=>{c(n.action===`add`?`Added. Restriction is active.`:`Removed. Restriction lifted.`),d(null),o(``),await t.invalidateQueries({queryKey:xt})}}),p=n.data?.users??[],m=e.memberIds.map(e=>{let t=p.find(t=>t.slackUserId===e);return t?{user:t,resolved:!0}:{user:{slackUserId:e,displayName:e},resolved:!1}}),h=p.filter(t=>!e.memberIds.includes(t.slackUserId)),g=a.trim().toLocaleLowerCase().replace(/^@/,``),_=h.filter(e=>`${e.displayName} ${e.handle??``} ${e.slackUserId}`.toLocaleLowerCase().includes(g)),v=e.canLookup&&n.isSuccess&&!n.isError,y=m.length,b=n.isSuccess?`Not found in the Slack directory · still restricted`:`Saved ID · still restricted`;function x(e,t){f.reset(),c(``),d({action:e,user:t})}return(0,X.jsxs)(`section`,{"aria-labelledby":`ws-${e.id}`,className:`group/ws border-b border-border-soft py-4 last:border-b-0`,children:[(0,X.jsxs)(`div`,{className:`flex min-h-7 items-center gap-2`,children:[(0,X.jsx)(`h2`,{id:`ws-${e.id}`,className:`min-w-0 truncate text-[13px] font-semibold text-text`,children:e.name}),(0,X.jsxs)(`span`,{className:`ml-auto shrink-0 text-[11px] text-text-subtle`,children:[y,` `,y===1?`person`:`people`]}),(0,X.jsx)(`button`,{type:`button`,className:`${wt} -mr-2 md:-mr-1.5 ${r?`opacity-100`:``}`,disabled:!e.canLookup,"aria-expanded":r,"aria-label":r?`Close search in ${e.name}`:`Add a person to ${e.name}`,title:r?`Close search`:`Add a person`,onClick:()=>{i(!r),o(``)},children:r?(0,X.jsx)(S,{"aria-hidden":!0,className:`h-3.5 w-3.5`}):(0,X.jsx)(C,{"aria-hidden":!0,className:`h-3.5 w-3.5`})})]}),!e.canLookup&&(0,X.jsx)(`p`,{role:`status`,className:`mt-2 border-l-2 border-border-strong pl-3 text-[12px] leading-relaxed text-text-muted`,children:`No Slack connection is available for this workspace. Saved IDs remain restricted.`}),n.isError&&(0,X.jsxs)(`div`,{role:`alert`,className:`mt-2 flex flex-wrap items-center gap-x-3 gap-y-2 border-l-2 border-health-error pl-3 text-[12px] leading-relaxed text-health-error`,children:[(0,X.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Slack directory unavailable. Saved IDs remain restricted.`}),(0,X.jsx)(`button`,{type:`button`,className:St,onClick:()=>void n.refetch(),children:`Retry lookup`})]}),r&&(0,X.jsxs)(`div`,{className:`mt-2 rounded-sm border border-border-soft bg-surface-elevated`,children:[(0,X.jsxs)(`label`,{className:`relative block`,children:[(0,X.jsx)(u,{"aria-hidden":!0,className:`pointer-events-none absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-text-subtle`}),(0,X.jsx)(`input`,{"aria-label":`Search Slack members in ${e.name}`,className:`min-h-[44px] w-full min-w-0 border-b border-border-soft bg-transparent pl-9 pr-3 text-[13px] text-text placeholder:text-text-subtle md:min-h-[36px] ${Q}`,placeholder:`Name or @username`,autoFocus:!0,value:a,onChange:e=>o(e.target.value)})]}),n.isPending&&e.canLookup&&(0,X.jsx)(`p`,{role:`status`,className:`px-3 py-3 text-[12px] text-text-muted`,children:`Loading Slack members…`}),v&&(0,X.jsxs)(`ul`,{"aria-label":`Slack search results · ${e.name}`,className:`max-h-60 divide-y divide-border-soft overflow-y-auto`,children:[_.slice(0,50).map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,className:`group flex min-h-[44px] w-full items-center gap-3 px-3 py-1.5 text-left hover:bg-surface md:min-h-[40px] ${Q}`,onClick:()=>x(`add`,e),children:[(0,X.jsx)(Ot,{user:e}),(0,X.jsxs)(`span`,{className:`ml-auto inline-flex shrink-0 items-center gap-1 text-[11px] text-text-subtle group-hover:text-accent`,children:[(0,X.jsx)(C,{"aria-hidden":!0,className:`h-3 w-3`}),` Add`]})]})},e.slackUserId)),_.length===0&&(0,X.jsx)(`li`,{className:`px-3 py-3 text-[12px] text-text-muted`,children:`No matching members.`}),_.length>50&&(0,X.jsx)(`li`,{className:`px-3 py-2 text-[11px] text-text-subtle`,children:`Keep typing to narrow the results.`})]})]}),m.length>0?(0,X.jsx)(`ul`,{"aria-label":`Do-not-contact members · ${e.name}`,className:`mt-1.5`,children:m.map(({user:e,resolved:t})=>(0,X.jsxs)(`li`,{className:`group/row flex items-center gap-2.5 border-t border-border-soft py-1.5`,children:[(0,X.jsx)(Ot,{user:e,unresolvedNote:t?void 0:b}),(0,X.jsx)(`button`,{type:`button`,"aria-label":`Remove ${e.displayName}`,title:`Remove`,className:`${Tt} -mr-2 ml-auto md:-mr-1.5`,onClick:()=>x(`remove`,e),children:(0,X.jsx)(S,{"aria-hidden":!0,className:`h-3 w-3`})})]},e.slackUserId))}):(0,X.jsx)(`p`,{className:`mt-1.5 border-t border-border-soft pb-1 pt-2.5 text-[12px] text-text-subtle`,children:`No one listed. Agents may contact anyone in this workspace.`}),s&&(0,X.jsxs)(`p`,{role:`status`,className:`mt-2 flex items-center gap-2 text-[12px] text-text-muted`,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`inline-block h-1.5 w-1.5 rounded-full bg-health-ok`}),s]}),(0,X.jsx)(ae,{open:l!==null,title:l?.action===`add`?`Add to do-not-contact list?`:`Remove from do-not-contact list?`,description:l&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`span`,{className:`mb-2 block font-medium`,children:[l.user.displayName,` `,(0,X.jsxs)(`span`,{className:`font-mono text-[11px]`,children:[`(`,l.user.slackUserId,`)`]})]}),l.action===`add`?`All agents in this Anima instance connected to ${e.name} will be restricted from contacting this person through Anima tools.`:`This lifts the restriction for all agents in this Anima instance connected to ${e.name}.`]}),variant:`warn`,confirmVariant:l?.action===`remove`?`destructive`:`default`,confirmLabel:l?.action===`add`?`Add member`:`Remove member`,busy:f.isPending,error:f.error?.message,onCancel:()=>{f.isPending||d(null)},onConfirm:()=>{l&&!f.isPending&&f.mutate(l)}})]})}function Ot({user:e,unresolvedNote:t}){let n=t!==void 0;return(0,X.jsxs)(X.Fragment,{children:[e.avatarUrl?(0,X.jsx)(`img`,{src:e.avatarUrl,alt:``,className:`h-7 w-7 shrink-0 rounded-[3px] object-cover ring-1 ring-border-soft`}):(0,X.jsx)(`span`,{"aria-hidden":!0,className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-[3px] ring-1 ring-border-soft ${n?`bg-surface font-mono text-[10px] text-text-subtle`:`bg-surface-elevated text-[12px] font-semibold text-text-muted`}`,children:n?`?`:e.displayName.trim().slice(0,1).toLocaleUpperCase()}),(0,X.jsx)(`span`,{className:`min-w-0 leading-tight`,children:n?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`block truncate font-mono text-[12px] text-text`,children:e.slackUserId}),(0,X.jsx)(`span`,{className:`block truncate text-[11px] text-text-subtle`,children:t})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`block truncate text-[13px] text-text`,children:e.displayName}),(0,X.jsxs)(`span`,{className:`block truncate text-[11px] text-text-subtle`,children:[e.handle&&(0,X.jsxs)(`span`,{className:`text-text-muted`,children:[`@`,e.handle]}),e.handle&&` · `,(0,X.jsx)(`span`,{className:`font-mono text-[10px]`,children:e.slackUserId})]})]})})]})}function kt(){let{status:e,phase:t,applyError:n,installFailure:r,runningNames:i,availableTarget:a,inProgressTarget:o,inProgress:s,requestUpgrade:c,performUpgrade:l,cancelConfirm:u}=We();if(!e)return null;let d=e.state===`available`&&!!a;if(!d&&!(t!==`idle`||r!==null||n!==null))return null;let f=d||t!==`idle`;return(0,X.jsxs)(`div`,{className:`border-t border-border-soft p-2`,children:[f&&(0,X.jsxs)(`button`,{type:`button`,onClick:c,disabled:s,"aria-label":s?`Updating Anima to ${o??a}`:`Update Anima, ${e.currentVersion} to ${a}`,title:s?void 0:`Install the update and restart`,className:[`flex min-h-[44px] w-full items-center gap-2.5 rounded-sm bg-surface px-2.5 py-1.5 text-left font-sans text-[12px] text-text ring-1 ring-border-soft transition-colors`,s?`cursor-wait`:`hover:bg-surface-raised hover:ring-border-strong`,`focus-visible:outline-none focus-visible:ring-accent`].join(` `),children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-accent text-white`,children:s?(0,X.jsx)(w,{className:`h-[11px] w-[11px] animate-spin`,strokeWidth:2.2}):(0,X.jsx)(G,{className:`h-[11px] w-[11px]`,strokeWidth:2.2})}),(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col leading-tight`,children:[(0,X.jsx)(`span`,{className:`truncate`,children:s?`Updating Anima…`:`Update Anima`}),!s&&a&&(0,X.jsxs)(`span`,{"aria-hidden":!0,className:`truncate font-mono text-[10px] text-text-subtle`,children:[jt(e.currentVersion),` → `,jt(a)]})]})]}),r&&t!==`applying`&&(0,X.jsx)(At,{currentVersion:e.currentVersion,error:r.error,rollback:r.rollback,onRetry:f?void 0:c}),n&&t!==`applying`&&(0,X.jsxs)(`div`,{role:`alert`,className:`mt-1.5 px-1 font-sans text-[11px] leading-snug text-health-error`,children:[(0,X.jsx)(`p`,{children:n}),!f&&(0,X.jsx)($,{onRetry:c})]}),t===`confirming`&&(0,X.jsx)(z,{kind:`upgrade`,runningNames:i,target:a??o??``,onCancel:u,onConfirm:()=>void l()}),t===`applying`&&(0,X.jsx)(K,{above:!0,title:`Installing ${o??a}…`,body:`Your current version keeps running while Anima installs and verifies the new one, then asks any working agents to pause before restart. The dashboard reloads automatically when it's back.`})]})}function At({currentVersion:e,error:t,rollback:n,onRetry:r}){return(0,X.jsxs)(`div`,{role:`alert`,className:`mt-1.5 rounded-sm border border-health-error/40 bg-health-error/[0.06] px-2 py-1.5 font-sans text-[11px] leading-snug text-text`,children:[(0,X.jsxs)(`div`,{className:`flex items-start gap-1.5`,children:[(0,X.jsx)(A,{"aria-hidden":!0,className:`mt-px h-3 w-3 shrink-0 text-health-error`}),n===`failed`?(0,X.jsx)(`span`,{children:`Update failed and rollback didn't complete. The runtime may need attention.`}):(0,X.jsxs)(`span`,{children:[`Update failed: still on `,(0,X.jsx)(`span`,{className:`font-mono text-[10px]`,children:e})]})]}),t&&(0,X.jsx)(`p`,{className:`mt-1 break-words font-mono text-[10px] leading-relaxed text-text-muted`,children:t}),r&&(0,X.jsx)($,{onRetry:r})]})}function $({onRetry:e}){return(0,X.jsxs)(`button`,{type:`button`,onClick:e,className:`mt-1.5 flex min-h-[44px] items-center gap-1.5 rounded-sm border border-border-soft px-2 py-0.5 text-[11px] md:min-h-[28px] text-text-muted transition-colors hover:text-text focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent`,children:[(0,X.jsx)(w,{"aria-hidden":!0,className:`h-3 w-3`}),`Try again`]})}function jt(e){return e.replace(/\.[0-9a-f]{7,}$/i,``)}var Mt={server:Ae,providers:ke,"token-usage":Oe,"outreach-limits":je},Nt={server:nt,providers:ut,"token-usage":pt,"outreach-limits":Et};function Pt(){let{page:e}=O(),t=se(),n=xe(),r=ge(),i=me(t.state);if(e!==void 0&&!T(e))return(0,X.jsx)(Ce,{to:g(),replace:!0,state:t.state});let a=T(e)?e:null;if(!r&&a===null)return(0,X.jsx)(Ce,{to:g(k),replace:!0,state:t.state});let o=()=>n(i),s=e=>n(g(e),{state:t.state});if(r)return a===null?(0,X.jsx)(zt,{onBack:o,onSelect:s}):(0,X.jsx)(Bt,{page:a,onBack:()=>n(g(),{state:t.state})});let c=a??`server`;return(0,X.jsxs)(`div`,{className:`flex h-dvh w-screen overflow-hidden bg-surface text-text`,children:[(0,X.jsxs)(`nav`,{"aria-label":`Settings`,className:`flex w-[256px] shrink-0 flex-col border-r border-border-soft bg-surface-elevated`,children:[(0,X.jsxs)(`div`,{className:`flex h-14 shrink-0 items-center gap-2 border-b border-border-soft px-4`,children:[(0,X.jsx)(Lt,{label:`Back`,onClick:o}),(0,X.jsx)(`span`,{className:`caps ml-auto text-text`,children:`Settings`})]}),(0,X.jsx)(`div`,{className:`flex-1 overflow-y-auto pb-2`,children:v.map(e=>(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`div`,{className:`px-4 pb-1 pt-4 font-sans text-[10px] uppercase tracking-[0.14em] text-text-subtle`,children:e.label}),(0,X.jsx)(`ul`,{className:`space-y-0.5 px-2`,children:e.pages.map(e=>{let t=Mt[e.id],n=e.id===c;return(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,onClick:()=>s(e.id),"aria-current":n?`page`:void 0,className:[`flex h-[34px] w-full items-center gap-2.5 rounded-sm px-2 text-left font-sans text-[13px] transition-colors`,n?`bg-surface text-text ring-1 ring-border-soft`:`text-text-muted hover:bg-surface-hover hover:text-text`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent`].join(` `),children:[(0,X.jsx)(t,{"aria-hidden":!0,className:`h-[13px] w-[13px] shrink-0`}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),(0,X.jsx)(It,{page:e.id})]})},e.id)})})]},e.label))}),(0,X.jsx)(kt,{})]}),(0,X.jsx)(`main`,{className:`min-w-0 flex-1 overflow-y-auto`,children:(0,X.jsx)(`div`,{className:`max-w-[680px] px-10 pb-12 pt-9`,children:(0,X.jsx)(Ft,{page:c})})})]})}function Ft({page:e,hideTitle:t=!1}){let n=Nt[e],r=(0,Y.useRef)(null);return(0,Y.useEffect)(()=>{t||r.current?.focus()},[e,t]),(0,X.jsxs)(U,{children:[!t&&(0,X.jsx)(`h1`,{ref:r,tabIndex:-1,className:`display mb-1.5 text-[24px] font-semibold tracking-[-0.01em] text-text focus-visible:outline-none`,children:f(e)}),(0,X.jsx)(n,{})]},e)}function It({page:e,mobile:t=!1}){let{data:n}=Ne(),r=Le(),i=n?.providers.some(e=>e.updateAvailable)??!1;return e===`providers`&&i||t&&e===`server`&&r?(0,X.jsx)(`span`,{className:`shrink-0 rounded-[2px] border border-accent px-1.5 py-px font-sans text-[10px] tracking-[0.04em] text-accent`,children:`Update`}):null}function Lt({label:e,onClick:t}){return(0,X.jsxs)(`button`,{type:`button`,onClick:t,className:`-ml-2 flex min-h-[44px] items-center gap-1 rounded-sm pl-1 pr-2 font-sans text-[12px] text-text-muted transition-colors hover:text-text focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent md:min-h-8`,children:[(0,X.jsx)(H,{"aria-hidden":!0,className:`h-4 w-4`}),(0,X.jsx)(`span`,{children:e})]})}function Rt({title:e,backLabel:t,onBack:n}){return(0,X.jsxs)(`div`,{className:`sticky top-0 z-10 grid h-[calc(3.5rem+env(safe-area-inset-top))] shrink-0 grid-cols-[1fr_auto_1fr] items-center border-b border-border-soft bg-surface px-3 pt-[env(safe-area-inset-top)]`,children:[(0,X.jsx)(`div`,{className:`flex justify-start`,children:(0,X.jsx)(Lt,{label:t,onClick:n})}),(0,X.jsx)(`span`,{className:`caps text-text`,children:e}),(0,X.jsx)(`span`,{"aria-hidden":!0})]})}function zt({onBack:e,onSelect:t}){return(0,X.jsxs)(`div`,{className:`flex h-dvh flex-col bg-surface text-text`,children:[(0,X.jsx)(Rt,{title:`Settings`,backLabel:`Back`,onBack:e}),(0,X.jsx)(`nav`,{"aria-label":`Settings`,className:`flex-1 overflow-y-auto pb-[env(safe-area-inset-bottom)]`,children:v.map(e=>(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`div`,{className:`px-4 pb-1.5 pt-[18px] font-sans text-[10px] uppercase tracking-[0.14em] text-text-subtle`,children:e.label}),(0,X.jsx)(`ul`,{className:`divide-y divide-border-soft border-y border-border-soft`,children:e.pages.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,onClick:()=>t(e.id),className:`flex min-h-12 w-full items-center gap-3 px-4 text-left font-sans text-[14px] text-text hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-accent`,children:[(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),(0,X.jsx)(It,{page:e.id,mobile:!0}),(0,X.jsx)(oe,{"aria-hidden":!0,className:`h-4 w-4 shrink-0 text-text-subtle`})]})},e.id))})]},e.label))})]})}function Bt({page:e,onBack:t}){return(0,X.jsxs)(`div`,{className:`flex h-dvh flex-col bg-surface text-text`,children:[(0,X.jsx)(Rt,{title:f(e),backLabel:`Settings`,onBack:t}),(0,X.jsx)(`main`,{className:`flex-1 overflow-y-auto px-4 pb-[calc(2rem+env(safe-area-inset-bottom))] pt-5`,children:(0,X.jsx)(Ft,{page:e,hideTitle:!0})})]})}export{Pt as default};