@harnspec/ui 0.0.1 → 0.0.3
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.
- package/bin/harnspec-ui.js +46 -29
- package/dist/assets/{ChatSettingsPage-JPXu3eH0.js → ChatSettingsPage-CHSjd3vp.js} +1 -1
- package/dist/assets/{ContextPage-BLFL7v_u.js → ContextPage-BaNHyJAS.js} +1 -1
- package/dist/assets/{DashboardPage-D-pA0AIe.js → DashboardPage-DCb6-5kD.js} +1 -1
- package/dist/assets/{DependenciesPage-DjavTkHz.js → DependenciesPage-DmcZ0HId.js} +1 -1
- package/dist/assets/{FilesPage-BxxpK9Bt.js → FilesPage-DZzXXnSe.js} +1 -1
- package/dist/assets/{SessionDetailPage-iEL9xj4a.js → SessionDetailPage-DpLwCjal.js} +1 -1
- package/dist/assets/{SessionsPage-CO68ICYO.js → SessionsPage-BKKyO4A_.js} +1 -1
- package/dist/assets/{SpecDetailPage-9MMpkW8X.js → SpecDetailPage-B0cx1uxg.js} +2 -2
- package/dist/assets/{SpecsPage-1nVMIoG9.js → SpecsPage-CF_GhEVh.js} +1 -1
- package/dist/assets/{StatsPage-BvmDcqy8.js → StatsPage-CHongCio.js} +1 -1
- package/dist/assets/{_baseUniq-BRyOJSQv.js → _baseUniq-BWXYSgg3.js} +1 -1
- package/dist/assets/{arc-ljNi3wsf.js → arc-DVUWV1Ux.js} +1 -1
- package/dist/assets/{architectureDiagram-VXUJARFQ-CAly0kzY.js → architectureDiagram-VXUJARFQ-DtTMloLc.js} +1 -1
- package/dist/assets/{blockDiagram-VD42YOAC-BOl04R0o.js → blockDiagram-VD42YOAC-5FgtpUfA.js} +1 -1
- package/dist/assets/{c4Diagram-YG6GDRKO-S5hXNTsJ.js → c4Diagram-YG6GDRKO-DL2TZvVA.js} +1 -1
- package/dist/assets/channel-DRaxx9t9.js +1 -0
- package/dist/assets/{chunk-4BX2VUAB-iNaFpgQz.js → chunk-4BX2VUAB-DuxW4ARi.js} +1 -1
- package/dist/assets/{chunk-55IACEB6-DqKEYEHN.js → chunk-55IACEB6-jI95g37A.js} +1 -1
- package/dist/assets/{chunk-B4BG7PRW-z9_0Jmwe.js → chunk-B4BG7PRW-DjnYS36d.js} +1 -1
- package/dist/assets/{chunk-DI55MBZ5-BX1YqnSd.js → chunk-DI55MBZ5-BKKp8oyH.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-CUWgtpIs.js → chunk-FMBD7UC4-Kf-ovOBd.js} +1 -1
- package/dist/assets/{chunk-QN33PNHL-kfBxkNBp.js → chunk-QN33PNHL-Ct8TKBeY.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-N9ia6yy2.js → chunk-QZHKN3VN-BmSaNL6k.js} +1 -1
- package/dist/assets/{chunk-TZMSLE5B-sKnpnnNJ.js → chunk-TZMSLE5B-DQvOFmy4.js} +1 -1
- package/dist/assets/classDiagram-2ON5EDUG-MuAiNNYp.js +1 -0
- package/dist/assets/classDiagram-v2-WZHVMYZB-MuAiNNYp.js +1 -0
- package/dist/assets/clone-C-DQbIm8.js +1 -0
- package/dist/assets/{code-block-37QAKDTI-DeQWV7FO.js → code-block-37QAKDTI-C5riIxE5.js} +1 -1
- package/dist/assets/{cose-bilkent-S5V4N54A-gY03429f.js → cose-bilkent-S5V4N54A-DhwtA41M.js} +1 -1
- package/dist/assets/{dagre-6UL2VRFP-DSANw7dB.js → dagre-6UL2VRFP-B4ns4hkv.js} +1 -1
- package/dist/assets/{diagram-PSM6KHXK-ButP3OXt.js → diagram-PSM6KHXK-C6vBYdLz.js} +1 -1
- package/dist/assets/{diagram-QEK2KX5R-B_kcqC9w.js → diagram-QEK2KX5R-D5hNzEvu.js} +1 -1
- package/dist/assets/{diagram-S2PKOQOG-CEZf1YN1.js → diagram-S2PKOQOG-B7hU4Vir.js} +1 -1
- package/dist/assets/{erDiagram-Q2GNP2WA-2_Q02Cxk.js → erDiagram-Q2GNP2WA-GT38PoiU.js} +1 -1
- package/dist/assets/{flowDiagram-NV44I4VS-zHYqmkyx.js → flowDiagram-NV44I4VS-CG1t4tHV.js} +1 -1
- package/dist/assets/{funnel-x-BS_Cfod-.js → funnel-x-DVbrqcHk.js} +1 -1
- package/dist/assets/{ganttDiagram-JELNMOA3-6Yspdlny.js → ganttDiagram-JELNMOA3-BXKmb-ii.js} +1 -1
- package/dist/assets/{gitGraphDiagram-NY62KEGX-B9FE0mj2.js → gitGraphDiagram-NY62KEGX-AzgnB9fT.js} +1 -1
- package/dist/assets/{graph-Dj86lVww.js → graph-dOzOTENu.js} +1 -1
- package/dist/assets/{index-Bo42UlS3.js → index-BlyOVhDj.js} +6 -6
- package/dist/assets/{info-CjwfpSMh.js → info-Cl-KzKzC.js} +1 -1
- package/dist/assets/{infoDiagram-WHAUD3N6-BGRk5inn.js → infoDiagram-WHAUD3N6-D0wkBIMn.js} +1 -1
- package/dist/assets/{journeyDiagram-XKPGCS4Q-DkLUAT8H.js → journeyDiagram-XKPGCS4Q-Cmxvw-CF.js} +1 -1
- package/dist/assets/{kanban-definition-3W4ZIXB7-Cz5Z2HI7.js → kanban-definition-3W4ZIXB7-YdVwldix.js} +1 -1
- package/dist/assets/{layout-CBJU43bb.js → layout--LdX6GN6.js} +1 -1
- package/dist/assets/{linear-DEceC7GR.js → linear-CcZ9lo23.js} +1 -1
- package/dist/assets/{min-C3REIl55.js → min-C_YM2Fvy.js} +1 -1
- package/dist/assets/{mindmap-definition-VGOIOE7T-DK-dKLTa.js → mindmap-definition-VGOIOE7T-Bo3LAno7.js} +1 -1
- package/dist/assets/{page-transition-BKC5kVS6.js → page-transition-DY_O2TfZ.js} +1 -1
- package/dist/assets/{pieDiagram-ADFJNKIX--hXf44AA.js → pieDiagram-ADFJNKIX-TY170q2q.js} +1 -1
- package/dist/assets/{quadrantDiagram-AYHSOK5B-BP4dBgbK.js → quadrantDiagram-AYHSOK5B-CaGT9oCS.js} +1 -1
- package/dist/assets/{refresh-ccw-CfzFVZ57.js → refresh-ccw-DZO2C09G.js} +1 -1
- package/dist/assets/{requirementDiagram-UZGBJVZJ-BjJP3Slm.js → requirementDiagram-UZGBJVZJ-cjPEHOn1.js} +1 -1
- package/dist/assets/{sankeyDiagram-TZEHDZUN-DSt3qjc-.js → sankeyDiagram-TZEHDZUN-C1jZ6BzB.js} +1 -1
- package/dist/assets/{sequenceDiagram-WL72ISMW-CLo7P2AR.js → sequenceDiagram-WL72ISMW-CfbBeFLR.js} +1 -1
- package/dist/assets/{session-mode-badge-BQaNgsJN.js → session-mode-badge-BAcHdIhX.js} +1 -1
- package/dist/assets/{stat-card-CZ-HGUBa.js → stat-card-BEjjOCD2.js} +1 -1
- package/dist/assets/{stateDiagram-FKZM4ZOC-D5NKNKls.js → stateDiagram-FKZM4ZOC-BHdZJa9R.js} +1 -1
- package/dist/assets/stateDiagram-v2-4FDKWEC3-CnXnQZrS.js +1 -0
- package/dist/assets/{table-of-contents-BiPY4Kr6.js → table-of-contents-Cnkk8UZa.js} +1 -1
- package/dist/assets/{time-B8z8CeFv.js → time-yYkNCeI6.js} +1 -1
- package/dist/assets/{timeline-definition-IT6M3QCI-BJI5Adg7.js → timeline-definition-IT6M3QCI-DbB6dLD9.js} +1 -1
- package/dist/assets/{treemap-KMMF4GRG-DzpCHjjP.js → treemap-KMMF4GRG-Cm_v04dc.js} +1 -1
- package/dist/assets/{trending-up-COWs9Nc7.js → trending-up-C8H38O_j.js} +1 -1
- package/dist/assets/{validation-badge-IPkKaNb8.js → validation-badge-Bg0rq4Tp.js} +1 -1
- package/dist/assets/{xychartDiagram-PRI3JC2R-CFAKvOPr.js → xychartDiagram-PRI3JC2R-DCoq2bZ7.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/channel-DTtYVPxU.js +0 -1
- package/dist/assets/classDiagram-2ON5EDUG-DEiSx8NZ.js +0 -1
- package/dist/assets/classDiagram-v2-WZHVMYZB-DEiSx8NZ.js +0 -1
- package/dist/assets/clone-B-FuuJTp.js +0 -1
- package/dist/assets/stateDiagram-v2-4FDKWEC3-oN7y0aok.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-CU67Zn6k.js","assets/html-GMplVEZG.js","assets/javascript-wDzz0qaB.js","assets/css-DPfMkruS.js","assets/angular-ts-BwZT4LLn.js","assets/scss-OYdSNvt2.js","assets/apl-dKokRX4l.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/json-Cp-IABpG.js","assets/astro-CbQHKStN.js","assets/typescript-BPQ3VLAy.js","assets/postcss-CXtECtnM.js","assets/tsx-COt5Ahok.js","assets/blade-D4QpJJKB.js","assets/html-derivative-BFtXZ54Q.js","assets/sql-BLtJtn59.js","assets/bsl-BO_Y6i37.js","assets/sdbl-DVxCFoDh.js","assets/cairo-KRGpt6FW.js","assets/python-B6aJPvgy.js","assets/cobol-nwyudZeR.js","assets/coffee-Ch7k5sss.js","assets/cpp-CofmeUqb.js","assets/regexp-CDVJQ6XC.js","assets/glsl-DplSGwfg.js","assets/c-BIGW1oBm.js","assets/crystal-tKQVLTB8.js","assets/shellscript-Yzrsuije.js","assets/edge-BkV0erSs.js","assets/elixir-CDX3lj18.js","assets/elm-DbKCFpqz.js","assets/erb-BOJIQeun.js","assets/ruby-BvKwtOVI.js","assets/haml-B8DHNrY2.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/lua-BbnMAYS6.js","assets/yaml-Buea-lGh.js","assets/erlang-DsQrWhSR.js","assets/markdown-Cvjx9yec.js","assets/fortran-fixed-form-CkoXwp7k.js","assets/fortran-free-form-BxgE0vQu.js","assets/fsharp-CXgrBDvD.js","assets/gdresource-B7Tvp0Sc.js","assets/gdshader-DkwncUOv.js","assets/gdscript-DTMYz4Jt.js","assets/git-commit-F4YmCXRG.js","assets/diff-D97Zzqfu.js","assets/git-rebase-r7XF79zn.js","assets/glimmer-js-Rg0-pVw9.js","assets/glimmer-ts-U6CK756n.js","assets/hack-CaT9iCJl.js","assets/handlebars-BL8al0AC.js","assets/http-jrhK8wxY.js","assets/hurl-irOxFIW8.js","assets/csv-fuZLfV_i.js","assets/hxml-Bvhsp5Yf.js","assets/haxe-CzTSHFRz.js","assets/jinja-4LBKfQ-Z.js","assets/jison-wvAkD_A8.js","assets/julia-CxzCAyBv.js","assets/r-Dspwwk_N.js","assets/latex-B4uzh10-.js","assets/tex-CvyZ59Mk.js","assets/liquid-DYVedYrR.js","assets/marko-DZsq8hO1.js","assets/less-B1dDrJ26.js","assets/mdc-DUICxH0z.js","assets/nginx-DknmC5AR.js","assets/nim-CVrawwO9.js","assets/perl-C0TMdlhV.js","assets/php-CDn_0X-4.js","assets/pug-CGlum2m_.js","assets/qml-3beO22l8.js","assets/razor-C1TweQQi.js","assets/csharp-K5feNrxe.js","assets/rst-B0xPkSld.js","assets/cmake-D1j8_8rp.js","assets/sas-cz2c8ADy.js","assets/shaderlab-Dg9Lc6iA.js","assets/hlsl-D3lLCCz7.js","assets/shellsession-BADoaaVG.js","assets/soy-Brmx7dQM.js","assets/sparql-rVzFXLq3.js","assets/turtle-BsS91CYL.js","assets/stata-BH5u7GGu.js","assets/svelte-zxCyuUbr.js","assets/templ-W15q3VgB.js","assets/go-Dn2_MT6a.js","assets/ts-tags-zn1MmPIZ.js","assets/twig-CO9l9SDP.js","assets/vue-DN_0RTcg.js","assets/vue-html-AaS7Mt5G.js","assets/vue-vine-CQOfvN7w.js","assets/stylus-BEDo0Tqx.js","assets/xsl-CtQFsRM5.js","assets/dagre-6UL2VRFP-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-CU67Zn6k.js","assets/html-GMplVEZG.js","assets/javascript-wDzz0qaB.js","assets/css-DPfMkruS.js","assets/angular-ts-BwZT4LLn.js","assets/scss-OYdSNvt2.js","assets/apl-dKokRX4l.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/json-Cp-IABpG.js","assets/astro-CbQHKStN.js","assets/typescript-BPQ3VLAy.js","assets/postcss-CXtECtnM.js","assets/tsx-COt5Ahok.js","assets/blade-D4QpJJKB.js","assets/html-derivative-BFtXZ54Q.js","assets/sql-BLtJtn59.js","assets/bsl-BO_Y6i37.js","assets/sdbl-DVxCFoDh.js","assets/cairo-KRGpt6FW.js","assets/python-B6aJPvgy.js","assets/cobol-nwyudZeR.js","assets/coffee-Ch7k5sss.js","assets/cpp-CofmeUqb.js","assets/regexp-CDVJQ6XC.js","assets/glsl-DplSGwfg.js","assets/c-BIGW1oBm.js","assets/crystal-tKQVLTB8.js","assets/shellscript-Yzrsuije.js","assets/edge-BkV0erSs.js","assets/elixir-CDX3lj18.js","assets/elm-DbKCFpqz.js","assets/erb-BOJIQeun.js","assets/ruby-BvKwtOVI.js","assets/haml-B8DHNrY2.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/lua-BbnMAYS6.js","assets/yaml-Buea-lGh.js","assets/erlang-DsQrWhSR.js","assets/markdown-Cvjx9yec.js","assets/fortran-fixed-form-CkoXwp7k.js","assets/fortran-free-form-BxgE0vQu.js","assets/fsharp-CXgrBDvD.js","assets/gdresource-B7Tvp0Sc.js","assets/gdshader-DkwncUOv.js","assets/gdscript-DTMYz4Jt.js","assets/git-commit-F4YmCXRG.js","assets/diff-D97Zzqfu.js","assets/git-rebase-r7XF79zn.js","assets/glimmer-js-Rg0-pVw9.js","assets/glimmer-ts-U6CK756n.js","assets/hack-CaT9iCJl.js","assets/handlebars-BL8al0AC.js","assets/http-jrhK8wxY.js","assets/hurl-irOxFIW8.js","assets/csv-fuZLfV_i.js","assets/hxml-Bvhsp5Yf.js","assets/haxe-CzTSHFRz.js","assets/jinja-4LBKfQ-Z.js","assets/jison-wvAkD_A8.js","assets/julia-CxzCAyBv.js","assets/r-Dspwwk_N.js","assets/latex-B4uzh10-.js","assets/tex-CvyZ59Mk.js","assets/liquid-DYVedYrR.js","assets/marko-DZsq8hO1.js","assets/less-B1dDrJ26.js","assets/mdc-DUICxH0z.js","assets/nginx-DknmC5AR.js","assets/nim-CVrawwO9.js","assets/perl-C0TMdlhV.js","assets/php-CDn_0X-4.js","assets/pug-CGlum2m_.js","assets/qml-3beO22l8.js","assets/razor-C1TweQQi.js","assets/csharp-K5feNrxe.js","assets/rst-B0xPkSld.js","assets/cmake-D1j8_8rp.js","assets/sas-cz2c8ADy.js","assets/shaderlab-Dg9Lc6iA.js","assets/hlsl-D3lLCCz7.js","assets/shellsession-BADoaaVG.js","assets/soy-Brmx7dQM.js","assets/sparql-rVzFXLq3.js","assets/turtle-BsS91CYL.js","assets/stata-BH5u7GGu.js","assets/svelte-zxCyuUbr.js","assets/templ-W15q3VgB.js","assets/go-Dn2_MT6a.js","assets/ts-tags-zn1MmPIZ.js","assets/twig-CO9l9SDP.js","assets/vue-DN_0RTcg.js","assets/vue-html-AaS7Mt5G.js","assets/vue-vine-CQOfvN7w.js","assets/stylus-BEDo0Tqx.js","assets/xsl-CtQFsRM5.js","assets/dagre-6UL2VRFP-B4ns4hkv.js","assets/graph-dOzOTENu.js","assets/_baseUniq-BWXYSgg3.js","assets/layout--LdX6GN6.js","assets/min-C_YM2Fvy.js","assets/clone-C-DQbIm8.js","assets/cose-bilkent-S5V4N54A-DhwtA41M.js","assets/cytoscape.esm-Boq4YasU.js","assets/c4Diagram-YG6GDRKO-DL2TZvVA.js","assets/chunk-TZMSLE5B-DQvOFmy4.js","assets/flowDiagram-NV44I4VS-CG1t4tHV.js","assets/chunk-FMBD7UC4-Kf-ovOBd.js","assets/chunk-55IACEB6-jI95g37A.js","assets/chunk-QN33PNHL-Ct8TKBeY.js","assets/channel-DRaxx9t9.js","assets/erDiagram-Q2GNP2WA-GT38PoiU.js","assets/gitGraphDiagram-NY62KEGX-AzgnB9fT.js","assets/chunk-4BX2VUAB-DuxW4ARi.js","assets/chunk-QZHKN3VN-BmSaNL6k.js","assets/treemap-KMMF4GRG-Cm_v04dc.js","assets/ganttDiagram-JELNMOA3-BXKmb-ii.js","assets/time-yYkNCeI6.js","assets/linear-CcZ9lo23.js","assets/init-Dmth1JHB.js","assets/defaultLocale-C4B-KCzX.js","assets/infoDiagram-WHAUD3N6-D0wkBIMn.js","assets/pieDiagram-ADFJNKIX-TY170q2q.js","assets/arc-DVUWV1Ux.js","assets/ordinal-DILIJJjt.js","assets/quadrantDiagram-AYHSOK5B-CaGT9oCS.js","assets/xychartDiagram-PRI3JC2R-DCoq2bZ7.js","assets/band-CquvqAHh.js","assets/requirementDiagram-UZGBJVZJ-cjPEHOn1.js","assets/sequenceDiagram-WL72ISMW-CfbBeFLR.js","assets/classDiagram-2ON5EDUG-MuAiNNYp.js","assets/chunk-B4BG7PRW-DjnYS36d.js","assets/classDiagram-v2-WZHVMYZB-MuAiNNYp.js","assets/stateDiagram-FKZM4ZOC-BHdZJa9R.js","assets/chunk-DI55MBZ5-BKKp8oyH.js","assets/stateDiagram-v2-4FDKWEC3-CnXnQZrS.js","assets/journeyDiagram-XKPGCS4Q-Cmxvw-CF.js","assets/timeline-definition-IT6M3QCI-DbB6dLD9.js","assets/mindmap-definition-VGOIOE7T-Bo3LAno7.js","assets/kanban-definition-3W4ZIXB7-YdVwldix.js","assets/sankeyDiagram-TZEHDZUN-C1jZ6BzB.js","assets/diagram-S2PKOQOG-B7hU4Vir.js","assets/diagram-QEK2KX5R-D5hNzEvu.js","assets/blockDiagram-VD42YOAC-5FgtpUfA.js","assets/architectureDiagram-VXUJARFQ-DtTMloLc.js","assets/diagram-PSM6KHXK-C6vBYdLz.js","assets/ContextPage-BaNHyJAS.js","assets/table-of-contents-Cnkk8UZa.js","assets/info-Cl-KzKzC.js","assets/DashboardPage-DCb6-5kD.js","assets/stat-card-BEjjOCD2.js","assets/trending-up-C8H38O_j.js","assets/FilesPage-DZzXXnSe.js","assets/FilesPage-BOzy0zBy.css","assets/SessionDetailPage-DpLwCjal.js","assets/page-transition-DY_O2TfZ.js","assets/session-mode-badge-BAcHdIhX.js","assets/SessionsPage-BKKyO4A_.js","assets/funnel-x-DVbrqcHk.js","assets/refresh-ccw-DZO2C09G.js","assets/SpecDetailPage-B0cx1uxg.js","assets/validation-badge-Bg0rq4Tp.js","assets/token-utils-x_d_uTQu.js","assets/SpecDetailPage-BmnaB44z.css","assets/SpecsPage-CF_GhEVh.js","assets/StatsPage-CHongCio.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var $Te=Object.defineProperty;var BV=e=>{throw TypeError(e)};var zTe=(e,t,n)=>t in e?$Te(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Fe=(e,t,n)=>zTe(e,typeof t!="symbol"?t+"":t,n),rD=(e,t,n)=>t.has(e)||BV("Cannot "+n);var Oe=(e,t,n)=>(rD(e,t,"read from private field"),n?n.call(e):t.get(e)),Fn=(e,t,n)=>t.has(e)?BV("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),nn=(e,t,n,r)=>(rD(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Rr=(e,t,n)=>(rD(e,t,"access private method"),n);var gT=(e,t,n,r)=>({set _(i){nn(e,t,i,n)},get _(){return Oe(e,t,r)}});function UTe(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function Td(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var iD={exports:{}},hx={};var jV;function HTe(){if(jV)return hx;jV=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,a){var s=null;if(a!==void 0&&(s=""+a),i.key!==void 0&&(s=""+i.key),"key"in i){a={};for(var o in i)o!=="key"&&(a[o]=i[o])}else a=i;return i=a.ref,{$$typeof:e,type:r,key:s,ref:i!==void 0?i:null,props:a}}return hx.Fragment=t,hx.jsx=n,hx.jsxs=n,hx}var $V;function VTe(){return $V||($V=1,iD.exports=HTe()),iD.exports}var g=VTe(),aD={exports:{}},vr={};var zV;function qTe(){if(zV)return vr;zV=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),s=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),u=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),f=Symbol.iterator;function p(ee){return ee===null||typeof ee!="object"?null:(ee=f&&ee[f]||ee["@@iterator"],typeof ee=="function"?ee:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,x={};function _(ee,re,$){this.props=ee,this.context=re,this.refs=x,this.updater=$||y}_.prototype.isReactComponent={},_.prototype.setState=function(ee,re){if(typeof ee!="object"&&typeof ee!="function"&&ee!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,ee,re,"setState")},_.prototype.forceUpdate=function(ee){this.updater.enqueueForceUpdate(this,ee,"forceUpdate")};function E(){}E.prototype=_.prototype;function w(ee,re,$){this.props=ee,this.context=re,this.refs=x,this.updater=$||y}var C=w.prototype=new E;C.constructor=w,b(C,_.prototype),C.isPureReactComponent=!0;var k=Array.isArray;function N(){}var R={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function j(ee,re,$){var se=$.ref;return{$$typeof:e,type:ee,key:re,ref:se!==void 0?se:null,props:$}}function B(ee,re){return j(ee.type,re,ee.props)}function F(ee){return typeof ee=="object"&&ee!==null&&ee.$$typeof===e}function q(ee){var re={"=":"=0",":":"=2"};return"$"+ee.replace(/[=:]/g,function($){return re[$]})}var Q=/\/+/g;function I(ee,re){return typeof ee=="object"&&ee!==null&&ee.key!=null?q(""+ee.key):re.toString(36)}function V(ee){switch(ee.status){case"fulfilled":return ee.value;case"rejected":throw ee.reason;default:switch(typeof ee.status=="string"?ee.then(N,N):(ee.status="pending",ee.then(function(re){ee.status==="pending"&&(ee.status="fulfilled",ee.value=re)},function(re){ee.status==="pending"&&(ee.status="rejected",ee.reason=re)})),ee.status){case"fulfilled":return ee.value;case"rejected":throw ee.reason}}throw ee}function z(ee,re,$,se,le){var he=typeof ee;(he==="undefined"||he==="boolean")&&(ee=null);var oe=!1;if(ee===null)oe=!0;else switch(he){case"bigint":case"string":case"number":oe=!0;break;case"object":switch(ee.$$typeof){case e:case t:oe=!0;break;case u:return oe=ee._init,z(oe(ee._payload),re,$,se,le)}}if(oe)return le=le(ee),oe=se===""?"."+I(ee,0):se,k(le)?($="",oe!=null&&($=oe.replace(Q,"$&/")+"/"),z(le,re,$,"",function(Ie){return Ie})):le!=null&&(F(le)&&(le=B(le,$+(le.key==null||ee&&ee.key===le.key?"":(""+le.key).replace(Q,"$&/")+"/")+oe)),re.push(le)),1;oe=0;var be=se===""?".":se+":";if(k(ee))for(var _e=0;_e<ee.length;_e++)se=ee[_e],he=be+I(se,_e),oe+=z(se,re,$,he,le);else if(_e=p(ee),typeof _e=="function")for(ee=_e.call(ee),_e=0;!(se=ee.next()).done;)se=se.value,he=be+I(se,_e++),oe+=z(se,re,$,he,le);else if(he==="object"){if(typeof ee.then=="function")return z(V(ee),re,$,se,le);throw re=String(ee),Error("Objects are not valid as a React child (found: "+(re==="[object Object]"?"object with keys {"+Object.keys(ee).join(", ")+"}":re)+"). If you meant to render a collection of children, use an array instead.")}return oe}function G(ee,re,$){if(ee==null)return ee;var se=[],le=0;return z(ee,se,"","",function(he){return re.call($,he,le++)}),se}function Y(ee){if(ee._status===-1){var re=ee._result;re=re(),re.then(function($){(ee._status===0||ee._status===-1)&&(ee._status=1,ee._result=$)},function($){(ee._status===0||ee._status===-1)&&(ee._status=2,ee._result=$)}),ee._status===-1&&(ee._status=0,ee._result=re)}if(ee._status===1)return ee._result.default;throw ee._result}var te=typeof reportError=="function"?reportError:function(ee){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var re=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof ee=="object"&&ee!==null&&typeof ee.message=="string"?String(ee.message):String(ee),error:ee});if(!window.dispatchEvent(re))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",ee);return}console.error(ee)},Z={map:G,forEach:function(ee,re,$){G(ee,function(){re.apply(this,arguments)},$)},count:function(ee){var re=0;return G(ee,function(){re++}),re},toArray:function(ee){return G(ee,function(re){return re})||[]},only:function(ee){if(!F(ee))throw Error("React.Children.only expected to receive a single React element child.");return ee}};return vr.Activity=d,vr.Children=Z,vr.Component=_,vr.Fragment=n,vr.Profiler=i,vr.PureComponent=w,vr.StrictMode=r,vr.Suspense=l,vr.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=R,vr.__COMPILER_RUNTIME={__proto__:null,c:function(ee){return R.H.useMemoCache(ee)}},vr.cache=function(ee){return function(){return ee.apply(null,arguments)}},vr.cacheSignal=function(){return null},vr.cloneElement=function(ee,re,$){if(ee==null)throw Error("The argument must be a React element, but you passed "+ee+".");var se=b({},ee.props),le=ee.key;if(re!=null)for(he in re.key!==void 0&&(le=""+re.key),re)!L.call(re,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&re.ref===void 0||(se[he]=re[he]);var he=arguments.length-2;if(he===1)se.children=$;else if(1<he){for(var oe=Array(he),be=0;be<he;be++)oe[be]=arguments[be+2];se.children=oe}return j(ee.type,le,se)},vr.createContext=function(ee){return ee={$$typeof:s,_currentValue:ee,_currentValue2:ee,_threadCount:0,Provider:null,Consumer:null},ee.Provider=ee,ee.Consumer={$$typeof:a,_context:ee},ee},vr.createElement=function(ee,re,$){var se,le={},he=null;if(re!=null)for(se in re.key!==void 0&&(he=""+re.key),re)L.call(re,se)&&se!=="key"&&se!=="__self"&&se!=="__source"&&(le[se]=re[se]);var oe=arguments.length-2;if(oe===1)le.children=$;else if(1<oe){for(var be=Array(oe),_e=0;_e<oe;_e++)be[_e]=arguments[_e+2];le.children=be}if(ee&&ee.defaultProps)for(se in oe=ee.defaultProps,oe)le[se]===void 0&&(le[se]=oe[se]);return j(ee,he,le)},vr.createRef=function(){return{current:null}},vr.forwardRef=function(ee){return{$$typeof:o,render:ee}},vr.isValidElement=F,vr.lazy=function(ee){return{$$typeof:u,_payload:{_status:-1,_result:ee},_init:Y}},vr.memo=function(ee,re){return{$$typeof:c,type:ee,compare:re===void 0?null:re}},vr.startTransition=function(ee){var re=R.T,$={};R.T=$;try{var se=ee(),le=R.S;le!==null&&le($,se),typeof se=="object"&&se!==null&&typeof se.then=="function"&&se.then(N,te)}catch(he){te(he)}finally{re!==null&&$.types!==null&&(re.types=$.types),R.T=re}},vr.unstable_useCacheRefresh=function(){return R.H.useCacheRefresh()},vr.use=function(ee){return R.H.use(ee)},vr.useActionState=function(ee,re,$){return R.H.useActionState(ee,re,$)},vr.useCallback=function(ee,re){return R.H.useCallback(ee,re)},vr.useContext=function(ee){return R.H.useContext(ee)},vr.useDebugValue=function(){},vr.useDeferredValue=function(ee,re){return R.H.useDeferredValue(ee,re)},vr.useEffect=function(ee,re){return R.H.useEffect(ee,re)},vr.useEffectEvent=function(ee){return R.H.useEffectEvent(ee)},vr.useId=function(){return R.H.useId()},vr.useImperativeHandle=function(ee,re,$){return R.H.useImperativeHandle(ee,re,$)},vr.useInsertionEffect=function(ee,re){return R.H.useInsertionEffect(ee,re)},vr.useLayoutEffect=function(ee,re){return R.H.useLayoutEffect(ee,re)},vr.useMemo=function(ee,re){return R.H.useMemo(ee,re)},vr.useOptimistic=function(ee,re){return R.H.useOptimistic(ee,re)},vr.useReducer=function(ee,re,$){return R.H.useReducer(ee,re,$)},vr.useRef=function(ee){return R.H.useRef(ee)},vr.useState=function(ee){return R.H.useState(ee)},vr.useSyncExternalStore=function(ee,re,$){return R.H.useSyncExternalStore(ee,re,$)},vr.useTransition=function(){return R.H.useTransition()},vr.version="19.2.3",vr}var UV;function ig(){return UV||(UV=1,aD.exports=qTe()),aD.exports}var S=ig();const et=Td(S),T4=UTe({__proto__:null,default:et},[S]);var sD={exports:{}},fx={},oD={exports:{}},lD={};var HV;function GTe(){return HV||(HV=1,(function(e){function t(z,G){var Y=z.length;z.push(G);e:for(;0<Y;){var te=Y-1>>>1,Z=z[te];if(0<i(Z,G))z[te]=G,z[Y]=Z,Y=te;else break e}}function n(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var G=z[0],Y=z.pop();if(Y!==G){z[0]=Y;e:for(var te=0,Z=z.length,ee=Z>>>1;te<ee;){var re=2*(te+1)-1,$=z[re],se=re+1,le=z[se];if(0>i($,Y))se<Z&&0>i(le,$)?(z[te]=le,z[se]=Y,te=se):(z[te]=$,z[re]=Y,te=re);else if(se<Z&&0>i(le,Y))z[te]=le,z[se]=Y,te=se;else break e}}return G}function i(z,G){var Y=z.sortIndex-G.sortIndex;return Y!==0?Y:z.id-G.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var s=Date,o=s.now();e.unstable_now=function(){return s.now()-o}}var l=[],c=[],u=1,d=null,f=3,p=!1,y=!1,b=!1,x=!1,_=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;function C(z){for(var G=n(c);G!==null;){if(G.callback===null)r(c);else if(G.startTime<=z)r(c),G.sortIndex=G.expirationTime,t(l,G);else break;G=n(c)}}function k(z){if(b=!1,C(z),!y)if(n(l)!==null)y=!0,N||(N=!0,q());else{var G=n(c);G!==null&&V(k,G.startTime-z)}}var N=!1,R=-1,L=5,j=-1;function B(){return x?!0:!(e.unstable_now()-j<L)}function F(){if(x=!1,N){var z=e.unstable_now();j=z;var G=!0;try{e:{y=!1,b&&(b=!1,E(R),R=-1),p=!0;var Y=f;try{t:{for(C(z),d=n(l);d!==null&&!(d.expirationTime>z&&B());){var te=d.callback;if(typeof te=="function"){d.callback=null,f=d.priorityLevel;var Z=te(d.expirationTime<=z);if(z=e.unstable_now(),typeof Z=="function"){d.callback=Z,C(z),G=!0;break t}d===n(l)&&r(l),C(z)}else r(l);d=n(l)}if(d!==null)G=!0;else{var ee=n(c);ee!==null&&V(k,ee.startTime-z),G=!1}}break e}finally{d=null,f=Y,p=!1}G=void 0}}finally{G?q():N=!1}}}var q;if(typeof w=="function")q=function(){w(F)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,I=Q.port2;Q.port1.onmessage=F,q=function(){I.postMessage(null)}}else q=function(){_(F,0)};function V(z,G){R=_(function(){z(e.unstable_now())},G)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(z){z.callback=null},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(z){switch(f){case 1:case 2:case 3:var G=3;break;default:G=f}var Y=f;f=G;try{return z()}finally{f=Y}},e.unstable_requestPaint=function(){x=!0},e.unstable_runWithPriority=function(z,G){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var Y=f;f=z;try{return G()}finally{f=Y}},e.unstable_scheduleCallback=function(z,G,Y){var te=e.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?te+Y:te):Y=te,z){case 1:var Z=-1;break;case 2:Z=250;break;case 5:Z=1073741823;break;case 4:Z=1e4;break;default:Z=5e3}return Z=Y+Z,z={id:u++,callback:G,priorityLevel:z,startTime:Y,expirationTime:Z,sortIndex:-1},Y>te?(z.sortIndex=Y,t(c,z),n(l)===null&&z===n(c)&&(b?(E(R),R=-1):b=!0,V(k,Y-te))):(z.sortIndex=Z,t(l,z),y||p||(y=!0,N||(N=!0,q()))),z},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(z){var G=f;return function(){var Y=f;f=G;try{return z.apply(this,arguments)}finally{f=Y}}}})(lD)),lD}var VV;function WTe(){return VV||(VV=1,oD.exports=GTe()),oD.exports}var cD={exports:{}},qs={};var qV;function YTe(){if(qV)return qs;qV=1;var e=ig();function t(l){var c="https://react.dev/errors/"+l;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)c+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+l+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function a(l,c,u){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:d==null?null:""+d,children:l,containerInfo:c,implementation:u}}var s=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(l,c){if(l==="font")return"";if(typeof c=="string")return c==="use-credentials"?c:""}return qs.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,qs.createPortal=function(l,c){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)throw Error(t(299));return a(l,c,null,u)},qs.flushSync=function(l){var c=s.T,u=r.p;try{if(s.T=null,r.p=2,l)return l()}finally{s.T=c,r.p=u,r.d.f()}},qs.preconnect=function(l,c){typeof l=="string"&&(c?(c=c.crossOrigin,c=typeof c=="string"?c==="use-credentials"?c:"":void 0):c=null,r.d.C(l,c))},qs.prefetchDNS=function(l){typeof l=="string"&&r.d.D(l)},qs.preinit=function(l,c){if(typeof l=="string"&&c&&typeof c.as=="string"){var u=c.as,d=o(u,c.crossOrigin),f=typeof c.integrity=="string"?c.integrity:void 0,p=typeof c.fetchPriority=="string"?c.fetchPriority:void 0;u==="style"?r.d.S(l,typeof c.precedence=="string"?c.precedence:void 0,{crossOrigin:d,integrity:f,fetchPriority:p}):u==="script"&&r.d.X(l,{crossOrigin:d,integrity:f,fetchPriority:p,nonce:typeof c.nonce=="string"?c.nonce:void 0})}},qs.preinitModule=function(l,c){if(typeof l=="string")if(typeof c=="object"&&c!==null){if(c.as==null||c.as==="script"){var u=o(c.as,c.crossOrigin);r.d.M(l,{crossOrigin:u,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0})}}else c==null&&r.d.M(l)},qs.preload=function(l,c){if(typeof l=="string"&&typeof c=="object"&&c!==null&&typeof c.as=="string"){var u=c.as,d=o(u,c.crossOrigin);r.d.L(l,u,{crossOrigin:d,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0,type:typeof c.type=="string"?c.type:void 0,fetchPriority:typeof c.fetchPriority=="string"?c.fetchPriority:void 0,referrerPolicy:typeof c.referrerPolicy=="string"?c.referrerPolicy:void 0,imageSrcSet:typeof c.imageSrcSet=="string"?c.imageSrcSet:void 0,imageSizes:typeof c.imageSizes=="string"?c.imageSizes:void 0,media:typeof c.media=="string"?c.media:void 0})}},qs.preloadModule=function(l,c){if(typeof l=="string")if(c){var u=o(c.as,c.crossOrigin);r.d.m(l,{as:typeof c.as=="string"&&c.as!=="script"?c.as:void 0,crossOrigin:u,integrity:typeof c.integrity=="string"?c.integrity:void 0})}else r.d.m(l)},qs.requestFormReset=function(l){r.d.r(l)},qs.unstable_batchedUpdates=function(l,c){return l(c)},qs.useFormState=function(l,c,u){return s.H.useFormState(l,c,u)},qs.useFormStatus=function(){return s.H.useHostTransitionStatus()},qs.version="19.2.3",qs}var GV;function $ne(){if(GV)return cD.exports;GV=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),cD.exports=YTe(),cD.exports}var WV;function KTe(){if(WV)return fx;WV=1;var e=WTe(),t=ig(),n=$ne();function r(h){var m="https://react.dev/errors/"+h;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)m+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+h+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(h){return!(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)}function a(h){var m=h,v=h;if(h.alternate)for(;m.return;)m=m.return;else{h=m;do m=h,(m.flags&4098)!==0&&(v=m.return),h=m.return;while(h)}return m.tag===3?v:null}function s(h){if(h.tag===13){var m=h.memoizedState;if(m===null&&(h=h.alternate,h!==null&&(m=h.memoizedState)),m!==null)return m.dehydrated}return null}function o(h){if(h.tag===31){var m=h.memoizedState;if(m===null&&(h=h.alternate,h!==null&&(m=h.memoizedState)),m!==null)return m.dehydrated}return null}function l(h){if(a(h)!==h)throw Error(r(188))}function c(h){var m=h.alternate;if(!m){if(m=a(h),m===null)throw Error(r(188));return m!==h?null:h}for(var v=h,T=m;;){var M=v.return;if(M===null)break;var P=M.alternate;if(P===null){if(T=M.return,T!==null){v=T;continue}break}if(M.child===P.child){for(P=M.child;P;){if(P===v)return l(M),h;if(P===T)return l(M),m;P=P.sibling}throw Error(r(188))}if(v.return!==T.return)v=M,T=P;else{for(var ae=!1,fe=M.child;fe;){if(fe===v){ae=!0,v=M,T=P;break}if(fe===T){ae=!0,T=M,v=P;break}fe=fe.sibling}if(!ae){for(fe=P.child;fe;){if(fe===v){ae=!0,v=P,T=M;break}if(fe===T){ae=!0,T=P,v=M;break}fe=fe.sibling}if(!ae)throw Error(r(189))}}if(v.alternate!==T)throw Error(r(190))}if(v.tag!==3)throw Error(r(188));return v.stateNode.current===v?h:m}function u(h){var m=h.tag;if(m===5||m===26||m===27||m===6)return h;for(h=h.child;h!==null;){if(m=u(h),m!==null)return m;h=h.sibling}return null}var d=Object.assign,f=Symbol.for("react.element"),p=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),w=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function q(h){return h===null||typeof h!="object"?null:(h=F&&h[F]||h["@@iterator"],typeof h=="function"?h:null)}var Q=Symbol.for("react.client.reference");function I(h){if(h==null)return null;if(typeof h=="function")return h.$$typeof===Q?null:h.displayName||h.name||null;if(typeof h=="string")return h;switch(h){case b:return"Fragment";case _:return"Profiler";case x:return"StrictMode";case k:return"Suspense";case N:return"SuspenseList";case j:return"Activity"}if(typeof h=="object")switch(h.$$typeof){case y:return"Portal";case w:return h.displayName||"Context";case E:return(h._context.displayName||"Context")+".Consumer";case C:var m=h.render;return h=h.displayName,h||(h=m.displayName||m.name||"",h=h!==""?"ForwardRef("+h+")":"ForwardRef"),h;case R:return m=h.displayName||null,m!==null?m:I(h.type)||"Memo";case L:m=h._payload,h=h._init;try{return I(h(m))}catch{}}return null}var V=Array.isArray,z=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},te=[],Z=-1;function ee(h){return{current:h}}function re(h){0>Z||(h.current=te[Z],te[Z]=null,Z--)}function $(h,m){Z++,te[Z]=h.current,h.current=m}var se=ee(null),le=ee(null),he=ee(null),oe=ee(null);function be(h,m){switch($(he,m),$(le,h),$(se,null),m.nodeType){case 9:case 11:h=(h=m.documentElement)&&(h=h.namespaceURI)?oV(h):0;break;default:if(h=m.tagName,m=m.namespaceURI)m=oV(m),h=lV(m,h);else switch(h){case"svg":h=1;break;case"math":h=2;break;default:h=0}}re(se),$(se,h)}function _e(){re(se),re(le),re(he)}function Ie(h){h.memoizedState!==null&&$(oe,h);var m=se.current,v=lV(m,h.type);m!==v&&($(le,h),$(se,v))}function Ue(h){le.current===h&&(re(se),re(le)),oe.current===h&&(re(oe),lx._currentValue=Y)}var Ce,Xe;function _t(h){if(Ce===void 0)try{throw Error()}catch(v){var m=v.stack.trim().match(/\n( *(at )?)/);Ce=m&&m[1]||"",Xe=-1<v.stack.indexOf(`
|
|
3
3
|
at`)?" (<anonymous>)":-1<v.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
4
|
`+Ce+h+Xe}var xt=!1;function Ct(h,m){if(!h||xt)return"";xt=!0;var v=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var T={DetermineComponentFrameRoot:function(){try{if(m){var bt=function(){throw Error()};if(Object.defineProperty(bt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(bt,[])}catch(st){var rt=st}Reflect.construct(h,[],bt)}else{try{bt.call()}catch(st){rt=st}h.call(bt.prototype)}}else{try{throw Error()}catch(st){rt=st}(bt=h())&&typeof bt.catch=="function"&&bt.catch(function(){})}}catch(st){if(st&&rt&&typeof st.stack=="string")return[st.stack,rt.stack]}return[null,null]}};T.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var M=Object.getOwnPropertyDescriptor(T.DetermineComponentFrameRoot,"name");M&&M.configurable&&Object.defineProperty(T.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var P=T.DetermineComponentFrameRoot(),ae=P[0],fe=P[1];if(ae&&fe){var Me=ae.split(`
|
|
@@ -1758,8 +1758,8 @@ Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error
|
|
|
1758
1758
|
node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const r=e.x,i=e.y,a=Math.abs(r-n.x),s=e.width/2;let o=n.x<t.x?s-a:s+a;const l=e.height/2,c=Math.abs(t.y-n.y),u=Math.abs(t.x-n.x);if(Math.abs(i-t.y)*s>Math.abs(r-t.x)*l){let d=n.y<t.y?t.y-l-i:i-l-t.y;o=u*d/c;const f={x:n.x<t.x?n.x+o:n.x-u+o,y:n.y<t.y?n.y+c-d:n.y-c+d};return o===0&&(f.x=t.x,f.y=t.y),u===0&&(f.x=t.x),c===0&&(f.y=t.y),vt.debug(`abc89 top/bottom calc, Q ${c}, q ${d}, R ${u}, r ${o}`,f),f}else{n.x<t.x?o=t.x-s-r:o=r-s-t.x;let d=c*o/u,f=n.x<t.x?n.x+u-o:n.x-u+o,p=n.y<t.y?n.y+d:n.y-d;return vt.debug(`sides calc abc89, Q ${c}, q ${d}, R ${u}, r ${o}`,{_x:f,_y:p}),o===0&&(f=t.x,p=t.y),u===0&&(f=t.x),c===0&&(p=t.y),{x:f,y:p}}},"intersection"),DZ=J((e,t)=>{vt.warn("abc88 cutPathAtIntersect",e,t);let n=[],r=e[0],i=!1;return e.forEach(a=>{if(vt.info("abc88 checking point",a,t),!vut(t,a)&&!i){const s=xut(t,r,a);vt.debug("abc88 inside",a,r,s),vt.debug("abc88 intersection",s,t);let o=!1;n.forEach(l=>{o=o||l.x===s.x&&l.y===s.y}),n.some(l=>l.x===s.x&&l.y===s.y)?vt.warn("abc88 no intersect",s,n):n.push(s),i=!0}else vt.warn("abc88 outside",a,r),r=a,i||n.push(a)}),vt.debug("returning points",n),n},"cutPathAtIntersect");function k1e(e){const t=[],n=[];for(let r=1;r<e.length-1;r++){const i=e[r-1],a=e[r],s=e[r+1];(i.x===a.x&&a.y===s.y&&Math.abs(a.x-s.x)>5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===s.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-s.y)>5)&&(t.push(a),n.push(r))}return{cornerPoints:t,cornerPointPositions:n}}J(k1e,"extractCornerPoints");var MZ=J(function(e,t,n){const r=t.x-e.x,i=t.y-e.y,a=Math.sqrt(r*r+i*i),s=n/a;return{x:t.x-s*r,y:t.y-s*i}},"findAdjacentPoint"),_ut=J(function(e){const{cornerPointPositions:t}=k1e(e),n=[];for(let r=0;r<e.length;r++)if(t.includes(r)){const i=e[r-1],a=e[r+1],s=e[r],o=MZ(i,s,5),l=MZ(a,s,5),c=l.x-o.x,u=l.y-o.y;n.push(o);const d=Math.sqrt(2)*2;let f={x:s.x,y:s.y};if(Math.abs(a.x-i.x)>10&&Math.abs(a.y-i.y)>=10){vt.debug("Corner point fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));const p=5;s.x===o.x?f={x:c<0?o.x-p+d:o.x+p-d,y:u<0?o.y-d:o.y+d}:f={x:c<0?o.x-d:o.x+d,y:u<0?o.y-p+d:o.y+p-d}}else vt.debug("Corner point skipping fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));n.push(f,l)}else n.push(e[r]);return n},"fixCorners"),Eut=J((e,t,n)=>{const r=e-t-n,i=2,a=2,s=i+a,o=Math.floor(r/s),l=Array(o).fill(`${i} ${a}`).join(" ");return`0 ${t} ${l} ${n}`},"generateDashArray"),wut=J(function(e,t,n,r,i,a,s,o=!1){var I;const{handDrawnSeed:l}=yi();let c=t.points,u=!1;const d=i;var f=a;const p=[];for(const V in t.cssCompiledStyles)a0e(V)||p.push(t.cssCompiledStyles[V]);vt.debug("UIO intersect check",t.points,f.x,d.x),f.intersect&&d.intersect&&!o&&(c=c.slice(1,t.points.length-1),c.unshift(d.intersect(c[0])),vt.debug("Last point UIO",t.start,"-->",t.end,c[c.length-1],f,f.intersect(c[c.length-1])),c.push(f.intersect(c[c.length-1])));const y=btoa(JSON.stringify(c));t.toCluster&&(vt.info("to cluster abc88",n.get(t.toCluster)),c=DZ(t.points,n.get(t.toCluster).node),u=!0),t.fromCluster&&(vt.debug("from cluster abc88",n.get(t.fromCluster),JSON.stringify(c,null,2)),c=DZ(c.reverse(),n.get(t.fromCluster).node).reverse(),u=!0);let b=c.filter(V=>!Number.isNaN(V.y));b=_ut(b);let x=FA;switch(x=b3,t.curve){case"linear":x=b3;break;case"basis":x=FA;break;case"cardinal":x=cpe;break;case"bumpX":x=ipe;break;case"bumpY":x=ape;break;case"catmullRom":x=dpe;break;case"monotoneX":x=ype;break;case"monotoneY":x=bpe;break;case"natural":x=xpe;break;case"step":x=_pe;break;case"stepAfter":x=wpe;break;case"stepBefore":x=Epe;break;default:x=FA}const{x:_,y:E}=_at(t),w=iit().x(_).y(E).curve(x);let C;switch(t.thickness){case"normal":C="edge-thickness-normal";break;case"thick":C="edge-thickness-thick";break;case"invisible":C="edge-thickness-invisible";break;default:C="edge-thickness-normal"}switch(t.pattern){case"solid":C+=" edge-pattern-solid";break;case"dotted":C+=" edge-pattern-dotted";break;case"dashed":C+=" edge-pattern-dashed";break;default:C+=" edge-pattern-solid"}let k,N=t.curve==="rounded"?N1e(R1e(b,t),5):w(b);const R=Array.isArray(t.style)?t.style:[t.style];let L=R.find(V=>V==null?void 0:V.startsWith("stroke:")),j=!1;if(t.look==="handDrawn"){const V=_n.svg(e);Object.assign([],b);const z=V.path(N,{roughness:.3,seed:l});C+=" transition",k=gr(z).select("path").attr("id",t.id).attr("class"," "+C+(t.classes?" "+t.classes:"")).attr("style",R?R.reduce((Y,te)=>Y+";"+te,""):"");let G=k.attr("d");k.attr("d",G),e.node().appendChild(k.node())}else{const V=p.join(";"),z=R?R.reduce(($,se)=>$+se+";",""):"";let G="";t.animate&&(G=" edge-animation-fast"),t.animation&&(G=" edge-animation-"+t.animation);const Y=(V?V+";"+z+";":z)+";"+(R?R.reduce(($,se)=>$+";"+se,""):"");k=e.append("path").attr("d",N).attr("id",t.id).attr("class"," "+C+(t.classes?" "+t.classes:"")+(G??"")).attr("style",Y),L=(I=Y.match(/stroke:([^;]+)/))==null?void 0:I[1],j=t.animate===!0||!!t.animation||V.includes("animation");const te=k.node(),Z=typeof te.getTotalLength=="function"?te.getTotalLength():0,ee=YK[t.arrowTypeStart]||0,re=YK[t.arrowTypeEnd]||0;if(t.look==="neo"&&!j){const se=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?Eut(Z,ee,re):`0 ${ee} ${Z-ee-re} ${re}`}; stroke-dashoffset: 0;`;k.attr("style",se+k.attr("style"))}}k.attr("data-edge",!0),k.attr("data-et","edge"),k.attr("data-id",t.id),k.attr("data-points",y),t.showPoints&&b.forEach(V=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",V.x).attr("cy",V.y)});let B="";(yi().flowchart.arrowMarkerAbsolute||yi().state.arrowMarkerAbsolute)&&(B=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,B=B.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),vt.info("arrowTypeStart",t.arrowTypeStart),vt.info("arrowTypeEnd",t.arrowTypeEnd),mut(k,t,B,s,r,L);const F=Math.floor(c.length/2),q=c[F];ru.isLabelCoordinateInPath(q,k.attr("d"))||(u=!0);let Q={};return u&&(Q.updatedPath=c),Q.originalPath=t.points,Q},"insertEdge");function N1e(e,t){if(e.length<2)return"";let n="";const r=e.length,i=1e-5;for(let a=0;a<r;a++){const s=e[a],o=e[a-1],l=e[a+1];if(a===0)n+=`M${s.x},${s.y}`;else if(a===r-1)n+=`L${s.x},${s.y}`;else{const c=s.x-o.x,u=s.y-o.y,d=l.x-s.x,f=l.y-s.y,p=Math.hypot(c,u),y=Math.hypot(d,f);if(p<i||y<i){n+=`L${s.x},${s.y}`;continue}const b=c/p,x=u/p,_=d/y,E=f/y,w=b*_+x*E,C=Math.max(-1,Math.min(1,w)),k=Math.acos(C);if(k<i||Math.abs(Math.PI-k)<i){n+=`L${s.x},${s.y}`;continue}const N=Math.min(t/Math.sin(k/2),p/2,y/2),R=s.x-b*N,L=s.y-x*N,j=s.x+_*N,B=s.y+E*N;n+=`L${R},${L}`,n+=`Q${s.x},${s.y} ${j},${B}`}}return n}J(N1e,"generateRoundedPath");function F7(e,t){if(!e||!t)return{angle:0,deltaX:0,deltaY:0};const n=t.x-e.x,r=t.y-e.y;return{angle:Math.atan2(r,n),deltaX:n,deltaY:r}}J(F7,"calculateDeltaAndAngle");function R1e(e,t){const n=e.map(i=>({...i}));if(e.length>=2&&Ks[t.arrowTypeStart]){const i=Ks[t.arrowTypeStart],a=e[0],s=e[1],{angle:o}=F7(a,s),l=i*Math.cos(o),c=i*Math.sin(o);n[0].x=a.x+l,n[0].y=a.y+c}const r=e.length;if(r>=2&&Ks[t.arrowTypeEnd]){const i=Ks[t.arrowTypeEnd],a=e[r-1],s=e[r-2],{angle:o}=F7(s,a),l=i*Math.cos(o),c=i*Math.sin(o);n[r-1].x=a.x-l,n[r-1].y=a.y-c}return n}J(R1e,"applyMarkerOffsetsToPoints");var Sut=J((e,t,n,r)=>{t.forEach(i=>{$ut[i](e,n,r)})},"insertMarkers"),Tut=J((e,t,n)=>{vt.trace("Making markers for ",n),e.append("defs").append("marker").attr("id",n+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",n+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),Cut=J((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",n+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),Aut=J((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",n+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),kut=J((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",n+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),Nut=J((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",n+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),Rut=J((e,t,n)=>{e.append("marker").attr("id",n+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",n+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),Dut=J((e,t,n)=>{e.append("marker").attr("id",n+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",n+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),Mut=J((e,t,n)=>{e.append("marker").attr("id",n+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",n+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),Iut=J((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),Lut=J((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),e.append("defs").append("marker").attr("id",n+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),Out=J((e,t,n)=>{const r=e.append("defs").append("marker").attr("id",n+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");r.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),r.append("path").attr("d","M9,0 L9,18");const i=e.append("defs").append("marker").attr("id",n+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),i.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),Put=J((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),e.append("defs").append("marker").attr("id",n+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),Fut=J((e,t,n)=>{const r=e.append("defs").append("marker").attr("id",n+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");r.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),r.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const i=e.append("defs").append("marker").attr("id",n+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),i.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),But=J((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0
|
|
1759
1759
|
L20,10
|
|
1760
1760
|
M20,10
|
|
1761
|
-
L0,20`)},"requirement_arrow"),jut=J((e,t,n)=>{const r=e.append("defs").append("marker").attr("id",n+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");r.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),r.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),r.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),$ut={extension:Tut,composition:Cut,aggregation:Aut,dependency:kut,lollipop:Nut,point:Rut,circle:Dut,cross:Mut,barb:Iut,only_one:Lut,zero_or_one:Out,one_or_more:Put,zero_or_more:Fut,requirement_arrow:But,requirement_contains:jut},zut=Sut,Uut={common:iv,getConfig:ro,insertCluster:Zct,insertEdge:wut,insertEdgeLabel:yut,insertMarkers:zut,insertNode:A1e,interpolateToCurve:Ej,labelHelper:ir,log:vt,positionEdgeLabel:but},_E={},D1e=J(e=>{for(const t of e)_E[t.name]=t},"registerLayoutLoaders"),Hut=J(()=>{D1e([{name:"dagre",loader:J(async()=>await me(()=>import("./dagre-6UL2VRFP-DSANw7dB.js"),__vite__mapDeps([97,98,99,100,101,102])),"loader")},{name:"cose-bilkent",loader:J(async()=>await me(()=>import("./cose-bilkent-S5V4N54A-gY03429f.js"),__vite__mapDeps([103,104])),"loader")}])},"registerDefaultLayoutLoaders");Hut();var JLt=J(async(e,t)=>{if(!(e.layoutAlgorithm in _E))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);const n=_E[e.layoutAlgorithm];return(await n.loader()).render(e,t,Uut,{algorithm:n.algorithm})},"render"),eOt=J((e="",{fallback:t="dagre"}={})=>{if(e in _E)return e;if(t in _E)return vt.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm"),M1e="comm",I1e="rule",L1e="decl",Vut="@import",qut="@namespace",Gut="@keyframes",Wut="@layer",O1e=Math.abs,Uj=String.fromCharCode;function P1e(e){return e.trim()}function UA(e,t,n){return e.replace(t,n)}function Yut(e,t,n){return e.indexOf(t,n)}function Fy(e,t){return e.charCodeAt(t)|0}function Rb(e,t,n){return e.slice(t,n)}function Zu(e){return e.length}function Kut(e){return e.length}function pC(e,t){return t.push(e),e}var _6=1,Db=1,F1e=0,Ac=0,Va=0,cv="";function Hj(e,t,n,r,i,a,s,o){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:_6,column:Db,length:s,return:"",siblings:o}}function Zut(){return Va}function Xut(){return Va=Ac>0?Fy(cv,--Ac):0,Db--,Va===10&&(Db=1,_6--),Va}function ou(){return Va=Ac<F1e?Fy(cv,Ac++):0,Db++,Va===10&&(Db=1,_6++),Va}function _p(){return Fy(cv,Ac)}function HA(){return Ac}function E6(e,t){return Rb(cv,e,t)}function EE(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Qut(e){return _6=Db=1,F1e=Zu(cv=e),Ac=0,[]}function Jut(e){return cv="",e}function qM(e){return P1e(E6(Ac-1,B7(e===91?e+2:e===40?e+1:e)))}function edt(e){for(;(Va=_p())&&Va<33;)ou();return EE(e)>2||EE(Va)>3?"":" "}function tdt(e,t){for(;--t&&ou()&&!(Va<48||Va>102||Va>57&&Va<65||Va>70&&Va<97););return E6(e,HA()+(t<6&&_p()==32&&ou()==32))}function B7(e){for(;ou();)switch(Va){case e:return Ac;case 34:case 39:e!==34&&e!==39&&B7(Va);break;case 40:e===41&&B7(e);break;case 92:ou();break}return Ac}function ndt(e,t){for(;ou()&&e+Va!==57;)if(e+Va===84&&_p()===47)break;return"/*"+E6(t,Ac-1)+"*"+Uj(e===47?e:ou())}function rdt(e){for(;!EE(_p());)ou();return E6(e,Ac)}function idt(e){return Jut(VA("",null,null,null,[""],e=Qut(e),0,[0],e))}function VA(e,t,n,r,i,a,s,o,l){for(var c=0,u=0,d=s,f=0,p=0,y=0,b=1,x=1,_=1,E=0,w="",C=i,k=a,N=r,R=w;x;)switch(y=E,E=ou()){case 40:if(y!=108&&Fy(R,d-1)==58){Yut(R+=UA(qM(E),"&","&\f"),"&\f",O1e(c?o[c-1]:0))!=-1&&(_=-1);break}case 34:case 39:case 91:R+=qM(E);break;case 9:case 10:case 13:case 32:R+=edt(y);break;case 92:R+=tdt(HA()-1,7);continue;case 47:switch(_p()){case 42:case 47:pC(adt(ndt(ou(),HA()),t,n,l),l),(EE(y||1)==5||EE(_p()||1)==5)&&Zu(R)&&Rb(R,-1,void 0)!==" "&&(R+=" ");break;default:R+="/"}break;case 123*b:o[c++]=Zu(R)*_;case 125*b:case 59:case 0:switch(E){case 0:case 125:x=0;case 59+u:_==-1&&(R=UA(R,/\f/g,"")),p>0&&(Zu(R)-d||b===0&&y===47)&&pC(p>32?LZ(R+";",r,n,d-1,l):LZ(UA(R," ","")+";",r,n,d-2,l),l);break;case 59:R+=";";default:if(pC(N=IZ(R,t,n,c,u,i,o,w,C=[],k=[],d,a),a),E===123)if(u===0)VA(R,t,N,N,C,a,d,o,k);else{switch(f){case 99:if(Fy(R,3)===110)break;case 108:if(Fy(R,2)===97)break;default:u=0;case 100:case 109:case 115:}u?VA(e,N,N,r&&pC(IZ(e,N,N,0,0,i,o,w,i,C=[],d,k),k),i,k,d,o,r?C:k):VA(R,N,N,N,[""],k,0,o,k)}}c=u=p=0,b=_=1,w=R="",d=s;break;case 58:d=1+Zu(R),p=y;default:if(b<1){if(E==123)--b;else if(E==125&&b++==0&&Xut()==125)continue}switch(R+=Uj(E),E*b){case 38:_=u>0?1:(R+="\f",-1);break;case 44:o[c++]=(Zu(R)-1)*_,_=1;break;case 64:_p()===45&&(R+=qM(ou())),f=_p(),u=d=Zu(w=R+=rdt(HA())),E++;break;case 45:y===45&&Zu(R)==2&&(b=0)}}return a}function IZ(e,t,n,r,i,a,s,o,l,c,u,d){for(var f=i-1,p=i===0?a:[""],y=Kut(p),b=0,x=0,_=0;b<r;++b)for(var E=0,w=Rb(e,f+1,f=O1e(x=s[b])),C=e;E<y;++E)(C=P1e(x>0?p[E]+" "+w:UA(w,/&\f/g,p[E])))&&(l[_++]=C);return Hj(e,t,n,i===0?I1e:o,l,c,u,d)}function adt(e,t,n,r){return Hj(e,t,n,M1e,Uj(Zut()),Rb(e,2,-2),0,r)}function LZ(e,t,n,r,i){return Hj(e,t,n,L1e,Rb(e,0,r),Rb(e,r+1,-1),r,i)}function j7(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function sdt(e,t,n,r){switch(e.type){case Wut:if(e.children.length)break;case Vut:case qut:case L1e:return e.return=e.return||e.value;case M1e:return"";case Gut:return e.return=e.value+"{"+j7(e.children,r)+"}";case I1e:if(!Zu(e.value=e.props.join(",")))return""}return Zu(n=j7(e.children,r))?e.return=e.value+"{"+n+"}":""}var odt=c0e(Object.keys,Object),ldt=Object.prototype,cdt=ldt.hasOwnProperty;function udt(e){if(!d6(e))return odt(e);var t=[];for(var n in Object(e))cdt.call(e,n)&&n!="constructor"&&t.push(n);return t}var $7=Sg(Ld,"DataView"),z7=Sg(Ld,"Promise"),U7=Sg(Ld,"Set"),H7=Sg(Ld,"WeakMap"),OZ="[object Map]",ddt="[object Object]",PZ="[object Promise]",FZ="[object Set]",BZ="[object WeakMap]",jZ="[object DataView]",hdt=wg($7),fdt=wg(vE),pdt=wg(z7),mdt=wg(U7),gdt=wg(H7),Km=sv;($7&&Km(new $7(new ArrayBuffer(1)))!=jZ||vE&&Km(new vE)!=OZ||z7&&Km(z7.resolve())!=PZ||U7&&Km(new U7)!=FZ||H7&&Km(new H7)!=BZ)&&(Km=function(e){var t=sv(e),n=t==ddt?e.constructor:void 0,r=n?wg(n):"";if(r)switch(r){case hdt:return jZ;case fdt:return OZ;case pdt:return PZ;case mdt:return FZ;case gdt:return BZ}return t});var ydt="[object Map]",bdt="[object Set]",vdt=Object.prototype,xdt=vdt.hasOwnProperty;function $Z(e){if(e==null)return!0;if(h6(e)&&(D3(e)||typeof e=="string"||typeof e.splice=="function"||xj(e)||_j(e)||R3(e)))return!e.length;var t=Km(e);if(t==ydt||t==bdt)return!e.size;if(d6(e))return!udt(e).length;for(var n in e)if(xdt.call(e,n))return!1;return!0}var B1e="c4",_dt=J(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),Edt=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./c4Diagram-YG6GDRKO-S5hXNTsJ.js");return{diagram:t}},__vite__mapDeps([105,106]));return{id:B1e,diagram:e}},"loader"),wdt={id:B1e,detector:_dt,loader:Edt},Sdt=wdt,j1e="flowchart",Tdt=J((e,t)=>{var n,r;return((n=t==null?void 0:t.flowchart)==null?void 0:n.defaultRenderer)==="dagre-wrapper"||((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="elk"?!1:/^\s*graph/.test(e)},"detector"),Cdt=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-zHYqmkyx.js");return{diagram:t}},__vite__mapDeps([107,108,109,110,111]));return{id:j1e,diagram:e}},"loader"),Adt={id:j1e,detector:Tdt,loader:Cdt},kdt=Adt,$1e="flowchart-v2",Ndt=J((e,t)=>{var n,r,i;return((n=t==null?void 0:t.flowchart)==null?void 0:n.defaultRenderer)==="dagre-d3"?!1:(((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="elk"&&(t.layout="elk"),/^\s*graph/.test(e)&&((i=t==null?void 0:t.flowchart)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(e))},"detector"),Rdt=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-zHYqmkyx.js");return{diagram:t}},__vite__mapDeps([107,108,109,110,111]));return{id:$1e,diagram:e}},"loader"),Ddt={id:$1e,detector:Ndt,loader:Rdt},Mdt=Ddt,z1e="er",Idt=J(e=>/^\s*erDiagram/.test(e),"detector"),Ldt=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./erDiagram-Q2GNP2WA-2_Q02Cxk.js");return{diagram:t}},__vite__mapDeps([112,109,110,111]));return{id:z1e,diagram:e}},"loader"),Odt={id:z1e,detector:Idt,loader:Ldt},Pdt=Odt,U1e="gitGraph",Fdt=J(e=>/^\s*gitGraph/.test(e),"detector"),Bdt=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./gitGraphDiagram-NY62KEGX-B9FE0mj2.js");return{diagram:t}},__vite__mapDeps([113,114,115,116,101,99]));return{id:U1e,diagram:e}},"loader"),jdt={id:U1e,detector:Fdt,loader:Bdt},$dt=jdt,H1e="gantt",zdt=J(e=>/^\s*gantt/.test(e),"detector"),Udt=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./ganttDiagram-JELNMOA3-6Yspdlny.js");return{diagram:t}},__vite__mapDeps([117,118,119,120,121]));return{id:H1e,diagram:e}},"loader"),Hdt={id:H1e,detector:zdt,loader:Udt},Vdt=Hdt,V1e="info",qdt=J(e=>/^\s*info/.test(e),"detector"),Gdt=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./infoDiagram-WHAUD3N6-BGRk5inn.js");return{diagram:t}},__vite__mapDeps([122,116,101,99]));return{id:V1e,diagram:e}},"loader"),Wdt={id:V1e,detector:qdt,loader:Gdt},q1e="pie",Ydt=J(e=>/^\s*pie/.test(e),"detector"),Kdt=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./pieDiagram-ADFJNKIX--hXf44AA.js");return{diagram:t}},__vite__mapDeps([123,114,116,101,99,124,125,120]));return{id:q1e,diagram:e}},"loader"),Zdt={id:q1e,detector:Ydt,loader:Kdt},G1e="quadrantChart",Xdt=J(e=>/^\s*quadrantChart/.test(e),"detector"),Qdt=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./quadrantDiagram-AYHSOK5B-BP4dBgbK.js");return{diagram:t}},__vite__mapDeps([126,119,120,121]));return{id:G1e,diagram:e}},"loader"),Jdt={id:G1e,detector:Xdt,loader:Qdt},eht=Jdt,W1e="xychart",tht=J(e=>/^\s*xychart(-beta)?/.test(e),"detector"),nht=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./xychartDiagram-PRI3JC2R-CFAKvOPr.js");return{diagram:t}},__vite__mapDeps([127,128,120,125,119,121]));return{id:W1e,diagram:e}},"loader"),rht={id:W1e,detector:tht,loader:nht},iht=rht,Y1e="requirement",aht=J(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),sht=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./requirementDiagram-UZGBJVZJ-BjJP3Slm.js");return{diagram:t}},__vite__mapDeps([129,109,110]));return{id:Y1e,diagram:e}},"loader"),oht={id:Y1e,detector:aht,loader:sht},lht=oht,K1e="sequence",cht=J(e=>/^\s*sequenceDiagram/.test(e),"detector"),uht=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./sequenceDiagram-WL72ISMW-CLo7P2AR.js");return{diagram:t}},__vite__mapDeps([130,106,115]));return{id:K1e,diagram:e}},"loader"),dht={id:K1e,detector:cht,loader:uht},hht=dht,Z1e="class",fht=J((e,t)=>{var n;return((n=t==null?void 0:t.class)==null?void 0:n.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e)},"detector"),pht=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./classDiagram-2ON5EDUG-DEiSx8NZ.js");return{diagram:t}},__vite__mapDeps([131,132,108,109,110]));return{id:Z1e,diagram:e}},"loader"),mht={id:Z1e,detector:fht,loader:pht},ght=mht,X1e="classDiagram",yht=J((e,t)=>{var n;return/^\s*classDiagram/.test(e)&&((n=t==null?void 0:t.class)==null?void 0:n.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e)},"detector"),bht=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./classDiagram-v2-WZHVMYZB-DEiSx8NZ.js");return{diagram:t}},__vite__mapDeps([133,132,108,109,110]));return{id:X1e,diagram:e}},"loader"),vht={id:X1e,detector:yht,loader:bht},xht=vht,Q1e="state",_ht=J((e,t)=>{var n;return((n=t==null?void 0:t.state)==null?void 0:n.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e)},"detector"),Eht=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./stateDiagram-FKZM4ZOC-D5NKNKls.js");return{diagram:t}},__vite__mapDeps([134,135,109,110,98,99,100,101]));return{id:Q1e,diagram:e}},"loader"),wht={id:Q1e,detector:_ht,loader:Eht},Sht=wht,J1e="stateDiagram",Tht=J((e,t)=>{var n;return!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&((n=t==null?void 0:t.state)==null?void 0:n.defaultRenderer)==="dagre-wrapper")},"detector"),Cht=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./stateDiagram-v2-4FDKWEC3-oN7y0aok.js");return{diagram:t}},__vite__mapDeps([136,135,109,110]));return{id:J1e,diagram:e}},"loader"),Aht={id:J1e,detector:Tht,loader:Cht},kht=Aht,eye="journey",Nht=J(e=>/^\s*journey/.test(e),"detector"),Rht=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./journeyDiagram-XKPGCS4Q-DkLUAT8H.js");return{diagram:t}},__vite__mapDeps([137,106,108,124]));return{id:eye,diagram:e}},"loader"),Dht={id:eye,detector:Nht,loader:Rht},Mht=Dht,Iht=J((e,t,n)=>{vt.debug(`rendering svg for syntax error
|
|
1762
|
-
`);const r=fit(t),i=r.append("g");r.attr("viewBox","0 0 2412 512"),Jfe(r,100,512,!0),i.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),i.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),i.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),i.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),i.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),i.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),i.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),i.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${n}`)},"draw"),tye={draw:Iht},Lht=tye,Oht={db:{},renderer:tye,parser:{parse:J(()=>{},"parse")}},Pht=Oht,nye="flowchart-elk",Fht=J((e,t={})=>{var n;return/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&((n=t==null?void 0:t.flowchart)==null?void 0:n.defaultRenderer)==="elk"?(t.layout="elk",!0):!1},"detector"),Bht=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-
|
|
1761
|
+
L0,20`)},"requirement_arrow"),jut=J((e,t,n)=>{const r=e.append("defs").append("marker").attr("id",n+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");r.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),r.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),r.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),$ut={extension:Tut,composition:Cut,aggregation:Aut,dependency:kut,lollipop:Nut,point:Rut,circle:Dut,cross:Mut,barb:Iut,only_one:Lut,zero_or_one:Out,one_or_more:Put,zero_or_more:Fut,requirement_arrow:But,requirement_contains:jut},zut=Sut,Uut={common:iv,getConfig:ro,insertCluster:Zct,insertEdge:wut,insertEdgeLabel:yut,insertMarkers:zut,insertNode:A1e,interpolateToCurve:Ej,labelHelper:ir,log:vt,positionEdgeLabel:but},_E={},D1e=J(e=>{for(const t of e)_E[t.name]=t},"registerLayoutLoaders"),Hut=J(()=>{D1e([{name:"dagre",loader:J(async()=>await me(()=>import("./dagre-6UL2VRFP-B4ns4hkv.js"),__vite__mapDeps([97,98,99,100,101,102])),"loader")},{name:"cose-bilkent",loader:J(async()=>await me(()=>import("./cose-bilkent-S5V4N54A-DhwtA41M.js"),__vite__mapDeps([103,104])),"loader")}])},"registerDefaultLayoutLoaders");Hut();var JLt=J(async(e,t)=>{if(!(e.layoutAlgorithm in _E))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);const n=_E[e.layoutAlgorithm];return(await n.loader()).render(e,t,Uut,{algorithm:n.algorithm})},"render"),eOt=J((e="",{fallback:t="dagre"}={})=>{if(e in _E)return e;if(t in _E)return vt.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm"),M1e="comm",I1e="rule",L1e="decl",Vut="@import",qut="@namespace",Gut="@keyframes",Wut="@layer",O1e=Math.abs,Uj=String.fromCharCode;function P1e(e){return e.trim()}function UA(e,t,n){return e.replace(t,n)}function Yut(e,t,n){return e.indexOf(t,n)}function Fy(e,t){return e.charCodeAt(t)|0}function Rb(e,t,n){return e.slice(t,n)}function Zu(e){return e.length}function Kut(e){return e.length}function pC(e,t){return t.push(e),e}var _6=1,Db=1,F1e=0,Ac=0,Va=0,cv="";function Hj(e,t,n,r,i,a,s,o){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:_6,column:Db,length:s,return:"",siblings:o}}function Zut(){return Va}function Xut(){return Va=Ac>0?Fy(cv,--Ac):0,Db--,Va===10&&(Db=1,_6--),Va}function ou(){return Va=Ac<F1e?Fy(cv,Ac++):0,Db++,Va===10&&(Db=1,_6++),Va}function _p(){return Fy(cv,Ac)}function HA(){return Ac}function E6(e,t){return Rb(cv,e,t)}function EE(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Qut(e){return _6=Db=1,F1e=Zu(cv=e),Ac=0,[]}function Jut(e){return cv="",e}function qM(e){return P1e(E6(Ac-1,B7(e===91?e+2:e===40?e+1:e)))}function edt(e){for(;(Va=_p())&&Va<33;)ou();return EE(e)>2||EE(Va)>3?"":" "}function tdt(e,t){for(;--t&&ou()&&!(Va<48||Va>102||Va>57&&Va<65||Va>70&&Va<97););return E6(e,HA()+(t<6&&_p()==32&&ou()==32))}function B7(e){for(;ou();)switch(Va){case e:return Ac;case 34:case 39:e!==34&&e!==39&&B7(Va);break;case 40:e===41&&B7(e);break;case 92:ou();break}return Ac}function ndt(e,t){for(;ou()&&e+Va!==57;)if(e+Va===84&&_p()===47)break;return"/*"+E6(t,Ac-1)+"*"+Uj(e===47?e:ou())}function rdt(e){for(;!EE(_p());)ou();return E6(e,Ac)}function idt(e){return Jut(VA("",null,null,null,[""],e=Qut(e),0,[0],e))}function VA(e,t,n,r,i,a,s,o,l){for(var c=0,u=0,d=s,f=0,p=0,y=0,b=1,x=1,_=1,E=0,w="",C=i,k=a,N=r,R=w;x;)switch(y=E,E=ou()){case 40:if(y!=108&&Fy(R,d-1)==58){Yut(R+=UA(qM(E),"&","&\f"),"&\f",O1e(c?o[c-1]:0))!=-1&&(_=-1);break}case 34:case 39:case 91:R+=qM(E);break;case 9:case 10:case 13:case 32:R+=edt(y);break;case 92:R+=tdt(HA()-1,7);continue;case 47:switch(_p()){case 42:case 47:pC(adt(ndt(ou(),HA()),t,n,l),l),(EE(y||1)==5||EE(_p()||1)==5)&&Zu(R)&&Rb(R,-1,void 0)!==" "&&(R+=" ");break;default:R+="/"}break;case 123*b:o[c++]=Zu(R)*_;case 125*b:case 59:case 0:switch(E){case 0:case 125:x=0;case 59+u:_==-1&&(R=UA(R,/\f/g,"")),p>0&&(Zu(R)-d||b===0&&y===47)&&pC(p>32?LZ(R+";",r,n,d-1,l):LZ(UA(R," ","")+";",r,n,d-2,l),l);break;case 59:R+=";";default:if(pC(N=IZ(R,t,n,c,u,i,o,w,C=[],k=[],d,a),a),E===123)if(u===0)VA(R,t,N,N,C,a,d,o,k);else{switch(f){case 99:if(Fy(R,3)===110)break;case 108:if(Fy(R,2)===97)break;default:u=0;case 100:case 109:case 115:}u?VA(e,N,N,r&&pC(IZ(e,N,N,0,0,i,o,w,i,C=[],d,k),k),i,k,d,o,r?C:k):VA(R,N,N,N,[""],k,0,o,k)}}c=u=p=0,b=_=1,w=R="",d=s;break;case 58:d=1+Zu(R),p=y;default:if(b<1){if(E==123)--b;else if(E==125&&b++==0&&Xut()==125)continue}switch(R+=Uj(E),E*b){case 38:_=u>0?1:(R+="\f",-1);break;case 44:o[c++]=(Zu(R)-1)*_,_=1;break;case 64:_p()===45&&(R+=qM(ou())),f=_p(),u=d=Zu(w=R+=rdt(HA())),E++;break;case 45:y===45&&Zu(R)==2&&(b=0)}}return a}function IZ(e,t,n,r,i,a,s,o,l,c,u,d){for(var f=i-1,p=i===0?a:[""],y=Kut(p),b=0,x=0,_=0;b<r;++b)for(var E=0,w=Rb(e,f+1,f=O1e(x=s[b])),C=e;E<y;++E)(C=P1e(x>0?p[E]+" "+w:UA(w,/&\f/g,p[E])))&&(l[_++]=C);return Hj(e,t,n,i===0?I1e:o,l,c,u,d)}function adt(e,t,n,r){return Hj(e,t,n,M1e,Uj(Zut()),Rb(e,2,-2),0,r)}function LZ(e,t,n,r,i){return Hj(e,t,n,L1e,Rb(e,0,r),Rb(e,r+1,-1),r,i)}function j7(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function sdt(e,t,n,r){switch(e.type){case Wut:if(e.children.length)break;case Vut:case qut:case L1e:return e.return=e.return||e.value;case M1e:return"";case Gut:return e.return=e.value+"{"+j7(e.children,r)+"}";case I1e:if(!Zu(e.value=e.props.join(",")))return""}return Zu(n=j7(e.children,r))?e.return=e.value+"{"+n+"}":""}var odt=c0e(Object.keys,Object),ldt=Object.prototype,cdt=ldt.hasOwnProperty;function udt(e){if(!d6(e))return odt(e);var t=[];for(var n in Object(e))cdt.call(e,n)&&n!="constructor"&&t.push(n);return t}var $7=Sg(Ld,"DataView"),z7=Sg(Ld,"Promise"),U7=Sg(Ld,"Set"),H7=Sg(Ld,"WeakMap"),OZ="[object Map]",ddt="[object Object]",PZ="[object Promise]",FZ="[object Set]",BZ="[object WeakMap]",jZ="[object DataView]",hdt=wg($7),fdt=wg(vE),pdt=wg(z7),mdt=wg(U7),gdt=wg(H7),Km=sv;($7&&Km(new $7(new ArrayBuffer(1)))!=jZ||vE&&Km(new vE)!=OZ||z7&&Km(z7.resolve())!=PZ||U7&&Km(new U7)!=FZ||H7&&Km(new H7)!=BZ)&&(Km=function(e){var t=sv(e),n=t==ddt?e.constructor:void 0,r=n?wg(n):"";if(r)switch(r){case hdt:return jZ;case fdt:return OZ;case pdt:return PZ;case mdt:return FZ;case gdt:return BZ}return t});var ydt="[object Map]",bdt="[object Set]",vdt=Object.prototype,xdt=vdt.hasOwnProperty;function $Z(e){if(e==null)return!0;if(h6(e)&&(D3(e)||typeof e=="string"||typeof e.splice=="function"||xj(e)||_j(e)||R3(e)))return!e.length;var t=Km(e);if(t==ydt||t==bdt)return!e.size;if(d6(e))return!udt(e).length;for(var n in e)if(xdt.call(e,n))return!1;return!0}var B1e="c4",_dt=J(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),Edt=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./c4Diagram-YG6GDRKO-DL2TZvVA.js");return{diagram:t}},__vite__mapDeps([105,106]));return{id:B1e,diagram:e}},"loader"),wdt={id:B1e,detector:_dt,loader:Edt},Sdt=wdt,j1e="flowchart",Tdt=J((e,t)=>{var n,r;return((n=t==null?void 0:t.flowchart)==null?void 0:n.defaultRenderer)==="dagre-wrapper"||((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="elk"?!1:/^\s*graph/.test(e)},"detector"),Cdt=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-CG1t4tHV.js");return{diagram:t}},__vite__mapDeps([107,108,109,110,111]));return{id:j1e,diagram:e}},"loader"),Adt={id:j1e,detector:Tdt,loader:Cdt},kdt=Adt,$1e="flowchart-v2",Ndt=J((e,t)=>{var n,r,i;return((n=t==null?void 0:t.flowchart)==null?void 0:n.defaultRenderer)==="dagre-d3"?!1:(((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="elk"&&(t.layout="elk"),/^\s*graph/.test(e)&&((i=t==null?void 0:t.flowchart)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(e))},"detector"),Rdt=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-CG1t4tHV.js");return{diagram:t}},__vite__mapDeps([107,108,109,110,111]));return{id:$1e,diagram:e}},"loader"),Ddt={id:$1e,detector:Ndt,loader:Rdt},Mdt=Ddt,z1e="er",Idt=J(e=>/^\s*erDiagram/.test(e),"detector"),Ldt=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./erDiagram-Q2GNP2WA-GT38PoiU.js");return{diagram:t}},__vite__mapDeps([112,109,110,111]));return{id:z1e,diagram:e}},"loader"),Odt={id:z1e,detector:Idt,loader:Ldt},Pdt=Odt,U1e="gitGraph",Fdt=J(e=>/^\s*gitGraph/.test(e),"detector"),Bdt=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./gitGraphDiagram-NY62KEGX-AzgnB9fT.js");return{diagram:t}},__vite__mapDeps([113,114,115,116,101,99]));return{id:U1e,diagram:e}},"loader"),jdt={id:U1e,detector:Fdt,loader:Bdt},$dt=jdt,H1e="gantt",zdt=J(e=>/^\s*gantt/.test(e),"detector"),Udt=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./ganttDiagram-JELNMOA3-BXKmb-ii.js");return{diagram:t}},__vite__mapDeps([117,118,119,120,121]));return{id:H1e,diagram:e}},"loader"),Hdt={id:H1e,detector:zdt,loader:Udt},Vdt=Hdt,V1e="info",qdt=J(e=>/^\s*info/.test(e),"detector"),Gdt=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./infoDiagram-WHAUD3N6-D0wkBIMn.js");return{diagram:t}},__vite__mapDeps([122,116,101,99]));return{id:V1e,diagram:e}},"loader"),Wdt={id:V1e,detector:qdt,loader:Gdt},q1e="pie",Ydt=J(e=>/^\s*pie/.test(e),"detector"),Kdt=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./pieDiagram-ADFJNKIX-TY170q2q.js");return{diagram:t}},__vite__mapDeps([123,114,116,101,99,124,125,120]));return{id:q1e,diagram:e}},"loader"),Zdt={id:q1e,detector:Ydt,loader:Kdt},G1e="quadrantChart",Xdt=J(e=>/^\s*quadrantChart/.test(e),"detector"),Qdt=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./quadrantDiagram-AYHSOK5B-CaGT9oCS.js");return{diagram:t}},__vite__mapDeps([126,119,120,121]));return{id:G1e,diagram:e}},"loader"),Jdt={id:G1e,detector:Xdt,loader:Qdt},eht=Jdt,W1e="xychart",tht=J(e=>/^\s*xychart(-beta)?/.test(e),"detector"),nht=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./xychartDiagram-PRI3JC2R-DCoq2bZ7.js");return{diagram:t}},__vite__mapDeps([127,128,120,125,119,121]));return{id:W1e,diagram:e}},"loader"),rht={id:W1e,detector:tht,loader:nht},iht=rht,Y1e="requirement",aht=J(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),sht=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./requirementDiagram-UZGBJVZJ-cjPEHOn1.js");return{diagram:t}},__vite__mapDeps([129,109,110]));return{id:Y1e,diagram:e}},"loader"),oht={id:Y1e,detector:aht,loader:sht},lht=oht,K1e="sequence",cht=J(e=>/^\s*sequenceDiagram/.test(e),"detector"),uht=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./sequenceDiagram-WL72ISMW-CfbBeFLR.js");return{diagram:t}},__vite__mapDeps([130,106,115]));return{id:K1e,diagram:e}},"loader"),dht={id:K1e,detector:cht,loader:uht},hht=dht,Z1e="class",fht=J((e,t)=>{var n;return((n=t==null?void 0:t.class)==null?void 0:n.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e)},"detector"),pht=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./classDiagram-2ON5EDUG-MuAiNNYp.js");return{diagram:t}},__vite__mapDeps([131,132,108,109,110]));return{id:Z1e,diagram:e}},"loader"),mht={id:Z1e,detector:fht,loader:pht},ght=mht,X1e="classDiagram",yht=J((e,t)=>{var n;return/^\s*classDiagram/.test(e)&&((n=t==null?void 0:t.class)==null?void 0:n.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e)},"detector"),bht=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./classDiagram-v2-WZHVMYZB-MuAiNNYp.js");return{diagram:t}},__vite__mapDeps([133,132,108,109,110]));return{id:X1e,diagram:e}},"loader"),vht={id:X1e,detector:yht,loader:bht},xht=vht,Q1e="state",_ht=J((e,t)=>{var n;return((n=t==null?void 0:t.state)==null?void 0:n.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e)},"detector"),Eht=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./stateDiagram-FKZM4ZOC-BHdZJa9R.js");return{diagram:t}},__vite__mapDeps([134,135,109,110,98,99,100,101]));return{id:Q1e,diagram:e}},"loader"),wht={id:Q1e,detector:_ht,loader:Eht},Sht=wht,J1e="stateDiagram",Tht=J((e,t)=>{var n;return!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&((n=t==null?void 0:t.state)==null?void 0:n.defaultRenderer)==="dagre-wrapper")},"detector"),Cht=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./stateDiagram-v2-4FDKWEC3-CnXnQZrS.js");return{diagram:t}},__vite__mapDeps([136,135,109,110]));return{id:J1e,diagram:e}},"loader"),Aht={id:J1e,detector:Tht,loader:Cht},kht=Aht,eye="journey",Nht=J(e=>/^\s*journey/.test(e),"detector"),Rht=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./journeyDiagram-XKPGCS4Q-Cmxvw-CF.js");return{diagram:t}},__vite__mapDeps([137,106,108,124]));return{id:eye,diagram:e}},"loader"),Dht={id:eye,detector:Nht,loader:Rht},Mht=Dht,Iht=J((e,t,n)=>{vt.debug(`rendering svg for syntax error
|
|
1762
|
+
`);const r=fit(t),i=r.append("g");r.attr("viewBox","0 0 2412 512"),Jfe(r,100,512,!0),i.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),i.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),i.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),i.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),i.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),i.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),i.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),i.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${n}`)},"draw"),tye={draw:Iht},Lht=tye,Oht={db:{},renderer:tye,parser:{parse:J(()=>{},"parse")}},Pht=Oht,nye="flowchart-elk",Fht=J((e,t={})=>{var n;return/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&((n=t==null?void 0:t.flowchart)==null?void 0:n.defaultRenderer)==="elk"?(t.layout="elk",!0):!1},"detector"),Bht=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-CG1t4tHV.js");return{diagram:t}},__vite__mapDeps([107,108,109,110,111]));return{id:nye,diagram:e}},"loader"),jht={id:nye,detector:Fht,loader:Bht},$ht=jht,rye="timeline",zht=J(e=>/^\s*timeline/.test(e),"detector"),Uht=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./timeline-definition-IT6M3QCI-DbB6dLD9.js");return{diagram:t}},__vite__mapDeps([138,124]));return{id:rye,diagram:e}},"loader"),Hht={id:rye,detector:zht,loader:Uht},Vht=Hht,iye="mindmap",qht=J(e=>/^\s*mindmap/.test(e),"detector"),Ght=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./mindmap-definition-VGOIOE7T-Bo3LAno7.js");return{diagram:t}},__vite__mapDeps([139,109,110]));return{id:iye,diagram:e}},"loader"),Wht={id:iye,detector:qht,loader:Ght},Yht=Wht,aye="kanban",Kht=J(e=>/^\s*kanban/.test(e),"detector"),Zht=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./kanban-definition-3W4ZIXB7-YdVwldix.js");return{diagram:t}},__vite__mapDeps([140,108]));return{id:aye,diagram:e}},"loader"),Xht={id:aye,detector:Kht,loader:Zht},Qht=Xht,sye="sankey",Jht=J(e=>/^\s*sankey(-beta)?/.test(e),"detector"),eft=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./sankeyDiagram-TZEHDZUN-C1jZ6BzB.js");return{diagram:t}},__vite__mapDeps([141,125,120]));return{id:sye,diagram:e}},"loader"),tft={id:sye,detector:Jht,loader:eft},nft=tft,oye="packet",rft=J(e=>/^\s*packet(-beta)?/.test(e),"detector"),ift=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./diagram-S2PKOQOG-B7hU4Vir.js");return{diagram:t}},__vite__mapDeps([142,114,116,101,99]));return{id:oye,diagram:e}},"loader"),aft={id:oye,detector:rft,loader:ift},lye="radar",sft=J(e=>/^\s*radar-beta/.test(e),"detector"),oft=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./diagram-QEK2KX5R-D5hNzEvu.js");return{diagram:t}},__vite__mapDeps([143,114,116,101,99]));return{id:lye,diagram:e}},"loader"),lft={id:lye,detector:sft,loader:oft},cye="block",cft=J(e=>/^\s*block(-beta)?/.test(e),"detector"),uft=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./blockDiagram-VD42YOAC-5FgtpUfA.js");return{diagram:t}},__vite__mapDeps([144,108,102,98,99,111]));return{id:cye,diagram:e}},"loader"),dft={id:cye,detector:cft,loader:uft},hft=dft,uye="architecture",fft=J(e=>/^\s*architecture/.test(e),"detector"),pft=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./architectureDiagram-VXUJARFQ-DtTMloLc.js");return{diagram:t}},__vite__mapDeps([145,114,116,101,99,104]));return{id:uye,diagram:e}},"loader"),mft={id:uye,detector:fft,loader:pft},gft=mft,dye="treemap",yft=J(e=>/^\s*treemap/.test(e),"detector"),bft=J(async()=>{const{diagram:e}=await me(async()=>{const{diagram:t}=await import("./diagram-PSM6KHXK-C6vBYdLz.js");return{diagram:t}},__vite__mapDeps([146,110,114,116,101,99,121,125,120]));return{id:dye,diagram:e}},"loader"),vft={id:dye,detector:yft,loader:bft},zZ=!1,w6=J(()=>{zZ||(zZ=!0,y3("error",Pht,e=>e.toLowerCase().trim()==="error"),y3("---",{db:{clear:J(()=>{},"clear")},styles:{},renderer:{draw:J(()=>{},"draw")},parser:{parse:J(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:J(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),r7($ht,Yht,gft),r7(Sdt,Qht,xht,ght,Pdt,Vdt,Wdt,Zdt,lht,hht,Mdt,kdt,Vht,$dt,kht,Sht,Mht,eht,nft,aft,iht,hft,lft,vft))},"addDiagrams"),xft=J(async()=>{vt.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(K0).map(async([n,{detector:r,loader:i}])=>{if(i)try{o7(n)}catch{try{const{diagram:a,id:s}=await i();y3(s,a,r)}catch(a){throw vt.error(`Failed to load external diagram with key ${n}. Removing from detectors.`),delete K0[n],a}}}))).filter(n=>n.status==="rejected");if(t.length>0){vt.error(`Failed to load ${t.length} external diagrams`);for(const n of t)vt.error(n);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),_ft="graphics-document document";function hye(e,t){e.attr("role",_ft),t!==""&&e.attr("aria-roledescription",t)}J(hye,"setA11yDiagramInfo");function fye(e,t,n,r){if(e.insert!==void 0){if(n){const i=`chart-desc-${r}`;e.attr("aria-describedby",i),e.insert("desc",":first-child").attr("id",i).text(n)}if(t){const i=`chart-title-${r}`;e.attr("aria-labelledby",i),e.insert("title",":first-child").attr("id",i).text(t)}}}J(fye,"addSVGa11yTitleDescription");var I0,V7=(I0=class{constructor(t,n,r,i,a){this.type=t,this.text=n,this.db=r,this.parser=i,this.renderer=a}static async fromText(t,n={}){var c,u;const r=ro(),i=QB(t,r);t=vlt(t)+`
|
|
1763
1763
|
`;try{o7(i)}catch{const d=rrt(i);if(!d)throw new zfe(`Diagram ${i} not found.`);const{id:f,diagram:p}=await d();y3(f,p)}const{db:a,parser:s,renderer:o,init:l}=o7(i);return s.parser&&(s.parser.yy=a),(c=a.clear)==null||c.call(a),l==null||l(r),n.title&&((u=a.setDiagramTitle)==null||u.call(a,n.title)),await s.parse(t),new I0(i,t,a,s,o)}async render(t,n){await this.renderer.draw(this.text,t,n,this)}getParser(){return this.parser}getType(){return this.type}},J(I0,"Diagram"),I0),UZ=[],Eft=J(()=>{UZ.forEach(e=>{e()}),UZ=[]},"attachFunctions"),wft=J(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function pye(e){const t=e.match($fe);if(!t)return{text:e,metadata:{}};let n=xat(t[1],{schema:vat})??{};n=typeof n=="object"&&!Array.isArray(n)?n:{};const r={};return n.displayMode&&(r.displayMode=n.displayMode.toString()),n.title&&(r.title=n.title.toString()),n.config&&(r.config=n.config),{text:e.slice(t[0].length),metadata:r}}J(pye,"extractFrontMatter");var Sft=J(e=>e.replace(/\r\n?/g,`
|
|
1764
1764
|
`).replace(/<(\w+)([^>]*)>/g,(t,n,r)=>"<"+n+r.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),Tft=J(e=>{const{text:t,metadata:n}=pye(e),{displayMode:r,title:i,config:a={}}=n;return r&&(a.gantt||(a.gantt={}),a.gantt.displayMode=r),{title:i,config:a,text:t}},"processFrontmatter"),Cft=J(e=>{const t=ru.detectInit(e)??{},n=ru.detectDirective(e,"wrap");return Array.isArray(n)?t.wrap=n.some(({type:r})=>r==="wrap"):(n==null?void 0:n.type)==="wrap"&&(t.wrap=!0),{text:slt(e),directive:t}},"processDirectives");function Vj(e){const t=Sft(e),n=Tft(t),r=Cft(n.text),i=Aj(n.config,r.directive);return e=wft(r.text),{code:e,title:n.title,config:i}}J(Vj,"preprocessDiagram");function mye(e){const t=new TextEncoder().encode(e),n=Array.from(t,r=>String.fromCodePoint(r)).join("");return btoa(n)}J(mye,"toBase64");var Aft=5e4,kft="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",Nft="sandbox",Rft="loose",Dft="http://www.w3.org/2000/svg",Mft="http://www.w3.org/1999/xlink",Ift="http://www.w3.org/1999/xhtml",Lft="100%",Oft="100%",Pft="border:0;margin:0;",Fft="margin:0",Bft="allow-top-navigation-by-user-activation allow-popups",jft='The "iframe" tag is not supported by your browser.',$ft=["foreignobject"],zft=["dominant-baseline"];function qj(e){const t=Vj(e);return m3(),vrt(t.config??{}),t}J(qj,"processAndSetConfigs");async function gye(e,t){w6();try{const{code:n,config:r}=qj(e);return{diagramType:(await bye(n)).type,config:r}}catch(n){if(t!=null&&t.suppressErrors)return!1;throw n}}J(gye,"parse");var HZ=J((e,t,n=[])=>`
|
|
1765
1765
|
.${e} ${t} { ${n.join(" !important; ")} !important; }`,"cssImportantStyles"),Uft=J((e,t=new Map)=>{var r;let n="";if(e.themeCSS!==void 0&&(n+=`
|
|
@@ -2119,7 +2119,7 @@ Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error
|
|
|
2119
2119
|
`||u==="\r"){l=!0;break}if(!l)return o;let c=[];for(let u of o)u===" "?c.push("\\t"):u===`
|
|
2120
2120
|
`?c.push("\\n"):u==="\r"?c.push("\\r"):c.push(u);return c.join("")},i=t.length>0?n.length+1:n.length,a=new Array(i),s=0;t.length>0&&(a[s]=t.map(r).join(" "),s+=1);for(let o of n)a[s]=o.map(r).join(" "),s+=1;return a.join(`
|
|
2121
2121
|
`)},LI=e=>{let t=!1;for(let r of e)if(r==="\\"||r==="|"){t=!0;break}if(!t)return e;let n=[];for(let r of e)r==="\\"?n.push("\\\\"):r==="|"?n.push("\\|"):n.push(r);return n.join("")},USt=e=>{let{headers:t,rows:n}=e;if(t.length===0)return"";let r=new Array(n.length+2),i=0,a=t.map(o=>LI(o));r[i]=`| ${a.join(" | ")} |`,i+=1;let s=new Array(t.length);for(let o=0;o<t.length;o+=1)s[o]="---";r[i]=`| ${s.join(" | ")} |`,i+=1;for(let o of n)if(o.length<t.length){let l=new Array(t.length);for(let c=0;c<t.length;c+=1)l[c]=c<o.length?LI(o[c]):"";r[i]=`| ${l.join(" | ")} |`,i+=1}else{let l=o.map(c=>LI(c));r[i]=`| ${l.join(" | ")} |`,i+=1}return r.join(`
|
|
2122
|
-
`)},HSt=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let[a,s]=S.useState(!1),[o,l]=S.useState(!1),c=S.useRef(null),u=S.useRef(0),{isAnimating:d}=S.useContext(Rc),f=async y=>{var b,x;if(typeof window>"u"||!((b=navigator==null?void 0:navigator.clipboard)!=null&&b.write)){r==null||r(new Error("Clipboard API not available"));return}try{let _=(x=c.current)==null?void 0:x.closest('[data-streamdown="table-wrapper"]'),E=_==null?void 0:_.querySelector("table");if(!E){r==null||r(new Error("Table not found"));return}let w=F_e(E),C=y==="csv"?B_e(w):zSt(w),k=new ClipboardItem({"text/plain":new Blob([C],{type:"text/plain"}),"text/html":new Blob([E.outerHTML],{type:"text/html"})});await navigator.clipboard.write([k]),l(!0),s(!1),n==null||n(y),u.current=window.setTimeout(()=>l(!1),i)}catch(_){r==null||r(_)}};S.useEffect(()=>{let y=b=>{let x=b.composedPath();c.current&&!x.includes(c.current)&&s(!1)};return document.addEventListener("mousedown",y),()=>{document.removeEventListener("mousedown",y),window.clearTimeout(u.current)}},[]);let p=o?sz:oz;return g.jsxs("div",{className:"relative",ref:c,children:[g.jsx("button",{className:br("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:d,onClick:()=>s(!a),title:"Copy table",type:"button",children:e??g.jsx(p,{size:14})}),a?g.jsxs("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[g.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>f("csv"),title:"Copy table as CSV",type:"button",children:"CSV"}),g.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>f("tsv"),title:"Copy table as TSV",type:"button",children:"TSV"})]}):null]})},VSt=({children:e,className:t,onDownload:n,onError:r})=>{let[i,a]=S.useState(!1),s=S.useRef(null),{isAnimating:o}=S.useContext(Rc),l=c=>{var u;try{let d=(u=s.current)==null?void 0:u.closest('[data-streamdown="table-wrapper"]'),f=d==null?void 0:d.querySelector("table");if(!f){r==null||r(new Error("Table not found"));return}let p=F_e(f),y=c==="csv"?B_e(p):USt(p);Uy(`table.${c==="csv"?"csv":"md"}`,y,c==="csv"?"text/csv":"text/markdown"),a(!1),n==null||n(c)}catch(d){r==null||r(d)}};return S.useEffect(()=>{let c=u=>{let d=u.composedPath();s.current&&!d.includes(s.current)&&a(!1)};return document.addEventListener("mousedown",c),()=>{document.removeEventListener("mousedown",c)}},[]),g.jsxs("div",{className:"relative",ref:s,children:[g.jsx("button",{className:br("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:o,onClick:()=>a(!i),title:"Download table",type:"button",children:e??g.jsx(q6,{size:14})}),i?g.jsxs("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[g.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>l("csv"),title:"Download table as CSV",type:"button",children:"CSV"}),g.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>l("markdown"),title:"Download table as Markdown",type:"button",children:"Markdown"})]}):null]})},qSt=({children:e,className:t,showControls:n,...r})=>g.jsxs("div",{className:"my-4 flex flex-col space-y-2","data-streamdown":"table-wrapper",children:[n?g.jsxs("div",{className:"flex items-center justify-end gap-1",children:[g.jsx(HSt,{}),g.jsx(VSt,{})]}):null,g.jsx("div",{className:"overflow-x-auto",children:g.jsx("table",{className:br("w-full border-collapse border border-border",t),"data-streamdown":"table",...r,children:e})})]}),GSt=S.lazy(()=>me(()=>import("./code-block-37QAKDTI-DeQWV7FO.js"),[]).then(e=>({default:e.CodeBlock}))),WSt=S.lazy(()=>me(()=>Promise.resolve().then(()=>J8t),void 0).then(e=>({default:e.Mermaid}))),YSt=/language-([^\s]+)/;function G6(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,i=e.position.end,a=t.position.end;return(n==null?void 0:n.line)===(r==null?void 0:r.line)&&(n==null?void 0:n.column)===(r==null?void 0:r.column)&&(i==null?void 0:i.line)===(a==null?void 0:a.line)&&(i==null?void 0:i.column)===(a==null?void 0:a.column)}function Sa(e,t){return e.className===t.className&&G6(e.node,t.node)}var B9=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,NC=(e,t)=>{if(typeof e=="boolean")return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},cz=S.memo(({children:e,className:t,node:n,...r})=>g.jsx("ol",{className:br("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...r,children:e}),(e,t)=>Sa(e,t));cz.displayName="MarkdownOl";var j_e=S.memo(({children:e,className:t,node:n,...r})=>g.jsx("li",{className:br("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...r,children:e}),(e,t)=>e.className===t.className&&G6(e.node,t.node));j_e.displayName="MarkdownLi";var $_e=S.memo(({children:e,className:t,node:n,...r})=>g.jsx("ul",{className:br("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...r,children:e}),(e,t)=>Sa(e,t));$_e.displayName="MarkdownUl";var z_e=S.memo(({className:e,node:t,...n})=>g.jsx("hr",{className:br("my-6 border-border",e),"data-streamdown":"horizontal-rule",...n}),(e,t)=>Sa(e,t));z_e.displayName="MarkdownHr";var U_e=S.memo(({children:e,className:t,node:n,...r})=>g.jsx("span",{className:br("font-semibold",t),"data-streamdown":"strong",...r,children:e}),(e,t)=>Sa(e,t));U_e.displayName="MarkdownStrong";var KSt=({children:e,className:t,href:n,node:r,...i})=>{let{linkSafety:a}=S.useContext(Rc),[s,o]=S.useState(!1),l=n==="streamdown:incomplete-link",c=S.useCallback(async p=>{if(!(!(a!=null&&a.enabled&&n)||l)){if(p.preventDefault(),a.onLinkCheck&&await a.onLinkCheck(n)){window.open(n,"_blank","noreferrer");return}o(!0)}},[a,n,l]),u=S.useCallback(()=>{n&&window.open(n,"_blank","noreferrer")},[n]),d=S.useCallback(()=>{o(!1)},[]),f={url:n??"",isOpen:s,onClose:d,onConfirm:u};return a!=null&&a.enabled&&n?g.jsxs(g.Fragment,{children:[g.jsx("button",{className:br("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":l,"data-streamdown":"link",onClick:c,type:"button",children:e}),a.renderModal?a.renderModal(f):g.jsx(OSt,{...f})]}):g.jsx("a",{className:br("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":l,"data-streamdown":"link",href:n,rel:"noreferrer",target:"_blank",...i,children:e})},H_e=S.memo(KSt,(e,t)=>Sa(e,t)&&e.href===t.href);H_e.displayName="MarkdownA";var V_e=S.memo(({children:e,className:t,node:n,...r})=>g.jsx("h1",{className:br("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...r,children:e}),(e,t)=>Sa(e,t));V_e.displayName="MarkdownH1";var q_e=S.memo(({children:e,className:t,node:n,...r})=>g.jsx("h2",{className:br("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...r,children:e}),(e,t)=>Sa(e,t));q_e.displayName="MarkdownH2";var G_e=S.memo(({children:e,className:t,node:n,...r})=>g.jsx("h3",{className:br("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...r,children:e}),(e,t)=>Sa(e,t));G_e.displayName="MarkdownH3";var W_e=S.memo(({children:e,className:t,node:n,...r})=>g.jsx("h4",{className:br("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...r,children:e}),(e,t)=>Sa(e,t));W_e.displayName="MarkdownH4";var Y_e=S.memo(({children:e,className:t,node:n,...r})=>g.jsx("h5",{className:br("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...r,children:e}),(e,t)=>Sa(e,t));Y_e.displayName="MarkdownH5";var K_e=S.memo(({children:e,className:t,node:n,...r})=>g.jsx("h6",{className:br("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...r,children:e}),(e,t)=>Sa(e,t));K_e.displayName="MarkdownH6";var Z_e=S.memo(({children:e,className:t,node:n,...r})=>{let{controls:i}=S.useContext(Rc),a=B9(i,"table");return g.jsx(qSt,{className:t,showControls:a,...r,children:e})},(e,t)=>Sa(e,t));Z_e.displayName="MarkdownTable";var X_e=S.memo(({children:e,className:t,node:n,...r})=>g.jsx("thead",{className:br("bg-muted/80",t),"data-streamdown":"table-header",...r,children:e}),(e,t)=>Sa(e,t));X_e.displayName="MarkdownThead";var Q_e=S.memo(({children:e,className:t,node:n,...r})=>g.jsx("tbody",{className:br("divide-y divide-border bg-muted/40",t),"data-streamdown":"table-body",...r,children:e}),(e,t)=>Sa(e,t));Q_e.displayName="MarkdownTbody";var J_e=S.memo(({children:e,className:t,node:n,...r})=>g.jsx("tr",{className:br("border-border border-b",t),"data-streamdown":"table-row",...r,children:e}),(e,t)=>Sa(e,t));J_e.displayName="MarkdownTr";var e2e=S.memo(({children:e,className:t,node:n,...r})=>g.jsx("th",{className:br("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...r,children:e}),(e,t)=>Sa(e,t));e2e.displayName="MarkdownTh";var t2e=S.memo(({children:e,className:t,node:n,...r})=>g.jsx("td",{className:br("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...r,children:e}),(e,t)=>Sa(e,t));t2e.displayName="MarkdownTd";var n2e=S.memo(({children:e,className:t,node:n,...r})=>g.jsx("blockquote",{className:br("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...r,children:e}),(e,t)=>Sa(e,t));n2e.displayName="MarkdownBlockquote";var r2e=S.memo(({children:e,className:t,node:n,...r})=>g.jsx("sup",{className:br("text-sm",t),"data-streamdown":"superscript",...r,children:e}),(e,t)=>Sa(e,t));r2e.displayName="MarkdownSup";var i2e=S.memo(({children:e,className:t,node:n,...r})=>g.jsx("sub",{className:br("text-sm",t),"data-streamdown":"subscript",...r,children:e}),(e,t)=>Sa(e,t));i2e.displayName="MarkdownSub";var a2e=S.memo(({children:e,className:t,node:n,...r})=>{if("data-footnotes"in r){let i=s=>{var o,l;if(!S.isValidElement(s))return!1;let c=Array.isArray(s.props.children)?s.props.children:[s.props.children],u=!1,d=!1;for(let f of c)if(f){if(typeof f=="string")f.trim()!==""&&(u=!0);else if(S.isValidElement(f))if(((o=f.props)==null?void 0:o["data-footnote-backref"])!==void 0)d=!0;else{let p=Array.isArray(f.props.children)?f.props.children:[f.props.children];for(let y of p){if(typeof y=="string"&&y.trim()!==""){u=!0;break}if(S.isValidElement(y)&&((l=y.props)==null?void 0:l["data-footnote-backref"])===void 0){u=!0;break}}}}return d&&!u},a=Array.isArray(e)?e.map(s=>{if(!S.isValidElement(s))return s;if(s.type===cz){let o=(Array.isArray(s.props.children)?s.props.children:[s.props.children]).filter(l=>!i(l));return o.length===0?null:{...s,props:{...s.props,children:o}}}return s}):e;return(Array.isArray(a)?a.some(s=>s!==null):a!==null)?g.jsx("section",{className:t,...r,children:a}):null}return g.jsx("section",{className:t,...r,children:e})},(e,t)=>Sa(e,t));a2e.displayName="MarkdownSection";var ZSt=({node:e,className:t,children:n,...r})=>{var i,a,s;let o=((i=e==null?void 0:e.position)==null?void 0:i.start.line)===((a=e==null?void 0:e.position)==null?void 0:a.end.line),{mermaid:l,controls:c}=S.useContext(Rc),u=lz();if(o)return g.jsx("code",{className:br("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),"data-streamdown":"inline-code",...r,children:n});let d=t==null?void 0:t.match(YSt),f=(s=d==null?void 0:d.at(1))!=null?s:"",p="";if(S.isValidElement(n)&&n.props&&typeof n.props=="object"&&"children"in n.props&&typeof n.props.children=="string"?p=n.props.children:typeof n=="string"&&(p=n),f==="mermaid"&&u){let b=B9(c,"mermaid"),x=NC(c,"download"),_=NC(c,"copy"),E=NC(c,"fullscreen"),w=NC(c,"panZoom"),C=b&&(x||_||E);return g.jsx(S.Suspense,{fallback:g.jsx(PJ,{}),children:g.jsxs("div",{className:br("group relative my-4 h-auto rounded-xl border p-4",t),"data-streamdown":"mermaid-block",children:[C?g.jsxs("div",{className:"flex items-center justify-end gap-2",children:[x?g.jsx(FSt,{chart:p,config:l==null?void 0:l.config}):null,_?g.jsx(LJ,{code:p}):null,E?g.jsx($St,{chart:p,config:l==null?void 0:l.config}):null]}):null,g.jsx(WSt,{chart:p,config:l==null?void 0:l.config,showControls:w})]})})}let y=B9(c,"code");return g.jsx(S.Suspense,{fallback:g.jsx(PJ,{}),children:g.jsx(GSt,{className:br("overflow-x-auto border-border border-t",t),code:p,language:f,children:y?g.jsxs(g.Fragment,{children:[g.jsx(RSt,{code:p,language:f}),g.jsx(LJ,{})]}):null})})},s2e=S.memo(ZSt,(e,t)=>e.className===t.className&&G6(e.node,t.node));s2e.displayName="MarkdownCode";var o2e=S.memo(MSt,(e,t)=>e.className===t.className&&G6(e.node,t.node));o2e.displayName="MarkdownImg";var l2e=S.memo(({children:e,className:t,node:n,...r})=>{var i,a;let s=(Array.isArray(e)?e:[e]).filter(o=>o!=null&&o!=="");if(s.length===1&&S.isValidElement(s[0])){let o=s[0].props.node,l=o==null?void 0:o.tagName;if(l==="img")return g.jsx(g.Fragment,{children:e});if(l==="code"&&((i=o==null?void 0:o.position)==null?void 0:i.start.line)!==((a=o==null?void 0:o.position)==null?void 0:a.end.line))return g.jsx(g.Fragment,{children:e})}return g.jsx("p",{className:t,...r,children:e})},(e,t)=>Sa(e,t));l2e.displayName="MarkdownParagraph";var XSt={ol:cz,li:j_e,ul:$_e,hr:z_e,strong:U_e,a:H_e,h1:V_e,h2:q_e,h3:G_e,h4:W_e,h5:Y_e,h6:K_e,table:Z_e,thead:X_e,tbody:Q_e,tr:J_e,th:e2e,td:t2e,blockquote:n2e,code:s2e,img:o2e,pre:({children:e})=>e,sup:r2e,sub:i2e,p:l2e,section:a2e},FJ=[],BJ={allowDangerousHtml:!0},RC=new WeakMap,QSt=class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,i=e.remarkRehypeOptions;if(!(n||r||i)){let u="default";return this.keyCache.set(e,u),u}let a=u=>{if(!u||u.length===0)return"";let d="";for(let f=0;f<u.length;f+=1){let p=u[f];if(f>0&&(d+=","),Array.isArray(p)){let[y,b]=p;if(typeof y=="function"){let x=RC.get(y);x||(x=y.name,RC.set(y,x)),d+=x}else d+=String(y);d+=":",d+=JSON.stringify(b)}else if(typeof p=="function"){let y=RC.get(p);y||(y=p.name,RC.set(p,y)),d+=y}else d+=String(p)}return d},s=a(n),o=a(r),l=i?JSON.stringify(i):"",c=`${o}::${s}::${l}`;return this.keyCache.set(e,c),c}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let r=this.cache.keys().next().value;r&&this.cache.delete(r)}this.cache.set(n,t)}clear(){this.cache.clear()}},jJ=new QSt,c2e=e=>{let t=JSt(e),n=e.children||"";return tTt(t.runSync(t.parse(n),n),e)},JSt=e=>{let t=jJ.get(e);if(t)return t;let n=eTt(e);return jJ.set(e,n),n},eTt=e=>{let t=e.rehypePlugins||FJ,n=e.remarkPlugins||FJ,r=e.remarkRehypeOptions?{...BJ,...e.remarkRehypeOptions}:BJ;return Ohe().use(Che).use(n).use(Ihe,r).use(t)},tTt=(e,t)=>lhe(e,{Fragment:g.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:g.jsx,jsxs:g.jsxs,passKeys:!0,passNode:!0}),nTt=/\[\^[^\]\s]{1,200}\](?!:)/,rTt=/\[\^[^\]\s]{1,200}\]:/,iTt=/<\/(\w+)>/,aTt=/<(\w+)[\s>]/,OI=e=>{let t=0;for(;t<e.length&&(e[t]===" "||e[t]===" "||e[t]===`
|
|
2122
|
+
`)},HSt=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let[a,s]=S.useState(!1),[o,l]=S.useState(!1),c=S.useRef(null),u=S.useRef(0),{isAnimating:d}=S.useContext(Rc),f=async y=>{var b,x;if(typeof window>"u"||!((b=navigator==null?void 0:navigator.clipboard)!=null&&b.write)){r==null||r(new Error("Clipboard API not available"));return}try{let _=(x=c.current)==null?void 0:x.closest('[data-streamdown="table-wrapper"]'),E=_==null?void 0:_.querySelector("table");if(!E){r==null||r(new Error("Table not found"));return}let w=F_e(E),C=y==="csv"?B_e(w):zSt(w),k=new ClipboardItem({"text/plain":new Blob([C],{type:"text/plain"}),"text/html":new Blob([E.outerHTML],{type:"text/html"})});await navigator.clipboard.write([k]),l(!0),s(!1),n==null||n(y),u.current=window.setTimeout(()=>l(!1),i)}catch(_){r==null||r(_)}};S.useEffect(()=>{let y=b=>{let x=b.composedPath();c.current&&!x.includes(c.current)&&s(!1)};return document.addEventListener("mousedown",y),()=>{document.removeEventListener("mousedown",y),window.clearTimeout(u.current)}},[]);let p=o?sz:oz;return g.jsxs("div",{className:"relative",ref:c,children:[g.jsx("button",{className:br("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:d,onClick:()=>s(!a),title:"Copy table",type:"button",children:e??g.jsx(p,{size:14})}),a?g.jsxs("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[g.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>f("csv"),title:"Copy table as CSV",type:"button",children:"CSV"}),g.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>f("tsv"),title:"Copy table as TSV",type:"button",children:"TSV"})]}):null]})},VSt=({children:e,className:t,onDownload:n,onError:r})=>{let[i,a]=S.useState(!1),s=S.useRef(null),{isAnimating:o}=S.useContext(Rc),l=c=>{var u;try{let d=(u=s.current)==null?void 0:u.closest('[data-streamdown="table-wrapper"]'),f=d==null?void 0:d.querySelector("table");if(!f){r==null||r(new Error("Table not found"));return}let p=F_e(f),y=c==="csv"?B_e(p):USt(p);Uy(`table.${c==="csv"?"csv":"md"}`,y,c==="csv"?"text/csv":"text/markdown"),a(!1),n==null||n(c)}catch(d){r==null||r(d)}};return S.useEffect(()=>{let c=u=>{let d=u.composedPath();s.current&&!d.includes(s.current)&&a(!1)};return document.addEventListener("mousedown",c),()=>{document.removeEventListener("mousedown",c)}},[]),g.jsxs("div",{className:"relative",ref:s,children:[g.jsx("button",{className:br("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:o,onClick:()=>a(!i),title:"Download table",type:"button",children:e??g.jsx(q6,{size:14})}),i?g.jsxs("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[g.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>l("csv"),title:"Download table as CSV",type:"button",children:"CSV"}),g.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>l("markdown"),title:"Download table as Markdown",type:"button",children:"Markdown"})]}):null]})},qSt=({children:e,className:t,showControls:n,...r})=>g.jsxs("div",{className:"my-4 flex flex-col space-y-2","data-streamdown":"table-wrapper",children:[n?g.jsxs("div",{className:"flex items-center justify-end gap-1",children:[g.jsx(HSt,{}),g.jsx(VSt,{})]}):null,g.jsx("div",{className:"overflow-x-auto",children:g.jsx("table",{className:br("w-full border-collapse border border-border",t),"data-streamdown":"table",...r,children:e})})]}),GSt=S.lazy(()=>me(()=>import("./code-block-37QAKDTI-C5riIxE5.js"),[]).then(e=>({default:e.CodeBlock}))),WSt=S.lazy(()=>me(()=>Promise.resolve().then(()=>J8t),void 0).then(e=>({default:e.Mermaid}))),YSt=/language-([^\s]+)/;function G6(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,i=e.position.end,a=t.position.end;return(n==null?void 0:n.line)===(r==null?void 0:r.line)&&(n==null?void 0:n.column)===(r==null?void 0:r.column)&&(i==null?void 0:i.line)===(a==null?void 0:a.line)&&(i==null?void 0:i.column)===(a==null?void 0:a.column)}function Sa(e,t){return e.className===t.className&&G6(e.node,t.node)}var B9=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,NC=(e,t)=>{if(typeof e=="boolean")return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},cz=S.memo(({children:e,className:t,node:n,...r})=>g.jsx("ol",{className:br("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...r,children:e}),(e,t)=>Sa(e,t));cz.displayName="MarkdownOl";var j_e=S.memo(({children:e,className:t,node:n,...r})=>g.jsx("li",{className:br("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...r,children:e}),(e,t)=>e.className===t.className&&G6(e.node,t.node));j_e.displayName="MarkdownLi";var $_e=S.memo(({children:e,className:t,node:n,...r})=>g.jsx("ul",{className:br("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...r,children:e}),(e,t)=>Sa(e,t));$_e.displayName="MarkdownUl";var z_e=S.memo(({className:e,node:t,...n})=>g.jsx("hr",{className:br("my-6 border-border",e),"data-streamdown":"horizontal-rule",...n}),(e,t)=>Sa(e,t));z_e.displayName="MarkdownHr";var U_e=S.memo(({children:e,className:t,node:n,...r})=>g.jsx("span",{className:br("font-semibold",t),"data-streamdown":"strong",...r,children:e}),(e,t)=>Sa(e,t));U_e.displayName="MarkdownStrong";var KSt=({children:e,className:t,href:n,node:r,...i})=>{let{linkSafety:a}=S.useContext(Rc),[s,o]=S.useState(!1),l=n==="streamdown:incomplete-link",c=S.useCallback(async p=>{if(!(!(a!=null&&a.enabled&&n)||l)){if(p.preventDefault(),a.onLinkCheck&&await a.onLinkCheck(n)){window.open(n,"_blank","noreferrer");return}o(!0)}},[a,n,l]),u=S.useCallback(()=>{n&&window.open(n,"_blank","noreferrer")},[n]),d=S.useCallback(()=>{o(!1)},[]),f={url:n??"",isOpen:s,onClose:d,onConfirm:u};return a!=null&&a.enabled&&n?g.jsxs(g.Fragment,{children:[g.jsx("button",{className:br("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":l,"data-streamdown":"link",onClick:c,type:"button",children:e}),a.renderModal?a.renderModal(f):g.jsx(OSt,{...f})]}):g.jsx("a",{className:br("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":l,"data-streamdown":"link",href:n,rel:"noreferrer",target:"_blank",...i,children:e})},H_e=S.memo(KSt,(e,t)=>Sa(e,t)&&e.href===t.href);H_e.displayName="MarkdownA";var V_e=S.memo(({children:e,className:t,node:n,...r})=>g.jsx("h1",{className:br("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...r,children:e}),(e,t)=>Sa(e,t));V_e.displayName="MarkdownH1";var q_e=S.memo(({children:e,className:t,node:n,...r})=>g.jsx("h2",{className:br("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...r,children:e}),(e,t)=>Sa(e,t));q_e.displayName="MarkdownH2";var G_e=S.memo(({children:e,className:t,node:n,...r})=>g.jsx("h3",{className:br("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...r,children:e}),(e,t)=>Sa(e,t));G_e.displayName="MarkdownH3";var W_e=S.memo(({children:e,className:t,node:n,...r})=>g.jsx("h4",{className:br("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...r,children:e}),(e,t)=>Sa(e,t));W_e.displayName="MarkdownH4";var Y_e=S.memo(({children:e,className:t,node:n,...r})=>g.jsx("h5",{className:br("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...r,children:e}),(e,t)=>Sa(e,t));Y_e.displayName="MarkdownH5";var K_e=S.memo(({children:e,className:t,node:n,...r})=>g.jsx("h6",{className:br("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...r,children:e}),(e,t)=>Sa(e,t));K_e.displayName="MarkdownH6";var Z_e=S.memo(({children:e,className:t,node:n,...r})=>{let{controls:i}=S.useContext(Rc),a=B9(i,"table");return g.jsx(qSt,{className:t,showControls:a,...r,children:e})},(e,t)=>Sa(e,t));Z_e.displayName="MarkdownTable";var X_e=S.memo(({children:e,className:t,node:n,...r})=>g.jsx("thead",{className:br("bg-muted/80",t),"data-streamdown":"table-header",...r,children:e}),(e,t)=>Sa(e,t));X_e.displayName="MarkdownThead";var Q_e=S.memo(({children:e,className:t,node:n,...r})=>g.jsx("tbody",{className:br("divide-y divide-border bg-muted/40",t),"data-streamdown":"table-body",...r,children:e}),(e,t)=>Sa(e,t));Q_e.displayName="MarkdownTbody";var J_e=S.memo(({children:e,className:t,node:n,...r})=>g.jsx("tr",{className:br("border-border border-b",t),"data-streamdown":"table-row",...r,children:e}),(e,t)=>Sa(e,t));J_e.displayName="MarkdownTr";var e2e=S.memo(({children:e,className:t,node:n,...r})=>g.jsx("th",{className:br("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...r,children:e}),(e,t)=>Sa(e,t));e2e.displayName="MarkdownTh";var t2e=S.memo(({children:e,className:t,node:n,...r})=>g.jsx("td",{className:br("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...r,children:e}),(e,t)=>Sa(e,t));t2e.displayName="MarkdownTd";var n2e=S.memo(({children:e,className:t,node:n,...r})=>g.jsx("blockquote",{className:br("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...r,children:e}),(e,t)=>Sa(e,t));n2e.displayName="MarkdownBlockquote";var r2e=S.memo(({children:e,className:t,node:n,...r})=>g.jsx("sup",{className:br("text-sm",t),"data-streamdown":"superscript",...r,children:e}),(e,t)=>Sa(e,t));r2e.displayName="MarkdownSup";var i2e=S.memo(({children:e,className:t,node:n,...r})=>g.jsx("sub",{className:br("text-sm",t),"data-streamdown":"subscript",...r,children:e}),(e,t)=>Sa(e,t));i2e.displayName="MarkdownSub";var a2e=S.memo(({children:e,className:t,node:n,...r})=>{if("data-footnotes"in r){let i=s=>{var o,l;if(!S.isValidElement(s))return!1;let c=Array.isArray(s.props.children)?s.props.children:[s.props.children],u=!1,d=!1;for(let f of c)if(f){if(typeof f=="string")f.trim()!==""&&(u=!0);else if(S.isValidElement(f))if(((o=f.props)==null?void 0:o["data-footnote-backref"])!==void 0)d=!0;else{let p=Array.isArray(f.props.children)?f.props.children:[f.props.children];for(let y of p){if(typeof y=="string"&&y.trim()!==""){u=!0;break}if(S.isValidElement(y)&&((l=y.props)==null?void 0:l["data-footnote-backref"])===void 0){u=!0;break}}}}return d&&!u},a=Array.isArray(e)?e.map(s=>{if(!S.isValidElement(s))return s;if(s.type===cz){let o=(Array.isArray(s.props.children)?s.props.children:[s.props.children]).filter(l=>!i(l));return o.length===0?null:{...s,props:{...s.props,children:o}}}return s}):e;return(Array.isArray(a)?a.some(s=>s!==null):a!==null)?g.jsx("section",{className:t,...r,children:a}):null}return g.jsx("section",{className:t,...r,children:e})},(e,t)=>Sa(e,t));a2e.displayName="MarkdownSection";var ZSt=({node:e,className:t,children:n,...r})=>{var i,a,s;let o=((i=e==null?void 0:e.position)==null?void 0:i.start.line)===((a=e==null?void 0:e.position)==null?void 0:a.end.line),{mermaid:l,controls:c}=S.useContext(Rc),u=lz();if(o)return g.jsx("code",{className:br("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),"data-streamdown":"inline-code",...r,children:n});let d=t==null?void 0:t.match(YSt),f=(s=d==null?void 0:d.at(1))!=null?s:"",p="";if(S.isValidElement(n)&&n.props&&typeof n.props=="object"&&"children"in n.props&&typeof n.props.children=="string"?p=n.props.children:typeof n=="string"&&(p=n),f==="mermaid"&&u){let b=B9(c,"mermaid"),x=NC(c,"download"),_=NC(c,"copy"),E=NC(c,"fullscreen"),w=NC(c,"panZoom"),C=b&&(x||_||E);return g.jsx(S.Suspense,{fallback:g.jsx(PJ,{}),children:g.jsxs("div",{className:br("group relative my-4 h-auto rounded-xl border p-4",t),"data-streamdown":"mermaid-block",children:[C?g.jsxs("div",{className:"flex items-center justify-end gap-2",children:[x?g.jsx(FSt,{chart:p,config:l==null?void 0:l.config}):null,_?g.jsx(LJ,{code:p}):null,E?g.jsx($St,{chart:p,config:l==null?void 0:l.config}):null]}):null,g.jsx(WSt,{chart:p,config:l==null?void 0:l.config,showControls:w})]})})}let y=B9(c,"code");return g.jsx(S.Suspense,{fallback:g.jsx(PJ,{}),children:g.jsx(GSt,{className:br("overflow-x-auto border-border border-t",t),code:p,language:f,children:y?g.jsxs(g.Fragment,{children:[g.jsx(RSt,{code:p,language:f}),g.jsx(LJ,{})]}):null})})},s2e=S.memo(ZSt,(e,t)=>e.className===t.className&&G6(e.node,t.node));s2e.displayName="MarkdownCode";var o2e=S.memo(MSt,(e,t)=>e.className===t.className&&G6(e.node,t.node));o2e.displayName="MarkdownImg";var l2e=S.memo(({children:e,className:t,node:n,...r})=>{var i,a;let s=(Array.isArray(e)?e:[e]).filter(o=>o!=null&&o!=="");if(s.length===1&&S.isValidElement(s[0])){let o=s[0].props.node,l=o==null?void 0:o.tagName;if(l==="img")return g.jsx(g.Fragment,{children:e});if(l==="code"&&((i=o==null?void 0:o.position)==null?void 0:i.start.line)!==((a=o==null?void 0:o.position)==null?void 0:a.end.line))return g.jsx(g.Fragment,{children:e})}return g.jsx("p",{className:t,...r,children:e})},(e,t)=>Sa(e,t));l2e.displayName="MarkdownParagraph";var XSt={ol:cz,li:j_e,ul:$_e,hr:z_e,strong:U_e,a:H_e,h1:V_e,h2:q_e,h3:G_e,h4:W_e,h5:Y_e,h6:K_e,table:Z_e,thead:X_e,tbody:Q_e,tr:J_e,th:e2e,td:t2e,blockquote:n2e,code:s2e,img:o2e,pre:({children:e})=>e,sup:r2e,sub:i2e,p:l2e,section:a2e},FJ=[],BJ={allowDangerousHtml:!0},RC=new WeakMap,QSt=class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,i=e.remarkRehypeOptions;if(!(n||r||i)){let u="default";return this.keyCache.set(e,u),u}let a=u=>{if(!u||u.length===0)return"";let d="";for(let f=0;f<u.length;f+=1){let p=u[f];if(f>0&&(d+=","),Array.isArray(p)){let[y,b]=p;if(typeof y=="function"){let x=RC.get(y);x||(x=y.name,RC.set(y,x)),d+=x}else d+=String(y);d+=":",d+=JSON.stringify(b)}else if(typeof p=="function"){let y=RC.get(p);y||(y=p.name,RC.set(p,y)),d+=y}else d+=String(p)}return d},s=a(n),o=a(r),l=i?JSON.stringify(i):"",c=`${o}::${s}::${l}`;return this.keyCache.set(e,c),c}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let r=this.cache.keys().next().value;r&&this.cache.delete(r)}this.cache.set(n,t)}clear(){this.cache.clear()}},jJ=new QSt,c2e=e=>{let t=JSt(e),n=e.children||"";return tTt(t.runSync(t.parse(n),n),e)},JSt=e=>{let t=jJ.get(e);if(t)return t;let n=eTt(e);return jJ.set(e,n),n},eTt=e=>{let t=e.rehypePlugins||FJ,n=e.remarkPlugins||FJ,r=e.remarkRehypeOptions?{...BJ,...e.remarkRehypeOptions}:BJ;return Ohe().use(Che).use(n).use(Ihe,r).use(t)},tTt=(e,t)=>lhe(e,{Fragment:g.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:g.jsx,jsxs:g.jsxs,passKeys:!0,passNode:!0}),nTt=/\[\^[^\]\s]{1,200}\](?!:)/,rTt=/\[\^[^\]\s]{1,200}\]:/,iTt=/<\/(\w+)>/,aTt=/<(\w+)[\s>]/,OI=e=>{let t=0;for(;t<e.length&&(e[t]===" "||e[t]===" "||e[t]===`
|
|
2123
2123
|
`||e[t]==="\r");)t+=1;return t+1<e.length&&e[t]==="$"&&e[t+1]==="$"},sTt=e=>{let t=e.length-1;for(;t>=0&&(e[t]===" "||e[t]===" "||e[t]===`
|
|
2124
2124
|
`||e[t]==="\r");)t-=1;return t>=1&&e[t]==="$"&&e[t-1]==="$"},PI=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]==="$"&&e[n+1]==="$"&&(t+=1,n+=1);return t},oTt=e=>{let t=nTt.test(e),n=rTt.test(e);if(t||n)return[e];let r=pc.lex(e,{gfm:!0}),i=[],a=[];for(let s of r){let o=s.raw,l=i.length;if(a.length>0){if(i[l-1]+=o,s.type==="html"){let c=o.match(iTt);if(c){let u=c[1];a.at(-1)===u&&a.pop()}}continue}if(s.type==="html"&&s.block){let c=o.match(aTt);if(c){let u=c[1];o.includes(`</${u}>`)||a.push(u)}}if(o.trim()==="$$"&&l>0){let c=i[l-1],u=OI(c),d=PI(c);if(u&&d%2===1){i[l-1]=c+o;continue}}if(l>0&&sTt(o)){let c=i[l-1],u=OI(c),d=PI(c),f=PI(o);if(u&&d%2===1&&!OI(o)&&f===1){i[l-1]=c+o;continue}}i.push(o)}return i},lTt={raw:EEt,sanitize:[MEt,{}],harden:[mxt,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},cTt={gfm:[ofe,{}]},uTt=Object.values(lTt),dTt=Object.values(cTt),hTt={block:" ▋",circle:" ●"},fTt={shikiTheme:["github-light","github-dark"],controls:!0,isAnimating:!1,mode:"streaming",mermaid:void 0,linkSafety:{enabled:!0}},Rc=S.createContext(fTt),u2e=S.memo(({content:e,shouldParseIncompleteMarkdown:t,index:n,...r})=>g.jsx(c2e,{...r,children:e}),(e,t)=>{if(e.content!==t.content||e.index!==t.index)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(i=>{var a,s;return((a=e.components)==null?void 0:a[i])!==((s=t.components)==null?void 0:s[i])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});u2e.displayName="Block";var pTt=["github-light","github-dark"],d2e=S.memo(({children:e,mode:t="streaming",parseIncompleteMarkdown:n=!0,components:r,rehypePlugins:i=uTt,remarkPlugins:a=dTt,className:s,shikiTheme:o=pTt,mermaid:l,controls:c=!0,isAnimating:u=!1,BlockComponent:d=u2e,parseMarkdownIntoBlocksFn:f=oTt,caret:p,plugins:y,remend:b,linkSafety:x={enabled:!0},..._})=>{let E=S.useId(),[w,C]=S.useTransition(),k=S.useMemo(()=>typeof e!="string"?"":t==="streaming"&&n?Pwt(e,b):e,[e,t,n,b]),N=S.useMemo(()=>f(k),[k,f]),[R,L]=S.useState(N);S.useEffect(()=>{t==="streaming"?C(()=>{L(N)}):L(N)},[N,t]);let j=t==="streaming"?R:N,B=S.useMemo(()=>j.map((z,G)=>`${E}-${G}`),[j.length,E]),F=S.useMemo(()=>{var z,G;return{shikiTheme:(G=(z=y==null?void 0:y.code)==null?void 0:z.getThemes())!=null?G:o,controls:c,isAnimating:u,mode:t,mermaid:l,linkSafety:x}},[o,c,u,t,l,x,y==null?void 0:y.code]),q=S.useMemo(()=>({...XSt,...r}),[r]),Q=S.useMemo(()=>{let z=[];return y!=null&&y.cjk&&(z=[...z,...y.cjk.remarkPluginsBefore]),z=[...z,...a],y!=null&&y.cjk&&(z=[...z,...y.cjk.remarkPluginsAfter]),y!=null&&y.math&&(z=[...z,y.math.remarkPlugin]),z},[a,y==null?void 0:y.math,y==null?void 0:y.cjk]),I=S.useMemo(()=>y!=null&&y.math?[...i,y.math.rehypePlugin]:i,[i,y==null?void 0:y.math]),V=S.useMemo(()=>p&&u?{"--streamdown-caret":`"${hTt[p]}"`}:void 0,[p,u]);return t==="static"?g.jsx(F9.Provider,{value:y??null,children:g.jsx(Rc.Provider,{value:F,children:g.jsx("div",{className:br("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",s),children:g.jsx(c2e,{components:q,rehypePlugins:I,remarkPlugins:Q,..._,children:e})})})}):g.jsx(F9.Provider,{value:y??null,children:g.jsx(Rc.Provider,{value:F,children:g.jsxs("div",{className:br("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",p?"*:last:after:inline *:last:after:align-baseline *:last:after:content-(--streamdown-caret)":null,s),style:V,children:[j.length===0&&p&&u&&g.jsx("span",{}),j.map((z,G)=>g.jsx(d,{components:q,content:z,index:G,rehypePlugins:I,remarkPlugins:Q,shouldParseIncompleteMarkdown:n,..._},B[G]))]})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety);d2e.displayName="Streamdown";var mTt=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:i=.1,showControls:a=!0,initialZoom:s=1,fullscreen:o=!1})=>{let l=S.useRef(null),c=S.useRef(null),[u,d]=S.useState(s),[f,p]=S.useState({x:0,y:0}),[y,b]=S.useState(!1),[x,_]=S.useState({x:0,y:0}),[E,w]=S.useState({x:0,y:0}),C=S.useCallback(q=>{d(Q=>Math.max(n,Math.min(r,Q+q)))},[n,r]),k=S.useCallback(()=>{C(i)},[C,i]),N=S.useCallback(()=>{C(-i)},[C,i]),R=S.useCallback(()=>{d(s),p({x:0,y:0})},[s]),L=S.useCallback(q=>{q.preventDefault();let Q=q.deltaY>0?-i:i;C(Q)},[C,i]),j=S.useCallback(q=>{if(q.button!==0||q.isPrimary===!1)return;b(!0),_({x:q.clientX,y:q.clientY}),w(f);let Q=q.currentTarget;Q instanceof HTMLElement&&Q.setPointerCapture(q.pointerId)},[f]),B=S.useCallback(q=>{if(!y)return;q.preventDefault();let Q=q.clientX-x.x,I=q.clientY-x.y;p({x:E.x+Q,y:E.y+I})},[y,x,E]),F=S.useCallback(q=>{b(!1);let Q=q.currentTarget;Q instanceof HTMLElement&&Q.releasePointerCapture(q.pointerId)},[]);return S.useEffect(()=>{let q=l.current;if(q)return q.addEventListener("wheel",L,{passive:!1}),()=>{q.removeEventListener("wheel",L)}},[L]),S.useEffect(()=>{let q=c.current;if(q&&y)return document.body.style.userSelect="none",q.addEventListener("pointermove",B,{passive:!1}),q.addEventListener("pointerup",F),q.addEventListener("pointercancel",F),()=>{document.body.style.userSelect="",q.removeEventListener("pointermove",B),q.removeEventListener("pointerup",F),q.removeEventListener("pointercancel",F)}},[y,B,F]),g.jsxs("div",{className:br("relative flex flex-col",o?"h-full w-full":"min-h-28 w-full",t),ref:l,style:{cursor:y?"grabbing":"grab"},children:[a?g.jsxs("div",{className:br("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/90 p-1 shadow-sm backdrop-blur-sm",o?"bottom-4 left-4":"bottom-2 left-2"),children:[g.jsx("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",disabled:u>=r,onClick:k,title:"Zoom in",type:"button",children:g.jsx(ASt,{size:16})}),g.jsx("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",disabled:u<=n,onClick:N,title:"Zoom out",type:"button",children:g.jsx(kSt,{size:16})}),g.jsx("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",onClick:R,title:"Reset zoom and pan",type:"button",children:g.jsx(CSt,{size:16})})]}):null,g.jsx("div",{className:br("flex-1 origin-center transition-transform duration-150 ease-out",o?"flex h-full w-full items-center justify-center":"flex w-full items-center justify-center"),onPointerDown:j,ref:c,role:"application",style:{transform:`translate(${f.x}px, ${f.y}px) scale(${u})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},h2e=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let[a,s]=S.useState(null),[o,l]=S.useState(!1),[c,u]=S.useState(""),[d,f]=S.useState(""),[p,y]=S.useState(0),{mermaid:b}=S.useContext(Rc),x=lz(),_=b==null?void 0:b.errorComponent,{shouldRender:E,containerRef:w}=wSt({immediate:r});if(S.useEffect(()=>{if(E){if(!x){s("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{s(null),l(!0);let k=x.getMermaid(n),N=e.split("").reduce((j,B)=>(j<<5)-j+B.charCodeAt(0)|0,0),R=`mermaid-${Math.abs(N)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:L}=await k.render(R,e);u(L),f(L)}catch(k){if(!(d||c)){let N=k instanceof Error?k.message:"Failed to render Mermaid chart";s(N)}}finally{l(!1)}})()}},[e,n,p,E,x]),!(E||c||d))return g.jsx("div",{className:br("my-4 min-h-[200px]",t),ref:w});if(o&&!c&&!d)return g.jsx("div",{className:br("my-4 flex justify-center p-4",t),ref:w,children:g.jsxs("div",{className:"flex items-center space-x-2 text-muted-foreground",children:[g.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-current border-b-2"}),g.jsx("span",{className:"text-sm",children:"Loading diagram..."})]})});if(a&&!c&&!d){let k=()=>y(N=>N+1);return _?g.jsx("div",{ref:w,children:g.jsx(_,{chart:e,error:a,retry:k})}):g.jsxs("div",{className:br("rounded-lg border border-red-200 bg-red-50 p-4",t),ref:w,children:[g.jsxs("p",{className:"font-mono text-red-700 text-sm",children:["Mermaid Error: ",a]}),g.jsxs("details",{className:"mt-2",children:[g.jsx("summary",{className:"cursor-pointer text-red-600 text-xs",children:"Show Code"}),g.jsx("pre",{className:"mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs",children:e})]})]})}let C=c||d;return g.jsx("div",{className:br("size-full",t),"data-streamdown":"mermaid",ref:w,children:g.jsx(mTt,{className:br(r?"size-full overflow-hidden":"my-4 overflow-hidden",t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:i,zoomStep:.1,children:g.jsx("div",{"aria-label":"Mermaid chart",className:br("flex justify-center",r?"size-full items-center":null),dangerouslySetInnerHTML:{__html:C},role:"img"})})})};const f2e=S.createContext(null),gTt=()=>{const e=S.useContext(f2e);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},yTt=1e3,bTt=1e3,p2e=S.memo(({className:e,isStreaming:t=!1,open:n,defaultOpen:r=!0,onOpenChange:i,duration:a,children:s,...o})=>{const[l,c]=Cs({prop:n,defaultProp:r,onChange:i}),[u,d]=Cs({prop:a,defaultProp:void 0}),[f,p]=S.useState(!1),[y,b]=S.useState(null);S.useEffect(()=>{t?y===null&&b(Date.now()):y!==null&&(d(Math.ceil((Date.now()-y)/bTt)),b(null))},[t,y,d]),S.useEffect(()=>{if(r&&!t&&l&&!f){const _=setTimeout(()=>{c(!1),p(!0)},yTt);return()=>clearTimeout(_)}},[t,l,r,c,f]);const x=_=>{c(_)};return g.jsx(f2e.Provider,{value:{isStreaming:t,isOpen:l,setIsOpen:c,duration:u},children:g.jsx(qh,{className:ke("not-prose mb-4",e),onOpenChange:x,open:l,...o,children:s})})}),vTt=(e,t)=>e||t===0?g.jsx(w$,{duration:1,children:"Thinking..."}):t===void 0?g.jsx("p",{children:"Thought for a few seconds"}):g.jsxs("p",{children:["Thought for ",t," seconds"]}),m2e=S.memo(({className:e,children:t,getThinkingMessage:n=vTt,...r})=>{const{isStreaming:i,isOpen:a,duration:s}=gTt();return g.jsx(ug,{className:ke("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...r,children:t??g.jsxs(g.Fragment,{children:[g.jsx(BP,{className:"size-4"}),n(i,s),g.jsx(Cd,{className:ke("size-4 transition-transform",a?"rotate-180":"rotate-0")})]})})}),g2e=S.memo(({className:e,children:t,...n})=>g.jsx(dg,{className:ke("mt-4 text-sm [&_p]:whitespace-pre-wrap [&_li]:whitespace-pre-wrap [&_blockquote]:whitespace-pre-wrap","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...n,children:g.jsx(d2e,{plugins:{code:ebt,mermaid:pxt,math:hxt,cjk:Kyt},remarkPlugins:[lfe],...n,children:t})}));p2e.displayName="Reasoning";m2e.displayName="ReasoningTrigger";g2e.displayName="ReasoningContent";const xTt=new Set(["claude","copilot","codex","gemini","cursor","windsurf","opencode","amp","antigravity"]),_Tt=new Set(["cursor","codex","copilot","windsurf"]),Zx={bg:"bg-muted",text:"text-foreground"},ETt=new Set(["claude","copilot","codex","opencode","aider","cline","gemini","cursor","windsurf","droid","kiro","kimi","qodo","amp","trae","qwen-code","goose","openhands","continue","crush","roo","codebuddy","kilo","augment","antigravity"]);function wTt(e){return e==="qwen-code"?"QC":e==="copilot"?"GH":e==="opencode"?"OC":e==="openhands"?"OH":e==="codebuddy"?"CB":e.charAt(0).toUpperCase()}const uz=({runnerId:e,size:t=40,showFallback:n=!0,className:r,...i})=>{const[a,s]=S.useState(!1),o=xTt.has(e)&&!a,l=ETt.has(e),c=wTt(e),u=Math.round(t*.5),d=t<=32?"text-xs":t<=48?"text-sm":"text-base";return!n&&!l?null:o?_Tt.has(e)?g.jsx("div",{className:ke("shrink-0 rounded-md flex items-center justify-center overflow-hidden",Zx.bg,Zx.text,r),style:{width:t,height:t},...i,children:g.jsx("div",{className:"w-3/5 h-3/5 bg-current",style:{maskImage:`url(/icons/runners/${e}.svg)`,maskSize:"contain",maskPosition:"center",maskRepeat:"no-repeat",WebkitMaskImage:`url(/icons/runners/${e}.svg)`,WebkitMaskSize:"contain",WebkitMaskPosition:"center",WebkitMaskRepeat:"no-repeat"}})}):g.jsx("div",{className:ke("shrink-0 rounded-md flex items-center justify-center overflow-hidden",Zx.bg,r),style:{width:t,height:t},...i,children:g.jsx("img",{src:`/icons/runners/${e}.svg`,alt:`${e} logo`,className:ke("w-3/5 h-3/5 object-contain"),style:{filter:"var(--runner-icon-filter, none)"},onError:()=>s(!0)})}):g.jsx("div",{className:ke("shrink-0 rounded-md flex items-center justify-center font-semibold",Zx.bg,Zx.text,d,r),style:{width:t,height:t},...i,children:l?c:g.jsx(eie,{style:{width:u,height:u}})})},y2e=500,STt=e=>{try{const t=new WeakSet;return JSON.stringify(e,(n,r)=>{if(typeof r=="bigint")return r.toString();if(typeof r=="object"&&r!==null){if(t.has(r))return"[Circular]";t.add(r)}return r},2)}catch(t){return String(t instanceof Error?t.message:e)}},b2e=e=>typeof e=="string"?e:STt(e),TTt=(e,t=y2e)=>{const n=e.split(`
|
|
2125
2125
|
`),r=n.length;if(t<=0||r<=t)return{fullText:e,truncatedText:e,isTruncated:!1,totalLines:r,hiddenLines:0};const i=n.slice(0,t).join(`
|
|
@@ -2132,7 +2132,7 @@ Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error
|
|
|
2132
2132
|
|
|
2133
2133
|
`):Ro(e)?typeof e.text=="string"?e.text:typeof e.content=="string"?e.content:"":""}function p5t(e){if(e.result!==void 0)return e.result;const t=e.content;if(Array.isArray(t)){for(const n of t)if(Ro(n)){if(n.content!==void 0)return n.content;if(n.result!==void 0)return n.result;if(n.text!==void 0)return n.text}return t}return Ro(t)?t.content!==void 0?t.content:t.text!==void 0?t.text:t:null}function dP(e,t,n){if(!Ro(t))return null;if(e==="session/request_permission")return{type:"acp_permission_request",timestamp:n,id:Ua(t.id),tool:Ua(t.tool),args:uP(t.args),options:f0(t.options).filter(a=>typeof a=="string")};if(e!=="session/update")return null;const r=f5t(t.update)??t,i=Ua(r.sessionUpdate??r.type);if(i==="agent_message_chunk"||i==="user_message_chunk"){const a=f0(r.content),s=OE(r.content??r.text);return{type:"acp_message",timestamp:n,role:i==="user_message_chunk"?"user":"agent",content:s,done:v4(r.done),contentBlocks:a,rawContent:r.content}}if(i==="agent_thought_chunk"){const a=f0(r.content),s=OE(r.content??r.text);return{type:"acp_thought",timestamp:n,content:s,done:v4(r.done),contentBlocks:a,rawContent:r.content}}return i==="tool_call"||i==="tool_call_update"?{type:"acp_tool_call",timestamp:n,id:Ua(r.toolCallId??r.id),tool:Ua(r.title??r.toolName??r.tool??r.name),args:uP(r.args??r.rawInput??r.input??r.arguments),status:lwe(r.status),result:p5t(r),rawContent:r.content}:i==="plan"?{type:"acp_plan",timestamp:n,entries:f0(r.entries).map((a,s)=>Ro(a)?{id:Ua(a.id,String(s)),title:Ua(a.title),status:cwe(a.status)}:{id:String(s),title:"",status:"pending"}),done:typeof r.done=="boolean"?r.done:void 0}:i==="current_mode_update"?{type:"acp_mode_update",timestamp:n,mode:Ua(r.mode)}:null}function uwe(e){if(!Ro(e))return null;const t=Ua(e.type);if(!d5t.has(t))return null;switch(t){case"log":return{type:"log",timestamp:Ua(e.timestamp),level:Ua(e.level),message:Ua(e.message)};case"complete":return{type:"complete",status:Ua(e.status),duration_ms:typeof e.duration_ms=="number"?e.duration_ms:0};default:return null}}function dwe(e){const t=Ua(e.type),n=x4(e.timestamp);if(t==="acp_message"){const r=Ua(e.role);if(r==="user"||r==="agent")return{type:"acp_message",timestamp:n,role:r,content:OE(e.content),done:v4(e.done),contentBlocks:f0(e.contentBlocks??e.content),rawContent:e.content}}return t==="acp_thought"?{type:"acp_thought",timestamp:n,content:OE(e.content),done:v4(e.done),contentBlocks:f0(e.contentBlocks??e.content),rawContent:e.content}:t==="acp_tool_call"?{type:"acp_tool_call",timestamp:n,id:Ua(e.id),tool:Ua(e.toolName??e.tool??e.name),args:uP(e.args??e.rawInput??e.input??e.arguments),status:lwe(e.status),result:e.result??null,rawContent:e.content}:t==="acp_plan"?{type:"acp_plan",timestamp:n,entries:f0(e.entries).map((r,i)=>Ro(r)?{id:Ua(r.id,String(i)),title:Ua(r.title),status:cwe(r.status)}:{id:String(i),title:"",status:"pending"}),done:typeof e.done=="boolean"?e.done:void 0}:null}function bOt(e){if(Ro(e)&&typeof e.__acp_method=="string"){const n=dP(e.__acp_method,e.params,x4(e.timestamp));if(n)return n}if(Ro(e)){const n=dwe(e);if(n)return n}const t=uwe(e);if(t)return t;if(Ro(e)&&e.type==="log"&&typeof e.message=="string"){const n=e.message,r=n.indexOf("{");if(r>=0)try{const i=JSON.parse(n.slice(r));if(Ro(i)&&typeof i.__acp_method=="string"){const a=dP(i.__acp_method,i.params,x4(e.timestamp));if(a)return a}}catch{}}return null}function m5t(e){let t=null;const n=e.message.indexOf("{");if(n>=0)try{const i=e.message.slice(n);t=JSON.parse(i)}catch{t=null}if(Ro(t)&&typeof t.__acp_method=="string"){const i=dP(t.__acp_method,t.params,x4(t.timestamp)??e.timestamp);if(i)return i}if(Ro(t)){const i=dwe(t);if(i)return i}const r=uwe(t);return r?"timestamp"in r&&!r.timestamp?{...r,timestamp:e.timestamp}:r:{type:"log",timestamp:e.timestamp,level:e.level,message:e.message}}function g5t(e,t){var i;const n=[...e],r=n[n.length-1];if(t.type==="acp_message")for(let a=n.length-1;a>=0;a--){const s=n[a];if((s==null?void 0:s.type)==="acp_message"){if(s.role===t.role&&(!s.done||s._autoClosed)){const o={...s,content:`${s.content}${t.content}`,done:t.done,timestamp:t.timestamp??s.timestamp};return delete o._autoClosed,n[a]=o,n}break}}if(t.type==="acp_thought")for(let a=n.length-1;a>=0;a--){const s=n[a];if((s==null?void 0:s.type)==="acp_thought"&&(!s.done||s._autoClosed)){let o="";const l=s.content||"",c=t.content||"";l&&c&&/[^\s\n]$/.test(l)&&/^[^\s\n]/.test(c)&&(/^[*_`~]+$/.test(c)||(/[a-zA-Z0-9.,*_"']$/.test(l)&&/^[A-Z]/.test(c)||l.endsWith(c))&&(o=`
|
|
2134
2134
|
|
|
2135
|
-
`));const u={...s,content:`${l}${o}${c}`,done:t.done,timestamp:t.timestamp??s.timestamp};return delete u._autoClosed,n[a]=u,n}if((s==null?void 0:s.type)==="acp_message"||(s==null?void 0:s.type)==="acp_tool_call"&&(s.status==="completed"||s.status==="failed"))break}if(t.type!=="acp_thought"&&(r==null?void 0:r.type)==="acp_thought"&&!r.done&&(n[n.length-1]={...r,done:!0},n[n.length-1]._autoClosed=!0),t.type!=="acp_message"&&(r==null?void 0:r.type)==="acp_message"&&!r.done&&(n[n.length-1]={...r,done:!0},n[n.length-1]._autoClosed=!0),t.type==="complete")for(let a=0;a<n.length;a++){const s=n[a];((s==null?void 0:s.type)==="acp_thought"||(s==null?void 0:s.type)==="acp_message")&&!s.done&&(n[a]={...s,done:!0})}if(t.type==="acp_tool_call"){const a=n.findIndex(s=>s.type==="acp_tool_call"&&s.id===t.id);if(a>=0){const s=n[a];return s.type==="acp_tool_call"&&(n[a]={...s,...t,args:Object.keys(t.args).length>0?t.args:s.args,result:t.result??s.result}),n}}if(t.type==="acp_plan"){let a=-1;for(let s=n.length-1;s>=0;s-=1)if(((i=n[s])==null?void 0:i.type)==="acp_plan"){a=s;break}if(a>=0)return n[a]=t,n}return n.push(t),n}function vOt(e){let t=!1;const n=e.map(r=>(r.type==="acp_thought"||r.type==="acp_message")&&!r.done?(t=!0,{...r,done:!0}):r);return t?n:e}function y5t({sessionId:e,onBack:t}){var E;const{t:n}=Hn("common"),{currentProject:r}=Qa(),{stopSession:i,pauseSession:a}=awe((r==null?void 0:r.id)??null),[s,o]=S.useState(null),[l,c]=S.useState([]),[u,d]=S.useState([]),[f,p]=S.useState(!0),[y,b]=S.useState(!0),x=S.useRef(null);if(S.useEffect(()=>{const w=async()=>{try{const k=await gn.getSession(e);o(k);const N=await gn.getSessionLogs(e);c(N);const R=N.slice().reverse().reduce((L,j)=>g5t(L,m5t(j)),[]);d(R)}finally{p(!1)}};w();const C=setInterval(w,2e3);return()=>clearInterval(C)},[e]),S.useEffect(()=>{y&&x.current&&(x.current.scrollTop=x.current.scrollHeight)},[l,y]),f&&!s)return g.jsx("div",{className:"p-4 text-xs",children:n("actions.loading")});const _=h5t(s);return g.jsxs("div",{className:"flex flex-col h-full",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2 p-1",children:[g.jsx(ct,{variant:"ghost",size:"icon",onClick:t,className:"h-8 w-8",children:g.jsx(FP,{className:"h-4 w-4"})}),g.jsxs("div",{className:"font-semibold text-sm truncate",children:[s==null?void 0:s.runner,(((E=s==null?void 0:s.specIds)==null?void 0:E.length)??0)>0?` • #${s==null?void 0:s.specIds[0]}`:""]}),g.jsx("div",{className:"ml-auto rounded-full border border-border px-2 py-0.5 text-[10px] text-muted-foreground",children:n(_?"sessions.labels.protocolAcp":"sessions.labels.protocolCli")})]}),g.jsx("div",{className:"flex items-center gap-2 mb-2 px-1",children:(s==null?void 0:s.status)==="running"&&g.jsxs(g.Fragment,{children:[g.jsxs(ct,{size:"sm",variant:"outline",className:"h-7 text-xs flex-1",onClick:()=>s&&a(s.id),children:[g.jsx(UP,{className:"h-3 w-3 mr-1"})," ",n("sessions.actions.pause")]}),g.jsxs(ct,{size:"sm",variant:"destructive",className:"h-7 text-xs flex-1",onClick:()=>s&&i(s.id),children:[g.jsx(dk,{className:"h-3 w-3 mr-1"})," ",n("sessions.actions.stop")]})]})}),g.jsxs("div",{className:"flex items-center justify-between mb-2 px-1",children:[g.jsx("div",{className:"text-xs font-semibold",children:n("sessions.labels.logs")}),g.jsxs("div",{className:"flex gap-1",children:[g.jsx(ct,{size:"icon",variant:"ghost",className:"h-6 w-6",children:g.jsx(Wre,{className:"h-3 w-3"})}),g.jsx(ct,{size:"sm",variant:y?"secondary":"ghost",className:"h-6 text-[10px] px-2",onClick:()=>b(!y),children:n("sessions.labels.autoScroll")})]})]}),_?g.jsx("div",{className:"flex-1 min-h-0",children:g.jsx(u5t,{events:u,loading:f,emptyTitle:n("sessions.emptyLogs"),emptyDescription:n("sessionDetail.logsDescription")})}):g.jsx("div",{ref:x,className:"flex-1 bg-muted/50 rounded-md p-2 overflow-y-auto text-[10px] font-mono whitespace-pre-wrap",children:l.map(w=>{var C;return g.jsxs("div",{className:"mb-1",children:[g.jsxs("span",{className:"text-muted-foreground",children:["[",(C=w.timestamp.split("T")[1])==null?void 0:C.split(".")[0],"]"]})," ",g.jsx("span",{className:ke("font-bold",w.level==="error"?"text-red-500":"text-blue-500"),children:w.level.toUpperCase()})," ",g.jsx("span",{children:w.message})]},`${w.timestamp}-${w.id}`)})})]})}function kte(e){return e.status==="running"||e.status==="paused"}function b5t(){const{t:e}=Hn("common"),t=ql(),{currentProject:n}=Qa(),{data:r=[]}=nN((n==null?void 0:n.id)??null),{pauseSession:i,resumeSession:a,stopSession:s}=awe((n==null?void 0:n.id)??null),{isDrawerOpen:o,specFilter:l,createDialogNonce:c,openDrawer:u,closeDrawer:d,setSpecFilter:f}=Nz(),[p,y]=S.useState(!1),[b,x]=S.useState(!1),[_,E]=S.useState(null),w=S.useRef(c);S.useEffect(()=>{o&&!p&&y(!0)},[o]),S.useEffect(()=>{c!==w.current&&(w.current=c,y(!1),x(!0))},[c]);const C=S.useCallback(q=>{y(q),q?u():(d(),f(null))},[d,u,f]),k=S.useMemo(()=>(l?r.filter(Q=>{var I;return((I=Q.specIds)==null?void 0:I.some(V=>V===l||V.includes(l)))??!1}):r.filter(kte)).sort((Q,I)=>new Date(I.startedAt).getTime()-new Date(Q.startedAt).getTime()),[r,l]),N=S.useMemo(()=>r.filter(kte).sort((q,Q)=>new Date(Q.startedAt).getTime()-new Date(q.startedAt).getTime()),[r]),R=S.useMemo(()=>N.filter(q=>q.status==="running").length,[N]),L=S.useMemo(()=>N.filter(q=>q.status==="pending").length,[N]),j=R>0||L>0,B=()=>{if(!(n!=null&&n.id))return;C(!1);const q=l?`/projects/${n.id}/sessions?spec=${l}`:`/projects/${n.id}/sessions`;t(q)},F=()=>{C(!1),setTimeout(()=>{x(!0)},200)};return g.jsxs(g.Fragment,{children:[g.jsxs(Mc,{open:p,onOpenChange:C,children:[g.jsxs(Qo,{children:[g.jsx(Jo,{asChild:!0,children:g.jsx(Ic,{asChild:!0,children:g.jsxs(ct,{variant:"ghost",size:"icon",className:"relative h-9 w-9 sm:h-10 sm:w-10","data-tauri-drag-region":"false",children:[g.jsx(ED,{className:"h-5 w-5"}),j&&g.jsxs("span",{className:"absolute top-1.5 right-1.5 flex h-2.5 w-2.5",children:[g.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-green-400 opacity-75"}),g.jsx("span",{className:"relative inline-flex rounded-full h-2.5 w-2.5 bg-green-500"})]}),g.jsx("span",{className:"sr-only",children:e("sessions.title")})]})})}),g.jsx(xo,{children:g.jsx("p",{children:e("sessions.title")})})]}),g.jsx(Gl,{className:"w-[800px] max-w-[90vw] p-0",align:"end",alignOffset:-8,children:g.jsxs("div",{className:"flex h-[500px] max-h-[85vh] w-full flex-col md:flex-row",children:[g.jsxs("div",{className:"w-full border-b flex flex-col md:w-[380px] shrink-0 md:border-b-0 md:border-r",children:[g.jsxs("div",{className:"flex items-center justify-between p-3 border-b",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-sm font-semibold",children:e("sessions.title")}),(R>0||L>0)&&g.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[R>0&&g.jsxs("span",{className:"flex items-center gap-1",children:[g.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-green-500"}),g.jsx("span",{className:"text-muted-foreground",children:R})]}),L>0&&g.jsxs("span",{className:"flex items-center gap-1",children:[g.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-amber-500"}),g.jsx("span",{className:"text-muted-foreground",children:L})]})]})]}),g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx(gw,{children:g.jsxs(Qo,{children:[g.jsx(Jo,{asChild:!0,children:g.jsx(ct,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:F,children:g.jsx(Fl,{className:"h-4 w-4"})})}),g.jsx(xo,{children:e("sessions.actions.new")})]})}),g.jsx(ct,{size:"sm",variant:"link",className:"h-7 px-2 text-xs",onClick:B,children:e("sessions.actions.viewAll")})]})]}),l&&g.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b bg-muted/30",children:[g.jsx(P4,{className:"h-3 w-3 text-muted-foreground shrink-0"}),g.jsxs("span",{className:"text-xs text-muted-foreground",children:[e("sessionsPage.filters.spec"),":"]}),g.jsxs(ei,{variant:"secondary",className:"text-xs px-2 py-0 h-5 gap-1 max-w-[200px]",children:[g.jsx("span",{className:"truncate",children:l}),g.jsx("button",{type:"button",onClick:()=>f(null),className:"ml-0.5 rounded-full hover:bg-muted-foreground/20 cursor-pointer",children:g.jsx(cl,{className:"h-3 w-3"})})]})]}),g.jsx("div",{className:"flex-1 space-y-2 overflow-y-auto p-3",children:k.length===0?g.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-4",children:[g.jsx(ED,{className:"h-8 w-8 text-muted-foreground/50 mb-3"}),g.jsx("p",{className:"text-sm font-medium",children:e(l?"sessions.emptyForSpec":"sessions.empty")}),g.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:e("sessions.labels.emptyHint","Start a new session to run specs")}),g.jsx(ct,{variant:"outline",size:"sm",className:"mt-4",onClick:F,children:e("sessions.actions.new")})]}):k.map(q=>{var z;const Q=zb[q.status],I=Q.icon,V=_===q.id;return g.jsxs("button",{type:"button",className:`w-full rounded-md border p-3 mb-2 text-left transition-all ${V?"border-primary bg-primary/5 ring-1 ring-primary/20":"hover:border-primary/30 hover:bg-muted/50"}`,onClick:()=>E(q.id),children:[g.jsxs("div",{className:"mb-1.5 flex items-start justify-between gap-2",children:[g.jsx("span",{className:"text-sm font-medium leading-none line-clamp-2",children:((z=q.prompt)==null?void 0:z.trim())||q.id.slice(0,8)}),g.jsxs(ei,{variant:"outline",className:`${Q.className} shrink-0`,children:[g.jsx(I,{className:"mr-1 h-3 w-3"}),e(`sessions.status.${q.status}`)]})]}),g.jsx("div",{className:"mb-3 truncate text-xs text-muted-foreground",children:q.specIds.length>0?q.specIds.join(", "):e("sessions.select.empty")}),g.jsxs("div",{className:"flex items-center gap-1.5 mt-auto",children:[q.status==="running"&&g.jsxs(g.Fragment,{children:[g.jsxs(ct,{size:"sm",variant:"secondary",className:"h-7 px-2.5 text-xs flex-1",onClick:G=>{G.stopPropagation(),i(q.id)},children:[g.jsx(UP,{className:"mr-1.5 h-3.5 w-3.5"}),e("sessions.actions.pause")]}),g.jsxs(ct,{size:"sm",variant:"destructive",className:"h-7 px-2.5 text-xs flex-1",onClick:G=>{G.stopPropagation(),s(q.id)},children:[g.jsx(dk,{className:"mr-1.5 h-3 w-3"}),e("sessions.actions.stop")]})]}),q.status==="paused"&&g.jsxs(g.Fragment,{children:[g.jsxs(ct,{size:"sm",variant:"secondary",className:"h-7 px-2.5 text-xs flex-1",onClick:G=>{G.stopPropagation(),a(q.id)},children:[g.jsx(Jre,{className:"mr-1.5 h-3.5 w-3.5"}),e("sessions.actions.resume")]}),g.jsxs(ct,{size:"sm",variant:"destructive",className:"h-7 px-2.5 text-xs flex-1",onClick:G=>{G.stopPropagation(),s(q.id)},children:[g.jsx(dk,{className:"mr-1.5 h-3 w-3"}),e("sessions.actions.stop")]})]})]})]},q.id)})})]}),g.jsx("div",{className:"flex-1 p-0 flex flex-col min-h-0 bg-muted/10 relative overflow-hidden",children:_?g.jsx(y5t,{sessionId:_,onBack:()=>E(null)}):g.jsxs("div",{className:"flex flex-col h-full items-center justify-center p-6 text-center text-muted-foreground w-full",children:[g.jsx(ED,{className:"h-10 w-10 mb-4 opacity-20"}),g.jsx("p",{className:"text-sm",children:e("sessions.labels.logs")}),g.jsx("p",{className:"text-xs mt-1 max-w-[250px] opacity-70",children:e("sessions.labels.logsHint","Select an active session from the left to view its execution logs")})]})})]})})]}),g.jsx(i5t,{open:b,onOpenChange:x,projectPath:n==null?void 0:n.path,defaultSpecId:l})]})}const v5t="/logo-with-bg.svg",x5t="/logo-dark-bg.svg";function _5t(e){const t=e.match(/^\/projects\/[^/]+(\/.*)?$/);return t?t[1]||"/":e}function E5t(e){const t=_5t(e);return t==="/"?{page:"home"}:t==="/stats"?{page:"stats"}:t==="/dependencies"?{page:"dependencies"}:t==="/context"?{page:"context"}:t==="/settings"?{page:"settings"}:t==="/machines"?{page:"machines"}:t==="/specs"||t.startsWith("/specs?")?{page:"specs",query:t.split("?")[1]}:t.startsWith("/specs/")?{page:"spec-detail",specId:t.split("/")[2]}:t==="/sessions"||t.startsWith("/sessions?")?{page:"sessions",query:t.split("?")[1]}:t.startsWith("/sessions/")?{page:"session-detail",specId:t.split("/")[2]}:{page:"unknown"}}function w5t({basePath:e}){const t=Hs(),{t:n}=Hn("common"),r=n("navigation.home"),i=n("navigation.specs"),a=n("navigation.stats"),s=n("navigation.dependencies"),o=n("navigation.context"),l=n("navigation.settings"),c=n("navigation.machines"),u=n("navigation.sessions"),d=E5t(t.pathname);let f=[];switch(d.page){case"home":f=[{label:r}];break;case"stats":f=[{label:r,to:e},{label:a}];break;case"dependencies":f=[{label:r,to:e},{label:s}];break;case"context":f=[{label:r,to:e},{label:o}];break;case"settings":f=[{label:r,to:e},{label:l}];break;case"machines":f=[{label:r,to:e},{label:c}];break;case"specs":{f=[{label:r,to:e},{label:i}];break}case"spec-detail":f=[{label:r,to:e},{label:i,to:`${e}/specs`},{label:d.specId||""}];break;case"sessions":f=[{label:r,to:e},{label:u}];break;case"session-detail":f=[{label:r,to:e},{label:u,to:`${e}/sessions`},{label:d.specId||""}];break;default:f=[{label:r,to:e}]}return g.jsx("nav",{className:"hidden md:flex items-center gap-1 text-sm text-muted-foreground",children:f.map((p,y)=>g.jsxs("div",{className:"flex items-center gap-1",children:[y>0&&g.jsx(hu,{className:"h-4 w-4"}),p.to?g.jsx(og,{to:p.to,className:"hover:text-foreground transition-colors",children:p.label}):g.jsx("span",{className:"text-foreground",children:p.label})]},y))})}function S5t({onToggleSidebar:e,rightSlot:t,onHeaderDoubleClick:n}){const{t:r}=Hn("common"),{projectId:i}=sg(),{currentProject:a}=Qa(),{toggleChat:s}=eN(),o=i??(a==null?void 0:a.id),l=o?`/projects/${o}`:"/projects",c=()=>{e==null||e()};return g.jsx("header",{className:"sticky top-0 z-50 h-14 border-b border-border bg-background transition-all duration-300 ease-in-out","data-tauri-drag-region":"true",onDoubleClick:n,children:g.jsxs("div",{className:"flex items-center justify-between h-full px-4",children:[g.jsxs("div",{className:"flex items-center gap-2 sm:gap-4 min-w-0 flex-1",children:[g.jsxs(ct,{variant:"ghost",size:"icon",onClick:c,className:"lg:hidden h-9 w-9 shrink-0","data-tauri-drag-region":"false",children:[g.jsx(dRe,{className:"h-5 w-5"}),g.jsx("span",{className:"sr-only",children:r("navigation.toggleMenu")})]}),g.jsxs(og,{to:l,className:"flex items-center space-x-2 shrink-0","data-tauri-drag-region":"false",children:[g.jsx("img",{src:v5t,alt:r("navigation.logoAlt"),className:"h-7 w-7 sm:h-8 sm:w-8 dark:hidden"}),g.jsx("img",{src:x5t,alt:r("navigation.logoAlt"),className:"h-7 w-7 sm:h-8 sm:w-8 hidden dark:block"}),g.jsx("span",{className:"font-bold text-lg sm:text-xl hidden sm:inline",children:r("navigation.brandName")})]}),g.jsx("div",{className:"hidden md:block min-w-0","data-tauri-drag-region":"false",children:g.jsx(w5t,{basePath:l})})]}),g.jsxs("div",{className:"flex items-center gap-1 sm:gap-2 shrink-0","data-tauri-drag-region":"false",children:[g.jsx("div",{"data-tauri-drag-region":"false",children:g.jsx(X3t,{})}),g.jsxs(gw,{children:[g.jsx(i4t,{}),g.jsx(r4t,{}),g.jsx(Q3t,{}),g.jsxs(Qo,{children:[g.jsx(Jo,{asChild:!0,children:g.jsx(ct,{variant:"ghost",size:"icon",asChild:!0,className:"h-9 w-9 sm:h-10 sm:w-10","data-tauri-drag-region":"false",children:g.jsx("a",{href:"https://harnspec.gitub.io",target:"_blank",rel:"noopener noreferrer","aria-label":r("navigation.docsTooltip"),children:g.jsx(Hre,{className:"h-5 w-5"})})})}),g.jsx(xo,{children:g.jsx("p",{children:r("navigation.docsTooltip")})})]}),g.jsxs(Qo,{children:[g.jsx(Jo,{asChild:!0,children:g.jsx(ct,{variant:"ghost",size:"icon",asChild:!0,className:"h-9 w-9 sm:h-10 sm:w-10","data-tauri-drag-region":"false",children:g.jsxs("a",{href:"https://github.com/codervisor/harnspec",target:"_blank",rel:"noopener noreferrer","aria-label":r("navigation.githubTooltip"),children:[g.jsx("img",{src:"/github-mark-white.svg",alt:r("navigation.githubAlt"),className:"hidden dark:block w-5 h-5"}),g.jsx("img",{src:"/github-mark.svg",alt:r("navigation.githubAlt"),className:"dark:hidden w-5 h-5"})]})})}),g.jsx(xo,{children:g.jsx("p",{children:r("navigation.githubTooltip")})})]}),g.jsx(b5t,{}),g.jsxs(Qo,{children:[g.jsx(Jo,{asChild:!0,children:g.jsxs(ct,{variant:"ghost",size:"icon",className:"h-9 w-9 sm:h-10 sm:w-10",onClick:s,"data-tauri-drag-region":"false",children:[g.jsx(X6e,{className:"h-5 w-5"}),g.jsx("span",{className:"sr-only",children:r("chat.openChat")})]})}),g.jsx(xo,{children:g.jsx("p",{children:r("chat.openChat")})})]}),t&&g.jsx("div",{className:"ml-2 flex items-center","data-tauri-drag-region":"false",children:t})]})]})]})})}const Nte=["local","git"];async function T5t(){const t=await fetch("/api/capabilities");if(!t.ok)throw new Error("Failed to fetch capabilities");return t.json()}function hwe(){const e=sl({queryKey:["capabilities"],queryFn:T5t,staleTime:3e5,retry:1,placeholderData:{projectSources:Nte,readonly:!1}}),t=e.data??{projectSources:Nte,readonly:!1};return{...e,capabilities:t,hasSource:n=>t.projectSources.includes(n)}}function C5t({onSelect:e,onCancel:t,initialPath:n,actionLabel:r,isLoading:i}){const[a,s]=S.useState(n||""),[o,l]=S.useState([]),[c,u]=S.useState(!1),[d,f]=S.useState(null),p=S.useRef(null),{t:y}=Hn("common"),b=i||c;S.useEffect(()=>{x(a)},[a]),S.useEffect(()=>{p.current&&(p.current.scrollLeft=p.current.scrollWidth)},[a]);const x=async R=>{try{u(!0),f(null);const L=await gn.listDirectory(R);l(L.items||[]),!R&&L.path&&s(L.path)}catch(L){const j=L instanceof Error?L.message:y("directoryPicker.error");f(j)}finally{u(!1)}},_=R=>{s(R)},E=o.find(R=>R.name===".."),w=o.filter(R=>R.name!==".."),k=(R=>{if(!R)return[];const L=R.includes("\\")?"\\":"/",j=R.split(L).filter(Boolean),B=R.startsWith("/");return j.map((F,q)=>{let Q=j.slice(0,q+1).join(L);return B&&(Q="/"+Q),{name:F,path:Q}})})(a),N=r??y("directoryPicker.action");return g.jsxs("div",{className:"flex flex-col h-[400px] gap-4 min-w-0 overflow-hidden",children:[g.jsxs("div",{className:"flex items-center border rounded-md p-1 gap-1 bg-muted/30 min-w-0 overflow-hidden",children:[g.jsx(ct,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0",disabled:!E||b,onClick:()=>E&&_(E.path),title:y("directoryPicker.parent"),children:g.jsx(FP,{className:"h-4 w-4"})}),g.jsx("div",{className:"w-px h-5 bg-border mx-1 shrink-0"}),g.jsxs("div",{ref:p,className:"flex-1 overflow-x-auto whitespace-nowrap flex items-center scrollbar-hide px-1 min-w-0",title:a,children:[g.jsx(ct,{onClick:()=>_("/"),variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0",title:y("directoryPicker.rootAction"),children:g.jsx(Xre,{className:"h-4 w-4 text-muted-foreground"})}),k.map((R,L)=>g.jsxs("div",{className:"flex items-center shrink-0",children:[g.jsx(hu,{className:"h-3 w-3 text-muted-foreground mx-0.5 shrink-0"}),g.jsx(ct,{onClick:()=>_(R.path),variant:"ghost",size:"sm",className:ke("h-7 text-sm",L===k.length-1?"font-medium text-foreground":"text-muted-foreground"),children:R.name})]},R.path))]})]}),g.jsxs("div",{className:"flex-1 border rounded-md overflow-hidden relative bg-background min-h-0",children:[b&&g.jsx("div",{className:"absolute inset-0 bg-background/50 flex items-center justify-center z-10",children:g.jsx(Nh,{className:"h-6 w-6 animate-spin"})}),d?g.jsxs("div",{className:"p-4 text-destructive text-sm text-center",children:[d,g.jsx(ct,{variant:"link",onClick:()=>x(a),className:"block mx-auto mt-2",children:y("actions.retry")})]}):g.jsx("div",{className:"h-full overflow-auto",children:g.jsx("div",{className:"p-1",children:w.length===0&&!b?g.jsx("div",{className:"p-4 text-center text-sm text-muted-foreground",children:y("directoryPicker.empty")}):w.map(R=>g.jsxs(ct,{onClick:()=>_(R.path),variant:"ghost",size:"sm",className:"w-full justify-start gap-3 h-9 group",children:[g.jsx(Zre,{className:"h-4 w-4 text-blue-500 fill-blue-500/20 group-hover:fill-blue-500/30 transition-colors shrink-0"}),g.jsx("span",{className:"truncate",children:R.name})]},R.path))})})]}),g.jsxs("div",{className:"flex justify-end gap-2",children:[g.jsx(ct,{variant:"outline",onClick:t,disabled:b,children:y("actions.cancel")}),g.jsx(ct,{onClick:()=>e(a),disabled:b||!a,children:N})]})]})}function fwe({onSuccess:e,onCancel:t}){const n=ll(),[r,i]=S.useState(""),[a,s]=S.useState(null),[o,l]=S.useState(!1),[c,u]=S.useState(!1),[d,f]=S.useState(null),p=async()=>{if(r.trim()){l(!0),f(null),s(null);try{const b=await gn.detectGitSpecs(r.trim());b?s(b):f("No HarnSpec specs found in this repository. Make sure it has a `specs/` directory with numbered spec folders.")}catch(b){f(b instanceof Error?b.message:"Failed to detect specs")}finally{l(!1)}}},y=async()=>{if(a){u(!0),f(null);try{const b=await gn.importGitRepo(r.trim(),{branch:a.branch,specsPath:a.specsDir});await n.invalidateQueries({queryKey:["projects"]}),e(b.projectId)}catch(b){f(b instanceof Error?b.message:"Failed to import repository")}finally{u(!1)}}};return g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{className:"grid gap-2",children:[g.jsx(Eoe,{htmlFor:"git-repo",children:"Repository"}),g.jsxs("div",{className:"flex gap-2",children:[g.jsx(Na,{id:"git-repo",value:r,onChange:b=>{i(b.target.value),s(null)},placeholder:"owner/repo, HTTPS URL, or SSH URL",disabled:o||c,onKeyDown:b=>{b.key==="Enter"&&(b.preventDefault(),p())}}),g.jsx(ct,{type:"button",variant:"outline",onClick:()=>{p()},disabled:!r.trim()||o||c,children:o?g.jsx("span",{className:"animate-pulse",children:"…"}):g.jsx(Vh,{className:"h-4 w-4"})})]}),g.jsxs("p",{className:"text-xs text-muted-foreground",children:["Any Git repository — ",g.jsx("code",{children:"acme/project"}),", ",g.jsx("code",{children:"https://github.com/acme/project"}),", or ",g.jsx("code",{children:"git@gitlab.com:team/repo.git"})]})]}),a&&g.jsxs("div",{className:"rounded-md border border-green-500/30 bg-green-500/5 p-3 space-y-1",children:[g.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-green-700 dark:text-green-400",children:[g.jsx(Lp,{className:"h-4 w-4"}),"Found ",a.specCount," spec",a.specCount!==1?"s":""," in ",g.jsxs("code",{children:[a.specsDir,"/"]})]}),g.jsxs("div",{className:"text-xs text-muted-foreground",children:["Branch: ",g.jsx("code",{children:a.branch})]})]}),d&&g.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-3 flex items-start gap-2 text-sm text-destructive",children:[g.jsx(_c,{className:"h-4 w-4 mt-0.5 flex-shrink-0"}),d]}),g.jsxs("div",{className:"flex justify-end gap-2",children:[g.jsx(ct,{variant:"outline",onClick:t,disabled:c,children:"Cancel"}),g.jsx(ct,{onClick:()=>{y()},disabled:!a||c,children:c?"Importing…":`Import ${a?`(${a.specCount} specs)`:""}`})]})]})}function pwe({open:e,onOpenChange:t,initialTab:n}){const{addProject:r}=Q6(),i=ql(),{hasSource:a}=hwe(),s=a("local"),o=a("git"),l=s&&o,c=n??(s?"local":"git"),[u,d]=S.useState(""),[f,p]=S.useState("picker"),[y,b]=S.useState(c),[x,_]=S.useState(!1),[E,w]=S.useState(null),{t:C}=Hn("common");S.useEffect(()=>{e&&(p("picker"),d(""),w(null),b(n??c))},[e,n,c]);const k=async R=>{try{_(!0),w(null);const L=await r(R);return t(!1),L!=null&&L.id?i(`/projects/${L.id}/specs`):i("/"),L}catch(L){const j=L instanceof Error?L.message:C("createProject.toastError");return w(j),null}finally{_(!1)}},N=R=>{if(R.preventDefault(),!u.trim()){w(C("createProject.pathRequired"));return}k(u.trim())};return g.jsx(tm,{open:e,onOpenChange:R=>{t(R),R||w(null)},children:g.jsxs(Gh,{className:"sm:max-w-[600px]",children:[g.jsxs(fg,{children:[g.jsx(pg,{children:C("createProject.title")}),g.jsx(mg,{children:y==="git"?"Connect a Git repository containing HarnSpec specs.":C(f==="picker"?"createProject.descriptionPicker":"createProject.descriptionManual")})]}),l&&g.jsxs("div",{className:"flex gap-1 p-1 bg-muted rounded-lg",children:[g.jsxs("button",{type:"button",className:`flex-1 flex items-center justify-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${y==="local"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,onClick:()=>{b("local"),w(null)},children:[g.jsx(uk,{className:"h-4 w-4"}),"Local"]}),g.jsxs("button",{type:"button",className:`flex-1 flex items-center justify-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${y==="git"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,onClick:()=>{b("git"),w(null)},children:[g.jsx(kh,{className:"h-4 w-4"}),"Git"]})]}),y==="git"&&o?g.jsx(fwe,{onSuccess:R=>{t(!1),i(`/projects/${R}/specs`)},onCancel:()=>t(!1)}):f==="picker"?g.jsxs("div",{className:"space-y-2 min-w-0 overflow-hidden",children:[g.jsx(C5t,{onSelect:k,onCancel:()=>t(!1),initialPath:u,actionLabel:C(x?"createProject.adding":"createProject.action"),isLoading:x}),g.jsx("div",{className:"flex justify-center",children:g.jsx(ct,{variant:"link",size:"sm",onClick:()=>p("manual"),className:"text-muted-foreground",children:C("createProject.enterManually")})})]}):g.jsxs("form",{onSubmit:N,className:"space-y-4",children:[g.jsxs("div",{className:"grid gap-2",children:[g.jsx("label",{htmlFor:"project-path",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:C("createProject.pathLabel")}),g.jsx("div",{className:"flex gap-2",children:g.jsx(Na,{id:"project-path",value:u,onChange:R=>d(R.target.value),placeholder:C("createProject.pathPlaceholder"),className:"flex-1",disabled:x})}),g.jsx("p",{className:"text-xs text-muted-foreground",children:C("createProject.pathHelp")})]}),E&&g.jsx("p",{className:"text-sm text-destructive",children:E}),g.jsxs(iw,{className:"flex-col sm:flex-row gap-2",children:[g.jsx("div",{className:"flex-1 flex justify-start",children:g.jsxs(ct,{type:"button",variant:"ghost",size:"sm",onClick:()=>p("picker"),children:[g.jsx(uk,{className:"h-4 w-4 mr-2"}),C("createProject.browseFolders")]})}),g.jsx(ct,{type:"button",variant:"outline",onClick:()=>t(!1),disabled:x,children:C("actions.cancel")}),g.jsx(ct,{type:"submit",disabled:x||!u.trim(),children:C(x?"createProject.adding":"createProject.action")})]})]}),E&&y==="local"&&g.jsx("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-3 text-sm text-destructive",children:E})]})})}function A5t({open:e,onOpenChange:t}){const n=ql();return g.jsx(tm,{open:e,onOpenChange:t,children:g.jsxs(Gh,{className:"sm:max-w-[520px]",children:[g.jsxs(fg,{children:[g.jsxs(pg,{className:"flex items-center gap-2",children:[g.jsx(kh,{className:"h-5 w-5"}),"Import from Git"]}),g.jsx(mg,{children:"Connect a Git repository containing HarnSpec specs."})]}),g.jsx(fwe,{onSuccess:r=>{t(!1),n(`/projects/${r}/specs`)},onCancel:()=>t(!1)})]})})}function tk({name:e,color:t,icon:n,size:r="md",className:i}){return g.jsx(_Ct,{name:e,color:t||void 0,icon:n,size:r,className:i})}function k5t({collapsed:e}){const{currentProject:t}=Qa(),{projects:n,isLoading:r}=Kw(),{switchProject:i}=Q6(),{t:a}=Hn("common"),s=Hs(),o=ql(),[l,c]=S.useState(!1),[u,d]=S.useState(!1),[f,p]=S.useState(!1),[y,b]=S.useState(!1);if(r)return g.jsx(Rt,{className:ke("w-full",e?"h-9 w-9":"h-10")});const x=async E=>{if(E===(t==null?void 0:t.id)){c(!1);return}b(!0),c(!1);const C=s.pathname.match(/^\/projects\/[^/]+(\/.*)?$/);let k=(C==null?void 0:C[1])||"";(!k||k==="/")&&(k=""),k.match(/^\/specs\/[^/]+$/)&&(k="/specs");try{await i(E),o(`/projects/${E}${k}${s.search}`)}catch(N){console.error("Failed to switch project",N)}finally{b(!1)}},_=[...n||[]].sort((E,w)=>E.favorite===w.favorite?0:E.favorite?-1:1);return g.jsxs(g.Fragment,{children:[g.jsx(pwe,{open:u,onOpenChange:d}),g.jsx(A5t,{open:f,onOpenChange:p}),g.jsxs(Mc,{open:l,onOpenChange:c,children:[g.jsx(Ic,{asChild:!0,children:g.jsx(ct,{variant:"outline",role:"combobox","aria-expanded":l,disabled:y,className:ke("w-full justify-between transition-opacity",e?"h-9 w-9 p-0 justify-center":"px-3",y&&"opacity-70"),children:e?y?g.jsx(Nh,{className:"h-4 w-4 animate-spin"}):g.jsx(tk,{name:(t==null?void 0:t.name)||"",color:t==null?void 0:t.color,size:"xs"}):g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"flex items-center gap-2 truncate",children:[y?g.jsx(Nh,{className:"h-4 w-4 shrink-0 animate-spin"}):g.jsx(tk,{name:(t==null?void 0:t.name)||"",color:t==null?void 0:t.color,size:"xs",className:"shrink-0"}),g.jsx("span",{className:"truncate",children:y?a("projectSwitcher.switching"):(t==null?void 0:t.name)||a("projectSwitcher.placeholder")})]}),g.jsx(L4,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})})}),g.jsx(Gl,{className:"w-[240px] p-0",align:"start",children:g.jsxs(Wh,{children:[g.jsx(nm,{placeholder:a("projectSwitcher.searchPlaceholder")}),g.jsxs(Yh,{children:[g.jsx(Kh,{children:a("projectSwitcher.noProject")}),g.jsx(no,{heading:a("projects.projects"),children:_.map(E=>{const w=(t==null?void 0:t.id)===E.id;return g.jsx(Ss,{onSelect:()=>x(E.id),className:ke("text-sm",w&&"bg-accent"),children:g.jsxs("div",{className:"flex items-center gap-2 w-full",children:[g.jsx(tk,{name:E.name||"",color:E.color,size:"xs",className:"shrink-0"}),g.jsx("span",{className:"truncate flex-1",children:E.name}),E.favorite&&g.jsx(Oh,{className:"h-3 w-3 shrink-0 fill-yellow-600 text-yellow-600 dark:fill-yellow-500 dark:text-yellow-500"}),g.jsx("div",{className:ke("mr-2 flex h-4 w-4 items-center justify-center",(t==null?void 0:t.id)===E.id?"opacity-100":"opacity-0"),children:g.jsx(ua,{className:"h-4 w-4"})})]})},E.id)})}),g.jsx(mF,{}),g.jsxs(no,{children:[g.jsx(Ss,{className:"cursor-pointer",onSelect:()=>{c(!1),d(!0)},children:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(Fl,{className:"h-4 w-4"}),g.jsx("span",{children:a("projects.createProject")})]})}),g.jsx(Ss,{className:"cursor-pointer",onSelect:()=>{c(!1),p(!0)},children:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(kh,{className:"h-4 w-4"}),g.jsx("span",{children:"Import from Git"})]})}),g.jsx(Ss,{className:"cursor-pointer",onSelect:()=>{c(!1),o("/projects")},children:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(Pp,{className:"h-4 w-4"}),g.jsx("span",{children:a("projects.manageProjects")})]})})]})]})]})})]})]})}function mwe({to:e,icon:t,label:n,description:r,isCollapsed:i=!1,stripProjectPrefix:a=!1}){const o=Hs().pathname,l=x=>x.replace(/\/$/,"")||"/",c=l(e),u=l(o),d=x=>{if(!a)return x;const _=x.match(/^\/projects\/[^/]+(\/.*)?$/);return _?_[1]||"/":x},f=d(c),p=d(u),b=f==="/"||f===""?p==="/"||p==="":p===f||p.startsWith(`${f}/`);return g.jsxs(og,{to:e,title:i?n:void 0,className:ke("flex items-center gap-3 rounded-lg px-3 py-2 transition-colors","hover:bg-accent hover:text-accent-foreground",b&&"bg-accent text-accent-foreground font-medium",i&&"justify-center px-2"),children:[g.jsx(t,{className:ke("h-5 w-5 shrink-0",b&&"text-primary")}),!i&&g.jsxs("div",{className:"flex flex-col",children:[g.jsx("span",{className:"text-sm",children:n}),r&&g.jsx("span",{className:"text-xs text-muted-foreground",children:r})]})]})}const Rz=Wl()(Bd(e=>({isSidebarOpen:!1,toggleSidebar:()=>e(t=>({isSidebarOpen:!t.isSidebarOpen})),isWideMode:!1,toggleWideMode:()=>e(t=>({isWideMode:!t.isWideMode})),mainSidebarCollapsed:!1,setMainSidebarCollapsed:t=>e({mainSidebarCollapsed:t}),toggleMainSidebar:()=>e(t=>({mainSidebarCollapsed:!t.mainSidebarCollapsed})),settingsSidebarCollapsed:!1,setSettingsSidebarCollapsed:t=>e({settingsSidebarCollapsed:t}),toggleSettingsSidebar:()=>e(t=>({settingsSidebarCollapsed:!t.settingsSidebarCollapsed}))}),{name:"harnspec:layout",partialize:e=>({isWideMode:e.isWideMode,mainSidebarCollapsed:e.mainSidebarCollapsed,settingsSidebarCollapsed:e.settingsSidebarCollapsed})}));function N5t({mobileOpen:e=!1,onMobileClose:t}){const n=Hs(),{projectId:r}=sg(),{currentProject:i}=Qa(),a=r??(i==null?void 0:i.id),s=a?`/projects/${a}`:"/projects",{t:o}=Hn("common"),{machineModeEnabled:l}=Ig(),{mainSidebarCollapsed:c,toggleMainSidebar:u}=Rz();S.useEffect(()=>{document.documentElement.style.setProperty("--main-sidebar-width",c?"60px":"240px")},[c]),S.useEffect(()=>{e&&t&&t()},[n.pathname,e,t]);const d=[{id:"home",path:s,label:o("navigation.home"),description:o("navigation.dashboard"),icon:Xre},{id:"specs",path:`${s}/specs`,label:o("navigation.specs"),description:o("navigation.allSpecifications"),icon:Kre},{id:"sessions",path:`${s}/sessions`,label:o("navigation.sessions"),description:o("navigation.sessionsDescription"),icon:eie},{id:"files",path:`${s}/files`,label:o("navigation.files"),description:o("navigation.filesDescription"),icon:uk},{id:"dependencies",path:`${s}/dependencies`,label:o("navigation.dependencies"),description:o("navigation.dependencyGraph"),icon:yRe},{id:"stats",path:`${s}/stats`,label:o("navigation.stats"),description:o("navigation.analytics"),icon:qre},{id:"context",path:`${s}/context`,label:o("navigation.context"),description:o("navigation.projectContext"),icon:Hre},{id:"projects",path:"/projects",label:o("navigation.projects"),description:o("navigation.manageProjects"),icon:Zre},{id:"settings",path:"/settings",label:o("navigation.settings"),description:o("navigation.settingsDescription"),icon:Pp},...l?[{id:"machines",path:"/machines",label:o("navigation.machines"),description:o("navigation.manageMachines"),icon:P2}]:[]];return g.jsxs(g.Fragment,{children:[e&&g.jsx("div",{className:"fixed inset-0 bg-black/50 z-40 lg:hidden",onClick:t}),g.jsx("aside",{className:ke("border-r bg-background transition-all duration-300 flex-shrink-0","hidden lg:flex lg:sticky lg:top-14 lg:h-[calc(100dvh-3.5rem)]",c?"lg:w-[60px]":"lg:w-[240px]",e&&"fixed inset-y-0 left-0 z-[60] flex w-[280px]"),children:g.jsxs("div",{className:"flex flex-col h-full w-full",children:[g.jsx("div",{className:"lg:hidden flex justify-end p-2 border-b",children:g.jsx("button",{onClick:t,className:"p-2 hover:bg-secondary rounded-md transition-colors","aria-label":o("navigation.closeMenu"),children:g.jsx(cl,{className:"h-5 w-5"})})}),g.jsxs("nav",{className:"flex-1 px-2 py-2 space-y-1",children:[g.jsx("div",{className:"mb-4 flex items-center justify-center",children:g.jsx(k5t,{collapsed:c&&!e})}),d.map(f=>g.jsx(mwe,{to:f.path,icon:f.icon,label:f.label,description:!c||e?f.description:void 0,isCollapsed:c&&!e,stripProjectPrefix:!0},f.id))]}),g.jsx("div",{className:"hidden lg:block p-2 border-t",children:g.jsxs("button",{onClick:u,className:ke("w-full flex items-center justify-center gap-2 rounded-md px-3 py-2 text-sm hover:bg-secondary transition-colors",c&&"px-2"),children:[c?g.jsx(hu,{className:"h-4 w-4"}):g.jsx(I4,{className:"h-4 w-4"}),!c&&g.jsx("span",{className:"text-xs",children:o("navigation.collapse")})]})})]})})]})}function R5t(){const{machineModeEnabled:e,machines:t,currentMachine:n,selectMachine:r,loading:i}=Ig(),{t:a}=Hn("common"),[s,o]=S.useState(!1);if(!e)return null;const l=(n==null?void 0:n.label)||a("machines.noSelection");return g.jsxs(Mc,{open:s,onOpenChange:o,children:[g.jsx(Ic,{asChild:!0,children:g.jsxs(ct,{variant:"outline",className:"h-8 px-2 gap-2 text-xs","aria-label":a("machines.switcherLabel"),disabled:i,children:[g.jsx(P2,{className:"h-3.5 w-3.5"}),g.jsx("span",{className:"truncate max-w-[160px]",children:l}),(n==null?void 0:n.status)==="offline"?g.jsx(tie,{className:"h-3.5 w-3.5 text-destructive"}):g.jsx(CL,{className:"h-3.5 w-3.5 text-emerald-500"}),g.jsx(L4,{className:"h-3.5 w-3.5 opacity-60"})]})}),g.jsx(Gl,{align:"end",className:"w-64 p-0",children:g.jsx(Wh,{children:g.jsxs(Yh,{children:[g.jsx(Kh,{children:a("machines.empty")}),g.jsx(no,{heading:a("machines.available"),children:t.map(c=>g.jsx(Ss,{onSelect:()=>{r(c.id),o(!1)},children:g.jsxs("div",{className:"flex items-center gap-2 w-full",children:[g.jsx(P2,{className:"h-4 w-4"}),g.jsx("span",{className:"truncate flex-1",children:c.label}),g.jsx("span",{className:ke("text-[10px] uppercase tracking-wide",c.status==="online"?"text-emerald-500":"text-destructive"),children:c.status==="online"?a("machines.status.online"):a("machines.status.offline")}),g.jsx("div",{className:ke("mr-1 flex h-4 w-4 items-center justify-center",(n==null?void 0:n.id)===c.id?"opacity-100":"opacity-0"),children:g.jsx(ua,{className:"h-3 w-3"})})]})},c.id))})]})})})]})}function D5t(e){const[t,n]=S.useState(!1);return S.useEffect(()=>{const r=window.matchMedia(e);r.matches!==t&&n(r.matches);const i=()=>n(r.matches);return r.addEventListener("change",i),()=>r.removeEventListener("change",i)},[e,t]),t}function M5t({onResize:e,onResizeStart:t,onResizeEnd:n,minWidth:r=300,maxWidth:i=1/0}){const[a,s]=S.useState(!1);return S.useEffect(()=>{if(!a)return;const o=c=>{const u=window.innerWidth-c.clientX,d=Math.min(i,window.innerWidth),f=Math.min(Math.max(u,r),d);e(f)},l=()=>{s(!1),n==null||n(),document.body.style.cursor="",document.body.style.userSelect=""};return document.addEventListener("mousemove",o),document.addEventListener("mouseup",l),document.body.style.cursor="col-resize",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",l),document.body.style.cursor="",document.body.style.userSelect=""}},[a,r,i,e,n]),g.jsx("div",{className:ke("absolute left-0 top-0 bottom-0 w-1 cursor-col-resize hover:bg-primary/50 transition-colors z-50",a&&"bg-primary/50 w-1.5"),onMouseDown:()=>{s(!0),t==null||t()}})}const Dz=e=>typeof e=="object"&&e!==null,nl=e=>typeof e=="string"?e:void 0,I5t=e=>Array.isArray(e)?e.filter(t=>typeof t=="string"):[],gwe=e=>typeof e=="number"?e:void 0,rN=({output:e})=>{const{t}=Hn("common"),n=b2e(e);return g.jsx(_5,{code:n,language:"json",maxHeight:300,children:g.jsxs(oue,{children:[g.jsx(lue,{children:t("chat.toolExecution.labels.output")}),g.jsx(cue,{children:g.jsx(uue,{"aria-label":t("chat.toolExecution.actions.copy"),size:"icon-sm"})})]})})},L5t=({output:e})=>{if(!Dz(e)||!Array.isArray(e.results))return g.jsx(rN,{output:e});const t=e.results,n=nl(e.query),r=gwe(e.count);return g.jsxs("div",{className:"space-y-2 text-xs",children:[g.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n&&g.jsx("span",{className:"rounded-md bg-muted/40 px-2 py-1 font-mono text-[10px]",children:n}),typeof r=="number"&&g.jsx(ei,{className:"text-[10px]",variant:"secondary",children:r})]}),g.jsx("div",{className:"grid gap-2",children:t.map((i,a)=>{const s=nl(i.title)??nl(i.name)??nl(i.path)??`#${a+1}`,o=nl(i.path),l=nl(i.snippet);return g.jsxs("div",{className:"rounded-md border bg-muted/20 p-2",children:[g.jsx("div",{className:"font-medium text-foreground",children:s}),o&&g.jsx("div",{className:"text-[10px] text-muted-foreground font-mono",children:o}),l&&g.jsx("div",{className:"mt-1 text-muted-foreground",children:l})]},o??`${s}-${a}`)})})]})},O5t=({output:e})=>{if(!Dz(e)||!Array.isArray(e.groups))return g.jsx(rN,{output:e});const t=e.groups;return g.jsx("div",{className:"grid gap-2 text-xs",children:t.map((n,r)=>{const i=nl(n.name)??`#${r+1}`,a=gwe(n.count),s=Array.isArray(n.specs)?n.specs:[];return g.jsxs("div",{className:"rounded-md border bg-muted/20 p-2",children:[g.jsxs("div",{className:"flex items-center justify-between gap-2",children:[g.jsx("div",{className:"font-medium text-foreground truncate",children:i}),typeof a=="number"&&g.jsx(ei,{className:"text-[10px]",variant:"secondary",children:a})]}),s.length>0&&g.jsx("div",{className:"mt-2 grid gap-1 text-[10px] text-muted-foreground",children:s.slice(0,6).map((o,l)=>{const c=nl(o.title)??nl(o.path)??nl(o.name)??`#${l+1}`,u=nl(o.status);return g.jsxs("div",{className:"flex items-center justify-between gap-2",children:[g.jsx("span",{className:"truncate",children:c}),u&&g.jsx(ei,{className:"text-[10px]",variant:"outline",children:u})]},`${c}-${l}`)})})]},`${i}-${r}`)})})},P5t=({output:e})=>{const{t}=Hn("common");if(!Dz(e)||typeof e.content!="string")return g.jsx(rN,{output:e});const n=nl(e.title),r=nl(e.path),i=nl(e.status),a=I5t(e.tags),s=e.content,[o,l]=S.useState(!1),c=S.useMemo(()=>v2e(s),[s]),u=o||!c.isTruncated?c.fullText:c.truncatedText;return g.jsxs("div",{className:"space-y-3",children:[(n||r||i||a.length>0)&&g.jsxs("div",{className:"space-y-1 text-xs",children:[n&&g.jsx("div",{className:"text-sm font-semibold",children:n}),r&&g.jsx("div",{className:"text-[10px] text-muted-foreground font-mono",children:r}),(i||a.length>0)&&g.jsxs("div",{className:"flex flex-wrap gap-1",children:[i&&g.jsx(ei,{className:"text-[10px]",variant:"secondary",children:i}),a.map(d=>g.jsx(ei,{className:"text-[10px]",variant:"outline",children:d},d))]}),c.isTruncated&&g.jsx(ct,{className:"h-6 px-2 text-[10px]",onClick:()=>l(d=>!d),size:"sm",type:"button",variant:"ghost",children:t(o?"chat.toolExecution.actions.showLess":"chat.toolExecution.actions.showAll")})]}),g.jsx("div",{className:ke("rounded-md border bg-muted/10 p-3 text-sm"),children:g.jsx(S6,{children:u})})]})},Rte={search:e=>g.jsx(L5t,{output:e}),board:e=>g.jsx(O5t,{output:e}),view:e=>g.jsx(P5t,{output:e})},F5t={resolve:e=>Rte[e]??null,render:(e,t)=>{const n=Rte[e];return n?n(t):g.jsx(rN,{output:t})}},B5t=new Set(["input-streaming","input-available","approval-requested","approval-responded","output-available","output-error","output-denied"]);function j5t(e,t,n){return e&&B5t.has(e)?e:e==="error"||n?"output-error":e==="result"||t!==void 0?"output-available":e==="call"||e==="running"||e==="pending"?"input-available":"input-streaming"}function H1(e,t){const{toolCallId:n,toolName:r,description:i,input:a,output:s,state:o,errorMessage:l}=e,c=s!==void 0?F5t.render(r,s):void 0,u=typeof a=="object"&&a!==null?a:{},d=typeof u.title=="string"?u.title:void 0,f=typeof u.description=="string"?u.description:i;return g.jsxs(j9,{children:[g.jsx($9,{title:d,description:f,state:j5t(o,s,l),toolName:r,type:"dynamic-tool"}),g.jsx(z9,{children:g.jsx(U9,{input:a,output:c,rawOutput:s,errorText:l})})]},n||t)}const Dte=/^\s*\*\*Error:\*\*\s*/;function $5t({message:e,isLast:t}){var s;const n=new Map;if(e.parts){for(const o of e.parts)if(typeof o=="object"&&o!==null&&"type"in o&&o.type==="tool-result"){const l=o,c=String(l.toolCallId??"");c&&n.set(c,l)}}const r=new Map,i=new Set,a=new Map;if(e.parts){for(let o=0;o<e.parts.length;o++){const l=e.parts[o];if(typeof l!="object"||l===null||!("type"in l))continue;const c=l;if(c.type==="tool-call"){const u=String(c.toolCallId??"");u&&!n.has(u)&&r.set(u,{index:o,toolName:String(c.toolName??"")})}}if(r.size>0)for(let o=0;o<e.parts.length;o++){const l=e.parts[o];if(typeof l!="object"||l===null||!("type"in l))continue;const c=l;if(c.type==="text"){const u=c.text;if(u&&Dte.test(u)){const d=u.replace(Dte,"").trim();let f=null;for(const[p,y]of r)y.index<o&&(f={id:p,toolName:y.toolName});f&&(a.set(f.id,d),i.add(o),r.delete(f.id))}}}}return g.jsx(H3,{from:e.role,className:ke(t&&"pb-2"),children:g.jsx(V3,{children:(s=e.parts)==null?void 0:s.map((o,l)=>{if(typeof o!="object"||o===null||!("type"in o))return null;const c=o,u=c.type;if(u==="text"){if(i.has(l))return null;const d=c.text;return d?g.jsx(S6,{children:d},l):null}if(u==="tool-invocation"){const d=c.toolInvocation;return d?H1({toolCallId:String(d.toolCallId??""),toolName:String(d.toolName??""),description:typeof d.description=="string"?d.description:void 0,input:d.args,output:d.result,state:d.state,errorMessage:typeof d.error=="string"?d.error:typeof d.errorMessage=="string"?d.errorMessage:void 0},l):null}if(u==="tool-call"){const d=String(c.toolCallId??""),f=d?n.get(d):void 0,p=(f==null?void 0:f.output)??(f==null?void 0:f.result),y=d?a.get(d):void 0;if(y)return H1({toolCallId:d,toolName:String(c.toolName??""),description:void 0,input:c.input,output:void 0,state:"error",errorMessage:y},l);let b,x=!1;if((f==null?void 0:f.isError)===!0)x=!0,b=typeof p=="string"?p:JSON.stringify(p);else if(typeof p=="object"&&p!==null){const _=p;_.type==="error-text"?(x=!0,b=typeof _.text=="string"?_.text:JSON.stringify(_)):_.type==="error-json"&&(x=!0,b=JSON.stringify(_.value??_))}return H1({toolCallId:d,toolName:String(c.toolName??""),description:void 0,input:c.input,output:x?void 0:p,state:x?"error":p!==void 0?"result":"call",errorMessage:b},l)}if(u==="tool-result")return null;if(u==="tool-error"){const d=c.error,f=typeof d=="string"?d:d instanceof Error?d.message:JSON.stringify(d);return H1({toolCallId:String(c.toolCallId??""),toolName:String(c.toolName??""),description:void 0,input:c.input,output:void 0,state:"error",errorMessage:f},l)}if(u==="step-start")return null;if(u==="dynamic-tool")return H1({toolCallId:String(c.toolCallId??""),toolName:String(c.toolName??""),description:void 0,input:c.input,output:c.output,state:c.state,errorMessage:typeof c.errorText=="string"?c.errorText:void 0},l);if(typeof u=="string"&&u.startsWith("tool-")){const d=u.slice(5);return H1({toolCallId:String(c.toolCallId??""),toolName:d,description:void 0,input:c.input,output:c.output,state:c.state,errorMessage:typeof c.errorText=="string"?c.errorText:void 0},l)}return null})})})}function z5t({className:e,text:t,...n}){const{t:r}=Hn("common");return g.jsxs("div",{className:ke("flex items-center gap-2",e),children:[g.jsx(Nh,{className:"h-4 w-4 animate-spin text-muted-foreground"}),g.jsx(w$,{className:ke("text-sm",e),duration:1,spread:2,...n,children:t||r("chat.thinking")})]})}const rl={all:["specs"],lists:()=>[...rl.all,"list"],list:(e,t)=>[...rl.lists(),e,t],details:()=>[...rl.all,"detail"],detail:(e,t)=>[...rl.details(),e,t],stats:e=>[...rl.all,"stats",e],dependencies:(e,t)=>[...rl.all,"deps",e,t]};function ywe(e,t){return sl({queryKey:rl.list(e??"",t),queryFn:()=>(e&&gn.setCurrentProjectId(e),gn.getSpecs(t)),enabled:!!e,staleTime:10*1e3})}function xOt(e,t){return sl({queryKey:[...rl.list(e??"",t),"hierarchy"],queryFn:()=>(e&&gn.setCurrentProjectId(e),gn.getSpecsWithHierarchy(t)),enabled:!!e,staleTime:10*1e3})}function _Ot(e,t,n){return sl({queryKey:[...rl.all,"search",e??"",t,n],queryFn:()=>(e&&gn.setCurrentProjectId(e),gn.searchSpecs(t,n)),enabled:!!e&&t.length>0,placeholderData:t6e,staleTime:5*1e3})}function EOt(e,t){const n=S.useMemo(()=>[...t].sort(),[t]);return sl({queryKey:[...rl.all,"batch-metadata",e??"",n],queryFn:()=>(e&&gn.setCurrentProjectId(e),PEe().getBatchMetadata(e,n)),enabled:!!e&&n.length>0,staleTime:30*1e3})}function wOt(e,t){return sl({queryKey:rl.detail(e??"",t??""),queryFn:()=>(e&&gn.setCurrentProjectId(e),gn.getSpec(t)),enabled:!!e&&!!t,staleTime:30*1e3})}function SOt(e){return sl({queryKey:rl.stats(e??""),queryFn:()=>(e&&gn.setCurrentProjectId(e),gn.getStats()),enabled:!!e,staleTime:30*1e3})}function U5t(){const e=ll();return()=>{e.invalidateQueries({queryKey:rl.lists(),refetchType:"active"}),e.invalidateQueries({queryKey:rl.details(),refetchType:"active"}),e.invalidateQueries({queryKey:["specs","stats"],refetchType:"active"})}}function H5t(e,t){const n=e.message??"";if(!n.includes("Tool error")&&!n.includes("Tool execution failed"))return!1;const r=t[t.length-1];return!r||r.role!=="assistant"||!r.parts?!1:r.parts.some(i=>{if(typeof i!="object"||i===null||!("type"in i))return!1;const a=i;return a.type==="tool-call"||a.type==="tool-invocation"||a.type==="dynamic-tool"||typeof a.type=="string"&&a.type.startsWith("tool-")})}function V5t(e){return{type:"source-document",sourceId:e.specName,title:e.title??e.specName,filename:e.specName,mediaType:"text/markdown"}}function bwe(e){const t=e.sourceId,n=e.title,r=e.filename;return t??n??r??null}function q5t({specs:e,selectedSpecIds:t}){const n=fyt(),r=S.useRef([]);return S.useEffect(()=>{const i=new Set(r.current),a=new Set(t);for(const s of n.sources){const o=bwe(s);o&&!a.has(o)&&n.remove(s.id)}for(const s of t)if(!i.has(s)){const o=e.find(l=>l.specName===s);o&&n.add(V5t(o))}r.current=t},[t,e]),null}function G5t(){const{t:e}=Hn("common");return g.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center p-8",children:[g.jsx("div",{className:"w-16 h-16 rounded-full bg-muted flex items-center justify-center mb-4",children:g.jsx(Qre,{className:"h-8 w-8 text-muted-foreground"})}),g.jsx("h3",{className:"text-lg font-medium mb-2",children:e("chat.title")}),g.jsx("p",{className:"text-sm text-muted-foreground max-w-sm",children:e("chat.empty")})]})}function W5t({messages:e,onSubmit:t,isLoading:n,error:r,onRetry:i,className:a,footerContent:s,inputRef:o}){const{t:l}=Hn("common"),{currentProject:c}=Qa(),d=ywe((c==null?void 0:c.id)??null).data??[],f=e.length>0||r,[p,y]=S.useState([]),b=x=>{if(x.text.trim()){const _=x.referencedSources.map(w=>bwe(w)).filter(w=>!!w),E=_.length?`${l("chat.specContextPrefix")}
|
|
2135
|
+
`));const u={...s,content:`${l}${o}${c}`,done:t.done,timestamp:t.timestamp??s.timestamp};return delete u._autoClosed,n[a]=u,n}if((s==null?void 0:s.type)==="acp_message"||(s==null?void 0:s.type)==="acp_tool_call"&&(s.status==="completed"||s.status==="failed"))break}if(t.type!=="acp_thought"&&(r==null?void 0:r.type)==="acp_thought"&&!r.done&&(n[n.length-1]={...r,done:!0},n[n.length-1]._autoClosed=!0),t.type!=="acp_message"&&(r==null?void 0:r.type)==="acp_message"&&!r.done&&(n[n.length-1]={...r,done:!0},n[n.length-1]._autoClosed=!0),t.type==="complete")for(let a=0;a<n.length;a++){const s=n[a];((s==null?void 0:s.type)==="acp_thought"||(s==null?void 0:s.type)==="acp_message")&&!s.done&&(n[a]={...s,done:!0})}if(t.type==="acp_tool_call"){const a=n.findIndex(s=>s.type==="acp_tool_call"&&s.id===t.id);if(a>=0){const s=n[a];return s.type==="acp_tool_call"&&(n[a]={...s,...t,args:Object.keys(t.args).length>0?t.args:s.args,result:t.result??s.result}),n}}if(t.type==="acp_plan"){let a=-1;for(let s=n.length-1;s>=0;s-=1)if(((i=n[s])==null?void 0:i.type)==="acp_plan"){a=s;break}if(a>=0)return n[a]=t,n}return n.push(t),n}function vOt(e){let t=!1;const n=e.map(r=>(r.type==="acp_thought"||r.type==="acp_message")&&!r.done?(t=!0,{...r,done:!0}):r);return t?n:e}function y5t({sessionId:e,onBack:t}){var E;const{t:n}=Hn("common"),{currentProject:r}=Qa(),{stopSession:i,pauseSession:a}=awe((r==null?void 0:r.id)??null),[s,o]=S.useState(null),[l,c]=S.useState([]),[u,d]=S.useState([]),[f,p]=S.useState(!0),[y,b]=S.useState(!0),x=S.useRef(null);if(S.useEffect(()=>{const w=async()=>{try{const k=await gn.getSession(e);o(k);const N=await gn.getSessionLogs(e);c(N);const R=N.slice().reverse().reduce((L,j)=>g5t(L,m5t(j)),[]);d(R)}finally{p(!1)}};w();const C=setInterval(w,2e3);return()=>clearInterval(C)},[e]),S.useEffect(()=>{y&&x.current&&(x.current.scrollTop=x.current.scrollHeight)},[l,y]),f&&!s)return g.jsx("div",{className:"p-4 text-xs",children:n("actions.loading")});const _=h5t(s);return g.jsxs("div",{className:"flex flex-col h-full",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2 p-1",children:[g.jsx(ct,{variant:"ghost",size:"icon",onClick:t,className:"h-8 w-8",children:g.jsx(FP,{className:"h-4 w-4"})}),g.jsxs("div",{className:"font-semibold text-sm truncate",children:[s==null?void 0:s.runner,(((E=s==null?void 0:s.specIds)==null?void 0:E.length)??0)>0?` • #${s==null?void 0:s.specIds[0]}`:""]}),g.jsx("div",{className:"ml-auto rounded-full border border-border px-2 py-0.5 text-[10px] text-muted-foreground",children:n(_?"sessions.labels.protocolAcp":"sessions.labels.protocolCli")})]}),g.jsx("div",{className:"flex items-center gap-2 mb-2 px-1",children:(s==null?void 0:s.status)==="running"&&g.jsxs(g.Fragment,{children:[g.jsxs(ct,{size:"sm",variant:"outline",className:"h-7 text-xs flex-1",onClick:()=>s&&a(s.id),children:[g.jsx(UP,{className:"h-3 w-3 mr-1"})," ",n("sessions.actions.pause")]}),g.jsxs(ct,{size:"sm",variant:"destructive",className:"h-7 text-xs flex-1",onClick:()=>s&&i(s.id),children:[g.jsx(dk,{className:"h-3 w-3 mr-1"})," ",n("sessions.actions.stop")]})]})}),g.jsxs("div",{className:"flex items-center justify-between mb-2 px-1",children:[g.jsx("div",{className:"text-xs font-semibold",children:n("sessions.labels.logs")}),g.jsxs("div",{className:"flex gap-1",children:[g.jsx(ct,{size:"icon",variant:"ghost",className:"h-6 w-6",children:g.jsx(Wre,{className:"h-3 w-3"})}),g.jsx(ct,{size:"sm",variant:y?"secondary":"ghost",className:"h-6 text-[10px] px-2",onClick:()=>b(!y),children:n("sessions.labels.autoScroll")})]})]}),_?g.jsx("div",{className:"flex-1 min-h-0",children:g.jsx(u5t,{events:u,loading:f,emptyTitle:n("sessions.emptyLogs"),emptyDescription:n("sessionDetail.logsDescription")})}):g.jsx("div",{ref:x,className:"flex-1 bg-muted/50 rounded-md p-2 overflow-y-auto text-[10px] font-mono whitespace-pre-wrap",children:l.map(w=>{var C;return g.jsxs("div",{className:"mb-1",children:[g.jsxs("span",{className:"text-muted-foreground",children:["[",(C=w.timestamp.split("T")[1])==null?void 0:C.split(".")[0],"]"]})," ",g.jsx("span",{className:ke("font-bold",w.level==="error"?"text-red-500":"text-blue-500"),children:w.level.toUpperCase()})," ",g.jsx("span",{children:w.message})]},`${w.timestamp}-${w.id}`)})})]})}function kte(e){return e.status==="running"||e.status==="paused"}function b5t(){const{t:e}=Hn("common"),t=ql(),{currentProject:n}=Qa(),{data:r=[]}=nN((n==null?void 0:n.id)??null),{pauseSession:i,resumeSession:a,stopSession:s}=awe((n==null?void 0:n.id)??null),{isDrawerOpen:o,specFilter:l,createDialogNonce:c,openDrawer:u,closeDrawer:d,setSpecFilter:f}=Nz(),[p,y]=S.useState(!1),[b,x]=S.useState(!1),[_,E]=S.useState(null),w=S.useRef(c);S.useEffect(()=>{o&&!p&&y(!0)},[o]),S.useEffect(()=>{c!==w.current&&(w.current=c,y(!1),x(!0))},[c]);const C=S.useCallback(q=>{y(q),q?u():(d(),f(null))},[d,u,f]),k=S.useMemo(()=>(l?r.filter(Q=>{var I;return((I=Q.specIds)==null?void 0:I.some(V=>V===l||V.includes(l)))??!1}):r.filter(kte)).sort((Q,I)=>new Date(I.startedAt).getTime()-new Date(Q.startedAt).getTime()),[r,l]),N=S.useMemo(()=>r.filter(kte).sort((q,Q)=>new Date(Q.startedAt).getTime()-new Date(q.startedAt).getTime()),[r]),R=S.useMemo(()=>N.filter(q=>q.status==="running").length,[N]),L=S.useMemo(()=>N.filter(q=>q.status==="pending").length,[N]),j=R>0||L>0,B=()=>{if(!(n!=null&&n.id))return;C(!1);const q=l?`/projects/${n.id}/sessions?spec=${l}`:`/projects/${n.id}/sessions`;t(q)},F=()=>{C(!1),setTimeout(()=>{x(!0)},200)};return g.jsxs(g.Fragment,{children:[g.jsxs(Mc,{open:p,onOpenChange:C,children:[g.jsxs(Qo,{children:[g.jsx(Jo,{asChild:!0,children:g.jsx(Ic,{asChild:!0,children:g.jsxs(ct,{variant:"ghost",size:"icon",className:"relative h-9 w-9 sm:h-10 sm:w-10","data-tauri-drag-region":"false",children:[g.jsx(ED,{className:"h-5 w-5"}),j&&g.jsxs("span",{className:"absolute top-1.5 right-1.5 flex h-2.5 w-2.5",children:[g.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-green-400 opacity-75"}),g.jsx("span",{className:"relative inline-flex rounded-full h-2.5 w-2.5 bg-green-500"})]}),g.jsx("span",{className:"sr-only",children:e("sessions.title")})]})})}),g.jsx(xo,{children:g.jsx("p",{children:e("sessions.title")})})]}),g.jsx(Gl,{className:"w-[800px] max-w-[90vw] p-0",align:"end",alignOffset:-8,children:g.jsxs("div",{className:"flex h-[500px] max-h-[85vh] w-full flex-col md:flex-row",children:[g.jsxs("div",{className:"w-full border-b flex flex-col md:w-[380px] shrink-0 md:border-b-0 md:border-r",children:[g.jsxs("div",{className:"flex items-center justify-between p-3 border-b",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-sm font-semibold",children:e("sessions.title")}),(R>0||L>0)&&g.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[R>0&&g.jsxs("span",{className:"flex items-center gap-1",children:[g.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-green-500"}),g.jsx("span",{className:"text-muted-foreground",children:R})]}),L>0&&g.jsxs("span",{className:"flex items-center gap-1",children:[g.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-amber-500"}),g.jsx("span",{className:"text-muted-foreground",children:L})]})]})]}),g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx(gw,{children:g.jsxs(Qo,{children:[g.jsx(Jo,{asChild:!0,children:g.jsx(ct,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:F,children:g.jsx(Fl,{className:"h-4 w-4"})})}),g.jsx(xo,{children:e("sessions.actions.new")})]})}),g.jsx(ct,{size:"sm",variant:"link",className:"h-7 px-2 text-xs",onClick:B,children:e("sessions.actions.viewAll")})]})]}),l&&g.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b bg-muted/30",children:[g.jsx(P4,{className:"h-3 w-3 text-muted-foreground shrink-0"}),g.jsxs("span",{className:"text-xs text-muted-foreground",children:[e("sessionsPage.filters.spec"),":"]}),g.jsxs(ei,{variant:"secondary",className:"text-xs px-2 py-0 h-5 gap-1 max-w-[200px]",children:[g.jsx("span",{className:"truncate",children:l}),g.jsx("button",{type:"button",onClick:()=>f(null),className:"ml-0.5 rounded-full hover:bg-muted-foreground/20 cursor-pointer",children:g.jsx(cl,{className:"h-3 w-3"})})]})]}),g.jsx("div",{className:"flex-1 space-y-2 overflow-y-auto p-3",children:k.length===0?g.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-4",children:[g.jsx(ED,{className:"h-8 w-8 text-muted-foreground/50 mb-3"}),g.jsx("p",{className:"text-sm font-medium",children:e(l?"sessions.emptyForSpec":"sessions.empty")}),g.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:e("sessions.labels.emptyHint","Start a new session to run specs")}),g.jsx(ct,{variant:"outline",size:"sm",className:"mt-4",onClick:F,children:e("sessions.actions.new")})]}):k.map(q=>{var z;const Q=zb[q.status],I=Q.icon,V=_===q.id;return g.jsxs("button",{type:"button",className:`w-full rounded-md border p-3 mb-2 text-left transition-all ${V?"border-primary bg-primary/5 ring-1 ring-primary/20":"hover:border-primary/30 hover:bg-muted/50"}`,onClick:()=>E(q.id),children:[g.jsxs("div",{className:"mb-1.5 flex items-start justify-between gap-2",children:[g.jsx("span",{className:"text-sm font-medium leading-none line-clamp-2",children:((z=q.prompt)==null?void 0:z.trim())||q.id.slice(0,8)}),g.jsxs(ei,{variant:"outline",className:`${Q.className} shrink-0`,children:[g.jsx(I,{className:"mr-1 h-3 w-3"}),e(`sessions.status.${q.status}`)]})]}),g.jsx("div",{className:"mb-3 truncate text-xs text-muted-foreground",children:q.specIds.length>0?q.specIds.join(", "):e("sessions.select.empty")}),g.jsxs("div",{className:"flex items-center gap-1.5 mt-auto",children:[q.status==="running"&&g.jsxs(g.Fragment,{children:[g.jsxs(ct,{size:"sm",variant:"secondary",className:"h-7 px-2.5 text-xs flex-1",onClick:G=>{G.stopPropagation(),i(q.id)},children:[g.jsx(UP,{className:"mr-1.5 h-3.5 w-3.5"}),e("sessions.actions.pause")]}),g.jsxs(ct,{size:"sm",variant:"destructive",className:"h-7 px-2.5 text-xs flex-1",onClick:G=>{G.stopPropagation(),s(q.id)},children:[g.jsx(dk,{className:"mr-1.5 h-3 w-3"}),e("sessions.actions.stop")]})]}),q.status==="paused"&&g.jsxs(g.Fragment,{children:[g.jsxs(ct,{size:"sm",variant:"secondary",className:"h-7 px-2.5 text-xs flex-1",onClick:G=>{G.stopPropagation(),a(q.id)},children:[g.jsx(Jre,{className:"mr-1.5 h-3.5 w-3.5"}),e("sessions.actions.resume")]}),g.jsxs(ct,{size:"sm",variant:"destructive",className:"h-7 px-2.5 text-xs flex-1",onClick:G=>{G.stopPropagation(),s(q.id)},children:[g.jsx(dk,{className:"mr-1.5 h-3 w-3"}),e("sessions.actions.stop")]})]})]})]},q.id)})})]}),g.jsx("div",{className:"flex-1 p-0 flex flex-col min-h-0 bg-muted/10 relative overflow-hidden",children:_?g.jsx(y5t,{sessionId:_,onBack:()=>E(null)}):g.jsxs("div",{className:"flex flex-col h-full items-center justify-center p-6 text-center text-muted-foreground w-full",children:[g.jsx(ED,{className:"h-10 w-10 mb-4 opacity-20"}),g.jsx("p",{className:"text-sm",children:e("sessions.labels.logs")}),g.jsx("p",{className:"text-xs mt-1 max-w-[250px] opacity-70",children:e("sessions.labels.logsHint","Select an active session from the left to view its execution logs")})]})})]})})]}),g.jsx(i5t,{open:b,onOpenChange:x,projectPath:n==null?void 0:n.path,defaultSpecId:l})]})}const v5t="/logo-with-bg.svg",x5t="/logo-dark-bg.svg";function _5t(e){const t=e.match(/^\/projects\/[^/]+(\/.*)?$/);return t?t[1]||"/":e}function E5t(e){const t=_5t(e);return t==="/"?{page:"home"}:t==="/stats"?{page:"stats"}:t==="/dependencies"?{page:"dependencies"}:t==="/context"?{page:"context"}:t==="/settings"?{page:"settings"}:t==="/machines"?{page:"machines"}:t==="/specs"||t.startsWith("/specs?")?{page:"specs",query:t.split("?")[1]}:t.startsWith("/specs/")?{page:"spec-detail",specId:t.split("/")[2]}:t==="/sessions"||t.startsWith("/sessions?")?{page:"sessions",query:t.split("?")[1]}:t.startsWith("/sessions/")?{page:"session-detail",specId:t.split("/")[2]}:{page:"unknown"}}function w5t({basePath:e}){const t=Hs(),{t:n}=Hn("common"),r=n("navigation.home"),i=n("navigation.specs"),a=n("navigation.stats"),s=n("navigation.dependencies"),o=n("navigation.context"),l=n("navigation.settings"),c=n("navigation.machines"),u=n("navigation.sessions"),d=E5t(t.pathname);let f=[];switch(d.page){case"home":f=[{label:r}];break;case"stats":f=[{label:r,to:e},{label:a}];break;case"dependencies":f=[{label:r,to:e},{label:s}];break;case"context":f=[{label:r,to:e},{label:o}];break;case"settings":f=[{label:r,to:e},{label:l}];break;case"machines":f=[{label:r,to:e},{label:c}];break;case"specs":{f=[{label:r,to:e},{label:i}];break}case"spec-detail":f=[{label:r,to:e},{label:i,to:`${e}/specs`},{label:d.specId||""}];break;case"sessions":f=[{label:r,to:e},{label:u}];break;case"session-detail":f=[{label:r,to:e},{label:u,to:`${e}/sessions`},{label:d.specId||""}];break;default:f=[{label:r,to:e}]}return g.jsx("nav",{className:"hidden md:flex items-center gap-1 text-sm text-muted-foreground",children:f.map((p,y)=>g.jsxs("div",{className:"flex items-center gap-1",children:[y>0&&g.jsx(hu,{className:"h-4 w-4"}),p.to?g.jsx(og,{to:p.to,className:"hover:text-foreground transition-colors",children:p.label}):g.jsx("span",{className:"text-foreground",children:p.label})]},y))})}function S5t({onToggleSidebar:e,rightSlot:t,onHeaderDoubleClick:n}){const{t:r}=Hn("common"),{projectId:i}=sg(),{currentProject:a}=Qa(),{toggleChat:s}=eN(),o=i??(a==null?void 0:a.id),l=o?`/projects/${o}`:"/projects",c=()=>{e==null||e()};return g.jsx("header",{className:"sticky top-0 z-50 h-14 border-b border-border bg-background transition-all duration-300 ease-in-out","data-tauri-drag-region":"true",onDoubleClick:n,children:g.jsxs("div",{className:"flex items-center justify-between h-full px-4",children:[g.jsxs("div",{className:"flex items-center gap-2 sm:gap-4 min-w-0 flex-1",children:[g.jsxs(ct,{variant:"ghost",size:"icon",onClick:c,className:"lg:hidden h-9 w-9 shrink-0","data-tauri-drag-region":"false",children:[g.jsx(dRe,{className:"h-5 w-5"}),g.jsx("span",{className:"sr-only",children:r("navigation.toggleMenu")})]}),g.jsxs(og,{to:l,className:"flex items-center space-x-2 shrink-0","data-tauri-drag-region":"false",children:[g.jsx("img",{src:v5t,alt:r("navigation.logoAlt"),className:"h-7 w-7 sm:h-8 sm:w-8 dark:hidden"}),g.jsx("img",{src:x5t,alt:r("navigation.logoAlt"),className:"h-7 w-7 sm:h-8 sm:w-8 hidden dark:block"}),g.jsx("span",{className:"font-bold text-lg sm:text-xl hidden sm:inline",children:r("navigation.brandName")})]}),g.jsx("div",{className:"hidden md:block min-w-0","data-tauri-drag-region":"false",children:g.jsx(w5t,{basePath:l})})]}),g.jsxs("div",{className:"flex items-center gap-1 sm:gap-2 shrink-0","data-tauri-drag-region":"false",children:[g.jsx("div",{"data-tauri-drag-region":"false",children:g.jsx(X3t,{})}),g.jsxs(gw,{children:[g.jsx(i4t,{}),g.jsx(r4t,{}),g.jsx(Q3t,{}),g.jsxs(Qo,{children:[g.jsx(Jo,{asChild:!0,children:g.jsx(ct,{variant:"ghost",size:"icon",asChild:!0,className:"h-9 w-9 sm:h-10 sm:w-10","data-tauri-drag-region":"false",children:g.jsx("a",{href:"https://harnspec.gitub.io",target:"_blank",rel:"noopener noreferrer","aria-label":r("navigation.docsTooltip"),children:g.jsx(Hre,{className:"h-5 w-5"})})})}),g.jsx(xo,{children:g.jsx("p",{children:r("navigation.docsTooltip")})})]}),g.jsxs(Qo,{children:[g.jsx(Jo,{asChild:!0,children:g.jsx(ct,{variant:"ghost",size:"icon",asChild:!0,className:"h-9 w-9 sm:h-10 sm:w-10","data-tauri-drag-region":"false",children:g.jsxs("a",{href:"https://github.com/harnspec/harnspec",target:"_blank",rel:"noopener noreferrer","aria-label":r("navigation.githubTooltip"),children:[g.jsx("img",{src:"/github-mark-white.svg",alt:r("navigation.githubAlt"),className:"hidden dark:block w-5 h-5"}),g.jsx("img",{src:"/github-mark.svg",alt:r("navigation.githubAlt"),className:"dark:hidden w-5 h-5"})]})})}),g.jsx(xo,{children:g.jsx("p",{children:r("navigation.githubTooltip")})})]}),g.jsx(b5t,{}),g.jsxs(Qo,{children:[g.jsx(Jo,{asChild:!0,children:g.jsxs(ct,{variant:"ghost",size:"icon",className:"h-9 w-9 sm:h-10 sm:w-10",onClick:s,"data-tauri-drag-region":"false",children:[g.jsx(X6e,{className:"h-5 w-5"}),g.jsx("span",{className:"sr-only",children:r("chat.openChat")})]})}),g.jsx(xo,{children:g.jsx("p",{children:r("chat.openChat")})})]}),t&&g.jsx("div",{className:"ml-2 flex items-center","data-tauri-drag-region":"false",children:t})]})]})]})})}const Nte=["local","git"];async function T5t(){const t=await fetch("/api/capabilities");if(!t.ok)throw new Error("Failed to fetch capabilities");return t.json()}function hwe(){const e=sl({queryKey:["capabilities"],queryFn:T5t,staleTime:3e5,retry:1,placeholderData:{projectSources:Nte,readonly:!1}}),t=e.data??{projectSources:Nte,readonly:!1};return{...e,capabilities:t,hasSource:n=>t.projectSources.includes(n)}}function C5t({onSelect:e,onCancel:t,initialPath:n,actionLabel:r,isLoading:i}){const[a,s]=S.useState(n||""),[o,l]=S.useState([]),[c,u]=S.useState(!1),[d,f]=S.useState(null),p=S.useRef(null),{t:y}=Hn("common"),b=i||c;S.useEffect(()=>{x(a)},[a]),S.useEffect(()=>{p.current&&(p.current.scrollLeft=p.current.scrollWidth)},[a]);const x=async R=>{try{u(!0),f(null);const L=await gn.listDirectory(R);l(L.items||[]),!R&&L.path&&s(L.path)}catch(L){const j=L instanceof Error?L.message:y("directoryPicker.error");f(j)}finally{u(!1)}},_=R=>{s(R)},E=o.find(R=>R.name===".."),w=o.filter(R=>R.name!==".."),k=(R=>{if(!R)return[];const L=R.includes("\\")?"\\":"/",j=R.split(L).filter(Boolean),B=R.startsWith("/");return j.map((F,q)=>{let Q=j.slice(0,q+1).join(L);return B&&(Q="/"+Q),{name:F,path:Q}})})(a),N=r??y("directoryPicker.action");return g.jsxs("div",{className:"flex flex-col h-[400px] gap-4 min-w-0 overflow-hidden",children:[g.jsxs("div",{className:"flex items-center border rounded-md p-1 gap-1 bg-muted/30 min-w-0 overflow-hidden",children:[g.jsx(ct,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0",disabled:!E||b,onClick:()=>E&&_(E.path),title:y("directoryPicker.parent"),children:g.jsx(FP,{className:"h-4 w-4"})}),g.jsx("div",{className:"w-px h-5 bg-border mx-1 shrink-0"}),g.jsxs("div",{ref:p,className:"flex-1 overflow-x-auto whitespace-nowrap flex items-center scrollbar-hide px-1 min-w-0",title:a,children:[g.jsx(ct,{onClick:()=>_("/"),variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0",title:y("directoryPicker.rootAction"),children:g.jsx(Xre,{className:"h-4 w-4 text-muted-foreground"})}),k.map((R,L)=>g.jsxs("div",{className:"flex items-center shrink-0",children:[g.jsx(hu,{className:"h-3 w-3 text-muted-foreground mx-0.5 shrink-0"}),g.jsx(ct,{onClick:()=>_(R.path),variant:"ghost",size:"sm",className:ke("h-7 text-sm",L===k.length-1?"font-medium text-foreground":"text-muted-foreground"),children:R.name})]},R.path))]})]}),g.jsxs("div",{className:"flex-1 border rounded-md overflow-hidden relative bg-background min-h-0",children:[b&&g.jsx("div",{className:"absolute inset-0 bg-background/50 flex items-center justify-center z-10",children:g.jsx(Nh,{className:"h-6 w-6 animate-spin"})}),d?g.jsxs("div",{className:"p-4 text-destructive text-sm text-center",children:[d,g.jsx(ct,{variant:"link",onClick:()=>x(a),className:"block mx-auto mt-2",children:y("actions.retry")})]}):g.jsx("div",{className:"h-full overflow-auto",children:g.jsx("div",{className:"p-1",children:w.length===0&&!b?g.jsx("div",{className:"p-4 text-center text-sm text-muted-foreground",children:y("directoryPicker.empty")}):w.map(R=>g.jsxs(ct,{onClick:()=>_(R.path),variant:"ghost",size:"sm",className:"w-full justify-start gap-3 h-9 group",children:[g.jsx(Zre,{className:"h-4 w-4 text-blue-500 fill-blue-500/20 group-hover:fill-blue-500/30 transition-colors shrink-0"}),g.jsx("span",{className:"truncate",children:R.name})]},R.path))})})]}),g.jsxs("div",{className:"flex justify-end gap-2",children:[g.jsx(ct,{variant:"outline",onClick:t,disabled:b,children:y("actions.cancel")}),g.jsx(ct,{onClick:()=>e(a),disabled:b||!a,children:N})]})]})}function fwe({onSuccess:e,onCancel:t}){const n=ll(),[r,i]=S.useState(""),[a,s]=S.useState(null),[o,l]=S.useState(!1),[c,u]=S.useState(!1),[d,f]=S.useState(null),p=async()=>{if(r.trim()){l(!0),f(null),s(null);try{const b=await gn.detectGitSpecs(r.trim());b?s(b):f("No HarnSpec specs found in this repository. Make sure it has a `specs/` directory with numbered spec folders.")}catch(b){f(b instanceof Error?b.message:"Failed to detect specs")}finally{l(!1)}}},y=async()=>{if(a){u(!0),f(null);try{const b=await gn.importGitRepo(r.trim(),{branch:a.branch,specsPath:a.specsDir});await n.invalidateQueries({queryKey:["projects"]}),e(b.projectId)}catch(b){f(b instanceof Error?b.message:"Failed to import repository")}finally{u(!1)}}};return g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{className:"grid gap-2",children:[g.jsx(Eoe,{htmlFor:"git-repo",children:"Repository"}),g.jsxs("div",{className:"flex gap-2",children:[g.jsx(Na,{id:"git-repo",value:r,onChange:b=>{i(b.target.value),s(null)},placeholder:"owner/repo, HTTPS URL, or SSH URL",disabled:o||c,onKeyDown:b=>{b.key==="Enter"&&(b.preventDefault(),p())}}),g.jsx(ct,{type:"button",variant:"outline",onClick:()=>{p()},disabled:!r.trim()||o||c,children:o?g.jsx("span",{className:"animate-pulse",children:"…"}):g.jsx(Vh,{className:"h-4 w-4"})})]}),g.jsxs("p",{className:"text-xs text-muted-foreground",children:["Any Git repository — ",g.jsx("code",{children:"acme/project"}),", ",g.jsx("code",{children:"https://github.com/acme/project"}),", or ",g.jsx("code",{children:"git@gitlab.com:team/repo.git"})]})]}),a&&g.jsxs("div",{className:"rounded-md border border-green-500/30 bg-green-500/5 p-3 space-y-1",children:[g.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-green-700 dark:text-green-400",children:[g.jsx(Lp,{className:"h-4 w-4"}),"Found ",a.specCount," spec",a.specCount!==1?"s":""," in ",g.jsxs("code",{children:[a.specsDir,"/"]})]}),g.jsxs("div",{className:"text-xs text-muted-foreground",children:["Branch: ",g.jsx("code",{children:a.branch})]})]}),d&&g.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-3 flex items-start gap-2 text-sm text-destructive",children:[g.jsx(_c,{className:"h-4 w-4 mt-0.5 flex-shrink-0"}),d]}),g.jsxs("div",{className:"flex justify-end gap-2",children:[g.jsx(ct,{variant:"outline",onClick:t,disabled:c,children:"Cancel"}),g.jsx(ct,{onClick:()=>{y()},disabled:!a||c,children:c?"Importing…":`Import ${a?`(${a.specCount} specs)`:""}`})]})]})}function pwe({open:e,onOpenChange:t,initialTab:n}){const{addProject:r}=Q6(),i=ql(),{hasSource:a}=hwe(),s=a("local"),o=a("git"),l=s&&o,c=n??(s?"local":"git"),[u,d]=S.useState(""),[f,p]=S.useState("picker"),[y,b]=S.useState(c),[x,_]=S.useState(!1),[E,w]=S.useState(null),{t:C}=Hn("common");S.useEffect(()=>{e&&(p("picker"),d(""),w(null),b(n??c))},[e,n,c]);const k=async R=>{try{_(!0),w(null);const L=await r(R);return t(!1),L!=null&&L.id?i(`/projects/${L.id}/specs`):i("/"),L}catch(L){const j=L instanceof Error?L.message:C("createProject.toastError");return w(j),null}finally{_(!1)}},N=R=>{if(R.preventDefault(),!u.trim()){w(C("createProject.pathRequired"));return}k(u.trim())};return g.jsx(tm,{open:e,onOpenChange:R=>{t(R),R||w(null)},children:g.jsxs(Gh,{className:"sm:max-w-[600px]",children:[g.jsxs(fg,{children:[g.jsx(pg,{children:C("createProject.title")}),g.jsx(mg,{children:y==="git"?"Connect a Git repository containing HarnSpec specs.":C(f==="picker"?"createProject.descriptionPicker":"createProject.descriptionManual")})]}),l&&g.jsxs("div",{className:"flex gap-1 p-1 bg-muted rounded-lg",children:[g.jsxs("button",{type:"button",className:`flex-1 flex items-center justify-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${y==="local"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,onClick:()=>{b("local"),w(null)},children:[g.jsx(uk,{className:"h-4 w-4"}),"Local"]}),g.jsxs("button",{type:"button",className:`flex-1 flex items-center justify-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${y==="git"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,onClick:()=>{b("git"),w(null)},children:[g.jsx(kh,{className:"h-4 w-4"}),"Git"]})]}),y==="git"&&o?g.jsx(fwe,{onSuccess:R=>{t(!1),i(`/projects/${R}/specs`)},onCancel:()=>t(!1)}):f==="picker"?g.jsxs("div",{className:"space-y-2 min-w-0 overflow-hidden",children:[g.jsx(C5t,{onSelect:k,onCancel:()=>t(!1),initialPath:u,actionLabel:C(x?"createProject.adding":"createProject.action"),isLoading:x}),g.jsx("div",{className:"flex justify-center",children:g.jsx(ct,{variant:"link",size:"sm",onClick:()=>p("manual"),className:"text-muted-foreground",children:C("createProject.enterManually")})})]}):g.jsxs("form",{onSubmit:N,className:"space-y-4",children:[g.jsxs("div",{className:"grid gap-2",children:[g.jsx("label",{htmlFor:"project-path",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:C("createProject.pathLabel")}),g.jsx("div",{className:"flex gap-2",children:g.jsx(Na,{id:"project-path",value:u,onChange:R=>d(R.target.value),placeholder:C("createProject.pathPlaceholder"),className:"flex-1",disabled:x})}),g.jsx("p",{className:"text-xs text-muted-foreground",children:C("createProject.pathHelp")})]}),E&&g.jsx("p",{className:"text-sm text-destructive",children:E}),g.jsxs(iw,{className:"flex-col sm:flex-row gap-2",children:[g.jsx("div",{className:"flex-1 flex justify-start",children:g.jsxs(ct,{type:"button",variant:"ghost",size:"sm",onClick:()=>p("picker"),children:[g.jsx(uk,{className:"h-4 w-4 mr-2"}),C("createProject.browseFolders")]})}),g.jsx(ct,{type:"button",variant:"outline",onClick:()=>t(!1),disabled:x,children:C("actions.cancel")}),g.jsx(ct,{type:"submit",disabled:x||!u.trim(),children:C(x?"createProject.adding":"createProject.action")})]})]}),E&&y==="local"&&g.jsx("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-3 text-sm text-destructive",children:E})]})})}function A5t({open:e,onOpenChange:t}){const n=ql();return g.jsx(tm,{open:e,onOpenChange:t,children:g.jsxs(Gh,{className:"sm:max-w-[520px]",children:[g.jsxs(fg,{children:[g.jsxs(pg,{className:"flex items-center gap-2",children:[g.jsx(kh,{className:"h-5 w-5"}),"Import from Git"]}),g.jsx(mg,{children:"Connect a Git repository containing HarnSpec specs."})]}),g.jsx(fwe,{onSuccess:r=>{t(!1),n(`/projects/${r}/specs`)},onCancel:()=>t(!1)})]})})}function tk({name:e,color:t,icon:n,size:r="md",className:i}){return g.jsx(_Ct,{name:e,color:t||void 0,icon:n,size:r,className:i})}function k5t({collapsed:e}){const{currentProject:t}=Qa(),{projects:n,isLoading:r}=Kw(),{switchProject:i}=Q6(),{t:a}=Hn("common"),s=Hs(),o=ql(),[l,c]=S.useState(!1),[u,d]=S.useState(!1),[f,p]=S.useState(!1),[y,b]=S.useState(!1);if(r)return g.jsx(Rt,{className:ke("w-full",e?"h-9 w-9":"h-10")});const x=async E=>{if(E===(t==null?void 0:t.id)){c(!1);return}b(!0),c(!1);const C=s.pathname.match(/^\/projects\/[^/]+(\/.*)?$/);let k=(C==null?void 0:C[1])||"";(!k||k==="/")&&(k=""),k.match(/^\/specs\/[^/]+$/)&&(k="/specs");try{await i(E),o(`/projects/${E}${k}${s.search}`)}catch(N){console.error("Failed to switch project",N)}finally{b(!1)}},_=[...n||[]].sort((E,w)=>E.favorite===w.favorite?0:E.favorite?-1:1);return g.jsxs(g.Fragment,{children:[g.jsx(pwe,{open:u,onOpenChange:d}),g.jsx(A5t,{open:f,onOpenChange:p}),g.jsxs(Mc,{open:l,onOpenChange:c,children:[g.jsx(Ic,{asChild:!0,children:g.jsx(ct,{variant:"outline",role:"combobox","aria-expanded":l,disabled:y,className:ke("w-full justify-between transition-opacity",e?"h-9 w-9 p-0 justify-center":"px-3",y&&"opacity-70"),children:e?y?g.jsx(Nh,{className:"h-4 w-4 animate-spin"}):g.jsx(tk,{name:(t==null?void 0:t.name)||"",color:t==null?void 0:t.color,size:"xs"}):g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"flex items-center gap-2 truncate",children:[y?g.jsx(Nh,{className:"h-4 w-4 shrink-0 animate-spin"}):g.jsx(tk,{name:(t==null?void 0:t.name)||"",color:t==null?void 0:t.color,size:"xs",className:"shrink-0"}),g.jsx("span",{className:"truncate",children:y?a("projectSwitcher.switching"):(t==null?void 0:t.name)||a("projectSwitcher.placeholder")})]}),g.jsx(L4,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})})}),g.jsx(Gl,{className:"w-[240px] p-0",align:"start",children:g.jsxs(Wh,{children:[g.jsx(nm,{placeholder:a("projectSwitcher.searchPlaceholder")}),g.jsxs(Yh,{children:[g.jsx(Kh,{children:a("projectSwitcher.noProject")}),g.jsx(no,{heading:a("projects.projects"),children:_.map(E=>{const w=(t==null?void 0:t.id)===E.id;return g.jsx(Ss,{onSelect:()=>x(E.id),className:ke("text-sm",w&&"bg-accent"),children:g.jsxs("div",{className:"flex items-center gap-2 w-full",children:[g.jsx(tk,{name:E.name||"",color:E.color,size:"xs",className:"shrink-0"}),g.jsx("span",{className:"truncate flex-1",children:E.name}),E.favorite&&g.jsx(Oh,{className:"h-3 w-3 shrink-0 fill-yellow-600 text-yellow-600 dark:fill-yellow-500 dark:text-yellow-500"}),g.jsx("div",{className:ke("mr-2 flex h-4 w-4 items-center justify-center",(t==null?void 0:t.id)===E.id?"opacity-100":"opacity-0"),children:g.jsx(ua,{className:"h-4 w-4"})})]})},E.id)})}),g.jsx(mF,{}),g.jsxs(no,{children:[g.jsx(Ss,{className:"cursor-pointer",onSelect:()=>{c(!1),d(!0)},children:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(Fl,{className:"h-4 w-4"}),g.jsx("span",{children:a("projects.createProject")})]})}),g.jsx(Ss,{className:"cursor-pointer",onSelect:()=>{c(!1),p(!0)},children:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(kh,{className:"h-4 w-4"}),g.jsx("span",{children:"Import from Git"})]})}),g.jsx(Ss,{className:"cursor-pointer",onSelect:()=>{c(!1),o("/projects")},children:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(Pp,{className:"h-4 w-4"}),g.jsx("span",{children:a("projects.manageProjects")})]})})]})]})]})})]})]})}function mwe({to:e,icon:t,label:n,description:r,isCollapsed:i=!1,stripProjectPrefix:a=!1}){const o=Hs().pathname,l=x=>x.replace(/\/$/,"")||"/",c=l(e),u=l(o),d=x=>{if(!a)return x;const _=x.match(/^\/projects\/[^/]+(\/.*)?$/);return _?_[1]||"/":x},f=d(c),p=d(u),b=f==="/"||f===""?p==="/"||p==="":p===f||p.startsWith(`${f}/`);return g.jsxs(og,{to:e,title:i?n:void 0,className:ke("flex items-center gap-3 rounded-lg px-3 py-2 transition-colors","hover:bg-accent hover:text-accent-foreground",b&&"bg-accent text-accent-foreground font-medium",i&&"justify-center px-2"),children:[g.jsx(t,{className:ke("h-5 w-5 shrink-0",b&&"text-primary")}),!i&&g.jsxs("div",{className:"flex flex-col",children:[g.jsx("span",{className:"text-sm",children:n}),r&&g.jsx("span",{className:"text-xs text-muted-foreground",children:r})]})]})}const Rz=Wl()(Bd(e=>({isSidebarOpen:!1,toggleSidebar:()=>e(t=>({isSidebarOpen:!t.isSidebarOpen})),isWideMode:!1,toggleWideMode:()=>e(t=>({isWideMode:!t.isWideMode})),mainSidebarCollapsed:!1,setMainSidebarCollapsed:t=>e({mainSidebarCollapsed:t}),toggleMainSidebar:()=>e(t=>({mainSidebarCollapsed:!t.mainSidebarCollapsed})),settingsSidebarCollapsed:!1,setSettingsSidebarCollapsed:t=>e({settingsSidebarCollapsed:t}),toggleSettingsSidebar:()=>e(t=>({settingsSidebarCollapsed:!t.settingsSidebarCollapsed}))}),{name:"harnspec:layout",partialize:e=>({isWideMode:e.isWideMode,mainSidebarCollapsed:e.mainSidebarCollapsed,settingsSidebarCollapsed:e.settingsSidebarCollapsed})}));function N5t({mobileOpen:e=!1,onMobileClose:t}){const n=Hs(),{projectId:r}=sg(),{currentProject:i}=Qa(),a=r??(i==null?void 0:i.id),s=a?`/projects/${a}`:"/projects",{t:o}=Hn("common"),{machineModeEnabled:l}=Ig(),{mainSidebarCollapsed:c,toggleMainSidebar:u}=Rz();S.useEffect(()=>{document.documentElement.style.setProperty("--main-sidebar-width",c?"60px":"240px")},[c]),S.useEffect(()=>{e&&t&&t()},[n.pathname,e,t]);const d=[{id:"home",path:s,label:o("navigation.home"),description:o("navigation.dashboard"),icon:Xre},{id:"specs",path:`${s}/specs`,label:o("navigation.specs"),description:o("navigation.allSpecifications"),icon:Kre},{id:"sessions",path:`${s}/sessions`,label:o("navigation.sessions"),description:o("navigation.sessionsDescription"),icon:eie},{id:"files",path:`${s}/files`,label:o("navigation.files"),description:o("navigation.filesDescription"),icon:uk},{id:"dependencies",path:`${s}/dependencies`,label:o("navigation.dependencies"),description:o("navigation.dependencyGraph"),icon:yRe},{id:"stats",path:`${s}/stats`,label:o("navigation.stats"),description:o("navigation.analytics"),icon:qre},{id:"context",path:`${s}/context`,label:o("navigation.context"),description:o("navigation.projectContext"),icon:Hre},{id:"projects",path:"/projects",label:o("navigation.projects"),description:o("navigation.manageProjects"),icon:Zre},{id:"settings",path:"/settings",label:o("navigation.settings"),description:o("navigation.settingsDescription"),icon:Pp},...l?[{id:"machines",path:"/machines",label:o("navigation.machines"),description:o("navigation.manageMachines"),icon:P2}]:[]];return g.jsxs(g.Fragment,{children:[e&&g.jsx("div",{className:"fixed inset-0 bg-black/50 z-40 lg:hidden",onClick:t}),g.jsx("aside",{className:ke("border-r bg-background transition-all duration-300 flex-shrink-0","hidden lg:flex lg:sticky lg:top-14 lg:h-[calc(100dvh-3.5rem)]",c?"lg:w-[60px]":"lg:w-[240px]",e&&"fixed inset-y-0 left-0 z-[60] flex w-[280px]"),children:g.jsxs("div",{className:"flex flex-col h-full w-full",children:[g.jsx("div",{className:"lg:hidden flex justify-end p-2 border-b",children:g.jsx("button",{onClick:t,className:"p-2 hover:bg-secondary rounded-md transition-colors","aria-label":o("navigation.closeMenu"),children:g.jsx(cl,{className:"h-5 w-5"})})}),g.jsxs("nav",{className:"flex-1 px-2 py-2 space-y-1",children:[g.jsx("div",{className:"mb-4 flex items-center justify-center",children:g.jsx(k5t,{collapsed:c&&!e})}),d.map(f=>g.jsx(mwe,{to:f.path,icon:f.icon,label:f.label,description:!c||e?f.description:void 0,isCollapsed:c&&!e,stripProjectPrefix:!0},f.id))]}),g.jsx("div",{className:"hidden lg:block p-2 border-t",children:g.jsxs("button",{onClick:u,className:ke("w-full flex items-center justify-center gap-2 rounded-md px-3 py-2 text-sm hover:bg-secondary transition-colors",c&&"px-2"),children:[c?g.jsx(hu,{className:"h-4 w-4"}):g.jsx(I4,{className:"h-4 w-4"}),!c&&g.jsx("span",{className:"text-xs",children:o("navigation.collapse")})]})})]})})]})}function R5t(){const{machineModeEnabled:e,machines:t,currentMachine:n,selectMachine:r,loading:i}=Ig(),{t:a}=Hn("common"),[s,o]=S.useState(!1);if(!e)return null;const l=(n==null?void 0:n.label)||a("machines.noSelection");return g.jsxs(Mc,{open:s,onOpenChange:o,children:[g.jsx(Ic,{asChild:!0,children:g.jsxs(ct,{variant:"outline",className:"h-8 px-2 gap-2 text-xs","aria-label":a("machines.switcherLabel"),disabled:i,children:[g.jsx(P2,{className:"h-3.5 w-3.5"}),g.jsx("span",{className:"truncate max-w-[160px]",children:l}),(n==null?void 0:n.status)==="offline"?g.jsx(tie,{className:"h-3.5 w-3.5 text-destructive"}):g.jsx(CL,{className:"h-3.5 w-3.5 text-emerald-500"}),g.jsx(L4,{className:"h-3.5 w-3.5 opacity-60"})]})}),g.jsx(Gl,{align:"end",className:"w-64 p-0",children:g.jsx(Wh,{children:g.jsxs(Yh,{children:[g.jsx(Kh,{children:a("machines.empty")}),g.jsx(no,{heading:a("machines.available"),children:t.map(c=>g.jsx(Ss,{onSelect:()=>{r(c.id),o(!1)},children:g.jsxs("div",{className:"flex items-center gap-2 w-full",children:[g.jsx(P2,{className:"h-4 w-4"}),g.jsx("span",{className:"truncate flex-1",children:c.label}),g.jsx("span",{className:ke("text-[10px] uppercase tracking-wide",c.status==="online"?"text-emerald-500":"text-destructive"),children:c.status==="online"?a("machines.status.online"):a("machines.status.offline")}),g.jsx("div",{className:ke("mr-1 flex h-4 w-4 items-center justify-center",(n==null?void 0:n.id)===c.id?"opacity-100":"opacity-0"),children:g.jsx(ua,{className:"h-3 w-3"})})]})},c.id))})]})})})]})}function D5t(e){const[t,n]=S.useState(!1);return S.useEffect(()=>{const r=window.matchMedia(e);r.matches!==t&&n(r.matches);const i=()=>n(r.matches);return r.addEventListener("change",i),()=>r.removeEventListener("change",i)},[e,t]),t}function M5t({onResize:e,onResizeStart:t,onResizeEnd:n,minWidth:r=300,maxWidth:i=1/0}){const[a,s]=S.useState(!1);return S.useEffect(()=>{if(!a)return;const o=c=>{const u=window.innerWidth-c.clientX,d=Math.min(i,window.innerWidth),f=Math.min(Math.max(u,r),d);e(f)},l=()=>{s(!1),n==null||n(),document.body.style.cursor="",document.body.style.userSelect=""};return document.addEventListener("mousemove",o),document.addEventListener("mouseup",l),document.body.style.cursor="col-resize",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",l),document.body.style.cursor="",document.body.style.userSelect=""}},[a,r,i,e,n]),g.jsx("div",{className:ke("absolute left-0 top-0 bottom-0 w-1 cursor-col-resize hover:bg-primary/50 transition-colors z-50",a&&"bg-primary/50 w-1.5"),onMouseDown:()=>{s(!0),t==null||t()}})}const Dz=e=>typeof e=="object"&&e!==null,nl=e=>typeof e=="string"?e:void 0,I5t=e=>Array.isArray(e)?e.filter(t=>typeof t=="string"):[],gwe=e=>typeof e=="number"?e:void 0,rN=({output:e})=>{const{t}=Hn("common"),n=b2e(e);return g.jsx(_5,{code:n,language:"json",maxHeight:300,children:g.jsxs(oue,{children:[g.jsx(lue,{children:t("chat.toolExecution.labels.output")}),g.jsx(cue,{children:g.jsx(uue,{"aria-label":t("chat.toolExecution.actions.copy"),size:"icon-sm"})})]})})},L5t=({output:e})=>{if(!Dz(e)||!Array.isArray(e.results))return g.jsx(rN,{output:e});const t=e.results,n=nl(e.query),r=gwe(e.count);return g.jsxs("div",{className:"space-y-2 text-xs",children:[g.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n&&g.jsx("span",{className:"rounded-md bg-muted/40 px-2 py-1 font-mono text-[10px]",children:n}),typeof r=="number"&&g.jsx(ei,{className:"text-[10px]",variant:"secondary",children:r})]}),g.jsx("div",{className:"grid gap-2",children:t.map((i,a)=>{const s=nl(i.title)??nl(i.name)??nl(i.path)??`#${a+1}`,o=nl(i.path),l=nl(i.snippet);return g.jsxs("div",{className:"rounded-md border bg-muted/20 p-2",children:[g.jsx("div",{className:"font-medium text-foreground",children:s}),o&&g.jsx("div",{className:"text-[10px] text-muted-foreground font-mono",children:o}),l&&g.jsx("div",{className:"mt-1 text-muted-foreground",children:l})]},o??`${s}-${a}`)})})]})},O5t=({output:e})=>{if(!Dz(e)||!Array.isArray(e.groups))return g.jsx(rN,{output:e});const t=e.groups;return g.jsx("div",{className:"grid gap-2 text-xs",children:t.map((n,r)=>{const i=nl(n.name)??`#${r+1}`,a=gwe(n.count),s=Array.isArray(n.specs)?n.specs:[];return g.jsxs("div",{className:"rounded-md border bg-muted/20 p-2",children:[g.jsxs("div",{className:"flex items-center justify-between gap-2",children:[g.jsx("div",{className:"font-medium text-foreground truncate",children:i}),typeof a=="number"&&g.jsx(ei,{className:"text-[10px]",variant:"secondary",children:a})]}),s.length>0&&g.jsx("div",{className:"mt-2 grid gap-1 text-[10px] text-muted-foreground",children:s.slice(0,6).map((o,l)=>{const c=nl(o.title)??nl(o.path)??nl(o.name)??`#${l+1}`,u=nl(o.status);return g.jsxs("div",{className:"flex items-center justify-between gap-2",children:[g.jsx("span",{className:"truncate",children:c}),u&&g.jsx(ei,{className:"text-[10px]",variant:"outline",children:u})]},`${c}-${l}`)})})]},`${i}-${r}`)})})},P5t=({output:e})=>{const{t}=Hn("common");if(!Dz(e)||typeof e.content!="string")return g.jsx(rN,{output:e});const n=nl(e.title),r=nl(e.path),i=nl(e.status),a=I5t(e.tags),s=e.content,[o,l]=S.useState(!1),c=S.useMemo(()=>v2e(s),[s]),u=o||!c.isTruncated?c.fullText:c.truncatedText;return g.jsxs("div",{className:"space-y-3",children:[(n||r||i||a.length>0)&&g.jsxs("div",{className:"space-y-1 text-xs",children:[n&&g.jsx("div",{className:"text-sm font-semibold",children:n}),r&&g.jsx("div",{className:"text-[10px] text-muted-foreground font-mono",children:r}),(i||a.length>0)&&g.jsxs("div",{className:"flex flex-wrap gap-1",children:[i&&g.jsx(ei,{className:"text-[10px]",variant:"secondary",children:i}),a.map(d=>g.jsx(ei,{className:"text-[10px]",variant:"outline",children:d},d))]}),c.isTruncated&&g.jsx(ct,{className:"h-6 px-2 text-[10px]",onClick:()=>l(d=>!d),size:"sm",type:"button",variant:"ghost",children:t(o?"chat.toolExecution.actions.showLess":"chat.toolExecution.actions.showAll")})]}),g.jsx("div",{className:ke("rounded-md border bg-muted/10 p-3 text-sm"),children:g.jsx(S6,{children:u})})]})},Rte={search:e=>g.jsx(L5t,{output:e}),board:e=>g.jsx(O5t,{output:e}),view:e=>g.jsx(P5t,{output:e})},F5t={resolve:e=>Rte[e]??null,render:(e,t)=>{const n=Rte[e];return n?n(t):g.jsx(rN,{output:t})}},B5t=new Set(["input-streaming","input-available","approval-requested","approval-responded","output-available","output-error","output-denied"]);function j5t(e,t,n){return e&&B5t.has(e)?e:e==="error"||n?"output-error":e==="result"||t!==void 0?"output-available":e==="call"||e==="running"||e==="pending"?"input-available":"input-streaming"}function H1(e,t){const{toolCallId:n,toolName:r,description:i,input:a,output:s,state:o,errorMessage:l}=e,c=s!==void 0?F5t.render(r,s):void 0,u=typeof a=="object"&&a!==null?a:{},d=typeof u.title=="string"?u.title:void 0,f=typeof u.description=="string"?u.description:i;return g.jsxs(j9,{children:[g.jsx($9,{title:d,description:f,state:j5t(o,s,l),toolName:r,type:"dynamic-tool"}),g.jsx(z9,{children:g.jsx(U9,{input:a,output:c,rawOutput:s,errorText:l})})]},n||t)}const Dte=/^\s*\*\*Error:\*\*\s*/;function $5t({message:e,isLast:t}){var s;const n=new Map;if(e.parts){for(const o of e.parts)if(typeof o=="object"&&o!==null&&"type"in o&&o.type==="tool-result"){const l=o,c=String(l.toolCallId??"");c&&n.set(c,l)}}const r=new Map,i=new Set,a=new Map;if(e.parts){for(let o=0;o<e.parts.length;o++){const l=e.parts[o];if(typeof l!="object"||l===null||!("type"in l))continue;const c=l;if(c.type==="tool-call"){const u=String(c.toolCallId??"");u&&!n.has(u)&&r.set(u,{index:o,toolName:String(c.toolName??"")})}}if(r.size>0)for(let o=0;o<e.parts.length;o++){const l=e.parts[o];if(typeof l!="object"||l===null||!("type"in l))continue;const c=l;if(c.type==="text"){const u=c.text;if(u&&Dte.test(u)){const d=u.replace(Dte,"").trim();let f=null;for(const[p,y]of r)y.index<o&&(f={id:p,toolName:y.toolName});f&&(a.set(f.id,d),i.add(o),r.delete(f.id))}}}}return g.jsx(H3,{from:e.role,className:ke(t&&"pb-2"),children:g.jsx(V3,{children:(s=e.parts)==null?void 0:s.map((o,l)=>{if(typeof o!="object"||o===null||!("type"in o))return null;const c=o,u=c.type;if(u==="text"){if(i.has(l))return null;const d=c.text;return d?g.jsx(S6,{children:d},l):null}if(u==="tool-invocation"){const d=c.toolInvocation;return d?H1({toolCallId:String(d.toolCallId??""),toolName:String(d.toolName??""),description:typeof d.description=="string"?d.description:void 0,input:d.args,output:d.result,state:d.state,errorMessage:typeof d.error=="string"?d.error:typeof d.errorMessage=="string"?d.errorMessage:void 0},l):null}if(u==="tool-call"){const d=String(c.toolCallId??""),f=d?n.get(d):void 0,p=(f==null?void 0:f.output)??(f==null?void 0:f.result),y=d?a.get(d):void 0;if(y)return H1({toolCallId:d,toolName:String(c.toolName??""),description:void 0,input:c.input,output:void 0,state:"error",errorMessage:y},l);let b,x=!1;if((f==null?void 0:f.isError)===!0)x=!0,b=typeof p=="string"?p:JSON.stringify(p);else if(typeof p=="object"&&p!==null){const _=p;_.type==="error-text"?(x=!0,b=typeof _.text=="string"?_.text:JSON.stringify(_)):_.type==="error-json"&&(x=!0,b=JSON.stringify(_.value??_))}return H1({toolCallId:d,toolName:String(c.toolName??""),description:void 0,input:c.input,output:x?void 0:p,state:x?"error":p!==void 0?"result":"call",errorMessage:b},l)}if(u==="tool-result")return null;if(u==="tool-error"){const d=c.error,f=typeof d=="string"?d:d instanceof Error?d.message:JSON.stringify(d);return H1({toolCallId:String(c.toolCallId??""),toolName:String(c.toolName??""),description:void 0,input:c.input,output:void 0,state:"error",errorMessage:f},l)}if(u==="step-start")return null;if(u==="dynamic-tool")return H1({toolCallId:String(c.toolCallId??""),toolName:String(c.toolName??""),description:void 0,input:c.input,output:c.output,state:c.state,errorMessage:typeof c.errorText=="string"?c.errorText:void 0},l);if(typeof u=="string"&&u.startsWith("tool-")){const d=u.slice(5);return H1({toolCallId:String(c.toolCallId??""),toolName:d,description:void 0,input:c.input,output:c.output,state:c.state,errorMessage:typeof c.errorText=="string"?c.errorText:void 0},l)}return null})})})}function z5t({className:e,text:t,...n}){const{t:r}=Hn("common");return g.jsxs("div",{className:ke("flex items-center gap-2",e),children:[g.jsx(Nh,{className:"h-4 w-4 animate-spin text-muted-foreground"}),g.jsx(w$,{className:ke("text-sm",e),duration:1,spread:2,...n,children:t||r("chat.thinking")})]})}const rl={all:["specs"],lists:()=>[...rl.all,"list"],list:(e,t)=>[...rl.lists(),e,t],details:()=>[...rl.all,"detail"],detail:(e,t)=>[...rl.details(),e,t],stats:e=>[...rl.all,"stats",e],dependencies:(e,t)=>[...rl.all,"deps",e,t]};function ywe(e,t){return sl({queryKey:rl.list(e??"",t),queryFn:()=>(e&&gn.setCurrentProjectId(e),gn.getSpecs(t)),enabled:!!e,staleTime:10*1e3})}function xOt(e,t){return sl({queryKey:[...rl.list(e??"",t),"hierarchy"],queryFn:()=>(e&&gn.setCurrentProjectId(e),gn.getSpecsWithHierarchy(t)),enabled:!!e,staleTime:10*1e3})}function _Ot(e,t,n){return sl({queryKey:[...rl.all,"search",e??"",t,n],queryFn:()=>(e&&gn.setCurrentProjectId(e),gn.searchSpecs(t,n)),enabled:!!e&&t.length>0,placeholderData:t6e,staleTime:5*1e3})}function EOt(e,t){const n=S.useMemo(()=>[...t].sort(),[t]);return sl({queryKey:[...rl.all,"batch-metadata",e??"",n],queryFn:()=>(e&&gn.setCurrentProjectId(e),PEe().getBatchMetadata(e,n)),enabled:!!e&&n.length>0,staleTime:30*1e3})}function wOt(e,t){return sl({queryKey:rl.detail(e??"",t??""),queryFn:()=>(e&&gn.setCurrentProjectId(e),gn.getSpec(t)),enabled:!!e&&!!t,staleTime:30*1e3})}function SOt(e){return sl({queryKey:rl.stats(e??""),queryFn:()=>(e&&gn.setCurrentProjectId(e),gn.getStats()),enabled:!!e,staleTime:30*1e3})}function U5t(){const e=ll();return()=>{e.invalidateQueries({queryKey:rl.lists(),refetchType:"active"}),e.invalidateQueries({queryKey:rl.details(),refetchType:"active"}),e.invalidateQueries({queryKey:["specs","stats"],refetchType:"active"})}}function H5t(e,t){const n=e.message??"";if(!n.includes("Tool error")&&!n.includes("Tool execution failed"))return!1;const r=t[t.length-1];return!r||r.role!=="assistant"||!r.parts?!1:r.parts.some(i=>{if(typeof i!="object"||i===null||!("type"in i))return!1;const a=i;return a.type==="tool-call"||a.type==="tool-invocation"||a.type==="dynamic-tool"||typeof a.type=="string"&&a.type.startsWith("tool-")})}function V5t(e){return{type:"source-document",sourceId:e.specName,title:e.title??e.specName,filename:e.specName,mediaType:"text/markdown"}}function bwe(e){const t=e.sourceId,n=e.title,r=e.filename;return t??n??r??null}function q5t({specs:e,selectedSpecIds:t}){const n=fyt(),r=S.useRef([]);return S.useEffect(()=>{const i=new Set(r.current),a=new Set(t);for(const s of n.sources){const o=bwe(s);o&&!a.has(o)&&n.remove(s.id)}for(const s of t)if(!i.has(s)){const o=e.find(l=>l.specName===s);o&&n.add(V5t(o))}r.current=t},[t,e]),null}function G5t(){const{t:e}=Hn("common");return g.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center p-8",children:[g.jsx("div",{className:"w-16 h-16 rounded-full bg-muted flex items-center justify-center mb-4",children:g.jsx(Qre,{className:"h-8 w-8 text-muted-foreground"})}),g.jsx("h3",{className:"text-lg font-medium mb-2",children:e("chat.title")}),g.jsx("p",{className:"text-sm text-muted-foreground max-w-sm",children:e("chat.empty")})]})}function W5t({messages:e,onSubmit:t,isLoading:n,error:r,onRetry:i,className:a,footerContent:s,inputRef:o}){const{t:l}=Hn("common"),{currentProject:c}=Qa(),d=ywe((c==null?void 0:c.id)??null).data??[],f=e.length>0||r,[p,y]=S.useState([]),b=x=>{if(x.text.trim()){const _=x.referencedSources.map(w=>bwe(w)).filter(w=>!!w),E=_.length?`${l("chat.specContextPrefix")}
|
|
2136
2136
|
${_.map(w=>`- ${w}`).join(`
|
|
2137
2137
|
`)}
|
|
2138
2138
|
|
|
@@ -2184,4 +2184,4 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
2184
2184
|
`).map(I=>I.trim()).find(I=>I.length>0&&!I.includes("="))&&(q.env=a("settings.runners.errors.envInvalid")),u(q),Object.keys(q).length===0},L=()=>{if(!R())return;const q=o.args.split(`
|
|
2185
2185
|
`).map(I=>I.trim()).filter(Boolean),Q={};o.env.split(`
|
|
2186
2186
|
`).map(I=>I.trim()).filter(Boolean).forEach(I=>{const[V,...z]=I.split("="),G=z.join("=").trim();V&&(Q[V.trim()]=G)}),r({id:o.id.trim(),name:o.name.trim()||null,command:o.command.trim()||void 0,args:q,model:o.model.trim()||void 0,modelProviders:o.modelProviders.split(`
|
|
2187
|
-
`).map(I=>I.trim()).filter(Boolean),env:Object.keys(Q).length?Q:void 0})};return g.jsx(tm,{open:!0,onOpenChange:i,children:g.jsxs(Gh,{children:[g.jsxs(fg,{children:[g.jsx(pg,{children:a(s?"settings.runners.editRunner":"settings.runners.addRunner")}),g.jsx(mg,{children:a("settings.runners.dialogDescription")})]}),g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{className:"space-y-2",children:[g.jsxs(Um,{htmlFor:"runner-id",children:[a("settings.runners.fields.id")," ",g.jsx("span",{className:"text-destructive",children:"*"})]}),g.jsx(Na,{id:"runner-id",value:o.id,onChange:q=>l({...o,id:q.target.value}),placeholder:a("settings.runners.placeholders.id"),disabled:s}),c.id&&g.jsx("p",{className:"text-xs text-destructive",children:c.id}),g.jsx("p",{className:"text-xs text-muted-foreground",children:a("settings.runners.fields.idHelp")})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(Um,{htmlFor:"runner-name",children:a("settings.runners.fields.name")}),g.jsx(Na,{id:"runner-name",value:o.name,onChange:q=>l({...o,name:q.target.value}),placeholder:a("settings.runners.placeholders.name")})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(Um,{htmlFor:"runner-command",children:a("settings.runners.fields.command")}),g.jsx(Na,{id:"runner-command",value:o.command,onChange:q=>l({...o,command:q.target.value}),placeholder:a("settings.runners.placeholders.command")}),c.command&&g.jsx("p",{className:"text-xs text-destructive",children:c.command})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(Um,{htmlFor:"runner-args",children:a("settings.runners.fields.args")}),g.jsx(K_,{id:"runner-args",value:o.args,onChange:q=>l({...o,args:q.target.value}),placeholder:a("settings.runners.placeholders.args")}),g.jsx("p",{className:"text-xs text-muted-foreground",children:a("settings.runners.fields.argsHelp")})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(Um,{htmlFor:"runner-default-model",children:a("settings.runners.fields.defaultModel")}),g.jsxs(Mc,{open:b,onOpenChange:x,children:[g.jsx(Ic,{asChild:!0,children:g.jsxs(ct,{variant:"outline",role:"combobox","aria-expanded":b,className:"w-full justify-between font-normal",disabled:p,id:"runner-default-model",children:[g.jsx("span",{className:o.model?"":"text-muted-foreground",children:o.model||a(p?"settings.runners.validation.checking":"settings.runners.placeholders.defaultModel")}),g.jsx(L4,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),g.jsx(Gl,{className:"w-[--radix-popover-trigger-width] p-0",align:"start",children:g.jsxs(Wh,{shouldFilter:!1,children:[g.jsx(nm,{placeholder:a("settings.runners.placeholders.searchOrTypeModel"),value:_,onValueChange:E}),g.jsxs(Yh,{children:[g.jsx(Kh,{children:a("settings.runners.noModelsFound")}),(()=>{const q=_.trim()?d.filter(Q=>Q.toLowerCase().includes(_.toLowerCase())):d;return q.length>0?g.jsx(no,{children:q.map(Q=>g.jsxs(Ss,{value:Q,onSelect:()=>{l({...o,model:Q}),x(!1),E("")},children:[g.jsx(ua,{className:ke("mr-2 h-4 w-4",o.model===Q?"opacity-100":"opacity-0")}),Q]},Q))}):null})(),_.trim()&&!d.includes(_.trim())&&g.jsx(no,{heading:a("settings.runners.customModel"),children:g.jsxs(Ss,{value:_.trim(),onSelect:()=>{l({...o,model:_.trim()}),x(!1),E("")},children:[g.jsx(Fl,{className:"mr-2 h-4 w-4"}),a("settings.runners.useCustomModel",{model:_.trim()})]})}),o.model&&g.jsx(no,{children:g.jsx(Ss,{value:"__clear__",onSelect:()=>{l({...o,model:""}),x(!1),E("")},className:"text-muted-foreground",children:a("settings.runners.clearModel")})})]})]})})]})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(Um,{htmlFor:"runner-model-providers",children:a("settings.runners.fields.modelProviders")}),g.jsx(K_,{id:"runner-model-providers",value:o.modelProviders,onChange:q=>l({...o,modelProviders:q.target.value}),placeholder:a("settings.runners.placeholders.modelProviders")}),g.jsx("p",{className:"text-xs text-muted-foreground",children:a("settings.runners.fields.modelProvidersHelp")})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(Um,{htmlFor:"runner-env",children:a("settings.runners.fields.env")}),g.jsx(K_,{id:"runner-env",value:o.env,onChange:q=>l({...o,env:q.target.value}),placeholder:a("settings.runners.placeholders.env")}),c.env&&g.jsx("p",{className:"text-xs text-destructive",children:c.env}),g.jsx("p",{className:"text-xs text-muted-foreground",children:a("settings.runners.fields.envHelp")})]})]}),g.jsxs(iw,{children:[g.jsx(ct,{variant:"outline",onClick:i,children:a("actions.cancel")}),g.jsx(ct,{onClick:L,children:a("actions.save")})]})]})})}function S8t(){return g.jsx(E8t,{})}function T8t({htmlFor:e,children:t,className:n=""}){return g.jsx("label",{htmlFor:e,className:`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 ${n}`,children:t})}function C8t(){const{t:e,i18n:t}=Hn("common"),{theme:n,setTheme:r}=By(),{displayMode:i,setDisplayMode:a}=Sz(),s=c=>{t.changeLanguage(c),localStorage.setItem("harnspec-locale",c)},o=[{value:"light",icon:kL,label:e("settings.appearance.light"),description:e("settings.appearance.lightDescription")},{value:"dark",icon:TL,label:e("settings.appearance.dark"),description:e("settings.appearance.darkDescription")},{value:"system",icon:F2,label:e("settings.appearance.system"),description:e("settings.appearance.systemDescription")}],l=[{value:"normal",icon:F2,label:e("settings.appearance.normal"),description:e("settings.appearance.normalDescription")},{value:"wide",icon:AL,label:e("settings.appearance.wide"),description:e("settings.appearance.wideDescription")}];return g.jsxs("div",{className:"space-y-8",children:[g.jsxs("section",{className:"space-y-4",children:[g.jsxs("div",{children:[g.jsx("h3",{className:"text-base font-semibold",children:e("settings.appearance.theme")}),g.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:e("settings.appearance.themeDescription")})]}),g.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:o.map(({value:c,icon:u,label:d,description:f})=>g.jsxs("button",{onClick:()=>r(c),className:ke("flex flex-col items-center gap-2 p-4 border rounded-lg cursor-pointer transition-all hover:bg-accent/50",n===c?"border-primary bg-accent shadow-sm":"border-border hover:border-primary/50"),children:[g.jsx(u,{className:ke("h-6 w-6",n===c&&"text-primary")}),g.jsxs("div",{className:"text-center",children:[g.jsx("div",{className:"text-sm font-medium",children:d}),g.jsx("div",{className:"text-xs text-muted-foreground mt-0.5",children:f})]})]},c))})]}),g.jsxs("section",{className:"space-y-4",children:[g.jsxs("div",{children:[g.jsx("h3",{className:"text-base font-semibold",children:e("settings.appearance.displayMode")}),g.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:e("settings.appearance.displayModeDescription")})]}),g.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 max-w-2xl",children:l.map(({value:c,icon:u,label:d,description:f})=>g.jsxs("button",{onClick:()=>a(c),className:ke("flex flex-col items-center gap-2 p-4 border rounded-lg cursor-pointer transition-all hover:bg-accent/50",i===c?"border-primary bg-accent shadow-sm":"border-border hover:border-primary/50"),children:[g.jsx(u,{className:ke("h-6 w-6",i===c&&"text-primary")}),g.jsxs("div",{className:"text-center",children:[g.jsx("div",{className:"text-sm font-medium",children:d}),g.jsx("div",{className:"text-xs text-muted-foreground mt-0.5",children:f})]})]},c))})]}),g.jsxs("section",{className:"space-y-4",children:[g.jsxs("div",{children:[g.jsx("h3",{className:"text-base font-semibold",children:e("settings.appearance.language")}),g.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:e("settings.appearance.languageDescription")})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(T8t,{htmlFor:"language-select",children:e("settings.appearance.selectLanguage")}),g.jsxs(d5,{value:t.language,onValueChange:s,children:[g.jsx(fw,{id:"language-select",className:"w-full max-w-xs",children:g.jsx(Ple,{})}),g.jsxs(pw,{children:[g.jsx(yb,{value:"en",className:"cursor-pointer",children:e("language.english")}),g.jsx(yb,{value:"zh-CN",className:"cursor-pointer",children:e("language.chinese")})]})]})]})]})]})}function A8t(){return g.jsx(C8t,{})}function k8t(){const{currentProject:e,loading:t}=Qa(),{projects:n,storageKey:r}=Kw();if(t)return g.jsx("div",{className:"flex items-center justify-center min-h-screen bg-background",children:g.jsx("div",{className:"animate-pulse text-muted-foreground text-sm",children:"Loading…"})});if(e!=null&&e.id)return g.jsx(s_,{to:`/projects/${e.id}`,replace:!0});const i=typeof window<"u"?sessionStorage.getItem(r)??localStorage.getItem(r):null;if(i){const a=n.find(s=>s.id===i);if(a)return g.jsx(s_,{to:`/projects/${a.id}`,replace:!0})}return n.length>0?g.jsx(s_,{to:`/projects/${n[0].id}`,replace:!0}):g.jsx(s_,{to:"/projects",replace:!0})}const _ne={SIDEBAR_SCROLL:"harnspec:ui:sidebarScroll"},Ene={get:(e,t,n=!1)=>{if(typeof window>"u")return t;try{const i=(n?sessionStorage:localStorage).getItem(e);if(i===null)return t;try{return JSON.parse(i)}catch{return i}}catch(r){return console.warn(`Error reading from storage key "${e}":`,r),t}},set:(e,t,n=!1)=>{if(!(typeof window>"u"))try{const r=n?sessionStorage:localStorage;typeof t=="string"?r.setItem(e,t):r.setItem(e,JSON.stringify(t))}catch(r){console.warn(`Error writing to storage key "${e}":`,r)}},remove:(e,t=!1)=>{if(!(typeof window>"u"))try{(t?sessionStorage:localStorage).removeItem(e)}catch(n){console.warn(`Error removing storage key "${e}":`,n)}},migrateFromSessionToLocal:(e,t)=>{if(!(typeof window>"u"))try{const n=sessionStorage.getItem(e),r=localStorage.getItem(t);n!==null&&r===null&&localStorage.setItem(t,n),n!==null&&sessionStorage.removeItem(e)}catch(n){console.warn(`Error migrating ${e} to ${t}:`,n)}}};function N8t({statusFilter:e,priorityFilter:t,tagFilter:n,showArchived:r,statusOptions:i,allTags:a,tagSearchQuery:s,onTagSearchQueryChange:o,onToggleStatus:l,onTogglePriority:c,onToggleTag:u,onToggleArchived:d,onClearAll:f,t:p}){const y=e.length>0||t.length>0||n.length>0;return g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b",children:[g.jsx("span",{className:"font-medium text-sm py-1",children:p("specsNavSidebar.filtersLabel")}),(y||r)&&g.jsx(ct,{variant:"ghost",size:"sm",className:"h-auto px-2 py-1 text-xs",onClick:f,children:p("specsNavSidebar.clearFilters")})]}),g.jsxs("div",{className:"max-h-[calc(100dvh-200px)] overflow-y-auto",children:[g.jsxs(Lie,{type:"multiple",className:"w-full",children:[g.jsxs(q_,{value:"status",className:"border-b-0",children:[g.jsx(G_,{className:"px-4 py-3 hover:bg-muted/50 hover:no-underline text-xs",children:e.length===0?p("specsNavSidebar.select.status.all"):`${p("specsNavSidebar.status")}: ${e.length} ${p("specsNavSidebar.selected")}`}),g.jsx(W_,{className:"pb-2",children:g.jsxs("div",{className:"space-y-1 px-2",children:[i.map(b=>g.jsx(VC,{checked:e.includes(b),onToggle:()=>l(b),label:H9(b,p),icon:g.jsx(b4,{status:b,iconOnly:!0,className:"scale-90"})},b)),r&&g.jsx(VC,{checked:e.includes("archived"),onToggle:()=>l("archived"),label:H9("archived",p),icon:g.jsx(b4,{status:"archived",iconOnly:!0,className:"scale-90"})},"archived")]})})]}),g.jsxs(q_,{value:"priority",className:"border-b-0 border-t",children:[g.jsx(G_,{className:"px-4 py-3 hover:bg-muted/50 hover:no-underline text-xs",children:t.length===0?p("specsNavSidebar.select.priority.all"):`${p("specsNavSidebar.priority")}: ${t.length} ${p("specsNavSidebar.selected")}`}),g.jsx(W_,{className:"pb-2",children:g.jsx("div",{className:"space-y-1 px-2",children:["critical","high","medium","low"].map(b=>g.jsx(VC,{checked:t.includes(b),onToggle:()=>c(b),label:_2e(b,p),icon:g.jsx(wz,{priority:b,iconOnly:!0,className:"scale-90"})},b))})})]}),a.length>0&&g.jsxs(q_,{value:"tags",className:"border-b-0 border-t",children:[g.jsx(G_,{className:"px-4 py-3 hover:bg-muted/50 hover:no-underline text-xs",children:n.length===0?p("specsNavSidebar.select.tag.all"):`${p("specsNavSidebar.tags")}: ${n.length} ${p("specsNavSidebar.selected")}`}),g.jsxs(W_,{className:"pb-2",children:[g.jsx("div",{className:"px-2 pb-2",children:g.jsxs("div",{className:"relative",children:[g.jsx(Vh,{className:"absolute left-2 top-2 h-3.5 w-3.5 text-muted-foreground"}),g.jsx(Na,{type:"text",placeholder:p("specsNavSidebar.searchTags"),value:s,onChange:b=>o(b.target.value),className:"h-8 pl-8 text-xs bg-background"})]})}),g.jsxs("div",{className:"space-y-1 px-2 max-h-48 overflow-y-auto",children:[a.filter(b=>b.toLowerCase().includes(s.toLowerCase())).map(b=>g.jsx(VC,{checked:n.includes(b),onToggle:()=>u(b),label:b},b)),a.filter(b=>b.toLowerCase().includes(s.toLowerCase())).length===0&&g.jsx("div",{className:"text-xs text-muted-foreground text-center py-2",children:p("specsNavSidebar.noTagsFound")})]})]})]})]}),g.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-t hover:bg-accent cursor-pointer group",onClick:d,children:[g.jsx("div",{className:ke("flex items-center justify-center w-4 h-4 border rounded transition-colors",r?"bg-primary border-primary text-primary-foreground":"group-hover:border-primary/50"),children:r&&g.jsx(ua,{className:"h-3 w-3"})}),g.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[g.jsx(PP,{className:"h-4 w-4 text-muted-foreground"}),g.jsx("span",{className:"text-sm",children:p("specsNavSidebar.showArchived")})]})]})]})]})}function VC({checked:e,onToggle:t,label:n,icon:r}){return g.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent cursor-pointer group",onClick:t,children:[g.jsx("div",{className:ke("flex items-center justify-center w-4 h-4 border rounded transition-colors",e?"bg-primary border-primary text-primary-foreground":"group-hover:border-primary/50"),children:e&&g.jsx(ua,{className:"h-3 w-3"})}),g.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[r,g.jsx("span",{className:"text-sm flex-1 break-all",children:n})]})]})}function R8t({className:e,count:t,iconOnly:n=!1}){const{t:r}=Hn("common");return n?g.jsx(aG,{className:ke("h-4 w-4 text-primary",e)}):g.jsx(gw,{children:g.jsxs(Qo,{children:[g.jsx(Jo,{asChild:!0,children:g.jsxs("div",{className:ke("inline-flex items-center gap-1.5 rounded-md px-2 py-0.5 text-[10px] font-medium border border-primary/20 transition-colors","bg-primary/10 text-primary",e),children:[g.jsx(aG,{className:"h-3 w-3"}),g.jsx("span",{children:r("specs.hierarchy.umbrella")}),t!==void 0&&t>0&&g.jsxs("span",{className:"ml-0.5 opacity-70",children:["(",t,")"]})]})}),g.jsxs(xo,{children:[r("specs.hierarchy.umbrella"),t!==void 0&&t>0?` (${t} children)`:""]})]})})}function D8t({loading:e,filteredSpecs:t,activeSpecId:n,selectedSpecId:r,basePath:i,viewMode:a,sortBy:s,listHeight:o,listRef:l,expandedIds:c,onExpandedChange:u,onSpecClick:d,onMobileClose:f,t:p,language:y,sessionStatusBySpec:b}){const x=S.useCallback(_=>{const{index:E,style:w}=_,C=t[E],k=(C==null?void 0:C.specName)===n,N=(C==null?void 0:C.title)||(C==null?void 0:C.specName),R=b.get(C.specName);return C?g.jsx("div",{style:w,className:"px-2 py-0.5",children:g.jsxs(Qo,{children:[g.jsx(Jo,{asChild:!0,children:g.jsxs(og,{to:`${i}/specs/${C.specName}`,onClick:()=>f==null?void 0:f(),className:ke("flex flex-col gap-1 p-1.5 rounded-md text-sm transition-colors h-full justify-center",k?"bg-accent text-accent-foreground font-medium":"hover:bg-accent/50"),children:[g.jsxs("div",{className:"flex items-center gap-1.5 w-full",children:[C.specNumber&&g.jsxs("span",{className:"text-xs font-mono text-muted-foreground shrink-0",children:["#",C.specNumber]}),g.jsx("span",{className:"truncate text-xs leading-relaxed flex-1",children:N})]}),g.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap w-full",children:[C.status&&g.jsxs(Qo,{children:[g.jsx(Jo,{asChild:!0,children:g.jsx("div",{children:g.jsx(b4,{status:C.status,iconOnly:!0,className:"text-[10px] scale-90"})})}),g.jsx(xo,{side:"right",children:H9(C.status,p)})]}),C.priority&&g.jsxs(Qo,{children:[g.jsx(Jo,{asChild:!0,children:g.jsx("div",{children:g.jsx(wz,{priority:C.priority,iconOnly:!0,className:"text-[10px] scale-90"})})}),g.jsx(xo,{side:"right",children:_2e(C.priority,p)})]}),C.children&&C.children.length>0&&g.jsxs(Qo,{children:[g.jsx(Jo,{asChild:!0,children:g.jsx("div",{children:g.jsx(R8t,{iconOnly:!0,className:"h-3 w-3 text-muted-600 dark:text-muted-400"})})}),g.jsx(xo,{side:"right",children:p("specs.hierarchy.umbrella")})]}),C.updatedAt&&g.jsx("span",{className:"text-[10px] text-muted-foreground",children:C2e(C.updatedAt,y)}),R==="running"&&g.jsxs(Qo,{children:[g.jsx(Jo,{asChild:!0,children:g.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500","aria-label":p("sessions.indicators.running"),title:p("sessions.indicators.running")})}),g.jsx(xo,{side:"right",children:p("sessions.indicators.running")})]}),R==="attention"&&g.jsxs(Qo,{children:[g.jsx(Jo,{asChild:!0,children:g.jsx(vNe,{className:"h-3 w-3 text-amber-500","aria-label":p("sessions.indicators.attention")})}),g.jsx(xo,{side:"right",children:p("sessions.indicators.attention")})]}),R==="completed"&&g.jsxs(Qo,{children:[g.jsx(Jo,{asChild:!0,children:g.jsx(ua,{className:"h-3 w-3 text-emerald-500","aria-label":p("sessions.indicators.completedRecent")})}),g.jsx(xo,{side:"right",children:p("sessions.indicators.completedRecent")})]})]})]})}),g.jsx(xo,{side:"right",className:"max-w-[300px]",children:g.jsxs("div",{className:"space-y-1",children:[g.jsx("div",{className:"font-semibold",children:N}),g.jsx("div",{className:"text-xs text-muted-foreground",children:C.specName})]})})]})}):g.jsx("div",{style:w})},[n,i,t,y,f,b,p]);return e?g.jsx(xCt,{}):t.length===0?g.jsx("div",{className:"text-center py-8 text-sm text-muted-foreground",children:p("specsNavSidebar.noResults")}):a==="tree"?g.jsx("div",{className:"h-full px-2 py-0.5",children:g.jsx(wCt,{specs:t,onSpecClick:d,selectedSpecId:r,height:o,sortBy:s,expandedIds:c,onExpandedChange:u})}):g.jsx(yw,{listRef:l,defaultHeight:o,rowCount:t.length,rowHeight:60,overscanCount:6,rowComponent:x,rowProps:{},style:{height:o,width:"100%"}})}function M8t({mobileOpen:e=!1,onMobileOpenChange:t}){const n=Hs(),r=ql(),{projectId:i}=sg(),{currentProject:a}=Qa(),s=i??(a==null?void 0:a.id),o=ywe(s??null),l=nN(s??null),c=s?`/projects/${s}`:"/projects",u=S.useMemo(()=>o.data??[],[o.data]),d=S.useMemo(()=>l.data??[],[l.data]),f=!a||o.isLoading,p=S.useMemo(()=>{const ge=new Map,Le=1440*60*1e3,He=Date.now();for(const We of d)for(const lt of We.specIds??[]){const ot=ge.get(lt);if(ot==="running")continue;if(We.status==="running"){ge.set(lt,"running");continue}if(!ot&&(We.status==="pending"||We.status==="paused")){ge.set(lt,"attention");continue}const Jt=We.endedAt?new Date(We.endedAt).getTime():NaN,fn=We.startedAt?new Date(We.startedAt).getTime():NaN,Er=Number.isFinite(Jt)?Jt:fn,Kn=Number.isFinite(Er)&&He-Er<Le;!ot&&We.status==="completed"&&Kn&&ge.set(lt,"completed")}return ge},[d]),[y,b]=S.useState(""),[x,_]=S.useState(""),{statusFilter:E,priorityFilter:w,tagFilter:C,sortBy:k,hierarchyView:N,showArchived:R,expandedNodeIds:L,setStatusFilter:j,setPriorityFilter:B,setTagFilter:F,setSortBy:q,setHierarchyView:Q,setShowArchived:I,setExpandedNodeIds:V,clearFilters:z}=BEe(),{collapsed:G,setCollapsed:Y}=jEe(),[te,Z]=S.useState(!1),[ee,re]=S.useState(()=>wne()),$=N?"tree":"list",se=S.useCallback(ge=>Q(ge==="tree"),[Q]),le=S.useMemo(()=>new Set(L),[L]),he=S.useCallback(ge=>V(Array.from(ge)),[V]),[oe]=S.useState(()=>Ene.get(_ne.SIDEBAR_SCROLL,0,!0)),{t:be,i18n:_e}=Hn("common"),Ie=S.useRef(null),Ue=S.useRef(e),Ce=S.useRef(!1),Xe=S.useMemo(()=>{const ge=n.pathname.match(/\/specs\/(.+)$/);return ge?decodeURIComponent(ge[1]):""},[n.pathname]),_t=S.useRef(Xe),xt=S.useMemo(()=>u.find(ge=>ge.specName===Xe),[u,Xe]),Ct=(xt==null?void 0:xt.id)||Xe;S.useEffect(()=>{o.error&&console.error("Failed to load specs for sidebar",o.error)},[o.error]),S.useEffect(()=>{const ge=()=>re(wne());return ge(),window.addEventListener("resize",ge),()=>window.removeEventListener("resize",ge)},[]),S.useEffect(()=>{document.documentElement.style.setProperty("--specs-nav-sidebar-width",G?"0px":"280px")},[G]),S.useEffect(()=>{Ue.current=e},[e]),S.useEffect(()=>{Ue.current&&(t==null||t(!1))},[n.pathname,t]);const Kt=S.useCallback(ge=>{r(`${c}/specs/${ge.specName}`),e&&(t==null||t(!1))},[c,r,e,t]),mt=S.useCallback((ge,Le)=>{const He=new Map;for(const ot of Le)ot.parent&&(He.has(ot.parent)||He.set(ot.parent,[]),He.get(ot.parent).push(ot));const We=new Set(ge.map(ot=>ot.specName||ot.id)),lt=ot=>{const Jt=He.get(ot);if(Jt)for(const fn of Jt){const Er=fn.specName||fn.id;Er&&!We.has(Er)&&(We.add(Er),lt(Er))}};for(const ot of ge)lt(ot.specName||ot.id||"");return Le.filter(ot=>We.has(ot.specName||ot.id||""))},[]),Lt=S.useMemo(()=>new Mg(u,{keys:[{name:"title",weight:2},{name:"specNumber",weight:1.5},{name:"specName",weight:1},{name:"tags",weight:.5}],threshold:.4,includeScore:!0,minMatchCharLength:2}),[u]),Mn=S.useMemo(()=>{let ge=u,Le=u;if(!R&&!E.includes("archived")&&(ge=ge.filter(We=>We.status!=="archived"),Le=ge),y){const We=new Set(Lt.search(y).map(lt=>lt.item.specName));ge=ge.filter(lt=>We.has(lt.specName))}E.length>0&&(ge=ge.filter(We=>We.status&&E.includes(We.status))),w.length>0&&(ge=ge.filter(We=>We.priority&&w.includes(We.priority))),C.length>0&&(ge=ge.filter(We=>{var lt;return(lt=We.tags)==null?void 0:lt.some(ot=>C.includes(ot))})),$==="tree"&&(E.length>0||w.length>0)&&(ge=mt(ge,Le));const He={critical:4,high:3,medium:2,low:1};return[...ge].sort((We,lt)=>{switch(k){case"id-asc":return(We.specNumber||0)-(lt.specNumber||0);case"updated-desc":return We.updatedAt?lt.updatedAt?new Date(lt.updatedAt).getTime()-new Date(We.updatedAt).getTime()||(lt.specNumber||0)-(We.specNumber||0):-1:1;case"title-asc":return(We.title||We.specName||"").toLowerCase().localeCompare((lt.title||lt.specName||"").toLowerCase())||(lt.specNumber||0)-(We.specNumber||0);case"title-desc":return(lt.title||lt.specName||"").toLowerCase().localeCompare((We.title||We.specName||"").toLowerCase())||(lt.specNumber||0)-(We.specNumber||0);case"priority-desc":return(He[lt.priority||""]||0)-(He[We.priority||""]||0)||(lt.specNumber||0)-(We.specNumber||0);case"priority-asc":return(He[We.priority||""]||0)-(He[lt.priority||""]||0)||(lt.specNumber||0)-(We.specNumber||0);default:return(lt.specNumber||0)-(We.specNumber||0)}})},[u,y,E,w,C,$,mt,R,k,Lt]),ln=S.useMemo(()=>$!=="tree"?[]:N2e(Mn,k),[Mn,k,$]),Vn=S.useMemo(()=>V9(ln),[ln]),Ir=S.useRef(!1);S.useEffect(()=>{$==="tree"&&!Ir.current&&Vn.size>0&&(L.length===0&&he(Vn),Ir.current=!0)},[$,Vn,L.length,he]);const hn=S.useMemo(()=>{const ge=new Set;return u.forEach(Le=>{var He;return(He=Le.tags)==null?void 0:He.forEach(We=>ge.add(We))}),Array.from(ge).sort()},[u]),Yn=S.useMemo(()=>{const ge=["planned","in-progress","complete"];return u.some(Le=>Le.status==="draft")&&ge.unshift("draft"),ge},[u]),Ve=E.length>0||w.length>0||C.length>0;S.useEffect(()=>{var Le;if($==="tree")return;const ge=(Le=Ie.current)==null?void 0:Le.element;!ge||Ce.current||oe>0&&(ge.scrollTop=oe,Ce.current=!0)},[oe,ee,te,Mn.length,$]),S.useEffect(()=>{if($==="tree"||f||!Xe||Mn.length===0||!Ie.current||_t.current===Xe&&Ce.current)return;const ge=Mn.findIndex(Le=>Le.specName===Xe);if(ge>=0){const Le=requestAnimationFrame(()=>{var He;return(He=Ie.current)==null?void 0:He.scrollToRow({index:ge,align:"smart",behavior:"smooth"})});return Ce.current=!0,_t.current=Xe,()=>cancelAnimationFrame(Le)}_t.current=Xe},[Mn,Xe,oe,f,$]),S.useEffect(()=>{var He;if($==="tree")return;const ge=(He=Ie.current)==null?void 0:He.element;if(!ge)return;const Le=()=>Ene.set(_ne.SIDEBAR_SCROLL,ge.scrollTop,!0);return ge.addEventListener("scroll",Le,{passive:!0}),()=>ge.removeEventListener("scroll",Le)},[$]);const ie=ge=>j(E.includes(ge)?E.filter(Le=>Le!==ge):[...E,ge]),O=ge=>B(w.includes(ge)?w.filter(Le=>Le!==ge):[...w,ge]),K=ge=>F(C.includes(ge)?C.filter(Le=>Le!==ge):[...C,ge]),de=e||!G;return g.jsx(gw,{delayDuration:700,children:g.jsxs("div",{className:"relative",children:[e&&g.jsx("div",{className:"fixed inset-0 bg-black/40 z-40 lg:hidden",onClick:()=>t==null?void 0:t(!1)}),g.jsxs("aside",{className:ke("border-r bg-background flex flex-col overflow-hidden transition-all duration-300 flex-shrink-0",e?"fixed inset-y-0 left-0 z-50 w-[280px] shadow-xl":"hidden lg:flex lg:sticky lg:top-14 lg:h-[calc(100dvh-3.5rem)]",G&&!e?"lg:w-0 lg:border-r-0":"lg:w-[280px]"),children:[g.jsxs("div",{className:"p-3 border-b space-y-3",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsx("h2",{className:"font-semibold text-sm",children:be("specsNavSidebar.title")}),g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx(ct,{variant:$==="tree"?"secondary":"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>se($==="list"?"tree":"list"),title:be($==="list"?"specsNavSidebar.switchToTree":"specsNavSidebar.switchToList"),children:$==="list"?g.jsx(aRe,{className:"h-4 w-4"}):g.jsx(zRe,{className:"h-4 w-4"})}),g.jsxs(fb,{children:[g.jsx(pb,{asChild:!0,children:g.jsx(ct,{variant:k!=="id-desc"?"secondary":"ghost",size:"sm",className:"h-7 w-7 p-0",title:be("specsNavSidebar.sort.label"),children:g.jsx(Ure,{className:"h-4 w-4"})})}),g.jsxs(U0,{align:"start",className:"w-48",children:[g.jsx(wk,{children:be("specsNavSidebar.sort.label")}),g.jsx(hd,{}),[["id-desc","newest"],["id-asc","oldest"],["updated-desc","updated"]].map(([ge,Le])=>g.jsxs(yc,{onClick:()=>q(ge),children:[be(`specsNavSidebar.sort.${Le}`),k===ge&&g.jsx(ua,{className:"ml-auto h-4 w-4"})]},ge)),g.jsx(hd,{}),[["title-asc","titleAsc"],["title-desc","titleDesc"]].map(([ge,Le])=>g.jsxs(yc,{onClick:()=>q(ge),children:[be(`specsNavSidebar.sort.${Le}`),k===ge&&g.jsx(ua,{className:"ml-auto h-4 w-4"})]},ge)),g.jsx(hd,{}),[["priority-desc","priorityHigh"],["priority-asc","priorityLow"]].map(([ge,Le])=>g.jsxs(yc,{onClick:()=>q(ge),children:[be(`specsNavSidebar.sort.${Le}`),k===ge&&g.jsx(ua,{className:"ml-auto h-4 w-4"})]},ge))]})]}),g.jsxs(Mc,{open:te,onOpenChange:Z,children:[g.jsx(Ic,{asChild:!0,children:g.jsx(ct,{variant:te||Ve||R?"secondary":"ghost",size:"sm",className:"h-7 w-7 p-0",title:be(te?"specsNavSidebar.toggleFilters.hide":"specsNavSidebar.toggleFilters.show"),children:g.jsx(P4,{className:"h-4 w-4"})})}),g.jsx(Gl,{className:"w-80 p-0",align:"start",sideOffset:8,children:g.jsx(N8t,{statusFilter:E,priorityFilter:w,tagFilter:C,showArchived:R,statusOptions:Yn,allTags:hn,tagSearchQuery:x,onTagSearchQueryChange:_,onToggleStatus:ie,onTogglePriority:O,onToggleTag:K,onToggleArchived:()=>{const ge=!R;I(ge),!ge&&E.includes("archived")&&j(E.filter(Le=>Le!=="archived"))},onClearAll:()=>{z(),I(!1)},t:be})})]}),t&&g.jsx(ct,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 lg:hidden",onClick:()=>t(!1),title:be("actions.close"),children:g.jsx(cl,{className:"h-4 w-4"})}),g.jsx(ct,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 hidden lg:flex",onClick:()=>Y(!0),title:be("specSidebar.collapse"),children:g.jsx(I4,{className:"h-4 w-4"})})]})]}),g.jsx(k2e,{value:y,onChange:b,placeholder:be("specsNavSidebar.searchPlaceholder"),showShortcut:!1,className:"h-9 text-sm"})]}),g.jsx("div",{className:"flex-1 overflow-hidden",children:g.jsx(D8t,{loading:f,filteredSpecs:Mn,activeSpecId:Xe,selectedSpecId:Ct,basePath:c,viewMode:$,sortBy:k,listHeight:ee,listRef:Ie,expandedIds:le,onExpandedChange:he,onSpecClick:Kt,onMobileClose:()=>t==null?void 0:t(!1),t:be,language:_e.language,sessionStatusBySpec:p})})]}),!de&&g.jsx(ct,{variant:"ghost",size:"sm",className:"hidden lg:flex h-9 w-5 p-0 absolute z-50 top-2 left-0 bg-background border border-l-0 rounded-r-md rounded-l-none shadow-md hover:w-6 hover:bg-accent transition-all items-center justify-center",onClick:()=>Y(!1),title:be("specSidebar.expand"),children:g.jsx(hu,{className:"h-4 w-4"})})]})})}function wne(){return typeof window>"u"?600:window.innerHeight-56-100}function I8t(){const[e,t]=S.useState(!1);return g.jsxs("div",{className:"flex h-full relative",children:[g.jsx(M8t,{mobileOpen:e,onMobileOpenChange:t}),g.jsx(D4,{context:{mobileOpen:e,setMobileOpen:t}})]})}function L8t({status:e,className:t,iconOnly:n=!1,responsive:r=!0}){const{t:i}=Hn("common"),a=zb[e]||zb.pending,s=a.icon,o=n?void 0:i(a.labelKey),l=n||r&&!1;return g.jsxs(ei,{variant:"outline",className:ke("flex items-center w-fit h-5 px-2 py-0.5 text-xs font-medium border-transparent",!l&&"gap-1.5",a.className,r&&!n&&"hidden sm:flex",t),children:[g.jsx(s,{className:"h-3.5 w-3.5"}),!l&&o]})}function O8t({duration:e,variant:t="text",className:n}){return t==="pill"?g.jsxs("span",{className:ke("inline-flex items-center gap-1 h-5 px-1.5 py-0.5 text-[10px] font-medium rounded-md bg-muted text-muted-foreground shrink-0",n),children:[g.jsx(sG,{className:"h-3 w-3"}),e]}):g.jsxs("span",{className:ke("shrink-0 flex items-center gap-1 text-xs text-muted-foreground",n),children:[g.jsx(sG,{className:"h-3 w-3"}),e]})}function P8t({mobileOpen:e=!1,onMobileOpenChange:t}){const n=Hs(),r=ql(),{projectId:i}=sg(),{currentProject:a}=Qa(),s=i??(a==null?void 0:a.id),o=nN(s??null),l=s?`/projects/${s}`:"/projects",c=S.useMemo(()=>o.data??[],[o.data]),u=!a||o.isLoading,[d,f]=S.useState(""),[p,y]=S.useState([]),{collapsed:b,setCollapsed:x}=$Ee(),[_,E]=S.useState(()=>Sne()),w=S.useRef(null),C=S.useMemo(()=>{const I=n.pathname.match(/\/sessions\/(.+)$/);return I?decodeURIComponent(I[1]):""},[n.pathname]);S.useEffect(()=>{const I=()=>E(Sne());return I(),window.addEventListener("resize",I),()=>window.removeEventListener("resize",I)},[]),S.useEffect(()=>{document.documentElement.style.setProperty("--sessions-nav-sidebar-width",b?"0px":"280px")},[b]),S.useEffect(()=>{e&&(t==null||t(!1))},[n.pathname,t,e]);const k=S.useMemo(()=>{const I=c.map(V=>V.status).filter(Boolean);return Array.from(new Set(I)).sort()},[c]),N=p.length>0,R=S.useMemo(()=>{const I=d.trim().toLowerCase();return c.filter(z=>!(p.length>0&&!p.includes(z.status)||I&&![z.id,z.runner,z.prompt??"",...z.specIds??[]].join(" ").toLowerCase().includes(I))).sort((z,G)=>new Date(G.startedAt).getTime()-new Date(z.startedAt).getTime())},[d,c,p]),L=S.useCallback(I=>{r(`${l}/sessions/${I.id}`),e&&(t==null||t(!1))},[l,r,e,t]),j=I=>{y(V=>V.includes(I)?V.filter(z=>z!==I):[...V,I])},{t:B,i18n:F}=Hn("common"),q=S.useCallback(I=>{var ee,re;const{index:V,style:z}=I,G=R[V];if(!G)return g.jsx("div",{style:z});const Y=G.id===C,te=Ate(G),Z=G.prompt||((ee=G.specIds)!=null&&ee.length?G.specIds.join(", "):null)||G.id.slice(0,8);return g.jsx("div",{style:z,className:"px-1.5 py-0.5",children:g.jsxs("button",{onClick:()=>L(G),className:ke("w-full text-left rounded-md px-2.5 py-2 transition-colors group overflow-hidden",Y?"bg-accent text-accent-foreground font-medium":"hover:bg-accent/50"),children:[g.jsxs("div",{className:"flex items-center gap-1.5 w-full min-w-0",children:[g.jsx(uz,{runnerId:G.runner,size:20,className:"shrink-0"}),g.jsx("span",{className:"truncate text-xs leading-relaxed flex-1",children:Z})]}),g.jsxs("div",{className:"flex space-between items-center mt-1",children:[g.jsxs("div",{className:"flex items-center gap-1.5 w-full flex-1",children:[g.jsx(L8t,{status:G.status,iconOnly:!0,responsive:!1}),te&&g.jsx(O8t,{duration:te,variant:"pill"}),G.startedAt&&g.jsx("span",{className:"text-[10px] text-muted-foreground",children:C2e(G.startedAt,F.language)})]}),g.jsx("div",{children:(((re=G.specIds)==null?void 0:re.length)??0)>0&&g.jsxs("div",{className:"text-[10px] text-muted-foreground truncate w-full flex items-center gap-0.5",children:[g.jsx(UNe,{className:"h-2.5 w-2.5 shrink-0"}),g.jsx("span",{className:"truncate",children:G.specIds.map($=>$.split("-")[0]).join(", ")})]})})]})]})})},[C,R,Ate,L,F.language,B]),Q=e||!b;return g.jsxs("div",{className:"relative",children:[e&&g.jsx("div",{className:"fixed inset-0 bg-black/40 z-40 lg:hidden",onClick:()=>t==null?void 0:t(!1)}),g.jsxs("aside",{className:ke("border-r bg-background flex flex-col overflow-hidden transition-all duration-300 flex-shrink-0",e?"fixed inset-y-0 left-0 z-50 w-[280px] shadow-xl":"hidden lg:flex lg:sticky lg:top-14 lg:h-[calc(100dvh-3.5rem)]",b&&!e?"lg:w-0 lg:border-r-0":"lg:w-[280px]"),children:[g.jsxs("div",{className:"p-3 border-b space-y-3",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsx("h2",{className:"font-semibold text-sm",children:B("sessionsPage.title")}),g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsxs(Mc,{children:[g.jsx(Ic,{asChild:!0,children:g.jsx(ct,{variant:N?"secondary":"ghost",size:"sm",className:"h-7 w-7 p-0",title:B("specsNavSidebar.filtersLabel"),children:g.jsx(P4,{className:"h-4 w-4"})})}),g.jsxs(Gl,{className:"w-56 p-0",align:"start",sideOffset:8,children:[g.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b",children:[g.jsx("span",{className:"font-medium text-sm py-1",children:B("sessionsPage.filters.status")}),N&&g.jsx(ct,{variant:"ghost",size:"sm",className:"h-auto px-2 py-1 text-xs",onClick:()=>y([]),children:B("specsNavSidebar.clearFilters")})]}),g.jsx("div",{className:"p-2 space-y-1",children:k.map(I=>{const V=zb[I],z=V==null?void 0:V.icon;return g.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent cursor-pointer group",onClick:()=>j(I),children:[g.jsx("div",{className:ke("flex items-center justify-center w-4 h-4 border rounded transition-colors",p.includes(I)?"bg-primary border-primary text-primary-foreground":"group-hover:border-primary/50"),children:p.includes(I)&&g.jsx(ua,{className:"h-3 w-3"})}),g.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[z&&g.jsx(z,{className:"h-3.5 w-3.5"}),g.jsx("span",{className:"text-sm",children:B(`sessions.status.${I}`)})]})]},I)})})]})]}),t&&g.jsx(ct,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 lg:hidden",onClick:()=>t(!1),title:B("actions.close"),children:g.jsx(cl,{className:"h-4 w-4"})}),g.jsx(ct,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 hidden lg:flex",onClick:()=>x(!0),title:B("sessionsSidebar.collapse"),children:g.jsx(I4,{className:"h-4 w-4"})})]})]}),g.jsx(k2e,{value:d,onChange:f,placeholder:B("sessionsSidebar.searchPlaceholder"),showShortcut:!1,className:"h-9 text-sm"})]}),g.jsx("div",{className:"flex-1 overflow-hidden",children:u?g.jsx("div",{className:"p-3 space-y-2",children:Array.from({length:6}).map((I,V)=>g.jsx("div",{className:"h-14 rounded-md bg-muted/50 animate-pulse"},V))}):R.length===0?g.jsx("div",{className:"text-center py-8 text-sm text-muted-foreground",children:B("sessionsSidebar.noResults")}):g.jsx(yw,{listRef:w,defaultHeight:_,rowCount:R.length,rowHeight:60,overscanCount:6,rowComponent:q,rowProps:{},style:{height:_,width:"100%"}})})]}),!Q&&g.jsx(ct,{variant:"ghost",size:"sm",className:"hidden lg:flex h-9 w-5 p-0 absolute z-50 top-2 left-0 bg-background border border-l-0 rounded-r-md rounded-l-none shadow-md hover:w-6 hover:bg-accent transition-all items-center justify-center",onClick:()=>x(!1),title:B("sessionsSidebar.expand"),children:g.jsx(hu,{className:"h-4 w-4"})})]})}function Sne(){return typeof window>"u"?600:window.innerHeight-56-100}function F8t(){const[e,t]=S.useState(!1);return g.jsxs("div",{className:"flex h-full relative",children:[g.jsx(P8t,{mobileOpen:e,onMobileOpenChange:t}),g.jsx(D4,{context:{mobileOpen:e,setMobileOpen:t}})]})}const B8t=S.lazy(()=>me(()=>import("./ContextPage-BLFL7v_u.js"),__vite__mapDeps([147,148,149])).then(e=>({default:e.ContextPage}))),j8t=S.lazy(()=>me(()=>import("./DashboardPage-D-pA0AIe.js"),__vite__mapDeps([150,151,152])).then(e=>({default:e.DashboardPage}))),Tne=S.lazy(()=>me(()=>import("./DependenciesPage-DjavTkHz.js"),[]).then(e=>({default:e.DependenciesPage}))),$8t=S.lazy(()=>me(()=>import("./ChatSettingsPage-JPXu3eH0.js"),[]).then(e=>({default:e.ChatSettingsPage}))),z8t=S.lazy(()=>me(()=>import("./FilesPage-BxxpK9Bt.js"),__vite__mapDeps([153,154])).then(e=>({default:e.FilesPage}))),U8t=S.lazy(()=>me(()=>import("./SessionDetailPage-iEL9xj4a.js"),__vite__mapDeps([155,156,157])).then(e=>({default:e.SessionDetailPage}))),H8t=S.lazy(()=>me(()=>import("./SessionsPage-CO68ICYO.js"),__vite__mapDeps([158,156,157,159,160])).then(e=>({default:e.SessionsPage}))),V8t=S.lazy(()=>me(()=>import("./SpecDetailPage-9MMpkW8X.js"),__vite__mapDeps([161,156,162,163,149,152,148,160,164])).then(e=>({default:e.SpecDetailPage}))),q8t=S.lazy(()=>me(()=>import("./SpecsPage-1nVMIoG9.js"),__vite__mapDeps([165,162,163,149,159,160])).then(e=>({default:e.SpecsPage}))),G8t=S.lazy(()=>me(()=>import("./StatsPage-BvmDcqy8.js"),__vite__mapDeps([166,151,163,152,128,120,125,119,121,118])).then(e=>({default:e.StatsPage}))),qc=e=>g.jsx(S.Suspense,{fallback:null,children:g.jsx(e,{})});function W8t(){return[{index:!0,element:qc(j8t)},{path:"specs",children:[{index:!0,element:qc(q8t)},{element:g.jsx(I8t,{}),children:[{path:":specName",element:qc(V8t)}]}]},{path:"sessions",children:[{index:!0,element:qc(H8t)},{element:g.jsx(F8t,{}),children:[{path:":sessionId",element:qc(U8t)}]}]},{path:"stats",element:qc(G8t)},{path:"dependencies",element:qc(Tne)},{path:"dependencies/:specName",element:qc(Tne)},{path:"context",element:qc(B8t)},{path:"files",element:qc(z8t)},{path:"chat/settings",element:qc($8t)}]}const Y8t=O5e([{path:"/",element:g.jsx(k8t,{})},{path:"/projects",element:g.jsx(UC,{}),children:[{index:!0,element:g.jsx(i8t,{})}]},{path:"/machines",element:g.jsx(UC,{}),children:[{index:!0,element:g.jsx(a8t,{})}]},{path:"/settings",element:g.jsx(UC,{}),children:[{element:g.jsx(s8t,{}),children:[{index:!0,element:g.jsx(s_,{to:"/settings/models",replace:!0})},{path:"models",element:g.jsx(_8t,{})},{path:"runners",element:g.jsx(S8t,{})},{path:"appearance",element:g.jsx(A8t,{})}]}]},{path:"/projects/:projectId",element:g.jsx(UC,{}),children:W8t()}]),K8t=new v6e({defaultOptions:{queries:{staleTime:30*1e3,gcTime:300*1e3,retry:1,refetchOnWindowFocus:!1,refetchOnReconnect:!1},mutations:{retry:1}}});function Z8t(){const e=U5t(),{machineModeEnabled:t}=Ig(),n=S.useCallback(()=>{e()},[e]),i=!(typeof window<"u"&&"__TAURI__"in window),s="/api/events/specs",o=Number.parseInt("3000",10);e3t({enabled:i,url:s,reconnectDelayMs:Number.isFinite(o)?o:3e3,onChange:n}),S.useEffect(()=>{if(!t)return;const l=window.setInterval(()=>{e()},2e3);return()=>window.clearInterval(l)},[e,t])}function X8t(){const{currentProject:e}=Qa(),t=Nz(n=>n.isDrawerOpen);return Z8t(),Z4t((e==null?void 0:e.id)??null,{enabled:t}),Y3t(),null}function Q8t(){return g.jsxs(x6e,{client:K8t,children:[g.jsx(K4t,{children:g.jsx(s4t,{children:g.jsxs(w4t,{children:[g.jsx(X8t,{}),g.jsx(Y5e,{router:Y8t})]})})}),g.jsx(L6e,{initialIsOpen:!1})]})}XTe.createRoot(document.getElementById("root")).render(g.jsx(S.StrictMode,{children:g.jsx(zne,{fallbackRender:({error:e,resetErrorBoundary:t})=>g.jsxs("div",{style:{padding:"2rem",textAlign:"center",fontFamily:"system-ui, sans-serif"},children:[g.jsx("h1",{style:{fontSize:"1.25rem",fontWeight:600},children:"Something went wrong"}),g.jsx("p",{style:{color:"#888",marginTop:"0.5rem"},children:e==null?void 0:e.message}),g.jsx("button",{onClick:t,style:{marginTop:"1rem",padding:"0.5rem 1rem",cursor:"pointer"},children:"Reload"})]}),onReset:()=>window.location.reload(),children:g.jsx(Q8t,{})})}));const J8t=Object.freeze(Object.defineProperty({__proto__:null,Mermaid:h2e},Symbol.toStringTag,{value:"Module"}));export{hr as $,us as A,ei as B,Wa as C,tm as D,jh as E,Cc as F,Aat as G,plt as H,iv as I,A0e as J,Nw as K,_D as L,wLt as M,Rc as N,eOt as O,JLt as P,ru as Q,qrt as R,Grt as S,xat as T,vat as U,put as V,OLt as W,$rt as X,SLt as Y,s2 as Z,J as _,ct as a,yb as a$,_d as a0,Ant as a1,Yrt as a2,Aj as a3,ro as a4,qfe as a5,dlt as a6,fit as a7,TK as a8,eit as a9,Prt as aA,kw as aB,xn as aC,zn as aD,epe as aE,Zct as aF,A1e as aG,XLt as aH,_at as aI,hs as aJ,lm as aK,yj as aL,J0e as aM,Tg as aN,T0e as aO,ql as aP,c8t as aQ,u8t as aR,zE as aS,_c as aT,FP as aU,UMe as aV,Fl as aW,d5 as aX,fw as aY,Ple as aZ,pw as a_,zK as aa,$K as ab,MLt as ac,ALt as ad,RLt as ae,NLt as af,TLt as ag,O1 as ah,aj as ai,DLt as aj,CLt as ak,LLt as al,ILt as am,kLt as an,crt as ao,Tct as ap,iit as aq,Ab as ar,ELt as as,f6 as at,nlt as au,krt as av,JB as aw,FK as ax,FA as ay,ult as az,Gh as b,Iet as b$,Na as b0,mg as b1,iw as b2,Lp as b3,QE as b4,Mc as b5,Ic as b6,L4 as b7,Gl as b8,Wh as b9,UNe as bA,C2e as bB,O8t as bC,Cd as bD,hu as bE,UP as bF,dk as bG,Jre as bH,y5t as bI,xd as bJ,zut as bK,ZLt as bL,QLt as bM,YLt as bN,Cn as bO,KLt as bP,wut as bQ,but as bR,yut as bS,tit as bT,Kre as bU,$P as bV,aG as bW,Op as bX,aOt as bY,uQe as bZ,xnt as b_,nm as ba,Yh as bb,Kh as bc,no as bd,Ss as be,ua as bf,sg as bg,Qa as bh,nN as bi,ywe as bj,awe as bk,rLt as bl,ESe as bm,Vh as bn,P4 as bo,yOt as bp,uz as bq,cl as br,ZIt as bs,i5t as bt,zb as bu,Ate as bv,gw as bw,Qo as bx,Jo as by,xo as bz,fg as c,dOt as c$,ofe as c0,lfe as c1,opt as c2,ENe as c3,Hre as c4,Pp as c5,uOt as c6,gn as c7,og as c8,b4 as c9,h6 as cA,D3 as cB,v0e as cC,Zre as cD,Nh as cE,By as cF,nue as cG,uk as cH,PP as cI,N2e as cJ,iie as cK,ZP as cL,L2 as cM,zP as cN,O2 as cO,fb as cP,pb as cQ,U0 as cR,moe as cS,PEe as cT,Ig as cU,xOt as cV,ll as cW,rl as cX,BEe as cY,_Ot as cZ,EOt as c_,wz as ca,jP as cb,XE as cc,SOt as cd,lOt as ce,nLt as cf,g5t as cg,m5t as ch,vOt as ci,bOt as cj,h5t as ck,mOt as cl,gOt as cm,VP as cn,sG as co,P2 as cp,qP as cq,Wre as cr,Y9e as cs,lLt as ct,PPe as cu,FPe as cv,Qre as cw,BPe as cx,u5t as cy,_Lt as cz,pg as d,Ete as d$,Td as d0,Lw as d1,wct as d2,Ect as d3,SL as d4,Vs as d5,Ia as d6,ZWe as d7,et as d8,uAt as d9,cE as dA,Rot as dB,y0e as dC,u0e as dD,Lst as dE,k3 as dF,Ost as dG,Mw as dH,Km as dI,Tot as dJ,oZ as dK,Eg as dL,Pst as dM,xj as dN,Ist as dO,jst as dP,ov as dQ,Not as dR,Qot as dS,Vst as dT,qot as dU,bj as dV,$Z as dW,Sn as dX,a0e as dY,sOt as dZ,Gre as d_,Oc as da,Np as db,Ku as dc,Hy as dd,ol as de,pOt as df,bz as dg,fEe as dh,fOt as di,$b as dj,Bn as dk,Zkt as dl,p4 as dm,oOt as dn,al as dp,yGe as dq,NB as dr,Bde as ds,Sw as dt,zde as du,xLt as dv,RB as dw,tp as dx,pY as dy,SGe as dz,Aet as e,vRe as e0,yRe as e1,NL as e2,kh as e3,U5t as e4,D0 as e5,M0 as e6,E2e as e7,w2e as e8,R8t as e9,tlt as eA,b3 as eB,nit as eC,rit as eD,tF as eE,JWe as eF,lg as eG,Epe as eH,wpe as eI,_pe as eJ,xpe as eK,bpe as eL,ype as eM,hit as eN,ape as eO,ipe as eP,sit as eQ,ait as eR,T4 as eS,ig as eT,cOt as eU,me as eV,eie as ea,Xre as eb,dpt as ec,Jvt as ed,uxt as ee,JIt as ef,Nz as eg,wOt as eh,hOt as ei,sv as ej,Pot as ek,udt as el,Dw as em,R3 as en,om as eo,l6 as ep,nZ as eq,_j as er,h0e as es,g0e as et,Dst as eu,U7 as ev,Xot as ew,Vot as ex,Jot as ey,vj as ez,ke as f,Hs as g,Ht as h,Io as i,g as j,eae as k,Ya as l,iOt as m,NSt as n,br as o,Hrt as p,Vrt as q,S as r,X4t as s,Urt as t,Hn as u,zrt as v,yi as w,gr as x,vt as y,Jfe as z};
|
|
2187
|
+
`).map(I=>I.trim()).filter(Boolean),env:Object.keys(Q).length?Q:void 0})};return g.jsx(tm,{open:!0,onOpenChange:i,children:g.jsxs(Gh,{children:[g.jsxs(fg,{children:[g.jsx(pg,{children:a(s?"settings.runners.editRunner":"settings.runners.addRunner")}),g.jsx(mg,{children:a("settings.runners.dialogDescription")})]}),g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{className:"space-y-2",children:[g.jsxs(Um,{htmlFor:"runner-id",children:[a("settings.runners.fields.id")," ",g.jsx("span",{className:"text-destructive",children:"*"})]}),g.jsx(Na,{id:"runner-id",value:o.id,onChange:q=>l({...o,id:q.target.value}),placeholder:a("settings.runners.placeholders.id"),disabled:s}),c.id&&g.jsx("p",{className:"text-xs text-destructive",children:c.id}),g.jsx("p",{className:"text-xs text-muted-foreground",children:a("settings.runners.fields.idHelp")})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(Um,{htmlFor:"runner-name",children:a("settings.runners.fields.name")}),g.jsx(Na,{id:"runner-name",value:o.name,onChange:q=>l({...o,name:q.target.value}),placeholder:a("settings.runners.placeholders.name")})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(Um,{htmlFor:"runner-command",children:a("settings.runners.fields.command")}),g.jsx(Na,{id:"runner-command",value:o.command,onChange:q=>l({...o,command:q.target.value}),placeholder:a("settings.runners.placeholders.command")}),c.command&&g.jsx("p",{className:"text-xs text-destructive",children:c.command})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(Um,{htmlFor:"runner-args",children:a("settings.runners.fields.args")}),g.jsx(K_,{id:"runner-args",value:o.args,onChange:q=>l({...o,args:q.target.value}),placeholder:a("settings.runners.placeholders.args")}),g.jsx("p",{className:"text-xs text-muted-foreground",children:a("settings.runners.fields.argsHelp")})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(Um,{htmlFor:"runner-default-model",children:a("settings.runners.fields.defaultModel")}),g.jsxs(Mc,{open:b,onOpenChange:x,children:[g.jsx(Ic,{asChild:!0,children:g.jsxs(ct,{variant:"outline",role:"combobox","aria-expanded":b,className:"w-full justify-between font-normal",disabled:p,id:"runner-default-model",children:[g.jsx("span",{className:o.model?"":"text-muted-foreground",children:o.model||a(p?"settings.runners.validation.checking":"settings.runners.placeholders.defaultModel")}),g.jsx(L4,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),g.jsx(Gl,{className:"w-[--radix-popover-trigger-width] p-0",align:"start",children:g.jsxs(Wh,{shouldFilter:!1,children:[g.jsx(nm,{placeholder:a("settings.runners.placeholders.searchOrTypeModel"),value:_,onValueChange:E}),g.jsxs(Yh,{children:[g.jsx(Kh,{children:a("settings.runners.noModelsFound")}),(()=>{const q=_.trim()?d.filter(Q=>Q.toLowerCase().includes(_.toLowerCase())):d;return q.length>0?g.jsx(no,{children:q.map(Q=>g.jsxs(Ss,{value:Q,onSelect:()=>{l({...o,model:Q}),x(!1),E("")},children:[g.jsx(ua,{className:ke("mr-2 h-4 w-4",o.model===Q?"opacity-100":"opacity-0")}),Q]},Q))}):null})(),_.trim()&&!d.includes(_.trim())&&g.jsx(no,{heading:a("settings.runners.customModel"),children:g.jsxs(Ss,{value:_.trim(),onSelect:()=>{l({...o,model:_.trim()}),x(!1),E("")},children:[g.jsx(Fl,{className:"mr-2 h-4 w-4"}),a("settings.runners.useCustomModel",{model:_.trim()})]})}),o.model&&g.jsx(no,{children:g.jsx(Ss,{value:"__clear__",onSelect:()=>{l({...o,model:""}),x(!1),E("")},className:"text-muted-foreground",children:a("settings.runners.clearModel")})})]})]})})]})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(Um,{htmlFor:"runner-model-providers",children:a("settings.runners.fields.modelProviders")}),g.jsx(K_,{id:"runner-model-providers",value:o.modelProviders,onChange:q=>l({...o,modelProviders:q.target.value}),placeholder:a("settings.runners.placeholders.modelProviders")}),g.jsx("p",{className:"text-xs text-muted-foreground",children:a("settings.runners.fields.modelProvidersHelp")})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(Um,{htmlFor:"runner-env",children:a("settings.runners.fields.env")}),g.jsx(K_,{id:"runner-env",value:o.env,onChange:q=>l({...o,env:q.target.value}),placeholder:a("settings.runners.placeholders.env")}),c.env&&g.jsx("p",{className:"text-xs text-destructive",children:c.env}),g.jsx("p",{className:"text-xs text-muted-foreground",children:a("settings.runners.fields.envHelp")})]})]}),g.jsxs(iw,{children:[g.jsx(ct,{variant:"outline",onClick:i,children:a("actions.cancel")}),g.jsx(ct,{onClick:L,children:a("actions.save")})]})]})})}function S8t(){return g.jsx(E8t,{})}function T8t({htmlFor:e,children:t,className:n=""}){return g.jsx("label",{htmlFor:e,className:`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 ${n}`,children:t})}function C8t(){const{t:e,i18n:t}=Hn("common"),{theme:n,setTheme:r}=By(),{displayMode:i,setDisplayMode:a}=Sz(),s=c=>{t.changeLanguage(c),localStorage.setItem("harnspec-locale",c)},o=[{value:"light",icon:kL,label:e("settings.appearance.light"),description:e("settings.appearance.lightDescription")},{value:"dark",icon:TL,label:e("settings.appearance.dark"),description:e("settings.appearance.darkDescription")},{value:"system",icon:F2,label:e("settings.appearance.system"),description:e("settings.appearance.systemDescription")}],l=[{value:"normal",icon:F2,label:e("settings.appearance.normal"),description:e("settings.appearance.normalDescription")},{value:"wide",icon:AL,label:e("settings.appearance.wide"),description:e("settings.appearance.wideDescription")}];return g.jsxs("div",{className:"space-y-8",children:[g.jsxs("section",{className:"space-y-4",children:[g.jsxs("div",{children:[g.jsx("h3",{className:"text-base font-semibold",children:e("settings.appearance.theme")}),g.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:e("settings.appearance.themeDescription")})]}),g.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:o.map(({value:c,icon:u,label:d,description:f})=>g.jsxs("button",{onClick:()=>r(c),className:ke("flex flex-col items-center gap-2 p-4 border rounded-lg cursor-pointer transition-all hover:bg-accent/50",n===c?"border-primary bg-accent shadow-sm":"border-border hover:border-primary/50"),children:[g.jsx(u,{className:ke("h-6 w-6",n===c&&"text-primary")}),g.jsxs("div",{className:"text-center",children:[g.jsx("div",{className:"text-sm font-medium",children:d}),g.jsx("div",{className:"text-xs text-muted-foreground mt-0.5",children:f})]})]},c))})]}),g.jsxs("section",{className:"space-y-4",children:[g.jsxs("div",{children:[g.jsx("h3",{className:"text-base font-semibold",children:e("settings.appearance.displayMode")}),g.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:e("settings.appearance.displayModeDescription")})]}),g.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 max-w-2xl",children:l.map(({value:c,icon:u,label:d,description:f})=>g.jsxs("button",{onClick:()=>a(c),className:ke("flex flex-col items-center gap-2 p-4 border rounded-lg cursor-pointer transition-all hover:bg-accent/50",i===c?"border-primary bg-accent shadow-sm":"border-border hover:border-primary/50"),children:[g.jsx(u,{className:ke("h-6 w-6",i===c&&"text-primary")}),g.jsxs("div",{className:"text-center",children:[g.jsx("div",{className:"text-sm font-medium",children:d}),g.jsx("div",{className:"text-xs text-muted-foreground mt-0.5",children:f})]})]},c))})]}),g.jsxs("section",{className:"space-y-4",children:[g.jsxs("div",{children:[g.jsx("h3",{className:"text-base font-semibold",children:e("settings.appearance.language")}),g.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:e("settings.appearance.languageDescription")})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(T8t,{htmlFor:"language-select",children:e("settings.appearance.selectLanguage")}),g.jsxs(d5,{value:t.language,onValueChange:s,children:[g.jsx(fw,{id:"language-select",className:"w-full max-w-xs",children:g.jsx(Ple,{})}),g.jsxs(pw,{children:[g.jsx(yb,{value:"en",className:"cursor-pointer",children:e("language.english")}),g.jsx(yb,{value:"zh-CN",className:"cursor-pointer",children:e("language.chinese")})]})]})]})]})]})}function A8t(){return g.jsx(C8t,{})}function k8t(){const{currentProject:e,loading:t}=Qa(),{projects:n,storageKey:r}=Kw();if(t)return g.jsx("div",{className:"flex items-center justify-center min-h-screen bg-background",children:g.jsx("div",{className:"animate-pulse text-muted-foreground text-sm",children:"Loading…"})});if(e!=null&&e.id)return g.jsx(s_,{to:`/projects/${e.id}`,replace:!0});const i=typeof window<"u"?sessionStorage.getItem(r)??localStorage.getItem(r):null;if(i){const a=n.find(s=>s.id===i);if(a)return g.jsx(s_,{to:`/projects/${a.id}`,replace:!0})}return n.length>0?g.jsx(s_,{to:`/projects/${n[0].id}`,replace:!0}):g.jsx(s_,{to:"/projects",replace:!0})}const _ne={SIDEBAR_SCROLL:"harnspec:ui:sidebarScroll"},Ene={get:(e,t,n=!1)=>{if(typeof window>"u")return t;try{const i=(n?sessionStorage:localStorage).getItem(e);if(i===null)return t;try{return JSON.parse(i)}catch{return i}}catch(r){return console.warn(`Error reading from storage key "${e}":`,r),t}},set:(e,t,n=!1)=>{if(!(typeof window>"u"))try{const r=n?sessionStorage:localStorage;typeof t=="string"?r.setItem(e,t):r.setItem(e,JSON.stringify(t))}catch(r){console.warn(`Error writing to storage key "${e}":`,r)}},remove:(e,t=!1)=>{if(!(typeof window>"u"))try{(t?sessionStorage:localStorage).removeItem(e)}catch(n){console.warn(`Error removing storage key "${e}":`,n)}},migrateFromSessionToLocal:(e,t)=>{if(!(typeof window>"u"))try{const n=sessionStorage.getItem(e),r=localStorage.getItem(t);n!==null&&r===null&&localStorage.setItem(t,n),n!==null&&sessionStorage.removeItem(e)}catch(n){console.warn(`Error migrating ${e} to ${t}:`,n)}}};function N8t({statusFilter:e,priorityFilter:t,tagFilter:n,showArchived:r,statusOptions:i,allTags:a,tagSearchQuery:s,onTagSearchQueryChange:o,onToggleStatus:l,onTogglePriority:c,onToggleTag:u,onToggleArchived:d,onClearAll:f,t:p}){const y=e.length>0||t.length>0||n.length>0;return g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b",children:[g.jsx("span",{className:"font-medium text-sm py-1",children:p("specsNavSidebar.filtersLabel")}),(y||r)&&g.jsx(ct,{variant:"ghost",size:"sm",className:"h-auto px-2 py-1 text-xs",onClick:f,children:p("specsNavSidebar.clearFilters")})]}),g.jsxs("div",{className:"max-h-[calc(100dvh-200px)] overflow-y-auto",children:[g.jsxs(Lie,{type:"multiple",className:"w-full",children:[g.jsxs(q_,{value:"status",className:"border-b-0",children:[g.jsx(G_,{className:"px-4 py-3 hover:bg-muted/50 hover:no-underline text-xs",children:e.length===0?p("specsNavSidebar.select.status.all"):`${p("specsNavSidebar.status")}: ${e.length} ${p("specsNavSidebar.selected")}`}),g.jsx(W_,{className:"pb-2",children:g.jsxs("div",{className:"space-y-1 px-2",children:[i.map(b=>g.jsx(VC,{checked:e.includes(b),onToggle:()=>l(b),label:H9(b,p),icon:g.jsx(b4,{status:b,iconOnly:!0,className:"scale-90"})},b)),r&&g.jsx(VC,{checked:e.includes("archived"),onToggle:()=>l("archived"),label:H9("archived",p),icon:g.jsx(b4,{status:"archived",iconOnly:!0,className:"scale-90"})},"archived")]})})]}),g.jsxs(q_,{value:"priority",className:"border-b-0 border-t",children:[g.jsx(G_,{className:"px-4 py-3 hover:bg-muted/50 hover:no-underline text-xs",children:t.length===0?p("specsNavSidebar.select.priority.all"):`${p("specsNavSidebar.priority")}: ${t.length} ${p("specsNavSidebar.selected")}`}),g.jsx(W_,{className:"pb-2",children:g.jsx("div",{className:"space-y-1 px-2",children:["critical","high","medium","low"].map(b=>g.jsx(VC,{checked:t.includes(b),onToggle:()=>c(b),label:_2e(b,p),icon:g.jsx(wz,{priority:b,iconOnly:!0,className:"scale-90"})},b))})})]}),a.length>0&&g.jsxs(q_,{value:"tags",className:"border-b-0 border-t",children:[g.jsx(G_,{className:"px-4 py-3 hover:bg-muted/50 hover:no-underline text-xs",children:n.length===0?p("specsNavSidebar.select.tag.all"):`${p("specsNavSidebar.tags")}: ${n.length} ${p("specsNavSidebar.selected")}`}),g.jsxs(W_,{className:"pb-2",children:[g.jsx("div",{className:"px-2 pb-2",children:g.jsxs("div",{className:"relative",children:[g.jsx(Vh,{className:"absolute left-2 top-2 h-3.5 w-3.5 text-muted-foreground"}),g.jsx(Na,{type:"text",placeholder:p("specsNavSidebar.searchTags"),value:s,onChange:b=>o(b.target.value),className:"h-8 pl-8 text-xs bg-background"})]})}),g.jsxs("div",{className:"space-y-1 px-2 max-h-48 overflow-y-auto",children:[a.filter(b=>b.toLowerCase().includes(s.toLowerCase())).map(b=>g.jsx(VC,{checked:n.includes(b),onToggle:()=>u(b),label:b},b)),a.filter(b=>b.toLowerCase().includes(s.toLowerCase())).length===0&&g.jsx("div",{className:"text-xs text-muted-foreground text-center py-2",children:p("specsNavSidebar.noTagsFound")})]})]})]})]}),g.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-t hover:bg-accent cursor-pointer group",onClick:d,children:[g.jsx("div",{className:ke("flex items-center justify-center w-4 h-4 border rounded transition-colors",r?"bg-primary border-primary text-primary-foreground":"group-hover:border-primary/50"),children:r&&g.jsx(ua,{className:"h-3 w-3"})}),g.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[g.jsx(PP,{className:"h-4 w-4 text-muted-foreground"}),g.jsx("span",{className:"text-sm",children:p("specsNavSidebar.showArchived")})]})]})]})]})}function VC({checked:e,onToggle:t,label:n,icon:r}){return g.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent cursor-pointer group",onClick:t,children:[g.jsx("div",{className:ke("flex items-center justify-center w-4 h-4 border rounded transition-colors",e?"bg-primary border-primary text-primary-foreground":"group-hover:border-primary/50"),children:e&&g.jsx(ua,{className:"h-3 w-3"})}),g.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[r,g.jsx("span",{className:"text-sm flex-1 break-all",children:n})]})]})}function R8t({className:e,count:t,iconOnly:n=!1}){const{t:r}=Hn("common");return n?g.jsx(aG,{className:ke("h-4 w-4 text-primary",e)}):g.jsx(gw,{children:g.jsxs(Qo,{children:[g.jsx(Jo,{asChild:!0,children:g.jsxs("div",{className:ke("inline-flex items-center gap-1.5 rounded-md px-2 py-0.5 text-[10px] font-medium border border-primary/20 transition-colors","bg-primary/10 text-primary",e),children:[g.jsx(aG,{className:"h-3 w-3"}),g.jsx("span",{children:r("specs.hierarchy.umbrella")}),t!==void 0&&t>0&&g.jsxs("span",{className:"ml-0.5 opacity-70",children:["(",t,")"]})]})}),g.jsxs(xo,{children:[r("specs.hierarchy.umbrella"),t!==void 0&&t>0?` (${t} children)`:""]})]})})}function D8t({loading:e,filteredSpecs:t,activeSpecId:n,selectedSpecId:r,basePath:i,viewMode:a,sortBy:s,listHeight:o,listRef:l,expandedIds:c,onExpandedChange:u,onSpecClick:d,onMobileClose:f,t:p,language:y,sessionStatusBySpec:b}){const x=S.useCallback(_=>{const{index:E,style:w}=_,C=t[E],k=(C==null?void 0:C.specName)===n,N=(C==null?void 0:C.title)||(C==null?void 0:C.specName),R=b.get(C.specName);return C?g.jsx("div",{style:w,className:"px-2 py-0.5",children:g.jsxs(Qo,{children:[g.jsx(Jo,{asChild:!0,children:g.jsxs(og,{to:`${i}/specs/${C.specName}`,onClick:()=>f==null?void 0:f(),className:ke("flex flex-col gap-1 p-1.5 rounded-md text-sm transition-colors h-full justify-center",k?"bg-accent text-accent-foreground font-medium":"hover:bg-accent/50"),children:[g.jsxs("div",{className:"flex items-center gap-1.5 w-full",children:[C.specNumber&&g.jsxs("span",{className:"text-xs font-mono text-muted-foreground shrink-0",children:["#",C.specNumber]}),g.jsx("span",{className:"truncate text-xs leading-relaxed flex-1",children:N})]}),g.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap w-full",children:[C.status&&g.jsxs(Qo,{children:[g.jsx(Jo,{asChild:!0,children:g.jsx("div",{children:g.jsx(b4,{status:C.status,iconOnly:!0,className:"text-[10px] scale-90"})})}),g.jsx(xo,{side:"right",children:H9(C.status,p)})]}),C.priority&&g.jsxs(Qo,{children:[g.jsx(Jo,{asChild:!0,children:g.jsx("div",{children:g.jsx(wz,{priority:C.priority,iconOnly:!0,className:"text-[10px] scale-90"})})}),g.jsx(xo,{side:"right",children:_2e(C.priority,p)})]}),C.children&&C.children.length>0&&g.jsxs(Qo,{children:[g.jsx(Jo,{asChild:!0,children:g.jsx("div",{children:g.jsx(R8t,{iconOnly:!0,className:"h-3 w-3 text-muted-600 dark:text-muted-400"})})}),g.jsx(xo,{side:"right",children:p("specs.hierarchy.umbrella")})]}),C.updatedAt&&g.jsx("span",{className:"text-[10px] text-muted-foreground",children:C2e(C.updatedAt,y)}),R==="running"&&g.jsxs(Qo,{children:[g.jsx(Jo,{asChild:!0,children:g.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500","aria-label":p("sessions.indicators.running"),title:p("sessions.indicators.running")})}),g.jsx(xo,{side:"right",children:p("sessions.indicators.running")})]}),R==="attention"&&g.jsxs(Qo,{children:[g.jsx(Jo,{asChild:!0,children:g.jsx(vNe,{className:"h-3 w-3 text-amber-500","aria-label":p("sessions.indicators.attention")})}),g.jsx(xo,{side:"right",children:p("sessions.indicators.attention")})]}),R==="completed"&&g.jsxs(Qo,{children:[g.jsx(Jo,{asChild:!0,children:g.jsx(ua,{className:"h-3 w-3 text-emerald-500","aria-label":p("sessions.indicators.completedRecent")})}),g.jsx(xo,{side:"right",children:p("sessions.indicators.completedRecent")})]})]})]})}),g.jsx(xo,{side:"right",className:"max-w-[300px]",children:g.jsxs("div",{className:"space-y-1",children:[g.jsx("div",{className:"font-semibold",children:N}),g.jsx("div",{className:"text-xs text-muted-foreground",children:C.specName})]})})]})}):g.jsx("div",{style:w})},[n,i,t,y,f,b,p]);return e?g.jsx(xCt,{}):t.length===0?g.jsx("div",{className:"text-center py-8 text-sm text-muted-foreground",children:p("specsNavSidebar.noResults")}):a==="tree"?g.jsx("div",{className:"h-full px-2 py-0.5",children:g.jsx(wCt,{specs:t,onSpecClick:d,selectedSpecId:r,height:o,sortBy:s,expandedIds:c,onExpandedChange:u})}):g.jsx(yw,{listRef:l,defaultHeight:o,rowCount:t.length,rowHeight:60,overscanCount:6,rowComponent:x,rowProps:{},style:{height:o,width:"100%"}})}function M8t({mobileOpen:e=!1,onMobileOpenChange:t}){const n=Hs(),r=ql(),{projectId:i}=sg(),{currentProject:a}=Qa(),s=i??(a==null?void 0:a.id),o=ywe(s??null),l=nN(s??null),c=s?`/projects/${s}`:"/projects",u=S.useMemo(()=>o.data??[],[o.data]),d=S.useMemo(()=>l.data??[],[l.data]),f=!a||o.isLoading,p=S.useMemo(()=>{const ge=new Map,Le=1440*60*1e3,He=Date.now();for(const We of d)for(const lt of We.specIds??[]){const ot=ge.get(lt);if(ot==="running")continue;if(We.status==="running"){ge.set(lt,"running");continue}if(!ot&&(We.status==="pending"||We.status==="paused")){ge.set(lt,"attention");continue}const Jt=We.endedAt?new Date(We.endedAt).getTime():NaN,fn=We.startedAt?new Date(We.startedAt).getTime():NaN,Er=Number.isFinite(Jt)?Jt:fn,Kn=Number.isFinite(Er)&&He-Er<Le;!ot&&We.status==="completed"&&Kn&&ge.set(lt,"completed")}return ge},[d]),[y,b]=S.useState(""),[x,_]=S.useState(""),{statusFilter:E,priorityFilter:w,tagFilter:C,sortBy:k,hierarchyView:N,showArchived:R,expandedNodeIds:L,setStatusFilter:j,setPriorityFilter:B,setTagFilter:F,setSortBy:q,setHierarchyView:Q,setShowArchived:I,setExpandedNodeIds:V,clearFilters:z}=BEe(),{collapsed:G,setCollapsed:Y}=jEe(),[te,Z]=S.useState(!1),[ee,re]=S.useState(()=>wne()),$=N?"tree":"list",se=S.useCallback(ge=>Q(ge==="tree"),[Q]),le=S.useMemo(()=>new Set(L),[L]),he=S.useCallback(ge=>V(Array.from(ge)),[V]),[oe]=S.useState(()=>Ene.get(_ne.SIDEBAR_SCROLL,0,!0)),{t:be,i18n:_e}=Hn("common"),Ie=S.useRef(null),Ue=S.useRef(e),Ce=S.useRef(!1),Xe=S.useMemo(()=>{const ge=n.pathname.match(/\/specs\/(.+)$/);return ge?decodeURIComponent(ge[1]):""},[n.pathname]),_t=S.useRef(Xe),xt=S.useMemo(()=>u.find(ge=>ge.specName===Xe),[u,Xe]),Ct=(xt==null?void 0:xt.id)||Xe;S.useEffect(()=>{o.error&&console.error("Failed to load specs for sidebar",o.error)},[o.error]),S.useEffect(()=>{const ge=()=>re(wne());return ge(),window.addEventListener("resize",ge),()=>window.removeEventListener("resize",ge)},[]),S.useEffect(()=>{document.documentElement.style.setProperty("--specs-nav-sidebar-width",G?"0px":"280px")},[G]),S.useEffect(()=>{Ue.current=e},[e]),S.useEffect(()=>{Ue.current&&(t==null||t(!1))},[n.pathname,t]);const Kt=S.useCallback(ge=>{r(`${c}/specs/${ge.specName}`),e&&(t==null||t(!1))},[c,r,e,t]),mt=S.useCallback((ge,Le)=>{const He=new Map;for(const ot of Le)ot.parent&&(He.has(ot.parent)||He.set(ot.parent,[]),He.get(ot.parent).push(ot));const We=new Set(ge.map(ot=>ot.specName||ot.id)),lt=ot=>{const Jt=He.get(ot);if(Jt)for(const fn of Jt){const Er=fn.specName||fn.id;Er&&!We.has(Er)&&(We.add(Er),lt(Er))}};for(const ot of ge)lt(ot.specName||ot.id||"");return Le.filter(ot=>We.has(ot.specName||ot.id||""))},[]),Lt=S.useMemo(()=>new Mg(u,{keys:[{name:"title",weight:2},{name:"specNumber",weight:1.5},{name:"specName",weight:1},{name:"tags",weight:.5}],threshold:.4,includeScore:!0,minMatchCharLength:2}),[u]),Mn=S.useMemo(()=>{let ge=u,Le=u;if(!R&&!E.includes("archived")&&(ge=ge.filter(We=>We.status!=="archived"),Le=ge),y){const We=new Set(Lt.search(y).map(lt=>lt.item.specName));ge=ge.filter(lt=>We.has(lt.specName))}E.length>0&&(ge=ge.filter(We=>We.status&&E.includes(We.status))),w.length>0&&(ge=ge.filter(We=>We.priority&&w.includes(We.priority))),C.length>0&&(ge=ge.filter(We=>{var lt;return(lt=We.tags)==null?void 0:lt.some(ot=>C.includes(ot))})),$==="tree"&&(E.length>0||w.length>0)&&(ge=mt(ge,Le));const He={critical:4,high:3,medium:2,low:1};return[...ge].sort((We,lt)=>{switch(k){case"id-asc":return(We.specNumber||0)-(lt.specNumber||0);case"updated-desc":return We.updatedAt?lt.updatedAt?new Date(lt.updatedAt).getTime()-new Date(We.updatedAt).getTime()||(lt.specNumber||0)-(We.specNumber||0):-1:1;case"title-asc":return(We.title||We.specName||"").toLowerCase().localeCompare((lt.title||lt.specName||"").toLowerCase())||(lt.specNumber||0)-(We.specNumber||0);case"title-desc":return(lt.title||lt.specName||"").toLowerCase().localeCompare((We.title||We.specName||"").toLowerCase())||(lt.specNumber||0)-(We.specNumber||0);case"priority-desc":return(He[lt.priority||""]||0)-(He[We.priority||""]||0)||(lt.specNumber||0)-(We.specNumber||0);case"priority-asc":return(He[We.priority||""]||0)-(He[lt.priority||""]||0)||(lt.specNumber||0)-(We.specNumber||0);default:return(lt.specNumber||0)-(We.specNumber||0)}})},[u,y,E,w,C,$,mt,R,k,Lt]),ln=S.useMemo(()=>$!=="tree"?[]:N2e(Mn,k),[Mn,k,$]),Vn=S.useMemo(()=>V9(ln),[ln]),Ir=S.useRef(!1);S.useEffect(()=>{$==="tree"&&!Ir.current&&Vn.size>0&&(L.length===0&&he(Vn),Ir.current=!0)},[$,Vn,L.length,he]);const hn=S.useMemo(()=>{const ge=new Set;return u.forEach(Le=>{var He;return(He=Le.tags)==null?void 0:He.forEach(We=>ge.add(We))}),Array.from(ge).sort()},[u]),Yn=S.useMemo(()=>{const ge=["planned","in-progress","complete"];return u.some(Le=>Le.status==="draft")&&ge.unshift("draft"),ge},[u]),Ve=E.length>0||w.length>0||C.length>0;S.useEffect(()=>{var Le;if($==="tree")return;const ge=(Le=Ie.current)==null?void 0:Le.element;!ge||Ce.current||oe>0&&(ge.scrollTop=oe,Ce.current=!0)},[oe,ee,te,Mn.length,$]),S.useEffect(()=>{if($==="tree"||f||!Xe||Mn.length===0||!Ie.current||_t.current===Xe&&Ce.current)return;const ge=Mn.findIndex(Le=>Le.specName===Xe);if(ge>=0){const Le=requestAnimationFrame(()=>{var He;return(He=Ie.current)==null?void 0:He.scrollToRow({index:ge,align:"smart",behavior:"smooth"})});return Ce.current=!0,_t.current=Xe,()=>cancelAnimationFrame(Le)}_t.current=Xe},[Mn,Xe,oe,f,$]),S.useEffect(()=>{var He;if($==="tree")return;const ge=(He=Ie.current)==null?void 0:He.element;if(!ge)return;const Le=()=>Ene.set(_ne.SIDEBAR_SCROLL,ge.scrollTop,!0);return ge.addEventListener("scroll",Le,{passive:!0}),()=>ge.removeEventListener("scroll",Le)},[$]);const ie=ge=>j(E.includes(ge)?E.filter(Le=>Le!==ge):[...E,ge]),O=ge=>B(w.includes(ge)?w.filter(Le=>Le!==ge):[...w,ge]),K=ge=>F(C.includes(ge)?C.filter(Le=>Le!==ge):[...C,ge]),de=e||!G;return g.jsx(gw,{delayDuration:700,children:g.jsxs("div",{className:"relative",children:[e&&g.jsx("div",{className:"fixed inset-0 bg-black/40 z-40 lg:hidden",onClick:()=>t==null?void 0:t(!1)}),g.jsxs("aside",{className:ke("border-r bg-background flex flex-col overflow-hidden transition-all duration-300 flex-shrink-0",e?"fixed inset-y-0 left-0 z-50 w-[280px] shadow-xl":"hidden lg:flex lg:sticky lg:top-14 lg:h-[calc(100dvh-3.5rem)]",G&&!e?"lg:w-0 lg:border-r-0":"lg:w-[280px]"),children:[g.jsxs("div",{className:"p-3 border-b space-y-3",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsx("h2",{className:"font-semibold text-sm",children:be("specsNavSidebar.title")}),g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx(ct,{variant:$==="tree"?"secondary":"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>se($==="list"?"tree":"list"),title:be($==="list"?"specsNavSidebar.switchToTree":"specsNavSidebar.switchToList"),children:$==="list"?g.jsx(aRe,{className:"h-4 w-4"}):g.jsx(zRe,{className:"h-4 w-4"})}),g.jsxs(fb,{children:[g.jsx(pb,{asChild:!0,children:g.jsx(ct,{variant:k!=="id-desc"?"secondary":"ghost",size:"sm",className:"h-7 w-7 p-0",title:be("specsNavSidebar.sort.label"),children:g.jsx(Ure,{className:"h-4 w-4"})})}),g.jsxs(U0,{align:"start",className:"w-48",children:[g.jsx(wk,{children:be("specsNavSidebar.sort.label")}),g.jsx(hd,{}),[["id-desc","newest"],["id-asc","oldest"],["updated-desc","updated"]].map(([ge,Le])=>g.jsxs(yc,{onClick:()=>q(ge),children:[be(`specsNavSidebar.sort.${Le}`),k===ge&&g.jsx(ua,{className:"ml-auto h-4 w-4"})]},ge)),g.jsx(hd,{}),[["title-asc","titleAsc"],["title-desc","titleDesc"]].map(([ge,Le])=>g.jsxs(yc,{onClick:()=>q(ge),children:[be(`specsNavSidebar.sort.${Le}`),k===ge&&g.jsx(ua,{className:"ml-auto h-4 w-4"})]},ge)),g.jsx(hd,{}),[["priority-desc","priorityHigh"],["priority-asc","priorityLow"]].map(([ge,Le])=>g.jsxs(yc,{onClick:()=>q(ge),children:[be(`specsNavSidebar.sort.${Le}`),k===ge&&g.jsx(ua,{className:"ml-auto h-4 w-4"})]},ge))]})]}),g.jsxs(Mc,{open:te,onOpenChange:Z,children:[g.jsx(Ic,{asChild:!0,children:g.jsx(ct,{variant:te||Ve||R?"secondary":"ghost",size:"sm",className:"h-7 w-7 p-0",title:be(te?"specsNavSidebar.toggleFilters.hide":"specsNavSidebar.toggleFilters.show"),children:g.jsx(P4,{className:"h-4 w-4"})})}),g.jsx(Gl,{className:"w-80 p-0",align:"start",sideOffset:8,children:g.jsx(N8t,{statusFilter:E,priorityFilter:w,tagFilter:C,showArchived:R,statusOptions:Yn,allTags:hn,tagSearchQuery:x,onTagSearchQueryChange:_,onToggleStatus:ie,onTogglePriority:O,onToggleTag:K,onToggleArchived:()=>{const ge=!R;I(ge),!ge&&E.includes("archived")&&j(E.filter(Le=>Le!=="archived"))},onClearAll:()=>{z(),I(!1)},t:be})})]}),t&&g.jsx(ct,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 lg:hidden",onClick:()=>t(!1),title:be("actions.close"),children:g.jsx(cl,{className:"h-4 w-4"})}),g.jsx(ct,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 hidden lg:flex",onClick:()=>Y(!0),title:be("specSidebar.collapse"),children:g.jsx(I4,{className:"h-4 w-4"})})]})]}),g.jsx(k2e,{value:y,onChange:b,placeholder:be("specsNavSidebar.searchPlaceholder"),showShortcut:!1,className:"h-9 text-sm"})]}),g.jsx("div",{className:"flex-1 overflow-hidden",children:g.jsx(D8t,{loading:f,filteredSpecs:Mn,activeSpecId:Xe,selectedSpecId:Ct,basePath:c,viewMode:$,sortBy:k,listHeight:ee,listRef:Ie,expandedIds:le,onExpandedChange:he,onSpecClick:Kt,onMobileClose:()=>t==null?void 0:t(!1),t:be,language:_e.language,sessionStatusBySpec:p})})]}),!de&&g.jsx(ct,{variant:"ghost",size:"sm",className:"hidden lg:flex h-9 w-5 p-0 absolute z-50 top-2 left-0 bg-background border border-l-0 rounded-r-md rounded-l-none shadow-md hover:w-6 hover:bg-accent transition-all items-center justify-center",onClick:()=>Y(!1),title:be("specSidebar.expand"),children:g.jsx(hu,{className:"h-4 w-4"})})]})})}function wne(){return typeof window>"u"?600:window.innerHeight-56-100}function I8t(){const[e,t]=S.useState(!1);return g.jsxs("div",{className:"flex h-full relative",children:[g.jsx(M8t,{mobileOpen:e,onMobileOpenChange:t}),g.jsx(D4,{context:{mobileOpen:e,setMobileOpen:t}})]})}function L8t({status:e,className:t,iconOnly:n=!1,responsive:r=!0}){const{t:i}=Hn("common"),a=zb[e]||zb.pending,s=a.icon,o=n?void 0:i(a.labelKey),l=n||r&&!1;return g.jsxs(ei,{variant:"outline",className:ke("flex items-center w-fit h-5 px-2 py-0.5 text-xs font-medium border-transparent",!l&&"gap-1.5",a.className,r&&!n&&"hidden sm:flex",t),children:[g.jsx(s,{className:"h-3.5 w-3.5"}),!l&&o]})}function O8t({duration:e,variant:t="text",className:n}){return t==="pill"?g.jsxs("span",{className:ke("inline-flex items-center gap-1 h-5 px-1.5 py-0.5 text-[10px] font-medium rounded-md bg-muted text-muted-foreground shrink-0",n),children:[g.jsx(sG,{className:"h-3 w-3"}),e]}):g.jsxs("span",{className:ke("shrink-0 flex items-center gap-1 text-xs text-muted-foreground",n),children:[g.jsx(sG,{className:"h-3 w-3"}),e]})}function P8t({mobileOpen:e=!1,onMobileOpenChange:t}){const n=Hs(),r=ql(),{projectId:i}=sg(),{currentProject:a}=Qa(),s=i??(a==null?void 0:a.id),o=nN(s??null),l=s?`/projects/${s}`:"/projects",c=S.useMemo(()=>o.data??[],[o.data]),u=!a||o.isLoading,[d,f]=S.useState(""),[p,y]=S.useState([]),{collapsed:b,setCollapsed:x}=$Ee(),[_,E]=S.useState(()=>Sne()),w=S.useRef(null),C=S.useMemo(()=>{const I=n.pathname.match(/\/sessions\/(.+)$/);return I?decodeURIComponent(I[1]):""},[n.pathname]);S.useEffect(()=>{const I=()=>E(Sne());return I(),window.addEventListener("resize",I),()=>window.removeEventListener("resize",I)},[]),S.useEffect(()=>{document.documentElement.style.setProperty("--sessions-nav-sidebar-width",b?"0px":"280px")},[b]),S.useEffect(()=>{e&&(t==null||t(!1))},[n.pathname,t,e]);const k=S.useMemo(()=>{const I=c.map(V=>V.status).filter(Boolean);return Array.from(new Set(I)).sort()},[c]),N=p.length>0,R=S.useMemo(()=>{const I=d.trim().toLowerCase();return c.filter(z=>!(p.length>0&&!p.includes(z.status)||I&&![z.id,z.runner,z.prompt??"",...z.specIds??[]].join(" ").toLowerCase().includes(I))).sort((z,G)=>new Date(G.startedAt).getTime()-new Date(z.startedAt).getTime())},[d,c,p]),L=S.useCallback(I=>{r(`${l}/sessions/${I.id}`),e&&(t==null||t(!1))},[l,r,e,t]),j=I=>{y(V=>V.includes(I)?V.filter(z=>z!==I):[...V,I])},{t:B,i18n:F}=Hn("common"),q=S.useCallback(I=>{var ee,re;const{index:V,style:z}=I,G=R[V];if(!G)return g.jsx("div",{style:z});const Y=G.id===C,te=Ate(G),Z=G.prompt||((ee=G.specIds)!=null&&ee.length?G.specIds.join(", "):null)||G.id.slice(0,8);return g.jsx("div",{style:z,className:"px-1.5 py-0.5",children:g.jsxs("button",{onClick:()=>L(G),className:ke("w-full text-left rounded-md px-2.5 py-2 transition-colors group overflow-hidden",Y?"bg-accent text-accent-foreground font-medium":"hover:bg-accent/50"),children:[g.jsxs("div",{className:"flex items-center gap-1.5 w-full min-w-0",children:[g.jsx(uz,{runnerId:G.runner,size:20,className:"shrink-0"}),g.jsx("span",{className:"truncate text-xs leading-relaxed flex-1",children:Z})]}),g.jsxs("div",{className:"flex space-between items-center mt-1",children:[g.jsxs("div",{className:"flex items-center gap-1.5 w-full flex-1",children:[g.jsx(L8t,{status:G.status,iconOnly:!0,responsive:!1}),te&&g.jsx(O8t,{duration:te,variant:"pill"}),G.startedAt&&g.jsx("span",{className:"text-[10px] text-muted-foreground",children:C2e(G.startedAt,F.language)})]}),g.jsx("div",{children:(((re=G.specIds)==null?void 0:re.length)??0)>0&&g.jsxs("div",{className:"text-[10px] text-muted-foreground truncate w-full flex items-center gap-0.5",children:[g.jsx(UNe,{className:"h-2.5 w-2.5 shrink-0"}),g.jsx("span",{className:"truncate",children:G.specIds.map($=>$.split("-")[0]).join(", ")})]})})]})]})})},[C,R,Ate,L,F.language,B]),Q=e||!b;return g.jsxs("div",{className:"relative",children:[e&&g.jsx("div",{className:"fixed inset-0 bg-black/40 z-40 lg:hidden",onClick:()=>t==null?void 0:t(!1)}),g.jsxs("aside",{className:ke("border-r bg-background flex flex-col overflow-hidden transition-all duration-300 flex-shrink-0",e?"fixed inset-y-0 left-0 z-50 w-[280px] shadow-xl":"hidden lg:flex lg:sticky lg:top-14 lg:h-[calc(100dvh-3.5rem)]",b&&!e?"lg:w-0 lg:border-r-0":"lg:w-[280px]"),children:[g.jsxs("div",{className:"p-3 border-b space-y-3",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsx("h2",{className:"font-semibold text-sm",children:B("sessionsPage.title")}),g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsxs(Mc,{children:[g.jsx(Ic,{asChild:!0,children:g.jsx(ct,{variant:N?"secondary":"ghost",size:"sm",className:"h-7 w-7 p-0",title:B("specsNavSidebar.filtersLabel"),children:g.jsx(P4,{className:"h-4 w-4"})})}),g.jsxs(Gl,{className:"w-56 p-0",align:"start",sideOffset:8,children:[g.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b",children:[g.jsx("span",{className:"font-medium text-sm py-1",children:B("sessionsPage.filters.status")}),N&&g.jsx(ct,{variant:"ghost",size:"sm",className:"h-auto px-2 py-1 text-xs",onClick:()=>y([]),children:B("specsNavSidebar.clearFilters")})]}),g.jsx("div",{className:"p-2 space-y-1",children:k.map(I=>{const V=zb[I],z=V==null?void 0:V.icon;return g.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent cursor-pointer group",onClick:()=>j(I),children:[g.jsx("div",{className:ke("flex items-center justify-center w-4 h-4 border rounded transition-colors",p.includes(I)?"bg-primary border-primary text-primary-foreground":"group-hover:border-primary/50"),children:p.includes(I)&&g.jsx(ua,{className:"h-3 w-3"})}),g.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[z&&g.jsx(z,{className:"h-3.5 w-3.5"}),g.jsx("span",{className:"text-sm",children:B(`sessions.status.${I}`)})]})]},I)})})]})]}),t&&g.jsx(ct,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 lg:hidden",onClick:()=>t(!1),title:B("actions.close"),children:g.jsx(cl,{className:"h-4 w-4"})}),g.jsx(ct,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 hidden lg:flex",onClick:()=>x(!0),title:B("sessionsSidebar.collapse"),children:g.jsx(I4,{className:"h-4 w-4"})})]})]}),g.jsx(k2e,{value:d,onChange:f,placeholder:B("sessionsSidebar.searchPlaceholder"),showShortcut:!1,className:"h-9 text-sm"})]}),g.jsx("div",{className:"flex-1 overflow-hidden",children:u?g.jsx("div",{className:"p-3 space-y-2",children:Array.from({length:6}).map((I,V)=>g.jsx("div",{className:"h-14 rounded-md bg-muted/50 animate-pulse"},V))}):R.length===0?g.jsx("div",{className:"text-center py-8 text-sm text-muted-foreground",children:B("sessionsSidebar.noResults")}):g.jsx(yw,{listRef:w,defaultHeight:_,rowCount:R.length,rowHeight:60,overscanCount:6,rowComponent:q,rowProps:{},style:{height:_,width:"100%"}})})]}),!Q&&g.jsx(ct,{variant:"ghost",size:"sm",className:"hidden lg:flex h-9 w-5 p-0 absolute z-50 top-2 left-0 bg-background border border-l-0 rounded-r-md rounded-l-none shadow-md hover:w-6 hover:bg-accent transition-all items-center justify-center",onClick:()=>x(!1),title:B("sessionsSidebar.expand"),children:g.jsx(hu,{className:"h-4 w-4"})})]})}function Sne(){return typeof window>"u"?600:window.innerHeight-56-100}function F8t(){const[e,t]=S.useState(!1);return g.jsxs("div",{className:"flex h-full relative",children:[g.jsx(P8t,{mobileOpen:e,onMobileOpenChange:t}),g.jsx(D4,{context:{mobileOpen:e,setMobileOpen:t}})]})}const B8t=S.lazy(()=>me(()=>import("./ContextPage-BaNHyJAS.js"),__vite__mapDeps([147,148,149])).then(e=>({default:e.ContextPage}))),j8t=S.lazy(()=>me(()=>import("./DashboardPage-DCb6-5kD.js"),__vite__mapDeps([150,151,152])).then(e=>({default:e.DashboardPage}))),Tne=S.lazy(()=>me(()=>import("./DependenciesPage-DmcZ0HId.js"),[]).then(e=>({default:e.DependenciesPage}))),$8t=S.lazy(()=>me(()=>import("./ChatSettingsPage-CHSjd3vp.js"),[]).then(e=>({default:e.ChatSettingsPage}))),z8t=S.lazy(()=>me(()=>import("./FilesPage-DZzXXnSe.js"),__vite__mapDeps([153,154])).then(e=>({default:e.FilesPage}))),U8t=S.lazy(()=>me(()=>import("./SessionDetailPage-DpLwCjal.js"),__vite__mapDeps([155,156,157])).then(e=>({default:e.SessionDetailPage}))),H8t=S.lazy(()=>me(()=>import("./SessionsPage-BKKyO4A_.js"),__vite__mapDeps([158,156,157,159,160])).then(e=>({default:e.SessionsPage}))),V8t=S.lazy(()=>me(()=>import("./SpecDetailPage-B0cx1uxg.js"),__vite__mapDeps([161,156,162,163,149,152,148,160,164])).then(e=>({default:e.SpecDetailPage}))),q8t=S.lazy(()=>me(()=>import("./SpecsPage-CF_GhEVh.js"),__vite__mapDeps([165,162,163,149,159,160])).then(e=>({default:e.SpecsPage}))),G8t=S.lazy(()=>me(()=>import("./StatsPage-CHongCio.js"),__vite__mapDeps([166,151,163,152,128,120,125,119,121,118])).then(e=>({default:e.StatsPage}))),qc=e=>g.jsx(S.Suspense,{fallback:null,children:g.jsx(e,{})});function W8t(){return[{index:!0,element:qc(j8t)},{path:"specs",children:[{index:!0,element:qc(q8t)},{element:g.jsx(I8t,{}),children:[{path:":specName",element:qc(V8t)}]}]},{path:"sessions",children:[{index:!0,element:qc(H8t)},{element:g.jsx(F8t,{}),children:[{path:":sessionId",element:qc(U8t)}]}]},{path:"stats",element:qc(G8t)},{path:"dependencies",element:qc(Tne)},{path:"dependencies/:specName",element:qc(Tne)},{path:"context",element:qc(B8t)},{path:"files",element:qc(z8t)},{path:"chat/settings",element:qc($8t)}]}const Y8t=O5e([{path:"/",element:g.jsx(k8t,{})},{path:"/projects",element:g.jsx(UC,{}),children:[{index:!0,element:g.jsx(i8t,{})}]},{path:"/machines",element:g.jsx(UC,{}),children:[{index:!0,element:g.jsx(a8t,{})}]},{path:"/settings",element:g.jsx(UC,{}),children:[{element:g.jsx(s8t,{}),children:[{index:!0,element:g.jsx(s_,{to:"/settings/models",replace:!0})},{path:"models",element:g.jsx(_8t,{})},{path:"runners",element:g.jsx(S8t,{})},{path:"appearance",element:g.jsx(A8t,{})}]}]},{path:"/projects/:projectId",element:g.jsx(UC,{}),children:W8t()}]),K8t=new v6e({defaultOptions:{queries:{staleTime:30*1e3,gcTime:300*1e3,retry:1,refetchOnWindowFocus:!1,refetchOnReconnect:!1},mutations:{retry:1}}});function Z8t(){const e=U5t(),{machineModeEnabled:t}=Ig(),n=S.useCallback(()=>{e()},[e]),i=!(typeof window<"u"&&"__TAURI__"in window),s="/api/events/specs",o=Number.parseInt("3000",10);e3t({enabled:i,url:s,reconnectDelayMs:Number.isFinite(o)?o:3e3,onChange:n}),S.useEffect(()=>{if(!t)return;const l=window.setInterval(()=>{e()},2e3);return()=>window.clearInterval(l)},[e,t])}function X8t(){const{currentProject:e}=Qa(),t=Nz(n=>n.isDrawerOpen);return Z8t(),Z4t((e==null?void 0:e.id)??null,{enabled:t}),Y3t(),null}function Q8t(){return g.jsxs(x6e,{client:K8t,children:[g.jsx(K4t,{children:g.jsx(s4t,{children:g.jsxs(w4t,{children:[g.jsx(X8t,{}),g.jsx(Y5e,{router:Y8t})]})})}),g.jsx(L6e,{initialIsOpen:!1})]})}XTe.createRoot(document.getElementById("root")).render(g.jsx(S.StrictMode,{children:g.jsx(zne,{fallbackRender:({error:e,resetErrorBoundary:t})=>g.jsxs("div",{style:{padding:"2rem",textAlign:"center",fontFamily:"system-ui, sans-serif"},children:[g.jsx("h1",{style:{fontSize:"1.25rem",fontWeight:600},children:"Something went wrong"}),g.jsx("p",{style:{color:"#888",marginTop:"0.5rem"},children:e==null?void 0:e.message}),g.jsx("button",{onClick:t,style:{marginTop:"1rem",padding:"0.5rem 1rem",cursor:"pointer"},children:"Reload"})]}),onReset:()=>window.location.reload(),children:g.jsx(Q8t,{})})}));const J8t=Object.freeze(Object.defineProperty({__proto__:null,Mermaid:h2e},Symbol.toStringTag,{value:"Module"}));export{hr as $,us as A,ei as B,Wa as C,tm as D,jh as E,Cc as F,Aat as G,plt as H,iv as I,A0e as J,Nw as K,_D as L,wLt as M,Rc as N,eOt as O,JLt as P,ru as Q,qrt as R,Grt as S,xat as T,vat as U,put as V,OLt as W,$rt as X,SLt as Y,s2 as Z,J as _,ct as a,yb as a$,_d as a0,Ant as a1,Yrt as a2,Aj as a3,ro as a4,qfe as a5,dlt as a6,fit as a7,TK as a8,eit as a9,Prt as aA,kw as aB,xn as aC,zn as aD,epe as aE,Zct as aF,A1e as aG,XLt as aH,_at as aI,hs as aJ,lm as aK,yj as aL,J0e as aM,Tg as aN,T0e as aO,ql as aP,c8t as aQ,u8t as aR,zE as aS,_c as aT,FP as aU,UMe as aV,Fl as aW,d5 as aX,fw as aY,Ple as aZ,pw as a_,zK as aa,$K as ab,MLt as ac,ALt as ad,RLt as ae,NLt as af,TLt as ag,O1 as ah,aj as ai,DLt as aj,CLt as ak,LLt as al,ILt as am,kLt as an,crt as ao,Tct as ap,iit as aq,Ab as ar,ELt as as,f6 as at,nlt as au,krt as av,JB as aw,FK as ax,FA as ay,ult as az,Gh as b,Iet as b$,Na as b0,mg as b1,iw as b2,Lp as b3,QE as b4,Mc as b5,Ic as b6,L4 as b7,Gl as b8,Wh as b9,UNe as bA,C2e as bB,O8t as bC,Cd as bD,hu as bE,UP as bF,dk as bG,Jre as bH,y5t as bI,xd as bJ,zut as bK,ZLt as bL,QLt as bM,YLt as bN,Cn as bO,KLt as bP,wut as bQ,but as bR,yut as bS,tit as bT,Kre as bU,$P as bV,aG as bW,Op as bX,aOt as bY,uQe as bZ,xnt as b_,nm as ba,Yh as bb,Kh as bc,no as bd,Ss as be,ua as bf,sg as bg,Qa as bh,nN as bi,ywe as bj,awe as bk,rLt as bl,ESe as bm,Vh as bn,P4 as bo,yOt as bp,uz as bq,cl as br,ZIt as bs,i5t as bt,zb as bu,Ate as bv,gw as bw,Qo as bx,Jo as by,xo as bz,fg as c,dOt as c$,ofe as c0,lfe as c1,opt as c2,ENe as c3,Hre as c4,Pp as c5,uOt as c6,gn as c7,og as c8,b4 as c9,h6 as cA,D3 as cB,v0e as cC,Zre as cD,Nh as cE,By as cF,nue as cG,uk as cH,PP as cI,N2e as cJ,iie as cK,ZP as cL,L2 as cM,zP as cN,O2 as cO,fb as cP,pb as cQ,U0 as cR,moe as cS,PEe as cT,Ig as cU,xOt as cV,ll as cW,rl as cX,BEe as cY,_Ot as cZ,EOt as c_,wz as ca,jP as cb,XE as cc,SOt as cd,lOt as ce,nLt as cf,g5t as cg,m5t as ch,vOt as ci,bOt as cj,h5t as ck,mOt as cl,gOt as cm,VP as cn,sG as co,P2 as cp,qP as cq,Wre as cr,Y9e as cs,lLt as ct,PPe as cu,FPe as cv,Qre as cw,BPe as cx,u5t as cy,_Lt as cz,pg as d,Ete as d$,Td as d0,Lw as d1,wct as d2,Ect as d3,SL as d4,Vs as d5,Ia as d6,ZWe as d7,et as d8,uAt as d9,cE as dA,Rot as dB,y0e as dC,u0e as dD,Lst as dE,k3 as dF,Ost as dG,Mw as dH,Km as dI,Tot as dJ,oZ as dK,Eg as dL,Pst as dM,xj as dN,Ist as dO,jst as dP,ov as dQ,Not as dR,Qot as dS,Vst as dT,qot as dU,bj as dV,$Z as dW,Sn as dX,a0e as dY,sOt as dZ,Gre as d_,Oc as da,Np as db,Ku as dc,Hy as dd,ol as de,pOt as df,bz as dg,fEe as dh,fOt as di,$b as dj,Bn as dk,Zkt as dl,p4 as dm,oOt as dn,al as dp,yGe as dq,NB as dr,Bde as ds,Sw as dt,zde as du,xLt as dv,RB as dw,tp as dx,pY as dy,SGe as dz,Aet as e,vRe as e0,yRe as e1,NL as e2,kh as e3,U5t as e4,D0 as e5,M0 as e6,E2e as e7,w2e as e8,R8t as e9,tlt as eA,b3 as eB,nit as eC,rit as eD,tF as eE,JWe as eF,lg as eG,Epe as eH,wpe as eI,_pe as eJ,xpe as eK,bpe as eL,ype as eM,hit as eN,ape as eO,ipe as eP,sit as eQ,ait as eR,T4 as eS,ig as eT,cOt as eU,me as eV,eie as ea,Xre as eb,dpt as ec,Jvt as ed,uxt as ee,JIt as ef,Nz as eg,wOt as eh,hOt as ei,sv as ej,Pot as ek,udt as el,Dw as em,R3 as en,om as eo,l6 as ep,nZ as eq,_j as er,h0e as es,g0e as et,Dst as eu,U7 as ev,Xot as ew,Vot as ex,Jot as ey,vj as ez,ke as f,Hs as g,Ht as h,Io as i,g as j,eae as k,Ya as l,iOt as m,NSt as n,br as o,Hrt as p,Vrt as q,S as r,X4t as s,Urt as t,Hn as u,zrt as v,yi as w,gr as x,vt as y,Jfe as z};
|