turtlecode 0.3.29 → 0.3.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/assets/assets/{_basePickBy-B_iojEAt.js → _basePickBy-BUyd8Xv8.js} +1 -1
  2. package/assets/assets/{_baseUniq-U_Pc1B-R.js → _baseUniq-CKc_yDVi.js} +1 -1
  3. package/assets/assets/{arc-y7TA3kL0.js → arc-YS7ptZr0.js} +1 -1
  4. package/assets/assets/{architectureDiagram-2XIMDMQ5-BtuBr_8D.js → architectureDiagram-2XIMDMQ5-gfx-D1Wa.js} +1 -1
  5. package/assets/assets/{auth-callback-D6fEUSOP.js → auth-callback-CZclCZDz.js} +1 -1
  6. package/assets/assets/{blockDiagram-WCTKOSBZ-DPpbARm_.js → blockDiagram-WCTKOSBZ-CKmmx4WF.js} +1 -1
  7. package/assets/assets/{c4Diagram-IC4MRINW-DT82jRyc.js → c4Diagram-IC4MRINW-lgLGcXv9.js} +1 -1
  8. package/assets/assets/channel-BRhXYMWZ.js +1 -0
  9. package/assets/assets/{chunk-4BX2VUAB-DT9Cii3i.js → chunk-4BX2VUAB-OGB6ceH_.js} +1 -1
  10. package/assets/assets/{chunk-55IACEB6-k-YCbdfk.js → chunk-55IACEB6-B-ctk-_g.js} +1 -1
  11. package/assets/assets/{chunk-FMBD7UC4-B8vZVids.js → chunk-FMBD7UC4-BZ2TRvSm.js} +1 -1
  12. package/assets/assets/{chunk-JSJVCQXG-P9SBgzjq.js → chunk-JSJVCQXG-DoYiGAfx.js} +1 -1
  13. package/assets/assets/{chunk-KX2RTZJC-BVt0fO5A.js → chunk-KX2RTZJC-BecXyfAd.js} +1 -1
  14. package/assets/assets/{chunk-NQ4KR5QH-B-xqpclb.js → chunk-NQ4KR5QH-BEVPPITN.js} +1 -1
  15. package/assets/assets/{chunk-QZHKN3VN-8OzF2T1z.js → chunk-QZHKN3VN-DmFGZRbf.js} +1 -1
  16. package/assets/assets/{chunk-WL4C6EOR-CYQPYawR.js → chunk-WL4C6EOR-DkJf4A-j.js} +1 -1
  17. package/assets/assets/classDiagram-VBA2DB6C-DiRDQC1D.js +1 -0
  18. package/assets/assets/classDiagram-v2-RAHNMMFH-DiRDQC1D.js +1 -0
  19. package/assets/assets/clone-ByJAuYwX.js +1 -0
  20. package/assets/assets/{cose-bilkent-S5V4N54A-CWWJH6JP.js → cose-bilkent-S5V4N54A-CeH1-MeF.js} +1 -1
  21. package/assets/assets/{cssMode-5IvXkP6K.js → cssMode-6nhemA1L.js} +1 -1
  22. package/assets/assets/{dagre-KLK3FWXG-DJuf5yL5.js → dagre-KLK3FWXG-D_vfv4O2.js} +1 -1
  23. package/assets/assets/{design-panel-DGxOeM2o.js → design-panel-dpXqMniQ.js} +1 -1
  24. package/assets/assets/{diagram-E7M64L7V-E4hkPMxk.js → diagram-E7M64L7V-7s2rc_1j.js} +1 -1
  25. package/assets/assets/{diagram-IFDJBPK2-TFQC2GU2.js → diagram-IFDJBPK2-B3i87ReD.js} +1 -1
  26. package/assets/assets/{diagram-P4PSJMXO-DeTjCOyW.js → diagram-P4PSJMXO-Czoocnif.js} +1 -1
  27. package/assets/assets/{dialog-clone-project-CAfI0lHh.js → dialog-clone-project-DdL1b96k.js} +1 -1
  28. package/assets/assets/{dialog-connect-provider-B0LPEC99.js → dialog-connect-provider-Dn7ai2HO.js} +2 -2
  29. package/assets/assets/{dialog-create-project-DgZYKQLe.js → dialog-create-project-umYA5dgr.js} +1 -1
  30. package/assets/assets/{dialog-edit-project-DDzRssw5.js → dialog-edit-project-vZHe6bbF.js} +1 -1
  31. package/assets/assets/{dialog-fork-D2bQrrpP.js → dialog-fork-ziPqScsq.js} +1 -1
  32. package/assets/assets/{dialog-manage-models-tJeOYGFh.js → dialog-manage-models-LZ1dEU3b.js} +1 -1
  33. package/assets/assets/{dialog-select-directory-CjI5IZBg.js → dialog-select-directory-DbmMIanK.js} +3 -3
  34. package/assets/assets/{dialog-select-file-COsv0m3J.js → dialog-select-file-C6OgEt-4.js} +1 -1
  35. package/assets/assets/{dialog-select-mcp-B96RaTdf.js → dialog-select-mcp-i9ekbeFg.js} +1 -1
  36. package/assets/assets/{dialog-select-model-unpaid-DEY-u5MJ.js → dialog-select-model-unpaid-BUicAlCy.js} +2 -2
  37. package/assets/assets/{dialog-select-provider-DpwHcs_z.js → dialog-select-provider-ChOqW068.js} +1 -1
  38. package/assets/assets/{dialog-select-server-uqL2WKd-.js → dialog-select-server-IGj0oeBZ.js} +1 -1
  39. package/assets/assets/{dialog-settings-CXEAJdw0.js → dialog-settings-dlh01Gq9.js} +1 -1
  40. package/assets/assets/{erDiagram-INFDFZHY-9Hmz-EGm.js → erDiagram-INFDFZHY-CgaYm1Ut.js} +1 -1
  41. package/assets/assets/{flowDiagram-PKNHOUZH-4kZKRPZR.js → flowDiagram-PKNHOUZH-BD7vkBL6.js} +1 -1
  42. package/assets/assets/{freemarker2-SvgbhnJ2.js → freemarker2-C3EFf35k.js} +1 -1
  43. package/assets/assets/{ganttDiagram-A5KZAMGK-DAqQvIYI.js → ganttDiagram-A5KZAMGK-BVGx-hXt.js} +1 -1
  44. package/assets/assets/{ghostty-web-DZbVeO6H.js → ghostty-web-ZMYXct3O.js} +1 -1
  45. package/assets/assets/{gitGraphDiagram-K3NZZRJ6-wnUF9rfV.js → gitGraphDiagram-K3NZZRJ6-bqQVO5VF.js} +1 -1
  46. package/assets/assets/{graph-k_yNWxmC.js → graph-rN3n_tM8.js} +1 -1
  47. package/assets/assets/{handlebars-B2ONVutZ.js → handlebars-CA6b5iLA.js} +1 -1
  48. package/assets/assets/{home-M9U5I_mN.js → home-DQqU5LMI.js} +1 -1
  49. package/assets/assets/{html-DmnoTn9a.js → html-DANgOdjw.js} +1 -1
  50. package/assets/assets/{htmlMode-COQ2FePW.js → htmlMode-DLHwAZ7J.js} +1 -1
  51. package/assets/assets/{index-9S5eLovl.css → index-DaZ5Dq2D.css} +1 -1
  52. package/assets/assets/{index-Ck426Hvx.js → index-ktyB78JM.js} +10 -10
  53. package/assets/assets/{infoDiagram-LFFYTUFH-Cq59-9s7.js → infoDiagram-LFFYTUFH-Bq0n-WPV.js} +1 -1
  54. package/assets/assets/{ishikawaDiagram-PHBUUO56-BohmBc5G.js → ishikawaDiagram-PHBUUO56-BzqmpoR3.js} +1 -1
  55. package/assets/assets/{javascript-0JqfZ-ZK.js → javascript-D1un54bB.js} +1 -1
  56. package/assets/assets/{journeyDiagram-4ABVD52K-CPHl3wPm.js → journeyDiagram-4ABVD52K-CtuafHWl.js} +1 -1
  57. package/assets/assets/{jsonMode-BZ4_MoUH.js → jsonMode-DaNJis_I.js} +1 -1
  58. package/assets/assets/{kanban-definition-K7BYSVSG-DUTAJe6Q.js → kanban-definition-K7BYSVSG-CbhMWmZB.js} +1 -1
  59. package/assets/assets/{layout-BvYQlcGB.js → layout-BRnt9pje.js} +1 -1
  60. package/assets/assets/{liquid-DL0F7vFb.js → liquid-DthIi4mI.js} +1 -1
  61. package/assets/assets/{list-ChIlMjYm.js → list-Cn1A65j_.js} +1 -1
  62. package/assets/assets/{mdx-BTXLl_TQ.js → mdx-NVm6QFMK.js} +1 -1
  63. package/assets/assets/{mermaid.core-8TjZbLRD.js → mermaid.core-D4lf0itM.js} +5 -5
  64. package/assets/assets/{mindmap-definition-YRQLILUH-C6lKdbbb.js → mindmap-definition-YRQLILUH-x0uWdnSF.js} +1 -1
  65. package/assets/assets/{model-viewer-CeIucdad.js → model-viewer-DQKqNitV.js} +1 -1
  66. package/assets/assets/{pieDiagram-SKSYHLDU-DozGYWW7.js → pieDiagram-SKSYHLDU-CCqy1yNp.js} +1 -1
  67. package/assets/assets/{python-BTFINbZn.js → python-CFkmznMB.js} +1 -1
  68. package/assets/assets/{quadrantDiagram-337W2JSQ-dUO9Q20A.js → quadrantDiagram-337W2JSQ-DpbqnjEI.js} +1 -1
  69. package/assets/assets/{razor-BvR9Hnqa.js → razor-BUbreB_f.js} +1 -1
  70. package/assets/assets/{requirementDiagram-Z7DCOOCP-K8_TdzHK.js → requirementDiagram-Z7DCOOCP-CHi2-yHE.js} +1 -1
  71. package/assets/assets/{sankeyDiagram-WA2Y5GQK-BstnZ38B.js → sankeyDiagram-WA2Y5GQK-BbBMz53z.js} +1 -1
  72. package/assets/assets/{select-D2r3Hs22.js → select-DbfEu79O.js} +1 -1
  73. package/assets/assets/{sequenceDiagram-2WXFIKYE-Cn6skN5F.js → sequenceDiagram-2WXFIKYE-qFI6ylei.js} +1 -1
  74. package/assets/assets/{server-row-BwUYMVVB.js → server-row-CAmtE730.js} +1 -1
  75. package/assets/assets/{session-CU929GsB.js → session-C1XEMwgd.js} +27 -27
  76. package/assets/assets/{stateDiagram-RAJIS63D-B-iHRuam.js → stateDiagram-RAJIS63D-B-gX5_BJ.js} +1 -1
  77. package/assets/assets/stateDiagram-v2-FVOUBMTO-DAQB75zA.js +1 -0
  78. package/assets/assets/{status-popover-body-CHGxemen.js → status-popover-body-D5MCY-7T.js} +2 -2
  79. package/assets/assets/{switch-mNVnqcUl.js → switch-BfLax8_E.js} +1 -1
  80. package/assets/assets/{tag-3NQn3mEK.js → tag-ypP1V1Mn.js} +1 -1
  81. package/assets/assets/{timeline-definition-YZTLITO2-C3Q6oQ9i.js → timeline-definition-YZTLITO2-C9_m7jc1.js} +1 -1
  82. package/assets/assets/{treemap-KZPCXAKY-D3fK9Jyz.js → treemap-KZPCXAKY-BvLxBzLa.js} +1 -1
  83. package/assets/assets/{trellis-badge-demo-CNkMd4YG.js → trellis-badge-demo-C1blrToc.js} +1 -1
  84. package/assets/assets/{tsMode-CxEfAf9Z.js → tsMode-CNRtPSwc.js} +1 -1
  85. package/assets/assets/{typescript-I4Xe9fRj.js → typescript-DjKIL5Ul.js} +1 -1
  86. package/assets/assets/{vennDiagram-LZ73GAT5-Cx1RzW9o.js → vennDiagram-LZ73GAT5-CcB9iUby.js} +1 -1
  87. package/assets/assets/{xlsx-editor-BURweVsy.js → xlsx-editor-C0sY6EGV.js} +1 -1
  88. package/assets/assets/{xml-Z8-6vgF3.js → xml-8Tvr_clo.js} +1 -1
  89. package/assets/assets/{xychartDiagram-JWTSCODW-BWNqIjxZ.js → xychartDiagram-JWTSCODW-B6v7UlMZ.js} +1 -1
  90. package/assets/assets/{yaml-CfXlO5Lk.js → yaml-DYku7XRU.js} +1 -1
  91. package/assets/index.html +2 -2
  92. package/package.json +13 -13
  93. package/assets/assets/channel-B5ZdBKid.js +0 -1
  94. package/assets/assets/classDiagram-VBA2DB6C-B_GKGoPY.js +0 -1
  95. package/assets/assets/classDiagram-v2-RAHNMMFH-B_GKGoPY.js +0 -1
  96. package/assets/assets/clone-Dq4a-r80.js +0 -1
  97. package/assets/assets/stateDiagram-v2-FVOUBMTO-DBUaNCVy.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-DVc8C-J4.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-BZjJHVRy.js","assets/fortran-free-form-D22FLkUw.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-C8NyazO9.js","assets/r-DiinP2Uv.js","assets/latex-BdAV_C_H.js","assets/tex-CxkMU7Pf.js","assets/liquid-DYVedYrR.js","assets/marko-CPi9NSCl.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-CE9lU5zL.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-3Dk4HxPD.js","assets/templ-W15q3VgB.js","assets/go-Dn2_MT6a.js","assets/ts-tags-zn1MmPIZ.js","assets/twig-CO9l9SDP.js","assets/vue-DnHKYNfI.js","assets/vue-html-CChd_i61.js","assets/vue-vine-8moa0y9V.js","assets/stylus-BEDo0Tqx.js","assets/xsl-CtQFsRM5.js","assets/mermaid.core-8TjZbLRD.js","assets/transform-BwXaE9hv.js","assets/javascript-0JqfZ-ZK.js","assets/typescript-I4Xe9fRj.js","assets/dialog-settings-CXEAJdw0.js","assets/select-D2r3Hs22.js","assets/list-ChIlMjYm.js","assets/switch-mNVnqcUl.js","assets/dialog-connect-provider-B0LPEC99.js","assets/tag-3NQn3mEK.js","assets/dialog-select-provider-DpwHcs_z.js","assets/dialog-select-server-uqL2WKd-.js","assets/server-row-BwUYMVVB.js","assets/dialog-select-directory-CjI5IZBg.js","assets/home-M9U5I_mN.js","assets/dialog-create-project-DgZYKQLe.js","assets/session-CU929GsB.js","assets/session-DUC9Epge.css"])))=>i.map(i=>d[i]);
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-DVc8C-J4.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-BZjJHVRy.js","assets/fortran-free-form-D22FLkUw.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-C8NyazO9.js","assets/r-DiinP2Uv.js","assets/latex-BdAV_C_H.js","assets/tex-CxkMU7Pf.js","assets/liquid-DYVedYrR.js","assets/marko-CPi9NSCl.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-CE9lU5zL.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-3Dk4HxPD.js","assets/templ-W15q3VgB.js","assets/go-Dn2_MT6a.js","assets/ts-tags-zn1MmPIZ.js","assets/twig-CO9l9SDP.js","assets/vue-DnHKYNfI.js","assets/vue-html-CChd_i61.js","assets/vue-vine-8moa0y9V.js","assets/stylus-BEDo0Tqx.js","assets/xsl-CtQFsRM5.js","assets/mermaid.core-D4lf0itM.js","assets/transform-BwXaE9hv.js","assets/javascript-D1un54bB.js","assets/typescript-DjKIL5Ul.js","assets/dialog-settings-dlh01Gq9.js","assets/select-DbfEu79O.js","assets/list-Cn1A65j_.js","assets/switch-BfLax8_E.js","assets/dialog-connect-provider-Dn7ai2HO.js","assets/tag-ypP1V1Mn.js","assets/dialog-select-provider-ChOqW068.js","assets/dialog-select-server-IGj0oeBZ.js","assets/server-row-CAmtE730.js","assets/dialog-select-directory-DbmMIanK.js","assets/home-DQqU5LMI.js","assets/dialog-create-project-umYA5dgr.js","assets/session-C1XEMwgd.js","assets/session-DUC9Epge.css"])))=>i.map(i=>d[i]);
2
2
  (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&i(s)}).observe(document,{childList:!0,subtree:!0});function t(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(r){if(r.ep)return;r.ep=!0;const o=t(r);fetch(r.href,o)}})();const Wt={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return qke(this.context.count)},getNextContextId(){return qke(this.context.count++)}};function qke(n){const e=String(n),t=e.length-1;return Wt.context.id+(t?String.fromCharCode(96+t):"")+e}function C0(n){Wt.context=n}const hRe=!1,fst=(n,e)=>n===e,Ud=Symbol("solid-proxy"),fRe=typeof Proxy=="function",Jte=Symbol("solid-track"),Qte={equals:fst};let BC=null,pRe=yRe;const O1=1,Kb=2,gRe={owned:null,cleanups:null,context:null,owner:null},Hce={};var Dn=null;let St=null,pst=null,ir=null,el=null,ta=null,ise=0;function sa(n,e){const t=ir,i=Dn,r=n.length===0,o=e===void 0?i:e,s=r?gRe:{owned:null,cleanups:null,context:o?o.context:null,owner:o},a=r?n:()=>n(()=>Mn(()=>Bf(s)));Dn=s,ir=null;try{return zc(a,!0)}finally{ir=t,Dn=i}}function Ye(n,e){e=e?Object.assign({},Qte,e):Qte;const t={value:n,observers:null,observerSlots:null,comparator:e.equals||void 0},i=r=>(typeof r=="function"&&(St&&St.running&&St.sources.has(t)?r=r(t.tValue):r=r(t.value)),vRe(t,r));return[mRe.bind(t),i]}function Gb(n,e,t){const i=O_(n,e,!0,O1);ry(i)}function st(n,e,t){const i=O_(n,e,!1,O1);ry(i)}function Re(n,e,t){pRe=bst;const i=O_(n,e,!1,O1),r=S6&&Wn(S6);r&&(i.suspense=r),(!t||!t.render)&&(i.user=!0),ta?ta.push(i):ry(i)}function J(n,e,t){t=t?Object.assign({},Qte,t):Qte;const i=O_(n,e,!0,0);return i.observers=null,i.observerSlots=null,i.comparator=t.equals||void 0,ry(i),mRe.bind(i)}function gst(n){return n&&typeof n=="object"&&"then"in n}function mo(n,e,t){let i,r,o;typeof e=="function"?(i=n,r=e,o=t||{}):(i=!0,r=n,o=e||{});let s=null,a=Hce,l=null,c=!1,d=!1,u="initialValue"in o,h=typeof i=="function"&&J(i);const f=new Set,[p,g]=(o.storage||Ye)(o.initialValue),[v,y]=Ye(void 0),[C,_]=Ye(void 0,{equals:!1}),[w,x]=Ye(u?"ready":"unresolved");Wt.context&&(l=Wt.getNextContextId(),o.ssrLoadFrom==="initial"?a=o.initialValue:Wt.load&&Wt.has(l)&&(a=Wt.load(l)));function M(A,T,D,R){return s===A&&(s=null,R!==void 0&&(u=!0),(A===a||T===a)&&o.onHydrated&&queueMicrotask(()=>o.onHydrated(R,{value:T})),a=Hce,St&&A&&c?(St.promises.delete(A),c=!1,zc(()=>{St.running=!0,L(T,D)},!1)):L(T,D)),T}function L(A,T){zc(()=>{T===void 0&&g(()=>A),x(T!==void 0?"errored":u?"ready":"unresolved"),y(T);for(const D of f.keys())D.decrement();f.clear()},!1)}function S(){const A=S6&&Wn(S6),T=p(),D=v();if(D!==void 0&&!s)throw D;return ir&&!ir.user&&A&&Gb(()=>{C(),s&&(A.resolved&&St&&c?St.promises.add(s):f.has(A)||(A.increment(),f.add(A)))}),T}function I(A=!0){if(A!==!1&&d)return;d=!1;const T=h?h():i;if(c=St&&St.running,T==null||T===!1){M(s,Mn(p));return}St&&s&&St.promises.delete(s);let D;const R=a!==Hce?a:Mn(()=>{try{return r(T,{value:p(),refetching:A})}catch(P){D=P}});if(D!==void 0){M(s,void 0,PL(D),T);return}else if(!gst(R))return M(s,R,void 0,T),R;return s=R,"v"in R?(R.s===1?M(s,R.v,void 0,T):M(s,void 0,PL(R.v),T),R):(d=!0,queueMicrotask(()=>d=!1),zc(()=>{x(u?"refreshing":"pending"),_()},!1),R.then(P=>M(R,P,void 0,T),P=>M(R,void 0,PL(P),T)))}Object.defineProperties(S,{state:{get:()=>w()},error:{get:()=>v()},loading:{get(){const A=w();return A==="pending"||A==="refreshing"}},latest:{get(){if(!u)return S();const A=v();if(A&&!s)throw A;return p()}}});let E=Dn;return h?Gb(()=>(E=Dn,I(!1))):I(!1),[S,{refetch:A=>b0(E,()=>I(A)),mutate:g}]}function pn(n){return zc(n,!1)}function Mn(n){if(ir===null)return n();const e=ir;ir=null;try{return n()}finally{ir=e}}function Mr(n,e,t){const i=Array.isArray(n);let r,o=t&&t.defer;return s=>{let a;if(i){a=Array(n.length);for(let c=0;c<n.length;c++)a[c]=n[c]()}else a=n();if(o)return o=!1,s;const l=Mn(()=>e(a,r,s));return r=a,l}}function ur(n){Re(()=>Mn(n))}function Oe(n){return Dn===null||(Dn.cleanups===null?Dn.cleanups=[n]:Dn.cleanups.push(n)),n}function mst(n,e){BC||(BC=Symbol("error")),Dn=O_(void 0,void 0,!0),Dn.context={...Dn.context,[BC]:[e]},St&&St.running&&St.sources.add(Dn);try{return n()}catch(t){V_(t)}finally{Dn=Dn.owner}}function Uhe(){return ir}function Zd(){return Dn}function b0(n,e){const t=Dn,i=ir;Dn=n,ir=null;try{return zc(e,!0)}catch(r){V_(r)}finally{Dn=t,ir=i}}function vst(n){if(St&&St.running)return n(),St.done;const e=ir,t=Dn;return Promise.resolve().then(()=>{ir=e,Dn=t;let i;return S6&&(i=St||(St={sources:new Set,effects:[],promises:new Set,disposed:new Set,queue:new Set,running:!0}),i.done||(i.done=new Promise(r=>i.resolve=r)),i.running=!0),zc(n,!1),ir=Dn=null,i?i.done:void 0})}const[_3i,Uke]=Ye(!1);function yst(n){ta.push.apply(ta,n),n.length=0}function oi(n,e){const t=Symbol("context");return{id:t,Provider:wst(t),defaultValue:n}}function Wn(n){let e;return Dn&&Dn.context&&(e=Dn.context[n.id])!==void 0?e:n.defaultValue}function rse(n){const e=J(n),t=J(()=>Zhe(e()));return t.toArray=()=>{const i=t();return Array.isArray(i)?i:i!=null?[i]:[]},t}let S6;function kst(){return S6||(S6=oi())}function mRe(){const n=St&&St.running;if(this.sources&&(n?this.tState:this.state))if((n?this.tState:this.state)===O1)ry(this);else{const e=el;el=null,zc(()=>tne(this),!1),el=e}if(ir){const e=this.observers?this.observers.length:0;ir.sources?(ir.sources.push(this),ir.sourceSlots.push(e)):(ir.sources=[this],ir.sourceSlots=[e]),this.observers?(this.observers.push(ir),this.observerSlots.push(ir.sources.length-1)):(this.observers=[ir],this.observerSlots=[ir.sources.length-1])}return n&&St.sources.has(this)?this.tValue:this.value}function vRe(n,e,t){let i=St&&St.running&&St.sources.has(n)?n.tValue:n.value;if(!n.comparator||!n.comparator(i,e)){if(St){const r=St.running;(r||!t&&St.sources.has(n))&&(St.sources.add(n),n.tValue=e),r||(n.value=e)}else n.value=e;n.observers&&n.observers.length&&zc(()=>{for(let r=0;r<n.observers.length;r+=1){const o=n.observers[r],s=St&&St.running;s&&St.disposed.has(o)||((s?!o.tState:!o.state)&&(o.pure?el.push(o):ta.push(o),o.observers&&kRe(o)),s?o.tState=O1:o.state=O1)}if(el.length>1e6)throw el=[],new Error},!1)}return e}function ry(n){if(!n.fn)return;Bf(n);const e=ise;Zke(n,St&&St.running&&St.sources.has(n)?n.tValue:n.value,e),St&&!St.running&&St.sources.has(n)&&queueMicrotask(()=>{zc(()=>{St&&(St.running=!0),ir=Dn=n,Zke(n,n.tValue,e),ir=Dn=null},!1)})}function Zke(n,e,t){let i;const r=Dn,o=ir;ir=Dn=n;try{i=n.fn(e)}catch(s){return n.pure&&(St&&St.running?(n.tState=O1,n.tOwned&&n.tOwned.forEach(Bf),n.tOwned=void 0):(n.state=O1,n.owned&&n.owned.forEach(Bf),n.owned=null)),n.updatedAt=t+1,V_(s)}finally{ir=o,Dn=r}(!n.updatedAt||n.updatedAt<=t)&&(n.updatedAt!=null&&"observers"in n?vRe(n,i,!0):St&&St.running&&n.pure?(St.sources.has(n)||(n.value=i),St.sources.add(n),n.tValue=i):n.value=i,n.updatedAt=t)}function O_(n,e,t,i=O1,r){const o={fn:n,state:i,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:e,owner:Dn,context:Dn?Dn.context:null,pure:t};return St&&St.running&&(o.state=0,o.tState=i),Dn===null||Dn!==gRe&&(St&&St.running&&Dn.pure?Dn.tOwned?Dn.tOwned.push(o):Dn.tOwned=[o]:Dn.owned?Dn.owned.push(o):Dn.owned=[o]),o}function ene(n){const e=St&&St.running;if((e?n.tState:n.state)===0)return;if((e?n.tState:n.state)===Kb)return tne(n);if(n.suspense&&Mn(n.suspense.inFallback))return n.suspense.effects.push(n);const t=[n];for(;(n=n.owner)&&(!n.updatedAt||n.updatedAt<ise);){if(e&&St.disposed.has(n))return;(e?n.tState:n.state)&&t.push(n)}for(let i=t.length-1;i>=0;i--){if(n=t[i],e){let r=n,o=t[i+1];for(;(r=r.owner)&&r!==o;)if(St.disposed.has(r))return}if((e?n.tState:n.state)===O1)ry(n);else if((e?n.tState:n.state)===Kb){const r=el;el=null,zc(()=>tne(n,t[0]),!1),el=r}}}function zc(n,e){if(el)return n();let t=!1;e||(el=[]),ta?t=!0:ta=[],ise++;try{const i=n();return Cst(t),i}catch(i){t||(ta=null),el=null,V_(i)}}function Cst(n){if(el&&(yRe(el),el=null),n)return;let e;if(St){if(!St.promises.size&&!St.queue.size){const i=St.sources,r=St.disposed;ta.push.apply(ta,St.effects),e=St.resolve;for(const o of ta)"tState"in o&&(o.state=o.tState),delete o.tState;St=null,zc(()=>{for(const o of r)Bf(o);for(const o of i){if(o.value=o.tValue,o.owned)for(let s=0,a=o.owned.length;s<a;s++)Bf(o.owned[s]);o.tOwned&&(o.owned=o.tOwned),delete o.tValue,delete o.tOwned,o.tState=0}Uke(!1)},!1)}else if(St.running){St.running=!1,St.effects.push.apply(St.effects,ta),ta=null,Uke(!0);return}}const t=ta;ta=null,t.length&&zc(()=>pRe(t),!1),e&&e()}function yRe(n){for(let e=0;e<n.length;e++)ene(n[e])}function bst(n){let e,t=0;for(e=0;e<n.length;e++){const i=n[e];i.user?n[t++]=i:ene(i)}if(Wt.context){if(Wt.count){Wt.effects||(Wt.effects=[]),Wt.effects.push(...n.slice(0,t));return}C0()}for(Wt.effects&&(Wt.done||!Wt.count)&&(n=[...Wt.effects,...n],t+=Wt.effects.length,delete Wt.effects),e=0;e<t;e++)ene(n[e])}function tne(n,e){const t=St&&St.running;t?n.tState=0:n.state=0;for(let i=0;i<n.sources.length;i+=1){const r=n.sources[i];if(r.sources){const o=t?r.tState:r.state;o===O1?r!==e&&(!r.updatedAt||r.updatedAt<ise)&&ene(r):o===Kb&&tne(r,e)}}}function kRe(n){const e=St&&St.running;for(let t=0;t<n.observers.length;t+=1){const i=n.observers[t];(e?!i.tState:!i.state)&&(e?i.tState=Kb:i.state=Kb,i.pure?el.push(i):ta.push(i),i.observers&&kRe(i))}}function Bf(n){let e;if(n.sources)for(;n.sources.length;){const t=n.sources.pop(),i=n.sourceSlots.pop(),r=t.observers;if(r&&r.length){const o=r.pop(),s=t.observerSlots.pop();i<r.length&&(o.sourceSlots[s]=i,r[i]=o,t.observerSlots[i]=s)}}if(n.tOwned){for(e=n.tOwned.length-1;e>=0;e--)Bf(n.tOwned[e]);delete n.tOwned}if(St&&St.running&&n.pure)CRe(n,!0);else if(n.owned){for(e=n.owned.length-1;e>=0;e--)Bf(n.owned[e]);n.owned=null}if(n.cleanups){for(e=n.cleanups.length-1;e>=0;e--)n.cleanups[e]();n.cleanups=null}St&&St.running?n.tState=0:n.state=0}function CRe(n,e){if(e||(n.tState=0,St.disposed.add(n)),n.owned)for(let t=0;t<n.owned.length;t++)CRe(n.owned[t])}function PL(n){return n instanceof Error?n:new Error(typeof n=="string"?n:"Unknown error",{cause:n})}function Kke(n,e,t){try{for(const i of e)i(n)}catch(i){V_(i,t&&t.owner||null)}}function V_(n,e=Dn){const t=BC&&e&&e.context&&e.context[BC],i=PL(n);if(!t)throw i;ta?ta.push({fn(){Kke(i,t,e)},state:O1}):Kke(i,t,e)}function Zhe(n){if(typeof n=="function"&&!n.length)return Zhe(n());if(Array.isArray(n)){const e=[];for(let t=0;t<n.length;t++){const i=Zhe(n[t]);Array.isArray(i)?e.push.apply(e,i):e.push(i)}return e}return n}function wst(n,e){return function(i){let r;return st(()=>r=Mn(()=>(Dn.context={...Dn.context,[n]:i.value},rse(()=>i.children))),void 0),r}}const Khe=Symbol("fallback");function nne(n){for(let e=0;e<n.length;e++)n[e]()}function _st(n,e,t={}){let i=[],r=[],o=[],s=0,a=e.length>1?[]:null;return Oe(()=>nne(o)),()=>{let l=n()||[],c=l.length,d,u;return l[Jte],Mn(()=>{let f,p,g,v,y,C,_,w,x;if(c===0)s!==0&&(nne(o),o=[],i=[],r=[],s=0,a&&(a=[])),t.fallback&&(i=[Khe],r[0]=sa(M=>(o[0]=M,t.fallback())),s=1);else if(s===0){for(r=new Array(c),u=0;u<c;u++)i[u]=l[u],r[u]=sa(h);s=c}else{for(g=new Array(c),v=new Array(c),a&&(y=new Array(c)),C=0,_=Math.min(s,c);C<_&&i[C]===l[C];C++);for(_=s-1,w=c-1;_>=C&&w>=C&&i[_]===l[w];_--,w--)g[w]=r[_],v[w]=o[_],a&&(y[w]=a[_]);for(f=new Map,p=new Array(w+1),u=w;u>=C;u--)x=l[u],d=f.get(x),p[u]=d===void 0?-1:d,f.set(x,u);for(d=C;d<=_;d++)x=i[d],u=f.get(x),u!==void 0&&u!==-1?(g[u]=r[d],v[u]=o[d],a&&(y[u]=a[d]),u=p[u],f.set(x,u)):o[d]();for(u=C;u<c;u++)u in g?(r[u]=g[u],o[u]=v[u],a&&(a[u]=y[u],a[u](u))):r[u]=sa(h);r=r.slice(0,s=c),i=l.slice(0)}return r});function h(f){if(o[u]=f,a){const[p,g]=Ye(u);return a[u]=g,e(l[u],p)}return e(l[u])}}}function xst(n,e,t={}){let i=[],r=[],o=[],s=[],a=0,l;return Oe(()=>nne(o)),()=>{const c=n()||[],d=c.length;return c[Jte],Mn(()=>{if(d===0)return a!==0&&(nne(o),o=[],i=[],r=[],a=0,s=[]),t.fallback&&(i=[Khe],r[0]=sa(h=>(o[0]=h,t.fallback())),a=1),r;for(i[0]===Khe&&(o[0](),o=[],i=[],r=[],a=0),l=0;l<d;l++)l<i.length&&i[l]!==c[l]?s[l](()=>c[l]):l>=i.length&&(r[l]=sa(u));for(;l<i.length;l++)o[l]();return a=s.length=o.length=d,i=c.slice(0),r=r.slice(0,a)});function u(h){o[l]=h;const[f,p]=Ye(c[l]);return s[l]=p,e(f,l)}}}function m(n,e){return Mn(()=>n(e||{}))}function aS(){return!0}const Ghe={get(n,e,t){return e===Ud?t:n.get(e)},has(n,e){return e===Ud?!0:n.has(e)},set:aS,deleteProperty:aS,getOwnPropertyDescriptor(n,e){return{configurable:!0,enumerable:!0,get(){return n.get(e)},set:aS,deleteProperty:aS}},ownKeys(n){return n.keys()}};function $ce(n){return(n=typeof n=="function"?n():n)?n:{}}function Sst(){for(let n=0,e=this.length;n<e;++n){const t=this[n]();if(t!==void 0)return t}}function k(...n){let e=!1;for(let s=0;s<n.length;s++){const a=n[s];e=e||!!a&&Ud in a,n[s]=typeof a=="function"?(e=!0,J(a)):a}if(fRe&&e)return new Proxy({get(s){for(let a=n.length-1;a>=0;a--){const l=$ce(n[a])[s];if(l!==void 0)return l}},has(s){for(let a=n.length-1;a>=0;a--)if(s in $ce(n[a]))return!0;return!1},keys(){const s=[];for(let a=0;a<n.length;a++)s.push(...Object.keys($ce(n[a])));return[...new Set(s)]}},Ghe);const t={},i=Object.create(null);for(let s=n.length-1;s>=0;s--){const a=n[s];if(!a)continue;const l=Object.getOwnPropertyNames(a);for(let c=l.length-1;c>=0;c--){const d=l[c];if(d==="__proto__"||d==="constructor")continue;const u=Object.getOwnPropertyDescriptor(a,d);if(!i[d])i[d]=u.get?{enumerable:!0,configurable:!0,get:Sst.bind(t[d]=[u.get.bind(a)])}:u.value!==void 0?u:void 0;else{const h=t[d];h&&(u.get?h.push(u.get.bind(a)):u.value!==void 0&&h.push(()=>u.value))}}}const r={},o=Object.keys(i);for(let s=o.length-1;s>=0;s--){const a=o[s],l=i[a];l&&l.get?Object.defineProperty(r,a,l):r[a]=l?l.value:void 0}return r}function Je(n,...e){const t=e.length;if(fRe&&Ud in n){const r=t>1?e.flat():e[0],o=e.map(s=>new Proxy({get(a){return s.includes(a)?n[a]:void 0},has(a){return s.includes(a)&&a in n},keys(){return s.filter(a=>a in n)}},Ghe));return o.push(new Proxy({get(s){return r.includes(s)?void 0:n[s]},has(s){return r.includes(s)?!1:s in n},keys(){return Object.keys(n).filter(s=>!r.includes(s))}},Ghe)),o}const i=[];for(let r=0;r<=t;r++)i[r]={};for(const r of Object.getOwnPropertyNames(n)){let o=t;for(let l=0;l<e.length;l++)if(e[l].includes(r)){o=l;break}const s=Object.getOwnPropertyDescriptor(n,r);!s.get&&!s.set&&s.enumerable&&s.writable&&s.configurable?i[o][r]=s.value:Object.defineProperty(i[o],r,s)}return i}function ose(n){let e,t;const i=r=>{const o=Wt.context;if(o){const[a,l]=Ye();Wt.count||(Wt.count=0),Wt.count++,(t||(t=n())).then(c=>{!Wt.done&&C0(o),Wt.count--,l(()=>c.default),C0()}),e=a}else if(!e){const[a]=mo(()=>(t||(t=n())).then(l=>l.default));e=a}let s;return J(()=>(s=e())?Mn(()=>{if(!o||Wt.done)return s(r);const a=Wt.context;C0(o);const l=s(r);return C0(a),l}):"")};return i.preload=()=>t||((t=n()).then(r=>e=()=>r.default),t),i}let Mst=0;function $s(){return Wt.context?Wt.getNextContextId():`cl-${Mst++}`}const bRe=n=>`Stale read from <${n}>.`;function ei(n){const e="fallback"in n&&{fallback:()=>n.fallback};return J(_st(()=>n.each,n.children,e||void 0))}function x3i(n){const e="fallback"in n&&{fallback:()=>n.fallback};return J(xst(()=>n.each,n.children,e||void 0))}function _e(n){const e=n.keyed,t=J(()=>n.when,void 0,void 0),i=e?t:J(t,void 0,{equals:(r,o)=>!r==!o});return J(()=>{const r=i();if(r){const o=n.children;return typeof o=="function"&&o.length>0?Mn(()=>o(e?r:()=>{if(!Mn(i))throw bRe("Show");return t()})):o}return n.fallback},void 0,void 0)}function V1(n){const e=rse(()=>n.children),t=J(()=>{const i=e(),r=Array.isArray(i)?i:[i];let o=()=>{};for(let s=0;s<r.length;s++){const a=s,l=r[s],c=o,d=J(()=>c()?void 0:l.when,void 0,void 0),u=l.keyed?d:J(d,void 0,{equals:(h,f)=>!h==!f});o=()=>c()||(u()?[a,d,l]:void 0)}return o});return J(()=>{const i=t()();if(!i)return n.fallback;const[r,o,s]=i,a=s.children;return typeof a=="function"&&a.length>0?Mn(()=>a(s.keyed?o():()=>{if(Mn(t)()?.[0]!==r)throw bRe("Match");return o()})):a},void 0,void 0)}function fi(n){return n}let B8;function Lst(){B8&&[...B8].forEach(n=>n())}function Ist(n){let e;Wt.context&&Wt.load&&(e=Wt.load(Wt.getContextId()));const[t,i]=Ye(e,void 0);return B8||(B8=new Set),B8.add(i),Oe(()=>B8.delete(i)),J(()=>{let r;if(r=t()){const o=n.fallback;return typeof o=="function"&&o.length?Mn(()=>o(r,()=>i())):o}return mst(()=>n.children,i)},void 0,void 0)}const Nst=oi();function Est(n){let e=0,t,i,r,o,s;const[a,l]=Ye(!1),c=kst(),d={increment:()=>{++e===1&&l(!0)},decrement:()=>{--e===0&&l(!1)},inFallback:a,effects:[],resolved:!1},u=Zd();if(Wt.context&&Wt.load){const p=Wt.getContextId();let g=Wt.load(p);if(g&&(typeof g!="object"||g.s!==1?r=g:Wt.gather(p)),r&&r!=="$$f"){const[v,y]=Ye(void 0,{equals:!1});o=v,r.then(()=>{if(Wt.done)return y();Wt.gather(p),C0(i),y(),C0()},C=>{s=C,y()})}}const h=Wn(Nst);h&&(t=h.register(d.inFallback));let f;return Oe(()=>f&&f()),m(c.Provider,{value:d,get children(){return J(()=>{if(s)throw s;if(i=Wt.context,o)return o(),o=void 0;i&&r==="$$f"&&C0();const p=J(()=>n.children);return J(g=>{const v=d.inFallback(),{showContent:y=!0,showFallback:C=!0}=t?t():{};if((!v||r&&r!=="$$f")&&y)return d.resolved=!0,f&&f(),f=i=r=void 0,yst(d.effects),p();if(C)return f?g:sa(_=>(f=_,i&&(C0({id:i.id+"F",count:0}),i=void 0),n.fallback),u)})})}})}const Tst=["allowfullscreen","async","alpha","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","adauctionheaders","browsingtopics","credentialless","defaultchecked","defaultmuted","defaultselected","defer","disablepictureinpicture","disableremoteplayback","preservespitch","shadowrootclonable","shadowrootcustomelementregistry","shadowrootdelegatesfocus","shadowrootserializable","sharedstoragewritable"],Ast=new Set(["className","value","readOnly","noValidate","formNoValidate","isMap","noModule","playsInline","adAuctionHeaders","allowFullscreen","browsingTopics","defaultChecked","defaultMuted","defaultSelected","disablePictureInPicture","disableRemotePlayback","preservesPitch","shadowRootClonable","shadowRootCustomElementRegistry","shadowRootDelegatesFocus","shadowRootSerializable","sharedStorageWritable",...Tst]),Dst=new Set(["innerHTML","textContent","innerText","children"]),Rst=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),Pst=Object.assign(Object.create(null),{class:"className",novalidate:{$:"noValidate",FORM:1},formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1},adauctionheaders:{$:"adAuctionHeaders",IFRAME:1},allowfullscreen:{$:"allowFullscreen",IFRAME:1},browsingtopics:{$:"browsingTopics",IMG:1},defaultchecked:{$:"defaultChecked",INPUT:1},defaultmuted:{$:"defaultMuted",AUDIO:1,VIDEO:1},defaultselected:{$:"defaultSelected",OPTION:1},disablepictureinpicture:{$:"disablePictureInPicture",VIDEO:1},disableremoteplayback:{$:"disableRemotePlayback",AUDIO:1,VIDEO:1},preservespitch:{$:"preservesPitch",AUDIO:1,VIDEO:1},shadowrootclonable:{$:"shadowRootClonable",TEMPLATE:1},shadowrootdelegatesfocus:{$:"shadowRootDelegatesFocus",TEMPLATE:1},shadowrootserializable:{$:"shadowRootSerializable",TEMPLATE:1},sharedstoragewritable:{$:"sharedStorageWritable",IFRAME:1,IMG:1}});function Ost(n,e){const t=Pst[n];return typeof t=="object"?t[e]?t.$:void 0:t}const Vst=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),Hst=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),$st={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},sn=n=>J(()=>n());function Fst(n,e,t){let i=t.length,r=e.length,o=i,s=0,a=0,l=e[r-1].nextSibling,c=null;for(;s<r||a<o;){if(e[s]===t[a]){s++,a++;continue}for(;e[r-1]===t[o-1];)r--,o--;if(r===s){const d=o<i?a?t[a-1].nextSibling:t[o-a]:l;for(;a<o;)n.insertBefore(t[a++],d)}else if(o===a)for(;s<r;)(!c||!c.has(e[s]))&&e[s].remove(),s++;else if(e[s]===t[o-1]&&t[a]===e[r-1]){const d=e[--r].nextSibling;n.insertBefore(t[a++],e[s++].nextSibling),n.insertBefore(t[--o],d),e[r]=t[o]}else{if(!c){c=new Map;let u=a;for(;u<o;)c.set(t[u],u++)}const d=c.get(e[s]);if(d!=null)if(a<d&&d<o){let u=s,h=1,f;for(;++u<r&&u<o&&!((f=c.get(e[u]))==null||f!==d+h);)h++;if(h>d-a){const p=e[s];for(;a<d;)n.insertBefore(t[a++],p)}else n.replaceChild(t[a++],e[s++])}else s++;else e[s++].remove()}}}const Gke="_$DX_DELEGATE";function zst(n,e,t,i={}){let r;return sa(o=>{r=o,e===document?n():W(e,n(),e.firstChild?null:void 0,t)},i.owner),()=>{r(),e.textContent=""}}function le(n,e,t,i){let r;const o=()=>{const a=i?document.createElementNS("http://www.w3.org/1998/Math/MathML","template"):document.createElement("template");return a.innerHTML=n,t?a.content.firstChild.firstChild:i?a.firstChild:a.content.firstChild},s=e?()=>Mn(()=>document.importNode(r||(r=o()),!0)):()=>(r||(r=o())).cloneNode(!0);return s.cloneNode=s,s}function Fs(n,e=window.document){const t=e[Gke]||(e[Gke]=new Set);for(let i=0,r=n.length;i<r;i++){const o=n[i];t.has(o)||(t.add(o),e.addEventListener(o,Zst))}}function mt(n,e,t){c3(n)||(t==null?n.removeAttribute(e):n.setAttribute(e,t))}function Bst(n,e,t,i){c3(n)||(i==null?n.removeAttributeNS(e,t):n.setAttributeNS(e,t,i))}function jst(n,e,t){c3(n)||(t?n.setAttribute(e,""):n.removeAttribute(e))}function H1(n,e){c3(n)||(e==null?n.removeAttribute("class"):n.className=e)}function Ju(n,e,t,i){if(i)Array.isArray(t)?(n[`$$${e}`]=t[0],n[`$$${e}Data`]=t[1]):n[`$$${e}`]=t;else if(Array.isArray(t)){const r=t[0];n.addEventListener(e,t[0]=o=>r.call(n,t[1],o))}else n.addEventListener(e,t,typeof t!="function"&&t)}function Ko(n,e,t={}){const i=Object.keys(e||{}),r=Object.keys(t);let o,s;for(o=0,s=r.length;o<s;o++){const a=r[o];!a||a==="undefined"||e[a]||(Xke(n,a,!1),delete t[a])}for(o=0,s=i.length;o<s;o++){const a=i[o],l=!!e[a];!a||a==="undefined"||t[a]===l||!l||(Xke(n,a,!0),t[a]=l)}return t}function sse(n,e,t){if(!e)return t?mt(n,"style"):e;const i=n.style;if(typeof e=="string")return i.cssText=e;typeof t=="string"&&(i.cssText=t=void 0),t||(t={}),e||(e={});let r,o;for(o in t)e[o]==null&&i.removeProperty(o),delete t[o];for(o in e)r=e[o],r!==t[o]&&(i.setProperty(o,r),t[o]=r);return t}function Sr(n,e,t){t!=null?n.style.setProperty(e,t):n.style.removeProperty(e)}function El(n,e={},t,i){const r={};return i||st(()=>r.children=Xb(n,e.children,r.children)),st(()=>typeof e.ref=="function"&&aa(e.ref,n)),st(()=>Wst(n,e,t,!0,r,!0)),r}function aa(n,e,t){return Mn(()=>n(e,t))}function W(n,e,t,i){if(t!==void 0&&!i&&(i=[]),typeof e!="function")return Xb(n,e,i,t);st(r=>Xb(n,e(),r,t),i)}function Wst(n,e,t,i,r={},o=!1){e||(e={});for(const s in r)if(!(s in e)){if(s==="children")continue;r[s]=Yke(n,s,null,r[s],t,o,e)}for(const s in e){if(s==="children")continue;const a=e[s];r[s]=Yke(n,s,a,r[s],t,o,e)}}function qst(n){let e,t;return!c3()||!(e=Wt.registry.get(t=Kst()))?n():(Wt.completed&&Wt.completed.add(e),Wt.registry.delete(t),e)}function c3(n){return!!Wt.context&&!Wt.done&&(!n||n.isConnected)}function Ust(n){return n.toLowerCase().replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function Xke(n,e,t){const i=e.trim().split(/\s+/);for(let r=0,o=i.length;r<o;r++)n.classList.toggle(i[r],t)}function Yke(n,e,t,i,r,o,s){let a,l,c,d,u;if(e==="style")return sse(n,t,i);if(e==="classList")return Ko(n,t,i);if(t===i)return i;if(e==="ref")o||t(n);else if(e.slice(0,3)==="on:"){const h=e.slice(3);i&&n.removeEventListener(h,i,typeof i!="function"&&i),t&&n.addEventListener(h,t,typeof t!="function"&&t)}else if(e.slice(0,10)==="oncapture:"){const h=e.slice(10);i&&n.removeEventListener(h,i,!0),t&&n.addEventListener(h,t,!0)}else if(e.slice(0,2)==="on"){const h=e.slice(2).toLowerCase(),f=Vst.has(h);if(!f&&i){const p=Array.isArray(i)?i[0]:i;n.removeEventListener(h,p)}(f||t)&&(Ju(n,h,t,f),f&&Fs([h]))}else if(e.slice(0,5)==="attr:")mt(n,e.slice(5),t);else if(e.slice(0,5)==="bool:")jst(n,e.slice(5),t);else if((u=e.slice(0,5)==="prop:")||(c=Dst.has(e))||!r&&((d=Ost(e,n.tagName))||(l=Ast.has(e)))||(a=n.nodeName.includes("-")||"is"in s)){if(u)e=e.slice(5),l=!0;else if(c3(n))return t;e==="class"||e==="className"?H1(n,t):a&&!l&&!c?n[Ust(e)]=t:n[d||e]=t}else{const h=r&&e.indexOf(":")>-1&&$st[e.split(":")[0]];h?Bst(n,h,e,t):mt(n,Rst[e]||e,t)}return t}function Zst(n){if(Wt.registry&&Wt.events&&Wt.events.find(([l,c])=>c===n))return;let e=n.target;const t=`$$${n.type}`,i=n.target,r=n.currentTarget,o=l=>Object.defineProperty(n,"target",{configurable:!0,value:l}),s=()=>{const l=e[t];if(l&&!e.disabled){const c=e[`${t}Data`];if(c!==void 0?l.call(e,c,n):l.call(e,n),n.cancelBubble)return}return e.host&&typeof e.host!="string"&&!e.host._$host&&e.contains(n.target)&&o(e.host),!0},a=()=>{for(;s()&&(e=e._$host||e.parentNode||e.host););};if(Object.defineProperty(n,"currentTarget",{configurable:!0,get(){return e||document}}),Wt.registry&&!Wt.done&&(Wt.done=_$HY.done=!0),n.composedPath){const l=n.composedPath();o(l[0]);for(let c=0;c<l.length-2&&(e=l[c],!!s());c++){if(e._$host){e=e._$host,a();break}if(e.parentNode===r)break}}else a();o(i)}function Xb(n,e,t,i,r){const o=c3(n);if(o){!t&&(t=[...n.childNodes]);let l=[];for(let c=0;c<t.length;c++){const d=t[c];d.nodeType===8&&d.data.slice(0,2)==="!$"?d.remove():l.push(d)}t=l}for(;typeof t=="function";)t=t();if(e===t)return t;const s=typeof e,a=i!==void 0;if(n=a&&t[0]&&t[0].parentNode||n,s==="string"||s==="number"){if(o||s==="number"&&(e=e.toString(),e===t))return t;if(a){let l=t[0];l&&l.nodeType===3?l.data!==e&&(l.data=e):l=document.createTextNode(e),t=q3(n,t,i,l)}else t!==""&&typeof t=="string"?t=n.firstChild.data=e:t=n.textContent=e}else if(e==null||s==="boolean"){if(o)return t;t=q3(n,t,i)}else{if(s==="function")return st(()=>{let l=e();for(;typeof l=="function";)l=l();t=Xb(n,l,t,i)}),()=>t;if(Array.isArray(e)){const l=[],c=t&&Array.isArray(t);if(Xhe(l,e,t,r))return st(()=>t=Xb(n,l,t,i,!0)),()=>t;if(o){if(!l.length)return t;if(i===void 0)return t=[...n.childNodes];let d=l[0];if(d.parentNode!==n)return t;const u=[d];for(;(d=d.nextSibling)!==i;)u.push(d);return t=u}if(l.length===0){if(t=q3(n,t,i),a)return t}else c?t.length===0?Jke(n,l,i):Fst(n,t,l):(t&&q3(n),Jke(n,l));t=l}else if(e.nodeType){if(o&&e.parentNode)return t=a?[e]:e;if(Array.isArray(t)){if(a)return t=q3(n,t,i,e);q3(n,t,null,e)}else t==null||t===""||!n.firstChild?n.appendChild(e):n.replaceChild(e,n.firstChild);t=e}}return t}function Xhe(n,e,t,i){let r=!1;for(let o=0,s=e.length;o<s;o++){let a=e[o],l=t&&t[n.length],c;if(!(a==null||a===!0||a===!1))if((c=typeof a)=="object"&&a.nodeType)n.push(a);else if(Array.isArray(a))r=Xhe(n,a,l)||r;else if(c==="function")if(i){for(;typeof a=="function";)a=a();r=Xhe(n,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||r}else n.push(a),r=!0;else{const d=String(a);l&&l.nodeType===3&&l.data===d?n.push(l):n.push(document.createTextNode(d))}}return r}function Jke(n,e,t=null){for(let i=0,r=e.length;i<r;i++)n.insertBefore(e[i],t)}function q3(n,e,t,i){if(t===void 0)return n.textContent="";const r=i||document.createTextNode("");if(e.length){let o=!1;for(let s=e.length-1;s>=0;s--){const a=e[s];if(r!==a){const l=a.parentNode===n;!o&&!s?l?n.replaceChild(r,a):n.insertBefore(r,t):l&&a.remove()}else o=!0}}else n.insertBefore(r,t);return[r]}function Kst(){return Wt.getNextContextId()}const Gst=!1,Xst="http://www.w3.org/2000/svg";function wRe(n,e=!1,t=void 0){return e?document.createElementNS(Xst,n):document.createElement(n,{is:t})}function d3(n){const{useShadow:e}=n,t=document.createTextNode(""),i=()=>n.mount||document.body,r=Zd();let o,s=!!Wt.context;return Re(()=>{s&&(Zd().user=s=!1),o||(o=b0(r,()=>J(()=>n.children)));const a=i();if(a instanceof HTMLHeadElement){const[l,c]=Ye(!1),d=()=>c(!0);sa(u=>W(a,()=>l()?u():o(),null)),Oe(d)}else{const l=wRe(n.isSVG?"g":"div",n.isSVG),c=e&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return t.parentNode},configurable:!0}),W(c,o),a.appendChild(l),n.ref&&n.ref(l),Oe(()=>a.removeChild(l))}},void 0,{render:!s}),t}function Yst(n,e){const t=J(n);return J(()=>{const i=t();switch(typeof i){case"function":return Mn(()=>i(e));case"string":const r=Hst.has(i),o=Wt.context?qst():wRe(i,r,Mn(()=>e.is));return El(o,e,r),o}})}function ase(n){const[,e]=Je(n,["component"]);return Yst(()=>n.component,e)}const Jst="modulepreload",Qst=function(n){return"/"+n},Qke={},z=function(e,t,i){let r=Promise.resolve();if(t&&t.length>0){let l=function(c){return Promise.all(c.map(d=>Promise.resolve(d).then(u=>({status:"fulfilled",value:u}),u=>({status:"rejected",reason:u}))))};document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),a=s?.nonce||s?.getAttribute("nonce");r=l(t.map(c=>{if(c=Qst(c),c in Qke)return;Qke[c]=!0;const d=c.endsWith(".css"),u=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${u}`))return;const h=document.createElement("link");if(h.rel=d?"stylesheet":Jst,d||(h.as="script"),h.crossOrigin="",h.href=c,a&&h.setAttribute("nonce",a),document.head.appendChild(h),d)return new Promise((f,p)=>{h.addEventListener("load",f),h.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}function o(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return r.then(s=>{for(const a of s||[])a.status==="rejected"&&o(a.reason);return e().catch(o)})};function Jr(n){const e=oi();return{provider:t=>{const i=n.gate??!0,r=n.init(t);if(!i)return m(e.Provider,{value:r,get children(){return t.children}});const o=J(()=>{const s=r.ready;return s===void 0||(typeof s=="function"?s():s)});return m(_e,{get when(){return o()},get children(){return m(e.Provider,{value:r,get children(){return t.children}})}})},use(){const t=Wn(e);if(!t)throw new Error(`${n.name} context must be used within a context provider`);return t},useOptional(){return Wn(e)}}}const{use:_Re,provider:f5e}=Jr({name:"Data",init:n=>({get store(){return n.data},get directory(){return n.directory},get mediaUrl(){return n.mediaUrl},get mediaFetch(){return n.mediaFetch},navigateToSession:n.onNavigateToSession,sessionHref:n.onSessionHref})}),xRe=Jr({name:"FileComponent",init:n=>n.component}),eat=xRe.provider,S3i=xRe.use,tat=n=>n!=null,M3i=n=>n.filter(tat);function nat(n){return(...e)=>{for(const t of n)t&&t(...e)}}const Ze=n=>typeof n=="function"&&!n.length?n():n,eCe=n=>Array.isArray(n)?n:n?[n]:[];function iat(n,...e){return typeof n=="function"?n(...e):n}const p5e=Oe;function rat(n,e,t){if(Wt.context){const[i,r]=Ye(n,t);return ur(()=>r(()=>e())),[i,r]}return Ye(e(),t)}function L3i(n,e,t,i){const r=n.length,o=e.length;let s=0;if(!o){for(;s<r;s++)t(n[s]);return}if(!r){for(;s<o;s++)i(e[s]);return}for(;s<o&&e[s]===n[s];s++);let a,l;e=e.slice(s),n=n.slice(s);for(a of e)n.includes(a)||i(a);for(l of n)e.includes(l)||t(l)}function SRe(n,e,t,i){return n.addEventListener(e,t,i),p5e(n.removeEventListener.bind(n,e,t,i))}function oat(n,e,t,i){const r=()=>{eCe(Ze(n)).forEach(o=>{o&&eCe(Ze(e)).forEach(s=>SRe(o,s,t,i))})};typeof n=="function"?Re(r):st(r)}function sat(n,e=Zd()){let t=0,i,r;return()=>(t++,Oe(()=>{t--,queueMicrotask(()=>{!t&&r&&(r(),r=i=void 0)})}),r||sa(o=>i=n(r=o),e),i)}function aat(n){const e=Zd(),t=sat(n,e);return()=>Wt.context?sa(n,e):t()}function g5e(n,e=!1){const t=window.matchMedia(n),[i,r]=rat(e,()=>t.matches);return SRe(t,"change",()=>r(t.matches)),i}function lat(n){return g5e("(prefers-color-scheme: dark)",n)}lat.bind(void 0,!1);const cat=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function tCe(n){const e={};let t;for(;t=cat.exec(n);)e[t[1]]=t[2];return e}function su(n,e){if(typeof n=="string"){if(typeof e=="string")return`${n};${e}`;n=tCe(n)}else typeof e=="string"&&(e=tCe(e));return{...n,...e}}function qr(...n){return nat(n)}function dat(n,e,t=-1){return t in n?[...n.slice(0,t),e,...n.slice(t)]:[...n,e]}function Yhe(n,e){const t=[...n],i=t.indexOf(e);return i!==-1&&t.splice(i,1),t}function uat(n){return typeof n=="number"}function I8(n){return Object.prototype.toString.call(n)==="[object String]"}function MRe(n){return typeof n=="function"}function bh(n){return e=>`${n()}-${e}`}function hat(){const n=new Map,e=(r,o,s,a)=>{const l=a?.once?(...c)=>{n.delete(s),s(...c)}:s;n.set(s,{type:o,eventTarget:r,fn:l,options:a}),r.addEventListener(o,s,a)},t=(r,o,s,a)=>{const l=n.get(s)?.fn||s;r.removeEventListener(o,l,a),n.delete(s)},i=()=>{n.forEach((r,o)=>{t(r.eventTarget,r.type,o,r.options)})};return Oe(()=>{i()}),{addGlobalListener:e,removeGlobalListener:t,removeAllGlobalListeners:i}}function ps(n,e){return n?n===e||n.contains(e):!1}function rC(n,e=!1){const{activeElement:t}=Tl(n);if(!t?.nodeName)return null;if(LRe(t)&&t.contentDocument)return rC(t.contentDocument.body,e);if(e){const i=t.getAttribute("aria-activedescendant");if(i){const r=Tl(t).getElementById(i);if(r)return r}}return t}function m5e(n){return Tl(n).defaultView||window}function Tl(n){return n?n.ownerDocument||n:document}function LRe(n){return n.tagName==="IFRAME"}var IRe=(n=>(n.Escape="Escape",n.Enter="Enter",n.Tab="Tab",n.Space=" ",n.ArrowDown="ArrowDown",n.ArrowLeft="ArrowLeft",n.ArrowRight="ArrowRight",n.ArrowUp="ArrowUp",n.End="End",n.Home="Home",n.PageDown="PageDown",n.PageUp="PageUp",n))(IRe||{});function NRe(n){return typeof window>"u"||window.navigator==null?!1:window.navigator.userAgentData?.brands.some(e=>n.test(e.brand))||n.test(window.navigator.userAgent)}function v5e(n){return typeof window<"u"&&window.navigator!=null?n.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function lse(){return v5e(/^Mac/i)}function fat(){return v5e(/^iPhone/i)}function pat(){return v5e(/^iPad/i)||lse()&&navigator.maxTouchPoints>1}function gat(){return fat()||pat()}function mat(){return lse()||gat()}function I3i(){return NRe(/AppleWebKit/i)&&!vat()}function vat(){return NRe(/Chrome/i)}function In(n,e){return e&&(MRe(e)?e(n):e[0](e[1],n)),n?.defaultPrevented}function hs(n){return e=>{for(const t of n)In(e,t)}}function yat(n){return lse()?n.metaKey&&!n.ctrlKey:n.ctrlKey&&!n.metaKey}function Rs(n){if(n)if(kat())n.focus({preventScroll:!0});else{const e=Cat(n);n.focus(),bat(e)}}var lS=null;function kat(){if(lS==null){lS=!1;try{document.createElement("div").focus({get preventScroll(){return lS=!0,!0}})}catch{}}return lS}function Cat(n){let e=n.parentNode;const t=[],i=document.scrollingElement||document.documentElement;for(;e instanceof HTMLElement&&e!==i;)(e.offsetHeight<e.scrollHeight||e.offsetWidth<e.scrollWidth)&&t.push({element:e,scrollTop:e.scrollTop,scrollLeft:e.scrollLeft}),e=e.parentNode;return i instanceof HTMLElement&&t.push({element:i,scrollTop:i.scrollTop,scrollLeft:i.scrollLeft}),t}function bat(n){for(const{element:e,scrollTop:t,scrollLeft:i}of n)e.scrollTop=t,e.scrollLeft=i}var ERe=["input:not([type='hidden']):not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","[tabindex]","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"],wat=[...ERe,'[tabindex]:not([tabindex="-1"]):not([disabled])'],y5e=`${ERe.join(":not([hidden]),")},[tabindex]:not([disabled]):not([hidden])`,_at=wat.join(':not([hidden]):not([tabindex="-1"]),');function TRe(n,e){const i=Array.from(n.querySelectorAll(y5e)).filter(nCe);return e&&nCe(n)&&i.unshift(n),i.forEach((r,o)=>{if(LRe(r)&&r.contentDocument){const s=r.contentDocument.body,a=TRe(s,!1);i.splice(o,1,...a)}}),i}function nCe(n){return ARe(n)&&!xat(n)}function ARe(n){return n.matches(y5e)&&k5e(n)}function xat(n){return Number.parseInt(n.getAttribute("tabindex")||"0",10)<0}function k5e(n,e){return n.nodeName!=="#comment"&&Sat(n)&&Mat(n,e)&&(!n.parentElement||k5e(n.parentElement,n))}function Sat(n){if(!(n instanceof HTMLElement)&&!(n instanceof SVGElement))return!1;const{display:e,visibility:t}=n.style;let i=e!=="none"&&t!=="hidden"&&t!=="collapse";if(i){if(!n.ownerDocument.defaultView)return i;const{getComputedStyle:r}=n.ownerDocument.defaultView,{display:o,visibility:s}=r(n);i=o!=="none"&&s!=="hidden"&&s!=="collapse"}return i}function Mat(n,e){return!n.hasAttribute("hidden")&&(n.nodeName==="DETAILS"&&e&&e.nodeName!=="SUMMARY"?n.hasAttribute("open"):!0)}function Lat(n,e,t){const i=e?.tabbable?_at:y5e,r=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode(o){return e?.from?.contains(o)?NodeFilter.FILTER_REJECT:o.matches(i)&&k5e(o)&&(!e?.accept||e.accept(o))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return e?.from&&(r.currentNode=e.from),r}function iCe(n){let e=n;for(;e&&!Iat(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function Iat(n){const e=window.getComputedStyle(n);return/(auto|scroll)/.test(e.overflow+e.overflowX+e.overflowY)}function Nat(){}function DRe(n){return[n.clientX,n.clientY]}function C5e(n,e){const[t,i]=n;let r=!1;const o=e.length;for(let s=o,a=0,l=s-1;a<s;l=a++){const[c,d]=e[a],[u,h]=e[l],[,f]=e[l===0?s-1:l-1]||[0,0],p=(d-h)*(t-c)-(c-u)*(i-d);if(h<d){if(i>=h&&i<d){if(p===0)return!0;p>0&&(i===h?i>f&&(r=!r):r=!r)}}else if(d<h){if(i>d&&i<=h){if(p===0)return!0;p<0&&(i===h?i<f&&(r=!r):r=!r)}}else if(i===d&&(t>=u&&t<=c||t>=c&&t<=u))return!0}return r}function Pn(n,e){return k(n,e)}var ik=new Map,rCe=new Set;function oCe(){if(typeof window>"u")return;const n=t=>{if(!t.target)return;let i=ik.get(t.target);i||(i=new Set,ik.set(t.target,i),t.target.addEventListener("transitioncancel",e)),i.add(t.propertyName)},e=t=>{if(!t.target)return;const i=ik.get(t.target);if(i&&(i.delete(t.propertyName),i.size===0&&(t.target.removeEventListener("transitioncancel",e),ik.delete(t.target)),ik.size===0)){for(const r of rCe)r();rCe.clear()}};document.body.addEventListener("transitionrun",n),document.body.addEventListener("transitionend",e)}typeof document<"u"&&(document.readyState!=="loading"?oCe():document.addEventListener("DOMContentLoaded",oCe));function Jhe(n,e){const t=sCe(n,e,"left"),i=sCe(n,e,"top"),r=e.offsetWidth,o=e.offsetHeight;let s=n.scrollLeft,a=n.scrollTop;const l=s+n.offsetWidth,c=a+n.offsetHeight;t<=s?s=t:t+r>l&&(s+=t+r-l),i<=a?a=i:i+o>c&&(a+=i+o-c),n.scrollLeft=s,n.scrollTop=a}function sCe(n,e,t){const i=t==="left"?"offsetLeft":"offsetTop";let r=0;for(;e.offsetParent&&(r+=e[i],e.offsetParent!==n);){if(e.offsetParent.contains(n)){r-=n[i];break}e=e.offsetParent}return r}function Eat(n,e){if(document.contains(n)){const t=document.scrollingElement||document.documentElement;if(window.getComputedStyle(t).overflow==="hidden"){let r=iCe(n);for(;n&&r&&n!==t&&r!==t;)Jhe(r,n),n=r,r=iCe(n)}else{const{left:r,top:o}=n.getBoundingClientRect();n?.scrollIntoView?.({block:"nearest"});const{left:s,top:a}=n.getBoundingClientRect();(Math.abs(r-s)>1||Math.abs(o-a)>1)&&n.scrollIntoView?.({block:"nearest"})}}}var Tat={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"},Yb="data-kb-top-layer",RRe,Qhe=!1,U0=[];function Jb(n){return U0.findIndex(e=>e.node===n)}function Aat(n){return U0[Jb(n)]}function Dat(n){return U0[U0.length-1].node===n}function PRe(){return U0.filter(n=>n.isPointerBlocking)}function Rat(){return[...PRe()].slice(-1)[0]}function b5e(){return PRe().length>0}function ORe(n){const e=Jb(Rat()?.node);return Jb(n)<e}function Pat(n){U0.push(n)}function Oat(n){const e=Jb(n);e<0||U0.splice(e,1)}function Vat(){for(const{node:n}of U0)n.style.pointerEvents=ORe(n)?"none":"auto"}function Hat(n){if(b5e()&&!Qhe){const e=Tl(n);RRe=document.body.style.pointerEvents,e.body.style.pointerEvents="none",Qhe=!0}}function $at(n){if(b5e())return;const e=Tl(n);e.body.style.pointerEvents=RRe,e.body.style.length===0&&e.body.removeAttribute("style"),Qhe=!1}var vc={layers:U0,isTopMostLayer:Dat,hasPointerBlockingLayer:b5e,isBelowPointerBlockingLayer:ORe,addLayer:Pat,removeLayer:Oat,indexOf:Jb,find:Aat,assignPointerEventToLayers:Vat,disableBodyPointerEvents:Hat,restoreBodyPointerEvents:$at},Fce="focusScope.autoFocusOnMount",zce="focusScope.autoFocusOnUnmount",aCe={bubbles:!1,cancelable:!0},lCe={stack:[],active(){return this.stack[0]},add(n){n!==this.active()&&this.active()?.pause(),this.stack=Yhe(this.stack,n),this.stack.unshift(n)},remove(n){this.stack=Yhe(this.stack,n),this.active()?.resume()}};function VRe(n,e){const[t,i]=Ye(!1),r={pause(){i(!0)},resume(){i(!1)}};let o=null;const s=p=>n.onMountAutoFocus?.(p),a=p=>n.onUnmountAutoFocus?.(p),l=()=>Tl(e()),c=()=>{const p=l().createElement("span");return p.setAttribute("data-focus-trap",""),p.tabIndex=0,Object.assign(p.style,Tat),p},d=()=>{const p=e();return p?TRe(p,!0).filter(g=>!g.hasAttribute("data-focus-trap")):[]},u=()=>{const p=d();return p.length>0?p[0]:null},h=()=>{const p=d();return p.length>0?p[p.length-1]:null},f=()=>{const p=e();if(!p)return!1;const g=rC(p);return!g||ps(p,g)?!1:ARe(g)};Re(()=>{const p=e();if(!p)return;lCe.add(r);const g=rC(p);if(!ps(p,g)){const y=new CustomEvent(Fce,aCe);p.addEventListener(Fce,s),p.dispatchEvent(y),y.defaultPrevented||setTimeout(()=>{Rs(u()),rC(p)===g&&Rs(p)},0)}Oe(()=>{p.removeEventListener(Fce,s),setTimeout(()=>{const y=new CustomEvent(zce,aCe);f()&&y.preventDefault(),p.addEventListener(zce,a),p.dispatchEvent(y),y.defaultPrevented||Rs(g??l().body),p.removeEventListener(zce,a),lCe.remove(r)},0)})}),Re(()=>{const p=e();if(!p||!Ze(n.trapFocus)||t())return;const g=y=>{const C=y.target;C?.closest(`[${Yb}]`)||(ps(p,C)?o=C:Rs(o))},v=y=>{const _=y.relatedTarget??rC(p);_?.closest(`[${Yb}]`)||ps(p,_)||Rs(o)};l().addEventListener("focusin",g),l().addEventListener("focusout",v),Oe(()=>{l().removeEventListener("focusin",g),l().removeEventListener("focusout",v)})}),Re(()=>{const p=e();if(!p||!Ze(n.trapFocus)||t())return;const g=c();p.insertAdjacentElement("afterbegin",g);const v=c();p.insertAdjacentElement("beforeend",v);function y(_){const w=u(),x=h();_.relatedTarget===w?Rs(x):Rs(w)}g.addEventListener("focusin",y),v.addEventListener("focusin",y);const C=new MutationObserver(_=>{for(const w of _)w.previousSibling===v&&(v.remove(),p.insertAdjacentElement("beforeend",v)),w.nextSibling===g&&(g.remove(),p.insertAdjacentElement("afterbegin",g))});C.observe(p,{childList:!0,subtree:!1}),Oe(()=>{g.removeEventListener("focusin",y),v.removeEventListener("focusin",y),g.remove(),v.remove(),C.disconnect()})})}var Fat="data-live-announcer";function HRe(n){Re(()=>{Ze(n.isDisabled)||Oe(zat(Ze(n.targets),Ze(n.root)))})}var rk=new WeakMap,t1=[];function zat(n,e=document.body){const t=new Set(n),i=new Set,r=l=>{for(const h of l.querySelectorAll(`[${Fat}], [${Yb}]`))t.add(h);const c=h=>{if(t.has(h)||h.parentElement&&i.has(h.parentElement)&&h.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const f of t)if(h.contains(f))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},d=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode:c}),u=c(l);if(u===NodeFilter.FILTER_ACCEPT&&o(l),u!==NodeFilter.FILTER_REJECT){let h=d.nextNode();for(;h!=null;)o(h),h=d.nextNode()}},o=l=>{const c=rk.get(l)??0;l.getAttribute("aria-hidden")==="true"&&c===0||(c===0&&l.setAttribute("aria-hidden","true"),i.add(l),rk.set(l,c+1))};t1.length&&t1[t1.length-1].disconnect(),r(e);const s=new MutationObserver(l=>{for(const c of l)if(!(c.type!=="childList"||c.addedNodes.length===0)&&![...t,...i].some(d=>d.contains(c.target))){for(const d of c.removedNodes)d instanceof Element&&(t.delete(d),i.delete(d));for(const d of c.addedNodes)(d instanceof HTMLElement||d instanceof SVGElement)&&(d.dataset.liveAnnouncer==="true"||d.dataset.reactAriaTopLayer==="true")?t.add(d):d instanceof Element&&r(d)}});s.observe(e,{childList:!0,subtree:!0});const a={observe(){s.observe(e,{childList:!0,subtree:!0})},disconnect(){s.disconnect()}};return t1.push(a),()=>{s.disconnect();for(const l of i){const c=rk.get(l);if(c==null)return;c===1?(l.removeAttribute("aria-hidden"),rk.delete(l)):rk.set(l,c-1)}a===t1[t1.length-1]?(t1.pop(),t1.length&&t1[t1.length-1].observe()):t1.splice(t1.indexOf(a),1)}}var cCe="interactOutside.pointerDownOutside",dCe="interactOutside.focusOutside";function Bat(n,e){let t,i=Nat;const r=()=>Tl(e()),o=u=>n.onPointerDownOutside?.(u),s=u=>n.onFocusOutside?.(u),a=u=>n.onInteractOutside?.(u),l=u=>{const h=u.target;return!(h instanceof Element)||h.closest(`[${Yb}]`)||!ps(r(),h)||ps(e(),h)?!1:!n.shouldExcludeElement?.(h)},c=u=>{function h(){const f=e(),p=u.target;if(!f||!p||!l(u))return;const g=hs([o,a]);p.addEventListener(cCe,g,{once:!0});const v=new CustomEvent(cCe,{bubbles:!1,cancelable:!0,detail:{originalEvent:u,isContextMenu:u.button===2||yat(u)&&u.button===0}});p.dispatchEvent(v)}u.pointerType==="touch"?(r().removeEventListener("click",h),i=h,r().addEventListener("click",h,{once:!0})):h()},d=u=>{const h=e(),f=u.target;if(!h||!f||!l(u))return;const p=hs([s,a]);f.addEventListener(dCe,p,{once:!0});const g=new CustomEvent(dCe,{bubbles:!1,cancelable:!0,detail:{originalEvent:u,isContextMenu:!1}});f.dispatchEvent(g)};Re(()=>{Ze(n.isDisabled)||(t=window.setTimeout(()=>{r().addEventListener("pointerdown",c,!0)},0),r().addEventListener("focusin",d,!0),Oe(()=>{window.clearTimeout(t),r().removeEventListener("click",i),r().removeEventListener("pointerdown",c,!0),r().removeEventListener("focusin",d,!0)}))})}function jat(n){const e=t=>{t.key===IRe.Escape&&n.onEscapeKeyDown?.(t)};Re(()=>{if(Ze(n.isDisabled))return;const t=n.ownerDocument?.()??Tl();t.addEventListener("keydown",e),Oe(()=>{t.removeEventListener("keydown",e)})})}function zi(n){const[e,t]=Je(n,["as"]);if(!e.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return m(ase,k(t,{get component(){return e.as}}))}var $Re=oi();function Wat(){return Wn($Re)}function cse(n){let e;const t=Wat(),[i,r]=Je(n,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),o=new Set([]),s=u=>{o.add(u);const h=t?.registerNestedLayer(u);return()=>{o.delete(u),h?.()}};Bat({shouldExcludeElement:u=>e?i.excludedElements?.some(h=>ps(h(),u))||[...o].some(h=>ps(h,u)):!1,onPointerDownOutside:u=>{!e||vc.isBelowPointerBlockingLayer(e)||!i.bypassTopMostLayerCheck&&!vc.isTopMostLayer(e)||(i.onPointerDownOutside?.(u),i.onInteractOutside?.(u),u.defaultPrevented||i.onDismiss?.())},onFocusOutside:u=>{i.onFocusOutside?.(u),i.onInteractOutside?.(u),u.defaultPrevented||i.onDismiss?.()}},()=>e),jat({ownerDocument:()=>Tl(e),onEscapeKeyDown:u=>{!e||!vc.isTopMostLayer(e)||(i.onEscapeKeyDown?.(u),!u.defaultPrevented&&i.onDismiss&&(u.preventDefault(),i.onDismiss()))}}),ur(()=>{if(!e)return;vc.addLayer({node:e,isPointerBlocking:i.disableOutsidePointerEvents,dismiss:i.onDismiss});const u=t?.registerNestedLayer(e);vc.assignPointerEventToLayers(),vc.disableBodyPointerEvents(e),Oe(()=>{e&&(vc.removeLayer(e),u?.(),vc.assignPointerEventToLayers(),vc.restoreBodyPointerEvents(e))})}),Re(Mr([()=>e,()=>i.disableOutsidePointerEvents],([u,h])=>{if(!u)return;const f=vc.find(u);f&&f.isPointerBlocking!==h&&(f.isPointerBlocking=h,vc.assignPointerEventToLayers()),h&&vc.disableBodyPointerEvents(u),Oe(()=>{vc.restoreBodyPointerEvents(u)})},{defer:!0}));const d={registerNestedLayer:s};return m($Re.Provider,{value:d,get children(){return m(zi,k({as:"div",ref(u){var h=qr(f=>e=f,i.ref);typeof h=="function"&&h(u)}},r))}})}function H_(n){const[e,t]=Ye(n.defaultValue?.()),i=J(()=>n.value?.()!==void 0),r=J(()=>i()?n.value?.():e());return[r,s=>{Mn(()=>{const a=iat(s,r());return Object.is(a,r())||(i()||t(a),n.onChange?.(a)),a})}]}function FRe(n){const[e,t]=H_(n);return[()=>e()??!1,t]}function qat(n){const[e,t]=H_(n);return[()=>e()??[],t]}function u3(n={}){const[e,t]=FRe({value:()=>Ze(n.open),defaultValue:()=>!!Ze(n.defaultOpen),onChange:s=>n.onOpenChange?.(s)}),i=()=>{t(!0)},r=()=>{t(!1)};return{isOpen:e,setIsOpen:t,open:i,close:r,toggle:()=>{e()?r():i()}}}function $_(n,e){const[t,i]=Ye(uCe(e?.()));return Re(()=>{i(n()?.tagName.toLowerCase()||uCe(e?.()))}),t}function uCe(n){return I8(n)?n:void 0}var Uat=Object.defineProperty,au=(n,e)=>{for(var t in e)Uat(n,t,{get:e[t],enumerable:!0})},Zat={};au(Zat,{Button:()=>w5e,Root:()=>h3});var Kat=["button","color","file","image","reset","submit"];function Gat(n){const e=n.tagName.toLowerCase();return e==="button"?!0:e==="input"&&n.type?Kat.indexOf(n.type)!==-1:!1}function h3(n){let e;const t=Pn({type:"button"},n),[i,r]=Je(t,["ref","type","disabled"]),o=$_(()=>e,()=>"button"),s=J(()=>{const c=o();return c==null?!1:Gat({tagName:c,type:i.type})}),a=J(()=>o()==="input"),l=J(()=>o()==="a"&&e?.getAttribute("href")!=null);return m(zi,k({as:"button",ref(c){var d=qr(u=>e=u,i.ref);typeof d=="function"&&d(c)},get type(){return sn(()=>!!(s()||a()))()?i.type:void 0},get role(){return!s()&&!l()?"button":void 0},get tabIndex(){return!s()&&!l()&&!i.disabled?0:void 0},get disabled(){return sn(()=>!!(s()||a()))()?i.disabled:void 0},get"aria-disabled"(){return!s()&&!a()&&i.disabled?!0:void 0},get"data-disabled"(){return i.disabled?"":void 0}},r))}var w5e=h3;function Xa(n){return e=>(n(e),()=>n(void 0))}var za=n=>typeof n=="function"?n():n,e0e=(n,e)=>{if(n.contains(e))return!0;let t=e;for(;t;){if(t===n)return!0;t=t._$host??t.parentElement}return!1},cS=new Map,Xat=n=>{Re(()=>{const e=za(n.style)??{},t=za(n.properties)??[],i={};for(const o in e)i[o]=n.element.style[o];const r=cS.get(n.key);r?r.activeCount++:cS.set(n.key,{activeCount:1,originalStyles:i,properties:t.map(o=>o.key)}),Object.assign(n.element.style,n.style);for(const o of t)n.element.style.setProperty(o.key,o.value);Oe(()=>{const o=cS.get(n.key);if(o){if(o.activeCount!==1){o.activeCount--;return}cS.delete(n.key);for(const[s,a]of Object.entries(o.originalStyles))n.element.style[s]=a;for(const s of o.properties)n.element.style.removeProperty(s);n.element.style.length===0&&n.element.removeAttribute("style"),n.cleanup?.()}})})},hCe=Xat,Yat=(n,e)=>{switch(e){case"x":return[n.clientWidth,n.scrollLeft,n.scrollWidth];case"y":return[n.clientHeight,n.scrollTop,n.scrollHeight]}},Jat=(n,e)=>{const t=getComputedStyle(n),i=e==="x"?t.overflowX:t.overflowY;return i==="auto"||i==="scroll"||n.tagName==="HTML"&&i==="visible"},Qat=(n,e,t)=>{const i=e==="x"&&window.getComputedStyle(n).direction==="rtl"?-1:1;let r=n,o=0,s=0,a=!1;do{const[l,c,d]=Yat(r,e),u=d-l-i*c;(c!==0||u!==0)&&Jat(r,e)&&(o+=u,s+=c),r===(t??document.documentElement)?a=!0:r=r._$host??r.parentElement}while(r&&!a);return[o,s]},[fCe,pCe]=Ye([]),elt=n=>fCe().indexOf(n)===fCe().length-1,tlt=n=>{const e=k({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},n),t=$s();let i=[0,0],r=null,o=null;Re(()=>{za(e.enabled)&&(pCe(c=>[...c,t]),Oe(()=>{pCe(c=>c.filter(d=>d!==t))}))}),Re(()=>{if(!za(e.enabled)||!za(e.hideScrollbar))return;const{body:c}=document,d=window.innerWidth-c.offsetWidth;if(za(e.preventScrollbarShift)){const u={overflow:"hidden"},h=[];d>0&&(za(e.preventScrollbarShiftMode)==="padding"?u.paddingRight=`calc(${window.getComputedStyle(c).paddingRight} + ${d}px)`:u.marginRight=`calc(${window.getComputedStyle(c).marginRight} + ${d}px)`,h.push({key:"--scrollbar-width",value:`${d}px`}));const f=window.scrollY,p=window.scrollX;hCe({key:"prevent-scroll",element:c,style:u,properties:h,cleanup:()=>{za(e.restoreScrollPosition)&&d>0&&window.scrollTo(p,f)}})}else hCe({key:"prevent-scroll",element:c,style:{overflow:"hidden"}})}),Re(()=>{!elt(t)||!za(e.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",s,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),Oe(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",s),document.removeEventListener("touchmove",l)}))});const s=c=>{i=gCe(c),r=null,o=null},a=c=>{const d=c.target,u=za(e.element),h=nlt(c),f=Math.abs(h[0])>Math.abs(h[1])?"x":"y",p=f==="x"?h[0]:h[1],g=mCe(d,f,p,u);let v;u&&e0e(u,d)?v=!g:v=!0,v&&c.cancelable&&c.preventDefault()},l=c=>{const d=za(e.element),u=c.target;let h;if(c.touches.length===2)h=!za(e.allowPinchZoom);else{if(r==null||o===null){const f=gCe(c).map((g,v)=>i[v]-g),p=Math.abs(f[0])>Math.abs(f[1])?"x":"y";r=p,o=p==="x"?f[0]:f[1]}if(u.type==="range")h=!1;else{const f=mCe(u,r,o,d);d&&e0e(d,u)?h=!f:h=!0}}h&&c.cancelable&&c.preventDefault()}},nlt=n=>[n.deltaX,n.deltaY],gCe=n=>n.changedTouches[0]?[n.changedTouches[0].clientX,n.changedTouches[0].clientY]:[0,0],mCe=(n,e,t,i)=>{const r=i!==null&&e0e(i,n),[o,s]=Qat(n,e,r?i:void 0);return!(t>0&&Math.abs(o)<=1||t<0&&Math.abs(s)<1)},ilt=tlt,zRe=ilt,rlt=n=>{const e=J(()=>{const s=za(n.element);if(s)return getComputedStyle(s)}),t=()=>e()?.animationName??"none",[i,r]=Ye(za(n.show)?"present":"hidden");let o="none";return Re(s=>{const a=za(n.show);return Mn(()=>{if(s===a)return a;const l=o,c=t();a?r("present"):c==="none"||e()?.display==="none"?r("hidden"):r(s===!0&&l!==c?"hiding":"hidden")}),a}),Re(()=>{const s=za(n.element);if(!s)return;const a=c=>{c.target===s&&(o=t())},l=c=>{const u=t().includes(c.animationName);c.target===s&&u&&i()==="hiding"&&r("hidden")};s.addEventListener("animationstart",a),s.addEventListener("animationcancel",l),s.addEventListener("animationend",l),Oe(()=>{s.removeEventListener("animationstart",a),s.removeEventListener("animationcancel",l),s.removeEventListener("animationend",l)})}),{present:()=>i()==="present"||i()==="hiding",state:i,setState:r}},olt=rlt,M6=olt,slt={};au(slt,{CloseButton:()=>jRe,Content:()=>WRe,Description:()=>qRe,Dialog:()=>lf,Overlay:()=>URe,Portal:()=>ZRe,Root:()=>KRe,Title:()=>GRe,Trigger:()=>XRe,useDialogContext:()=>gp});var BRe=oi();function gp(){const n=Wn(BRe);if(n===void 0)throw new Error("[kobalte]: `useDialogContext` must be used within a `Dialog` component");return n}function jRe(n){const e=gp(),[t,i]=Je(n,["aria-label","onClick"]);return m(h3,k({get"aria-label"(){return t["aria-label"]||e.translations().dismiss},onClick:o=>{In(o,t.onClick),e.close()}},i))}function WRe(n){let e;const t=gp(),i=Pn({id:t.generateId("content")},n),[r,o]=Je(i,["ref","onOpenAutoFocus","onCloseAutoFocus","onPointerDownOutside","onFocusOutside","onInteractOutside"]);let s=!1,a=!1;const l=h=>{r.onPointerDownOutside?.(h),t.modal()&&h.detail.isContextMenu&&h.preventDefault()},c=h=>{r.onFocusOutside?.(h),t.modal()&&h.preventDefault()},d=h=>{r.onInteractOutside?.(h),!t.modal()&&(h.defaultPrevented||(s=!0,h.detail.originalEvent.type==="pointerdown"&&(a=!0)),ps(t.triggerRef(),h.target)&&h.preventDefault(),h.detail.originalEvent.type==="focusin"&&a&&h.preventDefault())},u=h=>{r.onCloseAutoFocus?.(h),t.modal()?(h.preventDefault(),Rs(t.triggerRef())):(h.defaultPrevented||(s||Rs(t.triggerRef()),h.preventDefault()),s=!1,a=!1)};return HRe({isDisabled:()=>!(t.isOpen()&&t.modal()),targets:()=>e?[e]:[]}),zRe({element:()=>e??null,enabled:()=>t.contentPresent()&&t.preventScroll()}),VRe({trapFocus:()=>t.isOpen()&&t.modal(),onMountAutoFocus:r.onOpenAutoFocus,onUnmountAutoFocus:u},()=>e),Re(()=>Oe(t.registerContentId(o.id))),m(_e,{get when(){return t.contentPresent()},get children(){return m(cse,k({ref(h){var f=qr(p=>{t.setContentRef(p),e=p},r.ref);typeof f=="function"&&f(h)},role:"dialog",tabIndex:-1,get disableOutsidePointerEvents(){return sn(()=>!!t.modal())()&&t.isOpen()},get excludedElements(){return[t.triggerRef]},get"aria-labelledby"(){return t.titleId()},get"aria-describedby"(){return t.descriptionId()},get"data-expanded"(){return t.isOpen()?"":void 0},get"data-closed"(){return t.isOpen()?void 0:""},onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:d,get onDismiss(){return t.close}},o))}})}function qRe(n){const e=gp(),t=Pn({id:e.generateId("description")},n),[i,r]=Je(t,["id"]);return Re(()=>Oe(e.registerDescriptionId(i.id))),m(zi,k({as:"p",get id(){return i.id}},r))}function URe(n){const e=gp(),[t,i]=Je(n,["ref","style","onPointerDown"]),r=o=>{In(o,t.onPointerDown),o.target===o.currentTarget&&o.preventDefault()};return m(_e,{get when(){return e.overlayPresent()},get children(){return m(zi,k({as:"div",ref(o){var s=qr(e.setOverlayRef,t.ref);typeof s=="function"&&s(o)},get style(){return su({"pointer-events":"auto"},t.style)},get"data-expanded"(){return e.isOpen()?"":void 0},get"data-closed"(){return e.isOpen()?void 0:""},onPointerDown:r},i))}})}function ZRe(n){const e=gp();return m(_e,{get when(){return e.contentPresent()||e.overlayPresent()},get children(){return m(d3,n)}})}var vCe={dismiss:"Dismiss"};function KRe(n){const e=`dialog-${$s()}`,t=Pn({id:e,modal:!0,translations:vCe},n),[i,r]=Ye(),[o,s]=Ye(),[a,l]=Ye(),[c,d]=Ye(),[u,h]=Ye(),[f,p]=Ye(),g=u3({open:()=>t.open,defaultOpen:()=>t.defaultOpen,onOpenChange:w=>t.onOpenChange?.(w)}),v=()=>t.forceMount||g.isOpen(),{present:y}=M6({show:v,element:()=>c()??null}),{present:C}=M6({show:v,element:()=>u()??null}),_={translations:()=>t.translations??vCe,isOpen:g.isOpen,modal:()=>t.modal??!0,preventScroll:()=>t.preventScroll??_.modal(),contentId:i,titleId:o,descriptionId:a,triggerRef:f,overlayRef:c,setOverlayRef:d,contentRef:u,setContentRef:h,overlayPresent:y,contentPresent:C,close:g.close,toggle:g.toggle,setTriggerRef:p,generateId:bh(()=>t.id),registerContentId:Xa(r),registerTitleId:Xa(s),registerDescriptionId:Xa(l)};return m(BRe.Provider,{value:_,get children(){return t.children}})}function GRe(n){const e=gp(),t=Pn({id:e.generateId("title")},n),[i,r]=Je(t,["id"]);return Re(()=>Oe(e.registerTitleId(i.id))),m(zi,k({as:"h2",get id(){return i.id}},r))}function XRe(n){const e=gp(),[t,i]=Je(n,["ref","onClick"]);return m(h3,k({ref(o){var s=qr(e.setTriggerRef,t.ref);typeof s=="function"&&s(o)},"aria-haspopup":"dialog",get"aria-expanded"(){return e.isOpen()},get"aria-controls"(){return sn(()=>!!e.isOpen())()?e.contentId():void 0},get"data-expanded"(){return e.isOpen()?"":void 0},get"data-closed"(){return e.isOpen()?void 0:""},onClick:o=>{In(o,t.onClick),e.toggle()}},i))}var lf=Object.assign(KRe,{CloseButton:jRe,Content:WRe,Description:qRe,Overlay:URe,Portal:ZRe,Title:GRe,Trigger:XRe}),alt=le("<div>"),llt=le("<div data-component=dialog-stack>");const YRe=oi();function clt(){const[n,e]=Ye(),t={current:void 0},i={value:!1};Oe(()=>{t.current!==void 0&&(clearTimeout(t.current),t.current=void 0)});const r=()=>{const s=n();if(!s||i.value)return;i.value=!0,s.onClose?.(),s.setClosing(!0);const a=s.id;t.current!==void 0&&(clearTimeout(t.current),t.current=void 0),t.current=setTimeout(()=>{t.current=void 0,s.dispose(),n()?.id===a&&e(void 0),i.value=!1},150)};return Re(()=>{if(!n())return;const s=a=>{a.key==="Escape"&&(r(),a.preventDefault(),a.stopPropagation())};window.addEventListener("keydown",s,!0),Oe(()=>window.removeEventListener("keydown",s,!0))}),{get active(){return n()},close:r,show:(s,a,l)=>{const c=n();c&&(c.dispose(),e(void 0)),t.current!==void 0&&(clearTimeout(t.current),t.current=void 0),i.value=!1;const d=Math.random().toString(36).slice(2);let u,h;const f=b0(a,()=>sa(p=>{u=p;const[g,v]=Ye(!1);return h=v,m(lf,{modal:!0,get open(){return!g()},onOpenChange:y=>{y||r()},get children(){return m(lf.Portal,{get children(){return[m(lf.Overlay,{"data-component":"dialog-overlay",get"data-closing"(){return g()?"":void 0},onClick:r}),(()=>{var y=alt();return W(y,s),st(()=>mt(y,"data-closing",g()?"":void 0)),y})()]}})}})}));!u||!h||e({id:d,node:f,dispose:u,owner:a,onClose:l,setClosing:h})}}}function dlt(n){const e=clt();return m(YRe.Provider,{value:e,get children(){return[sn(()=>n.children),(()=>{var t=llt();return W(t,()=>e.active?.node),t})()]}})}function oy(){const n=Wn(YRe),e=Zd();if(!e)throw new Error("useDialog must be used within a DialogProvider");if(!n)throw new Error("useDialog must be used within a DialogProvider");return{get active(){return n.active},show(t,i){const r=n.active?.owner??e;n.show(t,r,i)},close(){n.close()}}}const JRe={"ui.sessionReview.title":"Session changes","ui.sessionReview.title.lastTurn":"Last turn changes","ui.sessionReview.diffStyle.unified":"Unified","ui.sessionReview.diffStyle.split":"Split","ui.sessionReview.expandAll":"Expand all","ui.sessionReview.collapseAll":"Collapse all","ui.sessionReview.change.added":"Added","ui.sessionReview.change.removed":"Removed","ui.sessionReview.change.modified":"Modified","ui.sessionReview.image.loading":"Loading...","ui.sessionReview.image.placeholder":"Image","ui.sessionReview.largeDiff.title":"Diff too large to render","ui.sessionReview.largeDiff.meta":"Limit: {{limit}} changed lines. Current: {{current}} changed lines.","ui.sessionReview.largeDiff.renderAnyway":"Render anyway","ui.sessionReview.openFile":"Open file","ui.sessionReview.selection.line":"line {{line}}","ui.sessionReview.selection.lines":"lines {{start}}-{{end}}","ui.fileMedia.kind.image":"image","ui.fileMedia.kind.audio":"audio","ui.fileMedia.state.removed":"Removed {{kind}} file.","ui.fileMedia.state.loading":"Loading {{kind}}...","ui.fileMedia.state.error":"Unable to load {{kind}}.","ui.fileMedia.state.unavailable":"{{kind}} preview unavailable.","ui.fileMedia.binary.title":"Binary file","ui.fileMedia.binary.description.path":"{{path}} is binary.","ui.fileMedia.binary.description.default":"Binary content","ui.lineComment.label.prefix":"Comment on ","ui.lineComment.label.suffix":"","ui.lineComment.editorLabel.prefix":"Commenting on ","ui.lineComment.editorLabel.suffix":"","ui.lineComment.placeholder":"Add comment","ui.lineComment.submit":"Comment","ui.sessionTurn.steps.show":"Show steps","ui.sessionTurn.steps.hide":"Hide steps","ui.sessionTurn.summary.response":"Response","ui.sessionTurn.diff.showMore":"Show more changes ({{count}})","ui.sessionTurn.retry.retrying":"retrying","ui.sessionTurn.retry.inSeconds":"in {{seconds}}s","ui.sessionTurn.retry.attempt":"attempt #{{attempt}}","ui.sessionTurn.retry.attemptLine":"{{line}} - attempt #{{attempt}}","ui.sessionTurn.retry.geminiHot":"gemini is way too hot right now","ui.sessionTurn.error.freeUsageExceeded":"Free usage exceeded","ui.sessionTurn.error.addCredits":"Add credits","ui.sessionTurn.status.delegating":"Delegating work","ui.sessionTurn.status.planning":"Planning next steps","ui.sessionTurn.status.gatheringContext":"Exploring","ui.sessionTurn.status.gatheredContext":"Explored","ui.sessionTurn.status.searchingCodebase":"Searching the codebase","ui.sessionTurn.status.searchingWeb":"Searching the web","ui.sessionTurn.status.makingEdits":"Making edits","ui.sessionTurn.status.runningCommands":"Running commands","ui.sessionTurn.status.thinking":"Thinking","ui.sessionTurn.status.thinkingWithTopic":"Thinking - {{topic}}","ui.sessionTurn.status.gatheringThoughts":"Gathering thoughts","ui.sessionTurn.status.consideringNextSteps":"Considering next steps","ui.messagePart.diagnostic.error":"Error","ui.researchSources.title":"Sources","ui.messagePart.title.edit":"Edit","ui.messagePart.title.write":"Write","ui.messagePart.option.typeOwnAnswer":"Type your own answer","ui.messagePart.review.title":"Review your answers","ui.messagePart.questions.dismissed":"Questions dismissed","ui.messagePart.compaction":"Session compacted","ui.messagePart.hook.graphEnrichment":"Graph enrichment","ui.messagePart.hook.researchCapture":"Research capture","ui.messagePart.hook.turnEndEnrichment":"Graph enrichment follow-up","ui.messagePart.hook.turnEndResearch":"Research capture follow-up","ui.messagePart.hook.triggered":"Hook triggered","ui.messagePart.context.read.one":"{{count}} read","ui.messagePart.context.read.other":"{{count}} reads","ui.messagePart.context.search.one":"{{count}} search","ui.messagePart.context.search.other":"{{count}} searches","ui.messagePart.context.list.one":"{{count}} list","ui.messagePart.context.list.other":"{{count}} lists","ui.list.loading":"Loading","ui.list.empty":"No results","ui.list.clearFilter":"Clear filter","ui.list.emptyWithFilter.prefix":"No results for","ui.list.emptyWithFilter.suffix":"","ui.fileSearch.placeholder":"Find","ui.fileSearch.previousMatch":"Previous match","ui.fileSearch.nextMatch":"Next match","ui.fileSearch.close":"Close search","ui.messageNav.newMessage":"New message","ui.textField.copyToClipboard":"Copy to clipboard","ui.textField.copyLink":"Copy link","ui.textField.copied":"Copied","ui.imagePreview.alt":"Image preview","ui.scrollView.ariaLabel":"scrollable content","ui.tool.read":"Read","ui.tool.loaded":"Loaded","ui.tool.list":"List","ui.tool.glob":"Glob","ui.tool.grep":"Grep","ui.tool.task":"Task","ui.tool.webfetch":"Webfetch","ui.tool.websearch":"Web Search","ui.tool.deepResearch":"Deep Research","ui.tool.codesearch":"Code Search","ui.tool.shell":"Shell","ui.tool.patch":"Patch","ui.tool.todos":"To-dos","ui.tool.todos.read":"Read to-dos","ui.tool.questions":"Questions","ui.tool.agent":"{{type}} Agent","ui.tool.agent.default":"Agent","ui.tool.skill":"Skill","ui.basicTool.called":"Called `{{tool}}`","ui.toolErrorCard.failed":"Failed","ui.toolErrorCard.copyError":"Copy error","ui.common.file.one":"file","ui.common.file.other":"files","ui.common.question.one":"question","ui.common.question.other":"questions","ui.common.add":"Add","ui.common.back":"Back","ui.common.cancel":"Cancel","ui.common.confirm":"Confirm","ui.common.dismiss":"Dismiss","ui.common.close":"Close","ui.common.next":"Next","ui.common.submit":"Submit","ui.permission.deny":"Deny","ui.permission.allowAlways":"Allow always","ui.permission.allowOnce":"Allow once","ui.message.expand":"Expand message","ui.message.collapse":"Collapse message","ui.message.copy":"Copy","ui.message.copyMessage":"Copy message","ui.message.forkMessage":"Fork to new session","ui.message.revertMessage":"Revert message","ui.message.copyResponse":"Copy response","ui.message.copied":"Copied","ui.message.readAloud":"Read aloud","ui.message.preparingSpeech":"Preparing speech…","ui.message.stopSpeech":"Stop reading","ui.message.speechFailed":"Speech unavailable","ui.message.duration.seconds":"{{count}}s","ui.message.duration.minutesSeconds":"{{minutes}}m {{seconds}}s","ui.message.interrupted":"Interrupted","ui.message.queued":"Queued","ui.message.attachment.alt":"attachment","ui.patch.action.deleted":"Deleted","ui.patch.action.created":"Created","ui.patch.action.moved":"Moved","ui.patch.action.patched":"Patched","ui.question.subtitle.answered":"{{count}} answered","ui.question.answer.none":"(no answer)","ui.question.review.notAnswered":"(not answered)","ui.question.multiHint":"Select all answers that apply","ui.question.singleHint":"Select one answer","ui.question.custom.placeholder":"Type your answer..."};function ult(n,e){return e?n.replace(/{{\s*([^}]+?)\s*}}/g,(t,i)=>{const r=String(i),o=e[r];return o===void 0?"":String(o)}):n}const hlt={locale:()=>"en",t:(n,e)=>{const t=JRe[n]??String(n);return ult(t,e)}},QRe=oi(hlt);function flt(n){return m(QRe.Provider,{get value(){return n.value},get children(){return n.children}})}function f3(){return Wn(QRe)}function _5e(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var p3=_5e();function ePe(n){p3=n}var jC={exec:()=>null};function Yi(n,e=""){let t=typeof n=="string"?n:n.source,i={replace:(r,o)=>{let s=typeof o=="string"?o:o.source;return s=s.replace(bl.caret,"$1"),t=t.replace(r,s),i},getRegex:()=>new RegExp(t,e)};return i}var plt=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),bl={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i")},glt=/^(?:[ \t]*(?:\n|$))+/,mlt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,vlt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,F_=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ylt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,x5e=/(?:[*+-]|\d{1,9}[.)])/,tPe=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,nPe=Yi(tPe).replace(/bull/g,x5e).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),klt=Yi(tPe).replace(/bull/g,x5e).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),S5e=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Clt=/^[^\n]+/,M5e=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,blt=Yi(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",M5e).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),wlt=Yi(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,x5e).getRegex(),dse="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",L5e=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,_lt=Yi("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",L5e).replace("tag",dse).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),iPe=Yi(S5e).replace("hr",F_).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",dse).getRegex(),xlt=Yi(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",iPe).getRegex(),I5e={blockquote:xlt,code:mlt,def:blt,fences:vlt,heading:ylt,hr:F_,html:_lt,lheading:nPe,list:wlt,newline:glt,paragraph:iPe,table:jC,text:Clt},yCe=Yi("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",F_).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",dse).getRegex(),Slt={...I5e,lheading:klt,table:yCe,paragraph:Yi(S5e).replace("hr",F_).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",yCe).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",dse).getRegex()},Mlt={...I5e,html:Yi(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",L5e).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:jC,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Yi(S5e).replace("hr",F_).replace("heading",` *#{1,6} *[^
3
3
  ]`).replace("lheading",nPe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Llt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ilt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,rPe=/^( {2,}|\\)\n(?!\s*$)/,Nlt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,use=/[\p{P}\p{S}]/u,N5e=/[\s\p{P}\p{S}]/u,oPe=/[^\s\p{P}\p{S}]/u,Elt=Yi(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,N5e).getRegex(),sPe=/(?!~)[\p{P}\p{S}]/u,Tlt=/(?!~)[\s\p{P}\p{S}]/u,Alt=/(?:[^\s\p{P}\p{S}]|~)/u,Dlt=Yi(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",plt?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),aPe=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Rlt=Yi(aPe,"u").replace(/punct/g,use).getRegex(),Plt=Yi(aPe,"u").replace(/punct/g,sPe).getRegex(),lPe="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Olt=Yi(lPe,"gu").replace(/notPunctSpace/g,oPe).replace(/punctSpace/g,N5e).replace(/punct/g,use).getRegex(),Vlt=Yi(lPe,"gu").replace(/notPunctSpace/g,Alt).replace(/punctSpace/g,Tlt).replace(/punct/g,sPe).getRegex(),Hlt=Yi("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,oPe).replace(/punctSpace/g,N5e).replace(/punct/g,use).getRegex(),$lt=Yi(/\\(punct)/,"gu").replace(/punct/g,use).getRegex(),Flt=Yi(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),zlt=Yi(L5e).replace("(?:-->|$)","-->").getRegex(),Blt=Yi("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",zlt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ine=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,jlt=Yi(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ine).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),cPe=Yi(/^!?\[(label)\]\[(ref)\]/).replace("label",ine).replace("ref",M5e).getRegex(),dPe=Yi(/^!?\[(ref)\](?:\[\])?/).replace("ref",M5e).getRegex(),Wlt=Yi("reflink|nolink(?!\\()","g").replace("reflink",cPe).replace("nolink",dPe).getRegex(),kCe=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,E5e={_backpedal:jC,anyPunctuation:$lt,autolink:Flt,blockSkip:Dlt,br:rPe,code:Ilt,del:jC,emStrongLDelim:Rlt,emStrongRDelimAst:Olt,emStrongRDelimUnd:Hlt,escape:Llt,link:jlt,nolink:dPe,punctuation:Elt,reflink:cPe,reflinkSearch:Wlt,tag:Blt,text:Nlt,url:jC},qlt={...E5e,link:Yi(/^!?\[(label)\]\((.*?)\)/).replace("label",ine).getRegex(),reflink:Yi(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ine).getRegex()},t0e={...E5e,emStrongRDelimAst:Vlt,emStrongLDelim:Plt,url:Yi(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",kCe).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Yi(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",kCe).getRegex()},Ult={...t0e,br:Yi(rPe).replace("{2,}","*").getRegex(),text:Yi(t0e.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},dS={normal:I5e,gfm:Slt,pedantic:Mlt},ok={normal:E5e,gfm:t0e,breaks:Ult,pedantic:qlt},Zlt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},CCe=n=>Zlt[n];function Kh(n,e){if(e){if(bl.escapeTest.test(n))return n.replace(bl.escapeReplace,CCe)}else if(bl.escapeTestNoEncode.test(n))return n.replace(bl.escapeReplaceNoEncode,CCe);return n}function bCe(n){try{n=encodeURI(n).replace(bl.percentDecode,"%")}catch{return null}return n}function wCe(n,e){let t=n.replace(bl.findPipe,(o,s,a)=>{let l=!1,c=s;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),i=t.split(bl.splitPipe),r=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),e)if(i.length>e)i.splice(e);else for(;i.length<e;)i.push("");for(;r<i.length;r++)i[r]=i[r].trim().replace(bl.slashPipe,"|");return i}function sk(n,e,t){let i=n.length;if(i===0)return"";let r=0;for(;r<i&&n.charAt(i-r-1)===e;)r++;return n.slice(0,i-r)}function Klt(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let i=0;i<n.length;i++)if(n[i]==="\\")i++;else if(n[i]===e[0])t++;else if(n[i]===e[1]&&(t--,t<0))return i;return t>0?-2:-1}function _Ce(n,e,t,i,r){let o=e.href,s=e.title||null,a=n[1].replace(r.other.outputLinkReplace,"$1");i.state.inLink=!0;let l={type:n[0].charAt(0)==="!"?"image":"link",raw:t,href:o,title:s,text:a,tokens:i.inlineTokens(a)};return i.state.inLink=!1,l}function Glt(n,e,t){let i=n.match(t.other.indentCodeCompensation);if(i===null)return e;let r=i[1];return e.split(`
4
4
  `).map(o=>{let s=o.match(t.other.beginningSpace);if(s===null)return o;let[a]=s;return a.length>=r.length?o.slice(r.length):o}).join(`
@@ -2051,7 +2051,7 @@ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.pus
2051
2051
  `)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
2052
2052
  `,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){const i="end"in t.value?t.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){const r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const i=!this.onKeyLine&&this.indent===e.indent,r=i&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind";let o=[];if(r&&t.sep&&!t.value){const s=[];for(let a=0;a<t.sep.length;++a){const l=t.sep[a];switch(l.type){case"newline":s.push(a);break;case"space":break;case"comment":l.indent>e.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(o=t.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":r||t.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(o.push(this.sourceToken),e.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if($2(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(t$e(t.key)&&!$2(t.sep,"newline")){const s=J3(t.start),a=t.key,l=t.sep;l.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:a,sep:l}]})}else o.length>0?t.sep=t.sep.concat(o,this.sourceToken):t.sep.push(this.sourceToken);else if($2(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{const s=J3(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||r?e.items.push({start:o,key:null,sep:[this.sourceToken]}):$2(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const s=this.flowScalar(this.type);r||t.value?(e.items.push({start:o,key:s,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(s):(Object.assign(t,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{const s=this.startBlockValue(e);if(s){if(s.type==="block-seq"){if(!t.explicitKey&&t.sep&&!$2(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&e.items.push({start:o});this.stack.push(s);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){const i="end"in t.value?t.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){const r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||$2(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){const i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const r=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:r,sep:[]}):t.sep?this.stack.push(r):Object.assign(t,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const i=this.startBlockValue(e);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{const i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===e.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){const r=PS(i),o=J3(r);bwe(e);const s=e.end.splice(1,e.end.length);s.push(this.sourceToken);const a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:o,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
2053
2053
  `)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
2054
- `,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const t=PS(e),i=J3(t);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const t=PS(e),i=J3(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};function n$e(n){const e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new e$e||null,prettyErrors:e}}function wgt(n,e={}){const{lineCounter:t,prettyErrors:i}=n$e(e),r=new P9e(t?.addNewLine),o=new R9e(e),s=Array.from(o.compose(r.parse(n)));if(i&&t)for(const a of s)a.errors.forEach(Ane(n,t)),a.warnings.forEach(Ane(n,t));return s.length>0?s:Object.assign([],{empty:!0},o.streamInfo())}function i$e(n,e={}){const{lineCounter:t,prettyErrors:i}=n$e(e),r=new P9e(t?.addNewLine),o=new R9e(e);let s=null;for(const a of o.compose(r.parse(n),!0,n.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new F9(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&t&&(s.errors.forEach(Ane(n,t)),s.warnings.forEach(Ane(n,t))),s}function _gt(n,e,t){let i;typeof e=="function"?i=e:t===void 0&&e&&typeof e=="object"&&(t=e);const r=i$e(n,t);if(!r)return null;if(r.warnings.forEach(o=>CHe(r.options.logLevel,o)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:i},t))}function xgt(n,e,t){let i=null;if(typeof e=="function"||Array.isArray(e)?i=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){const r=Math.round(t);t=r<1?void 0:r>8?{indent:8}:{indent:r}}if(n===void 0){const{keepUndefined:r}=t??e??{};if(!r)return}return v3(n)&&!i?n.toString(t):new $se(n,i,t).toString(t)}const Sgt=Object.freeze(Object.defineProperty({__proto__:null,Alias:Ese,CST:kgt,Composer:R9e,Document:$se,Lexer:QHe,LineCounter:e$e,Pair:tl,Parser:P9e,Scalar:Vn,Schema:$He,YAMLError:A9e,YAMLMap:Ec,YAMLParseError:F9,YAMLSeq:Uf,YAMLWarning:BHe,isAlias:vp,isCollection:po,isDocument:v3,isMap:fy,isNode:vo,isPair:io,isScalar:Hr,isSeq:py,parse:_gt,parseAllDocuments:wgt,parseDocument:i$e,stringify:xgt,visit:y3,visitAsync:Nse},Symbol.toStringTag,{value:"Module"})),Mgt=/^---\s*\n([\s\S]*?)\n---\s*(?:\n|$)/;function Lgt(n){const e=n.match(Mgt);if(e)try{const t=Sgt.parse(e[1]);return!t||typeof t!="object"||Array.isArray(t)?void 0:{meta:t,body:n.slice(e[0].length)}}catch{return}}function r$e(n){const e=typeof n.title=="string"?n.title:void 0,t=typeof n.description=="string"?n.description:void 0,i=Object.entries(n).filter(([o])=>o!=="title"&&o!=="description").map(([o,s])=>{const a=Array.isArray(s)?s.map(l=>`<span data-slot="frontmatter-tag">${hk(String(l))}</span>`).join(""):`<span data-slot="frontmatter-value">${hk(String(s))}</span>`;return`<div class="fm-field"><span class="fm-field-key">${hk(o)}</span><div class="fm-field-val">${a}</div></div>`}).join("");return`<details data-component="frontmatter" open><summary data-slot="frontmatter-toggle">Frontmatter</summary><div data-slot="fm-body">${e!==void 0||t!==void 0?`<div data-slot="fm-header">${e!==void 0?`<div data-slot="fm-title">${hk(e)}</div>`:""}${t!==void 0?`<div data-slot="fm-desc">${hk(t)}</div>`:""}</div>`:""}<div data-slot="fm-grid">${i}</div></div></details>`}function hk(n){return n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}y9e("OpenCode",()=>Promise.resolve({name:"OpenCode",colors:{"editor.background":"var(--color-background-stronger)","editor.foreground":"var(--text-base)","gitDecoration.addedResourceForeground":"var(--syntax-diff-add)","gitDecoration.deletedResourceForeground":"var(--syntax-diff-delete)"},tokenColors:[{scope:["comment","punctuation.definition.comment","string.comment"],settings:{foreground:"var(--syntax-comment)"}},{scope:["entity.other.attribute-name"],settings:{foreground:"var(--syntax-property)"}},{scope:["constant","entity.name.constant","variable.other.constant","variable.language","entity"],settings:{foreground:"var(--syntax-constant)"}},{scope:["entity.name","meta.export.default","meta.definition.variable"],settings:{foreground:"var(--syntax-type)"}},{scope:["meta.object.member"],settings:{foreground:"var(--syntax-primitive)"}},{scope:["variable.parameter.function","meta.jsx.children","meta.block","meta.tag.attributes","entity.name.constant","meta.embedded.expression","meta.template.expression","string.other.begin.yaml","string.other.end.yaml"],settings:{foreground:"var(--syntax-punctuation)"}},{scope:["entity.name.function","support.type.primitive"],settings:{foreground:"var(--syntax-primitive)"}},{scope:["support.class.component"],settings:{foreground:"var(--syntax-type)"}},{scope:"keyword",settings:{foreground:"var(--syntax-keyword)"}},{scope:["keyword.operator","storage.type.function.arrow","punctuation.separator.key-value.css","entity.name.tag.yaml","punctuation.separator.key-value.mapping.yaml"],settings:{foreground:"var(--syntax-operator)"}},{scope:["storage","storage.type"],settings:{foreground:"var(--syntax-keyword)"}},{scope:["storage.modifier.package","storage.modifier.import","storage.type.java"],settings:{foreground:"var(--syntax-primitive)"}},{scope:["string","punctuation.definition.string","string punctuation.section.embedded source","entity.name.tag"],settings:{foreground:"var(--syntax-string)"}},{scope:"support",settings:{foreground:"var(--syntax-primitive)"}},{scope:["support.type.object.module","variable.other.object","support.type.property-name.css"],settings:{foreground:"var(--syntax-object)"}},{scope:"meta.property-name",settings:{foreground:"var(--syntax-property)"}},{scope:"variable",settings:{foreground:"var(--syntax-variable)"}},{scope:"variable.other",settings:{foreground:"var(--syntax-variable)"}},{scope:["invalid.broken","invalid.illegal","invalid.unimplemented","invalid.deprecated","message.error","markup.deleted","meta.diff.header.from-file","punctuation.definition.deleted","brackethighlighter.unmatched","token.error-token"],settings:{foreground:"var(--syntax-critical)"}},{scope:"carriage-return",settings:{foreground:"var(--syntax-keyword)"}},{scope:"string source",settings:{foreground:"var(--syntax-variable)"}},{scope:"string variable",settings:{foreground:"var(--syntax-constant)"}},{scope:["source.regexp","string.regexp","string.regexp.character-class","string.regexp constant.character.escape","string.regexp source.ruby.embedded","string.regexp string.regexp.arbitrary-repitition","string.regexp constant.character.escape"],settings:{foreground:"var(--syntax-regexp)"}},{scope:"support.constant",settings:{foreground:"var(--syntax-primitive)"}},{scope:"support.variable",settings:{foreground:"var(--syntax-variable)"}},{scope:"meta.module-reference",settings:{foreground:"var(--syntax-info)"}},{scope:"punctuation.definition.list.begin.markdown",settings:{foreground:"var(--syntax-punctuation)"}},{scope:["markup.heading","markup.heading entity.name"],settings:{fontStyle:"bold",foreground:"var(--syntax-info)"}},{scope:"markup.quote",settings:{foreground:"var(--syntax-info)"}},{scope:"markup.italic",settings:{fontStyle:"italic"}},{scope:"markup.bold",settings:{fontStyle:"bold",foreground:"var(--text-strong)"}},{scope:["markup.raw","markup.inserted","meta.diff.header.to-file","punctuation.definition.inserted","markup.changed","punctuation.definition.changed","markup.ignored","markup.untracked"],settings:{foreground:"var(--text-base)"}},{scope:"meta.diff.range",settings:{fontStyle:"bold",foreground:"var(--syntax-unknown)"}},{scope:"meta.diff.header",settings:{foreground:"var(--syntax-unknown)"}},{scope:"meta.separator",settings:{fontStyle:"bold",foreground:"var(--syntax-unknown)"}},{scope:"meta.output",settings:{foreground:"var(--syntax-unknown)"}},{scope:"meta.export.default",settings:{foreground:"var(--syntax-unknown)"}},{scope:["brackethighlighter.tag","brackethighlighter.curly","brackethighlighter.round","brackethighlighter.square","brackethighlighter.angle","brackethighlighter.quote"],settings:{foreground:"var(--syntax-unknown)"}},{scope:["constant.other.reference.link","string.other.link"],settings:{fontStyle:"underline",foreground:"var(--syntax-unknown)"}},{scope:"token.info-token",settings:{foreground:"var(--syntax-info)"}},{scope:"token.warn-token",settings:{foreground:"var(--syntax-warning)"}},{scope:"token.debug-token",settings:{foreground:"var(--syntax-info)"}}],semanticTokenColors:{comment:"var(--syntax-comment)",string:"var(--syntax-string)",number:"var(--syntax-constant)",regexp:"var(--syntax-regexp)",keyword:"var(--syntax-keyword)",variable:"var(--syntax-variable)",parameter:"var(--syntax-variable)",property:"var(--syntax-property)",function:"var(--syntax-primitive)",method:"var(--syntax-primitive)",type:"var(--syntax-type)",class:"var(--syntax-type)",namespace:"var(--syntax-type)",enumMember:"var(--syntax-primitive)","variable.constant":"var(--syntax-constant)","variable.defaultLibrary":"var(--syntax-unknown)"}}));const o$e={throwOnError:!1,strict:!1};function s$e(n){const e=n.trim();return e?/^[\d\s.,+\-–—%$€£¥¢]*$/u.test(e):!0}function Igt(n){return n.replace(/[\u2013\u2014]/g,"-")}function wwe(n,e){if(s$e(n))return null;try{return J5e.renderToString(Igt(n),{...o$e,displayMode:e})}catch{return null}}function Ngt(n){const e=n.extensions;if(!e)return n;for(const t of e){if(!("renderer"in t)||typeof t.renderer!="function")continue;const i=t.renderer;t.renderer=r=>s$e(r.text)?r.raw:i(r)}return n}function Egt(n){let e=n;const t=/\$\$([\s\S]*?)\$\$/g;e=e.replace(t,(r,o)=>wwe(o,!0)??`$$${o}$$`);const i=/(?<!\$)\$(?!\$)((?:[^$\\]|\\.)+?)\$(?!\$)/g;return e=e.replace(i,(r,o)=>wwe(o,!1)??`$${o}$`),e}function Tgt(n){const e=/(<(?:pre|code|kbd)[^>]*>[\s\S]*?<\/(?:pre|code|kbd)>)/gi;return n.split(e).map((i,r)=>r%2===1?i:Egt(i)).join("")}async function Agt(n){const e=/<pre><code(?:\s+class="language-([^"]*)")?>([\s\S]*?)<\/code><\/pre>/g,t=[...n.matchAll(e)];if(t.length===0)return n;const i=await dv({themes:["OpenCode"],langs:[],preferredHighlighter:"shiki-wasm"});let r=n;for(const o of t){const[s,a,l]=o,c=l.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#39;/g,"'");let d=a||"text";d in ow||(d="text"),i.getLoadedLanguages().includes(d)||await i.loadLanguage(d);const u=i.codeToHtml(c,{lang:d,theme:"OpenCode",tabindex:!1});r=r.replace(s,()=>u)}return r}const Dgt=new Set(["issue","file","symbol","identity","milestone","decision"]);function Rgt(){return{extensions:[{name:"wikilink",level:"inline",start(n){return n.indexOf("[[")},tokenizer(n){const e=n.match(/^\[\[([^\]]+)\]\]/);if(!e)return;const t=e[1],i=t.indexOf("|"),r=i!==-1?t.substring(0,i).trim():t.trim(),o=i!==-1?t.substring(i+1).trim():void 0,s=r.indexOf(":");let a="",l=r;if(s!==-1){const c=r.substring(0,s);Dgt.has(c)&&(a=c,l=r.substring(s+1))}return a||(/^TRL-\d+$/i.test(l)?a="issue":/^DEC-\d+$/i.test(l)?a="decision":a="entity"),{type:"wikilink",raw:e[0],namespace:a,target:l,alias:o||l}},renderer(n){return n.namespace==="entity"?`<a href="${`entity://${encodeURIComponent(n.target)}`}" class="wiki-link entity-link" data-wiki-ns="${n.namespace}" data-wiki-target="${n.target}">[[${n.alias}]]</a>`:`<a href="${`wiki://${n.namespace}/${encodeURIComponent(n.target)}`}" class="wiki-link" data-wiki-ns="${n.namespace}" data-wiki-target="${n.target}">[[${n.alias}]]</a>`}}]}}function Pgt(){return{extensions:[{name:"frontmatter",level:"block",start(n){return n.indexOf("---")===0?0:void 0},tokenizer(n){const e=Lgt(n);if(e)return{type:"frontmatter",raw:n.slice(0,n.length-e.body.length),meta:e.meta}},renderer(n){return r$e(n.meta)}}]}}const{use:a$e,provider:Ogt}=Jr({name:"Marked",init:n=>{const e=rr.use({renderer:{image({href:t,title:i,text:r}){const o=i?` title="${i}"`:"",s=r?` alt="${r}"`:"";return`<img src="${t}"${s}${o}>`},link({href:t,title:i,text:r}){const o=i?` title="${i}"`:"";if(/^(?:https?|mailto|tel|wiki|entity|data|blob):/.test(t)||t.startsWith("#"))return`<a href="${t}"${o} class="external-link" rel="noopener noreferrer">${r}</a>`;const s=t.replace(/"/g,"&quot;");return`<a href="${t}"${o} class="file-link" data-file-path="${s}">${r}</a>`}}},Rgt(),Pgt(),Ngt(Z1t({...o$e,nonStandard:!0})),X1t({async highlight(t,i){const r=await dv({themes:["OpenCode"],langs:[],preferredHighlighter:"shiki-wasm"});return i in ow||(i="text"),r.getLoadedLanguages().includes(i)||await r.loadLanguage(i),r.codeToHtml(t,{lang:i||"text",theme:"OpenCode",tabindex:!1})}}));if(n.nativeParser){const t=n.nativeParser;return{async parse(i){const r=await t(i),o=Tgt(r);return Agt(o)}}}return e}});function ri(n){const e=new TextEncoder().encode(n),t=Array.from(e,i=>String.fromCharCode(i)).join("");return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Vgt(n){const e=atob(n.replace(/-/g,"+").replace(/_/g,"/")),t=Uint8Array.from(e,i=>i.charCodeAt(0));return new TextDecoder().decode(t)}function fv(n){if(!n)return;let e=2166136261;for(let t=0;t<n.length;t++)e^=n.charCodeAt(t),e=Math.imul(e,16777619);return(e>>>0).toString(36)}function Rne(n,e=5e5){if(!n)return;if(n.length<=e)return fv(n);const t=4096,r=[0,Math.floor(n.length*.25),Math.floor(n.length*.5),Math.floor(n.length*.75),n.length-t].map(o=>{const s=Math.max(0,Math.min(n.length-t,o-Math.floor(t/2)));return fv(n.slice(s,s+t))??""}).join(":");return`${n.length}:${r}`}const l$e=`
2054
+ `,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const t=PS(e),i=J3(t);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const t=PS(e),i=J3(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};function n$e(n){const e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new e$e||null,prettyErrors:e}}function wgt(n,e={}){const{lineCounter:t,prettyErrors:i}=n$e(e),r=new P9e(t?.addNewLine),o=new R9e(e),s=Array.from(o.compose(r.parse(n)));if(i&&t)for(const a of s)a.errors.forEach(Ane(n,t)),a.warnings.forEach(Ane(n,t));return s.length>0?s:Object.assign([],{empty:!0},o.streamInfo())}function i$e(n,e={}){const{lineCounter:t,prettyErrors:i}=n$e(e),r=new P9e(t?.addNewLine),o=new R9e(e);let s=null;for(const a of o.compose(r.parse(n),!0,n.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new F9(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&t&&(s.errors.forEach(Ane(n,t)),s.warnings.forEach(Ane(n,t))),s}function _gt(n,e,t){let i;typeof e=="function"?i=e:t===void 0&&e&&typeof e=="object"&&(t=e);const r=i$e(n,t);if(!r)return null;if(r.warnings.forEach(o=>CHe(r.options.logLevel,o)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:i},t))}function xgt(n,e,t){let i=null;if(typeof e=="function"||Array.isArray(e)?i=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){const r=Math.round(t);t=r<1?void 0:r>8?{indent:8}:{indent:r}}if(n===void 0){const{keepUndefined:r}=t??e??{};if(!r)return}return v3(n)&&!i?n.toString(t):new $se(n,i,t).toString(t)}const Sgt=Object.freeze(Object.defineProperty({__proto__:null,Alias:Ese,CST:kgt,Composer:R9e,Document:$se,Lexer:QHe,LineCounter:e$e,Pair:tl,Parser:P9e,Scalar:Vn,Schema:$He,YAMLError:A9e,YAMLMap:Ec,YAMLParseError:F9,YAMLSeq:Uf,YAMLWarning:BHe,isAlias:vp,isCollection:po,isDocument:v3,isMap:fy,isNode:vo,isPair:io,isScalar:Hr,isSeq:py,parse:_gt,parseAllDocuments:wgt,parseDocument:i$e,stringify:xgt,visit:y3,visitAsync:Nse},Symbol.toStringTag,{value:"Module"})),Mgt=/^---\s*\n([\s\S]*?)\n---\s*(?:\n|$)/;function Lgt(n){const e=n.match(Mgt);if(e)try{const t=Sgt.parse(e[1]);return!t||typeof t!="object"||Array.isArray(t)?void 0:{meta:t,body:n.slice(e[0].length)}}catch{return}}function r$e(n){const e=typeof n.title=="string"?n.title:void 0,t=typeof n.description=="string"?n.description:void 0,i=Object.entries(n).filter(([o])=>o!=="title"&&o!=="description").map(([o,s])=>{const a=Array.isArray(s)?s.map(l=>`<span data-slot="frontmatter-tag">${hk(String(l))}</span>`).join(""):`<span data-slot="frontmatter-value">${hk(String(s))}</span>`;return`<div class="fm-field"><span class="fm-field-key">${hk(o)}</span><div class="fm-field-val">${a}</div></div>`}).join("");return`<details data-component="frontmatter" open><summary data-slot="frontmatter-toggle">Frontmatter</summary><div data-slot="fm-body">${e!==void 0||t!==void 0?`<div data-slot="fm-header">${e!==void 0?`<div data-slot="fm-title">${hk(e)}</div>`:""}${t!==void 0?`<div data-slot="fm-desc">${hk(t)}</div>`:""}</div>`:""}<div data-slot="fm-grid">${i}</div></div></details>`}function hk(n){return n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}y9e("OpenCode",()=>Promise.resolve({name:"OpenCode",colors:{"editor.background":"var(--color-background-stronger)","editor.foreground":"var(--text-base)","gitDecoration.addedResourceForeground":"var(--syntax-diff-add)","gitDecoration.deletedResourceForeground":"var(--syntax-diff-delete)"},tokenColors:[{scope:["comment","punctuation.definition.comment","string.comment"],settings:{foreground:"var(--syntax-comment)"}},{scope:["entity.other.attribute-name"],settings:{foreground:"var(--syntax-property)"}},{scope:["constant","entity.name.constant","variable.other.constant","variable.language","entity"],settings:{foreground:"var(--syntax-constant)"}},{scope:["entity.name","meta.export.default","meta.definition.variable"],settings:{foreground:"var(--syntax-type)"}},{scope:["meta.object.member"],settings:{foreground:"var(--syntax-primitive)"}},{scope:["variable.parameter.function","meta.jsx.children","meta.block","meta.tag.attributes","entity.name.constant","meta.embedded.expression","meta.template.expression","string.other.begin.yaml","string.other.end.yaml"],settings:{foreground:"var(--syntax-punctuation)"}},{scope:["entity.name.function","support.type.primitive"],settings:{foreground:"var(--syntax-primitive)"}},{scope:["support.class.component"],settings:{foreground:"var(--syntax-type)"}},{scope:"keyword",settings:{foreground:"var(--syntax-keyword)"}},{scope:["keyword.operator","storage.type.function.arrow","punctuation.separator.key-value.css","entity.name.tag.yaml","punctuation.separator.key-value.mapping.yaml"],settings:{foreground:"var(--syntax-operator)"}},{scope:["storage","storage.type"],settings:{foreground:"var(--syntax-keyword)"}},{scope:["storage.modifier.package","storage.modifier.import","storage.type.java"],settings:{foreground:"var(--syntax-primitive)"}},{scope:["string","punctuation.definition.string","string punctuation.section.embedded source","entity.name.tag"],settings:{foreground:"var(--syntax-string)"}},{scope:"support",settings:{foreground:"var(--syntax-primitive)"}},{scope:["support.type.object.module","variable.other.object","support.type.property-name.css"],settings:{foreground:"var(--syntax-object)"}},{scope:"meta.property-name",settings:{foreground:"var(--syntax-property)"}},{scope:"variable",settings:{foreground:"var(--syntax-variable)"}},{scope:"variable.other",settings:{foreground:"var(--syntax-variable)"}},{scope:["invalid.broken","invalid.illegal","invalid.unimplemented","invalid.deprecated","message.error","markup.deleted","meta.diff.header.from-file","punctuation.definition.deleted","brackethighlighter.unmatched","token.error-token"],settings:{foreground:"var(--syntax-critical)"}},{scope:"carriage-return",settings:{foreground:"var(--syntax-keyword)"}},{scope:"string source",settings:{foreground:"var(--syntax-variable)"}},{scope:"string variable",settings:{foreground:"var(--syntax-constant)"}},{scope:["source.regexp","string.regexp","string.regexp.character-class","string.regexp constant.character.escape","string.regexp source.ruby.embedded","string.regexp string.regexp.arbitrary-repitition","string.regexp constant.character.escape"],settings:{foreground:"var(--syntax-regexp)"}},{scope:"support.constant",settings:{foreground:"var(--syntax-primitive)"}},{scope:"support.variable",settings:{foreground:"var(--syntax-variable)"}},{scope:"meta.module-reference",settings:{foreground:"var(--syntax-info)"}},{scope:"punctuation.definition.list.begin.markdown",settings:{foreground:"var(--syntax-punctuation)"}},{scope:["markup.heading","markup.heading entity.name"],settings:{fontStyle:"bold",foreground:"var(--syntax-info)"}},{scope:"markup.quote",settings:{foreground:"var(--syntax-info)"}},{scope:"markup.italic",settings:{fontStyle:"italic"}},{scope:"markup.bold",settings:{fontStyle:"bold",foreground:"var(--text-strong)"}},{scope:["markup.raw","markup.inserted","meta.diff.header.to-file","punctuation.definition.inserted","markup.changed","punctuation.definition.changed","markup.ignored","markup.untracked"],settings:{foreground:"var(--text-base)"}},{scope:"meta.diff.range",settings:{fontStyle:"bold",foreground:"var(--syntax-unknown)"}},{scope:"meta.diff.header",settings:{foreground:"var(--syntax-unknown)"}},{scope:"meta.separator",settings:{fontStyle:"bold",foreground:"var(--syntax-unknown)"}},{scope:"meta.output",settings:{foreground:"var(--syntax-unknown)"}},{scope:"meta.export.default",settings:{foreground:"var(--syntax-unknown)"}},{scope:["brackethighlighter.tag","brackethighlighter.curly","brackethighlighter.round","brackethighlighter.square","brackethighlighter.angle","brackethighlighter.quote"],settings:{foreground:"var(--syntax-unknown)"}},{scope:["constant.other.reference.link","string.other.link"],settings:{fontStyle:"underline",foreground:"var(--syntax-unknown)"}},{scope:"token.info-token",settings:{foreground:"var(--syntax-info)"}},{scope:"token.warn-token",settings:{foreground:"var(--syntax-warning)"}},{scope:"token.debug-token",settings:{foreground:"var(--syntax-info)"}}],semanticTokenColors:{comment:"var(--syntax-comment)",string:"var(--syntax-string)",number:"var(--syntax-constant)",regexp:"var(--syntax-regexp)",keyword:"var(--syntax-keyword)",variable:"var(--syntax-variable)",parameter:"var(--syntax-variable)",property:"var(--syntax-property)",function:"var(--syntax-primitive)",method:"var(--syntax-primitive)",type:"var(--syntax-type)",class:"var(--syntax-type)",namespace:"var(--syntax-type)",enumMember:"var(--syntax-primitive)","variable.constant":"var(--syntax-constant)","variable.defaultLibrary":"var(--syntax-unknown)"}}));const o$e={throwOnError:!1,strict:!1};function s$e(n){const e=n.trim();return e?/^[\d\s.,+\-–—%$€£¥¢]*$/u.test(e):!0}function Igt(n){return n.replace(/[\u2013\u2014]/g,"-")}function wwe(n,e){if(s$e(n))return null;try{return J5e.renderToString(Igt(n),{...o$e,displayMode:e})}catch{return null}}function Ngt(n){const e=n.extensions;if(!e)return n;for(const t of e){if(!("renderer"in t)||typeof t.renderer!="function")continue;const i=t.renderer;t.renderer=function(r){return r&&typeof r=="object"&&"text"in r&&"raw"in r&&s$e(r.text)?r.raw:i.call(this,r)}}return n}function Egt(n){let e=n;const t=/\$\$([\s\S]*?)\$\$/g;e=e.replace(t,(r,o)=>wwe(o,!0)??`$$${o}$$`);const i=/(?<!\$)\$(?!\$)((?:[^$\\]|\\.)+?)\$(?!\$)/g;return e=e.replace(i,(r,o)=>wwe(o,!1)??`$${o}$`),e}function Tgt(n){const e=/(<(?:pre|code|kbd)[^>]*>[\s\S]*?<\/(?:pre|code|kbd)>)/gi;return n.split(e).map((i,r)=>r%2===1?i:Egt(i)).join("")}async function Agt(n){const e=/<pre><code(?:\s+class="language-([^"]*)")?>([\s\S]*?)<\/code><\/pre>/g,t=[...n.matchAll(e)];if(t.length===0)return n;const i=await dv({themes:["OpenCode"],langs:[],preferredHighlighter:"shiki-wasm"});let r=n;for(const o of t){const[s,a,l]=o,c=l.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#39;/g,"'");let d=a||"text";d in ow||(d="text"),i.getLoadedLanguages().includes(d)||await i.loadLanguage(d);const u=i.codeToHtml(c,{lang:d,theme:"OpenCode",tabindex:!1});r=r.replace(s,()=>u)}return r}const Dgt=new Set(["issue","file","symbol","identity","milestone","decision"]);function Rgt(){return{extensions:[{name:"wikilink",level:"inline",start(n){return n.indexOf("[[")},tokenizer(n){const e=n.match(/^\[\[([^\]]+)\]\]/);if(!e)return;const t=e[1],i=t.indexOf("|"),r=i!==-1?t.substring(0,i).trim():t.trim(),o=i!==-1?t.substring(i+1).trim():void 0,s=r.indexOf(":");let a="",l=r;if(s!==-1){const c=r.substring(0,s);Dgt.has(c)&&(a=c,l=r.substring(s+1))}return a||(/^TRL-\d+$/i.test(l)?a="issue":/^DEC-\d+$/i.test(l)?a="decision":a="entity"),{type:"wikilink",raw:e[0],namespace:a,target:l,alias:o||l}},renderer(n){return n.namespace==="entity"?`<a href="${`entity://${encodeURIComponent(n.target)}`}" class="wiki-link entity-link" data-wiki-ns="${n.namespace}" data-wiki-target="${n.target}">[[${n.alias}]]</a>`:`<a href="${`wiki://${n.namespace}/${encodeURIComponent(n.target)}`}" class="wiki-link" data-wiki-ns="${n.namespace}" data-wiki-target="${n.target}">[[${n.alias}]]</a>`}}]}}function Pgt(){return{extensions:[{name:"frontmatter",level:"block",start(n){return n.indexOf("---")===0?0:void 0},tokenizer(n){const e=Lgt(n);if(e)return{type:"frontmatter",raw:n.slice(0,n.length-e.body.length),meta:e.meta}},renderer(n){return r$e(n.meta)}}]}}const{use:a$e,provider:Ogt}=Jr({name:"Marked",init:n=>{const e=rr.use({renderer:{image({href:t,title:i,text:r}){const o=i?` title="${i}"`:"",s=r?` alt="${r}"`:"";return`<img src="${t}"${s}${o}>`},link({href:t,title:i,text:r}){const o=i?` title="${i}"`:"";if(/^(?:https?|mailto|tel|wiki|entity|data|blob):/.test(t)||t.startsWith("#"))return`<a href="${t}"${o} class="external-link" rel="noopener noreferrer">${r}</a>`;const s=t.replace(/"/g,"&quot;");return`<a href="${t}"${o} class="file-link" data-file-path="${s}">${r}</a>`}}},Rgt(),Pgt(),Ngt(Z1t({...o$e,nonStandard:!0})),X1t({async highlight(t,i){const r=await dv({themes:["OpenCode"],langs:[],preferredHighlighter:"shiki-wasm"});return i in ow||(i="text"),r.getLoadedLanguages().includes(i)||await r.loadLanguage(i),r.codeToHtml(t,{lang:i||"text",theme:"OpenCode",tabindex:!1})}}));if(n.nativeParser){const t=n.nativeParser;return{async parse(i){const r=await t(i),o=Tgt(r);return Agt(o)}}}return e}});function ri(n){const e=new TextEncoder().encode(n),t=Array.from(e,i=>String.fromCharCode(i)).join("");return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Vgt(n){const e=atob(n.replace(/-/g,"+").replace(/_/g,"/")),t=Uint8Array.from(e,i=>i.charCodeAt(0));return new TextDecoder().decode(t)}function fv(n){if(!n)return;let e=2166136261;for(let t=0;t<n.length;t++)e^=n.charCodeAt(t),e=Math.imul(e,16777619);return(e>>>0).toString(36)}function Rne(n,e=5e5){if(!n)return;if(n.length<=e)return fv(n);const t=4096,r=[0,Math.floor(n.length*.25),Math.floor(n.length*.5),Math.floor(n.length*.75),n.length-t].map(o=>{const s=Math.max(0,Math.min(n.length-t,o-Math.floor(t/2)));return fv(n.slice(s,s+t))??""}).join(":");return`${n.length}:${r}`}const l$e=`
2055
2055
  [data-annotation-slot] {
2056
2056
  padding: 12px;
2057
2057
  box-sizing: border-box;
@@ -2543,7 +2543,7 @@ $$`:`${n}$$`},_Nn=n=>CNn(n)%2===0?n:wNn(n),xNn=n=>bNn(n)%2===1?`${n}$`:n,SNn=(n,
2543
2543
  `);if(e===-1)return n;let t=n.substring(e+1),i=n.substring(0,e),r=t.trim();if(LNn.test(r)&&!t.match(INn)){let o=i.split(`
2544
2544
  `).at(-1);if(o&&o.trim().length>0)return`${n}​`}if(NNn.test(r)&&!t.match(ENn)){let o=i.split(`
2545
2545
  `).at(-1);if(o&&o.trim().length>0)return`${n}​`}return n},ANn=new RegExp("(?<=[\\p{L}\\p{N}_])~(?!~)(?=[\\p{L}\\p{N}_])","gu"),DNn=n=>!n||typeof n!="string"||!n.includes("~")?n:n.replace(ANn,(e,t)=>Pl(n,t)?e:"\\~"),RNn=n=>{var e,t;let i=n.match(WIn);if(i){let r=i[2];if(!r||S3.test(r))return n;let o=n.lastIndexOf(i[1]);if(Pl(n,o)||Kf(n,o))return n;if(((e=n.match(_Se))==null?void 0:e.length)%2===1)return`${n}~~`}else{let r=n.match(GIn);if(r){let o=n.lastIndexOf(r[0].slice(0,2));if(Pl(n,o)||Kf(n,o))return n;if(((t=n.match(_Se))==null?void 0:t.length)%2===1)return`${n}~`}}return n},Ade=n=>n!==!1,PNn=n=>n===!0,gl={SINGLE_TILDE:0,COMPARISON_OPERATORS:5,HTML_TAGS:10,SETEXT_HEADINGS:15,LINKS:20,BOLD_ITALIC:30,BOLD:35,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,INLINE_KATEX:75,DEFAULT:100},ONn=[{handler:{name:"singleTilde",handle:DNn,priority:gl.SINGLE_TILDE},optionKey:"singleTilde"},{handler:{name:"comparisonOperators",handle:VIn,priority:gl.COMPARISON_OPERATORS},optionKey:"comparisonOperators"},{handler:{name:"htmlTags",handle:mNn,priority:gl.HTML_TAGS},optionKey:"htmlTags"},{handler:{name:"setextHeadings",handle:TNn,priority:gl.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:vKe,priority:gl.LINKS},optionKey:"links",earlyReturn:n=>n.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:pNn,priority:gl.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:rNn,priority:gl.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:sNn,priority:gl.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:lNn,priority:gl.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:uNn,priority:gl.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:kNn,priority:gl.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:RNn,priority:gl.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:_Nn,priority:gl.KATEX},optionKey:"katex"},{handler:{name:"inlineKatex",handle:xNn,priority:gl.INLINE_KATEX},optionKey:"inlineKatex"}],VNn=n=>{var e;let t=(e=n?.linkMode)!=null?e:"protocol";return ONn.filter(({handler:i,optionKey:r})=>i.name==="links"?Ade(n?.links)||Ade(n?.images):i.name==="inlineKatex"?PNn(n?.inlineKatex):Ade(n?.[r])).map(({handler:i,earlyReturn:r})=>i.name==="links"?{handler:dKe(cKe({},i),{handle:o=>vKe(o,t)}),earlyReturn:t==="protocol"?r:void 0}:{handler:i,earlyReturn:r})},HNn=(n,e)=>{var t;if(!n||typeof n!="string")return n;let i=n.endsWith(" ")&&!n.endsWith(" ")?n.slice(0,-1):n,r=VNn(e),o=((t=e?.handlers)!=null?t:[]).map(a=>{var l;return{handler:dKe(cKe({},a),{priority:(l=a.priority)!=null?l:gl.DEFAULT}),earlyReturn:void 0}}),s=[...r,...o].sort((a,l)=>{var c,d;return((c=a.handler.priority)!=null?c:0)-((d=l.handler.priority)!=null?d:0)});for(let{handler:a,earlyReturn:l}of s)if(i=a.handle(i),l!=null&&l(i))return i;return i},$Nn=HNn;function FNn(n){return/^\[[^\]]+\]:\s+\S+/m.test(n)||/^\[\^[^\]]+\]:\s+/m.test(n)}function zNn(n){const e=n.match(/^[ \t]{0,3}(`{3,}|~{3,})/);if(!e)return!1;const t=e[1];if(!t)return!1;const i=t[0],r=t.length,o=n.trimEnd().split(`
2546
- `).at(-1)?.trim()??"";return!new RegExp(`^[\\t ]{0,3}${i}{${r},}[\\t ]*$`).test(o)}function MSe(n){return $Nn(n,{linkMode:"text-only"})}function BNn(n,e){if(!e)return[{raw:n,src:n,mode:"full"}];const t=MSe(n);if(FNn(n))return[{raw:n,src:t,mode:"live"}];const i=rr.lexer(n),r=i.findLastIndex(l=>l.type!=="space");if(r<0)return[{raw:n,src:t,mode:"live"}];const o=i[r];if(!o||o.type!=="code")return[{raw:n,src:t,mode:"live"}];const s=o;if(!zNn(s.raw))return[{raw:n,src:t,mode:"live"}];const a=i.slice(0,r).map(l=>l.raw).join("");return a?[{raw:a,src:MSe(a),mode:"live"},{raw:s.raw,src:s.raw,mode:"live"}]:[{raw:s.raw,src:s.raw,mode:"live"}]}let jNn=0,LSe=Promise.resolve(),Mk=null;function WNn(){return Mk||(Mk=document.createElement("div"),Mk.style.cssText="visibility:hidden;position:fixed;top:-9999px;left:-9999px;width:0;height:0;overflow:hidden;",document.body.appendChild(Mk)),Mk}async function qNn(){return(await z(()=>import("./mermaid.core-8TjZbLRD.js").then(e=>e.br),__vite__mapDeps([97,98]))).default}let Dde;function UNn(){return Dde||(Dde=qNn()),Dde}function yKe(n,e){const t=LSe.then(async()=>{const i=await UNn();i.initialize({startOnLoad:!1,theme:e?"dark":"default",fontFamily:"inherit",securityLevel:"loose"});const r=`mermaid-${++jNn}`,{svg:o}=await i.render(r,n,WNn());return o}).catch(i=>{throw i});return LSe=t.then(()=>{},()=>{}),t}var dte={exports:{}};/* @license
2546
+ `).at(-1)?.trim()??"";return!new RegExp(`^[\\t ]{0,3}${i}{${r},}[\\t ]*$`).test(o)}function MSe(n){return $Nn(n,{linkMode:"text-only"})}function BNn(n,e){if(!e)return[{raw:n,src:n,mode:"full"}];const t=MSe(n);if(FNn(n))return[{raw:n,src:t,mode:"live"}];const i=rr.lexer(n),r=i.findLastIndex(l=>l.type!=="space");if(r<0)return[{raw:n,src:t,mode:"live"}];const o=i[r];if(!o||o.type!=="code")return[{raw:n,src:t,mode:"live"}];const s=o;if(!zNn(s.raw))return[{raw:n,src:t,mode:"live"}];const a=i.slice(0,r).map(l=>l.raw).join("");return a?[{raw:a,src:MSe(a),mode:"live"},{raw:s.raw,src:s.raw,mode:"live"}]:[{raw:s.raw,src:s.raw,mode:"live"}]}let jNn=0,LSe=Promise.resolve(),Mk=null;function WNn(){return Mk||(Mk=document.createElement("div"),Mk.style.cssText="visibility:hidden;position:fixed;top:-9999px;left:-9999px;width:0;height:0;overflow:hidden;",document.body.appendChild(Mk)),Mk}async function qNn(){return(await z(()=>import("./mermaid.core-D4lf0itM.js").then(e=>e.br),__vite__mapDeps([97,98]))).default}let Dde;function UNn(){return Dde||(Dde=qNn()),Dde}function yKe(n,e){const t=LSe.then(async()=>{const i=await UNn();i.initialize({startOnLoad:!1,theme:e?"dark":"default",fontFamily:"inherit",securityLevel:"loose"});const r=`mermaid-${++jNn}`,{svg:o}=await i.render(r,n,WNn());return o}).catch(i=>{throw i});return LSe=t.then(()=>{},()=>{}),t}var dte={exports:{}};/* @license
2547
2547
  Papa Parse
2548
2548
  v5.5.3
2549
2549
  https://github.com/mholt/PapaParse
@@ -3387,27 +3387,27 @@ ${e.toString()}`}}class koe{constructor(e=new By,t=!1,i,r=$ii){this._services=e,
3387
3387
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
3388
3388
  * Released under the MIT license
3389
3389
  * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
3390
- *-----------------------------------------------------------------------------*/var U1i=Object.defineProperty,Z1i=Object.getOwnPropertyDescriptor,K1i=Object.getOwnPropertyNames,G1i=Object.prototype.hasOwnProperty,X1i=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of K1i(e))!G1i.call(n,r)&&r!==t&&U1i(n,r,{get:()=>e[r],enumerable:!(i=Z1i(e,r))||i.enumerable});return n},Y1i=(n,e,t)=>(X1i(n,e,"default"),t),OC={};Y1i(OC,Kx);var Ant={},The={},J1i=class Dnt{static getOrCreate(e){return The[e]||(The[e]=new Dnt(e)),The[e]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((t,i)=>{this._lazyLoadPromiseResolve=t,this._lazyLoadPromiseReject=i})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,Ant[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}};function pt(n){const e=n.id;Ant[e]=n,OC.languages.register(n);const t=J1i.getOrCreate(e);OC.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),OC.languages.onLanguageEncountered(e,async()=>{const i=await t.load();OC.languages.setLanguageConfiguration(e,i.conf)})}pt({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>z(()=>import("./abap-BrgZPUOV.js"),[])});pt({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>z(()=>import("./apex-DyP6w7ZV.js"),[])});pt({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>z(()=>import("./azcli-BaLxmfj-.js"),[])});pt({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>z(()=>import("./bat-CFOPXBzS.js"),[])});pt({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>z(()=>import("./bicep-BfEKNvv3.js"),[])});pt({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>z(()=>import("./cameligo-BFG1Mk7z.js"),[])});pt({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>z(()=>import("./clojure-DTECt2xU.js"),[])});pt({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>z(()=>import("./coffee-CDGzqUPQ.js"),[])});pt({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>z(()=>import("./cpp-CLLBncYj.js"),[])});pt({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>z(()=>import("./cpp-CLLBncYj.js"),[])});pt({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>z(()=>import("./csharp-dUCx_-0o.js"),[])});pt({id:"csp",extensions:[".csp"],aliases:["CSP","csp"],loader:()=>z(()=>import("./csp-5Rap-vPy.js"),[])});pt({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>z(()=>import("./css-D3h14YRZ.js"),[])});pt({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>z(()=>import("./cypher-DrQuvNYM.js"),[])});pt({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>z(()=>import("./dart-CFKIUWau.js"),[])});pt({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>z(()=>import("./dockerfile-Zznr-cwX.js"),[])});pt({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>z(()=>import("./ecl-Ce3n6wWz.js"),[])});pt({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>z(()=>import("./elixir-deUWdS0T.js"),[])});pt({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>z(()=>import("./flow9-i9-g7ZhI.js"),[])});pt({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>z(()=>import("./fsharp-CzKuDChf.js"),[])});pt({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>z(()=>import("./freemarker2-SvgbhnJ2.js"),[]).then(n=>n.TagAutoInterpolationDollar)});pt({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>z(()=>import("./freemarker2-SvgbhnJ2.js"),[]).then(n=>n.TagAngleInterpolationDollar)});pt({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>z(()=>import("./freemarker2-SvgbhnJ2.js"),[]).then(n=>n.TagBracketInterpolationDollar)});pt({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>z(()=>import("./freemarker2-SvgbhnJ2.js"),[]).then(n=>n.TagAngleInterpolationBracket)});pt({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>z(()=>import("./freemarker2-SvgbhnJ2.js"),[]).then(n=>n.TagBracketInterpolationBracket)});pt({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>z(()=>import("./freemarker2-SvgbhnJ2.js"),[]).then(n=>n.TagAutoInterpolationDollar)});pt({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>z(()=>import("./freemarker2-SvgbhnJ2.js"),[]).then(n=>n.TagAutoInterpolationBracket)});pt({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>z(()=>import("./go-Cphgjts3.js"),[])});pt({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>z(()=>import("./graphql-Cg7bfA9N.js"),[])});pt({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>z(()=>import("./handlebars-B2ONVutZ.js"),[])});pt({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>z(()=>import("./hcl-0cvrggvQ.js"),[])});pt({id:"html",extensions:[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],aliases:["HTML","htm","html","xhtml"],mimetypes:["text/html","text/x-jshtm","text/template","text/ng-template"],loader:()=>z(()=>import("./html-DmnoTn9a.js"),[])});pt({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>z(()=>import("./ini-Drc7WvVn.js"),[])});pt({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>z(()=>import("./java-B_fMsGYe.js"),[])});pt({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>z(()=>import("./javascript-0JqfZ-ZK.js"),__vite__mapDeps([99,100]))});pt({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>z(()=>import("./julia-Bqgm2twL.js"),[])});pt({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>z(()=>import("./kotlin-BSkB5QuD.js"),[])});pt({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>z(()=>import("./less-BsTHnhdd.js"),[])});pt({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>z(()=>import("./lexon-YWi4-JPR.js"),[])});pt({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>z(()=>import("./lua-nf6ki56Z.js"),[])});pt({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>z(()=>import("./liquid-DL0F7vFb.js"),[])});pt({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>z(()=>import("./m3-Cpb6xl2v.js"),[])});pt({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>z(()=>import("./markdown-DSZPf7rp.js"),[])});pt({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>z(()=>import("./mdx-BTXLl_TQ.js"),[])});pt({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>z(()=>import("./mips-B_c3zf-v.js"),[])});pt({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>z(()=>import("./msdax-rUNN04Wq.js"),[])});pt({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>z(()=>import("./mysql-DDwshQtU.js"),[])});pt({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>z(()=>import("./objective-c-B5zXfXm9.js"),[])});pt({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>z(()=>import("./pascal-CXOwvkN_.js"),[])});pt({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>z(()=>import("./pascaligo-Bc-ZgV77.js"),[])});pt({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>z(()=>import("./perl-CwNk8-XU.js"),[])});pt({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>z(()=>import("./pgsql-tGk8EFnU.js"),[])});pt({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>z(()=>import("./php-CpIb_Oan.js"),[])});pt({id:"pla",extensions:[".pla"],loader:()=>z(()=>import("./pla-B03wrqEc.js"),[])});pt({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>z(()=>import("./postiats-BKlk5iyT.js"),[])});pt({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>z(()=>import("./powerquery-Bhzvs7bI.js"),[])});pt({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>z(()=>import("./powershell-Dd3NCNK9.js"),[])});pt({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>z(()=>import("./protobuf-COyEY5Pt.js"),[])});pt({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>z(()=>import("./pug-BaJupSGV.js"),[])});pt({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>z(()=>import("./python-BTFINbZn.js"),[])});pt({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>z(()=>import("./qsharp-DXyYeYxl.js"),[])});pt({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>z(()=>import("./r-CdQndTaG.js"),[])});pt({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>z(()=>import("./razor-BvR9Hnqa.js"),[])});pt({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>z(()=>import("./redis-CVwtpugi.js"),[])});pt({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>z(()=>import("./redshift-25W9uPmb.js"),[])});pt({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>z(()=>import("./restructuredtext-DfzH4Xui.js"),[])});pt({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>z(()=>import("./ruby-Cp1zYvxS.js"),[])});pt({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>z(()=>import("./rust-D5C2fndG.js"),[])});pt({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>z(()=>import("./sb-CDntyWJ8.js"),[])});pt({id:"scala",extensions:[".scala",".sc",".sbt"],aliases:["Scala","scala","SBT","Sbt","sbt","Dotty","dotty"],mimetypes:["text/x-scala-source","text/x-scala","text/x-sbt","text/x-dotty"],loader:()=>z(()=>import("./scala-BoFRg7Ot.js"),[])});pt({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>z(()=>import("./scheme-Bio4gycK.js"),[])});pt({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>z(()=>import("./scss-4Ik7cdeQ.js"),[])});pt({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>z(()=>import("./shell-CX-rkNHf.js"),[])});pt({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>z(()=>import("./solidity-Tw7wswEv.js"),[])});pt({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>z(()=>import("./sophia-C5WLch3f.js"),[])});pt({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>z(()=>import("./sparql-DHaeiCBh.js"),[])});pt({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>z(()=>import("./sql-CCSDG5nI.js"),[])});pt({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>z(()=>import("./st-pnP8ivHi.js"),[])});pt({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>z(()=>import("./swift-DwJ7jVG9.js"),[])});pt({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>z(()=>import("./systemverilog-B9Xyijhd.js"),[])});pt({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>z(()=>import("./systemverilog-B9Xyijhd.js"),[])});pt({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>z(()=>import("./tcl-DnHyzjbg.js"),[])});pt({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>z(()=>import("./twig-CPajHgWi.js"),[])});pt({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>z(()=>import("./typescript-I4Xe9fRj.js"),[])});pt({id:"typespec",extensions:[".tsp"],aliases:["TypeSpec"],loader:()=>z(()=>import("./typespec-D-MeaMDU.js"),[])});pt({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>z(()=>import("./vb-DgyLZaXg.js"),[])});pt({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>z(()=>import("./wgsl-DYQUnd45.js"),[])});pt({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)",aliases:["XML","xml"],mimetypes:["text/xml","application/xml","application/xaml+xml","application/xml-dtd"],loader:()=>z(()=>import("./xml-Z8-6vgF3.js"),[])});pt({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>z(()=>import("./yaml-CfXlO5Lk.js"),[])});/*!-----------------------------------------------------------------------------
3390
+ *-----------------------------------------------------------------------------*/var U1i=Object.defineProperty,Z1i=Object.getOwnPropertyDescriptor,K1i=Object.getOwnPropertyNames,G1i=Object.prototype.hasOwnProperty,X1i=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of K1i(e))!G1i.call(n,r)&&r!==t&&U1i(n,r,{get:()=>e[r],enumerable:!(i=Z1i(e,r))||i.enumerable});return n},Y1i=(n,e,t)=>(X1i(n,e,"default"),t),OC={};Y1i(OC,Kx);var Ant={},The={},J1i=class Dnt{static getOrCreate(e){return The[e]||(The[e]=new Dnt(e)),The[e]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((t,i)=>{this._lazyLoadPromiseResolve=t,this._lazyLoadPromiseReject=i})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,Ant[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}};function pt(n){const e=n.id;Ant[e]=n,OC.languages.register(n);const t=J1i.getOrCreate(e);OC.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),OC.languages.onLanguageEncountered(e,async()=>{const i=await t.load();OC.languages.setLanguageConfiguration(e,i.conf)})}pt({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>z(()=>import("./abap-BrgZPUOV.js"),[])});pt({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>z(()=>import("./apex-DyP6w7ZV.js"),[])});pt({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>z(()=>import("./azcli-BaLxmfj-.js"),[])});pt({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>z(()=>import("./bat-CFOPXBzS.js"),[])});pt({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>z(()=>import("./bicep-BfEKNvv3.js"),[])});pt({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>z(()=>import("./cameligo-BFG1Mk7z.js"),[])});pt({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>z(()=>import("./clojure-DTECt2xU.js"),[])});pt({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>z(()=>import("./coffee-CDGzqUPQ.js"),[])});pt({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>z(()=>import("./cpp-CLLBncYj.js"),[])});pt({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>z(()=>import("./cpp-CLLBncYj.js"),[])});pt({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>z(()=>import("./csharp-dUCx_-0o.js"),[])});pt({id:"csp",extensions:[".csp"],aliases:["CSP","csp"],loader:()=>z(()=>import("./csp-5Rap-vPy.js"),[])});pt({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>z(()=>import("./css-D3h14YRZ.js"),[])});pt({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>z(()=>import("./cypher-DrQuvNYM.js"),[])});pt({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>z(()=>import("./dart-CFKIUWau.js"),[])});pt({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>z(()=>import("./dockerfile-Zznr-cwX.js"),[])});pt({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>z(()=>import("./ecl-Ce3n6wWz.js"),[])});pt({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>z(()=>import("./elixir-deUWdS0T.js"),[])});pt({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>z(()=>import("./flow9-i9-g7ZhI.js"),[])});pt({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>z(()=>import("./fsharp-CzKuDChf.js"),[])});pt({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>z(()=>import("./freemarker2-C3EFf35k.js"),[]).then(n=>n.TagAutoInterpolationDollar)});pt({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>z(()=>import("./freemarker2-C3EFf35k.js"),[]).then(n=>n.TagAngleInterpolationDollar)});pt({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>z(()=>import("./freemarker2-C3EFf35k.js"),[]).then(n=>n.TagBracketInterpolationDollar)});pt({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>z(()=>import("./freemarker2-C3EFf35k.js"),[]).then(n=>n.TagAngleInterpolationBracket)});pt({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>z(()=>import("./freemarker2-C3EFf35k.js"),[]).then(n=>n.TagBracketInterpolationBracket)});pt({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>z(()=>import("./freemarker2-C3EFf35k.js"),[]).then(n=>n.TagAutoInterpolationDollar)});pt({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>z(()=>import("./freemarker2-C3EFf35k.js"),[]).then(n=>n.TagAutoInterpolationBracket)});pt({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>z(()=>import("./go-Cphgjts3.js"),[])});pt({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>z(()=>import("./graphql-Cg7bfA9N.js"),[])});pt({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>z(()=>import("./handlebars-CA6b5iLA.js"),[])});pt({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>z(()=>import("./hcl-0cvrggvQ.js"),[])});pt({id:"html",extensions:[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],aliases:["HTML","htm","html","xhtml"],mimetypes:["text/html","text/x-jshtm","text/template","text/ng-template"],loader:()=>z(()=>import("./html-DANgOdjw.js"),[])});pt({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>z(()=>import("./ini-Drc7WvVn.js"),[])});pt({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>z(()=>import("./java-B_fMsGYe.js"),[])});pt({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>z(()=>import("./javascript-D1un54bB.js"),__vite__mapDeps([99,100]))});pt({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>z(()=>import("./julia-Bqgm2twL.js"),[])});pt({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>z(()=>import("./kotlin-BSkB5QuD.js"),[])});pt({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>z(()=>import("./less-BsTHnhdd.js"),[])});pt({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>z(()=>import("./lexon-YWi4-JPR.js"),[])});pt({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>z(()=>import("./lua-nf6ki56Z.js"),[])});pt({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>z(()=>import("./liquid-DthIi4mI.js"),[])});pt({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>z(()=>import("./m3-Cpb6xl2v.js"),[])});pt({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>z(()=>import("./markdown-DSZPf7rp.js"),[])});pt({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>z(()=>import("./mdx-NVm6QFMK.js"),[])});pt({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>z(()=>import("./mips-B_c3zf-v.js"),[])});pt({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>z(()=>import("./msdax-rUNN04Wq.js"),[])});pt({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>z(()=>import("./mysql-DDwshQtU.js"),[])});pt({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>z(()=>import("./objective-c-B5zXfXm9.js"),[])});pt({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>z(()=>import("./pascal-CXOwvkN_.js"),[])});pt({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>z(()=>import("./pascaligo-Bc-ZgV77.js"),[])});pt({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>z(()=>import("./perl-CwNk8-XU.js"),[])});pt({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>z(()=>import("./pgsql-tGk8EFnU.js"),[])});pt({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>z(()=>import("./php-CpIb_Oan.js"),[])});pt({id:"pla",extensions:[".pla"],loader:()=>z(()=>import("./pla-B03wrqEc.js"),[])});pt({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>z(()=>import("./postiats-BKlk5iyT.js"),[])});pt({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>z(()=>import("./powerquery-Bhzvs7bI.js"),[])});pt({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>z(()=>import("./powershell-Dd3NCNK9.js"),[])});pt({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>z(()=>import("./protobuf-COyEY5Pt.js"),[])});pt({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>z(()=>import("./pug-BaJupSGV.js"),[])});pt({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>z(()=>import("./python-CFkmznMB.js"),[])});pt({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>z(()=>import("./qsharp-DXyYeYxl.js"),[])});pt({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>z(()=>import("./r-CdQndTaG.js"),[])});pt({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>z(()=>import("./razor-BUbreB_f.js"),[])});pt({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>z(()=>import("./redis-CVwtpugi.js"),[])});pt({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>z(()=>import("./redshift-25W9uPmb.js"),[])});pt({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>z(()=>import("./restructuredtext-DfzH4Xui.js"),[])});pt({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>z(()=>import("./ruby-Cp1zYvxS.js"),[])});pt({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>z(()=>import("./rust-D5C2fndG.js"),[])});pt({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>z(()=>import("./sb-CDntyWJ8.js"),[])});pt({id:"scala",extensions:[".scala",".sc",".sbt"],aliases:["Scala","scala","SBT","Sbt","sbt","Dotty","dotty"],mimetypes:["text/x-scala-source","text/x-scala","text/x-sbt","text/x-dotty"],loader:()=>z(()=>import("./scala-BoFRg7Ot.js"),[])});pt({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>z(()=>import("./scheme-Bio4gycK.js"),[])});pt({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>z(()=>import("./scss-4Ik7cdeQ.js"),[])});pt({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>z(()=>import("./shell-CX-rkNHf.js"),[])});pt({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>z(()=>import("./solidity-Tw7wswEv.js"),[])});pt({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>z(()=>import("./sophia-C5WLch3f.js"),[])});pt({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>z(()=>import("./sparql-DHaeiCBh.js"),[])});pt({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>z(()=>import("./sql-CCSDG5nI.js"),[])});pt({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>z(()=>import("./st-pnP8ivHi.js"),[])});pt({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>z(()=>import("./swift-DwJ7jVG9.js"),[])});pt({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>z(()=>import("./systemverilog-B9Xyijhd.js"),[])});pt({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>z(()=>import("./systemverilog-B9Xyijhd.js"),[])});pt({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>z(()=>import("./tcl-DnHyzjbg.js"),[])});pt({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>z(()=>import("./twig-CPajHgWi.js"),[])});pt({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>z(()=>import("./typescript-DjKIL5Ul.js"),[])});pt({id:"typespec",extensions:[".tsp"],aliases:["TypeSpec"],loader:()=>z(()=>import("./typespec-D-MeaMDU.js"),[])});pt({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>z(()=>import("./vb-DgyLZaXg.js"),[])});pt({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>z(()=>import("./wgsl-DYQUnd45.js"),[])});pt({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)",aliases:["XML","xml"],mimetypes:["text/xml","application/xml","application/xaml+xml","application/xml-dtd"],loader:()=>z(()=>import("./xml-8Tvr_clo.js"),[])});pt({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>z(()=>import("./yaml-DYku7XRU.js"),[])});/*!-----------------------------------------------------------------------------
3391
3391
  * Copyright (c) Microsoft Corporation. All rights reserved.
3392
3392
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
3393
3393
  * Released under the MIT license
3394
3394
  * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
3395
- *-----------------------------------------------------------------------------*/var Q1i=Object.defineProperty,edi=Object.getOwnPropertyDescriptor,tdi=Object.getOwnPropertyNames,ndi=Object.prototype.hasOwnProperty,idi=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of tdi(e))!ndi.call(n,r)&&r!==t&&Q1i(n,r,{get:()=>e[r],enumerable:!(i=edi(e,r))||i.enumerable});return n},rdi=(n,e,t)=>(idi(n,e,"default"),t),qy={};rdi(qy,Kx);var Xye=class{constructor(e,t,i){this._onDidChange=new qy.Emitter,this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this.options}get options(){return this._options}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(e){this.setOptions(e)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},Yye={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"},data:{useDefaultDataProvider:!0},format:{newlineBetweenSelectors:!0,newlineBetweenRules:!0,spaceAroundSelectorSeparator:!1,braceStyle:"collapse",maxPreserveNewLines:void 0,preserveNewLines:!0}},Jye={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0,documentFormattingEdits:!0,documentRangeFormattingEdits:!0},Rnt=new Xye("css",Yye,Jye),Pnt=new Xye("scss",Yye,Jye),Ont=new Xye("less",Yye,Jye);qy.languages.css={cssDefaults:Rnt,lessDefaults:Ont,scssDefaults:Pnt};function Qye(){return z(()=>import("./cssMode-5IvXkP6K.js"),[])}qy.languages.onLanguage("less",()=>{Qye().then(n=>n.setupMode(Ont))});qy.languages.onLanguage("scss",()=>{Qye().then(n=>n.setupMode(Pnt))});qy.languages.onLanguage("css",()=>{Qye().then(n=>n.setupMode(Rnt))});/*!-----------------------------------------------------------------------------
3395
+ *-----------------------------------------------------------------------------*/var Q1i=Object.defineProperty,edi=Object.getOwnPropertyDescriptor,tdi=Object.getOwnPropertyNames,ndi=Object.prototype.hasOwnProperty,idi=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of tdi(e))!ndi.call(n,r)&&r!==t&&Q1i(n,r,{get:()=>e[r],enumerable:!(i=edi(e,r))||i.enumerable});return n},rdi=(n,e,t)=>(idi(n,e,"default"),t),qy={};rdi(qy,Kx);var Xye=class{constructor(e,t,i){this._onDidChange=new qy.Emitter,this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this.options}get options(){return this._options}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(e){this.setOptions(e)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},Yye={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"},data:{useDefaultDataProvider:!0},format:{newlineBetweenSelectors:!0,newlineBetweenRules:!0,spaceAroundSelectorSeparator:!1,braceStyle:"collapse",maxPreserveNewLines:void 0,preserveNewLines:!0}},Jye={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0,documentFormattingEdits:!0,documentRangeFormattingEdits:!0},Rnt=new Xye("css",Yye,Jye),Pnt=new Xye("scss",Yye,Jye),Ont=new Xye("less",Yye,Jye);qy.languages.css={cssDefaults:Rnt,lessDefaults:Ont,scssDefaults:Pnt};function Qye(){return z(()=>import("./cssMode-6nhemA1L.js"),[])}qy.languages.onLanguage("less",()=>{Qye().then(n=>n.setupMode(Ont))});qy.languages.onLanguage("scss",()=>{Qye().then(n=>n.setupMode(Pnt))});qy.languages.onLanguage("css",()=>{Qye().then(n=>n.setupMode(Rnt))});/*!-----------------------------------------------------------------------------
3396
3396
  * Copyright (c) Microsoft Corporation. All rights reserved.
3397
3397
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
3398
3398
  * Released under the MIT license
3399
3399
  * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
3400
- *-----------------------------------------------------------------------------*/var odi=Object.defineProperty,sdi=Object.getOwnPropertyDescriptor,adi=Object.getOwnPropertyNames,ldi=Object.prototype.hasOwnProperty,cdi=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of adi(e))!ldi.call(n,r)&&r!==t&&odi(n,r,{get:()=>e[r],enumerable:!(i=sdi(e,r))||i.enumerable});return n},ddi=(n,e,t)=>(cdi(n,e,"default"),t),cce={};ddi(cce,Kx);var udi=class{constructor(e,t,i){this._onDidChange=new cce.Emitter,this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},hdi={tabSize:4,insertSpaces:!1,wrapLineLength:120,unformatted:'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',contentUnformatted:"pre",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:void 0,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},dce={format:hdi,suggest:{},data:{useDefaultDataProvider:!0}};function uce(n){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:n===Wb,documentFormattingEdits:n===Wb,documentRangeFormattingEdits:n===Wb}}var Wb="html",ZAe="handlebars",KAe="razor",Vnt=hce(Wb,dce,uce(Wb)),fdi=Vnt.defaults,Hnt=hce(ZAe,dce,uce(ZAe)),pdi=Hnt.defaults,$nt=hce(KAe,dce,uce(KAe)),gdi=$nt.defaults;cce.languages.html={htmlDefaults:fdi,razorDefaults:gdi,handlebarDefaults:pdi,htmlLanguageService:Vnt,handlebarLanguageService:Hnt,razorLanguageService:$nt,registerHTMLLanguageService:hce};function mdi(){return z(()=>import("./htmlMode-COQ2FePW.js"),[])}function hce(n,e=dce,t=uce(n)){const i=new udi(n,e,t);let r;const o=cce.languages.onLanguage(n,async()=>{r=(await mdi()).setupMode(i)});return{defaults:i,dispose(){o.dispose(),r?.dispose(),r=void 0}}}/*!-----------------------------------------------------------------------------
3400
+ *-----------------------------------------------------------------------------*/var odi=Object.defineProperty,sdi=Object.getOwnPropertyDescriptor,adi=Object.getOwnPropertyNames,ldi=Object.prototype.hasOwnProperty,cdi=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of adi(e))!ldi.call(n,r)&&r!==t&&odi(n,r,{get:()=>e[r],enumerable:!(i=sdi(e,r))||i.enumerable});return n},ddi=(n,e,t)=>(cdi(n,e,"default"),t),cce={};ddi(cce,Kx);var udi=class{constructor(e,t,i){this._onDidChange=new cce.Emitter,this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},hdi={tabSize:4,insertSpaces:!1,wrapLineLength:120,unformatted:'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',contentUnformatted:"pre",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:void 0,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},dce={format:hdi,suggest:{},data:{useDefaultDataProvider:!0}};function uce(n){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:n===Wb,documentFormattingEdits:n===Wb,documentRangeFormattingEdits:n===Wb}}var Wb="html",ZAe="handlebars",KAe="razor",Vnt=hce(Wb,dce,uce(Wb)),fdi=Vnt.defaults,Hnt=hce(ZAe,dce,uce(ZAe)),pdi=Hnt.defaults,$nt=hce(KAe,dce,uce(KAe)),gdi=$nt.defaults;cce.languages.html={htmlDefaults:fdi,razorDefaults:gdi,handlebarDefaults:pdi,htmlLanguageService:Vnt,handlebarLanguageService:Hnt,razorLanguageService:$nt,registerHTMLLanguageService:hce};function mdi(){return z(()=>import("./htmlMode-DLHwAZ7J.js"),[])}function hce(n,e=dce,t=uce(n)){const i=new udi(n,e,t);let r;const o=cce.languages.onLanguage(n,async()=>{r=(await mdi()).setupMode(i)});return{defaults:i,dispose(){o.dispose(),r?.dispose(),r=void 0}}}/*!-----------------------------------------------------------------------------
3401
3401
  * Copyright (c) Microsoft Corporation. All rights reserved.
3402
3402
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
3403
3403
  * Released under the MIT license
3404
3404
  * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
3405
- *-----------------------------------------------------------------------------*/var vdi=Object.defineProperty,ydi=Object.getOwnPropertyDescriptor,kdi=Object.getOwnPropertyNames,Cdi=Object.prototype.hasOwnProperty,bdi=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of kdi(e))!Cdi.call(n,r)&&r!==t&&vdi(n,r,{get:()=>e[r],enumerable:!(i=ydi(e,r))||i.enumerable});return n},wdi=(n,e,t)=>(bdi(n,e,"default"),t),Gx={};wdi(Gx,Kx);var _di=class{constructor(e,t,i){this._onDidChange=new Gx.Emitter,this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},xdi={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},Sdi={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},Fnt=new _di("json",xdi,Sdi),Mdi=()=>znt().then(n=>n.getWorker());Gx.languages.json={jsonDefaults:Fnt,getWorker:Mdi};function znt(){return z(()=>import("./jsonMode-BZ4_MoUH.js"),[])}Gx.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});Gx.languages.onLanguage("json",()=>{znt().then(n=>n.setupMode(Fnt))});/*!-----------------------------------------------------------------------------
3405
+ *-----------------------------------------------------------------------------*/var vdi=Object.defineProperty,ydi=Object.getOwnPropertyDescriptor,kdi=Object.getOwnPropertyNames,Cdi=Object.prototype.hasOwnProperty,bdi=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of kdi(e))!Cdi.call(n,r)&&r!==t&&vdi(n,r,{get:()=>e[r],enumerable:!(i=ydi(e,r))||i.enumerable});return n},wdi=(n,e,t)=>(bdi(n,e,"default"),t),Gx={};wdi(Gx,Kx);var _di=class{constructor(e,t,i){this._onDidChange=new Gx.Emitter,this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},xdi={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},Sdi={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},Fnt=new _di("json",xdi,Sdi),Mdi=()=>znt().then(n=>n.getWorker());Gx.languages.json={jsonDefaults:Fnt,getWorker:Mdi};function znt(){return z(()=>import("./jsonMode-DaNJis_I.js"),[])}Gx.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});Gx.languages.onLanguage("json",()=>{znt().then(n=>n.setupMode(Fnt))});/*!-----------------------------------------------------------------------------
3406
3406
  * Copyright (c) Microsoft Corporation. All rights reserved.
3407
3407
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
3408
3408
  * Released under the MIT license
3409
3409
  * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
3410
- *-----------------------------------------------------------------------------*/var Ldi=Object.defineProperty,Idi=Object.getOwnPropertyDescriptor,Ndi=Object.getOwnPropertyNames,Edi=Object.prototype.hasOwnProperty,Tdi=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ndi(e))!Edi.call(n,r)&&r!==t&&Ldi(n,r,{get:()=>e[r],enumerable:!(i=Idi(e,r))||i.enumerable});return n},Adi=(n,e,t)=>(Tdi(n,e,"default"),t),Ddi="5.4.5",Qv={};Adi(Qv,Kx);var Bnt=(n=>(n[n.None=0]="None",n[n.CommonJS=1]="CommonJS",n[n.AMD=2]="AMD",n[n.UMD=3]="UMD",n[n.System=4]="System",n[n.ES2015=5]="ES2015",n[n.ESNext=99]="ESNext",n))(Bnt||{}),jnt=(n=>(n[n.None=0]="None",n[n.Preserve=1]="Preserve",n[n.React=2]="React",n[n.ReactNative=3]="ReactNative",n[n.ReactJSX=4]="ReactJSX",n[n.ReactJSXDev=5]="ReactJSXDev",n))(jnt||{}),Wnt=(n=>(n[n.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",n[n.LineFeed=1]="LineFeed",n))(Wnt||{}),qnt=(n=>(n[n.ES3=0]="ES3",n[n.ES5=1]="ES5",n[n.ES2015=2]="ES2015",n[n.ES2016=3]="ES2016",n[n.ES2017=4]="ES2017",n[n.ES2018=5]="ES2018",n[n.ES2019=6]="ES2019",n[n.ES2020=7]="ES2020",n[n.ESNext=99]="ESNext",n[n.JSON=100]="JSON",n[n.Latest=99]="Latest",n))(qnt||{}),Unt=(n=>(n[n.Classic=1]="Classic",n[n.NodeJs=2]="NodeJs",n))(Unt||{}),Znt=class{constructor(n,e,t,i,r){this._onDidChange=new Qv.Emitter,this._onDidExtraLibsChange=new Qv.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(n),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(r),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(n,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===n)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[t]&&(i=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(i=this._extraLibs[t].version+1),this._extraLibs[t]={content:n,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let r=this._extraLibs[t];r&&r.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(n){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),n&&n.length>0)for(const e of n){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content;let r=1;this._removedExtraLibs[t]&&(r=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:r}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(n){this._compilerOptions=n||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(n){this._diagnosticsOptions=n||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(n){this._workerOptions=n||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(n){this._inlayHintsOptions=n||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(n){}setEagerModelSync(n){this._eagerModelSync=n}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(n){this._modeConfiguration=n||Object.create(null),this._onDidChange.fire(void 0)}},Rdi=Ddi,Knt={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},Gnt=new Znt({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},Knt),Xnt=new Znt({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},Knt),Pdi=()=>fce().then(n=>n.getTypeScriptWorker()),Odi=()=>fce().then(n=>n.getJavaScriptWorker());Qv.languages.typescript={ModuleKind:Bnt,JsxEmit:jnt,NewLineKind:Wnt,ScriptTarget:qnt,ModuleResolutionKind:Unt,typescriptVersion:Rdi,typescriptDefaults:Gnt,javascriptDefaults:Xnt,getTypeScriptWorker:Pdi,getJavaScriptWorker:Odi};function fce(){return z(()=>import("./tsMode-CxEfAf9Z.js"),[])}Qv.languages.onLanguage("typescript",()=>fce().then(n=>n.setupTypeScript(Gnt)));Qv.languages.onLanguage("javascript",()=>fce().then(n=>n.setupJavaScript(Xnt)));const Vdi={0:" ",1:"u",2:"r"},GAe=65535,bd=16777215,XAe=4278190080;class Ahe{constructor(e){const t=Math.ceil(e/32);this._states=new Uint32Array(t)}get(e){const t=e/32|0,i=e%32;return(this._states[t]&1<<i)!==0}set(e,t){const i=e/32|0,r=e%32,o=this._states[i];t?this._states[i]=o|1<<r:this._states[i]=o&~(1<<r)}}class nc{constructor(e,t,i){if(e.length!==t.length||e.length>GAe)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new Ahe(e.length),this._userDefinedStates=new Ahe(e.length),this._recoveredStates=new Ahe(e.length),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(i,r)=>{const o=e[e.length-1];return this.getStartLineNumber(o)<=i&&this.getEndLineNumber(o)>=r};for(let i=0,r=this._startIndexes.length;i<r;i++){const o=this._startIndexes[i],s=this._endIndexes[i];if(o>bd||s>bd)throw new Error("startLineNumber or endLineNumber must not exceed "+bd);for(;e.length>0&&!t(o,s);)e.pop();const a=e.length>0?e[e.length-1]:-1;e.push(i),this._startIndexes[i]=o+((a&255)<<24),this._endIndexes[i]=s+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&bd}getEndLineNumber(e){return this._endIndexes[e]&bd}getType(e){return this._types?this._types[e]:void 0}hasTypes(){return!!this._types}isCollapsed(e){return this._collapseStates.get(e)}setCollapsed(e,t){this._collapseStates.set(e,t)}isUserDefined(e){return this._userDefinedStates.get(e)}setUserDefined(e,t){return this._userDefinedStates.set(e,t)}isRecovered(e){return this._recoveredStates.get(e)}setRecovered(e,t){return this._recoveredStates.set(e,t)}getSource(e){return this.isUserDefined(e)?1:this.isRecovered(e)?2:0}setSource(e,t){t===1?(this.setUserDefined(e,!0),this.setRecovered(e,!1)):t===2?(this.setUserDefined(e,!1),this.setRecovered(e,!0)):(this.setUserDefined(e,!1),this.setRecovered(e,!1))}setCollapsedAllOfType(e,t){let i=!1;if(this._types)for(let r=0;r<this._types.length;r++)this._types[r]===e&&(this.setCollapsed(r,t),i=!0);return i}toRegion(e){return new Hdi(this,e)}getParentIndex(e){this.ensureParentIndices();const t=((this._startIndexes[e]&XAe)>>>24)+((this._endIndexes[e]&XAe)>>>16);return t===GAe?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,i=this._startIndexes.length;if(i===0)return-1;for(;t<i;){const r=Math.floor((t+i)/2);e<this.getStartLineNumber(r)?i=r:t=r+1}return t-1}findRange(e){let t=this.findIndex(e);if(t>=0){if(this.getEndLineNumber(t)>=e)return t;for(t=this.getParentIndex(t);t!==-1;){if(this.contains(t,e))return t;t=this.getParentIndex(t)}}return-1}toString(){const e=[];for(let t=0;t<this.length;t++)e[t]=`[${Vdi[this.getSource(t)]}${this.isCollapsed(t)?"+":"-"}] ${this.getStartLineNumber(t)}/${this.getEndLineNumber(t)}`;return e.join(", ")}toFoldRange(e){return{startLineNumber:this._startIndexes[e]&bd,endLineNumber:this._endIndexes[e]&bd,type:this._types?this._types[e]:void 0,isCollapsed:this.isCollapsed(e),source:this.getSource(e)}}static fromFoldRanges(e){const t=e.length,i=new Uint32Array(t),r=new Uint32Array(t);let o=[],s=!1;for(let l=0;l<t;l++){const c=e[l];i[l]=c.startLineNumber,r[l]=c.endLineNumber,o.push(c.type),c.type&&(s=!0)}s||(o=void 0);const a=new nc(i,r,o);for(let l=0;l<t;l++)e[l].isCollapsed&&a.setCollapsed(l,!0),a.setSource(l,e[l].source);return a}static sanitizeAndMerge(e,t,i,r){i=i??Number.MAX_VALUE;const o=(v,y)=>Array.isArray(v)?(C=>C<y?v[C]:void 0):(C=>C<y?v.toFoldRange(C):void 0),s=o(e,e.length),a=o(t,t.length);let l=0,c=0,d=s(0),u=a(0);const h=[];let f,p=0;const g=[];for(;d||u;){let v;if(u&&(!d||d.startLineNumber>=u.startLineNumber))d&&d.startLineNumber===u.startLineNumber?(u.source===1?v=u:(v=d,v.isCollapsed=u.isCollapsed&&(d.endLineNumber===u.endLineNumber||!r?.startsInside(d.startLineNumber+1,d.endLineNumber+1)),v.source=0),d=s(++l)):(v=u,u.isCollapsed&&u.source===0&&(v.source=2)),u=a(++c);else{let y=c,C=u;for(;;){if(!C||C.startLineNumber>d.endLineNumber){v=d;break}if(C.source===1&&C.endLineNumber>d.endLineNumber)break;C=a(++y)}d=s(++l)}if(v){for(;f&&f.endLineNumber<v.startLineNumber;)f=h.pop();v.endLineNumber>v.startLineNumber&&v.startLineNumber>p&&v.endLineNumber<=i&&(!f||f.endLineNumber>=v.endLineNumber)&&(g.push(v),p=v.startLineNumber,f&&h.push(f),f=v)}}return g}}class Hdi{constructor(e,t){this.ranges=e,this.index=t}get startLineNumber(){return this.ranges.getStartLineNumber(this.index)}get endLineNumber(){return this.ranges.getEndLineNumber(this.index)}get regionIndex(){return this.index}get parentIndex(){return this.ranges.getParentIndex(this.index)}get isCollapsed(){return this.ranges.isCollapsed(this.index)}containedBy(e){return e.startLineNumber<=this.startLineNumber&&e.endLineNumber>=this.endLineNumber}containsLine(e){return this.startLineNumber<=e&&e<=this.endLineNumber}}class $di{get regions(){return this._regions}get textModel(){return this._textModel}constructor(e,t){this._updateEventEmitter=new fe,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new nc(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[]}toggleCollapseState(e){if(!e.length)return;e=e.sort((i,r)=>i.regionIndex-r.regionIndex);const t={};this._decorationProvider.changeDecorations(i=>{let r=0,o=-1,s=-1;const a=l=>{for(;r<l;){const c=this._regions.getEndLineNumber(r),d=this._regions.isCollapsed(r);if(c<=o){const u=this.regions.getSource(r)!==0;i.changeDecorationOptions(this._editorDecorationIds[r],this._decorationProvider.getDecorationOption(d,c<=s,u))}d&&c>s&&(s=c),r++}};for(const l of e){const c=l.regionIndex,d=this._editorDecorationIds[c];if(d&&!t[d]){t[d]=!0,a(c);const u=!this._regions.isCollapsed(c);this._regions.setCollapsed(c,u),o=Math.max(o,this._regions.getEndLineNumber(c))}}a(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const t=new Array,i=r=>{for(const o of e)if(!(o.startLineNumber>r.endLineNumber||r.startLineNumber>o.endLineNumber))return!0;return!1};for(let r=0;r<this._regions.length;r++){const o=this._regions.toFoldRange(r);(o.source===0||!i(o))&&t.push(o)}this.updatePost(nc.fromFoldRanges(t))}update(e,t){const i=this._currentFoldedOrManualRanges(t),r=nc.sanitizeAndMerge(e,i,this._textModel.getLineCount(),t);this.updatePost(nc.fromFoldRanges(r))}updatePost(e){const t=[];let i=-1;for(let r=0,o=e.length;r<o;r++){const s=e.getStartLineNumber(r),a=e.getEndLineNumber(r),l=e.isCollapsed(r),c=e.getSource(r)!==0,d={startLineNumber:s,startColumn:this._textModel.getLineMaxColumn(s),endLineNumber:a,endColumn:this._textModel.getLineMaxColumn(a)+1};t.push({range:d,options:this._decorationProvider.getDecorationOption(l,a<=i,c)}),l&&a>i&&(i=a)}this._decorationProvider.changeDecorations(r=>this._editorDecorationIds=r.deltaDecorations(this._editorDecorationIds,t)),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e){const t=[];for(let i=0,r=this._regions.length;i<r;i++){let o=this.regions.isCollapsed(i);const s=this.regions.getSource(i);if(o||s!==0){const a=this._regions.toFoldRange(i),l=this._textModel.getDecorationRange(this._editorDecorationIds[i]);l&&(o&&e?.startsInside(l.startLineNumber+1,l.endLineNumber)&&(o=!1),t.push({startLineNumber:l.startLineNumber,endLineNumber:l.endLineNumber,type:a.type,isCollapsed:o,source:s}))}}return t}getMemento(){const e=this._currentFoldedOrManualRanges(),t=[],i=this._textModel.getLineCount();for(let r=0,o=e.length;r<o;r++){const s=e[r];if(s.startLineNumber>=s.endLineNumber||s.startLineNumber<1||s.endLineNumber>i)continue;const a=this._getLinesChecksum(s.startLineNumber+1,s.endLineNumber);t.push({startLineNumber:s.startLineNumber,endLineNumber:s.endLineNumber,isCollapsed:s.isCollapsed,source:s.source,checksum:a})}return t.length>0?t:void 0}applyMemento(e){if(!Array.isArray(e))return;const t=[],i=this._textModel.getLineCount();for(const o of e){if(o.startLineNumber>=o.endLineNumber||o.startLineNumber<1||o.endLineNumber>i)continue;const s=this._getLinesChecksum(o.startLineNumber+1,o.endLineNumber);(!o.checksum||s===o.checksum)&&t.push({startLineNumber:o.startLineNumber,endLineNumber:o.endLineNumber,type:void 0,isCollapsed:o.isCollapsed??!0,source:o.source??0})}const r=nc.sanitizeAndMerge(this._regions,t,i);this.updatePost(nc.fromFoldRanges(r))}_getLinesChecksum(e,t){return _7e(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const i=[];if(this._regions){let r=this._regions.findRange(e),o=1;for(;r>=0;){const s=this._regions.toRegion(r);(!t||t(s,o))&&i.push(s),o++,r=s.parentIndex}}return i}getRegionAtLine(e){if(this._regions){const t=this._regions.findRange(e);if(t>=0)return this._regions.toRegion(t)}return null}getRegionsInside(e,t){const i=[],r=e?e.regionIndex+1:0,o=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const s=[];for(let a=r,l=this._regions.length;a<l;a++){const c=this._regions.toRegion(a);if(this._regions.getStartLineNumber(a)<o){for(;s.length>0&&!c.containedBy(s[s.length-1]);)s.pop();s.push(c),t(c,s.length)&&i.push(c)}else break}}else for(let s=r,a=this._regions.length;s<a;s++){const l=this._regions.toRegion(s);if(this._regions.getStartLineNumber(s)<o)(!t||t(l))&&i.push(l);else break}return i}}function Ynt(n,e,t){const i=[];for(const r of t){const o=n.getRegionAtLine(r);if(o){const s=!o.isCollapsed;if(i.push(o),e>1){const a=n.getRegionsInside(o,(l,c)=>l.isCollapsed!==s&&c<e);i.push(...a)}}}n.toggleCollapseState(i)}function Uy(n,e,t=Number.MAX_VALUE,i){const r=[];if(i&&i.length>0)for(const o of i){const s=n.getRegionAtLine(o);if(s&&(s.isCollapsed!==e&&r.push(s),t>1)){const a=n.getRegionsInside(s,(l,c)=>l.isCollapsed!==e&&c<t);r.push(...a)}}else{const o=n.getRegionsInside(null,(s,a)=>s.isCollapsed!==e&&a<t);r.push(...o)}n.toggleCollapseState(r)}function Jnt(n,e,t,i){const r=[];for(const o of i){const s=n.getAllRegionsAtLine(o,(a,l)=>a.isCollapsed!==e&&l<=t);r.push(...s)}n.toggleCollapseState(r)}function Fdi(n,e,t){const i=[];for(const r of t){const o=n.getAllRegionsAtLine(r,s=>s.isCollapsed!==e);o.length>0&&i.push(o[0])}n.toggleCollapseState(i)}function zdi(n,e,t,i){const r=(s,a)=>a===e&&s.isCollapsed!==t&&!i.some(l=>s.containsLine(l)),o=n.getRegionsInside(null,r);n.toggleCollapseState(o)}function Qnt(n,e,t){const i=[];for(const s of t){const a=n.getAllRegionsAtLine(s,void 0);a.length>0&&i.push(a[0])}const r=s=>i.every(a=>!a.containedBy(s)&&!s.containedBy(a))&&s.isCollapsed!==e,o=n.getRegionsInside(null,r);n.toggleCollapseState(o)}function eke(n,e,t){const i=n.textModel,r=n.regions,o=[];for(let s=r.length-1;s>=0;s--)if(t!==r.isCollapsed(s)){const a=r.getStartLineNumber(s);e.test(i.getLineContent(a))&&o.push(r.toRegion(s))}n.toggleCollapseState(o)}function tke(n,e,t){const i=n.regions,r=[];for(let o=i.length-1;o>=0;o--)t!==i.isCollapsed(o)&&e===i.getType(o)&&r.push(i.toRegion(o));n.toggleCollapseState(r)}function Bdi(n,e){let t=null;const i=e.getRegionAtLine(n);if(i!==null&&(t=i.startLineNumber,n===t)){const r=i.parentIndex;r!==-1?t=e.regions.getStartLineNumber(r):t=null}return t}function jdi(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){if(n!==t.startLineNumber)return t.startLineNumber;{const i=t.parentIndex;let r=0;for(i!==-1&&(r=e.regions.getStartLineNumber(t.parentIndex));t!==null;)if(t.regionIndex>0){if(t=e.regions.toRegion(t.regionIndex-1),t.startLineNumber<=r)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}}else if(e.regions.length>0)for(t=e.regions.toRegion(e.regions.length-1);t!==null;){if(t.startLineNumber<n)return t.startLineNumber;t.regionIndex>0?t=e.regions.toRegion(t.regionIndex-1):t=null}return null}function Wdi(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){const i=t.parentIndex;let r=0;if(i!==-1)r=e.regions.getEndLineNumber(t.parentIndex);else{if(e.regions.length===0)return null;r=e.regions.getEndLineNumber(e.regions.length-1)}for(;t!==null;)if(t.regionIndex<e.regions.length){if(t=e.regions.toRegion(t.regionIndex+1),t.startLineNumber>=r)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}else if(e.regions.length>0)for(t=e.regions.toRegion(0);t!==null;){if(t.startLineNumber>n)return t.startLineNumber;t.regionIndex<e.regions.length?t=e.regions.toRegion(t.regionIndex+1):t=null}return null}class qdi{get onDidChange(){return this._updateEventEmitter.event}get hiddenRanges(){return this._hiddenRanges}constructor(e){this._updateEventEmitter=new fe,this._hasLineChanges=!1,this._foldingModel=e,this._foldingModelListener=e.onDidChange(t=>this.updateHiddenRanges()),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}notifyChangeModelContent(e){this._hiddenRanges.length&&!this._hasLineChanges&&(this._hasLineChanges=e.changes.some(t=>t.range.endLineNumber!==t.range.startLineNumber||t3(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let i=0,r=0,o=Number.MAX_VALUE,s=-1;const a=this._foldingModel.regions;for(;i<a.length;i++){if(!a.isCollapsed(i))continue;const l=a.getStartLineNumber(i)+1,c=a.getEndLineNumber(i);o<=l&&c<=s||(!e&&r<this._hiddenRanges.length&&this._hiddenRanges[r].startLineNumber===l&&this._hiddenRanges[r].endLineNumber===c?(t.push(this._hiddenRanges[r]),r++):(e=!0,t.push(new ce(l,1,c,1))),o=l,s=c)}(this._hasLineChanges||e||r<this._hiddenRanges.length)&&this.applyHiddenRanges(t)}applyHiddenRanges(e){this._hiddenRanges=e,this._hasLineChanges=!1,this._updateEventEmitter.fire(e)}hasRanges(){return this._hiddenRanges.length>0}isHidden(e){return YAe(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let r=null;const o=s=>((!r||!Udi(s,r))&&(r=YAe(this._hiddenRanges,s)),r?r.startLineNumber-1:null);for(let s=0,a=e.length;s<a;s++){let l=e[s];const c=o(l.startLineNumber);c&&(l=l.setStartPosition(c,i.getLineMaxColumn(c)),t=!0);const d=o(l.endLineNumber);d&&(l=l.setEndPosition(d,i.getLineMaxColumn(d)),t=!0),e[s]=l}return t}dispose(){this.hiddenRanges.length>0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function Udi(n,e){return n>=e.startLineNumber&&n<=e.endLineNumber}function YAe(n,e){const t=Lre(n,i=>e<i.startLineNumber)-1;return t>=0&&n[t].endLineNumber>=e?n[t]:null}const Zdi=5e3,Kdi="indent";class eit{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id=Kdi}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,r=t&&t.markers;return Promise.resolve(Ydi(this.editorModel,i,r,this.foldingRangesLimit))}}let Gdi=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>bd||t>bd)return;const r=this._length;this._startIndexes[r]=e,this._endIndexes[r]=t,this._length++,i<1e3&&(this._indentOccurrences[i]=(this._indentOccurrences[i]||0)+1)}toIndentRanges(e){const t=this._foldingRangesLimit.limit;if(this._length<=t){this._foldingRangesLimit.update(this._length,!1);const i=new Uint32Array(this._length),r=new Uint32Array(this._length);for(let o=this._length-1,s=0;o>=0;o--,s++)i[s]=this._startIndexes[o],r[s]=this._endIndexes[o];return new nc(i,r)}else{this._foldingRangesLimit.update(this._length,t);let i=0,r=this._indentOccurrences.length;for(let l=0;l<this._indentOccurrences.length;l++){const c=this._indentOccurrences[l];if(c){if(c+i>t){r=l;break}i+=c}}const o=e.getOptions().tabSize,s=new Uint32Array(t),a=new Uint32Array(t);for(let l=this._length-1,c=0;l>=0;l--){const d=this._startIndexes[l],u=e.getLineContent(d),h=Vve(u,o);(h<r||h===r&&i++<t)&&(s[c]=d,a[c]=this._endIndexes[l],c++)}return new nc(s,a)}}};const Xdi={limit:Zdi,update:()=>{}};function Ydi(n,e,t,i=Xdi){const r=n.getOptions().tabSize,o=new Gdi(i);let s;t&&(s=new RegExp(`(${t.start.source})|(?:${t.end.source})`));const a=[],l=n.getLineCount()+1;a.push({indent:-1,endAbove:l,line:l});for(let c=n.getLineCount();c>0;c--){const d=n.getLineContent(c),u=Vve(d,r);let h=a[a.length-1];if(u===-1){e&&(h.endAbove=c);continue}let f;if(s&&(f=d.match(s)))if(f[1]){let p=a.length-1;for(;p>0&&a[p].indent!==-2;)p--;if(p>0){a.length=p+1,h=a[p],o.insertFirst(c,h.line,u),h.line=c,h.indent=u,h.endAbove=c;continue}}else{a.push({indent:-2,endAbove:c,line:c});continue}if(h.indent>u){do a.pop(),h=a[a.length-1];while(h.indent>u);const p=h.endAbove-1;p-c>=1&&o.insertFirst(c,p,u)}h.indent===u?h.endAbove=c:a.push({indent:u,endAbove:c,line:c})}return o.toIndentRanges(n)}const Jdi=ie("editor.foldBackground",{light:ln(mf,.3),dark:ln(mf,.3),hcDark:null,hcLight:null},N("foldBackgroundBackground","Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);ie("editor.foldPlaceholderForeground",{light:"#808080",dark:"#808080",hcDark:null,hcLight:null},N("collapsedTextColor","Color of the collapsed text after the first line of a folded range."));ie("editorGutter.foldingControlForeground",Rre,N("editorGutter.foldingControlForeground","Color of the folding control in the editor gutter."));const O4e=Q1("folding-expanded",tt.chevronDown,N("foldingExpandedIcon","Icon for expanded ranges in the editor glyph margin.")),V4e=Q1("folding-collapsed",tt.chevronRight,N("foldingCollapsedIcon","Icon for collapsed ranges in the editor glyph margin.")),JAe=Q1("folding-manual-collapsed",V4e,N("foldingManualCollapedIcon","Icon for manually collapsed ranges in the editor glyph margin.")),QAe=Q1("folding-manual-expanded",O4e,N("foldingManualExpandedIcon","Icon for manually expanded ranges in the editor glyph margin.")),Dhe={color:d9(Jdi),position:1},_8=N("linesCollapsed","Click to expand the range."),ML=N("linesExpanded","Click to collapse the range.");class Ul{static{this.COLLAPSED_VISUAL_DECORATION=Ii.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:_8,firstLineDecorationClassName:on.asClassName(V4e)})}static{this.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Ii.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:Dhe,isWholeLine:!0,linesDecorationsTooltip:_8,firstLineDecorationClassName:on.asClassName(V4e)})}static{this.MANUALLY_COLLAPSED_VISUAL_DECORATION=Ii.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:_8,firstLineDecorationClassName:on.asClassName(JAe)})}static{this.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Ii.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:Dhe,isWholeLine:!0,linesDecorationsTooltip:_8,firstLineDecorationClassName:on.asClassName(JAe)})}static{this.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=Ii.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:_8})}static{this.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=Ii.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:Dhe,isWholeLine:!0,linesDecorationsTooltip:_8})}static{this.EXPANDED_VISUAL_DECORATION=Ii.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+on.asClassName(O4e),linesDecorationsTooltip:ML})}static{this.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Ii.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:on.asClassName(O4e),linesDecorationsTooltip:ML})}static{this.MANUALLY_EXPANDED_VISUAL_DECORATION=Ii.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+on.asClassName(QAe),linesDecorationsTooltip:ML})}static{this.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Ii.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:on.asClassName(QAe),linesDecorationsTooltip:ML})}static{this.NO_CONTROLS_EXPANDED_RANGE_DECORATION=Ii.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0})}static{this.HIDDEN_RANGE_DECORATION=Ii.register({description:"folding-hidden-range-decoration",stickiness:1})}constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t?Ul.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?Ul.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:Ul.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:Ul.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?i?this.showFoldingHighlights?Ul.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ul.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?Ul.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ul.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?i?Ul.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:Ul.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?Ul.MANUALLY_EXPANDED_VISUAL_DECORATION:Ul.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}}const Qdi={},eui="syntax";class tit{constructor(e,t,i,r,o){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=r,this.fallbackRangeProvider=o,this.id=eui,this.disposables=new ht,o&&this.disposables.add(o);for(const s of t)typeof s.onDidChange=="function"&&this.disposables.add(s.onDidChange(i))}compute(e){return tui(this.providers,this.editorModel,e).then(t=>t?iui(t,this.foldingRangesLimit):this.fallbackRangeProvider?.compute(e)??null)}dispose(){this.disposables.dispose()}}function tui(n,e,t){let i=null;const r=n.map((o,s)=>Promise.resolve(o.provideFoldingRanges(e,Qdi,t)).then(a=>{if(!t.isCancellationRequested&&Array.isArray(a)){Array.isArray(i)||(i=[]);const l=e.getLineCount();for(const c of a)c.start>0&&c.end>c.start&&c.end<=l&&i.push({start:c.start,end:c.end,rank:s,kind:c.kind})}},Jae));return Promise.all(r).then(o=>i)}class nui{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,i,r){if(e>bd||t>bd)return;const o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._nestingLevels[o]=r,this._types[o]=i,this._length++,r<30&&(this._nestingLevelCounts[r]=(this._nestingLevelCounts[r]||0)+1)}toIndentRanges(){const e=this._foldingRangesLimit.limit;if(this._length<=e){this._foldingRangesLimit.update(this._length,!1);const t=new Uint32Array(this._length),i=new Uint32Array(this._length);for(let r=0;r<this._length;r++)t[r]=this._startIndexes[r],i[r]=this._endIndexes[r];return new nc(t,i,this._types)}else{this._foldingRangesLimit.update(this._length,e);let t=0,i=this._nestingLevelCounts.length;for(let a=0;a<this._nestingLevelCounts.length;a++){const l=this._nestingLevelCounts[a];if(l){if(l+t>e){i=a;break}t+=l}}const r=new Uint32Array(e),o=new Uint32Array(e),s=[];for(let a=0,l=0;a<this._length;a++){const c=this._nestingLevels[a];(c<i||c===i&&t++<e)&&(r[l]=this._startIndexes[a],o[l]=this._endIndexes[a],s[l]=this._types[a],l++)}return new nc(r,o,s)}}}function iui(n,e){const t=n.sort((s,a)=>{let l=s.start-a.start;return l===0&&(l=s.rank-a.rank),l}),i=new nui(e);let r;const o=[];for(const s of t)if(!r)r=s,i.add(s.start,s.end,s.kind&&s.kind.value,o.length);else if(s.start>r.start)if(s.end<=r.end)o.push(r),r=s,i.add(s.start,s.end,s.kind&&s.kind.value,o.length);else{if(s.start>r.end){do r=o.pop();while(r&&s.start>r.end);r&&o.push(r),r=s}i.add(s.start,s.end,s.kind&&s.kind.value,o.length)}return i.toIndentRanges()}var rui=function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Qk=function(n,e){return function(t,i){e(t,i,n)}},VC;const _s=new ut("foldingEnabled",!1);let ey=class extends Ne{static{VC=this}static{this.ID="editor.contrib.folding"}static get(e){return e.getContribution(VC.ID)}static getFoldingRangeProviders(e,t){const i=e.foldingRangeProvider.ordered(t);return VC._foldingRangeSelector?.(i,t)??i}constructor(e,t,i,r,o,s){super(),this.contextKeyService=t,this.languageConfigurationService=i,this.languageFeaturesService=s,this.localToDispose=this._register(new ht),this.editor=e,this._foldingLimitReporter=new oui(e);const a=this.editor.getOptions();this._isEnabled=a.get(43),this._useFoldingProviders=a.get(44)!=="indentation",this._unfoldOnClickAfterEndOfLine=a.get(48),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=a.get(46),this.updateDebounceInfo=o.for(s.foldingRangeProvider,"Folding",{min:200}),this.foldingModel=null,this.hiddenRangeModel=null,this.rangeProvider=null,this.foldingRegionPromise=null,this.foldingModelPromise=null,this.updateScheduler=null,this.cursorChangedScheduler=null,this.mouseDownInfo=null,this.foldingDecorationProvider=new Ul(e),this.foldingDecorationProvider.showFoldingControls=a.get(111),this.foldingDecorationProvider.showFoldingHighlights=a.get(45),this.foldingEnabled=_s.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel(()=>this.onModelChanged())),this._register(this.editor.onDidChangeConfiguration(l=>{if(l.hasChanged(43)&&(this._isEnabled=this.editor.getOptions().get(43),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),l.hasChanged(47)&&this.onModelChanged(),l.hasChanged(111)||l.hasChanged(45)){const c=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=c.get(111),this.foldingDecorationProvider.showFoldingHighlights=c.get(45),this.triggerFoldingModelChanged()}l.hasChanged(44)&&(this._useFoldingProviders=this.editor.getOptions().get(44)!=="indentation",this.onFoldingStrategyChanged()),l.hasChanged(48)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(48)),l.hasChanged(46)&&(this._foldingImportsByDefault=this.editor.getOptions().get(46))})),this.onModelChanged()}saveViewState(){const e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){const t=this.foldingModel.getMemento(),i=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:i,foldedImports:this._currentModelHasFoldedImports}}}restoreViewState(e){const t=this.editor.getModel();if(!(!t||!this._isEnabled||t.isTooLargeForTokenization()||!this.hiddenRangeModel)&&e&&(this._currentModelHasFoldedImports=!!e.foldedImports,e.collapsedRegions&&e.collapsedRegions.length>0&&this.foldingModel)){this._restoringViewState=!0;try{this.foldingModel.applyMemento(e.collapsedRegions)}finally{this._restoringViewState=!1}}}onModelChanged(){this.localToDispose.clear();const e=this.editor.getModel();!this._isEnabled||!e||e.isTooLargeForTokenization()||(this._currentModelHasFoldedImports=!1,this.foldingModel=new $di(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new qdi(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new Oy(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new da(()=>this.revealCursor(),200),this.localToDispose.add(this.cursorChangedScheduler),this.localToDispose.add(this.languageFeaturesService.foldingRangeProvider.onDidChange(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelContent(t=>this.onDidChangeModelContent(t))),this.localToDispose.add(this.editor.onDidChangeCursorPosition(()=>this.onCursorPositionChanged())),this.localToDispose.add(this.editor.onMouseDown(t=>this.onEditorMouseDown(t))),this.localToDispose.add(this.editor.onMouseUp(t=>this.onEditorMouseUp(t))),this.localToDispose.add({dispose:()=>{this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.updateScheduler?.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,this.rangeProvider?.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){this.rangeProvider?.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const t=new eit(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=VC.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new tit(e,i,()=>this.triggerFoldingModelChanged(),this._foldingLimitReporter,t))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){this.hiddenRangeModel?.notifyChangeModelContent(e),this.triggerFoldingModelChanged()}triggerFoldingModelChanged(){this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger(()=>{const e=this.foldingModel;if(!e)return null;const t=new Sp,i=this.getRangeProvider(e.textModel),r=this.foldingRegionPromise=C7e(o=>i.compute(o));return r.then(o=>{if(o&&r===this.foldingRegionPromise){let s;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const c=o.setCollapsedAllOfType(Jl.Imports.value,!0);c&&(s=__.capture(this.editor),this._currentModelHasFoldedImports=c)}const a=this.editor.getSelections();e.update(o,sui(a)),s?.restore(this.editor);const l=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=l)}return e})}).then(void 0,e=>(li(e),null)))}onHiddenRangesChanges(e){if(this.hiddenRangeModel&&e.length&&!this._restoringViewState){const t=this.editor.getSelections();t&&this.hiddenRangeModel.adjustSelections(t)&&this.editor.setSelections(t)}this.editor.setHiddenAreas(e,this)}onCursorPositionChanged(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const e=this.getFoldingModel();e&&e.then(t=>{if(t){const i=this.editor.getSelections();if(i&&i.length>0){const r=[];for(const o of i){const s=o.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(s)&&r.push(...t.getAllRegionsAtLine(s,a=>a.isCollapsed&&s>a.startLineNumber))}r.length&&(t.toggleCollapseState(r),this.reveal(i[0].getPosition()))}}}).then(void 0,li)}onEditorMouseDown(e){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!e.target||!e.target.range||!e.event.leftButton&&!e.event.middleButton)return;const t=e.target.range;let i=!1;switch(e.target.type){case 4:{const r=e.target.detail,o=e.target.element.offsetLeft;if(r.offsetX-o<4)return;i=!0;break}case 7:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return}case 6:{if(this.hiddenRangeModel.hasRanges()){const r=this.editor.getModel();if(r&&t.startColumn===r.getLineMaxColumn(t.startLineNumber))break}return}default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:i}}onEditorMouseUp(e){const t=this.foldingModel;if(!t||!this.mouseDownInfo||!e.target)return;const i=this.mouseDownInfo.lineNumber,r=this.mouseDownInfo.iconClicked,o=e.target.range;if(!o||o.startLineNumber!==i)return;if(r){if(e.target.type!==4)return}else{const a=this.editor.getModel();if(!a||o.startColumn!==a.getLineMaxColumn(i))return}const s=t.getRegionAtLine(i);if(s&&s.startLineNumber===i){const a=s.isCollapsed;if(r||a){const l=e.event.altKey;let c=[];if(l){const d=h=>!h.containedBy(s)&&!s.containedBy(h),u=t.getRegionsInside(null,d);for(const h of u)h.isCollapsed&&c.push(h);c.length===0&&(c=u)}else{const d=e.event.middleButton||e.event.shiftKey;if(d)for(const u of t.getRegionsInside(s))u.isCollapsed===a&&c.push(u);(a||!d||c.length===0)&&c.push(s)}t.toggleCollapseState(c),this.reveal({lineNumber:i,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}};ey=VC=rui([Qk(1,Zn),Qk(2,Qc),Qk(3,Y1),Qk(4,fQe),Qk(5,pi)],ey);class oui{constructor(e){this.editor=e,this._onDidChange=new fe,this._computed=0,this._limited=!1}get limit(){return this.editor.getOptions().get(47)}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}class Ws extends F7e{runEditorCommand(e,t,i){const r=e.get(Qc),o=ey.get(t);if(!o)return;const s=o.getFoldingModel();if(s)return this.reportTelemetry(e,t),s.then(a=>{if(a){this.invoke(o,a,t,i,r);const l=t.getSelection();l&&o.reveal(l.getStartPosition())}})}getSelectedLines(e){const t=e.getSelections();return t?t.map(i=>i.startLineNumber):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map(i=>i+1):this.getSelectedLines(t)}run(e,t){}}function sui(n){return!n||n.length===0?{startsInside:()=>!1}:{startsInside(e,t){for(const i of n){const r=i.startLineNumber;if(r>=e&&r<=t)return!0}return!1}}}function nit(n){if(!Sa(n)){if(!_a(n))return!1;const e=n;if(!Sa(e.levels)&&!Jf(e.levels)||!Sa(e.direction)&&!Ll(e.direction)||!Sa(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(Jf)))return!1}return!0}class aui extends Ws{constructor(){super({id:"editor.unfold",label:N("unfoldAction.label","Unfold"),alias:"Unfold",precondition:_s,kbOpts:{kbExpr:Be.editorTextFocus,primary:3166,mac:{primary:2654},weight:100},metadata:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:`Property-value pairs that can be passed through this argument:
3410
+ *-----------------------------------------------------------------------------*/var Ldi=Object.defineProperty,Idi=Object.getOwnPropertyDescriptor,Ndi=Object.getOwnPropertyNames,Edi=Object.prototype.hasOwnProperty,Tdi=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ndi(e))!Edi.call(n,r)&&r!==t&&Ldi(n,r,{get:()=>e[r],enumerable:!(i=Idi(e,r))||i.enumerable});return n},Adi=(n,e,t)=>(Tdi(n,e,"default"),t),Ddi="5.4.5",Qv={};Adi(Qv,Kx);var Bnt=(n=>(n[n.None=0]="None",n[n.CommonJS=1]="CommonJS",n[n.AMD=2]="AMD",n[n.UMD=3]="UMD",n[n.System=4]="System",n[n.ES2015=5]="ES2015",n[n.ESNext=99]="ESNext",n))(Bnt||{}),jnt=(n=>(n[n.None=0]="None",n[n.Preserve=1]="Preserve",n[n.React=2]="React",n[n.ReactNative=3]="ReactNative",n[n.ReactJSX=4]="ReactJSX",n[n.ReactJSXDev=5]="ReactJSXDev",n))(jnt||{}),Wnt=(n=>(n[n.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",n[n.LineFeed=1]="LineFeed",n))(Wnt||{}),qnt=(n=>(n[n.ES3=0]="ES3",n[n.ES5=1]="ES5",n[n.ES2015=2]="ES2015",n[n.ES2016=3]="ES2016",n[n.ES2017=4]="ES2017",n[n.ES2018=5]="ES2018",n[n.ES2019=6]="ES2019",n[n.ES2020=7]="ES2020",n[n.ESNext=99]="ESNext",n[n.JSON=100]="JSON",n[n.Latest=99]="Latest",n))(qnt||{}),Unt=(n=>(n[n.Classic=1]="Classic",n[n.NodeJs=2]="NodeJs",n))(Unt||{}),Znt=class{constructor(n,e,t,i,r){this._onDidChange=new Qv.Emitter,this._onDidExtraLibsChange=new Qv.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(n),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(r),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(n,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===n)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[t]&&(i=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(i=this._extraLibs[t].version+1),this._extraLibs[t]={content:n,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let r=this._extraLibs[t];r&&r.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(n){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),n&&n.length>0)for(const e of n){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content;let r=1;this._removedExtraLibs[t]&&(r=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:r}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(n){this._compilerOptions=n||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(n){this._diagnosticsOptions=n||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(n){this._workerOptions=n||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(n){this._inlayHintsOptions=n||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(n){}setEagerModelSync(n){this._eagerModelSync=n}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(n){this._modeConfiguration=n||Object.create(null),this._onDidChange.fire(void 0)}},Rdi=Ddi,Knt={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},Gnt=new Znt({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},Knt),Xnt=new Znt({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},Knt),Pdi=()=>fce().then(n=>n.getTypeScriptWorker()),Odi=()=>fce().then(n=>n.getJavaScriptWorker());Qv.languages.typescript={ModuleKind:Bnt,JsxEmit:jnt,NewLineKind:Wnt,ScriptTarget:qnt,ModuleResolutionKind:Unt,typescriptVersion:Rdi,typescriptDefaults:Gnt,javascriptDefaults:Xnt,getTypeScriptWorker:Pdi,getJavaScriptWorker:Odi};function fce(){return z(()=>import("./tsMode-CNRtPSwc.js"),[])}Qv.languages.onLanguage("typescript",()=>fce().then(n=>n.setupTypeScript(Gnt)));Qv.languages.onLanguage("javascript",()=>fce().then(n=>n.setupJavaScript(Xnt)));const Vdi={0:" ",1:"u",2:"r"},GAe=65535,bd=16777215,XAe=4278190080;class Ahe{constructor(e){const t=Math.ceil(e/32);this._states=new Uint32Array(t)}get(e){const t=e/32|0,i=e%32;return(this._states[t]&1<<i)!==0}set(e,t){const i=e/32|0,r=e%32,o=this._states[i];t?this._states[i]=o|1<<r:this._states[i]=o&~(1<<r)}}class nc{constructor(e,t,i){if(e.length!==t.length||e.length>GAe)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new Ahe(e.length),this._userDefinedStates=new Ahe(e.length),this._recoveredStates=new Ahe(e.length),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(i,r)=>{const o=e[e.length-1];return this.getStartLineNumber(o)<=i&&this.getEndLineNumber(o)>=r};for(let i=0,r=this._startIndexes.length;i<r;i++){const o=this._startIndexes[i],s=this._endIndexes[i];if(o>bd||s>bd)throw new Error("startLineNumber or endLineNumber must not exceed "+bd);for(;e.length>0&&!t(o,s);)e.pop();const a=e.length>0?e[e.length-1]:-1;e.push(i),this._startIndexes[i]=o+((a&255)<<24),this._endIndexes[i]=s+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&bd}getEndLineNumber(e){return this._endIndexes[e]&bd}getType(e){return this._types?this._types[e]:void 0}hasTypes(){return!!this._types}isCollapsed(e){return this._collapseStates.get(e)}setCollapsed(e,t){this._collapseStates.set(e,t)}isUserDefined(e){return this._userDefinedStates.get(e)}setUserDefined(e,t){return this._userDefinedStates.set(e,t)}isRecovered(e){return this._recoveredStates.get(e)}setRecovered(e,t){return this._recoveredStates.set(e,t)}getSource(e){return this.isUserDefined(e)?1:this.isRecovered(e)?2:0}setSource(e,t){t===1?(this.setUserDefined(e,!0),this.setRecovered(e,!1)):t===2?(this.setUserDefined(e,!1),this.setRecovered(e,!0)):(this.setUserDefined(e,!1),this.setRecovered(e,!1))}setCollapsedAllOfType(e,t){let i=!1;if(this._types)for(let r=0;r<this._types.length;r++)this._types[r]===e&&(this.setCollapsed(r,t),i=!0);return i}toRegion(e){return new Hdi(this,e)}getParentIndex(e){this.ensureParentIndices();const t=((this._startIndexes[e]&XAe)>>>24)+((this._endIndexes[e]&XAe)>>>16);return t===GAe?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,i=this._startIndexes.length;if(i===0)return-1;for(;t<i;){const r=Math.floor((t+i)/2);e<this.getStartLineNumber(r)?i=r:t=r+1}return t-1}findRange(e){let t=this.findIndex(e);if(t>=0){if(this.getEndLineNumber(t)>=e)return t;for(t=this.getParentIndex(t);t!==-1;){if(this.contains(t,e))return t;t=this.getParentIndex(t)}}return-1}toString(){const e=[];for(let t=0;t<this.length;t++)e[t]=`[${Vdi[this.getSource(t)]}${this.isCollapsed(t)?"+":"-"}] ${this.getStartLineNumber(t)}/${this.getEndLineNumber(t)}`;return e.join(", ")}toFoldRange(e){return{startLineNumber:this._startIndexes[e]&bd,endLineNumber:this._endIndexes[e]&bd,type:this._types?this._types[e]:void 0,isCollapsed:this.isCollapsed(e),source:this.getSource(e)}}static fromFoldRanges(e){const t=e.length,i=new Uint32Array(t),r=new Uint32Array(t);let o=[],s=!1;for(let l=0;l<t;l++){const c=e[l];i[l]=c.startLineNumber,r[l]=c.endLineNumber,o.push(c.type),c.type&&(s=!0)}s||(o=void 0);const a=new nc(i,r,o);for(let l=0;l<t;l++)e[l].isCollapsed&&a.setCollapsed(l,!0),a.setSource(l,e[l].source);return a}static sanitizeAndMerge(e,t,i,r){i=i??Number.MAX_VALUE;const o=(v,y)=>Array.isArray(v)?(C=>C<y?v[C]:void 0):(C=>C<y?v.toFoldRange(C):void 0),s=o(e,e.length),a=o(t,t.length);let l=0,c=0,d=s(0),u=a(0);const h=[];let f,p=0;const g=[];for(;d||u;){let v;if(u&&(!d||d.startLineNumber>=u.startLineNumber))d&&d.startLineNumber===u.startLineNumber?(u.source===1?v=u:(v=d,v.isCollapsed=u.isCollapsed&&(d.endLineNumber===u.endLineNumber||!r?.startsInside(d.startLineNumber+1,d.endLineNumber+1)),v.source=0),d=s(++l)):(v=u,u.isCollapsed&&u.source===0&&(v.source=2)),u=a(++c);else{let y=c,C=u;for(;;){if(!C||C.startLineNumber>d.endLineNumber){v=d;break}if(C.source===1&&C.endLineNumber>d.endLineNumber)break;C=a(++y)}d=s(++l)}if(v){for(;f&&f.endLineNumber<v.startLineNumber;)f=h.pop();v.endLineNumber>v.startLineNumber&&v.startLineNumber>p&&v.endLineNumber<=i&&(!f||f.endLineNumber>=v.endLineNumber)&&(g.push(v),p=v.startLineNumber,f&&h.push(f),f=v)}}return g}}class Hdi{constructor(e,t){this.ranges=e,this.index=t}get startLineNumber(){return this.ranges.getStartLineNumber(this.index)}get endLineNumber(){return this.ranges.getEndLineNumber(this.index)}get regionIndex(){return this.index}get parentIndex(){return this.ranges.getParentIndex(this.index)}get isCollapsed(){return this.ranges.isCollapsed(this.index)}containedBy(e){return e.startLineNumber<=this.startLineNumber&&e.endLineNumber>=this.endLineNumber}containsLine(e){return this.startLineNumber<=e&&e<=this.endLineNumber}}class $di{get regions(){return this._regions}get textModel(){return this._textModel}constructor(e,t){this._updateEventEmitter=new fe,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new nc(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[]}toggleCollapseState(e){if(!e.length)return;e=e.sort((i,r)=>i.regionIndex-r.regionIndex);const t={};this._decorationProvider.changeDecorations(i=>{let r=0,o=-1,s=-1;const a=l=>{for(;r<l;){const c=this._regions.getEndLineNumber(r),d=this._regions.isCollapsed(r);if(c<=o){const u=this.regions.getSource(r)!==0;i.changeDecorationOptions(this._editorDecorationIds[r],this._decorationProvider.getDecorationOption(d,c<=s,u))}d&&c>s&&(s=c),r++}};for(const l of e){const c=l.regionIndex,d=this._editorDecorationIds[c];if(d&&!t[d]){t[d]=!0,a(c);const u=!this._regions.isCollapsed(c);this._regions.setCollapsed(c,u),o=Math.max(o,this._regions.getEndLineNumber(c))}}a(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const t=new Array,i=r=>{for(const o of e)if(!(o.startLineNumber>r.endLineNumber||r.startLineNumber>o.endLineNumber))return!0;return!1};for(let r=0;r<this._regions.length;r++){const o=this._regions.toFoldRange(r);(o.source===0||!i(o))&&t.push(o)}this.updatePost(nc.fromFoldRanges(t))}update(e,t){const i=this._currentFoldedOrManualRanges(t),r=nc.sanitizeAndMerge(e,i,this._textModel.getLineCount(),t);this.updatePost(nc.fromFoldRanges(r))}updatePost(e){const t=[];let i=-1;for(let r=0,o=e.length;r<o;r++){const s=e.getStartLineNumber(r),a=e.getEndLineNumber(r),l=e.isCollapsed(r),c=e.getSource(r)!==0,d={startLineNumber:s,startColumn:this._textModel.getLineMaxColumn(s),endLineNumber:a,endColumn:this._textModel.getLineMaxColumn(a)+1};t.push({range:d,options:this._decorationProvider.getDecorationOption(l,a<=i,c)}),l&&a>i&&(i=a)}this._decorationProvider.changeDecorations(r=>this._editorDecorationIds=r.deltaDecorations(this._editorDecorationIds,t)),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e){const t=[];for(let i=0,r=this._regions.length;i<r;i++){let o=this.regions.isCollapsed(i);const s=this.regions.getSource(i);if(o||s!==0){const a=this._regions.toFoldRange(i),l=this._textModel.getDecorationRange(this._editorDecorationIds[i]);l&&(o&&e?.startsInside(l.startLineNumber+1,l.endLineNumber)&&(o=!1),t.push({startLineNumber:l.startLineNumber,endLineNumber:l.endLineNumber,type:a.type,isCollapsed:o,source:s}))}}return t}getMemento(){const e=this._currentFoldedOrManualRanges(),t=[],i=this._textModel.getLineCount();for(let r=0,o=e.length;r<o;r++){const s=e[r];if(s.startLineNumber>=s.endLineNumber||s.startLineNumber<1||s.endLineNumber>i)continue;const a=this._getLinesChecksum(s.startLineNumber+1,s.endLineNumber);t.push({startLineNumber:s.startLineNumber,endLineNumber:s.endLineNumber,isCollapsed:s.isCollapsed,source:s.source,checksum:a})}return t.length>0?t:void 0}applyMemento(e){if(!Array.isArray(e))return;const t=[],i=this._textModel.getLineCount();for(const o of e){if(o.startLineNumber>=o.endLineNumber||o.startLineNumber<1||o.endLineNumber>i)continue;const s=this._getLinesChecksum(o.startLineNumber+1,o.endLineNumber);(!o.checksum||s===o.checksum)&&t.push({startLineNumber:o.startLineNumber,endLineNumber:o.endLineNumber,type:void 0,isCollapsed:o.isCollapsed??!0,source:o.source??0})}const r=nc.sanitizeAndMerge(this._regions,t,i);this.updatePost(nc.fromFoldRanges(r))}_getLinesChecksum(e,t){return _7e(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const i=[];if(this._regions){let r=this._regions.findRange(e),o=1;for(;r>=0;){const s=this._regions.toRegion(r);(!t||t(s,o))&&i.push(s),o++,r=s.parentIndex}}return i}getRegionAtLine(e){if(this._regions){const t=this._regions.findRange(e);if(t>=0)return this._regions.toRegion(t)}return null}getRegionsInside(e,t){const i=[],r=e?e.regionIndex+1:0,o=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const s=[];for(let a=r,l=this._regions.length;a<l;a++){const c=this._regions.toRegion(a);if(this._regions.getStartLineNumber(a)<o){for(;s.length>0&&!c.containedBy(s[s.length-1]);)s.pop();s.push(c),t(c,s.length)&&i.push(c)}else break}}else for(let s=r,a=this._regions.length;s<a;s++){const l=this._regions.toRegion(s);if(this._regions.getStartLineNumber(s)<o)(!t||t(l))&&i.push(l);else break}return i}}function Ynt(n,e,t){const i=[];for(const r of t){const o=n.getRegionAtLine(r);if(o){const s=!o.isCollapsed;if(i.push(o),e>1){const a=n.getRegionsInside(o,(l,c)=>l.isCollapsed!==s&&c<e);i.push(...a)}}}n.toggleCollapseState(i)}function Uy(n,e,t=Number.MAX_VALUE,i){const r=[];if(i&&i.length>0)for(const o of i){const s=n.getRegionAtLine(o);if(s&&(s.isCollapsed!==e&&r.push(s),t>1)){const a=n.getRegionsInside(s,(l,c)=>l.isCollapsed!==e&&c<t);r.push(...a)}}else{const o=n.getRegionsInside(null,(s,a)=>s.isCollapsed!==e&&a<t);r.push(...o)}n.toggleCollapseState(r)}function Jnt(n,e,t,i){const r=[];for(const o of i){const s=n.getAllRegionsAtLine(o,(a,l)=>a.isCollapsed!==e&&l<=t);r.push(...s)}n.toggleCollapseState(r)}function Fdi(n,e,t){const i=[];for(const r of t){const o=n.getAllRegionsAtLine(r,s=>s.isCollapsed!==e);o.length>0&&i.push(o[0])}n.toggleCollapseState(i)}function zdi(n,e,t,i){const r=(s,a)=>a===e&&s.isCollapsed!==t&&!i.some(l=>s.containsLine(l)),o=n.getRegionsInside(null,r);n.toggleCollapseState(o)}function Qnt(n,e,t){const i=[];for(const s of t){const a=n.getAllRegionsAtLine(s,void 0);a.length>0&&i.push(a[0])}const r=s=>i.every(a=>!a.containedBy(s)&&!s.containedBy(a))&&s.isCollapsed!==e,o=n.getRegionsInside(null,r);n.toggleCollapseState(o)}function eke(n,e,t){const i=n.textModel,r=n.regions,o=[];for(let s=r.length-1;s>=0;s--)if(t!==r.isCollapsed(s)){const a=r.getStartLineNumber(s);e.test(i.getLineContent(a))&&o.push(r.toRegion(s))}n.toggleCollapseState(o)}function tke(n,e,t){const i=n.regions,r=[];for(let o=i.length-1;o>=0;o--)t!==i.isCollapsed(o)&&e===i.getType(o)&&r.push(i.toRegion(o));n.toggleCollapseState(r)}function Bdi(n,e){let t=null;const i=e.getRegionAtLine(n);if(i!==null&&(t=i.startLineNumber,n===t)){const r=i.parentIndex;r!==-1?t=e.regions.getStartLineNumber(r):t=null}return t}function jdi(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){if(n!==t.startLineNumber)return t.startLineNumber;{const i=t.parentIndex;let r=0;for(i!==-1&&(r=e.regions.getStartLineNumber(t.parentIndex));t!==null;)if(t.regionIndex>0){if(t=e.regions.toRegion(t.regionIndex-1),t.startLineNumber<=r)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}}else if(e.regions.length>0)for(t=e.regions.toRegion(e.regions.length-1);t!==null;){if(t.startLineNumber<n)return t.startLineNumber;t.regionIndex>0?t=e.regions.toRegion(t.regionIndex-1):t=null}return null}function Wdi(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){const i=t.parentIndex;let r=0;if(i!==-1)r=e.regions.getEndLineNumber(t.parentIndex);else{if(e.regions.length===0)return null;r=e.regions.getEndLineNumber(e.regions.length-1)}for(;t!==null;)if(t.regionIndex<e.regions.length){if(t=e.regions.toRegion(t.regionIndex+1),t.startLineNumber>=r)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}else if(e.regions.length>0)for(t=e.regions.toRegion(0);t!==null;){if(t.startLineNumber>n)return t.startLineNumber;t.regionIndex<e.regions.length?t=e.regions.toRegion(t.regionIndex+1):t=null}return null}class qdi{get onDidChange(){return this._updateEventEmitter.event}get hiddenRanges(){return this._hiddenRanges}constructor(e){this._updateEventEmitter=new fe,this._hasLineChanges=!1,this._foldingModel=e,this._foldingModelListener=e.onDidChange(t=>this.updateHiddenRanges()),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}notifyChangeModelContent(e){this._hiddenRanges.length&&!this._hasLineChanges&&(this._hasLineChanges=e.changes.some(t=>t.range.endLineNumber!==t.range.startLineNumber||t3(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let i=0,r=0,o=Number.MAX_VALUE,s=-1;const a=this._foldingModel.regions;for(;i<a.length;i++){if(!a.isCollapsed(i))continue;const l=a.getStartLineNumber(i)+1,c=a.getEndLineNumber(i);o<=l&&c<=s||(!e&&r<this._hiddenRanges.length&&this._hiddenRanges[r].startLineNumber===l&&this._hiddenRanges[r].endLineNumber===c?(t.push(this._hiddenRanges[r]),r++):(e=!0,t.push(new ce(l,1,c,1))),o=l,s=c)}(this._hasLineChanges||e||r<this._hiddenRanges.length)&&this.applyHiddenRanges(t)}applyHiddenRanges(e){this._hiddenRanges=e,this._hasLineChanges=!1,this._updateEventEmitter.fire(e)}hasRanges(){return this._hiddenRanges.length>0}isHidden(e){return YAe(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let r=null;const o=s=>((!r||!Udi(s,r))&&(r=YAe(this._hiddenRanges,s)),r?r.startLineNumber-1:null);for(let s=0,a=e.length;s<a;s++){let l=e[s];const c=o(l.startLineNumber);c&&(l=l.setStartPosition(c,i.getLineMaxColumn(c)),t=!0);const d=o(l.endLineNumber);d&&(l=l.setEndPosition(d,i.getLineMaxColumn(d)),t=!0),e[s]=l}return t}dispose(){this.hiddenRanges.length>0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function Udi(n,e){return n>=e.startLineNumber&&n<=e.endLineNumber}function YAe(n,e){const t=Lre(n,i=>e<i.startLineNumber)-1;return t>=0&&n[t].endLineNumber>=e?n[t]:null}const Zdi=5e3,Kdi="indent";class eit{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id=Kdi}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,r=t&&t.markers;return Promise.resolve(Ydi(this.editorModel,i,r,this.foldingRangesLimit))}}let Gdi=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>bd||t>bd)return;const r=this._length;this._startIndexes[r]=e,this._endIndexes[r]=t,this._length++,i<1e3&&(this._indentOccurrences[i]=(this._indentOccurrences[i]||0)+1)}toIndentRanges(e){const t=this._foldingRangesLimit.limit;if(this._length<=t){this._foldingRangesLimit.update(this._length,!1);const i=new Uint32Array(this._length),r=new Uint32Array(this._length);for(let o=this._length-1,s=0;o>=0;o--,s++)i[s]=this._startIndexes[o],r[s]=this._endIndexes[o];return new nc(i,r)}else{this._foldingRangesLimit.update(this._length,t);let i=0,r=this._indentOccurrences.length;for(let l=0;l<this._indentOccurrences.length;l++){const c=this._indentOccurrences[l];if(c){if(c+i>t){r=l;break}i+=c}}const o=e.getOptions().tabSize,s=new Uint32Array(t),a=new Uint32Array(t);for(let l=this._length-1,c=0;l>=0;l--){const d=this._startIndexes[l],u=e.getLineContent(d),h=Vve(u,o);(h<r||h===r&&i++<t)&&(s[c]=d,a[c]=this._endIndexes[l],c++)}return new nc(s,a)}}};const Xdi={limit:Zdi,update:()=>{}};function Ydi(n,e,t,i=Xdi){const r=n.getOptions().tabSize,o=new Gdi(i);let s;t&&(s=new RegExp(`(${t.start.source})|(?:${t.end.source})`));const a=[],l=n.getLineCount()+1;a.push({indent:-1,endAbove:l,line:l});for(let c=n.getLineCount();c>0;c--){const d=n.getLineContent(c),u=Vve(d,r);let h=a[a.length-1];if(u===-1){e&&(h.endAbove=c);continue}let f;if(s&&(f=d.match(s)))if(f[1]){let p=a.length-1;for(;p>0&&a[p].indent!==-2;)p--;if(p>0){a.length=p+1,h=a[p],o.insertFirst(c,h.line,u),h.line=c,h.indent=u,h.endAbove=c;continue}}else{a.push({indent:-2,endAbove:c,line:c});continue}if(h.indent>u){do a.pop(),h=a[a.length-1];while(h.indent>u);const p=h.endAbove-1;p-c>=1&&o.insertFirst(c,p,u)}h.indent===u?h.endAbove=c:a.push({indent:u,endAbove:c,line:c})}return o.toIndentRanges(n)}const Jdi=ie("editor.foldBackground",{light:ln(mf,.3),dark:ln(mf,.3),hcDark:null,hcLight:null},N("foldBackgroundBackground","Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);ie("editor.foldPlaceholderForeground",{light:"#808080",dark:"#808080",hcDark:null,hcLight:null},N("collapsedTextColor","Color of the collapsed text after the first line of a folded range."));ie("editorGutter.foldingControlForeground",Rre,N("editorGutter.foldingControlForeground","Color of the folding control in the editor gutter."));const O4e=Q1("folding-expanded",tt.chevronDown,N("foldingExpandedIcon","Icon for expanded ranges in the editor glyph margin.")),V4e=Q1("folding-collapsed",tt.chevronRight,N("foldingCollapsedIcon","Icon for collapsed ranges in the editor glyph margin.")),JAe=Q1("folding-manual-collapsed",V4e,N("foldingManualCollapedIcon","Icon for manually collapsed ranges in the editor glyph margin.")),QAe=Q1("folding-manual-expanded",O4e,N("foldingManualExpandedIcon","Icon for manually expanded ranges in the editor glyph margin.")),Dhe={color:d9(Jdi),position:1},_8=N("linesCollapsed","Click to expand the range."),ML=N("linesExpanded","Click to collapse the range.");class Ul{static{this.COLLAPSED_VISUAL_DECORATION=Ii.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:_8,firstLineDecorationClassName:on.asClassName(V4e)})}static{this.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Ii.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:Dhe,isWholeLine:!0,linesDecorationsTooltip:_8,firstLineDecorationClassName:on.asClassName(V4e)})}static{this.MANUALLY_COLLAPSED_VISUAL_DECORATION=Ii.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:_8,firstLineDecorationClassName:on.asClassName(JAe)})}static{this.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Ii.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:Dhe,isWholeLine:!0,linesDecorationsTooltip:_8,firstLineDecorationClassName:on.asClassName(JAe)})}static{this.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=Ii.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:_8})}static{this.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=Ii.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:Dhe,isWholeLine:!0,linesDecorationsTooltip:_8})}static{this.EXPANDED_VISUAL_DECORATION=Ii.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+on.asClassName(O4e),linesDecorationsTooltip:ML})}static{this.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Ii.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:on.asClassName(O4e),linesDecorationsTooltip:ML})}static{this.MANUALLY_EXPANDED_VISUAL_DECORATION=Ii.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+on.asClassName(QAe),linesDecorationsTooltip:ML})}static{this.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Ii.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:on.asClassName(QAe),linesDecorationsTooltip:ML})}static{this.NO_CONTROLS_EXPANDED_RANGE_DECORATION=Ii.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0})}static{this.HIDDEN_RANGE_DECORATION=Ii.register({description:"folding-hidden-range-decoration",stickiness:1})}constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t?Ul.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?Ul.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:Ul.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:Ul.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?i?this.showFoldingHighlights?Ul.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ul.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?Ul.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ul.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?i?Ul.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:Ul.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?Ul.MANUALLY_EXPANDED_VISUAL_DECORATION:Ul.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}}const Qdi={},eui="syntax";class tit{constructor(e,t,i,r,o){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=r,this.fallbackRangeProvider=o,this.id=eui,this.disposables=new ht,o&&this.disposables.add(o);for(const s of t)typeof s.onDidChange=="function"&&this.disposables.add(s.onDidChange(i))}compute(e){return tui(this.providers,this.editorModel,e).then(t=>t?iui(t,this.foldingRangesLimit):this.fallbackRangeProvider?.compute(e)??null)}dispose(){this.disposables.dispose()}}function tui(n,e,t){let i=null;const r=n.map((o,s)=>Promise.resolve(o.provideFoldingRanges(e,Qdi,t)).then(a=>{if(!t.isCancellationRequested&&Array.isArray(a)){Array.isArray(i)||(i=[]);const l=e.getLineCount();for(const c of a)c.start>0&&c.end>c.start&&c.end<=l&&i.push({start:c.start,end:c.end,rank:s,kind:c.kind})}},Jae));return Promise.all(r).then(o=>i)}class nui{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,i,r){if(e>bd||t>bd)return;const o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._nestingLevels[o]=r,this._types[o]=i,this._length++,r<30&&(this._nestingLevelCounts[r]=(this._nestingLevelCounts[r]||0)+1)}toIndentRanges(){const e=this._foldingRangesLimit.limit;if(this._length<=e){this._foldingRangesLimit.update(this._length,!1);const t=new Uint32Array(this._length),i=new Uint32Array(this._length);for(let r=0;r<this._length;r++)t[r]=this._startIndexes[r],i[r]=this._endIndexes[r];return new nc(t,i,this._types)}else{this._foldingRangesLimit.update(this._length,e);let t=0,i=this._nestingLevelCounts.length;for(let a=0;a<this._nestingLevelCounts.length;a++){const l=this._nestingLevelCounts[a];if(l){if(l+t>e){i=a;break}t+=l}}const r=new Uint32Array(e),o=new Uint32Array(e),s=[];for(let a=0,l=0;a<this._length;a++){const c=this._nestingLevels[a];(c<i||c===i&&t++<e)&&(r[l]=this._startIndexes[a],o[l]=this._endIndexes[a],s[l]=this._types[a],l++)}return new nc(r,o,s)}}}function iui(n,e){const t=n.sort((s,a)=>{let l=s.start-a.start;return l===0&&(l=s.rank-a.rank),l}),i=new nui(e);let r;const o=[];for(const s of t)if(!r)r=s,i.add(s.start,s.end,s.kind&&s.kind.value,o.length);else if(s.start>r.start)if(s.end<=r.end)o.push(r),r=s,i.add(s.start,s.end,s.kind&&s.kind.value,o.length);else{if(s.start>r.end){do r=o.pop();while(r&&s.start>r.end);r&&o.push(r),r=s}i.add(s.start,s.end,s.kind&&s.kind.value,o.length)}return i.toIndentRanges()}var rui=function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Qk=function(n,e){return function(t,i){e(t,i,n)}},VC;const _s=new ut("foldingEnabled",!1);let ey=class extends Ne{static{VC=this}static{this.ID="editor.contrib.folding"}static get(e){return e.getContribution(VC.ID)}static getFoldingRangeProviders(e,t){const i=e.foldingRangeProvider.ordered(t);return VC._foldingRangeSelector?.(i,t)??i}constructor(e,t,i,r,o,s){super(),this.contextKeyService=t,this.languageConfigurationService=i,this.languageFeaturesService=s,this.localToDispose=this._register(new ht),this.editor=e,this._foldingLimitReporter=new oui(e);const a=this.editor.getOptions();this._isEnabled=a.get(43),this._useFoldingProviders=a.get(44)!=="indentation",this._unfoldOnClickAfterEndOfLine=a.get(48),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=a.get(46),this.updateDebounceInfo=o.for(s.foldingRangeProvider,"Folding",{min:200}),this.foldingModel=null,this.hiddenRangeModel=null,this.rangeProvider=null,this.foldingRegionPromise=null,this.foldingModelPromise=null,this.updateScheduler=null,this.cursorChangedScheduler=null,this.mouseDownInfo=null,this.foldingDecorationProvider=new Ul(e),this.foldingDecorationProvider.showFoldingControls=a.get(111),this.foldingDecorationProvider.showFoldingHighlights=a.get(45),this.foldingEnabled=_s.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel(()=>this.onModelChanged())),this._register(this.editor.onDidChangeConfiguration(l=>{if(l.hasChanged(43)&&(this._isEnabled=this.editor.getOptions().get(43),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),l.hasChanged(47)&&this.onModelChanged(),l.hasChanged(111)||l.hasChanged(45)){const c=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=c.get(111),this.foldingDecorationProvider.showFoldingHighlights=c.get(45),this.triggerFoldingModelChanged()}l.hasChanged(44)&&(this._useFoldingProviders=this.editor.getOptions().get(44)!=="indentation",this.onFoldingStrategyChanged()),l.hasChanged(48)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(48)),l.hasChanged(46)&&(this._foldingImportsByDefault=this.editor.getOptions().get(46))})),this.onModelChanged()}saveViewState(){const e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){const t=this.foldingModel.getMemento(),i=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:i,foldedImports:this._currentModelHasFoldedImports}}}restoreViewState(e){const t=this.editor.getModel();if(!(!t||!this._isEnabled||t.isTooLargeForTokenization()||!this.hiddenRangeModel)&&e&&(this._currentModelHasFoldedImports=!!e.foldedImports,e.collapsedRegions&&e.collapsedRegions.length>0&&this.foldingModel)){this._restoringViewState=!0;try{this.foldingModel.applyMemento(e.collapsedRegions)}finally{this._restoringViewState=!1}}}onModelChanged(){this.localToDispose.clear();const e=this.editor.getModel();!this._isEnabled||!e||e.isTooLargeForTokenization()||(this._currentModelHasFoldedImports=!1,this.foldingModel=new $di(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new qdi(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new Oy(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new da(()=>this.revealCursor(),200),this.localToDispose.add(this.cursorChangedScheduler),this.localToDispose.add(this.languageFeaturesService.foldingRangeProvider.onDidChange(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelContent(t=>this.onDidChangeModelContent(t))),this.localToDispose.add(this.editor.onDidChangeCursorPosition(()=>this.onCursorPositionChanged())),this.localToDispose.add(this.editor.onMouseDown(t=>this.onEditorMouseDown(t))),this.localToDispose.add(this.editor.onMouseUp(t=>this.onEditorMouseUp(t))),this.localToDispose.add({dispose:()=>{this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.updateScheduler?.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,this.rangeProvider?.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){this.rangeProvider?.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const t=new eit(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=VC.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new tit(e,i,()=>this.triggerFoldingModelChanged(),this._foldingLimitReporter,t))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){this.hiddenRangeModel?.notifyChangeModelContent(e),this.triggerFoldingModelChanged()}triggerFoldingModelChanged(){this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger(()=>{const e=this.foldingModel;if(!e)return null;const t=new Sp,i=this.getRangeProvider(e.textModel),r=this.foldingRegionPromise=C7e(o=>i.compute(o));return r.then(o=>{if(o&&r===this.foldingRegionPromise){let s;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const c=o.setCollapsedAllOfType(Jl.Imports.value,!0);c&&(s=__.capture(this.editor),this._currentModelHasFoldedImports=c)}const a=this.editor.getSelections();e.update(o,sui(a)),s?.restore(this.editor);const l=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=l)}return e})}).then(void 0,e=>(li(e),null)))}onHiddenRangesChanges(e){if(this.hiddenRangeModel&&e.length&&!this._restoringViewState){const t=this.editor.getSelections();t&&this.hiddenRangeModel.adjustSelections(t)&&this.editor.setSelections(t)}this.editor.setHiddenAreas(e,this)}onCursorPositionChanged(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const e=this.getFoldingModel();e&&e.then(t=>{if(t){const i=this.editor.getSelections();if(i&&i.length>0){const r=[];for(const o of i){const s=o.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(s)&&r.push(...t.getAllRegionsAtLine(s,a=>a.isCollapsed&&s>a.startLineNumber))}r.length&&(t.toggleCollapseState(r),this.reveal(i[0].getPosition()))}}}).then(void 0,li)}onEditorMouseDown(e){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!e.target||!e.target.range||!e.event.leftButton&&!e.event.middleButton)return;const t=e.target.range;let i=!1;switch(e.target.type){case 4:{const r=e.target.detail,o=e.target.element.offsetLeft;if(r.offsetX-o<4)return;i=!0;break}case 7:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return}case 6:{if(this.hiddenRangeModel.hasRanges()){const r=this.editor.getModel();if(r&&t.startColumn===r.getLineMaxColumn(t.startLineNumber))break}return}default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:i}}onEditorMouseUp(e){const t=this.foldingModel;if(!t||!this.mouseDownInfo||!e.target)return;const i=this.mouseDownInfo.lineNumber,r=this.mouseDownInfo.iconClicked,o=e.target.range;if(!o||o.startLineNumber!==i)return;if(r){if(e.target.type!==4)return}else{const a=this.editor.getModel();if(!a||o.startColumn!==a.getLineMaxColumn(i))return}const s=t.getRegionAtLine(i);if(s&&s.startLineNumber===i){const a=s.isCollapsed;if(r||a){const l=e.event.altKey;let c=[];if(l){const d=h=>!h.containedBy(s)&&!s.containedBy(h),u=t.getRegionsInside(null,d);for(const h of u)h.isCollapsed&&c.push(h);c.length===0&&(c=u)}else{const d=e.event.middleButton||e.event.shiftKey;if(d)for(const u of t.getRegionsInside(s))u.isCollapsed===a&&c.push(u);(a||!d||c.length===0)&&c.push(s)}t.toggleCollapseState(c),this.reveal({lineNumber:i,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}};ey=VC=rui([Qk(1,Zn),Qk(2,Qc),Qk(3,Y1),Qk(4,fQe),Qk(5,pi)],ey);class oui{constructor(e){this.editor=e,this._onDidChange=new fe,this._computed=0,this._limited=!1}get limit(){return this.editor.getOptions().get(47)}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}class Ws extends F7e{runEditorCommand(e,t,i){const r=e.get(Qc),o=ey.get(t);if(!o)return;const s=o.getFoldingModel();if(s)return this.reportTelemetry(e,t),s.then(a=>{if(a){this.invoke(o,a,t,i,r);const l=t.getSelection();l&&o.reveal(l.getStartPosition())}})}getSelectedLines(e){const t=e.getSelections();return t?t.map(i=>i.startLineNumber):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map(i=>i+1):this.getSelectedLines(t)}run(e,t){}}function sui(n){return!n||n.length===0?{startsInside:()=>!1}:{startsInside(e,t){for(const i of n){const r=i.startLineNumber;if(r>=e&&r<=t)return!0}return!1}}}function nit(n){if(!Sa(n)){if(!_a(n))return!1;const e=n;if(!Sa(e.levels)&&!Jf(e.levels)||!Sa(e.direction)&&!Ll(e.direction)||!Sa(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(Jf)))return!1}return!0}class aui extends Ws{constructor(){super({id:"editor.unfold",label:N("unfoldAction.label","Unfold"),alias:"Unfold",precondition:_s,kbOpts:{kbExpr:Be.editorTextFocus,primary:3166,mac:{primary:2654},weight:100},metadata:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:`Property-value pairs that can be passed through this argument:
3411
3411
  * 'levels': Number of levels to unfold. If not set, defaults to 1.
3412
3412
  * 'direction': If 'up', unfold given number of levels up otherwise unfolds down.
3413
3413
  * 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the unfold action to. If not set, the active selection(s) will be used.
@@ -3482,7 +3482,7 @@ window.addEventListener("afterprint", () => { try { window.close(); } catch (e)
3482
3482
  </body>
3483
3483
  </html>`;return e.document.open(),e.document.write(i),e.document.close(),!0}function mhi(n){const e=Bs(),t=a$e(),[i,r]=Ye(!1),o=J(()=>Gte(n.path)),s=J(()=>ehi(n.path)),a=J(()=>thi(n.path)),l=J(()=>nhi(n.path)),c=J(()=>ihi(n.path)),d=J(()=>rhi(n.path)),u=J(()=>H4e(e.url,n.path,e.directory)),h=J(()=>n.state.mode??"rich"),f=J(()=>o()||s()||l());let p;const g=J(()=>n.path.split("/").pop()??n.path),v=J(()=>{const w=new Blob([n.value]).size;return w<1024?`${w} B`:w<1024*1024?`${(w/1024).toFixed(1)} KB`:`${(w/(1024*1024)).toFixed(1)} MB`}),y=J(()=>s()?"CSV":o()?"Markdown":Xte(n.path).toUpperCase()),C=J(()=>{const w=g(),x=w.lastIndexOf(".");return x>0?w.slice(0,x):w}),_=async()=>{if(!i()){r(!0);try{const w=await Promise.resolve(t.parse(n.value));!await ghi({title:C(),html:w})&&typeof window<"u"&&window.alert("Unable to open print window. Please allow popups for this site to export PDF.")}catch(w){console.error("pdf export failed",w),typeof window<"u"&&window.alert(`PDF export failed: ${w?.message??"unknown error"}`)}finally{r(!1)}}};return a()?(()=>{var w=qui();return W(w,m(hhi,{get value(){return n.value},get onChange(){return n.onChange}})),w})():c()?(()=>{var w=Uui(),x=w.firstChild;return st(()=>mt(x,"src",u())),w})():d()?(()=>{var w=Zui(),x=w.firstChild;return st(M=>{var L=u(),S=n.path;return L!==M.e&&mt(x,"src",M.e=L),S!==M.t&&mt(x,"alt",M.t=S),M},{e:void 0,t:void 0}),w})():(()=>{var w=Jui(),x=w.firstChild,M=x.firstChild,L=M.firstChild,S=L.nextSibling,I=S.nextSibling,E=M.nextSibling,A=x.nextSibling;return W(M,m(_e,{get when(){return sn(()=>!!o())()&&h()==="rich"},get children(){var T=Kui(),D=T.firstChild,R=D.nextSibling;return D.$$click=()=>p?.undo(),W(D,m(Cn,{name:"reset",size:"small"})),R.$$click=()=>p?.redo(),W(R,m(Cn,{name:"refresh-cw",size:"small",class:"scale-x-[-1]"})),st(P=>{var V=!p?.canUndo(),$=!p?.canRedo();return V!==P.e&&(D.disabled=P.e=V),$!==P.t&&(R.disabled=P.t=$),P},{e:void 0,t:void 0}),T}}),L),W(L,g),W(S,v),W(I,y),W(E,m(_e,{get when(){return n.state.saveError},children:T=>(()=>{var D=Qui();return W(D,T),D})()}),null),W(E,m(_e,{get when(){return sn(()=>!n.state.saveError)()&&n.state.stale},get children(){return Gui()}}),null),W(E,m(_e,{get when(){return o()},get children(){var T=Xui();return T.$$click=_,W(T,m(Cn,{get name(){return i()?"loader-2":"download"},size:"small",get class(){return i()?"animate-spin":""}})),st(D=>{var R=i()||!n.value,P=i()?"Preparing PDF…":"Export as PDF";return R!==D.e&&(T.disabled=D.e=R),P!==D.t&&mt(T,"title",D.t=P),D},{e:void 0,t:void 0}),T}}),null),W(E,m(_e,{get when(){return f()},get children(){var T=Yui(),D=T.firstChild,R=D.nextSibling,P=R.nextSibling;return D.$$click=()=>n.onMode("rich"),W(D,m(Cn,{get name(){return sn(()=>!!s())()?"table":l()?"globe":"letter-text"},size:"small"})),P.$$click=()=>n.onMode("raw"),W(P,m(Cn,{name:"code",size:"small"})),st(V=>{var $=`flex items-center justify-center w-7 h-7 transition-colors ${h()==="rich"?"text-text-strong shadow-[inset_0_-1px_0_0_var(--text-strong)]":"text-text-weak hover:text-text-base"}`,j=s()?"Table view":l()?"Preview":"Rich editor",B=`flex items-center justify-center w-7 h-7 transition-colors ${h()==="raw"?"text-text-strong shadow-[inset_0_-1px_0_0_var(--text-strong)]":"text-text-weak hover:text-text-base"}`,te=s()?"Raw CSV":l()?"HTML source":"Markdown source";return $!==V.e&&H1(D,V.e=$),j!==V.t&&mt(D,"title",V.t=j),B!==V.a&&H1(P,V.a=B),te!==V.o&&mt(P,"title",V.o=te),V},{e:void 0,t:void 0,a:void 0,o:void 0}),T}}),null),W(A,m(V1,{get children(){return[m(fi,{get when(){return sn(()=>!!s())()&&h()==="rich"},get children(){return m(iit,{get value(){return n.value},get onChange(){return n.onChange}})}}),m(fi,{get when(){return sn(()=>!!l())()&&h()==="rich"},get children(){return m(uhi,{get value(){return n.value}})}}),m(fi,{get when(){return sn(()=>!o()&&!s()&&!a())()&&!l()},get children(){return m(rDe,{get path(){return n.path},get value(){return n.value},get active(){return n.active},get onChange(){return n.onChange}})}}),m(fi,{get when(){return sn(()=>!!o())()&&h()==="rich"},get children(){return m(dhi,{get path(){return n.path},get value(){return n.value},get active(){return n.active},get onChange(){return n.onChange},get mention(){return n.mention},ref:T=>{p=T}})}}),m(fi,{get when(){return h()==="raw"},get children(){return m(rDe,{get path(){return n.path},get value(){return n.value},get active(){return n.active},get onChange(){return n.onChange}})}})]}})),st(()=>mt(L,"title",g())),w})()}Fs(["click","input","keydown"]);var vhi=le('<div class="rounded-md border border-border-base bg-background-base px-3 py-2 text-12-regular text-text-weak">Preview unavailable'),yhi=le('<div class="bg-background-base overflow-hidden h-full flex flex-col">'),khi=le('<div class="flex flex-col h-full"><div class="flex-shrink-0 border-b border-border-base p-4"><div class="flex items-center justify-center bg-background-stronger rounded-lg p-4"><img class="max-h-64 max-w-full object-contain"></div></div><div class="flex-1 overflow-auto entity-file-preview">'),Chi=le('<div class="h-full overflow-auto">'),bhi=le('<div class="h-full flex items-center justify-center bg-background-stronger px-6"><audio controls preload=metadata class="w-full max-w-xl">'),whi=le('<div class="h-full flex items-center justify-center bg-black"><video controls autoplay class="max-h-full max-w-full">'),_hi=le('<div class="h-full overflow-auto px-3 py-2 entity-md-preview">');const xhi={session:[],session_status:{},session_diff:{},message:{},part:{}};function aDe(n){return n.replaceAll("\\","/").replace(/\/+/g,"/")}function lDe(n,e){const t=e.split("#")[0]?.split("?")[0]?.trim();if(!t||/^(?:[a-z]+:|\/\/)/i.test(t))return;const i=aDe(t);if(i.startsWith("/"))return i.replace(/^\/+/,"");const r=aDe(n).split("/").slice(0,-1);for(const o of i.split("/"))if(!(!o||o===".")){if(o===".."){r.pop();continue}r.push(o)}return r.join("/")}function oit(n){const e=Bs(),t=J(()=>{if(!(!n.file||n.file.type!=="text"||n.file.encoding==="base64"))return n.file.content}),i=J(()=>{const u=t();if(!(!u||!JMn(n.path)))return u}),r=J(()=>{const u=t();if(!(!u||!QMn(n.path)))return u}),o=J(()=>{if(JZe(n.path))return nb(e.url,e.directory,n.path)}),s=J(()=>{if(iLn(n.path))return nb(e.url,e.directory,n.path)}),a=J(()=>{if(X2e(n.path))return nb(e.url,e.directory,n.path)}),l=J(()=>Rne(n.file?.content??"")),c=u=>e.client.file.read({path:u}).then(h=>h.data).catch(()=>{}),d=async u=>{const h=await c(u);if(!(!h||h.type!=="text"||h.encoding==="base64"))return h.content};return m(_e,{get when(){return n.file},get fallback(){return vhi()},children:u=>(()=>{var h=yhi();return W(h,m(_e,{get when(){return i()},get fallback(){return m(_e,{get when(){return o()},get fallback(){return m(_e,{get when(){return s()},get fallback(){return m(_e,{get when(){return r()},get fallback(){return m(_e,{get when(){return sn(()=>!!a())()&&n.path.toLowerCase().endsWith(".svg")},children:f=>(()=>{var p=khi(),g=p.firstChild,v=g.firstChild,y=v.firstChild,C=g.nextSibling;return y.addEventListener("error",_=>{const w=_.currentTarget;w.style.display="none",w.parentElement.innerHTML='<div class="text-text-weak">Failed to load SVG</div>'}),W(C,m(A$e,{mode:"text",get file(){return{name:n.path,contents:u().content,cacheKey:l()}},class:"text-10-mono",get media(){return{mode:"auto",path:n.path,current:u(),readFile:c}}})),st(_=>{var w=f(),x=n.path;return w!==_.e&&mt(y,"src",_.e=w),x!==_.t&&mt(y,"alt",_.t=x),_},{e:void 0,t:void 0}),p})()})},children:f=>(()=>{var p=Chi();return W(p,m(iit,{get value(){return f()}})),p})()})},children:f=>(()=>{var p=bhi(),g=p.firstChild;return st(()=>mt(g,"src",f())),p})()})},children:f=>(()=>{var p=whi(),g=p.firstChild;return g.addEventListener("error",v=>{const y=v.currentTarget;y.style.display="none",y.parentElement.innerHTML='<div class="text-text-weak">Failed to load video</div>'}),st(()=>mt(g,"src",f())),p})()})},children:f=>m(f5e,{data:xhi,get directory(){return e.directory},get mediaUrl(){return e.url},get children(){var p=_hi();return W(p,m(_Ke,{get text(){return f()},get cacheKey(){return l()},onLinkClick:g=>{const v=lDe(n.path,g);v&&n.onLinkClick?.(v)},fileFetch:g=>{const v=lDe(n.path,g);return v?d(v):Promise.resolve(void 0)}})),p}})})),h})()})}var Shi=le('<div class="bg-gradient-to-b from-black to-black h-full w-full opacity-75"><div style=pointer-events:none>'),Mhi=le('<img alt class="block size-full object-cover"loading=lazy>',!0,!1,!1),Lhi=le('<video class="block size-full object-cover"preload=metadata muted playsinline>'),Ihi=le('<pre class="absolute inset-0 m-0 overflow-hidden whitespace-pre p-1.5 font-mono text-[8px] leading-[1.25] text-text-weak">'),Nhi=le('<div class="absolute inset-0 grid grid-cols-3 gap-px p-1.5">'),Ehi=le('<div class="absolute bottom-1 right-1 rounded-sm bg-background-base/80 px-1 py-0.5 text-[9px] font-medium text-text-weak">'),Thi=le('<div class="absolute inset-0 flex items-center justify-center text-text-weaker">'),Ahi=le('<div class="flex items-center justify-center rounded-[2px] bg-surface-raised-base/40">'),Dhi=le('<div class="absolute inset-0 flex items-center justify-center">');function Rhi(n){const e=Bs(),[t]=mo(()=>n.type==="directory"?n.path:void 0,async l=>{try{return(await e.client.file.list({path:l})).data??[]}catch{return[]}},{initialValue:[]}),[i]=mo(()=>n.type==="file"&&!X2e(n.path)?n.path:void 0,async l=>{try{return(await e.client.file.read({path:l})).data}catch{return}},{initialValue:void 0}),r=J(()=>{const l=i.latest;if(!(!l||l.type!=="text"||l.encoding==="base64"))return l.content}),o=J(()=>{const l=r();if(l)return l.split(`
3484
3484
  `).slice(0,24).join(`
3485
- `).slice(0,1200)}),s=J(()=>n.type==="file"&&X2e(n.path)?nb(e.url,e.directory,n.path):void 0),a=J(()=>n.type==="file"&&JZe(n.path)?nb(e.url,e.directory,n.path):void 0);return(()=>{var l=Shi(),c=l.firstChild;return W(c,m(V1,{get fallback(){return m(Ohi,{get path(){return n.path},get type(){return n.type}})},get children(){return[m(fi,{get when(){return n.type==="directory"},get children(){return m(Phi,{get list(){return t.latest??[]}})}}),m(fi,{get when(){return s()},children:d=>(()=>{var u=Mhi();return u.addEventListener("error",h=>{h.currentTarget.style.display="none"}),st(()=>mt(u,"src",d())),u})()}),m(fi,{get when(){return a()},children:d=>(()=>{var u=Lhi();return u.addEventListener("error",h=>{h.currentTarget.style.display="none"}),st(()=>mt(u,"src",d())),u})()}),m(fi,{get when(){return o()},children:d=>(()=>{var u=Ihi();return W(u,d),u})()})]}})),st(()=>H1(c,`relative w-full h-full overflow-hidden rounded-sm bg-background-base text-text-weak ${n.class??""}`)),l})()}function Phi(n){const e=()=>n.list.length,t=()=>n.list.slice(0,9);return m(_e,{get when(){return e()>0},get fallback(){return(()=>{var i=Thi();return W(i,m(Cn,{name:"folder",size:"medium"})),i})()},get children(){return[(()=>{var i=Nhi();return W(i,m(ei,{get each(){return t()},children:r=>(()=>{var o=Ahi();return W(o,m(_e,{get when(){return r.type==="directory"},get fallback(){return m(Nae,{get node(){return{path:r.path,type:"file"}},class:"size-3"})},get children(){return m(Cn,{name:"folder",size:"small",class:"text-icon-weak"})}})),o})()})),i})(),(()=>{var i=Ehi();return W(i,e),i})()]}})}function Ohi(n){return(()=>{var e=Dhi();return W(e,m(_e,{get when(){return n.type==="file"},get fallback(){return m(Cn,{name:"folder",size:"medium",class:"text-icon-weak"})},get children(){return m(Nae,{get node(){return{path:n.path,type:"file"}},class:"size-6"})}})),e})()}var Vhi=le('<div class="flex-1 min-h-0 overflow-hidden">'),Hhi=le('<div class="h-full min-h-0">'),$hi=le('<div class="m-3 flex items-center gap-2 rounded-md border border-border-base bg-background-base px-3 py-2 text-text-weak"><span class=text-12-regular>Loading file...'),sit=le('<div class="grid grid-cols-2 gap-2">'),ait=le('<div class="h-full overflow-y-auto p-3">'),Fhi=le('<div class="flex items-center gap-2 rounded-md border border-border-base bg-background-base px-3 py-2 text-text-weak"><span class=text-12-regular>Loading directory...'),zhi=le('<div class="rounded-md border border-border-base bg-background-base px-3 py-2 text-12-regular text-text-weak">Empty directory'),Bhi=le('<span class="shrink-0 rounded-sm px-1 py-0.5 text-[9px] font-medium uppercase tracking-wide">'),jhi=le('<button class="entity-child-card group relative flex flex-col overflow-hidden rounded-md border border-border-base/60 bg-background-base text-left transition-colors hover:border-border-base hover:bg-surface-raised-base/40"><div class="relative h-20 w-full bg-surface-raised-base/30 border-b border-border-weaker-base"></div><div class="flex items-center gap-1.5 px-2 py-1.5 min-w-0"><span class="truncate flex-1 text-11-medium text-text-strong">'),Whi=le('<div class="grid grid-cols-4 gap-1.5">'),qhi=le('<div class="h-full overflow-y-auto p-3 flex flex-col gap-3">'),Uhi=le('<div class="flex flex-col rounded-md border border-border-base/60 bg-background-base px-2.5 py-2"><span class="text-14-semibold text-text-strong tabular-nums leading-none"></span><span class="mt-1 text-10-medium uppercase tracking-wide text-text-weaker">'),Zhi=le('<div class="rounded-md border border-border-base bg-background-base px-3 py-3 text-12-regular text-text-weak text-center">No README.md at project root'),Khi=le('<div class="rounded-md border border-border-base/60 bg-background-base overflow-hidden"><div class="flex items-center gap-1.5 border-b border-border-weaker-base px-2.5 py-1.5"><span class="font-mono text-10-medium text-text-weak">'),Ghi=le('<div class="flex items-center gap-2 rounded-md border border-border-base bg-background-base px-3 py-2 text-text-weak"><span class=text-12-regular>'),Xhi=le('<div class="flex items-center gap-2 text-text-weak"><span class=text-12-regular>Loading...'),Yhi=le('<div class="rounded-md border border-border-base bg-background-base px-3 py-3 text-12-regular text-text-weak">See <span class=text-text-strong>Details</span> tab for attributes.'),Jhi=le('<div class="rounded-md border border-border-base bg-background-base px-3 py-4 text-12-regular text-text-weak text-center">No preview available'),Qhi=le('<div class="flex flex-col gap-3">'),e0i=le('<div class="rounded-md border border-border-base/60 bg-background-base px-2.5 py-1.5"><div class="text-10-medium uppercase tracking-wide text-text-weaker"></div><div class="mt-0.5 text-11-regular text-text-strong truncate">');const t0i={session:[],session_status:{},session_diff:{},message:{},part:{}};function cDe(n){return(()=>{var e=Vhi();return W(e,m(V1,{get fallback(){return m(s0i,{get id(){return n.id}})},get children(){return[m(fi,{get when(){return n.type==="file"},get children(){return m(n0i,{get path(){return Y2e(n.id)}})}}),m(fi,{get when(){return n.type==="directory"},get children(){return m(i0i,{get path(){return Y2e(n.id)}})}}),m(fi,{get when(){return n.type==="project"},get children(){return m(o0i,{get id(){return n.id}})}})]}})),e})()}function n0i(n){const e=Dwn(),t=Bs(),i=xy(),r=FZe(),o=WZe(),s=Eae(),[a,l]=Ye(!1);Re(Mr(()=>n.path,g=>{g&&(l(!1),e.load(g).then(()=>{e.setMode(g,e.get(g)?.mode??"rich")}).catch(()=>l(!0)))}));const c=J(()=>e.get(n.path)),d=J(()=>e.text(n.path)??""),u=J(()=>{const g=c()?.content;return g?.type==="text"&&g.encoding!=="base64"}),h=J(()=>!!c()?.loaded||a()),f=()=>{const g=n.path;g&&e.save(g)},p=async g=>{try{await t.client.file.write({fileWriteInput:{path:g,content:"",format:!1}});const v=g.includes("/")?g.slice(0,g.lastIndexOf("/")):"";return await e.tree.refresh(v),v&&e.tree.expand(v),Fd({variant:"success",title:`Created ${g}`}),g}catch(v){const y=v instanceof Error?v.message:String(v);Fd({variant:"error",title:"Create failed",description:y});return}};return(()=>{var g=Hhi();return W(g,m(_e,{get when(){return h()},get fallback(){return(()=>{var v=$hi(),y=v.firstChild;return W(v,m(wp,{}),y),v})()},get children(){return m(_e,{get when(){return sn(()=>!!(!a()&&c()))()&&u()},get fallback(){return m(oit,{get path(){return n.path},get file(){return c()?.content},onLinkClick:v=>s(`file:${v}`,"file")})},get children(){return m(mhi,{get path(){return n.path},get state(){return c()},get value(){return d()},active:!0,onChange:v=>e.setDraft(n.path,v),onSave:f,onMode:v=>e.setMode(n.path,v),mention:{search:v=>TEn({query:v,file:e,sync:i,trellis:AEn(r,o?.facts)}),fetch:async(v,y)=>{if(y==="file")return await e.load(v),e.text(v)},navigate:v=>{v.type==="file"?s(`file:${v.id}`,"file"):s(v.id,v.type)},onCreate:p}})}})}})),g})()}function i0i(n){const e=Bs(),t=Eae(),[i]=mo(()=>n.path,async o=>{try{return(await e.client.file.list({path:o})).data??[]}catch{return[]}},{initialValue:[]}),r=()=>i.latest??[];return(()=>{var o=ait();return W(o,m(_e,{get when(){return!i.loading},get fallback(){return(()=>{var s=Fhi(),a=s.firstChild;return W(s,m(wp,{}),a),s})()},get children(){return m(_e,{get when(){return r().length>0},get fallback(){return zhi()},get children(){var s=sit();return W(s,m(ei,{get each(){return r()},children:a=>{const l=a.type==="directory"?"directory":"file",c=l==="directory"?`dir:${a.path}`:`file:${a.path}`;return m(r0i,{id:c,get path(){return a.path},type:l,onOpen:()=>t(c,a.type)})}})),s}})}})),o})()}function r0i(n){const e=J(()=>n.type==="file"?QZe(n.path):"dir"),t=J(()=>h0[n.type]??"var(--border-base)"),i=xLn();return(()=>{var r=jhi(),o=r.firstChild,s=o.nextSibling,a=s.firstChild;return r.addEventListener("mouseleave",()=>i?.(null)),r.addEventListener("mouseenter",()=>i?.(n.id)),Ju(r,"click",n.onOpen,!0),W(o,m(Rhi,{get path(){return n.path},get type(){return n.type},class:"absolute inset-0"})),W(s,m(Nae,{get node(){return{path:n.path,type:n.type}},class:"shrink-0 size-3.5","aria-hidden":"true"}),a),W(a,()=>r8e(n.path)),W(s,m(_e,{get when(){return e()},get children(){var l=Bhi();return W(l,e),st(c=>{var d=`color-mix(in srgb, ${t()} 18%, transparent)`,u=t();return d!==c.e&&Sr(l,"background",c.e=d),u!==c.t&&Sr(l,"color",c.t=u),c},{e:void 0,t:void 0}),l}}),null),st(l=>{var c=t(),d=n.path;return c!==l.e&&Sr(r,"--accent",l.e=c),d!==l.t&&mt(a,"title",l.t=d),l},{e:void 0,t:void 0}),r})()}function o0i(n){const e=Bs(),t=l2(),[i]=mo(()=>n.id,async()=>{try{return await t.fetchGraph()}catch{return}},{initialValue:void 0}),[r]=mo(async()=>{const l=["README.md","readme.md","README.markdown","Readme.md"];for(const c of l)try{const d=(await e.client.file.read({path:c})).data;if(d&&d.type==="text"&&d.encoding!=="base64")return{path:c,data:d}}catch{}},{initialValue:void 0}),o=()=>i.latest,s=()=>r.latest,a=J(()=>{const l=o();if(!l)return[];const c={};for(const u of l.nodes)c[u.type]=(c[u.type]??0)+1;return["file","directory","issue","agent","workunit","cycle","epic","roadmap","memory","sprite","suggestion","mcp"].filter(u=>(c[u]??0)>0).map(u=>({label:u==="directory"?"dirs":u==="workunit"?"tasks":`${u}s`,value:c[u]})).concat(l.hiddenNodes>0?[{label:"hidden",value:l.hiddenNodes}]:[])});return(()=>{var l=qhi();return W(l,m(_e,{get when(){return!i.loading},get fallback(){return m(dDe,{label:"Loading stats..."})},get children(){return m(_e,{get when(){return a().length>0},get children(){var c=Whi();return W(c,m(ei,{get each(){return a()},children:d=>(()=>{var u=Uhi(),h=u.firstChild,f=h.nextSibling;return W(h,()=>d.value),W(f,()=>d.label),u})()})),c}})}}),null),W(l,m(_e,{get when(){return!r.loading},get fallback(){return m(dDe,{label:"Loading README..."})},get children(){return m(_e,{get when(){return s()},get fallback(){return Zhi()},children:c=>(()=>{var d=Khi(),u=d.firstChild,h=u.firstChild;return W(u,m(Cn,{name:"file-text",size:"small",class:"text-icon-weak"}),h),W(h,()=>c().path),W(d,m(oit,{get path(){return c().path},get file(){return c().data}}),null),d})()})}}),null),l})()}function dDe(n){return(()=>{var e=Ghi(),t=e.firstChild;return W(e,m(wp,{}),t),W(t,()=>n.label),e})()}function s0i(n){const e=Bs(),t=l2(),[i]=mo(()=>n.id,async a=>{try{return await t.fetchEntity(a)}catch{return}},{initialValue:void 0}),r=J(()=>{const a=i.latest;if(!a)return;const l=["body","description","purpose","summary","message","title","name"];for(const c of l){const d=a.facts.find(u=>u.a===c);if(d)return W9(d.v)}}),o=J(()=>Rne(r()??"")),s=J(()=>(i.latest?.facts??[]).filter(a=>!XZe.has(a.a)));return(()=>{var a=ait();return W(a,m(_e,{get when(){return i.loading},get children(){var l=Xhi(),c=l.firstChild;return W(l,m(wp,{}),c),l}}),null),W(a,m(_e,{get when(){return!i.loading},get children(){return m(_e,{get when(){return r()},get fallback(){return m(_e,{get when(){return s().length>0},get fallback(){return Jhi()},get children(){return Yhi()}})},children:l=>(()=>{var c=Qhi();return W(c,m(_e,{get when(){return s().length>0},get children(){var d=sit();return W(d,m(ei,{get each(){return s().slice(0,24)},children:u=>(()=>{var h=e0i(),f=h.firstChild,p=f.nextSibling;return W(f,()=>u.a),W(p,()=>W9(u.v)),st(()=>mt(p,"title",W9(u.v))),h})()})),d}}),null),W(c,m(f5e,{data:t0i,get directory(){return e.directory},get mediaUrl(){return e.url},get children(){return m(_Ke,{get text(){return l()},get cacheKey(){return o()}})}}),null),c})()})}}),null),a})()}Fs(["click"]);var a0i=le('<div class="flex items-center justify-center py-6"><div class="animate-spin h-4 w-4 rounded-full border-2 border-text-weaker border-t-transparent">'),l0i=le('<div class="rounded-md border border-border-base bg-background-base px-3 py-4 text-12-regular text-text-weak text-center">No relationships recorded'),uDe=le('<div class="grid grid-cols-2 gap-2">'),c0i=le('<div class="grid grid-cols-1 gap-2">'),d0i=le('<div class="flex-1 min-h-0 overflow-y-auto p-3 flex flex-col gap-4">');function u0i(n){const e=l2(),t=Eae(),[i]=mo(()=>n.id,async d=>{try{return await e.fetchEntity(d)}catch{return}},{initialValue:void 0}),[r]=mo(()=>n.id,async d=>{try{return await e.fetchRefs(d)}catch{return}},{initialValue:void 0}),o=J(()=>i.latest?.links??[]),s=J(()=>r.latest?.outgoing??[]),a=J(()=>r.latest?.incoming??[]),l=J(()=>i.loading||r.loading),c=J(()=>!l()&&o().length===0&&s().length===0&&a().length===0);return(()=>{var d=d0i();return W(d,m(_e,{get when(){return sn(()=>!!(l()&&o().length===0&&s().length===0))()&&a().length===0},get children(){return a0i()}}),null),W(d,m(_e,{get when(){return c()},get children(){return l0i()}}),null),W(d,m(_e,{get when(){return o().length>0},get children(){return m(q9,{icon:"arrow-right",title:"Links",get children(){var u=uDe();return W(u,m(ei,{get each(){return o().slice(0,48)},children:h=>m(nKe,{get relation(){return h.a},get target(){return h.e2},onClick:()=>t(h.e2)})})),u}})}}),null),W(d,m(_e,{get when(){return s().length>0},get children(){return m(q9,{icon:"link",title:"References",get children(){var u=uDe();return W(u,m(ei,{get each(){return s()},children:h=>{const f=`${h.namespace}:${h.target}`,p=h.state==="resolved"&&!!h.namespace&&!!h.target;return m(iKe,{get title(){return h.title??f},get namespace(){return h.namespace},get state(){return h.state},get staleReason(){return h.staleReason},onClick:()=>p&&t(f,h.namespace),disabled:!p})}})),u}})}}),null),W(d,m(_e,{get when(){return a().length>0},get children(){return m(q9,{icon:"arrow-left",title:"Backlinks",get children(){var u=c0i();return W(u,m(ei,{get each(){return a()},children:h=>m(rKe,{get filePath(){return h.filePath},get line(){return h.line}})})),u}})}}),null),d})()}var h0i=le("<div>"),f0i=le('<span class="absolute bottom-0 left-1/2 -translate-x-1/2 w-8 h-[2px] bg-white rounded-full">'),p0i=le('<button class="relative flex-1 flex items-center justify-center gap-1.5 px-2 py-1.5 text-11-medium transition-colors"><span>');const lit=[{id:"preview",label:"Preview",icon:"eye"},{id:"details",label:"Details",icon:"info"},{id:"activity",label:"Activity",icon:"history"}],oyi=[{id:"overview",label:"Overview",icon:"info"},{id:"history",label:"History",icon:"history"},{id:"decisions",label:"Decisions",icon:"brain"},{id:"relationships",label:"Relationships",icon:"git-branch"}];function g0i(n){const e=()=>n.items??lit;return(()=>{var t=h0i();return W(t,m(ei,{get each(){return e()},children:i=>{const r=()=>n.tab===i.id;return(()=>{var o=p0i(),s=o.firstChild;return o.$$click=()=>n.setTab(i.id),W(o,m(_e,{get when(){return i.icon},get children(){return m(Cn,{get name(){return i.icon},size:"small",class:"shrink-0"})}}),s),W(s,()=>i.label),W(o,m(_e,{get when(){return r()},get children(){return f0i()}}),null),st(a=>{var l={"text-text-strong":r(),"text-text-weak hover:text-text-base":!r()},c=r();return a.e=Ko(o,l,a.e),c!==a.t&&mt(o,"aria-pressed",a.t=c),a},{e:void 0,t:void 0}),o})()}})),st(()=>H1(t,`shrink-0 flex items-center gap-1 px-2 py-1.5 border-b border-border-weaker-base ${n.class??""}`)),t})()}Fs(["click"]);var m0i=le("<div>");function cit(n){const[e,t]=Ye(n.initialTab??"details"),i=J(()=>n.type==="file"||n.type==="directory");return Re(Mr(()=>n.id,()=>t(n.initialTab??"preview"),{defer:!0})),(()=>{var r=m0i();return W(r,m(g0i,{get tab(){return e()},setTab:t,get items(){return n.items}}),null),W(r,m(_e,{get when(){return e()==="preview"},get children(){return m(cDe,{get id(){return n.id},get type(){return n.type}})}}),null),W(r,m(_e,{get when(){return e()==="details"},get children(){return m(aSe,{get id(){return n.id},get type(){return n.type},get status(){return n.status},get priority(){return n.priority}})}}),null),W(r,m(_e,{get when(){return e()==="activity"},get children(){return m(lte,{get id(){return n.id},get type(){return n.type}})}}),null),W(r,m(_e,{get when(){return e()==="overview"},get children(){return m(_e,{get when(){return i()},get fallback(){return m(aSe,{get id(){return n.id},get type(){return n.type},get status(){return n.status},get priority(){return n.priority}})},get children(){return m(cDe,{get id(){return n.id},get type(){return n.type}})}})}}),null),W(r,m(_e,{get when(){return e()==="history"},get children(){return m(lte,{get id(){return n.id},get type(){return n.type},kind:"op"})}}),null),W(r,m(_e,{get when(){return e()==="decisions"},get children(){return m(lte,{get id(){return n.id},get type(){return n.type},kind:"decision"})}}),null),W(r,m(_e,{get when(){return e()==="relationships"},get children(){return m(u0i,{get id(){return n.id},get type(){return n.type}})}}),null),st(()=>H1(r,`flex flex-col min-h-0 flex-1 ${n.class??""}`)),r})()}var v0i=le('<div class="relative h-full w-full overflow-visible">'),y0i=le('<button class="inline-flex items-center gap-1 rounded-md px-1.5 py-1 text-xs text-text-weak hover:text-text-base hover:bg-surface-raised-base/60 transition-colors"><span class="truncate max-w-40">'),k0i=le('<div class="absolute inset-0 rounded-xl border border-border-weaker-base bg-surface-base shadow-xl flex flex-col overflow-hidden"style="transform-origin:center center;transition:transform 200ms ease, filter 200ms ease"><div class="shrink-0 border-b border-border-weaker-base px-4 py-3 flex items-center gap-3"><div class="flex-1 min-w-0 flex items-center gap-2"><span class="inline-flex items-center gap-1 rounded-full bg-surface-raised-base px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide"></span><span class="truncate text-12-medium text-text-strong font-mono"></span></div></div><div class="min-h-0 flex-1 overflow-hidden">'),C0i=le('<div class="w-72 shrink-0 border-l border-border-weaker-base bg-surface-raised-base/30 flex flex-col">'),b0i=le('<div class="flex h-full"><div class="flex-1 min-h-0 overflow-auto p-4">'),w0i=le('<div class="flex flex-col items-center gap-2 py-8 text-text-weak"><div class=text-12-regular>Loading details...'),_0i=le('<div class="text-13-regular text-text-base whitespace-pre-wrap">'),x0i=le('<div class="flex flex-wrap gap-1.5">'),S0i=le('<div class="flex items-center gap-2 flex-wrap">'),M0i=le('<div class="flex items-center gap-2 p-2 rounded-md bg-background-base border border-border-base">'),L0i=le('<div class="p-3 rounded-md bg-background-base border border-border-base flex flex-col gap-2"><div class="flex items-center gap-2">'),I0i=le('<div class="flex flex-col gap-3"><div class="text-12-medium uppercase tracking-wide text-text-weak">Decision Traces</div><div class="flex flex-col gap-2 max-h-[200px] overflow-y-auto">'),N0i=le('<div class="flex justify-between"><span>Assignee</span><span>'),E0i=le('<div class="flex justify-between"><span>Branch</span><span class=text-11-mono>'),T0i=le('<div class="flex flex-col gap-4"><div class="flex items-center gap-2"><span class="text-12-medium text-text-info"></span><span class="text-10-medium uppercase rounded px-1.5 py-0.5 bg-surface-raised-base text-text-weak"></span><span class="text-10-medium uppercase rounded px-1.5 py-0.5 bg-surface-raised-base text-text-weak"></span></div><h1 class="text-16-semibold text-text-strong leading-tight"></h1><div class="flex flex-col gap-3"><div class="flex items-center justify-between"><div class="text-12-medium uppercase tracking-wide text-text-weak">Acceptance Criteria</div><div class="flex items-center gap-1"></div></div><div class="flex flex-col gap-2 max-h-[300px] overflow-y-auto"></div></div><div class="pt-4 border-t border-border-weaker-base flex flex-col gap-3 text-12-regular text-text-weak"><div class="flex justify-between"><span>Created</span><span>'),A0i=le('<span class="rounded-full bg-surface-raised-base px-2.5 py-0.5 text-11-medium text-text-weak">'),dit=le('<div class="text-12-regular text-text-weaker italic">No criteria defined'),D0i=le('<code class="text-11-mono text-text-weak block mt-1 p-1 rounded bg-surface-raised-base truncate">'),R0i=le('<pre class="mt-1 p-2 rounded bg-background-stronger text-11-mono text-text-weak overflow-x-auto max-h-24">'),P0i=le('<div class="p-3 rounded-md bg-background-base border border-border-base flex flex-col gap-2"><div class="flex items-start gap-3"><button class="mt-1 shrink-0 cursor-pointer hover:opacity-70 transition-opacity"title="Click to toggle status"></button><div class="flex-1 min-w-0"><div class="text-13-medium text-text-strong leading-normal">'),O0i=le('<div class="size-3 rounded-full border-2 border-border-strong-base">'),V0i=le('<div class="text-11-regular text-text-weak truncate">'),H0i=le('<div class="p-2 rounded-md bg-background-base border border-border-base flex items-start gap-2"><div class="flex-1 min-w-0"><div class="text-12-medium text-text-strong"></div></div><div class="shrink-0 text-11-regular text-text-weaker whitespace-nowrap">'),$0i=le('<div class="flex h-full items-center justify-center text-12-regular text-text-weak">WorkUnit not found'),F0i=le('<section class="flex flex-col gap-2"><div class="text-12-medium uppercase tracking-wide text-text-weak">Labels</div><div class="flex flex-wrap gap-1.5">'),z0i=le('<div class="flex h-full min-h-0"><div class="flex-1 min-w-0 overflow-y-auto p-5"><div class="flex flex-col gap-5"><div class="flex items-start gap-3"><div class="flex-1 min-w-0"><div class="text-11-medium uppercase tracking-wide text-text-weak">WorkUnit</div><h1 class="mt-1 text-18-semibold text-text-strong leading-snug"></h1><div class="mt-2 flex items-center gap-2 flex-wrap"><span class="text-11-mono text-text-info"></span><span class="text-10-medium uppercase rounded px-1.5 py-0.5 bg-surface-raised-base text-text-weak"></span><span class="text-10-medium uppercase rounded px-1.5 py-0.5 bg-surface-raised-base text-text-weak"></span></div></div></div><section class="flex flex-col gap-2"><div class="flex items-center gap-2"><div class="text-12-medium uppercase tracking-wide text-text-weak">Description</div></div><div class="rounded-md border border-border-base bg-background-base px-3 py-2 text-13-regular text-text-base"></div></section><section class="flex flex-col gap-3"><div class="flex items-center gap-2"><div class="text-12-medium uppercase tracking-wide text-text-weak">Acceptance Criteria</div><div class=flex-1></div><span class="text-11-regular text-text-weaker">%</span></div><div class="h-1.5 rounded-full bg-surface-raised-base overflow-hidden"><div class="h-full bg-text-success transition-all"></div></div></section></div></div><aside class="w-80 shrink-0 border-l border-border-weaker-base bg-surface-raised-base/30 flex flex-col min-h-0"><div class="shrink-0 border-b border-border-weaker-base p-3 flex flex-col gap-3"><div class="text-12-medium text-text-strong">Status</div><div class="flex flex-col gap-1.5"></div><div class="grid grid-cols-2 gap-2 text-11-regular text-text-weak"></div></div><div class="shrink-0 border-b border-border-weaker-base px-3 py-2 flex items-center gap-2"><div class="text-12-medium text-text-strong">Activity'),B0i=le('<span class="rounded-md bg-surface-raised-base px-2.5 py-1 text-11-medium text-text-strong">'),j0i=le('<code class="mt-1 block truncate rounded bg-surface-raised-base px-1.5 py-1 text-11-mono text-text-weak">'),W0i=le('<div class="rounded-md border border-border-base bg-background-base p-3 flex items-start gap-3"><div class="flex-1 min-w-0"><div class="text-13-medium text-text-strong leading-normal">'),q0i=le('<div class="mt-0.5 size-4 rounded-sm border border-border-strong-base">'),U0i=le('<button class="w-full rounded-md border px-3 py-2 text-left text-12-medium transition-colors">'),Z0i=le('<div class="rounded-md border border-border-base/60 bg-background-base px-2.5 py-1.5 min-w-0"><div class="text-10-medium uppercase tracking-wide text-text-weaker"></div><div class="mt-0.5 truncate text-11-regular text-text-strong">'),K0i=le('<div class="text-11-regular text-text-weak line-clamp-2">'),G0i=le('<div class="shrink-0 border-b border-border-weaker-base px-4 py-2.5 flex flex-col gap-0.5"><div class="text-13-semibold text-text-strong truncate">'),X0i=le('<div class="flex flex-col h-full min-h-0">');const hDe={w:760,h:620},$4e=oi();function fDe(n,e,t){return Math.max(e,Math.min(n,t))}function Y0i(n,e){return e||n.includes(":")&&n.split(":")[0]||"entity"}function J0i(n,e){return n.includes(":")?n:e==="issue"?`issue:${n}`:n}function F4e(n){return n.includes(":")?n.split(":").slice(1).join(":"):n}function z4e(n){const e=Date.now()-new Date(n).getTime();return e<6e4?"just now":e<36e5?`${Math.round(e/6e4)}m ago`:e<864e5?`${Math.round(e/36e5)}h ago`:`${Math.round(e/864e5)}d ago`}function Q0i(n){return n.split("/").pop()||n}function e2i(n){return typeof n=="string"?n:typeof n=="number"||typeof n=="boolean"?String(n):JSON.stringify(n,null,2)??""}function pDe(n,e){const t=e.flatMap(i=>n?.facts.filter(r=>r.a===i)??[])[0];return t?e2i(t.v):void 0}function t2i(n){const e=oy(),t=l2(),i=Bs(),[r,o]=Yt({stack:[],size:hDe,open:!1,closing:!1}),s={stack:()=>r.stack,size:()=>r.size,trellis:t,sdk:i,push(a,l){const c=J0i(a,l);o("stack",jt(d=>{d[d.length-1]?.id!==c&&d.push({key:`${c}:${Date.now()}`,id:c,type:Y0i(c,l)})}))},pop(){if(r.stack.length<=1){o("stack",[]);return}o("stack",r.stack.slice(0,-1))},clear(){o("stack",[])},setSize(a,l){o("size",{w:fDe(a,560,Math.min(920,window.innerWidth-96)),h:fDe(l,420,Math.min(760,window.innerHeight-120))})},getTransform(a){const l=r.stack.length-1-a;return l<=0?{scale:1,offsetY:16,brightness:1,interactive:!0}:{scale:Math.max(.82,1-l*.04),offsetY:l*-28,brightness:Math.max(.5,1-l*.14),interactive:!1}}};return Re(()=>{if(r.stack.length>0){!r.open&&!r.closing&&(o("open",!0),e.show(()=>m($4e.Provider,{value:s,get children(){return m(n2i,{})}}),()=>{pn(()=>{o("open",!1),o("closing",!1),o("stack",[]),o("size",hDe)})}));return}r.open&&!r.closing&&(o("closing",!0),e.close())}),m($4e.Provider,{value:s,get children(){return n.children}})}function Zy(){const n=Wn($4e);if(!n)throw new Error("useEntityDialog must be used within EntityDialogProvider");return n}function n2i(){const n=Zy();return m(aie,{size:"x-large",transition:!0,class:"!h-full !bg-transparent !shadow-none !overflow-visible",get children(){var e=v0i();return W(e,m(ei,{get each(){return n.stack()},children:(t,i)=>m(i2i,{entry:t,get index(){return i()}})})),e}})}function i2i(n){const e=Zy(),t=J(()=>e.getTransform(n.index)),i=J(()=>n.index===e.stack().length-1),r=J(()=>e.stack()[n.index-1]);return(()=>{var o=k0i(),s=o.firstChild,a=s.firstChild,l=a.firstChild,c=l.nextSibling,d=s.nextSibling;return W(s,m(_e,{get when(){return n.index>0},get children(){var u=y0i(),h=u.firstChild;return u.$$click=()=>e.pop(),W(u,m(Cn,{name:"arrow-left",size:"small"}),h),W(h,(()=>{var f=sn(()=>!!r());return()=>f()?F4e(r().id):"Back"})()),u}}),a),W(l,m(GZe,{get type(){return n.entry.type},size:12}),null),W(l,()=>n.entry.type,null),W(c,()=>F4e(n.entry.id)),W(s,m(_e,{get when(){return i()},get children(){return m(oa,{icon:"close-small",variant:"ghost",onClick:()=>e.clear()})}}),null),W(d,m(V1,{get fallback(){return m(uit,{get id(){return n.entry.id},get type(){return n.entry.type}})},get children(){return[m(fi,{get when(){return n.entry.type==="issue"},get children(){return m(o2i,{get id(){return n.entry.id}})}}),m(fi,{get when(){return n.entry.type==="workunit"},get children(){return m(s2i,{get id(){return n.entry.id}})}})]}})),st(u=>{var h=`translateY(${t().offsetY}px) scale(${t().scale})`,f=`brightness(${t().brightness})`,p=t().interactive?"auto":"none",g=`${100+n.index}`,v=i8e(n.entry.type);return h!==u.e&&Sr(o,"transform",u.e=h),f!==u.t&&Sr(o,"filter",u.t=f),p!==u.a&&Sr(o,"pointer-events",u.a=p),g!==u.o&&Sr(o,"z-index",u.o=g),v!==u.i&&Sr(l,"color",u.i=v),u},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),o})()}function r2i(n){return(()=>{var e=C0i();return W(e,m(cit,{get id(){return n.entityId},get type(){return n.type}})),e})()}function o2i(n){const t=Zy().trellis,[i,r]=Yt({busy:!1,adding:!1,newAcDesc:"",newAcCmd:"",assigning:!1,assignee:""}),o=J(()=>n.id.replace(/^issue:/,"")),[s,a]=mo(o,g=>t.getIssue(g),{initialValue:void 0}),[l]=mo(o,g=>t.fetchDecisionChain(`issue:${g}`),{initialValue:[]}),c=()=>s.latest,d=()=>l.latest??[],u=async g=>{r("busy",!0);try{await g(),await t.refresh(),a.refetch()}catch(v){console.error("[entity-dialog] action failed:",v)}finally{r("busy",!1)}},h=J(()=>{const g=c();if(!g)return[];const v=[];return g.status==="backlog"&&v.push({label:"Triage",run:()=>void u(()=>t.triageIssue(o()))}),(g.status==="backlog"||g.status==="queue")&&v.push({label:"Start",run:()=>void u(()=>t.startIssue(o()))}),g.status==="in_progress"&&v.push({label:"Pause",run:()=>void u(()=>t.pauseIssue(o()))}),g.status==="paused"&&v.push({label:"Resume",run:()=>void u(()=>t.resumeIssue(o()))}),(g.status==="in_progress"||g.status==="paused")&&v.push({label:"Close",run:()=>void u(()=>t.closeIssue(o(),!0))}),g.status==="closed"&&v.push({label:"Reopen",run:()=>void u(()=>t.reopenIssue(o()))}),v}),f=async()=>{const g=i.newAcDesc.trim();g&&(await u(()=>t.addCriterion(o(),g,i.newAcCmd.trim()||void 0)),pn(()=>{r("newAcDesc",""),r("newAcCmd",""),r("adding",!1)}))},p=async()=>{const g=i.assignee.trim();g&&(await u(()=>t.assignIssue(o(),g)),pn(()=>{r("assignee",""),r("assigning",!1)}))};return(()=>{var g=b0i(),v=g.firstChild;return W(v,m(_e,{get when(){return!s.loading},get fallback(){return(()=>{var y=w0i(),C=y.firstChild;return W(y,m(wp,{}),C),y})()},get children(){return m(_e,{get when(){return c()},get fallback(){return m(uit,{get id(){return n.id},type:"issue"})},children:y=>(()=>{var C=T0i(),_=C.firstChild,w=_.firstChild,x=w.nextSibling,M=x.nextSibling,L=_.nextSibling,S=L.nextSibling,I=S.firstChild,E=I.firstChild,A=E.nextSibling,T=I.nextSibling,D=S.nextSibling,R=D.firstChild,P=R.firstChild,V=P.nextSibling;return W(w,()=>y().id),W(x,()=>y().priority),W(M,()=>y().status),W(L,()=>y().title),W(C,m(_e,{get when(){return y().description},get children(){var $=_0i();return W($,()=>y().description),$}}),S),W(C,m(_e,{get when(){return y().labels.length>0},get children(){var $=x0i();return W($,m(ei,{get each(){return y().labels},children:j=>(()=>{var B=A0i();return W(B,j),B})()})),$}}),S),W(C,m(_e,{get when(){return h().length>0},get children(){var $=S0i();return W($,m(ei,{get each(){return h()},children:j=>m(to,{size:"small",variant:"ghost",get onClick(){return j.run},get disabled(){return i.busy},get children(){return j.label}})}),null),W($,m(_e,{get when(){return!i.assigning},get children(){return m(to,{size:"small",variant:"ghost",onClick:()=>r("assigning",!0),get disabled(){return i.busy},children:"Assign"})}}),null),$}}),S),W(C,m(_e,{get when(){return i.assigning},get children(){var $=M0i();return W($,m(ate,{placeholder:"Agent ID...",get value(){return i.assignee},onInput:j=>r("assignee",j.target.value),onKeyDown:j=>j.key==="Enter"&&void p(),class:"flex-1",autofocus:!0}),null),W($,m(oa,{icon:"check-small",variant:"ghost",onClick:()=>void p(),get disabled(){return!i.assignee.trim()}}),null),W($,m(oa,{icon:"close-small",variant:"ghost",onClick:()=>r("assigning",!1)}),null),$}}),S),W(A,m(to,{size:"small",variant:"ghost",onClick:()=>r("adding",!0),get disabled(){return i.adding},children:"Add"}),null),W(A,m(to,{size:"small",variant:"ghost",onClick:()=>void u(async()=>{await t.runCriteria(o())}),get disabled(){return i.busy},children:"Run All"}),null),W(T,m(ei,{get each(){return y().criteria},get fallback(){return dit()},children:($,j)=>(()=>{var B=P0i(),te=B.firstChild,U=te.firstChild,Y=U.nextSibling,X=Y.firstChild;return U.$$click=()=>{const se=$.status==="passed"?"failed":$.status==="failed"?"pending":"passed";u(()=>t.setCriterionStatus(o(),j(),se))},W(U,m(_e,{get when(){return $.status==="passed"},get fallback(){return m(_e,{get when(){return $.status==="failed"},get fallback(){return O0i()},get children(){return m(Cn,{name:"close-small",size:"small",class:"text-icon-error"})}})},get children(){return m(Cn,{name:"checklist",size:"small",class:"text-icon-success"})}})),W(X,()=>$.description),W(Y,m(_e,{get when(){return $.command},get children(){var se=D0i();return W(se,()=>$.command),se}}),null),W(B,m(_e,{get when(){return $.lastOutput},get children(){var se=R0i();return W(se,()=>$.lastOutput),se}}),null),st(()=>U.disabled=i.busy),B})()}),null),W(T,m(_e,{get when(){return i.adding},get children(){var $=L0i(),j=$.firstChild;return W($,m(ate,{placeholder:"Criterion description...",get value(){return i.newAcDesc},onInput:B=>r("newAcDesc",B.target.value),onKeyDown:B=>B.key==="Enter"&&void f(),class:"w-full",autofocus:!0}),j),W(j,m(ate,{placeholder:"Command (optional)...",get value(){return i.newAcCmd},onInput:B=>r("newAcCmd",B.target.value),onKeyDown:B=>B.key==="Enter"&&void f(),class:"flex-1"}),null),W(j,m(oa,{icon:"check-small",variant:"ghost",onClick:()=>void f(),get disabled(){return!i.newAcDesc.trim()}}),null),W(j,m(oa,{icon:"close-small",variant:"ghost",onClick:()=>{pn(()=>{r("adding",!1),r("newAcDesc",""),r("newAcCmd","")})}}),null),$}}),null),W(C,m(_e,{get when(){return d().length>0},get children(){var $=I0i(),j=$.firstChild,B=j.nextSibling;return W(B,m(ei,{get each(){return d()},children:te=>(()=>{var U=H0i(),Y=U.firstChild,X=Y.firstChild,se=Y.nextSibling;return W(U,m(Cn,{name:"brain",size:"small",class:"mt-0.5 shrink-0 text-icon-weak"}),Y),W(X,()=>te.toolName),W(Y,m(_e,{get when(){return te.outputSummary},get children(){var pe=V0i();return W(pe,()=>te.outputSummary),pe}}),null),W(se,()=>z4e(te.timestamp)),U})()})),$}}),D),W(V,()=>y().createdAt),W(D,m(_e,{get when(){return y().assignee},get children(){var $=N0i(),j=$.firstChild,B=j.nextSibling;return W(B,()=>y().assignee),$}}),null),W(D,m(_e,{get when(){return y().branch},get children(){var $=E0i(),j=$.firstChild,B=j.nextSibling;return W(B,()=>y().branch),$}}),null),C})()})}})),W(g,m(r2i,{get entityId(){return`issue:${o()}`},type:"issue"}),null),g})()}function s2i(n){const t=Zy().trellis,i=J(()=>n.id.replace(/^workunit:/,"")),r=J(()=>t.workUnits.find(l=>l.id===i())),o=J(()=>{const l=r();return l?.criteriaCount?Math.round(l.criteriaPassed/l.criteriaCount*100):0}),s=[{id:"backlog",label:"Backlog"},{id:"in_progress",label:"In Progress"},{id:"done",label:"Done"}],a=l=>{r()?.status!==l&&t.updateWorkUnit(i(),{status:l})};return m(_e,{get when(){return r()},get fallback(){return $0i()},children:l=>(()=>{var c=z0i(),d=c.firstChild,u=d.firstChild,h=u.firstChild,f=h.firstChild,p=f.firstChild,g=p.nextSibling,v=g.nextSibling,y=v.firstChild,C=y.nextSibling,_=C.nextSibling,w=h.nextSibling,x=w.firstChild,M=x.firstChild,L=x.nextSibling,S=w.nextSibling,I=S.firstChild,E=I.firstChild,A=E.nextSibling,T=A.nextSibling,D=T.firstChild,R=I.nextSibling,P=R.firstChild,V=d.nextSibling,$=V.firstChild,j=$.firstChild,B=j.nextSibling,te=B.nextSibling,U=$.nextSibling,Y=U.firstChild;return W(h,m(GZe,{type:"workunit",size:18,class:"mt-1 shrink-0"}),f),W(g,()=>l().title),W(y,()=>l().id),W(C,()=>l().priority),W(_,()=>l().status),W(u,m(_e,{get when(){return l().tags.length>0},get children(){var X=F0i(),se=X.firstChild,pe=se.nextSibling;return W(pe,m(ei,{get each(){return l().tags},children:Ae=>(()=>{var Fe=B0i();return W(Fe,Ae),Fe})()})),X}}),w),W(x,m(Cn,{name:"align-left",size:"small",class:"text-icon-weak"}),M),W(L,()=>l().title),W(I,m(Cn,{name:"checklist",size:"small",class:"text-icon-weak"}),E),W(T,o,D),W(S,m(ei,{get each(){return l().criteria},get fallback(){return dit()},children:X=>(()=>{var se=W0i(),pe=se.firstChild,Ae=pe.firstChild;return W(se,m(_e,{get when(){return X.status==="passed"},get fallback(){return m(_e,{get when(){return X.status==="failed"},get fallback(){return q0i()},get children(){return m(Cn,{name:"close-small",size:"small",class:"mt-0.5 shrink-0 text-icon-error"})}})},get children(){return m(Cn,{name:"check-small",size:"small",class:"mt-0.5 shrink-0 text-icon-success"})}}),pe),W(Ae,()=>X.description),W(pe,m(_e,{get when(){return X.command},get children(){var Fe=j0i();return W(Fe,()=>X.command),Fe}}),null),se})()}),null),W(B,m(ei,{each:s,children:X=>(()=>{var se=U0i();return se.$$click=()=>a(X.id),W(se,()=>X.label),st(pe=>Ko(se,{"border-border-strong-base bg-background-base text-text-strong":l().status===X.id,"border-border-base bg-transparent text-text-weak hover:bg-background-base/70":l().status!==X.id},pe)),se})()})),W(te,m(eC,{label:"Cycle",get value(){return l().cycle||"Unassigned"}}),null),W(te,m(eC,{label:"Spec",get value(){return l().specPath||"None"}}),null),W(te,m(eC,{label:"Created",get value(){return z4e(l().createdAt)}}),null),W(te,m(eC,{label:"Updated",get value(){return z4e(l().updatedAt)}}),null),W(te,m(_e,{get when(){return l().assignee},get children(){return m(eC,{label:"Assignee",get value(){return l().assignee}})}}),null),W(U,m(Cn,{name:"history",size:"small",class:"text-icon-weak"}),Y),W(V,m(lte,{get id(){return n.id},type:"workunit"}),null),st(X=>Sr(P,"width",`${o()}%`)),c})()})}function eC(n){return(()=>{var e=Z0i(),t=e.firstChild,i=t.nextSibling;return W(t,()=>n.label),W(i,()=>n.value),st(()=>mt(i,"title",n.value)),e})()}function uit(n){const e=Zy(),[t]=mo(()=>n.id,e.trellis.fetchEntity,{initialValue:void 0}),i=J(()=>F4e(n.id)),r=()=>t.latest,o=J(()=>pDe(r(),["title","name","message","estimatedIntent","url"])??Q0i(i())),s=J(()=>pDe(r(),["description","purpose","summary"])),a=J(()=>!!o()||!!s()),l=J(()=>"details"),c=J(()=>lit.filter(d=>d.id!=="preview"));return(()=>{var d=X0i();return W(d,m(_e,{get when(){return a()},get children(){var u=G0i(),h=u.firstChild;return W(h,o),W(u,m(_e,{get when(){return s()},get children(){var f=K0i();return W(f,s),f}}),null),st(()=>mt(h,"title",o())),u}}),null),W(d,m(cit,{get id(){return n.id},get type(){return n.type},get initialTab(){return l()},get items(){return c()}}),null),d})()}Fs(["click"]);function a2i(){const n=xy(),e=oMn(),t=Aa();let i,r;return Re(()=>{const o=t.id;if(!o){i&&(e.removeJob(i),i=void 0);return}(n.data.session_status[o]?.type??"idle")!=="idle"?i||(i=e.addJob({type:"generate",label:"Generating...",status:"running"})):i&&(e.removeJob(i),i=void 0)}),Re(()=>{const o=n.data.status;o==="loading"||o==="partial"?r||(r=e.addJob({type:"sync",label:"Syncing project...",status:"running"})):r&&(e.removeJob(r),r=void 0)}),Oe(()=>{i&&e.removeJob(i),r&&e.removeJob(r),i=void 0,r=void 0}),null}const[B4e,qb]=Yt({data:null,loading:!1}),syi=B4e;let d0=null,Rhe=0;const l2i=()=>{if(typeof window<"u"&&window.innerWidth<768)return!1;const n=navigator.connection;return!(n?.saveData||n?.type==="cellular")};async function gDe(n){if(B4e.data||B4e.loading||!l2i())return;const e=++Rhe;d0&&(d0.abort(),d0=null),d0=new AbortController,qb("loading",!0);const t=await n({includeHidden:!0,includeImports:!0,includeLinks:!0,includeOps:!1}).catch(()=>null);t&&e===Rhe&&!d0.signal.aborted&&qb("data",t),e===Rhe&&(qb("loading",!1),d0=null)}function ayi(){d0&&(d0.abort(),d0=null),qb("data",null),qb("loading",!1)}function c2i(){const n=l2(),e=TMn();return Re(()=>{if(n.ready&&e.stats&&!e.large)if(typeof window<"u"&&"requestIdleCallback"in window){const t=window.requestIdleCallback(()=>gDe(n.fetchGraph),{timeout:5e3});Oe(()=>window.cancelIdleCallback(t))}else{const t=setTimeout(()=>gDe(n.fetchGraph),3e3);Oe(()=>clearTimeout(t))}}),null}function d2i(n,e){n.indexOf(e)===-1&&n.push(e)}function nke(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const dp=(n,e,t)=>t>e?e:t<n?n:t;let ike=()=>{};const up={},hit=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n),u2i=n=>typeof n=="object"&&n!==null,fit=n=>/^0[^.\s]+$/u.test(n);function pit(n){let e;return()=>(e===void 0&&(e=n()),e)}const Ky=n=>n,rke=(...n)=>n.reduce((e,t)=>i=>t(e(i))),oke=(n,e,t)=>{const i=e-n;return i?(t-n)/i:1};class git{constructor(){this.subscriptions=[]}add(e){return d2i(this.subscriptions,e),()=>nke(this.subscriptions,e)}notify(e,t,i){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,i);else for(let o=0;o<r;o++){const s=this.subscriptions[o];s&&s(e,t,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const P1=n=>n*1e3,Od=n=>n/1e3,mit=(n,e)=>e?n*(1e3/e):0,h2i=(n,e,t)=>{const i=e-n;return((t-n)%i+i)%i+n},vit=(n,e,t)=>(((1-3*t+3*e)*n+(3*t-6*e))*n+3*e)*n,f2i=1e-7,p2i=12;function g2i(n,e,t,i,r){let o,s,a=0;do s=e+(t-e)/2,o=vit(s,i,r)-n,o>0?t=s:e=s;while(Math.abs(o)>f2i&&++a<p2i);return s}function Xx(n,e,t,i){if(n===e&&t===i)return Ky;const r=o=>g2i(o,0,1,n,t);return o=>o===0||o===1?o:vit(r(o),e,i)}const yit=n=>e=>e<=.5?n(2*e)/2:(2-n(2*(1-e)))/2,ske=n=>e=>1-n(1-e),kit=Xx(.33,1.53,.69,.99),ake=ske(kit),Cit=yit(ake),bit=n=>n>=1?1:(n*=2)<1?.5*ake(n):.5*(2-Math.pow(2,-10*(n-1))),lke=n=>1-Math.sin(Math.acos(n)),m2i=ske(lke),wit=yit(lke),v2i=Xx(.42,0,1,1),y2i=Xx(0,0,.58,1),_it=Xx(.42,0,.58,1),xit=n=>Array.isArray(n)&&typeof n[0]!="number";function Sit(n,e){return xit(n)?n[h2i(0,n.length,e)]:n}const Mit=n=>Array.isArray(n)&&typeof n[0]=="number",k2i={linear:Ky,easeIn:v2i,easeInOut:_it,easeOut:y2i,circIn:lke,circInOut:wit,circOut:m2i,backIn:ake,backInOut:Cit,backOut:kit,anticipate:bit},C2i=n=>typeof n=="string",mDe=n=>{if(Mit(n)){ike(n.length===4);const[e,t,i,r]=n;return Xx(e,t,i,r)}else if(C2i(n))return k2i[n];return n},LL=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function b2i(n,e){let t=new Set,i=new Set,r=!1,o=!1;const s=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(d){s.has(d)&&(c.schedule(d),n()),d(a)}const c={schedule:(d,u=!1,h=!1)=>{const p=h&&r?t:i;return u&&s.add(d),p.add(d),d},cancel:d=>{i.delete(d),s.delete(d)},process:d=>{if(a=d,r){o=!0;return}r=!0;const u=t;t=i,i=u,t.forEach(l),t.clear(),r=!1,o&&(o=!1,c.process(d))}};return c}const w2i=40;function Lit(n,e){let t=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},o=()=>t=!0,s=LL.reduce((_,w)=>(_[w]=b2i(o),_),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:d,update:u,preRender:h,render:f,postRender:p}=s,g=()=>{const _=up.useManualTiming,w=_?r.timestamp:performance.now();t=!1,_||(r.delta=i?1e3/60:Math.max(Math.min(w-r.timestamp,w2i),1)),r.timestamp=w,r.isProcessing=!0,a.process(r),l.process(r),c.process(r),d.process(r),u.process(r),h.process(r),f.process(r),p.process(r),r.isProcessing=!1,t&&e&&(i=!1,n(g))},v=()=>{t=!0,i=!0,r.isProcessing||n(g)};return{schedule:LL.reduce((_,w)=>{const x=s[w];return _[w]=(M,L=!1,S=!1)=>(t||v(),x.schedule(M,L,S)),_},{}),cancel:_=>{for(let w=0;w<LL.length;w++)s[LL[w]].cancel(_)},state:r,steps:s}}const{schedule:ah,cancel:j4e,state:Zoe}=Lit(typeof requestAnimationFrame<"u"?requestAnimationFrame:Ky,!0);let Yte;function _2i(){Yte=void 0}const Fc={now:()=>(Yte===void 0&&Fc.set(Zoe.isProcessing||up.useManualTiming?Zoe.timestamp:performance.now()),Yte),set:n=>{Yte=n,queueMicrotask(_2i)}},Iit=n=>e=>typeof e=="string"&&e.startsWith(n),Nit=Iit("--"),x2i=Iit("var(--"),cke=n=>x2i(n)?S2i.test(n.split("/*")[0].trim()):!1,S2i=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function vDe(n){return typeof n!="string"?!1:n.split("/*")[0].includes("var(--")}const Gy={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},N_={...Gy,transform:n=>dp(0,1,n)},IL={...Gy,default:1},Ub=n=>Math.round(n*1e5)/1e5,dke=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function M2i(n){return n==null}const L2i=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,uke=(n,e)=>t=>!!(typeof t=="string"&&L2i.test(t)&&t.startsWith(n)||e&&!M2i(t)&&Object.prototype.hasOwnProperty.call(t,e)),Eit=(n,e,t)=>i=>{if(typeof i!="string")return i;const[r,o,s,a]=i.match(dke);return{[n]:parseFloat(r),[e]:parseFloat(o),[t]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}},I2i=n=>dp(0,255,n),Phe={...Gy,transform:n=>Math.round(I2i(n))},i6={test:uke("rgb","red"),parse:Eit("red","green","blue"),transform:({red:n,green:e,blue:t,alpha:i=1})=>"rgba("+Phe.transform(n)+", "+Phe.transform(e)+", "+Phe.transform(t)+", "+Ub(N_.transform(i))+")"};function N2i(n){let e="",t="",i="",r="";return n.length>5?(e=n.substring(1,3),t=n.substring(3,5),i=n.substring(5,7),r=n.substring(7,9)):(e=n.substring(1,2),t=n.substring(2,3),i=n.substring(3,4),r=n.substring(4,5),e+=e,t+=t,i+=i,r+=r),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const W4e={test:uke("#"),parse:N2i,transform:i6.transform},Yx=n=>({test:e=>typeof e=="string"&&e.endsWith(n)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${n}`}),e0=Yx("deg"),ov=Yx("%"),Ht=Yx("px"),E2i=Yx("vh"),T2i=Yx("vw"),yDe={...ov,parse:n=>ov.parse(n)/100,transform:n=>ov.transform(n*100)},C7={test:uke("hsl","hue"),parse:Eit("hue","saturation","lightness"),transform:({hue:n,saturation:e,lightness:t,alpha:i=1})=>"hsla("+Math.round(n)+", "+ov.transform(Ub(e))+", "+ov.transform(Ub(t))+", "+Ub(N_.transform(i))+")"},as={test:n=>i6.test(n)||W4e.test(n)||C7.test(n),parse:n=>i6.test(n)?i6.parse(n):C7.test(n)?C7.parse(n):W4e.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?i6.transform(n):C7.transform(n),getAnimatableNone:n=>{const e=as.parse(n);return e.alpha=0,as.transform(e)}},A2i=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function D2i(n){return isNaN(n)&&typeof n=="string"&&(n.match(dke)?.length||0)+(n.match(A2i)?.length||0)>0}const Tit="number",Ait="color",R2i="var",P2i="var(",kDe="${}",O2i=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ty(n){const e=n.toString(),t=[],i={color:[],number:[],var:[]},r=[];let o=0;const a=e.replace(O2i,l=>(as.test(l)?(i.color.push(o),r.push(Ait),t.push(as.parse(l))):l.startsWith(P2i)?(i.var.push(o),r.push(R2i),t.push(l)):(i.number.push(o),r.push(Tit),t.push(parseFloat(l))),++o,kDe)).split(kDe);return{values:t,split:a,indexes:i,types:r}}function V2i(n){return ty(n).values}function Dit({split:n,types:e}){const t=n.length;return i=>{let r="";for(let o=0;o<t;o++)if(r+=n[o],i[o]!==void 0){const s=e[o];s===Tit?r+=Ub(i[o]):s===Ait?r+=as.transform(i[o]):r+=i[o]}return r}}function H2i(n){return Dit(ty(n))}const $2i=n=>typeof n=="number"?0:as.test(n)?as.getAnimatableNone(n):n,F2i=(n,e)=>typeof n=="number"?e?.trim().endsWith("/")?n:0:$2i(n);function z2i(n){const e=ty(n);return Dit(e)(e.values.map((i,r)=>F2i(i,e.split[r])))}const qd={test:D2i,parse:V2i,createTransformer:H2i,getAnimatableNone:z2i};function Ohe(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function B2i({hue:n,saturation:e,lightness:t,alpha:i}){n/=360,e/=100,t/=100;let r=0,o=0,s=0;if(!e)r=o=s=t;else{const a=t<.5?t*(1+e):t+e-t*e,l=2*t-a;r=Ohe(l,a,n+1/3),o=Ohe(l,a,n),s=Ohe(l,a,n-1/3)}return{red:Math.round(r*255),green:Math.round(o*255),blue:Math.round(s*255),alpha:i}}function Koe(n,e){return t=>t>0?e:n}const Xy=(n,e,t)=>n+(e-n)*t,Vhe=(n,e,t)=>{const i=n*n,r=t*(e*e-i)+i;return r<0?0:Math.sqrt(r)},j2i=[W4e,i6,C7],W2i=n=>j2i.find(e=>e.test(n));function CDe(n){const e=W2i(n);if(!e)return!1;let t=e.parse(n);return e===C7&&(t=B2i(t)),t}const bDe=(n,e)=>{const t=CDe(n),i=CDe(e);if(!t||!i)return Koe(n,e);const r={...t};return o=>(r.red=Vhe(t.red,i.red,o),r.green=Vhe(t.green,i.green,o),r.blue=Vhe(t.blue,i.blue,o),r.alpha=Xy(t.alpha,i.alpha,o),i6.transform(r))},q4e=new Set(["none","hidden"]);function q2i(n,e){return q4e.has(n)?t=>t<=0?n:e:t=>t>=1?e:n}function U2i(n,e){return t=>Xy(n,e,t)}function hke(n){return typeof n=="number"?U2i:typeof n=="string"?cke(n)?Koe:as.test(n)?bDe:G2i:Array.isArray(n)?Rit:typeof n=="object"?as.test(n)?bDe:Z2i:Koe}function Rit(n,e){const t=[...n],i=t.length,r=n.map((o,s)=>hke(o)(o,e[s]));return o=>{for(let s=0;s<i;s++)t[s]=r[s](o);return t}}function Z2i(n,e){const t={...n,...e},i={};for(const r in t)n[r]!==void 0&&e[r]!==void 0&&(i[r]=hke(n[r])(n[r],e[r]));return r=>{for(const o in i)t[o]=i[o](r);return t}}function K2i(n,e){const t=[],i={color:0,var:0,number:0};for(let r=0;r<e.values.length;r++){const o=e.types[r],s=n.indexes[o][i[o]],a=n.values[s]??0;t[r]=a,i[o]++}return t}const G2i=(n,e)=>{const t=qd.createTransformer(e),i=ty(n),r=ty(e);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?q4e.has(n)&&!r.values.length||q4e.has(e)&&!i.values.length?q2i(n,e):rke(Rit(K2i(i,r),r.values),t):Koe(n,e)};function Pit(n,e,t){return typeof n=="number"&&typeof e=="number"&&typeof t=="number"?Xy(n,e,t):hke(n)(n,e)}const X2i=n=>{const e=({timestamp:t})=>n(t);return{start:(t=!0)=>ah.update(e,t),stop:()=>j4e(e),now:()=>Zoe.isProcessing?Zoe.timestamp:Fc.now()}},Oit=(n,e,t=10)=>{let i="";const r=Math.max(Math.round(e/t),2);for(let o=0;o<r;o++)i+=Math.round(n(o/(r-1))*1e4)/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},Goe=2e4;function fke(n){let e=0;const t=50;let i=n.next(e);for(;!i.done&&e<Goe;)e+=t,i=n.next(e);return e>=Goe?1/0:e}function Vit(n,e=100,t){const i=t({...n,keyframes:[0,e]}),r=Math.min(fke(i),Goe);return{type:"keyframes",ease:o=>i.next(r*o).value/e,duration:Od(r)}}const Ao={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function U4e(n,e){return n*Math.sqrt(1-e*e)}const Y2i=12;function J2i(n,e,t){let i=t;for(let r=1;r<Y2i;r++)i=i-n(i)/e(i);return i}const Hhe=.001;function Q2i({duration:n=Ao.duration,bounce:e=Ao.bounce,velocity:t=Ao.velocity,mass:i=Ao.mass}){let r,o,s=1-e;s=dp(Ao.minDamping,Ao.maxDamping,s),n=dp(Ao.minDuration,Ao.maxDuration,Od(n)),s<1?(r=c=>{const d=c*s,u=d*n,h=d-t,f=U4e(c,s),p=Math.exp(-u);return Hhe-h/f*p},o=c=>{const u=c*s*n,h=u*t+t,f=Math.pow(s,2)*Math.pow(c,2)*n,p=Math.exp(-u),g=U4e(Math.pow(c,2),s);return(-r(c)+Hhe>0?-1:1)*((h-f)*p)/g}):(r=c=>{const d=Math.exp(-c*n),u=(c-t)*n+1;return-Hhe+d*u},o=c=>{const d=Math.exp(-c*n),u=(t-c)*(n*n);return d*u});const a=5/n,l=J2i(r,o,a);if(n=P1(n),isNaN(l))return{stiffness:Ao.stiffness,damping:Ao.damping,duration:n};{const c=Math.pow(l,2)*i;return{stiffness:c,damping:s*2*Math.sqrt(i*c),duration:n}}}const efi=["duration","bounce"],tfi=["stiffness","damping","mass"];function wDe(n,e){return e.some(t=>n[t]!==void 0)}function nfi(n){let e={velocity:Ao.velocity,stiffness:Ao.stiffness,damping:Ao.damping,mass:Ao.mass,isResolvedFromDuration:!1,...n};if(!wDe(n,tfi)&&wDe(n,efi))if(e.velocity=0,n.visualDuration){const t=n.visualDuration,i=2*Math.PI/(t*1.2),r=i*i,o=2*dp(.05,1,1-(n.bounce||0))*Math.sqrt(r);e={...e,mass:Ao.mass,stiffness:r,damping:o}}else{const t=Q2i({...n,velocity:0});e={...e,...t,mass:Ao.mass},e.isResolvedFromDuration=!0}return e}function E_(n=Ao.visualDuration,e=Ao.bounce){const t=typeof n!="object"?{visualDuration:n,keyframes:[0,1],bounce:e}:n;let{restSpeed:i,restDelta:r}=t;const o=t.keyframes[0],s=t.keyframes[t.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:c,mass:d,duration:u,velocity:h,isResolvedFromDuration:f}=nfi({...t,velocity:-Od(t.velocity||0)}),p=h||0,g=c/(2*Math.sqrt(l*d)),v=s-o,y=Od(Math.sqrt(l/d)),C=Math.abs(v)<5;i||(i=C?Ao.restSpeed.granular:Ao.restSpeed.default),r||(r=C?Ao.restDelta.granular:Ao.restDelta.default);let _,w,x,M,L,S;if(g<1)x=U4e(y,g),M=(p+g*y*v)/x,_=E=>{const A=Math.exp(-g*y*E);return s-A*(M*Math.sin(x*E)+v*Math.cos(x*E))},L=g*y*M+v*x,S=g*y*v-M*x,w=E=>Math.exp(-g*y*E)*(L*Math.sin(x*E)+S*Math.cos(x*E));else if(g===1){_=A=>s-Math.exp(-y*A)*(v+(p+y*v)*A);const E=p+y*v;w=A=>Math.exp(-y*A)*(y*E*A-p)}else{const E=y*Math.sqrt(g*g-1);_=R=>{const P=Math.exp(-g*y*R),V=Math.min(E*R,300);return s-P*((p+g*y*v)*Math.sinh(V)+E*v*Math.cosh(V))/E};const A=(p+g*y*v)/E,T=g*y*A-v*E,D=g*y*v-A*E;w=R=>{const P=Math.exp(-g*y*R),V=Math.min(E*R,300);return P*(T*Math.sinh(V)+D*Math.cosh(V))}}const I={calculatedDuration:f&&u||null,velocity:E=>P1(w(E)),next:E=>{if(!f&&g<1){const T=Math.exp(-g*y*E),D=Math.sin(x*E),R=Math.cos(x*E),P=s-T*(M*D+v*R),V=P1(T*(L*D+S*R));return a.done=Math.abs(V)<=i&&Math.abs(s-P)<=r,a.value=a.done?s:P,a}const A=_(E);if(f)a.done=E>=u;else{const T=P1(w(E));a.done=Math.abs(T)<=i&&Math.abs(s-A)<=r}return a.value=a.done?s:A,a},toString:()=>{const E=Math.min(fke(I),Goe),A=Oit(T=>I.next(E*T).value,E,30);return E+"ms "+A},toTransition:()=>{}};return I}E_.applyToOptions=n=>{const e=Vit(n,100,E_);return n.ease=e.ease,n.duration=P1(e.duration),n.type="keyframes",n};const ifi=5;function Hit(n,e,t){const i=Math.max(e-ifi,0);return mit(t-n(i),e-i)}function Z4e({keyframes:n,velocity:e=0,power:t=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:o=500,modifyTarget:s,min:a,max:l,restDelta:c=.5,restSpeed:d}){const u=n[0],h={done:!1,value:u},f=S=>a!==void 0&&S<a||l!==void 0&&S>l,p=S=>a===void 0?l:l===void 0||Math.abs(a-S)<Math.abs(l-S)?a:l;let g=t*e;const v=u+g,y=s===void 0?v:s(v);y!==v&&(g=y-u);const C=S=>-g*Math.exp(-S/i),_=S=>y+C(S),w=S=>{const I=C(S),E=_(S);h.done=Math.abs(I)<=c,h.value=h.done?y:E};let x,M;const L=S=>{f(h.value)&&(x=S,M=E_({keyframes:[h.value,p(h.value)],velocity:Hit(_,S,h.value),damping:r,stiffness:o,restDelta:c,restSpeed:d}))};return L(0),{calculatedDuration:null,next:S=>{let I=!1;return!M&&x===void 0&&(I=!0,w(S),L(S)),x!==void 0&&S>=x?M.next(S-x):(!I&&w(S),h)}}}function rfi(n,e,t){const i=[],r=t||up.mix||Pit,o=n.length-1;for(let s=0;s<o;s++){let a=r(n[s],n[s+1]);if(e){const l=Array.isArray(e)?e[s]||Ky:e;a=rke(l,a)}i.push(a)}return i}function ofi(n,e,{clamp:t=!0,ease:i,mixer:r}={}){const o=n.length;if(ike(o===e.length),o===1)return()=>e[0];if(o===2&&e[0]===e[1])return()=>e[1];const s=n[0]===n[1];n[0]>n[o-1]&&(n=[...n].reverse(),e=[...e].reverse());const a=rfi(e,i,r),l=a.length,c=d=>{if(s&&d<n[0])return e[0];let u=0;if(l>1)for(;u<n.length-2&&!(d<n[u+1]);u++);const h=oke(n[u],n[u+1],d);return a[u](h)};return t?d=>c(dp(n[0],n[o-1],d)):c}function $it(n,e){const t=n[n.length-1];for(let i=1;i<=e;i++){const r=oke(0,e,i);n.push(Xy(t,1,r))}}function Fit(n){const e=[0];return $it(e,n.length-1),e}function sfi(n,e){return n.map(t=>t*e)}function afi(n,e){return n.map(()=>e||_it).splice(0,n.length-1)}function Zb({duration:n=300,keyframes:e,times:t,ease:i="easeInOut"}){const r=xit(i)?i.map(mDe):mDe(i),o={done:!1,value:e[0]},s=sfi(t&&t.length===e.length?t:Fit(e),n),a=ofi(s,e,{ease:Array.isArray(r)?r:afi(e,r)});return{calculatedDuration:n,next:l=>(o.value=a(l),o.done=l>=n,o)}}const lfi=n=>n!==null;function pce(n,{repeat:e,repeatType:t="loop"},i,r=1){const o=n.filter(lfi),a=r<0||e&&t!=="loop"&&e%2===1?0:o.length-1;return!a||i===void 0?o[a]:i}const cfi={decay:Z4e,inertia:Z4e,tween:Zb,keyframes:Zb,spring:E_};function zit(n){typeof n.type=="string"&&(n.type=cfi[n.type])}class pke{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}}const dfi=n=>n/100;class Xoe extends pke{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==Fc.now()&&this.tick(Fc.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;zit(e);const{type:t=Zb,repeat:i=0,repeatDelay:r=0,repeatType:o,velocity:s=0}=e;let{keyframes:a}=e;const l=t||Zb;l!==Zb&&typeof a[0]!="number"&&(this.mixKeyframes=rke(dfi,Pit(a[0],a[1])),a=[0,100]);const c=l({...e,keyframes:a});o==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...a].reverse(),velocity:-s})),c.calculatedDuration===null&&(c.calculatedDuration=fke(c));const{calculatedDuration:d}=c;this.calculatedDuration=d,this.resolvedDuration=d+r,this.totalDuration=this.resolvedDuration*(i+1)-r,this.generator=c}updateTime(e){const t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=t}tick(e,t=!1){const{generator:i,totalDuration:r,mixKeyframes:o,mirroredGenerator:s,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return i.next(0);const{delay:c=0,keyframes:d,repeat:u,repeatType:h,repeatDelay:f,type:p,onUpdate:g,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);const y=this.currentTime-c*(this.playbackSpeed>=0?1:-1),C=this.playbackSpeed>=0?y<0:y>r;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let _=this.currentTime,w=i;if(u){const S=Math.min(this.currentTime,r)/a;let I=Math.floor(S),E=S%1;!E&&S>=1&&(E=1),E===1&&I--,I=Math.min(I,u+1),!!(I%2)&&(h==="reverse"?(E=1-E,f&&(E-=f/a)):h==="mirror"&&(w=s)),_=dp(0,1,E)*a}let x;C?(this.delayState.value=d[0],x=this.delayState):x=w.next(_),o&&!C&&(x.value=o(x.value));let{done:M}=x;!C&&l!==null&&(M=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const L=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return L&&p!==Z4e&&(x.value=pce(d,this.options,v,this.speed)),g&&g(x.value),L&&this.finish(),x}then(e,t){return this.finished.then(e,t)}get duration(){return Od(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Od(e)}get time(){return Od(this.currentTime)}set time(e){e=P1(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const t=this.generator.next(e).value;return Hit(i=>this.generator.next(i).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(Fc.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=Od(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=X2i,startTime:t}=this.options;this.driver||(this.driver=e(r=>this.tick(r))),this.options.onPlay?.();const i=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=i):this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime||(this.startTime=t??i),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Fc.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function ufi(n){for(let e=1;e<n.length;e++)n[e]??(n[e]=n[e-1])}const r6=n=>n*180/Math.PI,K4e=n=>{const e=r6(Math.atan2(n[1],n[0]));return G4e(e)},hfi={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:n=>(Math.abs(n[0])+Math.abs(n[3]))/2,rotate:K4e,rotateZ:K4e,skewX:n=>r6(Math.atan(n[1])),skewY:n=>r6(Math.atan(n[2])),skew:n=>(Math.abs(n[1])+Math.abs(n[2]))/2},G4e=n=>(n=n%360,n<0&&(n+=360),n),_De=K4e,xDe=n=>Math.sqrt(n[0]*n[0]+n[1]*n[1]),SDe=n=>Math.sqrt(n[4]*n[4]+n[5]*n[5]),ffi={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:xDe,scaleY:SDe,scale:n=>(xDe(n)+SDe(n))/2,rotateX:n=>G4e(r6(Math.atan2(n[6],n[5]))),rotateY:n=>G4e(r6(Math.atan2(-n[2],n[0]))),rotateZ:_De,rotate:_De,skewX:n=>r6(Math.atan(n[4])),skewY:n=>r6(Math.atan(n[1])),skew:n=>(Math.abs(n[1])+Math.abs(n[4]))/2};function X4e(n){return n.includes("scale")?1:0}function Y4e(n,e){if(!n||n==="none")return X4e(e);const t=n.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,r;if(t)i=ffi,r=t;else{const a=n.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=hfi,r=a}if(!r)return X4e(e);const o=i[e],s=r[1].split(",").map(gfi);return typeof o=="function"?o(s):s[o]}const pfi=(n,e)=>{const{transform:t="none"}=getComputedStyle(n);return Y4e(t,e)};function gfi(n){return parseFloat(n.trim())}const Yy=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Jy=new Set([...Yy,"pathRotation"]),MDe=n=>n===Gy||n===Ht,mfi=new Set(["x","y","z"]),vfi=Yy.filter(n=>!mfi.has(n));function yfi(n){const e=[];return vfi.forEach(t=>{const i=n.getValue(t);i!==void 0&&(e.push([t,i.get()]),i.set(t.startsWith("scale")?1:0))}),e}const xf={width:({x:n},{paddingLeft:e="0",paddingRight:t="0",boxSizing:i})=>{const r=n.max-n.min;return i==="border-box"?r:r-parseFloat(e)-parseFloat(t)},height:({y:n},{paddingTop:e="0",paddingBottom:t="0",boxSizing:i})=>{const r=n.max-n.min;return i==="border-box"?r:r-parseFloat(e)-parseFloat(t)},top:(n,{top:e})=>parseFloat(e),left:(n,{left:e})=>parseFloat(e),bottom:({y:n},{top:e})=>parseFloat(e)+(n.max-n.min),right:({x:n},{left:e})=>parseFloat(e)+(n.max-n.min),x:(n,{transform:e})=>Y4e(e,"x"),y:(n,{transform:e})=>Y4e(e,"y")};xf.translateX=xf.x;xf.translateY=xf.y;const x6=new Set;let J4e=!1,Q4e=!1,e5e=!1;function Bit(){if(Q4e){const n=Array.from(x6).filter(i=>i.needsMeasurement),e=new Set(n.map(i=>i.element)),t=new Map;e.forEach(i=>{const r=yfi(i);r.length&&(t.set(i,r),i.render())}),n.forEach(i=>i.measureInitialState()),e.forEach(i=>{i.render();const r=t.get(i);r&&r.forEach(([o,s])=>{i.getValue(o)?.set(s)})}),n.forEach(i=>i.measureEndState()),n.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}Q4e=!1,J4e=!1,x6.forEach(n=>n.complete(e5e)),x6.clear()}function jit(){x6.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(Q4e=!0)})}function kfi(){e5e=!0,jit(),Bit(),e5e=!1}class gke{constructor(e,t,i,r,o,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=i,this.motionValue=r,this.element=o,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(x6.add(this),J4e||(J4e=!0,ah.read(jit),ah.resolveKeyframes(Bit))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:i,motionValue:r}=this;if(e[0]===null){const o=r?.get(),s=e[e.length-1];if(o!==void 0)e[0]=o;else if(i&&t){const a=i.readValue(t,s);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=s),r&&o===void 0&&r.set(e[0])}ufi(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),x6.delete(this)}cancel(){this.state==="scheduled"&&(x6.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Cfi=n=>n.startsWith("--");function Wit(n,e,t){Cfi(e)?n.style.setProperty(e,t):n.style[e]=t}const bfi={};function qit(n,e){const t=pit(n);return()=>bfi[e]??t()}const wfi=qit(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Uit=qit(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),HC=([n,e,t,i])=>`cubic-bezier(${n}, ${e}, ${t}, ${i})`,LDe={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:HC([0,.65,.55,1]),circOut:HC([.55,0,1,.45]),backIn:HC([.31,.01,.66,-.59]),backOut:HC([.33,1.53,.69,.99])};function Zit(n,e){if(n)return typeof n=="function"?Uit()?Oit(n,e):"ease-out":Mit(n)?HC(n):Array.isArray(n)?n.map(t=>Zit(t,e)||LDe.easeOut):LDe[n]}function _fi(n,e,t,{delay:i=0,duration:r=300,repeat:o=0,repeatType:s="loop",ease:a="easeOut",times:l}={},c=void 0){const d={[e]:t};l&&(d.offset=l);const u=Zit(a,r);Array.isArray(u)&&(d.easing=u);const h={delay:i,duration:r,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:o+1,direction:s==="reverse"?"alternate":"normal"};return c&&(h.pseudoElement=c),n.animate(d,h)}function mke(n){return typeof n=="function"&&"applyToOptions"in n}function xfi({type:n,...e}){return mke(n)&&Uit()?n.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Kit extends pke{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:t,name:i,keyframes:r,pseudoElement:o,allowFlatten:s=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=!!o,this.allowFlatten=s,this.options=e,ike(typeof e.type!="string");const c=xfi(e);this.animation=_fi(t,i,r,c,o),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const d=pce(r,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(d),Wit(t,i,d),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return Od(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Od(e)}get time(){return Od(Number(this.animation.currentTime)||0)}set time(e){const t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=P1(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:i,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&wfi()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),i&&(this.animation.rangeEnd=i),Ky):r(this)}}const Git={anticipate:bit,backInOut:Cit,circInOut:wit};function Sfi(n){return n in Git}function Mfi(n){typeof n.ease=="string"&&Sfi(n.ease)&&(n.ease=Git[n.ease])}const $he=10;class Lfi extends Kit{constructor(e){Mfi(e),zit(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:t,onUpdate:i,onComplete:r,element:o,...s}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}const a=new Xoe({...s,autoplay:!1}),l=Math.max($he,Fc.now()-this.startTime),c=dp(0,$he,l-$he),d=a.sample(l).value,{name:u}=this.options;o&&u&&Wit(o,u,d),t.setWithVelocity(a.sample(Math.max(0,l-c)).value,d,c),a.stop()}}const IDe=(n,e)=>e==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(qd.test(n)||n==="0")&&!n.startsWith("url("));function Ifi(n){const e=n[0];if(n.length===1)return!0;for(let t=0;t<n.length;t++)if(n[t]!==e)return!0}function Nfi(n,e,t,i){const r=n[0];if(r===null)return!1;if(e==="display"||e==="visibility")return!0;const o=n[n.length-1],s=IDe(r,e),a=IDe(o,e);return!s||!a?!1:Ifi(n)||(t==="spring"||mke(t))&&i}function t5e(n){n.duration=0,n.type="keyframes"}const Xit=new Set(["opacity","clipPath","filter","transform"]),Efi=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Tfi(n){for(let e=0;e<n.length;e++)if(typeof n[e]=="string"&&Efi.test(n[e]))return!0;return!1}const Afi=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Dfi=pit(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Rfi(n){const{motionValue:e,name:t,repeatDelay:i,repeatType:r,damping:o,type:s,keyframes:a}=n;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:d}=e.owner.getProps();return Dfi()&&t&&(Xit.has(t)||Afi.has(t)&&Tfi(a))&&(t!=="transform"||!d)&&!c&&!i&&r!=="mirror"&&o!==0&&s!=="inertia"}const Pfi=40;class Ofi extends pke{constructor({autoplay:e=!0,delay:t=0,type:i="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:s="loop",keyframes:a,name:l,motionValue:c,element:d,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Fc.now();const h={autoplay:e,delay:t,type:i,repeat:r,repeatDelay:o,repeatType:s,name:l,motionValue:c,element:d,...u},f=d?.KeyframeResolver||gke;this.keyframeResolver=new f(a,(p,g,v)=>this.onKeyframesResolved(p,g,h,!v),l,c,d),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,i,r){this.keyframeResolver=void 0;const{name:o,type:s,velocity:a,delay:l,isHandoff:c,onUpdate:d}=i;this.resolvedAt=Fc.now();let u=!0;Nfi(e,o,s,a)||(u=!1,(up.instantAnimations||!l)&&d?.(pce(e,i,t)),e[0]=e[e.length-1],t5e(i),i.repeat=0);const f={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>Pfi?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:t,...i,keyframes:e},p=u&&!c&&Rfi(f),g=f.motionValue?.owner?.current;let v;if(p)try{v=new Lfi({...f,element:g})}catch{v=new Xoe(f)}else v=new Xoe(f);v.finished.then(()=>{this.notifyFinished()}).catch(Ky),this.pendingTimeline&&(this.stopTimeline=v.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=v}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),kfi()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class Vfi{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let i=0;i<this.animations.length;i++)this.animations[i][e]=t}attachTimeline(e){const t=this.animations.map(i=>i.attachTimeline(e));return()=>{t.forEach((i,r)=>{i&&i(),this.animations[r].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return NDe(this.animations,"duration")}get iterationDuration(){return NDe(this.animations,"iterationDuration")}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function NDe(n,e){let t=0;for(let i=0;i<n.length;i++){const r=n[i][e];r!==null&&r>t&&(t=r)}return t}class Hfi extends Vfi{then(e,t){return this.finished.finally(e).then(()=>{})}}const EDe=30,$fi=n=>!isNaN(parseFloat(n));class Ffi{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{const r=Fc.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=Fc.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=$fi(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new git);const i=this.events[e].add(t);return e==="change"?()=>{i(),ah.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,i){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-i}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=Fc.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>EDe)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,EDe);return mit(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ny(n,e){return new Ffi(n,e)}function Yit(n,e){if(n?.inherit&&e){const{inherit:t,...i}=n;return{...e,...i}}return n}function Jit(n,e){const t=n?.[e]??n?.default??n;return t!==n?Yit(t,n):t}const zfi={type:"spring",stiffness:500,damping:25,restSpeed:10},Bfi=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),jfi={type:"keyframes",duration:.8},Wfi={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},qfi=(n,{keyframes:e})=>e.length>2?jfi:Jy.has(n)?n.startsWith("scale")?Bfi(e[1]):zfi:Wfi,Ufi=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Zfi(n){for(const e in n)if(!Ufi.has(e))return!0;return!1}const Qit=(n,e,t,i={},r,o)=>s=>{const a=Jit(i,n)||{},l=a.delay||i.delay||0;let{elapsed:c=0}=i;c=c-P1(l);const d={keyframes:Array.isArray(t)?t:[null,t],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:h=>{e.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:n,motionValue:e,element:o?void 0:r};Zfi(a)||Object.assign(d,qfi(n,d)),d.duration&&(d.duration=P1(d.duration)),d.repeatDelay&&(d.repeatDelay=P1(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let u=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(t5e(d),d.delay===0&&(u=!0)),(up.instantAnimations||up.skipAnimations||r?.shouldSkipAnimations||a.skipAnimations)&&(u=!0,t5e(d),d.delay=0),d.allowFlatten=!a.type&&!a.ease,u&&!o&&e.get()!==void 0){const h=pce(d.keyframes,a);if(h!==void 0){ah.update(()=>{d.onUpdate(h),d.onComplete()});return}}return a.isSync?new Xoe(d):new Ofi(d)},Kfi=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Gfi(n){const e=Kfi.exec(n);if(!e)return[,];const[,t,i,r]=e;return[`--${t??i}`,r]}function ert(n,e,t=1){const[i,r]=Gfi(n);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const s=o.trim();return hit(s)?parseFloat(s):s}return cke(r)?ert(r,e,t+1):r}function TDe(n){const e=[{},{}];return n?.values.forEach((t,i)=>{e[0][i]=t.get(),e[1][i]=t.getVelocity()}),e}function trt(n,e,t,i){if(typeof e=="function"){const[r,o]=TDe(i);e=e(t!==void 0?t:n.custom,r,o)}if(typeof e=="string"&&(e=n.variants&&n.variants[e]),typeof e=="function"){const[r,o]=TDe(i);e=e(t!==void 0?t:n.custom,r,o)}return e}function Xfi(n,e,t){const i=n.getProps();return trt(i,e,i.custom,n)}const nrt=new Set(["width","height","top","left","right","bottom",...Yy]),Yfi=n=>Array.isArray(n);function Jfi(n,e,t){n.hasValue(e)?n.getValue(e).set(t):n.addValue(e,ny(t))}function Qfi(n){return Yfi(n)?n[n.length-1]||0:n}function epi(n,e){const t=Xfi(n,e);let{transitionEnd:i={},transition:r={},...o}=t||{};o={...o,...i};for(const s in o){const a=Qfi(o[s]);Jfi(n,s,a)}}const Ml=n=>!!(n&&n.getVelocity);function tpi(n){return!!(Ml(n)&&n.add)}function npi(n,e){const t=n.getValue("willChange");if(tpi(t))return t.add(e);if(!t&&up.WillChange){const i=new up.WillChange("auto");n.addValue("willChange",i),i.add(e)}}function vke(n){return n.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const ipi="framerAppearId",rpi="data-"+vke(ipi);function opi(n){return n.props[rpi]}function spi({protectedKeys:n,needsAnimating:e},t){const i=n.hasOwnProperty(t)&&e[t]!==!0;return e[t]=!1,i}function api(n,e,{delay:t=0,transitionOverride:i,type:r}={}){let{transition:o,transitionEnd:s,...a}=e;const l=n.getDefaultTransition();o=o?Yit(o,l):l;const c=o?.reduceMotion,d=o?.skipAnimations;i&&(o=i);const u=[],h=r&&n.animationState&&n.animationState.getState()[r],f=o?.path;f&&f.animateVisualElement(n,a,o,t,u);for(const p in a){const g=n.getValue(p,n.latestValues[p]??null),v=a[p];if(v===void 0||h&&spi(h,p))continue;const y={delay:t,...Jit(o||{},p)};d&&(y.skipAnimations=!0);const C=g.get();if(C!==void 0&&!g.isAnimating()&&!Array.isArray(v)&&v===C&&!y.velocity){ah.update(()=>g.set(v));continue}let _=!1;if(window.MotionHandoffAnimation){const M=opi(n);if(M){const L=window.MotionHandoffAnimation(M,p,ah);L!==null&&(y.startTime=L,_=!0)}}npi(n,p);const w=c??n.shouldReduceMotion;g.start(Qit(p,g,v,w&&nrt.has(p)?{type:!1}:y,n,_));const x=g.animation;x&&u.push(x)}if(s){const p=()=>ah.update(()=>{s&&epi(n,s)});u.length?Promise.all(u).then(p):p()}return u}const lpi={test:n=>n==="auto",parse:n=>n},irt=n=>e=>e.test(n),rrt=[Gy,Ht,ov,e0,T2i,E2i,lpi],ADe=n=>rrt.find(irt(n));function cpi(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||fit(n):!0}const dpi=new Set(["brightness","contrast","saturate","opacity"]);function upi(n){const[e,t]=n.slice(0,-1).split("(");if(e==="drop-shadow")return n;const[i]=t.match(dke)||[];if(!i)return n;const r=t.replace(i,"");let o=dpi.has(e)?1:0;return i!==t&&(o*=100),e+"("+o+r+")"}const hpi=/\b([a-z-]*)\(.*?\)/gu,n5e={...qd,getAnimatableNone:n=>{const e=n.match(hpi);return e?e.map(upi).join(" "):n}},i5e={...qd,getAnimatableNone:n=>{const e=qd.parse(n);return qd.createTransformer(n)(e.map(i=>typeof i=="number"?0:typeof i=="object"?{...i,alpha:1}:i))}},DDe={...Gy,transform:Math.round},fpi={rotate:e0,pathRotation:e0,rotateX:e0,rotateY:e0,rotateZ:e0,scale:IL,scaleX:IL,scaleY:IL,scaleZ:IL,skew:e0,skewX:e0,skewY:e0,distance:Ht,translateX:Ht,translateY:Ht,translateZ:Ht,x:Ht,y:Ht,z:Ht,perspective:Ht,transformPerspective:Ht,opacity:N_,originX:yDe,originY:yDe,originZ:Ht},Yoe={borderWidth:Ht,borderTopWidth:Ht,borderRightWidth:Ht,borderBottomWidth:Ht,borderLeftWidth:Ht,borderRadius:Ht,borderTopLeftRadius:Ht,borderTopRightRadius:Ht,borderBottomRightRadius:Ht,borderBottomLeftRadius:Ht,width:Ht,maxWidth:Ht,height:Ht,maxHeight:Ht,top:Ht,right:Ht,bottom:Ht,left:Ht,inset:Ht,insetBlock:Ht,insetBlockStart:Ht,insetBlockEnd:Ht,insetInline:Ht,insetInlineStart:Ht,insetInlineEnd:Ht,padding:Ht,paddingTop:Ht,paddingRight:Ht,paddingBottom:Ht,paddingLeft:Ht,paddingBlock:Ht,paddingBlockStart:Ht,paddingBlockEnd:Ht,paddingInline:Ht,paddingInlineStart:Ht,paddingInlineEnd:Ht,margin:Ht,marginTop:Ht,marginRight:Ht,marginBottom:Ht,marginLeft:Ht,marginBlock:Ht,marginBlockStart:Ht,marginBlockEnd:Ht,marginInline:Ht,marginInlineStart:Ht,marginInlineEnd:Ht,fontSize:Ht,backgroundPositionX:Ht,backgroundPositionY:Ht,...fpi,zIndex:DDe,fillOpacity:N_,strokeOpacity:N_,numOctaves:DDe},ppi={...Yoe,color:as,backgroundColor:as,outlineColor:as,fill:as,stroke:as,borderColor:as,borderTopColor:as,borderRightColor:as,borderBottomColor:as,borderLeftColor:as,filter:n5e,WebkitFilter:n5e,mask:i5e,WebkitMask:i5e},ort=n=>ppi[n],gpi=new Set([n5e,i5e]);function srt(n,e){let t=ort(n);return gpi.has(t)||(t=qd),t.getAnimatableNone?t.getAnimatableNone(e):void 0}const mpi=new Set(["auto","none","0"]);function vpi(n,e,t){let i=0,r;for(;i<n.length&&!r;){const o=n[i];typeof o=="string"&&!mpi.has(o)&&ty(o).values.length&&(r=n[i]),i++}if(r&&t)for(const o of e)n[o]=srt(t,r)}class ypi extends gke{constructor(e,t,i,r,o){super(e,t,i,r,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:i}=this;if(!t||!t.current)return;super.readKeyframes();for(let d=0;d<e.length;d++){let u=e[d];if(typeof u=="string"&&(u=u.trim(),cke(u))){const h=ert(u,t.current);h!==void 0&&(e[d]=h),d===e.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!nrt.has(i)||e.length!==2)return;const[r,o]=e,s=ADe(r),a=ADe(o),l=vDe(r),c=vDe(o);if(l!==c&&xf[i]){this.needsMeasurement=!0;return}if(s!==a)if(MDe(s)&&MDe(a))for(let d=0;d<e.length;d++){const u=e[d];typeof u=="string"&&(e[d]=parseFloat(u))}else xf[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,i=[];for(let r=0;r<e.length;r++)(e[r]===null||cpi(e[r]))&&i.push(r);i.length&&vpi(e,i,t)}measureInitialState(){const{element:e,unresolvedKeyframes:t,name:i}=this;if(!e||!e.current)return;i==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=xf[i](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;const r=t[t.length-1];r!==void 0&&e.getValue(i,r).jump(r,!1)}measureEndState(){const{element:e,name:t,unresolvedKeyframes:i}=this;if(!e||!e.current)return;const r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);const o=i.length-1,s=i[o];i[o]=xf[t](e.measureViewportBox(),window.getComputedStyle(e.current)),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,l])=>{e.getValue(a).set(l)}),this.resolveNoneKeyframes()}}function kpi(n,e,t){if(n==null)return[];if(n instanceof EventTarget)return[n];if(typeof n=="string"){let i=document;e&&(i=e.current);const r=t?.[n]??i.querySelectorAll(n);return r?Array.from(r):[]}return Array.from(n).filter(i=>i!=null)}const r5e=(n,e)=>e&&typeof n=="number"?e.transform(n):n,{schedule:Cpi}=Lit(queueMicrotask,!1);function art(n){return u2i(n)&&"ownerSVGElement"in n}function bpi(n){return art(n)&&n.tagName==="svg"}const wpi=[...rrt,as,qd],_pi=n=>wpi.find(irt(n)),RDe=()=>({min:0,max:0}),yke=()=>({x:RDe(),y:RDe()}),T_=new WeakMap;function xpi(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}function Spi(n){return typeof n=="string"||Array.isArray(n)}const Mpi=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Lpi=["initial",...Mpi];function lrt(n){return xpi(n.animate)||Lpi.some(e=>Spi(n[e]))}function Ipi(n){return!!(lrt(n)||n.variants)}function Npi(n,e,t){for(const i in e){const r=e[i],o=t[i];if(Ml(r))n.addValue(i,r);else if(Ml(o))n.addValue(i,ny(r,{owner:n}));else if(o!==r)if(n.hasValue(i)){const s=n.getValue(i);s.liveStyle===!0?s.jump(r):s.hasAnimated||s.set(r)}else{const s=n.getStaticValue(i);n.addValue(i,ny(s!==void 0?s:r,{owner:n}))}}for(const i in t)e[i]===void 0&&n.removeValue(i);return e}const o5e={current:null},crt={current:!1},Epi=typeof window<"u";function Tpi(){if(crt.current=!0,!!Epi)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),e=()=>o5e.current=n.matches;n.addEventListener("change",e),e()}else o5e.current=!1}const PDe=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let ODe={};class drt{scrapeMotionValuesFromProps(e,t,i){return{}}constructor({parent:e,props:t,presenceContext:i,reducedMotionConfig:r,skipAnimations:o,blockInitialAnimation:s,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=gke,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=Fc.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,ah.render(this.render,!1,!0))};const{latestValues:c,renderState:d}=a;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=d,this.parent=e,this.props=t,this.presenceContext=i,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=o,this.options=l,this.blockInitialAnimation=!!s,this.isControllingVariants=lrt(t),this.isVariantNode=Ipi(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:u,...h}=this.scrapeMotionValuesFromProps(t,{},this);for(const f in h){const p=h[f];c[f]!==void 0&&Ml(p)&&p.set(c[f])}}mount(e){if(this.hasBeenMounted)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];this.current=e,T_.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,i)=>this.bindToMotionValue(i,t)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(crt.current||Tpi(),this.shouldReduceMotion=o5e.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),j4e(this.notifyUpdate),j4e(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&Xit.has(e)&&this.current instanceof HTMLElement){const{factory:s,keyframes:a,times:l,ease:c,duration:d}=t.accelerate,u=new Kit({element:this.current,name:e,keyframes:a,times:l,ease:c,duration:P1(d)}),h=s(u);this.valueSubscriptions.set(e,()=>{h(),u.cancel()});return}const i=Jy.has(e);i&&this.onBindTransform&&this.onBindTransform();const r=t.on("change",s=>{this.latestValues[e]=s,this.props.onUpdate&&ah.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),o&&o()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in ODe){const t=ODe[e];if(!t)continue;const{isEnabled:i,Feature:r}=t;if(!this.features[e]&&r&&i(this.props)&&(this.features[e]=new r(this)),this.features[e]){const o=this.features[e];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):yke()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let i=0;i<PDe.length;i++){const r=PDe[i];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const o="on"+r,s=e[o];s&&(this.propEventSubscriptions[r]=this.on(r,s))}this.prevMotionValues=Npi(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){const i=this.values.get(e);t!==i&&(i&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return i===void 0&&t!==void 0&&(i=ny(t===null?void 0:t,{owner:this}),this.addValue(e,i)),i}readValue(e,t){let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(hit(i)||fit(i))?i=parseFloat(i):!_pi(i)&&qd.test(t)&&(i=srt(e,t)),this.setBaseTarget(e,Ml(i)?i.get():i)),Ml(i)?i.get():i}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){const{initial:t}=this.props;let i;if(typeof t=="string"||typeof t=="object"){const o=trt(this.props,t,this.presenceContext?.custom);o&&(i=o[e])}if(t&&i!==void 0)return i;const r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!Ml(r)?r:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new git),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Cpi.render(this.render)}}class urt extends drt{constructor(){super(...arguments),this.KeyframeResolver=ypi}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){const i=e.style;return i?i[t]:void 0}removeValueFromRenderState(e,{vars:t,style:i}){delete t[e],delete i[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Ml(e)&&(this.childSubscription=e.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function Api({top:n,left:e,right:t,bottom:i}){return{x:{min:e,max:t},y:{min:n,max:i}}}function Dpi(n,e){if(!e)return n;const t=e({x:n.left,y:n.top}),i=e({x:n.right,y:n.bottom});return{top:t.y,left:t.x,bottom:i.y,right:i.x}}function Rpi(n,e){return Api(Dpi(n.getBoundingClientRect(),e))}const Ppi={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Opi=Yy.length;function Vpi(n,e,t){let i="",r=!0;for(let s=0;s<Opi;s++){const a=Yy[s],l=n[a];if(l===void 0)continue;let c=!0;if(typeof l=="number")c=l===(a.startsWith("scale")?1:0);else{const d=parseFloat(l);c=a.startsWith("scale")?d===1:d===0}if(!c||t){const d=r5e(l,Yoe[a]);if(!c){r=!1;const u=Ppi[a]||a;i+=`${u}(${d}) `}t&&(e[a]=d)}}const o=n.pathRotation;return o&&(r=!1,i+=`rotate(${r5e(o,Yoe.pathRotation)}) `),i=i.trim(),t?i=t(e,r?"":i):r&&(i="none"),i}function hrt(n,e,t){const{style:i,vars:r,transformOrigin:o}=n;let s=!1,a=!1;for(const l in e){const c=e[l];if(Jy.has(l)){s=!0;continue}else if(Nit(l)){r[l]=c;continue}else{const d=r5e(c,Yoe[l]);l.startsWith("origin")?(a=!0,o[l]=d):i[l]=d}}if(e.transform||(s||t?i.transform=Vpi(e,n.transform,t):i.transform&&(i.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:d=0}=o;i.transformOrigin=`${l} ${c} ${d}`}}function frt(n,{style:e,vars:t},i,r){const o=n.style;let s;for(s in e)o[s]=e[s];r?.applyProjectionStyles(o,i);for(s in t)o.setProperty(s,t[s])}function VDe(n,e){return e.max===e.min?0:n/(e.max-e.min)*100}const tC={correct:(n,e)=>{if(!e.target)return n;if(typeof n=="string")if(Ht.test(n))n=parseFloat(n);else return n;const t=VDe(n,e.target.x),i=VDe(n,e.target.y);return`${t}% ${i}%`}},Hpi={correct:(n,{treeScale:e,projectionDelta:t})=>{const i=n,r=qd.parse(n);if(r.length>5)return i;const o=qd.createTransformer(n),s=typeof r[0]!="number"?1:0,a=t.x.scale*e.x,l=t.y.scale*e.y;r[0+s]/=a,r[1+s]/=l;const c=Xy(a,l,.5);return typeof r[2+s]=="number"&&(r[2+s]/=c),typeof r[3+s]=="number"&&(r[3+s]/=c),o(r)}},$pi={borderRadius:{...tC,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:tC,borderTopRightRadius:tC,borderBottomLeftRadius:tC,borderBottomRightRadius:tC,boxShadow:Hpi};function Fpi(n,{layout:e,layoutId:t}){return Jy.has(n)||n.startsWith("origin")||(e||t!==void 0)&&(!!$pi[n]||n==="opacity")}function prt(n,e,t){const i=n.style,r=e?.style,o={};if(!i)return o;for(const s in i)(Ml(i[s])||r&&Ml(r[s])||Fpi(s,n)||t?.getValue(s)?.liveStyle!==void 0)&&(o[s]=i[s]);return o}function zpi(n){return window.getComputedStyle(n)}class Bpi extends urt{constructor(){super(...arguments),this.type="html",this.renderInstance=frt}readValueFromInstance(e,t){if(Jy.has(t))return this.projection?.isProjecting?X4e(t):pfi(e,t);{const i=zpi(e),r=(Nit(t)?i.getPropertyValue(t):i[t])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Rpi(e,t)}build(e,t,i){hrt(e,t,i.transformTemplate)}scrapeMotionValuesFromProps(e,t,i){return prt(e,t,i)}}function jpi(n,e){return n in e}class Wpi extends drt{constructor(){super(...arguments),this.type="object"}readValueFromInstance(e,t){if(jpi(t,e)){const i=e[t];if(typeof i=="string"||typeof i=="number")return i}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e]}measureInstanceViewportBox(){return yke()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}}const qpi={offset:"stroke-dashoffset",array:"stroke-dasharray"},Upi={offset:"strokeDashoffset",array:"strokeDasharray"};function Zpi(n,e,t=1,i=0,r=!0){n.pathLength=1;const o=r?qpi:Upi;n[o.offset]=`${-i}`,n[o.array]=`${e} ${t}`}const Kpi=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Gpi(n,{attrX:e,attrY:t,attrScale:i,pathLength:r,pathSpacing:o=1,pathOffset:s=0,...a},l,c,d){if(hrt(n,a,c),l){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:u,style:h}=n;u.transform&&(h.transform=u.transform,delete u.transform),(h.transform||u.transformOrigin)&&(h.transformOrigin=u.transformOrigin??"50% 50%",delete u.transformOrigin),h.transform&&(h.transformBox=d?.transformBox??"fill-box",delete u.transformBox);for(const f of Kpi)u[f]!==void 0&&(h[f]=u[f],delete u[f]);e!==void 0&&(u.x=e),t!==void 0&&(u.y=t),i!==void 0&&(u.scale=i),r!==void 0&&Zpi(u,r,o,s,!1)}const grt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Xpi=n=>typeof n=="string"&&n.toLowerCase()==="svg";function Ypi(n,e,t,i){frt(n,e,void 0,i);for(const r in e.attrs)n.setAttribute(grt.has(r)?r:vke(r),e.attrs[r])}function Jpi(n,e,t){const i=prt(n,e,t);for(const r in n)if(Ml(n[r])||Ml(e[r])){const o=Yy.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;i[o]=n[r]}return i}class Qpi extends urt{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=yke}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Jy.has(t)){const i=ort(t);return i&&i.default||0}return t=grt.has(t)?t:vke(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,i){return Jpi(e,t,i)}build(e,t,i){Gpi(e,t,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(e,t,i,r){Ypi(e,t,i,r)}mount(e){this.isSVGTag=Xpi(e.tagName),super.mount(e)}}function egi(n,e,t){const i=Ml(n)?n:ny(n);return i.start(Qit("",i,e,t)),i.animation}function kke(n){return typeof n=="object"&&!Array.isArray(n)}function mrt(n,e,t,i){return n==null?[]:typeof n=="string"&&kke(e)?kpi(n,t,i):n instanceof NodeList?Array.from(n):Array.isArray(n)?n.filter(r=>r!=null):[n]}function tgi(n,e,t){return n*(e+1)+t*e}function HDe(n,e,t,i){return typeof e=="number"?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,n+parseFloat(e)):e==="<"?t:e.startsWith("<")?Math.max(0,t+parseFloat(e.slice(1))):i.get(e)??n}function ngi(n,e,t){for(let i=0;i<n.length;i++){const r=n[i];r.at>e&&r.at<t&&(nke(n,r),i--)}}function igi(n,e,t,i,r,o){ngi(n,r,o);for(let s=0;s<e.length;s++)n.push({value:e[s],at:Xy(r,o,i[s]),easing:Sit(t,s)})}function rgi(n,e,t=0){const i=e+1+e*t;for(let r=0;r<n.length;r++)n[r]=n[r]/i}function ogi(n,e){return n.at===e.at?n.value===null?1:e.value===null?-1:0:n.at-e.at}const sgi="easeInOut",agi=20;function lgi(n,{defaultTransition:e={},...t}={},i,r){const o=e.duration||.3,s=new Map,a=new Map,l={},c=new Map;let d=0,u=0,h=0;for(let f=0;f<n.length;f++){const p=n[f];if(typeof p=="string"){c.set(p,u);continue}else if(!Array.isArray(p)){c.set(p.name,HDe(u,p.at,d,c));continue}let[g,v,y={}]=p;y.at!==void 0&&(u=HDe(u,y.at,d,c));let C=0;const _=(w,x,M,L=0,S=0)=>{const I=cgi(w),{delay:E=0,times:A=Fit(I),type:T=e.type||"keyframes",repeat:D,repeatType:R,repeatDelay:P=0,...V}=x;let{ease:$=e.ease||"easeOut",duration:j}=x;const B=typeof E=="function"?E(L,S):E,te=I.length,U=mke(T)?T:r?.[T||"keyframes"];if(te<=2&&U){let pe=100;if(te===2&&hgi(I)){const be=I[1]-I[0];pe=Math.abs(be)}const Ae={...e,...V};j!==void 0&&(Ae.duration=P1(j));const Fe=Vit(Ae,pe,U);$=Fe.ease,j=Fe.duration}j??(j=o);const Y=u+B;A.length===1&&A[0]===0&&(A[1]=1);const X=A.length-I.length;if(X>0&&$it(A,X),I.length===1&&I.unshift(null),D&&D<agi){const pe=j>0?P/j:0;j=tgi(j,D,P);const Ae=[...I],Fe=[...A];$=Array.isArray($)?[...$]:[$];const be=[...$],Ve=R==="reverse"||R==="mirror";let Ke=Ae,We=be;Ve&&(Ke=[...Ae].reverse(),R==="reverse"&&(We=[...be].reverse().map(At=>typeof At=="function"?ske(At):At)));for(let At=0;At<D;At++){const Ct=Ve&&At%2===0,Z=Ct?Ke:Ae,wt=Ct?We:be,vt=(At+1)*(1+pe);pe>0&&(I.push(I[I.length-1]),A.push(vt),$.push("linear")),I.push(...Z);for(let cn=0;cn<Z.length;cn++)A.push(Fe[cn]+vt),$.push(cn===0?"linear":Sit(wt,cn-1))}rgi(A,D,pe)}const se=Y+j;igi(M,I,$,A,Y,se),C=Math.max(B+j,C),h=Math.max(se,h)};if(Ml(g)){const w=$De(g,a);_(v,y,FDe("default",w))}else{const w=mrt(g,v,i,l),x=w.length;for(let M=0;M<x;M++){v=v,y=y;const L=w[M],S=$De(L,a);for(const I in v)_(v[I],dgi(y,I),FDe(I,S),M,x)}}d=u,u+=C}return a.forEach((f,p)=>{for(const g in f){const v=f[g];v.sort(ogi);const y=[],C=[],_=[];for(let L=0;L<v.length;L++){const{at:S,value:I,easing:E}=v[L];y.push(I),C.push(oke(0,h,S)),_.push(E||"easeOut")}C[0]!==0&&(C.unshift(0),y.unshift(y[0]),_.unshift(sgi)),C[C.length-1]!==1&&(C.push(1),y.push(null)),s.has(p)||s.set(p,{keyframes:{},transition:{}});const w=s.get(p);w.keyframes[g]=y;const{type:x,...M}=e;w.transition[g]={...M,duration:h,ease:_,times:C,...t}}}),s}function $De(n,e){return!e.has(n)&&e.set(n,{}),e.get(n)}function FDe(n,e){return e[n]||(e[n]=[]),e[n]}function cgi(n){return Array.isArray(n)?n:[n]}function dgi(n,e){return n&&n[e]?{...n,...n[e]}:{...n}}const ugi=n=>typeof n=="number",hgi=n=>n.every(ugi);function fgi(n){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},t=art(n)&&!bpi(n)?new Qpi(e):new Bpi(e);t.mount(n),T_.set(n,t)}function pgi(n){const e={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},t=new Wpi(e);t.mount(n),T_.set(n,t)}function ggi(n,e){return Ml(n)||typeof n=="number"||typeof n=="string"&&!kke(e)}function vrt(n,e,t,i){const r=[];if(ggi(n,e))r.push(egi(n,kke(e)&&e.default||e,t&&(t.default||t)));else{if(n==null)return r;const o=mrt(n,e,i),s=o.length;for(let a=0;a<s;a++){const l=o[a],c=l instanceof Element?fgi:pgi;T_.has(l)||c(l);const d=T_.get(l),u={...t};"delay"in u&&typeof u.delay=="function"&&(u.delay=u.delay(a,s)),r.push(...api(d,{...e,transition:u},{}))}}return r}function mgi(n,e,t){const i=[],r=n.map(s=>{if(Array.isArray(s)&&typeof s[0]=="function"){const a=s[0],l=ny(0);return l.on("change",a),s.length===1?[l,[0,1]]:s.length===2?[l,[0,1],s[1]]:[l,s[1],s[2]]}return s});return lgi(r,e,t,{spring:E_}).forEach(({keyframes:s,transition:a},l)=>{i.push(...vrt(l,s,a))}),i}function vgi(n){return Array.isArray(n)&&n.some(Array.isArray)}function ygi(n={}){const{scope:e,reduceMotion:t,skipAnimations:i}=n;function r(o,s,a){let l=[],c;const d={};if(t!==void 0&&(d.reduceMotion=t),i!==void 0&&(d.skipAnimations=i),vgi(o)){const{onComplete:h,...f}=s||{};typeof h=="function"&&(c=h),l=mgi(o,{...d,...f},e)}else{const{onComplete:h,...f}=a||{};typeof h=="function"&&(c=h),l=vrt(o,s,{...d,...f},e)}const u=new Hfi(l);return c&&u.finished.then(c),e&&(e.animations.push(u),u.finished.then(()=>{nke(e.animations,u)})),u}return r}const yrt=ygi(),kgi=3e3;function Cgi(){const n=Aa(),e=Bs(),t=xy();Re(()=>{const i=n.id;if(!i)return;const r=t.data.session_status[i]?.type??"idle",s=(t.data.message[i]??[]).findLast(c=>c.role==="assistant"&&typeof c.time.completed!="number");if(r==="idle"&&!s)return;const a=()=>{jZe(document.activeElement)||(Uo(()=>e.client.session.status()).then(c=>{const d=c.data?.[i];d&&t.set("session_status",i,d)}),t.session.sync(i,{force:!0}))};a();const l=setInterval(a,kgi);Oe(()=>clearInterval(l))})}var bgi=le("<div class=size-full>");function wgi(n){const e=vy(),t=k3(),i=Aa(),r=xy(),o=bp(),s=J(()=>ri(n.directory));return Re(()=>{const a=r.data.path.directory;if(!a||a===n.directory)return;const l=e.pathname.slice(s().length+1);t(`/${ri(a)}${l}${e.search}${e.hash}`,{replace:!0})}),Re(()=>{const a=i.id;a&&r.session.sync(a)}),Cgi(),m(f5e,{get data(){return r.data},get directory(){return n.directory},get mediaUrl(){return o.url},get mediaFetch(){return o.fetch},onNavigateToSession:a=>t(`/${s()}/session/${a}`),onSessionHref:a=>`/${s()}/session/${a}`,get children(){return m(yMn,{get children(){return n.children}})}})}function _gi(n){const e=Aa(),t=ha(),i=k3();let r="";const o=J(()=>e.dir?nh(e.dir)??"":"");return Re(()=>{const s=e.dir;if(s){if(o()){r="";return}r!==s&&(r=s,Fd({variant:"error",title:t.t("common.requestFailed"),description:t.t("directory.error.invalidUrl")}),i("/",{replace:!0}))}}),m(_e,{get when(){return o()},keyed:!0,children:s=>m(pbn,{directory:()=>s,get children(){return m(qZe,{get children(){return m(lMn,{get children(){return[m(c2i,{}),m(t2i,{get children(){return m(rwn,{get children(){return[m(a2i,{}),(()=>{var a=bgi();return aa(l=>requestAnimationFrame(()=>yrt(l,{opacity:[0,1],y:[4,0]},{type:"spring",stiffness:400,damping:30})),a),W(a,m(wgi,{directory:s,get children(){return n.children}})),a})()]}})}})]}})}})}})})}var xgi=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),Sgi=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function Mgi(n){if(Intl.Locale){const t=new Intl.Locale(n).maximize().script??"";return xgi.has(t)}const e=n.split("-")[0];return Sgi.has(e)}function Lgi(n){return Mgi(n)?"rtl":"ltr"}function krt(){let n=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([n])}catch{n="en-US"}return{locale:n,direction:Lgi(n)}}var s5e=krt(),$C=new Set;function zDe(){s5e=krt();for(const n of $C)n(s5e)}function Igi(){const[n,e]=Ye(s5e),t=J(()=>n());return ur(()=>{$C.size===0&&window.addEventListener("languagechange",zDe),$C.add(e),Oe(()=>{$C.delete(e),$C.size===0&&window.removeEventListener("languagechange",zDe)})}),{locale:()=>t().locale,direction:()=>t().direction}}var Ngi=oi();function m2(){const n=Igi();return Wn(Ngi)||n}var Fhe=new Map;function Egi(n){const{locale:e}=m2(),t=J(()=>e()+(n?Object.entries(n).sort((i,r)=>i[0]<r[0]?-1:1).join():""));return J(()=>{const i=t();let r;return Fhe.has(i)&&(r=Fhe.get(i)),r||(r=new Intl.Collator(e(),n),Fhe.set(i,r)),r})}const Tgi=["top","right","bottom","left"],hp=Math.min,Ic=Math.max,Joe=Math.round,NL=Math.floor,lh=n=>({x:n,y:n}),Agi={left:"right",right:"left",bottom:"top",top:"bottom"};function a5e(n,e,t){return Ic(n,hp(e,t))}function j3(n,e){return typeof n=="function"?n(e):n}function fp(n){return n.split("-")[0]}function Qy(n){return n.split("-")[1]}function Crt(n){return n==="x"?"y":"x"}function Cke(n){return n==="y"?"height":"width"}function T0(n){const e=n[0];return e==="t"||e==="b"?"y":"x"}function bke(n){return Crt(T0(n))}function Dgi(n,e,t){t===void 0&&(t=!1);const i=Qy(n),r=bke(n),o=Cke(r);let s=r==="x"?i===(t?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=Qoe(s)),[s,Qoe(s)]}function Rgi(n){const e=Qoe(n);return[l5e(n),e,l5e(e)]}function l5e(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}const BDe=["left","right"],jDe=["right","left"],Pgi=["top","bottom"],Ogi=["bottom","top"];function Vgi(n,e,t){switch(n){case"top":case"bottom":return t?e?jDe:BDe:e?BDe:jDe;case"left":case"right":return e?Pgi:Ogi;default:return[]}}function Hgi(n,e,t,i){const r=Qy(n);let o=Vgi(fp(n),t==="start",i);return r&&(o=o.map(s=>s+"-"+r),e&&(o=o.concat(o.map(l5e)))),o}function Qoe(n){const e=fp(n);return Agi[e]+n.slice(e.length)}function $gi(n){return{top:0,right:0,bottom:0,left:0,...n}}function brt(n){return typeof n!="number"?$gi(n):{top:n,right:n,bottom:n,left:n}}function ese(n){const{x:e,y:t,width:i,height:r}=n;return{width:i,height:r,top:t,left:e,right:e+i,bottom:t+r,x:e,y:t}}function WDe(n,e,t){let{reference:i,floating:r}=n;const o=T0(e),s=bke(e),a=Cke(s),l=fp(e),c=o==="y",d=i.x+i.width/2-r.width/2,u=i.y+i.height/2-r.height/2,h=i[a]/2-r[a]/2;let f;switch(l){case"top":f={x:d,y:i.y-r.height};break;case"bottom":f={x:d,y:i.y+i.height};break;case"right":f={x:i.x+i.width,y:u};break;case"left":f={x:i.x-r.width,y:u};break;default:f={x:i.x,y:i.y}}switch(Qy(e)){case"start":f[s]-=h*(t&&c?-1:1);break;case"end":f[s]+=h*(t&&c?-1:1);break}return f}async function Fgi(n,e){var t;e===void 0&&(e={});const{x:i,y:r,platform:o,rects:s,elements:a,strategy:l}=n,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:h=!1,padding:f=0}=j3(e,n),p=brt(f),v=a[h?u==="floating"?"reference":"floating":u],y=ese(await o.getClippingRect({element:(t=await(o.isElement==null?void 0:o.isElement(v)))==null||t?v:v.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),C=u==="floating"?{x:i,y:r,width:s.floating.width,height:s.floating.height}:s.reference,_=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),w=await(o.isElement==null?void 0:o.isElement(_))?await(o.getScale==null?void 0:o.getScale(_))||{x:1,y:1}:{x:1,y:1},x=ese(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:C,offsetParent:_,strategy:l}):C);return{top:(y.top-x.top+p.top)/w.y,bottom:(x.bottom-y.bottom+p.bottom)/w.y,left:(y.left-x.left+p.left)/w.x,right:(x.right-y.right+p.right)/w.x}}const zgi=50,Bgi=async(n,e,t)=>{const{placement:i="bottom",strategy:r="absolute",middleware:o=[],platform:s}=t,a=s.detectOverflow?s:{...s,detectOverflow:Fgi},l=await(s.isRTL==null?void 0:s.isRTL(e));let c=await s.getElementRects({reference:n,floating:e,strategy:r}),{x:d,y:u}=WDe(c,i,l),h=i,f=0;const p={};for(let g=0;g<o.length;g++){const v=o[g];if(!v)continue;const{name:y,fn:C}=v,{x:_,y:w,data:x,reset:M}=await C({x:d,y:u,initialPlacement:i,placement:h,strategy:r,middlewareData:p,rects:c,platform:a,elements:{reference:n,floating:e}});d=_??d,u=w??u,p[y]={...p[y],...x},M&&f<zgi&&(f++,typeof M=="object"&&(M.placement&&(h=M.placement),M.rects&&(c=M.rects===!0?await s.getElementRects({reference:n,floating:e,strategy:r}):M.rects),{x:d,y:u}=WDe(c,h,l)),g=-1)}return{x:d,y:u,placement:h,strategy:r,middlewareData:p}},jgi=n=>({name:"arrow",options:n,async fn(e){const{x:t,y:i,placement:r,rects:o,platform:s,elements:a,middlewareData:l}=e,{element:c,padding:d=0}=j3(n,e)||{};if(c==null)return{};const u=brt(d),h={x:t,y:i},f=bke(r),p=Cke(f),g=await s.getDimensions(c),v=f==="y",y=v?"top":"left",C=v?"bottom":"right",_=v?"clientHeight":"clientWidth",w=o.reference[p]+o.reference[f]-h[f]-o.floating[p],x=h[f]-o.reference[f],M=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let L=M?M[_]:0;(!L||!await(s.isElement==null?void 0:s.isElement(M)))&&(L=a.floating[_]||o.floating[p]);const S=w/2-x/2,I=L/2-g[p]/2-1,E=hp(u[y],I),A=hp(u[C],I),T=E,D=L-g[p]-A,R=L/2-g[p]/2+S,P=a5e(T,R,D),V=!l.arrow&&Qy(r)!=null&&R!==P&&o.reference[p]/2-(R<T?E:A)-g[p]/2<0,$=V?R<T?R-T:R-D:0;return{[f]:h[f]+$,data:{[f]:P,centerOffset:R-P-$,...V&&{alignmentOffset:$}},reset:V}}}),Wgi=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(e){var t,i;const{placement:r,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...v}=j3(n,e);if((t=o.arrow)!=null&&t.alignmentOffset)return{};const y=fp(r),C=T0(a),_=fp(a)===a,w=await(l.isRTL==null?void 0:l.isRTL(c.floating)),x=h||(_||!g?[Qoe(a)]:Rgi(a)),M=p!=="none";!h&&M&&x.push(...Hgi(a,g,p,w));const L=[a,...x],S=await l.detectOverflow(e,v),I=[];let E=((i=o.flip)==null?void 0:i.overflows)||[];if(d&&I.push(S[y]),u){const R=Dgi(r,s,w);I.push(S[R[0]],S[R[1]])}if(E=[...E,{placement:r,overflows:I}],!I.every(R=>R<=0)){var A,T;const R=(((A=o.flip)==null?void 0:A.index)||0)+1,P=L[R];if(P&&(!(u==="alignment"?C!==T0(P):!1)||E.every(j=>T0(j.placement)===C?j.overflows[0]>0:!0)))return{data:{index:R,overflows:E},reset:{placement:P}};let V=(T=E.filter($=>$.overflows[0]<=0).sort(($,j)=>$.overflows[1]-j.overflows[1])[0])==null?void 0:T.placement;if(!V)switch(f){case"bestFit":{var D;const $=(D=E.filter(j=>{if(M){const B=T0(j.placement);return B===C||B==="y"}return!0}).map(j=>[j.placement,j.overflows.filter(B=>B>0).reduce((B,te)=>B+te,0)]).sort((j,B)=>j[1]-B[1])[0])==null?void 0:D[0];$&&(V=$);break}case"initialPlacement":V=a;break}if(r!==V)return{reset:{placement:V}}}return{}}}};function qDe(n,e){return{top:n.top-e.height,right:n.right-e.width,bottom:n.bottom-e.height,left:n.left-e.width}}function UDe(n){return Tgi.some(e=>n[e]>=0)}const qgi=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(e){const{rects:t,platform:i}=e,{strategy:r="referenceHidden",...o}=j3(n,e);switch(r){case"referenceHidden":{const s=await i.detectOverflow(e,{...o,elementContext:"reference"}),a=qDe(s,t.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:UDe(a)}}}case"escaped":{const s=await i.detectOverflow(e,{...o,altBoundary:!0}),a=qDe(s,t.floating);return{data:{escapedOffsets:a,escaped:UDe(a)}}}default:return{}}}}},Ugi=new Set(["left","top"]);async function Zgi(n,e){const{placement:t,platform:i,elements:r}=n,o=await(i.isRTL==null?void 0:i.isRTL(r.floating)),s=fp(t),a=Qy(t),l=T0(t)==="y",c=Ugi.has(s)?-1:1,d=o&&l?-1:1,u=j3(e,n);let{mainAxis:h,crossAxis:f,alignmentAxis:p}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof p=="number"&&(f=a==="end"?p*-1:p),l?{x:f*d,y:h*c}:{x:h*c,y:f*d}}const Kgi=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(e){var t,i;const{x:r,y:o,placement:s,middlewareData:a}=e,l=await Zgi(e,n);return s===((t=a.offset)==null?void 0:t.placement)&&(i=a.arrow)!=null&&i.alignmentOffset?{}:{x:r+l.x,y:o+l.y,data:{...l,placement:s}}}}},Ggi=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(e){const{x:t,y:i,placement:r,platform:o}=e,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:y=>{let{x:C,y:_}=y;return{x:C,y:_}}},...c}=j3(n,e),d={x:t,y:i},u=await o.detectOverflow(e,c),h=T0(fp(r)),f=Crt(h);let p=d[f],g=d[h];if(s){const y=f==="y"?"top":"left",C=f==="y"?"bottom":"right",_=p+u[y],w=p-u[C];p=a5e(_,p,w)}if(a){const y=h==="y"?"top":"left",C=h==="y"?"bottom":"right",_=g+u[y],w=g-u[C];g=a5e(_,g,w)}const v=l.fn({...e,[f]:p,[h]:g});return{...v,data:{x:v.x-t,y:v.y-i,enabled:{[f]:s,[h]:a}}}}}},Xgi=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(e){var t,i;const{placement:r,rects:o,platform:s,elements:a}=e,{apply:l=()=>{},...c}=j3(n,e),d=await s.detectOverflow(e,c),u=fp(r),h=Qy(r),f=T0(r)==="y",{width:p,height:g}=o.floating;let v,y;u==="top"||u==="bottom"?(v=u,y=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(y=u,v=h==="end"?"top":"bottom");const C=g-d.top-d.bottom,_=p-d.left-d.right,w=hp(g-d[v],C),x=hp(p-d[y],_),M=!e.middlewareData.shift;let L=w,S=x;if((t=e.middlewareData.shift)!=null&&t.enabled.x&&(S=_),(i=e.middlewareData.shift)!=null&&i.enabled.y&&(L=C),M&&!h){const E=Ic(d.left,0),A=Ic(d.right,0),T=Ic(d.top,0),D=Ic(d.bottom,0);f?S=p-2*(E!==0||A!==0?E+A:Ic(d.left,d.right)):L=g-2*(T!==0||D!==0?T+D:Ic(d.top,d.bottom))}await l({...e,availableWidth:S,availableHeight:L});const I=await s.getDimensions(a.floating);return p!==I.width||g!==I.height?{reset:{rects:!0}}:{}}}};function gce(){return typeof window<"u"}function ek(n){return wrt(n)?(n.nodeName||"").toLowerCase():"#document"}function Uc(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function Th(n){var e;return(e=(wrt(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function wrt(n){return gce()?n instanceof Node||n instanceof Uc(n).Node:!1}function iu(n){return gce()?n instanceof Element||n instanceof Uc(n).Element:!1}function v2(n){return gce()?n instanceof HTMLElement||n instanceof Uc(n).HTMLElement:!1}function ZDe(n){return!gce()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof Uc(n).ShadowRoot}function Jx(n){const{overflow:e,overflowX:t,overflowY:i,display:r}=ru(n);return/auto|scroll|overlay|hidden|clip/.test(e+i+t)&&r!=="inline"&&r!=="contents"}function Ygi(n){return/^(table|td|th)$/.test(ek(n))}function mce(n){try{if(n.matches(":popover-open"))return!0}catch{}try{return n.matches(":modal")}catch{return!1}}const Jgi=/transform|translate|scale|rotate|perspective|filter/,Qgi=/paint|layout|strict|content/,Gp=n=>!!n&&n!=="none";let zhe;function wke(n){const e=iu(n)?ru(n):n;return Gp(e.transform)||Gp(e.translate)||Gp(e.scale)||Gp(e.rotate)||Gp(e.perspective)||!_ke()&&(Gp(e.backdropFilter)||Gp(e.filter))||Jgi.test(e.willChange||"")||Qgi.test(e.contain||"")}function emi(n){let e=pp(n);for(;v2(e)&&!iy(e);){if(wke(e))return e;if(mce(e))return null;e=pp(e)}return null}function _ke(){return zhe==null&&(zhe=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),zhe}function iy(n){return/^(html|body|#document)$/.test(ek(n))}function ru(n){return Uc(n).getComputedStyle(n)}function vce(n){return iu(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function pp(n){if(ek(n)==="html")return n;const e=n.assignedSlot||n.parentNode||ZDe(n)&&n.host||Th(n);return ZDe(e)?e.host:e}function _rt(n){const e=pp(n);return iy(e)?n.ownerDocument?n.ownerDocument.body:n.body:v2(e)&&Jx(e)?e:_rt(e)}function A_(n,e,t){var i;e===void 0&&(e=[]),t===void 0&&(t=!0);const r=_rt(n),o=r===((i=n.ownerDocument)==null?void 0:i.body),s=Uc(r);if(o){const a=c5e(s);return e.concat(s,s.visualViewport||[],Jx(r)?r:[],a&&t?A_(a):[])}else return e.concat(r,A_(r,[],t))}function c5e(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function xrt(n){const e=ru(n);let t=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=v2(n),o=r?n.offsetWidth:t,s=r?n.offsetHeight:i,a=Joe(t)!==o||Joe(i)!==s;return a&&(t=o,i=s),{width:t,height:i,$:a}}function xke(n){return iu(n)?n:n.contextElement}function sv(n){const e=xke(n);if(!v2(e))return lh(1);const t=e.getBoundingClientRect(),{width:i,height:r,$:o}=xrt(e);let s=(o?Joe(t.width):t.width)/i,a=(o?Joe(t.height):t.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const tmi=lh(0);function Srt(n){const e=Uc(n);return!_ke()||!e.visualViewport?tmi:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function nmi(n,e,t){return e===void 0&&(e=!1),!t||e&&t!==Uc(n)?!1:e}function l3(n,e,t,i){e===void 0&&(e=!1),t===void 0&&(t=!1);const r=n.getBoundingClientRect(),o=xke(n);let s=lh(1);e&&(i?iu(i)&&(s=sv(i)):s=sv(n));const a=nmi(o,t,i)?Srt(o):lh(0);let l=(r.left+a.x)/s.x,c=(r.top+a.y)/s.y,d=r.width/s.x,u=r.height/s.y;if(o){const h=Uc(o),f=i&&iu(i)?Uc(i):i;let p=h,g=c5e(p);for(;g&&i&&f!==p;){const v=sv(g),y=g.getBoundingClientRect(),C=ru(g),_=y.left+(g.clientLeft+parseFloat(C.paddingLeft))*v.x,w=y.top+(g.clientTop+parseFloat(C.paddingTop))*v.y;l*=v.x,c*=v.y,d*=v.x,u*=v.y,l+=_,c+=w,p=Uc(g),g=c5e(p)}}return ese({width:d,height:u,x:l,y:c})}function yce(n,e){const t=vce(n).scrollLeft;return e?e.left+t:l3(Th(n)).left+t}function Mrt(n,e){const t=n.getBoundingClientRect(),i=t.left+e.scrollLeft-yce(n,t),r=t.top+e.scrollTop;return{x:i,y:r}}function imi(n){let{elements:e,rect:t,offsetParent:i,strategy:r}=n;const o=r==="fixed",s=Th(i),a=e?mce(e.floating):!1;if(i===s||a&&o)return t;let l={scrollLeft:0,scrollTop:0},c=lh(1);const d=lh(0),u=v2(i);if((u||!u&&!o)&&((ek(i)!=="body"||Jx(s))&&(l=vce(i)),u)){const f=l3(i);c=sv(i),d.x=f.x+i.clientLeft,d.y=f.y+i.clientTop}const h=s&&!u&&!o?Mrt(s,l):lh(0);return{width:t.width*c.x,height:t.height*c.y,x:t.x*c.x-l.scrollLeft*c.x+d.x+h.x,y:t.y*c.y-l.scrollTop*c.y+d.y+h.y}}function rmi(n){return Array.from(n.getClientRects())}function omi(n){const e=Th(n),t=vce(n),i=n.ownerDocument.body,r=Ic(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),o=Ic(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let s=-t.scrollLeft+yce(n);const a=-t.scrollTop;return ru(i).direction==="rtl"&&(s+=Ic(e.clientWidth,i.clientWidth)-r),{width:r,height:o,x:s,y:a}}const KDe=25;function smi(n,e){const t=Uc(n),i=Th(n),r=t.visualViewport;let o=i.clientWidth,s=i.clientHeight,a=0,l=0;if(r){o=r.width,s=r.height;const d=_ke();(!d||d&&e==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}const c=yce(i);if(c<=0){const d=i.ownerDocument,u=d.body,h=getComputedStyle(u),f=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,p=Math.abs(i.clientWidth-u.clientWidth-f);p<=KDe&&(o-=p)}else c<=KDe&&(o+=c);return{width:o,height:s,x:a,y:l}}function ami(n,e){const t=l3(n,!0,e==="fixed"),i=t.top+n.clientTop,r=t.left+n.clientLeft,o=v2(n)?sv(n):lh(1),s=n.clientWidth*o.x,a=n.clientHeight*o.y,l=r*o.x,c=i*o.y;return{width:s,height:a,x:l,y:c}}function GDe(n,e,t){let i;if(e==="viewport")i=smi(n,t);else if(e==="document")i=omi(Th(n));else if(iu(e))i=ami(e,t);else{const r=Srt(n);i={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return ese(i)}function Lrt(n,e){const t=pp(n);return t===e||!iu(t)||iy(t)?!1:ru(t).position==="fixed"||Lrt(t,e)}function lmi(n,e){const t=e.get(n);if(t)return t;let i=A_(n,[],!1).filter(a=>iu(a)&&ek(a)!=="body"),r=null;const o=ru(n).position==="fixed";let s=o?pp(n):n;for(;iu(s)&&!iy(s);){const a=ru(s),l=wke(s);!l&&a.position==="fixed"&&(r=null),(o?!l&&!r:!l&&a.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||Jx(s)&&!l&&Lrt(n,s))?i=i.filter(d=>d!==s):r=a,s=pp(s)}return e.set(n,i),i}function cmi(n){let{element:e,boundary:t,rootBoundary:i,strategy:r}=n;const s=[...t==="clippingAncestors"?mce(e)?[]:lmi(e,this._c):[].concat(t),i],a=GDe(e,s[0],r);let l=a.top,c=a.right,d=a.bottom,u=a.left;for(let h=1;h<s.length;h++){const f=GDe(e,s[h],r);l=Ic(f.top,l),c=hp(f.right,c),d=hp(f.bottom,d),u=Ic(f.left,u)}return{width:c-u,height:d-l,x:u,y:l}}function dmi(n){const{width:e,height:t}=xrt(n);return{width:e,height:t}}function umi(n,e,t){const i=v2(e),r=Th(e),o=t==="fixed",s=l3(n,!0,o,e);let a={scrollLeft:0,scrollTop:0};const l=lh(0);function c(){l.x=yce(r)}if(i||!i&&!o)if((ek(e)!=="body"||Jx(r))&&(a=vce(e)),i){const f=l3(e,!0,o,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else r&&c();o&&!i&&r&&c();const d=r&&!i&&!o?Mrt(r,a):lh(0),u=s.left+a.scrollLeft-l.x-d.x,h=s.top+a.scrollTop-l.y-d.y;return{x:u,y:h,width:s.width,height:s.height}}function Bhe(n){return ru(n).position==="static"}function XDe(n,e){if(!v2(n)||ru(n).position==="fixed")return null;if(e)return e(n);let t=n.offsetParent;return Th(n)===t&&(t=t.ownerDocument.body),t}function Irt(n,e){const t=Uc(n);if(mce(n))return t;if(!v2(n)){let r=pp(n);for(;r&&!iy(r);){if(iu(r)&&!Bhe(r))return r;r=pp(r)}return t}let i=XDe(n,e);for(;i&&Ygi(i)&&Bhe(i);)i=XDe(i,e);return i&&iy(i)&&Bhe(i)&&!wke(i)?t:i||emi(n)||t}const hmi=async function(n){const e=this.getOffsetParent||Irt,t=this.getDimensions,i=await t(n.floating);return{reference:umi(n.reference,await e(n.floating),n.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function fmi(n){return ru(n).direction==="rtl"}const Nrt={convertOffsetParentRelativeRectToViewportRelativeRect:imi,getDocumentElement:Th,getClippingRect:cmi,getOffsetParent:Irt,getElementRects:hmi,getClientRects:rmi,getDimensions:dmi,getScale:sv,isElement:iu,isRTL:fmi};function Ert(n,e){return n.x===e.x&&n.y===e.y&&n.width===e.width&&n.height===e.height}function pmi(n,e){let t=null,i;const r=Th(n);function o(){var a;clearTimeout(i),(a=t)==null||a.disconnect(),t=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const c=n.getBoundingClientRect(),{left:d,top:u,width:h,height:f}=c;if(a||e(),!h||!f)return;const p=NL(u),g=NL(r.clientWidth-(d+h)),v=NL(r.clientHeight-(u+f)),y=NL(d),_={rootMargin:-p+"px "+-g+"px "+-v+"px "+-y+"px",threshold:Ic(0,hp(1,l))||1};let w=!0;function x(M){const L=M[0].intersectionRatio;if(L!==l){if(!w)return s();L?s(!1,L):i=setTimeout(()=>{s(!1,1e-7)},1e3)}L===1&&!Ert(c,n.getBoundingClientRect())&&s(),w=!1}try{t=new IntersectionObserver(x,{..._,root:r.ownerDocument})}catch{t=new IntersectionObserver(x,_)}t.observe(n)}return s(!0),o}function gmi(n,e,t,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,c=xke(n),d=r||o?[...c?A_(c):[],...e?A_(e):[]]:[];d.forEach(y=>{r&&y.addEventListener("scroll",t,{passive:!0}),o&&y.addEventListener("resize",t)});const u=c&&a?pmi(c,t):null;let h=-1,f=null;s&&(f=new ResizeObserver(y=>{let[C]=y;C&&C.target===c&&f&&e&&(f.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var _;(_=f)==null||_.observe(e)})),t()}),c&&!l&&f.observe(c),e&&f.observe(e));let p,g=l?l3(n):null;l&&v();function v(){const y=l3(n);g&&!Ert(g,y)&&t(),g=y,p=requestAnimationFrame(v)}return t(),()=>{var y;d.forEach(C=>{r&&C.removeEventListener("scroll",t),o&&C.removeEventListener("resize",t)}),u?.(),(y=f)==null||y.disconnect(),f=null,l&&cancelAnimationFrame(p)}}const mmi=Kgi,vmi=Ggi,ymi=Wgi,kmi=Xgi,Cmi=qgi,bmi=jgi,wmi=(n,e,t)=>{const i=new Map,r={platform:Nrt,...t},o={...r.platform,_c:i};return Bgi(n,e,{...r,platform:o})};var _mi=le('<svg display=block viewBox="0 0 30 30"style=transform:scale(1.02)><g><path fill=none d=M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z></path><path stroke=none d=M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z>'),Ske=oi();function Mke(){const n=Wn(Ske);if(n===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return n}var d5e=30,YDe=d5e/2,xmi={top:180,right:-90,bottom:0,left:90};function y2(n){const e=Mke(),t=Pn({size:d5e},n),[i,r]=Je(t,["ref","style","size"]),o=()=>e.currentPlacement().split("-")[0],s=Smi(e.contentRef),a=()=>s()?.getPropertyValue("background-color")||"none",l=()=>s()?.getPropertyValue(`border-${o()}-color`)||"none",c=()=>s()?.getPropertyValue(`border-${o()}-width`)||"0px",d=()=>Number.parseInt(c())*2*(d5e/i.size),u=()=>`rotate(${xmi[o()]} ${YDe} ${YDe}) translate(0 2)`;return m(zi,k({as:"div",ref(h){var f=qr(e.setArrowRef,i.ref);typeof f=="function"&&f(h)},"aria-hidden":"true",get style(){return su({position:"absolute","font-size":`${i.size}px`,width:"1em",height:"1em","pointer-events":"none",fill:a(),stroke:l(),"stroke-width":d()},i.style)}},r,{get children(){var h=_mi(),f=h.firstChild,p=f.firstChild;return p.nextSibling,st(()=>mt(f,"transform",u())),h}}))}function Smi(n){const[e,t]=Ye();return Re(()=>{const i=n();i&&t(m5e(i).getComputedStyle(i))}),e}function Mmi(n){const e=Mke(),[t,i]=Je(n,["ref","style"]);return m(zi,k({as:"div",ref(r){var o=qr(e.setPositionerRef,t.ref);typeof o=="function"&&o(r)},"data-popper-positioner":"",get style(){return su({position:"absolute",top:0,left:0,"min-width":"max-content"},t.style)}},i))}function JDe(n){const{x:e=0,y:t=0,width:i=0,height:r=0}=n??{};if(typeof DOMRect=="function")return new DOMRect(e,t,i,r);const o={x:e,y:t,width:i,height:r,top:t,right:e+i,bottom:t+r,left:e};return{...o,toJSON:()=>o}}function Lmi(n,e){return{contextElement:n,getBoundingClientRect:()=>{const i=e(n);return i?JDe(i):n?n.getBoundingClientRect():JDe()}}}function Imi(n){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(n)}var Nmi={top:"bottom",right:"left",bottom:"top",left:"right"};function Emi(n,e){const[t,i]=n.split("-"),r=Nmi[t];return i?t==="left"||t==="right"?`${r} ${i==="start"?"top":"bottom"}`:i==="start"?`${r} ${e==="rtl"?"right":"left"}`:`${r} ${e==="rtl"?"left":"right"}`:`${r} center`}function Tmi(n){const e=Pn({getAnchorRect:h=>h?.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},n),[t,i]=Ye(),[r,o]=Ye(),[s,a]=Ye(e.placement),l=()=>Lmi(e.anchorRef?.(),e.getAnchorRect),{direction:c}=m2();async function d(){const h=l(),f=t(),p=r();if(!h||!f)return;const g=(p?.clientHeight||0)/2,v=typeof e.gutter=="number"?e.gutter+g:e.gutter??g;f.style.setProperty("--kb-popper-content-overflow-padding",`${e.overflowPadding}px`),h.getBoundingClientRect();const y=[mmi(({placement:M})=>{const L=!!M.split("-")[1];return{mainAxis:v,crossAxis:L?void 0:e.shift,alignmentAxis:e.shift}})];if(e.flip!==!1){const M=typeof e.flip=="string"?e.flip.split(" "):void 0;if(M!==void 0&&!M.every(Imi))throw new Error("`flip` expects a spaced-delimited list of placements");y.push(ymi({padding:e.overflowPadding,fallbackPlacements:M}))}(e.slide||e.overlap)&&y.push(vmi({mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding})),y.push(kmi({padding:e.overflowPadding,apply({availableWidth:M,availableHeight:L,rects:S}){const I=Math.round(S.reference.width);M=Math.floor(M),L=Math.floor(L),f.style.setProperty("--kb-popper-anchor-width",`${I}px`),f.style.setProperty("--kb-popper-content-available-width",`${M}px`),f.style.setProperty("--kb-popper-content-available-height",`${L}px`),e.sameWidth&&(f.style.width=`${I}px`),e.fitViewport&&(f.style.maxWidth=`${M}px`,f.style.maxHeight=`${L}px`)}})),e.hideWhenDetached&&y.push(Cmi({padding:e.detachedPadding})),p&&y.push(bmi({element:p,padding:e.arrowPadding}));const C=await wmi(h,f,{placement:e.placement,strategy:"absolute",middleware:y,platform:{...Nrt,isRTL:()=>c()==="rtl"}});if(a(C.placement),e.onCurrentPlacementChange?.(C.placement),!f)return;f.style.setProperty("--kb-popper-content-transform-origin",Emi(C.placement,c()));const _=Math.round(C.x),w=Math.round(C.y);let x;if(e.hideWhenDetached&&(x=C.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(f.style,{top:"0",left:"0",transform:`translate3d(${_}px, ${w}px, 0)`,visibility:x}),p&&C.middlewareData.arrow){const{x:M,y:L}=C.middlewareData.arrow,S=C.placement.split("-")[0];Object.assign(p.style,{left:M!=null?`${M}px`:"",top:L!=null?`${L}px`:"",[S]:"100%"})}}Re(()=>{const h=l(),f=t();if(!h||!f)return;const p=gmi(h,f,d,{elementResize:typeof ResizeObserver=="function"});Oe(p)}),Re(()=>{const h=t(),f=e.contentRef?.();!h||!f||queueMicrotask(()=>{h.style.zIndex=getComputedStyle(f).zIndex})});const u={currentPlacement:s,contentRef:()=>e.contentRef?.(),setPositionerRef:i,setArrowRef:o};return m(Ske.Provider,{value:u,get children(){return e.children}})}var tk=Object.assign(Tmi,{Arrow:y2,Context:Ske,usePopperContext:Mke,Positioner:Mmi}),Ami={};au(Ami,{Arrow:()=>y2,Content:()=>Art,Portal:()=>Drt,Root:()=>Rrt,Tooltip:()=>FC,Trigger:()=>Prt,useTooltipContext:()=>kce});var Trt=oi();function kce(){const n=Wn(Trt);if(n===void 0)throw new Error("[kobalte]: `useTooltipContext` must be used within a `Tooltip` component");return n}function Art(n){const e=kce(),t=Pn({id:e.generateId("content")},n),[i,r]=Je(t,["ref","style"]);return Re(()=>Oe(e.registerContentId(r.id))),m(_e,{get when(){return e.contentPresent()},get children(){return m(tk.Positioner,{get children(){return m(cse,k({ref(o){var s=qr(a=>{e.setContentRef(a)},i.ref);typeof s=="function"&&s(o)},role:"tooltip",disableOutsidePointerEvents:!1,get style(){return su({"--kb-tooltip-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},i.style)},onFocusOutside:o=>o.preventDefault(),onDismiss:()=>e.hideTooltip(!0)},()=>e.dataset(),r))}})}})}function Drt(n){const e=kce();return m(_e,{get when(){return e.contentPresent()},get children(){return m(d3,n)}})}function Dmi(n,e,t){const i=n.split("-")[0],r=e.getBoundingClientRect(),o=t.getBoundingClientRect(),s=[],a=r.left+r.width/2,l=r.top+r.height/2;switch(i){case"top":s.push([r.left,l]),s.push([o.left,o.bottom]),s.push([o.left,o.top]),s.push([o.right,o.top]),s.push([o.right,o.bottom]),s.push([r.right,l]);break;case"right":s.push([a,r.top]),s.push([o.left,o.top]),s.push([o.right,o.top]),s.push([o.right,o.bottom]),s.push([o.left,o.bottom]),s.push([a,r.bottom]);break;case"bottom":s.push([r.left,l]),s.push([o.left,o.top]),s.push([o.left,o.bottom]),s.push([o.right,o.bottom]),s.push([o.right,o.top]),s.push([r.right,l]);break;case"left":s.push([a,r.top]),s.push([o.right,o.top]),s.push([o.left,o.top]),s.push([o.left,o.bottom]),s.push([o.right,o.bottom]),s.push([a,r.bottom]);break}return s}var Xp={},Rmi=0,x8=!1,Zh,nC,S8;function Rrt(n){const e=`tooltip-${$s()}`,t=`${++Rmi}`,i=Pn({id:e,openDelay:700,closeDelay:300,skipDelayDuration:300},n),[r,o]=Je(i,["id","open","defaultOpen","onOpenChange","disabled","triggerOnFocusOnly","openDelay","closeDelay","skipDelayDuration","ignoreSafeArea","forceMount"]);let s;const[a,l]=Ye(),[c,d]=Ye(),[u,h]=Ye(),[f,p]=Ye(o.placement),g=u3({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:R=>r.onOpenChange?.(R)}),{present:v}=M6({show:()=>r.forceMount||g.isOpen(),element:()=>u()??null}),y=()=>{Xp[t]=_},C=()=>{for(const R in Xp)R!==t&&(Xp[R](!0),delete Xp[R])},_=(R=!1)=>{R||r.closeDelay&&r.closeDelay<=0?(window.clearTimeout(s),s=void 0,g.close()):s||(s=window.setTimeout(()=>{s=void 0,g.close()},r.closeDelay)),window.clearTimeout(Zh),Zh=void 0,r.skipDelayDuration&&r.skipDelayDuration>=0&&(S8=window.setTimeout(()=>{window.clearTimeout(S8),S8=void 0},r.skipDelayDuration)),x8&&(window.clearTimeout(nC),nC=window.setTimeout(()=>{delete Xp[t],nC=void 0,x8=!1},r.closeDelay))},w=()=>{clearTimeout(s),s=void 0,C(),y(),x8=!0,g.open(),window.clearTimeout(Zh),Zh=void 0,window.clearTimeout(nC),nC=void 0,window.clearTimeout(S8),S8=void 0},x=()=>{C(),y(),!g.isOpen()&&!Zh&&!x8?Zh=window.setTimeout(()=>{Zh=void 0,x8=!0,w()},r.openDelay):g.isOpen()||w()},M=(R=!1)=>{!R&&r.openDelay&&r.openDelay>0&&!s&&!S8?x():w()},L=()=>{window.clearTimeout(Zh),Zh=void 0,x8=!1},S=()=>{window.clearTimeout(s),s=void 0},I=R=>ps(c(),R)||ps(u(),R),E=R=>{const P=c(),V=u();if(!(!P||!V))return Dmi(R,P,V)},A=R=>{const P=R.target;if(I(P)){S();return}if(!r.ignoreSafeArea){const V=E(f());if(V&&C5e(DRe(R),V)){S();return}}s||_()};Re(()=>{if(!g.isOpen())return;const R=Tl();R.addEventListener("pointermove",A,!0),Oe(()=>{R.removeEventListener("pointermove",A,!0)})}),Re(()=>{const R=c();if(!R||!g.isOpen())return;const P=$=>{const j=$.target;ps(j,R)&&_(!0)},V=m5e();V.addEventListener("scroll",P,{capture:!0}),Oe(()=>{V.removeEventListener("scroll",P,{capture:!0})})}),Oe(()=>{clearTimeout(s),Xp[t]&&delete Xp[t]});const D={dataset:J(()=>({"data-expanded":g.isOpen()?"":void 0,"data-closed":g.isOpen()?void 0:""})),isOpen:g.isOpen,isDisabled:()=>r.disabled??!1,triggerOnFocusOnly:()=>r.triggerOnFocusOnly??!1,contentId:a,contentPresent:v,openTooltip:M,hideTooltip:_,cancelOpening:L,generateId:bh(()=>i.id),registerContentId:Xa(l),isTargetOnTooltip:I,setTriggerRef:d,setContentRef:h};return m(Trt.Provider,{value:D,get children(){return m(tk,k({anchorRef:c,contentRef:u,onCurrentPlacementChange:p},o))}})}function Prt(n){let e;const t=kce(),[i,r]=Je(n,["ref","onPointerEnter","onPointerLeave","onPointerDown","onClick","onFocus","onBlur"]);let o=!1,s=!1,a=!1;const l=()=>{o=!1},c=()=>{!t.isOpen()&&(s||a)&&t.openTooltip(a)},d=y=>{t.isOpen()&&!s&&!a&&t.hideTooltip(y)},u=y=>{In(y,i.onPointerEnter),!(y.pointerType==="touch"||t.triggerOnFocusOnly()||t.isDisabled()||y.defaultPrevented)&&(s=!0,c())},h=y=>{In(y,i.onPointerLeave),y.pointerType!=="touch"&&(s=!1,a=!1,t.isOpen()?d():t.cancelOpening())},f=y=>{In(y,i.onPointerDown),o=!0,Tl(e).addEventListener("pointerup",l,{once:!0})},p=y=>{In(y,i.onClick),s=!1,a=!1,d(!0)},g=y=>{In(y,i.onFocus),!(t.isDisabled()||y.defaultPrevented||o)&&(a=!0,c())},v=y=>{In(y,i.onBlur);const C=y.relatedTarget;t.isTargetOnTooltip(C)||(s=!1,a=!1,d(!0))};return Oe(()=>{Tl(e).removeEventListener("pointerup",l)}),m(zi,k({as:"button",ref(y){var C=qr(_=>{t.setTriggerRef(_),e=_},i.ref);typeof C=="function"&&C(y)},get"aria-describedby"(){return sn(()=>!!t.isOpen())()?t.contentId():void 0},onPointerEnter:u,onPointerLeave:h,onPointerDown:f,onClick:p,onFocus:g,onBlur:v},()=>t.dataset(),r))}var FC=Object.assign(Rrt,{Arrow:y2,Content:Art,Portal:Drt,Trigger:Prt}),Pmi=le("<div data-slot=tooltip-keybind><span></span><span data-slot=tooltip-keybind-key>");function Ort(n){const[e,t]=Je(n,["title","keybind"]);return m(ou,k(t,{get value(){return(()=>{var i=Pmi(),r=i.firstChild,o=r.nextSibling;return W(r,()=>e.title),W(o,()=>e.keybind),i})()}}))}function ou(n){let e;const[t,i]=Yt({open:!1,block:!1,expand:!1}),[r,o]=Je(n,["children","class","contentClass","contentStyle","inactive","forceOpen","ignoreSafeArea","value"]),s=()=>i("open",!1),a=()=>{const h=document.activeElement;return!e||!h?!1:e.contains(h)},l=(h=t.expand)=>{h||e?.matches(":hover")||a()||i("block",!1)},c=()=>{const h=!!e?.querySelector('[aria-expanded="true"], [data-expanded]');if(i("expand",h),h){i("block",!0),s();return}l(h)},d=()=>{i("block",!0),s()},u=()=>{a()||s(),l()};return Re(()=>{if(!e)return;c();const h=new MutationObserver(c);h.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["aria-expanded","data-expanded"]}),Oe(()=>h.disconnect())}),m(V1,{get children(){return[m(fi,{get when(){return r.inactive},get children(){return r.children}}),m(fi,{when:!0,get children(){return m(FC,k({gutter:4},o,{closeDelay:0,get ignoreSafeArea(){return r.ignoreSafeArea??!0},get open(){return r.forceOpen||t.open},onOpenChange:h=>{r.forceOpen||t.block&&h||i("open",h)},get children(){return[m(FC.Trigger,{ref(h){var f=e;typeof f=="function"?f(h):e=h},as:"div","data-component":"tooltip-trigger",get class(){return r.class},onPointerDownCapture:d,onKeyDownCapture:h=>{h.key!=="Enter"&&h.key!==" "||d()},onPointerLeave:u,onFocusOut:()=>requestAnimationFrame(()=>l()),get children(){return r.children}}),m(FC.Portal,{get children(){return m(FC.Content,{"data-component":"tooltip",get"data-placement"(){return n.placement},get"data-force-open"(){return r.forceOpen},get class(){return r.contentClass},get style(){return r.contentStyle},get children(){return r.value}})}})]}}))}})]}})}function Vrt(n){let e=n.startIndex??0;const t=n.startLevel??0,i=[],r=l=>{if(l==null)return"";const c=n.getKey??"key",d=I8(c)?l[c]:c(l);return d!=null?String(d):""},o=l=>{if(l==null)return"";const c=n.getTextValue??"textValue",d=I8(c)?l[c]:c(l);return d!=null?String(d):""},s=l=>{if(l==null)return!1;const c=n.getDisabled??"disabled";return(I8(c)?l[c]:c(l))??!1},a=l=>{if(l!=null)return I8(n.getSectionChildren)?l[n.getSectionChildren]:n.getSectionChildren?.(l)};for(const l of n.dataSource){if(I8(l)||uat(l)){i.push({type:"item",rawValue:l,key:String(l),textValue:String(l),disabled:s(l),level:t,index:e}),e++;continue}if(a(l)!=null){i.push({type:"section",rawValue:l,key:"",textValue:"",disabled:!1,level:t,index:e}),e++;const c=a(l)??[];if(c.length>0){const d=Vrt({dataSource:c,getKey:n.getKey,getTextValue:n.getTextValue,getDisabled:n.getDisabled,getSectionChildren:n.getSectionChildren,startIndex:e,startLevel:t+1});i.push(...d),e+=d.length}}else i.push({type:"item",rawValue:l,key:r(l),textValue:o(l),disabled:s(l),level:t,index:e}),e++}return i}function Omi(n,e=[]){return J(()=>{const t=Vrt({dataSource:Ze(n.dataSource),getKey:Ze(n.getKey),getTextValue:Ze(n.getTextValue),getDisabled:Ze(n.getDisabled),getSectionChildren:Ze(n.getSectionChildren)});for(let i=0;i<e.length;i++)e[i]();return n.factory(t)})}var u0=class Hrt extends Set{anchorKey;currentKey;constructor(e,t,i){super(e),e instanceof Hrt?(this.anchorKey=t||e.anchorKey,this.currentKey=i||e.currentKey):(this.anchorKey=t,this.currentKey=i)}};function Vmi(n){const[e,t]=H_(n);return[()=>e()??new u0,t]}function $rt(n){return mat()?n.altKey:n.ctrlKey}function z8(n){return lse()?n.metaKey:n.ctrlKey}function QDe(n){return new u0(n)}function Hmi(n,e){if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0}function $mi(n){const e=Pn({selectionMode:"none",selectionBehavior:"toggle"},n),[t,i]=Ye(!1),[r,o]=Ye(),s=J(()=>{const g=Ze(e.selectedKeys);return g!=null?QDe(g):g}),a=J(()=>{const g=Ze(e.defaultSelectedKeys);return g!=null?QDe(g):new u0}),[l,c]=Vmi({value:s,defaultValue:a,onChange:g=>e.onSelectionChange?.(g)}),[d,u]=Ye(Ze(e.selectionBehavior)),h=()=>Ze(e.selectionMode),f=()=>Ze(e.disallowEmptySelection)??!1,p=g=>{(Ze(e.allowDuplicateSelectionEvents)||!Hmi(g,l()))&&c(g)};return Re(()=>{const g=l();Ze(e.selectionBehavior)==="replace"&&d()==="toggle"&&typeof g=="object"&&g.size===0&&u("replace")}),Re(()=>{u(Ze(e.selectionBehavior)??"toggle")}),{selectionMode:h,disallowEmptySelection:f,selectionBehavior:d,setSelectionBehavior:u,isFocused:t,setFocused:i,focusedKey:r,setFocusedKey:o,selectedKeys:l,setSelectedKeys:p}}function Fmi(n){const[e,t]=Ye(""),[i,r]=Ye(-1);return{typeSelectHandlers:{onKeyDown:s=>{if(Ze(n.isDisabled))return;const a=Ze(n.keyboardDelegate),l=Ze(n.selectionManager);if(!a.getKeyForSearch)return;const c=zmi(s.key);if(!c||s.ctrlKey||s.metaKey)return;c===" "&&e().trim().length>0&&(s.preventDefault(),s.stopPropagation());let d=t(h=>h+c),u=a.getKeyForSearch(d,l.focusedKey())??a.getKeyForSearch(d);u==null&&Bmi(d)&&(d=d[0],u=a.getKeyForSearch(d,l.focusedKey())??a.getKeyForSearch(d)),u!=null&&(l.setFocusedKey(u),n.onTypeSelect?.(u)),clearTimeout(i()),r(window.setTimeout(()=>t(""),500))}}}}function zmi(n){return n.length===1||!/^[A-Z]/i.test(n)?n:""}function Bmi(n){return n.split("").every(e=>e===n[0])}function jmi(n,e,t){const r=k({selectOnFocus:()=>Ze(n.selectionManager).selectionBehavior()==="replace"},n),o=()=>t?.()??e(),{direction:s}=m2();let a={top:0,left:0};oat(()=>Ze(r.isVirtualized)?void 0:o(),"scroll",()=>{const v=o();v&&(a={top:v.scrollTop,left:v.scrollLeft})});const{typeSelectHandlers:l}=Fmi({isDisabled:()=>Ze(r.disallowTypeAhead),keyboardDelegate:()=>Ze(r.keyboardDelegate),selectionManager:()=>Ze(r.selectionManager)}),c=()=>Ze(r.orientation)??"vertical",d=v=>{In(v,l.onKeyDown),v.altKey&&v.key==="Tab"&&v.preventDefault();const y=e();if(!y?.contains(v.target))return;const C=Ze(r.selectionManager),_=Ze(r.selectOnFocus),w=S=>{S!=null&&(C.setFocusedKey(S),v.shiftKey&&C.selectionMode()==="multiple"?C.extendSelection(S):_&&!$rt(v)&&C.replaceSelection(S))},x=Ze(r.keyboardDelegate),M=Ze(r.shouldFocusWrap),L=C.focusedKey();switch(v.key){case(c()==="vertical"?"ArrowDown":"ArrowRight"):{if(x.getKeyBelow){v.preventDefault();let S;L!=null?S=x.getKeyBelow(L):S=x.getFirstKey?.(),S==null&&M&&(S=x.getFirstKey?.(L)),w(S)}break}case(c()==="vertical"?"ArrowUp":"ArrowLeft"):{if(x.getKeyAbove){v.preventDefault();let S;L!=null?S=x.getKeyAbove(L):S=x.getLastKey?.(),S==null&&M&&(S=x.getLastKey?.(L)),w(S)}break}case(c()==="vertical"?"ArrowLeft":"ArrowUp"):{if(x.getKeyLeftOf){v.preventDefault();const S=s()==="rtl";let I;L!=null?I=x.getKeyLeftOf(L):I=S?x.getFirstKey?.():x.getLastKey?.(),w(I)}break}case(c()==="vertical"?"ArrowRight":"ArrowDown"):{if(x.getKeyRightOf){v.preventDefault();const S=s()==="rtl";let I;L!=null?I=x.getKeyRightOf(L):I=S?x.getLastKey?.():x.getFirstKey?.(),w(I)}break}case"Home":if(x.getFirstKey){v.preventDefault();const S=x.getFirstKey(L,z8(v));S!=null&&(C.setFocusedKey(S),z8(v)&&v.shiftKey&&C.selectionMode()==="multiple"?C.extendSelection(S):_&&C.replaceSelection(S))}break;case"End":if(x.getLastKey){v.preventDefault();const S=x.getLastKey(L,z8(v));S!=null&&(C.setFocusedKey(S),z8(v)&&v.shiftKey&&C.selectionMode()==="multiple"?C.extendSelection(S):_&&C.replaceSelection(S))}break;case"PageDown":if(x.getKeyPageBelow&&L!=null){v.preventDefault();const S=x.getKeyPageBelow(L);w(S)}break;case"PageUp":if(x.getKeyPageAbove&&L!=null){v.preventDefault();const S=x.getKeyPageAbove(L);w(S)}break;case"a":z8(v)&&C.selectionMode()==="multiple"&&Ze(r.disallowSelectAll)!==!0&&(v.preventDefault(),C.selectAll());break;case"Escape":v.defaultPrevented||(v.preventDefault(),Ze(r.disallowEmptySelection)||C.clearSelection());break;case"Tab":if(!Ze(r.allowsTabNavigation)){if(v.shiftKey)y.focus();else{const S=Lat(y,{tabbable:!0});let I,E;do E=S.lastChild(),E&&(I=E);while(E);I&&!I.contains(document.activeElement)&&Rs(I)}break}}},u=v=>{const y=Ze(r.selectionManager),C=Ze(r.keyboardDelegate),_=Ze(r.selectOnFocus);if(y.isFocused()){v.currentTarget.contains(v.target)||y.setFocused(!1);return}if(v.currentTarget.contains(v.target)){if(y.setFocused(!0),y.focusedKey()==null){const w=M=>{M!=null&&(y.setFocusedKey(M),_&&y.replaceSelection(M))},x=v.relatedTarget;x&&v.currentTarget.compareDocumentPosition(x)&Node.DOCUMENT_POSITION_FOLLOWING?w(y.lastSelectedKey()??C.getLastKey?.()):w(y.firstSelectedKey()??C.getFirstKey?.())}else if(!Ze(r.isVirtualized)){const w=o();if(w){w.scrollTop=a.top,w.scrollLeft=a.left;const x=w.querySelector(`[data-key="${y.focusedKey()}"]`);x&&(Rs(x),Jhe(w,x))}}}},h=v=>{const y=Ze(r.selectionManager);v.currentTarget.contains(v.relatedTarget)||y.setFocused(!1)},f=v=>{o()===v.target&&v.preventDefault()},p=()=>{const v=Ze(r.autoFocus);if(!v)return;const y=Ze(r.selectionManager),C=Ze(r.keyboardDelegate);let _;v==="first"&&(_=C.getFirstKey?.()),v==="last"&&(_=C.getLastKey?.());const w=y.selectedKeys();w.size&&(_=w.values().next().value),y.setFocused(!0),y.setFocusedKey(_);const x=e();x&&_==null&&!Ze(r.shouldUseVirtualFocus)&&Rs(x)};return ur(()=>{r.deferAutoFocus?setTimeout(p,0):p()}),Re(Mr([o,()=>Ze(r.isVirtualized),()=>Ze(r.selectionManager).focusedKey()],v=>{const[y,C,_]=v;if(C)_&&r.scrollToKey?.(_);else if(_&&y){const w=y.querySelector(`[data-key="${_}"]`);w&&Jhe(y,w)}})),{tabIndex:J(()=>{if(!Ze(r.shouldUseVirtualFocus))return Ze(r.selectionManager).focusedKey()==null?0:-1}),onKeyDown:d,onMouseDown:f,onFocusIn:u,onFocusOut:h}}function Frt(n,e){const t=()=>Ze(n.selectionManager),i=()=>Ze(n.key),r=()=>Ze(n.shouldUseVirtualFocus),o=C=>{t().selectionMode()!=="none"&&(t().selectionMode()==="single"?t().isSelected(i())&&!t().disallowEmptySelection()?t().toggleSelection(i()):t().replaceSelection(i()):C?.shiftKey?t().extendSelection(i()):t().selectionBehavior()==="toggle"||z8(C)||"pointerType"in C&&C.pointerType==="touch"?t().toggleSelection(i()):t().replaceSelection(i()))},s=()=>t().isSelected(i()),a=()=>Ze(n.disabled)||t().isDisabled(i()),l=()=>!a()&&t().canSelectItem(i());let c=null;const d=C=>{l()&&(c=C.pointerType,C.pointerType==="mouse"&&C.button===0&&!Ze(n.shouldSelectOnPressUp)&&o(C))},u=C=>{l()&&C.pointerType==="mouse"&&C.button===0&&Ze(n.shouldSelectOnPressUp)&&Ze(n.allowsDifferentPressOrigin)&&o(C)},h=C=>{l()&&(Ze(n.shouldSelectOnPressUp)&&!Ze(n.allowsDifferentPressOrigin)||c!=="mouse")&&o(C)},f=C=>{!l()||!["Enter"," "].includes(C.key)||($rt(C)?t().toggleSelection(i()):o(C))},p=C=>{a()&&C.preventDefault()},g=C=>{const _=e();r()||a()||!_||C.target===_&&t().setFocusedKey(i())},v=J(()=>{if(!(r()||a()))return i()===t().focusedKey()?0:-1}),y=J(()=>Ze(n.virtualized)?void 0:i());return Re(Mr([e,i,r,()=>t().focusedKey(),()=>t().isFocused()],([C,_,w,x,M])=>{C&&_===x&&M&&!w&&document.activeElement!==C&&(n.focus?n.focus():Rs(C))})),{isSelected:s,isDisabled:a,allowsSelection:l,tabIndex:v,dataKey:y,onPointerDown:d,onPointerUp:u,onClick:h,onKeyDown:f,onMouseDown:p,onFocus:g}}var Wmi=class{collection;state;constructor(n,e){this.collection=n,this.state=e}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(n){this.state.setSelectionBehavior(n)}isFocused(){return this.state.isFocused()}setFocused(n){this.state.setFocused(n)}focusedKey(){return this.state.focusedKey()}setFocusedKey(n){(n==null||this.collection().getItem(n))&&this.state.setFocusedKey(n)}selectedKeys(){return this.state.selectedKeys()}isSelected(n){if(this.state.selectionMode()==="none")return!1;const e=this.getKey(n);return e==null?!1:this.state.selectedKeys().has(e)}isEmpty(){return this.state.selectedKeys().size===0}isSelectAll(){if(this.isEmpty())return!1;const n=this.state.selectedKeys();return this.getAllSelectableKeys().every(e=>n.has(e))}firstSelectedKey(){let n;for(const e of this.state.selectedKeys()){const t=this.collection().getItem(e),i=t?.index!=null&&n?.index!=null&&t.index<n.index;(!n||i)&&(n=t)}return n?.key}lastSelectedKey(){let n;for(const e of this.state.selectedKeys()){const t=this.collection().getItem(e),i=t?.index!=null&&n?.index!=null&&t.index>n.index;(!n||i)&&(n=t)}return n?.key}extendSelection(n){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"){this.replaceSelection(n);return}const e=this.getKey(n);if(e==null)return;const t=this.state.selectedKeys(),i=t.anchorKey||e,r=new u0(t,i,e);for(const o of this.getKeyRange(i,t.currentKey||e))r.delete(o);for(const o of this.getKeyRange(e,i))this.canSelectItem(o)&&r.add(o);this.state.setSelectedKeys(r)}getKeyRange(n,e){const t=this.collection().getItem(n),i=this.collection().getItem(e);return t&&i?t.index!=null&&i.index!=null&&t.index<=i.index?this.getKeyRangeInternal(n,e):this.getKeyRangeInternal(e,n):[]}getKeyRangeInternal(n,e){const t=[];let i=n;for(;i!=null;){const r=this.collection().getItem(i);if(r&&r.type==="item"&&t.push(i),i===e)return t;i=this.collection().getKeyAfter(i)}return[]}getKey(n){const e=this.collection().getItem(n);return e?!e||e.type!=="item"?null:e.key:n}toggleSelection(n){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"&&!this.isSelected(n)){this.replaceSelection(n);return}const e=this.getKey(n);if(e==null)return;const t=new u0(this.state.selectedKeys());t.has(e)?t.delete(e):this.canSelectItem(e)&&(t.add(e),t.anchorKey=e,t.currentKey=e),!(this.disallowEmptySelection()&&t.size===0)&&this.state.setSelectedKeys(t)}replaceSelection(n){if(this.selectionMode()==="none")return;const e=this.getKey(n);if(e==null)return;const t=this.canSelectItem(e)?new u0([e],e,e):new u0;this.state.setSelectedKeys(t)}setSelectedKeys(n){if(this.selectionMode()==="none")return;const e=new u0;for(const t of n){const i=this.getKey(t);if(i!=null&&(e.add(i),this.selectionMode()==="single"))break}this.state.setSelectedKeys(e)}selectAll(){this.selectionMode()==="multiple"&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const n=this.state.selectedKeys();!this.disallowEmptySelection()&&n.size>0&&this.state.setSelectedKeys(new u0)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(n,e){this.selectionMode()!=="none"&&(this.selectionMode()==="single"?this.isSelected(n)&&!this.disallowEmptySelection()?this.toggleSelection(n):this.replaceSelection(n):this.selectionBehavior()==="toggle"||e&&e.pointerType==="touch"?this.toggleSelection(n):this.replaceSelection(n))}isSelectionEqual(n){if(n===this.state.selectedKeys())return!0;const e=this.selectedKeys();if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;for(const t of e)if(!n.has(t))return!1;return!0}canSelectItem(n){if(this.state.selectionMode()==="none")return!1;const e=this.collection().getItem(n);return e!=null&&!e.disabled}isDisabled(n){const e=this.collection().getItem(n);return!e||e.disabled}getAllSelectableKeys(){const n=[];return(t=>{for(;t!=null;){if(this.canSelectItem(t)){const i=this.collection().getItem(t);if(!i)continue;i.type==="item"&&n.push(t)}t=this.collection().getKeyAfter(t)}})(this.collection().getFirstKey()),n}},eRe=class{keyMap=new Map;iterable;firstKey;lastKey;constructor(n){this.iterable=n;for(const i of n)this.keyMap.set(i.key,i);if(this.keyMap.size===0)return;let e,t=0;for(const[i,r]of this.keyMap)e?(e.nextKey=i,r.prevKey=e.key):(this.firstKey=i,r.prevKey=void 0),r.type==="item"&&(r.index=t++),e=r,e.nextKey=void 0;this.lastKey=e.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(n){return this.keyMap.get(n)?.prevKey}getKeyAfter(n){return this.keyMap.get(n)?.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(n){return this.keyMap.get(n)}at(n){const e=[...this.getKeys()];return this.getItem(e[n])}};function qmi(n){const e=$mi(n),i=Omi({dataSource:()=>Ze(n.dataSource),getKey:()=>Ze(n.getKey),getTextValue:()=>Ze(n.getTextValue),getDisabled:()=>Ze(n.getDisabled),getSectionChildren:()=>Ze(n.getSectionChildren),factory:o=>n.filter?new eRe(n.filter(o)):new eRe(o)},[()=>n.filter]),r=new Wmi(i,e);return Gb(()=>{const o=e.focusedKey();o!=null&&!i().getItem(o)&&e.setFocusedKey(void 0)}),{collection:i,selectionManager:()=>r}}var Umi=class{collection;ref;collator;constructor(n,e,t){this.collection=n,this.ref=e,this.collator=t}getKeyBelow(n){let e=this.collection().getKeyAfter(n);for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyAfter(e)}}getKeyAbove(n){let e=this.collection().getKeyBefore(n);for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyBefore(e)}}getFirstKey(){let n=this.collection().getFirstKey();for(;n!=null;){const e=this.collection().getItem(n);if(e&&e.type==="item"&&!e.disabled)return n;n=this.collection().getKeyAfter(n)}}getLastKey(){let n=this.collection().getLastKey();for(;n!=null;){const e=this.collection().getItem(n);if(e&&e.type==="item"&&!e.disabled)return n;n=this.collection().getKeyBefore(n)}}getItem(n){return this.ref?.()?.querySelector(`[data-key="${n}"]`)??null}getKeyPageAbove(n){const e=this.ref?.();let t=this.getItem(n);if(!e||!t)return;const i=Math.max(0,t.offsetTop+t.offsetHeight-e.offsetHeight);let r=n;for(;r&&t&&t.offsetTop>i;)r=this.getKeyAbove(r),t=r!=null?this.getItem(r):null;return r}getKeyPageBelow(n){const e=this.ref?.();let t=this.getItem(n);if(!e||!t)return;const i=Math.min(e.scrollHeight,t.offsetTop-t.offsetHeight+e.offsetHeight);let r=n;for(;r&&t&&t.offsetTop<i;)r=this.getKeyBelow(r),t=r!=null?this.getItem(r):null;return r}getKeyForSearch(n,e){const t=this.collator?.();if(!t)return;let i=e!=null?this.getKeyBelow(e):this.getFirstKey();for(;i!=null;){const r=this.collection().getItem(i);if(r){const o=r.textValue.slice(0,n.length);if(r.textValue&&t.compare(o,n)===0)return i}i=this.getKeyBelow(i)}}};function Zmi(n,e,t){const i=Egi({usage:"search",sensitivity:"base"}),r=J(()=>{const o=Ze(n.keyboardDelegate);return o||new Umi(n.collection,e,i)});return jmi({selectionManager:()=>Ze(n.selectionManager),keyboardDelegate:r,autoFocus:()=>Ze(n.autoFocus),deferAutoFocus:()=>Ze(n.deferAutoFocus),shouldFocusWrap:()=>Ze(n.shouldFocusWrap),disallowEmptySelection:()=>Ze(n.disallowEmptySelection),selectOnFocus:()=>Ze(n.selectOnFocus),disallowTypeAhead:()=>Ze(n.disallowTypeAhead),shouldUseVirtualFocus:()=>Ze(n.shouldUseVirtualFocus),allowsTabNavigation:()=>Ze(n.allowsTabNavigation),isVirtualized:()=>Ze(n.isVirtualized),scrollToKey:o=>Ze(n.scrollToKey)?.(o),orientation:()=>Ze(n.orientation)},e,t)}var zrt=oi();function Brt(){return Wn(zrt)}function Kmi(){const n=Brt();if(n===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return n}function jrt(n,e){return!!(e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING)}function Gmi(n,e){const t=e.ref();if(!t)return-1;let i=n.length;if(!i)return-1;for(;i--;){const r=n[i]?.ref();if(r&&jrt(r,t))return i+1}return 0}function Xmi(n){const e=n.map((i,r)=>[r,i]);let t=!1;return e.sort(([i,r],[o,s])=>{const a=r.ref(),l=s.ref();return a===l||!a||!l?0:jrt(a,l)?(i>o&&(t=!0),-1):(i<o&&(t=!0),1)}),t?e.map(([i,r])=>r):n}function Wrt(n,e){const t=Xmi(n);n!==t&&e(t)}function Ymi(n){const e=n[0],t=n[n.length-1]?.ref();let i=e?.ref()?.parentElement;for(;i;){if(t&&i.contains(t))return i;i=i.parentElement}return Tl(i).body}function Jmi(n,e){Re(()=>{const t=setTimeout(()=>{Wrt(n(),e)});Oe(()=>clearTimeout(t))})}function Qmi(n,e){if(typeof IntersectionObserver!="function"){Jmi(n,e);return}let t=[];Re(()=>{const i=()=>{const s=!!t.length;t=n(),s&&Wrt(n(),e)},r=Ymi(n()),o=new IntersectionObserver(i,{root:r});for(const s of n()){const a=s.ref();a&&o.observe(a)}Oe(()=>o.disconnect())})}function e4i(n={}){const[e,t]=qat({value:()=>Ze(n.items),onChange:o=>n.onItemsChange?.(o)});Qmi(e,t);const i=o=>(t(s=>{const a=Gmi(s,o);return dat(s,o,a)}),()=>{t(s=>{const a=s.filter(l=>l.ref()!==o.ref());return s.length===a.length?s:a})});return{DomCollectionProvider:o=>m(zrt.Provider,{value:{registerItem:i},get children(){return o.children}})}}function t4i(n){const e=Kmi(),t=Pn({shouldRegisterItem:!0},n);Re(()=>{if(!t.shouldRegisterItem)return;const i=e.registerItem(t.getItem());Oe(i)})}function n4i(n={}){const[e,t]=FRe({value:()=>Ze(n.isSelected),defaultValue:()=>!!Ze(n.defaultIsSelected),onChange:o=>n.onSelectedChange?.(o)});return{isSelected:e,setIsSelected:o=>{!Ze(n.isReadOnly)&&!Ze(n.isDisabled)&&t(o)},toggle:()=>{!Ze(n.isReadOnly)&&!Ze(n.isDisabled)&&t(!e())}}}var i4i=oi();function Cce(){return Wn(i4i)}var r4i=oi();function qrt(){return Wn(r4i)}var Urt=oi();function Zrt(){return Wn(Urt)}function Ah(){const n=Zrt();if(n===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return n}var Krt=oi();function Lke(){const n=Wn(Krt);if(n===void 0)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return n}var Grt=oi();function td(){const n=Wn(Grt);if(n===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return n}function Ike(n){let e;const t=td(),i=Ah(),r=Pn({id:t.generateId(`item-${$s()}`)},n),[o,s]=Je(r,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=Ye(),[c,d]=Ye(),[u,h]=Ye(),f=()=>i.listState().selectionManager(),p=()=>s.id,g=()=>f().focusedKey()===p(),v=()=>{o.onSelect?.(),o.closeOnSelect&&setTimeout(()=>{i.close(!0)})};t4i({getItem:()=>({ref:()=>e,type:"item",key:p(),textValue:o.textValue??u()?.textContent??e?.textContent??"",disabled:o.disabled??!1})});const y=Frt({key:p,selectionManager:f,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>o.disabled},()=>e),C=I=>{In(I,o.onPointerMove),I.pointerType==="mouse"&&(o.disabled?i.onItemLeave(I):(i.onItemEnter(I),I.defaultPrevented||(Rs(I.currentTarget),i.listState().selectionManager().setFocused(!0),i.listState().selectionManager().setFocusedKey(p()))))},_=I=>{In(I,o.onPointerLeave),I.pointerType==="mouse"&&i.onItemLeave(I)},w=I=>{In(I,o.onPointerUp),!o.disabled&&I.button===0&&v()},x=I=>{if(In(I,o.onKeyDown),!I.repeat&&!o.disabled)switch(I.key){case"Enter":case" ":v();break}},M=J(()=>{if(o.indeterminate)return"mixed";if(o.checked!=null)return o.checked}),L=J(()=>({"data-indeterminate":o.indeterminate?"":void 0,"data-checked":o.checked&&!o.indeterminate?"":void 0,"data-disabled":o.disabled?"":void 0,"data-highlighted":g()?"":void 0})),S={isChecked:()=>o.checked,dataset:L,setLabelRef:h,generateId:bh(()=>s.id),registerLabel:Xa(l),registerDescription:Xa(d)};return m(Krt.Provider,{value:S,get children(){return m(zi,k({as:"div",ref(I){var E=qr(A=>e=A,o.ref);typeof E=="function"&&E(I)},get tabIndex(){return y.tabIndex()},get"aria-checked"(){return M()},get"aria-disabled"(){return o.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return y.dataKey()},get onPointerDown(){return hs([o.onPointerDown,y.onPointerDown])},get onPointerUp(){return hs([w,y.onPointerUp])},get onClick(){return hs([o.onClick,y.onClick])},get onKeyDown(){return hs([x,y.onKeyDown])},get onMouseDown(){return hs([o.onMouseDown,y.onMouseDown])},get onFocus(){return hs([o.onFocus,y.onFocus])},onPointerMove:C,onPointerLeave:_},L,s))}})}function bce(n){const e=Pn({closeOnSelect:!1},n),[t,i]=Je(e,["checked","defaultChecked","onChange","onSelect"]),r=n4i({isSelected:()=>t.checked,defaultIsSelected:()=>t.defaultChecked,onSelectedChange:s=>t.onChange?.(s),isDisabled:()=>i.disabled});return m(Ike,k({role:"menuitemcheckbox",get checked(){return r.isSelected()},onSelect:()=>{t.onSelect?.(),r.toggle()}},i))}var D_={next:(n,e)=>n==="ltr"?e==="horizontal"?"ArrowRight":"ArrowDown":e==="horizontal"?"ArrowLeft":"ArrowUp",previous:(n,e)=>D_.next(n==="ltr"?"rtl":"ltr",e)},tRe={first:n=>n==="horizontal"?"ArrowDown":"ArrowRight",last:n=>n==="horizontal"?"ArrowUp":"ArrowLeft"};function Xrt(n){const e=td(),t=Ah(),i=Cce(),{direction:r}=m2(),o=Pn({id:e.generateId("trigger")},n),[s,a]=Je(o,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let l=()=>e.value();i!==void 0&&(l=()=>e.value()??s.id,i.lastValue()===void 0&&i.setLastValue(l));const c=$_(()=>t.triggerRef(),()=>"button"),d=J(()=>c()==="a"&&t.triggerRef()?.getAttribute("href")!=null);Re(Mr(()=>i?.value(),y=>{d()&&y===l()&&t.triggerRef()?.focus()}));const u=()=>{i!==void 0?t.isOpen()?i.value()===l()&&i.closeMenu():(i.autoFocusMenu()||i.setAutoFocusMenu(!0),t.open(!1)):t.toggle(!0)},h=y=>{In(y,s.onPointerDown),y.currentTarget.dataset.pointerType=y.pointerType,!s.disabled&&y.pointerType!=="touch"&&y.button===0&&u()},f=y=>{In(y,s.onClick),s.disabled||y.currentTarget.dataset.pointerType==="touch"&&u()},p=y=>{if(In(y,s.onKeyDown),!s.disabled){if(d())switch(y.key){case"Enter":case" ":return}switch(y.key){case"Enter":case" ":case tRe.first(e.orientation()):y.stopPropagation(),y.preventDefault(),Eat(y.currentTarget),t.open("first"),i?.setAutoFocusMenu(!0),i?.setValue(l);break;case tRe.last(e.orientation()):y.stopPropagation(),y.preventDefault(),t.open("last");break;case D_.next(r(),e.orientation()):if(i===void 0)break;y.stopPropagation(),y.preventDefault(),i.nextMenu();break;case D_.previous(r(),e.orientation()):if(i===void 0)break;y.stopPropagation(),y.preventDefault(),i.previousMenu();break}}},g=y=>{In(y,s.onMouseOver),t.triggerRef()?.dataset.pointerType!=="touch"&&!s.disabled&&i!==void 0&&i.value()!==void 0&&i.setValue(l)},v=y=>{In(y,s.onFocus),i!==void 0&&y.currentTarget.dataset.pointerType!=="touch"&&i.setValue(l)};return Re(()=>Oe(t.registerTriggerId(s.id))),m(h3,k({ref(y){var C=qr(t.setTriggerRef,s.ref);typeof C=="function"&&C(y)},get"data-kb-menu-value-trigger"(){return e.value()},get id(){return s.id},get disabled(){return s.disabled},"aria-haspopup":"true",get"aria-expanded"(){return t.isOpen()},get"aria-controls"(){return sn(()=>!!t.isOpen())()?t.contentId():void 0},get"data-highlighted"(){return l()!==void 0&&i?.value()===l()?!0:void 0},get tabIndex(){return i!==void 0?i.value()===l()||i.lastValue()===l()?0:-1:void 0},onPointerDown:h,onMouseOver:g,onClick:f,onKeyDown:p,onFocus:v,role:i!==void 0?"menuitem":void 0},()=>t.dataset(),a))}function Yrt(n){let e;const t=td(),i=Ah(),r=Cce(),o=qrt(),{direction:s}=m2(),a=Pn({id:t.generateId(`content-${$s()}`)},n),[l,c]=Je(a,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let d=0;const u=()=>i.parentMenuContext()==null&&r===void 0&&t.isModal(),h=Zmi({selectionManager:i.listState().selectionManager,collection:i.listState().collection,autoFocus:i.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!i.listState().selectionManager().isFocused(),orientation:()=>t.orientation()==="horizontal"?"vertical":"horizontal"},()=>e);VRe({trapFocus:()=>u()&&i.isOpen(),onMountAutoFocus:_=>{r===void 0&&l.onOpenAutoFocus?.(_)},onUnmountAutoFocus:l.onCloseAutoFocus},()=>e);const f=_=>{if(ps(_.currentTarget,_.target)&&(_.key==="Tab"&&i.isOpen()&&_.preventDefault(),r!==void 0&&_.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(_.key){case D_.next(s(),t.orientation()):_.stopPropagation(),_.preventDefault(),i.close(!0),r.setAutoFocusMenu(!0),r.nextMenu();break;case D_.previous(s(),t.orientation()):if(_.currentTarget.hasAttribute("data-closed"))break;_.stopPropagation(),_.preventDefault(),i.close(!0),r.setAutoFocusMenu(!0),r.previousMenu();break}},p=_=>{l.onEscapeKeyDown?.(_),r?.setAutoFocusMenu(!1),i.close(!0)},g=_=>{l.onFocusOutside?.(_),t.isModal()&&_.preventDefault()},v=_=>{In(_,l.onPointerEnter),i.isOpen()&&(i.parentMenuContext()?.listState().selectionManager().setFocused(!1),i.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},y=_=>{if(In(_,l.onPointerMove),_.pointerType!=="mouse")return;const w=_.target,x=d!==_.clientX;ps(_.currentTarget,w)&&x&&(i.setPointerDir(_.clientX>d?"right":"left"),d=_.clientX)};Re(()=>Oe(i.registerContentId(l.id))),Oe(()=>i.setContentRef(void 0));const C={ref:qr(_=>{i.setContentRef(_),e=_},l.ref),role:"menu",get id(){return l.id},get tabIndex(){return h.tabIndex()},get"aria-labelledby"(){return i.triggerId()},onKeyDown:hs([l.onKeyDown,h.onKeyDown,f]),onMouseDown:hs([l.onMouseDown,h.onMouseDown]),onFocusIn:hs([l.onFocusIn,h.onFocusIn]),onFocusOut:hs([l.onFocusOut,h.onFocusOut]),onPointerEnter:v,onPointerMove:y,get"data-orientation"(){return t.orientation()}};return m(_e,{get when(){return i.contentPresent()},get children(){return m(_e,{get when(){return o===void 0||i.parentMenuContext()!=null},get fallback(){return m(zi,k({as:"div"},()=>i.dataset(),C,c))},get children(){return m(tk.Positioner,{get children(){return m(cse,k({get disableOutsidePointerEvents(){return sn(()=>!!u())()&&i.isOpen()},get excludedElements(){return[i.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return su({"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},l.style)},onEscapeKeyDown:p,onFocusOutside:g,get onDismiss(){return i.close}},()=>i.dataset(),C,c))}})}})}})}function Jrt(n){let e;const t=td(),i=Ah(),[r,o]=Je(n,["ref"]);return zRe({element:()=>e??null,enabled:()=>i.contentPresent()&&t.preventScroll()}),m(Yrt,k({ref(s){var a=qr(l=>{e=l},r.ref);typeof a=="function"&&a(s)}},o))}var Qrt=oi();function o4i(){const n=Wn(Qrt);if(n===void 0)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return n}function Qx(n){const e=td(),t=Pn({id:e.generateId(`group-${$s()}`)},n),[i,r]=Ye(),o={generateId:bh(()=>t.id),registerLabelId:Xa(r)};return m(Qrt.Provider,{value:o,get children(){return m(zi,k({as:"div",role:"group",get"aria-labelledby"(){return i()}},t))}})}function wce(n){const e=o4i(),t=Pn({id:e.generateId("label")},n),[i,r]=Je(t,["id"]);return Re(()=>Oe(e.registerLabelId(i.id))),m(zi,k({as:"span",get id(){return i.id},"aria-hidden":"true"},r))}function _ce(n){const e=Ah(),t=Pn({children:"▼"},n);return m(zi,k({as:"span","aria-hidden":"true"},()=>e.dataset(),t))}function xce(n){return m(Ike,k({role:"menuitem",closeOnSelect:!0},n))}function Sce(n){const e=Lke(),t=Pn({id:e.generateId("description")},n),[i,r]=Je(t,["id"]);return Re(()=>Oe(e.registerDescription(i.id))),m(zi,k({as:"div",get id(){return i.id}},()=>e.dataset(),r))}function Mce(n){const e=Lke(),t=Pn({id:e.generateId("indicator")},n),[i,r]=Je(t,["forceMount"]);return m(_e,{get when(){return i.forceMount||e.isChecked()},get children(){return m(zi,k({as:"div"},()=>e.dataset(),r))}})}function Lce(n){const e=Lke(),t=Pn({id:e.generateId("label")},n),[i,r]=Je(t,["ref","id"]);return Re(()=>Oe(e.registerLabel(i.id))),m(zi,k({as:"div",ref(o){var s=qr(e.setLabelRef,i.ref);typeof s=="function"&&s(o)},get id(){return i.id}},()=>e.dataset(),r))}function Ice(n){const e=Ah();return m(_e,{get when(){return e.contentPresent()},get children(){return m(d3,n)}})}var eot=oi();function s4i(){const n=Wn(eot);if(n===void 0)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return n}function Nce(n){const t=td().generateId(`radiogroup-${$s()}`),i=Pn({id:t},n),[r,o]=Je(i,["value","defaultValue","onChange","disabled"]),[s,a]=H_({value:()=>r.value,defaultValue:()=>r.defaultValue,onChange:c=>r.onChange?.(c)}),l={isDisabled:()=>r.disabled,isSelectedValue:c=>c===s(),setSelectedValue:c=>a(c)};return m(eot.Provider,{value:l,get children(){return m(Qx,o)}})}function Ece(n){const e=s4i(),t=Pn({closeOnSelect:!1},n),[i,r]=Je(t,["value","onSelect"]);return m(Ike,k({role:"menuitemradio",get checked(){return e.isSelectedValue(i.value)},onSelect:()=>{i.onSelect?.(),e.setSelectedValue(i.value)}},r))}function a4i(n,e,t){const i=n.split("-")[0],r=t.getBoundingClientRect(),o=[],s=e.clientX,a=e.clientY;switch(i){case"top":o.push([s,a+5]),o.push([r.left,r.bottom]),o.push([r.left,r.top]),o.push([r.right,r.top]),o.push([r.right,r.bottom]);break;case"right":o.push([s-5,a]),o.push([r.left,r.top]),o.push([r.right,r.top]),o.push([r.right,r.bottom]),o.push([r.left,r.bottom]);break;case"bottom":o.push([s,a-5]),o.push([r.right,r.top]),o.push([r.right,r.bottom]),o.push([r.left,r.bottom]),o.push([r.left,r.top]);break;case"left":o.push([s+5,a]),o.push([r.right,r.bottom]),o.push([r.left,r.bottom]),o.push([r.left,r.top]),o.push([r.right,r.top]);break}return o}function l4i(n,e){return e?C5e([n.clientX,n.clientY],e):!1}function tot(n){const e=td(),t=Brt(),i=Zrt(),r=Cce(),o=qrt(),s=Pn({placement:e.orientation()==="horizontal"?"bottom-start":"right-start"},n),[a,l]=Je(s,["open","defaultOpen","onOpenChange"]);let c=0,d=null,u="right";const[h,f]=Ye(),[p,g]=Ye(),[v,y]=Ye(),[C,_]=Ye(),[w,x]=Ye(!0),[M,L]=Ye(l.placement),[S,I]=Ye([]),[E,A]=Ye([]),{DomCollectionProvider:T}=e4i({items:E,onItemsChange:A}),D=u3({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:be=>a.onOpenChange?.(be)}),{present:R}=M6({show:()=>e.forceMount()||D.isOpen(),element:()=>C()??null}),P=qmi({selectionMode:"none",dataSource:E}),V=be=>{x(be),D.open()},$=(be=!1)=>{D.close(),be&&i&&i.close(!0)},j=be=>{x(be),D.toggle()},B=()=>{const be=C();be&&(Rs(be),P.selectionManager().setFocused(!0),P.selectionManager().setFocusedKey(void 0))},te=()=>{o!=null?setTimeout(()=>B()):B()},U=be=>{I(Ke=>[...Ke,be]);const Ve=i?.registerNestedMenu(be);return()=>{I(Ke=>Yhe(Ke,be)),Ve?.()}},Y=be=>u===d?.side&&l4i(be,d?.area),X=be=>{Y(be)&&be.preventDefault()},se=be=>{Y(be)||te()},pe=be=>{Y(be)&&be.preventDefault()};HRe({isDisabled:()=>!(i==null&&D.isOpen()&&e.isModal()),targets:()=>[C(),...S()].filter(Boolean)}),Re(()=>{const be=C();if(!be||!i)return;const Ve=i.registerNestedMenu(be);Oe(()=>{Ve()})}),Re(()=>{i===void 0&&r?.registerMenu(e.value(),[C(),...S()])}),Re(()=>{i!==void 0||r===void 0||(r.value()===e.value()?(v()?.focus(),r.autoFocusMenu()&&V(!0)):$())}),Re(()=>{i!==void 0||r===void 0||D.isOpen()&&r.setValue(e.value())}),Oe(()=>{i===void 0&&r?.unregisterMenu(e.value())});const Fe={dataset:J(()=>({"data-expanded":D.isOpen()?"":void 0,"data-closed":D.isOpen()?void 0:""})),isOpen:D.isOpen,contentPresent:R,nestedMenus:S,currentPlacement:M,pointerGraceTimeoutId:()=>c,autoFocus:w,listState:()=>P,parentMenuContext:()=>i,triggerRef:v,contentRef:C,triggerId:h,contentId:p,setTriggerRef:y,setContentRef:_,open:V,close:$,toggle:j,focusContent:te,onItemEnter:X,onItemLeave:se,onTriggerLeave:pe,setPointerDir:be=>u=be,setPointerGraceTimeoutId:be=>c=be,setPointerGraceIntent:be=>d=be,registerNestedMenu:U,registerItemToParentDomCollection:t?.registerItem,registerTriggerId:Xa(f),registerContentId:Xa(g)};return m(T,{get children(){return m(Urt.Provider,{value:Fe,get children(){return m(_e,{when:o===void 0,get fallback(){return l.children},get children(){return m(tk,k({anchorRef:v,contentRef:C,onCurrentPlacementChange:L},l))}})}})}})}function Tce(n){const{direction:e}=m2();return m(tot,k({get placement(){return e()==="rtl"?"left-start":"right-start"},flip:!0},n))}var c4i={close:(n,e)=>n==="ltr"?[e==="horizontal"?"ArrowLeft":"ArrowUp"]:[e==="horizontal"?"ArrowRight":"ArrowDown"]};function Ace(n){const e=Ah(),t=td(),[i,r]=Je(n,["onFocusOutside","onKeyDown"]),{direction:o}=m2();return m(Yrt,k({onOpenAutoFocus:d=>{d.preventDefault()},onCloseAutoFocus:d=>{d.preventDefault()},onFocusOutside:d=>{i.onFocusOutside?.(d);const u=d.target;ps(e.triggerRef(),u)||e.close()},onKeyDown:d=>{In(d,i.onKeyDown);const u=ps(d.currentTarget,d.target),h=c4i.close(o(),t.orientation()).includes(d.key),f=e.parentMenuContext()!=null;u&&h&&f&&(e.close(),Rs(e.triggerRef()))}},r))}var nRe=["Enter"," "],d4i={open:(n,e)=>n==="ltr"?[...nRe,e==="horizontal"?"ArrowRight":"ArrowDown"]:[...nRe,e==="horizontal"?"ArrowLeft":"ArrowUp"]};function Dce(n){let e;const t=td(),i=Ah(),r=Pn({id:t.generateId(`sub-trigger-${$s()}`)},n),[o,s]=Je(r,["ref","id","textValue","disabled","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);let a=null;const l=()=>{a&&window.clearTimeout(a),a=null},{direction:c}=m2(),d=()=>o.id,u=()=>{const _=i.parentMenuContext();if(_==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");return _.listState().selectionManager()},h=()=>i.listState().collection(),f=()=>u().focusedKey()===d(),p=Frt({key:d,selectionManager:u,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>o.disabled},()=>e),g=_=>{In(_,o.onClick),!i.isOpen()&&!o.disabled&&i.open(!0)},v=_=>{if(In(_,o.onPointerMove),_.pointerType!=="mouse")return;const w=i.parentMenuContext();if(w?.onItemEnter(_),!_.defaultPrevented){if(o.disabled){w?.onItemLeave(_);return}!i.isOpen()&&!a&&(i.parentMenuContext()?.setPointerGraceIntent(null),a=window.setTimeout(()=>{i.open(!1),l()},100)),w?.onItemEnter(_),_.defaultPrevented||(i.listState().selectionManager().isFocused()&&(i.listState().selectionManager().setFocused(!1),i.listState().selectionManager().setFocusedKey(void 0)),Rs(_.currentTarget),w?.listState().selectionManager().setFocused(!0),w?.listState().selectionManager().setFocusedKey(d()))}},y=_=>{if(In(_,o.onPointerLeave),_.pointerType!=="mouse")return;l();const w=i.parentMenuContext(),x=i.contentRef();if(x){w?.setPointerGraceIntent({area:a4i(i.currentPlacement(),_,x),side:i.currentPlacement().split("-")[0]}),window.clearTimeout(w?.pointerGraceTimeoutId());const M=window.setTimeout(()=>{w?.setPointerGraceIntent(null)},300);w?.setPointerGraceTimeoutId(M)}else{if(w?.onTriggerLeave(_),_.defaultPrevented)return;w?.setPointerGraceIntent(null)}w?.onItemLeave(_)},C=_=>{In(_,o.onKeyDown),!_.repeat&&(o.disabled||d4i.open(c(),t.orientation()).includes(_.key)&&(_.stopPropagation(),_.preventDefault(),u().setFocused(!1),u().setFocusedKey(void 0),i.isOpen()||i.open("first"),i.focusContent(),i.listState().selectionManager().setFocused(!0),i.listState().selectionManager().setFocusedKey(h().getFirstKey())))};return Re(()=>{if(i.registerItemToParentDomCollection==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");const _=i.registerItemToParentDomCollection({ref:()=>e,type:"item",key:d(),textValue:o.textValue??e?.textContent??"",disabled:o.disabled??!1});Oe(_)}),Re(Mr(()=>i.parentMenuContext()?.pointerGraceTimeoutId(),_=>{Oe(()=>{window.clearTimeout(_),i.parentMenuContext()?.setPointerGraceIntent(null)})})),Re(()=>Oe(i.registerTriggerId(o.id))),Oe(()=>{l()}),m(zi,k({as:"div",ref(_){var w=qr(x=>{i.setTriggerRef(x),e=x},o.ref);typeof w=="function"&&w(_)},get id(){return o.id},role:"menuitem",get tabIndex(){return p.tabIndex()},"aria-haspopup":"true",get"aria-expanded"(){return i.isOpen()},get"aria-controls"(){return sn(()=>!!i.isOpen())()?i.contentId():void 0},get"aria-disabled"(){return o.disabled},get"data-key"(){return p.dataKey()},get"data-highlighted"(){return f()?"":void 0},get"data-disabled"(){return o.disabled?"":void 0},get onPointerDown(){return hs([o.onPointerDown,p.onPointerDown])},get onPointerUp(){return hs([o.onPointerUp,p.onPointerUp])},get onClick(){return hs([g,p.onClick])},get onKeyDown(){return hs([C,p.onKeyDown])},get onMouseDown(){return hs([o.onMouseDown,p.onMouseDown])},get onFocus(){return hs([o.onFocus,p.onFocus])},onPointerMove:v,onPointerLeave:y},()=>i.dataset(),s))}function not(n){const e=Cce(),t=`menu-${$s()}`,i=Pn({id:t,modal:!0},n),[r,o]=Je(i,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),s=u3({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:l=>r.onOpenChange?.(l)}),a={isModal:()=>r.modal??!0,preventScroll:()=>r.preventScroll??a.isModal(),forceMount:()=>r.forceMount??!1,generateId:bh(()=>r.id),value:()=>r.value,orientation:()=>r.orientation??e?.orientation()??"horizontal"};return m(Grt.Provider,{value:a,get children(){return m(tot,k({get open(){return s.isOpen()},get onOpenChange(){return s.setIsOpen}},o))}})}var u4i={};au(u4i,{Root:()=>nk,Separator:()=>h4i});function nk(n){let e;const t=Pn({orientation:"horizontal"},n),[i,r]=Je(t,["ref","orientation"]),o=$_(()=>e,()=>"hr");return m(zi,k({as:"hr",ref(s){var a=qr(l=>e=l,i.ref);typeof a=="function"&&a(s)},get role(){return o()!=="hr"?"separator":void 0},get"aria-orientation"(){return i.orientation==="vertical"?"vertical":void 0},get"data-orientation"(){return i.orientation}},r))}var h4i=nk,f4i={};au(f4i,{Arrow:()=>y2,CheckboxItem:()=>bce,Content:()=>iot,DropdownMenu:()=>xs,Group:()=>Qx,GroupLabel:()=>wce,Icon:()=>_ce,Item:()=>xce,ItemDescription:()=>Sce,ItemIndicator:()=>Mce,ItemLabel:()=>Lce,Portal:()=>Ice,RadioGroup:()=>Nce,RadioItem:()=>Ece,Root:()=>rot,Separator:()=>nk,Sub:()=>Tce,SubContent:()=>Ace,SubTrigger:()=>Dce,Trigger:()=>Xrt});function iot(n){const e=td(),t=Ah(),[i,r]=Je(n,["onCloseAutoFocus","onInteractOutside"]);let o=!1;return m(Jrt,k({onCloseAutoFocus:l=>{i.onCloseAutoFocus?.(l),o||Rs(t.triggerRef()),o=!1,l.preventDefault()},onInteractOutside:l=>{i.onInteractOutside?.(l),(!e.isModal()||l.detail.isContextMenu)&&(o=!0)}},r))}function rot(n){const e=`dropdownmenu-${$s()}`,t=Pn({id:e},n);return m(not,t)}var xs=Object.assign(rot,{Arrow:y2,CheckboxItem:bce,Content:iot,Group:Qx,GroupLabel:wce,Icon:_ce,Item:xce,ItemDescription:Sce,ItemIndicator:Mce,ItemLabel:Lce,Portal:Ice,RadioGroup:Nce,RadioItem:Ece,Separator:nk,Sub:Tce,SubContent:Ace,SubTrigger:Dce,Trigger:Xrt});function p4i(n){return m(xs,k(n,{"data-component":"dropdown-menu"}))}function g4i(n){const[e,t]=Je(n,["class","classList","children"]);return m(xs.Trigger,k(t,{"data-slot":"dropdown-menu-trigger",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function m4i(n){const[e,t]=Je(n,["class","classList","children"]);return m(xs.Icon,k(t,{"data-slot":"dropdown-menu-icon",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function v4i(n){return m(xs.Portal,n)}function y4i(n){const[e,t]=Je(n,["class","classList","children"]);return m(xs.Content,k(t,{"data-component":"dropdown-menu-content",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function k4i(n){const[e,t]=Je(n,["class","classList"]);return m(xs.Arrow,k(t,{"data-slot":"dropdown-menu-arrow",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}}}))}function C4i(n){const[e,t]=Je(n,["class","classList"]);return m(xs.Separator,k(t,{"data-slot":"dropdown-menu-separator",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}}}))}function b4i(n){const[e,t]=Je(n,["class","classList","children"]);return m(xs.Group,k(t,{"data-slot":"dropdown-menu-group",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function w4i(n){const[e,t]=Je(n,["class","classList","children"]);return m(xs.GroupLabel,k(t,{"data-slot":"dropdown-menu-group-label",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function _4i(n){const[e,t]=Je(n,["class","classList","children"]);return m(xs.Item,k(t,{"data-slot":"dropdown-menu-item",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function x4i(n){const[e,t]=Je(n,["class","classList","children"]);return m(xs.ItemLabel,k(t,{"data-slot":"dropdown-menu-item-label",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function S4i(n){const[e,t]=Je(n,["class","classList","children"]);return m(xs.ItemDescription,k(t,{"data-slot":"dropdown-menu-item-description",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function M4i(n){const[e,t]=Je(n,["class","classList","children"]);return m(xs.ItemIndicator,k(t,{"data-slot":"dropdown-menu-item-indicator",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function L4i(n){const[e,t]=Je(n,["class","classList","children"]);return m(xs.RadioGroup,k(t,{"data-slot":"dropdown-menu-radio-group",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function I4i(n){const[e,t]=Je(n,["class","classList","children"]);return m(xs.RadioItem,k(t,{"data-slot":"dropdown-menu-radio-item",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function N4i(n){const[e,t]=Je(n,["class","classList","children"]);return m(xs.CheckboxItem,k(t,{"data-slot":"dropdown-menu-checkbox-item",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function E4i(n){return m(xs.Sub,n)}function T4i(n){const[e,t]=Je(n,["class","classList","children"]);return m(xs.SubTrigger,k(t,{"data-slot":"dropdown-menu-sub-trigger",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function A4i(n){const[e,t]=Je(n,["class","classList","children"]);return m(xs.SubContent,k(t,{"data-component":"dropdown-menu-sub-content",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}const Un=Object.assign(p4i,{Trigger:g4i,Icon:m4i,Portal:v4i,Content:y4i,Arrow:k4i,Separator:C4i,Group:b4i,GroupLabel:w4i,Item:_4i,ItemLabel:x4i,ItemDescription:S4i,ItemIndicator:M4i,RadioGroup:L4i,RadioItem:I4i,CheckboxItem:N4i,Sub:E4i,SubTrigger:T4i,SubContent:A4i});var D4i=le("<div>"),Rce=class{x;y;width;height;constructor(e){this.x=Math.floor(e.x),this.y=Math.floor(e.y),this.width=Math.floor(e.width),this.height=Math.floor(e.height)}get rect(){return{x:this.x,y:this.y,width:this.width,height:this.height}}get left(){return this.x}get top(){return this.y}get right(){return this.x+this.width}get bottom(){return this.y+this.height}get center(){return{x:this.x+this.width*.5,y:this.y+this.height*.5}}get corners(){return{topLeft:{x:this.left,y:this.top},topRight:{x:this.right,y:this.top},bottomRight:{x:this.left,y:this.bottom},bottomLeft:{x:this.right,y:this.bottom}}}},av=n=>{let e=new Rce(n.getBoundingClientRect());const{transform:t}=getComputedStyle(n);return t&&(e=R4i(e,t)),e},R4i=(n,e)=>{let t,i;if(e.startsWith("matrix3d(")){const r=e.slice(9,-1).split(/, /);t=+r[12],i=+r[13]}else if(e.startsWith("matrix(")){const r=e.slice(7,-1).split(/, /);t=+r[4],i=+r[5]}else t=0,i=0;return new Rce({...n,x:n.x-t,y:n.y-i})},Vd=()=>({x:0,y:0}),Nke=(n,e)=>n.x===e.x&&n.y===e.y,jhe=(n,e)=>new Rce({...n,x:n.x+e.x,y:n.y+e.y}),P4i=(n,e)=>Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2)),O4i=(n,e)=>{const t=Math.max(n.top,e.top),i=Math.max(n.left,e.left),r=Math.min(n.right,e.right),o=Math.min(n.bottom,e.bottom),s=r-i,a=o-t;if(i<r&&t<o){const l=n.width*n.height,c=e.width*e.height,d=s*a;return d/(l+c-d)}return 0},Whe=(n,e)=>n.x===e.x&&n.y===e.y&&n.width===e.width&&n.height===e.height,oot=(n,e,t)=>{const i=n.transformed.center,r={distance:1/0,droppable:null};for(const o of e){const s=P4i(i,o.layout.center);s<r.distance?(r.distance=s,r.droppable=o):s===r.distance&&o.id===t.activeDroppableId&&(r.droppable=o)}return r.droppable},V4i=(n,e,t)=>{const i=n.transformed,r={ratio:0,droppable:null};for(const o of e){const s=O4i(i,o.layout);s>r.ratio?(r.ratio=s,r.droppable=o):s>0&&s===r.ratio&&o.id===t.activeDroppableId&&(r.droppable=o)}return r.droppable},sot=oi(),aot=n=>{const e=k({collisionDetector:V4i},n),[t,i]=Yt({draggables:{},droppables:{},sensors:{},active:{draggableId:null,get draggable(){return t.active.draggableId!==null?t.draggables[t.active.draggableId]:null},droppableId:null,get droppable(){return t.active.droppableId!==null?t.droppables[t.active.droppableId]:null},sensorId:null,get sensor(){return t.active.sensorId!==null?t.sensors[t.active.sensorId]:null},overlay:null}}),r=(R,P,V)=>{R.substring(0,R.length-1),Mn(()=>t[R][P])&&i(R,P,"transformers",V.id,V)},o=(R,P,V)=>{R.substring(0,R.length-1),Mn(()=>t[R][P])&&Mn(()=>t[R][P].transformers[V])&&i(R,P,"transformers",V,void 0)},s=({id:R,node:P,layout:V,data:$})=>{const j=t.draggables[R],B={id:R,node:P,layout:V,data:$,_pendingCleanup:!1};let te;if(!j)Object.defineProperties(B,{transformers:{enumerable:!0,configurable:!0,writable:!0,value:{}},transform:{enumerable:!0,configurable:!0,get:()=>{if(t.active.overlay)return Vd();const U=Object.values(t.draggables[R].transformers);return U.sort((Y,X)=>Y.order-X.order),U.reduce((Y,X)=>X.callback(Y),Vd())}},transformed:{enumerable:!0,configurable:!0,get:()=>jhe(t.draggables[R].layout,t.draggables[R].transform)}});else if(t.active.draggableId===R&&!t.active.overlay){const U={x:j.layout.x-V.x,y:j.layout.y-V.y},Y="addDraggable-existing-offset",X=j.transformers[Y],se=X?X.callback(U):U;te={id:Y,order:100,callback:pe=>({x:pe.x+se.x,y:pe.y+se.y})},A(()=>o("draggables",R,Y))}pn(()=>{i("draggables",R,B),te&&r("draggables",R,te)}),t.active.draggable&&w()},a=R=>{Mn(()=>t.draggables[R])&&(i("draggables",R,"_pendingCleanup",!0),queueMicrotask(()=>l(R)))},l=R=>{if(t.draggables[R]?._pendingCleanup){const P=t.active.draggableId===R;pn(()=>{P&&i("active","draggableId",null),i("draggables",R,void 0)})}},c=({id:R,node:P,layout:V,data:$})=>{const j=t.droppables[R],B={id:R,node:P,layout:V,data:$,_pendingCleanup:!1};j||Object.defineProperties(B,{transformers:{enumerable:!0,configurable:!0,writable:!0,value:{}},transform:{enumerable:!0,configurable:!0,get:()=>{const te=Object.values(t.droppables[R].transformers);return te.sort((U,Y)=>U.order-Y.order),te.reduce((U,Y)=>Y.callback(U),Vd())}},transformed:{enumerable:!0,configurable:!0,get:()=>jhe(t.droppables[R].layout,t.droppables[R].transform)}}),i("droppables",R,B),t.active.draggable&&w()},d=R=>{Mn(()=>t.droppables[R])&&(i("droppables",R,"_pendingCleanup",!0),queueMicrotask(()=>u(R)))},u=R=>{if(t.droppables[R]?._pendingCleanup){const P=t.active.droppableId===R;pn(()=>{P&&i("active","droppableId",null),i("droppables",R,void 0)})}},h=({id:R,activators:P})=>{i("sensors",R,{id:R,activators:P,coordinates:{origin:{x:0,y:0},current:{x:0,y:0},get delta(){return{x:t.sensors[R].coordinates.current.x-t.sensors[R].coordinates.origin.x,y:t.sensors[R].coordinates.current.y-t.sensors[R].coordinates.origin.y}}}})},f=R=>{if(!Mn(()=>t.sensors[R]))return;const P=t.active.sensorId===R;pn(()=>{P&&i("active","sensorId",null),i("sensors",R,void 0)})},p=({node:R,layout:P})=>{const V=t.active.overlay,$={node:R,layout:P};V||Object.defineProperties($,{id:{enumerable:!0,configurable:!0,get:()=>t.active.draggable?.id},data:{enumerable:!0,configurable:!0,get:()=>t.active.draggable?.data},transformers:{enumerable:!0,configurable:!0,get:()=>Object.fromEntries(Object.entries(t.active.draggable?t.active.draggable.transformers:{}).filter(([j])=>j!=="addDraggable-existing-offset"))},transform:{enumerable:!0,configurable:!0,get:()=>{const j=Object.values(t.active.overlay?t.active.overlay.transformers:[]);return j.sort((B,te)=>B.order-te.order),j.reduce((B,te)=>te.callback(B),Vd())}},transformed:{enumerable:!0,configurable:!0,get:()=>t.active.overlay?jhe(t.active.overlay.layout,t.active.overlay.transform):new Rce({x:0,y:0,width:0,height:0})}}),i("active","overlay",$)},g=()=>i("active","overlay",null),v=(R,P)=>{pn(()=>{i("sensors",R,"coordinates",{origin:{...P},current:{...P}}),i("active","sensorId",R)})},y=R=>{const P=t.active.sensorId;P&&i("sensors",P,"coordinates","current",{...R})},C=()=>i("active","sensorId",null),_=(R,P)=>{const V={};for(const j of Object.values(t.sensors))if(j)for(const[B,te]of Object.entries(j.activators))V[B]??=[],V[B].push({sensor:j,activator:te});const $={};for(const j in V){let B=j;P&&(B=`on${j}`),$[B]=te=>{for(const{activator:U}of V[j]){if(t.active.sensor)break;U(te,R)}}}return $},w=()=>{let R=!1;const P=Object.values(t.draggables),V=Object.values(t.droppables),$=t.active.overlay;return pn(()=>{const j=new WeakMap;for(const B of P)if(B){const te=B.layout;j.has(B.node)||j.set(B.node,av(B.node));const U=j.get(B.node);Whe(te,U)||(i("draggables",B.id,"layout",U),R=!0)}for(const B of V)if(B){const te=B.layout;j.has(B.node)||j.set(B.node,av(B.node));const U=j.get(B.node);Whe(te,U)||(i("droppables",B.id,"layout",U),R=!0)}if($){const B=$.layout,te=av($.node);Whe(B,te)||(i("active","overlay","layout",te),R=!0)}}),R},x=()=>{const R=t.active.overlay??t.active.draggable;if(R){const P=e.collisionDetector(R,Object.values(t.droppables),{activeDroppableId:t.active.droppableId}),V=P?P.id:null;t.active.droppableId!==V&&i("active","droppableId",V)}},M=R=>{const P={id:"sensorMove",order:0,callback:V=>t.active.sensor?{x:V.x+t.active.sensor.coordinates.delta.x,y:V.y+t.active.sensor.coordinates.delta.y}:V};w(),pn(()=>{i("active","draggableId",R),r("draggables",R,P)}),x()},L=()=>{const R=Mn(()=>t.active.draggableId);pn(()=>{R!==null&&o("draggables",R,"sensorMove"),i("active",["draggableId","droppableId"],null)}),w()},S=R=>{Re(()=>{const P=t.active.draggable;P&&Mn(()=>R({draggable:P}))})},I=R=>{Re(()=>{const P=t.active.draggable;if(P){const V=Mn(()=>t.active.overlay);Object.values(V?V.transform:P.transform),Mn(()=>R({draggable:P,overlay:V}))}})},E=R=>{Re(()=>{const P=t.active.draggable,V=t.active.droppable;P&&Mn(()=>R({draggable:P,droppable:V,overlay:t.active.overlay}))})},A=R=>{Re(({previousDraggable:P,previousDroppable:V,previousOverlay:$})=>{const j=t.active.draggable,B=j?t.active.droppable:null,te=j?t.active.overlay:null;return!j&&P&&Mn(()=>R({draggable:P,droppable:V,overlay:$})),{previousDraggable:j,previousDroppable:B,previousOverlay:te}},{previousDraggable:null,previousDroppable:null,previousOverlay:null})};I(()=>x()),e.onDragStart&&S(e.onDragStart),e.onDragMove&&I(e.onDragMove),e.onDragOver&&E(e.onDragOver),e.onDragEnd&&A(e.onDragEnd);const D=[t,{addTransformer:r,removeTransformer:o,addDraggable:s,removeDraggable:a,addDroppable:c,removeDroppable:d,addSensor:h,removeSensor:f,setOverlay:p,clearOverlay:g,recomputeLayouts:w,detectCollisions:x,draggableActivators:_,sensorStart:v,sensorMove:y,sensorEnd:C,dragStart:M,dragEnd:L,onDragStart:S,onDragMove:I,onDragOver:E,onDragEnd:A}];return m(sot.Provider,{value:D,get children(){return e.children}})},W3=()=>Wn(sot)||null,H4i=(n="pointer-sensor")=>{const[e,{addSensor:t,removeSensor:i,sensorStart:r,sensorMove:o,sensorEnd:s,dragStart:a,dragEnd:l}]=W3(),c=250,d=10;ur(()=>{t({id:n,activators:{pointerdown:g}})}),Oe(()=>{i(n)});const u=()=>e.active.sensorId===n,h={x:0,y:0};let f=null,p=null;const g=(x,M)=>{x.button===0&&(document.addEventListener("pointermove",C),document.addEventListener("pointerup",_),p=M,h.x=x.clientX,h.y=x.clientY,f=window.setTimeout(y,c))},v=()=>{f&&(clearTimeout(f),f=null),document.removeEventListener("pointermove",C),document.removeEventListener("pointerup",_),document.removeEventListener("selectionchange",w)},y=()=>{e.active.sensor?u()||v():(r(n,h),a(p),w(),document.addEventListener("selectionchange",w))},C=x=>{const M={x:x.clientX,y:x.clientY};if(!e.active.sensor){const L={x:M.x-h.x,y:M.y-h.y};Math.sqrt(L.x**2+L.y**2)>d&&y()}u()&&(x.preventDefault(),o(M))},_=x=>{v(),u()&&(x.preventDefault(),l(),s())},w=()=>{window.getSelection()?.removeAllRanges()}},lot=n=>(H4i(),sn(()=>n.children)),Pce=n=>({transform:`translate3d(${n.x}px, ${n.y}px, 0)`}),$4i=(n,e={})=>{const[t,{addDraggable:i,removeDraggable:r,draggableActivators:o}]=W3(),[s,a]=Ye(null);ur(()=>{const u=s();u&&i({id:n,node:u,layout:av(u),data:e})}),Oe(()=>r(n));const l=()=>t.active.draggableId===n,c=()=>t.draggables[n]?.transform||Vd();return Object.defineProperties((u,h)=>{const f=h?h():{};Re(()=>{const p=s(),g=o(n);if(p)for(const v in g)p.addEventListener(v,g[v]);Oe(()=>{if(p)for(const v in g)p.removeEventListener(v,g[v])})}),a(u),f.skipTransform||Re(()=>{const p=c();if(Nke(p,Vd()))u.style.removeProperty("transform");else{const g=Pce(c());u.style.setProperty("transform",g.transform??null)}})},{ref:{enumerable:!0,value:a},isActiveDraggable:{enumerable:!0,get:l},dragActivators:{enumerable:!0,get:()=>o(n,!0)},transform:{enumerable:!0,get:c}})},F4i=(n,e={})=>{const[t,{addDroppable:i,removeDroppable:r}]=W3(),[o,s]=Ye(null);ur(()=>{const d=o();d&&i({id:n,node:d,layout:av(d),data:e})}),Oe(()=>r(n));const a=()=>t.active.droppableId===n,l=()=>t.droppables[n]?.transform||Vd();return Object.defineProperties((d,u)=>{const h=u?u():{};s(d),h.skipTransform||Re(()=>{const f=l();if(Nke(f,Vd()))d.style.removeProperty("transform");else{const p=Pce(l());d.style.setProperty("transform",p.transform??null)}})},{ref:{enumerable:!0,value:s},isActiveDroppable:{enumerable:!0,get:a},transform:{enumerable:!0,get:l}})},cot=n=>{const[e,{onDragStart:t,onDragEnd:i,setOverlay:r,clearOverlay:o}]=W3();let s;t(({draggable:l})=>{r({node:l.node,layout:l.layout}),queueMicrotask(()=>{if(s){const c=av(s),d={x:(l.layout.width-c.width)/2,y:(l.layout.height-c.height)/2};c.x+=d.x,c.y+=d.y,r({node:s,layout:c})}})}),i(()=>queueMicrotask(o));const a=()=>{const l=e.active.overlay,c=e.active.draggable;return!l||!c?{}:{position:"fixed",transition:"transform 0s",top:`${l.layout.top}px`,left:`${l.layout.left}px`,"min-width":`${c.layout.width}px`,"min-height":`${c.layout.height}px`,...Pce(l.transform),...n.style}};return m(d3,{get mount(){return document.body},get children(){return m(_e,{get when(){return e.active.draggable},get children(){var l=D4i(),c=s;return typeof c=="function"?aa(c,l):s=l,W(l,(()=>{var d=sn(()=>typeof n.children=="function");return()=>d()?n.children(e.active.draggable):n.children})()),st(d=>{var u=n.class,h=a();return u!==d.e&&H1(l,d.e=u),d.t=sse(l,h,d.t),d},{e:void 0,t:void 0}),l}})}})},z4i=(n,e,t)=>{const i=n.slice();return i.splice(t,0,...i.splice(e,1)),i},dot=oi(),uot=n=>{const[e]=W3(),[t,i]=Yt({initialIds:[],sortedIds:[]}),r=a=>a>=0&&a<t.initialIds.length;Re(()=>{i("initialIds",[...n.ids]),i("sortedIds",[...n.ids])}),Re(()=>{e.active.draggableId&&e.active.droppableId?Mn(()=>{const a=t.sortedIds.indexOf(e.active.draggableId),l=t.initialIds.indexOf(e.active.droppableId);if(!r(a)||!r(l))i("sortedIds",[...n.ids]);else if(a!==l){const c=z4i(t.sortedIds,a,l);i("sortedIds",c)}}):i("sortedIds",[...n.ids])});const s=[t,{}];return m(dot.Provider,{value:s,get children(){return n.children}})},B4i=()=>Wn(dot)||null,j4i=(n,e)=>t=>{n(t),e(t)},hot=(n,e={})=>{const[t,{addTransformer:i,removeTransformer:r}]=W3(),[o]=B4i(),s=$4i(n,e),a=F4i(n,e),l=j4i(s.ref,a.ref),c=()=>o.initialIds.indexOf(n),d=()=>o.sortedIds.indexOf(n),u=v=>t.droppables[v]?.layout||null,h=()=>{const v=Vd(),y=c(),C=d();if(C!==y){const _=u(n),w=u(o.initialIds[C]);_&&w&&(v.x=w.x-_.x,v.y=w.y-_.y)}return v},f={id:"sortableOffset",order:100,callback:v=>{const y=h();return{x:v.x+y.x,y:v.y+y.y}}};ur(()=>i("droppables",n,f)),Oe(()=>r("droppables",n,f.id));const p=()=>(n===t.active.draggableId&&!t.active.overlay?t.draggables[n]?.transform:t.droppables[n]?.transform)||Vd();return Object.defineProperties(v=>{s(v,()=>({skipTransform:!0})),a(v,()=>({skipTransform:!0})),Re(()=>{const y=p();if(Nke(y,Vd()))v.style.removeProperty("transform");else{const C=Pce(p());v.style.setProperty("transform",C.transform??null)}})},{ref:{enumerable:!0,value:l},transform:{enumerable:!0,get:p},isActiveDraggable:{enumerable:!0,get:()=>s.isActiveDraggable},dragActivators:{enumerable:!0,get:()=>s.dragActivators},isActiveDroppable:{enumerable:!0,get:()=>a.isActiveDroppable}})};function W4i(n){const e={locs:[],timer:void 0,pending:void 0,over:void 0,last:void 0},t=n.delay??250,i=n.max??4,r=n.tolerance??80,o=n.edge??18,s=()=>{e.timer!==void 0&&clearTimeout(e.timer),e.timer=void 0,e.pending=void 0},a=()=>{s(),e.over=void 0,e.last=void 0,e.locs.length=0},l=p=>{if(!n.enabled())return;const g=n.el();if(!g)return;const v=g.getBoundingClientRect(),y=p.clientX,C=p.clientY;y<v.left||y>v.right||C<v.top||C>v.bottom||(e.locs.push({x:y,y:C}),e.locs.length>i&&e.locs.shift())},c=()=>{if(!n.enabled()||!n.active())return 0;const p=n.el();if(!p||e.locs.length<2)return 0;const g=p.getBoundingClientRect(),v=e.locs[e.locs.length-1];if(!v)return 0;const y=e.locs[0]??v;if(y.x<g.left||y.x>g.right||y.y<g.top||y.y>g.bottom||e.last&&v.x===e.last.x&&v.y===e.last.y)return 0;if(g.right-v.x<=o)return e.last=v,t;const C={x:g.right,y:g.top-r},_={x:g.right,y:g.bottom+r},w=(I,E)=>(E.y-I.y)/(E.x-I.x),x=w(v,C),M=w(v,_),L=w(y,C),S=w(y,_);return x<L&&M>S?(e.last=v,t):(e.last=void 0,0)},d=p=>{s(),n.onActivate(p)},u=p=>{if(!p||n.active()===p)return;if(!n.active()){d(p);return}const g=c();if(g===0){d(p);return}s(),e.pending=p,e.timer=window.setTimeout(()=>{e.timer=void 0,e.pending===p&&(e.pending=void 0,n.enabled()&&n.active()&&e.over===p&&n.onActivate(p))},g)};return{move:l,enter:(p,g)=>{n.enabled()&&(e.over=p,l(g),u(p))},leave:p=>{e.over===p&&(e.over=void 0),e.pending===p&&s()},activate:d,request:u,cancel:s,reset:a}}let u5e;const q4i=n=>{u5e=n},U4i=n=>{if(window.focus(),!!n){if(u5e)return u5e(n);console.warn("notification-click: navigate function not set, falling back to window.location.assign"),window.location.assign(n)}},iC=n=>n.replace(/[\\/]+$/,""),M8=new Map,L8=new Map;function Z4i(){const n={resolve:t=>{}};return{promise:new Promise(t=>{n.resolve=t}),resolve:n.resolve}}const EL={get(n){return M8.get(iC(n))},pending(n){const e=iC(n),t=M8.get(e);t&&t.status!=="pending"||M8.set(e,{status:"pending"})},ready(n){const e=iC(n),t={status:"ready"};M8.set(e,t);const i=L8.get(e);i&&(L8.delete(e),i.resolve(t))},failed(n,e){const t=iC(n),i={status:"failed",message:e};M8.set(t,i);const r=L8.get(t);r&&(L8.delete(t),r.resolve(i))},wait(n){const e=iC(n),t=M8.get(e);if(t&&t.status!=="pending")return Promise.resolve(t);const i=L8.get(e);if(i)return i.promise;const r=Z4i();return L8.set(e,r),r.promise}},K4i=40,R_={session:new Map,terminal:new Map},fot=(n,e,t)=>{for(n.delete(e),n.set(e,t);n.size>K4i;){const i=n.keys().next().value;if(i===void 0)return;n.delete(i)}},G4i=(n,e)=>{const t=R_.session.get(n)??{prompt:"",files:{}};fot(R_.session,n,{...t,...e})},cyi=n=>R_.session.get(n),dyi=(n,e)=>{fot(R_.terminal,n,e)},uyi=n=>R_.terminal.get(n),X4i=n=>typeof n!="object"||n===null?!1:"draggable"in n,tse=n=>{if(!X4i(n))return;const e=n.draggable;if(e)return typeof e.id=="string"?e.id:void 0},Y4i=(n,e)=>({id:n,order:100,callback:t=>e==="x"?{...t,x:0}:{...t,y:0}}),pot=(n,e)=>()=>{const t=W3();if(!t)return null;const[,{onDragStart:i,onDragEnd:r,addTransformer:o,removeTransformer:s}]=t,a=Y4i(e,n),l=sa(c=>(i(d=>{const u=tse(d);u&&o("draggables",u,a)}),r(d=>{const u=tse(d);u&&s("draggables",u,a.id)}),c));return Oe(l),null},got=pot("x","constrain-x-axis"),hyi=pot("y","constrain-y-axis"),Eke=100;function J4i(n,e,t=Eke){if(!n.stack.length){const r=e==="/"?["/"]:["/",e];return{stack:r,index:r.length-1,action:void 0}}const i=n.stack[n.index];return e===i?n.action?{...n,action:void 0}:n:n.action?{...n,action:void 0}:Q4i(n,e,t)}function Q4i(n,e,t=Eke){const i=n.stack.slice(0,n.index+1).concat(e),r=e5i(i,i.length-1,t);return{...n,...r,action:void 0}}function e5i(n,e,t=Eke){if(n.length<=t)return{stack:n,index:e};const i=n.length-t;return{stack:n.slice(i),index:Math.max(0,e-i)}}function t5i(n){if(n.index<=0)return;const e=n.index-1,t=n.stack[e];if(t)return{state:{...n,index:e,action:"back"},to:t}}function n5i(n){if(n.index>=n.stack.length-1)return;const e=n.index+1,t=n.stack[e];if(t)return{state:{...n,index:e,action:"forward"},to:t}}function i5i(){const n=kMn(),e=_3(),t=()=>n?.agent.current()?.name;return m(oa,{icon:"bot",size:"small",get variant(){return e.session.opened()?"primary":"ghost"},class:"w-6 h-6 rounded-full shrink-0 transition-colors",get classList(){return{"bg-surface-raised-base text-text-base shadow-[0_0_0_1px_var(--border-base)]":e.session.opened(),"text-icon-weak hover:text-icon-base hover:bg-surface-base":!e.session.opened()}},get title(){return sn(()=>!!t())()?`${t()} mode`:"No agent active"},onClick:()=>e.session.toggle()})}var r5i=le('<div class="h-full shrink-0">'),o5i=le('<div class="hidden w-8 shrink-0 items-center justify-center lg:flex sm:w-10 xl:hidden">'),s5i=le('<div class="hidden w-8 shrink-0 items-center justify-center sm:mr-2 lg:flex xl:hidden">'),a5i=le('<div class="flex items-center shrink-0"><svg width=18 height=18 viewBox="0 0 800 800"fill=none xmlns=http://www.w3.org/2000/svg class=shrink-0><path d="M373.362 226.643C388.087 211.919 411.96 211.919 426.684 226.643L573.37 373.324C588.094 388.047 588.094 411.92 573.37 426.644L426.684 573.324C411.96 588.048 388.087 588.048 373.362 573.324L226.677 426.644C211.952 411.92 211.952 388.047 226.677 373.324L373.362 226.643Z"fill=currentColor class=text-text-base></path><path d="M586.658 513.282C594.02 505.921 605.956 505.921 613.318 513.282L686.659 586.621C694.021 593.983 694.021 605.919 686.659 613.28L613.318 686.619C605.956 693.981 594.02 693.981 586.658 686.619L513.317 613.28C505.955 605.919 505.955 593.983 513.317 586.621L586.658 513.282Z"fill=currentColor class=text-text-base></path><path d="M286.501 586.454C293.957 593.909 293.957 605.997 286.501 613.453L213.5 686.452C206.044 693.907 193.956 693.907 186.5 686.452L113.499 613.453C106.043 605.997 106.043 593.909 113.499 586.454L186.5 513.455C193.956 506 206.044 506 213.5 513.455L286.501 586.454Z"fill=currentColor class=text-text-base></path><path d="M406.524 93.4982C402.934 97.088 397.113 97.088 393.523 93.4982L356.523 56.499C352.933 52.9092 352.933 47.089 356.523 43.4992L393.523 6.50002C397.113 2.91025 402.934 2.91025 406.524 6.50003L443.524 43.4992C447.114 47.089 447.114 52.9092 443.524 56.499L406.524 93.4982Z"fill=currentColor class=text-text-base></path><path d="M186.502 113.498C193.958 106.042 206.046 106.042 213.502 113.498L286.503 186.496C293.959 193.952 293.959 206.04 286.503 213.496L213.502 286.494C206.046 293.95 193.958 293.95 186.502 286.494L113.501 213.496C106.045 206.04 106.045 193.952 113.501 186.496L186.502 113.498Z"fill=currentColor class=text-text-base></path><path d="M686.499 186.483C693.955 193.939 693.955 206.027 686.499 213.482L613.498 286.481C606.042 293.937 593.954 293.937 586.498 286.481L513.497 213.482C506.041 206.027 506.041 193.939 513.497 186.483L586.498 113.484C593.954 106.029 606.042 106.029 613.498 113.484L686.499 186.483Z"fill=currentColor class=text-text-base></path><path d="M356.689 756.666C353.007 752.985 353.007 747.017 356.689 743.336L393.359 706.667C397.04 702.986 403.008 702.986 406.689 706.667L443.359 743.336C447.041 747.017 447.041 752.985 443.359 756.666L406.689 793.335C403.008 797.016 397.04 797.016 393.359 793.335L356.689 756.666Z"fill=currentColor class=text-text-base>'),l5i=le('<span class="truncate opacity-70">'),c5i=le('<div data-tauri-decorum-tb class="flex flex-row">'),d5i=le('<header class="h-12 shrink-0 bg-transparent relative grid grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center"data-tauri-drag-region><div><div class="flex items-center gap-1 min-w-0 ml-1 px-1 sm:gap-2 sm:ml-2 sm:px-2"></div><div id=opencode-titlebar-left class="flex items-center gap-1 sm:gap-2"></div></div><div class="min-w-0 flex items-center justify-center pointer-events-none"><div class="pointer-events-auto min-w-0 flex items-center justify-center w-fit max-w-full"><div id=opencode-titlebar-center class="min-w-0 flex justify-center"></div></div></div><div data-tauri-drag-region><div id=opencode-titlebar-right class="flex items-center gap-1 sm:gap-2"></div><div class="flex items-center gap-3 sm:gap-3">'),u5i=le('<div class="w-36 shrink-0">');const Tke=()=>window.__TAURI__,h5i=()=>Tke()?.window?.getCurrentWindow?.(),f5i=()=>Tke()?.webviewWindow?.getCurrentWebviewWindow?.();function p5i(){const n=_3(),e=a2(),t=sze(),i=ha(),r=qse(),o=oy(),s=k3(),a=vy(),l=Aa();function c(){z(async()=>{const{DialogCreateProject:A}=await import("./dialog-create-project-DgZYKQLe.js");return{DialogCreateProject:A}},[]).then(({DialogCreateProject:A})=>{o.show(()=>m(A,{onSelect:T=>{if(!T)return;const D=Array.isArray(T)?T[0]:T;D&&(n.projects.open(D),s(`/${ri(D)}/session`))}}))})}function d(){z(async()=>{const{DialogCloneProject:A}=await import("./dialog-clone-project-CAfI0lHh.js");return{DialogCloneProject:A}},[]).then(({DialogCloneProject:A})=>{o.show(()=>m(A,{onSelect:T=>{T&&(n.projects.open(T),s(`/${ri(T)}/session`))}}))})}const u=J(()=>e.platform==="desktop"&&e.os==="macos"),h=J(()=>e.platform==="desktop"&&e.os==="windows"),f=()=>e.webviewZoom?.()??1,p=()=>u()?`${40/f()}px`:void 0,[g,v]=Yt({stack:[],index:0,action:void 0}),y=()=>`${a.pathname}${a.search}${a.hash}`;Re(()=>{const A=y();Mn(()=>{const T=J4i(g,A);T!==g&&v(T)})});const C=J(()=>n.projects.list().length>0),_=J(()=>n.projects.list().find(A=>ri(A.worktree)===l.dir)),w=J(()=>{const A=_();return A?A.worktree:i.t("command.project.open")}),x=()=>{const A=t5i(g);A&&(v(A.state),s(A.to))},M=()=>{const A=n5i(g);A&&(v(A.state),s(A.to))};t.register(()=>[{id:"common.goBack",title:i.t("common.goBack"),category:i.t("command.category.view"),keybind:"mod+[",onSelect:x},{id:"common.goForward",title:i.t("common.goForward"),category:i.t("command.category.view"),keybind:"mod+]",onSelect:M}]);const L=()=>{if(e.platform==="desktop")return h5i()};Re(()=>{if(e.platform!=="desktop")return;const A=r.colorScheme(),T=A==="system"?null:A,D=f5i();D?.setTheme&&D.setTheme(T).catch(()=>{})});const S=A=>A instanceof Element?!!A.closest("button, a, input, textarea, select, option, [role='button'], [role='menuitem'], [contenteditable='true'], [contenteditable='']"):!1,I=A=>{if(e.platform!=="desktop"||A.buttons!==1||S(A.target))return;const T=L();T?.startDragging&&(A.preventDefault(),T.startDragging().catch(()=>{}))},E=A=>{if(e.platform!=="desktop"||S(A.target)||A.target instanceof Element&&A.target.closest("[data-tauri-decorum-tb]"))return;const T=L();T?.toggleMaximize&&(A.preventDefault(),T.toggleMaximize().catch(()=>{}))};return(()=>{var A=d5i(),T=A.firstChild,D=T.firstChild,R=T.nextSibling,P=R.nextSibling,V=P.firstChild,$=V.nextSibling;return A.$$dblclick=E,A.$$mousedown=I,W(T,m(_e,{get when(){return u()},get children(){return[(()=>{var j=r5i();return st(B=>Sr(j,"width",`${72/f()}px`)),j})(),(()=>{var j=o5i();return W(j,m(oa,{icon:"menu",variant:"ghost",class:"titlebar-icon rounded-md",get onClick(){return n.mobileSidebar.toggle},get"aria-label"(){return i.t("sidebar.menu.toggle")},get"aria-expanded"(){return n.mobileSidebar.opened()}})),j})()]}}),D),W(T,m(_e,{get when(){return!u()},get children(){var j=s5i();return W(j,m(oa,{icon:"menu",variant:"ghost",class:"titlebar-icon rounded-md",get onClick(){return n.mobileSidebar.toggle},get"aria-label"(){return i.t("sidebar.menu.toggle")},get"aria-expanded"(){return n.mobileSidebar.opened()}})),j}}),D),W(D,m(_e,{get when(){return!ih()},get children(){return m(_e,{get when(){return C()||!0},get children(){return[a5i(),m(Un,{placement:"bottom",gutter:4,modal:!1,get children(){return[m(Un.Trigger,{as:to,variant:"ghost",size:"small",class:"flex h-7 min-w-0 max-w-[128px] items-center gap-1.5 rounded-md px-1.5 font-mono text-[11px] text-text-base hover:bg-white/5 sm:max-w-[280px] sm:px-2 lg:max-w-[360px] xl:max-w-[520px]",get title(){return w()},get children(){return[m(Cn,{name:"folder-add-left",size:"small",class:"shrink-0 text-text-weak",style:{"font-size":"12px"}}),(()=>{var j=l5i();return W(j,w),j})(),m(Cn,{name:"chevron-down",size:"small",class:"shrink-0 text-icon-weak"})]}}),m(Un.Portal,{get children(){return m(Un.Content,{class:"min-w-[180px]",get children(){return[m(_e,{get when(){return!ih()},get children(){return[m(ei,{get each(){return n.projects.list()},children:j=>m(Un.Item,{onSelect:()=>s(`/${ri(j.worktree)}/session`),get children(){return m(Un.ItemLabel,{get children(){return j.name||Ds(j.worktree)}})}})}),m(Un.Separator,{}),m(Un.Item,{onSelect:()=>t.trigger("project.open"),get children(){return m(Un.ItemLabel,{get children(){return i.t("command.project.open")}})}}),m(Un.Separator,{}),m(Un.Sub,{get children(){return[m(Un.SubTrigger,{get children(){return i.t("command.project.new")}}),m(Un.SubContent,{get children(){return[m(Un.Item,{onSelect:c,get children(){return m(Un.ItemLabel,{get children(){return i.t("command.project.newBlank")}})}}),m(Un.Item,{onSelect:d,get children(){return m(Un.ItemLabel,{get children(){return i.t("command.project.importGitHub")}})}})]}})]}})]}}),m(_e,{get when(){return ih()},get children(){return m(Un.Item,{onSelect:uMn,get children(){return m(Un.ItemLabel,{children:"Exit to Trellis Cloud"})}})}})]}})}})]}})]}})}})),P.$$mousedown=I,W($,m(Ort,{placement:"bottom",get title(){return i.t("sidebar.settings")},get keybind(){return t.keybind("settings.open")??""},get children(){return m(to,{variant:"ghost",class:"titlebar-icon w-8 h-6 p-0 box-border shrink-0",onClick:()=>t.trigger("settings.open"),get"aria-label"(){return i.t("sidebar.settings")},get children(){return m(Cn,{size:"small",name:"settings-gear"})}})}}),null),W($,m(i5i,{}),null),W(P,m(_e,{get when(){return h()},get children(){return[sn(()=>sn(()=>!Tke())()&&u5i()),c5i()]}}),null),st(j=>{var B=p(),te={"flex items-center min-w-0":!0,"pl-2":!u()},U={"flex items-center min-w-0 justify-end":!0,"pr-2":!h()};return B!==j.e&&Sr(A,"min-height",j.e=B),j.t=Ko(T,te,j.t),j.a=Ko(P,U,j.a),j},{e:void 0,t:void 0,a:void 0}),A})()}Fs(["mousedown","dblclick"]);const rn=n=>{if(!n)return"";const e=n.replaceAll("\\","/"),t=e.match(/^([A-Za-z]:)\/+$/);return t?`${t[1]}/`:/^\/+$/i.test(e)?"/":e.replace(/\/+$/,"")};function mot(n){const e=n-6e4;return(t,i)=>{const r=t.time?.updated??t.time?.created??0,o=i.time?.updated??i.time?.created??0,s=r>e,a=o>e;return s&&a?t.id<i.id?-1:t.id>i.id?1:0:s&&!a?-1:!s&&a?1:o-r}}const g5i=(n,e)=>rn(n.directory)===rn(e)&&!n.parentID&&!n.time?.archived,vot=n=>(n.session??[]).filter(e=>g5i(e,n.path.directory)),P_=(n,e)=>vot(n).sort(mot(e)),iRe=(n,e)=>n.flatMap(vot).sort(mot(e))[0];function m5i(n,e=()=>!0){return Object.values(n??{}).some(t=>t?.some(e))}const nse=n=>{const e=new Map;for(const t of n??[]){if(!t.parentID)continue;const i=e.get(t.parentID);if(i){i.push(t.id);continue}e.set(t.parentID,[t.id])}return e},Ake=n=>n.name||Ds(n.worktree),TL=(n,e)=>{if(n&&typeof n=="object"&&"data"in n){const t=n.data;if(t?.message)return t.message}return n instanceof Error?n.message:e},AL=(n,e,t)=>{const i=rn(n),r=new Map;for(const s of e){const a=rn(s);a!==i&&(r.has(a)||r.set(a,s))}if(!t?.length)return[n,...r.values()];const o=[n];for(const s of t){const a=rn(s);if(a===i)continue;const l=r.get(a);l&&(o.push(l),r.delete(a))}return[...o,...r.values()]},rRe="opencode:deep-link",yot=n=>{if(n.startsWith("opencode://")&&!(typeof URL.canParse=="function"&&!URL.canParse(n)))try{return new URL(n)}catch{return}},v5i=n=>{const e=yot(n);if(!e||e.hostname!=="open-project")return;const t=e.searchParams.get("directory");if(t)return t},y5i=n=>{const e=yot(n);if(!e||e.hostname!=="new-session")return;const t=e.searchParams.get("directory");if(!t)return;const i=e.searchParams.get("prompt")||void 0;return i?{directory:t,prompt:i}:{directory:t}},k5i=n=>n.map(v5i).filter(e=>!!e),C5i=n=>n.map(y5i).filter(e=>!!e),b5i=n=>{const e=n.__OPENCODE__?.deepLinks??[];return e.length===0?[]:(n.__OPENCODE__&&(n.__OPENCODE__.deepLinks=[]),e)};var w5i=le("<span>");function _5i(){const[n,e]=Yt({active:"",value:""}),t=c=>n.active===c,i=()=>n.value,r=(c,d)=>{c&&e({active:c,value:d})},o=()=>e({active:"",value:""}),s=c=>{const d=n.value.trim();if(!d){o();return}o(),c(d)},a=(c,d)=>{if(c.key==="Enter"){c.preventDefault(),s(d);return}c.key==="Escape"&&(c.preventDefault(),o())};return{editor:n,editorOpen:t,editorValue:i,openEditor:r,closeEditor:o,saveEditor:s,editorKeyDown:a,setEditor:e,InlineEditor:c=>{let d;Oe(()=>{d!==void 0&&cancelAnimationFrame(d)});const u=()=>c.editing??t(c.id),h=()=>c.stopPropagation??!1,f=()=>c.openOnDblClick??!0,p=v=>{h()&&v.stopPropagation()},g=v=>{f()&&(p(v),r(c.id,c.value()))};return m(_e,{get when(){return u()},get fallback(){return(()=>{var v=w5i();return v.$$touchstart=p,v.$$click=p,v.$$mousedown=p,v.$$pointerdown=p,v.$$dblclick=g,W(v,()=>c.value()),st(()=>H1(v,c.displayClass??c.class)),v})()},get children(){return m(ate,{ref:v=>{d!==void 0&&cancelAnimationFrame(d),d=requestAnimationFrame(()=>{d=void 0,v.isConnected&&v.focus()})},get value(){return i()},get class(){return c.class},onInput:v=>e("value",v.currentTarget.value),onKeyDown:v=>{v.stopPropagation(),a(v,c.onSave)},onBlur:o,onPointerDown:p,onClick:p,onDblClick:p,onMouseDown:p,onMouseUp:p,onTouchStart:p})}})}}}Fs(["dblclick","pointerdown","mousedown","click","touchstart"]);var x5i={};au(x5i,{Collapsible:()=>Oce,Content:()=>Cot,Root:()=>bot,Trigger:()=>wot,useCollapsibleContext:()=>Dke});var kot=oi();function Dke(){const n=Wn(kot);if(n===void 0)throw new Error("[kobalte]: `useCollapsibleContext` must be used within a `Collapsible.Root` component");return n}function Cot(n){const[e,t]=Ye(),i=Dke(),r=Pn({id:i.generateId("content")},n),[o,s]=Je(r,["ref","id","style"]),{present:a}=M6({show:i.shouldMount,element:()=>e()??null}),[l,c]=Ye(0),[d,u]=Ye(0);let f=i.isOpen()||a();return ur(()=>{const p=requestAnimationFrame(()=>{f=!1});Oe(()=>{cancelAnimationFrame(p)})}),Re(Mr(a,()=>{if(!e())return;e().style.transitionDuration="0s",e().style.animationName="none";const p=e().getBoundingClientRect();c(p.height),u(p.width),f||(e().style.transitionDuration="",e().style.animationName="")})),Re(Mr(i.isOpen,p=>{!p&&e()&&(e().style.transitionDuration="",e().style.animationName="")},{defer:!0})),Re(()=>Oe(i.registerContentId(o.id))),m(_e,{get when(){return a()},get children(){return m(zi,k({as:"div",ref(p){var g=qr(t,o.ref);typeof g=="function"&&g(p)},get id(){return o.id},get style(){return su({"--kb-collapsible-content-height":l()?`${l()}px`:void 0,"--kb-collapsible-content-width":d()?`${d()}px`:void 0},o.style)}},()=>i.dataset(),s))}})}function bot(n){const e=`collapsible-${$s()}`,t=Pn({id:e},n),[i,r]=Je(t,["open","defaultOpen","onOpenChange","disabled","forceMount"]),[o,s]=Ye(),a=u3({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:d=>i.onOpenChange?.(d)}),l=J(()=>({"data-expanded":a.isOpen()?"":void 0,"data-closed":a.isOpen()?void 0:"","data-disabled":i.disabled?"":void 0})),c={dataset:l,isOpen:a.isOpen,disabled:()=>i.disabled??!1,shouldMount:()=>i.forceMount||a.isOpen(),contentId:o,toggle:a.toggle,generateId:bh(()=>r.id),registerContentId:Xa(s)};return m(kot.Provider,{value:c,get children(){return m(zi,k({as:"div"},l,r))}})}function wot(n){const e=Dke(),[t,i]=Je(n,["onClick"]);return m(h3,k({get"aria-expanded"(){return e.isOpen()},get"aria-controls"(){return sn(()=>!!e.isOpen())()?e.contentId():void 0},get disabled(){return e.disabled()},onClick:o=>{In(o,t.onClick),e.toggle()}},()=>e.dataset(),i))}var Oce=Object.assign(bot,{Content:Cot,Trigger:wot}),S5i=le("<div data-slot=collapsible-arrow><span data-slot=collapsible-arrow-icon>");function M5i(n){const[e,t]=Je(n,["class","classList","variant"]);return m(Oce,k({"data-component":"collapsible",get"data-variant"(){return e.variant||"normal"},get classList(){return{...e.classList??{},[e.class??""]:!!e.class}}},t))}function L5i(n){return m(Oce.Trigger,k({"data-slot":"collapsible-trigger"},n))}function I5i(n){return m(Oce.Content,k({"data-slot":"collapsible-content"},n))}function N5i(n){return(()=>{var e=S5i(),t=e.firstChild;return El(e,n||{},!1,!0),W(t,m(Cn,{name:"chevron-down",size:"small"})),e})()}const qhe=Object.assign(M5i,{Arrow:N5i,Trigger:L5i,Content:I5i});var E5i=le("<div>"),T5i=le("<img data-slot=avatar-image>");const oRe=typeof Intl<"u"&&"Segmenter"in Intl?new Intl.Segmenter(void 0,{granularity:"grapheme"}):void 0;function A5i(n){return n?oRe?oRe.segment(n)[Symbol.iterator]().next().value?.segment??Array.from(n)[0]??"":Array.from(n)[0]??"":""}function D5i(n){const[e,t]=Je(n,["fallback","src","background","foreground","size","class","classList","style"]),i=e.src;return(()=>{var r=E5i();return El(r,k(t,{"data-component":"avatar",get"data-size"(){return e.size||"normal"},"data-has-image":i?"":void 0,get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get style(){return{...typeof e.style=="object"?e.style:{},...!i&&e.background?{"--avatar-bg":e.background}:{},...!i&&e.foreground?{"--avatar-fg":e.foreground}:{}}}}),!1,!0),W(r,m(_e,{when:i,get fallback(){return A5i(e.fallback)},children:o=>(()=>{var s=T5i();return mt(s,"draggable",!1),st(()=>mt(s,"src",o())),s})()})),r})()}var R5i={};au(R5i,{Link:()=>P5i,Root:()=>Rke});function Rke(n){let e;const[t,i]=Je(n,["ref","href","disabled"]),r=$_(()=>e,()=>"a");return m(zi,k({as:"a",ref(o){var s=qr(a=>e=a,t.ref);typeof s=="function"&&s(o)},get role(){return r()!=="a"||t.disabled?"link":void 0},get tabIndex(){return r()!=="a"&&!t.disabled?0:void 0},get href(){return sn(()=>!t.disabled)()?t.href:void 0},get"aria-disabled"(){return t.disabled?!0:void 0},get"data-disabled"(){return t.disabled?"":void 0}},i))}var P5i=Rke,O5i={};au(O5i,{Arrow:()=>y2,Content:()=>xot,HoverCard:()=>zC,Portal:()=>Sot,Root:()=>Mot,Trigger:()=>Lot,useHoverCardContext:()=>Vce});var _ot=oi();function Vce(){const n=Wn(_ot);if(n===void 0)throw new Error("[kobalte]: `useHoverCardContext` must be used within a `HoverCard` component");return n}function xot(n){const e=Vce(),[t,i]=Je(n,["ref","style"]);return m(_e,{get when(){return e.contentPresent()},get children(){return m(tk.Positioner,{get children(){return m(cse,k({ref(r){var o=qr(s=>{e.setContentRef(s)},t.ref);typeof o=="function"&&o(r)},disableOutsidePointerEvents:!1,get style(){return su({"--kb-hovercard-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},t.style)},onFocusOutside:r=>r.preventDefault(),get onDismiss(){return e.close}},()=>e.dataset(),i))}})}})}function Sot(n){const e=Vce();return m(_e,{get when(){return e.contentPresent()},get children(){return m(d3,n)}})}function V5i(n,e,t){const i=n.split("-")[0],r=e.getBoundingClientRect(),o=t.getBoundingClientRect(),s=[],a=r.left+r.width/2,l=r.top+r.height/2;switch(i){case"top":s.push([r.left,l]),s.push([o.left,o.bottom]),s.push([o.left,o.top]),s.push([o.right,o.top]),s.push([o.right,o.bottom]),s.push([r.right,l]);break;case"right":s.push([a,r.top]),s.push([o.left,o.top]),s.push([o.right,o.top]),s.push([o.right,o.bottom]),s.push([o.left,o.bottom]),s.push([a,r.bottom]);break;case"bottom":s.push([r.left,l]),s.push([o.left,o.top]),s.push([o.left,o.bottom]),s.push([o.right,o.bottom]),s.push([o.right,o.top]),s.push([r.right,l]);break;case"left":s.push([a,r.top]),s.push([o.right,o.top]),s.push([o.left,o.top]),s.push([o.left,o.bottom]),s.push([o.right,o.bottom]),s.push([a,r.bottom]);break}return s}function Mot(n){const e=`hovercard-${$s()}`,t=Pn({id:e,openDelay:700,closeDelay:300},n),[i,r]=Je(t,["id","open","defaultOpen","onOpenChange","openDelay","closeDelay","ignoreSafeArea","forceMount"]);let o,s;const[a,l]=Ye(),[c,d]=Ye(),[u,h]=Ye(r.placement),f=u3({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:E=>i.onOpenChange?.(E)}),{present:p}=M6({show:()=>i.forceMount||f.isOpen(),element:()=>c()??null}),{addGlobalListener:g,removeGlobalListener:v}=hat(),y=()=>{o=window.setTimeout(()=>{o=void 0,f.open()},i.openDelay)},C=()=>{s=window.setTimeout(()=>{s=void 0,f.close()},i.closeDelay)},_=()=>{window.clearTimeout(o),o=void 0},w=()=>{window.clearTimeout(s),s=void 0},x=E=>ps(a(),E)||ps(c(),E),M=E=>{const A=a(),T=c();if(!(!A||!T))return V5i(E,A,T)},L=E=>{const A=E.target;if(x(A)){w();return}if(!i.ignoreSafeArea){const T=M(u());if(T&&C5e(DRe(E),T)){w();return}}s||C()};Re(()=>{f.isOpen()&&(g(document,"pointermove",L,!0),Oe(()=>{v(document,"pointermove",L,!0)}))}),Oe(()=>{_(),w()});const I={dataset:J(()=>({"data-expanded":f.isOpen()?"":void 0,"data-closed":f.isOpen()?void 0:""})),isOpen:f.isOpen,contentPresent:p,openWithDelay:y,closeWithDelay:C,cancelOpening:_,cancelClosing:w,close:f.close,isTargetOnHoverCard:x,setTriggerRef:l,setContentRef:d};return m(_ot.Provider,{value:I,get children(){return m(tk,k({anchorRef:a,contentRef:c,onCurrentPlacementChange:h},r))}})}function Lot(n){const e=Vce(),[t,i]=Je(n,["ref","onPointerEnter","onPointerLeave","onFocus","onBlur"]),r=l=>{In(l,t.onPointerEnter),!(l.pointerType==="touch"||i.disabled||l.defaultPrevented)&&(e.cancelClosing(),e.isOpen()||e.openWithDelay())},o=l=>{In(l,t.onPointerLeave),l.pointerType!=="touch"&&e.cancelOpening()},s=l=>{In(l,t.onFocus),!(i.disabled||l.defaultPrevented)&&(e.cancelClosing(),e.isOpen()||e.openWithDelay())},a=l=>{In(l,t.onBlur),e.cancelOpening();const c=l.relatedTarget;e.isTargetOnHoverCard(c)||e.closeWithDelay()};return Oe(e.cancelOpening),m(Rke,k({ref(l){var c=qr(e.setTriggerRef,t.ref);typeof c=="function"&&c(l)},onPointerEnter:r,onPointerLeave:o,onFocus:s,onBlur:a},()=>e.dataset(),i))}var zC=Object.assign(Mot,{Arrow:y2,Content:xot,Portal:Sot,Trigger:Lot}),H5i=le("<div data-slot=hover-card-body>");function Iot(n){const[e,t]=Je(n,["trigger","mount","class","classList","children"]);return m(zC,k({gutter:4},t,{get children(){return[m(zC.Trigger,{as:"div","data-slot":"hover-card-trigger",tabIndex:-1,get children(){return e.trigger}}),m(zC.Portal,{get mount(){return e.mount},get children(){return m(zC.Content,{"data-component":"hover-card-content",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){var i=H5i();return W(i,()=>e.children),i}})}})]}}))}var $5i=le('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 18 14"fill=none><g>'),F5i=le("<span data-slot=diff-changes-additions>"),z5i=le("<span data-slot=diff-changes-deletions>"),B5i=le("<div data-component=diff-changes>"),j5i=le("<svg><rect width=2 height=14 rx=1></svg>",!1,!0,!1);function W5i(n){const e=()=>n.variant??"default",t=J(()=>Array.isArray(n.changes)?n.changes.reduce((d,u)=>d+(u.additions??0),0):n.changes.additions),i=J(()=>Array.isArray(n.changes)?n.changes.reduce((d,u)=>d+(u.deletions??0),0):n.changes.deletions),r=J(()=>(t()??0)+(i()??0)),o=J(()=>{const u=t()??0,h=i()??0;if(u===0&&h===0)return{added:0,deleted:0,neutral:5};const f=u+h;if(f<5){const S=u>0?1:0,I=h>0?1:0,E=5-S-I;return{added:S,deleted:I,neutral:E}}const p=u>h?u/h:h/u;let g=5;(f<20||p<4)&&(g=4);const v=u/f,y=h/f,C=v*g,_=y*g;let w=u>0?Math.max(1,Math.round(C)):0,x=h>0?Math.max(1,Math.round(_)):0;u>0&&u<=5&&(w=Math.min(w,1)),u>5&&u<=10&&(w=Math.min(w,2)),h>0&&h<=5&&(x=Math.min(x,1)),h>5&&h<=10&&(x=Math.min(x,2));let M=w+x;M>g&&(C>_?w=g-x:x=g-w,M=w+x);const L=Math.max(0,5-M);return{added:w,deleted:x,neutral:L}}),s="var(--icon-diff-add-base)",a="var(--icon-diff-delete-base)",l="var(--icon-weak-base)",c=J(()=>{const d=o();return[...Array(d.added).fill(s),...Array(d.deleted).fill(a),...Array(d.neutral).fill(l)].slice(0,5)});return m(_e,{get when(){return sn(()=>e()==="default")()?r()>0:!0},get children(){var d=B5i();return W(d,m(V1,{get children(){return[m(fi,{get when(){return e()==="bars"},get children(){var u=$5i(),h=u.firstChild;return W(h,m(ei,{get each(){return c()},children:(f,p)=>(()=>{var g=j5i();return mt(g,"fill",f),st(()=>mt(g,"x",p()*4)),g})()})),u}}),m(fi,{get when(){return e()==="default"},get children(){return[(()=>{var u=F5i();return W(u,()=>`+${t()}`),u})(),(()=>{var u=z5i();return W(u,()=>`-${i()}`),u})()]}})]}})),st(u=>{var h=e(),f={[n.class??""]:!0};return h!==u.e&&mt(d,"data-variant",u.e=h),u.t=Ko(d,f,u.t),u},{e:void 0,t:void 0}),d}})}var q5i=le("<ul role=list data-component=message-nav>"),U5i=le("<div data-slot=message-nav-tick-button role=button tabindex=0><div data-slot=message-nav-tick-line>"),Z5i=le("<button data-slot=message-nav-message-button><div data-slot=message-nav-title-preview>"),K5i=le("<li data-slot=message-nav-item>"),G5i=le("<div data-slot=message-nav-tooltip-content>");function Not(n){const e=f3(),[t,i]=Je(n,["messages","current","size","onMessageSelect","getLabel"]),r=()=>(()=>{var o=q5i();return El(o,k({get"data-size"(){return t.size}},i),!1,!0),W(o,m(ei,{get each(){return t.messages},children:s=>{const a=()=>t.onMessageSelect(s),l=c=>{c.key!=="Enter"&&c.key!==" "||(c.preventDefault(),t.onMessageSelect(s))};return(()=>{var c=K5i();return W(c,m(V1,{get children(){return[m(fi,{get when(){return t.size==="compact"},get children(){var d=U5i();return d.$$keydown=l,d.$$click=a,st(()=>mt(d,"data-active",s.id===t.current?.id||void 0)),d}}),m(fi,{get when(){return t.size==="normal"},get children(){var d=Z5i(),u=d.firstChild;return d.$$keydown=l,d.$$click=a,W(d,m(W5i,{get changes(){return s.summary?.diffs??[]},variant:"bars"}),u),W(u,m(_e,{get when(){return t.getLabel?.(s)??s.summary?.title},get fallback(){return e.t("ui.messageNav.newMessage")},get children(){return t.getLabel?.(s)??s.summary?.title}})),st(()=>mt(u,"data-active",s.id===t.current?.id||void 0)),d}})]}})),c})()}})),o})();return m(V1,{get children(){return[m(fi,{get when(){return t.size==="compact"},get children(){return m(ou,{openDelay:0,placement:"right-start",gutter:-40,shift:-10,overlap:!0,contentClass:"message-nav-tooltip",get value(){return(()=>{var o=G5i();return W(o,m(Not,k(n,{size:"normal",class:""}))),o})()},get children(){return r()}})}}),m(fi,{get when(){return t.size==="normal"},get children(){return r()}})]}})}Fs(["click","keydown"]);const sRe={ask:"var(--icon-agent-ask-base)",build:"var(--icon-agent-build-base)",docs:"var(--icon-agent-docs-base)",plan:"var(--icon-agent-plan-base)"};function X5i(n,e){return e||(sRe[n]??sRe[n.toLowerCase()])}function Y5i(n,e){if(n)for(let t=n.length-1;t>=0;t--){const i=n[t];if(!(i.role!=="user"||!i.agent))return X5i(i.agent,e.find(r=>r.name===i.agent)?.color)}}function Eot(n,e,t,i=()=>!0){if(!t)return;const r=n.reduce((l,c)=>{if(!c.parentID)return l;const d=l.get(c.parentID);return d&&d.push(c.id),d||l.set(c.parentID,[c.id]),l},new Map),o=new Set([t]),s=[t];for(const l of s){const c=r.get(l);if(c)for(const d of c)o.has(d)||(o.add(d),s.push(d))}const a=s.find(l=>e[l]?.some(i));if(a)return e[a]?.find(i)}function J5i(n,e,t,i){return Eot(n,e,t,i)}function fyi(n,e,t,i){return Eot(n,e,t,i)}var Q5i=le("<div>"),e9i=le('<div><div class="size-full rounded overflow-clip">'),t9i=le('<div class="size-1.5 rounded-full bg-surface-warning-strong">'),n9i=le('<div class="size-1.5 rounded-full bg-text-diff-delete-base">'),i9i=le('<div class="size-1.5 rounded-full bg-text-interactive-base">'),Tot=le('<div class="shrink-0 size-6 flex items-center justify-center">'),Aot=le('<span class="text-14-regular text-text-strong min-w-0 flex-1 truncate">'),r9i=le('<div class="overflow-y-auto overflow-x-hidden max-h-72 h-full">'),o9i=le('<div class="min-w-0 w-full">'),s9i=le('<div class="text-12-regular text-text-weak">'),a9i=le('<div class="group/session relative w-full min-w-0 rounded-md cursor-default pl-2 pr-3 transition-colors hover:bg-surface-raised-base-hover [&amp;:has(:focus-visible)]:bg-surface-raised-base-hover has-[[data-expanded]]:bg-surface-raised-base-hover has-[.active]:bg-surface-base-active"><div class="flex min-w-0 items-center gap-1"><div class="min-w-0 flex-1"></div><div class="shrink-0 overflow-hidden transition-[width,opacity]">'),l9i=le('<div class="group/session relative w-full min-w-0 rounded-md cursor-default transition-colors pl-2 pr-3 hover:bg-surface-raised-base-hover [&amp;:has(:focus-visible)]:bg-surface-raised-base-hover has-[.active]:bg-surface-base-active">'),c9i=le('<div class="flex flex-col gap-1">'),d9i=le('<div class="h-8 w-full rounded-md bg-surface-raised-base opacity-60 animate-pulse">');const u9i="4b0ea68d7af9a6031a7ffda7ad66e0cb83315750",Pke=n=>{const e=G1(),t=Iae(),i=Y3e(),r=J(()=>[n.project.worktree,...n.project.sandboxes??[]]),o=J(()=>r().reduce((d,u)=>d+t.project.unseenCount(u),0)),s=J(()=>r().some(d=>t.project.unseenHasError(d))),a=J(()=>r().some(d=>{const[u]=e.child(d,{bootstrap:!1});return m5i(u.permission,h=>!i.autoResponds(h,d))})),l=J(()=>n.notify&&(a()||o()>0)),c=J(()=>n.project.name||Ds(n.project.worktree));return(()=>{var d=e9i(),u=d.firstChild;return W(u,m(D5i,k({get fallback(){return c()},get src(){return sn(()=>n.project.id===u9i)()?"https://opencode.ai/favicon.svg":n.project.icon?.override}},()=>pwn(n.project.icon?.color),{class:"size-full rounded",get classList(){return{"badge-mask":l()}}}))),W(d,m(_e,{get when(){return l()},get children(){var h=Q5i();return st(f=>Ko(h,{"absolute top-px right-px size-1.5 rounded-full z-10":!0,"bg-surface-warning-strong":a(),"bg-icon-critical-base":!a()&&s(),"bg-text-interactive-base":!a()&&!s()},f)),h}}),null),st(()=>H1(d,`relative size-8 shrink-0 rounded ${n.class??""}`)),d})()},h9i=n=>m(z9e,{get href(){return`/${n.slug}/session/${n.session.id}`},get class(){return`flex items-center gap-1 min-w-0 w-full text-left focus:outline-none ${n.dense?"py-0.5":"py-1"}`},get onPointerDown(){return n.warmPress},get onPointerEnter(){return n.warmHover},get onPointerLeave(){return n.cancelHoverPrefetch},get onFocus(){return n.warmFocus},onClick:()=>{n.setHoverSession(void 0),!n.sidebarOpened()&&n.clearHoverProjectSoon()},get children(){return[(()=>{var e=Tot();return W(e,m(V1,{get fallback(){return m(Cn,{name:"dash",size:"small",class:"text-icon-weak"})},get children(){return[m(fi,{get when(){return n.isWorking()},get children(){return m(wp,{class:"size-[15px]"})}}),m(fi,{get when(){return n.hasPermissions()},get children(){return t9i()}}),m(fi,{get when(){return n.hasError()},get children(){return n9i()}}),m(fi,{get when(){return n.unseenCount()>0},get children(){return i9i()}})]}})),st(t=>Sr(e,"color",n.tint()??"var(--icon-interactive-base)")),e})(),(()=>{var e=Aot();return W(e,()=>n.session.title),e})()]}}),f9i=n=>{let e;return m(Iot,{openDelay:1e3,get closeDelay(){return n.sidebarHovering()?600:0},placement:"right-start",gutter:16,shift:-2,get trigger(){return(()=>{var t=o9i(),i=e;return typeof i=="function"?aa(i,t):e=t,W(t,()=>n.trigger),t})()},get open(){return n.hoverSession()===n.session.id},onOpenChange:t=>{if(!t){n.setHoverSession(void 0);return}e?.matches(":hover")&&n.setHoverSession(n.session.id)},get children(){return m(_e,{get when(){return n.hoverReady()},get fallback(){return(()=>{var t=s9i();return W(t,()=>n.language.t("session.messages.loading")),t})()},get children(){var t=r9i();return W(t,m(Not,{get messages(){return n.hoverMessages()??[]},current:void 0,get getLabel(){return n.messageLabel},get onMessageSelect(){return n.onMessageSelect},size:"normal",class:"w-60"})),t}})}})},h5e=n=>{const e=Aa(),t=k3(),i=_3(),r=ha(),o=Iae(),s=Y3e(),a=G1(),l=J(()=>o.session.unseenCount(n.session.id)),c=J(()=>o.session.unseenHasError(n.session.id)),[d]=a.child(n.session.directory),u=J(()=>!!J5i(d.session,d.permission,n.session.id,I=>!s.autoResponds(I,n.session.directory))),h=J(()=>{if(u())return!1;const I=(d.message[n.session.id]??[]).findLast(A=>A.role==="assistant"&&typeof A.time?.completed!="number"),E=d.session_status[n.session.id];return I!==void 0||E?.type==="busy"||E?.type==="retry"||E!==void 0&&E.type!=="idle"}),f=J(()=>Y5i(d.message[n.session.id],d.agent)),p=J(()=>d.message[n.session.id]?.filter(I=>I.role==="user")),g=J(()=>p()!==void 0),v=J(()=>!n.mobile&&n.sidebarExpanded()),y=J(()=>(n.popover??!0)&&v()),C=J(()=>n.session.id===e.id),_=(I,E)=>{const A=n.navList?.(),T=A?.some(R=>R.id===n.session.id&&R.directory===n.session.directory)?A:n.list;n.prefetchSession(n.session,E);const D=T.findIndex(R=>R.id===n.session.id&&R.directory===n.session.directory);if(D!==-1)for(let R=1;R<=I;R++){const P=T[D+R];P&&n.prefetchSession(P,R===1?"high":E);const V=T[D-R];V&&n.prefetchSession(V,R===1?"high":E)}},w={current:void 0},x=()=>{w.current!==void 0&&(clearTimeout(w.current),w.current=void 0)},M=()=>{_(1,"high"),w.current===void 0&&(w.current=setTimeout(()=>{w.current=void 0,_(2,"low")},80))};Oe(x);const L=I=>(d.part[I.id]??[]).find(T=>T?.type==="text"&&!T.synthetic&&!T.ignored)?.text,S=m(h9i,{get session(){return n.session},get slug(){return n.slug},get mobile(){return n.mobile},get dense(){return n.dense},tint:f,isWorking:h,hasPermissions:u,hasError:c,unseenCount:l,get setHoverSession(){return n.setHoverSession},get clearHoverProjectSoon(){return n.clearHoverProjectSoon},get sidebarOpened(){return i.sidebar.opened},warmHover:M,warmPress:()=>_(2,"high"),warmFocus:()=>_(2,"high"),cancelHoverPrefetch:x});return(()=>{var I=a9i(),E=I.firstChild,A=E.firstChild,T=A.nextSibling;return W(A,m(_e,{get when(){return y()},get fallback(){return m(ou,{get placement(){return n.mobile?"bottom":"right"},get value(){return n.session.title},gutter:10,class:"min-w-0 w-full",children:S})},get children(){return m(f9i,{get mobile(){return n.mobile},get nav(){return n.nav},get hoverSession(){return n.hoverSession},get session(){return n.session},get sidebarHovering(){return n.sidebarHovering},hoverReady:g,hoverMessages:p,language:r,isActive:C,get slug(){return n.slug},get setHoverSession(){return n.setHoverSession},messageLabel:L,onMessageSelect:D=>{C()||i.pendingMessage.set(`${ri(n.session.directory)}/${n.session.id}`,D.id),t(`${n.slug}/session/${n.session.id}#message-${D.id}`)},trigger:S})}})),W(T,m(ou,{get value(){return r.t("common.archive")},placement:"top",get children(){return m(oa,{icon:"archive",variant:"ghost",class:"size-6 rounded-md",get"aria-label"(){return r.t("common.archive")},onClick:D=>{D.preventDefault(),D.stopPropagation(),n.archiveSession(n.session)}})}})),st(D=>{var R=n.session.id,P={"w-6 opacity-100 pointer-events-auto":!!n.mobile,"w-0 opacity-0 pointer-events-none":!n.mobile,"group-hover/session:w-6 group-hover/session:opacity-100 group-hover/session:pointer-events-auto":!0,"group-focus-within/session:w-6 group-focus-within/session:opacity-100 group-focus-within/session:pointer-events-auto":!0};return R!==D.e&&mt(I,"data-session-id",D.e=R),D.t=Ko(T,P,D.t),D},{e:void 0,t:void 0}),I})()},p9i=n=>{const e=_3(),i=ha().t("command.session.new"),r=()=>n.mobile||!n.sidebarExpanded(),o=m(z9e,{get href(){return`/${n.slug}/session`},end:!0,get class(){return`flex items-center gap-1 min-w-0 w-full text-left focus:outline-none ${n.dense?"py-0.5":"py-1"}`},onClick:()=>{n.setHoverSession(void 0),!e.sidebar.opened()&&n.clearHoverProjectSoon()},get children(){return[(()=>{var s=Tot();return W(s,m(Cn,{name:"new-session",size:"small",class:"text-icon-weak"})),s})(),(()=>{var s=Aot();return W(s,i),s})()]}});return(()=>{var s=l9i();return W(s,m(_e,{get when(){return!r()},get fallback(){return m(ou,{get placement(){return n.mobile?"bottom":"right"},value:i,gutter:10,class:"min-w-0 w-full",children:o})},children:o})),s})()},g9i=n=>{const e=Array.from({length:n.count??4},(t,i)=>i);return(()=>{var t=c9i();return W(t,m(ei,{each:e,children:()=>d9i()})),t})()};var m9i=le('<div class="bg-background-base rounded-md px-2 py-1 text-14-medium text-text-strong">'),v9i=le('<div class="flex items-center gap-1 min-w-0 flex-1"><div class="flex items-center justify-center shrink-0 size-6"></div><span class="text-14-medium text-text-base shrink-0"> :</span><div class="flex items-center justify-center shrink-0 overflow-hidden w-0 opacity-0 transition-all duration-200 group-hover/workspace:w-3.5 group-hover/workspace:opacity-100 group-focus-within/workspace:w-3.5 group-focus-within/workspace:opacity-100">'),y9i=le('<span class="text-14-medium text-text-base min-w-0 truncate">'),k9i=le('<div class="absolute right-1 top-1/2 -translate-y-1/2 flex items-center gap-0.5 transition-opacity">'),C9i=le('<div class="shrink-0 size-6 flex items-center justify-center">'),b9i=le('<span class="text-14-regular text-text-strong min-w-0 flex-1 truncate">Trellis Board'),w9i=le('<div class="relative w-full py-1">'),_9i=le('<nav class="flex flex-col gap-1">'),aRe=le("<div>"),x9i=le('<div class=py-1><div class="group/workspace relative"data-component=workspace-item><div class="flex items-center gap-1">'),S9i=le('<div class="size-full flex flex-col py-2 overflow-y-auto no-scrollbar [overflow-anchor:none]">');const M9i=n=>{const e=G1(),t=ha(),i=J(()=>{const r=n.sidebarProject();if(!r)return;const o=n.activeWorkspace();if(!o)return;const[s]=e.child(o,{bootstrap:!1}),a=o===r.worktree?t.t("workspace.type.local"):t.t("workspace.type.sandbox"),l=n.workspaceLabel(o,s.vcs?.branch,r.id);return`${a} : ${l}`});return m(_e,{get when(){return i()},children:r=>(()=>{var o=m9i();return W(o,r),o})()})},L9i=n=>(()=>{var e=v9i(),t=e.firstChild,i=t.nextSibling,r=i.firstChild,o=i.nextSibling;return W(t,m(_e,{get when(){return n.busy()},get fallback(){return m(Cn,{name:"branch",size:"small"})},get children(){return m(wp,{class:"size-[15px]"})}})),W(i,(()=>{var s=sn(()=>!!n.local());return()=>s()?n.language.t("workspace.type.local"):n.language.t("workspace.type.sandbox")})(),r),W(e,m(_e,{get when(){return!n.local()},get fallback(){return(()=>{var s=y9i();return W(s,()=>n.branch()??Ds(n.directory)),s})()},get children(){return m(n.InlineEditor,{get id(){return`workspace:${n.directory}`},get value(){return n.workspaceValue},onSave:s=>{const a=s.trim();a&&(n.renameWorkspace(n.directory,a,n.projectId,n.branch()),n.setEditor("value",n.workspaceValue()))},class:"text-14-medium text-text-base min-w-0 truncate",displayClass:"text-14-medium text-text-base min-w-0 truncate",get editing(){return n.workspaceEditActive()},stopPropagation:!1,openOnDblClick:!1})}}),o),W(o,m(Cn,{get name(){return n.open()?"chevron-down":"chevron-right"},size:"small",class:"text-icon-base"})),e})(),I9i=n=>(()=>{var e=k9i();return W(e,m(Un,{get modal(){return!n.sidebarHovering()},get open(){return n.menuOpen()},onOpenChange:t=>n.setMenuOpen(t),get children(){return[m(ou,{get value(){return n.language.t("common.moreOptions")},placement:"top",get children(){return m(Un.Trigger,{as:oa,icon:"dot-grid",variant:"ghost",class:"size-6 rounded-md","data-action":"workspace-menu",get"data-workspace"(){return ri(n.directory)},get"aria-label"(){return n.language.t("common.moreOptions")}})}}),m(Un.Portal,{get children(){return m(Un.Content,{onCloseAutoFocus:t=>{n.pendingRename()&&(t.preventDefault(),n.setPendingRename(!1),n.openEditor(`workspace:${n.directory}`,n.workspaceValue()))},get children(){return[m(Un.Item,{get disabled(){return n.local()},onSelect:()=>{n.setPendingRename(!0),n.setMenuOpen(!1)},get children(){return m(Un.ItemLabel,{get children(){return n.language.t("common.rename")}})}}),m(_e,{get when(){return!ih()},get children(){return[m(Un.Item,{get disabled(){return n.local()||n.busy()},onSelect:()=>n.showResetWorkspaceDialog(n.root,n.directory),get children(){return m(Un.ItemLabel,{get children(){return n.language.t("common.reset")}})}}),m(Un.Item,{get disabled(){return n.local()||n.busy()},onSelect:()=>n.showDeleteWorkspaceDialog(n.root,n.directory),get children(){return m(Un.ItemLabel,{get children(){return n.language.t("common.delete")}})}})]}})]}})}})]}}),null),W(e,m(_e,{get when(){return!n.touch()},get children(){return m(ou,{get value(){return n.language.t("command.session.new")},placement:"top",get children(){return m(oa,{icon:"new-session",variant:"ghost",class:"size-6 rounded-md opacity-0 pointer-events-none group-hover/workspace:opacity-100 group-hover/workspace:pointer-events-auto group-focus-within/workspace:opacity-100 group-focus-within/workspace:pointer-events-auto","data-action":"workspace-new-session",get"data-workspace"(){return ri(n.directory)},get"aria-label"(){return n.language.t("command.session.new")},onClick:t=>{t.preventDefault(),t.stopPropagation(),n.setHoverSession(void 0),n.clearHoverProjectSoon(),n.createSession()}})}})}}),null),st(t=>Ko(e,{"opacity-100 pointer-events-auto":n.menuOpen(),"opacity-0 pointer-events-none":!n.menuOpen(),"group-hover/workspace:opacity-100 group-hover/workspace:pointer-events-auto":!0,"group-focus-within/workspace:opacity-100 group-focus-within/workspace:pointer-events-auto":!0},t)),e})(),Dot=n=>(()=>{var e=_9i();return W(e,m(z9e,{get href(){return`/${n.slug()}/trellis`},class:"flex items-center gap-1 min-w-0 w-full text-left py-1 rounded-md px-2 pr-3 hover:bg-surface-raised-base-hover [&.active]:bg-surface-base-active",onClick:()=>{n.ctx.setHoverSession(void 0),n.ctx.clearHoverProjectSoon()},get children(){return[(()=>{var t=C9i();return W(t,m(Cn,{name:"checklist",size:"small",class:"text-icon-weak"})),t})(),b9i()]}}),null),W(e,m(_e,{get when(){return n.showNew()},get children(){return m(p9i,{get slug(){return n.slug()},get mobile(){return n.mobile},get sidebarExpanded(){return n.ctx.sidebarExpanded},get clearHoverProjectSoon(){return n.ctx.clearHoverProjectSoon},get setHoverSession(){return n.ctx.setHoverSession}})}}),null),W(e,m(_e,{get when(){return n.loading()},get children(){return m(g9i,{})}}),null),W(e,m(ei,{get each(){return n.sessions()},children:t=>m(h5e,{session:t,get list(){return n.sessions()},get navList(){return n.ctx.navList},get slug(){return n.slug()},get mobile(){return n.mobile},get popover(){return n.popover},get children(){return n.children()},get sidebarExpanded(){return n.ctx.sidebarExpanded},get sidebarHovering(){return n.ctx.sidebarHovering},get nav(){return n.ctx.nav},get hoverSession(){return n.ctx.hoverSession},get setHoverSession(){return n.ctx.setHoverSession},get clearHoverProjectSoon(){return n.ctx.clearHoverProjectSoon},get prefetchSession(){return n.ctx.prefetchSession},get archiveSession(){return n.ctx.archiveSession}})}),null),W(e,m(_e,{get when(){return n.hasMore()},get children(){var t=w9i();return W(t,m(to,{variant:"ghost",class:"flex w-full text-left justify-start text-14-regular text-text-weak pl-9 pr-10",size:"large",onClick:i=>{n.loadMore(),i.currentTarget.blur()},get children(){return n.language.t("common.loadMore")}})),t}}),null),e})(),N9i=n=>{const e=Aa(),t=G1(),i=ha(),r=hot(n.directory),[o,s]=t.child(n.directory,{bootstrap:!1}),[a,l]=Yt({open:!1,pendingRename:!1}),c=J(()=>ri(n.directory)),d=J(()=>P_(o,n.sortNow())),u=J(()=>nse(o.session)),h=J(()=>n.directory===n.project.worktree),f=J(()=>rn(n.ctx.currentDir())===rn(n.directory)),p=J(()=>{const D=o.vcs?.branch,R=D??Ds(n.directory);return n.ctx.workspaceName(n.directory,n.project.id,D)??R}),g=J(()=>n.ctx.workspaceExpanded(n.directory,h())),v=J(()=>g()||f()),y=J(D=>D||o.status==="complete",!1),C=J(()=>d()?.length??0),_=J(()=>o.sessionTotal>C()),w=J(()=>n.ctx.isBusy(n.directory)),x=J(D=>D||w(),!1),M=J(()=>g()&&!y()&&C()===0&&!x()),L=g5e("(hover: none)"),S=J(()=>!M()&&(L()||C()===0||f()&&!e.id)),I=async()=>{s("limit",D=>(D??0)+5),await t.project.loadSessions(n.directory)},E=J(()=>n.ctx.editorOpen(`workspace:${n.directory}`)),A=()=>m(L9i,{local:h,busy:w,open:g,get directory(){return n.directory},language:i,branch:()=>o.vcs?.branch,workspaceValue:p,workspaceEditActive:E,get InlineEditor(){return n.ctx.InlineEditor},get renameWorkspace(){return n.ctx.renameWorkspace},get setEditor(){return n.ctx.setEditor},get projectId(){return n.project.id}}),T=D=>{n.ctx.setWorkspaceExpanded(n.directory,D),!D&&n.ctx.editorOpen(`workspace:${n.directory}`)&&n.ctx.closeEditor()};return Re(()=>{v()&&t.child(n.directory,{bootstrap:!0})}),(()=>{var D=aRe();return aa(r,D,()=>!0),W(D,m(qhe,{variant:"ghost",get open(){return g()},class:"shrink-0",onOpenChange:T,get children(){return[(()=>{var R=x9i(),P=R.firstChild,V=P.firstChild;return W(V,m(_e,{get when(){return E()},get fallback(){return m(qhe.Trigger,{get class(){return`flex items-center justify-between w-full pl-2 py-1.5 rounded-md hover:bg-surface-raised-base-hover transition-[padding] duration-200 ${a.open?"pr-16":"pr-2"} group-hover/workspace:pr-16 group-focus-within/workspace:pr-16`},"data-action":"workspace-toggle",get"data-workspace"(){return ri(n.directory)},get children(){return A()}})},get children(){var $=aRe();return W($,A),st(()=>H1($,`flex items-center justify-between w-full pl-2 py-1.5 rounded-md transition-[padding] duration-200 ${a.open?"pr-16":"pr-2"} group-hover/workspace:pr-16 group-focus-within/workspace:pr-16`)),$}}),null),W(V,m(I9i,{get directory(){return n.directory},local:h,busy:w,menuOpen:()=>a.open,pendingRename:()=>a.pendingRename,setMenuOpen:$=>l("open",$),setPendingRename:$=>l("pendingRename",$),get sidebarHovering(){return n.ctx.sidebarHovering},touch:L,language:i,workspaceValue:p,get openEditor(){return n.ctx.openEditor},get showResetWorkspaceDialog(){return n.ctx.showResetWorkspaceDialog},get showDeleteWorkspaceDialog(){return n.ctx.showDeleteWorkspaceDialog},get root(){return n.project.worktree},get setHoverSession(){return n.ctx.setHoverSession},get clearHoverProjectSoon(){return n.ctx.clearHoverProjectSoon},createSession:()=>n.ctx.createSession(n.directory)}),null),st(()=>mt(P,"data-workspace",ri(n.directory))),R})(),m(qhe.Content,{get children(){return m(Dot,{slug:c,get mobile(){return n.mobile},get popover(){return n.popover},get ctx(){return n.ctx},showNew:S,loading:M,sessions:d,children:u,hasMore:_,loadMore:I,language:i})}})]}})),st(R=>Ko(D,{"opacity-30":r.isActiveDraggable,"opacity-50 pointer-events-none":w()},R)),D})()},E9i=n=>{const e=G1(),t=ha(),i=J(()=>{const[h,f]=e.child(n.project.worktree);return{store:h,setStore:f}}),r=J(()=>ri(n.project.worktree)),o=J(()=>P_(i().store,n.sortNow())),s=J(()=>nse(i().store.session)),a=J(h=>h||i().store.status==="complete",!1),l=J(()=>o()?.length??0),c=J(()=>!a()&&l()===0),d=J(()=>i().store.sessionTotal>l()),u=async()=>{i().setStore("limit",h=>(h??0)+5),await e.project.loadSessions(n.project.worktree)};return(()=>{var h=S9i();return aa(f=>n.ctx.setScrollContainerRef(f,n.mobile),h),W(h,m(Dot,{slug:r,get mobile(){return n.mobile},get popover(){return n.popover},get ctx(){return n.ctx},showNew:()=>!1,loading:c,sessions:o,children:s,hasMore:d,loadMore:u,language:t})),h})()};var T9i={};au(T9i,{Arrow:()=>y2,CheckboxItem:()=>bce,Content:()=>Rot,ContextMenu:()=>Ss,Group:()=>Qx,GroupLabel:()=>wce,Icon:()=>_ce,Item:()=>xce,ItemDescription:()=>Sce,ItemIndicator:()=>Mce,ItemLabel:()=>Lce,Portal:()=>Ice,RadioGroup:()=>Nce,RadioItem:()=>Ece,Root:()=>Vot,Separator:()=>nk,Sub:()=>Tce,SubContent:()=>Ace,SubTrigger:()=>Dce,Trigger:()=>Hot,useContextMenuContext:()=>Oot});function Rot(n){const e=td(),[t,i]=Je(n,["onCloseAutoFocus","onInteractOutside"]);let r=!1;return m(Jrt,k({onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),!a.defaultPrevented&&r&&a.preventDefault(),r=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),!a.defaultPrevented&&!e.isModal()&&(r=!0)}},i))}var Pot=oi();function A9i(){return Wn(Pot)}function Oot(){const n=A9i();if(n===void 0)throw new Error("[kobalte]: `useContextMenuContext` must be used within a `ContextMenu` component");return n}function Vot(n){const e=`contextmenu-${$s()}`,{direction:t}=m2(),i=Pn({id:e,placement:t()==="rtl"?"left-start":"right-start",gutter:2,shift:2},n),[r,o]=Je(i,["onOpenChange"]),[s,a]=Ye({x:0,y:0}),l=u3({defaultOpen:!1,onOpenChange:d=>r.onOpenChange?.(d)}),c={setAnchorRect:a};return m(Pot.Provider,{value:c,get children(){return m(not,k({get open(){return l.isOpen()},get onOpenChange(){return l.setIsOpen},getAnchorRect:s},o))}})}function Hot(n){const e=td(),t=Ah(),i=Oot(),r=Pn({id:e.generateId("trigger")},n),[o,s]=Je(r,["ref","style","disabled","onContextMenu","onPointerDown","onPointerMove","onPointerCancel","onPointerUp"]);let a=0;const l=()=>{window.clearTimeout(a)};Oe(()=>{l()});const c=g=>{if(o.disabled){In(g,o.onContextMenu);return}l(),g.preventDefault(),g.stopPropagation(),i.setAnchorRect({x:g.clientX,y:g.clientY}),t.isOpen()?t.focusContent():t.open(!0)},d=g=>g.pointerType==="touch"||g.pointerType==="pen";return m(zi,k({as:"div",ref(g){var v=qr(t.setTriggerRef,o.ref);typeof v=="function"&&v(g)},get style(){return su({"-webkit-touch-callout":"none"},o.style)},get"data-disabled"(){return o.disabled?"":void 0},onContextMenu:c,onPointerDown:g=>{In(g,o.onPointerDown),!o.disabled&&d(g)&&(l(),i.setAnchorRect({x:g.clientX,y:g.clientY}),a=window.setTimeout(()=>t.open(!1),700))},onPointerMove:g=>{In(g,o.onPointerMove),!o.disabled&&d(g)&&l()},onPointerCancel:g=>{In(g,o.onPointerCancel),!o.disabled&&d(g)&&l()},onPointerUp:g=>{In(g,o.onPointerUp),!o.disabled&&d(g)&&l()}},()=>t.dataset(),s))}var Ss=Object.assign(Vot,{Arrow:y2,CheckboxItem:bce,Content:Rot,Group:Qx,GroupLabel:wce,Icon:_ce,Item:xce,ItemDescription:Sce,ItemIndicator:Mce,ItemLabel:Lce,Portal:Ice,RadioGroup:Nce,RadioItem:Ece,Separator:nk,Sub:Tce,SubContent:Ace,SubTrigger:Dce,Trigger:Hot});function D9i(n){return m(Ss,k(n,{"data-component":"context-menu"}))}function R9i(n){const[e,t]=Je(n,["class","classList","children"]);return m(Ss.Trigger,k(t,{"data-slot":"context-menu-trigger",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function P9i(n){const[e,t]=Je(n,["class","classList","children"]);return m(Ss.Icon,k(t,{"data-slot":"context-menu-icon",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function O9i(n){return m(Ss.Portal,n)}function V9i(n){const[e,t]=Je(n,["class","classList","children"]);return m(Ss.Content,k(t,{"data-component":"context-menu-content",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function H9i(n){const[e,t]=Je(n,["class","classList"]);return m(Ss.Arrow,k(t,{"data-slot":"context-menu-arrow",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}}}))}function $9i(n){const[e,t]=Je(n,["class","classList"]);return m(Ss.Separator,k(t,{"data-slot":"context-menu-separator",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}}}))}function F9i(n){const[e,t]=Je(n,["class","classList","children"]);return m(Ss.Group,k(t,{"data-slot":"context-menu-group",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function z9i(n){const[e,t]=Je(n,["class","classList","children"]);return m(Ss.GroupLabel,k(t,{"data-slot":"context-menu-group-label",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function B9i(n){const[e,t]=Je(n,["class","classList","children"]);return m(Ss.Item,k(t,{"data-slot":"context-menu-item",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function j9i(n){const[e,t]=Je(n,["class","classList","children"]);return m(Ss.ItemLabel,k(t,{"data-slot":"context-menu-item-label",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function W9i(n){const[e,t]=Je(n,["class","classList","children"]);return m(Ss.ItemDescription,k(t,{"data-slot":"context-menu-item-description",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function q9i(n){const[e,t]=Je(n,["class","classList","children"]);return m(Ss.ItemIndicator,k(t,{"data-slot":"context-menu-item-indicator",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function U9i(n){const[e,t]=Je(n,["class","classList","children"]);return m(Ss.RadioGroup,k(t,{"data-slot":"context-menu-radio-group",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function Z9i(n){const[e,t]=Je(n,["class","classList","children"]);return m(Ss.RadioItem,k(t,{"data-slot":"context-menu-radio-item",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function K9i(n){const[e,t]=Je(n,["class","classList","children"]);return m(Ss.CheckboxItem,k(t,{"data-slot":"context-menu-checkbox-item",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function G9i(n){return m(Ss.Sub,n)}function X9i(n){const[e,t]=Je(n,["class","classList","children"]);return m(Ss.SubTrigger,k(t,{"data-slot":"context-menu-sub-trigger",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function Y9i(n){const[e,t]=Je(n,["class","classList","children"]);return m(Ss.SubContent,k(t,{"data-component":"context-menu-sub-content",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}const Cc=Object.assign(D9i,{Trigger:R9i,Icon:P9i,Portal:O9i,Content:V9i,Arrow:H9i,Separator:$9i,Group:F9i,GroupLabel:z9i,Item:B9i,ItemLabel:j9i,ItemDescription:W9i,ItemIndicator:q9i,RadioGroup:U9i,RadioItem:Z9i,CheckboxItem:K9i,Sub:G9i,SubTrigger:X9i,SubContent:Y9i});var J9i=le('<div class="bg-background-base rounded-xl p-1">'),Q9i=le('<div class="-m-3 p-2 flex flex-col w-72"><div class="px-4 pt-2 pb-1 flex items-center gap-2"><div class="text-14-medium text-text-strong truncate grow"></div></div><div class="px-4 pb-2 text-12-medium text-text-weak"></div><div class="px-2 pb-2 flex flex-col gap-2"></div><div class="px-2 py-2 border-t border-border-weak-base">'),e6i=le('<div class="flex flex-col gap-1"><div class="px-2 py-0.5 flex items-center gap-1 min-w-0"><div class="shrink-0 size-6 flex items-center justify-center"></div><span class="truncate text-14-medium text-text-base">'),t6i=le("<div>");const n6i=n=>{const e=J(()=>n.projects().find(t=>t.worktree===n.activeProject()));return m(_e,{get when(){return e()},children:t=>(()=>{var i=J9i();return W(i,m(Pke,{get project(){return t()}})),i})()})},i6i=n=>{const e=Iae(),t=_3(),i=J(()=>n.dirs().reduce((o,s)=>o+e.project.unseenCount(s),0)),r=()=>n.dirs().filter(o=>e.project.unseenCount(o)>0).forEach(o=>e.project.markViewed(o));return m(Cc,{get modal(){return!n.sidebarHovering()},onOpenChange:o=>{n.setMenu(o),n.setSuppressHover(o),o&&n.setOpen(!1)},get children(){return[m(Cc.Trigger,{as:"button",type:"button",get"aria-label"(){return Ake(n.project)},"data-action":"project-switch",get"data-project"(){return ri(n.project.worktree)},get classList(){return{"flex items-center justify-center size-10 p-1 rounded-lg overflow-hidden transition-colors cursor-default":!0,"bg-transparent border-2 border-icon-strong-base hover:bg-surface-base-hover":n.selected(),"bg-transparent border border-transparent hover:bg-surface-base-hover hover:border-border-weak-base":!n.selected()&&!n.active(),"bg-surface-base-hover border border-border-weak-base":!n.selected()&&n.active()}},onPointerDown:o=>{if(o.button===0&&!o.ctrlKey){n.setOpen(!1),n.setSuppressHover(!0);return}n.overlay()&&(o.button!==2&&!(o.button===0&&o.ctrlKey)||(n.setOpen(!1),n.setSuppressHover(!0),o.preventDefault()))},onMouseEnter:o=>{n.overlay()&&(n.suppressHover()||n.onProjectMouseEnter(n.project.worktree,o))},onMouseLeave:()=>{n.suppressHover()&&n.setSuppressHover(!1),n.overlay()&&n.onProjectMouseLeave(n.project.worktree)},onFocus:()=>{n.overlay()&&(n.suppressHover()||n.onProjectFocus(n.project.worktree))},onClick:()=>{if(n.setOpen(!1),n.selected()){t.sidebar.toggle();return}n.navigateToProject(n.project.worktree)},onBlur:()=>n.setOpen(!1),get children(){return m(Pke,{get project(){return n.project},notify:!0})}}),m(Cc.Portal,{get children(){return m(Cc.Content,{get children(){return[m(Cc.Item,{onSelect:()=>n.showEditProjectDialog(n.project),get children(){return m(Cc.ItemLabel,{get children(){return n.language.t("common.edit")}})}}),m(Cc.Item,{"data-action":"project-workspaces-toggle",get"data-project"(){return ri(n.project.worktree)},get disabled(){return sn(()=>n.project.vcs!=="git")()&&!n.workspacesEnabled(n.project)},onSelect:()=>n.toggleProjectWorkspaces(n.project),get children(){return m(Cc.ItemLabel,{get children(){return sn(()=>!!n.workspacesEnabled(n.project))()?n.language.t("sidebar.workspaces.disable"):n.language.t("sidebar.workspaces.enable")}})}}),m(Cc.Item,{"data-action":"project-clear-notifications",get"data-project"(){return ri(n.project.worktree)},get disabled(){return i()===0},onSelect:r,get children(){return m(Cc.ItemLabel,{get children(){return n.language.t("sidebar.project.clearNotifications")}})}}),m(Cc.Separator,{}),m(Cc.Item,{"data-action":"project-close-menu",get"data-project"(){return ri(n.project.worktree)},onSelect:()=>n.closeProject(n.project.worktree),get children(){return m(Cc.ItemLabel,{get children(){return n.language.t("common.close")}})}})]}})}})]}})},r6i=n=>(()=>{var e=Q9i(),t=e.firstChild,i=t.firstChild,r=t.nextSibling,o=r.nextSibling,s=o.nextSibling;return W(i,()=>Ake(n.project)),W(r,()=>n.language.t("sidebar.project.recentSessions")),W(o,m(_e,{get when(){return n.workspaceEnabled()},get fallback(){return m(ei,{get each(){return n.projectSessions().slice(0,2)},children:a=>m(h5e,k(()=>n.ctx.sessionProps,{session:a,get list(){return n.projectSessions()},get slug(){return ri(n.project.worktree)},dense:!0,get mobile(){return n.mobile},popover:!1,get children(){return n.projectChildren()}}))})},get children(){return m(ei,{get each(){return n.workspaces()},children:a=>{const l=J(()=>n.workspaceSessions(a)),c=J(()=>n.workspaceChildren(a));return(()=>{var d=e6i(),u=d.firstChild,h=u.firstChild,f=h.nextSibling;return W(h,m(Cn,{name:"branch",size:"small",class:"text-icon-base"})),W(f,()=>n.label(a)),W(d,m(ei,{get each(){return l().slice(0,2)},children:p=>m(h5e,k(()=>n.ctx.sessionProps,{session:p,get list(){return l()},get slug(){return ri(a)},dense:!0,get mobile(){return n.mobile},popover:!1,get children(){return c()}}))}),null),d})()}})}})),W(s,m(to,{variant:"ghost",class:"flex w-full text-left justify-start text-text-base px-2 hover:bg-transparent active:bg-transparent",onClick:()=>{n.ctx.openSidebar(),n.ctx.onHoverOpenChanged(n.project.worktree,!1),!n.selected()&&n.ctx.navigateToProject(n.project.worktree)},get children(){return n.language.t("sidebar.project.viewAllSessions")}})),e})(),o6i=n=>{const e=G1(),t=ha(),i=hot(n.project.worktree),r=J(()=>n.ctx.currentProject()?.worktree===n.project.worktree),o=J(()=>n.ctx.workspaceIds(n.project).slice(0,2)),s=J(()=>n.ctx.workspacesEnabled(n.project)),a=J(()=>n.ctx.workspaceIds(n.project)),[l,c]=Yt({menu:!1,suppressHover:!1}),d=()=>n.ctx.hoverProject()===n.project.worktree,u=J(()=>!n.mobile&&n.ctx.sidebarOpened()),h=J(()=>!n.mobile&&!n.ctx.sidebarOpened()),f=J(()=>l.menu||(u()||h())&&d()),p=()=>d()&&u()&&!r()&&!l.menu,g=M=>{const[L]=e.child(M,{bootstrap:!1}),S=M===n.project.worktree?t.t("workspace.type.local"):t.t("workspace.type.sandbox"),I=n.ctx.workspaceLabel(M,L.vcs?.branch,n.project.id);return`${S} : ${I}`},v=J(()=>e.child(n.project.worktree,{bootstrap:!1})[0]),y=J(()=>P_(v(),n.sortNow())),C=J(()=>nse(v().session)),_=M=>{const[L]=e.child(M,{bootstrap:!1});return P_(L,n.sortNow())},w=M=>{const[L]=e.child(M,{bootstrap:!1});return nse(L.session)},x=()=>m(i6i,{get project(){return n.project},get mobile(){return n.mobile},get nav(){return n.ctx.nav},get sidebarHovering(){return n.ctx.sidebarHovering},selected:r,active:f,overlay:h,suppressHover:()=>l.suppressHover,dirs:a,get onProjectMouseEnter(){return n.ctx.onProjectMouseEnter},get onProjectMouseLeave(){return n.ctx.onProjectMouseLeave},get onProjectFocus(){return n.ctx.onProjectFocus},get navigateToProject(){return n.ctx.navigateToProject},get showEditProjectDialog(){return n.ctx.showEditProjectDialog},get toggleProjectWorkspaces(){return n.ctx.toggleProjectWorkspaces},get workspacesEnabled(){return n.ctx.workspacesEnabled},get closeProject(){return n.ctx.closeProject},setMenu:M=>c("menu",M),setOpen:M=>n.ctx.onHoverOpenChanged(n.project.worktree,M),setSuppressHover:M=>c("suppressHover",M),language:t});return(()=>{var M=t6i();return aa(i,M,()=>!0),W(M,m(_e,{get when(){return sn(()=>!!u())()&&!r()},get fallback(){return x()},get children(){return m(Iot,{get open(){return sn(()=>!!(!l.suppressHover&&p()))()&&!l.menu},openDelay:0,closeDelay:0,placement:"right-start",gutter:6,get trigger(){return x()},onOpenChange:L=>{l.menu||L&&l.suppressHover||(n.ctx.onHoverOpenChanged(n.project.worktree,L),L&&n.ctx.setHoverSession(void 0))},get children(){return m(r6i,{get project(){return n.project},get mobile(){return n.mobile},selected:r,workspaceEnabled:s,workspaces:o,label:g,projectSessions:y,projectChildren:C,workspaceSessions:_,workspaceChildren:w,get ctx(){return n.ctx},language:t})}})}})),st(()=>M.classList.toggle("opacity-30",!!i.isActiveDraggable)),M})()};var s6i=le('<div class="h-full w-full flex flex-col items-center gap-3 px-3 py-3 overflow-y-auto no-scrollbar">'),a6i=le('<div class="flex h-full w-full min-w-0 overflow-hidden"><div data-component=sidebar-rail class="w-16 shrink-0 bg-surface-raised-base flex flex-col items-center overflow-hidden"><div class="flex-1 min-h-0 w-full"></div><div class="shrink-0 w-full pt-3 pb-6 flex flex-col items-center gap-2"></div></div><div>'),l6i=le('<span class="text-icon-base text-12-medium">'),c6i=le('<div class="flex items-center gap-2"><span>');const d6i=n=>{const e=J(()=>!!n.mobile||n.opened()),t=()=>n.mobile?"bottom":"right";let i;return Re(()=>{const r=i;if(r){if(e()){r.removeAttribute("inert");return}r.setAttribute("inert","")}}),(()=>{var r=a6i(),o=r.firstChild,s=o.firstChild,a=s.nextSibling,l=o.nextSibling;return Ju(o,"mousemove",n.aimMove,!0),W(s,m(aot,{get onDragStart(){return n.handleDragStart},get onDragEnd(){return n.handleDragEnd},get onDragOver(){return n.handleDragOver},collisionDetector:oot,get children(){return[m(lot,{}),m(got,{}),(()=>{var c=s6i();return W(c,m(uot,{get ids(){return n.projects().map(d=>d.worktree)},get children(){return m(ei,{get each(){return n.projects()},children:d=>n.renderProject(d)})}}),null),W(c,m(ou,{get placement(){return t()},get value(){return(()=>{var d=c6i(),u=d.firstChild;return W(u,()=>n.openProjectLabel),W(d,m(_e,{get when(){return sn(()=>!n.mobile)()&&!!n.openProjectKeybind()},get children(){var h=l6i();return W(h,()=>n.openProjectKeybind()),h}}),null),d})()},get children(){return m(oa,{icon:"plus",variant:"ghost",size:"large",get onClick(){return n.onOpenProject},get"aria-label"(){return sn(()=>typeof n.openProjectLabel=="string")()?n.openProjectLabel:void 0}})}}),null),c})(),m(cot,{get children(){return n.renderProjectOverlay()}})]}})),W(a,m(Ort,{get placement(){return t()},get title(){return n.settingsLabel()},get keybind(){return n.settingsKeybind()??""},get children(){return m(oa,{icon:"settings-gear",variant:"ghost",size:"large",get onClick(){return n.onOpenSettings},get"aria-label"(){return n.settingsLabel()}})}}),null),W(a,m(ou,{get placement(){return t()},get value(){return n.helpLabel()},get children(){return m(oa,{icon:"help",variant:"ghost",size:"large",get onClick(){return n.onOpenHelp},get"aria-label"(){return n.helpLabel()}})}}),null),aa(c=>{i=c},l),W(l,()=>n.renderPanel()),st(c=>{var d={"flex-1 flex h-full min-h-0 min-w-0 overflow-hidden":!0,"pointer-events-none":!e()},u=!e();return c.e=Ko(l,d,c.e),u!==c.t&&mt(l,"aria-hidden",c.t=u),c},{e:void 0,t:void 0}),r})()};Fs(["mousemove"]);var u6i=le('<div class="flex flex-col gap-4 pl-6 pr-2.5 pb-3"><div class="flex flex-col gap-1"><span class="text-14-regular text-text-strong"></span><span class="text-12-regular text-text-weak"></span></div><div class="flex justify-end gap-2">'),h6i=le('<div class="flex flex-col gap-4 pl-6 pr-2.5 pb-3"><div class="flex flex-col gap-1"><span class="text-14-regular text-text-strong"></span><span class="text-12-regular text-text-weak"> <!> </span></div><div class="flex justify-end gap-2">'),f6i=le('<span class="text-12-regular text-text-base truncate select-text">'),p6i=le('<div class="shrink-0 pl-1 py-1"><div class="group/project flex items-start justify-between gap-2 py-2 pl-2 pr-0"><div class="flex flex-col min-w-0">'),g6i=le('<div class="flex-1 min-h-0 flex flex-col">'),m6i=le('<div><div class="shrink-0 px-3 py-3"><div class="rounded-xl bg-background-base shadow-xs-border-base"data-component=getting-started><div class="p-3 flex flex-col gap-6"><div class="flex flex-col gap-2"><div class="text-14-medium text-text-strong"></div><div class="text-14-regular text-text-base"style=line-height:var(--line-height-normal)></div><div class="text-14-regular text-text-base"style=line-height:var(--line-height-normal)></div></div><div data-component=getting-started-actions>'),v6i=le('<div class="flex-1 min-h-0 -mt-4 flex items-center justify-center px-6 pb-64 text-center"><div class="mt-8 flex max-w-60 flex-col items-center gap-6 text-center"><div class="flex flex-col gap-3"><div class="text-14-medium text-text-strong"></div><div class="text-14-regular text-text-base"style=line-height:var(--line-height-normal)>'),lRe=le('<div class="shrink-0 py-4">'),y6i=le('<div class="relative flex-1 min-h-0"><div class="size-full flex flex-col py-2 gap-4 overflow-y-auto no-scrollbar [overflow-anchor:none]">'),k6i=le('<div class="flex-1 min-h-0">'),C6i=le('<div class=" hidden w-12 shrink-0 bg-background-base flex flex-col items-center py-2 gap-2 z-20"><div class="flex-1 w-full flex flex-col items-center gap-1 overflow-y-auto no-scrollbar"><button type=button class="flex items-center justify-center size-9 p-1 rounded-md transition-colors hover:bg-surface-base-hover"></button></div><div class="shrink-0 w-full flex flex-col items-center gap-1 pb-2"><button type=button class="flex items-center justify-center size-9 p-1 rounded-md transition-colors hover:bg-surface-base-hover">'),cRe=le("<div class=size-full>"),b6i=le('<div class="relative bg-background-base flex-1 min-h-0 min-w-0 flex flex-col select-none [&amp;_input]:select-text [&amp;_textarea]:select-text [&amp;_[contenteditable]]:select-text"><div class="flex-1 min-h-0 min-w-0 flex overflow-hidden"><div class="flex-1 min-h-0 relative"><div class="size-full relative overflow-x-hidden"><div class=xl:hidden><div></div><nav data-component=sidebar-nav-mobile></nav></div><div><main>'),w6i=le('<button type=button class="flex items-center justify-center size-9 p-0.5 rounded-md transition-colors">');function _6i(n){const[e,t,,i]=vs(yo.global("layout.page",["layout.page.v1"]),Yt({lastProjectSession:{},activeProject:void 0,activeWorkspace:void 0,workspaceOrder:{},workspaceName:{},workspaceBranchName:{},workspaceExpanded:{},gettingStartedDismissed:!1,activityBarVisible:!0,minimapVisible:!1,panelMaximized:!1,panelPosition:"bottom",panelAlignment:"center"})),r=J(()=>i());let o,s=0,a=!1;const l=Aa(),c=bp(),d=G1(),u=_3(),h=J(()=>u.ready()),f=a2(),p=J_(),g=w3(),v=Iae(),y=dMn(),C=Y3e(),_=k3();q4i(_);const w=X3e(),x=oy(),M=sze(),L=qse(),S=ha(),I=nh(l.dir),E=J(()=>{const K=l.dir;if(!K)return{slug:K,dir:""};const ee=nh(K);return ee?{slug:K,dir:d.peek(ee,{bootstrap:!1})[0].path.directory||ee}:{slug:K,dir:""}}),A=J(()=>L.ids().map(K=>[K,L.themes()[K]])),T=["system","light","dark"],D={system:"theme.scheme.system",light:"theme.scheme.light",dark:"theme.scheme.dark"},R=K=>S.t(D[K]),P=J(()=>E().dir),[V,$]=Yt({autoselect:!I,busyWorkspaces:{},hoverSession:void 0,hoverProject:void 0,scrollSessionKey:void 0,nav:void 0,sortNow:Date.now(),sizing:!1,peek:void 0,peeked:!1}),j=_5i(),B=(K,ee)=>{const Ce=rn(K);if(ee){$("busyWorkspaces",Ce,!0);return}$("busyWorkspaces",jt(Se=>{delete Se[Ce]}))},te=K=>!!V.busyWorkspaces[rn(K)],U=()=>V.sortNow;let Y;const X=setTimeout(()=>{$("sortNow",Date.now()),Y=setInterval(()=>$("sortNow",Date.now()),6e4)},6e4-Date.now()%6e4),se=W4i({enabled:()=>!u.sidebar.opened(),active:()=>V.hoverProject,el:()=>V.nav?.querySelector("[data-component='sidebar-rail']")??V.nav,onActivate:K=>{d.child(K),$("hoverProject",K),$("hoverSession",void 0)}});Oe(()=>{a=!0,s+=1,clearTimeout(X),Y&&clearInterval(Y),We!==void 0&&clearTimeout(We),se.reset()}),ur(()=>{const K=()=>$("sizing",!1),ee=()=>Ke(),Ce=()=>{document.visibilityState==="hidden"&&Ke()};window.addEventListener("pointerup",K),window.addEventListener("pointercancel",K),window.addEventListener("blur",K),window.addEventListener("blur",ee),document.addEventListener("visibilitychange",Ce),Oe(()=>{window.removeEventListener("pointerup",K),window.removeEventListener("pointercancel",K),window.removeEventListener("blur",K),window.removeEventListener("blur",ee),document.removeEventListener("visibilitychange",Ce)})});const pe=J(()=>!u.sidebar.opened()&&V.hoverProject!==void 0),Ae=J(()=>u.sidebar.opened()||pe()),Fe=K=>{$("hoverProject",K),se.reset()},be=()=>queueMicrotask(()=>Fe(void 0)),Ve=K=>$("hoverSession",K),Ke=()=>{$("hoverSession",void 0),Fe(void 0)};let We;const At=J(()=>{const K=V.hoverProject;if(K)return u.projects.list().find(ee=>ee.worktree===K)});J(()=>{const K=V.peek;if(K)return u.projects.list().find(ee=>ee.worktree===K)}),Re(()=>{const K=At();if(K){We!==void 0&&(clearTimeout(We),We=void 0),$("peek",K.worktree),$("peeked",!0);return}$("peeked",!1),V.peek!==void 0&&(We!==void 0&&clearTimeout(We),We=window.setTimeout(()=>{We=void 0,$("peek",void 0)},180))}),Re(()=>{u.sidebar.opened()&&Fe(void 0)}),Re(()=>{if(!V.autoselect)return;const K=l.dir;!K||!nh(K)||$("autoselect",!1)});const Ct=j.editorOpen,Z=j.openEditor,wt=j.closeEditor,vt=j.setEditor,cn=j.InlineEditor,Lt=()=>{u.sidebar.opened()||Ke()},Qt=K=>{Lt(),_(K),u.mobileSidebar.hide()},vr=K=>{if(!K)return;Lt();const ee=ri(K);c.createClient({directory:K,throwOnError:!0}).session.create().then(Se=>Se.data??void 0).then(Se=>{if(!Se)return;const Ge=ts(K,Se.id);u.handoff.setTabs(ee,Se.id);const[qe,Et]=d.child(K,{bootstrap:!1});qe.session.some(Nt=>Nt.id===Se.id)||(Et("session",Nt=>[...Nt,Se]),Et("sessionTotal",Nt=>Math.max(Nt,qe.sessionTotal+1))),Vt(K,Se.id,Ge);const en=new URLSearchParams(window.location.search).get("view");_(`/${ee}/session/${Se.id}${en?`?view=${encodeURIComponent(en)}`:""}`),u.mobileSidebar.hide()}).catch(Se=>{y.push(`${S.t("prompt.toast.sessionCreateFailed.title")}: ${TL(Se,S.t("common.requestFailed"))}`,"toast")})};function qs(K=1){const ee=A().map(([qe])=>qe);if(ee.length===0)return;const Ce=ee.indexOf(L.themeId()),Se=Ce===-1?0:(Ce+K+ee.length)%ee.length,Ge=ee[Se];L.setTheme(Ge),y.push(`${S.t("toast.theme.title")}: ${L.name(Ge)}`,"toast")}function oo(K=1){const ee=L.colorScheme(),Ce=T.indexOf(ee),Se=Ce===-1?0:(Ce+K+T.length)%T.length,Ge=T[Se];L.setColorScheme(Ge),y.push(`${S.t("toast.scheme.title")}: ${R(Ge)}`,"toast")}function Ms(K){K!==S.locale()&&(S.setLocale(K),y.push(`${S.t("toast.language.title")}: ${S.t("toast.language.description",{language:S.label(K)})}`,"toast"))}function Zi(K=1){const ee=S.locales,Ce=ee.indexOf(S.locale()),Se=Ce===-1?0:(Ce+K+ee.length)%ee.length,Ge=ee[Se];Ge&&Ms(Ge)}function Ri(K){const ee=p.appearance.fontSize();p.appearance.setFontSize(Math.max(8,Math.min(72,ee+K)))}function di(){p.appearance.setFontSize(14)}const bi=()=>ur(()=>{if(!f.checkUpdate||!f.update||!f.restart)return;let K;const ee=()=>f.checkUpdate().then(({updateAvailable:Ce,version:Se})=>{Ce&&y.push(`${S.t("toast.update.title")}: ${S.t("toast.update.description",{version:Se??""})}`,"toast")});Re(()=>{if(p.ready()){if(!p.updates.startup()){if(K===void 0)return;clearInterval(K),K=void 0;return}K===void 0&&(ee(),K=setInterval(ee,600*1e3))}}),Oe(()=>{K!==void 0&&clearInterval(K)})}),wo=()=>ur(()=>{const K=new Map,ee=5e3,Ce=c.event.listen(Se=>{if(Se.details?.type==="worktree.ready"){B(Se.name,!1),EL.ready(Se.name);return}if(Se.details?.type==="worktree.failed"){B(Se.name,!1),EL.failed(Se.name,Se.details.properties?.message??S.t("common.requestFailed"));return}if(Se.details?.type==="question.replied"||Se.details?.type==="question.rejected"||Se.details?.type==="permission.replied"){const ma=Se.details.properties,Dh=`${Se.name}:${ma.sessionID}`;K.delete(Dh);return}if(Se.details?.type!=="permission.asked"&&Se.details?.type!=="question.asked")return;const Ge=Se.details.type==="permission.asked"?S.t("notification.permission.title"):S.t("notification.question.title");Se.details.type;const qe=Se.name,Et=Se.details.properties;if(Se.details.type==="permission.asked"&&C.autoResponds(Se.details.properties,qe))return;const[Gt]=d.child(qe,{bootstrap:!1}),en=Gt.session.find(ma=>ma.id===Et.sessionID),Nt=`${qe}:${Et.sessionID}`,Ft=en?.title??S.t("command.session.new"),ji=Ds(qe),Cr=Se.details.type==="permission.asked"?S.t("notification.permission.description",{sessionTitle:Ft,projectName:ji}):S.t("notification.question.description",{sessionTitle:Ft,projectName:ji}),ar=`/${ri(qe)}/session/${Et.sessionID}`,Er=Date.now(),Ki=K.get(Nt)??0;if(Er-Ki<ee)return;K.set(Nt,Er),Se.details.type==="permission.asked"&&(p.sounds.permissionsEnabled()&&q2e(p.sounds.permissions()),p.notifications.permissions()&&f.notify(Ge,Cr,ar)),Se.details.type==="question.asked"&&p.notifications.agent()&&f.notify(Ge,Cr,ar);const zn=l.id;rn(qe)===rn(P())&&Et.sessionID===zn||rn(qe)===rn(P())&&en?.parentID===zn||y.push(`${Ge}: ${Cr}`,"toast")});Oe(Ce),Re(()=>{const Se=l.id;if(!P()||!Se)return;const Ge=`${P()}:${Se}`;K.delete(Ge);const[qe]=d.child(P(),{bootstrap:!1}),Et=qe.session.filter(Gt=>Gt.parentID===Se);for(const Gt of Et)K.delete(`${P()}:${Gt.id}`)})});bi(),wo();function Us(K,ee){if(!o||V.scrollSessionKey===ee)return;const Ce=o.querySelector(`[data-session-id="${K}"]`);if(!Ce)return;const Se=o.getBoundingClientRect(),Ge=Ce.getBoundingClientRect();if(Ge.top>=Se.top&&Ge.bottom<=Se.bottom){$("scrollSessionKey",ee);return}$("scrollSessionKey",ee),Ce.scrollIntoView({block:"nearest",behavior:"smooth"})}const Pi=J(()=>{const K=P();if(!K)return;const ee=rn(K),Ce=u.projects.list(),Se=Ce.find(Nt=>Nt.sandboxes?.some(Ft=>rn(Ft)===ee));if(Se)return Se;const Ge=Ce.find(Nt=>rn(Nt.worktree)===ee);if(Ge)return Ge;const[qe]=d.child(K,{bootstrap:!1}),Et=qe.project;if(!Et)return;const en=d.data.project.find(Nt=>Nt.id===Et)?.worktree;if(en)return Ce.find(Nt=>Nt.worktree===en)}),[fr]=mo(async()=>{if(await i.promise,await u.ready.promise,!Mn(()=>V.autoselect))return;const K=u.projects.list(),ee=g.projects.last();if(K.length===0){if(!ee)return;await Le(ee,!0);return}const Ce=K.find(Se=>Se.worktree===ee)??K[0];Ce&&await Le(Ce.worktree,!0)},{initialValue:void 0}),sr=(K,ee,Ce)=>{const Se=rn(K),Ge=e.workspaceName[Se]??e.workspaceName[K];if(Ge)return Ge;if(ee&&Ce)return e.workspaceBranchName[ee]?.[Ce]},Kr=(K,ee,Ce,Se)=>{const Ge=rn(K);t("workspaceName",Ge,ee),Ce&&Se&&(e.workspaceBranchName[Ce]||t("workspaceBranchName",Ce,{}),t("workspaceBranchName",Ce,Se,ee))},Oi=(K,ee,Ce)=>sr(K,Ce,ee)??ee??Ds(K),Ir=J(()=>{const K=Pi();return!K||K.vcs!=="git"?!1:u.sidebar.workspaces(K.worktree)()}),es=J(()=>{const K=Pi();if(!K)return[];if(!Ir())return[K.worktree];const ee=P();return rS(K).filter(Ce=>{const Se=e.workspaceExpanded[Ce]??Ce===K.worktree,Ge=rn(Ce)===rn(ee);return Se||Ge})});Re(()=>{if(!r()||!h())return;const K=u.projects.list();for(const[ee,Ce]of Object.entries(e.workspaceExpanded)){if(!Ce)continue;const Se=rn(ee),Ge=K.find(qe=>rn(qe.worktree)===Se||qe.sandboxes?.some(Et=>rn(Et)===Se));Ge&&(Ge.vcs==="git"&&u.sidebar.workspaces(Ge.worktree)()||t("workspaceExpanded",ee,!1))}});const eo=J(()=>{const K=Date.now(),ee=es();if(ee.length===0)return[];const Ce=[];for(const Se of ee){const[Ge]=d.child(Se,{bootstrap:!0}),qe=P_(Ge,K);Ce.push(...qe)}return Ce}),Kn=200,gc=2,Pa=10,mc=4,yr={value:0},_o=new Map,Te=10,He=new Map,yt=K=>{const ee=He.get(K);if(ee)return ee;const Ce=new Set;return He.set(K,Ce),Ce},at=(K,ee)=>{const Ce=yt(K);return yUe({seen:Ce,keep:ee,limit:Te,preserve:l.id&&rn(K)===rn(P())?[l.id]:void 0})};Re(()=>{const K=new Set(es());for(const ee of[...He.keys()])K.has(ee)||He.delete(ee)}),Re(()=>{E(),c.url,yr.value+=1,Cbn(),_o.clear()}),Re(()=>{const K=new Set(es());for(const[ee,Ce]of _o)K.has(ee)||(Ce.pending.length=0,Ce.pendingSet.clear(),Ce.running===0&&_o.delete(ee))});const G=K=>{const ee=_o.get(K);if(ee)return ee;const Ce={inflight:new Set,pending:[],pendingSet:new Set,running:0};return _o.set(K,Ce),Ce},ne=(K,ee)=>{if(K.length===0)return ee.slice().sort((Se,Ge)=>Se.id<Ge.id?-1:Se.id>Ge.id?1:0);const Ce=new Map;for(const Se of K)Ce.set(Se.id,Se);for(const Se of ee)Ce.set(Se.id,Se);return[...Ce.values()].sort((Se,Ge)=>Se.id<Ge.id?-1:Se.id>Ge.id?1:0)};async function oe(K,ee,Ce){const[Se,Ge]=d.child(K,{bootstrap:!1});return bbn({directory:K,sessionID:ee,task:qe=>Uo(()=>c.client.session.messages({directory:K,sessionID:ee,limit:Kn})).then(Et=>{if(yr.value!==Ce||!q_e(K,ee,qe))return;const Gt=(Et.data??[]).filter(Ki=>!!Ki?.info?.id),en=Gt.map(Ki=>Ki.info).filter(Ki=>!!Ki?.id),Nt=ne([],en),Ft=at(K,ee),ji=Et.response.headers.get("x-next-cursor")??void 0,Cr={limit:Nt.length,cursor:ji,complete:!ji,at:Date.now()};if(Ft.length>0){pUe(K,Ft);for(const Ki of Ft)d.todo.set(Ki,void 0)}const ar=Se.message[ee]??[],Er=ne(ar.filter(Ki=>!!Ki?.id),Nt);if(q_e(K,ee,qe))return pn(()=>{Ft.length>0&&Ge(jt(Ki=>{wae(Ki,Ft)})),Ge("message",ee,vn(Er,{key:"id"})),fUe({directory:K,sessionID:ee,...Cr});for(const Ki of Gt){const zn=Se.part[Ki.info.id]??[],ma=ne(zn.filter(Dh=>!!Dh?.id),Ki.parts.filter(Dh=>!!Dh?.id));Ge("part",Ki.info.id,vn(ma,{key:"id"}))}}),Cr}).catch(()=>{})})}const ae=K=>{const ee=G(K);if(ee.running>=gc)return;const Ce=ee.pending.shift();if(!Ce)return;ee.pendingSet.delete(Ce),ee.inflight.add(Ce),ee.running+=1;const Se=yr.value;oe(K,Ce,Se).finally(()=>{ee.running-=1,ee.inflight.delete(Ce),ae(K)})},me=(K,ee="low")=>{const Ce=K.directory;if(!Ce)return;const[Se]=d.child(Ce,{bootstrap:!1});if(Mn(()=>{const en=I2e(Ce,K.id);return ybn({message:Se.message[K.id]!==void 0,info:en,chunk:Kn})}))return;const qe=G(Ce);if(qe.inflight.has(K.id))return;if(qe.pendingSet.has(K.id)){if(ee!=="high")return;const en=qe.pending.indexOf(K.id);en>0&&(qe.pending.splice(en,1),qe.pending.unshift(K.id));return}const Et=yt(Ce);if(!(!Et.has(K.id)&&Et.size>=Te&&ee!=="high")){for(ee==="high"&&qe.pending.unshift(K.id),ee!=="high"&&qe.pending.push(K.id),qe.pendingSet.add(K.id);qe.pending.length>Pa;){const en=qe.pending.pop();en&&qe.pendingSet.delete(en)}ae(Ce)}},Me=(K,ee)=>{for(let Ce=1;Ce<=mc;Ce++){const Se=K[ee+Ce];Se&&me(Se,Ce===1?"high":"low");const Ge=K[ee-Ce];Ge&&me(Ge,Ce===1?"high":"low")}};Re(()=>{const K=eo();if(K.length===0)return;const ee=l.id?K.findIndex(Ce=>Ce.id===l.id):0;if(ee!==-1){if(!l.id){const Ce=K[ee];Ce&&me(Ce,"high")}Me(K,ee)}});function Pe(K){const ee=eo();if(ee.length===0)return;const Ce=l.id?ee.findIndex(qe=>qe.id===l.id):-1;let Se;Ce===-1?Se=K>0?0:ee.length-1:Se=(Ce+K+ee.length)%ee.length;const Ge=ee[Se];Ge&&(me(Ge,"high"),Me(ee,Se),re(Ge))}function it(K){const ee=u.projects.list();if(ee.length===0)return;const Ce=Pi()?.worktree,Se=P()?_i(P()):void 0,Ge=Ce??Se,qe=Ge?ee.findIndex(Gt=>Gt.worktree===Ge):-1,Et=qe===-1?K>0?ee[0]:ee[ee.length-1]:ee[(qe+K+ee.length)%ee.length];Et&&(d.child(Et.worktree),Le(Et.worktree))}function xt(K){const ee=eo();if(ee.length===0||!ee.some(qe=>v.session.unseenCount(qe.id)>0))return;const Se=l.id?ee.findIndex(qe=>qe.id===l.id):-1,Ge=Se===-1?K>0?-1:0:Se;for(let qe=1;qe<=ee.length;qe++){const Et=K>0?(Ge+qe)%ee.length:(Ge-qe+ee.length)%ee.length,Gt=ee[Et];if(Gt&&v.session.unseenCount(Gt.id)!==0){me(Gt,"high"),Me(ee,Et),re(Gt);return}}}async function Zt(K){const[ee,Ce]=d.child(K.directory),Se=ee.session??[],Ge=Se.findIndex(Et=>Et.id===K.id),qe=Se[Ge+1]??Se[Ge-1];await c.client.session.update({directory:K.directory,sessionID:K.id,time:{archived:Date.now()}}),Ce(jt(Et=>{const Gt=br.search(Et.session,K.id,en=>en.id);Gt.found&&Et.session.splice(Gt.index,1)})),K.id===l.id&&_(qe?`/${l.dir}/session/${qe.id}`:`/${l.dir}/session`)}M.register("layout",()=>{const K=[{id:"sidebar.toggle",title:S.t("command.sidebar.toggle"),category:S.t("command.category.view"),keybind:"mod+b",onSelect:()=>u.sidebar.toggle()},{id:"project.open",title:S.t("command.project.open"),category:S.t("command.category.project"),keybind:"mod+o",onSelect:()=>Nr()},{id:"project.previous",title:S.t("command.project.previous"),category:S.t("command.category.project"),keybind:"mod+alt+arrowup",onSelect:()=>it(-1)},{id:"project.next",title:S.t("command.project.next"),category:S.t("command.category.project"),keybind:"mod+alt+arrowdown",onSelect:()=>it(1)},{id:"provider.connect",title:S.t("command.provider.connect"),category:S.t("command.category.provider"),onSelect:()=>Tn()},{id:"server.switch",title:S.t("command.server.switch"),category:S.t("command.category.server"),onSelect:()=>Gn()},{id:"settings.open",title:S.t("command.settings.open"),category:S.t("command.category.settings"),keybind:"mod+shift+,",onSelect:()=>wi()},{id:"settings.shortcuts",title:S.t("command.settings.shortcuts"),category:S.t("command.category.settings"),keybind:"mod+shift+k",onSelect:()=>{const ee=++s;z(()=>import("./dialog-settings-CXEAJdw0.js"),__vite__mapDeps([101,102,103,104,105,106,107])).then(Ce=>{a||s!==ee||x.show(()=>m(Ce.DialogSettings,{tab:"shortcuts"}))})}},{id:"session.previous",title:S.t("command.session.previous"),category:S.t("command.category.session"),keybind:"mod+,",onSelect:()=>Pe(-1)},{id:"session.next",title:S.t("command.session.next"),category:S.t("command.category.session"),keybind:"mod+.",onSelect:()=>Pe(1)},{id:"view.toggleMinimap",title:S.t("command.view.toggleMinimap"),category:S.t("command.category.view"),keybind:"mod+shift+m,mod+alt+m",onSelect:()=>t("minimapVisible",ee=>!ee)},{id:"view.toggleMaximizedPanel",title:S.t("command.view.toggleMaximizedPanel"),category:S.t("command.category.view"),keybind:"ctrl+tab",onSelect:()=>t("panelMaximized",ee=>!ee)},{id:"view.toggleActivityBar",title:S.t("command.view.toggleActivityBar"),category:S.t("command.category.view"),keybind:"mod+shift+b",onSelect:()=>t("activityBarVisible",ee=>!ee)},{id:"view.moveSidebarLeft",title:S.t("command.view.moveSidebarLeft"),category:S.t("command.category.view"),keybind:"ctrl+shift+alt+left",onSelect:()=>{}},{id:"view.moveSidebarRight",title:S.t("command.view.moveSidebarRight"),category:S.t("command.category.view"),keybind:"ctrl+shift+alt+right",onSelect:()=>{}},{id:"view.alignPanelCenter",title:S.t("command.view.alignPanelCenter"),category:S.t("command.category.view"),keybind:"ctrl+shift+down",onSelect:()=>t("panelAlignment","center")},{id:"view.positionPanelBottom",title:S.t("command.view.positionPanelBottom"),category:S.t("command.category.view"),keybind:"ctrl+shift+down",onSelect:()=>t("panelPosition","bottom")},{id:"view.positionPanelRight",title:S.t("command.view.positionPanelRight"),category:S.t("command.category.view"),keybind:"ctrl+shift+right",onSelect:()=>t("panelPosition","right")},{id:"view.positionPanelLeft",title:S.t("command.view.positionPanelLeft"),category:S.t("command.category.view"),keybind:"ctrl+shift+left",onSelect:()=>t("panelPosition","left")},{id:"app.quit",title:S.t("command.app.quit"),category:S.t("command.category.app"),keybind:"mod+alt+q",onSelect:()=>{}},{id:"app.reload",title:S.t("command.app.reload"),category:S.t("command.category.app"),keybind:"mod+shift+alt+r",onSelect:()=>window.location.reload()},{id:"app.restart",title:S.t("command.app.restart"),category:S.t("command.category.app"),keybind:"mod+shift+r",onSelect:()=>{f.restart?.()}},{id:"theme.select",title:S.t("command.theme.select"),category:S.t("command.category.theme"),keybind:"alt+t",onSelect:()=>{}},{id:"theme.toggleLightDark",title:S.t("command.theme.toggleLightDark"),category:S.t("command.category.theme"),keybind:"mod+shift+alt+t",onSelect:()=>oo(1)},{id:"editor.fontZoomIn",title:S.t("command.editor.fontZoomIn"),category:S.t("command.category.editor"),keybind:"mod+alt+=",onSelect:()=>Ri(1)},{id:"editor.fontZoomOut",title:S.t("command.editor.fontZoomOut"),category:S.t("command.category.editor"),keybind:"mod+alt+-",onSelect:()=>Ri(-1)},{id:"editor.fontZoomReset",title:S.t("command.editor.fontZoomReset"),category:S.t("command.category.editor"),keybind:"alt+0",onSelect:()=>di()},{id:"terminal.fontZoomIn",title:S.t("command.terminal.fontZoomIn"),category:S.t("command.category.terminal"),keybind:"mod+ctrl+alt+=",onSelect:()=>Ri(1)},{id:"terminal.fontZoomOut",title:S.t("command.terminal.fontZoomOut"),category:S.t("command.category.terminal"),keybind:"mod+ctrl+alt+-",onSelect:()=>Ri(-1)},{id:"session.previous.unseen",title:S.t("command.session.previous.unseen"),category:S.t("command.category.session"),keybind:"shift+alt+arrowup",onSelect:()=>xt(-1)},{id:"session.next.unseen",title:S.t("command.session.next.unseen"),category:S.t("command.category.session"),keybind:"shift+alt+arrowdown",onSelect:()=>xt(1)},{id:"session.archive",title:S.t("command.session.archive"),category:S.t("command.category.session"),keybind:"mod+shift+backspace",disabled:!l.dir||!l.id,onSelect:()=>{const ee=eo().find(Ce=>Ce.id===l.id);ee&&Zt(ee)}},{id:"workspace.new",title:S.t("workspace.new"),category:S.t("command.category.workspace"),keybind:"mod+shift+w",disabled:!Ir(),onSelect:()=>{const ee=Pi();if(ee)return Hke(ee)}},{id:"workspace.toggle",title:S.t("command.workspace.toggle"),description:S.t("command.workspace.toggle.description"),category:S.t("command.category.workspace"),slash:"workspace",disabled:!Pi()||Pi()?.vcs!=="git",onSelect:()=>{const ee=Pi();if(!ee||ee.vcs!=="git")return;const Ce=u.sidebar.workspaces(ee.worktree)();u.sidebar.toggleWorkspaces(ee.worktree),y.push(`${Ce?S.t("toast.workspace.disabled.title"):S.t("toast.workspace.enabled.title")}: ${Ce?S.t("toast.workspace.disabled.description"):S.t("toast.workspace.enabled.description")}`,"toast")}},...ih()?[]:[{id:"theme.cycle",title:S.t("command.theme.cycle"),category:S.t("command.category.theme"),keybind:"mod+shift+t",onSelect:()=>qs(1)}]];if(!ih())for(const[ee]of A())K.push({id:`theme.set.${ee}`,title:S.t("command.theme.set",{theme:L.name(ee)}),category:S.t("command.category.theme"),onSelect:()=>L.commitPreview(),onHighlight:()=>(L.previewTheme(ee),()=>L.cancelPreview())});K.push({id:"theme.scheme.cycle",title:S.t("command.theme.scheme.cycle"),category:S.t("command.category.theme"),keybind:"mod+shift+s",onSelect:()=>oo(1)});for(const ee of T)K.push({id:`theme.scheme.${ee}`,title:S.t("command.theme.scheme.set",{scheme:R(ee)}),category:S.t("command.category.theme"),onSelect:()=>L.commitPreview(),onHighlight:()=>(L.previewColorScheme(ee),()=>L.cancelPreview())});K.push({id:"language.cycle",title:S.t("command.language.cycle"),category:S.t("command.category.language"),onSelect:()=>Zi(1)});for(const ee of S.locales)K.push({id:`language.set.${ee}`,title:S.t("command.language.set",{language:S.label(ee)}),category:S.t("command.category.language"),onSelect:()=>Ms(ee)});return K});function Tn(){const K=++s;z(()=>import("./dialog-select-provider-DpwHcs_z.js").then(ee=>ee.d),__vite__mapDeps([107,103,106,105])).then(ee=>{a||s!==K||x.show(()=>m(ee.DialogSelectProvider,{}))})}function Gn(){const K=++s;z(()=>import("./dialog-select-server-uqL2WKd-.js"),__vite__mapDeps([108,103,109])).then(ee=>{a||s!==K||x.show(()=>m(ee.DialogSelectServer,{}))})}function wi(){const K=++s;z(()=>import("./dialog-settings-CXEAJdw0.js"),__vite__mapDeps([101,102,103,104,105,106,107])).then(ee=>{a||s!==K||x.show(()=>m(ee.DialogSettings,{}))})}function _i(K){const ee=rn(K),Ce=u.projects.list().find(Gt=>rn(Gt.worktree)===ee||Gt.sandboxes?.some(en=>rn(en)===ee));if(Ce)return Ce.worktree;const Se=Object.entries(e.workspaceOrder).find(([Gt,en])=>rn(Gt)===ee||en.some(Nt=>rn(Nt)===ee));if(Se)return Se[0];const[Ge]=d.child(K,{bootstrap:!1}),qe=Ge.project;return qe?d.data.project.find(Gt=>Gt.id===qe)?.worktree??K:K}function zo(K){return Pi()?.worktree??_i(K)}function ts(K,ee,Ce=zo(K)){return t("lastProjectSession",Ce,{directory:K,id:ee,at:Date.now()}),Ce}function nd(K){e.lastProjectSession[K]&&t("lastProjectSession",jt(ee=>{delete ee[K]}))}function Vt(K,ee,Ce=zo(K)){return ts(K,ee,Ce),v.session.markViewed(ee),Mn(()=>e.workspaceExpanded[K])===!1&&t("workspaceExpanded",K,!0),requestAnimationFrame(()=>Us(ee,`${K}:${ee}`)),Ce}async function de(K){if(!K)return;const ee=_i(K);g.projects.touch(ee);const Ce=u.projects.list().find(Ft=>Ft.worktree===ee);let Se=Ce?AL(ee,[ee,...Ce.sandboxes??[]],e.workspaceOrder[ee]):[ee];const Ge=Ft=>Ft?Se.some(ji=>rn(ji)===rn(Ft)):!1,qe=async Ft=>{if(!Ft||Ft===ee||Ge(Ft))return Ge(Ft);const ji=await c.client.worktree.list({directory:ee}).then(Cr=>Cr.data??[]).catch(()=>[]);return Se=AL(ee,[ee,...ji],e.workspaceOrder[ee]),Ge(Ft)},Et=async Ft=>{if(!Ge(Ft.directory))return!1;const[ji]=d.child(Ft.directory,{bootstrap:!1});if(ji.session.some(ar=>ar.id===Ft.id))return t("lastProjectSession",ee,{directory:Ft.directory,id:Ft.id,at:Date.now()}),Qt(`/${ri(Ft.directory)}/session/${Ft.id}`),!0;const Cr=await c.client.session.get({sessionID:Ft.id}).then(ar=>ar.data).catch(()=>{});return!Cr?.directory||!Ge(Cr.directory)?!1:(t("lastProjectSession",ee,{directory:Cr.directory,id:Cr.id,at:Date.now()}),Qt(`/${ri(Cr.directory)}/session/${Cr.id}`),!0)},Gt=e.lastProjectSession[ee];if(Gt?.id){if(await qe(Gt.directory),await Et(Gt))return;nd(ee)}const en=iRe(Se.map(Ft=>d.child(Ft,{bootstrap:!1})[0]),Date.now());if(en&&await Et(en))return;const Nt=iRe(await Promise.all(Se.map(async Ft=>({path:{directory:Ft},session:await c.client.session.list({directory:Ft}).then(ji=>ji.data??[]).catch(()=>[])}))),Date.now());Nt&&await Et(Nt)||Qt(`/${ri(ee)}/session`)}function re(K){K&&Qt(`/${ri(K.directory)}/session/${K.id}`)}function Le(K,ee=!0){if(u.projects.open(K),ee)return de(K)}const lt=K=>{if(g.isLocal()){for(const ee of k5i(K))Le(ee);for(const ee of C5i(K)){Le(ee.directory,!1);const Ce=ri(ee.directory);ee.prompt&&G4i(Ce,{prompt:ee.prompt});const Se=ee.prompt?`/${Ce}/session?prompt=${encodeURIComponent(ee.prompt)}`:`/${Ce}/session`;Qt(Se)}}};ur(()=>{const K=ee=>{const Se=ee.detail?.urls??[];Se.length!==0&&lt(Se)};lt(b5i(window)),window.addEventListener(rRe,K),Oe(()=>window.removeEventListener(rRe,K))});async function Fn(K,ee){const Ce=Ake(K);if(ee===Ce)return;const Se=ee===Ds(K.worktree)?"":ee;if(K.id&&K.id!=="global"){await c.client.project.update({projectID:K.id,directory:K.worktree,name:Se});return}d.project.meta(K.worktree,{name:Se})}const xi=(K,ee,Ce,Se)=>{(sr(K,Ce,Se)??Se??Ds(K))!==ee&&Kr(K,ee,Ce,Se)};function ui(K){const ee=u.projects.list(),Ce=rn(K),Se=ee.findIndex(Et=>rn(Et.worktree)===Ce),Ge=rn(Pi()?.worktree??"")===Ce;if(Se===-1)return;const qe=ee[Se+1];if(!Ge){u.projects.close(K);return}if(!qe){u.projects.close(K),_("/");return}Qt(`/${ri(qe.worktree)}/session`),u.projects.close(K),queueMicrotask(()=>{de(qe.worktree)})}function kr(K){if(u.sidebar.workspaces(K.worktree)()){u.sidebar.toggleWorkspaces(K.worktree);return}K.vcs==="git"&&u.sidebar.toggleWorkspaces(K.worktree)}const Zs=K=>{const ee=++s;z(()=>import("./dialog-edit-project-DDzRssw5.js"),[]).then(Ce=>{a||s!==ee||x.show(()=>m(Ce.DialogEditProject,{project:K}))})};async function Nr(){function K(ee){if(Array.isArray(ee)){for(const Ce of ee)Le(Ce,!1);de(ee[0])}else ee&&Le(ee)}if(f.openDirectoryPickerDialog&&g.isLocal()){const ee=await f.openDirectoryPickerDialog?.({title:S.t("command.project.open"),multiple:!0});K(ee)}else{const ee=++s;z(()=>import("./dialog-select-directory-CjI5IZBg.js"),__vite__mapDeps([110,103])).then(Ce=>{a||s!==ee||x.show(()=>m(Ce.DialogSelectDirectory,{multiple:!0,onSelect:K}),()=>K(null))})}}const k2=async(K,ee,Ce=!1)=>{if(ee===K)return;const Se=P(),Ge=rn(Se),qe=rn(ee),Et=Ce||!!l.dir&&Ge===qe;!Ce&&Et&&Qt(`/${ri(K)}/session`),B(ee,!0);const Gt=await c.client.worktree.remove({directory:K,worktreeRemoveInput:{directory:ee}}).then(ar=>ar.data).catch(ar=>(y.push(`${S.t("workspace.delete.failed.title")}: ${TL(ar,S.t("common.requestFailed"))}`,"toast"),!1));if(B(ee,!1),!Gt||(rn(e.lastProjectSession[K]?.directory??"")===rn(ee)&&nd(K),d.set("project",jt(ar=>{const Er=ar.find(Ki=>Ki.worktree===K);Er&&(Er.sandboxes=(Er.sandboxes??[]).filter(Ki=>Ki!==ee))})),t("workspaceOrder",K,ar=>(ar??[]).filter(Er=>Er!==ee)),u.projects.close(ee),u.projects.open(K),Et))return;const en=P(),Nt=rn(en),Ft=u.projects.list().find(ar=>ar.worktree===K),Cr=(Ft?AL(K,[K,...Ft.sandboxes??[]],e.workspaceOrder[K]):[K]).some(ar=>rn(ar)===Nt);l.dir&&_i(en)===K&&!Cr&&Qt(`/${ri(K)}/session`)},xo=async(K,ee)=>{if(ee===K)return;B(ee,!0),y.push(`${S.t("workspace.resetting.title")}: ${S.t("workspace.resetting.description")}`,"toast");const Ce=await c.client.session.list({directory:ee}).then(qe=>qe.data??[]).catch(()=>[]);if(JSn(ee,Ce.map(qe=>qe.id),f),await c.client.instance.dispose({directory:ee}).catch(()=>{}),!await c.client.worktree.reset({directory:K,worktreeResetInput:{directory:ee}}).then(qe=>qe.data).catch(qe=>(y.push(`${S.t("workspace.reset.failed.title")}: ${TL(qe,S.t("common.requestFailed"))}`,"toast"),!1))){B(ee,!1);return}const Ge=Date.now();await Promise.all(Ce.filter(qe=>qe.time.archived===void 0).map(qe=>c.client.session.update({sessionID:qe.id,directory:qe.directory,time:{archived:Ge}}).catch(()=>{}))),B(ee,!1),y.push(`${S.t("workspace.reset.success.title")}: ${S.t("workspace.reset.success.description")}`,"toast")};function tS(K){const ee=J(()=>Ds(K.directory)),[Ce,Se]=Yt({status:"loading",dirty:!1});ur(()=>{c.client.file.status({directory:K.directory}).then(Et=>{const en=(Et.data??[]).length>0;Se({status:"ready",dirty:en})}).catch(()=>{Se({status:"error",dirty:!1})})});const Ge=()=>{const Et=!!l.dir&&rn(P())===rn(K.directory);Et&&Qt(`/${ri(K.root)}/session`),x.close(),k2(K.root,K.directory,Et)},qe=()=>Ce.status==="loading"?S.t("workspace.status.checking"):Ce.status==="error"?S.t("workspace.status.error"):Ce.dirty?S.t("workspace.status.dirty"):S.t("workspace.status.clean");return m(aie,{get title(){return S.t("workspace.delete.title")},fit:!0,get children(){var Et=u6i(),Gt=Et.firstChild,en=Gt.firstChild,Nt=en.nextSibling,Ft=Gt.nextSibling;return W(en,()=>S.t("workspace.delete.confirm",{name:ee()})),W(Nt,qe),W(Ft,m(to,{variant:"ghost",size:"large",onClick:()=>x.close(),get children(){return S.t("common.cancel")}}),null),W(Ft,m(to,{variant:"primary",size:"large",get disabled(){return Ce.status==="loading"},onClick:Ge,get children(){return S.t("workspace.delete.button")}}),null),Et}})}function nS(K){const ee=J(()=>Ds(K.directory)),[Ce,Se]=Yt({status:"loading",dirty:!1,sessions:[]}),Ge=async()=>{const Ft=(await c.client.session.list({directory:K.directory}).then(ji=>ji.data??[]).catch(()=>[])).filter(ji=>ji.time.archived===void 0);Se({sessions:Ft})};ur(()=>{c.client.file.status({directory:K.directory}).then(Nt=>{const ji=(Nt.data??[]).length>0;Se({status:"ready",dirty:ji}),Ge()}).catch(()=>{Se({status:"error",dirty:!1})})});const qe=()=>{x.close(),xo(K.root,K.directory)},Et=()=>Ce.sessions.length,Gt=()=>Ce.status==="loading"?S.t("workspace.status.checking"):Ce.status==="error"?S.t("workspace.status.error"):Ce.dirty?S.t("workspace.status.dirty"):S.t("workspace.status.clean"),en=()=>{const Nt=Et();return Nt===0?S.t("workspace.reset.archived.none"):Nt===1?S.t("workspace.reset.archived.one"):S.t("workspace.reset.archived.many",{count:Nt})};return m(aie,{get title(){return S.t("workspace.reset.title")},fit:!0,get children(){var Nt=h6i(),Ft=Nt.firstChild,ji=Ft.firstChild,Cr=ji.nextSibling,ar=Cr.firstChild,Er=ar.nextSibling;Er.nextSibling;var Ki=Ft.nextSibling;return W(ji,()=>S.t("workspace.reset.confirm",{name:ee()})),W(Cr,Gt,ar),W(Cr,en,Er),W(Cr,()=>S.t("workspace.reset.note"),null),W(Ki,m(to,{variant:"ghost",size:"large",onClick:()=>x.close(),get children(){return S.t("common.cancel")}}),null),W(Ki,m(to,{variant:"primary",size:"large",get disabled(){return Ce.status==="loading"},onClick:qe,get children(){return S.t("workspace.reset.button")}}),null),Nt}})}const ga={session:"",sessionProject:"",directory:""};Re(Mr(()=>[r(),E().slug,l.id,Pi()?.worktree,P()],([K,ee,Ce,Se,Ge])=>{if(!K||!ee||!Ge){ga.session="",ga.sessionProject="",ga.directory="";return}if(!Ce){ga.session="",ga.sessionProject="",ga.directory="";return}const qe=`${ee}/${Ce}`;if(!Se){ga.session=qe,ga.directory=Ge,ga.sessionProject="";return}if(g.projects.last()!==Se&&g.projects.touch(Se),qe!==ga.session||Ge!==ga.directory){ga.session=qe,ga.directory=Ge,ga.sessionProject=Vt(Ge,Ce,Se);return}Se!==ga.sessionProject&&(ga.directory=Ge,ga.sessionProject=ts(Ge,Ce,Se))})),Re(()=>{const K=u.sidebar.opened()?u.sidebar.width():48;document.documentElement.style.setProperty("--dialog-left-margin",`${K}px`)});const est=J(()=>Math.max(u.sidebar.width(),244)),tst=J(()=>Math.max(est()-64,0)),iS=new Set;Re(Mr(es,K=>{if(K.length===0){iS.clear();return}const ee=new Set(K);for(const Ce of ee)iS.has(Ce)||d.project.loadSessions(Ce);iS.clear();for(const Ce of ee)iS.add(Ce)},{defer:!0}));function nst(K){const ee=tse(K);ee&&(Fe(void 0),t("activeProject",ee))}function ist(K){const{draggable:ee,droppable:Ce}=K;if(ee&&Ce){const Se=u.projects.list(),Ge=Se.findIndex(Et=>Et.worktree===ee.id.toString()),qe=Se.findIndex(Et=>Et.worktree===Ce.id.toString());Ge!==qe&&qe!==-1&&u.projects.move(ee.id.toString(),qe)}}function rst(){t("activeProject",void 0)}function rS(K){if(!K)return[];const ee=K.worktree,Ce=[ee,...K.sandboxes??[]],Se=Pi(),Ge=rn(Se?.worktree??"")===rn(K.worktree)?P():void 0,qe=Ge&&rn(Ge)!==rn(ee)&&!Ce.some(en=>rn(en)===rn(Ge))?Ge:void 0,Et=qe?EL.get(qe)?.status==="pending":!1,Gt=AL(ee,Ce,e.workspaceOrder[K.worktree]);return Et&&qe?[ee,qe,...Gt.filter(en=>en!==ee)]:!qe||Et?Gt:[...Gt,qe]}const Vke=J(()=>{if(u.sidebar.opened())return Pi();const K=At();return K||Pi()});function ost(K){const ee=tse(K);ee&&t("activeWorkspace",ee)}function sst(K){const{draggable:ee,droppable:Ce}=K;if(!ee||!Ce)return;const Se=Vke();if(!Se)return;const Ge=rS(Se),qe=Ge.findIndex(Nt=>Nt===ee.id.toString()),Et=Ge.findIndex(Nt=>Nt===Ce.id.toString());if(qe===-1||Et===-1||qe===Et)return;const Gt=Ge.slice(),[en]=Gt.splice(qe,1);en&&(Gt.splice(Et,0,en),t("workspaceOrder",Se.worktree,Gt.filter(Nt=>rn(Nt)!==rn(Se.worktree))))}function ast(){t("activeWorkspace",void 0)}const Hke=async K=>{Lt();const ee=await c.client.worktree.create({directory:K.worktree}).then(qe=>qe.data).catch(qe=>{y.push(`${S.t("workspace.create.failed.title")}: ${TL(qe,S.t("common.requestFailed"))}`,"toast")});if(!ee?.directory)return;Kr(ee.directory,ee.branch,K.id,ee.branch);const Ce=K.worktree,Se=rn(ee.directory),Ge=rn(Ce);B(ee.directory,!0),EL.pending(ee.directory),t("workspaceExpanded",Se,!0),Se!==ee.directory&&t("workspaceExpanded",ee.directory,!0),t("workspaceOrder",K.worktree,qe=>{const Gt=(qe??[]).filter(en=>{const Nt=rn(en);return Nt!==Ge&&Nt!==Se});return[ee.directory,...Gt]}),d.child(ee.directory),Qt(`/${ri(ee.directory)}/session`)},$ke={currentDir:P,navList:eo,sidebarExpanded:Ae,sidebarHovering:pe,nav:()=>V.nav,hoverSession:()=>V.hoverSession,setHoverSession:Ve,clearHoverProjectSoon:be,prefetchSession:me,archiveSession:Zt,workspaceName:sr,renameWorkspace:xi,editorOpen:Ct,openEditor:Z,closeEditor:wt,setEditor:vt,InlineEditor:cn,isBusy:te,workspaceExpanded:(K,ee)=>e.workspaceExpanded[K]??ee,setWorkspaceExpanded:(K,ee)=>t("workspaceExpanded",K,ee),showResetWorkspaceDialog:(K,ee)=>x.show(()=>m(nS,{root:K,directory:ee})),showDeleteWorkspaceDialog:(K,ee)=>x.show(()=>m(tS,{root:K,directory:ee})),createSession:vr,setScrollContainerRef:(K,ee)=>{ee||(o=K)}},lst={currentDir:P,currentProject:Pi,sidebarOpened:()=>u.sidebar.opened(),sidebarHovering:pe,hoverProject:()=>V.hoverProject,nav:()=>V.nav,onProjectMouseEnter:(K,ee)=>se.enter(K,ee),onProjectMouseLeave:K=>se.leave(K),onProjectFocus:K=>se.activate(K),onHoverOpenChanged:(K,ee)=>{!ee&&V.hoverProject&&V.hoverProject!==K||$("hoverProject",ee?K:void 0)},navigateToProject:de,openSidebar:()=>u.sidebar.open(),closeProject:ui,showEditProjectDialog:Zs,toggleProjectWorkspaces:kr,workspacesEnabled:K=>K.vcs==="git"&&u.sidebar.workspaces(K.worktree)(),workspaceIds:rS,workspaceLabel:Oi,sessionProps:{navList:eo,sidebarExpanded:Ae,sidebarHovering:pe,nav:()=>V.nav,hoverSession:()=>V.hoverSession,setHoverSession:Ve,clearHoverProjectSoon:be,prefetchSession:me,archiveSession:Zt},setHoverSession:Ve},cst=K=>{const ee=K.project,Ce=J(()=>K.mobile||(K.merged??u.sidebar.opened())),Se=J(()=>!K.mobile&&K.merged===!1&&!u.sidebar.opened()),Ge=J(()=>!!K.mobile||K.merged===!1||u.sidebar.opened()),qe=J(()=>!l.dir&&u.projects.list().length===0),Et=J(()=>{const zn=ee();return zn?zn.name||Ds(zn.worktree):""}),Gt=J(()=>ee()?.id??""),en=J(()=>ee()?.worktree??""),Nt=J(()=>{const zn=en();return zn?ri(zn):""}),Ft=J(()=>{const zn=ee();return zn?rS(zn):[]}),ji=J(()=>Ft().reduce((zn,ma)=>zn+v.project.unseenCount(ma),0)),Cr=()=>Ft().filter(zn=>v.project.unseenCount(zn)>0).forEach(zn=>v.project.markViewed(zn)),ar=J(()=>{const zn=ee();return!zn||zn.vcs!=="git"?!1:u.sidebar.workspaces(zn.worktree)()}),Er=J(()=>{const zn=ee();return zn?zn.vcs==="git"||u.sidebar.workspaces(zn.worktree)():!1}),Ki=J(()=>d.data.path.home);return(()=>{var zn=m6i(),ma=zn.firstChild,Dh=ma.firstChild,sS=Dh.firstChild,zke=sS.firstChild,Bke=zke.firstChild,jke=Bke.nextSibling,hst=jke.nextSibling,Wke=zke.nextSibling;return W(zn,m(_e,{get when(){return ee()},get fallback(){return m(_e,{get when(){return qe()},get children(){var Oa=v6i(),id=Oa.firstChild,Ls=id.firstChild,Gr=Ls.firstChild,C2=Gr.nextSibling;return W(Gr,()=>S.t("sidebar.empty.title")),W(C2,()=>S.t("sidebar.empty.description")),W(id,m(to,{size:"large",icon:"folder-add-left",onClick:Nr,get children(){return S.t("command.project.open")}}),null),Oa}})},get children(){return[(()=>{var Oa=p6i(),id=Oa.firstChild,Ls=id.firstChild;return W(Ls,m(cn,{get id(){return`project:${Gt()}`},value:Et,onSave:Gr=>{const C2=ee();C2&&Fn(C2,Gr)},class:"text-14-medium text-text-strong truncate",displayClass:"text-14-medium text-text-strong truncate",stopPropagation:!0}),null),W(Ls,m(ou,{placement:"bottom",gutter:2,get value(){return en()},class:"shrink-0",contentStyle:{"max-width":"640px",transform:"translate3d(52px, 0, 0)"},get children(){var Gr=f6i();return W(Gr,()=>en().replace(Ki(),"~")),Gr}}),null),W(id,m(Un,{get modal(){return!pe()},get children(){return[m(Un.Trigger,{as:oa,icon:"dot-grid",variant:"ghost","data-action":"project-menu",get"data-project"(){return Nt()},class:"shrink-0 size-6 rounded-md transition-opacity data-[expanded]:bg-surface-base-active",get classList(){return{"opacity-100":K.mobile||Ce(),"opacity-0 group-hover/project:opacity-100 group-focus-within/project:opacity-100 data-[expanded]:opacity-100":!K.mobile&&!Ce()}},get"aria-label"(){return S.t("common.moreOptions")}}),m(Un.Portal,{get children(){return m(Un.Content,{class:"mt-1",get children(){return[m(Un.Item,{onSelect:()=>{const Gr=ee();Gr&&Zs(Gr)},get children(){return m(Un.ItemLabel,{get children(){return S.t("common.edit")}})}}),m(Un.Item,{"data-action":"project-workspaces-toggle",get"data-project"(){return Nt()},get disabled(){return!Er()},onSelect:()=>{const Gr=ee();Gr&&kr(Gr)},get children(){return m(Un.ItemLabel,{get children(){return sn(()=>!!ar())()?S.t("sidebar.workspaces.disable"):S.t("sidebar.workspaces.enable")}})}}),m(Un.Item,{"data-action":"project-clear-notifications",get"data-project"(){return Nt()},get disabled(){return ji()===0},onSelect:Cr,get children(){return m(Un.ItemLabel,{get children(){return S.t("sidebar.project.clearNotifications")}})}}),m(Un.Separator,{}),m(Un.Item,{"data-action":"project-close-menu",get"data-project"(){return Nt()},onSelect:()=>{const Gr=en();Gr&&ui(Gr)},get children(){return m(Un.ItemLabel,{get children(){return S.t("common.close")}})}})]}})}})]}}),null),Oa})(),m(aot,{onDragStart:ost,onDragEnd:ast,onDragOver:sst,collisionDetector:oot,get children(){return[m(lot,{}),m(got,{}),(()=>{var Oa=g6i();return W(Oa,m(_e,{get when(){return ee()},children:id=>m(_e,{get when(){return ar()},get fallback(){return[(()=>{var Ls=lRe();return W(Ls,m(to,{variant:"secondary",size:"large",icon:"new-session",class:"w-full",onClick:()=>{const Gr=en();Gr&&vr(Gr)},get children(){return S.t("command.session.new")}})),Ls})(),(()=>{var Ls=k6i();return W(Ls,m(E9i,{ctx:$ke,get project(){return id()},sortNow:U,get mobile(){return K.mobile},get popover(){return Ge()}})),Ls})()]},get children(){return[(()=>{var Ls=lRe();return W(Ls,m(to,{size:"large",icon:"plus-small",class:"w-full",onClick:()=>{Hke(id())},get children(){return S.t("workspace.new")}})),Ls})(),(()=>{var Ls=y6i(),Gr=Ls.firstChild;return aa(C2=>{K.mobile||(o=C2)},Gr),W(Gr,m(uot,{get ids(){return Ft()},get children(){return m(ei,{get each(){return Ft()},children:C2=>m(N9i,{ctx:$ke,directory:C2,get project(){return id()},sortNow:U,get mobile(){return K.mobile},get popover(){return Ge()}})})}})),Ls})()]}})})),Oa})(),m(cot,{get children(){return m(M9i,{sidebarProject:Vke,activeWorkspace:()=>e.activeWorkspace,workspaceLabel:Oi})}})]}})]}}),ma),W(Bke,()=>S.t("sidebar.gettingStarted.title")),W(jke,()=>S.t("sidebar.gettingStarted.line1")),W(hst,()=>S.t("sidebar.gettingStarted.line2")),W(Wke,m(to,{size:"large",icon:"plus-small",onClick:Tn,get children(){return S.t("command.provider.connect")}}),null),W(Wke,m(to,{size:"large",variant:"ghost",onClick:()=>t("gettingStartedDismissed",!0),get children(){return S.t("toast.update.action.notYet")}}),null),st(Oa=>{var id={"flex flex-col min-h-0 min-w-0 box-border rounded-tl-[12px] px-3":!0,"border border-b-0 border-border-weak-base":!Ce(),"border-l border-t border-border-weaker-base":Ce(),"bg-background-base":Ce()||Se(),"bg-background-stronger":!Ce()&&!Se(),"flex-1 min-w-0":K.mobile,"max-w-full overflow-hidden":K.mobile},Ls=K.mobile?void 0:`${tst()}px`,Gr=!!(e.gettingStartedDismissed||!(w.all().length>0&&w.paid().length===0));return Oa.e=Ko(zn,id,Oa.e),Ls!==Oa.t&&Sr(zn,"width",Oa.t=Ls),Gr!==Oa.a&&ma.classList.toggle("hidden",Oa.a=Gr),Oa},{e:void 0,t:void 0,a:void 0}),zn})()},Fke=()=>u.projects.list(),dst=()=>m(n6i,{projects:Fke,activeProject:()=>e.activeProject}),ust=K=>m(d6i,{mobile:K,opened:()=>u.sidebar.opened(),get aimMove(){return se.move},projects:Fke,renderProject:ee=>m(o6i,{ctx:lst,project:ee,sortNow:U,mobile:K}),handleDragStart:nst,handleDragEnd:rst,handleDragOver:ist,get openProjectLabel(){return S.t("command.project.open")},openProjectKeybind:()=>M.keybind("project.open"),onOpenProject:Nr,renderProjectOverlay:dst,settingsLabel:()=>S.t("sidebar.settings"),settingsKeybind:()=>M.keybind("settings.open"),onOpenSettings:wi,helpLabel:()=>S.t("sidebar.help"),onOpenHelp:()=>f.openLink("https://opencode.ai/desktop-feedback"),renderPanel:()=>m(cst,{project:Pi,mobile:!0})});let oS;return vy(),ur(()=>{oS&&requestAnimationFrame(()=>{yrt(oS,{opacity:[0,1],y:[4,0]},{type:"spring",stiffness:400,damping:30})})}),m(rMn,{get children(){var K=b6i(),ee=K.firstChild,Ce=ee.firstChild,Se=Ce.firstChild,Ge=Se.firstChild,qe=Ge.firstChild,Et=qe.nextSibling,Gt=Ge.nextSibling,en=Gt.firstChild;return W(K,m(p5i,{}),ee),W(ee,m(_e,{get when(){return e.activityBarVisible},get children(){var Nt=C6i(),Ft=Nt.firstChild,ji=Ft.firstChild,Cr=Ft.nextSibling,ar=Cr.firstChild;return W(Ft,m(ei,{get each(){return u.projects.list()},children:Er=>{const Ki=J(()=>Pi()?.worktree===Er.worktree);return(()=>{var zn=w6i();return zn.$$click=()=>_(`/${ri(Er.worktree)}/session`),W(zn,m(Pke,{project:Er,notify:!0})),st(ma=>{var Dh={"bg-transparent hover:bg-surface-base-hover":!Ki(),"bg-surface-base-hover border border-border-weak-base":Ki()},sS=Er.name||Ds(Er.worktree);return ma.e=Ko(zn,Dh,ma.e),sS!==ma.t&&mt(zn,"aria-label",ma.t=sS),ma},{e:void 0,t:void 0}),zn})()}}),ji),ji.$$click=Nr,W(ji,m(Cn,{name:"plus",size:"small",class:"text-icon-weak"})),ar.$$click=wi,W(ar,m(Cn,{name:"settings-gear",size:"small",class:"text-icon-weak"})),st(Er=>{var Ki=S.t("command.project.open"),zn=S.t("sidebar.settings");return Ki!==Er.e&&mt(ji,"aria-label",Er.e=Ki),zn!==Er.t&&mt(ar,"aria-label",Er.t=zn),Er},{e:void 0,t:void 0}),Nt}}),Ce),qe.$$click=Nt=>{Nt.target===Nt.currentTarget&&u.mobileSidebar.hide()},Et.$$click=Nt=>Nt.stopPropagation(),W(Et,()=>ust(!0)),Ko(Gt,{"absolute p-3 pt-0 inset-0":!0,"xl:inset-y-0 xl:right-0 xl:left-0":!0,"z-20":!0}),Ko(en,{"size-full overflow-x-hidden flex flex-col items-start contain-strict rounded-xl":!0}),W(en,m(_e,{get when(){return!fr.loading},get fallback(){return cRe()},get children(){var Nt=cRe(),Ft=oS;return typeof Ft=="function"?aa(Ft,Nt):oS=Nt,W(Nt,()=>n.children),Nt}})),st(Nt=>{var Ft={"fixed inset-x-0 top-10 bottom-0 z-40 transition-opacity duration-200":!0,"opacity-100 pointer-events-auto":u.mobileSidebar.opened(),"opacity-0 pointer-events-none":!u.mobileSidebar.opened()},ji=S.t("sidebar.nav.projectsAndSessions"),Cr={"@container fixed top-10 bottom-0 left-0 z-50 w-full max-w-[400px] overflow-hidden border-r border-border-weaker-base bg-background-base transition-transform duration-200 ease-out":!0,"translate-x-0":u.mobileSidebar.opened(),"-translate-x-full":!u.mobileSidebar.opened()};return Nt.e=Ko(qe,Ft,Nt.e),ji!==Nt.t&&mt(Et,"aria-label",Nt.t=ji),Nt.a=Ko(Et,Cr,Nt.a),Nt},{e:void 0,t:void 0,a:void 0}),K}})}Fs(["click"]);var x6i=["id","name","validationState","required","disabled","readOnly"];function S6i(n){const e=`form-control-${$s()}`,t=Pn({id:e},n),[i,r]=Ye(),[o,s]=Ye(),[a,l]=Ye(),[c,d]=Ye(),u=(g,v,y)=>{const C=y!=null||i()!=null;return[y,i(),C&&v!=null?g:void 0].filter(Boolean).join(" ")||void 0},h=g=>[a(),c(),g].filter(Boolean).join(" ")||void 0,f=J(()=>({"data-valid":Ze(t.validationState)==="valid"?"":void 0,"data-invalid":Ze(t.validationState)==="invalid"?"":void 0,"data-required":Ze(t.required)?"":void 0,"data-disabled":Ze(t.disabled)?"":void 0,"data-readonly":Ze(t.readOnly)?"":void 0}));return{formControlContext:{name:()=>Ze(t.name)??Ze(t.id),dataset:f,validationState:()=>Ze(t.validationState),isRequired:()=>Ze(t.required),isDisabled:()=>Ze(t.disabled),isReadOnly:()=>Ze(t.readOnly),labelId:i,fieldId:o,descriptionId:a,errorMessageId:c,getAriaLabelledBy:u,getAriaDescribedBy:h,generateId:bh(()=>Ze(t.id)),registerLabel:Xa(r),registerField:Xa(s),registerDescription:Xa(l),registerErrorMessage:Xa(d)}}}var $ot=oi();function eS(){const n=Wn($ot);if(n===void 0)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return n}function Fot(n){const e=eS(),t=Pn({id:e.generateId("description")},n);return Re(()=>Oe(e.registerDescription(t.id))),m(zi,k({as:"div"},()=>e.dataset(),t))}var M6i=["id","aria-label","aria-labelledby","aria-describedby"];function L6i(n){const e=eS(),t=Pn({id:e.generateId("field")},n);return Re(()=>Oe(e.registerField(Ze(t.id)))),{fieldProps:{id:()=>Ze(t.id),ariaLabel:()=>Ze(t["aria-label"]),ariaLabelledBy:()=>e.getAriaLabelledBy(Ze(t.id),Ze(t["aria-label"]),Ze(t["aria-labelledby"])),ariaDescribedBy:()=>e.getAriaDescribedBy(Ze(t["aria-describedby"]))}}}function zot(n){let e;const t=eS(),i=Pn({id:t.generateId("label")},n),[r,o]=Je(i,["ref"]),s=$_(()=>e,()=>"label");return Re(()=>Oe(t.registerLabel(o.id))),m(zi,k({as:"label",ref(a){var l=qr(c=>e=c,r.ref);typeof l=="function"&&l(a)},get for(){return sn(()=>s()==="label")()?t.fieldId():void 0}},()=>t.dataset(),o))}function I6i(n,e){Re(Mr(n,t=>{if(t==null)return;const i=N6i(t);i!=null&&(i.addEventListener("reset",e,{passive:!0}),Oe(()=>{i.removeEventListener("reset",e)}))}))}function N6i(n){return E6i(n)?n.form:n.closest("form")}function E6i(n){return n.matches("textarea, input, select, button")}function Bot(n){const e=eS(),t=Pn({id:e.generateId("error-message")},n),[i,r]=Je(t,["forceMount"]),o=()=>e.validationState()==="invalid";return Re(()=>{o()&&Oe(e.registerErrorMessage(r.id))}),m(_e,{get when(){return i.forceMount||o()},get children(){return m(zi,k({as:"div"},()=>e.dataset(),r))}})}var T6i={};au(T6i,{Description:()=>Fot,ErrorMessage:()=>Bot,Input:()=>Wot,Label:()=>zot,Root:()=>Uot,TextArea:()=>Zot,TextField:()=>m9,useTextFieldContext:()=>Oke});var jot=oi();function Oke(){const n=Wn(jot);if(n===void 0)throw new Error("[kobalte]: `useTextFieldContext` must be used within a `TextField` component");return n}function Wot(n){return m(qot,k({type:"text"},n))}function qot(n){const e=eS(),t=Oke(),i=Pn({id:t.generateId("input")},n),[r,o,s]=Je(i,["onInput"],M6i),{fieldProps:a}=L6i(o);return m(zi,k({as:"input",get id(){return a.id()},get name(){return e.name()},get value(){return t.value()},get required(){return e.isRequired()},get disabled(){return e.isDisabled()},get readonly(){return e.isReadOnly()},get"aria-label"(){return a.ariaLabel()},get"aria-labelledby"(){return a.ariaLabelledBy()},get"aria-describedby"(){return a.ariaDescribedBy()},get"aria-invalid"(){return e.validationState()==="invalid"||void 0},get"aria-required"(){return e.isRequired()||void 0},get"aria-disabled"(){return e.isDisabled()||void 0},get"aria-readonly"(){return e.isReadOnly()||void 0},get onInput(){return hs([r.onInput,t.onInput])}},()=>e.dataset(),s))}function Uot(n){let e;const t=`textfield-${$s()}`,i=Pn({id:t},n),[r,o,s]=Je(i,["ref","value","defaultValue","onChange"],x6i),a=r.value,[l,c]=H_({value:()=>a===void 0?void 0:r.value??"",defaultValue:()=>r.defaultValue,onChange:f=>r.onChange?.(f)}),{formControlContext:d}=S6i(o);I6i(()=>e,()=>c(r.defaultValue??""));const u=f=>{if(d.isReadOnly()||d.isDisabled())return;const p=f.target;c(p.value),p.value=l()??""},h={value:l,generateId:bh(()=>Ze(o.id)),onInput:u};return m($ot.Provider,{value:d,get children(){return m(jot.Provider,{value:h,get children(){return m(zi,k({as:"div",ref(f){var p=qr(g=>e=g,r.ref);typeof p=="function"&&p(f)},role:"group",get id(){return Ze(o.id)}},()=>d.dataset(),s))}})}})}function Zot(n){let e;const t=Oke(),i=Pn({id:t.generateId("textarea")},n),[r,o]=Je(i,["ref","autoResize","submitOnEnter","onKeyPress"]);Re(Mr([()=>e,()=>r.autoResize,()=>t.value()],([a,l])=>{!a||!l||A6i(a)}));const s=a=>{e&&r.submitOnEnter&&a.key==="Enter"&&!a.shiftKey&&e.form&&(e.form.requestSubmit(),a.preventDefault())};return m(qot,k({as:"textarea",get"aria-multiline"(){return r.submitOnEnter?"false":void 0},get onKeyPress(){return hs([r.onKeyPress,s])},ref(a){var l=qr(c=>e=c,r.ref);typeof l=="function"&&l(a)}},o))}function A6i(n){const e=n.style.alignSelf,t=n.style.overflow;"MozAppearance"in n.style||(n.style.overflow="hidden"),n.style.alignSelf="start",n.style.height="auto",n.style.height=`${n.scrollHeight+(n.offsetHeight-n.clientHeight)}px`,n.style.overflow=t,n.style.alignSelf=e}var m9=Object.assign(Uot,{Description:Fot,ErrorMessage:Bot,Input:Wot,Label:zot,TextArea:Zot}),D6i=le("<div data-slot=input-wrapper>");function R6i(n){const e=f3(),[t,i]=Je(n,["name","defaultValue","value","onChange","onKeyDown","validationState","required","disabled","readOnly","class","label","hideLabel","description","error","variant","copyable","copyKind","multiline"]),[r,o]=Ye(!1),s=()=>r()?e.t("ui.textField.copied"):t.copyKind==="link"?e.t("ui.textField.copyLink"):e.t("ui.textField.copyToClipboard"),a=()=>r()?"check":t.copyKind==="link"?"link":"copy";async function l(){const d=t.value??t.defaultValue??"";await navigator.clipboard.writeText(d),o(!0),setTimeout(()=>o(!1),2e3)}function c(){t.copyable&&l()}return m(m9,{"data-component":"input",get"data-variant"(){return t.variant||"normal"},get name(){return t.name},get defaultValue(){return t.defaultValue},get value(){return t.value},get onChange(){return t.onChange},get onKeyDown(){return t.onKeyDown},onClick:c,get required(){return t.required},get disabled(){return t.disabled},get readOnly(){return t.readOnly},get validationState(){return t.validationState},get children(){return[m(_e,{get when(){return t.label},get children(){return m(m9.Label,{"data-slot":"input-label",get classList(){return{"sr-only":t.hideLabel}},get children(){return t.label}})}}),(()=>{var d=D6i();return W(d,m(_e,{get when(){return t.multiline},get fallback(){return m(m9.Input,k(i,{"data-slot":"input-input",get class(){return t.class}}))},get children(){return m(m9.TextArea,k(i,{autoResize:!0,"data-slot":"input-input",get class(){return t.class}}))}}),null),W(d,m(_e,{get when(){return t.copyable},get children(){return m(ou,{get value(){return s()},placement:"top",gutter:4,get forceOpen(){return r()},skipDelayDuration:0,get children(){return m(oa,{type:"button",get icon(){return a()},variant:"ghost",onClick:l,tabIndex:-1,"data-slot":"input-copy-button",get"aria-label"(){return s()}})}})}}),null),d})(),m(_e,{get when(){return t.description},get children(){return m(m9.Description,{"data-slot":"input-description",get children(){return t.description}})}}),m(m9.ErrorMessage,{"data-slot":"input-error",get children(){return t.error}})]}})}var P6i=le('<div class="relative flex-1 h-screen w-screen min-h-0 flex flex-col items-center justify-center bg-background-base font-sans"><div class="w-2/3 max-w-3xl flex flex-col items-center justify-center gap-8"><div class="flex flex-col items-center gap-2 text-center"><h1 class="text-lg font-medium text-text-strong"></h1><p class="text-sm text-text-weak"></p></div><div class="flex items-center gap-3"></div><div class="flex flex-col items-center gap-2"><div class="flex items-center justify-center gap-1"><button type=button class="flex items-center text-text-interactive-base gap-1"><div>'),O6i=le('<p class="text-xs text-text-danger-base text-center max-w-2xl">'),V6i=le('<p class="text-xs text-text-weak">');const DL=`
3485
+ `).slice(0,1200)}),s=J(()=>n.type==="file"&&X2e(n.path)?nb(e.url,e.directory,n.path):void 0),a=J(()=>n.type==="file"&&JZe(n.path)?nb(e.url,e.directory,n.path):void 0);return(()=>{var l=Shi(),c=l.firstChild;return W(c,m(V1,{get fallback(){return m(Ohi,{get path(){return n.path},get type(){return n.type}})},get children(){return[m(fi,{get when(){return n.type==="directory"},get children(){return m(Phi,{get list(){return t.latest??[]}})}}),m(fi,{get when(){return s()},children:d=>(()=>{var u=Mhi();return u.addEventListener("error",h=>{h.currentTarget.style.display="none"}),st(()=>mt(u,"src",d())),u})()}),m(fi,{get when(){return a()},children:d=>(()=>{var u=Lhi();return u.addEventListener("error",h=>{h.currentTarget.style.display="none"}),st(()=>mt(u,"src",d())),u})()}),m(fi,{get when(){return o()},children:d=>(()=>{var u=Ihi();return W(u,d),u})()})]}})),st(()=>H1(c,`relative w-full h-full overflow-hidden rounded-sm bg-background-base text-text-weak ${n.class??""}`)),l})()}function Phi(n){const e=()=>n.list.length,t=()=>n.list.slice(0,9);return m(_e,{get when(){return e()>0},get fallback(){return(()=>{var i=Thi();return W(i,m(Cn,{name:"folder",size:"medium"})),i})()},get children(){return[(()=>{var i=Nhi();return W(i,m(ei,{get each(){return t()},children:r=>(()=>{var o=Ahi();return W(o,m(_e,{get when(){return r.type==="directory"},get fallback(){return m(Nae,{get node(){return{path:r.path,type:"file"}},class:"size-3"})},get children(){return m(Cn,{name:"folder",size:"small",class:"text-icon-weak"})}})),o})()})),i})(),(()=>{var i=Ehi();return W(i,e),i})()]}})}function Ohi(n){return(()=>{var e=Dhi();return W(e,m(_e,{get when(){return n.type==="file"},get fallback(){return m(Cn,{name:"folder",size:"medium",class:"text-icon-weak"})},get children(){return m(Nae,{get node(){return{path:n.path,type:"file"}},class:"size-6"})}})),e})()}var Vhi=le('<div class="flex-1 min-h-0 overflow-hidden">'),Hhi=le('<div class="h-full min-h-0">'),$hi=le('<div class="m-3 flex items-center gap-2 rounded-md border border-border-base bg-background-base px-3 py-2 text-text-weak"><span class=text-12-regular>Loading file...'),sit=le('<div class="grid grid-cols-2 gap-2">'),ait=le('<div class="h-full overflow-y-auto p-3">'),Fhi=le('<div class="flex items-center gap-2 rounded-md border border-border-base bg-background-base px-3 py-2 text-text-weak"><span class=text-12-regular>Loading directory...'),zhi=le('<div class="rounded-md border border-border-base bg-background-base px-3 py-2 text-12-regular text-text-weak">Empty directory'),Bhi=le('<span class="shrink-0 rounded-sm px-1 py-0.5 text-[9px] font-medium uppercase tracking-wide">'),jhi=le('<button class="entity-child-card group relative flex flex-col overflow-hidden rounded-md border border-border-base/60 bg-background-base text-left transition-colors hover:border-border-base hover:bg-surface-raised-base/40"><div class="relative h-20 w-full bg-surface-raised-base/30 border-b border-border-weaker-base"></div><div class="flex items-center gap-1.5 px-2 py-1.5 min-w-0"><span class="truncate flex-1 text-11-medium text-text-strong">'),Whi=le('<div class="grid grid-cols-4 gap-1.5">'),qhi=le('<div class="h-full overflow-y-auto p-3 flex flex-col gap-3">'),Uhi=le('<div class="flex flex-col rounded-md border border-border-base/60 bg-background-base px-2.5 py-2"><span class="text-14-semibold text-text-strong tabular-nums leading-none"></span><span class="mt-1 text-10-medium uppercase tracking-wide text-text-weaker">'),Zhi=le('<div class="rounded-md border border-border-base bg-background-base px-3 py-3 text-12-regular text-text-weak text-center">No README.md at project root'),Khi=le('<div class="rounded-md border border-border-base/60 bg-background-base overflow-hidden"><div class="flex items-center gap-1.5 border-b border-border-weaker-base px-2.5 py-1.5"><span class="font-mono text-10-medium text-text-weak">'),Ghi=le('<div class="flex items-center gap-2 rounded-md border border-border-base bg-background-base px-3 py-2 text-text-weak"><span class=text-12-regular>'),Xhi=le('<div class="flex items-center gap-2 text-text-weak"><span class=text-12-regular>Loading...'),Yhi=le('<div class="rounded-md border border-border-base bg-background-base px-3 py-3 text-12-regular text-text-weak">See <span class=text-text-strong>Details</span> tab for attributes.'),Jhi=le('<div class="rounded-md border border-border-base bg-background-base px-3 py-4 text-12-regular text-text-weak text-center">No preview available'),Qhi=le('<div class="flex flex-col gap-3">'),e0i=le('<div class="rounded-md border border-border-base/60 bg-background-base px-2.5 py-1.5"><div class="text-10-medium uppercase tracking-wide text-text-weaker"></div><div class="mt-0.5 text-11-regular text-text-strong truncate">');const t0i={session:[],session_status:{},session_diff:{},message:{},part:{}};function cDe(n){return(()=>{var e=Vhi();return W(e,m(V1,{get fallback(){return m(s0i,{get id(){return n.id}})},get children(){return[m(fi,{get when(){return n.type==="file"},get children(){return m(n0i,{get path(){return Y2e(n.id)}})}}),m(fi,{get when(){return n.type==="directory"},get children(){return m(i0i,{get path(){return Y2e(n.id)}})}}),m(fi,{get when(){return n.type==="project"},get children(){return m(o0i,{get id(){return n.id}})}})]}})),e})()}function n0i(n){const e=Dwn(),t=Bs(),i=xy(),r=FZe(),o=WZe(),s=Eae(),[a,l]=Ye(!1);Re(Mr(()=>n.path,g=>{g&&(l(!1),e.load(g).then(()=>{e.setMode(g,e.get(g)?.mode??"rich")}).catch(()=>l(!0)))}));const c=J(()=>e.get(n.path)),d=J(()=>e.text(n.path)??""),u=J(()=>{const g=c()?.content;return g?.type==="text"&&g.encoding!=="base64"}),h=J(()=>!!c()?.loaded||a()),f=()=>{const g=n.path;g&&e.save(g)},p=async g=>{try{await t.client.file.write({fileWriteInput:{path:g,content:"",format:!1}});const v=g.includes("/")?g.slice(0,g.lastIndexOf("/")):"";return await e.tree.refresh(v),v&&e.tree.expand(v),Fd({variant:"success",title:`Created ${g}`}),g}catch(v){const y=v instanceof Error?v.message:String(v);Fd({variant:"error",title:"Create failed",description:y});return}};return(()=>{var g=Hhi();return W(g,m(_e,{get when(){return h()},get fallback(){return(()=>{var v=$hi(),y=v.firstChild;return W(v,m(wp,{}),y),v})()},get children(){return m(_e,{get when(){return sn(()=>!!(!a()&&c()))()&&u()},get fallback(){return m(oit,{get path(){return n.path},get file(){return c()?.content},onLinkClick:v=>s(`file:${v}`,"file")})},get children(){return m(mhi,{get path(){return n.path},get state(){return c()},get value(){return d()},active:!0,onChange:v=>e.setDraft(n.path,v),onSave:f,onMode:v=>e.setMode(n.path,v),mention:{search:v=>TEn({query:v,file:e,sync:i,trellis:AEn(r,o?.facts)}),fetch:async(v,y)=>{if(y==="file")return await e.load(v),e.text(v)},navigate:v=>{v.type==="file"?s(`file:${v.id}`,"file"):s(v.id,v.type)},onCreate:p}})}})}})),g})()}function i0i(n){const e=Bs(),t=Eae(),[i]=mo(()=>n.path,async o=>{try{return(await e.client.file.list({path:o})).data??[]}catch{return[]}},{initialValue:[]}),r=()=>i.latest??[];return(()=>{var o=ait();return W(o,m(_e,{get when(){return!i.loading},get fallback(){return(()=>{var s=Fhi(),a=s.firstChild;return W(s,m(wp,{}),a),s})()},get children(){return m(_e,{get when(){return r().length>0},get fallback(){return zhi()},get children(){var s=sit();return W(s,m(ei,{get each(){return r()},children:a=>{const l=a.type==="directory"?"directory":"file",c=l==="directory"?`dir:${a.path}`:`file:${a.path}`;return m(r0i,{id:c,get path(){return a.path},type:l,onOpen:()=>t(c,a.type)})}})),s}})}})),o})()}function r0i(n){const e=J(()=>n.type==="file"?QZe(n.path):"dir"),t=J(()=>h0[n.type]??"var(--border-base)"),i=xLn();return(()=>{var r=jhi(),o=r.firstChild,s=o.nextSibling,a=s.firstChild;return r.addEventListener("mouseleave",()=>i?.(null)),r.addEventListener("mouseenter",()=>i?.(n.id)),Ju(r,"click",n.onOpen,!0),W(o,m(Rhi,{get path(){return n.path},get type(){return n.type},class:"absolute inset-0"})),W(s,m(Nae,{get node(){return{path:n.path,type:n.type}},class:"shrink-0 size-3.5","aria-hidden":"true"}),a),W(a,()=>r8e(n.path)),W(s,m(_e,{get when(){return e()},get children(){var l=Bhi();return W(l,e),st(c=>{var d=`color-mix(in srgb, ${t()} 18%, transparent)`,u=t();return d!==c.e&&Sr(l,"background",c.e=d),u!==c.t&&Sr(l,"color",c.t=u),c},{e:void 0,t:void 0}),l}}),null),st(l=>{var c=t(),d=n.path;return c!==l.e&&Sr(r,"--accent",l.e=c),d!==l.t&&mt(a,"title",l.t=d),l},{e:void 0,t:void 0}),r})()}function o0i(n){const e=Bs(),t=l2(),[i]=mo(()=>n.id,async()=>{try{return await t.fetchGraph()}catch{return}},{initialValue:void 0}),[r]=mo(async()=>{const l=["README.md","readme.md","README.markdown","Readme.md"];for(const c of l)try{const d=(await e.client.file.read({path:c})).data;if(d&&d.type==="text"&&d.encoding!=="base64")return{path:c,data:d}}catch{}},{initialValue:void 0}),o=()=>i.latest,s=()=>r.latest,a=J(()=>{const l=o();if(!l)return[];const c={};for(const u of l.nodes)c[u.type]=(c[u.type]??0)+1;return["file","directory","issue","agent","workunit","cycle","epic","roadmap","memory","sprite","suggestion","mcp"].filter(u=>(c[u]??0)>0).map(u=>({label:u==="directory"?"dirs":u==="workunit"?"tasks":`${u}s`,value:c[u]})).concat(l.hiddenNodes>0?[{label:"hidden",value:l.hiddenNodes}]:[])});return(()=>{var l=qhi();return W(l,m(_e,{get when(){return!i.loading},get fallback(){return m(dDe,{label:"Loading stats..."})},get children(){return m(_e,{get when(){return a().length>0},get children(){var c=Whi();return W(c,m(ei,{get each(){return a()},children:d=>(()=>{var u=Uhi(),h=u.firstChild,f=h.nextSibling;return W(h,()=>d.value),W(f,()=>d.label),u})()})),c}})}}),null),W(l,m(_e,{get when(){return!r.loading},get fallback(){return m(dDe,{label:"Loading README..."})},get children(){return m(_e,{get when(){return s()},get fallback(){return Zhi()},children:c=>(()=>{var d=Khi(),u=d.firstChild,h=u.firstChild;return W(u,m(Cn,{name:"file-text",size:"small",class:"text-icon-weak"}),h),W(h,()=>c().path),W(d,m(oit,{get path(){return c().path},get file(){return c().data}}),null),d})()})}}),null),l})()}function dDe(n){return(()=>{var e=Ghi(),t=e.firstChild;return W(e,m(wp,{}),t),W(t,()=>n.label),e})()}function s0i(n){const e=Bs(),t=l2(),[i]=mo(()=>n.id,async a=>{try{return await t.fetchEntity(a)}catch{return}},{initialValue:void 0}),r=J(()=>{const a=i.latest;if(!a)return;const l=["body","description","purpose","summary","message","title","name"];for(const c of l){const d=a.facts.find(u=>u.a===c);if(d)return W9(d.v)}}),o=J(()=>Rne(r()??"")),s=J(()=>(i.latest?.facts??[]).filter(a=>!XZe.has(a.a)));return(()=>{var a=ait();return W(a,m(_e,{get when(){return i.loading},get children(){var l=Xhi(),c=l.firstChild;return W(l,m(wp,{}),c),l}}),null),W(a,m(_e,{get when(){return!i.loading},get children(){return m(_e,{get when(){return r()},get fallback(){return m(_e,{get when(){return s().length>0},get fallback(){return Jhi()},get children(){return Yhi()}})},children:l=>(()=>{var c=Qhi();return W(c,m(_e,{get when(){return s().length>0},get children(){var d=sit();return W(d,m(ei,{get each(){return s().slice(0,24)},children:u=>(()=>{var h=e0i(),f=h.firstChild,p=f.nextSibling;return W(f,()=>u.a),W(p,()=>W9(u.v)),st(()=>mt(p,"title",W9(u.v))),h})()})),d}}),null),W(c,m(f5e,{data:t0i,get directory(){return e.directory},get mediaUrl(){return e.url},get children(){return m(_Ke,{get text(){return l()},get cacheKey(){return o()}})}}),null),c})()})}}),null),a})()}Fs(["click"]);var a0i=le('<div class="flex items-center justify-center py-6"><div class="animate-spin h-4 w-4 rounded-full border-2 border-text-weaker border-t-transparent">'),l0i=le('<div class="rounded-md border border-border-base bg-background-base px-3 py-4 text-12-regular text-text-weak text-center">No relationships recorded'),uDe=le('<div class="grid grid-cols-2 gap-2">'),c0i=le('<div class="grid grid-cols-1 gap-2">'),d0i=le('<div class="flex-1 min-h-0 overflow-y-auto p-3 flex flex-col gap-4">');function u0i(n){const e=l2(),t=Eae(),[i]=mo(()=>n.id,async d=>{try{return await e.fetchEntity(d)}catch{return}},{initialValue:void 0}),[r]=mo(()=>n.id,async d=>{try{return await e.fetchRefs(d)}catch{return}},{initialValue:void 0}),o=J(()=>i.latest?.links??[]),s=J(()=>r.latest?.outgoing??[]),a=J(()=>r.latest?.incoming??[]),l=J(()=>i.loading||r.loading),c=J(()=>!l()&&o().length===0&&s().length===0&&a().length===0);return(()=>{var d=d0i();return W(d,m(_e,{get when(){return sn(()=>!!(l()&&o().length===0&&s().length===0))()&&a().length===0},get children(){return a0i()}}),null),W(d,m(_e,{get when(){return c()},get children(){return l0i()}}),null),W(d,m(_e,{get when(){return o().length>0},get children(){return m(q9,{icon:"arrow-right",title:"Links",get children(){var u=uDe();return W(u,m(ei,{get each(){return o().slice(0,48)},children:h=>m(nKe,{get relation(){return h.a},get target(){return h.e2},onClick:()=>t(h.e2)})})),u}})}}),null),W(d,m(_e,{get when(){return s().length>0},get children(){return m(q9,{icon:"link",title:"References",get children(){var u=uDe();return W(u,m(ei,{get each(){return s()},children:h=>{const f=`${h.namespace}:${h.target}`,p=h.state==="resolved"&&!!h.namespace&&!!h.target;return m(iKe,{get title(){return h.title??f},get namespace(){return h.namespace},get state(){return h.state},get staleReason(){return h.staleReason},onClick:()=>p&&t(f,h.namespace),disabled:!p})}})),u}})}}),null),W(d,m(_e,{get when(){return a().length>0},get children(){return m(q9,{icon:"arrow-left",title:"Backlinks",get children(){var u=c0i();return W(u,m(ei,{get each(){return a()},children:h=>m(rKe,{get filePath(){return h.filePath},get line(){return h.line}})})),u}})}}),null),d})()}var h0i=le("<div>"),f0i=le('<span class="absolute bottom-0 left-1/2 -translate-x-1/2 w-8 h-[2px] bg-white rounded-full">'),p0i=le('<button class="relative flex-1 flex items-center justify-center gap-1.5 px-2 py-1.5 text-11-medium transition-colors"><span>');const lit=[{id:"preview",label:"Preview",icon:"eye"},{id:"details",label:"Details",icon:"info"},{id:"activity",label:"Activity",icon:"history"}],oyi=[{id:"overview",label:"Overview",icon:"info"},{id:"history",label:"History",icon:"history"},{id:"decisions",label:"Decisions",icon:"brain"},{id:"relationships",label:"Relationships",icon:"git-branch"}];function g0i(n){const e=()=>n.items??lit;return(()=>{var t=h0i();return W(t,m(ei,{get each(){return e()},children:i=>{const r=()=>n.tab===i.id;return(()=>{var o=p0i(),s=o.firstChild;return o.$$click=()=>n.setTab(i.id),W(o,m(_e,{get when(){return i.icon},get children(){return m(Cn,{get name(){return i.icon},size:"small",class:"shrink-0"})}}),s),W(s,()=>i.label),W(o,m(_e,{get when(){return r()},get children(){return f0i()}}),null),st(a=>{var l={"text-text-strong":r(),"text-text-weak hover:text-text-base":!r()},c=r();return a.e=Ko(o,l,a.e),c!==a.t&&mt(o,"aria-pressed",a.t=c),a},{e:void 0,t:void 0}),o})()}})),st(()=>H1(t,`shrink-0 flex items-center gap-1 px-2 py-1.5 border-b border-border-weaker-base ${n.class??""}`)),t})()}Fs(["click"]);var m0i=le("<div>");function cit(n){const[e,t]=Ye(n.initialTab??"details"),i=J(()=>n.type==="file"||n.type==="directory");return Re(Mr(()=>n.id,()=>t(n.initialTab??"preview"),{defer:!0})),(()=>{var r=m0i();return W(r,m(g0i,{get tab(){return e()},setTab:t,get items(){return n.items}}),null),W(r,m(_e,{get when(){return e()==="preview"},get children(){return m(cDe,{get id(){return n.id},get type(){return n.type}})}}),null),W(r,m(_e,{get when(){return e()==="details"},get children(){return m(aSe,{get id(){return n.id},get type(){return n.type},get status(){return n.status},get priority(){return n.priority}})}}),null),W(r,m(_e,{get when(){return e()==="activity"},get children(){return m(lte,{get id(){return n.id},get type(){return n.type}})}}),null),W(r,m(_e,{get when(){return e()==="overview"},get children(){return m(_e,{get when(){return i()},get fallback(){return m(aSe,{get id(){return n.id},get type(){return n.type},get status(){return n.status},get priority(){return n.priority}})},get children(){return m(cDe,{get id(){return n.id},get type(){return n.type}})}})}}),null),W(r,m(_e,{get when(){return e()==="history"},get children(){return m(lte,{get id(){return n.id},get type(){return n.type},kind:"op"})}}),null),W(r,m(_e,{get when(){return e()==="decisions"},get children(){return m(lte,{get id(){return n.id},get type(){return n.type},kind:"decision"})}}),null),W(r,m(_e,{get when(){return e()==="relationships"},get children(){return m(u0i,{get id(){return n.id},get type(){return n.type}})}}),null),st(()=>H1(r,`flex flex-col min-h-0 flex-1 ${n.class??""}`)),r})()}var v0i=le('<div class="relative h-full w-full overflow-visible">'),y0i=le('<button class="inline-flex items-center gap-1 rounded-md px-1.5 py-1 text-xs text-text-weak hover:text-text-base hover:bg-surface-raised-base/60 transition-colors"><span class="truncate max-w-40">'),k0i=le('<div class="absolute inset-0 rounded-xl border border-border-weaker-base bg-surface-base shadow-xl flex flex-col overflow-hidden"style="transform-origin:center center;transition:transform 200ms ease, filter 200ms ease"><div class="shrink-0 border-b border-border-weaker-base px-4 py-3 flex items-center gap-3"><div class="flex-1 min-w-0 flex items-center gap-2"><span class="inline-flex items-center gap-1 rounded-full bg-surface-raised-base px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide"></span><span class="truncate text-12-medium text-text-strong font-mono"></span></div></div><div class="min-h-0 flex-1 overflow-hidden">'),C0i=le('<div class="w-72 shrink-0 border-l border-border-weaker-base bg-surface-raised-base/30 flex flex-col">'),b0i=le('<div class="flex h-full"><div class="flex-1 min-h-0 overflow-auto p-4">'),w0i=le('<div class="flex flex-col items-center gap-2 py-8 text-text-weak"><div class=text-12-regular>Loading details...'),_0i=le('<div class="text-13-regular text-text-base whitespace-pre-wrap">'),x0i=le('<div class="flex flex-wrap gap-1.5">'),S0i=le('<div class="flex items-center gap-2 flex-wrap">'),M0i=le('<div class="flex items-center gap-2 p-2 rounded-md bg-background-base border border-border-base">'),L0i=le('<div class="p-3 rounded-md bg-background-base border border-border-base flex flex-col gap-2"><div class="flex items-center gap-2">'),I0i=le('<div class="flex flex-col gap-3"><div class="text-12-medium uppercase tracking-wide text-text-weak">Decision Traces</div><div class="flex flex-col gap-2 max-h-[200px] overflow-y-auto">'),N0i=le('<div class="flex justify-between"><span>Assignee</span><span>'),E0i=le('<div class="flex justify-between"><span>Branch</span><span class=text-11-mono>'),T0i=le('<div class="flex flex-col gap-4"><div class="flex items-center gap-2"><span class="text-12-medium text-text-info"></span><span class="text-10-medium uppercase rounded px-1.5 py-0.5 bg-surface-raised-base text-text-weak"></span><span class="text-10-medium uppercase rounded px-1.5 py-0.5 bg-surface-raised-base text-text-weak"></span></div><h1 class="text-16-semibold text-text-strong leading-tight"></h1><div class="flex flex-col gap-3"><div class="flex items-center justify-between"><div class="text-12-medium uppercase tracking-wide text-text-weak">Acceptance Criteria</div><div class="flex items-center gap-1"></div></div><div class="flex flex-col gap-2 max-h-[300px] overflow-y-auto"></div></div><div class="pt-4 border-t border-border-weaker-base flex flex-col gap-3 text-12-regular text-text-weak"><div class="flex justify-between"><span>Created</span><span>'),A0i=le('<span class="rounded-full bg-surface-raised-base px-2.5 py-0.5 text-11-medium text-text-weak">'),dit=le('<div class="text-12-regular text-text-weaker italic">No criteria defined'),D0i=le('<code class="text-11-mono text-text-weak block mt-1 p-1 rounded bg-surface-raised-base truncate">'),R0i=le('<pre class="mt-1 p-2 rounded bg-background-stronger text-11-mono text-text-weak overflow-x-auto max-h-24">'),P0i=le('<div class="p-3 rounded-md bg-background-base border border-border-base flex flex-col gap-2"><div class="flex items-start gap-3"><button class="mt-1 shrink-0 cursor-pointer hover:opacity-70 transition-opacity"title="Click to toggle status"></button><div class="flex-1 min-w-0"><div class="text-13-medium text-text-strong leading-normal">'),O0i=le('<div class="size-3 rounded-full border-2 border-border-strong-base">'),V0i=le('<div class="text-11-regular text-text-weak truncate">'),H0i=le('<div class="p-2 rounded-md bg-background-base border border-border-base flex items-start gap-2"><div class="flex-1 min-w-0"><div class="text-12-medium text-text-strong"></div></div><div class="shrink-0 text-11-regular text-text-weaker whitespace-nowrap">'),$0i=le('<div class="flex h-full items-center justify-center text-12-regular text-text-weak">WorkUnit not found'),F0i=le('<section class="flex flex-col gap-2"><div class="text-12-medium uppercase tracking-wide text-text-weak">Labels</div><div class="flex flex-wrap gap-1.5">'),z0i=le('<div class="flex h-full min-h-0"><div class="flex-1 min-w-0 overflow-y-auto p-5"><div class="flex flex-col gap-5"><div class="flex items-start gap-3"><div class="flex-1 min-w-0"><div class="text-11-medium uppercase tracking-wide text-text-weak">WorkUnit</div><h1 class="mt-1 text-18-semibold text-text-strong leading-snug"></h1><div class="mt-2 flex items-center gap-2 flex-wrap"><span class="text-11-mono text-text-info"></span><span class="text-10-medium uppercase rounded px-1.5 py-0.5 bg-surface-raised-base text-text-weak"></span><span class="text-10-medium uppercase rounded px-1.5 py-0.5 bg-surface-raised-base text-text-weak"></span></div></div></div><section class="flex flex-col gap-2"><div class="flex items-center gap-2"><div class="text-12-medium uppercase tracking-wide text-text-weak">Description</div></div><div class="rounded-md border border-border-base bg-background-base px-3 py-2 text-13-regular text-text-base"></div></section><section class="flex flex-col gap-3"><div class="flex items-center gap-2"><div class="text-12-medium uppercase tracking-wide text-text-weak">Acceptance Criteria</div><div class=flex-1></div><span class="text-11-regular text-text-weaker">%</span></div><div class="h-1.5 rounded-full bg-surface-raised-base overflow-hidden"><div class="h-full bg-text-success transition-all"></div></div></section></div></div><aside class="w-80 shrink-0 border-l border-border-weaker-base bg-surface-raised-base/30 flex flex-col min-h-0"><div class="shrink-0 border-b border-border-weaker-base p-3 flex flex-col gap-3"><div class="text-12-medium text-text-strong">Status</div><div class="flex flex-col gap-1.5"></div><div class="grid grid-cols-2 gap-2 text-11-regular text-text-weak"></div></div><div class="shrink-0 border-b border-border-weaker-base px-3 py-2 flex items-center gap-2"><div class="text-12-medium text-text-strong">Activity'),B0i=le('<span class="rounded-md bg-surface-raised-base px-2.5 py-1 text-11-medium text-text-strong">'),j0i=le('<code class="mt-1 block truncate rounded bg-surface-raised-base px-1.5 py-1 text-11-mono text-text-weak">'),W0i=le('<div class="rounded-md border border-border-base bg-background-base p-3 flex items-start gap-3"><div class="flex-1 min-w-0"><div class="text-13-medium text-text-strong leading-normal">'),q0i=le('<div class="mt-0.5 size-4 rounded-sm border border-border-strong-base">'),U0i=le('<button class="w-full rounded-md border px-3 py-2 text-left text-12-medium transition-colors">'),Z0i=le('<div class="rounded-md border border-border-base/60 bg-background-base px-2.5 py-1.5 min-w-0"><div class="text-10-medium uppercase tracking-wide text-text-weaker"></div><div class="mt-0.5 truncate text-11-regular text-text-strong">'),K0i=le('<div class="text-11-regular text-text-weak line-clamp-2">'),G0i=le('<div class="shrink-0 border-b border-border-weaker-base px-4 py-2.5 flex flex-col gap-0.5"><div class="text-13-semibold text-text-strong truncate">'),X0i=le('<div class="flex flex-col h-full min-h-0">');const hDe={w:760,h:620},$4e=oi();function fDe(n,e,t){return Math.max(e,Math.min(n,t))}function Y0i(n,e){return e||n.includes(":")&&n.split(":")[0]||"entity"}function J0i(n,e){return n.includes(":")?n:e==="issue"?`issue:${n}`:n}function F4e(n){return n.includes(":")?n.split(":").slice(1).join(":"):n}function z4e(n){const e=Date.now()-new Date(n).getTime();return e<6e4?"just now":e<36e5?`${Math.round(e/6e4)}m ago`:e<864e5?`${Math.round(e/36e5)}h ago`:`${Math.round(e/864e5)}d ago`}function Q0i(n){return n.split("/").pop()||n}function e2i(n){return typeof n=="string"?n:typeof n=="number"||typeof n=="boolean"?String(n):JSON.stringify(n,null,2)??""}function pDe(n,e){const t=e.flatMap(i=>n?.facts.filter(r=>r.a===i)??[])[0];return t?e2i(t.v):void 0}function t2i(n){const e=oy(),t=l2(),i=Bs(),[r,o]=Yt({stack:[],size:hDe,open:!1,closing:!1}),s={stack:()=>r.stack,size:()=>r.size,trellis:t,sdk:i,push(a,l){const c=J0i(a,l);o("stack",jt(d=>{d[d.length-1]?.id!==c&&d.push({key:`${c}:${Date.now()}`,id:c,type:Y0i(c,l)})}))},pop(){if(r.stack.length<=1){o("stack",[]);return}o("stack",r.stack.slice(0,-1))},clear(){o("stack",[])},setSize(a,l){o("size",{w:fDe(a,560,Math.min(920,window.innerWidth-96)),h:fDe(l,420,Math.min(760,window.innerHeight-120))})},getTransform(a){const l=r.stack.length-1-a;return l<=0?{scale:1,offsetY:16,brightness:1,interactive:!0}:{scale:Math.max(.82,1-l*.04),offsetY:l*-28,brightness:Math.max(.5,1-l*.14),interactive:!1}}};return Re(()=>{if(r.stack.length>0){!r.open&&!r.closing&&(o("open",!0),e.show(()=>m($4e.Provider,{value:s,get children(){return m(n2i,{})}}),()=>{pn(()=>{o("open",!1),o("closing",!1),o("stack",[]),o("size",hDe)})}));return}r.open&&!r.closing&&(o("closing",!0),e.close())}),m($4e.Provider,{value:s,get children(){return n.children}})}function Zy(){const n=Wn($4e);if(!n)throw new Error("useEntityDialog must be used within EntityDialogProvider");return n}function n2i(){const n=Zy();return m(aie,{size:"x-large",transition:!0,class:"!h-full !bg-transparent !shadow-none !overflow-visible",get children(){var e=v0i();return W(e,m(ei,{get each(){return n.stack()},children:(t,i)=>m(i2i,{entry:t,get index(){return i()}})})),e}})}function i2i(n){const e=Zy(),t=J(()=>e.getTransform(n.index)),i=J(()=>n.index===e.stack().length-1),r=J(()=>e.stack()[n.index-1]);return(()=>{var o=k0i(),s=o.firstChild,a=s.firstChild,l=a.firstChild,c=l.nextSibling,d=s.nextSibling;return W(s,m(_e,{get when(){return n.index>0},get children(){var u=y0i(),h=u.firstChild;return u.$$click=()=>e.pop(),W(u,m(Cn,{name:"arrow-left",size:"small"}),h),W(h,(()=>{var f=sn(()=>!!r());return()=>f()?F4e(r().id):"Back"})()),u}}),a),W(l,m(GZe,{get type(){return n.entry.type},size:12}),null),W(l,()=>n.entry.type,null),W(c,()=>F4e(n.entry.id)),W(s,m(_e,{get when(){return i()},get children(){return m(oa,{icon:"close-small",variant:"ghost",onClick:()=>e.clear()})}}),null),W(d,m(V1,{get fallback(){return m(uit,{get id(){return n.entry.id},get type(){return n.entry.type}})},get children(){return[m(fi,{get when(){return n.entry.type==="issue"},get children(){return m(o2i,{get id(){return n.entry.id}})}}),m(fi,{get when(){return n.entry.type==="workunit"},get children(){return m(s2i,{get id(){return n.entry.id}})}})]}})),st(u=>{var h=`translateY(${t().offsetY}px) scale(${t().scale})`,f=`brightness(${t().brightness})`,p=t().interactive?"auto":"none",g=`${100+n.index}`,v=i8e(n.entry.type);return h!==u.e&&Sr(o,"transform",u.e=h),f!==u.t&&Sr(o,"filter",u.t=f),p!==u.a&&Sr(o,"pointer-events",u.a=p),g!==u.o&&Sr(o,"z-index",u.o=g),v!==u.i&&Sr(l,"color",u.i=v),u},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),o})()}function r2i(n){return(()=>{var e=C0i();return W(e,m(cit,{get id(){return n.entityId},get type(){return n.type}})),e})()}function o2i(n){const t=Zy().trellis,[i,r]=Yt({busy:!1,adding:!1,newAcDesc:"",newAcCmd:"",assigning:!1,assignee:""}),o=J(()=>n.id.replace(/^issue:/,"")),[s,a]=mo(o,g=>t.getIssue(g),{initialValue:void 0}),[l]=mo(o,g=>t.fetchDecisionChain(`issue:${g}`),{initialValue:[]}),c=()=>s.latest,d=()=>l.latest??[],u=async g=>{r("busy",!0);try{await g(),await t.refresh(),a.refetch()}catch(v){console.error("[entity-dialog] action failed:",v)}finally{r("busy",!1)}},h=J(()=>{const g=c();if(!g)return[];const v=[];return g.status==="backlog"&&v.push({label:"Triage",run:()=>void u(()=>t.triageIssue(o()))}),(g.status==="backlog"||g.status==="queue")&&v.push({label:"Start",run:()=>void u(()=>t.startIssue(o()))}),g.status==="in_progress"&&v.push({label:"Pause",run:()=>void u(()=>t.pauseIssue(o()))}),g.status==="paused"&&v.push({label:"Resume",run:()=>void u(()=>t.resumeIssue(o()))}),(g.status==="in_progress"||g.status==="paused")&&v.push({label:"Close",run:()=>void u(()=>t.closeIssue(o(),!0))}),g.status==="closed"&&v.push({label:"Reopen",run:()=>void u(()=>t.reopenIssue(o()))}),v}),f=async()=>{const g=i.newAcDesc.trim();g&&(await u(()=>t.addCriterion(o(),g,i.newAcCmd.trim()||void 0)),pn(()=>{r("newAcDesc",""),r("newAcCmd",""),r("adding",!1)}))},p=async()=>{const g=i.assignee.trim();g&&(await u(()=>t.assignIssue(o(),g)),pn(()=>{r("assignee",""),r("assigning",!1)}))};return(()=>{var g=b0i(),v=g.firstChild;return W(v,m(_e,{get when(){return!s.loading},get fallback(){return(()=>{var y=w0i(),C=y.firstChild;return W(y,m(wp,{}),C),y})()},get children(){return m(_e,{get when(){return c()},get fallback(){return m(uit,{get id(){return n.id},type:"issue"})},children:y=>(()=>{var C=T0i(),_=C.firstChild,w=_.firstChild,x=w.nextSibling,M=x.nextSibling,L=_.nextSibling,S=L.nextSibling,I=S.firstChild,E=I.firstChild,A=E.nextSibling,T=I.nextSibling,D=S.nextSibling,R=D.firstChild,P=R.firstChild,V=P.nextSibling;return W(w,()=>y().id),W(x,()=>y().priority),W(M,()=>y().status),W(L,()=>y().title),W(C,m(_e,{get when(){return y().description},get children(){var $=_0i();return W($,()=>y().description),$}}),S),W(C,m(_e,{get when(){return y().labels.length>0},get children(){var $=x0i();return W($,m(ei,{get each(){return y().labels},children:j=>(()=>{var B=A0i();return W(B,j),B})()})),$}}),S),W(C,m(_e,{get when(){return h().length>0},get children(){var $=S0i();return W($,m(ei,{get each(){return h()},children:j=>m(to,{size:"small",variant:"ghost",get onClick(){return j.run},get disabled(){return i.busy},get children(){return j.label}})}),null),W($,m(_e,{get when(){return!i.assigning},get children(){return m(to,{size:"small",variant:"ghost",onClick:()=>r("assigning",!0),get disabled(){return i.busy},children:"Assign"})}}),null),$}}),S),W(C,m(_e,{get when(){return i.assigning},get children(){var $=M0i();return W($,m(ate,{placeholder:"Agent ID...",get value(){return i.assignee},onInput:j=>r("assignee",j.target.value),onKeyDown:j=>j.key==="Enter"&&void p(),class:"flex-1",autofocus:!0}),null),W($,m(oa,{icon:"check-small",variant:"ghost",onClick:()=>void p(),get disabled(){return!i.assignee.trim()}}),null),W($,m(oa,{icon:"close-small",variant:"ghost",onClick:()=>r("assigning",!1)}),null),$}}),S),W(A,m(to,{size:"small",variant:"ghost",onClick:()=>r("adding",!0),get disabled(){return i.adding},children:"Add"}),null),W(A,m(to,{size:"small",variant:"ghost",onClick:()=>void u(async()=>{await t.runCriteria(o())}),get disabled(){return i.busy},children:"Run All"}),null),W(T,m(ei,{get each(){return y().criteria},get fallback(){return dit()},children:($,j)=>(()=>{var B=P0i(),te=B.firstChild,U=te.firstChild,Y=U.nextSibling,X=Y.firstChild;return U.$$click=()=>{const se=$.status==="passed"?"failed":$.status==="failed"?"pending":"passed";u(()=>t.setCriterionStatus(o(),j(),se))},W(U,m(_e,{get when(){return $.status==="passed"},get fallback(){return m(_e,{get when(){return $.status==="failed"},get fallback(){return O0i()},get children(){return m(Cn,{name:"close-small",size:"small",class:"text-icon-error"})}})},get children(){return m(Cn,{name:"checklist",size:"small",class:"text-icon-success"})}})),W(X,()=>$.description),W(Y,m(_e,{get when(){return $.command},get children(){var se=D0i();return W(se,()=>$.command),se}}),null),W(B,m(_e,{get when(){return $.lastOutput},get children(){var se=R0i();return W(se,()=>$.lastOutput),se}}),null),st(()=>U.disabled=i.busy),B})()}),null),W(T,m(_e,{get when(){return i.adding},get children(){var $=L0i(),j=$.firstChild;return W($,m(ate,{placeholder:"Criterion description...",get value(){return i.newAcDesc},onInput:B=>r("newAcDesc",B.target.value),onKeyDown:B=>B.key==="Enter"&&void f(),class:"w-full",autofocus:!0}),j),W(j,m(ate,{placeholder:"Command (optional)...",get value(){return i.newAcCmd},onInput:B=>r("newAcCmd",B.target.value),onKeyDown:B=>B.key==="Enter"&&void f(),class:"flex-1"}),null),W(j,m(oa,{icon:"check-small",variant:"ghost",onClick:()=>void f(),get disabled(){return!i.newAcDesc.trim()}}),null),W(j,m(oa,{icon:"close-small",variant:"ghost",onClick:()=>{pn(()=>{r("adding",!1),r("newAcDesc",""),r("newAcCmd","")})}}),null),$}}),null),W(C,m(_e,{get when(){return d().length>0},get children(){var $=I0i(),j=$.firstChild,B=j.nextSibling;return W(B,m(ei,{get each(){return d()},children:te=>(()=>{var U=H0i(),Y=U.firstChild,X=Y.firstChild,se=Y.nextSibling;return W(U,m(Cn,{name:"brain",size:"small",class:"mt-0.5 shrink-0 text-icon-weak"}),Y),W(X,()=>te.toolName),W(Y,m(_e,{get when(){return te.outputSummary},get children(){var pe=V0i();return W(pe,()=>te.outputSummary),pe}}),null),W(se,()=>z4e(te.timestamp)),U})()})),$}}),D),W(V,()=>y().createdAt),W(D,m(_e,{get when(){return y().assignee},get children(){var $=N0i(),j=$.firstChild,B=j.nextSibling;return W(B,()=>y().assignee),$}}),null),W(D,m(_e,{get when(){return y().branch},get children(){var $=E0i(),j=$.firstChild,B=j.nextSibling;return W(B,()=>y().branch),$}}),null),C})()})}})),W(g,m(r2i,{get entityId(){return`issue:${o()}`},type:"issue"}),null),g})()}function s2i(n){const t=Zy().trellis,i=J(()=>n.id.replace(/^workunit:/,"")),r=J(()=>t.workUnits.find(l=>l.id===i())),o=J(()=>{const l=r();return l?.criteriaCount?Math.round(l.criteriaPassed/l.criteriaCount*100):0}),s=[{id:"backlog",label:"Backlog"},{id:"in_progress",label:"In Progress"},{id:"done",label:"Done"}],a=l=>{r()?.status!==l&&t.updateWorkUnit(i(),{status:l})};return m(_e,{get when(){return r()},get fallback(){return $0i()},children:l=>(()=>{var c=z0i(),d=c.firstChild,u=d.firstChild,h=u.firstChild,f=h.firstChild,p=f.firstChild,g=p.nextSibling,v=g.nextSibling,y=v.firstChild,C=y.nextSibling,_=C.nextSibling,w=h.nextSibling,x=w.firstChild,M=x.firstChild,L=x.nextSibling,S=w.nextSibling,I=S.firstChild,E=I.firstChild,A=E.nextSibling,T=A.nextSibling,D=T.firstChild,R=I.nextSibling,P=R.firstChild,V=d.nextSibling,$=V.firstChild,j=$.firstChild,B=j.nextSibling,te=B.nextSibling,U=$.nextSibling,Y=U.firstChild;return W(h,m(GZe,{type:"workunit",size:18,class:"mt-1 shrink-0"}),f),W(g,()=>l().title),W(y,()=>l().id),W(C,()=>l().priority),W(_,()=>l().status),W(u,m(_e,{get when(){return l().tags.length>0},get children(){var X=F0i(),se=X.firstChild,pe=se.nextSibling;return W(pe,m(ei,{get each(){return l().tags},children:Ae=>(()=>{var Fe=B0i();return W(Fe,Ae),Fe})()})),X}}),w),W(x,m(Cn,{name:"align-left",size:"small",class:"text-icon-weak"}),M),W(L,()=>l().title),W(I,m(Cn,{name:"checklist",size:"small",class:"text-icon-weak"}),E),W(T,o,D),W(S,m(ei,{get each(){return l().criteria},get fallback(){return dit()},children:X=>(()=>{var se=W0i(),pe=se.firstChild,Ae=pe.firstChild;return W(se,m(_e,{get when(){return X.status==="passed"},get fallback(){return m(_e,{get when(){return X.status==="failed"},get fallback(){return q0i()},get children(){return m(Cn,{name:"close-small",size:"small",class:"mt-0.5 shrink-0 text-icon-error"})}})},get children(){return m(Cn,{name:"check-small",size:"small",class:"mt-0.5 shrink-0 text-icon-success"})}}),pe),W(Ae,()=>X.description),W(pe,m(_e,{get when(){return X.command},get children(){var Fe=j0i();return W(Fe,()=>X.command),Fe}}),null),se})()}),null),W(B,m(ei,{each:s,children:X=>(()=>{var se=U0i();return se.$$click=()=>a(X.id),W(se,()=>X.label),st(pe=>Ko(se,{"border-border-strong-base bg-background-base text-text-strong":l().status===X.id,"border-border-base bg-transparent text-text-weak hover:bg-background-base/70":l().status!==X.id},pe)),se})()})),W(te,m(eC,{label:"Cycle",get value(){return l().cycle||"Unassigned"}}),null),W(te,m(eC,{label:"Spec",get value(){return l().specPath||"None"}}),null),W(te,m(eC,{label:"Created",get value(){return z4e(l().createdAt)}}),null),W(te,m(eC,{label:"Updated",get value(){return z4e(l().updatedAt)}}),null),W(te,m(_e,{get when(){return l().assignee},get children(){return m(eC,{label:"Assignee",get value(){return l().assignee}})}}),null),W(U,m(Cn,{name:"history",size:"small",class:"text-icon-weak"}),Y),W(V,m(lte,{get id(){return n.id},type:"workunit"}),null),st(X=>Sr(P,"width",`${o()}%`)),c})()})}function eC(n){return(()=>{var e=Z0i(),t=e.firstChild,i=t.nextSibling;return W(t,()=>n.label),W(i,()=>n.value),st(()=>mt(i,"title",n.value)),e})()}function uit(n){const e=Zy(),[t]=mo(()=>n.id,e.trellis.fetchEntity,{initialValue:void 0}),i=J(()=>F4e(n.id)),r=()=>t.latest,o=J(()=>pDe(r(),["title","name","message","estimatedIntent","url"])??Q0i(i())),s=J(()=>pDe(r(),["description","purpose","summary"])),a=J(()=>!!o()||!!s()),l=J(()=>"details"),c=J(()=>lit.filter(d=>d.id!=="preview"));return(()=>{var d=X0i();return W(d,m(_e,{get when(){return a()},get children(){var u=G0i(),h=u.firstChild;return W(h,o),W(u,m(_e,{get when(){return s()},get children(){var f=K0i();return W(f,s),f}}),null),st(()=>mt(h,"title",o())),u}}),null),W(d,m(cit,{get id(){return n.id},get type(){return n.type},get initialTab(){return l()},get items(){return c()}}),null),d})()}Fs(["click"]);function a2i(){const n=xy(),e=oMn(),t=Aa();let i,r;return Re(()=>{const o=t.id;if(!o){i&&(e.removeJob(i),i=void 0);return}(n.data.session_status[o]?.type??"idle")!=="idle"?i||(i=e.addJob({type:"generate",label:"Generating...",status:"running"})):i&&(e.removeJob(i),i=void 0)}),Re(()=>{const o=n.data.status;o==="loading"||o==="partial"?r||(r=e.addJob({type:"sync",label:"Syncing project...",status:"running"})):r&&(e.removeJob(r),r=void 0)}),Oe(()=>{i&&e.removeJob(i),r&&e.removeJob(r),i=void 0,r=void 0}),null}const[B4e,qb]=Yt({data:null,loading:!1}),syi=B4e;let d0=null,Rhe=0;const l2i=()=>{if(typeof window<"u"&&window.innerWidth<768)return!1;const n=navigator.connection;return!(n?.saveData||n?.type==="cellular")};async function gDe(n){if(B4e.data||B4e.loading||!l2i())return;const e=++Rhe;d0&&(d0.abort(),d0=null),d0=new AbortController,qb("loading",!0);const t=await n({includeHidden:!0,includeImports:!0,includeLinks:!0,includeOps:!1}).catch(()=>null);t&&e===Rhe&&!d0.signal.aborted&&qb("data",t),e===Rhe&&(qb("loading",!1),d0=null)}function ayi(){d0&&(d0.abort(),d0=null),qb("data",null),qb("loading",!1)}function c2i(){const n=l2(),e=TMn();return Re(()=>{if(n.ready&&e.stats&&!e.large)if(typeof window<"u"&&"requestIdleCallback"in window){const t=window.requestIdleCallback(()=>gDe(n.fetchGraph),{timeout:5e3});Oe(()=>window.cancelIdleCallback(t))}else{const t=setTimeout(()=>gDe(n.fetchGraph),3e3);Oe(()=>clearTimeout(t))}}),null}function d2i(n,e){n.indexOf(e)===-1&&n.push(e)}function nke(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const dp=(n,e,t)=>t>e?e:t<n?n:t;let ike=()=>{};const up={},hit=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n),u2i=n=>typeof n=="object"&&n!==null,fit=n=>/^0[^.\s]+$/u.test(n);function pit(n){let e;return()=>(e===void 0&&(e=n()),e)}const Ky=n=>n,rke=(...n)=>n.reduce((e,t)=>i=>t(e(i))),oke=(n,e,t)=>{const i=e-n;return i?(t-n)/i:1};class git{constructor(){this.subscriptions=[]}add(e){return d2i(this.subscriptions,e),()=>nke(this.subscriptions,e)}notify(e,t,i){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,i);else for(let o=0;o<r;o++){const s=this.subscriptions[o];s&&s(e,t,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const P1=n=>n*1e3,Od=n=>n/1e3,mit=(n,e)=>e?n*(1e3/e):0,h2i=(n,e,t)=>{const i=e-n;return((t-n)%i+i)%i+n},vit=(n,e,t)=>(((1-3*t+3*e)*n+(3*t-6*e))*n+3*e)*n,f2i=1e-7,p2i=12;function g2i(n,e,t,i,r){let o,s,a=0;do s=e+(t-e)/2,o=vit(s,i,r)-n,o>0?t=s:e=s;while(Math.abs(o)>f2i&&++a<p2i);return s}function Xx(n,e,t,i){if(n===e&&t===i)return Ky;const r=o=>g2i(o,0,1,n,t);return o=>o===0||o===1?o:vit(r(o),e,i)}const yit=n=>e=>e<=.5?n(2*e)/2:(2-n(2*(1-e)))/2,ske=n=>e=>1-n(1-e),kit=Xx(.33,1.53,.69,.99),ake=ske(kit),Cit=yit(ake),bit=n=>n>=1?1:(n*=2)<1?.5*ake(n):.5*(2-Math.pow(2,-10*(n-1))),lke=n=>1-Math.sin(Math.acos(n)),m2i=ske(lke),wit=yit(lke),v2i=Xx(.42,0,1,1),y2i=Xx(0,0,.58,1),_it=Xx(.42,0,.58,1),xit=n=>Array.isArray(n)&&typeof n[0]!="number";function Sit(n,e){return xit(n)?n[h2i(0,n.length,e)]:n}const Mit=n=>Array.isArray(n)&&typeof n[0]=="number",k2i={linear:Ky,easeIn:v2i,easeInOut:_it,easeOut:y2i,circIn:lke,circInOut:wit,circOut:m2i,backIn:ake,backInOut:Cit,backOut:kit,anticipate:bit},C2i=n=>typeof n=="string",mDe=n=>{if(Mit(n)){ike(n.length===4);const[e,t,i,r]=n;return Xx(e,t,i,r)}else if(C2i(n))return k2i[n];return n},LL=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function b2i(n,e){let t=new Set,i=new Set,r=!1,o=!1;const s=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(d){s.has(d)&&(c.schedule(d),n()),d(a)}const c={schedule:(d,u=!1,h=!1)=>{const p=h&&r?t:i;return u&&s.add(d),p.add(d),d},cancel:d=>{i.delete(d),s.delete(d)},process:d=>{if(a=d,r){o=!0;return}r=!0;const u=t;t=i,i=u,t.forEach(l),t.clear(),r=!1,o&&(o=!1,c.process(d))}};return c}const w2i=40;function Lit(n,e){let t=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},o=()=>t=!0,s=LL.reduce((_,w)=>(_[w]=b2i(o),_),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:d,update:u,preRender:h,render:f,postRender:p}=s,g=()=>{const _=up.useManualTiming,w=_?r.timestamp:performance.now();t=!1,_||(r.delta=i?1e3/60:Math.max(Math.min(w-r.timestamp,w2i),1)),r.timestamp=w,r.isProcessing=!0,a.process(r),l.process(r),c.process(r),d.process(r),u.process(r),h.process(r),f.process(r),p.process(r),r.isProcessing=!1,t&&e&&(i=!1,n(g))},v=()=>{t=!0,i=!0,r.isProcessing||n(g)};return{schedule:LL.reduce((_,w)=>{const x=s[w];return _[w]=(M,L=!1,S=!1)=>(t||v(),x.schedule(M,L,S)),_},{}),cancel:_=>{for(let w=0;w<LL.length;w++)s[LL[w]].cancel(_)},state:r,steps:s}}const{schedule:ah,cancel:j4e,state:Zoe}=Lit(typeof requestAnimationFrame<"u"?requestAnimationFrame:Ky,!0);let Yte;function _2i(){Yte=void 0}const Fc={now:()=>(Yte===void 0&&Fc.set(Zoe.isProcessing||up.useManualTiming?Zoe.timestamp:performance.now()),Yte),set:n=>{Yte=n,queueMicrotask(_2i)}},Iit=n=>e=>typeof e=="string"&&e.startsWith(n),Nit=Iit("--"),x2i=Iit("var(--"),cke=n=>x2i(n)?S2i.test(n.split("/*")[0].trim()):!1,S2i=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function vDe(n){return typeof n!="string"?!1:n.split("/*")[0].includes("var(--")}const Gy={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},N_={...Gy,transform:n=>dp(0,1,n)},IL={...Gy,default:1},Ub=n=>Math.round(n*1e5)/1e5,dke=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function M2i(n){return n==null}const L2i=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,uke=(n,e)=>t=>!!(typeof t=="string"&&L2i.test(t)&&t.startsWith(n)||e&&!M2i(t)&&Object.prototype.hasOwnProperty.call(t,e)),Eit=(n,e,t)=>i=>{if(typeof i!="string")return i;const[r,o,s,a]=i.match(dke);return{[n]:parseFloat(r),[e]:parseFloat(o),[t]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}},I2i=n=>dp(0,255,n),Phe={...Gy,transform:n=>Math.round(I2i(n))},i6={test:uke("rgb","red"),parse:Eit("red","green","blue"),transform:({red:n,green:e,blue:t,alpha:i=1})=>"rgba("+Phe.transform(n)+", "+Phe.transform(e)+", "+Phe.transform(t)+", "+Ub(N_.transform(i))+")"};function N2i(n){let e="",t="",i="",r="";return n.length>5?(e=n.substring(1,3),t=n.substring(3,5),i=n.substring(5,7),r=n.substring(7,9)):(e=n.substring(1,2),t=n.substring(2,3),i=n.substring(3,4),r=n.substring(4,5),e+=e,t+=t,i+=i,r+=r),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const W4e={test:uke("#"),parse:N2i,transform:i6.transform},Yx=n=>({test:e=>typeof e=="string"&&e.endsWith(n)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${n}`}),e0=Yx("deg"),ov=Yx("%"),Ht=Yx("px"),E2i=Yx("vh"),T2i=Yx("vw"),yDe={...ov,parse:n=>ov.parse(n)/100,transform:n=>ov.transform(n*100)},C7={test:uke("hsl","hue"),parse:Eit("hue","saturation","lightness"),transform:({hue:n,saturation:e,lightness:t,alpha:i=1})=>"hsla("+Math.round(n)+", "+ov.transform(Ub(e))+", "+ov.transform(Ub(t))+", "+Ub(N_.transform(i))+")"},as={test:n=>i6.test(n)||W4e.test(n)||C7.test(n),parse:n=>i6.test(n)?i6.parse(n):C7.test(n)?C7.parse(n):W4e.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?i6.transform(n):C7.transform(n),getAnimatableNone:n=>{const e=as.parse(n);return e.alpha=0,as.transform(e)}},A2i=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function D2i(n){return isNaN(n)&&typeof n=="string"&&(n.match(dke)?.length||0)+(n.match(A2i)?.length||0)>0}const Tit="number",Ait="color",R2i="var",P2i="var(",kDe="${}",O2i=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ty(n){const e=n.toString(),t=[],i={color:[],number:[],var:[]},r=[];let o=0;const a=e.replace(O2i,l=>(as.test(l)?(i.color.push(o),r.push(Ait),t.push(as.parse(l))):l.startsWith(P2i)?(i.var.push(o),r.push(R2i),t.push(l)):(i.number.push(o),r.push(Tit),t.push(parseFloat(l))),++o,kDe)).split(kDe);return{values:t,split:a,indexes:i,types:r}}function V2i(n){return ty(n).values}function Dit({split:n,types:e}){const t=n.length;return i=>{let r="";for(let o=0;o<t;o++)if(r+=n[o],i[o]!==void 0){const s=e[o];s===Tit?r+=Ub(i[o]):s===Ait?r+=as.transform(i[o]):r+=i[o]}return r}}function H2i(n){return Dit(ty(n))}const $2i=n=>typeof n=="number"?0:as.test(n)?as.getAnimatableNone(n):n,F2i=(n,e)=>typeof n=="number"?e?.trim().endsWith("/")?n:0:$2i(n);function z2i(n){const e=ty(n);return Dit(e)(e.values.map((i,r)=>F2i(i,e.split[r])))}const qd={test:D2i,parse:V2i,createTransformer:H2i,getAnimatableNone:z2i};function Ohe(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function B2i({hue:n,saturation:e,lightness:t,alpha:i}){n/=360,e/=100,t/=100;let r=0,o=0,s=0;if(!e)r=o=s=t;else{const a=t<.5?t*(1+e):t+e-t*e,l=2*t-a;r=Ohe(l,a,n+1/3),o=Ohe(l,a,n),s=Ohe(l,a,n-1/3)}return{red:Math.round(r*255),green:Math.round(o*255),blue:Math.round(s*255),alpha:i}}function Koe(n,e){return t=>t>0?e:n}const Xy=(n,e,t)=>n+(e-n)*t,Vhe=(n,e,t)=>{const i=n*n,r=t*(e*e-i)+i;return r<0?0:Math.sqrt(r)},j2i=[W4e,i6,C7],W2i=n=>j2i.find(e=>e.test(n));function CDe(n){const e=W2i(n);if(!e)return!1;let t=e.parse(n);return e===C7&&(t=B2i(t)),t}const bDe=(n,e)=>{const t=CDe(n),i=CDe(e);if(!t||!i)return Koe(n,e);const r={...t};return o=>(r.red=Vhe(t.red,i.red,o),r.green=Vhe(t.green,i.green,o),r.blue=Vhe(t.blue,i.blue,o),r.alpha=Xy(t.alpha,i.alpha,o),i6.transform(r))},q4e=new Set(["none","hidden"]);function q2i(n,e){return q4e.has(n)?t=>t<=0?n:e:t=>t>=1?e:n}function U2i(n,e){return t=>Xy(n,e,t)}function hke(n){return typeof n=="number"?U2i:typeof n=="string"?cke(n)?Koe:as.test(n)?bDe:G2i:Array.isArray(n)?Rit:typeof n=="object"?as.test(n)?bDe:Z2i:Koe}function Rit(n,e){const t=[...n],i=t.length,r=n.map((o,s)=>hke(o)(o,e[s]));return o=>{for(let s=0;s<i;s++)t[s]=r[s](o);return t}}function Z2i(n,e){const t={...n,...e},i={};for(const r in t)n[r]!==void 0&&e[r]!==void 0&&(i[r]=hke(n[r])(n[r],e[r]));return r=>{for(const o in i)t[o]=i[o](r);return t}}function K2i(n,e){const t=[],i={color:0,var:0,number:0};for(let r=0;r<e.values.length;r++){const o=e.types[r],s=n.indexes[o][i[o]],a=n.values[s]??0;t[r]=a,i[o]++}return t}const G2i=(n,e)=>{const t=qd.createTransformer(e),i=ty(n),r=ty(e);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?q4e.has(n)&&!r.values.length||q4e.has(e)&&!i.values.length?q2i(n,e):rke(Rit(K2i(i,r),r.values),t):Koe(n,e)};function Pit(n,e,t){return typeof n=="number"&&typeof e=="number"&&typeof t=="number"?Xy(n,e,t):hke(n)(n,e)}const X2i=n=>{const e=({timestamp:t})=>n(t);return{start:(t=!0)=>ah.update(e,t),stop:()=>j4e(e),now:()=>Zoe.isProcessing?Zoe.timestamp:Fc.now()}},Oit=(n,e,t=10)=>{let i="";const r=Math.max(Math.round(e/t),2);for(let o=0;o<r;o++)i+=Math.round(n(o/(r-1))*1e4)/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},Goe=2e4;function fke(n){let e=0;const t=50;let i=n.next(e);for(;!i.done&&e<Goe;)e+=t,i=n.next(e);return e>=Goe?1/0:e}function Vit(n,e=100,t){const i=t({...n,keyframes:[0,e]}),r=Math.min(fke(i),Goe);return{type:"keyframes",ease:o=>i.next(r*o).value/e,duration:Od(r)}}const Ao={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function U4e(n,e){return n*Math.sqrt(1-e*e)}const Y2i=12;function J2i(n,e,t){let i=t;for(let r=1;r<Y2i;r++)i=i-n(i)/e(i);return i}const Hhe=.001;function Q2i({duration:n=Ao.duration,bounce:e=Ao.bounce,velocity:t=Ao.velocity,mass:i=Ao.mass}){let r,o,s=1-e;s=dp(Ao.minDamping,Ao.maxDamping,s),n=dp(Ao.minDuration,Ao.maxDuration,Od(n)),s<1?(r=c=>{const d=c*s,u=d*n,h=d-t,f=U4e(c,s),p=Math.exp(-u);return Hhe-h/f*p},o=c=>{const u=c*s*n,h=u*t+t,f=Math.pow(s,2)*Math.pow(c,2)*n,p=Math.exp(-u),g=U4e(Math.pow(c,2),s);return(-r(c)+Hhe>0?-1:1)*((h-f)*p)/g}):(r=c=>{const d=Math.exp(-c*n),u=(c-t)*n+1;return-Hhe+d*u},o=c=>{const d=Math.exp(-c*n),u=(t-c)*(n*n);return d*u});const a=5/n,l=J2i(r,o,a);if(n=P1(n),isNaN(l))return{stiffness:Ao.stiffness,damping:Ao.damping,duration:n};{const c=Math.pow(l,2)*i;return{stiffness:c,damping:s*2*Math.sqrt(i*c),duration:n}}}const efi=["duration","bounce"],tfi=["stiffness","damping","mass"];function wDe(n,e){return e.some(t=>n[t]!==void 0)}function nfi(n){let e={velocity:Ao.velocity,stiffness:Ao.stiffness,damping:Ao.damping,mass:Ao.mass,isResolvedFromDuration:!1,...n};if(!wDe(n,tfi)&&wDe(n,efi))if(e.velocity=0,n.visualDuration){const t=n.visualDuration,i=2*Math.PI/(t*1.2),r=i*i,o=2*dp(.05,1,1-(n.bounce||0))*Math.sqrt(r);e={...e,mass:Ao.mass,stiffness:r,damping:o}}else{const t=Q2i({...n,velocity:0});e={...e,...t,mass:Ao.mass},e.isResolvedFromDuration=!0}return e}function E_(n=Ao.visualDuration,e=Ao.bounce){const t=typeof n!="object"?{visualDuration:n,keyframes:[0,1],bounce:e}:n;let{restSpeed:i,restDelta:r}=t;const o=t.keyframes[0],s=t.keyframes[t.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:c,mass:d,duration:u,velocity:h,isResolvedFromDuration:f}=nfi({...t,velocity:-Od(t.velocity||0)}),p=h||0,g=c/(2*Math.sqrt(l*d)),v=s-o,y=Od(Math.sqrt(l/d)),C=Math.abs(v)<5;i||(i=C?Ao.restSpeed.granular:Ao.restSpeed.default),r||(r=C?Ao.restDelta.granular:Ao.restDelta.default);let _,w,x,M,L,S;if(g<1)x=U4e(y,g),M=(p+g*y*v)/x,_=E=>{const A=Math.exp(-g*y*E);return s-A*(M*Math.sin(x*E)+v*Math.cos(x*E))},L=g*y*M+v*x,S=g*y*v-M*x,w=E=>Math.exp(-g*y*E)*(L*Math.sin(x*E)+S*Math.cos(x*E));else if(g===1){_=A=>s-Math.exp(-y*A)*(v+(p+y*v)*A);const E=p+y*v;w=A=>Math.exp(-y*A)*(y*E*A-p)}else{const E=y*Math.sqrt(g*g-1);_=R=>{const P=Math.exp(-g*y*R),V=Math.min(E*R,300);return s-P*((p+g*y*v)*Math.sinh(V)+E*v*Math.cosh(V))/E};const A=(p+g*y*v)/E,T=g*y*A-v*E,D=g*y*v-A*E;w=R=>{const P=Math.exp(-g*y*R),V=Math.min(E*R,300);return P*(T*Math.sinh(V)+D*Math.cosh(V))}}const I={calculatedDuration:f&&u||null,velocity:E=>P1(w(E)),next:E=>{if(!f&&g<1){const T=Math.exp(-g*y*E),D=Math.sin(x*E),R=Math.cos(x*E),P=s-T*(M*D+v*R),V=P1(T*(L*D+S*R));return a.done=Math.abs(V)<=i&&Math.abs(s-P)<=r,a.value=a.done?s:P,a}const A=_(E);if(f)a.done=E>=u;else{const T=P1(w(E));a.done=Math.abs(T)<=i&&Math.abs(s-A)<=r}return a.value=a.done?s:A,a},toString:()=>{const E=Math.min(fke(I),Goe),A=Oit(T=>I.next(E*T).value,E,30);return E+"ms "+A},toTransition:()=>{}};return I}E_.applyToOptions=n=>{const e=Vit(n,100,E_);return n.ease=e.ease,n.duration=P1(e.duration),n.type="keyframes",n};const ifi=5;function Hit(n,e,t){const i=Math.max(e-ifi,0);return mit(t-n(i),e-i)}function Z4e({keyframes:n,velocity:e=0,power:t=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:o=500,modifyTarget:s,min:a,max:l,restDelta:c=.5,restSpeed:d}){const u=n[0],h={done:!1,value:u},f=S=>a!==void 0&&S<a||l!==void 0&&S>l,p=S=>a===void 0?l:l===void 0||Math.abs(a-S)<Math.abs(l-S)?a:l;let g=t*e;const v=u+g,y=s===void 0?v:s(v);y!==v&&(g=y-u);const C=S=>-g*Math.exp(-S/i),_=S=>y+C(S),w=S=>{const I=C(S),E=_(S);h.done=Math.abs(I)<=c,h.value=h.done?y:E};let x,M;const L=S=>{f(h.value)&&(x=S,M=E_({keyframes:[h.value,p(h.value)],velocity:Hit(_,S,h.value),damping:r,stiffness:o,restDelta:c,restSpeed:d}))};return L(0),{calculatedDuration:null,next:S=>{let I=!1;return!M&&x===void 0&&(I=!0,w(S),L(S)),x!==void 0&&S>=x?M.next(S-x):(!I&&w(S),h)}}}function rfi(n,e,t){const i=[],r=t||up.mix||Pit,o=n.length-1;for(let s=0;s<o;s++){let a=r(n[s],n[s+1]);if(e){const l=Array.isArray(e)?e[s]||Ky:e;a=rke(l,a)}i.push(a)}return i}function ofi(n,e,{clamp:t=!0,ease:i,mixer:r}={}){const o=n.length;if(ike(o===e.length),o===1)return()=>e[0];if(o===2&&e[0]===e[1])return()=>e[1];const s=n[0]===n[1];n[0]>n[o-1]&&(n=[...n].reverse(),e=[...e].reverse());const a=rfi(e,i,r),l=a.length,c=d=>{if(s&&d<n[0])return e[0];let u=0;if(l>1)for(;u<n.length-2&&!(d<n[u+1]);u++);const h=oke(n[u],n[u+1],d);return a[u](h)};return t?d=>c(dp(n[0],n[o-1],d)):c}function $it(n,e){const t=n[n.length-1];for(let i=1;i<=e;i++){const r=oke(0,e,i);n.push(Xy(t,1,r))}}function Fit(n){const e=[0];return $it(e,n.length-1),e}function sfi(n,e){return n.map(t=>t*e)}function afi(n,e){return n.map(()=>e||_it).splice(0,n.length-1)}function Zb({duration:n=300,keyframes:e,times:t,ease:i="easeInOut"}){const r=xit(i)?i.map(mDe):mDe(i),o={done:!1,value:e[0]},s=sfi(t&&t.length===e.length?t:Fit(e),n),a=ofi(s,e,{ease:Array.isArray(r)?r:afi(e,r)});return{calculatedDuration:n,next:l=>(o.value=a(l),o.done=l>=n,o)}}const lfi=n=>n!==null;function pce(n,{repeat:e,repeatType:t="loop"},i,r=1){const o=n.filter(lfi),a=r<0||e&&t!=="loop"&&e%2===1?0:o.length-1;return!a||i===void 0?o[a]:i}const cfi={decay:Z4e,inertia:Z4e,tween:Zb,keyframes:Zb,spring:E_};function zit(n){typeof n.type=="string"&&(n.type=cfi[n.type])}class pke{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}}const dfi=n=>n/100;class Xoe extends pke{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==Fc.now()&&this.tick(Fc.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;zit(e);const{type:t=Zb,repeat:i=0,repeatDelay:r=0,repeatType:o,velocity:s=0}=e;let{keyframes:a}=e;const l=t||Zb;l!==Zb&&typeof a[0]!="number"&&(this.mixKeyframes=rke(dfi,Pit(a[0],a[1])),a=[0,100]);const c=l({...e,keyframes:a});o==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...a].reverse(),velocity:-s})),c.calculatedDuration===null&&(c.calculatedDuration=fke(c));const{calculatedDuration:d}=c;this.calculatedDuration=d,this.resolvedDuration=d+r,this.totalDuration=this.resolvedDuration*(i+1)-r,this.generator=c}updateTime(e){const t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=t}tick(e,t=!1){const{generator:i,totalDuration:r,mixKeyframes:o,mirroredGenerator:s,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return i.next(0);const{delay:c=0,keyframes:d,repeat:u,repeatType:h,repeatDelay:f,type:p,onUpdate:g,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);const y=this.currentTime-c*(this.playbackSpeed>=0?1:-1),C=this.playbackSpeed>=0?y<0:y>r;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let _=this.currentTime,w=i;if(u){const S=Math.min(this.currentTime,r)/a;let I=Math.floor(S),E=S%1;!E&&S>=1&&(E=1),E===1&&I--,I=Math.min(I,u+1),!!(I%2)&&(h==="reverse"?(E=1-E,f&&(E-=f/a)):h==="mirror"&&(w=s)),_=dp(0,1,E)*a}let x;C?(this.delayState.value=d[0],x=this.delayState):x=w.next(_),o&&!C&&(x.value=o(x.value));let{done:M}=x;!C&&l!==null&&(M=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const L=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return L&&p!==Z4e&&(x.value=pce(d,this.options,v,this.speed)),g&&g(x.value),L&&this.finish(),x}then(e,t){return this.finished.then(e,t)}get duration(){return Od(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Od(e)}get time(){return Od(this.currentTime)}set time(e){e=P1(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const t=this.generator.next(e).value;return Hit(i=>this.generator.next(i).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(Fc.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=Od(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=X2i,startTime:t}=this.options;this.driver||(this.driver=e(r=>this.tick(r))),this.options.onPlay?.();const i=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=i):this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime||(this.startTime=t??i),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Fc.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function ufi(n){for(let e=1;e<n.length;e++)n[e]??(n[e]=n[e-1])}const r6=n=>n*180/Math.PI,K4e=n=>{const e=r6(Math.atan2(n[1],n[0]));return G4e(e)},hfi={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:n=>(Math.abs(n[0])+Math.abs(n[3]))/2,rotate:K4e,rotateZ:K4e,skewX:n=>r6(Math.atan(n[1])),skewY:n=>r6(Math.atan(n[2])),skew:n=>(Math.abs(n[1])+Math.abs(n[2]))/2},G4e=n=>(n=n%360,n<0&&(n+=360),n),_De=K4e,xDe=n=>Math.sqrt(n[0]*n[0]+n[1]*n[1]),SDe=n=>Math.sqrt(n[4]*n[4]+n[5]*n[5]),ffi={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:xDe,scaleY:SDe,scale:n=>(xDe(n)+SDe(n))/2,rotateX:n=>G4e(r6(Math.atan2(n[6],n[5]))),rotateY:n=>G4e(r6(Math.atan2(-n[2],n[0]))),rotateZ:_De,rotate:_De,skewX:n=>r6(Math.atan(n[4])),skewY:n=>r6(Math.atan(n[1])),skew:n=>(Math.abs(n[1])+Math.abs(n[4]))/2};function X4e(n){return n.includes("scale")?1:0}function Y4e(n,e){if(!n||n==="none")return X4e(e);const t=n.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,r;if(t)i=ffi,r=t;else{const a=n.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=hfi,r=a}if(!r)return X4e(e);const o=i[e],s=r[1].split(",").map(gfi);return typeof o=="function"?o(s):s[o]}const pfi=(n,e)=>{const{transform:t="none"}=getComputedStyle(n);return Y4e(t,e)};function gfi(n){return parseFloat(n.trim())}const Yy=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Jy=new Set([...Yy,"pathRotation"]),MDe=n=>n===Gy||n===Ht,mfi=new Set(["x","y","z"]),vfi=Yy.filter(n=>!mfi.has(n));function yfi(n){const e=[];return vfi.forEach(t=>{const i=n.getValue(t);i!==void 0&&(e.push([t,i.get()]),i.set(t.startsWith("scale")?1:0))}),e}const xf={width:({x:n},{paddingLeft:e="0",paddingRight:t="0",boxSizing:i})=>{const r=n.max-n.min;return i==="border-box"?r:r-parseFloat(e)-parseFloat(t)},height:({y:n},{paddingTop:e="0",paddingBottom:t="0",boxSizing:i})=>{const r=n.max-n.min;return i==="border-box"?r:r-parseFloat(e)-parseFloat(t)},top:(n,{top:e})=>parseFloat(e),left:(n,{left:e})=>parseFloat(e),bottom:({y:n},{top:e})=>parseFloat(e)+(n.max-n.min),right:({x:n},{left:e})=>parseFloat(e)+(n.max-n.min),x:(n,{transform:e})=>Y4e(e,"x"),y:(n,{transform:e})=>Y4e(e,"y")};xf.translateX=xf.x;xf.translateY=xf.y;const x6=new Set;let J4e=!1,Q4e=!1,e5e=!1;function Bit(){if(Q4e){const n=Array.from(x6).filter(i=>i.needsMeasurement),e=new Set(n.map(i=>i.element)),t=new Map;e.forEach(i=>{const r=yfi(i);r.length&&(t.set(i,r),i.render())}),n.forEach(i=>i.measureInitialState()),e.forEach(i=>{i.render();const r=t.get(i);r&&r.forEach(([o,s])=>{i.getValue(o)?.set(s)})}),n.forEach(i=>i.measureEndState()),n.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}Q4e=!1,J4e=!1,x6.forEach(n=>n.complete(e5e)),x6.clear()}function jit(){x6.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(Q4e=!0)})}function kfi(){e5e=!0,jit(),Bit(),e5e=!1}class gke{constructor(e,t,i,r,o,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=i,this.motionValue=r,this.element=o,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(x6.add(this),J4e||(J4e=!0,ah.read(jit),ah.resolveKeyframes(Bit))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:i,motionValue:r}=this;if(e[0]===null){const o=r?.get(),s=e[e.length-1];if(o!==void 0)e[0]=o;else if(i&&t){const a=i.readValue(t,s);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=s),r&&o===void 0&&r.set(e[0])}ufi(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),x6.delete(this)}cancel(){this.state==="scheduled"&&(x6.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Cfi=n=>n.startsWith("--");function Wit(n,e,t){Cfi(e)?n.style.setProperty(e,t):n.style[e]=t}const bfi={};function qit(n,e){const t=pit(n);return()=>bfi[e]??t()}const wfi=qit(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Uit=qit(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),HC=([n,e,t,i])=>`cubic-bezier(${n}, ${e}, ${t}, ${i})`,LDe={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:HC([0,.65,.55,1]),circOut:HC([.55,0,1,.45]),backIn:HC([.31,.01,.66,-.59]),backOut:HC([.33,1.53,.69,.99])};function Zit(n,e){if(n)return typeof n=="function"?Uit()?Oit(n,e):"ease-out":Mit(n)?HC(n):Array.isArray(n)?n.map(t=>Zit(t,e)||LDe.easeOut):LDe[n]}function _fi(n,e,t,{delay:i=0,duration:r=300,repeat:o=0,repeatType:s="loop",ease:a="easeOut",times:l}={},c=void 0){const d={[e]:t};l&&(d.offset=l);const u=Zit(a,r);Array.isArray(u)&&(d.easing=u);const h={delay:i,duration:r,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:o+1,direction:s==="reverse"?"alternate":"normal"};return c&&(h.pseudoElement=c),n.animate(d,h)}function mke(n){return typeof n=="function"&&"applyToOptions"in n}function xfi({type:n,...e}){return mke(n)&&Uit()?n.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Kit extends pke{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:t,name:i,keyframes:r,pseudoElement:o,allowFlatten:s=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=!!o,this.allowFlatten=s,this.options=e,ike(typeof e.type!="string");const c=xfi(e);this.animation=_fi(t,i,r,c,o),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const d=pce(r,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(d),Wit(t,i,d),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return Od(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Od(e)}get time(){return Od(Number(this.animation.currentTime)||0)}set time(e){const t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=P1(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:i,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&wfi()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),i&&(this.animation.rangeEnd=i),Ky):r(this)}}const Git={anticipate:bit,backInOut:Cit,circInOut:wit};function Sfi(n){return n in Git}function Mfi(n){typeof n.ease=="string"&&Sfi(n.ease)&&(n.ease=Git[n.ease])}const $he=10;class Lfi extends Kit{constructor(e){Mfi(e),zit(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:t,onUpdate:i,onComplete:r,element:o,...s}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}const a=new Xoe({...s,autoplay:!1}),l=Math.max($he,Fc.now()-this.startTime),c=dp(0,$he,l-$he),d=a.sample(l).value,{name:u}=this.options;o&&u&&Wit(o,u,d),t.setWithVelocity(a.sample(Math.max(0,l-c)).value,d,c),a.stop()}}const IDe=(n,e)=>e==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(qd.test(n)||n==="0")&&!n.startsWith("url("));function Ifi(n){const e=n[0];if(n.length===1)return!0;for(let t=0;t<n.length;t++)if(n[t]!==e)return!0}function Nfi(n,e,t,i){const r=n[0];if(r===null)return!1;if(e==="display"||e==="visibility")return!0;const o=n[n.length-1],s=IDe(r,e),a=IDe(o,e);return!s||!a?!1:Ifi(n)||(t==="spring"||mke(t))&&i}function t5e(n){n.duration=0,n.type="keyframes"}const Xit=new Set(["opacity","clipPath","filter","transform"]),Efi=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Tfi(n){for(let e=0;e<n.length;e++)if(typeof n[e]=="string"&&Efi.test(n[e]))return!0;return!1}const Afi=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Dfi=pit(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Rfi(n){const{motionValue:e,name:t,repeatDelay:i,repeatType:r,damping:o,type:s,keyframes:a}=n;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:d}=e.owner.getProps();return Dfi()&&t&&(Xit.has(t)||Afi.has(t)&&Tfi(a))&&(t!=="transform"||!d)&&!c&&!i&&r!=="mirror"&&o!==0&&s!=="inertia"}const Pfi=40;class Ofi extends pke{constructor({autoplay:e=!0,delay:t=0,type:i="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:s="loop",keyframes:a,name:l,motionValue:c,element:d,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Fc.now();const h={autoplay:e,delay:t,type:i,repeat:r,repeatDelay:o,repeatType:s,name:l,motionValue:c,element:d,...u},f=d?.KeyframeResolver||gke;this.keyframeResolver=new f(a,(p,g,v)=>this.onKeyframesResolved(p,g,h,!v),l,c,d),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,i,r){this.keyframeResolver=void 0;const{name:o,type:s,velocity:a,delay:l,isHandoff:c,onUpdate:d}=i;this.resolvedAt=Fc.now();let u=!0;Nfi(e,o,s,a)||(u=!1,(up.instantAnimations||!l)&&d?.(pce(e,i,t)),e[0]=e[e.length-1],t5e(i),i.repeat=0);const f={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>Pfi?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:t,...i,keyframes:e},p=u&&!c&&Rfi(f),g=f.motionValue?.owner?.current;let v;if(p)try{v=new Lfi({...f,element:g})}catch{v=new Xoe(f)}else v=new Xoe(f);v.finished.then(()=>{this.notifyFinished()}).catch(Ky),this.pendingTimeline&&(this.stopTimeline=v.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=v}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),kfi()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class Vfi{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let i=0;i<this.animations.length;i++)this.animations[i][e]=t}attachTimeline(e){const t=this.animations.map(i=>i.attachTimeline(e));return()=>{t.forEach((i,r)=>{i&&i(),this.animations[r].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return NDe(this.animations,"duration")}get iterationDuration(){return NDe(this.animations,"iterationDuration")}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function NDe(n,e){let t=0;for(let i=0;i<n.length;i++){const r=n[i][e];r!==null&&r>t&&(t=r)}return t}class Hfi extends Vfi{then(e,t){return this.finished.finally(e).then(()=>{})}}const EDe=30,$fi=n=>!isNaN(parseFloat(n));class Ffi{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{const r=Fc.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=Fc.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=$fi(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new git);const i=this.events[e].add(t);return e==="change"?()=>{i(),ah.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,i){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-i}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=Fc.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>EDe)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,EDe);return mit(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ny(n,e){return new Ffi(n,e)}function Yit(n,e){if(n?.inherit&&e){const{inherit:t,...i}=n;return{...e,...i}}return n}function Jit(n,e){const t=n?.[e]??n?.default??n;return t!==n?Yit(t,n):t}const zfi={type:"spring",stiffness:500,damping:25,restSpeed:10},Bfi=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),jfi={type:"keyframes",duration:.8},Wfi={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},qfi=(n,{keyframes:e})=>e.length>2?jfi:Jy.has(n)?n.startsWith("scale")?Bfi(e[1]):zfi:Wfi,Ufi=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Zfi(n){for(const e in n)if(!Ufi.has(e))return!0;return!1}const Qit=(n,e,t,i={},r,o)=>s=>{const a=Jit(i,n)||{},l=a.delay||i.delay||0;let{elapsed:c=0}=i;c=c-P1(l);const d={keyframes:Array.isArray(t)?t:[null,t],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:h=>{e.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:n,motionValue:e,element:o?void 0:r};Zfi(a)||Object.assign(d,qfi(n,d)),d.duration&&(d.duration=P1(d.duration)),d.repeatDelay&&(d.repeatDelay=P1(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let u=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(t5e(d),d.delay===0&&(u=!0)),(up.instantAnimations||up.skipAnimations||r?.shouldSkipAnimations||a.skipAnimations)&&(u=!0,t5e(d),d.delay=0),d.allowFlatten=!a.type&&!a.ease,u&&!o&&e.get()!==void 0){const h=pce(d.keyframes,a);if(h!==void 0){ah.update(()=>{d.onUpdate(h),d.onComplete()});return}}return a.isSync?new Xoe(d):new Ofi(d)},Kfi=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Gfi(n){const e=Kfi.exec(n);if(!e)return[,];const[,t,i,r]=e;return[`--${t??i}`,r]}function ert(n,e,t=1){const[i,r]=Gfi(n);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const s=o.trim();return hit(s)?parseFloat(s):s}return cke(r)?ert(r,e,t+1):r}function TDe(n){const e=[{},{}];return n?.values.forEach((t,i)=>{e[0][i]=t.get(),e[1][i]=t.getVelocity()}),e}function trt(n,e,t,i){if(typeof e=="function"){const[r,o]=TDe(i);e=e(t!==void 0?t:n.custom,r,o)}if(typeof e=="string"&&(e=n.variants&&n.variants[e]),typeof e=="function"){const[r,o]=TDe(i);e=e(t!==void 0?t:n.custom,r,o)}return e}function Xfi(n,e,t){const i=n.getProps();return trt(i,e,i.custom,n)}const nrt=new Set(["width","height","top","left","right","bottom",...Yy]),Yfi=n=>Array.isArray(n);function Jfi(n,e,t){n.hasValue(e)?n.getValue(e).set(t):n.addValue(e,ny(t))}function Qfi(n){return Yfi(n)?n[n.length-1]||0:n}function epi(n,e){const t=Xfi(n,e);let{transitionEnd:i={},transition:r={},...o}=t||{};o={...o,...i};for(const s in o){const a=Qfi(o[s]);Jfi(n,s,a)}}const Ml=n=>!!(n&&n.getVelocity);function tpi(n){return!!(Ml(n)&&n.add)}function npi(n,e){const t=n.getValue("willChange");if(tpi(t))return t.add(e);if(!t&&up.WillChange){const i=new up.WillChange("auto");n.addValue("willChange",i),i.add(e)}}function vke(n){return n.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const ipi="framerAppearId",rpi="data-"+vke(ipi);function opi(n){return n.props[rpi]}function spi({protectedKeys:n,needsAnimating:e},t){const i=n.hasOwnProperty(t)&&e[t]!==!0;return e[t]=!1,i}function api(n,e,{delay:t=0,transitionOverride:i,type:r}={}){let{transition:o,transitionEnd:s,...a}=e;const l=n.getDefaultTransition();o=o?Yit(o,l):l;const c=o?.reduceMotion,d=o?.skipAnimations;i&&(o=i);const u=[],h=r&&n.animationState&&n.animationState.getState()[r],f=o?.path;f&&f.animateVisualElement(n,a,o,t,u);for(const p in a){const g=n.getValue(p,n.latestValues[p]??null),v=a[p];if(v===void 0||h&&spi(h,p))continue;const y={delay:t,...Jit(o||{},p)};d&&(y.skipAnimations=!0);const C=g.get();if(C!==void 0&&!g.isAnimating()&&!Array.isArray(v)&&v===C&&!y.velocity){ah.update(()=>g.set(v));continue}let _=!1;if(window.MotionHandoffAnimation){const M=opi(n);if(M){const L=window.MotionHandoffAnimation(M,p,ah);L!==null&&(y.startTime=L,_=!0)}}npi(n,p);const w=c??n.shouldReduceMotion;g.start(Qit(p,g,v,w&&nrt.has(p)?{type:!1}:y,n,_));const x=g.animation;x&&u.push(x)}if(s){const p=()=>ah.update(()=>{s&&epi(n,s)});u.length?Promise.all(u).then(p):p()}return u}const lpi={test:n=>n==="auto",parse:n=>n},irt=n=>e=>e.test(n),rrt=[Gy,Ht,ov,e0,T2i,E2i,lpi],ADe=n=>rrt.find(irt(n));function cpi(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||fit(n):!0}const dpi=new Set(["brightness","contrast","saturate","opacity"]);function upi(n){const[e,t]=n.slice(0,-1).split("(");if(e==="drop-shadow")return n;const[i]=t.match(dke)||[];if(!i)return n;const r=t.replace(i,"");let o=dpi.has(e)?1:0;return i!==t&&(o*=100),e+"("+o+r+")"}const hpi=/\b([a-z-]*)\(.*?\)/gu,n5e={...qd,getAnimatableNone:n=>{const e=n.match(hpi);return e?e.map(upi).join(" "):n}},i5e={...qd,getAnimatableNone:n=>{const e=qd.parse(n);return qd.createTransformer(n)(e.map(i=>typeof i=="number"?0:typeof i=="object"?{...i,alpha:1}:i))}},DDe={...Gy,transform:Math.round},fpi={rotate:e0,pathRotation:e0,rotateX:e0,rotateY:e0,rotateZ:e0,scale:IL,scaleX:IL,scaleY:IL,scaleZ:IL,skew:e0,skewX:e0,skewY:e0,distance:Ht,translateX:Ht,translateY:Ht,translateZ:Ht,x:Ht,y:Ht,z:Ht,perspective:Ht,transformPerspective:Ht,opacity:N_,originX:yDe,originY:yDe,originZ:Ht},Yoe={borderWidth:Ht,borderTopWidth:Ht,borderRightWidth:Ht,borderBottomWidth:Ht,borderLeftWidth:Ht,borderRadius:Ht,borderTopLeftRadius:Ht,borderTopRightRadius:Ht,borderBottomRightRadius:Ht,borderBottomLeftRadius:Ht,width:Ht,maxWidth:Ht,height:Ht,maxHeight:Ht,top:Ht,right:Ht,bottom:Ht,left:Ht,inset:Ht,insetBlock:Ht,insetBlockStart:Ht,insetBlockEnd:Ht,insetInline:Ht,insetInlineStart:Ht,insetInlineEnd:Ht,padding:Ht,paddingTop:Ht,paddingRight:Ht,paddingBottom:Ht,paddingLeft:Ht,paddingBlock:Ht,paddingBlockStart:Ht,paddingBlockEnd:Ht,paddingInline:Ht,paddingInlineStart:Ht,paddingInlineEnd:Ht,margin:Ht,marginTop:Ht,marginRight:Ht,marginBottom:Ht,marginLeft:Ht,marginBlock:Ht,marginBlockStart:Ht,marginBlockEnd:Ht,marginInline:Ht,marginInlineStart:Ht,marginInlineEnd:Ht,fontSize:Ht,backgroundPositionX:Ht,backgroundPositionY:Ht,...fpi,zIndex:DDe,fillOpacity:N_,strokeOpacity:N_,numOctaves:DDe},ppi={...Yoe,color:as,backgroundColor:as,outlineColor:as,fill:as,stroke:as,borderColor:as,borderTopColor:as,borderRightColor:as,borderBottomColor:as,borderLeftColor:as,filter:n5e,WebkitFilter:n5e,mask:i5e,WebkitMask:i5e},ort=n=>ppi[n],gpi=new Set([n5e,i5e]);function srt(n,e){let t=ort(n);return gpi.has(t)||(t=qd),t.getAnimatableNone?t.getAnimatableNone(e):void 0}const mpi=new Set(["auto","none","0"]);function vpi(n,e,t){let i=0,r;for(;i<n.length&&!r;){const o=n[i];typeof o=="string"&&!mpi.has(o)&&ty(o).values.length&&(r=n[i]),i++}if(r&&t)for(const o of e)n[o]=srt(t,r)}class ypi extends gke{constructor(e,t,i,r,o){super(e,t,i,r,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:i}=this;if(!t||!t.current)return;super.readKeyframes();for(let d=0;d<e.length;d++){let u=e[d];if(typeof u=="string"&&(u=u.trim(),cke(u))){const h=ert(u,t.current);h!==void 0&&(e[d]=h),d===e.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!nrt.has(i)||e.length!==2)return;const[r,o]=e,s=ADe(r),a=ADe(o),l=vDe(r),c=vDe(o);if(l!==c&&xf[i]){this.needsMeasurement=!0;return}if(s!==a)if(MDe(s)&&MDe(a))for(let d=0;d<e.length;d++){const u=e[d];typeof u=="string"&&(e[d]=parseFloat(u))}else xf[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,i=[];for(let r=0;r<e.length;r++)(e[r]===null||cpi(e[r]))&&i.push(r);i.length&&vpi(e,i,t)}measureInitialState(){const{element:e,unresolvedKeyframes:t,name:i}=this;if(!e||!e.current)return;i==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=xf[i](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;const r=t[t.length-1];r!==void 0&&e.getValue(i,r).jump(r,!1)}measureEndState(){const{element:e,name:t,unresolvedKeyframes:i}=this;if(!e||!e.current)return;const r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);const o=i.length-1,s=i[o];i[o]=xf[t](e.measureViewportBox(),window.getComputedStyle(e.current)),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,l])=>{e.getValue(a).set(l)}),this.resolveNoneKeyframes()}}function kpi(n,e,t){if(n==null)return[];if(n instanceof EventTarget)return[n];if(typeof n=="string"){let i=document;e&&(i=e.current);const r=t?.[n]??i.querySelectorAll(n);return r?Array.from(r):[]}return Array.from(n).filter(i=>i!=null)}const r5e=(n,e)=>e&&typeof n=="number"?e.transform(n):n,{schedule:Cpi}=Lit(queueMicrotask,!1);function art(n){return u2i(n)&&"ownerSVGElement"in n}function bpi(n){return art(n)&&n.tagName==="svg"}const wpi=[...rrt,as,qd],_pi=n=>wpi.find(irt(n)),RDe=()=>({min:0,max:0}),yke=()=>({x:RDe(),y:RDe()}),T_=new WeakMap;function xpi(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}function Spi(n){return typeof n=="string"||Array.isArray(n)}const Mpi=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Lpi=["initial",...Mpi];function lrt(n){return xpi(n.animate)||Lpi.some(e=>Spi(n[e]))}function Ipi(n){return!!(lrt(n)||n.variants)}function Npi(n,e,t){for(const i in e){const r=e[i],o=t[i];if(Ml(r))n.addValue(i,r);else if(Ml(o))n.addValue(i,ny(r,{owner:n}));else if(o!==r)if(n.hasValue(i)){const s=n.getValue(i);s.liveStyle===!0?s.jump(r):s.hasAnimated||s.set(r)}else{const s=n.getStaticValue(i);n.addValue(i,ny(s!==void 0?s:r,{owner:n}))}}for(const i in t)e[i]===void 0&&n.removeValue(i);return e}const o5e={current:null},crt={current:!1},Epi=typeof window<"u";function Tpi(){if(crt.current=!0,!!Epi)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),e=()=>o5e.current=n.matches;n.addEventListener("change",e),e()}else o5e.current=!1}const PDe=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let ODe={};class drt{scrapeMotionValuesFromProps(e,t,i){return{}}constructor({parent:e,props:t,presenceContext:i,reducedMotionConfig:r,skipAnimations:o,blockInitialAnimation:s,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=gke,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=Fc.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,ah.render(this.render,!1,!0))};const{latestValues:c,renderState:d}=a;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=d,this.parent=e,this.props=t,this.presenceContext=i,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=o,this.options=l,this.blockInitialAnimation=!!s,this.isControllingVariants=lrt(t),this.isVariantNode=Ipi(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:u,...h}=this.scrapeMotionValuesFromProps(t,{},this);for(const f in h){const p=h[f];c[f]!==void 0&&Ml(p)&&p.set(c[f])}}mount(e){if(this.hasBeenMounted)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];this.current=e,T_.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,i)=>this.bindToMotionValue(i,t)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(crt.current||Tpi(),this.shouldReduceMotion=o5e.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),j4e(this.notifyUpdate),j4e(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&Xit.has(e)&&this.current instanceof HTMLElement){const{factory:s,keyframes:a,times:l,ease:c,duration:d}=t.accelerate,u=new Kit({element:this.current,name:e,keyframes:a,times:l,ease:c,duration:P1(d)}),h=s(u);this.valueSubscriptions.set(e,()=>{h(),u.cancel()});return}const i=Jy.has(e);i&&this.onBindTransform&&this.onBindTransform();const r=t.on("change",s=>{this.latestValues[e]=s,this.props.onUpdate&&ah.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),o&&o()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in ODe){const t=ODe[e];if(!t)continue;const{isEnabled:i,Feature:r}=t;if(!this.features[e]&&r&&i(this.props)&&(this.features[e]=new r(this)),this.features[e]){const o=this.features[e];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):yke()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let i=0;i<PDe.length;i++){const r=PDe[i];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const o="on"+r,s=e[o];s&&(this.propEventSubscriptions[r]=this.on(r,s))}this.prevMotionValues=Npi(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){const i=this.values.get(e);t!==i&&(i&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return i===void 0&&t!==void 0&&(i=ny(t===null?void 0:t,{owner:this}),this.addValue(e,i)),i}readValue(e,t){let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(hit(i)||fit(i))?i=parseFloat(i):!_pi(i)&&qd.test(t)&&(i=srt(e,t)),this.setBaseTarget(e,Ml(i)?i.get():i)),Ml(i)?i.get():i}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){const{initial:t}=this.props;let i;if(typeof t=="string"||typeof t=="object"){const o=trt(this.props,t,this.presenceContext?.custom);o&&(i=o[e])}if(t&&i!==void 0)return i;const r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!Ml(r)?r:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new git),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Cpi.render(this.render)}}class urt extends drt{constructor(){super(...arguments),this.KeyframeResolver=ypi}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){const i=e.style;return i?i[t]:void 0}removeValueFromRenderState(e,{vars:t,style:i}){delete t[e],delete i[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Ml(e)&&(this.childSubscription=e.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function Api({top:n,left:e,right:t,bottom:i}){return{x:{min:e,max:t},y:{min:n,max:i}}}function Dpi(n,e){if(!e)return n;const t=e({x:n.left,y:n.top}),i=e({x:n.right,y:n.bottom});return{top:t.y,left:t.x,bottom:i.y,right:i.x}}function Rpi(n,e){return Api(Dpi(n.getBoundingClientRect(),e))}const Ppi={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Opi=Yy.length;function Vpi(n,e,t){let i="",r=!0;for(let s=0;s<Opi;s++){const a=Yy[s],l=n[a];if(l===void 0)continue;let c=!0;if(typeof l=="number")c=l===(a.startsWith("scale")?1:0);else{const d=parseFloat(l);c=a.startsWith("scale")?d===1:d===0}if(!c||t){const d=r5e(l,Yoe[a]);if(!c){r=!1;const u=Ppi[a]||a;i+=`${u}(${d}) `}t&&(e[a]=d)}}const o=n.pathRotation;return o&&(r=!1,i+=`rotate(${r5e(o,Yoe.pathRotation)}) `),i=i.trim(),t?i=t(e,r?"":i):r&&(i="none"),i}function hrt(n,e,t){const{style:i,vars:r,transformOrigin:o}=n;let s=!1,a=!1;for(const l in e){const c=e[l];if(Jy.has(l)){s=!0;continue}else if(Nit(l)){r[l]=c;continue}else{const d=r5e(c,Yoe[l]);l.startsWith("origin")?(a=!0,o[l]=d):i[l]=d}}if(e.transform||(s||t?i.transform=Vpi(e,n.transform,t):i.transform&&(i.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:d=0}=o;i.transformOrigin=`${l} ${c} ${d}`}}function frt(n,{style:e,vars:t},i,r){const o=n.style;let s;for(s in e)o[s]=e[s];r?.applyProjectionStyles(o,i);for(s in t)o.setProperty(s,t[s])}function VDe(n,e){return e.max===e.min?0:n/(e.max-e.min)*100}const tC={correct:(n,e)=>{if(!e.target)return n;if(typeof n=="string")if(Ht.test(n))n=parseFloat(n);else return n;const t=VDe(n,e.target.x),i=VDe(n,e.target.y);return`${t}% ${i}%`}},Hpi={correct:(n,{treeScale:e,projectionDelta:t})=>{const i=n,r=qd.parse(n);if(r.length>5)return i;const o=qd.createTransformer(n),s=typeof r[0]!="number"?1:0,a=t.x.scale*e.x,l=t.y.scale*e.y;r[0+s]/=a,r[1+s]/=l;const c=Xy(a,l,.5);return typeof r[2+s]=="number"&&(r[2+s]/=c),typeof r[3+s]=="number"&&(r[3+s]/=c),o(r)}},$pi={borderRadius:{...tC,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:tC,borderTopRightRadius:tC,borderBottomLeftRadius:tC,borderBottomRightRadius:tC,boxShadow:Hpi};function Fpi(n,{layout:e,layoutId:t}){return Jy.has(n)||n.startsWith("origin")||(e||t!==void 0)&&(!!$pi[n]||n==="opacity")}function prt(n,e,t){const i=n.style,r=e?.style,o={};if(!i)return o;for(const s in i)(Ml(i[s])||r&&Ml(r[s])||Fpi(s,n)||t?.getValue(s)?.liveStyle!==void 0)&&(o[s]=i[s]);return o}function zpi(n){return window.getComputedStyle(n)}class Bpi extends urt{constructor(){super(...arguments),this.type="html",this.renderInstance=frt}readValueFromInstance(e,t){if(Jy.has(t))return this.projection?.isProjecting?X4e(t):pfi(e,t);{const i=zpi(e),r=(Nit(t)?i.getPropertyValue(t):i[t])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Rpi(e,t)}build(e,t,i){hrt(e,t,i.transformTemplate)}scrapeMotionValuesFromProps(e,t,i){return prt(e,t,i)}}function jpi(n,e){return n in e}class Wpi extends drt{constructor(){super(...arguments),this.type="object"}readValueFromInstance(e,t){if(jpi(t,e)){const i=e[t];if(typeof i=="string"||typeof i=="number")return i}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e]}measureInstanceViewportBox(){return yke()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}}const qpi={offset:"stroke-dashoffset",array:"stroke-dasharray"},Upi={offset:"strokeDashoffset",array:"strokeDasharray"};function Zpi(n,e,t=1,i=0,r=!0){n.pathLength=1;const o=r?qpi:Upi;n[o.offset]=`${-i}`,n[o.array]=`${e} ${t}`}const Kpi=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Gpi(n,{attrX:e,attrY:t,attrScale:i,pathLength:r,pathSpacing:o=1,pathOffset:s=0,...a},l,c,d){if(hrt(n,a,c),l){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:u,style:h}=n;u.transform&&(h.transform=u.transform,delete u.transform),(h.transform||u.transformOrigin)&&(h.transformOrigin=u.transformOrigin??"50% 50%",delete u.transformOrigin),h.transform&&(h.transformBox=d?.transformBox??"fill-box",delete u.transformBox);for(const f of Kpi)u[f]!==void 0&&(h[f]=u[f],delete u[f]);e!==void 0&&(u.x=e),t!==void 0&&(u.y=t),i!==void 0&&(u.scale=i),r!==void 0&&Zpi(u,r,o,s,!1)}const grt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Xpi=n=>typeof n=="string"&&n.toLowerCase()==="svg";function Ypi(n,e,t,i){frt(n,e,void 0,i);for(const r in e.attrs)n.setAttribute(grt.has(r)?r:vke(r),e.attrs[r])}function Jpi(n,e,t){const i=prt(n,e,t);for(const r in n)if(Ml(n[r])||Ml(e[r])){const o=Yy.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;i[o]=n[r]}return i}class Qpi extends urt{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=yke}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Jy.has(t)){const i=ort(t);return i&&i.default||0}return t=grt.has(t)?t:vke(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,i){return Jpi(e,t,i)}build(e,t,i){Gpi(e,t,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(e,t,i,r){Ypi(e,t,i,r)}mount(e){this.isSVGTag=Xpi(e.tagName),super.mount(e)}}function egi(n,e,t){const i=Ml(n)?n:ny(n);return i.start(Qit("",i,e,t)),i.animation}function kke(n){return typeof n=="object"&&!Array.isArray(n)}function mrt(n,e,t,i){return n==null?[]:typeof n=="string"&&kke(e)?kpi(n,t,i):n instanceof NodeList?Array.from(n):Array.isArray(n)?n.filter(r=>r!=null):[n]}function tgi(n,e,t){return n*(e+1)+t*e}function HDe(n,e,t,i){return typeof e=="number"?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,n+parseFloat(e)):e==="<"?t:e.startsWith("<")?Math.max(0,t+parseFloat(e.slice(1))):i.get(e)??n}function ngi(n,e,t){for(let i=0;i<n.length;i++){const r=n[i];r.at>e&&r.at<t&&(nke(n,r),i--)}}function igi(n,e,t,i,r,o){ngi(n,r,o);for(let s=0;s<e.length;s++)n.push({value:e[s],at:Xy(r,o,i[s]),easing:Sit(t,s)})}function rgi(n,e,t=0){const i=e+1+e*t;for(let r=0;r<n.length;r++)n[r]=n[r]/i}function ogi(n,e){return n.at===e.at?n.value===null?1:e.value===null?-1:0:n.at-e.at}const sgi="easeInOut",agi=20;function lgi(n,{defaultTransition:e={},...t}={},i,r){const o=e.duration||.3,s=new Map,a=new Map,l={},c=new Map;let d=0,u=0,h=0;for(let f=0;f<n.length;f++){const p=n[f];if(typeof p=="string"){c.set(p,u);continue}else if(!Array.isArray(p)){c.set(p.name,HDe(u,p.at,d,c));continue}let[g,v,y={}]=p;y.at!==void 0&&(u=HDe(u,y.at,d,c));let C=0;const _=(w,x,M,L=0,S=0)=>{const I=cgi(w),{delay:E=0,times:A=Fit(I),type:T=e.type||"keyframes",repeat:D,repeatType:R,repeatDelay:P=0,...V}=x;let{ease:$=e.ease||"easeOut",duration:j}=x;const B=typeof E=="function"?E(L,S):E,te=I.length,U=mke(T)?T:r?.[T||"keyframes"];if(te<=2&&U){let pe=100;if(te===2&&hgi(I)){const be=I[1]-I[0];pe=Math.abs(be)}const Ae={...e,...V};j!==void 0&&(Ae.duration=P1(j));const Fe=Vit(Ae,pe,U);$=Fe.ease,j=Fe.duration}j??(j=o);const Y=u+B;A.length===1&&A[0]===0&&(A[1]=1);const X=A.length-I.length;if(X>0&&$it(A,X),I.length===1&&I.unshift(null),D&&D<agi){const pe=j>0?P/j:0;j=tgi(j,D,P);const Ae=[...I],Fe=[...A];$=Array.isArray($)?[...$]:[$];const be=[...$],Ve=R==="reverse"||R==="mirror";let Ke=Ae,We=be;Ve&&(Ke=[...Ae].reverse(),R==="reverse"&&(We=[...be].reverse().map(At=>typeof At=="function"?ske(At):At)));for(let At=0;At<D;At++){const Ct=Ve&&At%2===0,Z=Ct?Ke:Ae,wt=Ct?We:be,vt=(At+1)*(1+pe);pe>0&&(I.push(I[I.length-1]),A.push(vt),$.push("linear")),I.push(...Z);for(let cn=0;cn<Z.length;cn++)A.push(Fe[cn]+vt),$.push(cn===0?"linear":Sit(wt,cn-1))}rgi(A,D,pe)}const se=Y+j;igi(M,I,$,A,Y,se),C=Math.max(B+j,C),h=Math.max(se,h)};if(Ml(g)){const w=$De(g,a);_(v,y,FDe("default",w))}else{const w=mrt(g,v,i,l),x=w.length;for(let M=0;M<x;M++){v=v,y=y;const L=w[M],S=$De(L,a);for(const I in v)_(v[I],dgi(y,I),FDe(I,S),M,x)}}d=u,u+=C}return a.forEach((f,p)=>{for(const g in f){const v=f[g];v.sort(ogi);const y=[],C=[],_=[];for(let L=0;L<v.length;L++){const{at:S,value:I,easing:E}=v[L];y.push(I),C.push(oke(0,h,S)),_.push(E||"easeOut")}C[0]!==0&&(C.unshift(0),y.unshift(y[0]),_.unshift(sgi)),C[C.length-1]!==1&&(C.push(1),y.push(null)),s.has(p)||s.set(p,{keyframes:{},transition:{}});const w=s.get(p);w.keyframes[g]=y;const{type:x,...M}=e;w.transition[g]={...M,duration:h,ease:_,times:C,...t}}}),s}function $De(n,e){return!e.has(n)&&e.set(n,{}),e.get(n)}function FDe(n,e){return e[n]||(e[n]=[]),e[n]}function cgi(n){return Array.isArray(n)?n:[n]}function dgi(n,e){return n&&n[e]?{...n,...n[e]}:{...n}}const ugi=n=>typeof n=="number",hgi=n=>n.every(ugi);function fgi(n){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},t=art(n)&&!bpi(n)?new Qpi(e):new Bpi(e);t.mount(n),T_.set(n,t)}function pgi(n){const e={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},t=new Wpi(e);t.mount(n),T_.set(n,t)}function ggi(n,e){return Ml(n)||typeof n=="number"||typeof n=="string"&&!kke(e)}function vrt(n,e,t,i){const r=[];if(ggi(n,e))r.push(egi(n,kke(e)&&e.default||e,t&&(t.default||t)));else{if(n==null)return r;const o=mrt(n,e,i),s=o.length;for(let a=0;a<s;a++){const l=o[a],c=l instanceof Element?fgi:pgi;T_.has(l)||c(l);const d=T_.get(l),u={...t};"delay"in u&&typeof u.delay=="function"&&(u.delay=u.delay(a,s)),r.push(...api(d,{...e,transition:u},{}))}}return r}function mgi(n,e,t){const i=[],r=n.map(s=>{if(Array.isArray(s)&&typeof s[0]=="function"){const a=s[0],l=ny(0);return l.on("change",a),s.length===1?[l,[0,1]]:s.length===2?[l,[0,1],s[1]]:[l,s[1],s[2]]}return s});return lgi(r,e,t,{spring:E_}).forEach(({keyframes:s,transition:a},l)=>{i.push(...vrt(l,s,a))}),i}function vgi(n){return Array.isArray(n)&&n.some(Array.isArray)}function ygi(n={}){const{scope:e,reduceMotion:t,skipAnimations:i}=n;function r(o,s,a){let l=[],c;const d={};if(t!==void 0&&(d.reduceMotion=t),i!==void 0&&(d.skipAnimations=i),vgi(o)){const{onComplete:h,...f}=s||{};typeof h=="function"&&(c=h),l=mgi(o,{...d,...f},e)}else{const{onComplete:h,...f}=a||{};typeof h=="function"&&(c=h),l=vrt(o,s,{...d,...f},e)}const u=new Hfi(l);return c&&u.finished.then(c),e&&(e.animations.push(u),u.finished.then(()=>{nke(e.animations,u)})),u}return r}const yrt=ygi(),kgi=3e3;function Cgi(){const n=Aa(),e=Bs(),t=xy();Re(()=>{const i=n.id;if(!i)return;const r=t.data.session_status[i]?.type??"idle",s=(t.data.message[i]??[]).findLast(c=>c.role==="assistant"&&typeof c.time.completed!="number");if(r==="idle"&&!s)return;const a=()=>{jZe(document.activeElement)||(Uo(()=>e.client.session.status()).then(c=>{const d=c.data?.[i];d&&t.set("session_status",i,d)}),t.session.sync(i,{force:!0}))};a();const l=setInterval(a,kgi);Oe(()=>clearInterval(l))})}var bgi=le("<div class=size-full>");function wgi(n){const e=vy(),t=k3(),i=Aa(),r=xy(),o=bp(),s=J(()=>ri(n.directory));return Re(()=>{const a=r.data.path.directory;if(!a||a===n.directory)return;const l=e.pathname.slice(s().length+1);t(`/${ri(a)}${l}${e.search}${e.hash}`,{replace:!0})}),Re(()=>{const a=i.id;a&&r.session.sync(a)}),Cgi(),m(f5e,{get data(){return r.data},get directory(){return n.directory},get mediaUrl(){return o.url},get mediaFetch(){return o.fetch},onNavigateToSession:a=>t(`/${s()}/session/${a}`),onSessionHref:a=>`/${s()}/session/${a}`,get children(){return m(yMn,{get children(){return n.children}})}})}function _gi(n){const e=Aa(),t=ha(),i=k3();let r="";const o=J(()=>e.dir?nh(e.dir)??"":"");return Re(()=>{const s=e.dir;if(s){if(o()){r="";return}r!==s&&(r=s,Fd({variant:"error",title:t.t("common.requestFailed"),description:t.t("directory.error.invalidUrl")}),i("/",{replace:!0}))}}),m(_e,{get when(){return o()},keyed:!0,children:s=>m(pbn,{directory:()=>s,get children(){return m(qZe,{get children(){return m(lMn,{get children(){return[m(c2i,{}),m(t2i,{get children(){return m(rwn,{get children(){return[m(a2i,{}),(()=>{var a=bgi();return aa(l=>requestAnimationFrame(()=>yrt(l,{opacity:[0,1],y:[4,0]},{type:"spring",stiffness:400,damping:30})),a),W(a,m(wgi,{directory:s,get children(){return n.children}})),a})()]}})}})]}})}})}})})}var xgi=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),Sgi=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function Mgi(n){if(Intl.Locale){const t=new Intl.Locale(n).maximize().script??"";return xgi.has(t)}const e=n.split("-")[0];return Sgi.has(e)}function Lgi(n){return Mgi(n)?"rtl":"ltr"}function krt(){let n=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([n])}catch{n="en-US"}return{locale:n,direction:Lgi(n)}}var s5e=krt(),$C=new Set;function zDe(){s5e=krt();for(const n of $C)n(s5e)}function Igi(){const[n,e]=Ye(s5e),t=J(()=>n());return ur(()=>{$C.size===0&&window.addEventListener("languagechange",zDe),$C.add(e),Oe(()=>{$C.delete(e),$C.size===0&&window.removeEventListener("languagechange",zDe)})}),{locale:()=>t().locale,direction:()=>t().direction}}var Ngi=oi();function m2(){const n=Igi();return Wn(Ngi)||n}var Fhe=new Map;function Egi(n){const{locale:e}=m2(),t=J(()=>e()+(n?Object.entries(n).sort((i,r)=>i[0]<r[0]?-1:1).join():""));return J(()=>{const i=t();let r;return Fhe.has(i)&&(r=Fhe.get(i)),r||(r=new Intl.Collator(e(),n),Fhe.set(i,r)),r})}const Tgi=["top","right","bottom","left"],hp=Math.min,Ic=Math.max,Joe=Math.round,NL=Math.floor,lh=n=>({x:n,y:n}),Agi={left:"right",right:"left",bottom:"top",top:"bottom"};function a5e(n,e,t){return Ic(n,hp(e,t))}function j3(n,e){return typeof n=="function"?n(e):n}function fp(n){return n.split("-")[0]}function Qy(n){return n.split("-")[1]}function Crt(n){return n==="x"?"y":"x"}function Cke(n){return n==="y"?"height":"width"}function T0(n){const e=n[0];return e==="t"||e==="b"?"y":"x"}function bke(n){return Crt(T0(n))}function Dgi(n,e,t){t===void 0&&(t=!1);const i=Qy(n),r=bke(n),o=Cke(r);let s=r==="x"?i===(t?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=Qoe(s)),[s,Qoe(s)]}function Rgi(n){const e=Qoe(n);return[l5e(n),e,l5e(e)]}function l5e(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}const BDe=["left","right"],jDe=["right","left"],Pgi=["top","bottom"],Ogi=["bottom","top"];function Vgi(n,e,t){switch(n){case"top":case"bottom":return t?e?jDe:BDe:e?BDe:jDe;case"left":case"right":return e?Pgi:Ogi;default:return[]}}function Hgi(n,e,t,i){const r=Qy(n);let o=Vgi(fp(n),t==="start",i);return r&&(o=o.map(s=>s+"-"+r),e&&(o=o.concat(o.map(l5e)))),o}function Qoe(n){const e=fp(n);return Agi[e]+n.slice(e.length)}function $gi(n){return{top:0,right:0,bottom:0,left:0,...n}}function brt(n){return typeof n!="number"?$gi(n):{top:n,right:n,bottom:n,left:n}}function ese(n){const{x:e,y:t,width:i,height:r}=n;return{width:i,height:r,top:t,left:e,right:e+i,bottom:t+r,x:e,y:t}}function WDe(n,e,t){let{reference:i,floating:r}=n;const o=T0(e),s=bke(e),a=Cke(s),l=fp(e),c=o==="y",d=i.x+i.width/2-r.width/2,u=i.y+i.height/2-r.height/2,h=i[a]/2-r[a]/2;let f;switch(l){case"top":f={x:d,y:i.y-r.height};break;case"bottom":f={x:d,y:i.y+i.height};break;case"right":f={x:i.x+i.width,y:u};break;case"left":f={x:i.x-r.width,y:u};break;default:f={x:i.x,y:i.y}}switch(Qy(e)){case"start":f[s]-=h*(t&&c?-1:1);break;case"end":f[s]+=h*(t&&c?-1:1);break}return f}async function Fgi(n,e){var t;e===void 0&&(e={});const{x:i,y:r,platform:o,rects:s,elements:a,strategy:l}=n,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:h=!1,padding:f=0}=j3(e,n),p=brt(f),v=a[h?u==="floating"?"reference":"floating":u],y=ese(await o.getClippingRect({element:(t=await(o.isElement==null?void 0:o.isElement(v)))==null||t?v:v.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),C=u==="floating"?{x:i,y:r,width:s.floating.width,height:s.floating.height}:s.reference,_=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),w=await(o.isElement==null?void 0:o.isElement(_))?await(o.getScale==null?void 0:o.getScale(_))||{x:1,y:1}:{x:1,y:1},x=ese(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:C,offsetParent:_,strategy:l}):C);return{top:(y.top-x.top+p.top)/w.y,bottom:(x.bottom-y.bottom+p.bottom)/w.y,left:(y.left-x.left+p.left)/w.x,right:(x.right-y.right+p.right)/w.x}}const zgi=50,Bgi=async(n,e,t)=>{const{placement:i="bottom",strategy:r="absolute",middleware:o=[],platform:s}=t,a=s.detectOverflow?s:{...s,detectOverflow:Fgi},l=await(s.isRTL==null?void 0:s.isRTL(e));let c=await s.getElementRects({reference:n,floating:e,strategy:r}),{x:d,y:u}=WDe(c,i,l),h=i,f=0;const p={};for(let g=0;g<o.length;g++){const v=o[g];if(!v)continue;const{name:y,fn:C}=v,{x:_,y:w,data:x,reset:M}=await C({x:d,y:u,initialPlacement:i,placement:h,strategy:r,middlewareData:p,rects:c,platform:a,elements:{reference:n,floating:e}});d=_??d,u=w??u,p[y]={...p[y],...x},M&&f<zgi&&(f++,typeof M=="object"&&(M.placement&&(h=M.placement),M.rects&&(c=M.rects===!0?await s.getElementRects({reference:n,floating:e,strategy:r}):M.rects),{x:d,y:u}=WDe(c,h,l)),g=-1)}return{x:d,y:u,placement:h,strategy:r,middlewareData:p}},jgi=n=>({name:"arrow",options:n,async fn(e){const{x:t,y:i,placement:r,rects:o,platform:s,elements:a,middlewareData:l}=e,{element:c,padding:d=0}=j3(n,e)||{};if(c==null)return{};const u=brt(d),h={x:t,y:i},f=bke(r),p=Cke(f),g=await s.getDimensions(c),v=f==="y",y=v?"top":"left",C=v?"bottom":"right",_=v?"clientHeight":"clientWidth",w=o.reference[p]+o.reference[f]-h[f]-o.floating[p],x=h[f]-o.reference[f],M=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let L=M?M[_]:0;(!L||!await(s.isElement==null?void 0:s.isElement(M)))&&(L=a.floating[_]||o.floating[p]);const S=w/2-x/2,I=L/2-g[p]/2-1,E=hp(u[y],I),A=hp(u[C],I),T=E,D=L-g[p]-A,R=L/2-g[p]/2+S,P=a5e(T,R,D),V=!l.arrow&&Qy(r)!=null&&R!==P&&o.reference[p]/2-(R<T?E:A)-g[p]/2<0,$=V?R<T?R-T:R-D:0;return{[f]:h[f]+$,data:{[f]:P,centerOffset:R-P-$,...V&&{alignmentOffset:$}},reset:V}}}),Wgi=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(e){var t,i;const{placement:r,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...v}=j3(n,e);if((t=o.arrow)!=null&&t.alignmentOffset)return{};const y=fp(r),C=T0(a),_=fp(a)===a,w=await(l.isRTL==null?void 0:l.isRTL(c.floating)),x=h||(_||!g?[Qoe(a)]:Rgi(a)),M=p!=="none";!h&&M&&x.push(...Hgi(a,g,p,w));const L=[a,...x],S=await l.detectOverflow(e,v),I=[];let E=((i=o.flip)==null?void 0:i.overflows)||[];if(d&&I.push(S[y]),u){const R=Dgi(r,s,w);I.push(S[R[0]],S[R[1]])}if(E=[...E,{placement:r,overflows:I}],!I.every(R=>R<=0)){var A,T;const R=(((A=o.flip)==null?void 0:A.index)||0)+1,P=L[R];if(P&&(!(u==="alignment"?C!==T0(P):!1)||E.every(j=>T0(j.placement)===C?j.overflows[0]>0:!0)))return{data:{index:R,overflows:E},reset:{placement:P}};let V=(T=E.filter($=>$.overflows[0]<=0).sort(($,j)=>$.overflows[1]-j.overflows[1])[0])==null?void 0:T.placement;if(!V)switch(f){case"bestFit":{var D;const $=(D=E.filter(j=>{if(M){const B=T0(j.placement);return B===C||B==="y"}return!0}).map(j=>[j.placement,j.overflows.filter(B=>B>0).reduce((B,te)=>B+te,0)]).sort((j,B)=>j[1]-B[1])[0])==null?void 0:D[0];$&&(V=$);break}case"initialPlacement":V=a;break}if(r!==V)return{reset:{placement:V}}}return{}}}};function qDe(n,e){return{top:n.top-e.height,right:n.right-e.width,bottom:n.bottom-e.height,left:n.left-e.width}}function UDe(n){return Tgi.some(e=>n[e]>=0)}const qgi=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(e){const{rects:t,platform:i}=e,{strategy:r="referenceHidden",...o}=j3(n,e);switch(r){case"referenceHidden":{const s=await i.detectOverflow(e,{...o,elementContext:"reference"}),a=qDe(s,t.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:UDe(a)}}}case"escaped":{const s=await i.detectOverflow(e,{...o,altBoundary:!0}),a=qDe(s,t.floating);return{data:{escapedOffsets:a,escaped:UDe(a)}}}default:return{}}}}},Ugi=new Set(["left","top"]);async function Zgi(n,e){const{placement:t,platform:i,elements:r}=n,o=await(i.isRTL==null?void 0:i.isRTL(r.floating)),s=fp(t),a=Qy(t),l=T0(t)==="y",c=Ugi.has(s)?-1:1,d=o&&l?-1:1,u=j3(e,n);let{mainAxis:h,crossAxis:f,alignmentAxis:p}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof p=="number"&&(f=a==="end"?p*-1:p),l?{x:f*d,y:h*c}:{x:h*c,y:f*d}}const Kgi=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(e){var t,i;const{x:r,y:o,placement:s,middlewareData:a}=e,l=await Zgi(e,n);return s===((t=a.offset)==null?void 0:t.placement)&&(i=a.arrow)!=null&&i.alignmentOffset?{}:{x:r+l.x,y:o+l.y,data:{...l,placement:s}}}}},Ggi=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(e){const{x:t,y:i,placement:r,platform:o}=e,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:y=>{let{x:C,y:_}=y;return{x:C,y:_}}},...c}=j3(n,e),d={x:t,y:i},u=await o.detectOverflow(e,c),h=T0(fp(r)),f=Crt(h);let p=d[f],g=d[h];if(s){const y=f==="y"?"top":"left",C=f==="y"?"bottom":"right",_=p+u[y],w=p-u[C];p=a5e(_,p,w)}if(a){const y=h==="y"?"top":"left",C=h==="y"?"bottom":"right",_=g+u[y],w=g-u[C];g=a5e(_,g,w)}const v=l.fn({...e,[f]:p,[h]:g});return{...v,data:{x:v.x-t,y:v.y-i,enabled:{[f]:s,[h]:a}}}}}},Xgi=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(e){var t,i;const{placement:r,rects:o,platform:s,elements:a}=e,{apply:l=()=>{},...c}=j3(n,e),d=await s.detectOverflow(e,c),u=fp(r),h=Qy(r),f=T0(r)==="y",{width:p,height:g}=o.floating;let v,y;u==="top"||u==="bottom"?(v=u,y=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(y=u,v=h==="end"?"top":"bottom");const C=g-d.top-d.bottom,_=p-d.left-d.right,w=hp(g-d[v],C),x=hp(p-d[y],_),M=!e.middlewareData.shift;let L=w,S=x;if((t=e.middlewareData.shift)!=null&&t.enabled.x&&(S=_),(i=e.middlewareData.shift)!=null&&i.enabled.y&&(L=C),M&&!h){const E=Ic(d.left,0),A=Ic(d.right,0),T=Ic(d.top,0),D=Ic(d.bottom,0);f?S=p-2*(E!==0||A!==0?E+A:Ic(d.left,d.right)):L=g-2*(T!==0||D!==0?T+D:Ic(d.top,d.bottom))}await l({...e,availableWidth:S,availableHeight:L});const I=await s.getDimensions(a.floating);return p!==I.width||g!==I.height?{reset:{rects:!0}}:{}}}};function gce(){return typeof window<"u"}function ek(n){return wrt(n)?(n.nodeName||"").toLowerCase():"#document"}function Uc(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function Th(n){var e;return(e=(wrt(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function wrt(n){return gce()?n instanceof Node||n instanceof Uc(n).Node:!1}function iu(n){return gce()?n instanceof Element||n instanceof Uc(n).Element:!1}function v2(n){return gce()?n instanceof HTMLElement||n instanceof Uc(n).HTMLElement:!1}function ZDe(n){return!gce()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof Uc(n).ShadowRoot}function Jx(n){const{overflow:e,overflowX:t,overflowY:i,display:r}=ru(n);return/auto|scroll|overlay|hidden|clip/.test(e+i+t)&&r!=="inline"&&r!=="contents"}function Ygi(n){return/^(table|td|th)$/.test(ek(n))}function mce(n){try{if(n.matches(":popover-open"))return!0}catch{}try{return n.matches(":modal")}catch{return!1}}const Jgi=/transform|translate|scale|rotate|perspective|filter/,Qgi=/paint|layout|strict|content/,Gp=n=>!!n&&n!=="none";let zhe;function wke(n){const e=iu(n)?ru(n):n;return Gp(e.transform)||Gp(e.translate)||Gp(e.scale)||Gp(e.rotate)||Gp(e.perspective)||!_ke()&&(Gp(e.backdropFilter)||Gp(e.filter))||Jgi.test(e.willChange||"")||Qgi.test(e.contain||"")}function emi(n){let e=pp(n);for(;v2(e)&&!iy(e);){if(wke(e))return e;if(mce(e))return null;e=pp(e)}return null}function _ke(){return zhe==null&&(zhe=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),zhe}function iy(n){return/^(html|body|#document)$/.test(ek(n))}function ru(n){return Uc(n).getComputedStyle(n)}function vce(n){return iu(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function pp(n){if(ek(n)==="html")return n;const e=n.assignedSlot||n.parentNode||ZDe(n)&&n.host||Th(n);return ZDe(e)?e.host:e}function _rt(n){const e=pp(n);return iy(e)?n.ownerDocument?n.ownerDocument.body:n.body:v2(e)&&Jx(e)?e:_rt(e)}function A_(n,e,t){var i;e===void 0&&(e=[]),t===void 0&&(t=!0);const r=_rt(n),o=r===((i=n.ownerDocument)==null?void 0:i.body),s=Uc(r);if(o){const a=c5e(s);return e.concat(s,s.visualViewport||[],Jx(r)?r:[],a&&t?A_(a):[])}else return e.concat(r,A_(r,[],t))}function c5e(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function xrt(n){const e=ru(n);let t=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=v2(n),o=r?n.offsetWidth:t,s=r?n.offsetHeight:i,a=Joe(t)!==o||Joe(i)!==s;return a&&(t=o,i=s),{width:t,height:i,$:a}}function xke(n){return iu(n)?n:n.contextElement}function sv(n){const e=xke(n);if(!v2(e))return lh(1);const t=e.getBoundingClientRect(),{width:i,height:r,$:o}=xrt(e);let s=(o?Joe(t.width):t.width)/i,a=(o?Joe(t.height):t.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const tmi=lh(0);function Srt(n){const e=Uc(n);return!_ke()||!e.visualViewport?tmi:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function nmi(n,e,t){return e===void 0&&(e=!1),!t||e&&t!==Uc(n)?!1:e}function l3(n,e,t,i){e===void 0&&(e=!1),t===void 0&&(t=!1);const r=n.getBoundingClientRect(),o=xke(n);let s=lh(1);e&&(i?iu(i)&&(s=sv(i)):s=sv(n));const a=nmi(o,t,i)?Srt(o):lh(0);let l=(r.left+a.x)/s.x,c=(r.top+a.y)/s.y,d=r.width/s.x,u=r.height/s.y;if(o){const h=Uc(o),f=i&&iu(i)?Uc(i):i;let p=h,g=c5e(p);for(;g&&i&&f!==p;){const v=sv(g),y=g.getBoundingClientRect(),C=ru(g),_=y.left+(g.clientLeft+parseFloat(C.paddingLeft))*v.x,w=y.top+(g.clientTop+parseFloat(C.paddingTop))*v.y;l*=v.x,c*=v.y,d*=v.x,u*=v.y,l+=_,c+=w,p=Uc(g),g=c5e(p)}}return ese({width:d,height:u,x:l,y:c})}function yce(n,e){const t=vce(n).scrollLeft;return e?e.left+t:l3(Th(n)).left+t}function Mrt(n,e){const t=n.getBoundingClientRect(),i=t.left+e.scrollLeft-yce(n,t),r=t.top+e.scrollTop;return{x:i,y:r}}function imi(n){let{elements:e,rect:t,offsetParent:i,strategy:r}=n;const o=r==="fixed",s=Th(i),a=e?mce(e.floating):!1;if(i===s||a&&o)return t;let l={scrollLeft:0,scrollTop:0},c=lh(1);const d=lh(0),u=v2(i);if((u||!u&&!o)&&((ek(i)!=="body"||Jx(s))&&(l=vce(i)),u)){const f=l3(i);c=sv(i),d.x=f.x+i.clientLeft,d.y=f.y+i.clientTop}const h=s&&!u&&!o?Mrt(s,l):lh(0);return{width:t.width*c.x,height:t.height*c.y,x:t.x*c.x-l.scrollLeft*c.x+d.x+h.x,y:t.y*c.y-l.scrollTop*c.y+d.y+h.y}}function rmi(n){return Array.from(n.getClientRects())}function omi(n){const e=Th(n),t=vce(n),i=n.ownerDocument.body,r=Ic(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),o=Ic(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let s=-t.scrollLeft+yce(n);const a=-t.scrollTop;return ru(i).direction==="rtl"&&(s+=Ic(e.clientWidth,i.clientWidth)-r),{width:r,height:o,x:s,y:a}}const KDe=25;function smi(n,e){const t=Uc(n),i=Th(n),r=t.visualViewport;let o=i.clientWidth,s=i.clientHeight,a=0,l=0;if(r){o=r.width,s=r.height;const d=_ke();(!d||d&&e==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}const c=yce(i);if(c<=0){const d=i.ownerDocument,u=d.body,h=getComputedStyle(u),f=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,p=Math.abs(i.clientWidth-u.clientWidth-f);p<=KDe&&(o-=p)}else c<=KDe&&(o+=c);return{width:o,height:s,x:a,y:l}}function ami(n,e){const t=l3(n,!0,e==="fixed"),i=t.top+n.clientTop,r=t.left+n.clientLeft,o=v2(n)?sv(n):lh(1),s=n.clientWidth*o.x,a=n.clientHeight*o.y,l=r*o.x,c=i*o.y;return{width:s,height:a,x:l,y:c}}function GDe(n,e,t){let i;if(e==="viewport")i=smi(n,t);else if(e==="document")i=omi(Th(n));else if(iu(e))i=ami(e,t);else{const r=Srt(n);i={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return ese(i)}function Lrt(n,e){const t=pp(n);return t===e||!iu(t)||iy(t)?!1:ru(t).position==="fixed"||Lrt(t,e)}function lmi(n,e){const t=e.get(n);if(t)return t;let i=A_(n,[],!1).filter(a=>iu(a)&&ek(a)!=="body"),r=null;const o=ru(n).position==="fixed";let s=o?pp(n):n;for(;iu(s)&&!iy(s);){const a=ru(s),l=wke(s);!l&&a.position==="fixed"&&(r=null),(o?!l&&!r:!l&&a.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||Jx(s)&&!l&&Lrt(n,s))?i=i.filter(d=>d!==s):r=a,s=pp(s)}return e.set(n,i),i}function cmi(n){let{element:e,boundary:t,rootBoundary:i,strategy:r}=n;const s=[...t==="clippingAncestors"?mce(e)?[]:lmi(e,this._c):[].concat(t),i],a=GDe(e,s[0],r);let l=a.top,c=a.right,d=a.bottom,u=a.left;for(let h=1;h<s.length;h++){const f=GDe(e,s[h],r);l=Ic(f.top,l),c=hp(f.right,c),d=hp(f.bottom,d),u=Ic(f.left,u)}return{width:c-u,height:d-l,x:u,y:l}}function dmi(n){const{width:e,height:t}=xrt(n);return{width:e,height:t}}function umi(n,e,t){const i=v2(e),r=Th(e),o=t==="fixed",s=l3(n,!0,o,e);let a={scrollLeft:0,scrollTop:0};const l=lh(0);function c(){l.x=yce(r)}if(i||!i&&!o)if((ek(e)!=="body"||Jx(r))&&(a=vce(e)),i){const f=l3(e,!0,o,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else r&&c();o&&!i&&r&&c();const d=r&&!i&&!o?Mrt(r,a):lh(0),u=s.left+a.scrollLeft-l.x-d.x,h=s.top+a.scrollTop-l.y-d.y;return{x:u,y:h,width:s.width,height:s.height}}function Bhe(n){return ru(n).position==="static"}function XDe(n,e){if(!v2(n)||ru(n).position==="fixed")return null;if(e)return e(n);let t=n.offsetParent;return Th(n)===t&&(t=t.ownerDocument.body),t}function Irt(n,e){const t=Uc(n);if(mce(n))return t;if(!v2(n)){let r=pp(n);for(;r&&!iy(r);){if(iu(r)&&!Bhe(r))return r;r=pp(r)}return t}let i=XDe(n,e);for(;i&&Ygi(i)&&Bhe(i);)i=XDe(i,e);return i&&iy(i)&&Bhe(i)&&!wke(i)?t:i||emi(n)||t}const hmi=async function(n){const e=this.getOffsetParent||Irt,t=this.getDimensions,i=await t(n.floating);return{reference:umi(n.reference,await e(n.floating),n.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function fmi(n){return ru(n).direction==="rtl"}const Nrt={convertOffsetParentRelativeRectToViewportRelativeRect:imi,getDocumentElement:Th,getClippingRect:cmi,getOffsetParent:Irt,getElementRects:hmi,getClientRects:rmi,getDimensions:dmi,getScale:sv,isElement:iu,isRTL:fmi};function Ert(n,e){return n.x===e.x&&n.y===e.y&&n.width===e.width&&n.height===e.height}function pmi(n,e){let t=null,i;const r=Th(n);function o(){var a;clearTimeout(i),(a=t)==null||a.disconnect(),t=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const c=n.getBoundingClientRect(),{left:d,top:u,width:h,height:f}=c;if(a||e(),!h||!f)return;const p=NL(u),g=NL(r.clientWidth-(d+h)),v=NL(r.clientHeight-(u+f)),y=NL(d),_={rootMargin:-p+"px "+-g+"px "+-v+"px "+-y+"px",threshold:Ic(0,hp(1,l))||1};let w=!0;function x(M){const L=M[0].intersectionRatio;if(L!==l){if(!w)return s();L?s(!1,L):i=setTimeout(()=>{s(!1,1e-7)},1e3)}L===1&&!Ert(c,n.getBoundingClientRect())&&s(),w=!1}try{t=new IntersectionObserver(x,{..._,root:r.ownerDocument})}catch{t=new IntersectionObserver(x,_)}t.observe(n)}return s(!0),o}function gmi(n,e,t,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,c=xke(n),d=r||o?[...c?A_(c):[],...e?A_(e):[]]:[];d.forEach(y=>{r&&y.addEventListener("scroll",t,{passive:!0}),o&&y.addEventListener("resize",t)});const u=c&&a?pmi(c,t):null;let h=-1,f=null;s&&(f=new ResizeObserver(y=>{let[C]=y;C&&C.target===c&&f&&e&&(f.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var _;(_=f)==null||_.observe(e)})),t()}),c&&!l&&f.observe(c),e&&f.observe(e));let p,g=l?l3(n):null;l&&v();function v(){const y=l3(n);g&&!Ert(g,y)&&t(),g=y,p=requestAnimationFrame(v)}return t(),()=>{var y;d.forEach(C=>{r&&C.removeEventListener("scroll",t),o&&C.removeEventListener("resize",t)}),u?.(),(y=f)==null||y.disconnect(),f=null,l&&cancelAnimationFrame(p)}}const mmi=Kgi,vmi=Ggi,ymi=Wgi,kmi=Xgi,Cmi=qgi,bmi=jgi,wmi=(n,e,t)=>{const i=new Map,r={platform:Nrt,...t},o={...r.platform,_c:i};return Bgi(n,e,{...r,platform:o})};var _mi=le('<svg display=block viewBox="0 0 30 30"style=transform:scale(1.02)><g><path fill=none d=M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z></path><path stroke=none d=M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z>'),Ske=oi();function Mke(){const n=Wn(Ske);if(n===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return n}var d5e=30,YDe=d5e/2,xmi={top:180,right:-90,bottom:0,left:90};function y2(n){const e=Mke(),t=Pn({size:d5e},n),[i,r]=Je(t,["ref","style","size"]),o=()=>e.currentPlacement().split("-")[0],s=Smi(e.contentRef),a=()=>s()?.getPropertyValue("background-color")||"none",l=()=>s()?.getPropertyValue(`border-${o()}-color`)||"none",c=()=>s()?.getPropertyValue(`border-${o()}-width`)||"0px",d=()=>Number.parseInt(c())*2*(d5e/i.size),u=()=>`rotate(${xmi[o()]} ${YDe} ${YDe}) translate(0 2)`;return m(zi,k({as:"div",ref(h){var f=qr(e.setArrowRef,i.ref);typeof f=="function"&&f(h)},"aria-hidden":"true",get style(){return su({position:"absolute","font-size":`${i.size}px`,width:"1em",height:"1em","pointer-events":"none",fill:a(),stroke:l(),"stroke-width":d()},i.style)}},r,{get children(){var h=_mi(),f=h.firstChild,p=f.firstChild;return p.nextSibling,st(()=>mt(f,"transform",u())),h}}))}function Smi(n){const[e,t]=Ye();return Re(()=>{const i=n();i&&t(m5e(i).getComputedStyle(i))}),e}function Mmi(n){const e=Mke(),[t,i]=Je(n,["ref","style"]);return m(zi,k({as:"div",ref(r){var o=qr(e.setPositionerRef,t.ref);typeof o=="function"&&o(r)},"data-popper-positioner":"",get style(){return su({position:"absolute",top:0,left:0,"min-width":"max-content"},t.style)}},i))}function JDe(n){const{x:e=0,y:t=0,width:i=0,height:r=0}=n??{};if(typeof DOMRect=="function")return new DOMRect(e,t,i,r);const o={x:e,y:t,width:i,height:r,top:t,right:e+i,bottom:t+r,left:e};return{...o,toJSON:()=>o}}function Lmi(n,e){return{contextElement:n,getBoundingClientRect:()=>{const i=e(n);return i?JDe(i):n?n.getBoundingClientRect():JDe()}}}function Imi(n){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(n)}var Nmi={top:"bottom",right:"left",bottom:"top",left:"right"};function Emi(n,e){const[t,i]=n.split("-"),r=Nmi[t];return i?t==="left"||t==="right"?`${r} ${i==="start"?"top":"bottom"}`:i==="start"?`${r} ${e==="rtl"?"right":"left"}`:`${r} ${e==="rtl"?"left":"right"}`:`${r} center`}function Tmi(n){const e=Pn({getAnchorRect:h=>h?.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},n),[t,i]=Ye(),[r,o]=Ye(),[s,a]=Ye(e.placement),l=()=>Lmi(e.anchorRef?.(),e.getAnchorRect),{direction:c}=m2();async function d(){const h=l(),f=t(),p=r();if(!h||!f)return;const g=(p?.clientHeight||0)/2,v=typeof e.gutter=="number"?e.gutter+g:e.gutter??g;f.style.setProperty("--kb-popper-content-overflow-padding",`${e.overflowPadding}px`),h.getBoundingClientRect();const y=[mmi(({placement:M})=>{const L=!!M.split("-")[1];return{mainAxis:v,crossAxis:L?void 0:e.shift,alignmentAxis:e.shift}})];if(e.flip!==!1){const M=typeof e.flip=="string"?e.flip.split(" "):void 0;if(M!==void 0&&!M.every(Imi))throw new Error("`flip` expects a spaced-delimited list of placements");y.push(ymi({padding:e.overflowPadding,fallbackPlacements:M}))}(e.slide||e.overlap)&&y.push(vmi({mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding})),y.push(kmi({padding:e.overflowPadding,apply({availableWidth:M,availableHeight:L,rects:S}){const I=Math.round(S.reference.width);M=Math.floor(M),L=Math.floor(L),f.style.setProperty("--kb-popper-anchor-width",`${I}px`),f.style.setProperty("--kb-popper-content-available-width",`${M}px`),f.style.setProperty("--kb-popper-content-available-height",`${L}px`),e.sameWidth&&(f.style.width=`${I}px`),e.fitViewport&&(f.style.maxWidth=`${M}px`,f.style.maxHeight=`${L}px`)}})),e.hideWhenDetached&&y.push(Cmi({padding:e.detachedPadding})),p&&y.push(bmi({element:p,padding:e.arrowPadding}));const C=await wmi(h,f,{placement:e.placement,strategy:"absolute",middleware:y,platform:{...Nrt,isRTL:()=>c()==="rtl"}});if(a(C.placement),e.onCurrentPlacementChange?.(C.placement),!f)return;f.style.setProperty("--kb-popper-content-transform-origin",Emi(C.placement,c()));const _=Math.round(C.x),w=Math.round(C.y);let x;if(e.hideWhenDetached&&(x=C.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(f.style,{top:"0",left:"0",transform:`translate3d(${_}px, ${w}px, 0)`,visibility:x}),p&&C.middlewareData.arrow){const{x:M,y:L}=C.middlewareData.arrow,S=C.placement.split("-")[0];Object.assign(p.style,{left:M!=null?`${M}px`:"",top:L!=null?`${L}px`:"",[S]:"100%"})}}Re(()=>{const h=l(),f=t();if(!h||!f)return;const p=gmi(h,f,d,{elementResize:typeof ResizeObserver=="function"});Oe(p)}),Re(()=>{const h=t(),f=e.contentRef?.();!h||!f||queueMicrotask(()=>{h.style.zIndex=getComputedStyle(f).zIndex})});const u={currentPlacement:s,contentRef:()=>e.contentRef?.(),setPositionerRef:i,setArrowRef:o};return m(Ske.Provider,{value:u,get children(){return e.children}})}var tk=Object.assign(Tmi,{Arrow:y2,Context:Ske,usePopperContext:Mke,Positioner:Mmi}),Ami={};au(Ami,{Arrow:()=>y2,Content:()=>Art,Portal:()=>Drt,Root:()=>Rrt,Tooltip:()=>FC,Trigger:()=>Prt,useTooltipContext:()=>kce});var Trt=oi();function kce(){const n=Wn(Trt);if(n===void 0)throw new Error("[kobalte]: `useTooltipContext` must be used within a `Tooltip` component");return n}function Art(n){const e=kce(),t=Pn({id:e.generateId("content")},n),[i,r]=Je(t,["ref","style"]);return Re(()=>Oe(e.registerContentId(r.id))),m(_e,{get when(){return e.contentPresent()},get children(){return m(tk.Positioner,{get children(){return m(cse,k({ref(o){var s=qr(a=>{e.setContentRef(a)},i.ref);typeof s=="function"&&s(o)},role:"tooltip",disableOutsidePointerEvents:!1,get style(){return su({"--kb-tooltip-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},i.style)},onFocusOutside:o=>o.preventDefault(),onDismiss:()=>e.hideTooltip(!0)},()=>e.dataset(),r))}})}})}function Drt(n){const e=kce();return m(_e,{get when(){return e.contentPresent()},get children(){return m(d3,n)}})}function Dmi(n,e,t){const i=n.split("-")[0],r=e.getBoundingClientRect(),o=t.getBoundingClientRect(),s=[],a=r.left+r.width/2,l=r.top+r.height/2;switch(i){case"top":s.push([r.left,l]),s.push([o.left,o.bottom]),s.push([o.left,o.top]),s.push([o.right,o.top]),s.push([o.right,o.bottom]),s.push([r.right,l]);break;case"right":s.push([a,r.top]),s.push([o.left,o.top]),s.push([o.right,o.top]),s.push([o.right,o.bottom]),s.push([o.left,o.bottom]),s.push([a,r.bottom]);break;case"bottom":s.push([r.left,l]),s.push([o.left,o.top]),s.push([o.left,o.bottom]),s.push([o.right,o.bottom]),s.push([o.right,o.top]),s.push([r.right,l]);break;case"left":s.push([a,r.top]),s.push([o.right,o.top]),s.push([o.left,o.top]),s.push([o.left,o.bottom]),s.push([o.right,o.bottom]),s.push([a,r.bottom]);break}return s}var Xp={},Rmi=0,x8=!1,Zh,nC,S8;function Rrt(n){const e=`tooltip-${$s()}`,t=`${++Rmi}`,i=Pn({id:e,openDelay:700,closeDelay:300,skipDelayDuration:300},n),[r,o]=Je(i,["id","open","defaultOpen","onOpenChange","disabled","triggerOnFocusOnly","openDelay","closeDelay","skipDelayDuration","ignoreSafeArea","forceMount"]);let s;const[a,l]=Ye(),[c,d]=Ye(),[u,h]=Ye(),[f,p]=Ye(o.placement),g=u3({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:R=>r.onOpenChange?.(R)}),{present:v}=M6({show:()=>r.forceMount||g.isOpen(),element:()=>u()??null}),y=()=>{Xp[t]=_},C=()=>{for(const R in Xp)R!==t&&(Xp[R](!0),delete Xp[R])},_=(R=!1)=>{R||r.closeDelay&&r.closeDelay<=0?(window.clearTimeout(s),s=void 0,g.close()):s||(s=window.setTimeout(()=>{s=void 0,g.close()},r.closeDelay)),window.clearTimeout(Zh),Zh=void 0,r.skipDelayDuration&&r.skipDelayDuration>=0&&(S8=window.setTimeout(()=>{window.clearTimeout(S8),S8=void 0},r.skipDelayDuration)),x8&&(window.clearTimeout(nC),nC=window.setTimeout(()=>{delete Xp[t],nC=void 0,x8=!1},r.closeDelay))},w=()=>{clearTimeout(s),s=void 0,C(),y(),x8=!0,g.open(),window.clearTimeout(Zh),Zh=void 0,window.clearTimeout(nC),nC=void 0,window.clearTimeout(S8),S8=void 0},x=()=>{C(),y(),!g.isOpen()&&!Zh&&!x8?Zh=window.setTimeout(()=>{Zh=void 0,x8=!0,w()},r.openDelay):g.isOpen()||w()},M=(R=!1)=>{!R&&r.openDelay&&r.openDelay>0&&!s&&!S8?x():w()},L=()=>{window.clearTimeout(Zh),Zh=void 0,x8=!1},S=()=>{window.clearTimeout(s),s=void 0},I=R=>ps(c(),R)||ps(u(),R),E=R=>{const P=c(),V=u();if(!(!P||!V))return Dmi(R,P,V)},A=R=>{const P=R.target;if(I(P)){S();return}if(!r.ignoreSafeArea){const V=E(f());if(V&&C5e(DRe(R),V)){S();return}}s||_()};Re(()=>{if(!g.isOpen())return;const R=Tl();R.addEventListener("pointermove",A,!0),Oe(()=>{R.removeEventListener("pointermove",A,!0)})}),Re(()=>{const R=c();if(!R||!g.isOpen())return;const P=$=>{const j=$.target;ps(j,R)&&_(!0)},V=m5e();V.addEventListener("scroll",P,{capture:!0}),Oe(()=>{V.removeEventListener("scroll",P,{capture:!0})})}),Oe(()=>{clearTimeout(s),Xp[t]&&delete Xp[t]});const D={dataset:J(()=>({"data-expanded":g.isOpen()?"":void 0,"data-closed":g.isOpen()?void 0:""})),isOpen:g.isOpen,isDisabled:()=>r.disabled??!1,triggerOnFocusOnly:()=>r.triggerOnFocusOnly??!1,contentId:a,contentPresent:v,openTooltip:M,hideTooltip:_,cancelOpening:L,generateId:bh(()=>i.id),registerContentId:Xa(l),isTargetOnTooltip:I,setTriggerRef:d,setContentRef:h};return m(Trt.Provider,{value:D,get children(){return m(tk,k({anchorRef:c,contentRef:u,onCurrentPlacementChange:p},o))}})}function Prt(n){let e;const t=kce(),[i,r]=Je(n,["ref","onPointerEnter","onPointerLeave","onPointerDown","onClick","onFocus","onBlur"]);let o=!1,s=!1,a=!1;const l=()=>{o=!1},c=()=>{!t.isOpen()&&(s||a)&&t.openTooltip(a)},d=y=>{t.isOpen()&&!s&&!a&&t.hideTooltip(y)},u=y=>{In(y,i.onPointerEnter),!(y.pointerType==="touch"||t.triggerOnFocusOnly()||t.isDisabled()||y.defaultPrevented)&&(s=!0,c())},h=y=>{In(y,i.onPointerLeave),y.pointerType!=="touch"&&(s=!1,a=!1,t.isOpen()?d():t.cancelOpening())},f=y=>{In(y,i.onPointerDown),o=!0,Tl(e).addEventListener("pointerup",l,{once:!0})},p=y=>{In(y,i.onClick),s=!1,a=!1,d(!0)},g=y=>{In(y,i.onFocus),!(t.isDisabled()||y.defaultPrevented||o)&&(a=!0,c())},v=y=>{In(y,i.onBlur);const C=y.relatedTarget;t.isTargetOnTooltip(C)||(s=!1,a=!1,d(!0))};return Oe(()=>{Tl(e).removeEventListener("pointerup",l)}),m(zi,k({as:"button",ref(y){var C=qr(_=>{t.setTriggerRef(_),e=_},i.ref);typeof C=="function"&&C(y)},get"aria-describedby"(){return sn(()=>!!t.isOpen())()?t.contentId():void 0},onPointerEnter:u,onPointerLeave:h,onPointerDown:f,onClick:p,onFocus:g,onBlur:v},()=>t.dataset(),r))}var FC=Object.assign(Rrt,{Arrow:y2,Content:Art,Portal:Drt,Trigger:Prt}),Pmi=le("<div data-slot=tooltip-keybind><span></span><span data-slot=tooltip-keybind-key>");function Ort(n){const[e,t]=Je(n,["title","keybind"]);return m(ou,k(t,{get value(){return(()=>{var i=Pmi(),r=i.firstChild,o=r.nextSibling;return W(r,()=>e.title),W(o,()=>e.keybind),i})()}}))}function ou(n){let e;const[t,i]=Yt({open:!1,block:!1,expand:!1}),[r,o]=Je(n,["children","class","contentClass","contentStyle","inactive","forceOpen","ignoreSafeArea","value"]),s=()=>i("open",!1),a=()=>{const h=document.activeElement;return!e||!h?!1:e.contains(h)},l=(h=t.expand)=>{h||e?.matches(":hover")||a()||i("block",!1)},c=()=>{const h=!!e?.querySelector('[aria-expanded="true"], [data-expanded]');if(i("expand",h),h){i("block",!0),s();return}l(h)},d=()=>{i("block",!0),s()},u=()=>{a()||s(),l()};return Re(()=>{if(!e)return;c();const h=new MutationObserver(c);h.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["aria-expanded","data-expanded"]}),Oe(()=>h.disconnect())}),m(V1,{get children(){return[m(fi,{get when(){return r.inactive},get children(){return r.children}}),m(fi,{when:!0,get children(){return m(FC,k({gutter:4},o,{closeDelay:0,get ignoreSafeArea(){return r.ignoreSafeArea??!0},get open(){return r.forceOpen||t.open},onOpenChange:h=>{r.forceOpen||t.block&&h||i("open",h)},get children(){return[m(FC.Trigger,{ref(h){var f=e;typeof f=="function"?f(h):e=h},as:"div","data-component":"tooltip-trigger",get class(){return r.class},onPointerDownCapture:d,onKeyDownCapture:h=>{h.key!=="Enter"&&h.key!==" "||d()},onPointerLeave:u,onFocusOut:()=>requestAnimationFrame(()=>l()),get children(){return r.children}}),m(FC.Portal,{get children(){return m(FC.Content,{"data-component":"tooltip",get"data-placement"(){return n.placement},get"data-force-open"(){return r.forceOpen},get class(){return r.contentClass},get style(){return r.contentStyle},get children(){return r.value}})}})]}}))}})]}})}function Vrt(n){let e=n.startIndex??0;const t=n.startLevel??0,i=[],r=l=>{if(l==null)return"";const c=n.getKey??"key",d=I8(c)?l[c]:c(l);return d!=null?String(d):""},o=l=>{if(l==null)return"";const c=n.getTextValue??"textValue",d=I8(c)?l[c]:c(l);return d!=null?String(d):""},s=l=>{if(l==null)return!1;const c=n.getDisabled??"disabled";return(I8(c)?l[c]:c(l))??!1},a=l=>{if(l!=null)return I8(n.getSectionChildren)?l[n.getSectionChildren]:n.getSectionChildren?.(l)};for(const l of n.dataSource){if(I8(l)||uat(l)){i.push({type:"item",rawValue:l,key:String(l),textValue:String(l),disabled:s(l),level:t,index:e}),e++;continue}if(a(l)!=null){i.push({type:"section",rawValue:l,key:"",textValue:"",disabled:!1,level:t,index:e}),e++;const c=a(l)??[];if(c.length>0){const d=Vrt({dataSource:c,getKey:n.getKey,getTextValue:n.getTextValue,getDisabled:n.getDisabled,getSectionChildren:n.getSectionChildren,startIndex:e,startLevel:t+1});i.push(...d),e+=d.length}}else i.push({type:"item",rawValue:l,key:r(l),textValue:o(l),disabled:s(l),level:t,index:e}),e++}return i}function Omi(n,e=[]){return J(()=>{const t=Vrt({dataSource:Ze(n.dataSource),getKey:Ze(n.getKey),getTextValue:Ze(n.getTextValue),getDisabled:Ze(n.getDisabled),getSectionChildren:Ze(n.getSectionChildren)});for(let i=0;i<e.length;i++)e[i]();return n.factory(t)})}var u0=class Hrt extends Set{anchorKey;currentKey;constructor(e,t,i){super(e),e instanceof Hrt?(this.anchorKey=t||e.anchorKey,this.currentKey=i||e.currentKey):(this.anchorKey=t,this.currentKey=i)}};function Vmi(n){const[e,t]=H_(n);return[()=>e()??new u0,t]}function $rt(n){return mat()?n.altKey:n.ctrlKey}function z8(n){return lse()?n.metaKey:n.ctrlKey}function QDe(n){return new u0(n)}function Hmi(n,e){if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0}function $mi(n){const e=Pn({selectionMode:"none",selectionBehavior:"toggle"},n),[t,i]=Ye(!1),[r,o]=Ye(),s=J(()=>{const g=Ze(e.selectedKeys);return g!=null?QDe(g):g}),a=J(()=>{const g=Ze(e.defaultSelectedKeys);return g!=null?QDe(g):new u0}),[l,c]=Vmi({value:s,defaultValue:a,onChange:g=>e.onSelectionChange?.(g)}),[d,u]=Ye(Ze(e.selectionBehavior)),h=()=>Ze(e.selectionMode),f=()=>Ze(e.disallowEmptySelection)??!1,p=g=>{(Ze(e.allowDuplicateSelectionEvents)||!Hmi(g,l()))&&c(g)};return Re(()=>{const g=l();Ze(e.selectionBehavior)==="replace"&&d()==="toggle"&&typeof g=="object"&&g.size===0&&u("replace")}),Re(()=>{u(Ze(e.selectionBehavior)??"toggle")}),{selectionMode:h,disallowEmptySelection:f,selectionBehavior:d,setSelectionBehavior:u,isFocused:t,setFocused:i,focusedKey:r,setFocusedKey:o,selectedKeys:l,setSelectedKeys:p}}function Fmi(n){const[e,t]=Ye(""),[i,r]=Ye(-1);return{typeSelectHandlers:{onKeyDown:s=>{if(Ze(n.isDisabled))return;const a=Ze(n.keyboardDelegate),l=Ze(n.selectionManager);if(!a.getKeyForSearch)return;const c=zmi(s.key);if(!c||s.ctrlKey||s.metaKey)return;c===" "&&e().trim().length>0&&(s.preventDefault(),s.stopPropagation());let d=t(h=>h+c),u=a.getKeyForSearch(d,l.focusedKey())??a.getKeyForSearch(d);u==null&&Bmi(d)&&(d=d[0],u=a.getKeyForSearch(d,l.focusedKey())??a.getKeyForSearch(d)),u!=null&&(l.setFocusedKey(u),n.onTypeSelect?.(u)),clearTimeout(i()),r(window.setTimeout(()=>t(""),500))}}}}function zmi(n){return n.length===1||!/^[A-Z]/i.test(n)?n:""}function Bmi(n){return n.split("").every(e=>e===n[0])}function jmi(n,e,t){const r=k({selectOnFocus:()=>Ze(n.selectionManager).selectionBehavior()==="replace"},n),o=()=>t?.()??e(),{direction:s}=m2();let a={top:0,left:0};oat(()=>Ze(r.isVirtualized)?void 0:o(),"scroll",()=>{const v=o();v&&(a={top:v.scrollTop,left:v.scrollLeft})});const{typeSelectHandlers:l}=Fmi({isDisabled:()=>Ze(r.disallowTypeAhead),keyboardDelegate:()=>Ze(r.keyboardDelegate),selectionManager:()=>Ze(r.selectionManager)}),c=()=>Ze(r.orientation)??"vertical",d=v=>{In(v,l.onKeyDown),v.altKey&&v.key==="Tab"&&v.preventDefault();const y=e();if(!y?.contains(v.target))return;const C=Ze(r.selectionManager),_=Ze(r.selectOnFocus),w=S=>{S!=null&&(C.setFocusedKey(S),v.shiftKey&&C.selectionMode()==="multiple"?C.extendSelection(S):_&&!$rt(v)&&C.replaceSelection(S))},x=Ze(r.keyboardDelegate),M=Ze(r.shouldFocusWrap),L=C.focusedKey();switch(v.key){case(c()==="vertical"?"ArrowDown":"ArrowRight"):{if(x.getKeyBelow){v.preventDefault();let S;L!=null?S=x.getKeyBelow(L):S=x.getFirstKey?.(),S==null&&M&&(S=x.getFirstKey?.(L)),w(S)}break}case(c()==="vertical"?"ArrowUp":"ArrowLeft"):{if(x.getKeyAbove){v.preventDefault();let S;L!=null?S=x.getKeyAbove(L):S=x.getLastKey?.(),S==null&&M&&(S=x.getLastKey?.(L)),w(S)}break}case(c()==="vertical"?"ArrowLeft":"ArrowUp"):{if(x.getKeyLeftOf){v.preventDefault();const S=s()==="rtl";let I;L!=null?I=x.getKeyLeftOf(L):I=S?x.getFirstKey?.():x.getLastKey?.(),w(I)}break}case(c()==="vertical"?"ArrowRight":"ArrowDown"):{if(x.getKeyRightOf){v.preventDefault();const S=s()==="rtl";let I;L!=null?I=x.getKeyRightOf(L):I=S?x.getLastKey?.():x.getFirstKey?.(),w(I)}break}case"Home":if(x.getFirstKey){v.preventDefault();const S=x.getFirstKey(L,z8(v));S!=null&&(C.setFocusedKey(S),z8(v)&&v.shiftKey&&C.selectionMode()==="multiple"?C.extendSelection(S):_&&C.replaceSelection(S))}break;case"End":if(x.getLastKey){v.preventDefault();const S=x.getLastKey(L,z8(v));S!=null&&(C.setFocusedKey(S),z8(v)&&v.shiftKey&&C.selectionMode()==="multiple"?C.extendSelection(S):_&&C.replaceSelection(S))}break;case"PageDown":if(x.getKeyPageBelow&&L!=null){v.preventDefault();const S=x.getKeyPageBelow(L);w(S)}break;case"PageUp":if(x.getKeyPageAbove&&L!=null){v.preventDefault();const S=x.getKeyPageAbove(L);w(S)}break;case"a":z8(v)&&C.selectionMode()==="multiple"&&Ze(r.disallowSelectAll)!==!0&&(v.preventDefault(),C.selectAll());break;case"Escape":v.defaultPrevented||(v.preventDefault(),Ze(r.disallowEmptySelection)||C.clearSelection());break;case"Tab":if(!Ze(r.allowsTabNavigation)){if(v.shiftKey)y.focus();else{const S=Lat(y,{tabbable:!0});let I,E;do E=S.lastChild(),E&&(I=E);while(E);I&&!I.contains(document.activeElement)&&Rs(I)}break}}},u=v=>{const y=Ze(r.selectionManager),C=Ze(r.keyboardDelegate),_=Ze(r.selectOnFocus);if(y.isFocused()){v.currentTarget.contains(v.target)||y.setFocused(!1);return}if(v.currentTarget.contains(v.target)){if(y.setFocused(!0),y.focusedKey()==null){const w=M=>{M!=null&&(y.setFocusedKey(M),_&&y.replaceSelection(M))},x=v.relatedTarget;x&&v.currentTarget.compareDocumentPosition(x)&Node.DOCUMENT_POSITION_FOLLOWING?w(y.lastSelectedKey()??C.getLastKey?.()):w(y.firstSelectedKey()??C.getFirstKey?.())}else if(!Ze(r.isVirtualized)){const w=o();if(w){w.scrollTop=a.top,w.scrollLeft=a.left;const x=w.querySelector(`[data-key="${y.focusedKey()}"]`);x&&(Rs(x),Jhe(w,x))}}}},h=v=>{const y=Ze(r.selectionManager);v.currentTarget.contains(v.relatedTarget)||y.setFocused(!1)},f=v=>{o()===v.target&&v.preventDefault()},p=()=>{const v=Ze(r.autoFocus);if(!v)return;const y=Ze(r.selectionManager),C=Ze(r.keyboardDelegate);let _;v==="first"&&(_=C.getFirstKey?.()),v==="last"&&(_=C.getLastKey?.());const w=y.selectedKeys();w.size&&(_=w.values().next().value),y.setFocused(!0),y.setFocusedKey(_);const x=e();x&&_==null&&!Ze(r.shouldUseVirtualFocus)&&Rs(x)};return ur(()=>{r.deferAutoFocus?setTimeout(p,0):p()}),Re(Mr([o,()=>Ze(r.isVirtualized),()=>Ze(r.selectionManager).focusedKey()],v=>{const[y,C,_]=v;if(C)_&&r.scrollToKey?.(_);else if(_&&y){const w=y.querySelector(`[data-key="${_}"]`);w&&Jhe(y,w)}})),{tabIndex:J(()=>{if(!Ze(r.shouldUseVirtualFocus))return Ze(r.selectionManager).focusedKey()==null?0:-1}),onKeyDown:d,onMouseDown:f,onFocusIn:u,onFocusOut:h}}function Frt(n,e){const t=()=>Ze(n.selectionManager),i=()=>Ze(n.key),r=()=>Ze(n.shouldUseVirtualFocus),o=C=>{t().selectionMode()!=="none"&&(t().selectionMode()==="single"?t().isSelected(i())&&!t().disallowEmptySelection()?t().toggleSelection(i()):t().replaceSelection(i()):C?.shiftKey?t().extendSelection(i()):t().selectionBehavior()==="toggle"||z8(C)||"pointerType"in C&&C.pointerType==="touch"?t().toggleSelection(i()):t().replaceSelection(i()))},s=()=>t().isSelected(i()),a=()=>Ze(n.disabled)||t().isDisabled(i()),l=()=>!a()&&t().canSelectItem(i());let c=null;const d=C=>{l()&&(c=C.pointerType,C.pointerType==="mouse"&&C.button===0&&!Ze(n.shouldSelectOnPressUp)&&o(C))},u=C=>{l()&&C.pointerType==="mouse"&&C.button===0&&Ze(n.shouldSelectOnPressUp)&&Ze(n.allowsDifferentPressOrigin)&&o(C)},h=C=>{l()&&(Ze(n.shouldSelectOnPressUp)&&!Ze(n.allowsDifferentPressOrigin)||c!=="mouse")&&o(C)},f=C=>{!l()||!["Enter"," "].includes(C.key)||($rt(C)?t().toggleSelection(i()):o(C))},p=C=>{a()&&C.preventDefault()},g=C=>{const _=e();r()||a()||!_||C.target===_&&t().setFocusedKey(i())},v=J(()=>{if(!(r()||a()))return i()===t().focusedKey()?0:-1}),y=J(()=>Ze(n.virtualized)?void 0:i());return Re(Mr([e,i,r,()=>t().focusedKey(),()=>t().isFocused()],([C,_,w,x,M])=>{C&&_===x&&M&&!w&&document.activeElement!==C&&(n.focus?n.focus():Rs(C))})),{isSelected:s,isDisabled:a,allowsSelection:l,tabIndex:v,dataKey:y,onPointerDown:d,onPointerUp:u,onClick:h,onKeyDown:f,onMouseDown:p,onFocus:g}}var Wmi=class{collection;state;constructor(n,e){this.collection=n,this.state=e}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(n){this.state.setSelectionBehavior(n)}isFocused(){return this.state.isFocused()}setFocused(n){this.state.setFocused(n)}focusedKey(){return this.state.focusedKey()}setFocusedKey(n){(n==null||this.collection().getItem(n))&&this.state.setFocusedKey(n)}selectedKeys(){return this.state.selectedKeys()}isSelected(n){if(this.state.selectionMode()==="none")return!1;const e=this.getKey(n);return e==null?!1:this.state.selectedKeys().has(e)}isEmpty(){return this.state.selectedKeys().size===0}isSelectAll(){if(this.isEmpty())return!1;const n=this.state.selectedKeys();return this.getAllSelectableKeys().every(e=>n.has(e))}firstSelectedKey(){let n;for(const e of this.state.selectedKeys()){const t=this.collection().getItem(e),i=t?.index!=null&&n?.index!=null&&t.index<n.index;(!n||i)&&(n=t)}return n?.key}lastSelectedKey(){let n;for(const e of this.state.selectedKeys()){const t=this.collection().getItem(e),i=t?.index!=null&&n?.index!=null&&t.index>n.index;(!n||i)&&(n=t)}return n?.key}extendSelection(n){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"){this.replaceSelection(n);return}const e=this.getKey(n);if(e==null)return;const t=this.state.selectedKeys(),i=t.anchorKey||e,r=new u0(t,i,e);for(const o of this.getKeyRange(i,t.currentKey||e))r.delete(o);for(const o of this.getKeyRange(e,i))this.canSelectItem(o)&&r.add(o);this.state.setSelectedKeys(r)}getKeyRange(n,e){const t=this.collection().getItem(n),i=this.collection().getItem(e);return t&&i?t.index!=null&&i.index!=null&&t.index<=i.index?this.getKeyRangeInternal(n,e):this.getKeyRangeInternal(e,n):[]}getKeyRangeInternal(n,e){const t=[];let i=n;for(;i!=null;){const r=this.collection().getItem(i);if(r&&r.type==="item"&&t.push(i),i===e)return t;i=this.collection().getKeyAfter(i)}return[]}getKey(n){const e=this.collection().getItem(n);return e?!e||e.type!=="item"?null:e.key:n}toggleSelection(n){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"&&!this.isSelected(n)){this.replaceSelection(n);return}const e=this.getKey(n);if(e==null)return;const t=new u0(this.state.selectedKeys());t.has(e)?t.delete(e):this.canSelectItem(e)&&(t.add(e),t.anchorKey=e,t.currentKey=e),!(this.disallowEmptySelection()&&t.size===0)&&this.state.setSelectedKeys(t)}replaceSelection(n){if(this.selectionMode()==="none")return;const e=this.getKey(n);if(e==null)return;const t=this.canSelectItem(e)?new u0([e],e,e):new u0;this.state.setSelectedKeys(t)}setSelectedKeys(n){if(this.selectionMode()==="none")return;const e=new u0;for(const t of n){const i=this.getKey(t);if(i!=null&&(e.add(i),this.selectionMode()==="single"))break}this.state.setSelectedKeys(e)}selectAll(){this.selectionMode()==="multiple"&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const n=this.state.selectedKeys();!this.disallowEmptySelection()&&n.size>0&&this.state.setSelectedKeys(new u0)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(n,e){this.selectionMode()!=="none"&&(this.selectionMode()==="single"?this.isSelected(n)&&!this.disallowEmptySelection()?this.toggleSelection(n):this.replaceSelection(n):this.selectionBehavior()==="toggle"||e&&e.pointerType==="touch"?this.toggleSelection(n):this.replaceSelection(n))}isSelectionEqual(n){if(n===this.state.selectedKeys())return!0;const e=this.selectedKeys();if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;for(const t of e)if(!n.has(t))return!1;return!0}canSelectItem(n){if(this.state.selectionMode()==="none")return!1;const e=this.collection().getItem(n);return e!=null&&!e.disabled}isDisabled(n){const e=this.collection().getItem(n);return!e||e.disabled}getAllSelectableKeys(){const n=[];return(t=>{for(;t!=null;){if(this.canSelectItem(t)){const i=this.collection().getItem(t);if(!i)continue;i.type==="item"&&n.push(t)}t=this.collection().getKeyAfter(t)}})(this.collection().getFirstKey()),n}},eRe=class{keyMap=new Map;iterable;firstKey;lastKey;constructor(n){this.iterable=n;for(const i of n)this.keyMap.set(i.key,i);if(this.keyMap.size===0)return;let e,t=0;for(const[i,r]of this.keyMap)e?(e.nextKey=i,r.prevKey=e.key):(this.firstKey=i,r.prevKey=void 0),r.type==="item"&&(r.index=t++),e=r,e.nextKey=void 0;this.lastKey=e.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(n){return this.keyMap.get(n)?.prevKey}getKeyAfter(n){return this.keyMap.get(n)?.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(n){return this.keyMap.get(n)}at(n){const e=[...this.getKeys()];return this.getItem(e[n])}};function qmi(n){const e=$mi(n),i=Omi({dataSource:()=>Ze(n.dataSource),getKey:()=>Ze(n.getKey),getTextValue:()=>Ze(n.getTextValue),getDisabled:()=>Ze(n.getDisabled),getSectionChildren:()=>Ze(n.getSectionChildren),factory:o=>n.filter?new eRe(n.filter(o)):new eRe(o)},[()=>n.filter]),r=new Wmi(i,e);return Gb(()=>{const o=e.focusedKey();o!=null&&!i().getItem(o)&&e.setFocusedKey(void 0)}),{collection:i,selectionManager:()=>r}}var Umi=class{collection;ref;collator;constructor(n,e,t){this.collection=n,this.ref=e,this.collator=t}getKeyBelow(n){let e=this.collection().getKeyAfter(n);for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyAfter(e)}}getKeyAbove(n){let e=this.collection().getKeyBefore(n);for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyBefore(e)}}getFirstKey(){let n=this.collection().getFirstKey();for(;n!=null;){const e=this.collection().getItem(n);if(e&&e.type==="item"&&!e.disabled)return n;n=this.collection().getKeyAfter(n)}}getLastKey(){let n=this.collection().getLastKey();for(;n!=null;){const e=this.collection().getItem(n);if(e&&e.type==="item"&&!e.disabled)return n;n=this.collection().getKeyBefore(n)}}getItem(n){return this.ref?.()?.querySelector(`[data-key="${n}"]`)??null}getKeyPageAbove(n){const e=this.ref?.();let t=this.getItem(n);if(!e||!t)return;const i=Math.max(0,t.offsetTop+t.offsetHeight-e.offsetHeight);let r=n;for(;r&&t&&t.offsetTop>i;)r=this.getKeyAbove(r),t=r!=null?this.getItem(r):null;return r}getKeyPageBelow(n){const e=this.ref?.();let t=this.getItem(n);if(!e||!t)return;const i=Math.min(e.scrollHeight,t.offsetTop-t.offsetHeight+e.offsetHeight);let r=n;for(;r&&t&&t.offsetTop<i;)r=this.getKeyBelow(r),t=r!=null?this.getItem(r):null;return r}getKeyForSearch(n,e){const t=this.collator?.();if(!t)return;let i=e!=null?this.getKeyBelow(e):this.getFirstKey();for(;i!=null;){const r=this.collection().getItem(i);if(r){const o=r.textValue.slice(0,n.length);if(r.textValue&&t.compare(o,n)===0)return i}i=this.getKeyBelow(i)}}};function Zmi(n,e,t){const i=Egi({usage:"search",sensitivity:"base"}),r=J(()=>{const o=Ze(n.keyboardDelegate);return o||new Umi(n.collection,e,i)});return jmi({selectionManager:()=>Ze(n.selectionManager),keyboardDelegate:r,autoFocus:()=>Ze(n.autoFocus),deferAutoFocus:()=>Ze(n.deferAutoFocus),shouldFocusWrap:()=>Ze(n.shouldFocusWrap),disallowEmptySelection:()=>Ze(n.disallowEmptySelection),selectOnFocus:()=>Ze(n.selectOnFocus),disallowTypeAhead:()=>Ze(n.disallowTypeAhead),shouldUseVirtualFocus:()=>Ze(n.shouldUseVirtualFocus),allowsTabNavigation:()=>Ze(n.allowsTabNavigation),isVirtualized:()=>Ze(n.isVirtualized),scrollToKey:o=>Ze(n.scrollToKey)?.(o),orientation:()=>Ze(n.orientation)},e,t)}var zrt=oi();function Brt(){return Wn(zrt)}function Kmi(){const n=Brt();if(n===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return n}function jrt(n,e){return!!(e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING)}function Gmi(n,e){const t=e.ref();if(!t)return-1;let i=n.length;if(!i)return-1;for(;i--;){const r=n[i]?.ref();if(r&&jrt(r,t))return i+1}return 0}function Xmi(n){const e=n.map((i,r)=>[r,i]);let t=!1;return e.sort(([i,r],[o,s])=>{const a=r.ref(),l=s.ref();return a===l||!a||!l?0:jrt(a,l)?(i>o&&(t=!0),-1):(i<o&&(t=!0),1)}),t?e.map(([i,r])=>r):n}function Wrt(n,e){const t=Xmi(n);n!==t&&e(t)}function Ymi(n){const e=n[0],t=n[n.length-1]?.ref();let i=e?.ref()?.parentElement;for(;i;){if(t&&i.contains(t))return i;i=i.parentElement}return Tl(i).body}function Jmi(n,e){Re(()=>{const t=setTimeout(()=>{Wrt(n(),e)});Oe(()=>clearTimeout(t))})}function Qmi(n,e){if(typeof IntersectionObserver!="function"){Jmi(n,e);return}let t=[];Re(()=>{const i=()=>{const s=!!t.length;t=n(),s&&Wrt(n(),e)},r=Ymi(n()),o=new IntersectionObserver(i,{root:r});for(const s of n()){const a=s.ref();a&&o.observe(a)}Oe(()=>o.disconnect())})}function e4i(n={}){const[e,t]=qat({value:()=>Ze(n.items),onChange:o=>n.onItemsChange?.(o)});Qmi(e,t);const i=o=>(t(s=>{const a=Gmi(s,o);return dat(s,o,a)}),()=>{t(s=>{const a=s.filter(l=>l.ref()!==o.ref());return s.length===a.length?s:a})});return{DomCollectionProvider:o=>m(zrt.Provider,{value:{registerItem:i},get children(){return o.children}})}}function t4i(n){const e=Kmi(),t=Pn({shouldRegisterItem:!0},n);Re(()=>{if(!t.shouldRegisterItem)return;const i=e.registerItem(t.getItem());Oe(i)})}function n4i(n={}){const[e,t]=FRe({value:()=>Ze(n.isSelected),defaultValue:()=>!!Ze(n.defaultIsSelected),onChange:o=>n.onSelectedChange?.(o)});return{isSelected:e,setIsSelected:o=>{!Ze(n.isReadOnly)&&!Ze(n.isDisabled)&&t(o)},toggle:()=>{!Ze(n.isReadOnly)&&!Ze(n.isDisabled)&&t(!e())}}}var i4i=oi();function Cce(){return Wn(i4i)}var r4i=oi();function qrt(){return Wn(r4i)}var Urt=oi();function Zrt(){return Wn(Urt)}function Ah(){const n=Zrt();if(n===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return n}var Krt=oi();function Lke(){const n=Wn(Krt);if(n===void 0)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return n}var Grt=oi();function td(){const n=Wn(Grt);if(n===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return n}function Ike(n){let e;const t=td(),i=Ah(),r=Pn({id:t.generateId(`item-${$s()}`)},n),[o,s]=Je(r,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=Ye(),[c,d]=Ye(),[u,h]=Ye(),f=()=>i.listState().selectionManager(),p=()=>s.id,g=()=>f().focusedKey()===p(),v=()=>{o.onSelect?.(),o.closeOnSelect&&setTimeout(()=>{i.close(!0)})};t4i({getItem:()=>({ref:()=>e,type:"item",key:p(),textValue:o.textValue??u()?.textContent??e?.textContent??"",disabled:o.disabled??!1})});const y=Frt({key:p,selectionManager:f,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>o.disabled},()=>e),C=I=>{In(I,o.onPointerMove),I.pointerType==="mouse"&&(o.disabled?i.onItemLeave(I):(i.onItemEnter(I),I.defaultPrevented||(Rs(I.currentTarget),i.listState().selectionManager().setFocused(!0),i.listState().selectionManager().setFocusedKey(p()))))},_=I=>{In(I,o.onPointerLeave),I.pointerType==="mouse"&&i.onItemLeave(I)},w=I=>{In(I,o.onPointerUp),!o.disabled&&I.button===0&&v()},x=I=>{if(In(I,o.onKeyDown),!I.repeat&&!o.disabled)switch(I.key){case"Enter":case" ":v();break}},M=J(()=>{if(o.indeterminate)return"mixed";if(o.checked!=null)return o.checked}),L=J(()=>({"data-indeterminate":o.indeterminate?"":void 0,"data-checked":o.checked&&!o.indeterminate?"":void 0,"data-disabled":o.disabled?"":void 0,"data-highlighted":g()?"":void 0})),S={isChecked:()=>o.checked,dataset:L,setLabelRef:h,generateId:bh(()=>s.id),registerLabel:Xa(l),registerDescription:Xa(d)};return m(Krt.Provider,{value:S,get children(){return m(zi,k({as:"div",ref(I){var E=qr(A=>e=A,o.ref);typeof E=="function"&&E(I)},get tabIndex(){return y.tabIndex()},get"aria-checked"(){return M()},get"aria-disabled"(){return o.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return y.dataKey()},get onPointerDown(){return hs([o.onPointerDown,y.onPointerDown])},get onPointerUp(){return hs([w,y.onPointerUp])},get onClick(){return hs([o.onClick,y.onClick])},get onKeyDown(){return hs([x,y.onKeyDown])},get onMouseDown(){return hs([o.onMouseDown,y.onMouseDown])},get onFocus(){return hs([o.onFocus,y.onFocus])},onPointerMove:C,onPointerLeave:_},L,s))}})}function bce(n){const e=Pn({closeOnSelect:!1},n),[t,i]=Je(e,["checked","defaultChecked","onChange","onSelect"]),r=n4i({isSelected:()=>t.checked,defaultIsSelected:()=>t.defaultChecked,onSelectedChange:s=>t.onChange?.(s),isDisabled:()=>i.disabled});return m(Ike,k({role:"menuitemcheckbox",get checked(){return r.isSelected()},onSelect:()=>{t.onSelect?.(),r.toggle()}},i))}var D_={next:(n,e)=>n==="ltr"?e==="horizontal"?"ArrowRight":"ArrowDown":e==="horizontal"?"ArrowLeft":"ArrowUp",previous:(n,e)=>D_.next(n==="ltr"?"rtl":"ltr",e)},tRe={first:n=>n==="horizontal"?"ArrowDown":"ArrowRight",last:n=>n==="horizontal"?"ArrowUp":"ArrowLeft"};function Xrt(n){const e=td(),t=Ah(),i=Cce(),{direction:r}=m2(),o=Pn({id:e.generateId("trigger")},n),[s,a]=Je(o,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let l=()=>e.value();i!==void 0&&(l=()=>e.value()??s.id,i.lastValue()===void 0&&i.setLastValue(l));const c=$_(()=>t.triggerRef(),()=>"button"),d=J(()=>c()==="a"&&t.triggerRef()?.getAttribute("href")!=null);Re(Mr(()=>i?.value(),y=>{d()&&y===l()&&t.triggerRef()?.focus()}));const u=()=>{i!==void 0?t.isOpen()?i.value()===l()&&i.closeMenu():(i.autoFocusMenu()||i.setAutoFocusMenu(!0),t.open(!1)):t.toggle(!0)},h=y=>{In(y,s.onPointerDown),y.currentTarget.dataset.pointerType=y.pointerType,!s.disabled&&y.pointerType!=="touch"&&y.button===0&&u()},f=y=>{In(y,s.onClick),s.disabled||y.currentTarget.dataset.pointerType==="touch"&&u()},p=y=>{if(In(y,s.onKeyDown),!s.disabled){if(d())switch(y.key){case"Enter":case" ":return}switch(y.key){case"Enter":case" ":case tRe.first(e.orientation()):y.stopPropagation(),y.preventDefault(),Eat(y.currentTarget),t.open("first"),i?.setAutoFocusMenu(!0),i?.setValue(l);break;case tRe.last(e.orientation()):y.stopPropagation(),y.preventDefault(),t.open("last");break;case D_.next(r(),e.orientation()):if(i===void 0)break;y.stopPropagation(),y.preventDefault(),i.nextMenu();break;case D_.previous(r(),e.orientation()):if(i===void 0)break;y.stopPropagation(),y.preventDefault(),i.previousMenu();break}}},g=y=>{In(y,s.onMouseOver),t.triggerRef()?.dataset.pointerType!=="touch"&&!s.disabled&&i!==void 0&&i.value()!==void 0&&i.setValue(l)},v=y=>{In(y,s.onFocus),i!==void 0&&y.currentTarget.dataset.pointerType!=="touch"&&i.setValue(l)};return Re(()=>Oe(t.registerTriggerId(s.id))),m(h3,k({ref(y){var C=qr(t.setTriggerRef,s.ref);typeof C=="function"&&C(y)},get"data-kb-menu-value-trigger"(){return e.value()},get id(){return s.id},get disabled(){return s.disabled},"aria-haspopup":"true",get"aria-expanded"(){return t.isOpen()},get"aria-controls"(){return sn(()=>!!t.isOpen())()?t.contentId():void 0},get"data-highlighted"(){return l()!==void 0&&i?.value()===l()?!0:void 0},get tabIndex(){return i!==void 0?i.value()===l()||i.lastValue()===l()?0:-1:void 0},onPointerDown:h,onMouseOver:g,onClick:f,onKeyDown:p,onFocus:v,role:i!==void 0?"menuitem":void 0},()=>t.dataset(),a))}function Yrt(n){let e;const t=td(),i=Ah(),r=Cce(),o=qrt(),{direction:s}=m2(),a=Pn({id:t.generateId(`content-${$s()}`)},n),[l,c]=Je(a,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let d=0;const u=()=>i.parentMenuContext()==null&&r===void 0&&t.isModal(),h=Zmi({selectionManager:i.listState().selectionManager,collection:i.listState().collection,autoFocus:i.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!i.listState().selectionManager().isFocused(),orientation:()=>t.orientation()==="horizontal"?"vertical":"horizontal"},()=>e);VRe({trapFocus:()=>u()&&i.isOpen(),onMountAutoFocus:_=>{r===void 0&&l.onOpenAutoFocus?.(_)},onUnmountAutoFocus:l.onCloseAutoFocus},()=>e);const f=_=>{if(ps(_.currentTarget,_.target)&&(_.key==="Tab"&&i.isOpen()&&_.preventDefault(),r!==void 0&&_.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(_.key){case D_.next(s(),t.orientation()):_.stopPropagation(),_.preventDefault(),i.close(!0),r.setAutoFocusMenu(!0),r.nextMenu();break;case D_.previous(s(),t.orientation()):if(_.currentTarget.hasAttribute("data-closed"))break;_.stopPropagation(),_.preventDefault(),i.close(!0),r.setAutoFocusMenu(!0),r.previousMenu();break}},p=_=>{l.onEscapeKeyDown?.(_),r?.setAutoFocusMenu(!1),i.close(!0)},g=_=>{l.onFocusOutside?.(_),t.isModal()&&_.preventDefault()},v=_=>{In(_,l.onPointerEnter),i.isOpen()&&(i.parentMenuContext()?.listState().selectionManager().setFocused(!1),i.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},y=_=>{if(In(_,l.onPointerMove),_.pointerType!=="mouse")return;const w=_.target,x=d!==_.clientX;ps(_.currentTarget,w)&&x&&(i.setPointerDir(_.clientX>d?"right":"left"),d=_.clientX)};Re(()=>Oe(i.registerContentId(l.id))),Oe(()=>i.setContentRef(void 0));const C={ref:qr(_=>{i.setContentRef(_),e=_},l.ref),role:"menu",get id(){return l.id},get tabIndex(){return h.tabIndex()},get"aria-labelledby"(){return i.triggerId()},onKeyDown:hs([l.onKeyDown,h.onKeyDown,f]),onMouseDown:hs([l.onMouseDown,h.onMouseDown]),onFocusIn:hs([l.onFocusIn,h.onFocusIn]),onFocusOut:hs([l.onFocusOut,h.onFocusOut]),onPointerEnter:v,onPointerMove:y,get"data-orientation"(){return t.orientation()}};return m(_e,{get when(){return i.contentPresent()},get children(){return m(_e,{get when(){return o===void 0||i.parentMenuContext()!=null},get fallback(){return m(zi,k({as:"div"},()=>i.dataset(),C,c))},get children(){return m(tk.Positioner,{get children(){return m(cse,k({get disableOutsidePointerEvents(){return sn(()=>!!u())()&&i.isOpen()},get excludedElements(){return[i.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return su({"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},l.style)},onEscapeKeyDown:p,onFocusOutside:g,get onDismiss(){return i.close}},()=>i.dataset(),C,c))}})}})}})}function Jrt(n){let e;const t=td(),i=Ah(),[r,o]=Je(n,["ref"]);return zRe({element:()=>e??null,enabled:()=>i.contentPresent()&&t.preventScroll()}),m(Yrt,k({ref(s){var a=qr(l=>{e=l},r.ref);typeof a=="function"&&a(s)}},o))}var Qrt=oi();function o4i(){const n=Wn(Qrt);if(n===void 0)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return n}function Qx(n){const e=td(),t=Pn({id:e.generateId(`group-${$s()}`)},n),[i,r]=Ye(),o={generateId:bh(()=>t.id),registerLabelId:Xa(r)};return m(Qrt.Provider,{value:o,get children(){return m(zi,k({as:"div",role:"group",get"aria-labelledby"(){return i()}},t))}})}function wce(n){const e=o4i(),t=Pn({id:e.generateId("label")},n),[i,r]=Je(t,["id"]);return Re(()=>Oe(e.registerLabelId(i.id))),m(zi,k({as:"span",get id(){return i.id},"aria-hidden":"true"},r))}function _ce(n){const e=Ah(),t=Pn({children:"▼"},n);return m(zi,k({as:"span","aria-hidden":"true"},()=>e.dataset(),t))}function xce(n){return m(Ike,k({role:"menuitem",closeOnSelect:!0},n))}function Sce(n){const e=Lke(),t=Pn({id:e.generateId("description")},n),[i,r]=Je(t,["id"]);return Re(()=>Oe(e.registerDescription(i.id))),m(zi,k({as:"div",get id(){return i.id}},()=>e.dataset(),r))}function Mce(n){const e=Lke(),t=Pn({id:e.generateId("indicator")},n),[i,r]=Je(t,["forceMount"]);return m(_e,{get when(){return i.forceMount||e.isChecked()},get children(){return m(zi,k({as:"div"},()=>e.dataset(),r))}})}function Lce(n){const e=Lke(),t=Pn({id:e.generateId("label")},n),[i,r]=Je(t,["ref","id"]);return Re(()=>Oe(e.registerLabel(i.id))),m(zi,k({as:"div",ref(o){var s=qr(e.setLabelRef,i.ref);typeof s=="function"&&s(o)},get id(){return i.id}},()=>e.dataset(),r))}function Ice(n){const e=Ah();return m(_e,{get when(){return e.contentPresent()},get children(){return m(d3,n)}})}var eot=oi();function s4i(){const n=Wn(eot);if(n===void 0)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return n}function Nce(n){const t=td().generateId(`radiogroup-${$s()}`),i=Pn({id:t},n),[r,o]=Je(i,["value","defaultValue","onChange","disabled"]),[s,a]=H_({value:()=>r.value,defaultValue:()=>r.defaultValue,onChange:c=>r.onChange?.(c)}),l={isDisabled:()=>r.disabled,isSelectedValue:c=>c===s(),setSelectedValue:c=>a(c)};return m(eot.Provider,{value:l,get children(){return m(Qx,o)}})}function Ece(n){const e=s4i(),t=Pn({closeOnSelect:!1},n),[i,r]=Je(t,["value","onSelect"]);return m(Ike,k({role:"menuitemradio",get checked(){return e.isSelectedValue(i.value)},onSelect:()=>{i.onSelect?.(),e.setSelectedValue(i.value)}},r))}function a4i(n,e,t){const i=n.split("-")[0],r=t.getBoundingClientRect(),o=[],s=e.clientX,a=e.clientY;switch(i){case"top":o.push([s,a+5]),o.push([r.left,r.bottom]),o.push([r.left,r.top]),o.push([r.right,r.top]),o.push([r.right,r.bottom]);break;case"right":o.push([s-5,a]),o.push([r.left,r.top]),o.push([r.right,r.top]),o.push([r.right,r.bottom]),o.push([r.left,r.bottom]);break;case"bottom":o.push([s,a-5]),o.push([r.right,r.top]),o.push([r.right,r.bottom]),o.push([r.left,r.bottom]),o.push([r.left,r.top]);break;case"left":o.push([s+5,a]),o.push([r.right,r.bottom]),o.push([r.left,r.bottom]),o.push([r.left,r.top]),o.push([r.right,r.top]);break}return o}function l4i(n,e){return e?C5e([n.clientX,n.clientY],e):!1}function tot(n){const e=td(),t=Brt(),i=Zrt(),r=Cce(),o=qrt(),s=Pn({placement:e.orientation()==="horizontal"?"bottom-start":"right-start"},n),[a,l]=Je(s,["open","defaultOpen","onOpenChange"]);let c=0,d=null,u="right";const[h,f]=Ye(),[p,g]=Ye(),[v,y]=Ye(),[C,_]=Ye(),[w,x]=Ye(!0),[M,L]=Ye(l.placement),[S,I]=Ye([]),[E,A]=Ye([]),{DomCollectionProvider:T}=e4i({items:E,onItemsChange:A}),D=u3({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:be=>a.onOpenChange?.(be)}),{present:R}=M6({show:()=>e.forceMount()||D.isOpen(),element:()=>C()??null}),P=qmi({selectionMode:"none",dataSource:E}),V=be=>{x(be),D.open()},$=(be=!1)=>{D.close(),be&&i&&i.close(!0)},j=be=>{x(be),D.toggle()},B=()=>{const be=C();be&&(Rs(be),P.selectionManager().setFocused(!0),P.selectionManager().setFocusedKey(void 0))},te=()=>{o!=null?setTimeout(()=>B()):B()},U=be=>{I(Ke=>[...Ke,be]);const Ve=i?.registerNestedMenu(be);return()=>{I(Ke=>Yhe(Ke,be)),Ve?.()}},Y=be=>u===d?.side&&l4i(be,d?.area),X=be=>{Y(be)&&be.preventDefault()},se=be=>{Y(be)||te()},pe=be=>{Y(be)&&be.preventDefault()};HRe({isDisabled:()=>!(i==null&&D.isOpen()&&e.isModal()),targets:()=>[C(),...S()].filter(Boolean)}),Re(()=>{const be=C();if(!be||!i)return;const Ve=i.registerNestedMenu(be);Oe(()=>{Ve()})}),Re(()=>{i===void 0&&r?.registerMenu(e.value(),[C(),...S()])}),Re(()=>{i!==void 0||r===void 0||(r.value()===e.value()?(v()?.focus(),r.autoFocusMenu()&&V(!0)):$())}),Re(()=>{i!==void 0||r===void 0||D.isOpen()&&r.setValue(e.value())}),Oe(()=>{i===void 0&&r?.unregisterMenu(e.value())});const Fe={dataset:J(()=>({"data-expanded":D.isOpen()?"":void 0,"data-closed":D.isOpen()?void 0:""})),isOpen:D.isOpen,contentPresent:R,nestedMenus:S,currentPlacement:M,pointerGraceTimeoutId:()=>c,autoFocus:w,listState:()=>P,parentMenuContext:()=>i,triggerRef:v,contentRef:C,triggerId:h,contentId:p,setTriggerRef:y,setContentRef:_,open:V,close:$,toggle:j,focusContent:te,onItemEnter:X,onItemLeave:se,onTriggerLeave:pe,setPointerDir:be=>u=be,setPointerGraceTimeoutId:be=>c=be,setPointerGraceIntent:be=>d=be,registerNestedMenu:U,registerItemToParentDomCollection:t?.registerItem,registerTriggerId:Xa(f),registerContentId:Xa(g)};return m(T,{get children(){return m(Urt.Provider,{value:Fe,get children(){return m(_e,{when:o===void 0,get fallback(){return l.children},get children(){return m(tk,k({anchorRef:v,contentRef:C,onCurrentPlacementChange:L},l))}})}})}})}function Tce(n){const{direction:e}=m2();return m(tot,k({get placement(){return e()==="rtl"?"left-start":"right-start"},flip:!0},n))}var c4i={close:(n,e)=>n==="ltr"?[e==="horizontal"?"ArrowLeft":"ArrowUp"]:[e==="horizontal"?"ArrowRight":"ArrowDown"]};function Ace(n){const e=Ah(),t=td(),[i,r]=Je(n,["onFocusOutside","onKeyDown"]),{direction:o}=m2();return m(Yrt,k({onOpenAutoFocus:d=>{d.preventDefault()},onCloseAutoFocus:d=>{d.preventDefault()},onFocusOutside:d=>{i.onFocusOutside?.(d);const u=d.target;ps(e.triggerRef(),u)||e.close()},onKeyDown:d=>{In(d,i.onKeyDown);const u=ps(d.currentTarget,d.target),h=c4i.close(o(),t.orientation()).includes(d.key),f=e.parentMenuContext()!=null;u&&h&&f&&(e.close(),Rs(e.triggerRef()))}},r))}var nRe=["Enter"," "],d4i={open:(n,e)=>n==="ltr"?[...nRe,e==="horizontal"?"ArrowRight":"ArrowDown"]:[...nRe,e==="horizontal"?"ArrowLeft":"ArrowUp"]};function Dce(n){let e;const t=td(),i=Ah(),r=Pn({id:t.generateId(`sub-trigger-${$s()}`)},n),[o,s]=Je(r,["ref","id","textValue","disabled","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);let a=null;const l=()=>{a&&window.clearTimeout(a),a=null},{direction:c}=m2(),d=()=>o.id,u=()=>{const _=i.parentMenuContext();if(_==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");return _.listState().selectionManager()},h=()=>i.listState().collection(),f=()=>u().focusedKey()===d(),p=Frt({key:d,selectionManager:u,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>o.disabled},()=>e),g=_=>{In(_,o.onClick),!i.isOpen()&&!o.disabled&&i.open(!0)},v=_=>{if(In(_,o.onPointerMove),_.pointerType!=="mouse")return;const w=i.parentMenuContext();if(w?.onItemEnter(_),!_.defaultPrevented){if(o.disabled){w?.onItemLeave(_);return}!i.isOpen()&&!a&&(i.parentMenuContext()?.setPointerGraceIntent(null),a=window.setTimeout(()=>{i.open(!1),l()},100)),w?.onItemEnter(_),_.defaultPrevented||(i.listState().selectionManager().isFocused()&&(i.listState().selectionManager().setFocused(!1),i.listState().selectionManager().setFocusedKey(void 0)),Rs(_.currentTarget),w?.listState().selectionManager().setFocused(!0),w?.listState().selectionManager().setFocusedKey(d()))}},y=_=>{if(In(_,o.onPointerLeave),_.pointerType!=="mouse")return;l();const w=i.parentMenuContext(),x=i.contentRef();if(x){w?.setPointerGraceIntent({area:a4i(i.currentPlacement(),_,x),side:i.currentPlacement().split("-")[0]}),window.clearTimeout(w?.pointerGraceTimeoutId());const M=window.setTimeout(()=>{w?.setPointerGraceIntent(null)},300);w?.setPointerGraceTimeoutId(M)}else{if(w?.onTriggerLeave(_),_.defaultPrevented)return;w?.setPointerGraceIntent(null)}w?.onItemLeave(_)},C=_=>{In(_,o.onKeyDown),!_.repeat&&(o.disabled||d4i.open(c(),t.orientation()).includes(_.key)&&(_.stopPropagation(),_.preventDefault(),u().setFocused(!1),u().setFocusedKey(void 0),i.isOpen()||i.open("first"),i.focusContent(),i.listState().selectionManager().setFocused(!0),i.listState().selectionManager().setFocusedKey(h().getFirstKey())))};return Re(()=>{if(i.registerItemToParentDomCollection==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");const _=i.registerItemToParentDomCollection({ref:()=>e,type:"item",key:d(),textValue:o.textValue??e?.textContent??"",disabled:o.disabled??!1});Oe(_)}),Re(Mr(()=>i.parentMenuContext()?.pointerGraceTimeoutId(),_=>{Oe(()=>{window.clearTimeout(_),i.parentMenuContext()?.setPointerGraceIntent(null)})})),Re(()=>Oe(i.registerTriggerId(o.id))),Oe(()=>{l()}),m(zi,k({as:"div",ref(_){var w=qr(x=>{i.setTriggerRef(x),e=x},o.ref);typeof w=="function"&&w(_)},get id(){return o.id},role:"menuitem",get tabIndex(){return p.tabIndex()},"aria-haspopup":"true",get"aria-expanded"(){return i.isOpen()},get"aria-controls"(){return sn(()=>!!i.isOpen())()?i.contentId():void 0},get"aria-disabled"(){return o.disabled},get"data-key"(){return p.dataKey()},get"data-highlighted"(){return f()?"":void 0},get"data-disabled"(){return o.disabled?"":void 0},get onPointerDown(){return hs([o.onPointerDown,p.onPointerDown])},get onPointerUp(){return hs([o.onPointerUp,p.onPointerUp])},get onClick(){return hs([g,p.onClick])},get onKeyDown(){return hs([C,p.onKeyDown])},get onMouseDown(){return hs([o.onMouseDown,p.onMouseDown])},get onFocus(){return hs([o.onFocus,p.onFocus])},onPointerMove:v,onPointerLeave:y},()=>i.dataset(),s))}function not(n){const e=Cce(),t=`menu-${$s()}`,i=Pn({id:t,modal:!0},n),[r,o]=Je(i,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),s=u3({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:l=>r.onOpenChange?.(l)}),a={isModal:()=>r.modal??!0,preventScroll:()=>r.preventScroll??a.isModal(),forceMount:()=>r.forceMount??!1,generateId:bh(()=>r.id),value:()=>r.value,orientation:()=>r.orientation??e?.orientation()??"horizontal"};return m(Grt.Provider,{value:a,get children(){return m(tot,k({get open(){return s.isOpen()},get onOpenChange(){return s.setIsOpen}},o))}})}var u4i={};au(u4i,{Root:()=>nk,Separator:()=>h4i});function nk(n){let e;const t=Pn({orientation:"horizontal"},n),[i,r]=Je(t,["ref","orientation"]),o=$_(()=>e,()=>"hr");return m(zi,k({as:"hr",ref(s){var a=qr(l=>e=l,i.ref);typeof a=="function"&&a(s)},get role(){return o()!=="hr"?"separator":void 0},get"aria-orientation"(){return i.orientation==="vertical"?"vertical":void 0},get"data-orientation"(){return i.orientation}},r))}var h4i=nk,f4i={};au(f4i,{Arrow:()=>y2,CheckboxItem:()=>bce,Content:()=>iot,DropdownMenu:()=>xs,Group:()=>Qx,GroupLabel:()=>wce,Icon:()=>_ce,Item:()=>xce,ItemDescription:()=>Sce,ItemIndicator:()=>Mce,ItemLabel:()=>Lce,Portal:()=>Ice,RadioGroup:()=>Nce,RadioItem:()=>Ece,Root:()=>rot,Separator:()=>nk,Sub:()=>Tce,SubContent:()=>Ace,SubTrigger:()=>Dce,Trigger:()=>Xrt});function iot(n){const e=td(),t=Ah(),[i,r]=Je(n,["onCloseAutoFocus","onInteractOutside"]);let o=!1;return m(Jrt,k({onCloseAutoFocus:l=>{i.onCloseAutoFocus?.(l),o||Rs(t.triggerRef()),o=!1,l.preventDefault()},onInteractOutside:l=>{i.onInteractOutside?.(l),(!e.isModal()||l.detail.isContextMenu)&&(o=!0)}},r))}function rot(n){const e=`dropdownmenu-${$s()}`,t=Pn({id:e},n);return m(not,t)}var xs=Object.assign(rot,{Arrow:y2,CheckboxItem:bce,Content:iot,Group:Qx,GroupLabel:wce,Icon:_ce,Item:xce,ItemDescription:Sce,ItemIndicator:Mce,ItemLabel:Lce,Portal:Ice,RadioGroup:Nce,RadioItem:Ece,Separator:nk,Sub:Tce,SubContent:Ace,SubTrigger:Dce,Trigger:Xrt});function p4i(n){return m(xs,k(n,{"data-component":"dropdown-menu"}))}function g4i(n){const[e,t]=Je(n,["class","classList","children"]);return m(xs.Trigger,k(t,{"data-slot":"dropdown-menu-trigger",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function m4i(n){const[e,t]=Je(n,["class","classList","children"]);return m(xs.Icon,k(t,{"data-slot":"dropdown-menu-icon",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function v4i(n){return m(xs.Portal,n)}function y4i(n){const[e,t]=Je(n,["class","classList","children"]);return m(xs.Content,k(t,{"data-component":"dropdown-menu-content",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function k4i(n){const[e,t]=Je(n,["class","classList"]);return m(xs.Arrow,k(t,{"data-slot":"dropdown-menu-arrow",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}}}))}function C4i(n){const[e,t]=Je(n,["class","classList"]);return m(xs.Separator,k(t,{"data-slot":"dropdown-menu-separator",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}}}))}function b4i(n){const[e,t]=Je(n,["class","classList","children"]);return m(xs.Group,k(t,{"data-slot":"dropdown-menu-group",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function w4i(n){const[e,t]=Je(n,["class","classList","children"]);return m(xs.GroupLabel,k(t,{"data-slot":"dropdown-menu-group-label",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function _4i(n){const[e,t]=Je(n,["class","classList","children"]);return m(xs.Item,k(t,{"data-slot":"dropdown-menu-item",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function x4i(n){const[e,t]=Je(n,["class","classList","children"]);return m(xs.ItemLabel,k(t,{"data-slot":"dropdown-menu-item-label",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function S4i(n){const[e,t]=Je(n,["class","classList","children"]);return m(xs.ItemDescription,k(t,{"data-slot":"dropdown-menu-item-description",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function M4i(n){const[e,t]=Je(n,["class","classList","children"]);return m(xs.ItemIndicator,k(t,{"data-slot":"dropdown-menu-item-indicator",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function L4i(n){const[e,t]=Je(n,["class","classList","children"]);return m(xs.RadioGroup,k(t,{"data-slot":"dropdown-menu-radio-group",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function I4i(n){const[e,t]=Je(n,["class","classList","children"]);return m(xs.RadioItem,k(t,{"data-slot":"dropdown-menu-radio-item",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function N4i(n){const[e,t]=Je(n,["class","classList","children"]);return m(xs.CheckboxItem,k(t,{"data-slot":"dropdown-menu-checkbox-item",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function E4i(n){return m(xs.Sub,n)}function T4i(n){const[e,t]=Je(n,["class","classList","children"]);return m(xs.SubTrigger,k(t,{"data-slot":"dropdown-menu-sub-trigger",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function A4i(n){const[e,t]=Je(n,["class","classList","children"]);return m(xs.SubContent,k(t,{"data-component":"dropdown-menu-sub-content",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}const Un=Object.assign(p4i,{Trigger:g4i,Icon:m4i,Portal:v4i,Content:y4i,Arrow:k4i,Separator:C4i,Group:b4i,GroupLabel:w4i,Item:_4i,ItemLabel:x4i,ItemDescription:S4i,ItemIndicator:M4i,RadioGroup:L4i,RadioItem:I4i,CheckboxItem:N4i,Sub:E4i,SubTrigger:T4i,SubContent:A4i});var D4i=le("<div>"),Rce=class{x;y;width;height;constructor(e){this.x=Math.floor(e.x),this.y=Math.floor(e.y),this.width=Math.floor(e.width),this.height=Math.floor(e.height)}get rect(){return{x:this.x,y:this.y,width:this.width,height:this.height}}get left(){return this.x}get top(){return this.y}get right(){return this.x+this.width}get bottom(){return this.y+this.height}get center(){return{x:this.x+this.width*.5,y:this.y+this.height*.5}}get corners(){return{topLeft:{x:this.left,y:this.top},topRight:{x:this.right,y:this.top},bottomRight:{x:this.left,y:this.bottom},bottomLeft:{x:this.right,y:this.bottom}}}},av=n=>{let e=new Rce(n.getBoundingClientRect());const{transform:t}=getComputedStyle(n);return t&&(e=R4i(e,t)),e},R4i=(n,e)=>{let t,i;if(e.startsWith("matrix3d(")){const r=e.slice(9,-1).split(/, /);t=+r[12],i=+r[13]}else if(e.startsWith("matrix(")){const r=e.slice(7,-1).split(/, /);t=+r[4],i=+r[5]}else t=0,i=0;return new Rce({...n,x:n.x-t,y:n.y-i})},Vd=()=>({x:0,y:0}),Nke=(n,e)=>n.x===e.x&&n.y===e.y,jhe=(n,e)=>new Rce({...n,x:n.x+e.x,y:n.y+e.y}),P4i=(n,e)=>Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2)),O4i=(n,e)=>{const t=Math.max(n.top,e.top),i=Math.max(n.left,e.left),r=Math.min(n.right,e.right),o=Math.min(n.bottom,e.bottom),s=r-i,a=o-t;if(i<r&&t<o){const l=n.width*n.height,c=e.width*e.height,d=s*a;return d/(l+c-d)}return 0},Whe=(n,e)=>n.x===e.x&&n.y===e.y&&n.width===e.width&&n.height===e.height,oot=(n,e,t)=>{const i=n.transformed.center,r={distance:1/0,droppable:null};for(const o of e){const s=P4i(i,o.layout.center);s<r.distance?(r.distance=s,r.droppable=o):s===r.distance&&o.id===t.activeDroppableId&&(r.droppable=o)}return r.droppable},V4i=(n,e,t)=>{const i=n.transformed,r={ratio:0,droppable:null};for(const o of e){const s=O4i(i,o.layout);s>r.ratio?(r.ratio=s,r.droppable=o):s>0&&s===r.ratio&&o.id===t.activeDroppableId&&(r.droppable=o)}return r.droppable},sot=oi(),aot=n=>{const e=k({collisionDetector:V4i},n),[t,i]=Yt({draggables:{},droppables:{},sensors:{},active:{draggableId:null,get draggable(){return t.active.draggableId!==null?t.draggables[t.active.draggableId]:null},droppableId:null,get droppable(){return t.active.droppableId!==null?t.droppables[t.active.droppableId]:null},sensorId:null,get sensor(){return t.active.sensorId!==null?t.sensors[t.active.sensorId]:null},overlay:null}}),r=(R,P,V)=>{R.substring(0,R.length-1),Mn(()=>t[R][P])&&i(R,P,"transformers",V.id,V)},o=(R,P,V)=>{R.substring(0,R.length-1),Mn(()=>t[R][P])&&Mn(()=>t[R][P].transformers[V])&&i(R,P,"transformers",V,void 0)},s=({id:R,node:P,layout:V,data:$})=>{const j=t.draggables[R],B={id:R,node:P,layout:V,data:$,_pendingCleanup:!1};let te;if(!j)Object.defineProperties(B,{transformers:{enumerable:!0,configurable:!0,writable:!0,value:{}},transform:{enumerable:!0,configurable:!0,get:()=>{if(t.active.overlay)return Vd();const U=Object.values(t.draggables[R].transformers);return U.sort((Y,X)=>Y.order-X.order),U.reduce((Y,X)=>X.callback(Y),Vd())}},transformed:{enumerable:!0,configurable:!0,get:()=>jhe(t.draggables[R].layout,t.draggables[R].transform)}});else if(t.active.draggableId===R&&!t.active.overlay){const U={x:j.layout.x-V.x,y:j.layout.y-V.y},Y="addDraggable-existing-offset",X=j.transformers[Y],se=X?X.callback(U):U;te={id:Y,order:100,callback:pe=>({x:pe.x+se.x,y:pe.y+se.y})},A(()=>o("draggables",R,Y))}pn(()=>{i("draggables",R,B),te&&r("draggables",R,te)}),t.active.draggable&&w()},a=R=>{Mn(()=>t.draggables[R])&&(i("draggables",R,"_pendingCleanup",!0),queueMicrotask(()=>l(R)))},l=R=>{if(t.draggables[R]?._pendingCleanup){const P=t.active.draggableId===R;pn(()=>{P&&i("active","draggableId",null),i("draggables",R,void 0)})}},c=({id:R,node:P,layout:V,data:$})=>{const j=t.droppables[R],B={id:R,node:P,layout:V,data:$,_pendingCleanup:!1};j||Object.defineProperties(B,{transformers:{enumerable:!0,configurable:!0,writable:!0,value:{}},transform:{enumerable:!0,configurable:!0,get:()=>{const te=Object.values(t.droppables[R].transformers);return te.sort((U,Y)=>U.order-Y.order),te.reduce((U,Y)=>Y.callback(U),Vd())}},transformed:{enumerable:!0,configurable:!0,get:()=>jhe(t.droppables[R].layout,t.droppables[R].transform)}}),i("droppables",R,B),t.active.draggable&&w()},d=R=>{Mn(()=>t.droppables[R])&&(i("droppables",R,"_pendingCleanup",!0),queueMicrotask(()=>u(R)))},u=R=>{if(t.droppables[R]?._pendingCleanup){const P=t.active.droppableId===R;pn(()=>{P&&i("active","droppableId",null),i("droppables",R,void 0)})}},h=({id:R,activators:P})=>{i("sensors",R,{id:R,activators:P,coordinates:{origin:{x:0,y:0},current:{x:0,y:0},get delta(){return{x:t.sensors[R].coordinates.current.x-t.sensors[R].coordinates.origin.x,y:t.sensors[R].coordinates.current.y-t.sensors[R].coordinates.origin.y}}}})},f=R=>{if(!Mn(()=>t.sensors[R]))return;const P=t.active.sensorId===R;pn(()=>{P&&i("active","sensorId",null),i("sensors",R,void 0)})},p=({node:R,layout:P})=>{const V=t.active.overlay,$={node:R,layout:P};V||Object.defineProperties($,{id:{enumerable:!0,configurable:!0,get:()=>t.active.draggable?.id},data:{enumerable:!0,configurable:!0,get:()=>t.active.draggable?.data},transformers:{enumerable:!0,configurable:!0,get:()=>Object.fromEntries(Object.entries(t.active.draggable?t.active.draggable.transformers:{}).filter(([j])=>j!=="addDraggable-existing-offset"))},transform:{enumerable:!0,configurable:!0,get:()=>{const j=Object.values(t.active.overlay?t.active.overlay.transformers:[]);return j.sort((B,te)=>B.order-te.order),j.reduce((B,te)=>te.callback(B),Vd())}},transformed:{enumerable:!0,configurable:!0,get:()=>t.active.overlay?jhe(t.active.overlay.layout,t.active.overlay.transform):new Rce({x:0,y:0,width:0,height:0})}}),i("active","overlay",$)},g=()=>i("active","overlay",null),v=(R,P)=>{pn(()=>{i("sensors",R,"coordinates",{origin:{...P},current:{...P}}),i("active","sensorId",R)})},y=R=>{const P=t.active.sensorId;P&&i("sensors",P,"coordinates","current",{...R})},C=()=>i("active","sensorId",null),_=(R,P)=>{const V={};for(const j of Object.values(t.sensors))if(j)for(const[B,te]of Object.entries(j.activators))V[B]??=[],V[B].push({sensor:j,activator:te});const $={};for(const j in V){let B=j;P&&(B=`on${j}`),$[B]=te=>{for(const{activator:U}of V[j]){if(t.active.sensor)break;U(te,R)}}}return $},w=()=>{let R=!1;const P=Object.values(t.draggables),V=Object.values(t.droppables),$=t.active.overlay;return pn(()=>{const j=new WeakMap;for(const B of P)if(B){const te=B.layout;j.has(B.node)||j.set(B.node,av(B.node));const U=j.get(B.node);Whe(te,U)||(i("draggables",B.id,"layout",U),R=!0)}for(const B of V)if(B){const te=B.layout;j.has(B.node)||j.set(B.node,av(B.node));const U=j.get(B.node);Whe(te,U)||(i("droppables",B.id,"layout",U),R=!0)}if($){const B=$.layout,te=av($.node);Whe(B,te)||(i("active","overlay","layout",te),R=!0)}}),R},x=()=>{const R=t.active.overlay??t.active.draggable;if(R){const P=e.collisionDetector(R,Object.values(t.droppables),{activeDroppableId:t.active.droppableId}),V=P?P.id:null;t.active.droppableId!==V&&i("active","droppableId",V)}},M=R=>{const P={id:"sensorMove",order:0,callback:V=>t.active.sensor?{x:V.x+t.active.sensor.coordinates.delta.x,y:V.y+t.active.sensor.coordinates.delta.y}:V};w(),pn(()=>{i("active","draggableId",R),r("draggables",R,P)}),x()},L=()=>{const R=Mn(()=>t.active.draggableId);pn(()=>{R!==null&&o("draggables",R,"sensorMove"),i("active",["draggableId","droppableId"],null)}),w()},S=R=>{Re(()=>{const P=t.active.draggable;P&&Mn(()=>R({draggable:P}))})},I=R=>{Re(()=>{const P=t.active.draggable;if(P){const V=Mn(()=>t.active.overlay);Object.values(V?V.transform:P.transform),Mn(()=>R({draggable:P,overlay:V}))}})},E=R=>{Re(()=>{const P=t.active.draggable,V=t.active.droppable;P&&Mn(()=>R({draggable:P,droppable:V,overlay:t.active.overlay}))})},A=R=>{Re(({previousDraggable:P,previousDroppable:V,previousOverlay:$})=>{const j=t.active.draggable,B=j?t.active.droppable:null,te=j?t.active.overlay:null;return!j&&P&&Mn(()=>R({draggable:P,droppable:V,overlay:$})),{previousDraggable:j,previousDroppable:B,previousOverlay:te}},{previousDraggable:null,previousDroppable:null,previousOverlay:null})};I(()=>x()),e.onDragStart&&S(e.onDragStart),e.onDragMove&&I(e.onDragMove),e.onDragOver&&E(e.onDragOver),e.onDragEnd&&A(e.onDragEnd);const D=[t,{addTransformer:r,removeTransformer:o,addDraggable:s,removeDraggable:a,addDroppable:c,removeDroppable:d,addSensor:h,removeSensor:f,setOverlay:p,clearOverlay:g,recomputeLayouts:w,detectCollisions:x,draggableActivators:_,sensorStart:v,sensorMove:y,sensorEnd:C,dragStart:M,dragEnd:L,onDragStart:S,onDragMove:I,onDragOver:E,onDragEnd:A}];return m(sot.Provider,{value:D,get children(){return e.children}})},W3=()=>Wn(sot)||null,H4i=(n="pointer-sensor")=>{const[e,{addSensor:t,removeSensor:i,sensorStart:r,sensorMove:o,sensorEnd:s,dragStart:a,dragEnd:l}]=W3(),c=250,d=10;ur(()=>{t({id:n,activators:{pointerdown:g}})}),Oe(()=>{i(n)});const u=()=>e.active.sensorId===n,h={x:0,y:0};let f=null,p=null;const g=(x,M)=>{x.button===0&&(document.addEventListener("pointermove",C),document.addEventListener("pointerup",_),p=M,h.x=x.clientX,h.y=x.clientY,f=window.setTimeout(y,c))},v=()=>{f&&(clearTimeout(f),f=null),document.removeEventListener("pointermove",C),document.removeEventListener("pointerup",_),document.removeEventListener("selectionchange",w)},y=()=>{e.active.sensor?u()||v():(r(n,h),a(p),w(),document.addEventListener("selectionchange",w))},C=x=>{const M={x:x.clientX,y:x.clientY};if(!e.active.sensor){const L={x:M.x-h.x,y:M.y-h.y};Math.sqrt(L.x**2+L.y**2)>d&&y()}u()&&(x.preventDefault(),o(M))},_=x=>{v(),u()&&(x.preventDefault(),l(),s())},w=()=>{window.getSelection()?.removeAllRanges()}},lot=n=>(H4i(),sn(()=>n.children)),Pce=n=>({transform:`translate3d(${n.x}px, ${n.y}px, 0)`}),$4i=(n,e={})=>{const[t,{addDraggable:i,removeDraggable:r,draggableActivators:o}]=W3(),[s,a]=Ye(null);ur(()=>{const u=s();u&&i({id:n,node:u,layout:av(u),data:e})}),Oe(()=>r(n));const l=()=>t.active.draggableId===n,c=()=>t.draggables[n]?.transform||Vd();return Object.defineProperties((u,h)=>{const f=h?h():{};Re(()=>{const p=s(),g=o(n);if(p)for(const v in g)p.addEventListener(v,g[v]);Oe(()=>{if(p)for(const v in g)p.removeEventListener(v,g[v])})}),a(u),f.skipTransform||Re(()=>{const p=c();if(Nke(p,Vd()))u.style.removeProperty("transform");else{const g=Pce(c());u.style.setProperty("transform",g.transform??null)}})},{ref:{enumerable:!0,value:a},isActiveDraggable:{enumerable:!0,get:l},dragActivators:{enumerable:!0,get:()=>o(n,!0)},transform:{enumerable:!0,get:c}})},F4i=(n,e={})=>{const[t,{addDroppable:i,removeDroppable:r}]=W3(),[o,s]=Ye(null);ur(()=>{const d=o();d&&i({id:n,node:d,layout:av(d),data:e})}),Oe(()=>r(n));const a=()=>t.active.droppableId===n,l=()=>t.droppables[n]?.transform||Vd();return Object.defineProperties((d,u)=>{const h=u?u():{};s(d),h.skipTransform||Re(()=>{const f=l();if(Nke(f,Vd()))d.style.removeProperty("transform");else{const p=Pce(l());d.style.setProperty("transform",p.transform??null)}})},{ref:{enumerable:!0,value:s},isActiveDroppable:{enumerable:!0,get:a},transform:{enumerable:!0,get:l}})},cot=n=>{const[e,{onDragStart:t,onDragEnd:i,setOverlay:r,clearOverlay:o}]=W3();let s;t(({draggable:l})=>{r({node:l.node,layout:l.layout}),queueMicrotask(()=>{if(s){const c=av(s),d={x:(l.layout.width-c.width)/2,y:(l.layout.height-c.height)/2};c.x+=d.x,c.y+=d.y,r({node:s,layout:c})}})}),i(()=>queueMicrotask(o));const a=()=>{const l=e.active.overlay,c=e.active.draggable;return!l||!c?{}:{position:"fixed",transition:"transform 0s",top:`${l.layout.top}px`,left:`${l.layout.left}px`,"min-width":`${c.layout.width}px`,"min-height":`${c.layout.height}px`,...Pce(l.transform),...n.style}};return m(d3,{get mount(){return document.body},get children(){return m(_e,{get when(){return e.active.draggable},get children(){var l=D4i(),c=s;return typeof c=="function"?aa(c,l):s=l,W(l,(()=>{var d=sn(()=>typeof n.children=="function");return()=>d()?n.children(e.active.draggable):n.children})()),st(d=>{var u=n.class,h=a();return u!==d.e&&H1(l,d.e=u),d.t=sse(l,h,d.t),d},{e:void 0,t:void 0}),l}})}})},z4i=(n,e,t)=>{const i=n.slice();return i.splice(t,0,...i.splice(e,1)),i},dot=oi(),uot=n=>{const[e]=W3(),[t,i]=Yt({initialIds:[],sortedIds:[]}),r=a=>a>=0&&a<t.initialIds.length;Re(()=>{i("initialIds",[...n.ids]),i("sortedIds",[...n.ids])}),Re(()=>{e.active.draggableId&&e.active.droppableId?Mn(()=>{const a=t.sortedIds.indexOf(e.active.draggableId),l=t.initialIds.indexOf(e.active.droppableId);if(!r(a)||!r(l))i("sortedIds",[...n.ids]);else if(a!==l){const c=z4i(t.sortedIds,a,l);i("sortedIds",c)}}):i("sortedIds",[...n.ids])});const s=[t,{}];return m(dot.Provider,{value:s,get children(){return n.children}})},B4i=()=>Wn(dot)||null,j4i=(n,e)=>t=>{n(t),e(t)},hot=(n,e={})=>{const[t,{addTransformer:i,removeTransformer:r}]=W3(),[o]=B4i(),s=$4i(n,e),a=F4i(n,e),l=j4i(s.ref,a.ref),c=()=>o.initialIds.indexOf(n),d=()=>o.sortedIds.indexOf(n),u=v=>t.droppables[v]?.layout||null,h=()=>{const v=Vd(),y=c(),C=d();if(C!==y){const _=u(n),w=u(o.initialIds[C]);_&&w&&(v.x=w.x-_.x,v.y=w.y-_.y)}return v},f={id:"sortableOffset",order:100,callback:v=>{const y=h();return{x:v.x+y.x,y:v.y+y.y}}};ur(()=>i("droppables",n,f)),Oe(()=>r("droppables",n,f.id));const p=()=>(n===t.active.draggableId&&!t.active.overlay?t.draggables[n]?.transform:t.droppables[n]?.transform)||Vd();return Object.defineProperties(v=>{s(v,()=>({skipTransform:!0})),a(v,()=>({skipTransform:!0})),Re(()=>{const y=p();if(Nke(y,Vd()))v.style.removeProperty("transform");else{const C=Pce(p());v.style.setProperty("transform",C.transform??null)}})},{ref:{enumerable:!0,value:l},transform:{enumerable:!0,get:p},isActiveDraggable:{enumerable:!0,get:()=>s.isActiveDraggable},dragActivators:{enumerable:!0,get:()=>s.dragActivators},isActiveDroppable:{enumerable:!0,get:()=>a.isActiveDroppable}})};function W4i(n){const e={locs:[],timer:void 0,pending:void 0,over:void 0,last:void 0},t=n.delay??250,i=n.max??4,r=n.tolerance??80,o=n.edge??18,s=()=>{e.timer!==void 0&&clearTimeout(e.timer),e.timer=void 0,e.pending=void 0},a=()=>{s(),e.over=void 0,e.last=void 0,e.locs.length=0},l=p=>{if(!n.enabled())return;const g=n.el();if(!g)return;const v=g.getBoundingClientRect(),y=p.clientX,C=p.clientY;y<v.left||y>v.right||C<v.top||C>v.bottom||(e.locs.push({x:y,y:C}),e.locs.length>i&&e.locs.shift())},c=()=>{if(!n.enabled()||!n.active())return 0;const p=n.el();if(!p||e.locs.length<2)return 0;const g=p.getBoundingClientRect(),v=e.locs[e.locs.length-1];if(!v)return 0;const y=e.locs[0]??v;if(y.x<g.left||y.x>g.right||y.y<g.top||y.y>g.bottom||e.last&&v.x===e.last.x&&v.y===e.last.y)return 0;if(g.right-v.x<=o)return e.last=v,t;const C={x:g.right,y:g.top-r},_={x:g.right,y:g.bottom+r},w=(I,E)=>(E.y-I.y)/(E.x-I.x),x=w(v,C),M=w(v,_),L=w(y,C),S=w(y,_);return x<L&&M>S?(e.last=v,t):(e.last=void 0,0)},d=p=>{s(),n.onActivate(p)},u=p=>{if(!p||n.active()===p)return;if(!n.active()){d(p);return}const g=c();if(g===0){d(p);return}s(),e.pending=p,e.timer=window.setTimeout(()=>{e.timer=void 0,e.pending===p&&(e.pending=void 0,n.enabled()&&n.active()&&e.over===p&&n.onActivate(p))},g)};return{move:l,enter:(p,g)=>{n.enabled()&&(e.over=p,l(g),u(p))},leave:p=>{e.over===p&&(e.over=void 0),e.pending===p&&s()},activate:d,request:u,cancel:s,reset:a}}let u5e;const q4i=n=>{u5e=n},U4i=n=>{if(window.focus(),!!n){if(u5e)return u5e(n);console.warn("notification-click: navigate function not set, falling back to window.location.assign"),window.location.assign(n)}},iC=n=>n.replace(/[\\/]+$/,""),M8=new Map,L8=new Map;function Z4i(){const n={resolve:t=>{}};return{promise:new Promise(t=>{n.resolve=t}),resolve:n.resolve}}const EL={get(n){return M8.get(iC(n))},pending(n){const e=iC(n),t=M8.get(e);t&&t.status!=="pending"||M8.set(e,{status:"pending"})},ready(n){const e=iC(n),t={status:"ready"};M8.set(e,t);const i=L8.get(e);i&&(L8.delete(e),i.resolve(t))},failed(n,e){const t=iC(n),i={status:"failed",message:e};M8.set(t,i);const r=L8.get(t);r&&(L8.delete(t),r.resolve(i))},wait(n){const e=iC(n),t=M8.get(e);if(t&&t.status!=="pending")return Promise.resolve(t);const i=L8.get(e);if(i)return i.promise;const r=Z4i();return L8.set(e,r),r.promise}},K4i=40,R_={session:new Map,terminal:new Map},fot=(n,e,t)=>{for(n.delete(e),n.set(e,t);n.size>K4i;){const i=n.keys().next().value;if(i===void 0)return;n.delete(i)}},G4i=(n,e)=>{const t=R_.session.get(n)??{prompt:"",files:{}};fot(R_.session,n,{...t,...e})},cyi=n=>R_.session.get(n),dyi=(n,e)=>{fot(R_.terminal,n,e)},uyi=n=>R_.terminal.get(n),X4i=n=>typeof n!="object"||n===null?!1:"draggable"in n,tse=n=>{if(!X4i(n))return;const e=n.draggable;if(e)return typeof e.id=="string"?e.id:void 0},Y4i=(n,e)=>({id:n,order:100,callback:t=>e==="x"?{...t,x:0}:{...t,y:0}}),pot=(n,e)=>()=>{const t=W3();if(!t)return null;const[,{onDragStart:i,onDragEnd:r,addTransformer:o,removeTransformer:s}]=t,a=Y4i(e,n),l=sa(c=>(i(d=>{const u=tse(d);u&&o("draggables",u,a)}),r(d=>{const u=tse(d);u&&s("draggables",u,a.id)}),c));return Oe(l),null},got=pot("x","constrain-x-axis"),hyi=pot("y","constrain-y-axis"),Eke=100;function J4i(n,e,t=Eke){if(!n.stack.length){const r=e==="/"?["/"]:["/",e];return{stack:r,index:r.length-1,action:void 0}}const i=n.stack[n.index];return e===i?n.action?{...n,action:void 0}:n:n.action?{...n,action:void 0}:Q4i(n,e,t)}function Q4i(n,e,t=Eke){const i=n.stack.slice(0,n.index+1).concat(e),r=e5i(i,i.length-1,t);return{...n,...r,action:void 0}}function e5i(n,e,t=Eke){if(n.length<=t)return{stack:n,index:e};const i=n.length-t;return{stack:n.slice(i),index:Math.max(0,e-i)}}function t5i(n){if(n.index<=0)return;const e=n.index-1,t=n.stack[e];if(t)return{state:{...n,index:e,action:"back"},to:t}}function n5i(n){if(n.index>=n.stack.length-1)return;const e=n.index+1,t=n.stack[e];if(t)return{state:{...n,index:e,action:"forward"},to:t}}function i5i(){const n=kMn(),e=_3(),t=()=>n?.agent.current()?.name;return m(oa,{icon:"bot",size:"small",get variant(){return e.session.opened()?"primary":"ghost"},class:"w-6 h-6 rounded-full shrink-0 transition-colors",get classList(){return{"bg-surface-raised-base text-text-base shadow-[0_0_0_1px_var(--border-base)]":e.session.opened(),"text-icon-weak hover:text-icon-base hover:bg-surface-base":!e.session.opened()}},get title(){return sn(()=>!!t())()?`${t()} mode`:"No agent active"},onClick:()=>e.session.toggle()})}var r5i=le('<div class="h-full shrink-0">'),o5i=le('<div class="hidden w-8 shrink-0 items-center justify-center lg:flex sm:w-10 xl:hidden">'),s5i=le('<div class="hidden w-8 shrink-0 items-center justify-center sm:mr-2 lg:flex xl:hidden">'),a5i=le('<div class="flex items-center shrink-0"><svg width=18 height=18 viewBox="0 0 800 800"fill=none xmlns=http://www.w3.org/2000/svg class=shrink-0><path d="M373.362 226.643C388.087 211.919 411.96 211.919 426.684 226.643L573.37 373.324C588.094 388.047 588.094 411.92 573.37 426.644L426.684 573.324C411.96 588.048 388.087 588.048 373.362 573.324L226.677 426.644C211.952 411.92 211.952 388.047 226.677 373.324L373.362 226.643Z"fill=currentColor class=text-text-base></path><path d="M586.658 513.282C594.02 505.921 605.956 505.921 613.318 513.282L686.659 586.621C694.021 593.983 694.021 605.919 686.659 613.28L613.318 686.619C605.956 693.981 594.02 693.981 586.658 686.619L513.317 613.28C505.955 605.919 505.955 593.983 513.317 586.621L586.658 513.282Z"fill=currentColor class=text-text-base></path><path d="M286.501 586.454C293.957 593.909 293.957 605.997 286.501 613.453L213.5 686.452C206.044 693.907 193.956 693.907 186.5 686.452L113.499 613.453C106.043 605.997 106.043 593.909 113.499 586.454L186.5 513.455C193.956 506 206.044 506 213.5 513.455L286.501 586.454Z"fill=currentColor class=text-text-base></path><path d="M406.524 93.4982C402.934 97.088 397.113 97.088 393.523 93.4982L356.523 56.499C352.933 52.9092 352.933 47.089 356.523 43.4992L393.523 6.50002C397.113 2.91025 402.934 2.91025 406.524 6.50003L443.524 43.4992C447.114 47.089 447.114 52.9092 443.524 56.499L406.524 93.4982Z"fill=currentColor class=text-text-base></path><path d="M186.502 113.498C193.958 106.042 206.046 106.042 213.502 113.498L286.503 186.496C293.959 193.952 293.959 206.04 286.503 213.496L213.502 286.494C206.046 293.95 193.958 293.95 186.502 286.494L113.501 213.496C106.045 206.04 106.045 193.952 113.501 186.496L186.502 113.498Z"fill=currentColor class=text-text-base></path><path d="M686.499 186.483C693.955 193.939 693.955 206.027 686.499 213.482L613.498 286.481C606.042 293.937 593.954 293.937 586.498 286.481L513.497 213.482C506.041 206.027 506.041 193.939 513.497 186.483L586.498 113.484C593.954 106.029 606.042 106.029 613.498 113.484L686.499 186.483Z"fill=currentColor class=text-text-base></path><path d="M356.689 756.666C353.007 752.985 353.007 747.017 356.689 743.336L393.359 706.667C397.04 702.986 403.008 702.986 406.689 706.667L443.359 743.336C447.041 747.017 447.041 752.985 443.359 756.666L406.689 793.335C403.008 797.016 397.04 797.016 393.359 793.335L356.689 756.666Z"fill=currentColor class=text-text-base>'),l5i=le('<span class="truncate opacity-70">'),c5i=le('<div data-tauri-decorum-tb class="flex flex-row">'),d5i=le('<header class="h-12 shrink-0 bg-transparent relative grid grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center"data-tauri-drag-region><div><div class="flex items-center gap-1 min-w-0 ml-1 px-1 sm:gap-2 sm:ml-2 sm:px-2"></div><div id=opencode-titlebar-left class="flex items-center gap-1 sm:gap-2"></div></div><div class="min-w-0 flex items-center justify-center pointer-events-none"><div class="pointer-events-auto min-w-0 flex items-center justify-center w-fit max-w-full"><div id=opencode-titlebar-center class="min-w-0 flex justify-center"></div></div></div><div data-tauri-drag-region><div id=opencode-titlebar-right class="flex items-center gap-1 sm:gap-2"></div><div class="flex items-center gap-3 sm:gap-3">'),u5i=le('<div class="w-36 shrink-0">');const Tke=()=>window.__TAURI__,h5i=()=>Tke()?.window?.getCurrentWindow?.(),f5i=()=>Tke()?.webviewWindow?.getCurrentWebviewWindow?.();function p5i(){const n=_3(),e=a2(),t=sze(),i=ha(),r=qse(),o=oy(),s=k3(),a=vy(),l=Aa();function c(){z(async()=>{const{DialogCreateProject:A}=await import("./dialog-create-project-umYA5dgr.js");return{DialogCreateProject:A}},[]).then(({DialogCreateProject:A})=>{o.show(()=>m(A,{onSelect:T=>{if(!T)return;const D=Array.isArray(T)?T[0]:T;D&&(n.projects.open(D),s(`/${ri(D)}/session`))}}))})}function d(){z(async()=>{const{DialogCloneProject:A}=await import("./dialog-clone-project-DdL1b96k.js");return{DialogCloneProject:A}},[]).then(({DialogCloneProject:A})=>{o.show(()=>m(A,{onSelect:T=>{T&&(n.projects.open(T),s(`/${ri(T)}/session`))}}))})}const u=J(()=>e.platform==="desktop"&&e.os==="macos"),h=J(()=>e.platform==="desktop"&&e.os==="windows"),f=()=>e.webviewZoom?.()??1,p=()=>u()?`${40/f()}px`:void 0,[g,v]=Yt({stack:[],index:0,action:void 0}),y=()=>`${a.pathname}${a.search}${a.hash}`;Re(()=>{const A=y();Mn(()=>{const T=J4i(g,A);T!==g&&v(T)})});const C=J(()=>n.projects.list().length>0),_=J(()=>n.projects.list().find(A=>ri(A.worktree)===l.dir)),w=J(()=>{const A=_();return A?A.worktree:i.t("command.project.open")}),x=()=>{const A=t5i(g);A&&(v(A.state),s(A.to))},M=()=>{const A=n5i(g);A&&(v(A.state),s(A.to))};t.register(()=>[{id:"common.goBack",title:i.t("common.goBack"),category:i.t("command.category.view"),keybind:"mod+[",onSelect:x},{id:"common.goForward",title:i.t("common.goForward"),category:i.t("command.category.view"),keybind:"mod+]",onSelect:M}]);const L=()=>{if(e.platform==="desktop")return h5i()};Re(()=>{if(e.platform!=="desktop")return;const A=r.colorScheme(),T=A==="system"?null:A,D=f5i();D?.setTheme&&D.setTheme(T).catch(()=>{})});const S=A=>A instanceof Element?!!A.closest("button, a, input, textarea, select, option, [role='button'], [role='menuitem'], [contenteditable='true'], [contenteditable='']"):!1,I=A=>{if(e.platform!=="desktop"||A.buttons!==1||S(A.target))return;const T=L();T?.startDragging&&(A.preventDefault(),T.startDragging().catch(()=>{}))},E=A=>{if(e.platform!=="desktop"||S(A.target)||A.target instanceof Element&&A.target.closest("[data-tauri-decorum-tb]"))return;const T=L();T?.toggleMaximize&&(A.preventDefault(),T.toggleMaximize().catch(()=>{}))};return(()=>{var A=d5i(),T=A.firstChild,D=T.firstChild,R=T.nextSibling,P=R.nextSibling,V=P.firstChild,$=V.nextSibling;return A.$$dblclick=E,A.$$mousedown=I,W(T,m(_e,{get when(){return u()},get children(){return[(()=>{var j=r5i();return st(B=>Sr(j,"width",`${72/f()}px`)),j})(),(()=>{var j=o5i();return W(j,m(oa,{icon:"menu",variant:"ghost",class:"titlebar-icon rounded-md",get onClick(){return n.mobileSidebar.toggle},get"aria-label"(){return i.t("sidebar.menu.toggle")},get"aria-expanded"(){return n.mobileSidebar.opened()}})),j})()]}}),D),W(T,m(_e,{get when(){return!u()},get children(){var j=s5i();return W(j,m(oa,{icon:"menu",variant:"ghost",class:"titlebar-icon rounded-md",get onClick(){return n.mobileSidebar.toggle},get"aria-label"(){return i.t("sidebar.menu.toggle")},get"aria-expanded"(){return n.mobileSidebar.opened()}})),j}}),D),W(D,m(_e,{get when(){return!ih()},get children(){return m(_e,{get when(){return C()||!0},get children(){return[a5i(),m(Un,{placement:"bottom",gutter:4,modal:!1,get children(){return[m(Un.Trigger,{as:to,variant:"ghost",size:"small",class:"flex h-7 min-w-0 max-w-[128px] items-center gap-1.5 rounded-md px-1.5 font-mono text-[11px] text-text-base hover:bg-white/5 sm:max-w-[280px] sm:px-2 lg:max-w-[360px] xl:max-w-[520px]",get title(){return w()},get children(){return[m(Cn,{name:"folder-add-left",size:"small",class:"shrink-0 text-text-weak",style:{"font-size":"12px"}}),(()=>{var j=l5i();return W(j,w),j})(),m(Cn,{name:"chevron-down",size:"small",class:"shrink-0 text-icon-weak"})]}}),m(Un.Portal,{get children(){return m(Un.Content,{class:"min-w-[180px]",get children(){return[m(_e,{get when(){return!ih()},get children(){return[m(ei,{get each(){return n.projects.list()},children:j=>m(Un.Item,{onSelect:()=>s(`/${ri(j.worktree)}/session`),get children(){return m(Un.ItemLabel,{get children(){return j.name||Ds(j.worktree)}})}})}),m(Un.Separator,{}),m(Un.Item,{onSelect:()=>t.trigger("project.open"),get children(){return m(Un.ItemLabel,{get children(){return i.t("command.project.open")}})}}),m(Un.Separator,{}),m(Un.Sub,{get children(){return[m(Un.SubTrigger,{get children(){return i.t("command.project.new")}}),m(Un.SubContent,{get children(){return[m(Un.Item,{onSelect:c,get children(){return m(Un.ItemLabel,{get children(){return i.t("command.project.newBlank")}})}}),m(Un.Item,{onSelect:d,get children(){return m(Un.ItemLabel,{get children(){return i.t("command.project.importGitHub")}})}})]}})]}})]}}),m(_e,{get when(){return ih()},get children(){return m(Un.Item,{onSelect:uMn,get children(){return m(Un.ItemLabel,{children:"Exit to Trellis Cloud"})}})}})]}})}})]}})]}})}})),P.$$mousedown=I,W($,m(Ort,{placement:"bottom",get title(){return i.t("sidebar.settings")},get keybind(){return t.keybind("settings.open")??""},get children(){return m(to,{variant:"ghost",class:"titlebar-icon w-8 h-6 p-0 box-border shrink-0",onClick:()=>t.trigger("settings.open"),get"aria-label"(){return i.t("sidebar.settings")},get children(){return m(Cn,{size:"small",name:"settings-gear"})}})}}),null),W($,m(i5i,{}),null),W(P,m(_e,{get when(){return h()},get children(){return[sn(()=>sn(()=>!Tke())()&&u5i()),c5i()]}}),null),st(j=>{var B=p(),te={"flex items-center min-w-0":!0,"pl-2":!u()},U={"flex items-center min-w-0 justify-end":!0,"pr-2":!h()};return B!==j.e&&Sr(A,"min-height",j.e=B),j.t=Ko(T,te,j.t),j.a=Ko(P,U,j.a),j},{e:void 0,t:void 0,a:void 0}),A})()}Fs(["mousedown","dblclick"]);const rn=n=>{if(!n)return"";const e=n.replaceAll("\\","/"),t=e.match(/^([A-Za-z]:)\/+$/);return t?`${t[1]}/`:/^\/+$/i.test(e)?"/":e.replace(/\/+$/,"")};function mot(n){const e=n-6e4;return(t,i)=>{const r=t.time?.updated??t.time?.created??0,o=i.time?.updated??i.time?.created??0,s=r>e,a=o>e;return s&&a?t.id<i.id?-1:t.id>i.id?1:0:s&&!a?-1:!s&&a?1:o-r}}const g5i=(n,e)=>rn(n.directory)===rn(e)&&!n.parentID&&!n.time?.archived,vot=n=>(n.session??[]).filter(e=>g5i(e,n.path.directory)),P_=(n,e)=>vot(n).sort(mot(e)),iRe=(n,e)=>n.flatMap(vot).sort(mot(e))[0];function m5i(n,e=()=>!0){return Object.values(n??{}).some(t=>t?.some(e))}const nse=n=>{const e=new Map;for(const t of n??[]){if(!t.parentID)continue;const i=e.get(t.parentID);if(i){i.push(t.id);continue}e.set(t.parentID,[t.id])}return e},Ake=n=>n.name||Ds(n.worktree),TL=(n,e)=>{if(n&&typeof n=="object"&&"data"in n){const t=n.data;if(t?.message)return t.message}return n instanceof Error?n.message:e},AL=(n,e,t)=>{const i=rn(n),r=new Map;for(const s of e){const a=rn(s);a!==i&&(r.has(a)||r.set(a,s))}if(!t?.length)return[n,...r.values()];const o=[n];for(const s of t){const a=rn(s);if(a===i)continue;const l=r.get(a);l&&(o.push(l),r.delete(a))}return[...o,...r.values()]},rRe="opencode:deep-link",yot=n=>{if(n.startsWith("opencode://")&&!(typeof URL.canParse=="function"&&!URL.canParse(n)))try{return new URL(n)}catch{return}},v5i=n=>{const e=yot(n);if(!e||e.hostname!=="open-project")return;const t=e.searchParams.get("directory");if(t)return t},y5i=n=>{const e=yot(n);if(!e||e.hostname!=="new-session")return;const t=e.searchParams.get("directory");if(!t)return;const i=e.searchParams.get("prompt")||void 0;return i?{directory:t,prompt:i}:{directory:t}},k5i=n=>n.map(v5i).filter(e=>!!e),C5i=n=>n.map(y5i).filter(e=>!!e),b5i=n=>{const e=n.__OPENCODE__?.deepLinks??[];return e.length===0?[]:(n.__OPENCODE__&&(n.__OPENCODE__.deepLinks=[]),e)};var w5i=le("<span>");function _5i(){const[n,e]=Yt({active:"",value:""}),t=c=>n.active===c,i=()=>n.value,r=(c,d)=>{c&&e({active:c,value:d})},o=()=>e({active:"",value:""}),s=c=>{const d=n.value.trim();if(!d){o();return}o(),c(d)},a=(c,d)=>{if(c.key==="Enter"){c.preventDefault(),s(d);return}c.key==="Escape"&&(c.preventDefault(),o())};return{editor:n,editorOpen:t,editorValue:i,openEditor:r,closeEditor:o,saveEditor:s,editorKeyDown:a,setEditor:e,InlineEditor:c=>{let d;Oe(()=>{d!==void 0&&cancelAnimationFrame(d)});const u=()=>c.editing??t(c.id),h=()=>c.stopPropagation??!1,f=()=>c.openOnDblClick??!0,p=v=>{h()&&v.stopPropagation()},g=v=>{f()&&(p(v),r(c.id,c.value()))};return m(_e,{get when(){return u()},get fallback(){return(()=>{var v=w5i();return v.$$touchstart=p,v.$$click=p,v.$$mousedown=p,v.$$pointerdown=p,v.$$dblclick=g,W(v,()=>c.value()),st(()=>H1(v,c.displayClass??c.class)),v})()},get children(){return m(ate,{ref:v=>{d!==void 0&&cancelAnimationFrame(d),d=requestAnimationFrame(()=>{d=void 0,v.isConnected&&v.focus()})},get value(){return i()},get class(){return c.class},onInput:v=>e("value",v.currentTarget.value),onKeyDown:v=>{v.stopPropagation(),a(v,c.onSave)},onBlur:o,onPointerDown:p,onClick:p,onDblClick:p,onMouseDown:p,onMouseUp:p,onTouchStart:p})}})}}}Fs(["dblclick","pointerdown","mousedown","click","touchstart"]);var x5i={};au(x5i,{Collapsible:()=>Oce,Content:()=>Cot,Root:()=>bot,Trigger:()=>wot,useCollapsibleContext:()=>Dke});var kot=oi();function Dke(){const n=Wn(kot);if(n===void 0)throw new Error("[kobalte]: `useCollapsibleContext` must be used within a `Collapsible.Root` component");return n}function Cot(n){const[e,t]=Ye(),i=Dke(),r=Pn({id:i.generateId("content")},n),[o,s]=Je(r,["ref","id","style"]),{present:a}=M6({show:i.shouldMount,element:()=>e()??null}),[l,c]=Ye(0),[d,u]=Ye(0);let f=i.isOpen()||a();return ur(()=>{const p=requestAnimationFrame(()=>{f=!1});Oe(()=>{cancelAnimationFrame(p)})}),Re(Mr(a,()=>{if(!e())return;e().style.transitionDuration="0s",e().style.animationName="none";const p=e().getBoundingClientRect();c(p.height),u(p.width),f||(e().style.transitionDuration="",e().style.animationName="")})),Re(Mr(i.isOpen,p=>{!p&&e()&&(e().style.transitionDuration="",e().style.animationName="")},{defer:!0})),Re(()=>Oe(i.registerContentId(o.id))),m(_e,{get when(){return a()},get children(){return m(zi,k({as:"div",ref(p){var g=qr(t,o.ref);typeof g=="function"&&g(p)},get id(){return o.id},get style(){return su({"--kb-collapsible-content-height":l()?`${l()}px`:void 0,"--kb-collapsible-content-width":d()?`${d()}px`:void 0},o.style)}},()=>i.dataset(),s))}})}function bot(n){const e=`collapsible-${$s()}`,t=Pn({id:e},n),[i,r]=Je(t,["open","defaultOpen","onOpenChange","disabled","forceMount"]),[o,s]=Ye(),a=u3({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:d=>i.onOpenChange?.(d)}),l=J(()=>({"data-expanded":a.isOpen()?"":void 0,"data-closed":a.isOpen()?void 0:"","data-disabled":i.disabled?"":void 0})),c={dataset:l,isOpen:a.isOpen,disabled:()=>i.disabled??!1,shouldMount:()=>i.forceMount||a.isOpen(),contentId:o,toggle:a.toggle,generateId:bh(()=>r.id),registerContentId:Xa(s)};return m(kot.Provider,{value:c,get children(){return m(zi,k({as:"div"},l,r))}})}function wot(n){const e=Dke(),[t,i]=Je(n,["onClick"]);return m(h3,k({get"aria-expanded"(){return e.isOpen()},get"aria-controls"(){return sn(()=>!!e.isOpen())()?e.contentId():void 0},get disabled(){return e.disabled()},onClick:o=>{In(o,t.onClick),e.toggle()}},()=>e.dataset(),i))}var Oce=Object.assign(bot,{Content:Cot,Trigger:wot}),S5i=le("<div data-slot=collapsible-arrow><span data-slot=collapsible-arrow-icon>");function M5i(n){const[e,t]=Je(n,["class","classList","variant"]);return m(Oce,k({"data-component":"collapsible",get"data-variant"(){return e.variant||"normal"},get classList(){return{...e.classList??{},[e.class??""]:!!e.class}}},t))}function L5i(n){return m(Oce.Trigger,k({"data-slot":"collapsible-trigger"},n))}function I5i(n){return m(Oce.Content,k({"data-slot":"collapsible-content"},n))}function N5i(n){return(()=>{var e=S5i(),t=e.firstChild;return El(e,n||{},!1,!0),W(t,m(Cn,{name:"chevron-down",size:"small"})),e})()}const qhe=Object.assign(M5i,{Arrow:N5i,Trigger:L5i,Content:I5i});var E5i=le("<div>"),T5i=le("<img data-slot=avatar-image>");const oRe=typeof Intl<"u"&&"Segmenter"in Intl?new Intl.Segmenter(void 0,{granularity:"grapheme"}):void 0;function A5i(n){return n?oRe?oRe.segment(n)[Symbol.iterator]().next().value?.segment??Array.from(n)[0]??"":Array.from(n)[0]??"":""}function D5i(n){const[e,t]=Je(n,["fallback","src","background","foreground","size","class","classList","style"]),i=e.src;return(()=>{var r=E5i();return El(r,k(t,{"data-component":"avatar",get"data-size"(){return e.size||"normal"},"data-has-image":i?"":void 0,get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get style(){return{...typeof e.style=="object"?e.style:{},...!i&&e.background?{"--avatar-bg":e.background}:{},...!i&&e.foreground?{"--avatar-fg":e.foreground}:{}}}}),!1,!0),W(r,m(_e,{when:i,get fallback(){return A5i(e.fallback)},children:o=>(()=>{var s=T5i();return mt(s,"draggable",!1),st(()=>mt(s,"src",o())),s})()})),r})()}var R5i={};au(R5i,{Link:()=>P5i,Root:()=>Rke});function Rke(n){let e;const[t,i]=Je(n,["ref","href","disabled"]),r=$_(()=>e,()=>"a");return m(zi,k({as:"a",ref(o){var s=qr(a=>e=a,t.ref);typeof s=="function"&&s(o)},get role(){return r()!=="a"||t.disabled?"link":void 0},get tabIndex(){return r()!=="a"&&!t.disabled?0:void 0},get href(){return sn(()=>!t.disabled)()?t.href:void 0},get"aria-disabled"(){return t.disabled?!0:void 0},get"data-disabled"(){return t.disabled?"":void 0}},i))}var P5i=Rke,O5i={};au(O5i,{Arrow:()=>y2,Content:()=>xot,HoverCard:()=>zC,Portal:()=>Sot,Root:()=>Mot,Trigger:()=>Lot,useHoverCardContext:()=>Vce});var _ot=oi();function Vce(){const n=Wn(_ot);if(n===void 0)throw new Error("[kobalte]: `useHoverCardContext` must be used within a `HoverCard` component");return n}function xot(n){const e=Vce(),[t,i]=Je(n,["ref","style"]);return m(_e,{get when(){return e.contentPresent()},get children(){return m(tk.Positioner,{get children(){return m(cse,k({ref(r){var o=qr(s=>{e.setContentRef(s)},t.ref);typeof o=="function"&&o(r)},disableOutsidePointerEvents:!1,get style(){return su({"--kb-hovercard-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},t.style)},onFocusOutside:r=>r.preventDefault(),get onDismiss(){return e.close}},()=>e.dataset(),i))}})}})}function Sot(n){const e=Vce();return m(_e,{get when(){return e.contentPresent()},get children(){return m(d3,n)}})}function V5i(n,e,t){const i=n.split("-")[0],r=e.getBoundingClientRect(),o=t.getBoundingClientRect(),s=[],a=r.left+r.width/2,l=r.top+r.height/2;switch(i){case"top":s.push([r.left,l]),s.push([o.left,o.bottom]),s.push([o.left,o.top]),s.push([o.right,o.top]),s.push([o.right,o.bottom]),s.push([r.right,l]);break;case"right":s.push([a,r.top]),s.push([o.left,o.top]),s.push([o.right,o.top]),s.push([o.right,o.bottom]),s.push([o.left,o.bottom]),s.push([a,r.bottom]);break;case"bottom":s.push([r.left,l]),s.push([o.left,o.top]),s.push([o.left,o.bottom]),s.push([o.right,o.bottom]),s.push([o.right,o.top]),s.push([r.right,l]);break;case"left":s.push([a,r.top]),s.push([o.right,o.top]),s.push([o.left,o.top]),s.push([o.left,o.bottom]),s.push([o.right,o.bottom]),s.push([a,r.bottom]);break}return s}function Mot(n){const e=`hovercard-${$s()}`,t=Pn({id:e,openDelay:700,closeDelay:300},n),[i,r]=Je(t,["id","open","defaultOpen","onOpenChange","openDelay","closeDelay","ignoreSafeArea","forceMount"]);let o,s;const[a,l]=Ye(),[c,d]=Ye(),[u,h]=Ye(r.placement),f=u3({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:E=>i.onOpenChange?.(E)}),{present:p}=M6({show:()=>i.forceMount||f.isOpen(),element:()=>c()??null}),{addGlobalListener:g,removeGlobalListener:v}=hat(),y=()=>{o=window.setTimeout(()=>{o=void 0,f.open()},i.openDelay)},C=()=>{s=window.setTimeout(()=>{s=void 0,f.close()},i.closeDelay)},_=()=>{window.clearTimeout(o),o=void 0},w=()=>{window.clearTimeout(s),s=void 0},x=E=>ps(a(),E)||ps(c(),E),M=E=>{const A=a(),T=c();if(!(!A||!T))return V5i(E,A,T)},L=E=>{const A=E.target;if(x(A)){w();return}if(!i.ignoreSafeArea){const T=M(u());if(T&&C5e(DRe(E),T)){w();return}}s||C()};Re(()=>{f.isOpen()&&(g(document,"pointermove",L,!0),Oe(()=>{v(document,"pointermove",L,!0)}))}),Oe(()=>{_(),w()});const I={dataset:J(()=>({"data-expanded":f.isOpen()?"":void 0,"data-closed":f.isOpen()?void 0:""})),isOpen:f.isOpen,contentPresent:p,openWithDelay:y,closeWithDelay:C,cancelOpening:_,cancelClosing:w,close:f.close,isTargetOnHoverCard:x,setTriggerRef:l,setContentRef:d};return m(_ot.Provider,{value:I,get children(){return m(tk,k({anchorRef:a,contentRef:c,onCurrentPlacementChange:h},r))}})}function Lot(n){const e=Vce(),[t,i]=Je(n,["ref","onPointerEnter","onPointerLeave","onFocus","onBlur"]),r=l=>{In(l,t.onPointerEnter),!(l.pointerType==="touch"||i.disabled||l.defaultPrevented)&&(e.cancelClosing(),e.isOpen()||e.openWithDelay())},o=l=>{In(l,t.onPointerLeave),l.pointerType!=="touch"&&e.cancelOpening()},s=l=>{In(l,t.onFocus),!(i.disabled||l.defaultPrevented)&&(e.cancelClosing(),e.isOpen()||e.openWithDelay())},a=l=>{In(l,t.onBlur),e.cancelOpening();const c=l.relatedTarget;e.isTargetOnHoverCard(c)||e.closeWithDelay()};return Oe(e.cancelOpening),m(Rke,k({ref(l){var c=qr(e.setTriggerRef,t.ref);typeof c=="function"&&c(l)},onPointerEnter:r,onPointerLeave:o,onFocus:s,onBlur:a},()=>e.dataset(),i))}var zC=Object.assign(Mot,{Arrow:y2,Content:xot,Portal:Sot,Trigger:Lot}),H5i=le("<div data-slot=hover-card-body>");function Iot(n){const[e,t]=Je(n,["trigger","mount","class","classList","children"]);return m(zC,k({gutter:4},t,{get children(){return[m(zC.Trigger,{as:"div","data-slot":"hover-card-trigger",tabIndex:-1,get children(){return e.trigger}}),m(zC.Portal,{get mount(){return e.mount},get children(){return m(zC.Content,{"data-component":"hover-card-content",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){var i=H5i();return W(i,()=>e.children),i}})}})]}}))}var $5i=le('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 18 14"fill=none><g>'),F5i=le("<span data-slot=diff-changes-additions>"),z5i=le("<span data-slot=diff-changes-deletions>"),B5i=le("<div data-component=diff-changes>"),j5i=le("<svg><rect width=2 height=14 rx=1></svg>",!1,!0,!1);function W5i(n){const e=()=>n.variant??"default",t=J(()=>Array.isArray(n.changes)?n.changes.reduce((d,u)=>d+(u.additions??0),0):n.changes.additions),i=J(()=>Array.isArray(n.changes)?n.changes.reduce((d,u)=>d+(u.deletions??0),0):n.changes.deletions),r=J(()=>(t()??0)+(i()??0)),o=J(()=>{const u=t()??0,h=i()??0;if(u===0&&h===0)return{added:0,deleted:0,neutral:5};const f=u+h;if(f<5){const S=u>0?1:0,I=h>0?1:0,E=5-S-I;return{added:S,deleted:I,neutral:E}}const p=u>h?u/h:h/u;let g=5;(f<20||p<4)&&(g=4);const v=u/f,y=h/f,C=v*g,_=y*g;let w=u>0?Math.max(1,Math.round(C)):0,x=h>0?Math.max(1,Math.round(_)):0;u>0&&u<=5&&(w=Math.min(w,1)),u>5&&u<=10&&(w=Math.min(w,2)),h>0&&h<=5&&(x=Math.min(x,1)),h>5&&h<=10&&(x=Math.min(x,2));let M=w+x;M>g&&(C>_?w=g-x:x=g-w,M=w+x);const L=Math.max(0,5-M);return{added:w,deleted:x,neutral:L}}),s="var(--icon-diff-add-base)",a="var(--icon-diff-delete-base)",l="var(--icon-weak-base)",c=J(()=>{const d=o();return[...Array(d.added).fill(s),...Array(d.deleted).fill(a),...Array(d.neutral).fill(l)].slice(0,5)});return m(_e,{get when(){return sn(()=>e()==="default")()?r()>0:!0},get children(){var d=B5i();return W(d,m(V1,{get children(){return[m(fi,{get when(){return e()==="bars"},get children(){var u=$5i(),h=u.firstChild;return W(h,m(ei,{get each(){return c()},children:(f,p)=>(()=>{var g=j5i();return mt(g,"fill",f),st(()=>mt(g,"x",p()*4)),g})()})),u}}),m(fi,{get when(){return e()==="default"},get children(){return[(()=>{var u=F5i();return W(u,()=>`+${t()}`),u})(),(()=>{var u=z5i();return W(u,()=>`-${i()}`),u})()]}})]}})),st(u=>{var h=e(),f={[n.class??""]:!0};return h!==u.e&&mt(d,"data-variant",u.e=h),u.t=Ko(d,f,u.t),u},{e:void 0,t:void 0}),d}})}var q5i=le("<ul role=list data-component=message-nav>"),U5i=le("<div data-slot=message-nav-tick-button role=button tabindex=0><div data-slot=message-nav-tick-line>"),Z5i=le("<button data-slot=message-nav-message-button><div data-slot=message-nav-title-preview>"),K5i=le("<li data-slot=message-nav-item>"),G5i=le("<div data-slot=message-nav-tooltip-content>");function Not(n){const e=f3(),[t,i]=Je(n,["messages","current","size","onMessageSelect","getLabel"]),r=()=>(()=>{var o=q5i();return El(o,k({get"data-size"(){return t.size}},i),!1,!0),W(o,m(ei,{get each(){return t.messages},children:s=>{const a=()=>t.onMessageSelect(s),l=c=>{c.key!=="Enter"&&c.key!==" "||(c.preventDefault(),t.onMessageSelect(s))};return(()=>{var c=K5i();return W(c,m(V1,{get children(){return[m(fi,{get when(){return t.size==="compact"},get children(){var d=U5i();return d.$$keydown=l,d.$$click=a,st(()=>mt(d,"data-active",s.id===t.current?.id||void 0)),d}}),m(fi,{get when(){return t.size==="normal"},get children(){var d=Z5i(),u=d.firstChild;return d.$$keydown=l,d.$$click=a,W(d,m(W5i,{get changes(){return s.summary?.diffs??[]},variant:"bars"}),u),W(u,m(_e,{get when(){return t.getLabel?.(s)??s.summary?.title},get fallback(){return e.t("ui.messageNav.newMessage")},get children(){return t.getLabel?.(s)??s.summary?.title}})),st(()=>mt(u,"data-active",s.id===t.current?.id||void 0)),d}})]}})),c})()}})),o})();return m(V1,{get children(){return[m(fi,{get when(){return t.size==="compact"},get children(){return m(ou,{openDelay:0,placement:"right-start",gutter:-40,shift:-10,overlap:!0,contentClass:"message-nav-tooltip",get value(){return(()=>{var o=G5i();return W(o,m(Not,k(n,{size:"normal",class:""}))),o})()},get children(){return r()}})}}),m(fi,{get when(){return t.size==="normal"},get children(){return r()}})]}})}Fs(["click","keydown"]);const sRe={ask:"var(--icon-agent-ask-base)",build:"var(--icon-agent-build-base)",docs:"var(--icon-agent-docs-base)",plan:"var(--icon-agent-plan-base)"};function X5i(n,e){return e||(sRe[n]??sRe[n.toLowerCase()])}function Y5i(n,e){if(n)for(let t=n.length-1;t>=0;t--){const i=n[t];if(!(i.role!=="user"||!i.agent))return X5i(i.agent,e.find(r=>r.name===i.agent)?.color)}}function Eot(n,e,t,i=()=>!0){if(!t)return;const r=n.reduce((l,c)=>{if(!c.parentID)return l;const d=l.get(c.parentID);return d&&d.push(c.id),d||l.set(c.parentID,[c.id]),l},new Map),o=new Set([t]),s=[t];for(const l of s){const c=r.get(l);if(c)for(const d of c)o.has(d)||(o.add(d),s.push(d))}const a=s.find(l=>e[l]?.some(i));if(a)return e[a]?.find(i)}function J5i(n,e,t,i){return Eot(n,e,t,i)}function fyi(n,e,t,i){return Eot(n,e,t,i)}var Q5i=le("<div>"),e9i=le('<div><div class="size-full rounded overflow-clip">'),t9i=le('<div class="size-1.5 rounded-full bg-surface-warning-strong">'),n9i=le('<div class="size-1.5 rounded-full bg-text-diff-delete-base">'),i9i=le('<div class="size-1.5 rounded-full bg-text-interactive-base">'),Tot=le('<div class="shrink-0 size-6 flex items-center justify-center">'),Aot=le('<span class="text-14-regular text-text-strong min-w-0 flex-1 truncate">'),r9i=le('<div class="overflow-y-auto overflow-x-hidden max-h-72 h-full">'),o9i=le('<div class="min-w-0 w-full">'),s9i=le('<div class="text-12-regular text-text-weak">'),a9i=le('<div class="group/session relative w-full min-w-0 rounded-md cursor-default pl-2 pr-3 transition-colors hover:bg-surface-raised-base-hover [&amp;:has(:focus-visible)]:bg-surface-raised-base-hover has-[[data-expanded]]:bg-surface-raised-base-hover has-[.active]:bg-surface-base-active"><div class="flex min-w-0 items-center gap-1"><div class="min-w-0 flex-1"></div><div class="shrink-0 overflow-hidden transition-[width,opacity]">'),l9i=le('<div class="group/session relative w-full min-w-0 rounded-md cursor-default transition-colors pl-2 pr-3 hover:bg-surface-raised-base-hover [&amp;:has(:focus-visible)]:bg-surface-raised-base-hover has-[.active]:bg-surface-base-active">'),c9i=le('<div class="flex flex-col gap-1">'),d9i=le('<div class="h-8 w-full rounded-md bg-surface-raised-base opacity-60 animate-pulse">');const u9i="4b0ea68d7af9a6031a7ffda7ad66e0cb83315750",Pke=n=>{const e=G1(),t=Iae(),i=Y3e(),r=J(()=>[n.project.worktree,...n.project.sandboxes??[]]),o=J(()=>r().reduce((d,u)=>d+t.project.unseenCount(u),0)),s=J(()=>r().some(d=>t.project.unseenHasError(d))),a=J(()=>r().some(d=>{const[u]=e.child(d,{bootstrap:!1});return m5i(u.permission,h=>!i.autoResponds(h,d))})),l=J(()=>n.notify&&(a()||o()>0)),c=J(()=>n.project.name||Ds(n.project.worktree));return(()=>{var d=e9i(),u=d.firstChild;return W(u,m(D5i,k({get fallback(){return c()},get src(){return sn(()=>n.project.id===u9i)()?"https://opencode.ai/favicon.svg":n.project.icon?.override}},()=>pwn(n.project.icon?.color),{class:"size-full rounded",get classList(){return{"badge-mask":l()}}}))),W(d,m(_e,{get when(){return l()},get children(){var h=Q5i();return st(f=>Ko(h,{"absolute top-px right-px size-1.5 rounded-full z-10":!0,"bg-surface-warning-strong":a(),"bg-icon-critical-base":!a()&&s(),"bg-text-interactive-base":!a()&&!s()},f)),h}}),null),st(()=>H1(d,`relative size-8 shrink-0 rounded ${n.class??""}`)),d})()},h9i=n=>m(z9e,{get href(){return`/${n.slug}/session/${n.session.id}`},get class(){return`flex items-center gap-1 min-w-0 w-full text-left focus:outline-none ${n.dense?"py-0.5":"py-1"}`},get onPointerDown(){return n.warmPress},get onPointerEnter(){return n.warmHover},get onPointerLeave(){return n.cancelHoverPrefetch},get onFocus(){return n.warmFocus},onClick:()=>{n.setHoverSession(void 0),!n.sidebarOpened()&&n.clearHoverProjectSoon()},get children(){return[(()=>{var e=Tot();return W(e,m(V1,{get fallback(){return m(Cn,{name:"dash",size:"small",class:"text-icon-weak"})},get children(){return[m(fi,{get when(){return n.isWorking()},get children(){return m(wp,{class:"size-[15px]"})}}),m(fi,{get when(){return n.hasPermissions()},get children(){return t9i()}}),m(fi,{get when(){return n.hasError()},get children(){return n9i()}}),m(fi,{get when(){return n.unseenCount()>0},get children(){return i9i()}})]}})),st(t=>Sr(e,"color",n.tint()??"var(--icon-interactive-base)")),e})(),(()=>{var e=Aot();return W(e,()=>n.session.title),e})()]}}),f9i=n=>{let e;return m(Iot,{openDelay:1e3,get closeDelay(){return n.sidebarHovering()?600:0},placement:"right-start",gutter:16,shift:-2,get trigger(){return(()=>{var t=o9i(),i=e;return typeof i=="function"?aa(i,t):e=t,W(t,()=>n.trigger),t})()},get open(){return n.hoverSession()===n.session.id},onOpenChange:t=>{if(!t){n.setHoverSession(void 0);return}e?.matches(":hover")&&n.setHoverSession(n.session.id)},get children(){return m(_e,{get when(){return n.hoverReady()},get fallback(){return(()=>{var t=s9i();return W(t,()=>n.language.t("session.messages.loading")),t})()},get children(){var t=r9i();return W(t,m(Not,{get messages(){return n.hoverMessages()??[]},current:void 0,get getLabel(){return n.messageLabel},get onMessageSelect(){return n.onMessageSelect},size:"normal",class:"w-60"})),t}})}})},h5e=n=>{const e=Aa(),t=k3(),i=_3(),r=ha(),o=Iae(),s=Y3e(),a=G1(),l=J(()=>o.session.unseenCount(n.session.id)),c=J(()=>o.session.unseenHasError(n.session.id)),[d]=a.child(n.session.directory),u=J(()=>!!J5i(d.session,d.permission,n.session.id,I=>!s.autoResponds(I,n.session.directory))),h=J(()=>{if(u())return!1;const I=(d.message[n.session.id]??[]).findLast(A=>A.role==="assistant"&&typeof A.time?.completed!="number"),E=d.session_status[n.session.id];return I!==void 0||E?.type==="busy"||E?.type==="retry"||E!==void 0&&E.type!=="idle"}),f=J(()=>Y5i(d.message[n.session.id],d.agent)),p=J(()=>d.message[n.session.id]?.filter(I=>I.role==="user")),g=J(()=>p()!==void 0),v=J(()=>!n.mobile&&n.sidebarExpanded()),y=J(()=>(n.popover??!0)&&v()),C=J(()=>n.session.id===e.id),_=(I,E)=>{const A=n.navList?.(),T=A?.some(R=>R.id===n.session.id&&R.directory===n.session.directory)?A:n.list;n.prefetchSession(n.session,E);const D=T.findIndex(R=>R.id===n.session.id&&R.directory===n.session.directory);if(D!==-1)for(let R=1;R<=I;R++){const P=T[D+R];P&&n.prefetchSession(P,R===1?"high":E);const V=T[D-R];V&&n.prefetchSession(V,R===1?"high":E)}},w={current:void 0},x=()=>{w.current!==void 0&&(clearTimeout(w.current),w.current=void 0)},M=()=>{_(1,"high"),w.current===void 0&&(w.current=setTimeout(()=>{w.current=void 0,_(2,"low")},80))};Oe(x);const L=I=>(d.part[I.id]??[]).find(T=>T?.type==="text"&&!T.synthetic&&!T.ignored)?.text,S=m(h9i,{get session(){return n.session},get slug(){return n.slug},get mobile(){return n.mobile},get dense(){return n.dense},tint:f,isWorking:h,hasPermissions:u,hasError:c,unseenCount:l,get setHoverSession(){return n.setHoverSession},get clearHoverProjectSoon(){return n.clearHoverProjectSoon},get sidebarOpened(){return i.sidebar.opened},warmHover:M,warmPress:()=>_(2,"high"),warmFocus:()=>_(2,"high"),cancelHoverPrefetch:x});return(()=>{var I=a9i(),E=I.firstChild,A=E.firstChild,T=A.nextSibling;return W(A,m(_e,{get when(){return y()},get fallback(){return m(ou,{get placement(){return n.mobile?"bottom":"right"},get value(){return n.session.title},gutter:10,class:"min-w-0 w-full",children:S})},get children(){return m(f9i,{get mobile(){return n.mobile},get nav(){return n.nav},get hoverSession(){return n.hoverSession},get session(){return n.session},get sidebarHovering(){return n.sidebarHovering},hoverReady:g,hoverMessages:p,language:r,isActive:C,get slug(){return n.slug},get setHoverSession(){return n.setHoverSession},messageLabel:L,onMessageSelect:D=>{C()||i.pendingMessage.set(`${ri(n.session.directory)}/${n.session.id}`,D.id),t(`${n.slug}/session/${n.session.id}#message-${D.id}`)},trigger:S})}})),W(T,m(ou,{get value(){return r.t("common.archive")},placement:"top",get children(){return m(oa,{icon:"archive",variant:"ghost",class:"size-6 rounded-md",get"aria-label"(){return r.t("common.archive")},onClick:D=>{D.preventDefault(),D.stopPropagation(),n.archiveSession(n.session)}})}})),st(D=>{var R=n.session.id,P={"w-6 opacity-100 pointer-events-auto":!!n.mobile,"w-0 opacity-0 pointer-events-none":!n.mobile,"group-hover/session:w-6 group-hover/session:opacity-100 group-hover/session:pointer-events-auto":!0,"group-focus-within/session:w-6 group-focus-within/session:opacity-100 group-focus-within/session:pointer-events-auto":!0};return R!==D.e&&mt(I,"data-session-id",D.e=R),D.t=Ko(T,P,D.t),D},{e:void 0,t:void 0}),I})()},p9i=n=>{const e=_3(),i=ha().t("command.session.new"),r=()=>n.mobile||!n.sidebarExpanded(),o=m(z9e,{get href(){return`/${n.slug}/session`},end:!0,get class(){return`flex items-center gap-1 min-w-0 w-full text-left focus:outline-none ${n.dense?"py-0.5":"py-1"}`},onClick:()=>{n.setHoverSession(void 0),!e.sidebar.opened()&&n.clearHoverProjectSoon()},get children(){return[(()=>{var s=Tot();return W(s,m(Cn,{name:"new-session",size:"small",class:"text-icon-weak"})),s})(),(()=>{var s=Aot();return W(s,i),s})()]}});return(()=>{var s=l9i();return W(s,m(_e,{get when(){return!r()},get fallback(){return m(ou,{get placement(){return n.mobile?"bottom":"right"},value:i,gutter:10,class:"min-w-0 w-full",children:o})},children:o})),s})()},g9i=n=>{const e=Array.from({length:n.count??4},(t,i)=>i);return(()=>{var t=c9i();return W(t,m(ei,{each:e,children:()=>d9i()})),t})()};var m9i=le('<div class="bg-background-base rounded-md px-2 py-1 text-14-medium text-text-strong">'),v9i=le('<div class="flex items-center gap-1 min-w-0 flex-1"><div class="flex items-center justify-center shrink-0 size-6"></div><span class="text-14-medium text-text-base shrink-0"> :</span><div class="flex items-center justify-center shrink-0 overflow-hidden w-0 opacity-0 transition-all duration-200 group-hover/workspace:w-3.5 group-hover/workspace:opacity-100 group-focus-within/workspace:w-3.5 group-focus-within/workspace:opacity-100">'),y9i=le('<span class="text-14-medium text-text-base min-w-0 truncate">'),k9i=le('<div class="absolute right-1 top-1/2 -translate-y-1/2 flex items-center gap-0.5 transition-opacity">'),C9i=le('<div class="shrink-0 size-6 flex items-center justify-center">'),b9i=le('<span class="text-14-regular text-text-strong min-w-0 flex-1 truncate">Trellis Board'),w9i=le('<div class="relative w-full py-1">'),_9i=le('<nav class="flex flex-col gap-1">'),aRe=le("<div>"),x9i=le('<div class=py-1><div class="group/workspace relative"data-component=workspace-item><div class="flex items-center gap-1">'),S9i=le('<div class="size-full flex flex-col py-2 overflow-y-auto no-scrollbar [overflow-anchor:none]">');const M9i=n=>{const e=G1(),t=ha(),i=J(()=>{const r=n.sidebarProject();if(!r)return;const o=n.activeWorkspace();if(!o)return;const[s]=e.child(o,{bootstrap:!1}),a=o===r.worktree?t.t("workspace.type.local"):t.t("workspace.type.sandbox"),l=n.workspaceLabel(o,s.vcs?.branch,r.id);return`${a} : ${l}`});return m(_e,{get when(){return i()},children:r=>(()=>{var o=m9i();return W(o,r),o})()})},L9i=n=>(()=>{var e=v9i(),t=e.firstChild,i=t.nextSibling,r=i.firstChild,o=i.nextSibling;return W(t,m(_e,{get when(){return n.busy()},get fallback(){return m(Cn,{name:"branch",size:"small"})},get children(){return m(wp,{class:"size-[15px]"})}})),W(i,(()=>{var s=sn(()=>!!n.local());return()=>s()?n.language.t("workspace.type.local"):n.language.t("workspace.type.sandbox")})(),r),W(e,m(_e,{get when(){return!n.local()},get fallback(){return(()=>{var s=y9i();return W(s,()=>n.branch()??Ds(n.directory)),s})()},get children(){return m(n.InlineEditor,{get id(){return`workspace:${n.directory}`},get value(){return n.workspaceValue},onSave:s=>{const a=s.trim();a&&(n.renameWorkspace(n.directory,a,n.projectId,n.branch()),n.setEditor("value",n.workspaceValue()))},class:"text-14-medium text-text-base min-w-0 truncate",displayClass:"text-14-medium text-text-base min-w-0 truncate",get editing(){return n.workspaceEditActive()},stopPropagation:!1,openOnDblClick:!1})}}),o),W(o,m(Cn,{get name(){return n.open()?"chevron-down":"chevron-right"},size:"small",class:"text-icon-base"})),e})(),I9i=n=>(()=>{var e=k9i();return W(e,m(Un,{get modal(){return!n.sidebarHovering()},get open(){return n.menuOpen()},onOpenChange:t=>n.setMenuOpen(t),get children(){return[m(ou,{get value(){return n.language.t("common.moreOptions")},placement:"top",get children(){return m(Un.Trigger,{as:oa,icon:"dot-grid",variant:"ghost",class:"size-6 rounded-md","data-action":"workspace-menu",get"data-workspace"(){return ri(n.directory)},get"aria-label"(){return n.language.t("common.moreOptions")}})}}),m(Un.Portal,{get children(){return m(Un.Content,{onCloseAutoFocus:t=>{n.pendingRename()&&(t.preventDefault(),n.setPendingRename(!1),n.openEditor(`workspace:${n.directory}`,n.workspaceValue()))},get children(){return[m(Un.Item,{get disabled(){return n.local()},onSelect:()=>{n.setPendingRename(!0),n.setMenuOpen(!1)},get children(){return m(Un.ItemLabel,{get children(){return n.language.t("common.rename")}})}}),m(_e,{get when(){return!ih()},get children(){return[m(Un.Item,{get disabled(){return n.local()||n.busy()},onSelect:()=>n.showResetWorkspaceDialog(n.root,n.directory),get children(){return m(Un.ItemLabel,{get children(){return n.language.t("common.reset")}})}}),m(Un.Item,{get disabled(){return n.local()||n.busy()},onSelect:()=>n.showDeleteWorkspaceDialog(n.root,n.directory),get children(){return m(Un.ItemLabel,{get children(){return n.language.t("common.delete")}})}})]}})]}})}})]}}),null),W(e,m(_e,{get when(){return!n.touch()},get children(){return m(ou,{get value(){return n.language.t("command.session.new")},placement:"top",get children(){return m(oa,{icon:"new-session",variant:"ghost",class:"size-6 rounded-md opacity-0 pointer-events-none group-hover/workspace:opacity-100 group-hover/workspace:pointer-events-auto group-focus-within/workspace:opacity-100 group-focus-within/workspace:pointer-events-auto","data-action":"workspace-new-session",get"data-workspace"(){return ri(n.directory)},get"aria-label"(){return n.language.t("command.session.new")},onClick:t=>{t.preventDefault(),t.stopPropagation(),n.setHoverSession(void 0),n.clearHoverProjectSoon(),n.createSession()}})}})}}),null),st(t=>Ko(e,{"opacity-100 pointer-events-auto":n.menuOpen(),"opacity-0 pointer-events-none":!n.menuOpen(),"group-hover/workspace:opacity-100 group-hover/workspace:pointer-events-auto":!0,"group-focus-within/workspace:opacity-100 group-focus-within/workspace:pointer-events-auto":!0},t)),e})(),Dot=n=>(()=>{var e=_9i();return W(e,m(z9e,{get href(){return`/${n.slug()}/trellis`},class:"flex items-center gap-1 min-w-0 w-full text-left py-1 rounded-md px-2 pr-3 hover:bg-surface-raised-base-hover [&.active]:bg-surface-base-active",onClick:()=>{n.ctx.setHoverSession(void 0),n.ctx.clearHoverProjectSoon()},get children(){return[(()=>{var t=C9i();return W(t,m(Cn,{name:"checklist",size:"small",class:"text-icon-weak"})),t})(),b9i()]}}),null),W(e,m(_e,{get when(){return n.showNew()},get children(){return m(p9i,{get slug(){return n.slug()},get mobile(){return n.mobile},get sidebarExpanded(){return n.ctx.sidebarExpanded},get clearHoverProjectSoon(){return n.ctx.clearHoverProjectSoon},get setHoverSession(){return n.ctx.setHoverSession}})}}),null),W(e,m(_e,{get when(){return n.loading()},get children(){return m(g9i,{})}}),null),W(e,m(ei,{get each(){return n.sessions()},children:t=>m(h5e,{session:t,get list(){return n.sessions()},get navList(){return n.ctx.navList},get slug(){return n.slug()},get mobile(){return n.mobile},get popover(){return n.popover},get children(){return n.children()},get sidebarExpanded(){return n.ctx.sidebarExpanded},get sidebarHovering(){return n.ctx.sidebarHovering},get nav(){return n.ctx.nav},get hoverSession(){return n.ctx.hoverSession},get setHoverSession(){return n.ctx.setHoverSession},get clearHoverProjectSoon(){return n.ctx.clearHoverProjectSoon},get prefetchSession(){return n.ctx.prefetchSession},get archiveSession(){return n.ctx.archiveSession}})}),null),W(e,m(_e,{get when(){return n.hasMore()},get children(){var t=w9i();return W(t,m(to,{variant:"ghost",class:"flex w-full text-left justify-start text-14-regular text-text-weak pl-9 pr-10",size:"large",onClick:i=>{n.loadMore(),i.currentTarget.blur()},get children(){return n.language.t("common.loadMore")}})),t}}),null),e})(),N9i=n=>{const e=Aa(),t=G1(),i=ha(),r=hot(n.directory),[o,s]=t.child(n.directory,{bootstrap:!1}),[a,l]=Yt({open:!1,pendingRename:!1}),c=J(()=>ri(n.directory)),d=J(()=>P_(o,n.sortNow())),u=J(()=>nse(o.session)),h=J(()=>n.directory===n.project.worktree),f=J(()=>rn(n.ctx.currentDir())===rn(n.directory)),p=J(()=>{const D=o.vcs?.branch,R=D??Ds(n.directory);return n.ctx.workspaceName(n.directory,n.project.id,D)??R}),g=J(()=>n.ctx.workspaceExpanded(n.directory,h())),v=J(()=>g()||f()),y=J(D=>D||o.status==="complete",!1),C=J(()=>d()?.length??0),_=J(()=>o.sessionTotal>C()),w=J(()=>n.ctx.isBusy(n.directory)),x=J(D=>D||w(),!1),M=J(()=>g()&&!y()&&C()===0&&!x()),L=g5e("(hover: none)"),S=J(()=>!M()&&(L()||C()===0||f()&&!e.id)),I=async()=>{s("limit",D=>(D??0)+5),await t.project.loadSessions(n.directory)},E=J(()=>n.ctx.editorOpen(`workspace:${n.directory}`)),A=()=>m(L9i,{local:h,busy:w,open:g,get directory(){return n.directory},language:i,branch:()=>o.vcs?.branch,workspaceValue:p,workspaceEditActive:E,get InlineEditor(){return n.ctx.InlineEditor},get renameWorkspace(){return n.ctx.renameWorkspace},get setEditor(){return n.ctx.setEditor},get projectId(){return n.project.id}}),T=D=>{n.ctx.setWorkspaceExpanded(n.directory,D),!D&&n.ctx.editorOpen(`workspace:${n.directory}`)&&n.ctx.closeEditor()};return Re(()=>{v()&&t.child(n.directory,{bootstrap:!0})}),(()=>{var D=aRe();return aa(r,D,()=>!0),W(D,m(qhe,{variant:"ghost",get open(){return g()},class:"shrink-0",onOpenChange:T,get children(){return[(()=>{var R=x9i(),P=R.firstChild,V=P.firstChild;return W(V,m(_e,{get when(){return E()},get fallback(){return m(qhe.Trigger,{get class(){return`flex items-center justify-between w-full pl-2 py-1.5 rounded-md hover:bg-surface-raised-base-hover transition-[padding] duration-200 ${a.open?"pr-16":"pr-2"} group-hover/workspace:pr-16 group-focus-within/workspace:pr-16`},"data-action":"workspace-toggle",get"data-workspace"(){return ri(n.directory)},get children(){return A()}})},get children(){var $=aRe();return W($,A),st(()=>H1($,`flex items-center justify-between w-full pl-2 py-1.5 rounded-md transition-[padding] duration-200 ${a.open?"pr-16":"pr-2"} group-hover/workspace:pr-16 group-focus-within/workspace:pr-16`)),$}}),null),W(V,m(I9i,{get directory(){return n.directory},local:h,busy:w,menuOpen:()=>a.open,pendingRename:()=>a.pendingRename,setMenuOpen:$=>l("open",$),setPendingRename:$=>l("pendingRename",$),get sidebarHovering(){return n.ctx.sidebarHovering},touch:L,language:i,workspaceValue:p,get openEditor(){return n.ctx.openEditor},get showResetWorkspaceDialog(){return n.ctx.showResetWorkspaceDialog},get showDeleteWorkspaceDialog(){return n.ctx.showDeleteWorkspaceDialog},get root(){return n.project.worktree},get setHoverSession(){return n.ctx.setHoverSession},get clearHoverProjectSoon(){return n.ctx.clearHoverProjectSoon},createSession:()=>n.ctx.createSession(n.directory)}),null),st(()=>mt(P,"data-workspace",ri(n.directory))),R})(),m(qhe.Content,{get children(){return m(Dot,{slug:c,get mobile(){return n.mobile},get popover(){return n.popover},get ctx(){return n.ctx},showNew:S,loading:M,sessions:d,children:u,hasMore:_,loadMore:I,language:i})}})]}})),st(R=>Ko(D,{"opacity-30":r.isActiveDraggable,"opacity-50 pointer-events-none":w()},R)),D})()},E9i=n=>{const e=G1(),t=ha(),i=J(()=>{const[h,f]=e.child(n.project.worktree);return{store:h,setStore:f}}),r=J(()=>ri(n.project.worktree)),o=J(()=>P_(i().store,n.sortNow())),s=J(()=>nse(i().store.session)),a=J(h=>h||i().store.status==="complete",!1),l=J(()=>o()?.length??0),c=J(()=>!a()&&l()===0),d=J(()=>i().store.sessionTotal>l()),u=async()=>{i().setStore("limit",h=>(h??0)+5),await e.project.loadSessions(n.project.worktree)};return(()=>{var h=S9i();return aa(f=>n.ctx.setScrollContainerRef(f,n.mobile),h),W(h,m(Dot,{slug:r,get mobile(){return n.mobile},get popover(){return n.popover},get ctx(){return n.ctx},showNew:()=>!1,loading:c,sessions:o,children:s,hasMore:d,loadMore:u,language:t})),h})()};var T9i={};au(T9i,{Arrow:()=>y2,CheckboxItem:()=>bce,Content:()=>Rot,ContextMenu:()=>Ss,Group:()=>Qx,GroupLabel:()=>wce,Icon:()=>_ce,Item:()=>xce,ItemDescription:()=>Sce,ItemIndicator:()=>Mce,ItemLabel:()=>Lce,Portal:()=>Ice,RadioGroup:()=>Nce,RadioItem:()=>Ece,Root:()=>Vot,Separator:()=>nk,Sub:()=>Tce,SubContent:()=>Ace,SubTrigger:()=>Dce,Trigger:()=>Hot,useContextMenuContext:()=>Oot});function Rot(n){const e=td(),[t,i]=Je(n,["onCloseAutoFocus","onInteractOutside"]);let r=!1;return m(Jrt,k({onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),!a.defaultPrevented&&r&&a.preventDefault(),r=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),!a.defaultPrevented&&!e.isModal()&&(r=!0)}},i))}var Pot=oi();function A9i(){return Wn(Pot)}function Oot(){const n=A9i();if(n===void 0)throw new Error("[kobalte]: `useContextMenuContext` must be used within a `ContextMenu` component");return n}function Vot(n){const e=`contextmenu-${$s()}`,{direction:t}=m2(),i=Pn({id:e,placement:t()==="rtl"?"left-start":"right-start",gutter:2,shift:2},n),[r,o]=Je(i,["onOpenChange"]),[s,a]=Ye({x:0,y:0}),l=u3({defaultOpen:!1,onOpenChange:d=>r.onOpenChange?.(d)}),c={setAnchorRect:a};return m(Pot.Provider,{value:c,get children(){return m(not,k({get open(){return l.isOpen()},get onOpenChange(){return l.setIsOpen},getAnchorRect:s},o))}})}function Hot(n){const e=td(),t=Ah(),i=Oot(),r=Pn({id:e.generateId("trigger")},n),[o,s]=Je(r,["ref","style","disabled","onContextMenu","onPointerDown","onPointerMove","onPointerCancel","onPointerUp"]);let a=0;const l=()=>{window.clearTimeout(a)};Oe(()=>{l()});const c=g=>{if(o.disabled){In(g,o.onContextMenu);return}l(),g.preventDefault(),g.stopPropagation(),i.setAnchorRect({x:g.clientX,y:g.clientY}),t.isOpen()?t.focusContent():t.open(!0)},d=g=>g.pointerType==="touch"||g.pointerType==="pen";return m(zi,k({as:"div",ref(g){var v=qr(t.setTriggerRef,o.ref);typeof v=="function"&&v(g)},get style(){return su({"-webkit-touch-callout":"none"},o.style)},get"data-disabled"(){return o.disabled?"":void 0},onContextMenu:c,onPointerDown:g=>{In(g,o.onPointerDown),!o.disabled&&d(g)&&(l(),i.setAnchorRect({x:g.clientX,y:g.clientY}),a=window.setTimeout(()=>t.open(!1),700))},onPointerMove:g=>{In(g,o.onPointerMove),!o.disabled&&d(g)&&l()},onPointerCancel:g=>{In(g,o.onPointerCancel),!o.disabled&&d(g)&&l()},onPointerUp:g=>{In(g,o.onPointerUp),!o.disabled&&d(g)&&l()}},()=>t.dataset(),s))}var Ss=Object.assign(Vot,{Arrow:y2,CheckboxItem:bce,Content:Rot,Group:Qx,GroupLabel:wce,Icon:_ce,Item:xce,ItemDescription:Sce,ItemIndicator:Mce,ItemLabel:Lce,Portal:Ice,RadioGroup:Nce,RadioItem:Ece,Separator:nk,Sub:Tce,SubContent:Ace,SubTrigger:Dce,Trigger:Hot});function D9i(n){return m(Ss,k(n,{"data-component":"context-menu"}))}function R9i(n){const[e,t]=Je(n,["class","classList","children"]);return m(Ss.Trigger,k(t,{"data-slot":"context-menu-trigger",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function P9i(n){const[e,t]=Je(n,["class","classList","children"]);return m(Ss.Icon,k(t,{"data-slot":"context-menu-icon",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function O9i(n){return m(Ss.Portal,n)}function V9i(n){const[e,t]=Je(n,["class","classList","children"]);return m(Ss.Content,k(t,{"data-component":"context-menu-content",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function H9i(n){const[e,t]=Je(n,["class","classList"]);return m(Ss.Arrow,k(t,{"data-slot":"context-menu-arrow",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}}}))}function $9i(n){const[e,t]=Je(n,["class","classList"]);return m(Ss.Separator,k(t,{"data-slot":"context-menu-separator",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}}}))}function F9i(n){const[e,t]=Je(n,["class","classList","children"]);return m(Ss.Group,k(t,{"data-slot":"context-menu-group",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function z9i(n){const[e,t]=Je(n,["class","classList","children"]);return m(Ss.GroupLabel,k(t,{"data-slot":"context-menu-group-label",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function B9i(n){const[e,t]=Je(n,["class","classList","children"]);return m(Ss.Item,k(t,{"data-slot":"context-menu-item",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function j9i(n){const[e,t]=Je(n,["class","classList","children"]);return m(Ss.ItemLabel,k(t,{"data-slot":"context-menu-item-label",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function W9i(n){const[e,t]=Je(n,["class","classList","children"]);return m(Ss.ItemDescription,k(t,{"data-slot":"context-menu-item-description",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function q9i(n){const[e,t]=Je(n,["class","classList","children"]);return m(Ss.ItemIndicator,k(t,{"data-slot":"context-menu-item-indicator",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function U9i(n){const[e,t]=Je(n,["class","classList","children"]);return m(Ss.RadioGroup,k(t,{"data-slot":"context-menu-radio-group",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function Z9i(n){const[e,t]=Je(n,["class","classList","children"]);return m(Ss.RadioItem,k(t,{"data-slot":"context-menu-radio-item",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function K9i(n){const[e,t]=Je(n,["class","classList","children"]);return m(Ss.CheckboxItem,k(t,{"data-slot":"context-menu-checkbox-item",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function G9i(n){return m(Ss.Sub,n)}function X9i(n){const[e,t]=Je(n,["class","classList","children"]);return m(Ss.SubTrigger,k(t,{"data-slot":"context-menu-sub-trigger",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}function Y9i(n){const[e,t]=Je(n,["class","classList","children"]);return m(Ss.SubContent,k(t,{"data-component":"context-menu-sub-content",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}}))}const Cc=Object.assign(D9i,{Trigger:R9i,Icon:P9i,Portal:O9i,Content:V9i,Arrow:H9i,Separator:$9i,Group:F9i,GroupLabel:z9i,Item:B9i,ItemLabel:j9i,ItemDescription:W9i,ItemIndicator:q9i,RadioGroup:U9i,RadioItem:Z9i,CheckboxItem:K9i,Sub:G9i,SubTrigger:X9i,SubContent:Y9i});var J9i=le('<div class="bg-background-base rounded-xl p-1">'),Q9i=le('<div class="-m-3 p-2 flex flex-col w-72"><div class="px-4 pt-2 pb-1 flex items-center gap-2"><div class="text-14-medium text-text-strong truncate grow"></div></div><div class="px-4 pb-2 text-12-medium text-text-weak"></div><div class="px-2 pb-2 flex flex-col gap-2"></div><div class="px-2 py-2 border-t border-border-weak-base">'),e6i=le('<div class="flex flex-col gap-1"><div class="px-2 py-0.5 flex items-center gap-1 min-w-0"><div class="shrink-0 size-6 flex items-center justify-center"></div><span class="truncate text-14-medium text-text-base">'),t6i=le("<div>");const n6i=n=>{const e=J(()=>n.projects().find(t=>t.worktree===n.activeProject()));return m(_e,{get when(){return e()},children:t=>(()=>{var i=J9i();return W(i,m(Pke,{get project(){return t()}})),i})()})},i6i=n=>{const e=Iae(),t=_3(),i=J(()=>n.dirs().reduce((o,s)=>o+e.project.unseenCount(s),0)),r=()=>n.dirs().filter(o=>e.project.unseenCount(o)>0).forEach(o=>e.project.markViewed(o));return m(Cc,{get modal(){return!n.sidebarHovering()},onOpenChange:o=>{n.setMenu(o),n.setSuppressHover(o),o&&n.setOpen(!1)},get children(){return[m(Cc.Trigger,{as:"button",type:"button",get"aria-label"(){return Ake(n.project)},"data-action":"project-switch",get"data-project"(){return ri(n.project.worktree)},get classList(){return{"flex items-center justify-center size-10 p-1 rounded-lg overflow-hidden transition-colors cursor-default":!0,"bg-transparent border-2 border-icon-strong-base hover:bg-surface-base-hover":n.selected(),"bg-transparent border border-transparent hover:bg-surface-base-hover hover:border-border-weak-base":!n.selected()&&!n.active(),"bg-surface-base-hover border border-border-weak-base":!n.selected()&&n.active()}},onPointerDown:o=>{if(o.button===0&&!o.ctrlKey){n.setOpen(!1),n.setSuppressHover(!0);return}n.overlay()&&(o.button!==2&&!(o.button===0&&o.ctrlKey)||(n.setOpen(!1),n.setSuppressHover(!0),o.preventDefault()))},onMouseEnter:o=>{n.overlay()&&(n.suppressHover()||n.onProjectMouseEnter(n.project.worktree,o))},onMouseLeave:()=>{n.suppressHover()&&n.setSuppressHover(!1),n.overlay()&&n.onProjectMouseLeave(n.project.worktree)},onFocus:()=>{n.overlay()&&(n.suppressHover()||n.onProjectFocus(n.project.worktree))},onClick:()=>{if(n.setOpen(!1),n.selected()){t.sidebar.toggle();return}n.navigateToProject(n.project.worktree)},onBlur:()=>n.setOpen(!1),get children(){return m(Pke,{get project(){return n.project},notify:!0})}}),m(Cc.Portal,{get children(){return m(Cc.Content,{get children(){return[m(Cc.Item,{onSelect:()=>n.showEditProjectDialog(n.project),get children(){return m(Cc.ItemLabel,{get children(){return n.language.t("common.edit")}})}}),m(Cc.Item,{"data-action":"project-workspaces-toggle",get"data-project"(){return ri(n.project.worktree)},get disabled(){return sn(()=>n.project.vcs!=="git")()&&!n.workspacesEnabled(n.project)},onSelect:()=>n.toggleProjectWorkspaces(n.project),get children(){return m(Cc.ItemLabel,{get children(){return sn(()=>!!n.workspacesEnabled(n.project))()?n.language.t("sidebar.workspaces.disable"):n.language.t("sidebar.workspaces.enable")}})}}),m(Cc.Item,{"data-action":"project-clear-notifications",get"data-project"(){return ri(n.project.worktree)},get disabled(){return i()===0},onSelect:r,get children(){return m(Cc.ItemLabel,{get children(){return n.language.t("sidebar.project.clearNotifications")}})}}),m(Cc.Separator,{}),m(Cc.Item,{"data-action":"project-close-menu",get"data-project"(){return ri(n.project.worktree)},onSelect:()=>n.closeProject(n.project.worktree),get children(){return m(Cc.ItemLabel,{get children(){return n.language.t("common.close")}})}})]}})}})]}})},r6i=n=>(()=>{var e=Q9i(),t=e.firstChild,i=t.firstChild,r=t.nextSibling,o=r.nextSibling,s=o.nextSibling;return W(i,()=>Ake(n.project)),W(r,()=>n.language.t("sidebar.project.recentSessions")),W(o,m(_e,{get when(){return n.workspaceEnabled()},get fallback(){return m(ei,{get each(){return n.projectSessions().slice(0,2)},children:a=>m(h5e,k(()=>n.ctx.sessionProps,{session:a,get list(){return n.projectSessions()},get slug(){return ri(n.project.worktree)},dense:!0,get mobile(){return n.mobile},popover:!1,get children(){return n.projectChildren()}}))})},get children(){return m(ei,{get each(){return n.workspaces()},children:a=>{const l=J(()=>n.workspaceSessions(a)),c=J(()=>n.workspaceChildren(a));return(()=>{var d=e6i(),u=d.firstChild,h=u.firstChild,f=h.nextSibling;return W(h,m(Cn,{name:"branch",size:"small",class:"text-icon-base"})),W(f,()=>n.label(a)),W(d,m(ei,{get each(){return l().slice(0,2)},children:p=>m(h5e,k(()=>n.ctx.sessionProps,{session:p,get list(){return l()},get slug(){return ri(a)},dense:!0,get mobile(){return n.mobile},popover:!1,get children(){return c()}}))}),null),d})()}})}})),W(s,m(to,{variant:"ghost",class:"flex w-full text-left justify-start text-text-base px-2 hover:bg-transparent active:bg-transparent",onClick:()=>{n.ctx.openSidebar(),n.ctx.onHoverOpenChanged(n.project.worktree,!1),!n.selected()&&n.ctx.navigateToProject(n.project.worktree)},get children(){return n.language.t("sidebar.project.viewAllSessions")}})),e})(),o6i=n=>{const e=G1(),t=ha(),i=hot(n.project.worktree),r=J(()=>n.ctx.currentProject()?.worktree===n.project.worktree),o=J(()=>n.ctx.workspaceIds(n.project).slice(0,2)),s=J(()=>n.ctx.workspacesEnabled(n.project)),a=J(()=>n.ctx.workspaceIds(n.project)),[l,c]=Yt({menu:!1,suppressHover:!1}),d=()=>n.ctx.hoverProject()===n.project.worktree,u=J(()=>!n.mobile&&n.ctx.sidebarOpened()),h=J(()=>!n.mobile&&!n.ctx.sidebarOpened()),f=J(()=>l.menu||(u()||h())&&d()),p=()=>d()&&u()&&!r()&&!l.menu,g=M=>{const[L]=e.child(M,{bootstrap:!1}),S=M===n.project.worktree?t.t("workspace.type.local"):t.t("workspace.type.sandbox"),I=n.ctx.workspaceLabel(M,L.vcs?.branch,n.project.id);return`${S} : ${I}`},v=J(()=>e.child(n.project.worktree,{bootstrap:!1})[0]),y=J(()=>P_(v(),n.sortNow())),C=J(()=>nse(v().session)),_=M=>{const[L]=e.child(M,{bootstrap:!1});return P_(L,n.sortNow())},w=M=>{const[L]=e.child(M,{bootstrap:!1});return nse(L.session)},x=()=>m(i6i,{get project(){return n.project},get mobile(){return n.mobile},get nav(){return n.ctx.nav},get sidebarHovering(){return n.ctx.sidebarHovering},selected:r,active:f,overlay:h,suppressHover:()=>l.suppressHover,dirs:a,get onProjectMouseEnter(){return n.ctx.onProjectMouseEnter},get onProjectMouseLeave(){return n.ctx.onProjectMouseLeave},get onProjectFocus(){return n.ctx.onProjectFocus},get navigateToProject(){return n.ctx.navigateToProject},get showEditProjectDialog(){return n.ctx.showEditProjectDialog},get toggleProjectWorkspaces(){return n.ctx.toggleProjectWorkspaces},get workspacesEnabled(){return n.ctx.workspacesEnabled},get closeProject(){return n.ctx.closeProject},setMenu:M=>c("menu",M),setOpen:M=>n.ctx.onHoverOpenChanged(n.project.worktree,M),setSuppressHover:M=>c("suppressHover",M),language:t});return(()=>{var M=t6i();return aa(i,M,()=>!0),W(M,m(_e,{get when(){return sn(()=>!!u())()&&!r()},get fallback(){return x()},get children(){return m(Iot,{get open(){return sn(()=>!!(!l.suppressHover&&p()))()&&!l.menu},openDelay:0,closeDelay:0,placement:"right-start",gutter:6,get trigger(){return x()},onOpenChange:L=>{l.menu||L&&l.suppressHover||(n.ctx.onHoverOpenChanged(n.project.worktree,L),L&&n.ctx.setHoverSession(void 0))},get children(){return m(r6i,{get project(){return n.project},get mobile(){return n.mobile},selected:r,workspaceEnabled:s,workspaces:o,label:g,projectSessions:y,projectChildren:C,workspaceSessions:_,workspaceChildren:w,get ctx(){return n.ctx},language:t})}})}})),st(()=>M.classList.toggle("opacity-30",!!i.isActiveDraggable)),M})()};var s6i=le('<div class="h-full w-full flex flex-col items-center gap-3 px-3 py-3 overflow-y-auto no-scrollbar">'),a6i=le('<div class="flex h-full w-full min-w-0 overflow-hidden"><div data-component=sidebar-rail class="w-16 shrink-0 bg-surface-raised-base flex flex-col items-center overflow-hidden"><div class="flex-1 min-h-0 w-full"></div><div class="shrink-0 w-full pt-3 pb-6 flex flex-col items-center gap-2"></div></div><div>'),l6i=le('<span class="text-icon-base text-12-medium">'),c6i=le('<div class="flex items-center gap-2"><span>');const d6i=n=>{const e=J(()=>!!n.mobile||n.opened()),t=()=>n.mobile?"bottom":"right";let i;return Re(()=>{const r=i;if(r){if(e()){r.removeAttribute("inert");return}r.setAttribute("inert","")}}),(()=>{var r=a6i(),o=r.firstChild,s=o.firstChild,a=s.nextSibling,l=o.nextSibling;return Ju(o,"mousemove",n.aimMove,!0),W(s,m(aot,{get onDragStart(){return n.handleDragStart},get onDragEnd(){return n.handleDragEnd},get onDragOver(){return n.handleDragOver},collisionDetector:oot,get children(){return[m(lot,{}),m(got,{}),(()=>{var c=s6i();return W(c,m(uot,{get ids(){return n.projects().map(d=>d.worktree)},get children(){return m(ei,{get each(){return n.projects()},children:d=>n.renderProject(d)})}}),null),W(c,m(ou,{get placement(){return t()},get value(){return(()=>{var d=c6i(),u=d.firstChild;return W(u,()=>n.openProjectLabel),W(d,m(_e,{get when(){return sn(()=>!n.mobile)()&&!!n.openProjectKeybind()},get children(){var h=l6i();return W(h,()=>n.openProjectKeybind()),h}}),null),d})()},get children(){return m(oa,{icon:"plus",variant:"ghost",size:"large",get onClick(){return n.onOpenProject},get"aria-label"(){return sn(()=>typeof n.openProjectLabel=="string")()?n.openProjectLabel:void 0}})}}),null),c})(),m(cot,{get children(){return n.renderProjectOverlay()}})]}})),W(a,m(Ort,{get placement(){return t()},get title(){return n.settingsLabel()},get keybind(){return n.settingsKeybind()??""},get children(){return m(oa,{icon:"settings-gear",variant:"ghost",size:"large",get onClick(){return n.onOpenSettings},get"aria-label"(){return n.settingsLabel()}})}}),null),W(a,m(ou,{get placement(){return t()},get value(){return n.helpLabel()},get children(){return m(oa,{icon:"help",variant:"ghost",size:"large",get onClick(){return n.onOpenHelp},get"aria-label"(){return n.helpLabel()}})}}),null),aa(c=>{i=c},l),W(l,()=>n.renderPanel()),st(c=>{var d={"flex-1 flex h-full min-h-0 min-w-0 overflow-hidden":!0,"pointer-events-none":!e()},u=!e();return c.e=Ko(l,d,c.e),u!==c.t&&mt(l,"aria-hidden",c.t=u),c},{e:void 0,t:void 0}),r})()};Fs(["mousemove"]);var u6i=le('<div class="flex flex-col gap-4 pl-6 pr-2.5 pb-3"><div class="flex flex-col gap-1"><span class="text-14-regular text-text-strong"></span><span class="text-12-regular text-text-weak"></span></div><div class="flex justify-end gap-2">'),h6i=le('<div class="flex flex-col gap-4 pl-6 pr-2.5 pb-3"><div class="flex flex-col gap-1"><span class="text-14-regular text-text-strong"></span><span class="text-12-regular text-text-weak"> <!> </span></div><div class="flex justify-end gap-2">'),f6i=le('<span class="text-12-regular text-text-base truncate select-text">'),p6i=le('<div class="shrink-0 pl-1 py-1"><div class="group/project flex items-start justify-between gap-2 py-2 pl-2 pr-0"><div class="flex flex-col min-w-0">'),g6i=le('<div class="flex-1 min-h-0 flex flex-col">'),m6i=le('<div><div class="shrink-0 px-3 py-3"><div class="rounded-xl bg-background-base shadow-xs-border-base"data-component=getting-started><div class="p-3 flex flex-col gap-6"><div class="flex flex-col gap-2"><div class="text-14-medium text-text-strong"></div><div class="text-14-regular text-text-base"style=line-height:var(--line-height-normal)></div><div class="text-14-regular text-text-base"style=line-height:var(--line-height-normal)></div></div><div data-component=getting-started-actions>'),v6i=le('<div class="flex-1 min-h-0 -mt-4 flex items-center justify-center px-6 pb-64 text-center"><div class="mt-8 flex max-w-60 flex-col items-center gap-6 text-center"><div class="flex flex-col gap-3"><div class="text-14-medium text-text-strong"></div><div class="text-14-regular text-text-base"style=line-height:var(--line-height-normal)>'),lRe=le('<div class="shrink-0 py-4">'),y6i=le('<div class="relative flex-1 min-h-0"><div class="size-full flex flex-col py-2 gap-4 overflow-y-auto no-scrollbar [overflow-anchor:none]">'),k6i=le('<div class="flex-1 min-h-0">'),C6i=le('<div class=" hidden w-12 shrink-0 bg-background-base flex flex-col items-center py-2 gap-2 z-20"><div class="flex-1 w-full flex flex-col items-center gap-1 overflow-y-auto no-scrollbar"><button type=button class="flex items-center justify-center size-9 p-1 rounded-md transition-colors hover:bg-surface-base-hover"></button></div><div class="shrink-0 w-full flex flex-col items-center gap-1 pb-2"><button type=button class="flex items-center justify-center size-9 p-1 rounded-md transition-colors hover:bg-surface-base-hover">'),cRe=le("<div class=size-full>"),b6i=le('<div class="relative bg-background-base flex-1 min-h-0 min-w-0 flex flex-col select-none [&amp;_input]:select-text [&amp;_textarea]:select-text [&amp;_[contenteditable]]:select-text"><div class="flex-1 min-h-0 min-w-0 flex overflow-hidden"><div class="flex-1 min-h-0 relative"><div class="size-full relative overflow-x-hidden"><div class=xl:hidden><div></div><nav data-component=sidebar-nav-mobile></nav></div><div><main>'),w6i=le('<button type=button class="flex items-center justify-center size-9 p-0.5 rounded-md transition-colors">');function _6i(n){const[e,t,,i]=vs(yo.global("layout.page",["layout.page.v1"]),Yt({lastProjectSession:{},activeProject:void 0,activeWorkspace:void 0,workspaceOrder:{},workspaceName:{},workspaceBranchName:{},workspaceExpanded:{},gettingStartedDismissed:!1,activityBarVisible:!0,minimapVisible:!1,panelMaximized:!1,panelPosition:"bottom",panelAlignment:"center"})),r=J(()=>i());let o,s=0,a=!1;const l=Aa(),c=bp(),d=G1(),u=_3(),h=J(()=>u.ready()),f=a2(),p=J_(),g=w3(),v=Iae(),y=dMn(),C=Y3e(),_=k3();q4i(_);const w=X3e(),x=oy(),M=sze(),L=qse(),S=ha(),I=nh(l.dir),E=J(()=>{const K=l.dir;if(!K)return{slug:K,dir:""};const ee=nh(K);return ee?{slug:K,dir:d.peek(ee,{bootstrap:!1})[0].path.directory||ee}:{slug:K,dir:""}}),A=J(()=>L.ids().map(K=>[K,L.themes()[K]])),T=["system","light","dark"],D={system:"theme.scheme.system",light:"theme.scheme.light",dark:"theme.scheme.dark"},R=K=>S.t(D[K]),P=J(()=>E().dir),[V,$]=Yt({autoselect:!I,busyWorkspaces:{},hoverSession:void 0,hoverProject:void 0,scrollSessionKey:void 0,nav:void 0,sortNow:Date.now(),sizing:!1,peek:void 0,peeked:!1}),j=_5i(),B=(K,ee)=>{const Ce=rn(K);if(ee){$("busyWorkspaces",Ce,!0);return}$("busyWorkspaces",jt(Se=>{delete Se[Ce]}))},te=K=>!!V.busyWorkspaces[rn(K)],U=()=>V.sortNow;let Y;const X=setTimeout(()=>{$("sortNow",Date.now()),Y=setInterval(()=>$("sortNow",Date.now()),6e4)},6e4-Date.now()%6e4),se=W4i({enabled:()=>!u.sidebar.opened(),active:()=>V.hoverProject,el:()=>V.nav?.querySelector("[data-component='sidebar-rail']")??V.nav,onActivate:K=>{d.child(K),$("hoverProject",K),$("hoverSession",void 0)}});Oe(()=>{a=!0,s+=1,clearTimeout(X),Y&&clearInterval(Y),We!==void 0&&clearTimeout(We),se.reset()}),ur(()=>{const K=()=>$("sizing",!1),ee=()=>Ke(),Ce=()=>{document.visibilityState==="hidden"&&Ke()};window.addEventListener("pointerup",K),window.addEventListener("pointercancel",K),window.addEventListener("blur",K),window.addEventListener("blur",ee),document.addEventListener("visibilitychange",Ce),Oe(()=>{window.removeEventListener("pointerup",K),window.removeEventListener("pointercancel",K),window.removeEventListener("blur",K),window.removeEventListener("blur",ee),document.removeEventListener("visibilitychange",Ce)})});const pe=J(()=>!u.sidebar.opened()&&V.hoverProject!==void 0),Ae=J(()=>u.sidebar.opened()||pe()),Fe=K=>{$("hoverProject",K),se.reset()},be=()=>queueMicrotask(()=>Fe(void 0)),Ve=K=>$("hoverSession",K),Ke=()=>{$("hoverSession",void 0),Fe(void 0)};let We;const At=J(()=>{const K=V.hoverProject;if(K)return u.projects.list().find(ee=>ee.worktree===K)});J(()=>{const K=V.peek;if(K)return u.projects.list().find(ee=>ee.worktree===K)}),Re(()=>{const K=At();if(K){We!==void 0&&(clearTimeout(We),We=void 0),$("peek",K.worktree),$("peeked",!0);return}$("peeked",!1),V.peek!==void 0&&(We!==void 0&&clearTimeout(We),We=window.setTimeout(()=>{We=void 0,$("peek",void 0)},180))}),Re(()=>{u.sidebar.opened()&&Fe(void 0)}),Re(()=>{if(!V.autoselect)return;const K=l.dir;!K||!nh(K)||$("autoselect",!1)});const Ct=j.editorOpen,Z=j.openEditor,wt=j.closeEditor,vt=j.setEditor,cn=j.InlineEditor,Lt=()=>{u.sidebar.opened()||Ke()},Qt=K=>{Lt(),_(K),u.mobileSidebar.hide()},vr=K=>{if(!K)return;Lt();const ee=ri(K);c.createClient({directory:K,throwOnError:!0}).session.create().then(Se=>Se.data??void 0).then(Se=>{if(!Se)return;const Ge=ts(K,Se.id);u.handoff.setTabs(ee,Se.id);const[qe,Et]=d.child(K,{bootstrap:!1});qe.session.some(Nt=>Nt.id===Se.id)||(Et("session",Nt=>[...Nt,Se]),Et("sessionTotal",Nt=>Math.max(Nt,qe.sessionTotal+1))),Vt(K,Se.id,Ge);const en=new URLSearchParams(window.location.search).get("view");_(`/${ee}/session/${Se.id}${en?`?view=${encodeURIComponent(en)}`:""}`),u.mobileSidebar.hide()}).catch(Se=>{y.push(`${S.t("prompt.toast.sessionCreateFailed.title")}: ${TL(Se,S.t("common.requestFailed"))}`,"toast")})};function qs(K=1){const ee=A().map(([qe])=>qe);if(ee.length===0)return;const Ce=ee.indexOf(L.themeId()),Se=Ce===-1?0:(Ce+K+ee.length)%ee.length,Ge=ee[Se];L.setTheme(Ge),y.push(`${S.t("toast.theme.title")}: ${L.name(Ge)}`,"toast")}function oo(K=1){const ee=L.colorScheme(),Ce=T.indexOf(ee),Se=Ce===-1?0:(Ce+K+T.length)%T.length,Ge=T[Se];L.setColorScheme(Ge),y.push(`${S.t("toast.scheme.title")}: ${R(Ge)}`,"toast")}function Ms(K){K!==S.locale()&&(S.setLocale(K),y.push(`${S.t("toast.language.title")}: ${S.t("toast.language.description",{language:S.label(K)})}`,"toast"))}function Zi(K=1){const ee=S.locales,Ce=ee.indexOf(S.locale()),Se=Ce===-1?0:(Ce+K+ee.length)%ee.length,Ge=ee[Se];Ge&&Ms(Ge)}function Ri(K){const ee=p.appearance.fontSize();p.appearance.setFontSize(Math.max(8,Math.min(72,ee+K)))}function di(){p.appearance.setFontSize(14)}const bi=()=>ur(()=>{if(!f.checkUpdate||!f.update||!f.restart)return;let K;const ee=()=>f.checkUpdate().then(({updateAvailable:Ce,version:Se})=>{Ce&&y.push(`${S.t("toast.update.title")}: ${S.t("toast.update.description",{version:Se??""})}`,"toast")});Re(()=>{if(p.ready()){if(!p.updates.startup()){if(K===void 0)return;clearInterval(K),K=void 0;return}K===void 0&&(ee(),K=setInterval(ee,600*1e3))}}),Oe(()=>{K!==void 0&&clearInterval(K)})}),wo=()=>ur(()=>{const K=new Map,ee=5e3,Ce=c.event.listen(Se=>{if(Se.details?.type==="worktree.ready"){B(Se.name,!1),EL.ready(Se.name);return}if(Se.details?.type==="worktree.failed"){B(Se.name,!1),EL.failed(Se.name,Se.details.properties?.message??S.t("common.requestFailed"));return}if(Se.details?.type==="question.replied"||Se.details?.type==="question.rejected"||Se.details?.type==="permission.replied"){const ma=Se.details.properties,Dh=`${Se.name}:${ma.sessionID}`;K.delete(Dh);return}if(Se.details?.type!=="permission.asked"&&Se.details?.type!=="question.asked")return;const Ge=Se.details.type==="permission.asked"?S.t("notification.permission.title"):S.t("notification.question.title");Se.details.type;const qe=Se.name,Et=Se.details.properties;if(Se.details.type==="permission.asked"&&C.autoResponds(Se.details.properties,qe))return;const[Gt]=d.child(qe,{bootstrap:!1}),en=Gt.session.find(ma=>ma.id===Et.sessionID),Nt=`${qe}:${Et.sessionID}`,Ft=en?.title??S.t("command.session.new"),ji=Ds(qe),Cr=Se.details.type==="permission.asked"?S.t("notification.permission.description",{sessionTitle:Ft,projectName:ji}):S.t("notification.question.description",{sessionTitle:Ft,projectName:ji}),ar=`/${ri(qe)}/session/${Et.sessionID}`,Er=Date.now(),Ki=K.get(Nt)??0;if(Er-Ki<ee)return;K.set(Nt,Er),Se.details.type==="permission.asked"&&(p.sounds.permissionsEnabled()&&q2e(p.sounds.permissions()),p.notifications.permissions()&&f.notify(Ge,Cr,ar)),Se.details.type==="question.asked"&&p.notifications.agent()&&f.notify(Ge,Cr,ar);const zn=l.id;rn(qe)===rn(P())&&Et.sessionID===zn||rn(qe)===rn(P())&&en?.parentID===zn||y.push(`${Ge}: ${Cr}`,"toast")});Oe(Ce),Re(()=>{const Se=l.id;if(!P()||!Se)return;const Ge=`${P()}:${Se}`;K.delete(Ge);const[qe]=d.child(P(),{bootstrap:!1}),Et=qe.session.filter(Gt=>Gt.parentID===Se);for(const Gt of Et)K.delete(`${P()}:${Gt.id}`)})});bi(),wo();function Us(K,ee){if(!o||V.scrollSessionKey===ee)return;const Ce=o.querySelector(`[data-session-id="${K}"]`);if(!Ce)return;const Se=o.getBoundingClientRect(),Ge=Ce.getBoundingClientRect();if(Ge.top>=Se.top&&Ge.bottom<=Se.bottom){$("scrollSessionKey",ee);return}$("scrollSessionKey",ee),Ce.scrollIntoView({block:"nearest",behavior:"smooth"})}const Pi=J(()=>{const K=P();if(!K)return;const ee=rn(K),Ce=u.projects.list(),Se=Ce.find(Nt=>Nt.sandboxes?.some(Ft=>rn(Ft)===ee));if(Se)return Se;const Ge=Ce.find(Nt=>rn(Nt.worktree)===ee);if(Ge)return Ge;const[qe]=d.child(K,{bootstrap:!1}),Et=qe.project;if(!Et)return;const en=d.data.project.find(Nt=>Nt.id===Et)?.worktree;if(en)return Ce.find(Nt=>Nt.worktree===en)}),[fr]=mo(async()=>{if(await i.promise,await u.ready.promise,!Mn(()=>V.autoselect))return;const K=u.projects.list(),ee=g.projects.last();if(K.length===0){if(!ee)return;await Le(ee,!0);return}const Ce=K.find(Se=>Se.worktree===ee)??K[0];Ce&&await Le(Ce.worktree,!0)},{initialValue:void 0}),sr=(K,ee,Ce)=>{const Se=rn(K),Ge=e.workspaceName[Se]??e.workspaceName[K];if(Ge)return Ge;if(ee&&Ce)return e.workspaceBranchName[ee]?.[Ce]},Kr=(K,ee,Ce,Se)=>{const Ge=rn(K);t("workspaceName",Ge,ee),Ce&&Se&&(e.workspaceBranchName[Ce]||t("workspaceBranchName",Ce,{}),t("workspaceBranchName",Ce,Se,ee))},Oi=(K,ee,Ce)=>sr(K,Ce,ee)??ee??Ds(K),Ir=J(()=>{const K=Pi();return!K||K.vcs!=="git"?!1:u.sidebar.workspaces(K.worktree)()}),es=J(()=>{const K=Pi();if(!K)return[];if(!Ir())return[K.worktree];const ee=P();return rS(K).filter(Ce=>{const Se=e.workspaceExpanded[Ce]??Ce===K.worktree,Ge=rn(Ce)===rn(ee);return Se||Ge})});Re(()=>{if(!r()||!h())return;const K=u.projects.list();for(const[ee,Ce]of Object.entries(e.workspaceExpanded)){if(!Ce)continue;const Se=rn(ee),Ge=K.find(qe=>rn(qe.worktree)===Se||qe.sandboxes?.some(Et=>rn(Et)===Se));Ge&&(Ge.vcs==="git"&&u.sidebar.workspaces(Ge.worktree)()||t("workspaceExpanded",ee,!1))}});const eo=J(()=>{const K=Date.now(),ee=es();if(ee.length===0)return[];const Ce=[];for(const Se of ee){const[Ge]=d.child(Se,{bootstrap:!0}),qe=P_(Ge,K);Ce.push(...qe)}return Ce}),Kn=200,gc=2,Pa=10,mc=4,yr={value:0},_o=new Map,Te=10,He=new Map,yt=K=>{const ee=He.get(K);if(ee)return ee;const Ce=new Set;return He.set(K,Ce),Ce},at=(K,ee)=>{const Ce=yt(K);return yUe({seen:Ce,keep:ee,limit:Te,preserve:l.id&&rn(K)===rn(P())?[l.id]:void 0})};Re(()=>{const K=new Set(es());for(const ee of[...He.keys()])K.has(ee)||He.delete(ee)}),Re(()=>{E(),c.url,yr.value+=1,Cbn(),_o.clear()}),Re(()=>{const K=new Set(es());for(const[ee,Ce]of _o)K.has(ee)||(Ce.pending.length=0,Ce.pendingSet.clear(),Ce.running===0&&_o.delete(ee))});const G=K=>{const ee=_o.get(K);if(ee)return ee;const Ce={inflight:new Set,pending:[],pendingSet:new Set,running:0};return _o.set(K,Ce),Ce},ne=(K,ee)=>{if(K.length===0)return ee.slice().sort((Se,Ge)=>Se.id<Ge.id?-1:Se.id>Ge.id?1:0);const Ce=new Map;for(const Se of K)Ce.set(Se.id,Se);for(const Se of ee)Ce.set(Se.id,Se);return[...Ce.values()].sort((Se,Ge)=>Se.id<Ge.id?-1:Se.id>Ge.id?1:0)};async function oe(K,ee,Ce){const[Se,Ge]=d.child(K,{bootstrap:!1});return bbn({directory:K,sessionID:ee,task:qe=>Uo(()=>c.client.session.messages({directory:K,sessionID:ee,limit:Kn})).then(Et=>{if(yr.value!==Ce||!q_e(K,ee,qe))return;const Gt=(Et.data??[]).filter(Ki=>!!Ki?.info?.id),en=Gt.map(Ki=>Ki.info).filter(Ki=>!!Ki?.id),Nt=ne([],en),Ft=at(K,ee),ji=Et.response.headers.get("x-next-cursor")??void 0,Cr={limit:Nt.length,cursor:ji,complete:!ji,at:Date.now()};if(Ft.length>0){pUe(K,Ft);for(const Ki of Ft)d.todo.set(Ki,void 0)}const ar=Se.message[ee]??[],Er=ne(ar.filter(Ki=>!!Ki?.id),Nt);if(q_e(K,ee,qe))return pn(()=>{Ft.length>0&&Ge(jt(Ki=>{wae(Ki,Ft)})),Ge("message",ee,vn(Er,{key:"id"})),fUe({directory:K,sessionID:ee,...Cr});for(const Ki of Gt){const zn=Se.part[Ki.info.id]??[],ma=ne(zn.filter(Dh=>!!Dh?.id),Ki.parts.filter(Dh=>!!Dh?.id));Ge("part",Ki.info.id,vn(ma,{key:"id"}))}}),Cr}).catch(()=>{})})}const ae=K=>{const ee=G(K);if(ee.running>=gc)return;const Ce=ee.pending.shift();if(!Ce)return;ee.pendingSet.delete(Ce),ee.inflight.add(Ce),ee.running+=1;const Se=yr.value;oe(K,Ce,Se).finally(()=>{ee.running-=1,ee.inflight.delete(Ce),ae(K)})},me=(K,ee="low")=>{const Ce=K.directory;if(!Ce)return;const[Se]=d.child(Ce,{bootstrap:!1});if(Mn(()=>{const en=I2e(Ce,K.id);return ybn({message:Se.message[K.id]!==void 0,info:en,chunk:Kn})}))return;const qe=G(Ce);if(qe.inflight.has(K.id))return;if(qe.pendingSet.has(K.id)){if(ee!=="high")return;const en=qe.pending.indexOf(K.id);en>0&&(qe.pending.splice(en,1),qe.pending.unshift(K.id));return}const Et=yt(Ce);if(!(!Et.has(K.id)&&Et.size>=Te&&ee!=="high")){for(ee==="high"&&qe.pending.unshift(K.id),ee!=="high"&&qe.pending.push(K.id),qe.pendingSet.add(K.id);qe.pending.length>Pa;){const en=qe.pending.pop();en&&qe.pendingSet.delete(en)}ae(Ce)}},Me=(K,ee)=>{for(let Ce=1;Ce<=mc;Ce++){const Se=K[ee+Ce];Se&&me(Se,Ce===1?"high":"low");const Ge=K[ee-Ce];Ge&&me(Ge,Ce===1?"high":"low")}};Re(()=>{const K=eo();if(K.length===0)return;const ee=l.id?K.findIndex(Ce=>Ce.id===l.id):0;if(ee!==-1){if(!l.id){const Ce=K[ee];Ce&&me(Ce,"high")}Me(K,ee)}});function Pe(K){const ee=eo();if(ee.length===0)return;const Ce=l.id?ee.findIndex(qe=>qe.id===l.id):-1;let Se;Ce===-1?Se=K>0?0:ee.length-1:Se=(Ce+K+ee.length)%ee.length;const Ge=ee[Se];Ge&&(me(Ge,"high"),Me(ee,Se),re(Ge))}function it(K){const ee=u.projects.list();if(ee.length===0)return;const Ce=Pi()?.worktree,Se=P()?_i(P()):void 0,Ge=Ce??Se,qe=Ge?ee.findIndex(Gt=>Gt.worktree===Ge):-1,Et=qe===-1?K>0?ee[0]:ee[ee.length-1]:ee[(qe+K+ee.length)%ee.length];Et&&(d.child(Et.worktree),Le(Et.worktree))}function xt(K){const ee=eo();if(ee.length===0||!ee.some(qe=>v.session.unseenCount(qe.id)>0))return;const Se=l.id?ee.findIndex(qe=>qe.id===l.id):-1,Ge=Se===-1?K>0?-1:0:Se;for(let qe=1;qe<=ee.length;qe++){const Et=K>0?(Ge+qe)%ee.length:(Ge-qe+ee.length)%ee.length,Gt=ee[Et];if(Gt&&v.session.unseenCount(Gt.id)!==0){me(Gt,"high"),Me(ee,Et),re(Gt);return}}}async function Zt(K){const[ee,Ce]=d.child(K.directory),Se=ee.session??[],Ge=Se.findIndex(Et=>Et.id===K.id),qe=Se[Ge+1]??Se[Ge-1];await c.client.session.update({directory:K.directory,sessionID:K.id,time:{archived:Date.now()}}),Ce(jt(Et=>{const Gt=br.search(Et.session,K.id,en=>en.id);Gt.found&&Et.session.splice(Gt.index,1)})),K.id===l.id&&_(qe?`/${l.dir}/session/${qe.id}`:`/${l.dir}/session`)}M.register("layout",()=>{const K=[{id:"sidebar.toggle",title:S.t("command.sidebar.toggle"),category:S.t("command.category.view"),keybind:"mod+b",onSelect:()=>u.sidebar.toggle()},{id:"project.open",title:S.t("command.project.open"),category:S.t("command.category.project"),keybind:"mod+o",onSelect:()=>Nr()},{id:"project.previous",title:S.t("command.project.previous"),category:S.t("command.category.project"),keybind:"mod+alt+arrowup",onSelect:()=>it(-1)},{id:"project.next",title:S.t("command.project.next"),category:S.t("command.category.project"),keybind:"mod+alt+arrowdown",onSelect:()=>it(1)},{id:"provider.connect",title:S.t("command.provider.connect"),category:S.t("command.category.provider"),onSelect:()=>Tn()},{id:"server.switch",title:S.t("command.server.switch"),category:S.t("command.category.server"),onSelect:()=>Gn()},{id:"settings.open",title:S.t("command.settings.open"),category:S.t("command.category.settings"),keybind:"mod+shift+,",onSelect:()=>wi()},{id:"settings.shortcuts",title:S.t("command.settings.shortcuts"),category:S.t("command.category.settings"),keybind:"mod+shift+k",onSelect:()=>{const ee=++s;z(()=>import("./dialog-settings-dlh01Gq9.js"),__vite__mapDeps([101,102,103,104,105,106,107])).then(Ce=>{a||s!==ee||x.show(()=>m(Ce.DialogSettings,{tab:"shortcuts"}))})}},{id:"session.previous",title:S.t("command.session.previous"),category:S.t("command.category.session"),keybind:"mod+,",onSelect:()=>Pe(-1)},{id:"session.next",title:S.t("command.session.next"),category:S.t("command.category.session"),keybind:"mod+.",onSelect:()=>Pe(1)},{id:"view.toggleMinimap",title:S.t("command.view.toggleMinimap"),category:S.t("command.category.view"),keybind:"mod+shift+m,mod+alt+m",onSelect:()=>t("minimapVisible",ee=>!ee)},{id:"view.toggleMaximizedPanel",title:S.t("command.view.toggleMaximizedPanel"),category:S.t("command.category.view"),keybind:"ctrl+tab",onSelect:()=>t("panelMaximized",ee=>!ee)},{id:"view.toggleActivityBar",title:S.t("command.view.toggleActivityBar"),category:S.t("command.category.view"),keybind:"mod+shift+b",onSelect:()=>t("activityBarVisible",ee=>!ee)},{id:"view.moveSidebarLeft",title:S.t("command.view.moveSidebarLeft"),category:S.t("command.category.view"),keybind:"ctrl+shift+alt+left",onSelect:()=>{}},{id:"view.moveSidebarRight",title:S.t("command.view.moveSidebarRight"),category:S.t("command.category.view"),keybind:"ctrl+shift+alt+right",onSelect:()=>{}},{id:"view.alignPanelCenter",title:S.t("command.view.alignPanelCenter"),category:S.t("command.category.view"),keybind:"ctrl+shift+down",onSelect:()=>t("panelAlignment","center")},{id:"view.positionPanelBottom",title:S.t("command.view.positionPanelBottom"),category:S.t("command.category.view"),keybind:"ctrl+shift+down",onSelect:()=>t("panelPosition","bottom")},{id:"view.positionPanelRight",title:S.t("command.view.positionPanelRight"),category:S.t("command.category.view"),keybind:"ctrl+shift+right",onSelect:()=>t("panelPosition","right")},{id:"view.positionPanelLeft",title:S.t("command.view.positionPanelLeft"),category:S.t("command.category.view"),keybind:"ctrl+shift+left",onSelect:()=>t("panelPosition","left")},{id:"app.quit",title:S.t("command.app.quit"),category:S.t("command.category.app"),keybind:"mod+alt+q",onSelect:()=>{}},{id:"app.reload",title:S.t("command.app.reload"),category:S.t("command.category.app"),keybind:"mod+shift+alt+r",onSelect:()=>window.location.reload()},{id:"app.restart",title:S.t("command.app.restart"),category:S.t("command.category.app"),keybind:"mod+shift+r",onSelect:()=>{f.restart?.()}},{id:"theme.select",title:S.t("command.theme.select"),category:S.t("command.category.theme"),keybind:"alt+t",onSelect:()=>{}},{id:"theme.toggleLightDark",title:S.t("command.theme.toggleLightDark"),category:S.t("command.category.theme"),keybind:"mod+shift+alt+t",onSelect:()=>oo(1)},{id:"editor.fontZoomIn",title:S.t("command.editor.fontZoomIn"),category:S.t("command.category.editor"),keybind:"mod+alt+=",onSelect:()=>Ri(1)},{id:"editor.fontZoomOut",title:S.t("command.editor.fontZoomOut"),category:S.t("command.category.editor"),keybind:"mod+alt+-",onSelect:()=>Ri(-1)},{id:"editor.fontZoomReset",title:S.t("command.editor.fontZoomReset"),category:S.t("command.category.editor"),keybind:"alt+0",onSelect:()=>di()},{id:"terminal.fontZoomIn",title:S.t("command.terminal.fontZoomIn"),category:S.t("command.category.terminal"),keybind:"mod+ctrl+alt+=",onSelect:()=>Ri(1)},{id:"terminal.fontZoomOut",title:S.t("command.terminal.fontZoomOut"),category:S.t("command.category.terminal"),keybind:"mod+ctrl+alt+-",onSelect:()=>Ri(-1)},{id:"session.previous.unseen",title:S.t("command.session.previous.unseen"),category:S.t("command.category.session"),keybind:"shift+alt+arrowup",onSelect:()=>xt(-1)},{id:"session.next.unseen",title:S.t("command.session.next.unseen"),category:S.t("command.category.session"),keybind:"shift+alt+arrowdown",onSelect:()=>xt(1)},{id:"session.archive",title:S.t("command.session.archive"),category:S.t("command.category.session"),keybind:"mod+shift+backspace",disabled:!l.dir||!l.id,onSelect:()=>{const ee=eo().find(Ce=>Ce.id===l.id);ee&&Zt(ee)}},{id:"workspace.new",title:S.t("workspace.new"),category:S.t("command.category.workspace"),keybind:"mod+shift+w",disabled:!Ir(),onSelect:()=>{const ee=Pi();if(ee)return Hke(ee)}},{id:"workspace.toggle",title:S.t("command.workspace.toggle"),description:S.t("command.workspace.toggle.description"),category:S.t("command.category.workspace"),slash:"workspace",disabled:!Pi()||Pi()?.vcs!=="git",onSelect:()=>{const ee=Pi();if(!ee||ee.vcs!=="git")return;const Ce=u.sidebar.workspaces(ee.worktree)();u.sidebar.toggleWorkspaces(ee.worktree),y.push(`${Ce?S.t("toast.workspace.disabled.title"):S.t("toast.workspace.enabled.title")}: ${Ce?S.t("toast.workspace.disabled.description"):S.t("toast.workspace.enabled.description")}`,"toast")}},...ih()?[]:[{id:"theme.cycle",title:S.t("command.theme.cycle"),category:S.t("command.category.theme"),keybind:"mod+shift+t",onSelect:()=>qs(1)}]];if(!ih())for(const[ee]of A())K.push({id:`theme.set.${ee}`,title:S.t("command.theme.set",{theme:L.name(ee)}),category:S.t("command.category.theme"),onSelect:()=>L.commitPreview(),onHighlight:()=>(L.previewTheme(ee),()=>L.cancelPreview())});K.push({id:"theme.scheme.cycle",title:S.t("command.theme.scheme.cycle"),category:S.t("command.category.theme"),keybind:"mod+shift+s",onSelect:()=>oo(1)});for(const ee of T)K.push({id:`theme.scheme.${ee}`,title:S.t("command.theme.scheme.set",{scheme:R(ee)}),category:S.t("command.category.theme"),onSelect:()=>L.commitPreview(),onHighlight:()=>(L.previewColorScheme(ee),()=>L.cancelPreview())});K.push({id:"language.cycle",title:S.t("command.language.cycle"),category:S.t("command.category.language"),onSelect:()=>Zi(1)});for(const ee of S.locales)K.push({id:`language.set.${ee}`,title:S.t("command.language.set",{language:S.label(ee)}),category:S.t("command.category.language"),onSelect:()=>Ms(ee)});return K});function Tn(){const K=++s;z(()=>import("./dialog-select-provider-ChOqW068.js").then(ee=>ee.d),__vite__mapDeps([107,103,106,105])).then(ee=>{a||s!==K||x.show(()=>m(ee.DialogSelectProvider,{}))})}function Gn(){const K=++s;z(()=>import("./dialog-select-server-IGj0oeBZ.js"),__vite__mapDeps([108,103,109])).then(ee=>{a||s!==K||x.show(()=>m(ee.DialogSelectServer,{}))})}function wi(){const K=++s;z(()=>import("./dialog-settings-dlh01Gq9.js"),__vite__mapDeps([101,102,103,104,105,106,107])).then(ee=>{a||s!==K||x.show(()=>m(ee.DialogSettings,{}))})}function _i(K){const ee=rn(K),Ce=u.projects.list().find(Gt=>rn(Gt.worktree)===ee||Gt.sandboxes?.some(en=>rn(en)===ee));if(Ce)return Ce.worktree;const Se=Object.entries(e.workspaceOrder).find(([Gt,en])=>rn(Gt)===ee||en.some(Nt=>rn(Nt)===ee));if(Se)return Se[0];const[Ge]=d.child(K,{bootstrap:!1}),qe=Ge.project;return qe?d.data.project.find(Gt=>Gt.id===qe)?.worktree??K:K}function zo(K){return Pi()?.worktree??_i(K)}function ts(K,ee,Ce=zo(K)){return t("lastProjectSession",Ce,{directory:K,id:ee,at:Date.now()}),Ce}function nd(K){e.lastProjectSession[K]&&t("lastProjectSession",jt(ee=>{delete ee[K]}))}function Vt(K,ee,Ce=zo(K)){return ts(K,ee,Ce),v.session.markViewed(ee),Mn(()=>e.workspaceExpanded[K])===!1&&t("workspaceExpanded",K,!0),requestAnimationFrame(()=>Us(ee,`${K}:${ee}`)),Ce}async function de(K){if(!K)return;const ee=_i(K);g.projects.touch(ee);const Ce=u.projects.list().find(Ft=>Ft.worktree===ee);let Se=Ce?AL(ee,[ee,...Ce.sandboxes??[]],e.workspaceOrder[ee]):[ee];const Ge=Ft=>Ft?Se.some(ji=>rn(ji)===rn(Ft)):!1,qe=async Ft=>{if(!Ft||Ft===ee||Ge(Ft))return Ge(Ft);const ji=await c.client.worktree.list({directory:ee}).then(Cr=>Cr.data??[]).catch(()=>[]);return Se=AL(ee,[ee,...ji],e.workspaceOrder[ee]),Ge(Ft)},Et=async Ft=>{if(!Ge(Ft.directory))return!1;const[ji]=d.child(Ft.directory,{bootstrap:!1});if(ji.session.some(ar=>ar.id===Ft.id))return t("lastProjectSession",ee,{directory:Ft.directory,id:Ft.id,at:Date.now()}),Qt(`/${ri(Ft.directory)}/session/${Ft.id}`),!0;const Cr=await c.client.session.get({sessionID:Ft.id}).then(ar=>ar.data).catch(()=>{});return!Cr?.directory||!Ge(Cr.directory)?!1:(t("lastProjectSession",ee,{directory:Cr.directory,id:Cr.id,at:Date.now()}),Qt(`/${ri(Cr.directory)}/session/${Cr.id}`),!0)},Gt=e.lastProjectSession[ee];if(Gt?.id){if(await qe(Gt.directory),await Et(Gt))return;nd(ee)}const en=iRe(Se.map(Ft=>d.child(Ft,{bootstrap:!1})[0]),Date.now());if(en&&await Et(en))return;const Nt=iRe(await Promise.all(Se.map(async Ft=>({path:{directory:Ft},session:await c.client.session.list({directory:Ft}).then(ji=>ji.data??[]).catch(()=>[])}))),Date.now());Nt&&await Et(Nt)||Qt(`/${ri(ee)}/session`)}function re(K){K&&Qt(`/${ri(K.directory)}/session/${K.id}`)}function Le(K,ee=!0){if(u.projects.open(K),ee)return de(K)}const lt=K=>{if(g.isLocal()){for(const ee of k5i(K))Le(ee);for(const ee of C5i(K)){Le(ee.directory,!1);const Ce=ri(ee.directory);ee.prompt&&G4i(Ce,{prompt:ee.prompt});const Se=ee.prompt?`/${Ce}/session?prompt=${encodeURIComponent(ee.prompt)}`:`/${Ce}/session`;Qt(Se)}}};ur(()=>{const K=ee=>{const Se=ee.detail?.urls??[];Se.length!==0&&lt(Se)};lt(b5i(window)),window.addEventListener(rRe,K),Oe(()=>window.removeEventListener(rRe,K))});async function Fn(K,ee){const Ce=Ake(K);if(ee===Ce)return;const Se=ee===Ds(K.worktree)?"":ee;if(K.id&&K.id!=="global"){await c.client.project.update({projectID:K.id,directory:K.worktree,name:Se});return}d.project.meta(K.worktree,{name:Se})}const xi=(K,ee,Ce,Se)=>{(sr(K,Ce,Se)??Se??Ds(K))!==ee&&Kr(K,ee,Ce,Se)};function ui(K){const ee=u.projects.list(),Ce=rn(K),Se=ee.findIndex(Et=>rn(Et.worktree)===Ce),Ge=rn(Pi()?.worktree??"")===Ce;if(Se===-1)return;const qe=ee[Se+1];if(!Ge){u.projects.close(K);return}if(!qe){u.projects.close(K),_("/");return}Qt(`/${ri(qe.worktree)}/session`),u.projects.close(K),queueMicrotask(()=>{de(qe.worktree)})}function kr(K){if(u.sidebar.workspaces(K.worktree)()){u.sidebar.toggleWorkspaces(K.worktree);return}K.vcs==="git"&&u.sidebar.toggleWorkspaces(K.worktree)}const Zs=K=>{const ee=++s;z(()=>import("./dialog-edit-project-vZHe6bbF.js"),[]).then(Ce=>{a||s!==ee||x.show(()=>m(Ce.DialogEditProject,{project:K}))})};async function Nr(){function K(ee){if(Array.isArray(ee)){for(const Ce of ee)Le(Ce,!1);de(ee[0])}else ee&&Le(ee)}if(f.openDirectoryPickerDialog&&g.isLocal()){const ee=await f.openDirectoryPickerDialog?.({title:S.t("command.project.open"),multiple:!0});K(ee)}else{const ee=++s;z(()=>import("./dialog-select-directory-DbmMIanK.js"),__vite__mapDeps([110,103])).then(Ce=>{a||s!==ee||x.show(()=>m(Ce.DialogSelectDirectory,{multiple:!0,onSelect:K}),()=>K(null))})}}const k2=async(K,ee,Ce=!1)=>{if(ee===K)return;const Se=P(),Ge=rn(Se),qe=rn(ee),Et=Ce||!!l.dir&&Ge===qe;!Ce&&Et&&Qt(`/${ri(K)}/session`),B(ee,!0);const Gt=await c.client.worktree.remove({directory:K,worktreeRemoveInput:{directory:ee}}).then(ar=>ar.data).catch(ar=>(y.push(`${S.t("workspace.delete.failed.title")}: ${TL(ar,S.t("common.requestFailed"))}`,"toast"),!1));if(B(ee,!1),!Gt||(rn(e.lastProjectSession[K]?.directory??"")===rn(ee)&&nd(K),d.set("project",jt(ar=>{const Er=ar.find(Ki=>Ki.worktree===K);Er&&(Er.sandboxes=(Er.sandboxes??[]).filter(Ki=>Ki!==ee))})),t("workspaceOrder",K,ar=>(ar??[]).filter(Er=>Er!==ee)),u.projects.close(ee),u.projects.open(K),Et))return;const en=P(),Nt=rn(en),Ft=u.projects.list().find(ar=>ar.worktree===K),Cr=(Ft?AL(K,[K,...Ft.sandboxes??[]],e.workspaceOrder[K]):[K]).some(ar=>rn(ar)===Nt);l.dir&&_i(en)===K&&!Cr&&Qt(`/${ri(K)}/session`)},xo=async(K,ee)=>{if(ee===K)return;B(ee,!0),y.push(`${S.t("workspace.resetting.title")}: ${S.t("workspace.resetting.description")}`,"toast");const Ce=await c.client.session.list({directory:ee}).then(qe=>qe.data??[]).catch(()=>[]);if(JSn(ee,Ce.map(qe=>qe.id),f),await c.client.instance.dispose({directory:ee}).catch(()=>{}),!await c.client.worktree.reset({directory:K,worktreeResetInput:{directory:ee}}).then(qe=>qe.data).catch(qe=>(y.push(`${S.t("workspace.reset.failed.title")}: ${TL(qe,S.t("common.requestFailed"))}`,"toast"),!1))){B(ee,!1);return}const Ge=Date.now();await Promise.all(Ce.filter(qe=>qe.time.archived===void 0).map(qe=>c.client.session.update({sessionID:qe.id,directory:qe.directory,time:{archived:Ge}}).catch(()=>{}))),B(ee,!1),y.push(`${S.t("workspace.reset.success.title")}: ${S.t("workspace.reset.success.description")}`,"toast")};function tS(K){const ee=J(()=>Ds(K.directory)),[Ce,Se]=Yt({status:"loading",dirty:!1});ur(()=>{c.client.file.status({directory:K.directory}).then(Et=>{const en=(Et.data??[]).length>0;Se({status:"ready",dirty:en})}).catch(()=>{Se({status:"error",dirty:!1})})});const Ge=()=>{const Et=!!l.dir&&rn(P())===rn(K.directory);Et&&Qt(`/${ri(K.root)}/session`),x.close(),k2(K.root,K.directory,Et)},qe=()=>Ce.status==="loading"?S.t("workspace.status.checking"):Ce.status==="error"?S.t("workspace.status.error"):Ce.dirty?S.t("workspace.status.dirty"):S.t("workspace.status.clean");return m(aie,{get title(){return S.t("workspace.delete.title")},fit:!0,get children(){var Et=u6i(),Gt=Et.firstChild,en=Gt.firstChild,Nt=en.nextSibling,Ft=Gt.nextSibling;return W(en,()=>S.t("workspace.delete.confirm",{name:ee()})),W(Nt,qe),W(Ft,m(to,{variant:"ghost",size:"large",onClick:()=>x.close(),get children(){return S.t("common.cancel")}}),null),W(Ft,m(to,{variant:"primary",size:"large",get disabled(){return Ce.status==="loading"},onClick:Ge,get children(){return S.t("workspace.delete.button")}}),null),Et}})}function nS(K){const ee=J(()=>Ds(K.directory)),[Ce,Se]=Yt({status:"loading",dirty:!1,sessions:[]}),Ge=async()=>{const Ft=(await c.client.session.list({directory:K.directory}).then(ji=>ji.data??[]).catch(()=>[])).filter(ji=>ji.time.archived===void 0);Se({sessions:Ft})};ur(()=>{c.client.file.status({directory:K.directory}).then(Nt=>{const ji=(Nt.data??[]).length>0;Se({status:"ready",dirty:ji}),Ge()}).catch(()=>{Se({status:"error",dirty:!1})})});const qe=()=>{x.close(),xo(K.root,K.directory)},Et=()=>Ce.sessions.length,Gt=()=>Ce.status==="loading"?S.t("workspace.status.checking"):Ce.status==="error"?S.t("workspace.status.error"):Ce.dirty?S.t("workspace.status.dirty"):S.t("workspace.status.clean"),en=()=>{const Nt=Et();return Nt===0?S.t("workspace.reset.archived.none"):Nt===1?S.t("workspace.reset.archived.one"):S.t("workspace.reset.archived.many",{count:Nt})};return m(aie,{get title(){return S.t("workspace.reset.title")},fit:!0,get children(){var Nt=h6i(),Ft=Nt.firstChild,ji=Ft.firstChild,Cr=ji.nextSibling,ar=Cr.firstChild,Er=ar.nextSibling;Er.nextSibling;var Ki=Ft.nextSibling;return W(ji,()=>S.t("workspace.reset.confirm",{name:ee()})),W(Cr,Gt,ar),W(Cr,en,Er),W(Cr,()=>S.t("workspace.reset.note"),null),W(Ki,m(to,{variant:"ghost",size:"large",onClick:()=>x.close(),get children(){return S.t("common.cancel")}}),null),W(Ki,m(to,{variant:"primary",size:"large",get disabled(){return Ce.status==="loading"},onClick:qe,get children(){return S.t("workspace.reset.button")}}),null),Nt}})}const ga={session:"",sessionProject:"",directory:""};Re(Mr(()=>[r(),E().slug,l.id,Pi()?.worktree,P()],([K,ee,Ce,Se,Ge])=>{if(!K||!ee||!Ge){ga.session="",ga.sessionProject="",ga.directory="";return}if(!Ce){ga.session="",ga.sessionProject="",ga.directory="";return}const qe=`${ee}/${Ce}`;if(!Se){ga.session=qe,ga.directory=Ge,ga.sessionProject="";return}if(g.projects.last()!==Se&&g.projects.touch(Se),qe!==ga.session||Ge!==ga.directory){ga.session=qe,ga.directory=Ge,ga.sessionProject=Vt(Ge,Ce,Se);return}Se!==ga.sessionProject&&(ga.directory=Ge,ga.sessionProject=ts(Ge,Ce,Se))})),Re(()=>{const K=u.sidebar.opened()?u.sidebar.width():48;document.documentElement.style.setProperty("--dialog-left-margin",`${K}px`)});const est=J(()=>Math.max(u.sidebar.width(),244)),tst=J(()=>Math.max(est()-64,0)),iS=new Set;Re(Mr(es,K=>{if(K.length===0){iS.clear();return}const ee=new Set(K);for(const Ce of ee)iS.has(Ce)||d.project.loadSessions(Ce);iS.clear();for(const Ce of ee)iS.add(Ce)},{defer:!0}));function nst(K){const ee=tse(K);ee&&(Fe(void 0),t("activeProject",ee))}function ist(K){const{draggable:ee,droppable:Ce}=K;if(ee&&Ce){const Se=u.projects.list(),Ge=Se.findIndex(Et=>Et.worktree===ee.id.toString()),qe=Se.findIndex(Et=>Et.worktree===Ce.id.toString());Ge!==qe&&qe!==-1&&u.projects.move(ee.id.toString(),qe)}}function rst(){t("activeProject",void 0)}function rS(K){if(!K)return[];const ee=K.worktree,Ce=[ee,...K.sandboxes??[]],Se=Pi(),Ge=rn(Se?.worktree??"")===rn(K.worktree)?P():void 0,qe=Ge&&rn(Ge)!==rn(ee)&&!Ce.some(en=>rn(en)===rn(Ge))?Ge:void 0,Et=qe?EL.get(qe)?.status==="pending":!1,Gt=AL(ee,Ce,e.workspaceOrder[K.worktree]);return Et&&qe?[ee,qe,...Gt.filter(en=>en!==ee)]:!qe||Et?Gt:[...Gt,qe]}const Vke=J(()=>{if(u.sidebar.opened())return Pi();const K=At();return K||Pi()});function ost(K){const ee=tse(K);ee&&t("activeWorkspace",ee)}function sst(K){const{draggable:ee,droppable:Ce}=K;if(!ee||!Ce)return;const Se=Vke();if(!Se)return;const Ge=rS(Se),qe=Ge.findIndex(Nt=>Nt===ee.id.toString()),Et=Ge.findIndex(Nt=>Nt===Ce.id.toString());if(qe===-1||Et===-1||qe===Et)return;const Gt=Ge.slice(),[en]=Gt.splice(qe,1);en&&(Gt.splice(Et,0,en),t("workspaceOrder",Se.worktree,Gt.filter(Nt=>rn(Nt)!==rn(Se.worktree))))}function ast(){t("activeWorkspace",void 0)}const Hke=async K=>{Lt();const ee=await c.client.worktree.create({directory:K.worktree}).then(qe=>qe.data).catch(qe=>{y.push(`${S.t("workspace.create.failed.title")}: ${TL(qe,S.t("common.requestFailed"))}`,"toast")});if(!ee?.directory)return;Kr(ee.directory,ee.branch,K.id,ee.branch);const Ce=K.worktree,Se=rn(ee.directory),Ge=rn(Ce);B(ee.directory,!0),EL.pending(ee.directory),t("workspaceExpanded",Se,!0),Se!==ee.directory&&t("workspaceExpanded",ee.directory,!0),t("workspaceOrder",K.worktree,qe=>{const Gt=(qe??[]).filter(en=>{const Nt=rn(en);return Nt!==Ge&&Nt!==Se});return[ee.directory,...Gt]}),d.child(ee.directory),Qt(`/${ri(ee.directory)}/session`)},$ke={currentDir:P,navList:eo,sidebarExpanded:Ae,sidebarHovering:pe,nav:()=>V.nav,hoverSession:()=>V.hoverSession,setHoverSession:Ve,clearHoverProjectSoon:be,prefetchSession:me,archiveSession:Zt,workspaceName:sr,renameWorkspace:xi,editorOpen:Ct,openEditor:Z,closeEditor:wt,setEditor:vt,InlineEditor:cn,isBusy:te,workspaceExpanded:(K,ee)=>e.workspaceExpanded[K]??ee,setWorkspaceExpanded:(K,ee)=>t("workspaceExpanded",K,ee),showResetWorkspaceDialog:(K,ee)=>x.show(()=>m(nS,{root:K,directory:ee})),showDeleteWorkspaceDialog:(K,ee)=>x.show(()=>m(tS,{root:K,directory:ee})),createSession:vr,setScrollContainerRef:(K,ee)=>{ee||(o=K)}},lst={currentDir:P,currentProject:Pi,sidebarOpened:()=>u.sidebar.opened(),sidebarHovering:pe,hoverProject:()=>V.hoverProject,nav:()=>V.nav,onProjectMouseEnter:(K,ee)=>se.enter(K,ee),onProjectMouseLeave:K=>se.leave(K),onProjectFocus:K=>se.activate(K),onHoverOpenChanged:(K,ee)=>{!ee&&V.hoverProject&&V.hoverProject!==K||$("hoverProject",ee?K:void 0)},navigateToProject:de,openSidebar:()=>u.sidebar.open(),closeProject:ui,showEditProjectDialog:Zs,toggleProjectWorkspaces:kr,workspacesEnabled:K=>K.vcs==="git"&&u.sidebar.workspaces(K.worktree)(),workspaceIds:rS,workspaceLabel:Oi,sessionProps:{navList:eo,sidebarExpanded:Ae,sidebarHovering:pe,nav:()=>V.nav,hoverSession:()=>V.hoverSession,setHoverSession:Ve,clearHoverProjectSoon:be,prefetchSession:me,archiveSession:Zt},setHoverSession:Ve},cst=K=>{const ee=K.project,Ce=J(()=>K.mobile||(K.merged??u.sidebar.opened())),Se=J(()=>!K.mobile&&K.merged===!1&&!u.sidebar.opened()),Ge=J(()=>!!K.mobile||K.merged===!1||u.sidebar.opened()),qe=J(()=>!l.dir&&u.projects.list().length===0),Et=J(()=>{const zn=ee();return zn?zn.name||Ds(zn.worktree):""}),Gt=J(()=>ee()?.id??""),en=J(()=>ee()?.worktree??""),Nt=J(()=>{const zn=en();return zn?ri(zn):""}),Ft=J(()=>{const zn=ee();return zn?rS(zn):[]}),ji=J(()=>Ft().reduce((zn,ma)=>zn+v.project.unseenCount(ma),0)),Cr=()=>Ft().filter(zn=>v.project.unseenCount(zn)>0).forEach(zn=>v.project.markViewed(zn)),ar=J(()=>{const zn=ee();return!zn||zn.vcs!=="git"?!1:u.sidebar.workspaces(zn.worktree)()}),Er=J(()=>{const zn=ee();return zn?zn.vcs==="git"||u.sidebar.workspaces(zn.worktree)():!1}),Ki=J(()=>d.data.path.home);return(()=>{var zn=m6i(),ma=zn.firstChild,Dh=ma.firstChild,sS=Dh.firstChild,zke=sS.firstChild,Bke=zke.firstChild,jke=Bke.nextSibling,hst=jke.nextSibling,Wke=zke.nextSibling;return W(zn,m(_e,{get when(){return ee()},get fallback(){return m(_e,{get when(){return qe()},get children(){var Oa=v6i(),id=Oa.firstChild,Ls=id.firstChild,Gr=Ls.firstChild,C2=Gr.nextSibling;return W(Gr,()=>S.t("sidebar.empty.title")),W(C2,()=>S.t("sidebar.empty.description")),W(id,m(to,{size:"large",icon:"folder-add-left",onClick:Nr,get children(){return S.t("command.project.open")}}),null),Oa}})},get children(){return[(()=>{var Oa=p6i(),id=Oa.firstChild,Ls=id.firstChild;return W(Ls,m(cn,{get id(){return`project:${Gt()}`},value:Et,onSave:Gr=>{const C2=ee();C2&&Fn(C2,Gr)},class:"text-14-medium text-text-strong truncate",displayClass:"text-14-medium text-text-strong truncate",stopPropagation:!0}),null),W(Ls,m(ou,{placement:"bottom",gutter:2,get value(){return en()},class:"shrink-0",contentStyle:{"max-width":"640px",transform:"translate3d(52px, 0, 0)"},get children(){var Gr=f6i();return W(Gr,()=>en().replace(Ki(),"~")),Gr}}),null),W(id,m(Un,{get modal(){return!pe()},get children(){return[m(Un.Trigger,{as:oa,icon:"dot-grid",variant:"ghost","data-action":"project-menu",get"data-project"(){return Nt()},class:"shrink-0 size-6 rounded-md transition-opacity data-[expanded]:bg-surface-base-active",get classList(){return{"opacity-100":K.mobile||Ce(),"opacity-0 group-hover/project:opacity-100 group-focus-within/project:opacity-100 data-[expanded]:opacity-100":!K.mobile&&!Ce()}},get"aria-label"(){return S.t("common.moreOptions")}}),m(Un.Portal,{get children(){return m(Un.Content,{class:"mt-1",get children(){return[m(Un.Item,{onSelect:()=>{const Gr=ee();Gr&&Zs(Gr)},get children(){return m(Un.ItemLabel,{get children(){return S.t("common.edit")}})}}),m(Un.Item,{"data-action":"project-workspaces-toggle",get"data-project"(){return Nt()},get disabled(){return!Er()},onSelect:()=>{const Gr=ee();Gr&&kr(Gr)},get children(){return m(Un.ItemLabel,{get children(){return sn(()=>!!ar())()?S.t("sidebar.workspaces.disable"):S.t("sidebar.workspaces.enable")}})}}),m(Un.Item,{"data-action":"project-clear-notifications",get"data-project"(){return Nt()},get disabled(){return ji()===0},onSelect:Cr,get children(){return m(Un.ItemLabel,{get children(){return S.t("sidebar.project.clearNotifications")}})}}),m(Un.Separator,{}),m(Un.Item,{"data-action":"project-close-menu",get"data-project"(){return Nt()},onSelect:()=>{const Gr=en();Gr&&ui(Gr)},get children(){return m(Un.ItemLabel,{get children(){return S.t("common.close")}})}})]}})}})]}}),null),Oa})(),m(aot,{onDragStart:ost,onDragEnd:ast,onDragOver:sst,collisionDetector:oot,get children(){return[m(lot,{}),m(got,{}),(()=>{var Oa=g6i();return W(Oa,m(_e,{get when(){return ee()},children:id=>m(_e,{get when(){return ar()},get fallback(){return[(()=>{var Ls=lRe();return W(Ls,m(to,{variant:"secondary",size:"large",icon:"new-session",class:"w-full",onClick:()=>{const Gr=en();Gr&&vr(Gr)},get children(){return S.t("command.session.new")}})),Ls})(),(()=>{var Ls=k6i();return W(Ls,m(E9i,{ctx:$ke,get project(){return id()},sortNow:U,get mobile(){return K.mobile},get popover(){return Ge()}})),Ls})()]},get children(){return[(()=>{var Ls=lRe();return W(Ls,m(to,{size:"large",icon:"plus-small",class:"w-full",onClick:()=>{Hke(id())},get children(){return S.t("workspace.new")}})),Ls})(),(()=>{var Ls=y6i(),Gr=Ls.firstChild;return aa(C2=>{K.mobile||(o=C2)},Gr),W(Gr,m(uot,{get ids(){return Ft()},get children(){return m(ei,{get each(){return Ft()},children:C2=>m(N9i,{ctx:$ke,directory:C2,get project(){return id()},sortNow:U,get mobile(){return K.mobile},get popover(){return Ge()}})})}})),Ls})()]}})})),Oa})(),m(cot,{get children(){return m(M9i,{sidebarProject:Vke,activeWorkspace:()=>e.activeWorkspace,workspaceLabel:Oi})}})]}})]}}),ma),W(Bke,()=>S.t("sidebar.gettingStarted.title")),W(jke,()=>S.t("sidebar.gettingStarted.line1")),W(hst,()=>S.t("sidebar.gettingStarted.line2")),W(Wke,m(to,{size:"large",icon:"plus-small",onClick:Tn,get children(){return S.t("command.provider.connect")}}),null),W(Wke,m(to,{size:"large",variant:"ghost",onClick:()=>t("gettingStartedDismissed",!0),get children(){return S.t("toast.update.action.notYet")}}),null),st(Oa=>{var id={"flex flex-col min-h-0 min-w-0 box-border rounded-tl-[12px] px-3":!0,"border border-b-0 border-border-weak-base":!Ce(),"border-l border-t border-border-weaker-base":Ce(),"bg-background-base":Ce()||Se(),"bg-background-stronger":!Ce()&&!Se(),"flex-1 min-w-0":K.mobile,"max-w-full overflow-hidden":K.mobile},Ls=K.mobile?void 0:`${tst()}px`,Gr=!!(e.gettingStartedDismissed||!(w.all().length>0&&w.paid().length===0));return Oa.e=Ko(zn,id,Oa.e),Ls!==Oa.t&&Sr(zn,"width",Oa.t=Ls),Gr!==Oa.a&&ma.classList.toggle("hidden",Oa.a=Gr),Oa},{e:void 0,t:void 0,a:void 0}),zn})()},Fke=()=>u.projects.list(),dst=()=>m(n6i,{projects:Fke,activeProject:()=>e.activeProject}),ust=K=>m(d6i,{mobile:K,opened:()=>u.sidebar.opened(),get aimMove(){return se.move},projects:Fke,renderProject:ee=>m(o6i,{ctx:lst,project:ee,sortNow:U,mobile:K}),handleDragStart:nst,handleDragEnd:rst,handleDragOver:ist,get openProjectLabel(){return S.t("command.project.open")},openProjectKeybind:()=>M.keybind("project.open"),onOpenProject:Nr,renderProjectOverlay:dst,settingsLabel:()=>S.t("sidebar.settings"),settingsKeybind:()=>M.keybind("settings.open"),onOpenSettings:wi,helpLabel:()=>S.t("sidebar.help"),onOpenHelp:()=>f.openLink("https://opencode.ai/desktop-feedback"),renderPanel:()=>m(cst,{project:Pi,mobile:!0})});let oS;return vy(),ur(()=>{oS&&requestAnimationFrame(()=>{yrt(oS,{opacity:[0,1],y:[4,0]},{type:"spring",stiffness:400,damping:30})})}),m(rMn,{get children(){var K=b6i(),ee=K.firstChild,Ce=ee.firstChild,Se=Ce.firstChild,Ge=Se.firstChild,qe=Ge.firstChild,Et=qe.nextSibling,Gt=Ge.nextSibling,en=Gt.firstChild;return W(K,m(p5i,{}),ee),W(ee,m(_e,{get when(){return e.activityBarVisible},get children(){var Nt=C6i(),Ft=Nt.firstChild,ji=Ft.firstChild,Cr=Ft.nextSibling,ar=Cr.firstChild;return W(Ft,m(ei,{get each(){return u.projects.list()},children:Er=>{const Ki=J(()=>Pi()?.worktree===Er.worktree);return(()=>{var zn=w6i();return zn.$$click=()=>_(`/${ri(Er.worktree)}/session`),W(zn,m(Pke,{project:Er,notify:!0})),st(ma=>{var Dh={"bg-transparent hover:bg-surface-base-hover":!Ki(),"bg-surface-base-hover border border-border-weak-base":Ki()},sS=Er.name||Ds(Er.worktree);return ma.e=Ko(zn,Dh,ma.e),sS!==ma.t&&mt(zn,"aria-label",ma.t=sS),ma},{e:void 0,t:void 0}),zn})()}}),ji),ji.$$click=Nr,W(ji,m(Cn,{name:"plus",size:"small",class:"text-icon-weak"})),ar.$$click=wi,W(ar,m(Cn,{name:"settings-gear",size:"small",class:"text-icon-weak"})),st(Er=>{var Ki=S.t("command.project.open"),zn=S.t("sidebar.settings");return Ki!==Er.e&&mt(ji,"aria-label",Er.e=Ki),zn!==Er.t&&mt(ar,"aria-label",Er.t=zn),Er},{e:void 0,t:void 0}),Nt}}),Ce),qe.$$click=Nt=>{Nt.target===Nt.currentTarget&&u.mobileSidebar.hide()},Et.$$click=Nt=>Nt.stopPropagation(),W(Et,()=>ust(!0)),Ko(Gt,{"absolute p-3 pt-0 inset-0":!0,"xl:inset-y-0 xl:right-0 xl:left-0":!0,"z-20":!0}),Ko(en,{"size-full overflow-x-hidden flex flex-col items-start contain-strict rounded-xl":!0}),W(en,m(_e,{get when(){return!fr.loading},get fallback(){return cRe()},get children(){var Nt=cRe(),Ft=oS;return typeof Ft=="function"?aa(Ft,Nt):oS=Nt,W(Nt,()=>n.children),Nt}})),st(Nt=>{var Ft={"fixed inset-x-0 top-10 bottom-0 z-40 transition-opacity duration-200":!0,"opacity-100 pointer-events-auto":u.mobileSidebar.opened(),"opacity-0 pointer-events-none":!u.mobileSidebar.opened()},ji=S.t("sidebar.nav.projectsAndSessions"),Cr={"@container fixed top-10 bottom-0 left-0 z-50 w-full max-w-[400px] overflow-hidden border-r border-border-weaker-base bg-background-base transition-transform duration-200 ease-out":!0,"translate-x-0":u.mobileSidebar.opened(),"-translate-x-full":!u.mobileSidebar.opened()};return Nt.e=Ko(qe,Ft,Nt.e),ji!==Nt.t&&mt(Et,"aria-label",Nt.t=ji),Nt.a=Ko(Et,Cr,Nt.a),Nt},{e:void 0,t:void 0,a:void 0}),K}})}Fs(["click"]);var x6i=["id","name","validationState","required","disabled","readOnly"];function S6i(n){const e=`form-control-${$s()}`,t=Pn({id:e},n),[i,r]=Ye(),[o,s]=Ye(),[a,l]=Ye(),[c,d]=Ye(),u=(g,v,y)=>{const C=y!=null||i()!=null;return[y,i(),C&&v!=null?g:void 0].filter(Boolean).join(" ")||void 0},h=g=>[a(),c(),g].filter(Boolean).join(" ")||void 0,f=J(()=>({"data-valid":Ze(t.validationState)==="valid"?"":void 0,"data-invalid":Ze(t.validationState)==="invalid"?"":void 0,"data-required":Ze(t.required)?"":void 0,"data-disabled":Ze(t.disabled)?"":void 0,"data-readonly":Ze(t.readOnly)?"":void 0}));return{formControlContext:{name:()=>Ze(t.name)??Ze(t.id),dataset:f,validationState:()=>Ze(t.validationState),isRequired:()=>Ze(t.required),isDisabled:()=>Ze(t.disabled),isReadOnly:()=>Ze(t.readOnly),labelId:i,fieldId:o,descriptionId:a,errorMessageId:c,getAriaLabelledBy:u,getAriaDescribedBy:h,generateId:bh(()=>Ze(t.id)),registerLabel:Xa(r),registerField:Xa(s),registerDescription:Xa(l),registerErrorMessage:Xa(d)}}}var $ot=oi();function eS(){const n=Wn($ot);if(n===void 0)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return n}function Fot(n){const e=eS(),t=Pn({id:e.generateId("description")},n);return Re(()=>Oe(e.registerDescription(t.id))),m(zi,k({as:"div"},()=>e.dataset(),t))}var M6i=["id","aria-label","aria-labelledby","aria-describedby"];function L6i(n){const e=eS(),t=Pn({id:e.generateId("field")},n);return Re(()=>Oe(e.registerField(Ze(t.id)))),{fieldProps:{id:()=>Ze(t.id),ariaLabel:()=>Ze(t["aria-label"]),ariaLabelledBy:()=>e.getAriaLabelledBy(Ze(t.id),Ze(t["aria-label"]),Ze(t["aria-labelledby"])),ariaDescribedBy:()=>e.getAriaDescribedBy(Ze(t["aria-describedby"]))}}}function zot(n){let e;const t=eS(),i=Pn({id:t.generateId("label")},n),[r,o]=Je(i,["ref"]),s=$_(()=>e,()=>"label");return Re(()=>Oe(t.registerLabel(o.id))),m(zi,k({as:"label",ref(a){var l=qr(c=>e=c,r.ref);typeof l=="function"&&l(a)},get for(){return sn(()=>s()==="label")()?t.fieldId():void 0}},()=>t.dataset(),o))}function I6i(n,e){Re(Mr(n,t=>{if(t==null)return;const i=N6i(t);i!=null&&(i.addEventListener("reset",e,{passive:!0}),Oe(()=>{i.removeEventListener("reset",e)}))}))}function N6i(n){return E6i(n)?n.form:n.closest("form")}function E6i(n){return n.matches("textarea, input, select, button")}function Bot(n){const e=eS(),t=Pn({id:e.generateId("error-message")},n),[i,r]=Je(t,["forceMount"]),o=()=>e.validationState()==="invalid";return Re(()=>{o()&&Oe(e.registerErrorMessage(r.id))}),m(_e,{get when(){return i.forceMount||o()},get children(){return m(zi,k({as:"div"},()=>e.dataset(),r))}})}var T6i={};au(T6i,{Description:()=>Fot,ErrorMessage:()=>Bot,Input:()=>Wot,Label:()=>zot,Root:()=>Uot,TextArea:()=>Zot,TextField:()=>m9,useTextFieldContext:()=>Oke});var jot=oi();function Oke(){const n=Wn(jot);if(n===void 0)throw new Error("[kobalte]: `useTextFieldContext` must be used within a `TextField` component");return n}function Wot(n){return m(qot,k({type:"text"},n))}function qot(n){const e=eS(),t=Oke(),i=Pn({id:t.generateId("input")},n),[r,o,s]=Je(i,["onInput"],M6i),{fieldProps:a}=L6i(o);return m(zi,k({as:"input",get id(){return a.id()},get name(){return e.name()},get value(){return t.value()},get required(){return e.isRequired()},get disabled(){return e.isDisabled()},get readonly(){return e.isReadOnly()},get"aria-label"(){return a.ariaLabel()},get"aria-labelledby"(){return a.ariaLabelledBy()},get"aria-describedby"(){return a.ariaDescribedBy()},get"aria-invalid"(){return e.validationState()==="invalid"||void 0},get"aria-required"(){return e.isRequired()||void 0},get"aria-disabled"(){return e.isDisabled()||void 0},get"aria-readonly"(){return e.isReadOnly()||void 0},get onInput(){return hs([r.onInput,t.onInput])}},()=>e.dataset(),s))}function Uot(n){let e;const t=`textfield-${$s()}`,i=Pn({id:t},n),[r,o,s]=Je(i,["ref","value","defaultValue","onChange"],x6i),a=r.value,[l,c]=H_({value:()=>a===void 0?void 0:r.value??"",defaultValue:()=>r.defaultValue,onChange:f=>r.onChange?.(f)}),{formControlContext:d}=S6i(o);I6i(()=>e,()=>c(r.defaultValue??""));const u=f=>{if(d.isReadOnly()||d.isDisabled())return;const p=f.target;c(p.value),p.value=l()??""},h={value:l,generateId:bh(()=>Ze(o.id)),onInput:u};return m($ot.Provider,{value:d,get children(){return m(jot.Provider,{value:h,get children(){return m(zi,k({as:"div",ref(f){var p=qr(g=>e=g,r.ref);typeof p=="function"&&p(f)},role:"group",get id(){return Ze(o.id)}},()=>d.dataset(),s))}})}})}function Zot(n){let e;const t=Oke(),i=Pn({id:t.generateId("textarea")},n),[r,o]=Je(i,["ref","autoResize","submitOnEnter","onKeyPress"]);Re(Mr([()=>e,()=>r.autoResize,()=>t.value()],([a,l])=>{!a||!l||A6i(a)}));const s=a=>{e&&r.submitOnEnter&&a.key==="Enter"&&!a.shiftKey&&e.form&&(e.form.requestSubmit(),a.preventDefault())};return m(qot,k({as:"textarea",get"aria-multiline"(){return r.submitOnEnter?"false":void 0},get onKeyPress(){return hs([r.onKeyPress,s])},ref(a){var l=qr(c=>e=c,r.ref);typeof l=="function"&&l(a)}},o))}function A6i(n){const e=n.style.alignSelf,t=n.style.overflow;"MozAppearance"in n.style||(n.style.overflow="hidden"),n.style.alignSelf="start",n.style.height="auto",n.style.height=`${n.scrollHeight+(n.offsetHeight-n.clientHeight)}px`,n.style.overflow=t,n.style.alignSelf=e}var m9=Object.assign(Uot,{Description:Fot,ErrorMessage:Bot,Input:Wot,Label:zot,TextArea:Zot}),D6i=le("<div data-slot=input-wrapper>");function R6i(n){const e=f3(),[t,i]=Je(n,["name","defaultValue","value","onChange","onKeyDown","validationState","required","disabled","readOnly","class","label","hideLabel","description","error","variant","copyable","copyKind","multiline"]),[r,o]=Ye(!1),s=()=>r()?e.t("ui.textField.copied"):t.copyKind==="link"?e.t("ui.textField.copyLink"):e.t("ui.textField.copyToClipboard"),a=()=>r()?"check":t.copyKind==="link"?"link":"copy";async function l(){const d=t.value??t.defaultValue??"";await navigator.clipboard.writeText(d),o(!0),setTimeout(()=>o(!1),2e3)}function c(){t.copyable&&l()}return m(m9,{"data-component":"input",get"data-variant"(){return t.variant||"normal"},get name(){return t.name},get defaultValue(){return t.defaultValue},get value(){return t.value},get onChange(){return t.onChange},get onKeyDown(){return t.onKeyDown},onClick:c,get required(){return t.required},get disabled(){return t.disabled},get readOnly(){return t.readOnly},get validationState(){return t.validationState},get children(){return[m(_e,{get when(){return t.label},get children(){return m(m9.Label,{"data-slot":"input-label",get classList(){return{"sr-only":t.hideLabel}},get children(){return t.label}})}}),(()=>{var d=D6i();return W(d,m(_e,{get when(){return t.multiline},get fallback(){return m(m9.Input,k(i,{"data-slot":"input-input",get class(){return t.class}}))},get children(){return m(m9.TextArea,k(i,{autoResize:!0,"data-slot":"input-input",get class(){return t.class}}))}}),null),W(d,m(_e,{get when(){return t.copyable},get children(){return m(ou,{get value(){return s()},placement:"top",gutter:4,get forceOpen(){return r()},skipDelayDuration:0,get children(){return m(oa,{type:"button",get icon(){return a()},variant:"ghost",onClick:l,tabIndex:-1,"data-slot":"input-copy-button",get"aria-label"(){return s()}})}})}}),null),d})(),m(_e,{get when(){return t.description},get children(){return m(m9.Description,{"data-slot":"input-description",get children(){return t.description}})}}),m(m9.ErrorMessage,{"data-slot":"input-error",get children(){return t.error}})]}})}var P6i=le('<div class="relative flex-1 h-screen w-screen min-h-0 flex flex-col items-center justify-center bg-background-base font-sans"><div class="w-2/3 max-w-3xl flex flex-col items-center justify-center gap-8"><div class="flex flex-col items-center gap-2 text-center"><h1 class="text-lg font-medium text-text-strong"></h1><p class="text-sm text-text-weak"></p></div><div class="flex items-center gap-3"></div><div class="flex flex-col items-center gap-2"><div class="flex items-center justify-center gap-1"><button type=button class="flex items-center text-text-interactive-base gap-1"><div>'),O6i=le('<p class="text-xs text-text-danger-base text-center max-w-2xl">'),V6i=le('<p class="text-xs text-text-weak">');const DL=`
3486
3486
  `+"─".repeat(40)+`
3487
3487
  `;function H6i(n){if(!n||typeof n!="object"||!("message"in n)||!("path"in n))return!1;const e=n.message,t=n.path;return typeof e!="string"||!Array.isArray(t)?!1:t.every(i=>typeof i=="string")}function $6i(n){return typeof n=="object"&&n!==null&&"name"in n&&"data"in n&&typeof n.data=="object"}function Kot(n,e){const t=new WeakSet;return JSON.stringify(n,(r,o)=>{if(typeof o=="bigint")return o.toString();if(typeof o=="object"&&o){if(t.has(o))return e;t.add(o)}return o},2)??String(n)}function F6i(n,e){const t=n.data,i=r=>Kot(r,e("error.page.circular"));switch(n.name){case"MCPFailed":{const r=typeof t.name=="string"?t.name:"";return e("error.chain.mcpFailed",{name:r})}case"ProviderAuthError":{const r=typeof t.providerID=="string"?t.providerID:e("common.unknown"),o=typeof t.message=="string"?t.message:i(t.message);return e("error.chain.providerAuthFailed",{provider:r,message:o})}case"APIError":{const o=[typeof t.message=="string"?t.message:e("error.chain.apiError")];return typeof t.statusCode=="number"&&o.push(e("error.chain.status",{status:t.statusCode})),typeof t.isRetryable=="boolean"&&o.push(e("error.chain.retryable",{retryable:t.isRetryable})),typeof t.responseBody=="string"&&t.responseBody&&o.push(e("error.chain.responseBody",{body:t.responseBody})),o.join(`
3488
3488
  `)}case"ProviderModelNotFoundError":{const{providerID:r,modelID:o,suggestions:s}=t,a=Array.isArray(s)&&s.length?[e("error.chain.didYouMean",{suggestions:s.join(", ")})]:[];return[e("error.chain.modelNotFound",{provider:r,model:o}),...a,e("error.chain.checkConfig")].join(`
@@ -3509,4 +3509,4 @@ ${l}`)});async function o(){e.checkUpdate&&(r("checking",!0),await e.checkUpdate
3509
3509
  100% { transform: translateX(-100%); }
3510
3510
  }
3511
3511
  .app-boot-bar { animation: app-boot-slide 1.6s cubic-bezier(0.45, 0, 0.2, 1) infinite; }
3512
- `),W6i=le('<div class="flex flex-col gap-2 w-full max-w-sm"><span class="text-12-regular text-text-base text-center"></span><div class="flex flex-col gap-1 bg-surface-base rounded-lg p-2">'),q6i=le('<div class="h-dvh w-screen flex flex-col items-center justify-center bg-background-base gap-6 p-6"><div class="flex flex-col items-center max-w-md text-center"><p class="text-14-regular text-text-base"><span class="text-text-strong font-medium"></span></p><p class="mt-1 text-12-regular text-text-weak">'),U6i=le('<button type=button class="flex items-center gap-3 w-full px-3 py-2 rounded-md hover:bg-surface-raised-base-hover transition-colors text-left"><span class="text-14-regular text-text-strong truncate">');const Z6i=ose(()=>z(()=>import("./home-M9U5I_mN.js"),__vite__mapDeps([111,110,103,112]))),K6i=ose(()=>z(()=>import("./auth-callback-D6fEUSOP.js"),[])),Xot=()=>z(()=>import("./session-CU929GsB.js").then(n=>n.s),__vite__mapDeps([113,102,103,106,98,114])),G6i=ose(Xot),X6i=ose(()=>z(()=>import("./trellis-badge-demo-CNkMd4YG.js"),[])),Y6i=()=>B6i();typeof location=="object"&&/\/session(?:\/|$)/.test(location.pathname)&&Xot();const dRe=()=>m(n3i,{get children(){return m(G6i,{})}}),J6i=()=>m(Y$e,{href:"session"});function Q6i(n){const e=ha();return m(flt,{get value(){return{locale:e.intl,t:e.t}},get children(){return n.children}})}function e3i(n){const e=new A4n;return m(E4n,{client:e,get children(){return n.children}})}function t3i(n){return m(X6n,{get children(){return m(RSn,{get children(){return m(vwn,{get children(){return m(ISn,{get children(){return m(cMn,{get children(){return m(bSn,{get children(){return m(n3n,{get children(){return m(Ywn,{get children(){return m(_6i,{get children(){return n.children}})}})}})}})}})}})}})}})}})}function n3i(n){return m(eMn,{get children(){return m(Rwn,{get children(){return m(qSn,{get children(){return m(h3n,{get children(){return n.children}})}})}})}})}function i3i(n){return m(t3i,{get children(){return m(Est,{get fallback(){return m(Y6i,{})},get children(){return[sn(()=>n.appChildren),sn(()=>n.children)]}})}})}function r3i(){const n=qse();return ur(()=>{ih()&&n.setTheme("oc-2")}),null}function o3i(n){return m(wmn,{get children(){return[m(qgn,{}),m(ymn,{onThemeApplied:(e,t)=>{window.api?.setTitlebar?.({mode:t}),hMn(t)},get children(){return[m(r3i,{}),m(B6n,{get locale(){return n.locale},get children(){return m(Q6i,{get children(){return m(Ist,{fallback:e=>m(z6i,{error:e}),get children(){return m(e3i,{get children(){return m(dlt,{get children(){return m(Ogt,{get children(){return m(eat,{component:A$e,get children(){return n.children}})}})}})}})}})}})}})]}})]}})}const s3i=n=>e=>p6n([e,b6n(n)],{concurrency:"unbounded"}).pipe(k6n(t=>t[0]));function a3i(n){const e=w3(),t=dUe(),[i,r]=Ye("blocking"),[o,s]=mo(()=>n.disableHealthCheck?!0:y6n(function*(){if(!e.current)return!0;const{http:a,type:l}=e.current;for(;;){if((yield*g6n(()=>t(a))).healthy)return!0;if(i()==="background"||l==="http")return!1}}).pipe(s3i(i()==="blocking"?"1.2 seconds":0),C6n({duration:"10 seconds",orElse:()=>m6n(!1)}),w6n(v6n(()=>r("background"))),_6n));return m(_e,{get when(){return sn(()=>i()==="blocking")()?!o.loading:o.state!=="pending"},get fallback(){return(()=>{var a=j6i(),l=a.firstChild;return W(a,m(D$e,{class:"w-20 h-25 opacity-80"}),l),a})()},get children(){return m(_e,{get when(){return o.latest},get fallback(){return m(l3i,{onRetry:()=>{i()==="background"&&s.refetch()},onServerSelected:a=>{r("blocking"),e.setActive(a),s.refetch()}})},get children(){return n.children}})}})}function l3i(n){const e=ha(),t=w3(),i=()=>t.list.filter(l=>Xu.key(l)!==t.key),r=J(()=>t.name||t.key),o="\0server\0",s=J(()=>e.t("app.server.unreachable",{server:o}).split(o)),a=setInterval(()=>n.onRetry?.(),1e3);return Oe(()=>clearInterval(a)),(()=>{var l=q6i(),c=l.firstChild,d=c.firstChild,u=d.firstChild,h=d.nextSibling;return W(c,m(D$e,{class:"w-12 h-15 mb-4"}),d),W(d,()=>s()[0],u),W(u,r),W(d,()=>s()[1],null),W(h,()=>e.t("app.server.retrying")),W(l,m(_e,{get when(){return i().length>0},get children(){var f=W6i(),p=f.firstChild,g=p.nextSibling;return W(p,()=>e.t("app.server.otherServers")),W(g,m(ei,{get each(){return i()},children:v=>{const y=Xu.key(v);return(()=>{var C=U6i(),_=C.firstChild;return C.$$click=()=>n.onServerSelected?.(y),W(_,()=>uUe(v)),C})()}})),f}}),null),l})()}function c3i(n){const e=w3();return m(_e,{get when(){return e.key},keyed:!0,get children(){return n.children}})}function d3i(n){return m(ubn,{get defaultServer(){return n.defaultServer},get disableHealthCheck(){return n.disableHealthCheck},get servers(){return n.servers},get children(){return m(a3i,{get disableHealthCheck(){return n.disableHealthCheck},get children(){return m(c3i,{get children(){return m(fbn,{get children(){return m(Ybn,{get children(){return m(iMn,{get children(){return m(ase,{get component(){return n.router??Ymn},root:e=>m(i3i,{get appChildren(){return n.children},get children(){return e.children}}),get children(){return[m(_2,{path:"/",component:Z6i}),m(_2,{path:"/auth/callback",component:K6i}),m(_2,{path:"/trellis-badge",component:X6i}),m(_2,{path:"/:dir",component:_gi,get children(){return[m(_2,{path:"/",component:J6i}),m(_2,{path:"/session",component:dRe}),m(_2,{path:"/session/:id",component:dRe}),m(_2,{path:"/trellis",component:()=>m(Y$e,{href:"..?view=graph"})})]}})]}})}})}})}})}})}})}})}Fs(["click"]);const u3i="1.3.5",h3i={version:u3i},Yot="opencode.settings.dat:defaultServerUrl",f3i=n=>{if(typeof localStorage>"u")return null;try{return localStorage.getItem(n)}catch{return null}},p3i=(n,e)=>{if(!(typeof localStorage>"u"))try{if(e!==null){localStorage.setItem(n,e);return}localStorage.removeItem(n)}catch{return}},Jot=()=>f3i(Yot),g3i=n=>p3i(Yot,n),m3i=async(n,e,t)=>{if(!("Notification"in window)||(Notification.permission==="default"?await Notification.requestPermission().catch(()=>"denied"):Notification.permission)!=="granted"||document.visibilityState==="visible"&&document.hasFocus())return;const o=new Notification(n,{body:e??"",icon:"https://opencode.ai/favicon-96x96-v3.png"});o.onclick=()=>{U4i(t),o.close()}},v3i=n=>{window.open(n,"_blank")},y3i=()=>{window.history.back()},k3i=()=>{window.history.forward()},C3i=async()=>{window.location.reload()},uRe=document.getElementById("root"),Qot=()=>location.hostname.includes("opencode.ai")?"http://localhost:4096":location.origin,b3i=()=>{const n=Jot();return n||Qot()},w3i={platform:"web",version:h3i.version,openLink:v3i,back:y3i,forward:k3i,restart:C3i,notify:m3i,getDefaultServer:async()=>{const n=Jot();return n?Xu.Key.make(n):null},setDefaultServer:g3i};if(uRe instanceof HTMLElement){const n={type:"http",http:{url:Qot()}};zst(()=>m(L6n,{value:w3i,get children(){return m(o3i,{get children(){return m(d3i,{get defaultServer(){return Xu.Key.make(b3i())},servers:[n],disableHealthCheck:!0})}})}}),uRe)}export{mt as $,Nae as A,to as B,m8i as C,wn as D,Ds as E,ei as F,aie as G,Yt as H,Cn as I,Fd as J,dUe as K,c8i as L,cbn as M,Xu as N,Re as O,Oe as P,oa as Q,Un as R,_e as S,rmn as T,vn as U,Ko as V,uUe as W,rse as X,H1 as Y,ou as Z,z as _,_3 as a,EZe as a$,D5i as a0,k as a1,pwn as a2,Kx as a3,Gnt as a4,xy as a5,Bs as a6,Mr as a7,Aa as a8,L8i as a9,MRe as aA,In as aB,Wn as aC,IRe as aD,au as aE,El as aF,V1 as aG,fi as aH,wp as aI,jt as aJ,pn as aK,sze as aL,Dwn as aM,nh as aN,ede as aO,qse as aP,J_ as aQ,ih as aR,u8i as aS,G6n as aT,d8i as aU,K6n as aV,f8i as aW,h8i as aX,M8i as aY,q2e as aZ,v2e as a_,x8i as aa,BZe as ab,X3e as ac,W2e as ad,pie as ae,$s as af,Pn as ag,Je as ah,x6i as ai,S6i as aj,n4i as ak,I6i as al,zi as am,Ze as an,qr as ao,$ot as ap,eS as aq,zot as ar,M6i as as,L6i as at,su as au,Tat as av,Bot as aw,Fot as ax,oi as ay,bh as az,a2 as b,fP as b$,s9 as b0,zU as b1,HX as b2,VU as b3,DJ as b4,O$ as b5,Oee as b6,WY as b7,g5e as b8,H4e as b9,lse as bA,Zmi as bB,Xa as bC,y2 as bD,Fmi as bE,h3 as bF,d3 as bG,HRe as bH,zRe as bI,VRe as bJ,tk as bK,cse as bL,u3 as bM,u0 as bN,Egi as bO,Umi as bP,xMn as bQ,z6 as bR,R8i as bS,uQ as bT,GZe as bU,Ree as bV,D8i as bW,TMn as bX,GK as bY,Rq as bZ,QJ as b_,b$e as ba,mx as bb,Mn as bc,za as bd,hie as be,Dxe as bf,f3 as bg,Jte as bh,sa as bi,M3i as bj,eCe as bk,L3i as bl,e4i as bm,t4i as bn,Frt as bo,hs as bp,m2 as bq,jmi as br,M6 as bs,Lat as bt,H_ as bu,qmi as bv,I3i as bw,Rs as bx,Hmi as by,sse as bz,oy as c,qhe as c$,ZP as c0,zQ as c1,HV as c2,WV as c3,Ny as c4,V4 as c5,aG as c6,oP as c7,WH as c8,iB as c9,p8i as cA,H9e as cB,OEn as cC,z_e as cD,dwn as cE,Y3e as cF,EL as cG,JC as cH,br as cI,i3n as cJ,v8i as cK,lf as cL,g8i as cM,l2 as cN,WZe as cO,AEn as cP,SEn as cQ,gM as cR,VSn as cS,U2e as cT,W5i as cU,x3i as cV,cyi as cW,G4i as cX,fyi as cY,J5i as cZ,ase as c_,eq as ca,Vz as cb,QF as cc,ps as cd,ose as ce,Est as cf,N8i as cg,T8i as ch,i8e as ci,vs as cj,yo as ck,Y5i as cl,Ort as cm,Dke as cn,wot as co,Cot as cp,bot as cq,Ju as cr,Y_e as cs,_Ke as ct,fv as cu,A$e as cv,hot as cw,I8i as cx,ZSn as cy,Rp as cz,k3 as d,Eae as d$,_Re as d0,S3i as d1,vy as d2,qMn as d3,eSe as d4,UMn as d5,ZMn as d6,F8i as d7,Zy as d8,e8i as d9,TEn as dA,ate as dB,aot as dC,lot as dD,F4i as dE,syi as dF,ayi as dG,h0 as dH,H8i as dI,$8i as dJ,cit as dK,oyi as dL,lit as dM,$4i as dN,G3i as dO,IP as dP,P8i as dQ,O8i as dR,OSe as dS,TP as dT,Um as dU,oG as dV,U4 as dW,mm as dX,Rm as dY,jI as dZ,g5 as d_,i8i as da,t8i as db,zst as dc,r8i as dd,ymt as de,n8i as df,MD as dg,TD as dh,VEn as di,a8e as dj,ND as dk,ED as dl,$Z as dm,tX as dn,EY as dp,wW as dq,j8i as dr,jZe as ds,KZe as dt,Y8 as du,_Ln as dv,rSe as dw,V8i as dx,FZe as dy,mhi as dz,w3 as e,dhi as e0,B8i as e1,z8i as e2,Kxe as e3,A8i as e4,sG as e5,r4 as e6,eY as e7,Rne as e8,e4 as e9,oq as ea,hz as eb,cm as ec,C$ as ed,BK as ee,tO as ef,oot as eg,got as eh,uot as ei,cot as ej,EV as ek,PH as el,$D as em,AD as en,hyi as eo,W8i as ep,tse as eq,dyi as er,uyi as es,tfe as et,Gb as eu,I2e as ev,vbn as ew,o8i as ex,$3i as ey,ha as f,E8i as g,Ye as h,J as i,aa as j,yrt as k,W as l,m,sn as n,ur as o,R6i as p,st as q,ri as r,Sr as s,le as t,G1 as u,Fs as v,s8i as w,YMn as x,bp as y,mo as z};
3512
+ `),W6i=le('<div class="flex flex-col gap-2 w-full max-w-sm"><span class="text-12-regular text-text-base text-center"></span><div class="flex flex-col gap-1 bg-surface-base rounded-lg p-2">'),q6i=le('<div class="h-dvh w-screen flex flex-col items-center justify-center bg-background-base gap-6 p-6"><div class="flex flex-col items-center max-w-md text-center"><p class="text-14-regular text-text-base"><span class="text-text-strong font-medium"></span></p><p class="mt-1 text-12-regular text-text-weak">'),U6i=le('<button type=button class="flex items-center gap-3 w-full px-3 py-2 rounded-md hover:bg-surface-raised-base-hover transition-colors text-left"><span class="text-14-regular text-text-strong truncate">');const Z6i=ose(()=>z(()=>import("./home-DQqU5LMI.js"),__vite__mapDeps([111,110,103,112]))),K6i=ose(()=>z(()=>import("./auth-callback-CZclCZDz.js"),[])),Xot=()=>z(()=>import("./session-C1XEMwgd.js").then(n=>n.s),__vite__mapDeps([113,102,103,106,98,114])),G6i=ose(Xot),X6i=ose(()=>z(()=>import("./trellis-badge-demo-C1blrToc.js"),[])),Y6i=()=>B6i();typeof location=="object"&&/\/session(?:\/|$)/.test(location.pathname)&&Xot();const dRe=()=>m(n3i,{get children(){return m(G6i,{})}}),J6i=()=>m(Y$e,{href:"session"});function Q6i(n){const e=ha();return m(flt,{get value(){return{locale:e.intl,t:e.t}},get children(){return n.children}})}function e3i(n){const e=new A4n;return m(E4n,{client:e,get children(){return n.children}})}function t3i(n){return m(X6n,{get children(){return m(RSn,{get children(){return m(vwn,{get children(){return m(ISn,{get children(){return m(cMn,{get children(){return m(bSn,{get children(){return m(n3n,{get children(){return m(Ywn,{get children(){return m(_6i,{get children(){return n.children}})}})}})}})}})}})}})}})}})}function n3i(n){return m(eMn,{get children(){return m(Rwn,{get children(){return m(qSn,{get children(){return m(h3n,{get children(){return n.children}})}})}})}})}function i3i(n){return m(t3i,{get children(){return m(Est,{get fallback(){return m(Y6i,{})},get children(){return[sn(()=>n.appChildren),sn(()=>n.children)]}})}})}function r3i(){const n=qse();return ur(()=>{ih()&&n.setTheme("oc-2")}),null}function o3i(n){return m(wmn,{get children(){return[m(qgn,{}),m(ymn,{onThemeApplied:(e,t)=>{window.api?.setTitlebar?.({mode:t}),hMn(t)},get children(){return[m(r3i,{}),m(B6n,{get locale(){return n.locale},get children(){return m(Q6i,{get children(){return m(Ist,{fallback:e=>m(z6i,{error:e}),get children(){return m(e3i,{get children(){return m(dlt,{get children(){return m(Ogt,{get children(){return m(eat,{component:A$e,get children(){return n.children}})}})}})}})}})}})}})]}})]}})}const s3i=n=>e=>p6n([e,b6n(n)],{concurrency:"unbounded"}).pipe(k6n(t=>t[0]));function a3i(n){const e=w3(),t=dUe(),[i,r]=Ye("blocking"),[o,s]=mo(()=>n.disableHealthCheck?!0:y6n(function*(){if(!e.current)return!0;const{http:a,type:l}=e.current;for(;;){if((yield*g6n(()=>t(a))).healthy)return!0;if(i()==="background"||l==="http")return!1}}).pipe(s3i(i()==="blocking"?"1.2 seconds":0),C6n({duration:"10 seconds",orElse:()=>m6n(!1)}),w6n(v6n(()=>r("background"))),_6n));return m(_e,{get when(){return sn(()=>i()==="blocking")()?!o.loading:o.state!=="pending"},get fallback(){return(()=>{var a=j6i(),l=a.firstChild;return W(a,m(D$e,{class:"w-20 h-25 opacity-80"}),l),a})()},get children(){return m(_e,{get when(){return o.latest},get fallback(){return m(l3i,{onRetry:()=>{i()==="background"&&s.refetch()},onServerSelected:a=>{r("blocking"),e.setActive(a),s.refetch()}})},get children(){return n.children}})}})}function l3i(n){const e=ha(),t=w3(),i=()=>t.list.filter(l=>Xu.key(l)!==t.key),r=J(()=>t.name||t.key),o="\0server\0",s=J(()=>e.t("app.server.unreachable",{server:o}).split(o)),a=setInterval(()=>n.onRetry?.(),1e3);return Oe(()=>clearInterval(a)),(()=>{var l=q6i(),c=l.firstChild,d=c.firstChild,u=d.firstChild,h=d.nextSibling;return W(c,m(D$e,{class:"w-12 h-15 mb-4"}),d),W(d,()=>s()[0],u),W(u,r),W(d,()=>s()[1],null),W(h,()=>e.t("app.server.retrying")),W(l,m(_e,{get when(){return i().length>0},get children(){var f=W6i(),p=f.firstChild,g=p.nextSibling;return W(p,()=>e.t("app.server.otherServers")),W(g,m(ei,{get each(){return i()},children:v=>{const y=Xu.key(v);return(()=>{var C=U6i(),_=C.firstChild;return C.$$click=()=>n.onServerSelected?.(y),W(_,()=>uUe(v)),C})()}})),f}}),null),l})()}function c3i(n){const e=w3();return m(_e,{get when(){return e.key},keyed:!0,get children(){return n.children}})}function d3i(n){return m(ubn,{get defaultServer(){return n.defaultServer},get disableHealthCheck(){return n.disableHealthCheck},get servers(){return n.servers},get children(){return m(a3i,{get disableHealthCheck(){return n.disableHealthCheck},get children(){return m(c3i,{get children(){return m(fbn,{get children(){return m(Ybn,{get children(){return m(iMn,{get children(){return m(ase,{get component(){return n.router??Ymn},root:e=>m(i3i,{get appChildren(){return n.children},get children(){return e.children}}),get children(){return[m(_2,{path:"/",component:Z6i}),m(_2,{path:"/auth/callback",component:K6i}),m(_2,{path:"/trellis-badge",component:X6i}),m(_2,{path:"/:dir",component:_gi,get children(){return[m(_2,{path:"/",component:J6i}),m(_2,{path:"/session",component:dRe}),m(_2,{path:"/session/:id",component:dRe}),m(_2,{path:"/trellis",component:()=>m(Y$e,{href:"..?view=graph"})})]}})]}})}})}})}})}})}})}})}Fs(["click"]);const u3i="1.3.5",h3i={version:u3i},Yot="opencode.settings.dat:defaultServerUrl",f3i=n=>{if(typeof localStorage>"u")return null;try{return localStorage.getItem(n)}catch{return null}},p3i=(n,e)=>{if(!(typeof localStorage>"u"))try{if(e!==null){localStorage.setItem(n,e);return}localStorage.removeItem(n)}catch{return}},Jot=()=>f3i(Yot),g3i=n=>p3i(Yot,n),m3i=async(n,e,t)=>{if(!("Notification"in window)||(Notification.permission==="default"?await Notification.requestPermission().catch(()=>"denied"):Notification.permission)!=="granted"||document.visibilityState==="visible"&&document.hasFocus())return;const o=new Notification(n,{body:e??"",icon:"https://opencode.ai/favicon-96x96-v3.png"});o.onclick=()=>{U4i(t),o.close()}},v3i=n=>{window.open(n,"_blank")},y3i=()=>{window.history.back()},k3i=()=>{window.history.forward()},C3i=async()=>{window.location.reload()},uRe=document.getElementById("root"),Qot=()=>location.hostname.includes("opencode.ai")?"http://localhost:4096":location.origin,b3i=()=>{const n=Jot();return n||Qot()},w3i={platform:"web",version:h3i.version,openLink:v3i,back:y3i,forward:k3i,restart:C3i,notify:m3i,getDefaultServer:async()=>{const n=Jot();return n?Xu.Key.make(n):null},setDefaultServer:g3i};if(uRe instanceof HTMLElement){const n={type:"http",http:{url:Qot()}};zst(()=>m(L6n,{value:w3i,get children(){return m(o3i,{get children(){return m(d3i,{get defaultServer(){return Xu.Key.make(b3i())},servers:[n],disableHealthCheck:!0})}})}}),uRe)}export{mt as $,Nae as A,to as B,m8i as C,wn as D,Ds as E,ei as F,aie as G,Yt as H,Cn as I,Fd as J,dUe as K,c8i as L,cbn as M,Xu as N,Re as O,Oe as P,oa as Q,Un as R,_e as S,rmn as T,vn as U,Ko as V,uUe as W,rse as X,H1 as Y,ou as Z,z as _,_3 as a,EZe as a$,D5i as a0,k as a1,pwn as a2,Kx as a3,Gnt as a4,xy as a5,Bs as a6,Mr as a7,Aa as a8,L8i as a9,MRe as aA,In as aB,Wn as aC,IRe as aD,au as aE,El as aF,V1 as aG,fi as aH,wp as aI,jt as aJ,pn as aK,sze as aL,Dwn as aM,nh as aN,ede as aO,qse as aP,J_ as aQ,ih as aR,u8i as aS,G6n as aT,d8i as aU,K6n as aV,f8i as aW,h8i as aX,M8i as aY,q2e as aZ,v2e as a_,x8i as aa,BZe as ab,X3e as ac,W2e as ad,pie as ae,$s as af,Pn as ag,Je as ah,x6i as ai,S6i as aj,n4i as ak,I6i as al,zi as am,Ze as an,qr as ao,$ot as ap,eS as aq,zot as ar,M6i as as,L6i as at,su as au,Tat as av,Bot as aw,Fot as ax,oi as ay,bh as az,a2 as b,fP as b$,s9 as b0,zU as b1,HX as b2,VU as b3,DJ as b4,O$ as b5,Oee as b6,WY as b7,g5e as b8,H4e as b9,lse as bA,Zmi as bB,Xa as bC,y2 as bD,Fmi as bE,h3 as bF,d3 as bG,HRe as bH,zRe as bI,VRe as bJ,tk as bK,cse as bL,u3 as bM,u0 as bN,Egi as bO,Umi as bP,xMn as bQ,z6 as bR,R8i as bS,uQ as bT,GZe as bU,Ree as bV,D8i as bW,TMn as bX,GK as bY,Rq as bZ,QJ as b_,b$e as ba,mx as bb,Mn as bc,za as bd,hie as be,Dxe as bf,f3 as bg,Jte as bh,sa as bi,M3i as bj,eCe as bk,L3i as bl,e4i as bm,t4i as bn,Frt as bo,hs as bp,m2 as bq,jmi as br,M6 as bs,Lat as bt,H_ as bu,qmi as bv,I3i as bw,Rs as bx,Hmi as by,sse as bz,oy as c,qhe as c$,ZP as c0,zQ as c1,HV as c2,WV as c3,Ny as c4,V4 as c5,aG as c6,oP as c7,WH as c8,iB as c9,p8i as cA,H9e as cB,OEn as cC,z_e as cD,dwn as cE,Y3e as cF,EL as cG,JC as cH,br as cI,i3n as cJ,v8i as cK,lf as cL,g8i as cM,l2 as cN,WZe as cO,AEn as cP,SEn as cQ,gM as cR,VSn as cS,U2e as cT,W5i as cU,x3i as cV,cyi as cW,G4i as cX,fyi as cY,J5i as cZ,ase as c_,eq as ca,Vz as cb,QF as cc,ps as cd,ose as ce,Est as cf,N8i as cg,T8i as ch,i8e as ci,vs as cj,yo as ck,Y5i as cl,Ort as cm,Dke as cn,wot as co,Cot as cp,bot as cq,Ju as cr,Y_e as cs,_Ke as ct,fv as cu,A$e as cv,hot as cw,I8i as cx,ZSn as cy,Rp as cz,k3 as d,Eae as d$,_Re as d0,S3i as d1,vy as d2,qMn as d3,eSe as d4,UMn as d5,ZMn as d6,F8i as d7,Zy as d8,e8i as d9,TEn as dA,ate as dB,aot as dC,lot as dD,F4i as dE,syi as dF,ayi as dG,h0 as dH,H8i as dI,$8i as dJ,cit as dK,oyi as dL,lit as dM,$4i as dN,G3i as dO,IP as dP,P8i as dQ,O8i as dR,OSe as dS,TP as dT,Um as dU,oG as dV,U4 as dW,mm as dX,Rm as dY,jI as dZ,g5 as d_,i8i as da,t8i as db,zst as dc,r8i as dd,ymt as de,n8i as df,MD as dg,TD as dh,VEn as di,a8e as dj,ND as dk,ED as dl,$Z as dm,tX as dn,EY as dp,wW as dq,j8i as dr,jZe as ds,KZe as dt,Y8 as du,_Ln as dv,rSe as dw,V8i as dx,FZe as dy,mhi as dz,w3 as e,dhi as e0,B8i as e1,z8i as e2,Kxe as e3,A8i as e4,sG as e5,r4 as e6,eY as e7,Rne as e8,e4 as e9,oq as ea,hz as eb,cm as ec,C$ as ed,BK as ee,tO as ef,oot as eg,got as eh,uot as ei,cot as ej,EV as ek,PH as el,$D as em,AD as en,hyi as eo,W8i as ep,tse as eq,dyi as er,uyi as es,tfe as et,Gb as eu,I2e as ev,vbn as ew,o8i as ex,$3i as ey,ha as f,E8i as g,Ye as h,J as i,aa as j,yrt as k,W as l,m,sn as n,ur as o,R6i as p,st as q,ri as r,Sr as s,le as t,G1 as u,Fs as v,s8i as w,YMn as x,bp as y,mo as z};