@inkeep/open-knowledge 0.42.0-beta.13 → 0.42.0-beta.15

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 (331) hide show
  1. package/dist/{acp-harness-probe-PwxCSk8L.mjs → acp-harness-probe-CAE-EIAO.mjs} +2 -2
  2. package/dist/assets/skills/discovery/SKILL.md +1 -1
  3. package/dist/assets/skills/project/SKILL.md +1 -1
  4. package/dist/{build-fAc55Z_L.mjs → build-DYQrG4v7.mjs} +1 -1
  5. package/dist/build-DcqN8tua.mjs +1 -0
  6. package/dist/{chunk-TLSUDHID-BOrmK-jg.mjs → chunk-TLSUDHID-B0bd8ZfM.mjs} +2 -2
  7. package/dist/cli.mjs +57 -57
  8. package/dist/config-schema.json +154 -0
  9. package/dist/config.project.schema.json +154 -0
  10. package/dist/constants-BZl1G87U.mjs +2 -0
  11. package/dist/{diff-HJF2MPDN-BvwqXcA5.mjs → diff-HJF2MPDN-DhZaF2MX.mjs} +1 -1
  12. package/dist/{flag-coverage-6JEX67RU-D3X0I2ha.mjs → flag-coverage-6JEX67RU-D1byxsyF.mjs} +2 -2
  13. package/dist/fs-traced-B9Czc2nP.mjs +1 -0
  14. package/dist/{fs-traced-Cc6WsRtP.mjs → fs-traced-BmZQL7v9.mjs} +2 -2
  15. package/dist/{git-handle-B1TJqyoh.mjs → git-handle-DPgGAaBb.mjs} +2 -2
  16. package/dist/git-handle-mU3AzxE3.mjs +1 -0
  17. package/dist/index.d.mts +37 -13
  18. package/dist/index.mjs +1 -1
  19. package/dist/init-CJbmqYq7.mjs +1 -0
  20. package/dist/{init-C_ZFDDwH.mjs → init-COanttdJ.mjs} +37 -37
  21. package/dist/{launch-json-removal-DPvJksib.mjs → launch-json-removal-DxmjjRz1.mjs} +2 -2
  22. package/dist/{lib-CE7ieLC-.mjs → lib-BS_oZ9bm.mjs} +4 -4
  23. package/dist/{libesm-CG75CrN9.mjs → libesm-DzwC_yFw.mjs} +1 -1
  24. package/dist/loader-CdTuY6uH.mjs +1 -0
  25. package/dist/{loader-0YCBN4cH.mjs → loader-Dfh3vrvm.mjs} +2 -2
  26. package/dist/md-manager-Dy92M9Co.mjs +2 -0
  27. package/dist/{open-browser-CXby8R3t.mjs → open-browser-DVHIE120.mjs} +2 -2
  28. package/dist/parse-worker.mjs +1 -1
  29. package/dist/{preview-Cjg4sLCV.mjs → preview-BXBmqQHa.mjs} +2 -2
  30. package/dist/preview-C6YDS1mn.mjs +1 -0
  31. package/dist/public/assets/ActivityModeContent-C2P34Oxp.js +1 -0
  32. package/dist/public/assets/{AgentDiffPane-f8e9_JvG.js → AgentDiffPane-DcYd6e4i.js} +2 -2
  33. package/dist/public/assets/{AgentThreadClientBinder-UR-Kf4b1.js → AgentThreadClientBinder-Dc_ZvYaC.js} +1 -1
  34. package/dist/public/assets/CodeMirrorPropInput-BDWvXsen.js +3 -0
  35. package/dist/public/assets/{ConsentDialogBody-BjbzWR8D.js → ConsentDialogBody-CerQg1mw.js} +1 -1
  36. package/dist/public/assets/DocumentContext-DYNMnkEK.js +38 -0
  37. package/dist/public/assets/{EditorModeToggle-BjJNUMBS.js → EditorModeToggle-DUpVsmPc.js} +2 -2
  38. package/dist/public/assets/{EnableSyncConfirmDialog-B05Urde9.js → EnableSyncConfirmDialog-ByznA2PW.js} +1 -1
  39. package/dist/public/assets/FeedbackForm-GiDmtTV5.js +1 -0
  40. package/dist/public/assets/{GraphPanel-Bc99r1NG.js → GraphPanel-CqaIMvPS.js} +1 -1
  41. package/dist/public/assets/{LintConfigEditor-gSyEWnW_.js → LintConfigEditor-2sMpGsvn.js} +1 -1
  42. package/dist/public/assets/ManagedArtifactProperties-Bv97X2Kw.js +1 -0
  43. package/dist/public/assets/{McpConsentDialogBody-BT0tOjYc.js → McpConsentDialogBody-g1cYKWmV.js} +1 -1
  44. package/dist/public/assets/{MermaidDocEditor-ppbCwqCZ.js → MermaidDocEditor-peOyXfDP.js} +1 -1
  45. package/dist/public/assets/PropertyPanel-TNLuDkLB.js +2 -0
  46. package/dist/public/assets/{ReportBugDialogBody-CkyHWZh9.js → ReportBugDialogBody-CFAfyMu8.js} +2 -2
  47. package/dist/public/assets/{SchemaConfigEditor-5fvtp9pn.js → SchemaConfigEditor-CINC-UXE.js} +1 -1
  48. package/dist/public/assets/{SettingsDialogBody-DYHvNSXS.js → SettingsDialogBody-DXovj0IS.js} +3 -3
  49. package/dist/public/assets/{ShareBranchSwitchDialog-DEHPks5w.js → ShareBranchSwitchDialog-Dfc-qPui.js} +1 -1
  50. package/dist/public/assets/{ShareReceiveDialog-IX_2OQ-z.js → ShareReceiveDialog-mjee2gdk.js} +1 -1
  51. package/dist/public/assets/{ShareReceiveMissDialog-BsHBuFKr.js → ShareReceiveMissDialog-RIU6HaEy.js} +1 -1
  52. package/dist/public/assets/{SkillEditorActions-Bg7DEmMN.js → SkillEditorActions-ghSewPgo.js} +1 -1
  53. package/dist/public/assets/SourceEditor-C5A403lL.js +1 -0
  54. package/dist/public/assets/{TerminalPanel-xzIwFtxc.js → TerminalPanel-B26SgJgt.js} +2 -2
  55. package/dist/public/assets/{TerminalSessionsHost-DPN4hpOi.js → TerminalSessionsHost-DXQM6Nk-.js} +2 -2
  56. package/dist/public/assets/{TerminalWindowApp-BEx4mQbz.js → TerminalWindowApp-DFkdh_Dr.js} +1 -1
  57. package/dist/public/assets/{ThreadView-BEUMdycz.js → ThreadView-meVyXMtJ.js} +2 -2
  58. package/dist/public/assets/{TimelineDiffPane-60Mqrg_1.js → TimelineDiffPane-CzDAeswG.js} +2 -2
  59. package/dist/public/assets/{abnfDiagram-VRR7QNED-BN6xOaJK.js → abnfDiagram-VRR7QNED-CpaiDrfg.js} +1 -1
  60. package/dist/public/assets/{agent-diff-store-D9meLWbh.js → agent-diff-store-CgUtJ40J.js} +1 -1
  61. package/dist/public/assets/{agent-visibility-CYbXZE0k.js → agent-visibility-Q7iJ3Wrj.js} +1 -1
  62. package/dist/public/assets/{arc-DXLgvp45.js → arc-CvzmZpaI.js} +1 -1
  63. package/dist/public/assets/architecture-TIHT7OUA-DJqhUxi8.js +1 -0
  64. package/dist/public/assets/{architectureDiagram-ZJ3FMSHR-sAL9H8K0.js → architectureDiagram-ZJ3FMSHR-CUPpKaNe.js} +1 -1
  65. package/dist/public/assets/{auth-state-cache-B9EBu3Gl.js → auth-state-cache-BGbpopsu.js} +3 -3
  66. package/dist/public/assets/awareness-heartbeat.worker-BYkbsKQ2.js +1 -0
  67. package/dist/public/assets/{blockDiagram-677ZJIJ3-CecPiwgF.js → blockDiagram-677ZJIJ3-BHPvFhpI.js} +1 -1
  68. package/dist/public/assets/{c4Diagram-LMCZKHZV-D8mdqYYS.js → c4Diagram-LMCZKHZV-DJHIa26M.js} +1 -1
  69. package/dist/public/assets/{calendar-DEDeJBdZ.js → calendar-Cbj0oPjD.js} +1 -1
  70. package/dist/public/assets/channel-DJju_46x.js +1 -0
  71. package/dist/public/assets/chunk-2Q5K7J3B-BThJ0ACJ.js +1 -0
  72. package/dist/public/assets/{chunk-32BRIVSS-JpxGJ5ji.js → chunk-32BRIVSS-BwgPzOKX.js} +1 -1
  73. package/dist/public/assets/{chunk-52WLFC77-C_iSxcYL.js → chunk-52WLFC77-BbFy67yI.js} +1 -1
  74. package/dist/public/assets/{chunk-5FCAYU7R-Bq8uZn8B.js → chunk-5FCAYU7R-b-dJCCK-.js} +1 -1
  75. package/dist/public/assets/{chunk-5HE753X5-Canmf8DQ.js → chunk-5HE753X5-BQBFOg3H.js} +1 -1
  76. package/dist/public/assets/{chunk-5JV3BV7I-Dtexaqo4.js → chunk-5JV3BV7I-DjT6jnuJ.js} +1 -1
  77. package/dist/public/assets/{chunk-5TONJI2A-QaNyDyr1.js → chunk-5TONJI2A-CmHBNIPA.js} +1 -1
  78. package/dist/public/assets/{chunk-5VM5RSS4-DnRDZx9C.js → chunk-5VM5RSS4-Do0yPUxJ.js} +1 -1
  79. package/dist/public/assets/{chunk-7BUUIJ7U-CjwBXrEk.js → chunk-7BUUIJ7U-BNZcf0tz.js} +1 -1
  80. package/dist/public/assets/{chunk-BIQX33UG-CwPTWPTQ.js → chunk-BIQX33UG-UfugZvJI.js} +1 -1
  81. package/dist/public/assets/{chunk-BO2N2NFS-BTXsfKML.js → chunk-BO2N2NFS-BIBt7Qku.js} +3 -3
  82. package/dist/public/assets/{chunk-C7G6YPKG-yRQSkwCz.js → chunk-C7G6YPKG-Do2eDGGY.js} +1 -1
  83. package/dist/public/assets/{chunk-CQNSW5MT-BzGo9Za_.js → chunk-CQNSW5MT-CnhzhYO8.js} +1 -1
  84. package/dist/public/assets/{chunk-CYSBUYHQ-CKmnpHug.js → chunk-CYSBUYHQ--r3UnEvE.js} +1 -1
  85. package/dist/public/assets/{chunk-EMLP6XTP-_x7IkQoS.js → chunk-EMLP6XTP-DrfV6ENZ.js} +1 -1
  86. package/dist/public/assets/{chunk-EX3LRPZG-Dp9dLoos.js → chunk-EX3LRPZG-5ZShCZOk.js} +1 -1
  87. package/dist/public/assets/{chunk-FWX5IMBZ-DS2bi_oI.js → chunk-FWX5IMBZ-o2qZZUCd.js} +2 -2
  88. package/dist/public/assets/{chunk-HOUHSVGY-CiAzcmEO.js → chunk-HOUHSVGY-Df48_U0n.js} +1 -1
  89. package/dist/public/assets/{chunk-ICXQ74PX-COjRz7aI.js → chunk-ICXQ74PX-C5pgH7nt.js} +1 -1
  90. package/dist/public/assets/{chunk-JG7HCLWE-BIqqOtX1.js → chunk-JG7HCLWE-BML1eBLo.js} +1 -1
  91. package/dist/public/assets/{chunk-JWPE2WC7-DKmcMFEN.js → chunk-JWPE2WC7-CdhLoJ2N.js} +1 -1
  92. package/dist/public/assets/{chunk-MOJQB5TN-BJQv3CxF.js → chunk-MOJQB5TN-DlER2Egr.js} +1 -1
  93. package/dist/public/assets/{chunk-MOZMSUNE-Cy6wrRA7.js → chunk-MOZMSUNE-DUrRQaqL.js} +1 -1
  94. package/dist/public/assets/{chunk-OGEWGWER-C7C3Oiaz.js → chunk-OGEWGWER-CSwz10O0.js} +1 -1
  95. package/dist/public/assets/{chunk-OSBZ3O6U-DmX-gaPq.js → chunk-OSBZ3O6U-81uAnz70.js} +1 -1
  96. package/dist/public/assets/{chunk-PUDLZKDR-ZoTPQ917.js → chunk-PUDLZKDR-DpE61GzF.js} +1 -1
  97. package/dist/public/assets/{chunk-Q4XR5HBZ-sjes-Yon.js → chunk-Q4XR5HBZ-BEUOBfte.js} +1 -1
  98. package/dist/public/assets/{chunk-QBLGF6JB-BiU9LEk8.js → chunk-QBLGF6JB-BLRJJJog.js} +1 -1
  99. package/dist/public/assets/{chunk-R7FJI6CG-BAfUnNIm.js → chunk-R7FJI6CG-DrLC9WW_.js} +1 -1
  100. package/dist/public/assets/{chunk-RYQCIY6F-IRvgwbUs.js → chunk-RYQCIY6F-C2zE8SC6.js} +1 -1
  101. package/dist/public/assets/{chunk-U6XO7XAA-2Ds3FX_A.js → chunk-U6XO7XAA-CzoIuhZL.js} +1 -1
  102. package/dist/public/assets/{chunk-V7JOEXUC-Xkrljz-l.js → chunk-V7JOEXUC-BQfpu3-5.js} +1 -1
  103. package/dist/public/assets/chunk-VAUOI2AC-BeKYmt6g.js +1 -0
  104. package/dist/public/assets/{chunk-VR4S4FIN-Db6y0lij.js → chunk-VR4S4FIN-QXoKTwNU.js} +1 -1
  105. package/dist/public/assets/{chunk-WYO6CB5R-WjatCbeP.js → chunk-WYO6CB5R-DAWl___9.js} +1 -1
  106. package/dist/public/assets/chunk-XXDRQBXY-BVenPdkF.js +1 -0
  107. package/dist/public/assets/{chunk-YOTPTUD7-BDIMzFfd.js → chunk-YOTPTUD7-BaSlFT1K.js} +1 -1
  108. package/dist/public/assets/{chunk-ZGVPDNZ5-DKtGLh__.js → chunk-ZGVPDNZ5-CApzXV8d.js} +1 -1
  109. package/dist/public/assets/{chunk-ZIRB5QZD-JvsKOaWe.js → chunk-ZIRB5QZD-DcyZ3zVD.js} +1 -1
  110. package/dist/public/assets/classDiagram-OUVF2IWQ-C-jB8GCV.js +1 -0
  111. package/dist/public/assets/classDiagram-v2-EOCWNBFH-YdtbtmeU.js +1 -0
  112. package/dist/public/assets/{client-version-D5pI6rXA.js → client-version-q6Dhv1UB.js} +1 -1
  113. package/dist/public/assets/{config-provider-DjoTPI46.js → config-provider-BlhsBCJH.js} +2 -2
  114. package/dist/public/assets/{cose-bilkent-JH36ORCC-B5xjEHuC.js → cose-bilkent-JH36ORCC-CA17ejsA.js} +1 -1
  115. package/dist/public/assets/cynefin-VYW2F7L2-D2sHOfu_.js +1 -0
  116. package/dist/public/assets/{cynefinDiagram-TSTJHNR4-BeGFvfoc.js → cynefinDiagram-TSTJHNR4-C1SvaQSj.js} +1 -1
  117. package/dist/public/assets/{dagre-CLVncoxl.js → dagre-BePblgKB.js} +1 -1
  118. package/dist/public/assets/{dagre-VKFMJZFB-D98i06T_.js → dagre-VKFMJZFB-DEzcQzQ_.js} +1 -1
  119. package/dist/public/assets/{diagram-FQU43EPY--u6SeKWp.js → diagram-FQU43EPY-CbY2dMOG.js} +1 -1
  120. package/dist/public/assets/{diagram-G47NLZAW-BqkpNwsF.js → diagram-G47NLZAW-DqCIUGeN.js} +1 -1
  121. package/dist/public/assets/{diagram-NH7WQ7WH-eeVqGH2O.js → diagram-NH7WQ7WH-Cw8bUyPJ.js} +1 -1
  122. package/dist/public/assets/{diagram-OA4YK3LP-D_SnUALW.js → diagram-OA4YK3LP-U82pbdIM.js} +1 -1
  123. package/dist/public/assets/{diagram-WEI45ONY-DKlVw8je.js → diagram-WEI45ONY-Q03Igfxy.js} +1 -1
  124. package/dist/public/assets/dist-BX94flmC.js +1 -0
  125. package/dist/public/assets/dist-C6PM6Xz4.js +2 -0
  126. package/dist/public/assets/{dist-DbWN0KUu.js → dist-D9TmfgYW.js} +122 -120
  127. package/dist/public/assets/{dist-DQ4RxLMf.js → dist-fh4pGZKU.js} +1 -1
  128. package/dist/public/assets/{doc-hash-Ds3Xt5sU.js → doc-hash-By0RtZb7.js} +1 -1
  129. package/dist/public/assets/{documents-events-CeD7Nm0E.js → documents-events-BRsI2hJl.js} +1 -1
  130. package/dist/public/assets/{ebnfDiagram-CCIWWBDH-d0cDPEQB.js → ebnfDiagram-CCIWWBDH-DZowrdm4.js} +1 -1
  131. package/dist/public/assets/{erDiagram-Q63AITRT-BsZ0tL6Z.js → erDiagram-Q63AITRT-CmoXSu-r.js} +1 -1
  132. package/dist/public/assets/eventmodeling-45OFAUF4-LqLB3TNh.js +1 -0
  133. package/dist/public/assets/{file-tree-adapter-UXgwHNRD.js → file-tree-adapter-NqeYDxT9.js} +1 -1
  134. package/dist/public/assets/{file-tree-utils-CKB7vhwx.js → file-tree-utils-BmEujY3K.js} +1 -1
  135. package/dist/public/assets/flowDiagram-23GEKE2U-4rTcseMm.js +1 -0
  136. package/dist/public/assets/{ganttDiagram-NO4QXBWP-DPxkIh3b.js → ganttDiagram-NO4QXBWP-C0xOCx7Q.js} +1 -1
  137. package/dist/public/assets/gitGraph-TEB2WS4Q-BEPuDtJ5.js +1 -0
  138. package/dist/public/assets/{gitGraphDiagram-IHSO6WYX-vSvxugX5.js → gitGraphDiagram-IHSO6WYX-_EJiD41h.js} +1 -1
  139. package/dist/public/assets/globals-Box5QldL.css +1 -0
  140. package/dist/public/assets/{globals-Bo785x8X.js → globals-DFE-MLkJ.js} +1 -1
  141. package/dist/public/assets/{graphlib-C4UD57Nn.js → graphlib-DnpO72b_.js} +1 -1
  142. package/dist/public/assets/{highlighted-body-OFNGDK62-DCKUiY8r.js → highlighted-body-OFNGDK62-CNSPR2wA.js} +1 -1
  143. package/dist/public/assets/index-Cb5OrOZT.js +2014 -0
  144. package/dist/public/assets/info-DKCQHKI2-CMS65hg4.js +1 -0
  145. package/dist/public/assets/{infoDiagram-FWYZ7A6U-Crh0f5aw.js → infoDiagram-FWYZ7A6U-CS6V0kHh.js} +1 -1
  146. package/dist/public/assets/{ishikawaDiagram-FXEZZL3T-DBJ4jEKk.js → ishikawaDiagram-FXEZZL3T-CyR5Ajwf.js} +1 -1
  147. package/dist/public/assets/{journeyDiagram-5HDEW3XC-CUDo0rzP.js → journeyDiagram-5HDEW3XC-CDLzkiDv.js} +1 -1
  148. package/dist/public/assets/{kanban-definition-HUTT4EX6-CJD8Oexf.js → kanban-definition-HUTT4EX6-DpgKHF6a.js} +1 -1
  149. package/dist/public/assets/{line-ClsiHw5g.js → line-5y1fbUZx.js} +1 -1
  150. package/dist/public/assets/{linear-BklRBRnp.js → linear-Cr_l_wiY.js} +1 -1
  151. package/dist/public/assets/{lint-config-client-CU8tKrUp.js → lint-config-client-m2-s0Ntp.js} +1 -1
  152. package/dist/public/assets/{map-CMaVsxPf.js → map-Y1ICr5kQ.js} +1 -1
  153. package/dist/public/assets/{markdownlint-rule-browser-D-lKa2AX.js → markdownlint-rule-browser-D59yIUvb.js} +1 -1
  154. package/dist/public/assets/mermaid-GHXKKRXX-cKMuWw6m.js +1 -0
  155. package/dist/public/assets/{mermaid-parser.core-D-rj2UdW.js → mermaid-parser.core-CqW0l_dJ.js} +2 -2
  156. package/dist/public/assets/{mermaid.core-DZGNq3YZ.js → mermaid.core-DTAF4MBn.js} +3 -3
  157. package/dist/public/assets/{mindmap-definition-LN4V7U3C-Drk1V3-q.js → mindmap-definition-LN4V7U3C-D_O_QNPK.js} +1 -1
  158. package/dist/public/assets/{navigation-targets-DlApq0F4.js → navigation-targets-BNXyYGqo.js} +1 -1
  159. package/dist/public/assets/{now-Ck_JVNC2.js → now-DZKi6vJC.js} +1 -1
  160. package/dist/public/assets/{open-managed-artifact-tab-C_zW-xH-.js → open-managed-artifact-tab-B_XkGOR4.js} +1 -1
  161. package/dist/public/assets/{ordinal-DrDHGs3t.js → ordinal-BWNniVDk.js} +1 -1
  162. package/dist/public/assets/packet-7NZHBO7P-BHMeVRDP.js +1 -0
  163. package/dist/public/assets/{pegDiagram-2B236MQR-CM3AjMbx.js → pegDiagram-2B236MQR-CdihzSPE.js} +1 -1
  164. package/dist/public/assets/{pending-receive-nav-store-CRA3584T.js → pending-receive-nav-store-lH450qAv.js} +1 -1
  165. package/dist/public/assets/pie-RZYD4A2V-04-GDYum.js +1 -0
  166. package/dist/public/assets/{pieDiagram-ENE6RG2P-D8wIwdwS.js → pieDiagram-ENE6RG2P-ChFgOvHp.js} +1 -1
  167. package/dist/public/assets/{prop-types-Bp7ajkYA.js → prop-types-CYlKPf0N.js} +1 -1
  168. package/dist/public/assets/{quadrantDiagram-ABIIQ3AL-h2Dtd1uI.js → quadrantDiagram-ABIIQ3AL-BSsBk-PK.js} +1 -1
  169. package/dist/public/assets/radar-I7S5WNFK-CFV8GxSd.js +1 -0
  170. package/dist/public/assets/railroad-3IZDKUUU-HocUJIPa.js +1 -0
  171. package/dist/public/assets/railroad-abnf-AHOZXSZD-BjtQnDLf.js +1 -0
  172. package/dist/public/assets/railroad-ebnf-EBAXGLYW-CB0AKoda.js +1 -0
  173. package/dist/public/assets/railroad-peg-LSFZ7HO6-D14HGrNX.js +1 -0
  174. package/dist/public/assets/{railroadDiagram-RFXS5EU6-CLc68_Sv.js → railroadDiagram-RFXS5EU6-CZtrUy7I.js} +1 -1
  175. package/dist/public/assets/{receive-store-CmOFuJ5o.js → receive-store-CnPZW2Nl.js} +1 -1
  176. package/dist/public/assets/{requirementDiagram-TGXJPOKE-DtJA-6Zq.js → requirementDiagram-TGXJPOKE-4y0MwGkb.js} +1 -1
  177. package/dist/public/assets/{sankeyDiagram-HTMAVEWB-Dw4-_oAZ.js → sankeyDiagram-HTMAVEWB-DU6fqR-t.js} +1 -1
  178. package/dist/public/assets/{selection-context-DJG3xvFp.js → selection-context-LHeRMlQS.js} +1 -1
  179. package/dist/public/assets/{sequenceDiagram-DBY2YBRQ-B4Af8Tp3.js → sequenceDiagram-DBY2YBRQ-BLOHid4z.js} +1 -1
  180. package/dist/public/assets/{sizeCapture-X5ZJPWSS-B7J9pg7l.js → sizeCapture-X5ZJPWSS-DHfk9Ljg.js} +1 -1
  181. package/dist/public/assets/skill-actions-CfCRZPoW.js +1 -0
  182. package/dist/public/assets/{skills-api-CN8Hksry.js → skills-api-BazENdP9.js} +1 -1
  183. package/dist/public/assets/{src-UzA84-l2.js → src-gwekitwz.js} +2 -2
  184. package/dist/public/assets/{src-D9eynQ26.js → src-xjlg9C_q.js} +1 -1
  185. package/dist/public/assets/{stateDiagram-2N3HPSRC-L3VR_LMr.js → stateDiagram-2N3HPSRC-BSUZgpoy.js} +1 -1
  186. package/dist/public/assets/stateDiagram-v2-6OUMAXLB-BTi0JfLJ.js +1 -0
  187. package/dist/public/assets/{swimlanes-5IMT3BWC-CRfWYpqt.js → swimlanes-5IMT3BWC-DXdgh-Jw.js} +2 -2
  188. package/dist/public/assets/swimlanesDiagram-G3AALYLV-v3ze-Bpb.js +8 -0
  189. package/dist/public/assets/{tag-pill-input-DVEEYU9y.js → tag-pill-input-CRZHSDZk.js} +1 -1
  190. package/dist/public/assets/{target-navigation-intent-DBKxmlEZ.js → target-navigation-intent-Dj_FUf4y.js} +1 -1
  191. package/dist/public/assets/{telemetry-impl-B0xfYfCD.js → telemetry-impl-P2IeKAaO.js} +2 -2
  192. package/dist/public/assets/{telemetry-startup-BYP0kNl2.js → telemetry-startup-DEYbhmGw.js} +1 -1
  193. package/dist/public/assets/{terminal-launch-events-OZusAMc8.js → terminal-launch-events-DScIDElv.js} +1 -1
  194. package/dist/public/assets/{terminal-telemetry-1gUD9W57.js → terminal-telemetry-DXukxrNb.js} +1 -1
  195. package/dist/public/assets/{timeline-definition-FHXFAJF6-C1Qc7Dba.js → timeline-definition-FHXFAJF6-DgwM8xnq.js} +1 -1
  196. package/dist/public/assets/treeView-QDETBFTQ-P-cJWDuJ.js +1 -0
  197. package/dist/public/assets/treemap-6X3UGDF4-DHfkEEZV.js +1 -0
  198. package/dist/public/assets/{typing-burst-detector-CjeuhXb7.js → typing-burst-detector-vTqYB3XL.js} +2 -2
  199. package/dist/public/assets/{uninstall-Cp4M347z.js → uninstall-BZCRgnr7.js} +1 -1
  200. package/dist/public/assets/{use-activity-panel-CZ8r7sJr.js → use-activity-panel-p45LX2Pn.js} +1 -1
  201. package/dist/public/assets/{use-apply-config-color-theme-kT3YWc5p.js → use-apply-config-color-theme-42OkirpU.js} +1 -1
  202. package/dist/public/assets/{use-collab-url-DPrY37Xq.js → use-collab-url-CD04O43Q.js} +1 -1
  203. package/dist/public/assets/{use-live-xterm-theme-BYn_alYX.js → use-live-xterm-theme-DBloho-q.js} +1 -1
  204. package/dist/public/assets/{use-settings-route-DbIUNQxX.js → use-settings-route-CqFpylkf.js} +1 -1
  205. package/dist/public/assets/{use-terminal-enabled-BPcyrJJU.js → use-terminal-enabled-DJWPpDI0.js} +1 -1
  206. package/dist/public/assets/use-timeline-entry-diff-Buyw-iUn.js +6 -0
  207. package/dist/public/assets/{use-workspace-BJkoTGFP.js → use-workspace-KCjvxowE.js} +1 -1
  208. package/dist/public/assets/{vennDiagram-L72KCM5P-C4cNDPVl.js → vennDiagram-L72KCM5P-Ds0NnN2m.js} +1 -1
  209. package/dist/public/assets/wardley-OPB4EBWU-CYMtNsgm.js +1 -0
  210. package/dist/public/assets/{wardleyDiagram-EHGQE667-B2UY3KQf.js → wardleyDiagram-EHGQE667-CyCq4K63.js} +1 -1
  211. package/dist/public/assets/{workspace-paths-BYp4HrI_.js → workspace-paths-7c4g7gcc.js} +1 -1
  212. package/dist/public/assets/{xychartDiagram-FW5EYKEG-CMsrwnL2.js → xychartDiagram-FW5EYKEG-DKLKXonj.js} +1 -1
  213. package/dist/public/index.html +47 -46
  214. package/dist/public/uninstall.html +5 -5
  215. package/dist/{repair-launch-json-CZawWAqd.mjs → repair-launch-json-DI-m7k4O.mjs} +2 -2
  216. package/dist/{repair-mcp-configs-DpdVVhiU.mjs → repair-mcp-configs-CsyBggTD.mjs} +2 -2
  217. package/dist/repair-skills-CkFqORhu.mjs +1 -0
  218. package/dist/{repair-skills-DllMOsvZ.mjs → repair-skills-D1i6iLv9.mjs} +2 -2
  219. package/dist/schemas/v0/config.project.schema.json +154 -0
  220. package/dist/server-lock-CIgYSMil.mjs +1 -0
  221. package/dist/{server-lock-Cr23NqXF.mjs → server-lock-VVJOI8HF.mjs} +2 -2
  222. package/dist/{sleep-B2L0pvp4.mjs → sleep-DTzPXGtM.mjs} +5 -5
  223. package/dist/src-4plpVqWf.mjs +3268 -0
  224. package/dist/src-B1AwMBZC.mjs +20 -0
  225. package/dist/{src-CJ8mKCzo.mjs → src-ByC_RNGy.mjs} +120 -116
  226. package/dist/src-Dtqr3yLh.mjs +1 -0
  227. package/dist/{start-FUQOcvoI.mjs → start-BqYk_tuA.mjs} +2 -2
  228. package/dist/start-cL5kxmwb.mjs +1 -0
  229. package/dist/{write-project-skill-CeYehb7h.mjs → write-project-skill-wHG3k3iy.mjs} +4 -4
  230. package/package.json +4 -4
  231. package/dist/build-L3kflBeC.mjs +0 -1
  232. package/dist/constants-CcMCMPg3.mjs +0 -2
  233. package/dist/fs-traced-BpCA6YXG.mjs +0 -1
  234. package/dist/git-handle-Dqp-QyuN.mjs +0 -1
  235. package/dist/init-lRVOzPU9.mjs +0 -1
  236. package/dist/loader-CSY1M15w.mjs +0 -1
  237. package/dist/md-manager-B4llsKsm.mjs +0 -2
  238. package/dist/preview-CiaBar1u.mjs +0 -1
  239. package/dist/public/assets/ActivityModeContent-Cj3BeHpK.js +0 -1
  240. package/dist/public/assets/CodeMirrorPropInput-B34vnmpV.js +0 -3
  241. package/dist/public/assets/DocumentContext-BiAlIaIL.js +0 -38
  242. package/dist/public/assets/FeedbackForm-BtLP5P4r.js +0 -1
  243. package/dist/public/assets/ManagedArtifactProperties-BHDbPsDj.js +0 -1
  244. package/dist/public/assets/PropertyPanel-Bke_n9xy.js +0 -2
  245. package/dist/public/assets/SourceEditor-rMBsqzFc.js +0 -1
  246. package/dist/public/assets/architecture-TIHT7OUA-D0qm7G-3.js +0 -1
  247. package/dist/public/assets/channel-DA_5WVVG.js +0 -1
  248. package/dist/public/assets/chunk-2Q5K7J3B-CZvundFv.js +0 -1
  249. package/dist/public/assets/chunk-VAUOI2AC-CzpwkaIj.js +0 -1
  250. package/dist/public/assets/chunk-XXDRQBXY-aujsIsPx.js +0 -1
  251. package/dist/public/assets/classDiagram-OUVF2IWQ-DaJYvXbz.js +0 -1
  252. package/dist/public/assets/classDiagram-v2-EOCWNBFH-naGS_xxO.js +0 -1
  253. package/dist/public/assets/cynefin-VYW2F7L2-BIoIBt-C.js +0 -1
  254. package/dist/public/assets/dist-B1qkpf98.js +0 -2
  255. package/dist/public/assets/eventmodeling-45OFAUF4-DJJWSxES.js +0 -1
  256. package/dist/public/assets/flowDiagram-23GEKE2U-BDvIWhMq.js +0 -1
  257. package/dist/public/assets/gitGraph-TEB2WS4Q-DbaUaLPe.js +0 -1
  258. package/dist/public/assets/globals-DF_8aGgC.css +0 -1
  259. package/dist/public/assets/index-CFaXQy8P.js +0 -2014
  260. package/dist/public/assets/info-DKCQHKI2-t_ReTPP2.js +0 -1
  261. package/dist/public/assets/mermaid-GHXKKRXX-Cj1_l2m9.js +0 -1
  262. package/dist/public/assets/packet-7NZHBO7P-DvVA7lgt.js +0 -1
  263. package/dist/public/assets/pie-RZYD4A2V-THg35hJ6.js +0 -1
  264. package/dist/public/assets/radar-I7S5WNFK-Cnae5YqF.js +0 -1
  265. package/dist/public/assets/railroad-3IZDKUUU-z19uKrUP.js +0 -1
  266. package/dist/public/assets/railroad-abnf-AHOZXSZD-BUg9AO49.js +0 -1
  267. package/dist/public/assets/railroad-ebnf-EBAXGLYW-DuBtfJ_K.js +0 -1
  268. package/dist/public/assets/railroad-peg-LSFZ7HO6-BSfcErEJ.js +0 -1
  269. package/dist/public/assets/skill-actions-CnJP2Bcc.js +0 -1
  270. package/dist/public/assets/stateDiagram-v2-6OUMAXLB-DM5o7mT7.js +0 -1
  271. package/dist/public/assets/swimlanesDiagram-G3AALYLV-BTrTvdTh.js +0 -8
  272. package/dist/public/assets/treeView-QDETBFTQ-nC4bzLZB.js +0 -1
  273. package/dist/public/assets/treemap-6X3UGDF4-D1MGcMAJ.js +0 -1
  274. package/dist/public/assets/use-timeline-entry-diff-vG8YRtnb.js +0 -6
  275. package/dist/public/assets/wardley-OPB4EBWU-Dt2lEMaH.js +0 -1
  276. package/dist/repair-skills-Buq5QlSJ.mjs +0 -1
  277. package/dist/server-lock-D335a5oG.mjs +0 -1
  278. package/dist/src-9fqRbYyu.mjs +0 -22
  279. package/dist/src-CIFd3tOE.mjs +0 -3267
  280. package/dist/src-DHVO9P4d.mjs +0 -1
  281. package/dist/start-eE4o515K.mjs +0 -1
  282. /package/dist/public/assets/{ActivityPanelDiffView-CSOgz1F9.js → ActivityPanelDiffView-BGKBr_no.js} +0 -0
  283. /package/dist/public/assets/{AppMenubar-CXadCCMc.js → AppMenubar-BU0HYo5c.js} +0 -0
  284. /package/dist/public/assets/{BugReportHistoryDialog-B5Yf5rAM.js → BugReportHistoryDialog-BZO4T3mM.js} +0 -0
  285. /package/dist/public/assets/{__vite-browser-external-T_MG5_bv.js → __vite-browser-external-BPhyXp2q.js} +0 -0
  286. /package/dist/public/assets/{agent-presence-CTJkQnoU.js → agent-presence-BDFQXhQj.js} +0 -0
  287. /package/dist/public/assets/{array-BAI_NyvG.js → array-DJgG7CD3.js} +0 -0
  288. /package/dist/public/assets/{chunk-KEIR6QF5-BSqm2tNO.js → chunk-KEIR6QF5-C3U0QMR_.js} +0 -0
  289. /package/dist/public/assets/{chunk-Y2CYZVJY-BCLrJxO_.js → chunk-Y2CYZVJY-WLanMySb.js} +0 -0
  290. /package/dist/public/assets/{clike-CkWR_Slw.js → clike-CsX0C1YS.js} +0 -0
  291. /package/dist/public/assets/{clipboard-adapter--Ja4oXEM.js → clipboard-adapter-B_gXWRIi.js} +0 -0
  292. /package/dist/public/assets/{colors-C1oQkVlI.js → colors-CWhKCDlb.js} +0 -0
  293. /package/dist/public/assets/{cytoscape.esm-ewu4kfMU.js → cytoscape.esm-2keAwKuv.js} +0 -0
  294. /package/dist/public/assets/{defaultLocale-C0VJf-tm.js → defaultLocale-CsPu2dQr.js} +0 -0
  295. /package/dist/public/assets/{diff-BsdYbIgD.js → diff-CbyZ1KYU.js} +0 -0
  296. /package/dist/public/assets/{dist-d-7NE8aL.js → dist-6exA4p3e.js} +0 -0
  297. /package/dist/public/assets/{dist-BocybIB-.js → dist-CmkBz4Vc.js} +0 -0
  298. /package/dist/public/assets/{dist-DDqBNQiG.js → dist-Ct4bmKYA.js} +0 -0
  299. /package/dist/public/assets/{dist-BF6U-ayK.js → dist-O02mGI7S.js} +0 -0
  300. /package/dist/public/assets/{follow-file-DBnmqlyk.js → follow-file-zwaRiP64.js} +0 -0
  301. /package/dist/public/assets/{form-D-z6QdLf.js → form-fGxW7-bd.js} +0 -0
  302. /package/dist/public/assets/{format-BVhfvqw3.js → format-CrtQIa7U.js} +0 -0
  303. /package/dist/public/assets/{go-D-ZJPtwk.js → go-Cx3BNpJ0.js} +0 -0
  304. /package/dist/public/assets/{init-BX0_4ZBD.js → init-tdyl3bNV.js} +0 -0
  305. /package/dist/public/assets/{isObject-BkQ5hIlp.js → isObject-CX6hKsbi.js} +0 -0
  306. /package/dist/public/assets/{libesm-CHqp8owk.js → libesm-JNr6wvfe.js} +0 -0
  307. /package/dist/public/assets/{lru-string-cache-hwDoWobi.js → lru-string-cache-BqWv9U_z.js} +0 -0
  308. /package/dist/public/assets/{lua-Cx3bDzQk.js → lua-u3LXwKmZ.js} +0 -0
  309. /package/dist/public/assets/{mcp-consent-store-Xk9UA_MB.js → mcp-consent-store-D31n_rvi.js} +0 -0
  310. /package/dist/public/assets/{min-Bd9Lorof.js → min-K63jgMN_.js} +0 -0
  311. /package/dist/public/assets/{panzoom.es-B9Lp3OVt.js → panzoom.es-CLhX4RTP.js} +0 -0
  312. /package/dist/public/assets/{path-C1_RvjGX.js → path-D0DHVP2m.js} +0 -0
  313. /package/dist/public/assets/{pdf-B7Y_z-D1.js → pdf-D1xNRDom.js} +0 -0
  314. /package/dist/public/assets/{pdf.worker-B6TdDPWM.js → pdf.worker-BoI-M0vk.js} +0 -0
  315. /package/dist/public/assets/{perl-CV3dlsd7.js → perl-Ds8HeZsB.js} +0 -0
  316. /package/dist/public/assets/{properties-D1GaCcfv.js → properties-CZlNTT94.js} +0 -0
  317. /package/dist/public/assets/{r-CHRF940O.js → r-fvx4gKsV.js} +0 -0
  318. /package/dist/public/assets/{rough.esm-B1nzhEZO.js → rough.esm-BNRxiiMT.js} +0 -0
  319. /package/dist/public/assets/{ruby-YzQuyklS.js → ruby-BGw-M-J7.js} +0 -0
  320. /package/dist/public/assets/{schema-fields-view-intent-Dz1ZzVCe.js → schema-fields-view-intent-BxfUZqrI.js} +0 -0
  321. /package/dist/public/assets/{share-metadata-rows-BlaR96La.js → share-metadata-rows-CheY4PXF.js} +0 -0
  322. /package/dist/public/assets/{shell-BvVJAeXE.js → shell-DTMPEhEr.js} +0 -0
  323. /package/dist/public/assets/{sortable.esm-B6whf_t-.js → sortable.esm-DGuuqLb9.js} +0 -0
  324. /package/dist/public/assets/{sql-CECtKdDi.js → sql-DoPu5kfc.js} +0 -0
  325. /package/dist/public/assets/{src-BaTc8y5c.js → src-Bipm8mTe.js} +0 -0
  326. /package/dist/public/assets/{swift-DLct3DJs.js → swift-CfZoxKRA.js} +0 -0
  327. /package/dist/public/assets/{textarea-RSYJwPz9.js → textarea-DII_Czak.js} +0 -0
  328. /package/dist/public/assets/{thread-client-CXDtD9Ce.js → thread-client-59Ryh_VO.js} +0 -0
  329. /package/dist/public/assets/{thread-draft-staging-B4_1TigQ.js → thread-draft-staging-YcpEkMiY.js} +0 -0
  330. /package/dist/public/assets/{toml-Bl-Vp4wG.js → toml-Br73Jx61.js} +0 -0
  331. /package/dist/public/assets/{useLintConfigViewMode-BYm6FwC5.js → useLintConfigViewMode-MQmCIk3b.js} +0 -0
@@ -0,0 +1,2014 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./telemetry-impl-P2IeKAaO.js","./chunk-CYidjpOJ.js","./preload-helper-Chd9yIcd.js","./trace-api-DHyWZzIa.js","./propagation-api-OHat7V1z.js","./ReportBugDialogBody-CFAfyMu8.js","./dist-D9TmfgYW.js","./lib-Iu39CNZE.js","./markdownit-YwcN3EvW.js","./w3c-keyname-DtWCia6R.js","./dist-Nvb76hAm.js","./jsx-runtime-BUgB2tll.js","./react-f2sANaYj.js","./checkbox-DY-vIhnZ.js","./dist-D6h-uzOv.js","./createLucideIcon-DAkhoPjT.js","./bundle-mjs-SHeFpKGC.js","./react-dom-DPxgxlDT.js","./dist-DFt8VaPU.js","./dist-DEamjSXE.js","./check-GqWaoTdV.js","./minus-SecfYzeQ.js","./compiler-runtime-BfE3aGVn.js","./dialog-TkFkuYVg.js","./dist-BNcdLYQI.js","./es2015-BNlmLq62.js","./button-Gol9BgNB.js","./x-DVkpYo5d.js","./CopyButton-1Q6Wnnjb.js","./tooltip-B4J7VHmA.js","./dist-nHZgBxFS.js","./floating-ui.dom-DxCSXcm6.js","./copy-9EDFYcyR.js","./loader-circle-Cg5SU7AZ.js","./BugReportHistory-B0qbbAw0.js","./collapsible-B1mS1n9y.js","./chevron-down-Bx9f3tW-.js","./folder-open-wLd69QUc.js","./trash-2-BUuL4OCw.js","./badge-Dba4cvJR.js","./triangle-alert-Clgvyc7B.js","./input-D0ZW0Opq.js","./textarea-DII_Czak.js","./external-link-T4Nj1gcG.js","./clipboard-adapter-B_gXWRIi.js","./BugReportHistoryDialog-BZO4T3mM.js","./GraphPanel-CqaIMvPS.js","./dist-q14fBS3T.js","./toggle-group-CjXmmTGy.js","./dist-BjDuLI_j.js","./dist-DAU1MdSo.js","./useQuery-ZeEDLtxh.js","./min-K63jgMN_.js","./src-Bipm8mTe.js","./colors-CWhKCDlb.js","./ordinal-BWNniVDk.js","./init-tdyl3bNV.js","./isObject-CX6hKsbi.js","./now-DZKi6vJC.js","./arrow-up-right-obRIg3Sv.js","./prop-types-CYlKPf0N.js","./navigation-targets-BNXyYGqo.js","./file-tree-utils-BmEujY3K.js","./doc-hash-By0RtZb7.js","./documents-events-BRsI2hJl.js","./documents-fetch-CLL0O1of.js","./parse-api-error-C_gwkKmG.js","./startup-marks-CqVzdU1y.js","./dist-PQ5KMVDh.js","./target-navigation-intent-Dj_FUf4y.js","./panel-Cyobla0Z.js","./ActivityModeContent-C2P34Oxp.js","./DocumentContext-DYNMnkEK.js","./esm-HV7Pxfbn.js","./dist-DNwOaDhC.js","./dist-CP0xcBf_.js","./dist-ioWbCXab.js","./dist-DifRwKW-.js","./dist-BObw0jPE.js","./dist-CiPafPDy.js","./dist-BR00oFrA2.js","./dist-DGzvBIzr.js","./dist-C7rVxfRB.js","./stex-CniH6-Mv.js","./config-provider-BlhsBCJH.js","./client-version-q6Dhv1UB.js","./use-apply-config-color-theme-42OkirpU.js","./config-context-gd3BC-iY.js","./switch-DYic2V-1.js","./terminal-input-events-C5UuEsAB.js","./CodeMirrorPropInput-BDWvXsen.js","./git-branch-CMJAiYLz.js","./chevron-right-C8oTR6gu.js","./workspace-paths-7c4g7gcc.js","./eye-CASw1HTi.js","./hash-DNKDqZ18.js","./info-yKMseklR.js","./paperclip-CX7J_G-w.js","./sliders-horizontal-34K0eDW2.js","./dist-BLAMau9Z.js","./file-tree-rename-validation-wADtjYEi.js","./use-collab-url-CD04O43Q.js","./DocumentContext-B0sQn39F.css","./timeline-diff-store-CYckprSS.js","./agent-diff-store-CgUtJ40J.js","./cursor-C1n4GZG0.js","./copilot-BAzfPGty.js","./use-activity-panel-p45LX2Pn.js","./agent-presence-BDFQXhQj.js","./lru-string-cache-BqWv9U_z.js","./SettingsDialogBody-DXovj0IS.js","./sortable.esm-DGuuqLb9.js","./dropdown-menu-xw8WTdb-.js","./dist-BJa2CfR3.js","./label-DyipnO5I.js","./radio-group-CGEdWasQ.js","./separator-DExEeoYE.js","./EnableSyncConfirmDialog-ByznA2PW.js","./RegisteredAgentIcon-8Tcfr3WP.js","./skill-actions-CfCRZPoW.js","./refresh-cw-BfeWGCsv.js","./agent-visibility-Q7iJ3Wrj.js","./use-settings-route-CqFpylkf.js","./skills-api-BazENdP9.js","./use-workspace-KCjvxowE.js","./auth-state-cache-BGbpopsu.js","./square-pen-C1vIlMAW.js","./open-managed-artifact-tab-B_XkGOR4.js","./field-DVIFAnvR.js","./form-fGxW7-bd.js","./ConfigSharingInfoTooltip-DMbsfWD9.js","./schema-fields-view-intent-BxfUZqrI.js","./lint-plugin-meta-B3N1DKgL.js","./markdownlint-rule-browser-D59yIUvb.js","./skeleton-HLkcMp95.js","./tag-pill-input-CRZHSDZk.js","./lint-config-client-m2-s0Ntp.js","./use-terminal-enabled-DJWPpDI0.js","./terminal-telemetry-DXukxrNb.js","./ManagedArtifactProperties-Bv97X2Kw.js","./PropertyPanel-TNLuDkLB.js","./format-CrtQIa7U.js","./braces-DwnwFx_V.js","./selection-context-LHeRMlQS.js","./MermaidDocEditor-peOyXfDP.js","./dist-BX94flmC.js","./dist-C6PM6Xz4.js","./src-gwekitwz.js","./SourceEditor-C5A403lL.js","./typing-burst-detector-vTqYB3XL.js","./wrench-BfoTvqT9.js","./SkillEditorActions-ghSewPgo.js","./LintConfigEditor-2sMpGsvn.js","./EditorModeToggle-DUpVsmPc.js","./useLintConfigViewMode-MQmCIk3b.js","./SchemaConfigEditor-CINC-UXE.js","./case-sensitive-nl0tWMnZ.js","./TimelineDiffPane-CzDAeswG.js","./use-timeline-entry-diff-Buyw-iUn.js","./libesm-JNr6wvfe.js","./panel-right-open-B7ziq39V.js","./AgentDiffPane-DcYd6e4i.js","./AppMenubar-BU0HYo5c.js","./AgentThreadClientBinder-Dc_ZvYaC.js","./thread-client-59Ryh_VO.js","./TerminalSessionsHost-DXQM6Nk-.js","./terminal-launch-events-DScIDElv.js","./thread-draft-staging-YcpEkMiY.js","./McpConsentDialogBody-g1cYKWmV.js","./mcp-consent-store-D31n_rvi.js","./ShareBranchSwitchDialog-Dfc-qPui.js","./miss-dialog-store-Bx4JLuKB.js","./share-metadata-rows-CheY4PXF.js","./desktop-bridge-types--ZPzhkC9.js","./receive-store-CnPZW2Nl.js","./worktree-store-LSx9q9Ga.js","./ShareReceiveMissDialog-RIU6HaEy.js","./pending-receive-nav-store-lH450qAv.js","./ConsentDialogBody-CerQg1mw.js","./project-paths-Dwo4Of8C.js","./ShareReceiveDialog-mjee2gdk.js","./TerminalWindowApp-DFkdh_Dr.js","./use-live-xterm-theme-DBloho-q.js","./use-installed-clis-B_nDAq7A.js","./telemetry-startup-DEYbhmGw.js"])))=>i.map(i=>d[i]);
2
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./globals-DFE-MLkJ.js";import{t as n}from"./preload-helper-Chd9yIcd.js";import{t as r}from"./jsx-runtime-BUgB2tll.js";import{$ as i,$t as a,A as o,At as s,B as c,Bt as l,C as u,Ct as d,D as f,Dt as p,Et as m,F as h,Ft as g,G as _,Gt as v,H as y,Ht as b,I as x,It as S,J as C,Jt as w,K as T,Kt as E,L as D,Lt as O,M as k,Mt as A,N as j,Nt as M,O as N,Ot as P,P as F,Pt as I,Q as L,Qt as R,R as z,Rt as B,S as V,St as H,T as U,Tt as W,U as G,Ut as K,V as ee,Vt as te,W as ne,Wt as q,X as re,Xt as ie,Y as ae,Z as oe,Zt as se,_ as ce,_t as le,a as ue,an as de,b as fe,bt as pe,c as me,cn as he,ct as ge,d as _e,dt as ve,en as ye,et as be,f as xe,fn as Se,ft as Ce,g as we,gt as Te,h as Ee,ht as De,i as Oe,in as ke,j as Ae,jt as je,k as Me,kt as Ne,l as Pe,lt as Fe,m as Ie,mn as Le,mt as Re,n as ze,nn as Be,nt as Ve,o as He,on as Ue,ot as We,p as Ge,pn as Ke,pt as qe,q as Je,r as Ye,rn as Xe,rt as Ze,s as Qe,sn as $e,st as et,t as tt,tn as nt,tt as rt,u as it,un as at,ut as ot,vt as st,w as ct,wt as lt,xt as ut,y as dt,yt as ft,z as pt,zt as mt}from"./DocumentContext-DYNMnkEK.js";import{t as ht}from"./react-f2sANaYj.js";import{n as J,r as gt,t as _t}from"./dist-Nvb76hAm.js";import{_ as vt,a as yt,c as bt,d as xt,f as St,g as Ct,h as wt,i as Tt,l as Et,m as Dt,n as Ot,o as kt,p as At,r as jt,s as Mt,t as Nt,u as Pt,v as Ft,y as It}from"./useQuery-ZeEDLtxh.js";import{n as Lt,t as Rt}from"./dist-PQ5KMVDh.js";import{t as zt}from"./react-dom-DPxgxlDT.js";import{t as Bt}from"./compiler-runtime-BfE3aGVn.js";import{a as Vt,c as Ht,i as Ut,l as Wt,o as Gt,r as Kt,s as qt,t as Jt,u as Yt}from"./terminal-input-events-C5UuEsAB.js";import{n as Xt,s as Y,t as Zt}from"./createLucideIcon-DAkhoPjT.js";import{n as Qt,r as $t,t as X}from"./button-Gol9BgNB.js";import{c as en,i as tn,l as nn,o as rn,t as an}from"./dist-D6h-uzOv.js";import{i as on,n as sn,r as cn,t as ln}from"./tooltip-B4J7VHmA.js";import{n as un,r as dn,t as fn}from"./collapsible-B1mS1n9y.js";import{a as pn,c as mn,i as hn,n as gn,o as _n,s as vn,t as yn}from"./dialog-TkFkuYVg.js";import{$ as bn,A as xn,B as Sn,C as Cn,E as wn,G as Tn,H as En,K as Dn,N as On,Q as kn,T as An,U as jn,X as Mn,_ as Nn,b as Pn,ct as Fn,dt as In,et as Ln,f as Rn,ft as zn,k as Bn,l as Vn,lt as Hn,m as Un,q as Wn,st as Gn,tt as Kn,u as qn,ut as Jn,z as Yn}from"./CodeMirrorPropInput-BDWvXsen.js";import{t as Xn}from"./checkbox-DY-vIhnZ.js";import{a as Zn,d as Qn,i as $n,l as er,n as tr,o as nr,r as rr,s as ir,t as ar,u as or}from"./floating-ui.dom-DxCSXcm6.js";import{_ as sr,a as cr,c as lr,d as ur,f as dr,g as fr,h as pr,i as mr,l as hr,m as gr,n as _r,o as vr,p as yr,r as br,s as xr,t as Sr,u as Cr}from"./dist-BJa2CfR3.js";import{a as wr,d as Tr,f as Er,i as Dr,m as Or,n as kr,o as Ar,p as jr,r as Mr,s as Nr,t as Pr,u as Fr}from"./dropdown-menu-xw8WTdb-.js";import{t as Ir}from"./label-DyipnO5I.js";import{c as Lr,s as Rr}from"./switch-DYic2V-1.js";import{n as zr,t as Br}from"./radio-group-CGEdWasQ.js";import{t as Vr}from"./separator-DExEeoYE.js";import{n as Hr,r as Ur,t as Wr}from"./toggle-group-CjXmmTGy.js";import{C as Gr,S as Kr,a as qr,b as Jr,c as Yr,f as Xr,h as Zr,n as Qr,o as $r,r as ei,s as ti,t as ni,u as ri,v as ii,x as ai}from"./agent-visibility-Q7iJ3Wrj.js";import{a as oi,i as si,n as ci,r as li}from"./terminal-telemetry-DXukxrNb.js";import{$a as ui,$i as di,$n as fi,A as pi,At as mi,Ba as hi,Bt as gi,C as _i,Cn as vi,D as yi,Di as bi,Dr as xi,E as Si,F as Ci,Gn as wi,Gr as Ti,H as Ei,Ha as Di,Hi as Oi,Hn as ki,I as Ai,In as ji,Ji as Mi,Ka as Ni,Ki as Pi,Kr as Fi,Ln as Ii,M as Li,Mn as Ri,N as zi,Nn as Bi,Nr as Vi,Oi as Hi,On as Ui,Pn as Wi,Qa as Gi,Qi as Ki,Qr as qi,R as Ji,Sr as Yi,Tt as Xi,Ui as Zi,Vr as Qi,Vt as $i,W as ea,Wn as ta,Wt as na,Xa as ra,Xr as ia,Yi as aa,Yn as oa,Zn as sa,Zr as ca,Zt as la,_i as ua,_n as da,aa as fa,ai as pa,ao as ma,at as ha,bi as ga,br as _a,c as va,ca as ya,ci as ba,co as xa,cr as Sa,di as Ca,dr as wa,ea as Ta,eo as Ea,gi as Da,gn as Oa,gr as ka,hr as Aa,ia as ja,io as Ma,ji as Na,jn as Pa,jt as Fa,n as Ia,no as La,oi as Ra,oo as za,ot as Ba,pr as Va,qa as Ha,qi as Ua,qn as Wa,qr as Ga,qt as Ka,r as qa,ra as Ja,ri as Ya,so as Xa,t as Za,ta as Qa,ti as $a,tn as eo,to,ut as no,v as ro,vi as io,wn as ao,xi as oo,ya as so,yi as co,yr as lo,yt as uo,zr as fo}from"./dist-D9TmfgYW.js";import{t as po}from"./git-branch-CMJAiYLz.js";import{c as mo,d as ho,f as go,l as _o,p as vo,u as yo}from"./EnableSyncConfirmDialog-ByznA2PW.js";import{t as bo}from"./arrow-up-right-obRIg3Sv.js";import{r as xo,t as So}from"./RegisteredAgentIcon-8Tcfr3WP.js";import{a as Co,c as wo,d as To,f as Eo,h as Do,i as Oo,l as ko,m as Ao,n as jo,o as Mo,p as No,r as Po,s as Fo,t as Io,u as Lo}from"./PropertyPanel-TNLuDkLB.js";import{t as Ro}from"./case-sensitive-nl0tWMnZ.js";import{t as zo}from"./check-GqWaoTdV.js";import{t as Bo}from"./chevron-left-BQ6OM94c.js";import{t as Vo}from"./chevron-down-Bx9f3tW-.js";import{t as Ho}from"./chevron-right-C8oTR6gu.js";import{t as Uo}from"./CopyButton-1Q6Wnnjb.js";import{a as Wo,i as Go,n as Ko,o as qo,r as Jo,s as Yo}from"./prop-types-CYlKPf0N.js";import{S as Xo,_ as Zo,a as Qo,b as $o,c as es,d as ts,f as ns,g as rs,i as is,l as as,m as os,n as ss,o as cs,p as ls,r as us,s as ds,u as fs,v as ps,x as ms,y as hs}from"./skill-actions-CfCRZPoW.js";import{B as gs,D as _s,E as vs,F as ys,G as bs,H as xs,I as Ss,K as Cs,L as ws,M as Ts,N as Es,O as Ds,P as Os,R as ks,S as As,T as js,U as Ms,V as Ns,W as Ps,_ as Fs,a as Is,c as Ls,j as Rs,l as zs,m as Bs,n as Vs,r as Hs,t as Us,u as Ws,v as Gs,w as Ks,z as qs}from"./auth-state-cache-BGbpopsu.js";import{a as Js,d as Ys,i as Xs,l as Zs,n as Qs,o as $s,r as ec,s as tc,t as nc,u as rc}from"./workspace-paths-7c4g7gcc.js";import{t as ic}from"./copy-9EDFYcyR.js";import{n as ac,t as oc}from"./square-pen-C1vIlMAW.js";import{t as sc}from"./eye-CASw1HTi.js";import{a as cc,i as lc,n as uc,o as dc,r as fc,s as pc,t as mc}from"./pending-receive-nav-store-lH450qAv.js";import{t as hc}from"./folder-open-wLd69QUc.js";import{i as gc,o as _c,t as vc}from"./open-managed-artifact-tab-B_XkGOR4.js";import{t as yc}from"./hash-DNKDqZ18.js";import{A as bc,C as xc,D as Sc,O as Cc,S as wc,T as Tc,_ as Ec,a as Dc,b as Oc,c as kc,d as Ac,f as jc,g as Mc,h as Nc,j as Pc,k as Fc,l as Ic,m as Lc,n as Rc,o as zc,p as Bc,r as Vc,s as Hc,t as Uc,u as Wc,v as Gc,w as Kc,x as qc,y as Jc}from"./terminal-launch-events-DScIDElv.js";import{t as Yc}from"./info-yKMseklR.js";import{t as Xc}from"./loader-circle-Cg5SU7AZ.js";import{t as Zc}from"./miss-dialog-store-Bx4JLuKB.js";import{n as Qc,t as $c}from"./panel-right-open-B7ziq39V.js";import{t as el}from"./paperclip-CX7J_G-w.js";import{t as tl}from"./refresh-cw-BfeWGCsv.js";import{c as nl,n as rl,o as il,r as al,s as ol,t as sl}from"./field-DVIFAnvR.js";import{t as cl}from"./sliders-horizontal-34K0eDW2.js";import{t as ll}from"./trash-2-BUuL4OCw.js";import{t as ul}from"./triangle-alert-Clgvyc7B.js";import{i as dl,n as fl,r as pl,t as ml}from"./timeline-diff-store-CYckprSS.js";import{t as hl}from"./x-DVkpYo5d.js";import{n as gl,t as _l}from"./dist-BLAMau9Z.js";import{a as vl,i as yl,n as bl,r as xl}from"./project-paths-Dwo4Of8C.js";import{t as Sl}from"./input-D0ZW0Opq.js";import{t as Cl}from"./dist-q14fBS3T.js";import{d as wl,f as Tl,g as El,h as Dl,i as Ol,n as kl,o as Al,p as jl,r as Ml,t as Nl,u as Pl}from"./use-settings-route-CqFpylkf.js";import{t as Fl}from"./parse-api-error-C_gwkKmG.js";import{n as Il,r as Ll,t as Rl}from"./file-tree-rename-validation-wADtjYEi.js";import{a as zl,c as Bl,d as Vl,i as Hl,l as Ul,n as Wl,o as Gl,s as Kl,u as ql}from"./file-tree-utils-BmEujY3K.js";import{a as Jl,i as Yl,n as Xl,o as Zl,r as Ql,s as $l}from"./navigation-targets-BNXyYGqo.js";import{c as eu,i as tu,l as nu,n as ru,o as iu,r as au,s as ou,u as su}from"./documents-events-BRsI2hJl.js";import{t as cu}from"./documents-fetch-CLL0O1of.js";import{a as lu,i as uu,o as du}from"./startup-marks-CqVzdU1y.js";import{a as fu,c as pu,d as mu,f as hu,h as gu,i as _u,l as vu,n as yu,o as bu,p as xu,r as Su,s as Cu,t as wu,u as Tu}from"./doc-hash-By0RtZb7.js";import{t as Eu}from"./badge-Dba4cvJR.js";import{c as Du,i as Ou,n as ku,t as Au}from"./config-provider-BlhsBCJH.js";import{i as ju,r as Mu,t as Nu}from"./use-collab-url-CD04O43Q.js";import{n as Pu,t as Fu}from"./client-version-q6Dhv1UB.js";import{$ as Iu,Et as Lu,Ft as Ru,I as zu,It as Bu,J as Vu,Lt as Hu,Mt as Uu,Nt as Wu,Ot as Gu,Q as Ku,X as qu,Z as Ju,jt as Yu,k as Xu,kt as Zu,ot as Qu,w as $u,wt as ed,xt as td}from"./dist-DNwOaDhC.js";import{n as nd,s as rd,t as id}from"./esm-HV7Pxfbn.js";import{n as ad}from"./dist-DGzvBIzr.js";import{n as od}from"./config-context-gd3BC-iY.js";import{n as sd,t as cd}from"./external-link-T4Nj1gcG.js";import{n as ld,r as ud,t as dd}from"./worktree-store-LSx9q9Ga.js";import{t as fd}from"./use-workspace-KCjvxowE.js";import{c as pd,i as md,n as hd,r as gd,s as _d,t as vd}from"./selection-context-LHeRMlQS.js";import{_ as yd,a as bd,b as xd,c as Sd,d as Cd,f as wd,g as Td,h as Ed,i as Dd,l as Od,m as kd,n as Ad,o as jd,p as Md,s as Nd,t as Pd,u as Fd,v as Id,x as Ld}from"./typing-burst-detector-vTqYB3XL.js";import{t as Rd}from"./use-installed-clis-B_nDAq7A.js";import{a as zd,i as Bd,n as Vd,o as Hd,r as Ud,s as Wd,t as Gd}from"./panel-Cyobla0Z.js";import{t as Kd}from"./target-navigation-intent-Dj_FUf4y.js";import{t as qd}from"./lint-plugin-meta-B3N1DKgL.js";import{t as Jd}from"./skeleton-HLkcMp95.js";import{c as Yd,i as Xd,l as Zd,r as Qd}from"./lint-config-client-m2-s0Ntp.js";import{a as $d,o as ef,t as tf}from"./agent-diff-store-CgUtJ40J.js";import{t as nf}from"./dist-BX94flmC.js";import{a as rf,i as af,n as of,o as sf,r as cf,t as lf}from"./EditorModeToggle-DUpVsmPc.js";import{n as uf}from"./clipboard-adapter-B_gXWRIi.js";import{a as df,n as ff,s as pf}from"./follow-file-zwaRiP64.js";import{a as mf,f as hf,i as gf,l as _f,n as vf,p as yf,r as bf,s as xf,t as Sf,u as Cf}from"./sortable.esm-DGuuqLb9.js";import{t as wf}from"./textarea-DII_Czak.js";import{i as Tf,o as Ef,r as Df,u as Of}from"./skills-api-BazENdP9.js";import{C as kf,D as Af,E as jf,O as Mf,S as Nf,T as Pf,_ as Ff,a as If,b as Lf,c as Rf,d as zf,f as Bf,g as Vf,h as Hf,i as Uf,k as Wf,l as Gf,m as Kf,n as qf,o as Jf,p as Yf,r as Xf,s as Zf,t as Qf,u as $f,v as ep,w as tp,x as np,y as rp}from"./file-tree-adapter-NqeYDxT9.js";import{t as ip}from"./use-live-xterm-theme-DBloho-q.js";import{n as ap,r as op}from"./agent-presence-BDFQXhQj.js";import{a as sp,c as cp,d as lp,f as up,i as dp,l as fp,m as pp,n as mp,o as hp,s as gp,t as _p,u as vp}from"./form-fGxW7-bd.js";import{n as yp,t as bp}from"./mcp-consent-store-D31n_rvi.js";import{a as xp,t as Sp}from"./receive-store-CnPZW2Nl.js";function Cp(){({BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.41.4`})?.VITE_OTEL_ENABLED===`true`&&n(()=>import(`./telemetry-impl-P2IeKAaO.js`).then(e=>e.install()),__vite__mapDeps([0,1,2,3,4]),import.meta.url)}var wp=class extends yt{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Tp(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=kt({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}})(this.state),bt.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Tp(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Ep=class extends It{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new wp({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Dp(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Dp(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Dp(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=Dp(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){bt.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>St(t,e))}findAll(e={}){return this.getAll().filter(t=>St(e,t))}notify(e){bt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return bt.batch(()=>Promise.all(e.map(e=>e.continue().catch(Dt))))}};function Dp(e){return e.options.scope?.id}var Op=class extends It{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??xt(r,t),a=this.get(i);return a||(a=new Tt({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){bt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>At(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>At(e,t)):t}notify(e){bt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){bt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){bt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},kp=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Op,this.#t=e.mutationCache||new Ep,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Ft.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Mt.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ct(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Et(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return bt.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;bt.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return bt.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=bt.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Dt).catch(Dt)}invalidateQueries(e,t={}){return bt.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=bt.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(Dt)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(Dt)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Ct(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Dt).catch(Dt)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Dt).catch(Dt)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return Mt.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Pt(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{wt(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Pt(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{wt(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=xt(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===vt&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Z=r(),Q=e(ht(),1),Ap=t(),$=Bt(),jp=3100,Mp=3;function Np(e,t,n){let r=n?.windowMs??600,i=n?.maxLevel??Mp;if(e===0||t>=r)return 1;let a=e+1;return a>i?i:a}var Pp={0:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},1:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},2:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},3:{count:16,startRadius:11,baseDistance:7,distanceVariance:3,sizeMin:.45,sizeMax:1.2,maxDelay:500,durationMin:1100,durationMax:2400}},Fp=[`var(--color-azure-blue)`,`var(--color-sky-blue)`,`var(--color-violet-300)`,`var(--color-orange-light)`,`var(--color-crystal-blue)`,`var(--color-white-cream)`];function Ip(e,t={}){let n=t.rng??Math.random,r=t.colors??Fp,i=Pp[e];if(i.count===0||r.length===0)return[];let a=[],o=Math.PI*2/i.count;for(let e=0;e<i.count;e++){let t=e*o+(n()-.5)*o*.7,s=i.baseDistance+(n()-.5)*2*i.distanceVariance,c=i.sizeMin+n()*(i.sizeMax-i.sizeMin),l=n()*i.maxDelay,u=i.durationMin+n()*(i.durationMax-i.durationMin),d=Math.floor(n()*r.length),f=Math.cos(t),p=Math.sin(t);a.push({id:e,dx:f*s,dy:p*s,originDx:f*i.startRadius,originDy:p*i.startRadius,size:c,color:r[d]??`currentColor`,delay:l,duration:u})}return a}var Lp=1.8,Rp=90,zp=16,Bp=380,Vp=.025,Hp=.1,Up=.18,Wp=400,Gp=9.2736,Kp=18.1799,qp=14.5244,Jp={1:{halfWidth:1.5,apexLift:2.2},2:{halfWidth:1.4,apexLift:2.6},3:{halfWidth:1.25,apexLift:3}};function Yp(e,t){let{halfWidth:n,apexLift:r}=Jp[t];return`M${e-n} ${qp+.3} Q${e} ${qp-r}, ${e+n} ${qp+.3}`}function Xp(e){let t=1.5,n=.3;return`M${e-t} ${qp-n} Q${e} ${qp+1.4}, ${e+t} ${qp-n}`}var Zp=15,Qp=15;function $p(e){return{fill:e.color,"--fx-tx":`${e.dx}px`,"--fx-ty":`${e.dy}px`,"--fx-delay":`${e.delay}ms`,"--fx-duration":`${e.duration}ms`}}function em(e){let t=(0,$.c)(71),{size:n,className:r,trackMouse:i,variant:a,celebrateSignal:o}=e,s=n===void 0?48:n,c=i===void 0?!0:i,l=a===void 0?`default`:a,u=o===void 0?0:o,d=(0,Q.useRef)(null),f=(0,Q.useRef)(null),p=(0,Q.useRef)(null),m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m={x:0,y:0},t[0]=m):m=t[0];let h=(0,Q.useRef)(m),[g,_]=(0,Q.useState)(0),[v,y]=(0,Q.useState)(0),b;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(b=[],t[1]=b):b=t[1];let[x,S]=(0,Q.useState)(b),C=(0,Q.useRef)(0),w=(0,Q.useRef)(void 0),T=l===`sleeping`,E;t[2]!==g||t[3]!==T?(E=function(){if(T)return;let e=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),t=C.current===0?1/0:e-C.current;C.current=e;let n=Np(g,t);_(n),y(im),S(Ip(n)),clearTimeout(w.current),w.current=setTimeout(()=>{_(0),S([])},jp)},t[2]=g,t[3]=T,t[4]=E):E=t[4];let D=E,O,k;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(O=()=>()=>clearTimeout(w.current),k=[],t[5]=O,t[6]=k):(O=t[5],k=t[6]),(0,Q.useEffect)(O,k);let A,j;t[7]!==u||t[8]!==T?(A=()=>{u===0||T||(_(3),y(rm),S(Ip(3)),clearTimeout(w.current),w.current=setTimeout(()=>{_(0),S([])},jp))},j=[u,T],t[7]=u,t[8]=T,t[9]=A,t[10]=j):(A=t[9],j=t[10]),(0,Q.useEffect)(A,j);let M,N;t[11]!==T||t[12]!==c?(M=()=>{if(!c||T||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let e=0,t=0,n=!1,r=0,i=0,a=0,o=0,s=0,l=function(){s===0&&(s=requestAnimationFrame(m))},u=function(r){e=r.clientX,t=r.clientY,n=!0,l()};function m(){s=0;let c=f.current,u=d.current;if(!c||!u){l();return}let m=n;n=!1;let g=c.getBoundingClientRect(),_=g.left+g.width/2,v=g.top+g.height*.48,y=e-_,b=t-v,x=Math.hypot(y,b),S=Math.max(-1,Math.min(1,y/Bp)),C=-Math.max(-1,Math.min(1,b/Bp))*zp,w=S*zp,T=0,E=0;if(x>=1){let e=Math.min(x/Rp,1)*Lp;T=y/x*e,E=b/x*e}let D=Math.abs(C-r)<.01&&Math.abs(w-i)<.01&&Math.abs(T-a)<.01&&Math.abs(E-o)<.01;if(!m&&D)return;l(),r+=(C-r)*Hp,i+=(w-i)*Hp,u.style.transform=`perspective(${Wp}px) rotateX(${r.toFixed(3)}deg) rotateY(${i.toFixed(3)}deg)`,a+=(T-a)*Up,o+=(E-o)*Up;let O=i*Vp,k=-r*Vp,A=a+O,j=o+k;h.current.x=A,h.current.y=j,p.current?.setAttribute(`transform`,`translate(${A.toFixed(3)} ${j.toFixed(3)})`)}return document.addEventListener(`mousemove`,u,{passive:!0}),l(),()=>{document.removeEventListener(`mousemove`,u),s!==0&&cancelAnimationFrame(s),s=0,d.current&&(d.current.style.transform=``),h.current={x:0,y:0},p.current?.removeAttribute(`transform`)}},N=[c,T],t[11]=T,t[12]=c,t[13]=M,t[14]=N):(M=t[13],N=t[14]),(0,Q.useEffect)(M,N);let P;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(P=()=>{let e=p.current;if(!e)return;let{x:t,y:n}=h.current;e.setAttribute(`transform`,`translate(${t.toFixed(3)} ${n.toFixed(3)})`)},t[15]=P):P=t[15],(0,Q.useLayoutEffect)(P);let F=g>0,I=F?g:1,L=F?`ok-blob-clicked-${g}`:null,R;t[16]===r?R=t[17]:(R=Y(`ok-blob-3d-wrapper`,r),t[16]=r,t[17]=R);let z=T?`cursor-default`:`cursor-pointer`,B=`body-${v}`,V=T&&`ok-blob-sleeping`,H;t[18]!==L||t[19]!==V?(H=Y(`ok-blob-group`,V,L),t[18]=L,t[19]=V,t[20]=H):H=t[20];let U;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Z.jsx)(`path`,{d:`M25.2339 6.78134C25.5199 7.35734 25.8179 8.47234 26.0179 9.07834C26.0189 9.08234 26.0209 9.08634 26.0219 9.09134C26.0229 9.09534 26.0249 9.10034 26.0259 9.10434C26.0539 9.19734 26.0949 9.29533 26.1519 9.41633C26.2919 9.71133 26.5269 10.1173 27.1299 11.1683C27.3259 11.4643 27.5209 11.7693 27.7119 12.0903C29.9739 15.1623 29.3259 20.1913 27.0469 22.9153C26.7779 23.2953 26.4869 23.6043 26.1889 23.8863C26.1519 23.9253 26.1129 23.9643 26.0729 24.0033C25.3159 24.7543 24.2949 25.4673 23.6129 25.8323C22.7469 26.2983 22.1349 26.5483 21.6299 26.7463C20.3649 27.3063 19.0609 27.7733 17.6569 28.0423C15.9649 28.3513 14.1939 28.4433 12.4569 28.1373C11.4779 27.9663 10.5119 27.6663 9.60891 27.2493C8.77491 26.8663 7.99192 26.3853 7.26992 25.8403C6.83592 25.5393 6.43893 25.2343 6.08093 24.9383C5.57893 24.5223 5.15993 24.1263 4.83493 23.7793C4.04993 22.9443 3.31593 21.8893 2.80893 21.0953C2.72593 20.9663 2.64792 20.8433 2.57592 20.7293C2.56192 20.7093 2.54793 20.6893 2.53393 20.6703C2.08593 20.0263 1.71892 19.3293 1.43792 18.5993C1.42892 18.5453 1.42093 18.4903 1.41293 18.4353C1.32093 17.7443 1.08292 16.9423 1.01092 15.6333C0.984921 15.0653 0.998928 14.4013 1.12393 13.6353C1.20693 13.1413 1.31993 12.9023 1.40893 12.7113C1.43593 12.6543 1.46193 12.6023 1.48593 12.5483C1.56793 12.3653 1.59392 12.1563 1.63592 11.9083C1.68992 11.5883 1.76992 11.1943 2.04592 10.7553C2.94392 9.37934 3.36792 8.81934 3.66592 8.33934C3.75592 8.20334 3.84292 8.08134 3.94192 7.96634C4.21592 7.64634 4.67693 7.29534 5.10293 7.05734C5.16693 7.02234 5.23093 6.98834 5.29193 6.95534C5.62993 6.77834 6.22592 6.30135 6.66992 5.92035C6.83692 5.77635 7.08193 5.60735 7.37393 5.40935C7.67393 5.20535 8.02593 4.96934 8.39193 4.70234C9.32093 4.02634 9.84091 3.69134 10.2599 3.42334C10.3799 3.34734 10.4919 3.27734 10.6049 3.20834C10.9609 2.98834 11.4149 2.73034 11.8869 2.48634C12.4519 2.19334 13.0469 1.92133 13.5089 1.72233C14.7399 1.30233 16.0539 1.01333 17.4169 1.00033C18.1169 0.991333 18.7939 1.16534 19.2389 1.43034C19.6869 1.69534 19.8689 2.00335 19.8039 2.23935C19.7379 2.47835 19.4399 2.63634 19.0109 2.74734C18.5789 2.85634 18.0469 2.92035 17.4889 2.96135C16.3639 3.04235 15.2399 3.36435 14.1499 3.80835C12.8199 4.35135 11.5379 5.07133 10.2719 5.84733C9.38691 6.39133 8.51192 6.97334 7.63592 7.56834C7.54492 7.63034 7.45492 7.69135 7.36492 7.75235C6.97392 8.06635 6.58293 8.38134 6.22293 8.66334C5.97893 8.85734 5.76793 9.04834 5.59393 9.21434C5.26893 9.52334 5.02393 9.74334 4.81893 9.93934C4.67793 10.0753 4.55793 10.2013 4.45593 10.3443C4.40093 10.4213 4.32992 10.5273 4.24792 10.6593C3.90492 11.1933 3.44493 12.1693 3.15393 13.1173C3.01893 13.5363 2.87991 14.0343 2.79391 14.5253C2.66591 15.2253 2.65594 15.9053 2.71994 16.2373C2.82794 16.8193 2.95593 17.4833 3.14093 18.0553C3.31293 18.6003 3.52991 19.0583 3.70791 19.2823C3.81591 19.4183 3.90394 19.5473 3.99594 19.6913C4.09394 19.8413 4.19191 20.0073 4.31091 20.2033C4.47891 20.4803 4.68592 20.8163 5.00192 21.2493C5.36492 21.7463 5.61793 22.1043 5.83493 22.4023C6.14493 22.8243 6.38591 23.1343 6.83691 23.5033C7.33891 23.9113 7.86593 24.3113 8.26693 24.6393C8.44893 24.7883 8.66993 24.9443 8.90493 25.0963C9.21593 25.2963 9.55192 25.4893 9.85592 25.6703C10.1059 25.8203 10.3059 25.9633 10.4869 26.0863C10.5429 26.1243 10.5979 26.1603 10.6519 26.1943C10.8699 26.2803 11.0929 26.3593 11.3159 26.4283C11.3539 26.4323 11.3949 26.4353 11.4369 26.4393C11.6509 26.4573 11.9089 26.4733 12.2209 26.5133C12.7169 26.5753 13.1399 26.6603 13.6019 26.7243C13.9589 26.7733 14.3409 26.8083 14.7729 26.7893C15.0729 26.7753 15.4069 26.7353 15.7389 26.6813C16.2349 26.6023 16.7179 26.4943 17.0569 26.4473C17.1499 26.4343 17.2359 26.4343 17.3209 26.4373C17.3489 26.4393 17.3799 26.4413 17.4109 26.4433C17.4119 26.4433 17.4119 26.4433 17.4129 26.4433C17.4199 26.4433 17.4279 26.4443 17.4349 26.4443C18.2329 26.2413 19.0259 25.9433 19.7959 25.5983C19.8609 25.5633 19.9259 25.5273 19.9899 25.4913C20.3059 25.3173 20.6049 25.1383 20.7869 24.9943C20.9829 24.8393 21.5189 24.5373 22.0579 24.1853C22.4109 23.9553 22.7649 23.7053 23.0369 23.4833C23.1949 23.3553 23.3689 23.2693 23.5479 23.1773C23.7129 23.0923 23.8809 23.0013 24.0349 22.8653C24.1109 22.7983 24.1869 22.7173 24.2639 22.6303C24.3309 22.5563 24.4039 22.4723 24.4759 22.3923C24.5459 22.3153 24.7199 22.1723 24.9139 21.9793C25.0079 21.8863 25.1059 21.7783 25.1909 21.6713C25.2199 21.6323 25.2489 21.5943 25.2769 21.5553C25.5919 21.0403 25.8779 20.5003 26.1019 19.9653C26.1299 19.8403 26.1379 19.7293 26.1279 19.6373C26.1199 19.5703 26.1029 19.5113 26.0839 19.4503C26.0599 19.3643 26.0329 19.2773 26.0239 19.1723C26.0169 19.0893 26.0309 19.0043 26.0629 18.9543C26.0779 18.9323 26.0969 18.9143 26.1129 18.8993C26.1329 18.8823 26.1499 18.8673 26.1569 18.8443C26.1609 18.8273 26.1579 18.8073 26.1529 18.7833C26.1459 18.7443 26.1369 18.6943 26.1539 18.6293C26.2189 18.3853 26.2869 18.1103 26.3319 17.8383C26.3829 17.5393 26.4049 17.2433 26.3949 17.0123C26.3849 16.7493 26.3909 16.3823 26.3469 16.0003C26.3179 15.7343 26.2659 15.4663 26.1979 15.2383C26.1319 15.0143 26.0219 14.7913 25.9039 14.5783C25.7629 14.3223 25.6119 14.0783 25.5169 13.8453C25.4969 13.7983 25.4999 13.7263 25.4999 13.6323C25.5009 13.5673 25.4999 13.4913 25.4919 13.4083C25.3239 13.1243 25.1459 12.8423 24.9589 12.5483C24.9479 12.5413 24.9369 12.5333 24.9249 12.5263C24.6689 12.3503 24.3139 12.1173 24.0769 11.5503C24.0179 11.4063 24.0069 11.2983 23.9969 11.1993C23.9859 11.1013 23.9799 11.0183 23.9289 10.9093C23.8709 10.7853 23.7759 10.6583 23.6709 10.4993C23.5849 10.3703 23.4899 10.2133 23.4199 10.0423C23.3819 9.95134 23.3509 9.85734 23.3329 9.75934C23.3299 9.74334 23.3269 9.72534 23.3229 9.70634C23.2899 9.52734 23.2439 9.26534 23.2409 8.98634C23.0209 8.24434 22.8339 7.48833 22.6519 6.77633C22.3429 5.57133 22.0519 4.54234 21.3329 3.95434C20.9839 3.65334 20.5689 3.35433 20.2459 3.05433C19.9259 2.75633 19.7449 2.47534 19.8019 2.23834C19.8639 2.00634 20.1589 1.82934 20.6659 1.80534C21.1699 1.78334 21.8699 1.93235 22.5209 2.39235C23.6159 3.14235 24.2029 4.38334 24.5599 5.35734C24.5829 5.40834 24.6049 5.46034 24.6259 5.51234C24.7849 5.89434 24.9529 6.22834 25.1199 6.55534C25.1579 6.63034 25.1969 6.70834 25.2339 6.78134Z`,className:`ok-blob-body`}),t[21]=U):U=t[21];let W=(F||T)&&`ok-blob-eye-hidden`,G;t[22]===W?G=t[23]:(G=Y(`ok-blob-eye`,W),t[22]=W,t[23]=G);let K;t[24]===G?K=t[25]:(K=(0,Z.jsx)(`ellipse`,{cx:Gp,cy:qp,rx:1.2722,ry:1.9083,className:G}),t[24]=G,t[25]=K);let ee=(F||T)&&`ok-blob-eye-hidden`,te;t[26]===ee?te=t[27]:(te=Y(`ok-blob-eye ok-blob-eye-right`,ee),t[26]=ee,t[27]=te);let ne;t[28]===te?ne=t[29]:(ne=(0,Z.jsx)(`ellipse`,{cx:Kp,cy:qp,rx:1.2722,ry:1.9083,className:te}),t[28]=te,t[29]=ne);let q;t[30]===I?q=t[31]:(q=Yp(Gp,I),t[30]=I,t[31]=q);let re=(!F||T)&&`ok-blob-eye-hidden`,ie;t[32]===re?ie=t[33]:(ie=Y(`ok-blob-happy-eye`,re),t[32]=re,t[33]=ie);let ae;t[34]!==q||t[35]!==ie?(ae=(0,Z.jsx)(`path`,{d:q,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:ie}),t[34]=q,t[35]=ie,t[36]=ae):ae=t[36];let oe;t[37]===I?oe=t[38]:(oe=Yp(Kp,I),t[37]=I,t[38]=oe);let se=(!F||T)&&`ok-blob-eye-hidden`,ce;t[39]===se?ce=t[40]:(ce=Y(`ok-blob-happy-eye`,se),t[39]=se,t[40]=ce);let le;t[41]!==oe||t[42]!==ce?(le=(0,Z.jsx)(`path`,{d:oe,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:ce}),t[41]=oe,t[42]=ce,t[43]=le):le=t[43];let ue;t[44]===T?ue=t[45]:(ue=T?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`path`,{d:Xp(Gp),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`}),(0,Z.jsx)(`path`,{d:Xp(Kp),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`})]}):null,t[44]=T,t[45]=ue);let de;t[46]!==K||t[47]!==ne||t[48]!==ae||t[49]!==le||t[50]!==ue?(de=(0,Z.jsxs)(`g`,{ref:p,children:[K,ne,ae,le,ue]}),t[46]=K,t[47]=ne,t[48]=ae,t[49]=le,t[50]=ue,t[51]=de):de=t[51];let fe;t[52]!==B||t[53]!==H||t[54]!==de?(fe=(0,Z.jsxs)(`g`,{className:H,children:[U,de]},B),t[52]=B,t[53]=H,t[54]=de,t[55]=fe):fe=t[55];let pe;t[56]===T?pe=t[57]:(pe=T?(0,Z.jsxs)(`g`,{children:[(0,Z.jsx)(`text`,{x:21,y:7,className:`ok-blob-z ok-blob-z-1`,children:`z`}),(0,Z.jsx)(`text`,{x:26,y:2,className:`ok-blob-z ok-blob-z-2`,children:`z`})]}):null,t[56]=T,t[57]=pe);let me;t[58]!==v||t[59]!==x?(me=x.length>0&&(0,Z.jsx)(`g`,{children:x.map(tm)},`firework-${v}`),t[58]=v,t[59]=x,t[60]=me):me=t[60];let he;t[61]!==D||t[62]!==s||t[63]!==z||t[64]!==fe||t[65]!==pe||t[66]!==me?(he=(0,Z.jsxs)(`svg`,{ref:f,width:s,height:s,viewBox:`0 0 30 30`,fill:`none`,overflow:`visible`,xmlns:`http://www.w3.org/2000/svg`,className:z,"aria-hidden":`true`,onClick:D,onMouseDown:nm,children:[fe,pe,me]}),t[61]=D,t[62]=s,t[63]=z,t[64]=fe,t[65]=pe,t[66]=me,t[67]=he):he=t[67];let ge;return t[68]!==R||t[69]!==he?(ge=(0,Z.jsx)(`span`,{ref:d,className:R,children:he}),t[68]=R,t[69]=he,t[70]=ge):ge=t[70],ge}function tm(e){return(0,Z.jsx)(`circle`,{cx:Zp+e.originDx,cy:Qp+e.originDy,r:e.size,className:`ok-blob-firework`,style:$p(e)},e.id)}function nm(e){return e.preventDefault()}function rm(e){return e+1}function im(e){return e+1}var am=(0,Q.lazy)(()=>n(()=>import(`./ReportBugDialogBody-CFAfyMu8.js`),__vite__mapDeps([5,1,6,2,3,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44]),import.meta.url)),om=1200,sm=`[cmdk-root],[data-radix-popper-content-wrapper]`,cm=500;function lm(e){let t=(0,$.c)(8),[n,r]=(0,Q.useState)(e.open),[i,a]=(0,Q.useState)(!1),[o,s]=(0,Q.useState)(null),c=(0,Q.useRef)(0);e.open&&!n&&r(!0);let l,u;if(t[0]!==e.crashInvite||t[1]!==e.open?(l=()=>{if(!e.open){a(!1);return}let t=c.current+=1,n=window.okDesktop?.bugReport?.captureScreenshot;if(typeof n!=`function`||e.crashInvite!==void 0){s(null),a(!0);return}s(null);let r=!1,i=e=>{r||c.current!==t||(r=!0,s(e),a(!0))},o=setTimeout(()=>i(null),om),l=performance.now(),u=0,d=()=>{if(c.current!==t)return;let e=performance.now()-l>=cm;if(document.querySelector(sm)!==null&&!e){u=requestAnimationFrame(d);return}u=requestAnimationFrame(()=>{c.current===t&&n().then(i).catch(()=>i(null))})};return u=requestAnimationFrame(d),()=>{c.current+=1,clearTimeout(o),cancelAnimationFrame(u)}},u=[e.open,e.crashInvite],t[0]=e.crashInvite,t[1]=e.open,t[2]=l,t[3]=u):(l=t[2],u=t[3]),(0,Q.useEffect)(l,u),!n)return null;let d=e.open&&i,f;return t[4]!==e||t[5]!==o||t[6]!==d?(f=(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(am,{...e,open:d,screenshot:o})}),t[4]=e,t[5]=o,t[6]=d,t[7]=f):f=t[7],f}var um=`ContextMenu`,[dm,fm]=en(um,[sr]),pm=sr(),[mm,hm]=dm(um),gm=e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,dir:i,modal:a=!0}=e,[o,s]=Q.useState(!1),c=pm(t),l=an(r),u=Q.useCallback(e=>{s(e),l(e)},[l]);return(0,Z.jsx)(mm,{scope:t,open:o,onOpenChange:u,modal:a,children:(0,Z.jsx)(dr,{...c,dir:i,open:o,onOpenChange:u,modal:a,children:n})})};gm.displayName=um;var _m=`ContextMenuTrigger`,vm=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,disabled:r=!1,...i}=e,a=hm(_m,n),o=pm(n),s=Q.useRef({x:0,y:0}),c=Q.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...s.current})}),l=Q.useRef(0),u=Q.useCallback(()=>window.clearTimeout(l.current),[]),d=e=>{s.current={x:e.clientX,y:e.clientY},a.onOpenChange(!0)};return Q.useEffect(()=>u,[u]),Q.useEffect(()=>void(r&&u()),[r,u]),(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Sr,{...o,virtualRef:c}),(0,Z.jsx)(nn.span,{"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,...i,ref:t,style:{WebkitTouchCallout:`none`,...e.style},onContextMenu:r?e.onContextMenu:rn(e.onContextMenu,e=>{u(),d(e),e.preventDefault()}),onPointerDown:r?e.onPointerDown:rn(e.onPointerDown,qm(e=>{u(),l.current=window.setTimeout(()=>d(e),700)})),onPointerMove:r?e.onPointerMove:rn(e.onPointerMove,qm(u)),onPointerCancel:r?e.onPointerCancel:rn(e.onPointerCancel,qm(u)),onPointerUp:r?e.onPointerUp:rn(e.onPointerUp,qm(u))})]})});vm.displayName=_m;var ym=`ContextMenuPortal`,bm=e=>{let{__scopeContextMenu:t,...n}=e,r=pm(t);return(0,Z.jsx)(hr,{...r,...n})};bm.displayName=ym;var xm=`ContextMenuContent`,Sm=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=hm(xm,n),a=pm(n),o=Q.useRef(!1);return(0,Z.jsx)(mr,{...a,...r,ref:t,side:`right`,sideOffset:2,align:`start`,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),!t.defaultPrevented&&o.current&&t.preventDefault(),o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),!t.defaultPrevented&&!i.modal&&(o.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Sm.displayName=xm;var Cm=`ContextMenuGroup`,wm=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=pm(n);return(0,Z.jsx)(cr,{...i,...r,ref:t})});wm.displayName=Cm;var Tm=`ContextMenuLabel`,Em=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=pm(n);return(0,Z.jsx)(lr,{...i,...r,ref:t})});Em.displayName=Tm;var Dm=`ContextMenuItem`,Om=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=pm(n);return(0,Z.jsx)(vr,{...i,...r,ref:t})});Om.displayName=Dm;var km=`ContextMenuCheckboxItem`,Am=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=pm(n);return(0,Z.jsx)(br,{...i,...r,ref:t})});Am.displayName=km;var jm=`ContextMenuRadioGroup`,Mm=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=pm(n);return(0,Z.jsx)(Cr,{...i,...r,ref:t})});Mm.displayName=jm;var Nm=`ContextMenuRadioItem`,Pm=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=pm(n);return(0,Z.jsx)(ur,{...i,...r,ref:t})});Pm.displayName=Nm;var Fm=`ContextMenuItemIndicator`,Im=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=pm(n);return(0,Z.jsx)(xr,{...i,...r,ref:t})});Im.displayName=Fm;var Lm=`ContextMenuSeparator`,Rm=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=pm(n);return(0,Z.jsx)(yr,{...i,...r,ref:t})});Rm.displayName=Lm;var zm=`ContextMenuArrow`,Bm=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=pm(n);return(0,Z.jsx)(_r,{...i,...r,ref:t})});Bm.displayName=zm;var Vm=`ContextMenuSub`,Hm=e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,open:i,defaultOpen:a}=e,o=pm(t),[s,c]=tn({prop:i,defaultProp:a??!1,onChange:r,caller:Vm});return(0,Z.jsx)(gr,{...o,open:s,onOpenChange:c,children:n})};Hm.displayName=Vm;var Um=`ContextMenuSubTrigger`,Wm=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=pm(n);return(0,Z.jsx)(fr,{...i,...r,ref:t})});Wm.displayName=Um;var Gm=`ContextMenuSubContent`,Km=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=pm(n);return(0,Z.jsx)(pr,{...i,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Km.displayName=Gm;function qm(e){return t=>t.pointerType===`mouse`?void 0:e(t)}var Jm=gm,Ym=vm,Xm=bm,Zm=Sm,Qm=wm,$m=Em,eh=Om,th=Am,nh=Im,rh=Rm,ih=Hm,ah=Wm,oh=Km,sh=new WeakMap;function ch(e,t){typeof e!=`object`||!e||typeof t!=`string`||t.trim()===``||sh.set(e,t)}function lh(e){if(!(typeof e!=`object`||!e))return sh.get(e)}function uh(e){let t=(0,$.c)(24),{error:n,resetErrorBoundary:r}=e,{_:i}=gt(),[a,o]=(0,Q.useState)(!1),s=(0,Q.useRef)(null),c=typeof window<`u`?window.okDesktop:void 0,l;t[0]!==i||t[1]!==n?(l=n instanceof Error&&n.message?n.message:i({id:`W5A0Ly`}),t[0]=i,t[1]=n,t[2]=l):l=t[2];let u=l,d,f;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>{s.current?.focus()},f=[],t[3]=d,t[4]=f):(d=t[3],f=t[4]),(0,Q.useEffect)(d,f);let p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsx)(em,{size:80,variant:`sleeping`}),t[5]=p):p=t[5];let m;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Z.jsx)(`h1`,{id:`app-error-title`,className:`text-2xl font-light tracking-tighter text-balance`,children:(0,Z.jsx)(J,{id:`nwtY4N`})}),t[6]=m):m=t[6];let h;t[7]===u?h=t[8]:(h=(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[m,(0,Z.jsx)(`p`,{className:`max-w-sm text-sm break-words text-muted-foreground`,children:u})]}),t[7]=u,t[8]=h);let g;t[9]===r?g=t[10]:(g=()=>r(),t[9]=r,t[10]=g);let _;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Z.jsx)(J,{id:`KDw4GX`}),t[11]=_):_=t[11];let v;t[12]===g?v=t[13]:(v=(0,Z.jsx)(X,{ref:s,variant:`default`,onClick:g,children:_}),t[12]=g,t[13]=v);let y;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(y=c?(0,Z.jsx)(X,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>o(!0),children:(0,Z.jsx)(J,{id:`ii5mVn`})}):null,t[14]=y):y=t[14];let b;t[15]===v?b=t[16]:(b=(0,Z.jsxs)(`div`,{className:`mt-1 flex gap-2`,children:[v,y]}),t[15]=v,t[16]=b);let x;t[17]!==n||t[18]!==a?(x=c?(0,Z.jsx)(ph,{children:(0,Z.jsx)(lm,{open:a,onOpenChange:o,systemWide:c.config.mode===`navigator`,crashContext:{source:`app shell`,errorMessage:n instanceof Error&&n.message?n.message:String(n),componentStack:lh(n)}})}):null,t[17]=n,t[18]=a,t[19]=x):x=t[19];let S;return t[20]!==b||t[21]!==x||t[22]!==h?(S=(0,Z.jsxs)(`div`,{role:`alert`,"aria-labelledby":`app-error-title`,"data-slot":`app-error-boundary`,className:`flex h-screen flex-col items-center justify-center gap-8 p-8 text-center`,children:[p,h,b,x]}),t[20]=b,t[21]=x,t[22]=h,t[23]=S):S=t[23],S}function dh(e){let t=(0,$.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(Yt,{FallbackComponent:uh,onError:fh,children:n}),t[0]=n,t[1]=r),r}function fh(e,t){ch(e,t.componentStack),console.error(`[AppErrorBoundary] app-shell render crash`,e,t.componentStack??``)}function ph(e){let t=(0,$.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(Yt,{fallback:null,onError:mh,children:n}),t[0]=n,t[1]=r),r}function mh(e){console.error(`[CrashReportingBoundary] crash-reporting UI render crash`,e)}function hh(){let e=(0,$.c)(5),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={queryKey:[`acp-catalog`],queryFn:vh,staleTime:3e5},e[0]=t):t=e[0];let n=Nt(t),r;e[1]===n.data?.agents?r=e[2]:(r=()=>(ai(li(n.data?.agents??[]).map(_h)),gh),e[1]=n.data?.agents,e[2]=r);let i;return e[3]===n.data?i=e[4]:(i=[n.data],e[3]=n.data,e[4]=i),(0,Q.useEffect)(r,i),null}function gh(){return ai([])}function _h(e){return{source:e.source,id:e.id,name:e.name,...e.iconUrl===void 0?{}:{iconUrl:e.iconUrl}}}function vh(e){let{signal:t}=e;return si(t)}var yh=Zt(`arrow-left-right`,[[`path`,{d:`M8 3 4 7l4 4`,key:`9rb6wj`}],[`path`,{d:`M4 7h16`,key:`6tx8e3`}],[`path`,{d:`m16 21 4-4-4-4`,key:`siv7j2`}],[`path`,{d:`M20 17H4`,key:`h6l3hr`}]]),bh=Zt(`arrow-up-down`,[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]),xh=Zt(`bird`,[[`path`,{d:`M16 7h.01`,key:`1kdx03`}],[`path`,{d:`M3.4 18H12a8 8 0 0 0 8-8V7a4 4 0 0 0-7.28-2.3L2 20`,key:`oj1oa8`}],[`path`,{d:`m20 7 2 .5-2 .5`,key:`12nv4d`}],[`path`,{d:`M10 18v3`,key:`1yea0a`}],[`path`,{d:`M14 17.75V21`,key:`1pymcb`}],[`path`,{d:`M7 18a6 6 0 0 0 3.84-10.61`,key:`1npnn0`}]]),Sh=Zt(`blocks`,[[`path`,{d:`M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2`,key:`1ah6g2`}],[`rect`,{x:`14`,y:`2`,width:`8`,height:`8`,rx:`1`,key:`88lufb`}]]),Ch=Zt(`bold`,[[`path`,{d:`M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8`,key:`mg9rjx`}]]),wh=Zt(`book-marked`,[[`path`,{d:`M10 2v8l3-3 3 3V2`,key:`sqw3rj`}],[`path`,{d:`M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20`,key:`k3hazp`}]]),Th=Zt(`cat`,[[`path`,{d:`M12 5c.67 0 1.35.09 2 .26 1.78-2 5.03-2.84 6.42-2.26 1.4.58-.42 7-.42 7 .57 1.07 1 2.24 1 3.44C21 17.9 16.97 21 12 21s-9-3-9-7.56c0-1.25.5-2.4 1-3.44 0 0-1.89-6.42-.5-7 1.39-.58 4.72.23 6.5 2.23A9.04 9.04 0 0 1 12 5Z`,key:`x6xyqk`}],[`path`,{d:`M8 14v.5`,key:`1nzgdb`}],[`path`,{d:`M16 14v.5`,key:`1lajdz`}],[`path`,{d:`M11.25 16.25h1.5L12 17l-.75-.75Z`,key:`12kq1m`}]]),Eh=Zt(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),Dh=Zt(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),Oh=Zt(`columns-3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),kh=Zt(`compass`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]),Ah=Zt(`corner-down-left`,[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]),jh=Zt(`dog`,[[`path`,{d:`M11.25 16.25h1.5L12 17z`,key:`w7jh35`}],[`path`,{d:`M16 14v.5`,key:`1lajdz`}],[`path`,{d:`M4.42 11.247A13.152 13.152 0 0 0 4 14.556C4 18.728 7.582 21 12 21s8-2.272 8-6.444a11.702 11.702 0 0 0-.493-3.309`,key:`u7s9ue`}],[`path`,{d:`M8 14v.5`,key:`1nzgdb`}],[`path`,{d:`M8.5 8.5c-.384 1.05-1.083 2.028-2.344 2.5-1.931.722-3.576-.297-3.656-1-.113-.994 1.177-6.53 4-7 1.923-.321 3.651.845 3.651 2.235A7.497 7.497 0 0 1 14 5.277c0-1.39 1.844-2.598 3.767-2.277 2.823.47 4.113 6.006 4 7-.08.703-1.725 1.722-3.656 1-1.261-.472-1.855-1.45-2.239-2.5`,key:`v8hric`}]]),Mh=Zt(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),Nh=Zt(`file-check`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m9 15 2 2 4-4`,key:`1grp1n`}]]),Ph=Zt(`file-code-corner`,[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]]),Fh=Zt(`file-code`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),Ih=Zt(`file-exclamation-point`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Lh=Zt(`file-key`,[[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M4 12v6`,key:`bg1pfk`}],[`path`,{d:`M4 14h2`,key:`1sf9f8`}],[`path`,{d:`M9.65 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v4`,key:`d56i0q`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),Rh=Zt(`fish`,[[`path`,{d:`M6.5 12c.94-3.46 4.94-6 8.5-6 3.56 0 6.06 2.54 7 6-.94 3.47-3.44 6-7 6s-7.56-2.53-8.5-6Z`,key:`15baut`}],[`path`,{d:`M18 12v.5`,key:`18hhni`}],[`path`,{d:`M16 17.93a9.77 9.77 0 0 1 0-11.86`,key:`16dt7o`}],[`path`,{d:`M7 10.67C7 8 5.58 5.97 2.73 5.5c-1 1.5-1 5 .23 6.5-1.24 1.5-1.24 5-.23 6.5C5.58 18.03 7 16 7 13.33`,key:`l9di03`}],[`path`,{d:`M10.46 7.26C10.2 5.88 9.17 4.24 8 3h5.8a2 2 0 0 1 1.98 1.67l.23 1.4`,key:`1kjonw`}],[`path`,{d:`m16.01 17.93-.23 1.4A2 2 0 0 1 13.8 21H9.5a5.96 5.96 0 0 0 1.49-3.98`,key:`1zlm23`}]]),zh=Zt(`fold-vertical`,[[`path`,{d:`M12 22v-6`,key:`6o8u61`}],[`path`,{d:`M12 8V2`,key:`1wkif3`}],[`path`,{d:`M4 12H2`,key:`rhcxmi`}],[`path`,{d:`M10 12H8`,key:`s88cx1`}],[`path`,{d:`M16 12h-2`,key:`10asgb`}],[`path`,{d:`M22 12h-2`,key:`14jgyd`}],[`path`,{d:`m15 19-3-3-3 3`,key:`e37ymu`}],[`path`,{d:`m15 5-3 3-3-3`,key:`19d6lf`}]]),Bh=Zt(`folder-cog`,[[`path`,{d:`M10.3 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.98a2 2 0 0 1 1.69.9l.66 1.2A2 2 0 0 0 12 6h8a2 2 0 0 1 2 2v3.3`,key:`128dxu`}],[`path`,{d:`m14.305 19.53.923-.382`,key:`3m78fa`}],[`path`,{d:`m15.228 16.852-.923-.383`,key:`npixar`}],[`path`,{d:`m16.852 15.228-.383-.923`,key:`5xggr7`}],[`path`,{d:`m16.852 20.772-.383.924`,key:`dpfhf9`}],[`path`,{d:`m19.148 15.228.383-.923`,key:`1reyyz`}],[`path`,{d:`m19.53 21.696-.382-.924`,key:`1goivc`}],[`path`,{d:`m20.772 16.852.924-.383`,key:`htqkph`}],[`path`,{d:`m20.772 19.148.924.383`,key:`9w9pjp`}],[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}]]),Vh=Zt(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Hh=Zt(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Uh=Zt(`grid-2x2-x`,[[`path`,{d:`M12 3v17a1 1 0 0 1-1 1H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v6a1 1 0 0 1-1 1H3`,key:`11za1p`}],[`path`,{d:`m16 16 5 5`,key:`8tpb07`}],[`path`,{d:`m16 21 5-5`,key:`193jll`}]]),Wh=Zt(`hard-drive`,[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]),Gh=Zt(`hexagon`,[[`path`,{d:`M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z`,key:`yt0hxn`}]]),Kh=Zt(`highlighter`,[[`path`,{d:`m9 11-6 6v3h9l3-3`,key:`1a3l36`}],[`path`,{d:`m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4`,key:`14a9rk`}]]),qh=Zt(`italic`,[[`line`,{x1:`19`,x2:`10`,y1:`4`,y2:`4`,key:`15jd3p`}],[`line`,{x1:`14`,x2:`5`,y1:`20`,y2:`20`,key:`bu0au3`}],[`line`,{x1:`15`,x2:`9`,y1:`4`,y2:`20`,key:`uljnxc`}]]),Jh=Zt(`library`,[[`path`,{d:`m16 6 4 14`,key:`ji33uf`}],[`path`,{d:`M12 6v14`,key:`1n7gus`}],[`path`,{d:`M8 8v12`,key:`1gg7y9`}],[`path`,{d:`M4 4v16`,key:`6qkkli`}]]),Yh=Zt(`link`,[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]),Xh=Zt(`list-collapse`,[[`path`,{d:`M10 5h11`,key:`1hkqpe`}],[`path`,{d:`M10 12h11`,key:`6m4ad9`}],[`path`,{d:`M10 19h11`,key:`14g2nv`}],[`path`,{d:`m3 10 3-3-3-3`,key:`i7pm08`}],[`path`,{d:`m3 20 3-3-3-3`,key:`20gx1n`}]]),Zh=Zt(`list-plus`,[[`path`,{d:`M16 5H3`,key:`m91uny`}],[`path`,{d:`M11 12H3`,key:`51ecnj`}],[`path`,{d:`M16 19H3`,key:`zzsher`}],[`path`,{d:`M18 9v6`,key:`1twb98`}],[`path`,{d:`M21 12h-6`,key:`bt1uis`}]]),Qh=Zt(`list-tree`,[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]),$h=Zt(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),eg=Zt(`megaphone`,[[`path`,{d:`M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z`,key:`q8bfy3`}],[`path`,{d:`M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14`,key:`1853fq`}],[`path`,{d:`M8 6v8`,key:`15ugcq`}]]),tg=Zt(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),ng=Zt(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),rg=Zt(`octagon-x`,[[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),ig=Zt(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),ag=Zt(`panel-left-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]]),og=Zt(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),sg=Zt(`pilcrow`,[[`path`,{d:`M13 4v16`,key:`8vvj80`}],[`path`,{d:`M17 4v16`,key:`7dpous`}],[`path`,{d:`M19 4H9.5a4.5 4.5 0 0 0 0 9H13`,key:`sh4n9v`}]]),cg=Zt(`pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),lg=Zt(`rabbit`,[[`path`,{d:`M13 16a3 3 0 0 1 2.24 5`,key:`1epib5`}],[`path`,{d:`M18 12h.01`,key:`yjnet6`}],[`path`,{d:`M18 21h-8a4 4 0 0 1-4-4 7 7 0 0 1 7-7h.2L9.6 6.4a1 1 0 1 1 2.8-2.8L15.8 7h.2c3.3 0 6 2.7 6 6v1a2 2 0 0 1-2 2h-1a3 3 0 0 0-3 3`,key:`ue9ozu`}],[`path`,{d:`M20 8.54V4a2 2 0 1 0-4 0v3`,key:`49iql8`}],[`path`,{d:`M7.612 12.524a3 3 0 1 0-1.6 4.3`,key:`1e33i0`}]]),ug=Zt(`rat`,[[`path`,{d:`M13 22H4a2 2 0 0 1 0-4h12`,key:`bt3f23`}],[`path`,{d:`M13.236 18a3 3 0 0 0-2.2-5`,key:`1tbvmo`}],[`path`,{d:`M16 9h.01`,key:`1bdo4e`}],[`path`,{d:`M16.82 3.94a3 3 0 1 1 3.237 4.868l1.815 2.587a1.5 1.5 0 0 1-1.5 2.1l-2.872-.453a3 3 0 0 0-3.5 3`,key:`9ch7kn`}],[`path`,{d:`M17 4.988a3 3 0 1 0-5.2 2.052A7 7 0 0 0 4 14.015 4 4 0 0 0 8 18`,key:`3s7e9i`}]]),dg=Zt(`replace-all`,[[`path`,{d:`M14 14a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1`,key:`zg1ipl`}],[`path`,{d:`M14 4a1 1 0 0 1 1-1`,key:`dhj8ez`}],[`path`,{d:`M15 10a1 1 0 0 1-1-1`,key:`1mnyi5`}],[`path`,{d:`M19 14a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1`,key:`txt6k4`}],[`path`,{d:`M21 4a1 1 0 0 0-1-1`,key:`sfs9ap`}],[`path`,{d:`M21 9a1 1 0 0 1-1 1`,key:`mp6qeo`}],[`path`,{d:`m3 7 3 3 3-3`,key:`x25e72`}],[`path`,{d:`M6 10V5a2 2 0 0 1 2-2h2`,key:`15xut4`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}]]),fg=Zt(`replace`,[[`path`,{d:`M14 4a1 1 0 0 1 1-1`,key:`dhj8ez`}],[`path`,{d:`M15 10a1 1 0 0 1-1-1`,key:`1mnyi5`}],[`path`,{d:`M21 4a1 1 0 0 0-1-1`,key:`sfs9ap`}],[`path`,{d:`M21 9a1 1 0 0 1-1 1`,key:`mp6qeo`}],[`path`,{d:`m3 7 3 3 3-3`,key:`x25e72`}],[`path`,{d:`M6 10V5a2 2 0 0 1 2-2h2`,key:`15xut4`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}]]),pg=Zt(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),mg=Zt(`share-2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),hg=Zt(`shrimp`,[[`path`,{d:`M11 12h.01`,key:`1lr4k6`}],[`path`,{d:`M13 22c.5-.5 1.12-1 2.5-1-1.38 0-2-.5-2.5-1`,key:`fatpdi`}],[`path`,{d:`M14 2a3.28 3.28 0 0 1-3.227 1.798l-6.17-.561A2.387 2.387 0 1 0 4.387 8H15.5a1 1 0 0 1 0 13 1 1 0 0 0 0-5H12a7 7 0 0 1-7-7V8`,key:`kehrqe`}],[`path`,{d:`M14 8a8.5 8.5 0 0 1 0 8`,key:`1imjx2`}],[`path`,{d:`M16 16c2 0 4.5-4 4-6`,key:`z0nejz`}]]),gg=Zt(`snail`,[[`path`,{d:`M2 13a6 6 0 1 0 12 0 4 4 0 1 0-8 0 2 2 0 0 0 4 0`,key:`hneq2s`}],[`circle`,{cx:`10`,cy:`13`,r:`8`,key:`194lz3`}],[`path`,{d:`M2 21h12c4.4 0 8-3.6 8-8V7a2 2 0 1 0-4 0v6`,key:`ixqyt7`}],[`path`,{d:`M18 3 19.1 5.2`,key:`9tjm43`}],[`path`,{d:`M22 3 20.9 5.2`,key:`j3odrs`}]]),_g=Zt(`spell-check`,[[`path`,{d:`m6 16 6-12 6 12`,key:`1b4byz`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}],[`path`,{d:`m16 20 2 2 4-4`,key:`13tcca`}]]),vg=Zt(`square-code`,[[`path`,{d:`m10 9-3 3 3 3`,key:`1oro0q`}],[`path`,{d:`m14 15 3-3-3-3`,key:`bz13h7`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]),yg=Zt(`squirrel`,[[`path`,{d:`M15.236 22a3 3 0 0 0-2.2-5`,key:`21bitc`}],[`path`,{d:`M16 20a3 3 0 0 1 3-3h1a2 2 0 0 0 2-2v-2a4 4 0 0 0-4-4V4`,key:`oh0fg0`}],[`path`,{d:`M18 13h.01`,key:`9veqaj`}],[`path`,{d:`M18 6a4 4 0 0 0-4 4 7 7 0 0 0-7 7c0-5 4-5 4-10.5a4.5 4.5 0 1 0-9 0 2.5 2.5 0 0 0 5 0C7 10 3 11 3 17c0 2.8 2.2 5 5 5h10`,key:`980v8a`}]]),bg=Zt(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),xg=Zt(`sticky-note`,[[`path`,{d:`M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z`,key:`1dfntj`}],[`path`,{d:`M15 3v5a1 1 0 0 0 1 1h5`,key:`6s6qgf`}]]),Sg=Zt(`strikethrough`,[[`path`,{d:`M16 4H9a3 3 0 0 0-2.83 4`,key:`43sutm`}],[`path`,{d:`M14 12a4 4 0 0 1 0 8H6`,key:`nlfj13`}],[`line`,{x1:`4`,x2:`20`,y1:`12`,y2:`12`,key:`1e0a9i`}]]),Cg=Zt(`table-properties`,[[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 9H3`,key:`1338ky`}],[`path`,{d:`M21 15H3`,key:`9uk58r`}]]),wg=Zt(`telescope`,[[`path`,{d:`m10.065 12.493-6.18 1.318a.934.934 0 0 1-1.108-.702l-.537-2.15a1.07 1.07 0 0 1 .691-1.265l13.504-4.44`,key:`k4qptu`}],[`path`,{d:`m13.56 11.747 4.332-.924`,key:`19l80z`}],[`path`,{d:`m16 21-3.105-6.21`,key:`7oh9d`}],[`path`,{d:`M16.485 5.94a2 2 0 0 1 1.455-2.425l1.09-.272a1 1 0 0 1 1.212.727l1.515 6.06a1 1 0 0 1-.727 1.213l-1.09.272a2 2 0 0 1-2.425-1.455z`,key:`m7xp4m`}],[`path`,{d:`m6.158 8.633 1.114 4.456`,key:`74o979`}],[`path`,{d:`m8 21 3.105-6.21`,key:`1fvxut`}],[`circle`,{cx:`12`,cy:`13`,r:`2`,key:`1c1ljs`}]]),Tg=Zt(`text-align-center`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M17 12H7`,key:`16if0g`}],[`path`,{d:`M19 19H5`,key:`vjpgq2`}]]),Eg=Zt(`text-align-end`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M21 19H7`,key:`4cu937`}]]),Dg=Zt(`text-align-start`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M17 19H3`,key:`z6ezky`}]]),Og=Zt(`text-quote`,[[`path`,{d:`M17 5H3`,key:`1cn7zz`}],[`path`,{d:`M21 12H8`,key:`scolzb`}],[`path`,{d:`M21 19H8`,key:`13qgcb`}],[`path`,{d:`M3 12v7`,key:`1ri8j3`}]]),kg=Zt(`thumbs-down`,[[`path`,{d:`M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z`,key:`m61m77`}],[`path`,{d:`M17 14V2`,key:`8ymqnk`}]]),Ag=Zt(`thumbs-up`,[[`path`,{d:`M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z`,key:`emmmcr`}],[`path`,{d:`M7 10v12`,key:`1qc93n`}]]),jg=Zt(`turtle`,[[`path`,{d:`m12 10 2 4v3a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-3a8 8 0 1 0-16 0v3a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-3l2-4h4Z`,key:`1lbbv7`}],[`path`,{d:`M4.82 7.9 8 10`,key:`m9wose`}],[`path`,{d:`M15.18 7.9 12 10`,key:`p8dp2u`}],[`path`,{d:`M16.93 10H20a2 2 0 0 1 0 4H2`,key:`12nsm7`}]]),Mg=Zt(`underline`,[[`path`,{d:`M6 4v6a6 6 0 0 0 12 0V4`,key:`9kb039`}],[`line`,{x1:`4`,x2:`20`,y1:`20`,y2:`20`,key:`nun2al`}]]),Ng=Zt(`unfold-vertical`,[[`path`,{d:`M12 22v-6`,key:`6o8u61`}],[`path`,{d:`M12 8V2`,key:`1wkif3`}],[`path`,{d:`M4 12H2`,key:`rhcxmi`}],[`path`,{d:`M10 12H8`,key:`s88cx1`}],[`path`,{d:`M16 12h-2`,key:`10asgb`}],[`path`,{d:`M22 12h-2`,key:`14jgyd`}],[`path`,{d:`m15 19-3 3-3-3`,key:`11eu04`}],[`path`,{d:`m15 5-3-3-3 3`,key:`itvq4r`}]]),Pg=Zt(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),Fg=Zt(`whole-word`,[[`circle`,{cx:`7`,cy:`12`,r:`3`,key:`12clwm`}],[`path`,{d:`M10 9v6`,key:`17i7lo`}],[`circle`,{cx:`17`,cy:`12`,r:`3`,key:`gl7c2s`}],[`path`,{d:`M14 7v8`,key:`dl84cr`}],[`path`,{d:`M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1`,key:`lt2kga`}]]),Ig=180,Lg=5e3;function Rg(e,t){if(e===``||t===``)return``;let n=e.includes(`\\`)&&!e.includes(`/`)?`\\`:`/`;return`${e.replace(/[/\\]+$/,``)}${n}${t}`}function zg(e){if(e===``)return``;let t=e.split(/[/\\]/).filter(Boolean);return t.length>0?t[t.length-1]??e:e}function Bg(e){let{parent:t,sanitizedName:n,enclosingProject:r,enclosingGit:i,targetState:a}=e;return t===``||n===``?{kind:`idle`}:r===null?i===null?a===`exists-nonempty`?{kind:`block-nonempty`}:{kind:`free`}:{kind:`confirm-git`,gitRoot:i.gitRoot}:{kind:`block-nested`,rootPath:r.rootPath}}function Vg(e){let t=e instanceof Error?e.message:String(e);for(let e of _i)if(t.startsWith(`${e}:`)||t.includes(`${e}: `))return e===`nested-project`||e===`target-not-empty`?{reason:e}:{reason:e,message:t};return{reason:`unknown`,message:t}}function Hg(e){switch(e.reason){case`nested-project`:return{id:`ScwcF2`};case`target-not-empty`:return{id:`e8L17t`};case`invalid-args`:return{id:`6bTTAN`};case`mkdir-failed`:return{id:`gJR87V`};case`git-init-failed`:return{id:`4CfgPM`};case`init-failed`:return{id:`l17ab4`};case`discovery-failed`:return{id:`ThmUrC`};case`unknown`:return{id:`AddR83`}}}function Ug(e){let t=(0,$.c)(186),{open:n,onOpenChange:r,bridge:i,initialPackId:a,packs:o}=e,{_:s}=gt(),c=(0,Q.useId)(),l=(0,Q.useId)(),u=(0,Q.useId)(),d=(0,Q.useId)(),[f,p]=(0,Q.useState)(``),[m,h]=(0,Q.useState)(!1),[g,_]=(0,Q.useState)(``),[v,y]=(0,Q.useState)(Xg),[b,x]=(0,Q.useState)(`shared`),[S,C]=(0,Q.useState)(!1),w;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(w={kind:`idle`},t[0]=w):w=t[0];let[T,E]=(0,Q.useState)(w),[D,O]=(0,Q.useState)(`idle`),[k,A]=(0,Q.useState)(!1),[j,M]=(0,Q.useState)(null),N;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(N={kind:`idle`},t[1]=N):N=t[1];let[P,F]=(0,Q.useState)(N),[I,L]=(0,Q.useState)(0),R;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(R=new Set,t[2]=R):R=t[2];let z=(0,Q.useRef)(R),B=(0,Q.useRef)(null),V=(0,Q.useRef)(null),H=(0,Q.useRef)(null),U=(0,Q.useRef)(0),W,G;t[3]!==i||t[4]!==n?(W=()=>{if(!n)return;z.current.clear(),M(null),E({kind:`idle`}),O(`idle`),A(!1),_(``),y(new Set(qa)),x(`shared`),C(!1),F({kind:`idle`}),U.current+=1;let e=!1;p(``),h(!0),i.fs.defaultProjectsRoot().then(t=>{e||p(t)}).catch(Yg).finally(()=>{e||h(!1)});let t=requestAnimationFrame(()=>{H.current?.focus()});return()=>{e=!0,cancelAnimationFrame(t)}},G=[n,i],t[3]=i,t[4]=n,t[5]=W,t[6]=G):(W=t[5],G=t[6]),(0,Q.useEffect)(W,G);let K;t[7]!==i||t[8]!==f||t[9]!==g||t[10]!==n?(K=()=>{if(!n)return;V.current!==null&&clearTimeout(V.current),B.current!==null&&B.current.abort();let e=ia(g);if(f===``||e===``){E({kind:`idle`}),O(`idle`);return}let t=f,r=Rg(t,e),a=new AbortController;return B.current=a,V.current=setTimeout(()=>{O(`in-flight`),Promise.all([i.fs.findEnclosingProjectRoot(t),i.fs.findEnclosingGitRoot(t),i.fs.folderState(r)]).then(n=>{let[r,i,o]=n;a.signal.aborted||(O(`idle`),E(Bg({parent:t,sanitizedName:e,enclosingProject:r,enclosingGit:i,targetState:o})))}).catch(e=>{a.signal.aborted||(console.warn(`[CreateProjectDialog] cascade probe failed:`,e),O(`idle`),E({kind:`free`}))})},Ig),()=>{V.current!==null&&clearTimeout(V.current),a.abort()}},t[7]=i,t[8]=f,t[9]=g,t[10]=n,t[11]=K):K=t[11];let ee;t[12]!==i||t[13]!==f||t[14]!==g||t[15]!==n||t[16]!==I?(ee=[n,f,g,i,I],t[12]=i,t[13]=f,t[14]=g,t[15]=n,t[16]=I,t[17]=ee):ee=t[17],(0,Q.useEffect)(K,ee);let te,ne;t[18]===n?(te=t[19],ne=t[20]):(te=()=>{if(!n)return;let e=()=>L(Jg);return window.addEventListener(`focus`,e),()=>window.removeEventListener(`focus`,e)},ne=[n],t[18]=n,t[19]=te,t[20]=ne),(0,Q.useEffect)(te,ne);let q=(0,Q.useRef)(`idle`),re,ie;t[21]===D?(re=t[22],ie=t[23]):(re=()=>{q.current=D},ie=[D],t[21]=D,t[22]=re,t[23]=ie),(0,Q.useEffect)(re,ie);let ae,oe;t[24]!==T.kind||t[25]!==n?(ae=()=>{if(!n||T.kind!==`confirm-git`)return;let e=setInterval(()=>{q.current!==`in-flight`&&L(qg)},Lg);return()=>clearInterval(e)},oe=[n,T.kind],t[24]=T.kind,t[25]=n,t[26]=ae,t[27]=oe):(ae=t[26],oe=t[27]),(0,Q.useEffect)(ae,oe);let se;t[28]!==T.gitRoot||t[29]!==T.kind||t[30]!==P.gitRoot||t[31]!==P.kind?(se=()=>{if(T.kind!==`confirm-git`){P.kind!==`idle`&&(U.current+=1,F({kind:`idle`}));return}P.kind===`confirming`&&P.gitRoot!==T.gitRoot&&F({kind:`idle`}),P.kind===`pending`&&P.gitRoot!==T.gitRoot&&(U.current+=1,F({kind:`idle`}))},t[28]=T.gitRoot,t[29]=T.kind,t[30]=P.gitRoot,t[31]=P.kind,t[32]=se):se=t[32];let ce;t[33]!==T||t[34]!==P?(ce=[T,P],t[33]=T,t[34]=P,t[35]=ce):ce=t[35],(0,Q.useEffect)(se,ce);let le;t[36]!==i||t[37]!==T.kind||t[38]!==n?(le=()=>{if(!n)return;let e=null;T.kind===`block-nested`?e=`nested`:T.kind===`block-nonempty`?e=`nonempty`:T.kind===`confirm-git`&&(e=`git-confirm`),e!==null&&(z.current.has(e)||(z.current.add(e),i.project.recordCreateNewBannerShown(e).catch(Kg)))},t[36]=i,t[37]=T.kind,t[38]=n,t[39]=le):le=t[39];let ue;t[40]!==i||t[41]!==T||t[42]!==n?(ue=[n,T,i],t[40]=i,t[41]=T,t[42]=n,t[43]=ue):ue=t[43],(0,Q.useEffect)(le,ue);let de;t[44]!==a||t[45]!==o?(de=o?.find(e=>e.id===a),t[44]=a,t[45]=o,t[46]=de):de=t[46];let fe=de,pe=g,me,he,ge,_e,ve;t[47]!==T.kind||t[48]!==f||t[49]!==pe?(_e=pe===``?``:ia(pe),he=pe!==``&&_e!==pe&&_e!==``,ge=pe!==``&&_e===``,me=T.kind===`block-nonempty`,ve=f!==``&&_e!==``?Rg(f,_e):``,t[47]=T.kind,t[48]=f,t[49]=pe,t[50]=me,t[51]=he,t[52]=ge,t[53]=_e,t[54]=ve):(me=t[50],he=t[51],ge=t[52],_e=t[53],ve=t[54]);let ye=ve,be=!k&&f!==``&&pe!==``&&_e!==``&&D===`idle`&&(T.kind===`free`||T.kind===`confirm-git`),xe=k||pe!==``&&!be,Se;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(Se=function(e){y(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},t[55]=Se):Se=t[55];let Ce=Se,we;t[56]!==i||t[57]!==f?(we=async function(){try{let e=await i.dialog.openFolder(f===``?void 0:{defaultPath:f});if(e===null)return;p(e),L(Gg),M(null)}catch(e){console.warn(`[CreateProjectDialog] dialog.openFolder failed:`,e)}},t[56]=i,t[57]=f,t[58]=we):we=t[58];let Te=we,Ee;t[59]!==s||t[60]!==i||t[61]!==k||t[62]!==be||t[63]!==v||t[64]!==a||t[65]!==f||t[66]!==r||t[67]!==pe||t[68]!==_e||t[69]!==b?(Ee=async function(e){if(e.preventDefault(),!k){if(pe.trim()===``){gl.error(s({id:`5OqaJi`})),H.current?.focus();return}if(be){A(!0),M(null);try{await i.project.createNew({parent:f,name:_e,editors:Array.from(v),sharing:b,packId:a}),r(!1)}catch(e){M(Vg(e)),A(!1)}}}},t[59]=s,t[60]=i,t[61]=k,t[62]=be,t[63]=v,t[64]=a,t[65]=f,t[66]=r,t[67]=pe,t[68]=_e,t[69]=b,t[70]=Ee):Ee=t[70];let De=Ee,Oe;t[71]!==k||t[72]!==r?(Oe=function(e){k||r(e)},t[71]=k,t[72]=r,t[73]=Oe):Oe=t[73];let ke=Oe,Ae;t[74]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=async function(e){F({kind:`confirming`,gitRoot:e})},t[74]=Ae):Ae=t[74];let je=Ae,Me;t[75]===Symbol.for(`react.memo_cache_sentinel`)?(Me=async function(){F({kind:`idle`})},t[75]=Me):Me=t[75];let Ne=Me,Pe;t[76]===i?Pe=t[77]:(Pe=async function(e){let t=U.current+1;U.current=t,F({kind:`pending`,gitRoot:e});try{if(await i.fs.removeGitFolder(e),U.current!==t)return;L(Wg),F({kind:`idle`})}catch(e){let n=e;if(U.current!==t)return;let r=n instanceof Error?n.message:String(n);console.error(`[CreateProjectDialog] bridge.fs.removeGitFolder failed:`,n),F({kind:`error`,message:r})}},t[76]=i,t[77]=Pe);let Fe=Pe,Ie;t[78]!==i||t[79]!==r?(Ie=async function(e){r(!1);try{await i.project.open({path:e,target:`new-window`,entryPoint:`create-new-nested-redirect`})}catch(e){console.warn(`[CreateProjectDialog] project.open failed:`,e)}},t[78]=i,t[79]=r,t[80]=Ie):Ie=t[80];let Le=Ie,Re=ge||me||he?`${u} ${d}`:u,ze;t[81]===Symbol.for(`react.memo_cache_sentinel`)?(ze=(0,Z.jsx)(mn,{children:(0,Z.jsx)(J,{id:`wbv9xO`})}),t[81]=ze):ze=t[81];let Be;t[82]===fe?Be=t[83]:(Be=(0,Z.jsxs)(vn,{children:[ze,(0,Z.jsx)(pn,{children:fe?(0,Z.jsx)(J,{id:`D2CwBE`,values:{0:fe.name,1:fe.entryCounts.folders},components:{0:(0,Z.jsx)(`strong`,{})}}):(0,Z.jsx)(J,{id:`O6yEPk`})})]}),t[82]=fe,t[83]=Be);let Ve;t[84]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=(0,Z.jsx)(J,{id:`OyIC0Q`}),t[84]=Ve):Ve=t[84];let He;t[85]===l?He=t[86]:(He=(0,Z.jsx)(Ir,{htmlFor:l,children:Ve}),t[85]=l,t[86]=He);let Ue;t[87]===s?Ue=t[88]:(Ue=s({id:`cV7LOw`}),t[87]=s,t[88]=Ue);let We;t[89]===Symbol.for(`react.memo_cache_sentinel`)?(We=e=>_(e.target.value),t[89]=We):We=t[89];let Ge=ge||me,Ke;t[90]!==k||t[91]!==g||t[92]!==Re||t[93]!==l||t[94]!==Ue||t[95]!==Ge?(Ke=(0,Z.jsx)(Sl,{id:l,ref:H,value:g,placeholder:Ue,onChange:We,disabled:k,autoComplete:`off`,"aria-invalid":Ge,"aria-describedby":Re,"data-testid":`create-name`}),t[90]=k,t[91]=g,t[92]=Re,t[93]=l,t[94]=Ue,t[95]=Ge,t[96]=Ke):Ke=t[96];let qe;t[97]!==d||t[98]!==me||t[99]!==he||t[100]!==ge||t[101]!==_e?(qe=ge?(0,Z.jsx)(`p`,{id:d,role:`alert`,className:`text-1sm text-destructive`,"data-testid":`create-name-error-erased`,children:(0,Z.jsx)(J,{id:`_PBJRl`})}):me?(0,Z.jsx)(`p`,{id:d,role:`alert`,className:`text-1sm text-destructive`,"data-testid":`create-name-error-taken`,children:(0,Z.jsx)(J,{id:`7apDiJ`,values:{sanitized:_e},components:{0:(0,Z.jsx)(`code`,{className:`font-mono break-all`})}})}):he?(0,Z.jsx)(`p`,{id:d,role:`status`,"aria-live":`polite`,className:`text-1sm text-muted-foreground`,"data-testid":`create-name-hint-diverged`,children:(0,Z.jsx)(J,{id:`KnoB--`,values:{sanitized:_e},components:{0:(0,Z.jsx)(`code`,{className:`font-mono break-all`})}})}):null,t[97]=d,t[98]=me,t[99]=he,t[100]=ge,t[101]=_e,t[102]=qe):qe=t[102];let Je;t[103]!==He||t[104]!==Ke||t[105]!==qe?(Je=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[He,Ke,qe]}),t[103]=He,t[104]=Ke,t[105]=qe,t[106]=Je):Je=t[106];let Ye;t[107]===Symbol.for(`react.memo_cache_sentinel`)?(Ye=(0,Z.jsx)(Ir,{children:(0,Z.jsx)(J,{id:`wJijgU`})}),t[107]=Ye):Ye=t[107];let Xe;t[108]!==f||t[109]!==m?(Xe=f===``?m?(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:(0,Z.jsx)(J,{id:`iHAJDj`})}):(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:(0,Z.jsx)(J,{id:`8m8diM`})}):f,t[108]=f,t[109]=m,t[110]=Xe):Xe=t[110];let Ze;t[111]===Xe?Ze=t[112]:(Ze=(0,Z.jsx)(`div`,{className:`min-w-0 flex-1 rounded-md border border-input bg-muted/50 px-2.5 py-1 text-sm text-foreground wrap-break-word`,"data-testid":`create-location-display`,children:Xe}),t[111]=Xe,t[112]=Ze);let Qe;t[113]===Te?Qe=t[114]:(Qe=()=>void Te(),t[113]=Te,t[114]=Qe);let $e;t[115]===Symbol.for(`react.memo_cache_sentinel`)?($e=(0,Z.jsx)(J,{id:`O2UpM1`}),t[115]=$e):$e=t[115];let et;t[116]!==k||t[117]!==Qe?(et=(0,Z.jsx)(X,{type:`button`,variant:`outline`,className:`shrink-0`,disabled:k,onClick:Qe,"data-testid":`create-browse`,children:$e}),t[116]=k,t[117]=Qe,t[118]=et):et=t[118];let tt;t[119]!==Ze||t[120]!==et?(tt=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[Ze,et]}),t[119]=Ze,t[120]=et,t[121]=tt):tt=t[121];let nt;t[122]===ye?nt=t[123]:(nt=ye===``?null:(0,Z.jsx)(J,{id:`k_yIIc`,values:{targetPreview:ye},components:{0:(0,Z.jsx)(`code`,{className:`font-mono break-all`})}}),t[122]=ye,t[123]=nt);let rt;t[124]!==u||t[125]!==nt?(rt=(0,Z.jsx)(`p`,{id:u,className:`text-1sm text-muted-foreground wrap-break-word`,"aria-live":`polite`,"data-testid":`create-target-caption`,children:nt}),t[124]=u,t[125]=nt,t[126]=rt):rt=t[126];let it;t[127]!==tt||t[128]!==rt?(it=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[Ye,tt,rt]}),t[127]=tt,t[128]=rt,t[129]=it):it=t[129];let at;t[130]!==T||t[131]!==Fe||t[132]!==Le||t[133]!==P?(at=(0,Z.jsx)(Zg,{cascade:T,onOpenNested:Le,removeGitState:P,onRequestRemoveGit:je,onCancelRemoveGit:Ne,onConfirmRemoveGit:Fe}),t[130]=T,t[131]=Fe,t[132]=Le,t[133]=P,t[134]=at):at=t[134];let ot;t[135]===Symbol.for(`react.memo_cache_sentinel`)?(ot=(0,Z.jsxs)(dn,{className:`group flex w-full items-center justify-between gap-2 px-3 py-2 text-sm font-medium hover:bg-muted/50`,"data-testid":`create-advanced-trigger`,children:[(0,Z.jsx)(J,{id:`VNgKZz`}),(0,Z.jsx)(Ho,{className:`size-4 transition-transform group-data-[state=open]:rotate-90 motion-reduce:transition-none`,"aria-hidden":!0})]}),t[135]=ot):ot=t[135];let st;t[136]===Symbol.for(`react.memo_cache_sentinel`)?(st=(0,Z.jsx)(`legend`,{className:`text-sm font-medium`,children:(0,Z.jsx)(J,{id:`0YEbfk`})}),t[136]=st):st=t[136];let ct;t[137]===Symbol.for(`react.memo_cache_sentinel`)?(ct=(0,Z.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`8IP5jY`})}),t[137]=ct):ct=t[137];let lt;t[138]!==k||t[139]!==v?(lt=qa.map(e=>{let t=`create-editor-${e}`;return(0,Z.jsxs)(Ir,{htmlFor:t,className:`text-sm font-normal`,children:[(0,Z.jsx)(Xn,{id:t,checked:v.has(e),onCheckedChange:()=>Ce(e),disabled:k,"data-testid":`create-editor-${e}`}),(0,Z.jsx)(`span`,{children:Ai[e]})]},e)}),t[138]=k,t[139]=v,t[140]=lt):lt=t[140];let ut;t[141]===lt?ut=t[142]:(ut=(0,Z.jsxs)(`fieldset`,{className:`flex flex-col space-y-2 pb-2`,children:[st,ct,lt]}),t[141]=lt,t[142]=ut);let dt;t[143]!==k||t[144]!==b?(dt=(0,Z.jsx)(vl,{idPrefix:`create`,testIdPrefix:`create-sharing`,value:b,onValueChange:x,disabled:k}),t[143]=k,t[144]=b,t[145]=dt):dt=t[145];let ft;t[146]!==ut||t[147]!==dt?(ft=(0,Z.jsxs)(un,{className:`space-y-6 border-t border-border px-3 py-4`,children:[ut,dt]}),t[146]=ut,t[147]=dt,t[148]=ft):ft=t[148];let pt;t[149]!==S||t[150]!==ft?(pt=(0,Z.jsxs)(fn,{open:S,onOpenChange:C,className:`rounded-md border border-border`,"data-testid":`create-advanced`,children:[ot,ft]}),t[149]=S,t[150]=ft,t[151]=pt):pt=t[151];let mt;t[152]!==s||t[153]!==j?(mt=j===null?null:(0,Z.jsx)(`div`,{role:`alert`,className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,"data-testid":`create-submit-error`,children:s(Hg(j))}),t[152]=s,t[153]=j,t[154]=mt):mt=t[154];let ht;t[155]!==c||t[156]!==De||t[157]!==Je||t[158]!==it||t[159]!==at||t[160]!==pt||t[161]!==mt?(ht=(0,Z.jsx)(gn,{className:`space-y-6`,children:(0,Z.jsxs)(`form`,{id:c,onSubmit:De,"data-testid":`create-project-form`,className:`space-y-6`,children:[Je,it,at,pt,mt]})}),t[155]=c,t[156]=De,t[157]=Je,t[158]=it,t[159]=at,t[160]=pt,t[161]=mt,t[162]=ht):ht=t[162];let _t;t[163]===r?_t=t[164]:(_t=()=>r(!1),t[163]=r,t[164]=_t);let vt;t[165]===Symbol.for(`react.memo_cache_sentinel`)?(vt=(0,Z.jsx)(J,{id:`dEgA5A`}),t[165]=vt):vt=t[165];let yt;t[166]!==k||t[167]!==_t?(yt=(0,Z.jsx)(X,{type:`button`,variant:`outline`,className:`font-mono uppercase`,onClick:_t,disabled:k,"data-testid":`create-cancel`,children:vt}),t[166]=k,t[167]=_t,t[168]=yt):yt=t[168];let bt;t[169]===k?bt=t[170]:(bt=k?(0,Z.jsx)(J,{id:`E9bKSA`}):(0,Z.jsx)(J,{id:`hYgDIe`}),t[169]=k,t[170]=bt);let xt;t[171]!==c||t[172]!==xe||t[173]!==bt?(xt=(0,Z.jsx)(X,{type:`submit`,form:c,disabled:xe,"data-testid":`create-submit`,children:bt}),t[171]=c,t[172]=xe,t[173]=bt,t[174]=xt):xt=t[174];let St;t[175]!==yt||t[176]!==xt?(St=(0,Z.jsxs)(_n,{children:[yt,xt]}),t[175]=yt,t[176]=xt,t[177]=St):St=t[177];let Ct;t[178]!==Be||t[179]!==ht||t[180]!==St?(Ct=(0,Z.jsxs)(hn,{className:`sm:max-w-lg`,"data-testid":`create-project-dialog`,children:[Be,ht,St]}),t[178]=Be,t[179]=ht,t[180]=St,t[181]=Ct):Ct=t[181];let wt;return t[182]!==ke||t[183]!==n||t[184]!==Ct?(wt=(0,Z.jsx)(yn,{open:n,onOpenChange:ke,children:Ct}),t[182]=ke,t[183]=n,t[184]=Ct,t[185]=wt):wt=t[185],wt}function Wg(e){return e+1}function Gg(e){return e+1}function Kg(){}function qg(e){return e+1}function Jg(e){return e+1}function Yg(e){console.warn(`[CreateProjectDialog] defaultProjectsRoot probe failed:`,e)}function Xg(){return new Set(qa)}function Zg(e){let t=(0,$.c)(37),{cascade:n,onOpenNested:r,removeGitState:i,onRequestRemoveGit:a,onCancelRemoveGit:o,onConfirmRemoveGit:s}=e;if(n.kind===`idle`||n.kind===`free`||n.kind===`block-nonempty`)return null;if(n.kind===`block-nested`){let{rootPath:e}=n,i;t[0]===e?i=t[1]:(i=zg(e),t[0]=e,t[1]=i);let a=i,o;t[2]===e?o=t[3]:(o={rootPath:e},t[2]=e,t[3]=o);let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s={0:(0,Z.jsx)(`code`,{className:`font-mono break-all`})},t[4]=s):s=t[4];let c;t[5]===o?c=t[6]:(c=(0,Z.jsx)(`p`,{className:`mb-2`,children:(0,Z.jsx)(J,{id:`W7XJN4`,values:o,components:s})}),t[5]=o,t[6]=c);let l;t[7]!==r||t[8]!==e?(l=()=>r(e),t[7]=r,t[8]=e,t[9]=l):l=t[9];let u;t[10]===a?u=t[11]:(u=(0,Z.jsx)(J,{id:`1Ta7Fd`,values:{basename:a}}),t[10]=a,t[11]=u);let d;t[12]!==l||t[13]!==u?(d=(0,Z.jsx)(X,{type:`button`,variant:`outline`,size:`sm`,onClick:l,"data-testid":`create-banner-nested-open`,children:u}),t[12]=l,t[13]=u,t[14]=d):d=t[14];let f;return t[15]!==c||t[16]!==d?(f=(0,Z.jsxs)(`div`,{role:`alert`,className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,"data-testid":`create-banner-nested`,children:[c,d]}),t[15]=c,t[16]=d,t[17]=f):f=t[17],f}if(n.kind===`confirm-git`){let{gitRoot:e}=n,r;if(t[18]!==e){let n;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(n=/\/+$/,t[20]=n):n=t[20],r=e.replace(n,``),t[18]=e,t[19]=r}else r=t[19];let c=`${r}/.git`,l=i.kind===`error`?i.message:null,u;t[21]===e?u=t[22]:(u={gitRoot:e},t[21]=e,t[22]=u);let d;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(d={0:(0,Z.jsx)(`code`,{}),1:(0,Z.jsx)(`code`,{})},t[23]=d):d=t[23];let f;t[24]===u?f=t[25]:(f=(0,Z.jsx)(`p`,{children:(0,Z.jsx)(J,{id:`FEK4oC`,values:u,components:d})}),t[24]=u,t[25]=f);let p;t[26]!==e||t[27]!==o||t[28]!==s||t[29]!==a||t[30]!==l||t[31]!==i.kind||t[32]!==c?(p=i.kind===`idle`||i.kind===`error`?(0,Z.jsxs)(`div`,{className:`mt-2 flex flex-col gap-1`,children:[(0,Z.jsx)(X,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>a(e),"data-testid":`create-banner-git-remove`,children:(0,Z.jsx)(J,{id:`YTLmTM`,components:{0:(0,Z.jsx)(`code`,{})}})}),i.kind===`error`?(0,Z.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,"data-testid":`create-banner-git-remove-error`,children:(0,Z.jsx)(J,{id:`SkMZlS`,values:{targetGitPath:c,removeGitError:l},components:{0:(0,Z.jsx)(`code`,{})}})}):null]}):(0,Z.jsxs)(`div`,{className:`mt-2 flex flex-col gap-2 rounded border border-blue-400/60 bg-white/40 p-2 dark:border-blue-600/60 dark:bg-black/20`,"data-testid":`create-banner-git-remove-confirm`,children:[(0,Z.jsx)(`p`,{className:`text-xs`,children:(0,Z.jsx)(J,{id:`WZ-vBy`,values:{targetGitPath:c},components:{0:(0,Z.jsx)(`code`,{className:`font-mono break-all`})}})}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Z.jsx)(X,{type:`button`,variant:`destructive`,size:`sm`,disabled:i.kind===`pending`,onClick:()=>s(e),"data-testid":`create-banner-git-remove-confirm-button`,children:i.kind===`pending`?(0,Z.jsx)(J,{id:`0-31GV`}):(0,Z.jsx)(J,{id:`v-h2hx`,values:{targetGitPath:c}})}),(0,Z.jsx)(X,{type:`button`,variant:`outline`,size:`sm`,disabled:i.kind===`pending`,onClick:o,"data-testid":`create-banner-git-remove-cancel`,children:(0,Z.jsx)(J,{id:`dEgA5A`})})]})]}),t[26]=e,t[27]=o,t[28]=s,t[29]=a,t[30]=l,t[31]=i.kind,t[32]=c,t[33]=p):p=t[33];let m;return t[34]!==f||t[35]!==p?(m=(0,Z.jsxs)(`div`,{role:`status`,"aria-live":`polite`,className:`rounded-md border border-blue-300 bg-blue-50 px-3 py-2 text-sm text-blue-900 dark:border-blue-700 dark:bg-blue-950 dark:text-blue-200`,"data-testid":`create-banner-git-confirm`,children:[f,p]}),t[34]=f,t[35]=p,t[36]=m):m=t[36],m}return null}var Qg=`open-knowledge:doc-panel-tab`,$g=null;function e_(){let e=$g;return $g=null,e}function t_(e,t=typeof window>`u`?new EventTarget:window){$g=e,t.dispatchEvent(new CustomEvent(Qg,{detail:{tab:e}}))}function n_(e,t=typeof window>`u`?new EventTarget:window){let n=t=>{let n=t instanceof CustomEvent?t.detail?.tab:void 0;n&&e(n)};return t.addEventListener(Qg,n),()=>t.removeEventListener(Qg,n)}function r_(e){let t=(0,$.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`GitHub`}),r=(0,Z.jsx)(`path`,{d:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,Z.jsxs)(`svg`,{role:`img`,fill:`currentColor`,height:24,width:24,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}function i_(e){if(e===null)return`none`;switch(e.kind){case`doc`:case`folder-index`:return`doc`;case`folder`:return`folder`;case`asset`:case`skill-file`:case`large-file`:return`asset`;case`missing`:return`none`}}var a_={back:{id:`iH8pgl`},forward:{id:`rxWGWX`},newFile:{id:`HdkSiO`},newFolder:{id:`96G6Re`},openGraph:{id:`3Fcb0I`},initializeStarterPack:{id:`fWi7pn`},newProject:{id:`gKi-a_`},openFolderOnDisk:{id:`WPwDin`},openFileOnDisk:{id:`ka6Eke`},switchProject:{id:`xaDWAI`},settings:{id:`Tz0i8g`},installClaudeDesktop:{id:`62Pc08`},reportBug:{id:`cd5EXh`},bugReportHistory:{id:`QHCx0c`},sendFeedback:{id:`RoafuO`},newFromTemplate:{id:`Uuj_R4`},rename:{id:`2wxgft`},duplicate:{id:`euc6Ns`},moveToTrash:{id:`q3TWG7`},revealInFinder:{id:`LtSYdi`},copyFullPath:{id:`Up2_7p`},copyRelativePath:{id:`M6mvVi`},closeTab:{id:`r6ncaO`},newWorktree:{id:`DXd9LM`},switchWorktree:{id:`8Vq20-`},sidebarShow:{id:`151wvk`},sidebarHide:{id:`Q1mtyd`},docPanelShow:{id:`fSRzLo`},docPanelHide:{id:`GSYWCm`},terminalShow:{id:`xi9KGG`},terminalHide:{id:`9xCnv8`},showHiddenFiles:{id:`XcGbim`},showOkFolders:{id:`GHsJb8`},showOnlyMarkdownFiles:{id:`WkTLN7`},showSkillsSection:{id:`NF_Wcg`},expandAll:{id:`OlAl5i`},collapseAll:{id:`qvWGzP`},newTerminal:{id:`ZBxvV3`},killTerminal:{id:`5_j-DA`},checkForUpdates:{id:`WMCwmR`},setUpIntegrations:{id:`AhoGwP`},checkSpelling:{id:`ZgJVnp`},openOnGithub:{id:`LeGeTf`}},o_={"navigate-back":Bo,"navigate-forward":Ho,"new-file":Fn,"new-folder":Vh,"open-graph":ng,"initialize-starter-pack":ig,"new-project":Wt,"open-folder":hc,"open-file":Gn,"switch-project":ke,settings:pg,"install-claude-desktop":ac,"report-bug":Ke,"bug-report-history":Pc,"send-feedback":tg,"new-from-template":Fn,rename:rc,duplicate:ic,"move-to-trash":ll,"reveal-in-finder":hc,"copy-full-path":ic,"copy-relative-path":ic,"close-tab":hl,"new-worktree":po,"switch-worktree":po,"toggle-sidebar":R,"toggle-doc-panel":bc,"toggle-terminal":Fc,"toggle-show-hidden-files":sc,"toggle-show-ok-folders":Hh,"toggle-show-only-markdown-files":Gn,"toggle-show-skills-section":Zs,"expand-all-tree":Ng,"collapse-all-tree":zh,"new-terminal":Fc,"kill-terminal":Fc,"check-for-updates":tl,"set-up-integrations":Sh,"toggle-spell-check":_g,"open-github":r_},s_={"new-file":e=>{e.closePalette(),e.openNewItemDialog(`file`)},"new-folder":e=>{e.closePalette(),e.openNewItemDialog(`folder`)},"open-graph":e=>{e.closePalette(),t_(`graph`)},"initialize-starter-pack":e=>{e.closePalette(),e.openSeedDialog()},"new-project":e=>{e.closePalette(),e.openCreateProjectDialog()},"open-folder":e=>{let t=e.bridge;t&&e.runAction(async()=>{let e=await t.dialog.openFolder();e&&await t.project.open({path:e,target:`new-window`,entryPoint:`pick-existing`})})},"open-file":e=>{let t=e.bridge;t&&e.runAction(()=>t.project.openFile())},"switch-project":e=>{let t=e.bridge;t&&e.runAction(()=>t.navigator.open(),Cl._({id:`jol95m`}))},settings:e=>{e.closePalette(),window.location.hash!==`#settings`&&(window.location.hash=Nl)},"install-claude-desktop":e=>{e.closePalette(),window.location.hash=`#install-claude-desktop`},"report-bug":e=>{e.closePalette(),e.openReportBugDialog()},"bug-report-history":e=>{e.closePalette(),e.openBugReportHistory()},"send-feedback":e=>{e.closePalette(),e.openFeedbackDialog()},"check-for-updates":e=>e.runAction(async()=>{await e.bridge?.update.checkNow()}),"set-up-integrations":e=>e.runAction(async()=>{await e.bridge?.mcpWiring.reconfigure()}),"toggle-spell-check":e=>e.runAction(async()=>{await e.bridge?.spellcheck.toggle()}),"open-github":e=>e.openExternalUrl(no)};function c_(e){return{host:e.bridge===null?`web`:`desktop`,activeTargetKind:e.contextualTargetKind,singleFile:e.singleFile,terminalLive:e.viewMenuState.terminalLive===!0,canExpandAll:e.viewMenuState.canExpandAll!==!1,canCollapseAll:e.viewMenuState.canCollapseAll!==!1,hasActiveDoc:e.activeDocName!==null,showInstallSkill:!1}}function l_(e,t){if(e.stateToggle){let n=t.viewMenuState[e.stateToggle.stateField]===!0?e.stateToggle.hideKey:e.stateToggle.showKey;return Cl._(a_[n])}return Cl._(a_[e.labelKey])}function u_(e){let t=e.menuActionId;return e=>e.emitMenuAction(t)}function d_(e){let t=e.palette;if(!t)throw Error(`command ${e.id} has no palette presence`);let n=o_[e.id];if(!n)throw Error(`command ${e.id} has no palette icon`);let r=e.checkField;return{id:e.id,menuActionId:e.menuActionId,label:t=>l_(e,t),keywords:e.keywords,icon:n,group:t.group,visibility:t.visibility,shortcutId:e.shortcutId,shortcutDesktopOnly:e.shortcutDesktopOnly,checked:r?e=>e.viewMenuState[r]===!0:void 0,available:t=>ji(e.availability,c_(t)),dispatch:s_[e.id]??u_(e)}}var f_=ro.flatMap(e=>e.palette?[d_(e)]:[]),p_=`ok-omnibar-recents-v1`,m_=10;function h_(e){return typeof e==`object`&&!!e&&(e.kind===`file`||e.kind===`folder`)&&typeof e.path==`string`&&typeof e.lastOpenedAt==`string`}function g_(e){if(e)return e;if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function __(e,t){return`${e}:${t}`}function v_(e){let t=g_(e);if(!t)return[];try{let e=t.getItem(p_);if(!e)return[];let n=JSON.parse(e);return Array.isArray(n)?n.filter(h_).slice(0,m_):[]}catch{return[]}}function y_(e,t){let n=g_(t);if(n)try{n.setItem(p_,JSON.stringify(e.slice(0,m_)))}catch(e){console.warn(`[omnibar] Failed to save recent entries:`,e)}}function b_(e,t){return[t,...e.filter(e=>e.kind!==t.kind||e.path!==t.path)].slice(0,m_)}function x_(e,t){return e.filter(e=>t.has(__(e.kind,e.path)))}var S_=50,C_=50,w_=``,T_=null;function E_(e){return e.trim().toLowerCase()}function D_(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function O_(e){let t=e.trim();return t?[...new Set(t.split(/\s+/).filter(Boolean))].sort((e,t)=>t.length-e.length):[]}function k_(e,t,n=new Map,r=new Map,i=new Set){let a=[],o=new Set;for(let t of e){o.add(t);let e=r.get(t),i=e?.modified,s=n.get(t);a.push({kind:`file`,path:t,name:Da(t),...s&&{title:s},...e?.docExt&&{docExt:e.docExt},...i&&{modifiedTs:Date.parse(i)}})}for(let e of i)o.has(e)||(o.add(e),a.push({kind:`file`,path:e,name:Da(e),bodyIndexed:!1}));for(let e of t)a.push({kind:`folder`,path:e,name:Da(e)});return a.sort((e,t)=>{let n=e.path.localeCompare(t.path);return n===0?e.kind===t.kind?0:e.kind===`folder`?-1:1:n}),a}function A_(e){return Ri({kind:e.kind===`folder`?`folder`:e.bodyIndexed===!1?`file`:`page`,path:e.path,title:e.title??e.name,modifiedTs:e.modifiedTs??0})}function j_(e){return{entries:e,byId:new Map(e.map(e=>[`${e.kind===`folder`?`folder`:e.bodyIndexed===!1?`file`:`page`}:${e.path}`,e])),corpus:Pa(e.map(A_))}}function M_(e){return e.map(e=>`${e.kind}\u0000${e.path}\u0000${e.title??``}\u0000${e.docExt??``}\u0000${e.modifiedTs??0} ${e.bodyIndexed===!1?`0`:`1`}`).join(``)}function N_(e){let t=M_(e);return T_&&w_===t?T_:(w_=t,T_=j_(e),T_)}function P_(e,t,n=S_){return F_(N_(e),t,n)}function F_(e,t,n=S_){let r=E_(t);return r?qi(e.corpus,r,{intent:`omnibar`,limit:n,scopes:[`page`,`folder`,`file`]}).map(t=>e.byId.get(t.document.id)).filter(e=>e!==void 0):e.entries.slice(0,20)}function I_(e,t){let n=O_(t);if(n.length===0||e.length===0)return[{text:e,match:!1,start:0}];let r=RegExp(`(${n.map(D_).join(`|`)})`,`gi`),i=[],a=0;for(let t of e.matchAll(r)){let n=t.index??0;n>a&&i.push({text:e.slice(a,n),match:!1,start:a}),i.push({text:t[0],match:!0,start:n}),a=n+t[0].length}return a<e.length&&i.push({text:e.slice(a),match:!1,start:a}),i.length>0?i:[{text:e,match:!1,start:0}]}function L_(e){if(e.kind!==`page`&&e.kind!==`folder`&&e.kind!==`file`||typeof e.path!=`string`)return null;let t=Da(e.path);return{kind:e.kind===`folder`?`folder`:`file`,path:e.path,name:t,...e.kind===`file`&&{bodyIndexed:!1},...e.title&&{title:e.title},...e.snippet&&{snippet:e.snippet},...typeof e.score==`number`&&{score:e.score}}}async function R_(e,t={}){let n=e.trim();if(!n)return{entries:[],truncated:!1,ready:!0};let r=await fetch(`/api/search`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({query:n,intent:`full_text`,ranking:t.semantic?`relevance`:`navigation`,scopes:[`page`,`folder`,`content`,`file`],limit:t.limit??C_,source:`omnibar`,...t.semantic?{semantic:!0}:{}}),signal:t.signal});if(!r.ok){let e=await r.json().catch(()=>null);throw Error(Fl(e)??`Search failed with status ${r.status}`)}let i=await r.json();return{entries:(i.results??[]).map(L_).filter(e=>!!e),truncated:i.truncated===!0,ready:i.ready!==!1}}function z_(e,t,n=[]){let r=E_(t);return r?E_([e,...n].join(` `)).includes(r):!0}function B_(e,t,n={}){if(e.trim()===``)return`idle`;if(t.length===0)return`empty`;if(n.truncated)return`truncated`;for(let e of t)if(`snippet`in e&&typeof e.snippet==`string`&&e.snippet.length>0)return`content`;return`name-only`}function V_(e){let{query:t,firedQuery:n,status:r,resultCount:i}=e,a=i>0,o=t!==``&&t!==n,s=a&&(r===`loading`||t!==n),c=null;r===`error`&&t!==``?c={kind:`retry`,query:t}:o&&r!==`loading`&&(c={kind:`search`,query:t});let l=null;return r===`loading`?l=`searching`:t===``&&!a?l=`empty`:r===`success`&&!o&&!a&&(l=`no-results`),{submit:c,results:{show:a,dimmed:s,forQuery:a?n:null},notice:l}}var H_=`tag:`;function U_(e,t){if(!e.toLowerCase().startsWith(`tag:`))return{kind:`normal`,query:e};let n=e.slice(4).replace(/^\s+/,``).trim();return n&&t.has(n)?{kind:`tag-docs`,tagName:n}:{kind:`tag-list`,query:n}}function W_(e,t){return v(e,t)}var G_=q;async function K_(e){let t=await fetch(`/api/tags/${encodeURIComponent(e)}`);if(!t.ok)throw Error(`/api/tags/${e} responded with ${t.status}`);let n=await t.json();return Array.isArray(n.docs)?n.docs:[]}var q_=(0,Q.lazy)(()=>n(()=>import(`./FeedbackForm-GiDmtTV5.js`).then(e=>({default:e.FeedbackForm})),[],import.meta.url)),J_=e=>{let t=(0,$.c)(11),{open:n,onOpenChange:r,source:i,onSuccess:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(vn,{children:(0,Z.jsx)(mn,{children:(0,Z.jsx)(J,{id:`SItQRc`})})}),t[0]=o):o=t[0];let s;t[1]!==r||t[2]!==a?(s=()=>{r(!1),a?.()},t[1]=r,t[2]=a,t[3]=s):s=t[3];let c;t[4]!==i||t[5]!==s?(c=(0,Z.jsxs)(hn,{children:[o,(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(q_,{source:i,onSuccess:s})})]}),t[4]=i,t[5]=s,t[6]=c):c=t[6];let l;return t[7]!==r||t[8]!==n||t[9]!==c?(l=(0,Z.jsx)(yn,{open:n,onOpenChange:r,children:c}),t[7]=r,t[8]=n,t[9]=c,t[10]=l):l=t[10],l},Y_=[`.md`,`.mdx`];function X_(e){let t=e.toLowerCase();for(let e of Y_)if(t.endsWith(e))return e;return null}var Z_={local:0,inherited:1};function Q_(e){return[...e].sort((e,t)=>{let n=Z_[e.scope]-Z_[t.scope];if(n!==0)return n;let r=(e.title??e.name).toLowerCase(),i=(t.title??t.name).toLowerCase();return r.localeCompare(i)})}var $_=`__blank__`;function ev(e){return e.trim()?e.includes(`..`)?`dotdot`:e.startsWith(`/`)?`leading-slash`:e.includes(`\\`)?`backslash`:e.includes(`\0`)?`null-byte`:null:`empty`}function tv(e){switch(e){case`empty`:return{id:`hYDc6B`};case`dotdot`:return{id:`Wyxs0x`};case`leading-slash`:return{id:`OYnx7O`};case`backslash`:return{id:`qo4zCg`};case`null-byte`:return{id:`saYiIO`}}}function nv(e){let t=e.fileName.trim(),n=X_(t)?t:`${t}${e.fileExtension??`.md`}`;if(e.kind===`folder`){let t=(e.folderName??``).trim();return`${e.initialDir?`${e.initialDir}/${t}`:t}/${n}`}return e.initialDir?`${e.initialDir}/${n}`:n}function rv(e,t){return Dl(e.target)?!1:El(e,`new-item`,t)}function iv(e){let t=e.value.lastIndexOf(`.`);t>0?e.setSelectionRange(0,t):e.select()}function av(e){let t=(0,$.c)(136),{open:n,onOpenChange:r,kind:i,initialDir:a,suggestedName:o,initialTemplate:s,defaultToTemplate:c,description:l,onCreated:u,folderConfig:d}=e,{_:f}=gt(),{addPage:p}=Go(),m=Ms(d?null:a),h=d??m,[g,_]=(0,Q.useState)(``),[v,y]=(0,Q.useState)(``),[b,x]=(0,Q.useState)($_),[S,C]=(0,Q.useState)(!1),[w,T]=(0,Q.useState)(null),[E,D]=(0,Q.useState)(!1),[O,k]=(0,Q.useState)(null),A=(0,Q.useId)(),j=(0,Q.useId)(),M=(0,Q.useId)(),N=(0,Q.useId)(),F=(0,Q.useId)(),[I,L]=(0,Q.useState)(!1),R=(0,Q.useRef)(null),z=(0,Q.useRef)(null),B,V;t[0]!==s||t[1]!==i||t[2]!==n||t[3]!==o?(B=()=>{n&&(T(null),k(null),D(!1),y(``),x(i===`file`&&s?s:$_),C(!1),L(!1),_(i===`file`?o??`untitled`:`index`))},V=[n,i,o,s],t[0]=s,t[1]=i,t[2]=n,t[3]=o,t[4]=B,t[5]=V):(B=t[4],V=t[5]),(0,Q.useEffect)(B,V);let H;t[6]!==h.state.data||t[7]!==h.state.status?(H=h.state.status===`ready`?Q_(h.state.data.folder.templates_available??[]):[],t[6]=h.state.data,t[7]=h.state.status,t[8]=H):H=t[8];let U=H,W;t[9]!==h.state.data||t[10]!==h.state.status||t[11]!==n||t[12]!==b?(W=()=>{n&&b!==$_&&h.state.status===`ready`&&((h.state.data.folder.templates_available??[]).some(e=>e.name===b)||x($_))},t[9]=h.state.data,t[10]=h.state.status,t[11]=n,t[12]=b,t[13]=W):W=t[13];let G;t[14]!==h.state||t[15]!==n||t[16]!==b?(G=[n,b,h.state],t[14]=h.state,t[15]=n,t[16]=b,t[17]=G):G=t[17],(0,Q.useEffect)(W,G);let K;t[18]!==c||t[19]!==h.state.data||t[20]!==h.state.status||t[21]!==s||t[22]!==n||t[23]!==S?(K=()=>{if(!n||!c||s||S||h.state.status!==`ready`)return;let e=Q_(h.state.data.folder.templates_available??[]);e.length>0&&x(e[0].name)},t[18]=c,t[19]=h.state.data,t[20]=h.state.status,t[21]=s,t[22]=n,t[23]=S,t[24]=K):K=t[24];let ee;t[25]!==c||t[26]!==h.state||t[27]!==s||t[28]!==n||t[29]!==S?(ee=[n,c,s,S,h.state],t[25]=c,t[26]=h.state,t[27]=s,t[28]=n,t[29]=S,t[30]=ee):ee=t[30],(0,Q.useEffect)(K,ee);let te=i===`file`,ne=h.state.status===`loading`||h.state.status===`idle`,q=h.state.status===`error`?h.state.message:null,re;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(re=function(e){_(e),T(null)},t[31]=re):re=t[31];let ie=re,ae;t[32]!==g||t[33]!==v||t[34]!==a||t[35]!==i?(ae=function(){return nv({kind:i,initialDir:a,fileName:g,folderName:v})},t[32]=g,t[33]=v,t[34]=a,t[35]=i,t[36]=ae):ae=t[36];let oe=ae,se;t[37]!==f||t[38]!==g||t[39]!==v||t[40]!==i?(se=function(){if(i===`folder`){let e=ev(v.trim());if(e)return{message:f({id:`ODGGlj`,values:{detail:f(tv(e))}}),field:`folder`}}let e=ev(g.trim());return e?{message:f(tv(e)),field:`file`}:null},t[37]=f,t[38]=g,t[39]=v,t[40]=i,t[41]=se):se=t[41];let ce=se,le;t[42]!==E||t[43]!==g||t[44]!==v||t[45]!==i?(le=E||!g.trim()||i===`folder`&&!v.trim(),t[42]=E,t[43]=g,t[44]=v,t[45]=i,t[46]=le):le=t[46];let ue=le,de;t[47]!==f||t[48]!==p||t[49]!==oe||t[50]!==ce||t[51]!==i||t[52]!==u||t[53]!==r||t[54]!==b?(de=async function(){let e=ce();if(e){T(e.message),k(e.field);return}D(!0),T(null),k(null);let t=oe(),n=i===`file`&&b!==$_?b:void 0,a={path:t};n!==void 0&&(a.template=n);try{let e=await fetch(`/api/create-page`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(a)}),t=e.status,n=await P(e,f({id:`d2uTPx`,values:{status:t}}));if(!n.ok){D(!1),T(n.title),k(`form`);return}let o=yi.safeParse(n.body);if(D(!1),!o.success){T(f(i===`folder`?{id:`K1ckLX`}:{id:`fJgQHX`})),k(`form`);return}let s=o.data.docName;r(!1),window.location.hash=`#/${s}`,p(s),au([`files`,`backlinks`,`graph`]),u?.(s)}catch(e){console.warn(`[NewItemDialog] create failed:`,e),D(!1),T(f({id:`HIb0vl`})),k(`form`)}},t[47]=f,t[48]=p,t[49]=oe,t[50]=ce,t[51]=i,t[52]=u,t[53]=r,t[54]=b,t[55]=de):de=t[55];let fe=de,pe;t[56]!==f||t[57]!==a?(pe=a||f({id:`L6Hhh6`}),t[56]=f,t[57]=a,t[58]=pe):pe=t[58];let me=pe,he;t[59]===i?he=t[60]:(he=(0,Z.jsx)(mn,{children:i===`file`?(0,Z.jsx)(J,{id:`HdkSiO`}):(0,Z.jsx)(J,{id:`96G6Re`})}),t[59]=i,t[60]=he);let ge;t[61]!==l||t[62]!==me?(ge=l??(0,Z.jsx)(J,{id:`NvOvTi`,values:{dirDisplay:me},components:{0:(0,Z.jsx)(`span`,{className:`font-medium text-foreground`})}}),t[61]=l,t[62]=me,t[63]=ge):ge=t[63];let _e;t[64]===ge?_e=t[65]:(_e=(0,Z.jsx)(pn,{children:ge}),t[64]=ge,t[65]=_e);let ve;t[66]!==he||t[67]!==_e?(ve=(0,Z.jsxs)(vn,{children:[he,_e]}),t[66]=he,t[67]=_e,t[68]=ve):ve=t[68];let ye;t[69]!==b||t[70]!==te||t[71]!==N||t[72]!==I||t[73]!==F||t[74]!==U||t[75]!==q||t[76]!==ne?(ye=te&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`span`,{id:N,className:`text-sm font-medium`,children:(0,Z.jsx)(J,{id:`f65AOQ`})}),q?(0,Z.jsx)(`p`,{role:`alert`,className:`text-1sm text-destructive`,children:(0,Z.jsx)(J,{id:`sE7R19`,values:{templatesError:q}})}):null,(0,Z.jsx)(sv,{triggerId:F,labelledById:N,open:I,onOpenChange:L,value:b,onValueChange:e=>{x(e),C(!0)},templates:U,loading:ne}),!ne&&!q&&U.length===0?(0,Z.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`uWtdQR`})}):null]}),t[69]=b,t[70]=te,t[71]=N,t[72]=I,t[73]=F,t[74]=U,t[75]=q,t[76]=ne,t[77]=ye):ye=t[77];let be;t[78]!==f||t[79]!==w||t[80]!==O||t[81]!==A||t[82]!==j||t[83]!==v||t[84]!==i?(be=i===`folder`&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`label`,{className:`text-sm font-medium`,htmlFor:j,children:(0,Z.jsx)(J,{id:`cqQyPB`})}),(0,Z.jsx)(Sl,{ref:z,id:j,value:v,onChange:e=>{y(e.target.value),T(null)},placeholder:`folder-name`,autoFocus:!0,"aria-describedby":w&&(O===`folder`||O===`form`)?A:void 0,"aria-invalid":w&&(O===`folder`||O===`form`)?!0:void 0,onKeyDown:e=>{if(e.key===`Enter`){e.preventDefault();let t=ev(v.trim());if(t){T(f({id:`ODGGlj`,values:{detail:f(tv(t))}})),k(`folder`);return}R.current?.focus()}}})]}),t[78]=f,t[79]=w,t[80]=O,t[81]=A,t[82]=j,t[83]=v,t[84]=i,t[85]=be):be=t[85];let xe;t[86]===i?xe=t[87]:(xe=i===`folder`?(0,Z.jsx)(J,{id:`jjtmV_`}):(0,Z.jsx)(J,{id:`s-XOaI`}),t[86]=i,t[87]=xe);let Se;t[88]!==M||t[89]!==xe?(Se=(0,Z.jsx)(`label`,{className:`text-sm font-medium`,htmlFor:M,children:xe}),t[88]=M,t[89]=xe,t[90]=Se):Se=t[90];let Ce;t[91]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=e=>ie(e.target.value),t[91]=Ce):Ce=t[91];let we=i===`file`,Te=w&&(O===`file`||O===`form`)?A:void 0,Ee=w&&(O===`file`||O===`form`)?!0:void 0,De;t[92]!==fe||t[93]!==ue?(De=e=>{e.key===`Enter`&&!ue&&fe()},t[92]=fe,t[93]=ue,t[94]=De):De=t[94];let Oe;t[95]!==M||t[96]!==g||t[97]!==we||t[98]!==Te||t[99]!==Ee||t[100]!==De?(Oe=(0,Z.jsx)(Sl,{ref:R,id:M,value:g,onChange:Ce,placeholder:`my-note`,autoFocus:we,"aria-describedby":Te,"aria-invalid":Ee,onFocus:ov,onKeyDown:De}),t[95]=M,t[96]=g,t[97]=we,t[98]=Te,t[99]=Ee,t[100]=De,t[101]=Oe):Oe=t[101];let ke;t[102]!==w||t[103]!==A?(ke=w&&(0,Z.jsx)(`p`,{id:A,role:`alert`,className:`text-1sm text-destructive`,children:w}),t[102]=w,t[103]=A,t[104]=ke):ke=t[104];let Ae;t[105]!==Se||t[106]!==Oe||t[107]!==ke?(Ae=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[Se,Oe,ke]}),t[105]=Se,t[106]=Oe,t[107]=ke,t[108]=Ae):Ae=t[108];let je;t[109]!==ye||t[110]!==be||t[111]!==Ae?(je=(0,Z.jsxs)(gn,{className:`space-y-6 pb-1`,children:[ye,be,Ae]}),t[109]=ye,t[110]=be,t[111]=Ae,t[112]=je):je=t[112];let Me;t[113]===r?Me=t[114]:(Me=()=>r(!1),t[113]=r,t[114]=Me);let Ne;t[115]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,Z.jsx)(J,{id:`dEgA5A`}),t[115]=Ne):Ne=t[115];let Pe;t[116]!==E||t[117]!==Me?(Pe=(0,Z.jsx)(X,{variant:`outline`,className:`font-mono uppercase`,onClick:Me,disabled:E,children:Ne}),t[116]=E,t[117]=Me,t[118]=Pe):Pe=t[118];let Fe;t[119]===E?Fe=t[120]:(Fe=E?(0,Z.jsx)(J,{id:`E9bKSA`}):(0,Z.jsx)(J,{id:`hYgDIe`}),t[119]=E,t[120]=Fe);let Ie;t[121]!==fe||t[122]!==ue||t[123]!==Fe?(Ie=(0,Z.jsx)(X,{onClick:fe,disabled:ue,children:Fe}),t[121]=fe,t[122]=ue,t[123]=Fe,t[124]=Ie):Ie=t[124];let Le;t[125]!==Pe||t[126]!==Ie?(Le=(0,Z.jsxs)(_n,{children:[Pe,Ie]}),t[125]=Pe,t[126]=Ie,t[127]=Le):Le=t[127];let Re;t[128]!==ve||t[129]!==je||t[130]!==Le?(Re=(0,Z.jsxs)(hn,{className:`sm:max-w-md`,"data-ok-layer-spawned":``,children:[ve,je,Le]}),t[128]=ve,t[129]=je,t[130]=Le,t[131]=Re):Re=t[131];let ze;return t[132]!==r||t[133]!==n||t[134]!==Re?(ze=(0,Z.jsx)(yn,{open:n,onOpenChange:r,children:Re}),t[132]=r,t[133]=n,t[134]=Re,t[135]=ze):ze=t[135],ze}function ov(e){return iv(e.currentTarget)}function sv(e){let t=(0,$.c)(66),{triggerId:n,labelledById:r,open:i,onOpenChange:a,value:o,onValueChange:c,templates:l,loading:u}=e,{_:d}=gt(),f=(0,Q.useId)(),p;if(t[0]!==l||t[1]!==o){let e;t[3]===o?e=t[4]:(e=e=>e.name===o,t[3]=o,t[4]=e),p=l.find(e),t[0]=l,t[1]=o,t[2]=p}else p=t[2];let m=p,h=o===$_,_=i?f:void 0,v=`${r} ${n}`,y;t[5]!==h||t[6]!==u||t[7]!==m?.name||t[8]!==m?.title||t[9]!==o?(y=u?(0,Z.jsx)(J,{id:`Hl89Qd`}):h?(0,Z.jsx)(J,{id:`E7BhZn`}):m?.title??m?.name??o,t[5]=h,t[6]=u,t[7]=m?.name,t[8]=m?.title,t[9]=o,t[10]=y):y=t[10];let b;t[11]===y?b=t[12]:(b=(0,Z.jsx)(`span`,{className:`truncate`,children:y}),t[11]=y,t[12]=b);let x;t[13]!==h||t[14]!==u||t[15]!==m?(x=!u&&!h&&m?(0,Z.jsx)(dv,{entry:m}):null,t[13]=h,t[14]=u,t[15]=m,t[16]=x):x=t[16];let C;t[17]!==b||t[18]!==x?(C=(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[b,x]}),t[17]=b,t[18]=x,t[19]=C):C=t[19];let w;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Z.jsx)(Eh,{className:`ml-2 size-4 shrink-0 opacity-50`,"aria-hidden":`true`}),t[20]=w):w=t[20];let T;t[21]!==u||t[22]!==i||t[23]!==_||t[24]!==v||t[25]!==C||t[26]!==n?(T=(0,Z.jsx)(Ht,{asChild:!0,children:(0,Z.jsxs)(X,{id:n,type:`button`,variant:`outline`,role:`combobox`,"aria-expanded":i,"aria-haspopup":`listbox`,"aria-controls":_,"aria-labelledby":v,disabled:u,className:`w-full justify-between font-normal`,children:[C,w]})}),t[21]=u,t[22]=i,t[23]=_,t[24]=v,t[25]=C,t[26]=n,t[27]=T):T=t[27];let E;t[28]===d?E=t[29]:(E=d({id:`UQAp48`}),t[28]=d,t[29]=E);let D;t[30]===E?D=t[31]:(D=(0,Z.jsx)(I,{placeholder:E}),t[30]=E,t[31]=D);let O;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Z.jsx)(A,{children:(0,Z.jsx)(J,{id:`c8iK2Y`})}),t[32]=O):O=t[32];let k;if(t[33]!==a||t[34]!==c||t[35]!==l||t[36]!==o){let e;t[38]!==a||t[39]!==c||t[40]!==o?(e=e=>{let t=e.title??e.name,n=e.title&&e.title!==e.name?e.name:void 0,r=`${e.scope}:${e.source_folder}:${e.name}`;return(0,Z.jsxs)(g,{value:r,keywords:[t,e.name,e.description??``,e.scope,e.source_folder??``],onSelect:()=>{c(e.name),a(!1)},className:`items-start gap-3`,children:[(0,Z.jsx)(zo,{className:Y(`mt-1 size-4 shrink-0`,o===e.name?`opacity-100`:`opacity-0`),"aria-hidden":`true`}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`truncate text-sm font-medium`,children:t}),n?(0,Z.jsx)(`code`,{className:`font-mono text-2xs text-muted-foreground shrink-0`,children:n}):null,(0,Z.jsx)(dv,{entry:e,className:`ml-auto`})]}),e.description?(0,Z.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-xs text-muted-foreground`,children:e.description}):null]})]},r)},t[38]=a,t[39]=c,t[40]=o,t[41]=e):e=t[41],k=l.map(e),t[33]=a,t[34]=c,t[35]=l,t[36]=o,t[37]=k}else k=t[37];let j;t[42]!==a||t[43]!==c?(j=()=>{c($_),a(!1)},t[42]=a,t[43]=c,t[44]=j):j=t[44];let M=o===$_?`opacity-100`:`opacity-0`,N;t[45]===M?N=t[46]:(N=Y(`mt-1 size-4 shrink-0`,M),t[45]=M,t[46]=N);let P;t[47]===N?P=t[48]:(P=(0,Z.jsx)(zo,{className:N,"aria-hidden":`true`}),t[47]=N,t[48]=P);let F;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Z.jsx)(`span`,{className:`text-sm font-medium`,children:(0,Z.jsx)(J,{id:`E7BhZn`})}),t[49]=F):F=t[49];let L;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[F,(0,Z.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-xs text-muted-foreground`,children:(0,Z.jsx)(J,{id:`hZoBHK`})})]}),t[50]=L):L=t[50];let R;t[51]!==j||t[52]!==P?(R=(0,Z.jsxs)(g,{value:`Blank note empty`,onSelect:j,className:`items-start gap-3`,children:[P,L]}),t[51]=j,t[52]=P,t[53]=R):R=t[53];let z;t[54]!==f||t[55]!==k||t[56]!==R?(z=(0,Z.jsxs)(S,{id:f,className:`subtle-scrollbar`,children:[O,k,R]}),t[54]=f,t[55]=k,t[56]=R,t[57]=z):z=t[57];let B;t[58]!==D||t[59]!==z?(B=(0,Z.jsx)(qt,{className:`w-[var(--radix-popover-trigger-width)] p-0`,align:`start`,onOpenAutoFocus:uv,onWheel:lv,onTouchMove:cv,children:(0,Z.jsxs)(s,{children:[D,z]})}),t[58]=D,t[59]=z,t[60]=B):B=t[60];let V;return t[61]!==a||t[62]!==i||t[63]!==B||t[64]!==T?(V=(0,Z.jsxs)(Vt,{open:i,onOpenChange:a,children:[T,B]}),t[61]=a,t[62]=i,t[63]=B,t[64]=T,t[65]=V):V=t[65],V}function cv(e){e.stopPropagation()}function lv(e){e.stopPropagation()}function uv(e){e.preventDefault(),e.currentTarget.querySelector(`[cmdk-input]`)?.focus()}function dv(e){let t=(0,$.c)(7),{entry:n,className:r}=e;if(n.scope===`inherited`){let e;t[0]===r?e=t[1]:(e=Y(`shrink-0 text-2xs`,r),t[0]=r,t[1]=e);let i;t[2]===n.source_folder?i=t[3]:(i=n.source_folder||(0,Z.jsx)(J,{id:`ZNK2Tq`}),t[2]=n.source_folder,t[3]=i);let a;return t[4]!==e||t[5]!==i?(a=(0,Z.jsx)(Eu,{variant:`gray`,className:e,children:i}),t[4]=e,t[5]=i,t[6]=a):a=t[6],a}return null}function fv(e){return e.split(`/`).pop()??e}function pv(e,t){let n=[];for(let r of t?.folders??[]){let t=`${r.path}/.ok/templates/`,i=e.created.filter(e=>e.kind===`file`&&(e.path.startsWith(t)||e.path.includes(`/${t}`))).map(e=>fv(e.path)),a=i.length,o=e.created.some(e=>e.kind===`folder`&&(e.path===r.path||e.path.endsWith(`/${r.path}`)));(a>0||o)&&n.push({path:r.path,summary:r.summary,templateCount:a,templates:i})}return n}function mv(e){return e.created.filter(e=>e.kind===`file`&&!e.path.split(`/`).includes(`.ok`)).map(e=>({path:e.path,name:fv(e.path)}))}function hv(e){let t=(0,$.c)(17),{plan:n,selectedPack:r}=e,{_:i}=gt(),a,o,s,c;if(t[0]!==i||t[1]!==n||t[2]!==r){let e=pv(n,r),l=mv(n),u=n.packSkill?.pending?n.packSkill:void 0,d=e.length,f=l.length,p=e.reduce(Sv,0),m=+!!u,h={"log.md":i({id:`EoaQyO`}),"USER.md":i({id:`bV6DJA`}),"SOUL.md":i({id:`Waiy-j`}),"ACCESS_POLICY.md":i({id:`6ZhdPI`}),"HEARTBEAT.md":i({id:`MDZSJe`}),"OVERVIEW.md":i({id:`dMsx3p`}),"welcome.md":i({id:`WWcqsG`}),"index.md":i({id:`uFQbYd`})},g=[d>0?{key:`folders`,n:d,label:i({id:`VsaI0G`,values:{folderCount:d}})}:null,f>0?{key:`files`,n:f,label:i({id:`DgcGrb`,values:{fileCount:f}})}:null,p>0?{key:`templates`,n:p,label:i({id:`ba3vIW`,values:{templateCount:p}})}:null,m>0?{key:`skills`,n:m,label:i({id:`HAvRAI`,values:{skillCount:m}})}:null].filter(xv),_=e.map(e=>({key:`folder:${e.path}`,icon:Hh,name:`${fv(e.path)}/`,pill:e.templateCount>0?i({id:`-5jISU`,values:{0:e.templateCount}}):void 0,pillTooltip:e.templateCount>0?e.templates:void 0,description:e.summary||void 0})),v=l.map(e=>({key:`file:${e.path}`,icon:he,name:e.name,title:e.name,description:h[e.name]})),y=u?[{key:`skill:${u.name}`,icon:Gh,name:Js(u.name),title:u.name,description:i({id:`FEqWFL`})}]:[],b=[{key:`folders`,label:i({id:`pcqlQu`,values:{0:_.length}}),rows:_},{key:`files`,label:i({id:`ZgGuA4`,values:{0:v.length}}),rows:v},{key:`skill`,label:i({id:`OZJeTZ`}),rows:y}].filter(bv);s=`space-y-5`;let x;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Z.jsx)(`h3`,{className:`flex items-center gap-1.5 text-xs font-medium uppercase font-mono tracking-wider text-muted-foreground`,children:(0,Z.jsx)(J,{id:`xSVO3J`})}),t[7]=x):x=t[7];let S=g.length>0?(0,Z.jsx)(`div`,{className:`flex flex-wrap items-baseline gap-x-2 gap-y-0.5 text-xs`,children:g.map(yv)}):null;t[8]===S?c=t[9]:(c=(0,Z.jsxs)(`div`,{className:`flex flex-wrap justify-between items-baseline gap-x-2 gap-y-0.5`,children:[x,S]}),t[8]=S,t[9]=c),a=`space-y-5`,o=b.map(gv),t[0]=i,t[1]=n,t[2]=r,t[3]=a,t[4]=o,t[5]=s,t[6]=c}else a=t[3],o=t[4],s=t[5],c=t[6];let l;t[10]!==a||t[11]!==o?(l=(0,Z.jsx)(`div`,{className:a,children:o}),t[10]=a,t[11]=o,t[12]=l):l=t[12];let u;return t[13]!==s||t[14]!==c||t[15]!==l?(u=(0,Z.jsxs)(`section`,{className:s,children:[c,l]}),t[13]=s,t[14]=c,t[15]=l,t[16]=u):u=t[16],u}function gv(e){return(0,Z.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,Z.jsxs)(`h4`,{className:`flex items-baseline gap-2 text-xs font-medium uppercase font-mono tracking-wider text-muted-foreground`,children:[(0,Z.jsx)(`span`,{children:e.label}),(0,Z.jsx)(`span`,{className:`text-muted-foreground/50`,children:e.rows.length})]}),(0,Z.jsx)(`ul`,{className:`space-y-4`,children:e.rows.map(_v)})]},e.key)}function _v(e){let t=e.icon;return(0,Z.jsxs)(`li`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(`div`,{"aria-hidden":`true`,className:`flex size-8 shrink-0 items-center justify-center rounded-lg border border-border/60`,children:(0,Z.jsx)(t,{className:`size-4 text-muted-foreground`})}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1 py-0.5`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`code`,{className:`min-w-0 flex-1 truncate font-mono text-1sm text-foreground/90`,title:e.title,children:e.name}),e.pill?e.pillTooltip&&e.pillTooltip.length>0?(0,Z.jsxs)(ln,{children:[(0,Z.jsx)(on,{className:`shrink-0 cursor-help rounded bg-transparent p-0 font-mono text-2xs uppercase tracking-wide text-muted-foreground transition-colors hover:text-foreground/70 focus-visible:text-foreground/70 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,children:e.pill}),(0,Z.jsx)(sn,{children:(0,Z.jsx)(`ul`,{className:`space-y-0.5 text-left font-mono`,children:e.pillTooltip.map(vv)})})]}):(0,Z.jsx)(`span`,{className:`shrink-0 font-mono text-2xs uppercase tracking-wide text-muted-foreground`,children:e.pill}):null]}),e.description?(0,Z.jsx)(`p`,{className:`mt-0.5 text-xs leading-relaxed text-muted-foreground`,children:e.description}):null]})]},e.key)}function vv(e){return(0,Z.jsx)(`li`,{children:e},e)}function yv(e,t){return(0,Z.jsxs)(Q.Fragment,{children:[t>0?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`text-muted-foreground/50`,children:`·`}):null,(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(`span`,{className:`text-foreground/80`,children:e.n}),` `,(0,Z.jsx)(`span`,{className:`text-muted-foreground/80`,children:e.label})]})]},e.key)}function bv(e){return e.rows.length>0}function xv(e){return e!==null}function Sv(e,t){return e+t.templateCount}async function Cv(e){let t=await e.json().catch(()=>null),n=uo.safeParse(t);if(!n.success)return{kind:`internal`,message:`HTTP ${e.status}`};let r=n.data.detail??n.data.title,i=n.data.type;return i===`urn:ok:error:seed-prerequisite-missing`?{kind:`prerequisite-missing`,message:r}:i===`urn:ok:error:seed-invalid-root`?{kind:`invalid-root`,message:r}:i===`urn:ok:error:no-project-dir`?{kind:`no-project`,message:r}:{kind:`internal`,message:r}}function wv(){let e=typeof window<`u`?window.okDesktop:void 0;if(e?.seed){let t=e.seed.apply;return{plan:e.seed.plan,apply:async(e,n)=>{let r=await t(e,n);return r.ok&&tu(),r},listPacks:e.seed.listPacks}}return{plan:async e=>{let t=new URLSearchParams;e?.rootDir&&t.set(`rootDir`,e.rootDir),e?.packId&&t.set(`packId`,e.packId);let n=t.toString(),r=await fetch(`/api/seed/plan${n?`?${n}`:``}`);if(!r.ok)return{ok:!1,error:await Cv(r)};let i=await r.json().catch(()=>null);return i?.plan?{ok:!0,plan:i.plan}:{ok:!1,error:{kind:`internal`,message:`Malformed plan response`}}},apply:async(e,t)=>{let n=await fetch(`/api/seed/apply`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({plan:e,packId:t?.packId})});if(!n.ok)return{ok:!1,error:await Cv(n)};let r=await n.json().catch(()=>null);return r?.result?(tu(),{ok:!0,result:r.result}):{ok:!1,error:{kind:`internal`,message:`Malformed apply response`}}},listPacks:async()=>{let e=await fetch(`/api/seed/packs`);if(!e.ok)return{ok:!1,error:{kind:`internal`,message:`HTTP ${e.status}`}};let t=await e.json().catch(()=>null);return!t||!Array.isArray(t.packs)?{ok:!1,error:{kind:`internal`,message:`Malformed listPacks response`}}:{ok:!0,packs:t.packs}}}}var Tv={"knowledge-base":Jh,"software-lifecycle":po,"codebase-wiki":wh,"plain-notes":xg,worldbuilding:kh,"writing-pipeline":og,"entity-vault":ng,okf:Nh};function Ev(e){return Tv[e]??Jh}function Dv(e){let t=(0,$.c)(69),{onPackSelect:n,onCreateBlankFile:r,collapsedPackIds:i,className:a,packs:o}=e,{_:s}=gt(),[c,l]=(0,Q.useState)(null),[u,d]=(0,Q.useState)(null),[f,p]=(0,Q.useState)(!1),m=o===void 0,h,g;t[0]===m?(h=t[1],g=t[2]):(h=()=>{if(!m)return;let e=!1;return(async()=>{try{let t=await wv().listPacks();if(e)return;t.ok?l(t.packs):d(t.error.message)}catch(t){let n=t;if(e)return;d(n instanceof Error?n.message:String(n))}})(),()=>{e=!0}},g=[m],t[0]=m,t[1]=h,t[2]=g),(0,Q.useEffect)(h,g);let _=m?c:o;if(u!==null){let e;t[3]===a?e=t[4]:(e=Y(`rounded-md bg-destructive/10 p-4 text-sm text-destructive`,a),t[3]=a,t[4]=e);let n;t[5]===u?n=t[6]:(n=(0,Z.jsx)(J,{id:`56WWtu`,values:{error:u}}),t[5]=u,t[6]=n);let r;return t[7]!==e||t[8]!==n?(r=(0,Z.jsx)(`div`,{role:`alert`,className:e,children:n}),t[7]=e,t[8]=n,t[9]=r):r=t[9],r}if(_===null){let e;t[10]===a?e=t[11]:(e=Y(`@container/packgrid w-full max-w-5xl`,a),t[10]=a,t[11]=e);let n;t[12]===s?n=t[13]:(n=s({id:`BeWTQy`}),t[12]=s,t[13]=n);let r;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(`div`,{className:`grid gap-4 @sm/packgrid:grid-cols-2 @2xl/packgrid:grid-cols-3`,children:Array.from({length:Object.keys(Tv).length},kv).map(Ov)}),t[14]=r):r=t[14];let i;return t[15]!==e||t[16]!==n||t[17]!==r?(i=(0,Z.jsx)(`div`,{role:`status`,className:e,"aria-busy":`true`,"aria-label":n,children:r}),t[15]=e,t[16]=n,t[17]=r,t[18]=i):i=t[18],i}if(_.length===0){let e;t[19]===a?e=t[20]:(e=Y(`flex w-full max-w-5xl items-center justify-center rounded-2xl border border-dashed border-border/60 bg-muted/20 p-8 text-sm text-muted-foreground`,a),t[19]=a,t[20]=e);let n;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(J,{id:`zLGXna`}),t[21]=n):n=t[21];let r;return t[22]===e?r=t[23]:(r=(0,Z.jsx)(`div`,{role:`status`,className:e,children:n}),t[22]=e,t[23]=r),r}let v;t[24]===i?v=t[25]:(v=i??[],t[24]=i,t[25]=v);let y;t[26]===v?y=t[27]:(y=new Set(v),t[26]=v,t[27]=y);let b=y,x,S,C,w,T,E,D,O,k;if(t[28]!==a||t[29]!==b||t[30]!==f||t[31]!==r||t[32]!==n||t[33]!==_){let e;t[43]===b?e=t[44]:(e=e=>!b.has(e.id),t[43]=b,t[44]=e);let i=_.filter(e),o;t[45]===b?o=t[46]:(o=e=>b.has(e.id),t[45]=b,t[46]=o),C=_.filter(o),S=C.length>0,w=S||r!=null,t[47]===a?k=t[48]:(k=Y(`@container/packgrid w-full max-w-5xl`,a),t[47]=a,t[48]=k),x=fn,T=f,E=p;let s;t[49]===n?s=t[50]:(s=e=>(0,Z.jsx)(Av,{pack:e,onSelect:()=>n(e.id)},e.id),t[49]=n,t[50]=s);let c=i.map(s);t[51]===c?D=t[52]:(D=(0,Z.jsx)(`div`,{className:`grid gap-4 @sm/packgrid:grid-cols-2 @2xl/packgrid:grid-cols-3`,children:c}),t[51]=c,t[52]=D),O=S?(0,Z.jsx)(un,{className:`-mx-1 -mb-1 overflow-hidden px-1 pb-1 data-[state=open]:animate-[collapsible-down_150ms_ease-out] data-[state=closed]:animate-[collapsible-up_150ms_ease-in]`,children:(0,Z.jsx)(`div`,{className:Y(`grid gap-4 @sm/packgrid:grid-cols-2 @2xl/packgrid:grid-cols-3`,`pt-4`),children:C.map(e=>(0,Z.jsx)(Av,{pack:e,onSelect:()=>n(e.id)},e.id))})}):null,t[28]=a,t[29]=b,t[30]=f,t[31]=r,t[32]=n,t[33]=_,t[34]=x,t[35]=S,t[36]=C,t[37]=w,t[38]=T,t[39]=E,t[40]=D,t[41]=O,t[42]=k}else x=t[34],S=t[35],C=t[36],w=t[37],T=t[38],E=t[39],D=t[40],O=t[41],k=t[42];let A;t[53]!==f||t[54]!==S||t[55]!==C||t[56]!==r||t[57]!==w?(A=w?(0,Z.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center justify-between gap-2`,children:[S?(0,Z.jsx)(dn,{asChild:!0,children:(0,Z.jsxs)(X,{type:`button`,variant:`link-muted`,size:`sm`,children:[f?(0,Z.jsx)(J,{id:`6lGV3K`}):(0,Z.jsx)(J,{id:`ymWJLd`,values:{0:C.length}}),(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:Y(`size-3.5 transition-transform`,f&&`rotate-180`)})]})}):(0,Z.jsx)(`span`,{}),r?(0,Z.jsx)(X,{type:`button`,variant:`link-muted`,size:`sm`,onClick:r,children:(0,Z.jsx)(J,{id:`L4Cdd9`,components:{0:(0,Z.jsx)(Jn,{"aria-hidden":`true`,className:`size-3.5`})}})}):null]}):null,t[53]=f,t[54]=S,t[55]=C,t[56]=r,t[57]=w,t[58]=A):A=t[58];let j;t[59]!==x||t[60]!==A||t[61]!==T||t[62]!==E||t[63]!==D||t[64]!==O?(j=(0,Z.jsxs)(x,{open:T,onOpenChange:E,children:[D,O,A]}),t[59]=x,t[60]=A,t[61]=T,t[62]=E,t[63]=D,t[64]=O,t[65]=j):j=t[65];let M;return t[66]!==j||t[67]!==k?(M=(0,Z.jsx)(`div`,{className:k,children:j}),t[66]=j,t[67]=k,t[68]=M):M=t[68],M}function Ov(e){return(0,Z.jsx)(jv,{},`skeleton-${e}`)}function kv(e,t){return t}function Av(e){let t=(0,$.c)(17),{pack:n,onSelect:r}=e,i;t[0]===n.id?i=t[1]:(i=Ev(n.id),t[0]=n.id,t[1]=i);let a=i,o;t[2]===a?o=t[3]:(o=(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`mt-0.5 shrink-0 text-muted-foreground`,children:(0,Z.jsx)(a,{className:`size-3.5`})}),t[2]=a,t[3]=o);let s;t[4]===n.name?s=t[5]:(s=(0,Z.jsx)(`h3`,{className:`min-w-0 wrap-break-word text-sm font-medium leading-tight`,children:n.name}),t[4]=n.name,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-row items-start gap-2`,children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;t[9]===n.description?l=t[10]:(l=(0,Z.jsx)(`p`,{className:`line-clamp-2 text-1sm leading-relaxed text-muted-foreground`,children:n.description}),t[9]=n.description,t[10]=l);let u;t[11]!==c||t[12]!==l?(u=(0,Z.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col gap-2`,children:[c,l]}),t[11]=c,t[12]=l,t[13]=u):u=t[13];let d;return t[14]!==r||t[15]!==u?(d=(0,Z.jsx)(`button`,{type:`button`,onClick:r,className:`group flex h-full min-w-0 flex-col items-start gap-4 rounded-2xl border border-border/60 bg-card p-5 text-left transition-[border-color,box-shadow,transform] hover:border-border hover:shadow-sm focus-visible:border-ring focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px`,children:u}),t[14]=r,t[15]=u,t[16]=d):d=t[16],d}function jv(){let e=(0,$.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(`span`,{className:`size-10 animate-pulse rounded-lg bg-muted`,"aria-hidden":`true`,children:(0,Z.jsx)(Xc,{className:`size-5 animate-spin text-muted-foreground opacity-0`})}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsxs)(`div`,{className:`flex h-full min-h-[200px] flex-col items-start gap-4 rounded-xl border border-border/60 bg-card p-6`,children:[t,(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,children:[(0,Z.jsx)(`div`,{className:`h-4 w-1/2 animate-pulse rounded bg-muted`}),(0,Z.jsx)(`div`,{className:`h-3 w-full animate-pulse rounded bg-muted`}),(0,Z.jsx)(`div`,{className:`h-3 w-4/5 animate-pulse rounded bg-muted`})]}),(0,Z.jsx)(`div`,{className:`mt-auto h-3 w-20 animate-pulse rounded bg-muted`})]}),e[1]=n):n=e[1],n}var Mv=`knowledge-base`;function Nv(e){let t=(0,$.c)(94),{open:n,onOpenChange:r,onSeedApplied:i,initialPackId:a}=e,{_:o}=gt(),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s={kind:`loading`},t[0]=s):s=t[0];let[c,l]=(0,Q.useState)(s),[u,d]=(0,Q.useState)(null),[f,p]=(0,Q.useState)(a??Mv),[m,h]=(0,Q.useState)(`project-root`),[g,_]=(0,Q.useState)(``),[v,y]=(0,Q.useState)(a===void 0?`pick`:`configure`),b=(0,Q.useRef)(!0),x=u?.find(e=>e.id===f),S,C;t[1]!==n||t[2]!==u?(S=()=>{if(!n||u!==null)return;let e=!1;return(async()=>{try{let t=await wv().listPacks();if(e)return;t.ok?d(t.packs):(d([]),l({kind:`error`,message:t.error.message}))}catch(t){let n=t;if(e)return;d([]),l({kind:`error`,message:n instanceof Error?n.message:String(n)})}})(),()=>{e=!0}},C=[n,u],t[1]=n,t[2]=u,t[3]=S,t[4]=C):(S=t[3],C=t[4]),(0,Q.useEffect)(S,C);let w,T;t[5]!==a||t[6]!==n?(w=()=>{n&&(p(a??Mv),h(`project-root`),_(``),y(a===void 0?`pick`:`configure`),l({kind:`loading`}),b.current=!0)},T=[n,a],t[5]=a,t[6]=n,t[7]=w,t[8]=T):(w=t[7],T=t[8]),(0,Q.useEffect)(w,T),(0,Q.useEffect)(()=>{x&&_(x.defaultSubfolder??``)},[x]);let E;t[9]===g?E=t[10]:(E=g.trim(),t[9]=g,t[10]=E);let D=E,O=m===`subfolder`&&D===``,k,A;t[11]!==o||t[12]!==n||t[13]!==u||t[14]!==m||t[15]!==f||t[16]!==v||t[17]!==O||t[18]!==D?(k=()=>{if(!n||v!==`configure`||u===null)return;if(O){l({kind:`error`,message:o({id:`Z8KDox`})});return}let e=m===`project-root`?void 0:D,t=b.current?0:200;b.current=!1;let r=!1,i=setTimeout(()=>{r||(l(Pv),wv().plan({rootDir:e,packId:f}).then(e=>{if(!r){if(!e.ok){l({kind:`error`,message:e.error.message});return}l(e.plan.created.length>0||e.plan.packSkill?.pending===!0?{kind:`plan`,plan:e.plan}:{kind:`already-seeded`,plan:e.plan})}}).catch(e=>{r||l({kind:`error`,message:e instanceof Error?e.message:String(e)})}))},t);return()=>{r=!0,clearTimeout(i)}},A=[n,v,u,f,m,D,O,o],t[11]=o,t[12]=n,t[13]=u,t[14]=m,t[15]=f,t[16]=v,t[17]=O,t[18]=D,t[19]=k,t[20]=A):(k=t[19],A=t[20]),(0,Q.useEffect)(k,A);let j=async function(){if(c.kind!==`plan`)return;let e=c.plan;l({kind:`applying`,plan:e});let t;try{t=await wv().apply(e,{packId:f})}catch(t){let n=t,r=n instanceof Error?n.message:String(n);gl.error(o({id:`iqugog`,values:{errorDetail:r}})),l({kind:`plan`,plan:e});return}if(t.ok){let n=x?.name??o({id:`W8vpBM`}),a=t.result.applied,s=e.packSkill?.pending===!0,c=o(a>0?{id:`x3-2ta`,values:{packName:n,projectEntries:a}}:s?{id:`B2Srgd`,values:{packName:n}}:{id:`K6jjWB`,values:{packName:n}});gl.success(c),i?.(),r(!1)}else{let n=t.error.message;gl.error(o({id:`iqugog`,values:{errorDetail:n}})),l({kind:`plan`,plan:e})}},M=a!==void 0,N=x?.name,P=o(v===`configure`&&x?{id:`hxEUVJ`,values:{selectedPackName:N}}:{id:`RGkNeJ`}),F;t[21]===o?F=t[22]:(F=o({id:`gvApb7`}),t[21]=o,t[22]=F);let I;t[23]===o?I=t[24]:(I=o({id:`hCOLSd`}),t[23]=o,t[24]=I);let L;t[25]===o?L=t[26]:(L=o({id:`Fy4GgU`}),t[25]=o,t[26]=L);let R;t[27]===o?R=t[28]:(R=o({id:`Qw-7Ie`}),t[27]=o,t[28]=R);let z;t[29]===o?z=t[30]:(z=o({id:`_ayOfA`}),t[29]=o,t[30]=z);let B;t[31]===o?B=t[32]:(B=o({id:`Zf0w-R`}),t[31]=o,t[32]=B);let V;t[33]===o?V=t[34]:(V=o({id:`hmYd9H`}),t[33]=o,t[34]=V);let H;t[35]===o?H=t[36]:(H=o({id:`VBE2dw`}),t[35]=o,t[36]=H);let U;t[37]!==F||t[38]!==I||t[39]!==L||t[40]!==R||t[41]!==z||t[42]!==B||t[43]!==V||t[44]!==H?(U={"knowledge-base":F,"software-lifecycle":I,"codebase-wiki":L,"plain-notes":R,okf:z,"writing-pipeline":B,"entity-vault":V,worldbuilding:H},t[37]=F,t[38]=I,t[39]=L,t[40]=R,t[41]=z,t[42]=B,t[43]=V,t[44]=H,t[45]=U):U=t[45];let W=U,G;t[46]!==o||t[47]!==W||t[48]!==x||t[49]!==v?(G=v===`configure`&&x?W[x.id]??x.description:o({id:`msqUNq`}),t[46]=o,t[47]=W,t[48]=x,t[49]=v,t[50]=G):G=t[50];let K=G,ee;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(ee=function(e){p(e),y(`configure`),b.current=!0},t[51]=ee):ee=t[51];let te=ee,ne;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(ne=function(){y(`pick`),l({kind:`loading`}),b.current=!0},t[52]=ne):ne=t[52];let q=ne,re;t[53]===P?re=t[54]:(re=(0,Z.jsx)(mn,{children:P}),t[53]=P,t[54]=re);let ie;t[55]===K?ie=t[56]:(ie=(0,Z.jsx)(pn,{children:K}),t[55]=K,t[56]=ie);let ae;t[57]!==re||t[58]!==ie?(ae=(0,Z.jsxs)(vn,{children:[re,ie]}),t[57]=re,t[58]=ie,t[59]=ae):ae=t[59];let oe;t[60]!==u||t[61]!==c||t[62]!==m||t[63]!==x||t[64]!==v||t[65]!==g?(oe=v===`pick`?(0,Z.jsx)(gn,{children:(0,Z.jsx)(Dv,{packs:u,onPackSelect:te})}):(0,Z.jsxs)(gn,{className:`space-y-6`,children:[(0,Z.jsx)(Fv,{choice:m,subfolder:g,placeholder:x?.defaultSubfolder??`subfolder`,onChoiceChange:h,onSubfolderChange:_}),(0,Z.jsx)(Iv,{phase:c,selectedPack:x})]}),t[60]=u,t[61]=c,t[62]=m,t[63]=x,t[64]=v,t[65]=g,t[66]=oe):oe=t[66];let se;t[67]!==M||t[68]!==v?(se=v===`configure`&&!M?(0,Z.jsxs)(X,{className:`mr-auto uppercase font-mono`,variant:`ghost`,onClick:q,children:[(0,Z.jsx)(In,{"aria-hidden":`true`,className:`h-4 w-4`}),(0,Z.jsx)(J,{id:`iH8pgl`})]}):null,t[67]=M,t[68]=v,t[69]=se):se=t[69];let ce;t[70]===r?ce=t[71]:(ce=()=>r(!1),t[70]=r,t[71]=ce);let le;t[72]===c.kind?le=t[73]:(le=c.kind===`already-seeded`||c.kind===`error`?(0,Z.jsx)(J,{id:`yz7wBu`}):(0,Z.jsx)(J,{id:`dEgA5A`}),t[72]=c.kind,t[73]=le);let ue;t[74]!==ce||t[75]!==le?(ue=(0,Z.jsx)(X,{className:`uppercase font-mono`,variant:`outline`,onClick:ce,children:le}),t[74]=ce,t[75]=le,t[76]=ue):ue=t[76];let de;t[77]!==j||t[78]!==c.kind||t[79]!==v||t[80]!==O?(de=v===`configure`&&c.kind===`plan`?(0,Z.jsx)(X,{onClick:j,disabled:O,children:(0,Z.jsx)(J,{id:`4TzU0n`})}):v===`configure`&&c.kind===`applying`?(0,Z.jsxs)(X,{disabled:!0,children:[(0,Z.jsx)(Xc,{"aria-hidden":`true`,className:`h-4 w-4 animate-spin`}),(0,Z.jsx)(J,{id:`XYlJJT`})]}):null,t[77]=j,t[78]=c.kind,t[79]=v,t[80]=O,t[81]=de):de=t[81];let fe;t[82]!==se||t[83]!==ue||t[84]!==de?(fe=(0,Z.jsxs)(_n,{children:[se,ue,de]}),t[82]=se,t[83]=ue,t[84]=de,t[85]=fe):fe=t[85];let pe;t[86]!==ae||t[87]!==oe||t[88]!==fe?(pe=(0,Z.jsxs)(hn,{className:`sm:max-w-4xl`,"data-ok-layer-spawned":``,children:[ae,oe,fe]}),t[86]=ae,t[87]=oe,t[88]=fe,t[89]=pe):pe=t[89];let me;return t[90]!==r||t[91]!==n||t[92]!==pe?(me=(0,Z.jsx)(yn,{open:n,onOpenChange:r,children:pe}),t[90]=r,t[91]=n,t[92]=pe,t[93]=me):me=t[93],me}function Pv(e){return e.kind===`plan`||e.kind===`already-seeded`?e:{kind:`loading`}}function Fv(e){let t=(0,$.c)(22),{choice:n,subfolder:r,placeholder:i,onChoiceChange:a,onSubfolderChange:o}=e,{_:s}=gt(),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(`p`,{className:`text-sm font-medium`,children:(0,Z.jsx)(J,{id:`3wiBAs`})}),t[0]=c):c=t[0];let l;t[1]===a?l=t[2]:(l=e=>a(e),t[1]=a,t[2]=l);let u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(ol,{children:(0,Z.jsx)(J,{id:`RSqaSd`})}),t[3]=u):u=t[3];let d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(il,{htmlFor:`seed-root-project-root`,children:(0,Z.jsxs)(sl,{orientation:`horizontal`,children:[(0,Z.jsxs)(rl,{children:[u,(0,Z.jsx)(al,{className:`text-1sm`,children:(0,Z.jsx)(J,{id:`ZvzbDF`})})]}),(0,Z.jsx)(zr,{value:`project-root`,id:`seed-root-project-root`})]})}),t[4]=d):d=t[4];let f;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(ol,{children:(0,Z.jsx)(J,{id:`ZWgr0b`})}),t[5]=f):f=t[5];let p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsx)(al,{className:`nth-last-2:mt-0 text-1sm`,children:(0,Z.jsx)(J,{id:`KQGZuq`})}),t[6]=p):p=t[6];let m;t[7]!==s||t[8]!==n||t[9]!==o||t[10]!==i||t[11]!==r?(m=n===`subfolder`&&(0,Z.jsx)(Sl,{value:r,onChange:e=>o(e.target.value),placeholder:i,"aria-label":s({id:`NYUhy5`}),spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,className:`mt-1.5 font-mono text-xs bg-background`}),t[7]=s,t[8]=n,t[9]=o,t[10]=i,t[11]=r,t[12]=m):m=t[12];let h;t[13]===m?h=t[14]:(h=(0,Z.jsxs)(rl,{children:[f,p,m]}),t[13]=m,t[14]=h);let g;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Z.jsx)(zr,{value:`subfolder`,id:`seed-root-subfolder`}),t[15]=g):g=t[15];let _;t[16]===h?_=t[17]:(_=(0,Z.jsx)(il,{htmlFor:`seed-root-subfolder`,children:(0,Z.jsxs)(sl,{orientation:`horizontal`,children:[h,g]})}),t[16]=h,t[17]=_);let v;return t[18]!==n||t[19]!==_||t[20]!==l?(v=(0,Z.jsxs)(`div`,{className:`space-y-2 py-1`,children:[c,(0,Z.jsxs)(Br,{className:`sm:flex`,value:n,onValueChange:l,children:[d,_]})]}),t[18]=n,t[19]=_,t[20]=l,t[21]=v):v=t[21],v}function Iv(e){let t=(0,$.c)(19),{phase:n,selectedPack:r}=e,{_:i}=gt();if(n.kind===`loading`){let e=r?.folders.length??6,n;t[0]===i?n=t[1]:(n=i({id:`--T3kB`}),t[0]=i,t[1]=n);let a;t[2]===e?a=t[3]:(a=(0,Z.jsx)(`ul`,{className:`space-y-2`,children:Array.from({length:e},zv).map(Rv)}),t[2]=e,t[3]=a);let o;return t[4]!==n||t[5]!==a?(o=(0,Z.jsx)(`section`,{role:`status`,"aria-busy":`true`,"aria-label":n,children:a}),t[4]=n,t[5]=a,t[6]=o):o=t[6],o}if(n.kind===`error`){let e;return t[7]===n.message?e=t[8]:(e=(0,Z.jsx)(`div`,{className:`rounded-md bg-destructive/10 p-3 text-sm text-destructive`,children:n.message}),t[7]=n.message,t[8]=e),e}if(n.kind===`already-seeded`){let e;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(`p`,{className:`font-medium`,children:(0,Z.jsx)(J,{id:`YwPUUP`})}),t[9]=e):e=t[9];let n;return t[10]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsxs)(`div`,{className:`py-2 text-sm`,children:[e,(0,Z.jsx)(`p`,{className:`text-muted-foreground`,children:(0,Z.jsx)(J,{id:`h-AdvS`})})]}),t[10]=n):n=t[10],n}let a;t[11]!==n.plan||t[12]!==r?(a=n.plan.created.length>0||n.plan.packSkill?.pending?(0,Z.jsx)(hv,{plan:n.plan,selectedPack:r}):null,t[11]=n.plan,t[12]=r,t[13]=a):a=t[13];let o;t[14]===n.plan.warnings?o=t[15]:(o=n.plan.warnings.length>0?(0,Z.jsx)(`div`,{className:`rounded-md bg-warning/10 p-3 text-xs text-warning-foreground`,children:n.plan.warnings.map(Lv)}):null,t[14]=n.plan.warnings,t[15]=o);let s;return t[16]!==a||t[17]!==o?(s=(0,Z.jsxs)(`div`,{className:`space-y-6 py-1 text-sm`,children:[a,o]}),t[16]=a,t[17]=o,t[18]=s):s=t[18],s}function Lv(e){return(0,Z.jsx)(`p`,{children:e},e)}function Rv(e){return(0,Z.jsxs)(`li`,{"aria-hidden":`true`,className:`flex items-center gap-3`,children:[(0,Z.jsx)(`div`,{className:`size-8 shrink-0 animate-pulse rounded-lg bg-muted`}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1 py-0.5`,children:[(0,Z.jsx)(`span`,{className:`block h-3.5 w-28 animate-pulse rounded bg-muted`}),(0,Z.jsx)(`span`,{className:`mt-2 block h-3 w-4/5 animate-pulse rounded bg-muted`})]})]},`seed-skeleton-${e}`)}function zv(e,t){return t}function Bv(){return(0,Q.useSyncExternalStore)(ud,dd,dd)}function Vv(e,t){return e instanceof Error&&e.message?e.message:t}async function Hv(e,t,n,r=`action`){try{n(null),await e()}catch(e){console.error(`[${r}] action failed:`,e),n(Vv(e,t))}}async function Uv(e,t,n=gl,r=`action`){await Hv(e,t,e=>{e!==null&&n.error(e)},r)}var Wv=(0,Q.createContext)(!1);function Gv(e){let t=(0,$.c)(5),{children:n}=e,[r,i]=(0,Q.useState)(qv),a,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>{if(window.okDesktop)return;let e=new AbortController;return ju(e.signal).then(t=>{e.signal.aborted||t.status!==`ok`||i(t.config.singleFile)}).catch(Kv),()=>e.abort()},o=[],t[0]=a,t[1]=o):(a=t[0],o=t[1]),(0,Q.useEffect)(a,o);let s;return t[2]!==n||t[3]!==r?(s=(0,Z.jsx)(Wv,{value:r,children:n}),t[2]=n,t[3]=r,t[4]=s):s=t[4],s}function Kv(){}function qv(){return typeof window<`u`?window.okDesktop?.config.singleFile??!1:!1}function Jv(){return(0,Q.use)(Wv)}function Yv(e,t,n){let r=[],i=new Set,a=new Set,o=t!==null&&t.mainRoot===e.project.mainRoot;e.projectSynthesized||(r.push({branch:e.project.branch??null,path:e.project.path,opened:!0,isMain:!0,isCurrent:e.project.path===n}),i.add(e.project.path),e.project.branch!=null&&a.add(e.project.branch));let s=[...e.worktrees].sort((e,t)=>t.lastOpenedAt.localeCompare(e.lastOpenedAt));for(let e of s)i.has(e.path)||(r.push({branch:e.branch??null,path:e.path,opened:!0,isMain:!1,isCurrent:e.path===n}),i.add(e.path),e.branch!=null&&a.add(e.branch));if(o){let e=t.entries.filter(e=>e.branch!==null&&!a.has(e.branch)&&(e.worktreePath===null||!i.has(e.worktreePath))).sort((e,t)=>(e.branch??``).localeCompare(t.branch??``));for(let t of e)r.push({branch:t.branch,path:t.worktreePath,opened:t.worktreePath!==null,isMain:t.isMain,isCurrent:t.isCurrent}),t.branch!=null&&a.add(t.branch),t.worktreePath!=null&&i.add(t.worktreePath)}return r.sort((e,t)=>Xv(e)-Xv(t))}function Xv(e){return e.isMain?0:e.opened?1:2}function Zv(e){let t=e.split(/[/\\]/).filter(e=>e.length>0);return t.length>0?t[t.length-1]??e:e}function Qv(e){let t=[],n=new Map;for(let r of e){let e=r.gitCommonDir,i=r.mainRoot;if(e===void 0||i===void 0){t.push({project:r,mainRoot:r.path,worktrees:[]});continue}let a=n.get(e);a===void 0&&(a=t.length,n.set(e,a),t.push({project:null,mainRoot:i,worktrees:[]}));let o=t[a];o!==void 0&&(r.isLinkedWorktree?o.worktrees.push(r):o.project===null&&(o.project=r))}return t.map(e=>{let t=e.project===null;return{project:e.project??{path:e.mainRoot,name:Zv(e.mainRoot),lastOpenedAt:``},worktrees:e.worktrees,projectSynthesized:t}})}function $v(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(Jm,{"data-slot":`context-menu`,...n}),t[2]=n,t[3]=r),r}function ey(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Y(`select-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(Ym,{"data-slot":`context-menu-trigger`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ty(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(Qm,{"data-slot":`context-menu-group`,...n}),t[2]=n,t[3]=r),r}function ny(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(ih,{"data-slot":`context-menu-sub`,...n}),t[2]=n,t[3]=r),r}function ry(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Y(`z-50 max-h-(--radix-context-menu-content-available-height) min-w-36 origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(Xm,{children:(0,Z.jsx)(Zm,{"data-slot":`context-menu-content`,className:i,...r})}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function iy(e){let t=(0,$.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,inset:r,variant:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s;t[5]===n?s=t[6]:(s=Y(`group/context-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive`,n),t[5]=n,t[6]=s);let c;return t[7]!==r||t[8]!==i||t[9]!==s||t[10]!==o?(c=(0,Z.jsx)(eh,{"data-slot":`context-menu-item`,"data-inset":r,"data-variant":o,className:s,...i}),t[7]=r,t[8]=i,t[9]=s,t[10]=o,t[11]=c):c=t[11],c}function ay(e){let t=(0,$.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,inset:i,children:n,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===r?o=t[6]:(o=Y(`flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,r),t[5]=r,t[6]=o);let s;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(Ho,{className:`ml-auto`}),t[7]=s):s=t[7];let c;return t[8]!==n||t[9]!==i||t[10]!==a||t[11]!==o?(c=(0,Z.jsxs)(ah,{"data-slot":`context-menu-sub-trigger`,"data-inset":i,className:o,...a,children:[n,s]}),t[8]=n,t[9]=i,t[10]=a,t[11]=o,t[12]=c):c=t[12],c}function oy(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Y(`z-50 max-h-(--radix-context-menu-content-available-height) min-w-32 origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border bg-popover p-1 text-popover-foreground shadow-lg data-[state=closed]:overflow-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0 subtle-scrollbar`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(oh,{"data-slot":`context-menu-sub-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function sy(e){let t=(0,$.c)(15),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:i,children:r,checked:n,inset:a,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s;t[6]===i?s=t[7]:(s=Y(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,i),t[6]=i,t[7]=s);let c;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(`span`,{className:`pointer-events-none absolute right-2`,children:(0,Z.jsx)(nh,{children:(0,Z.jsx)(zo,{})})}),t[8]=c):c=t[8];let l;return t[9]!==n||t[10]!==r||t[11]!==a||t[12]!==o||t[13]!==s?(l=(0,Z.jsxs)(th,{"data-slot":`context-menu-checkbox-item`,"data-inset":a,className:s,checked:n,...o,children:[c,r]}),t[9]=n,t[10]=r,t[11]=a,t[12]=o,t[13]=s,t[14]=l):l=t[14],l}function cy(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,inset:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=Y(`px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==i||t[8]!==a?(o=(0,Z.jsx)($m,{"data-slot":`context-menu-label`,"data-inset":r,className:a,...i}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9],o}function ly(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Y(`-mx-1 my-1 h-px bg-border`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(rh,{"data-slot":`context-menu-separator`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function uy(e){let t=(0,$.c)(14),{path:n,name:r,onRemoveRecent:i,testIdPrefix:a}=e,{_:o}=gt(),s;t[0]!==o||t[1]!==r?(s=o({id:`Y6PKd1`,values:{name:r}}),t[0]=o,t[1]=r,t[2]=s):s=t[2];let c;t[3]===o?c=t[4]:(c=o({id:`Es-eZU`}),t[3]=o,t[4]=c);let l;t[5]!==i||t[6]!==n?(l=e=>{e.stopPropagation(),i(n)},t[5]=i,t[6]=n,t[7]=l):l=t[7];let u=`${a}-remove-${n}`,d;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(hl,{"aria-hidden":`true`,className:`size-3.5`}),t[8]=d):d=t[8];let f;return t[9]!==s||t[10]!==c||t[11]!==l||t[12]!==u?(f=(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-sm`,tabIndex:-1,"aria-hidden":`true`,"aria-label":s,title:c,onClick:l,className:`absolute top-1/2 right-1 size-6 -translate-y-1/2 text-muted-foreground opacity-0 transition-opacity group-hover/recent:opacity-100 focus-visible:opacity-100`,"data-testid":u,children:d}),t[9]=s,t[10]=c,t[11]=l,t[12]=u,t[13]=f):f=t[13],f}function dy(e){let t=(0,$.c)(13),{path:n,onRemoveRecent:r,testIdPrefix:i,children:a}=e,o;t[0]===a?o=t[1]:(o=(0,Z.jsx)(ey,{asChild:!0,children:a}),t[0]=a,t[1]=o);let s;t[2]!==r||t[3]!==n?(s=()=>r(n),t[2]=r,t[3]=n,t[4]=s):s=t[4];let c=`${i}-context-remove-${n}`,l,u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(hl,{"aria-hidden":`true`}),u=(0,Z.jsx)(J,{id:`Es-eZU`}),t[5]=l,t[6]=u):(l=t[5],u=t[6]);let d;t[7]!==s||t[8]!==c?(d=(0,Z.jsx)(ry,{children:(0,Z.jsxs)(iy,{onSelect:s,"data-testid":c,children:[l,u]})}),t[7]=s,t[8]=c,t[9]=d):d=t[9];let f;return t[10]!==o||t[11]!==d?(f=(0,Z.jsxs)($v,{children:[o,d]}),t[10]=o,t[11]=d,t[12]=f):f=t[12],f}var fy=(0,Q.lazy)(()=>n(()=>import(`./BugReportHistoryDialog-BZO4T3mM.js`),__vite__mapDeps([45,10,1,11,12,23,14,15,16,17,24,25,26,22,27,34,35,36,37,33,38,39]),import.meta.url)),py=3e3,my=600,hy=20,gy=(e,t,n)=>Uv(e,t,n,`CommandPalette`);function _y(e){window.location.assign(Cu(e))}function vy(e,t){return e?.kind===`folder`||e?.kind===`folder-index`?e.folderPath:Hl(t)}function yy(e){let t=(0,$.c)(27),{entry:n,query:r,onSelect:i,disabled:a}=e,o=r===void 0?``:r,s=a===void 0?!1:a,c;t[0]===n?c=t[1]:(c=`title`in n&&n.title?n.title:n.path.split(`/`).pop()??n.path,t[0]=n,t[1]=c);let l=c,u=`snippet`in n?n.snippet:void 0,d=`docExt`in n?n.docExt:void 0,f=`bodyIndexed`in n?n.bodyIndexed:void 0,p=`${n.kind} ${n.path}`,m=`command-palette-nav-${n.kind}-${n.path}`,h;t[2]!==f||t[3]!==d||t[4]!==n.kind||t[5]!==n.path?(h=(0,Z.jsx)(B,{bodyIndexed:f,className:`mt-0.5 size-4`,docExt:d,kind:n.kind,path:n.path}),t[2]=f,t[3]=d,t[4]=n.kind,t[5]=n.path,t[6]=h):h=t[6];let _;t[7]!==o||t[8]!==l?(_=(0,Z.jsx)(`span`,{className:`truncate font-medium`,children:(0,Z.jsx)(xy,{query:o,text:l})}),t[7]=o,t[8]=l,t[9]=_):_=t[9];let v;t[10]!==n.path||t[11]!==o?(v=(0,Z.jsx)(`span`,{className:`truncate text-muted-foreground text-xs`,children:(0,Z.jsx)(xy,{query:o,text:n.path})}),t[10]=n.path,t[11]=o,t[12]=v):v=t[12];let y;t[13]!==o||t[14]!==u?(y=u?(0,Z.jsx)(`span`,{className:`max-h-10 overflow-hidden text-muted-foreground text-xs leading-relaxed`,children:(0,Z.jsx)(xy,{query:o,text:u})}):null,t[13]=o,t[14]=u,t[15]=y):y=t[15];let b;t[16]!==_||t[17]!==v||t[18]!==y?(b=(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[_,v,y]}),t[16]=_,t[17]=v,t[18]=y,t[19]=b):b=t[19];let x;return t[20]!==s||t[21]!==i||t[22]!==b||t[23]!==p||t[24]!==m||t[25]!==h?(x=(0,Z.jsxs)(g,{value:p,onSelect:i,disabled:s,"data-testid":m,className:`items-start`,children:[h,b]}),t[20]=s,t[21]=i,t[22]=b,t[23]=p,t[24]=m,t[25]=h,t[26]=x):x=t[26],x}function by(e){let t=(0,$.c)(5),{mode:n,inExclusiveMode:r,paletteModeKind:i}=e;if(r||i!==`normal`||n===`idle`||n===`content`)return null;let a=`command-palette-search-hint-${n}`,o;t[0]===n?o=t[1]:(o=n===`name-only`?(0,Z.jsx)(J,{id:`GuLeuE`,values:{0:Pl(`find`)},components:{0:(0,Z.jsx)(p,{"aria-label":jl(`find`)})}}):n===`truncated`?(0,Z.jsx)(J,{id:`-q4abP`}):(0,Z.jsx)(J,{id:`DbILZA`}),t[0]=n,t[1]=o);let s;return t[2]!==a||t[3]!==o?(s=(0,Z.jsx)(`div`,{"aria-live":`polite`,"data-testid":a,className:`border-t px-3 py-2 text-muted-foreground text-xs`,children:o}),t[2]=a,t[3]=o,t[4]=s):s=t[4],s}function xy(e){let t=(0,$.c)(5),{text:n,query:r}=e,i;t[0]!==r||t[1]!==n?(i=I_(n,r).map(Sy),t[0]=r,t[1]=n,t[2]=i):i=t[2];let a;return t[3]===i?a=t[4]:(a=(0,Z.jsx)(Z.Fragment,{children:i}),t[3]=i,t[4]=a),a}function Sy(e){let t=`${e.start}:${e.match?`match`:`plain`}`;return e.match?(0,Z.jsx)(`mark`,{className:`rounded-sm bg-primary/10 px-0.5 font-semibold text-primary`,children:e.text},t):(0,Z.jsx)(`span`,{children:e.text},t)}function Cy({searchResults:e,fallbackSearchResults:t,searchStatus:n}){return e.length>0?e:n===`success`?[]:t}function wy(e){let t=(0,$.c)(146),{bridge:n,open:r,onOpenChange:i}=e,a=n===void 0?null:n,{_:o}=gt(),s=Jv(),[c,l]=(0,Q.useState)(``),u=(0,Q.useDeferredValue)(c),d=u.trim(),f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=[],t[0]=f):f=t[0];let[m,h]=(0,Q.useState)(f),[_,v]=(0,Q.useState)(`idle`),[y,b]=(0,Q.useState)(!1),[x,C]=(0,Q.useState)(!1),[w,T]=(0,Q.useState)(!1),E;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(E=[],t[1]=E):E=t[1];let[D,k]=(0,Q.useState)(E),[j,N]=(0,Q.useState)(null),[P,F]=(0,Q.useState)(`idle`),L;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(L=[],t[2]=L):L=t[2];let[R,z]=(0,Q.useState)(L),B;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(B=[],t[3]=B):B=t[3];let[V,H]=(0,Q.useState)(B),[U,W]=(0,Q.useState)(null),[G,K]=(0,Q.useState)(!1),[ee,te]=(0,Q.useState)(!1),[ne,q]=(0,Q.useState)(!1),[re,ie]=(0,Q.useState)(!1),[ae,oe]=(0,Q.useState)(!1),[se,ce]=(0,Q.useState)(!1),le;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(le=[],t[4]=le):le=t[4];let[ue,de]=(0,Q.useState)(le),[fe,pe]=(0,Q.useState)(`idle`),me;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(me=[],t[5]=me):me=t[5];let[he,ge]=(0,Q.useState)(me),[_e,ve]=(0,Q.useState)(`idle`),ye=(0,Q.useRef)(!1),be=(0,Q.useRef)(null),xe=(0,Q.useRef)(null),Se=(0,Q.useRef)(null),Ce=(0,Q.useRef)(null),{activeDocName:we,activeTarget:Te}=Ye(),{pages:Ee,pageTitles:De,pageMeta:Oe,folderPaths:ke,filePaths:Ae,loading:Me}=Go(),Ne=fd(),{states:Pe,refresh:Fe}=as(),{dispatch:Ie}=$o(),Le;t[6]===r?Le=t[7]:(Le={enabled:r},t[6]=r,t[7]=Le);let{status:Re,refresh:ze}=Ns(Le),Be=(Re?.enabled??!1)&&(Re?.keyPresent??!1),Ve=Re?.embedded??0,He=Re?.total??0,Ue=Be&&He>0&&Ve<He,We;t[8]!==w||t[9]!==r||t[10]!==ze||t[11]!==Ue?(We=()=>{if(!r||!w||!Ue)return;let e=window.setInterval(()=>ze(),2500);return()=>window.clearInterval(e)},t[8]=w,t[9]=r,t[10]=ze,t[11]=Ue,t[12]=We):We=t[12];let Ge;t[13]!==w||t[14]!==r||t[15]!==Ue?(Ge=[r,w,Ue],t[13]=w,t[14]=r,t[15]=Ue,t[16]=Ge):Ge=t[16],(0,Q.useEffect)(We,Ge);let Ke=ls({docName:we,workspace:Ne}),qe=k_(Ee,ke,De,Oe,Ae),Je=x_(V,new Set(qe.map(Oy))),Xe=a?.config.projectPath??null,Ze=a?R.filter(e=>e.path!==Xe):[],Qe=Bv(),$e=a&&Qe?Qe.entries.filter(Dy):[],et;t[17]!==we||t[18]!==Te?(et=vy(Te,we),t[17]=we,t[18]=Te,t[19]=et):et=t[19];let tt=et,nt=d===``?[]:P_(qe,d,8),rt,it;t[20]!==i||t[21]!==r?(rt=()=>{let e=function(e){El(e,`command-palette`)&&(e.preventDefault(),i(!r))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},it=[i,r],t[20]=i,t[21]=r,t[22]=rt,t[23]=it):(rt=t[22],it=t[23]),(0,Q.useEffect)(rt,it);let at,ot;t[24]!==o||t[25]!==a||t[26]!==r||t[27]!==Fe?(at=()=>{if(r){if(H(v_()),Fe(),a){let e=!1;return gy(async()=>{let t=await a.project.listRecent();e||z(t)},o({id:`fYKgzG`})),()=>{e=!0}}return}l(``),de([]),pe(`idle`),ye.current=!1,ge([]),ve(`idle`),T(!1),Se.current?.abort(),Se.current=null,Ce.current!==null&&(window.clearTimeout(Ce.current),Ce.current=null),k([]),N(null),F(`idle`)},ot=[r,a,Fe,o],t[24]=o,t[25]=a,t[26]=r,t[27]=Fe,t[28]=at,t[29]=ot):(at=t[28],ot=t[29]),(0,Q.useEffect)(at,ot);let st;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(st=()=>{be.current&&(be.current.scrollTop=0)},t[30]=st):st=t[30];let ct;t[31]===c?ct=t[32]:(ct=[c],t[31]=c,t[32]=ct),(0,Q.useEffect)(st,ct);let lt=new Set(ue.map(Ey)),ut=w?{kind:`normal`,query:u}:U_(u,lt),dt=ut.kind!==`normal`,ft=dt||w,pt=ut.kind===`tag-list`?ut.query:``,mt=ut.kind===`tag-docs`?ut.tagName:``,ht=c.trim(),_t=w?V_({query:ht,firedQuery:j,status:P,resultCount:D.length}):null,vt=_t?.submit?.query??``,yt=_t?.results.forQuery??``,bt,xt;t[33]!==dt||t[34]!==r?(bt=()=>{if(!r||!dt||ye.current)return;ye.current=!0,pe(`loading`);let e=!1;return G_().then(t=>{e||(de(t),pe(`success`))}).catch(t=>{e||(console.error(`[command-palette-tag] fetch tags failed`,t),de([]),pe(`error`))}),()=>{e=!0}},xt=[r,dt],t[33]=dt,t[34]=r,t[35]=bt,t[36]=xt):(bt=t[35],xt=t[36]),(0,Q.useEffect)(bt,xt);let St=ut.kind===`tag-docs`?ut.tagName:null;(0,Q.useEffect)(()=>{if(!r||St===null){ge([]),ve(`idle`);return}ve(`loading`),ge([]);let e=!1;return K_(St).then(t=>{e||(ge(t),ve(`success`))}).catch(t=>{e||(console.error(`[command-palette-tag] fetch tag docs failed`,t),ge([]),ve(`error`))}),()=>{e=!0}},[r,St]),(0,Q.useEffect)(()=>{if(!r||!d||ft||Me){h([]),v(`idle`),b(!1),C(!1);return}let e=!1,t=!1,n=0,i=null,a,o;v(`loading`);let s=()=>e||n>=hy?!1:(n+=1,o=window.setTimeout(l,my),!0),c=()=>{e||t&&s()||(h([]),v(`error`),b(!1),C(!1))};function l(){let n=new AbortController;i=n,a=window.setTimeout(()=>{n.abort(),c()},py),R_(d,{signal:n.signal}).then(n=>{let{entries:r,truncated:i,ready:o}=n;if(window.clearTimeout(a),!e){if(!o){t||(t=!0,h([]),b(!1),C(!0),v(`success`)),s()||C(!1);return}h(r),b(i),C(!1),v(`success`)}}).catch(t=>{window.clearTimeout(a),!e&&(t instanceof Error&&t.name===`AbortError`||c())})}return l(),()=>{e=!0,window.clearTimeout(a),window.clearTimeout(o),i?.abort()}},[r,d,ft,Me]);let Ct;t[37]!==o||t[38]!==i?(Ct=(e,t)=>{let n=t===void 0?o({id:`uuoHOU`}):t;i(!1),gy(async()=>{await e()},n)},t[37]=o,t[38]=i,t[39]=Ct):Ct=t[39];let wt=Ct,Tt;t[40]!==o||t[41]!==a?(Tt=e=>{a&&gy(async()=>{await a.project.removeRecent(e),z(t=>t.filter(t=>t.path!==e))},o({id:`viwC-K`}))},t[40]=o,t[41]=a,t[42]=Tt):Tt=t[42];let Et=Tt,Dt;t[43]!==o||t[44]!==a||t[45]!==wt?(Dt=e=>{if(!a)return;let t=e.worktreePath;if(t!==null){wt(()=>a.project.open({path:t,target:`new-window`,entryPoint:`worktree`}),o({id:`LwMxXg`}));return}let n=e.branch;n!==null&&wt(async()=>{let e=await a.worktree.create({branch:n,createBranch:!1});if(!e.ok)throw Error(e.reason);ld(),await a.project.open({path:e.path,target:`new-window`,entryPoint:`worktree`})},o({id:`LwMxXg`}))},t[43]=o,t[44]=a,t[45]=wt,t[46]=Dt):Dt=t[46];let Ot=Dt,kt;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(kt=function(e){let t={kind:e.kind,path:e.path,lastOpenedAt:new Date().toISOString()},n=b_(v_(),t);y_(n),H(n)},t[47]=kt):kt=t[47];let At=kt,jt;t[48]===i?jt=t[49]:(jt=function(e){i(!1),At(e),_y(e.path)},t[48]=i,t[49]=jt);let Mt=jt,Nt=!ft&&d===``&&Je.length>0,Pt=Cy({searchResults:m,fallbackSearchResults:nt,searchStatus:_}),Ft=!ft&&Pt.length>0,It=!ft&&d!==``&&(Me||x)&&!Ft,Lt=!ft&&d!==``&&_===`loading`&&!Ft&&!It,Rt=!ft&&a!==null&&Ze.length>0&&(d===``||Ze.some(e=>z_(`${e.name} ${e.path}`,u,[`open recent project`]))),zt=$e.filter(e=>d===``||z_(e.branch??``,u,[`worktree branch`])),Bt=!ft&&a!==null&&zt.length>0,Vt=ec(),Ht=!ft&&!Vt&&Ke!==null&&(d===``||Zr.some(e=>{let t=e.displayName;return z_(o({id:`WqLq6M`,values:{displayName:t}}),u,[e.id,`agent handoff`,`open in`])})),Ut=ut.kind===`tag-list`?W_(ue,ut.query):[],Wt=ut.kind===`tag-list`&&fe!==`loading`&&Ut.length===0,Gt=ut.kind===`tag-docs`&&_e===`success`&&he.length===0,qt=Cc(),Jt;t[50]===i?Jt=t[51]:(Jt=e=>{i(!1),Kt(e)},t[50]=i,t[51]=Jt);let Yt=Jt,Xt;t[52]!==a||t[53]!==i?(Xt=e=>{i(!1),sd(e,a?{okDesktop:{shell:a.shell}}:{okDesktop:void 0})},t[52]=a,t[53]=i,t[54]=Xt):Xt=t[54];let Zt=Xt,Qt;t[55]===i?Qt=t[56]:(Qt=()=>i(!1),t[55]=i,t[56]=Qt);let $t;t[57]===W?$t=t[58]:($t=e=>W(e),t[57]=W,t[58]=$t);let X;t[59]===K?X=t[60]:(X=()=>K(!0),t[59]=K,t[60]=X);let en;t[61]===te?en=t[62]:(en=()=>te(!0),t[61]=te,t[62]=en);let tn;t[63]===q?tn=t[64]:(tn=()=>q(!0),t[63]=q,t[64]=tn);let nn;t[65]===ie?nn=t[66]:(nn=()=>{oe(!0),ie(!0)},t[65]=ie,t[66]=nn);let rn;t[67]===ce?rn=t[68]:(rn=()=>ce(!0),t[67]=ce,t[68]=rn);let an={bridge:a,singleFile:s,activeDocName:we,contextualTargetKind:i_(Te),viewMenuState:qt,emitMenuAction:Yt,runAction:wt,openExternalUrl:Zt,closePalette:Qt,openNewItemDialog:$t,openSeedDialog:X,openCreateProjectDialog:en,openReportBugDialog:tn,openBugReportHistory:nn,openFeedbackDialog:rn},on=ft?[]:f_.flatMap(e=>{if(!e.available(an)||e.visibility===`search-only`&&d===``)return[];let t=e.label(an);return z_(t,u,e.keywords)?[{cmd:e,label:t}]:[]}),sn=on.length>0,cn;t[69]===o?cn=t[70]:(cn=e=>{switch(e){case`commands`:return o({id:`45MZFs`});case`project`:return o({id:`e0NrBM`});case`file`:return o({id:`J2eKUI`});case`view`:return o({id:`jpctdh`});case`terminal`:return o({id:`ALhMYW`});case`app`:return o({id:`IrC12v`})}},t[69]=o,t[70]=cn);let ln=cn,un=e=>{let t=on.filter(t=>t.cmd.group===e);return t.length===0?null:(0,Z.jsx)(M,{heading:ln(e),children:t.map(e=>{let{cmd:t,label:n}=e,r=t.shortcutId!==void 0&&(t.shortcutDesktopOnly!==!0||a!==null)?Pl(t.shortcutId):null;return(0,Z.jsxs)(g,{value:`${n} ${t.keywords.join(` `)}`,onSelect:()=>t.dispatch(an),"data-testid":`command-palette-${t.id}`,children:[(0,Z.jsx)(t.icon,{}),(0,Z.jsx)(`span`,{children:n}),t.checked?.(an)?(0,Z.jsx)(zo,{className:`ml-auto text-muted-foreground`,"aria-hidden":`true`}):null,r?(0,Z.jsx)(O,{children:r}):null]},t.id)})},e)},dn=ft||Nt||Ft||Lt||It||Rt||Ht||sn,fn;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(fn=function(e){l(`${H_}${e}`)},t[71]=fn):fn=t[71];let pn=fn,mn;t[72]===Symbol.for(`react.memo_cache_sentinel`)?(mn=function(){Se.current?.abort(),Se.current=null,Ce.current!==null&&(window.clearTimeout(Ce.current),Ce.current=null),k([]),N(null),F(`idle`)},t[72]=mn):mn=t[72];let hn=mn,gn;t[73]===c?gn=t[74]:(gn=function(){T(!0),c.startsWith(`tag:`)&&l(c.slice(H_.length)),hn(),xe.current?.focus()},t[73]=c,t[74]=gn);let _n=gn,vn;t[75]===Symbol.for(`react.memo_cache_sentinel`)?(vn=function(){T(!1),l(``),hn(),xe.current?.focus()},t[75]=vn):vn=t[75];let yn=vn,bn=function(e){let t=e.trim();if(!t||Me)return;Se.current?.abort(),Ce.current!==null&&window.clearTimeout(Ce.current);let n=new AbortController;Se.current=n,F(`loading`);let r=!1,i=window.setTimeout(()=>{r=!0,n.abort(),F(`error`)},py);Ce.current=i,R_(t,{signal:n.signal,semantic:!0,limit:30}).then(e=>{let{entries:r}=e;xn(i,n),k(r),N(t),F(`success`)}).catch(e=>{xn(i,n),!(e instanceof Error&&e.name===`AbortError`&&!r)&&(console.debug(`[semantic-search] fire failed`,{timedOut:r,error:e}),F(`error`))})};function xn(e,t){window.clearTimeout(e),Ce.current===e&&(Ce.current=null),Se.current===t&&(Se.current=null)}let Sn=function(e){!w||e.key!==`Enter`||(_t?.submit?(e.preventDefault(),e.stopPropagation(),bn(_t.submit.query)):P===`loading`&&(e.preventDefault(),e.stopPropagation()))},Cn;t[76]===w?Cn=t[77]:(Cn=function(e){w&&(e.preventDefault(),yn())},t[76]=w,t[77]=Cn);let wn=Cn,Tn;t[78]===o?Tn=t[79]:(Tn=o({id:`1bDVu5`}),t[78]=o,t[79]=Tn);let En;t[80]===o?En=t[81]:(En=o({id:`5GRxoA`}),t[80]=o,t[81]=En);let Dn;t[82]===Symbol.for(`react.memo_cache_sentinel`)?(Dn={shouldFilter:!1,className:`[&_[cmdk-input-wrapper]_svg]:h-4 [&_[cmdk-input-wrapper]_svg]:w-4 [&_[cmdk-item]_svg]:h-4 [&_[cmdk-item]_svg]:w-4`},t[82]=Dn):Dn=t[82];let On;t[83]!==o||t[84]!==w?(On=o(w?{id:`zXj1rA`}:{id:`ggs9f8`}),t[83]=o,t[84]=w,t[85]=On):On=t[85];let kn;t[86]!==w||t[87]!==dt?(kn=()=>{w&&(T(!1),hn()),l(dt?``:H_),xe.current?.focus()},t[86]=w,t[87]=dt,t[88]=kn):kn=t[88];let An=dt?`border-primary/30 bg-primary/10 text-primary`:`border-border bg-transparent text-muted-foreground hover:bg-accent hover:text-accent-foreground`,jn;t[89]===An?jn=t[90]:(jn=Y(`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-xs font-medium transition-colors`,An),t[89]=An,t[90]=jn);let Mn,Nn;t[91]===Symbol.for(`react.memo_cache_sentinel`)?(Mn=(0,Z.jsx)(yc,{className:`size-3.5`}),Nn=(0,Z.jsx)(`span`,{children:(0,Z.jsx)(J,{id:`0rwwOn`})}),t[91]=Mn,t[92]=Nn):(Mn=t[91],Nn=t[92]);let Pn;t[93]!==dt||t[94]!==kn||t[95]!==jn?(Pn=(0,Z.jsxs)(`button`,{type:`button`,onClick:kn,"data-testid":`command-palette-filter-tag`,"data-active":dt,"aria-pressed":dt,className:jn,children:[Mn,Nn]}),t[93]=dt,t[94]=kn,t[95]=jn,t[96]=Pn):Pn=t[96];let Fn;t[97]!==_n||t[98]!==w||t[99]!==Be?(Fn=Be?(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>w?yn():_n(),"data-testid":`command-palette-filter-semantic`,"data-active":w,"aria-pressed":w,className:Y(`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-xs font-medium transition-colors`,w?`border-primary/30 bg-primary/10 text-primary`:`border-border bg-transparent text-muted-foreground hover:bg-accent hover:text-accent-foreground`),children:[(0,Z.jsx)(Zs,{className:`size-3.5`}),(0,Z.jsx)(`span`,{children:(0,Z.jsx)(J,{id:`9tJX8r`})})]}):null,t[97]=_n,t[98]=w,t[99]=Be,t[100]=Fn):Fn=t[100];let In;t[101]!==Pn||t[102]!==Fn?(In=(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-1.5 border-b px-3 py-2`,children:[Pn,Fn]}),t[101]=Pn,t[102]=Fn,t[103]=In):In=t[103];let Ln;t[104]===It?Ln=t[105]:(Ln=It?(0,Z.jsxs)(`div`,{className:`flex items-center justify-center gap-2 py-6 text-muted-foreground text-sm`,role:`status`,"aria-live":`polite`,"data-testid":`command-palette-search-preparing`,children:[(0,Z.jsx)(Xc,{className:`size-4 animate-spin`}),(0,Z.jsx)(J,{id:`yIPXut`})]}):null,t[104]=It,t[105]=Ln);let Rn;t[106]!==Ft||t[107]!==Lt?(Rn=Lt&&!Ft?(0,Z.jsx)(A,{children:(0,Z.jsx)(J,{id:`WRNXKp`})}):null,t[106]=Ft,t[107]=Lt,t[108]=Rn):Rn=t[108];let zn=by,Bn=B_(d,Pt,{truncated:y}),Vn;t[109]!==zn||t[110]!==ft||t[111]!==ut.kind||t[112]!==Bn?(Vn=(0,Z.jsx)(zn,{mode:Bn,inExclusiveMode:ft,paletteModeKind:ut.kind}),t[109]=zn,t[110]=ft,t[111]=ut.kind,t[112]=Bn,t[113]=Vn):Vn=t[113];let Hn=U===`file`,Un;t[114]===W?Un=t[115]:(Un=e=>{e||W(null)},t[114]=W,t[115]=Un);let Wn;t[116]!==tt||t[117]!==Hn||t[118]!==Un?(Wn=(0,Z.jsx)(av,{open:Hn,onOpenChange:Un,kind:`file`,initialDir:tt}),t[116]=tt,t[117]=Hn,t[118]=Un,t[119]=Wn):Wn=t[119];let Kn=U===`folder`,qn;t[120]===W?qn=t[121]:(qn=e=>{e||W(null)},t[120]=W,t[121]=qn);let Jn;t[122]!==tt||t[123]!==Kn||t[124]!==qn?(Jn=(0,Z.jsx)(av,{open:Kn,onOpenChange:qn,kind:`folder`,initialDir:tt}),t[122]=tt,t[123]=Kn,t[124]=qn,t[125]=Jn):Jn=t[125];let Yn;t[126]!==G||t[127]!==K?(Yn=(0,Z.jsx)(Nv,{open:G,onOpenChange:K}),t[126]=G,t[127]=K,t[128]=Yn):Yn=t[128];let Xn;t[129]!==a||t[130]!==ee||t[131]!==te?(Xn=a?(0,Z.jsx)(Ug,{open:ee,onOpenChange:te,bridge:a}):null,t[129]=a,t[130]=ee,t[131]=te,t[132]=Xn):Xn=t[132];let Zn;t[133]!==a||t[134]!==ne||t[135]!==q?(Zn=a?(0,Z.jsx)(lm,{open:ne,onOpenChange:q}):null,t[133]=a,t[134]=ne,t[135]=q,t[136]=Zn):Zn=t[136];let Qn;t[137]!==a||t[138]!==ae||t[139]!==re||t[140]!==ie||t[141]!==q?(Qn=a&&ae?(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(fy,{open:re,onOpenChange:ie,onReportABug:()=>{ie(!1),q(!0)}})}):null,t[137]=a,t[138]=ae,t[139]=re,t[140]=ie,t[141]=q,t[142]=Qn):Qn=t[142];let $n;return t[143]!==se||t[144]!==ce?($n=(0,Z.jsx)(J_,{open:se,onOpenChange:ce,source:`command_palette`}),t[143]=se,t[144]=ce,t[145]=$n):$n=t[145],(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(je,{open:r,onOpenChange:i,title:Tn,description:En,className:`sm:max-w-2xl`,commandProps:Dn,onEscapeKeyDown:wn,children:[(0,Z.jsx)(I,{ref:xe,value:c,onValueChange:l,onKeyDown:Sn,placeholder:On}),In,(0,Z.jsxs)(S,{ref:be,className:`subtle-scrollbar`,children:[w&&_t?(0,Z.jsxs)(Z.Fragment,{children:[Ue?(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 text-muted-foreground text-xs`,role:`status`,"aria-live":`polite`,"data-testid":`command-palette-semantic-indexing`,children:[(0,Z.jsx)(Xc,{className:`size-3.5 animate-spin`}),(0,Z.jsx)(J,{id:`kCNU4q`,values:{semanticIndexedCount:Ve,semanticTotalCount:He}})]}):null,_t.submit?(0,Z.jsx)(M,{children:(0,Z.jsx)(g,{value:`semantic-submit`,onSelect:()=>bn(vt),"data-testid":`command-palette-semantic-submit`,children:_t.submit.kind===`retry`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Zs,{}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-amber-700 dark:text-amber-400`,children:(0,Z.jsx)(J,{id:`w4ZzmQ`})}),(0,Z.jsx)(O,{children:`↵`})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Zs,{}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:(0,Z.jsx)(J,{id:`FNTx6u`,values:{semanticSubmitQuery:vt}})}),(0,Z.jsx)(O,{children:`↵`})]})})}):null,_t.notice===`empty`?(0,Z.jsx)(A,{"data-testid":`command-palette-semantic-empty`,children:(0,Z.jsx)(J,{id:`l5J_HM`,components:{0:(0,Z.jsx)(p,{"aria-label":o({id:`9Vnjc9`})})}})}):null,_t.notice===`searching`?(0,Z.jsxs)(`div`,{className:`flex items-center justify-center gap-2 py-6 text-muted-foreground text-sm`,role:`status`,"aria-live":`polite`,"data-testid":`command-palette-semantic-searching`,children:[(0,Z.jsx)(Xc,{className:`size-4 animate-spin`}),(0,Z.jsx)(J,{id:`PBwmDJ`})]}):null,_t.notice===`no-results`?(0,Z.jsx)(A,{"data-testid":`command-palette-semantic-no-results`,children:(0,Z.jsx)(J,{id:`yFyZMJ`,values:{semanticQueryText:ht}})}):null,_t.results.show?(0,Z.jsx)(M,{heading:_t.results.dimmed?o({id:`QlxHAH`,values:{semanticResultsLabel:yt}}):o({id:`9tJX8r`}),children:(0,Z.jsx)(`div`,{"data-testid":`command-palette-semantic-results`,"data-dimmed":_t.results.dimmed,children:D.map(e=>(0,Z.jsx)(yy,{entry:e,disabled:_t.results.dimmed,onSelect:()=>Mt(e)},__(e.kind,e.path)))})}):null]}):null,Ln,Rn,dn?null:(0,Z.jsx)(A,{children:_===`error`?(0,Z.jsx)(J,{id:`pkAft1`}):(0,Z.jsx)(J,{id:`i3f2kh`})}),ut.kind===`tag-list`?(0,Z.jsxs)(M,{heading:ut.query?o({id:`evs0iw`,values:{tagListQuery:pt}}):o({id:`2QM24L`}),children:[fe===`loading`?(0,Z.jsx)(A,{children:(0,Z.jsx)(J,{id:`a_u4ck`})}):null,fe===`error`?(0,Z.jsx)(A,{children:(0,Z.jsx)(J,{id:`qTcZZu`,components:{0:(0,Z.jsx)(p,{"aria-label":o({id:`69KLIV`})})}})}):null,Wt?(0,Z.jsx)(A,{children:ut.query?o({id:`X0ttSN`,values:{tagListQuery:pt}}):o({id:`JLUTgi`})}):null,Ut.map(e=>(0,Z.jsxs)(g,{value:`tag ${e.name}`,onSelect:()=>pn(e.name),"data-testid":`command-palette-tag-${e.name}`,children:[(0,Z.jsx)(yc,{}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium`,children:e.name}),(0,Z.jsx)(`span`,{className:`ml-auto shrink-0 text-[11px] text-muted-foreground tabular-nums`,children:(0,Z.jsx)(J,{id:`fVcm9t`,values:{0:e.count}})})]},`tag:${e.name}`))]}):null,ut.kind===`tag-docs`?(0,Z.jsxs)(M,{heading:o({id:`hGmuTc`,values:{tagDocsName:mt}}),children:[_e===`loading`?(0,Z.jsx)(A,{children:(0,Z.jsx)(J,{id:`pWbsW6`})}):null,_e===`error`?(0,Z.jsx)(A,{children:(0,Z.jsx)(J,{id:`z_4xza`,components:{0:(0,Z.jsx)(p,{"aria-label":o({id:`69KLIV`})})}})}):null,Gt?(0,Z.jsx)(A,{children:o({id:`NIWAux`,values:{tagDocsName:mt}})}):null,he.map(e=>{let t=e.title||e.docName.split(`/`).pop()||e.docName,n=e.matchingTags.filter(e=>e!==ut.tagName).map(Ty).join(`, `);return(0,Z.jsxs)(g,{value:`tag-doc ${e.docName}`,onSelect:()=>{i(!1),_y(e.docName)},"data-testid":`command-palette-tag-doc-${e.docName}`,className:`items-start`,children:[(0,Z.jsx)(Gn,{className:`mt-0.5`}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,Z.jsx)(`span`,{className:`truncate font-medium`,children:t}),(0,Z.jsx)(`span`,{className:`truncate text-muted-foreground text-xs`,children:e.docName}),e.matchingTags.length>0&&e.matchingTags.some(e=>e!==ut.tagName)?(0,Z.jsx)(`span`,{className:`truncate text-muted-foreground text-[11px]`,children:(0,Z.jsx)(J,{id:`CvsD6Y`,values:{viaTags:n}})}):null]})]},`tag-doc:${e.docName}`)})]}):null,Nt?(0,Z.jsx)(M,{heading:o({id:`MmDDWK`}),children:Je.map(e=>(0,Z.jsx)(yy,{entry:e,onSelect:()=>Mt(e)},__(e.kind,e.path)))}):null,un(`commands`),Ht?(0,Z.jsx)(M,{heading:o({id:`O7_W_a`}),children:Zr.filter(e=>{let t=e.displayName;return z_(o({id:`WqLq6M`,values:{displayName:t}}),u,[e.id,`agent handoff`,`open in`])}).map(e=>{let t=Pe[e.id],n=t.installed===!0&&Ke!==null,r=e.displayName,a=t.installed===null?o({id:`IA6JW2`}):t.installed===!1?o({id:`5SwVv1`}):null,s=o(a?{id:`1ZpfyB`,values:{displayName:r,hint:a}}:{id:`WqLq6M`,values:{displayName:r}});return(0,Z.jsxs)(g,{value:`send to ai ${e.displayName} ${e.id} agent open in`,disabled:!n,onSelect:()=>{!n||!Ke||(i(!1),Ie(e.id,Ke))},"data-testid":`command-palette-open-in-${e.id}`,"aria-label":s,children:[(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(J,{id:`WqLq6M`,values:{displayName:r}})}),a?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-auto text-muted-foreground text-xs`,children:a}):null]},e.id)})}):null,un(`project`),Rt&&a?(0,Z.jsx)(M,{heading:o({id:`3iyGWF`}),children:Ze.filter(e=>z_(`${e.name} ${e.path}`,u,[`open recent project`])).slice(0,10).map(e=>{let t=e.isLinkedWorktree===!0,n=t?po:Hh,r=t&&e.mainRoot!==void 0?Zv(e.mainRoot):null;return(0,Z.jsx)(dy,{path:e.path,onRemoveRecent:Et,testIdPrefix:`command-palette-recent`,children:(0,Z.jsxs)(`div`,{className:`group/recent relative flex items-center`,children:[(0,Z.jsxs)(g,{value:`${e.name} ${e.path} recent project`,onSelect:()=>wt(()=>a.project.open({path:e.path,target:`new-window`,entryPoint:`recents`}),o({id:`SUOoXn`})),"data-testid":`command-palette-recent-${e.path}`,className:`flex-1 items-start pr-8`,children:[(0,Z.jsx)(n,{className:`mt-0.5`}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,Z.jsx)(`span`,{className:`truncate font-medium`,children:e.name}),r===null?null:(0,Z.jsx)(`span`,{className:`truncate text-muted-foreground text-xs`,children:(0,Z.jsx)(J,{id:`8Gzz2G`,values:{worktreeOf:r}})}),(0,Z.jsx)(`span`,{className:`truncate text-muted-foreground text-xs`,children:e.path})]})]}),(0,Z.jsx)(uy,{path:e.path,name:e.name,onRemoveRecent:Et,testIdPrefix:`command-palette-recent`})]})},e.path)})}):null,Bt&&a?(0,Z.jsx)(M,{heading:o({id:`sxjyRq`}),children:zt.slice(0,10).map(e=>(0,Z.jsxs)(g,{value:`${e.branch} worktree branch`,onSelect:()=>Ot(e),"data-testid":`command-palette-worktree-${e.branch}`,className:`items-start`,children:[(0,Z.jsx)(po,{className:`mt-0.5`}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,Z.jsx)(`span`,{className:`truncate font-medium`,children:e.branch}),(0,Z.jsx)(`span`,{className:`truncate text-muted-foreground text-xs`,children:e.worktreePath??o({id:`iO8V-7`})})]})]},e.branch))}):null,[`file`,`view`,`terminal`,`app`].map(e=>un(e)),Ft?(0,Z.jsx)(M,{heading:o({id:`A1taO8`}),children:Pt.map(e=>(0,Z.jsx)(yy,{entry:e,query:d,onSelect:()=>Mt(e)},__(e.kind,e.path)))}):null]}),Vn]}),Wn,Jn,Yn,Xn,Zn,Qn,$n]})}function Ty(e){return`#${e}`}function Ey(e){return e.name}function Dy(e){return e.branch!==null&&!e.isCurrent}function Oy(e){return __(e.kind,e.path)}function ky(e){return e===`eperm`?Cl._({id:`XuQzrk`}):Cl._({id:`BUyQnq`})}async function Ay(e){let t=await e.restartServer(e.config.projectPath);return t.ok?{ok:!0}:{ok:!1,message:ky(t.reason)}}var jy=500;function My(e,t,n){return t?`terminal`:e===null&&n?`retrying`:`hidden`}function Ny(e){return e?.kind===`null-collab`}function Py(e){if(e===null)return Cl._({id:`Ua78MH`});if(e.kind===`null-collab`)return Cl._({id:`TJnkyf`});if(e.code===`network`)return Cl._({id:`aoa6xA`});if(e.code===`invalid-body`)return Cl._({id:`FRYB1Q`});let t=e.code;return Cl._({id:`4nj6n8`,values:{code:t}})}function Fy(){let e=(0,$.c)(28),{collabUrl:t,collabTerminal:n,collabLastError:r,retryCollab:i}=Ye(),[a,o]=(0,Q.useState)(!1),[s,c]=(0,Q.useState)(!1),[l,u]=(0,Q.useState)(null),d=typeof window<`u`?window.okDesktop:void 0,f,p;e[0]!==n||e[1]!==t?(f=()=>{if(t!==null||n){o(!1);return}let e=setTimeout(()=>o(!0),jy);return()=>clearTimeout(e)},p=[t,n],e[0]=n,e[1]=t,e[2]=f,e[3]=p):(f=e[2],p=e[3]),(0,Q.useEffect)(f,p);let m=My(t,n,a);if(m===`hidden`)return null;if(m===`terminal`){let t;e[4]===r?t=e[5]:(t=Ny(r),e[4]=r,e[5]=t);let n=t,a;e[6]===r?a=e[7]:(a=Py(r),e[6]=r,e[7]=a);let o=a,f;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(f=async()=>{if(d){u(null),c(!0);try{let e=await Ay(d);e.ok||(u(e.message),c(!1))}catch{c(!1)}}},e[8]=f):f=e[8];let p=f,m;e[9]!==o||e[10]!==n?(m=(0,Z.jsx)(`span`,{children:n?(0,Z.jsx)(J,{id:`AAlr5Y`,components:{0:(0,Z.jsx)(`code`,{className:`bg-red-100/60 px-1 rounded`})}}):(0,Z.jsx)(J,{id:`noH1JX`,values:{errorDetail:o},components:{0:(0,Z.jsx)(`code`,{className:`bg-red-100/60 px-1 rounded`}),1:(0,Z.jsx)(`code`,{className:`bg-red-100/60 px-1 rounded`})}})}),e[9]=o,e[10]=n,e[11]=m):m=e[11];let h;e[12]===i?h=e[13]:(h=()=>{u(null),i()},e[12]=i,e[13]=h);let g;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Z.jsx)(J,{id:`6gRgw8`}),e[14]=g):g=e[14];let _;e[15]!==s||e[16]!==h?(_=(0,Z.jsx)(`button`,{type:`button`,onClick:h,disabled:s,className:`bg-red-950 text-red-50 px-2 py-0.5 rounded text-xs font-medium hover:bg-red-900 disabled:opacity-60`,children:g}),e[15]=s,e[16]=h,e[17]=_):_=e[17];let v;e[18]===s?v=e[19]:(v=d?(0,Z.jsx)(`button`,{type:`button`,onClick:p,disabled:s,className:`bg-red-950 text-red-50 px-2 py-0.5 rounded text-xs font-medium hover:bg-red-900 disabled:opacity-60`,children:s?(0,Z.jsx)(J,{id:`0Er6-M`}):(0,Z.jsx)(J,{id:`uaUc6t`})}):null,e[18]=s,e[19]=v);let y;e[20]===l?y=e[21]:(y=l===null?null:(0,Z.jsx)(`span`,{className:`w-full text-red-950 text-xs`,children:l}),e[20]=l,e[21]=y);let b;return e[22]!==y||e[23]!==m||e[24]!==_||e[25]!==v?(b=(0,Z.jsxs)(`div`,{role:`alert`,"aria-live":`assertive`,className:`fixed top-0 inset-x-0 z-50 bg-red-500/95 text-red-950 text-sm text-center py-2 px-4 pl-[var(--ok-titlebar-reserve-left,1rem)] shadow-md flex items-center justify-center gap-3 flex-wrap`,children:[m,_,v,y]}),e[22]=y,e[23]=m,e[24]=_,e[25]=v,e[26]=b):b=e[26],b}let h;return e[27]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:`fixed top-0 inset-x-0 z-50 bg-amber-500/95 text-amber-950 text-sm text-center py-2 px-4 pl-[var(--ok-titlebar-reserve-left,1rem)] shadow-md`,children:(0,Z.jsx)(J,{id:`UYcGIW`})}),e[27]=h):h=e[27],h}function Iy(e){let t=(0,$.c)(5),{bridge:n}=e,[r,i]=(0,Q.useState)(!1),a,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>Ut(e=>{e===`new-project`&&i(!0)}),o=[],t[0]=a,t[1]=o):(a=t[0],o=t[1]),(0,Q.useEffect)(a,o);let s;return t[2]!==n||t[3]!==r?(s=(0,Z.jsx)(Ug,{open:r,onOpenChange:i,bridge:n}),t[2]=n,t[3]=r,t[4]=s):s=t[4],s}var Ly=`ok-acp-desktop-migration-v1`,Ry=[`ok-preferred-agent-v1`,`ok-ask-ai-agent-v2`,`ok-ask-ai-default-agent-v1`];function zy(e){try{return localStorage.getItem(e)}catch{return null}}function By(){try{localStorage.setItem(Ly,`1`)}catch{}}function Vy(){return Ry.some(e=>zy(e)!==null)}function Hy(e){return Zr.every(t=>e[t.id]?.installed!=null)?Zr.filter(t=>e[t.id]?.installed===!0).map(e=>e.id):null}function Uy(e){let t=(0,$.c)(3),n,r;t[0]===e?(n=t[1],r=t[2]):(n=()=>{if(zy(Ly)!==null)return;if(!Vy()){By();return}let t=Hy(e);if(t!==null){for(let e of t)ri(Yr(e),!0);By()}},r=[e],t[0]=e,t[1]=n,t[2]=r),(0,Q.useEffect)(n,r)}function Wy(){let{states:e}=as();return Uy(e),null}function Gy(e,t){e.chain().focus().insertContent({type:`text`,text:t}).run()}function Ky(e){if(e.isDestroyed)return null;try{let t=e.view.coordsAtPos(e.state.selection.from);return{left:t.left,top:t.top,bottom:t.bottom}}catch{return null}}function qy(){let e=(0,$.c)(29),{_:t}=gt(),[n,r]=(0,Q.useState)(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=function(e){let t=e.detail;if(!t?.editor||t.editor.isDestroyed)return;let n=Ky(t.editor);n&&r({editor:t.editor,...n})};return document.addEventListener(h,e),()=>document.removeEventListener(h,e)},a=[],e[0]=i,e[1]=a):(i=e[0],a=e[1]),(0,Q.useEffect)(i,a);let o=n?.editor??null,s,c;if(e[2]===o?(s=e[3],c=e[4]):(s=()=>{if(!o)return;let e=function(){let e=o,t=Ky(e);r(n=>!n||n.editor!==e?n:t?{...n,...t}:null)};return document.addEventListener(`scroll`,e,{capture:!0,passive:!0}),window.addEventListener(`resize`,e),()=>{document.removeEventListener(`scroll`,e,{capture:!0}),window.removeEventListener(`resize`,e)}},c=[o],e[2]=o,e[3]=s,e[4]=c),(0,Q.useEffect)(s,c),!n)return null;let l;e[5]===n?l=e[6]:(l=function(e){if(!n)return;let{editor:t}=n;r(null),e&&!t.isDestroyed&&t.commands.focus()},e[5]=n,e[6]=l);let u=l,d;e[7]===u?d=e[8]:(d=e=>{e||u(!1)},e[7]=u,e[8]=d);let f=n.bottom-n.top,p;e[9]!==n.left||e[10]!==n.top||e[11]!==f?(p=(0,Z.jsx)(Gt,{asChild:!0,children:(0,Z.jsx)(`span`,{"aria-hidden":!0,"data-testid":`emoji-picker-anchor`,className:`pointer-events-none fixed`,style:{left:n.left,top:n.top,height:f}})}),e[9]=n.left,e[10]=n.top,e[11]=f,e[12]=p):p=e[12];let m;e[13]===t?m=e[14]:(m=t({id:`pFPzHA`}),e[13]=t,e[14]=m);let g,_;e[15]===u?(g=e[16],_=e[17]):(_=()=>u(!0),g=()=>u(!1),e[15]=u,e[16]=g,e[17]=_);let v;e[18]===n.editor?v=e[19]:(v=(0,Z.jsx)(Do,{onSelect:e=>{let t=n.editor;r(null),Gy(t,e)}}),e[18]=n.editor,e[19]=v);let y;e[20]!==g||e[21]!==v||e[22]!==m||e[23]!==_?(y=(0,Z.jsx)(qt,{className:`w-auto p-0`,align:`start`,"aria-label":m,"data-testid":`emoji-picker-popover`,onEscapeKeyDown:_,onInteractOutside:g,children:v}),e[20]=g,e[21]=v,e[22]=m,e[23]=_,e[24]=y):y=e[24];let b;return e[25]!==y||e[26]!==d||e[27]!==p?(b=(0,Z.jsxs)(Vt,{open:!0,onOpenChange:d,children:[p,y]}),e[25]=y,e[26]=d,e[27]=p,e[28]=b):b=e[28],b}async function Jy(e){let t=await fetch(`/api/tags/${encodeURIComponent(e)}`);if(!t.ok){let e=await t.json().catch(()=>null),n=t.status,r=t.statusText;throw Error(Fl(e)??Cl._({id:`lHwYMr`,values:{status:n,statusText:r}}))}return(await t.json()).docs??[]}function Yy(){let e=(0,$.c)(18),[t,n]=(0,Q.useState)(!1),[r,i]=(0,Q.useState)(null),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={kind:`idle`},e[0]=a):a=e[0];let[o,s]=(0,Q.useState)(a),c=(0,Q.useRef)(0),l,u;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>{let e=function(e){let t=e.detail;if(!t||typeof t.value!=`string`)return;let r=c.current+=1;i(t.value),n(!0),s({kind:`loading`}),Jy(t.value).then(e=>{c.current===r&&s({kind:`ready`,docs:e})}).catch(e=>{c.current===r&&s({kind:`error`,message:e instanceof Error?e.message:String(e)})})};return document.addEventListener(ce,e),()=>document.removeEventListener(ce,e)},u=[],e[1]=l,e[2]=u):(l=e[1],u=e[2]),(0,Q.useEffect)(l,u);let d;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=function(e){n(!1),window.location.assign(Cu(e))},e[3]=d):d=e[3];let f=d,p=r??``,m;e[4]===p?m=e[5]:(m={tagName:p},e[4]=p,e[5]=m);let h;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(h={0:(0,Z.jsx)(`span`,{className:`font-mono break-all`})},e[6]=h):h=e[6];let g;e[7]===m?g=e[8]:(g=(0,Z.jsx)(vn,{children:(0,Z.jsx)(mn,{children:(0,Z.jsx)(J,{id:`7H4UHD`,values:m,components:h})})}),e[7]=m,e[8]=g);let _=r??``,v;e[9]!==o||e[10]!==_?(v=(0,Z.jsx)(gn,{children:(0,Z.jsx)(Xy,{fetchState:o,tag:_,onSelectDoc:f})}),e[9]=o,e[10]=_,e[11]=v):v=e[11];let y;e[12]!==g||e[13]!==v?(y=(0,Z.jsxs)(hn,{children:[g,v]}),e[12]=g,e[13]=v,e[14]=y):y=e[14];let b;return e[15]!==t||e[16]!==y?(b=(0,Z.jsx)(yn,{open:t,onOpenChange:n,children:y}),e[15]=t,e[16]=y,e[17]=b):b=e[17],b}function Xy(e){let t=(0,$.c)(15),{fetchState:n,tag:r,onSelectDoc:i}=e;if(n.kind===`idle`||n.kind===`loading`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(`p`,{className:`text-muted-foreground text-sm`,"data-testid":`tag-dialog-loading`,children:(0,Z.jsx)(J,{id:`yQE2r9`})}),t[0]=e):e=t[0],e}if(n.kind===`error`){let e;return t[1]===n.message?e=t[2]:(e=(0,Z.jsx)(`p`,{className:`text-destructive text-sm`,"data-testid":`tag-dialog-error`,children:n.message}),t[1]=n.message,t[2]=e),e}if(n.docs.length===0){let e;t[3]===r?e=t[4]:(e={tag:r},t[3]=r,t[4]=e);let n;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(n={0:(0,Z.jsx)(`span`,{className:`font-mono`})},t[5]=n):n=t[5];let i;return t[6]===e?i=t[7]:(i=(0,Z.jsx)(`p`,{className:`text-muted-foreground text-sm`,"data-testid":`tag-dialog-empty`,children:(0,Z.jsx)(J,{id:`lAiyU_`,values:e,components:n})}),t[6]=e,t[7]=i),i}let a;if(t[8]!==n.docs||t[9]!==i){let e;t[11]===i?e=t[12]:(e=e=>{let t=e.matchingTags??[];return(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,className:`w-full rounded-md px-2 py-1.5 text-left text-sm hover:bg-muted focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring`,onClick:()=>i(e.docName),"data-testid":`tag-dialog-row`,children:[(0,Z.jsx)(`span`,{className:`block truncate font-medium`,children:e.title}),e.docName===e.title?null:(0,Z.jsx)(`span`,{className:`block truncate text-xs text-muted-foreground`,children:e.docName}),t.length>0?(0,Z.jsx)(`span`,{className:`mt-1 flex flex-wrap items-center gap-1`,"data-testid":`tag-dialog-row-matches`,children:t.map(Zy)}):null]})},e.docName)},t[11]=i,t[12]=e),a=n.docs.map(e),t[8]=n.docs,t[9]=i,t[10]=a}else a=t[10];let o;return t[13]===a?o=t[14]:(o=(0,Z.jsx)(`ul`,{className:`flex flex-col gap-1`,"data-testid":`tag-dialog-list`,children:a}),t[13]=a,t[14]=o),o}function Zy(e){return(0,Z.jsxs)(`span`,{"data-testid":`tag-dialog-row-match`,"data-tag":e,className:`tag pointer-events-none text-xs`,children:[`#`,e]},e)}var Qy=`raw-mdx-nav`,$y=`ok-editor-mode-v1`,eb=[`wysiwyg`,`source`],tb=`wysiwyg`;function nb(e){return eb.includes(e)}function rb(e=localStorage){try{let t=e.getItem($y);if(t===null)return tb;if(nb(t))return t;console.warn(`[editor-mode] invalid persisted value, falling back to default`,{raw:t})}catch{}return tb}function ib(e=window,t=localStorage){let n=e.__OK_EDITOR_MODE__;return nb(n)?n:rb(t)}function ab(e,t=localStorage){try{return t.setItem($y,e),!0}catch(e){return console.warn(`[editor-mode] persist failed`,e),!1}}function ob(){let e=(0,$.c)(3),[t,n]=(0,Q.useState)(ib),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=function(e){n(e),ab(e)},e[0]=r):r=e[0];let i=r,a;return e[1]===t?a=e[2]:(a=[t,i],e[1]=t,e[2]=a),a}function sb(e){let t=(0,$.c)(4),{_:n}=gt(),r=(0,Q.useRef)(!1),i,a;t[0]!==n||t[1]!==e?(i=()=>{e===`no-push-permission`&&!r.current&&(r.current=!0,gl.info(n({id:`JkCD2u`})))},a=[e,n],t[0]=n,t[1]=e,t[2]=i,t[3]=a):(i=t[2],a=t[3]),(0,Q.useEffect)(i,a)}function cb(e,t){return e===`follow`?(0,Z.jsx)(J,{id:`Sxx_Zz`,values:{project:t}}):e===`full`?(0,Z.jsx)(J,{id:`4zEZS5`,values:{project:t}}):(0,Z.jsx)(J,{id:`AaaESH`,values:{project:t}})}function lb(){let e=(0,$.c)(8),{projectLocalConfig:t,projectLocalSynced:n,projectLocalBinding:r}=od(),i=(0,Q.useRef)(!1),a;e[0]!==r||e[1]!==t?.autoSync||e[2]!==n?(a=()=>{if(!n||i.current||r===null)return;let e=t?.autoSync;if(e?.inheritedNoticePending!==!0)return;i.current=!0;let a=typeof e.inheritedFrom==`string`?e.inheritedFrom:``;gl(cb(ra({mode:e.mode,enabled:e.enabled}),a)),r.patch({autoSync:{inheritedNoticePending:null}})},e[0]=r,e[1]=t?.autoSync,e[2]=n,e[3]=a):a=e[3];let o;e[4]!==r||e[5]!==t||e[6]!==n?(o=[n,t,r],e[4]=r,e[5]=t,e[6]=n,e[7]=o):o=e[7],(0,Q.useEffect)(a,o)}var ub=`ok-terminal-dock-v1`,db=`right`;function fb(e){return e===`bottom`?`bottom`:`right`}function pb(e){try{return fb((e??localStorage).getItem(ub))}catch{return db}}function mb(e,t){try{(t??localStorage).setItem(ub,e)}catch{}}function hb(){try{return typeof localStorage>`u`?db:pb()}catch{return db}}function gb(e){let t=(0,$.c)(36),{open:n,variant:r,onResolved:i}=e,{_:a}=gt(),o=mo(),s;t[0]!==a||t[1]!==i||t[2]!==r||t[3]!==o?(s=function(e){if(o===null){gl.error(a({id:`fiMNLl`}));return}let t=o(e?r===`follow`?`follow`:`full`:`off`);if(!t.ok){let n=t.error;gl.error(a(e?{id:`FUMerq`,values:{detail:n}}:{id:`0t0bbC`,values:{detail:n}}));return}i()},t[0]=a,t[1]=i,t[2]=r,t[3]=o,t[4]=s):s=t[4];let c=s,l;t[5]===r?l=t[6]:(l=(0,Z.jsx)(vn,{children:(0,Z.jsx)(_o,{variant:r})}),t[5]=r,t[6]=l);let u;t[7]===r?u=t[8]:(u=(0,Z.jsx)(yo,{variant:r}),t[7]=r,t[8]=u);let d;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(`p`,{className:`mt-3 text-1sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`QYTOaN`,components:{0:(0,Z.jsx)(`span`,{className:`font-medium`})}})}),t[9]=d):d=t[9];let f;t[10]===u?f=t[11]:(f=(0,Z.jsxs)(gn,{children:[u,d]}),t[10]=u,t[11]=f);let p;t[12]===c?p=t[13]:(p=()=>c(!1),t[12]=c,t[13]=p);let m=o===null,h;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(J,{id:`IKoTAC`}),t[14]=h):h=t[14];let g;t[15]!==p||t[16]!==m?(g=(0,Z.jsx)(X,{variant:`outline`,className:`uppercase font-mono`,onClick:p,disabled:m,children:h}),t[15]=p,t[16]=m,t[17]=g):g=t[17];let _;t[18]===c?_=t[19]:(_=()=>c(!0),t[18]=c,t[19]=_);let v=o===null,y;t[20]===r?y=t[21]:(y=r===`follow`?(0,Z.jsx)(J,{id:`U4nTfu`}):(0,Z.jsx)(J,{id:`XU0OXn`}),t[20]=r,t[21]=y);let b;t[22]!==_||t[23]!==v||t[24]!==y?(b=(0,Z.jsx)(X,{onClick:_,disabled:v,children:y}),t[22]=_,t[23]=v,t[24]=y,t[25]=b):b=t[25];let x;t[26]!==b||t[27]!==g?(x=(0,Z.jsxs)(_n,{children:[g,b]}),t[26]=b,t[27]=g,t[28]=x):x=t[28];let S;t[29]!==x||t[30]!==l||t[31]!==f?(S=(0,Z.jsxs)(hn,{className:`sm:max-w-lg`,showCloseButton:!1,children:[l,f,x]}),t[29]=x,t[30]=l,t[31]=f,t[32]=S):S=t[32];let C;return t[33]!==n||t[34]!==S?(C=(0,Z.jsx)(yn,{open:n,onOpenChange:_b,children:S}),t[33]=n,t[34]=S,t[35]=C):C=t[35],C}function _b(){}function vb(e){if(!(!e.autoSyncOnboardingDismissed&&e.hasRemote===!0&&e.projectLocalSynced===!0&&e.projectSynced===!0&&e.projectLocalConfig!==null&&ra(e.projectLocalConfig.autoSync??void 0)===null&&Ha(e.projectConfig?.autoSync?.default)===null))return null;switch(e.pushPermissionCheckStatus){case`allowed`:return`full`;case`denied`:return`follow`;default:return null}}var yb=new Map(ha.map(e=>[e.id,e.alias]));function bb(e,t,n){return vi({relativePath:nc(e),source:t.source,code:t.code,ruleAlias:t.source===`markdownlint`?yb.get(t.code):void 0,message:t.message,line:t.range.start.line+1,column:t.range.start.character+1,lineText:n})}var xb=5;async function Sb(e){let t=await fetch(`/api/backlinks?docName=${encodeURIComponent(e)}`),n=await t.json().catch(()=>null);if(!t.ok){let e=uo.safeParse(n),r=t.status;throw e.success?Error(e.data.title):new On(Cl._({id:`XopE_I`,values:{status:r}}),{status:r})}let r=va.safeParse(n);if(!r.success)throw new On(Cl._({id:`lZAiSP`}),{status:t.status});return r.data.backlinks}async function Cb(e){let t=await fetch(`/api/forward-links?docName=${encodeURIComponent(e)}`),n=await t.json().catch(()=>null);if(!t.ok){let e=uo.safeParse(n),r=t.status;throw e.success?Error(e.data.title):new On(Cl._({id:`GemPfn`,values:{status:r}}),{status:r})}let r=Ei.safeParse(n);if(!r.success)throw new On(Cl._({id:`2YZwPB`}),{status:t.status});return r.data.forwardLinks}function wb(e){let t=e.split(`/`);return t.length<=2?e:`…/${t.slice(-2).join(`/`)}`}function Tb(e){window.location.hash=Cu(e)}function Eb(e){let t=(0,$.c)(9),{title:n,count:r,isLoading:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(Vo,{className:`size-3.5 text-muted-foreground transition-transform group-data-[state=closed]:-rotate-90`}),t[0]=a):a=t[0];let o;t[1]===n?o=t[2]:(o=(0,Z.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[a,(0,Z.jsx)(Wd,{children:n})]}),t[1]=n,t[2]=o);let s;t[3]!==r||t[4]!==i?(s=!i&&(0,Z.jsx)(Ud,{children:r}),t[3]=r,t[4]=i,t[5]=s):s=t[5];let c;return t[6]!==o||t[7]!==s?(c=(0,Z.jsxs)(dn,{className:`group flex w-full cursor-pointer items-center justify-between px-5 py-3 text-left transition-colors hover:bg-muted/40`,children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8],c}function Db(e){let t=(0,$.c)(10),{total:n,expanded:r,onToggle:i}=e;if(n<=xb)return null;let a=n-xb,o;t[0]===r?o=t[1]:(o=r?(0,Z.jsx)(Vo,{className:`size-3`}):(0,Z.jsx)(Ho,{className:`size-3`}),t[0]=r,t[1]=o);let s;t[2]!==r||t[3]!==a?(s=r?(0,Z.jsx)(J,{id:`6fGjTz`}):(0,Z.jsx)(J,{id:`ZptNUh`,values:{hidden:a}}),t[2]=r,t[3]=a,t[4]=s):s=t[4];let c;return t[5]!==r||t[6]!==i||t[7]!==o||t[8]!==s?(c=(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":r,className:`mt-2 inline-flex cursor-pointer items-center gap-1 px-3 text-xs text-muted-foreground transition-colors hover:text-foreground`,onClick:i,children:[o,s]}),t[5]=r,t[6]=i,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function Ob(e){let t=(0,$.c)(35),{icon:n,iconColorClass:r,rowTooltip:i,title:a,path:o,anchor:s,snippet:c,titleHover:l,ariaLabel:u,href:d,external:f,disabled:p,onClick:m}=e,h=o!==void 0&&o!==a,g=r??`text-muted-foreground`,_;t[0]===g?_=t[1]:(_=Y(`mt-0.5 shrink-0`,g),t[0]=g,t[1]=_);let v;t[2]!==n||t[3]!==_?(v=(0,Z.jsx)(`span`,{className:_,children:n}),t[2]=n,t[3]=_,t[4]=v):v=t[4];let y=v,b;t[5]!==u||t[6]!==p||t[7]!==f||t[8]!==d||t[9]!==m||t[10]!==a||t[11]!==l?(b=d?(0,Z.jsxs)(`a`,{href:d,target:f?`_blank`:void 0,rel:f?`noopener noreferrer`:void 0,"aria-label":u,title:l,onClick:m,className:`block w-full truncate text-left font-medium text-foreground no-underline outline-none after:absolute after:inset-0 after:rounded-md focus-visible:after:ring-2 focus-visible:after:ring-ring`,children:[a,f?(0,Z.jsxs)(`span`,{className:`sr-only`,children:[` `,(0,Z.jsx)(J,{id:`dbtjJh`})]}):null]}):(0,Z.jsx)(`button`,{type:`button`,"aria-label":u,title:l,disabled:p,onClick:m,className:Y(`block w-full truncate text-left font-medium text-foreground no-underline outline-none after:absolute after:inset-0 after:rounded-md focus-visible:after:ring-2 focus-visible:after:ring-ring`,`cursor-pointer bg-transparent p-0 disabled:cursor-not-allowed disabled:opacity-60`),children:a}),t[5]=u,t[6]=p,t[7]=f,t[8]=d,t[9]=m,t[10]=a,t[11]=l,t[12]=b):b=t[12];let x=b,S;t[13]===y?S=t[14]:(S=(0,Z.jsx)(`div`,{className:`mt-px flex items-center`,children:y}),t[13]=y,t[14]=S);let C;t[15]!==s||t[16]!==o||t[17]!==h?(C=h?(0,Z.jsxs)(`div`,{className:`truncate font-mono text-xs text-muted-foreground`,children:[o,s?(0,Z.jsxs)(`span`,{className:`ml-1`,children:[`· #`,s]}):null]}):null,t[15]=s,t[16]=o,t[17]=h,t[18]=C):C=t[18];let w;t[19]===c?w=t[20]:(w=c?(0,Z.jsx)(`p`,{className:`line-clamp-2 text-muted-foreground`,children:c}):null,t[19]=c,t[20]=w);let T;t[21]!==x||t[22]!==C||t[23]!==w?(T=(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5 text-1sm`,children:[x,C,w]}),t[21]=x,t[22]=C,t[23]=w,t[24]=T):T=t[24];let E;t[25]!==S||t[26]!==T?(E=(0,Z.jsxs)(`div`,{className:`group relative flex items-start gap-2.5 rounded-md px-3 py-2.5 transition-colors hover:bg-muted/80`,children:[S,T]}),t[25]=S,t[26]=T,t[27]=E):E=t[27];let D=E;if(i){let e;t[28]===D?e=t[29]:(e=(0,Z.jsx)(on,{asChild:!0,children:D}),t[28]=D,t[29]=e);let n;t[30]===i?n=t[31]:(n=(0,Z.jsx)(sn,{side:`top`,children:i}),t[30]=i,t[31]=n);let r;return t[32]!==e||t[33]!==n?(r=(0,Z.jsxs)(ln,{children:[e,n]}),t[32]=e,t[33]=n,t[34]=r):r=t[34],r}return D}function kb(e){let t=(0,$.c)(39),{docName:n}=e,{_:r}=gt(),{folderPaths:i,pages:a,pagesBySlug:o,pagesByBasename:s,loading:c}=Go(),l,u;t[0]===n?(l=t[1],u=t[2]):(l=[`backlinks`,n],u=()=>Sb(n),t[0]=n,t[1]=l,t[2]=u);let d;t[3]!==n||t[4]!==c||t[5]!==a?(d=!c&&(a.has(n)||lo(n)),t[3]=n,t[4]=c,t[5]=a,t[6]=d):d=t[6];let f;t[7]!==l||t[8]!==u||t[9]!==d?(f={queryKey:l,queryFn:u,enabled:d},t[7]=l,t[8]=u,t[9]=d,t[10]=f):f=t[10];let{data:p,isLoading:m,error:h}=Nt(f),g;t[11]===p?g=t[12]:(g=p===void 0?[]:p,t[11]=p,t[12]=g);let _=g,[v,y]=(0,Q.useState)(!1),[b,x]=(0,Q.useState)(n);b!==n&&(x(n),y(!1));let S;t[13]!==_||t[14]!==v?(S=v?_:_.slice(0,xb),t[13]=_,t[14]=v,t[15]=S):S=t[15];let C=S,w;t[16]===r?w=t[17]:(w=r({id:`9NJWgv`}),t[16]=r,t[17]=w);let T;t[18]!==_.length||t[19]!==m||t[20]!==w?(T=(0,Z.jsx)(Eb,{title:w,count:_.length,isLoading:m}),t[18]=_.length,t[19]=m,t[20]=w,t[21]=T):T=t[21];let E;t[22]!==r||t[23]!==_.length||t[24]!==h||t[25]!==v||t[26]!==i||t[27]!==m||t[28]!==a||t[29]!==s||t[30]!==o||t[31]!==C?(E=h?(0,Z.jsx)(`div`,{className:`px-3`,children:(0,Z.jsx)(zd,{children:h instanceof Error?h.message:r({id:`Xet9MX`})})}):_.length===0&&!m?(0,Z.jsx)(`div`,{className:`px-3`,children:(0,Z.jsx)(Bd,{children:(0,Z.jsx)(J,{id:`rVxu1k`})})}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`flex flex-col gap-1`,children:C.map((e,t)=>{let n=Kd(e.source,{pages:a,folderPaths:i,pagesBySlug:o,pagesByBasename:s});return(0,Z.jsx)(Ob,{icon:(0,Z.jsx)(he,{className:`size-3.5`}),title:e.title,path:wb(e.source),titleHover:e.source,anchor:e.anchor,snippet:e.snippet,href:Cu(n.hashDocName,e.anchor)},`${e.source}-${t}`)})}),(0,Z.jsx)(Db,{total:_.length,expanded:v,onToggle:()=>y(Ab)})]}),t[22]=r,t[23]=_.length,t[24]=h,t[25]=v,t[26]=i,t[27]=m,t[28]=a,t[29]=s,t[30]=o,t[31]=C,t[32]=E):E=t[32];let D;t[33]!==m||t[34]!==E?(D=(0,Z.jsx)(un,{children:(0,Z.jsx)(`div`,{className:`px-2 pb-3`,"aria-busy":m,children:E})}),t[33]=m,t[34]=E,t[35]=D):D=t[35];let O;return t[36]!==D||t[37]!==T?(O=(0,Z.jsxs)(fn,{defaultOpen:!0,children:[T,D]}),t[36]=D,t[37]=T,t[38]=O):O=t[38],O}function Ab(e){return!e}function jb(e){let t=(0,$.c)(49),{docName:n}=e,{_:r}=gt(),{addPage:i,folderPaths:a,pages:o,pagesBySlug:s,pagesByBasename:c,loading:l}=Go(),d,f;t[0]===n?(d=t[1],f=t[2]):(d=[`forward-links`,n],f=()=>Cb(n),t[0]=n,t[1]=d,t[2]=f);let p;t[3]!==n||t[4]!==o||t[5]!==l?(p=!l&&(o.has(n)||lo(n)),t[3]=n,t[4]=o,t[5]=l,t[6]=p):p=t[6];let m;t[7]!==d||t[8]!==f||t[9]!==p?(m={queryKey:d,queryFn:f,enabled:p},t[7]=d,t[8]=f,t[9]=p,t[10]=m):m=t[10];let{data:h,isLoading:g,error:_}=Nt(m),v;t[11]===h?v=t[12]:(v=h===void 0?[]:h,t[11]=h,t[12]=v);let y=v,[b,x]=(0,Q.useState)(null),[S,C]=(0,Q.useState)(!1),[w,T]=(0,Q.useState)(n);w!==n&&(T(n),C(!1),x(null));let E;t[13]!==S||t[14]!==y?(E=S?y:y.slice(0,xb),t[13]=S,t[14]=y,t[15]=E):E=t[15];let D=E,O;t[16]!==r||t[17]!==i||t[18]!==b?(O=async function(e,t){if(!b){x(t);try{await u(e,{addPage:i,onCreated:Tb}),x(null)}catch(e){let t=e;gl.error(t instanceof Error?t.message:r({id:`tfi40B`})),x(null)}}},t[16]=r,t[17]=i,t[18]=b,t[19]=O):O=t[19];let k=O,A;t[20]!==r||t[21]!==b||t[22]!==a||t[23]!==k||t[24]!==o||t[25]!==c||t[26]!==s||t[27]!==l?(A=function(e){let{title:t}=e;if(e.kind===`external`){let t=e.title===e.url;return(0,Z.jsx)(Ob,{icon:(0,Z.jsx)(bo,{className:`size-3.5`}),rowTooltip:r({id:`XDzAnp`}),title:e.title,path:t?void 0:e.url,titleHover:e.url,snippet:e.snippet,href:e.url,external:!0},`ext:${e.url}`)}let n=Cn(e.docName,{pages:o,folderPaths:a,pagesBySlug:s,pagesByBasename:c}),i=!l&&n.kind===`create`,u=!l&&n.kind===`navigate`&&n.displayState===`folder`,d=wb(e.docName),f=e.title===e.docName?d:e.title,p=`doc:${e.docName}:${e.anchor??``}`,m=n.kind===`navigate`?n.hashDocName:e.docName,h=n.kind===`navigate`&&n.hash?n.hash:Cu(m,e.anchor);if(i&&n.kind===`create`){let i={initialDir:n.initialDir,suggestedName:n.suggestedName};return(0,Z.jsx)(Ob,{icon:(0,Z.jsx)(ul,{className:`size-3.5`}),iconColorClass:`text-amber-600 dark:text-amber-400`,rowTooltip:r(b===p?{id:`kj9pAE`}:{id:`IQPyrD`}),ariaLabel:r(b===p?{id:`un8kBM`,values:{linkTitle:t}}:{id:`jEdF24`,values:{linkTitle:t}}),title:f,path:d,titleHover:e.docName,anchor:e.anchor,snippet:e.snippet,disabled:b!==null,onClick:()=>void k(i,p)},p)}return u&&n.kind===`navigate`?(0,Z.jsx)(Ob,{icon:(0,Z.jsx)(Hh,{className:`size-3.5`}),iconColorClass:`text-sky-600 dark:text-sky-400`,ariaLabel:r({id:`P6lAT3`,values:{linkTitle:t}}),title:f,path:d,titleHover:e.docName,anchor:e.anchor,snippet:e.snippet,href:h},p):(0,Z.jsx)(Ob,{icon:(0,Z.jsx)(he,{className:`size-3.5`}),title:f,path:d,titleHover:e.docName,anchor:e.anchor,snippet:e.snippet,href:h},p)},t[20]=r,t[21]=b,t[22]=a,t[23]=k,t[24]=o,t[25]=c,t[26]=s,t[27]=l,t[28]=A):A=t[28];let j=A,M;t[29]===r?M=t[30]:(M=r({id:`O0Z2Xr`}),t[29]=r,t[30]=M);let N;t[31]!==g||t[32]!==y.length||t[33]!==M?(N=(0,Z.jsx)(Eb,{title:M,count:y.length,isLoading:g}),t[31]=g,t[32]=y.length,t[33]=M,t[34]=N):N=t[34];let P;t[35]!==r||t[36]!==_||t[37]!==S||t[38]!==g||t[39]!==y.length||t[40]!==j||t[41]!==D?(P=_?(0,Z.jsx)(`div`,{className:`px-3`,children:(0,Z.jsx)(zd,{children:_ instanceof Error?_.message:r({id:`pZAs1T`})})}):y.length===0&&!g?(0,Z.jsx)(`div`,{className:`px-3`,children:(0,Z.jsx)(Bd,{children:(0,Z.jsx)(J,{id:`roiUQQ`})})}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`flex flex-col gap-1`,children:D.map(j)}),(0,Z.jsx)(Db,{total:y.length,expanded:S,onToggle:()=>C(Mb)})]}),t[35]=r,t[36]=_,t[37]=S,t[38]=g,t[39]=y.length,t[40]=j,t[41]=D,t[42]=P):P=t[42];let F;t[43]!==g||t[44]!==P?(F=(0,Z.jsx)(un,{children:(0,Z.jsx)(`div`,{className:`px-2 pb-3`,"aria-busy":g,children:P})}),t[43]=g,t[44]=P,t[45]=F):F=t[45];let I;return t[46]!==N||t[47]!==F?(I=(0,Z.jsxs)(fn,{defaultOpen:!0,children:[N,F]}),t[46]=N,t[47]=F,t[48]=I):I=t[48],I}function Mb(e){return!e}function Nb(e){let t=(0,$.c)(11),{docName:n,className:r}=e,i=r===void 0?``:r,a;t[0]===n?a=t[1]:(a=(0,Z.jsx)(jb,{docName:n}),t[0]=n,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(Vr,{}),t[2]=o):o=t[2];let s;t[3]===n?s=t[4]:(s=(0,Z.jsx)(kb,{docName:n}),t[3]=n,t[4]=s);let c;t[5]!==a||t[6]!==s?(c=(0,Z.jsxs)(Vd,{className:`px-0 py-0`,children:[a,o,s]}),t[5]=a,t[6]=s,t[7]=c):c=t[7];let l;return t[8]!==i||t[9]!==c?(l=(0,Z.jsx)(Gd,{className:i,children:c}),t[8]=i,t[9]=c,t[10]=l):l=t[10],l}function Pb(e){let t=e.setTimer??((e,t)=>setTimeout(e,t)),n=e.clearTimer??(e=>clearTimeout(e)),r=!1,i=!1,a=null,o=null,s=e.baseMs,c=!1,l=n=>{if(!r){if(e.isPaused()){c=!0;return}a=t(u,n)}};async function u(){if(a=null,c=!1,r)return;if(e.isPaused()){c=!0;return}o=new AbortController;let t=o.signal;try{let n=await e.poll(t);if(r)return;n===`ok`?(s=e.baseMs,l(e.baseMs)):(s=Math.min(s*2,e.maxBackoffMs),l(s))}catch{if(r||t.aborted)return;s=Math.min(s*2,e.maxBackoffMs),l(s)}}return{start(){r||i||(i=!0,u())},resume(){r||!e.isPaused()&&c&&a===null&&(c=!1,u())},stop(){r=!0,a!==null&&(n(a),a=null),o?.abort()}}}var Fb=1e4,Ib=6e4;async function Lb(e,t,n){try{let r=await fetch(`/api/history?docName=${encodeURIComponent(e)}&limit=100`,{signal:t});if(!r.ok)return n.setError(n.unavailableMessage),`error`;let i=await r.json();return n.setEntries((i.entries??[]).filter(Rb)),n.setError(null),`ok`}catch(e){if(e instanceof DOMException&&e.name===`AbortError`)throw e;return n.setError(n.unavailableMessage),console.error(`[timeline]`,e),`error`}finally{t.aborted||n.setLoading(!1)}}function Rb(e){return e.type===`checkpoint`?e.checkpoint!==null&&so(e.checkpoint.kind):!0}function zb(e){let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/1e3);if(r<60)return Cl._({id:`xOTzt5`});if(r<3600){let e=Math.floor(r/60);return Cl._({id:`UyROxs`,values:{mins:e}})}if(r<86400){let e=Math.floor(r/3600);return Cl._({id:`wXO4Tg`,values:{hrs:e}})}if(r<86400*2)return Cl._({id:`rQRrkB`});let i=Math.floor(r/86400);return i<7?Cl._({id:`6u9LvN`,values:{days:i}}):t.toLocaleDateString()}function Bb(e){return new Date(e).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function Vb(e){if(e.type===`checkpoint`)return{kind:`recovered`};if(e.type===`upstream`)return{kind:`upstream`};let t=e.message,n=/^rollback: .+ to ([0-9a-f]{7,40})$/.exec(t);if(n)return{kind:`restore`,targetSha7:n[1].slice(0,7)};let r=/^rename: (.+) -> (.+)$/.exec(t);return r?{kind:`rename`,from:r[1],to:r[2]}:t.startsWith(`reconcile: `)?{kind:`reconcile`}:t.startsWith(`import: `)?{kind:`upstream`}:{kind:`edit`}}function Hb(e){return e.split(`/`).pop()??e}function Ub(e){return e.type===`checkpoint`?Cl._({id:`C-twqs`}):e.type===`upstream`?Cl._({id:`K_vT1F`}):e.contributors.length===1?e.contributors[0].name:e.contributors.length>1?e.contributors.map(e=>e.name).join(`, `):e.author===`openknowledge-server`||e.author===`server`?Cl._({id:`B2DrPb`}):e.author}function Wb(e){let t=(0,$.c)(18),{entry:n,isDark:r}=e;if(n.type===`checkpoint`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Pc,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),t[0]=e):e=t[0],e}if(n.type===`upstream`){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(po,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[1]=e):e=t[1],e}if(n.contributors.length>0){let e=n.contributors[0],i=e.colorSeed??e.name,a;t[2]===i?a=t[3]:(a=fi(i),t[2]=i,t[3]=a);let o=a,s=r?Ia[o]??Za[o]:Za[o],c;t[4]!==s||t[5]!==i?(c=s??da(i),t[4]=s,t[5]=i,t[6]=c):c=t[6];let l=c;if(o!==`bot`){let e;t[7]===l?e=t[8]:(e={color:l},t[7]=l,t[8]=e);let n;return t[9]!==o||t[10]!==e?(n=(0,Z.jsx)(ef,{icon:o,width:14,height:14,className:`shrink-0`,style:e}),t[9]=o,t[10]=e,t[11]=n):n=t[11],n}if(e.name===`File System`){let e;return t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Wh,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[12]=e):e=t[12],e}if(e.name===`OpenKnowledge (service)`||e.name===`Git (upstream)`){let e;return t[13]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(vo,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[13]=e):e=t[13],e}let u;return t[14]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(Pg,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[14]=u):u=t[14],u}if(n.authorEmail.includes(`agent`)||n.author.includes(`agent`)||n.authorEmail.includes(`cursor`)||n.authorEmail.includes(`claude`)){let e;return t[15]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Zs,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[15]=e):e=t[15],e}if(n.author===`openknowledge-server`||n.author===`server`){let e;return t[16]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(vo,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[16]=e):e=t[16],e}let i;return t[17]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(Pg,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[17]=i):i=t[17],i}function Gb(e){let t=[];for(let n of e.contributors)if(n.summaries)for(let e of n.summaries)t.push(e);return t}function Kb(e){let t=(0,$.c)(21),{summaries:n}=e,[r,i]=(0,Q.useState)(!1),a=(0,Q.useId)();if(n.length===0)return null;let o,s;t[0]===n?(o=t[1],s=t[2]):([o,...s]=n,t[0]=n,t[1]=o,t[2]=s);let c=s.length,l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`• `}),t[3]=l):l=t[3];let u;t[4]===o?u=t[5]:(u=(0,Z.jsxs)(`li`,{className:`text-xs text-foreground/90`,children:[l,o]}),t[4]=o,t[5]=u);let d;t[6]!==r||t[7]!==s?(d=r&&s.map(Jb),t[6]=r,t[7]=s,t[8]=d):d=t[8];let f;t[9]!==a||t[10]!==u||t[11]!==d?(f=(0,Z.jsxs)(`ul`,{id:a,className:`list-none`,children:[u,d]}),t[9]=a,t[10]=u,t[11]=d,t[12]=f):f=t[12];let p;t[13]!==r||t[14]!==c||t[15]!==a||t[16]!==s.length?(p=s.length>0&&(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":r,"aria-controls":a,className:`inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer`,onClick:e=>{e.stopPropagation(),i(qb)},children:[r?(0,Z.jsx)(Vo,{className:`size-3`}):(0,Z.jsx)(Ho,{className:`size-3`}),r?(0,Z.jsx)(J,{id:`vLyv1R`}):(0,Z.jsx)(J,{id:`ZptNUh`,values:{hidden:c}})]}),t[13]=r,t[14]=c,t[15]=a,t[16]=s.length,t[17]=p):p=t[17];let m;return t[18]!==f||t[19]!==p?(m=(0,Z.jsxs)(`div`,{className:`mt-0.5`,children:[f,p]}),t[18]=f,t[19]=p,t[20]=m):m=t[20],m}function qb(e){return!e}function Jb(e,t){return(0,Z.jsxs)(`li`,{className:`text-xs text-foreground/90`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`• `}),e]},`${t}-${e}`)}function Yb(e){let t=(0,$.c)(36),{descriptor:n,allDocs:r,versionBySha7:i,onJumpToVersion:a}=e,{_:o}=gt();if(n.kind===`restore`){let e,r;t[0]!==o||t[1]!==n.targetSha7||t[2]!==i?(r=i.get(n.targetSha7),e=o(r?{id:`sICrVf`,values:{0:Bb(r.timestamp)}}:{id:`i09An-`,values:{0:n.targetSha7}}),t[0]=o,t[1]=n.targetSha7,t[2]=i,t[3]=e,t[4]=r):(e=t[3],r=t[4]);let s=e,c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(nl,{className:`size-3 shrink-0`,"aria-hidden":!0}),t[5]=c):c=t[5];let l;return t[6]!==n.targetSha7||t[7]!==s||t[8]!==a||t[9]!==r?(l=(0,Z.jsxs)(`div`,{className:`flex items-center gap-1 text-xs text-muted-foreground`,children:[c,r?(0,Z.jsx)(`button`,{type:`button`,className:`truncate text-left underline-offset-2 hover:text-foreground hover:underline`,title:s,onClick:e=>{e.stopPropagation(),a(n.targetSha7)},children:s}):(0,Z.jsx)(`span`,{className:`truncate`,title:s,children:s})]}),t[6]=n.targetSha7,t[7]=s,t[8]=a,t[9]=r,t[10]=l):l=t[10],l}if(n.kind===`rename`){let e=`${n.from} → ${n.to}`,r;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(yh,{className:`size-3 shrink-0`,"aria-hidden":!0}),t[11]=r):r=t[11];let i;t[12]!==o||t[13]!==n.from||t[14]!==n.to?(i=o({id:`GkYV_4`,values:{0:Hb(n.from),1:Hb(n.to)}}),t[12]=o,t[13]=n.from,t[14]=n.to,t[15]=i):i=t[15];let a;t[16]===i?a=t[17]:(a=(0,Z.jsx)(`span`,{className:`truncate`,children:i}),t[16]=i,t[17]=a);let s;return t[18]!==e||t[19]!==a?(s=(0,Z.jsxs)(`p`,{className:`flex items-center gap-1 truncate text-xs text-muted-foreground`,title:e,children:[r,a]}),t[18]=e,t[19]=a,t[20]=s):s=t[20],s}if(n.kind===`reconcile`){let e;t[21]===o?e=t[22]:(e=o({id:`0qyKG6`}),t[21]=o,t[22]=e);let n;return t[23]===e?n=t[24]:(n=(0,Z.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:e}),t[23]=e,t[24]=n),n}if(n.kind===`recovered`)return null;if(r.length>0){let e;t[25]===r?e=t[26]:(e=r.join(`, `),t[25]=r,t[26]=e);let n;t[27]===r?n=t[28]:(n=r.join(`, `),t[27]=r,t[28]=n);let i;return t[29]!==e||t[30]!==n?(i=(0,Z.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,title:e,children:n}),t[29]=e,t[30]=n,t[31]=i):i=t[31],i}if(n.kind===`upstream`)return null;let s;t[32]===o?s=t[33]:(s=o({id:`MRZxAn`}),t[32]=o,t[33]=s);let c;return t[34]===s?c=t[35]:(c=(0,Z.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:s}),t[34]=s,t[35]=c),c}function Xb(e){let t=(0,$.c)(122),{entry:n,isDark:r,docName:i,laterEdits:a,onRestoreSuccess:o,versionBySha7:s,onJumpToVersion:c,registerRowRef:l,flashing:u}=e,{_:d}=gt(),f;t[0]===n.timestamp?f=t[1]:(f=zb(n.timestamp),t[0]=n.timestamp,t[1]=f);let p=f,m;t[2]===n?m=t[3]:(m=Ub(n),t[2]=n,t[3]=m);let h=m,g;t[4]===n.timestamp?g=t[5]:(g=Bb(n.timestamp),t[4]=n.timestamp,t[5]=g);let _=g,v;t[6]===n.contributors?v=t[7]:(v=n.contributors.flatMap(Zb),t[6]=n.contributors,t[7]=v);let y=v,b;t[8]===n?b=t[9]:(b=Gb(n),t[8]=n,t[9]=b);let x=b,S;t[10]===n?S=t[11]:(S=Vb(n),t[10]=n,t[11]=S);let C=S,[w,T]=(0,Q.useState)(!1),[E,D]=(0,Q.useState)(!1),O=(0,Q.useRef)(null),k=pl(),A=k?.docName===i&&k.sha===n.sha,j,M;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(j=()=>()=>O.current?.abort(),M=[],t[12]=j,t[13]=M):(j=t[12],M=t[13]),(0,Q.useEffect)(j,M);let N;t[14]!==_||t[15]!==h||t[16]!==i||t[17]!==n.parentSha||t[18]!==n.sha||t[19]!==a||t[20]!==p?(N=()=>{tf(),fl({docName:i,sha:n.sha,parentSha:n.parentSha??null,laterEdits:a,authorName:h,relativeTime:p,absoluteTime:_})},t[14]=_,t[15]=h,t[16]=i,t[17]=n.parentSha,t[18]=n.sha,t[19]=a,t[20]=p,t[21]=N):N=t[21];let P=N,F;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(F=function(){O.current?.abort(),O.current=null,D(!1),T(!1)},t[22]=F):F=t[22];let I=F,L;t[23]!==d||t[24]!==i||t[25]!==n.sha||t[26]!==o?(L=async function(){D(!0);let e=new AbortController;O.current=e;let t=function(){e.signal.aborted||D(!1),O.current===e&&(O.current=null)},r;try{r=await fetch(`/api/rollback`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({docName:i,commitSha:n.sha}),signal:e.signal})}catch(r){let a=r;!e.signal.aborted&&!(a instanceof DOMException&&a.name===`AbortError`)&&(console.error(`[timeline] rollback fetch failed`,{docName:i,sha:n.sha,err:a}),gl.error(d({id:`NkXEFS`}),{duration:4e3})),t();return}if(e.signal.aborted){t();return}if(r.ok)T(!1),o();else{let e=`HTTP ${r.status}`;try{let t=uo.safeParse(await r.json());t.success&&(e=t.data.title)}catch{}console.error(`[timeline] rollback failed`,{docName:i,sha:n.sha,status:r.status,detail:e}),gl.error(d({id:`uM6jnS`}),{description:e,duration:6e3})}t()},t[23]=d,t[24]=i,t[25]=n.sha,t[26]=o,t[27]=L):L=t[27];let R=L,z;t[28]!==n||t[29]!==r?(z=(0,Z.jsx)(Wb,{entry:n,isDark:r}),t[28]=n,t[29]=r,t[30]=z):z=t[30];let B=z,V=u?`ring-2 ring-ring ring-offset-1 ring-offset-background`:``,H;t[31]===V?H=t[32]:(H=[`flex flex-col rounded-lg transition-shadow`,V],t[31]=V,t[32]=H);let U=H.join(` `),W=A?`bg-muted`:`hover:bg-muted/80`,G;t[33]===W?G=t[34]:(G=[`group flex w-full items-start gap-2.5 rounded-lg px-3 py-2.5 text-left transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-ring`,W],t[33]=W,t[34]=G);let K=G.join(` `),ee;t[35]===P?ee=t[36]:(ee=e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),P())},t[35]=P,t[36]=ee);let te;t[37]===B?te=t[38]:(te=(0,Z.jsx)(`span`,{className:`mt-0.5 shrink-0`,children:B}),t[37]=B,t[38]=te);let ne;t[39]===h?ne=t[40]:(ne=(0,Z.jsx)(`span`,{className:`truncate text-xs text-foreground`,children:h}),t[39]=h,t[40]=ne);let q;t[41]!==n.timestamp||t[42]!==p?(q=(0,Z.jsx)(`time`,{className:`ml-auto shrink-0 text-xs text-muted-foreground/80`,dateTime:n.timestamp,title:n.timestamp,children:p}),t[41]=n.timestamp,t[42]=p,t[43]=q):q=t[43];let re;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`h-3 w-px shrink-0 bg-border`}),t[44]=re):re=t[44];let ie;t[45]===d?ie=t[46]:(ie=d({id:`Yea-K5`}),t[45]=d,t[46]=ie);let ae;t[47]!==R||t[48]!==a?(ae=e=>{e.stopPropagation(),a>0?T(!0):R()},t[47]=R,t[48]=a,t[49]=ae):ae=t[49];let oe;t[50]===E?oe=t[51]:(oe=E?(0,Z.jsx)(Xc,{className:`size-3 animate-spin`}):(0,Z.jsx)(dl,{className:`size-3`}),t[50]=E,t[51]=oe);let se;t[52]!==E||t[53]!==ie||t[54]!==ae||t[55]!==oe?(se=(0,Z.jsx)(on,{asChild:!0,children:(0,Z.jsx)(X,{variant:`ghost`,size:`icon`,className:`size-5 shrink-0 text-muted-foreground hover:text-destructive`,"data-testid":`timeline-entry-restore`,"aria-label":ie,disabled:E,onClick:ae,children:oe})}),t[52]=E,t[53]=ie,t[54]=ae,t[55]=oe,t[56]=se):se=t[56];let ce;t[57]===d?ce=t[58]:(ce=d({id:`Yea-K5`}),t[57]=d,t[58]=ce);let le;t[59]===ce?le=t[60]:(le=(0,Z.jsx)(sn,{side:`top`,children:ce}),t[59]=ce,t[60]=le);let ue;t[61]!==se||t[62]!==le?(ue=(0,Z.jsxs)(ln,{children:[se,le]}),t[61]=se,t[62]=le,t[63]=ue):ue=t[63];let de;t[64]!==ne||t[65]!==q||t[66]!==ue?(de=(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[ne,q,re,ue]}),t[64]=ne,t[65]=q,t[66]=ue,t[67]=de):de=t[67];let fe;t[68]===x?fe=t[69]:(fe=x.length>0&&(0,Z.jsx)(Kb,{summaries:x}),t[68]=x,t[69]=fe);let pe;t[70]!==y||t[71]!==C||t[72]!==c||t[73]!==s?(pe=(0,Z.jsx)(Yb,{descriptor:C,allDocs:y,versionBySha7:s,onJumpToVersion:c}),t[70]=y,t[71]=C,t[72]=c,t[73]=s,t[74]=pe):pe=t[74];let me;t[75]!==de||t[76]!==fe||t[77]!==pe?(me=(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[de,fe,pe]}),t[75]=de,t[76]=fe,t[77]=pe,t[78]=me):me=t[78];let he;t[79]!==P||t[80]!==A||t[81]!==K||t[82]!==ee||t[83]!==te||t[84]!==me?(he=(0,Z.jsxs)(`div`,{role:`button`,tabIndex:0,"aria-pressed":A,"data-testid":`timeline-entry-open`,className:K,onClick:P,onKeyDown:ee,children:[te,me]}),t[79]=P,t[80]=A,t[81]=K,t[82]=ee,t[83]=te,t[84]=me,t[85]=he):he=t[85];let ge;t[86]!==l||t[87]!==U||t[88]!==he?(ge=(0,Z.jsx)(`div`,{ref:l,className:U,children:he}),t[86]=l,t[87]=U,t[88]=he,t[89]=ge):ge=t[89];let _e;t[90]===Symbol.for(`react.memo_cache_sentinel`)?(_e=e=>{e?T(!0):I()},t[90]=_e):_e=t[90];let ve;t[91]===d?ve=t[92]:(ve=d({id:`n3wx1q`}),t[91]=d,t[92]=ve);let ye;t[93]===ve?ye=t[94]:(ye=(0,Z.jsx)(mn,{children:ve}),t[93]=ve,t[94]=ye);let be;t[95]===a?be=t[96]:(be=(0,Z.jsx)(J,{id:`nfPccR`,values:{laterEdits:a}}),t[95]=a,t[96]=be);let xe;t[97]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,Z.jsx)(J,{id:`5ZbJFS`}),t[97]=xe):xe=t[97];let Se;t[98]===be?Se=t[99]:(Se=(0,Z.jsxs)(pn,{children:[be,` `,xe]}),t[98]=be,t[99]=Se);let Ce;t[100]!==ye||t[101]!==Se?(Ce=(0,Z.jsxs)(vn,{children:[ye,Se]}),t[100]=ye,t[101]=Se,t[102]=Ce):Ce=t[102];let we;t[103]===Symbol.for(`react.memo_cache_sentinel`)?(we=(0,Z.jsx)(X,{variant:`outline`,"data-testid":`timeline-entry-restore-cancel`,onClick:I,children:(0,Z.jsx)(J,{id:`dEgA5A`})}),t[103]=we):we=t[103];let Te;t[104]===R?Te=t[105]:(Te=()=>R(),t[104]=R,t[105]=Te);let Ee;t[106]===E?Ee=t[107]:(Ee=E?(0,Z.jsx)(Xc,{className:`mr-2 size-4 animate-spin`}):null,t[106]=E,t[107]=Ee);let De;t[108]===Symbol.for(`react.memo_cache_sentinel`)?(De=(0,Z.jsx)(J,{id:`yKu_3Y`}),t[108]=De):De=t[108];let Oe;t[109]!==E||t[110]!==Te||t[111]!==Ee?(Oe=(0,Z.jsxs)(_n,{children:[we,(0,Z.jsxs)(X,{variant:`destructive`,"data-testid":`timeline-entry-restore-confirm`,disabled:E,onClick:Te,children:[Ee,De]})]}),t[109]=E,t[110]=Te,t[111]=Ee,t[112]=Oe):Oe=t[112];let ke;t[113]!==Ce||t[114]!==Oe?(ke=(0,Z.jsxs)(hn,{children:[Ce,Oe]}),t[113]=Ce,t[114]=Oe,t[115]=ke):ke=t[115];let Ae;t[116]!==w||t[117]!==ke?(Ae=(0,Z.jsx)(yn,{open:w,onOpenChange:_e,children:ke}),t[116]=w,t[117]=ke,t[118]=Ae):Ae=t[118];let je;return t[119]!==ge||t[120]!==Ae?(je=(0,Z.jsxs)(Z.Fragment,{children:[ge,Ae]}),t[119]=ge,t[120]=Ae,t[121]=je):je=t[121],je}function Zb(e){return e.docs}function Qb(e){let t=(0,$.c)(27),{docName:n}=e,{_:r}=gt(),{resolvedTheme:i}=Lt(),a=i===`dark`,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=[],t[0]=o):o=t[0];let[s,c]=(0,Q.useState)(o),[l,u]=(0,Q.useState)(!1),[d,f]=(0,Q.useState)(null),p=(0,Q.useRef)(new Map),[m,h]=(0,Q.useState)(null),g=(0,Q.useRef)(null),_=new Map;for(let e of s)_.set(e.sha.slice(0,7),e);let v,y;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(v=()=>()=>clearTimeout(g.current??void 0),y=[],t[1]=v,t[2]=y):(v=t[1],y=t[2]),(0,Q.useEffect)(v,y);let b=function(e){let t=_.get(e);t&&(p.current.get(t.sha)?.scrollIntoView({behavior:`smooth`,block:`center`}),h(t.sha),clearTimeout(g.current??void 0),g.current=setTimeout(()=>h(null),1600))},x;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(x=function(){ml()},t[3]=x):x=t[3];let S=x,C,w;t[4]!==r||t[5]!==n?(C=()=>{if(!n){c([]);return}u(!0);let e=Pb({baseMs:Fb,maxBackoffMs:Ib,isPaused:ex,poll:e=>Lb(n,e,{setEntries:c,setError:f,setLoading:u,unavailableMessage:r({id:`brCtGB`})})});e.start();let t=()=>e.resume();return typeof document<`u`&&document.addEventListener(`visibilitychange`,t),()=>{e.stop(),typeof document<`u`&&document.removeEventListener(`visibilitychange`,t)}},w=[n,r],t[4]=r,t[5]=n,t[6]=C,t[7]=w):(C=t[6],w=t[7]),(0,Q.useEffect)(C,w);let T;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Z.jsx)(Hd,{children:(0,Z.jsx)(Wd,{children:(0,Z.jsx)(J,{id:`cklVjM`})})}),t[8]=T):T=t[8];let E;t[9]!==r||t[10]!==l?(E=l&&(0,Z.jsx)(`div`,{className:`flex flex-col gap-1 p-2`,role:`status`,"aria-busy":`true`,"aria-label":r({id:`o49mDZ`}),children:[1,2,3].map($b)}),t[9]=r,t[10]=l,t[11]=E):E=t[11];let D;t[12]!==d||t[13]!==l?(D=!l&&d&&(0,Z.jsx)(`div`,{className:`px-4 py-3`,children:(0,Z.jsx)(`p`,{className:`text-xs text-destructive`,children:d})}),t[12]=d,t[13]=l,t[14]=D):D=t[14];let O;t[15]!==s||t[16]!==d||t[17]!==l?(O=!l&&!d&&s.length===0&&(0,Z.jsx)(`div`,{className:`px-4 py-8 text-center`,children:(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,Z.jsx)(J,{id:`Ta25TG`})})}),t[15]=s,t[16]=d,t[17]=l,t[18]=O):O=t[18];let k=!l&&!d&&s.length>0&&(0,Z.jsx)(`div`,{className:`flex flex-col gap-1 p-2`,children:s.map((e,t)=>(0,Z.jsx)(Xb,{entry:e,isDark:a,docName:n,laterEdits:t,onRestoreSuccess:S,versionBySha7:_,onJumpToVersion:b,registerRowRef:t=>{t?p.current.set(e.sha,t):p.current.delete(e.sha)},flashing:m===e.sha},e.sha))}),A;t[19]!==E||t[20]!==D||t[21]!==O||t[22]!==k?(A=(0,Z.jsxs)(`div`,{className:`flex-1 overflow-y-auto subtle-scrollbar scroll-fade-mask`,children:[E,D,O,k]}),t[19]=E,t[20]=D,t[21]=O,t[22]=k,t[23]=A):A=t[23];let j;return t[24]!==A||t[25]!==T?(j=(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[T,A]}),t[24]=A,t[25]=T,t[26]=j):j=t[26],j}function $b(e){return(0,Z.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded-lg px-3 py-2.5`,children:[(0,Z.jsx)(Jd,{className:`size-3.5 rounded mt-0.5 shrink-0`}),(0,Z.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,Z.jsx)(Jd,{className:`h-3 w-28`}),(0,Z.jsx)(Jd,{className:`h-3 w-40`})]})]},e)}function ex(){return typeof document<`u`&&document.visibilityState===`hidden`}var tx=`open-knowledge:lint-source-fixed`,nx=Object.freeze({source:`local`,skipStoreHooks:!1,context:Object.freeze({origin:`lint-fix`})});function rx(e,t){let n=e.split(`
3
+ `),r=0;for(let e=0;e<t.line&&e<n.length;e+=1)r+=n[e].length+1;let i=n[Math.min(t.line,n.length-1)]?.length??0;return r+Math.min(Math.max(t.character,0),i)}function ix(e){return e.flatMap(e=>e.fixes??[])}function ax(e,t){if(t.length===0)return!1;let n=e.document.getText(`source`),r=n.toString(),i=t.map(e=>({from:rx(r,e.range.start),to:rx(r,e.range.end),insert:e.newText})).sort((e,t)=>t.to-e.to||t.from-e.from||e.insert.localeCompare(t.insert));return e.document.transact(()=>{let e=1/0,t;for(let r of i){let i=t!==void 0&&r.from===t.from&&r.to===t.to&&r.insert===t.insert;t=r,!(i||r.to>e)&&(r.to>r.from&&n.delete(r.from,r.to-r.from),r.insert.length>0&&n.insert(r.from,r.insert),e=r.from)}},nx),typeof window<`u`&&window.dispatchEvent(new CustomEvent(tx)),!0}var ox=300;function sx(e,t){let n=(0,$.c)(7),r;n[0]===t?r=n[1]:(r=t?.enabled?JSON.stringify(t):null,n[0]=t,n[1]=r);let i=r,a;n[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=[],n[2]=a):a=n[2];let[o,s]=(0,Q.useState)(a),c,l;return n[3]!==i||n[4]!==e?(c=()=>{if(!e||i===null){s(cx);return}let t=JSON.parse(i),n=e.document.getText(`source`),r=null,a=!1,o=e.configuration.name,c=()=>void xi(n.toString(),t,o).then(e=>{a||s(e)}).catch(e=>{a||console.warn(`[lint] lintDocument failed`,e)}),l=()=>{r&&clearTimeout(r),r=setTimeout(c,ox)};return c(),n.observe(l),()=>{a=!0,r&&clearTimeout(r),n.unobserve(l)}},l=[e,i],n[3]=i,n[4]=e,n[5]=c,n[6]=l):(c=n[5],l=n[6]),(0,Q.useEffect)(c,l),o}function cx(e){return e.length===0?e:[]}var lx=[{id:`outline`,icon:Qh},{id:`links`,icon:Be},{id:`graph`,icon:ng},{id:`timeline`,icon:Dh},{id:`problems`,icon:ul}];function ux(e){let t=0,n=0;for(let r of e)r.severity===`error`?t+=1:n+=1;return{errorCount:t,warningCount:n}}function dx(e){return e===`outline`?Cl._({id:`dD7NPy`}):e===`links`?Cl._({id:`Rj01Fz`}):e===`graph`?Cl._({id:`x2fr_j`}):e===`problems`?Cl._({id:`OXdGnd`}):Cl._({id:`cklVjM`})}function fx(){return n(()=>import(`./GraphPanel-CqaIMvPS.js`),__vite__mapDeps([46,1,6,2,3,7,8,9,47,10,11,12,15,16,48,14,17,49,50,26,22,29,30,31,19,24,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,40,68,69,70,43]),import.meta.url)}var px=(0,Q.lazy)(async()=>({default:(await fx()).GraphPanel})),mx=(0,Q.lazy)(async()=>({default:(await n(()=>import(`./ActivityModeContent-C2P34Oxp.js`),__vite__mapDeps([71,1,47,10,11,12,23,14,15,16,17,24,25,26,22,27,29,30,31,19,72,2,73,74,9,75,76,77,78,79,80,81,82,83,6,3,7,8,84,68,85,86,87,4,88,49,18,20,36,35,89,90,37,38,40,61,62,63,43,65,91,92,28,32,60,64,66,67,93,94,95,96,33,21,97,98,99,100,39,41,101,102,103,104,105,106,107,108,109]),import.meta.url)).ActivityModeContent}));function hx(e){let t=(0,$.c)(45),{docName:n,isSourceMode:r,activeTab:i,onActiveTabChange:a,mode:o}=e,{_:s}=gt(),{activeProvider:c,activeDocName:l}=Ye(),{data:u}=Zd(n),d=l===n?c:null,f=sx(d,u?.effective??null),p=Ed(n),m;t[0]!==p||t[1]!==f?(m=[...f,...p],t[0]=p,t[1]=f,t[2]=m):m=t[2];let h=m,g,_;t[3]!==n||t[4]!==f||t[5]!==d?(g=()=>{d!==null&&wd(n,`lint`,ux(f))},_=[n,d,f],t[3]=n,t[4]=f,t[5]=d,t[6]=g,t[7]=_):(g=t[6],_=t[7]),(0,Q.useEffect)(g,_);let v,y;t[8]!==n||t[9]!==p||t[10]!==d?(v=()=>{d!==null&&wd(n,`links`,ux(p))},y=[n,d,p],t[8]=n,t[9]=p,t[10]=d,t[11]=v,t[12]=y):(v=t[11],y=t[12]),(0,Q.useEffect)(v,y);let b;t[13]===d?b=t[14]:(b=e=>{d!==null&&e.fixes&&e.fixes.length>0&&ax(d,e.fixes)},t[13]=d,t[14]=b);let x=b,S;t[15]!==f||t[16]!==d?(S=()=>{d!==null&&ax(d,ix(f))},t[15]=f,t[16]=d,t[17]=S):S=t[17];let C=S,w=es(),T;t[18]!==n||t[19]!==d?(T=e=>{if(d===null)return;let t=d.document.getText(`source`).toString().split(`
4
+ `)[e.range.start.line];Jt(bb(n,e,t),{submit:!0})},t[18]=n,t[19]=d,t[20]=T):T=t[20];let E=T,D=Jv(),O,k,A;if(t[21]!==s||t[22]!==i||t[23]!==h||t[24]!==o||t[25]!==a||t[26]!==D){let e=D?lx.filter(gx):lx;O=e.some(e=>e.id===i)?i:`outline`,k=o===`doc`&&e.length>1,A=k?(0,Z.jsx)(`div`,{className:`flex flex-row items-center justify-center gap-3 p-2`,children:(0,Z.jsx)(Wr,{type:`single`,variant:`outline`,value:O,onValueChange:e=>{e&&a(e)},"aria-label":s({id:`SrOuyg`}),children:e.map(e=>{let{id:t,icon:n}=e,r=dx(t),i=t===`problems`&&h.length>0;return(0,Z.jsxs)(ln,{children:[(0,Z.jsx)(Hr,{value:t,role:`tab`,id:`tab-${t}`,"aria-controls":`panel-${t}`,"aria-label":i?s({id:`2m_bmh`,values:{0:h.length,label:r}}):r,asChild:!0,children:(0,Z.jsxs)(on,{className:`relative`,children:[(0,Z.jsx)(n,{}),i&&(0,Z.jsx)(Eu,{variant:`destructive`,"aria-hidden":`true`,className:`absolute -right-1.5 -top-1.5 h-4 min-w-4 rounded-full px-1 text-[10px] leading-none`,children:h.length>99?`99+`:h.length})]})}),(0,Z.jsx)(sn,{side:`bottom`,children:r})]},t)})})}):null,t[21]=s,t[22]=i,t[23]=h,t[24]=o,t[25]=a,t[26]=D,t[27]=O,t[28]=k,t[29]=A}else O=t[27],k=t[28],A=t[29];let j;t[30]!==h||t[31]!==n||t[32]!==O||t[33]!==E||t[34]!==x||t[35]!==C||t[36]!==r||t[37]!==d||t[38]!==o||t[39]!==k||t[40]!==w?(j=o===`doc`?(0,Z.jsxs)(`div`,{...k?{role:`tabpanel`,id:`panel-${O}`,"aria-labelledby":`tab-${O}`}:{},className:`min-h-0 flex-1`,children:[O===`outline`&&(0,Z.jsx)(yd,{docName:n,isSourceMode:r}),O===`links`&&(0,Z.jsx)(Nb,{docName:n}),O===`graph`&&(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`-lCAuQ`})}),children:(0,Z.jsx)(px,{activeDocName:n})}),O===`timeline`&&(0,Z.jsx)(Qb,{docName:n}),O===`problems`&&(0,Z.jsx)(Od,{docName:n,diagnostics:h,onFix:d===null?void 0:x,onFixAll:d===null?void 0:C,onAskAi:d!==null&&w!==null?E:void 0})]}):(0,Z.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsx)(`div`,{role:`status`,"aria-busy":`true`,className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`ONPvOb`})}),children:(0,Z.jsx)(mx,{})})}),t[30]=h,t[31]=n,t[32]=O,t[33]=E,t[34]=x,t[35]=C,t[36]=r,t[37]=d,t[38]=o,t[39]=k,t[40]=w,t[41]=j):j=t[41];let M;return t[42]!==j||t[43]!==A?(M=(0,Z.jsxs)(Z.Fragment,{children:[A,j]}),t[42]=j,t[43]=A,t[44]=M):M=t[44],M}function gx(e){return e.id===`outline`||e.id===`problems`}function _x(e,t){let n=getComputedStyle(e);return t*parseFloat(n.fontSize)}function vx(e,t){let n=getComputedStyle(e.ownerDocument.documentElement);return t*parseFloat(n.fontSize)}function yx(e){return e/100*window.innerHeight}function bx(e){return e/100*window.innerWidth}function xx(e){switch(typeof e){case`number`:return[e,`px`];case`string`:{let t=parseFloat(e);return e.endsWith(`%`)?[t,`%`]:e.endsWith(`px`)?[t,`px`]:e.endsWith(`rem`)?[t,`rem`]:e.endsWith(`em`)?[t,`em`]:e.endsWith(`vh`)?[t,`vh`]:e.endsWith(`vw`)?[t,`vw`]:[t,`%`]}}}function Sx({groupSize:e,panelElement:t,styleProp:n}){let r,[i,a]=xx(n);switch(a){case`%`:r=i/100*e;break;case`px`:r=i;break;case`rem`:r=vx(t,i);break;case`em`:r=_x(t,i);break;case`vh`:r=yx(i);break;case`vw`:r=bx(i);break}return r}function Cx(e){return parseFloat(e.toFixed(3))}function wx({group:e}){let{orientation:t,panels:n}=e;return n.reduce((e,n)=>(e+=t===`horizontal`?n.element.offsetWidth:n.element.offsetHeight,e),0)}function Tx(e){let{panels:t}=e,n=wx({group:e});return n===0?t.map(e=>({groupResizeBehavior:e.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:e.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:e.panelConstraints.disabled,minSize:0,maxSize:100,panelId:e.id})):t.map(e=>{let{element:t,panelConstraints:r}=e,i=0;r.collapsedSize!==void 0&&(i=Cx(Sx({groupSize:n,panelElement:t,styleProp:r.collapsedSize})/n*100));let a;r.defaultSize!==void 0&&(a=Cx(Sx({groupSize:n,panelElement:t,styleProp:r.defaultSize})/n*100));let o=0;r.minSize!==void 0&&(o=Cx(Sx({groupSize:n,panelElement:t,styleProp:r.minSize})/n*100));let s=100;return r.maxSize!==void 0&&(s=Cx(Sx({groupSize:n,panelElement:t,styleProp:r.maxSize})/n*100)),{groupResizeBehavior:r.groupResizeBehavior,collapsedSize:i,collapsible:r.collapsible===!0,defaultSize:a,disabled:r.disabled,minSize:o,maxSize:s,panelId:e.id}})}function Ex(e,t=`Assertion error`){if(!e)throw Error(t)}function Dx(e,t){return Array.from(t).sort(e===`horizontal`?Ox:kx)}function Ox(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return n===0?e.element.offsetWidth-t.element.offsetWidth:n}function kx(e,t){let n=e.element.offsetTop-t.element.offsetTop;return n===0?e.element.offsetHeight-t.element.offsetHeight:n}function Ax(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE}function jx(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function Mx({orientation:e,rects:t,targetRect:n}){let r={x:n.x+n.width/2,y:n.y+n.height/2},i,a=Number.MAX_VALUE;for(let n of t){let{x:t,y:o}=jx(r,n),s=e===`horizontal`?t:o;s<a&&(a=s,i=n)}return Ex(i,`No rect found`),i}var Nx;function Px(){return Nx===void 0&&(Nx=typeof matchMedia==`function`?!!matchMedia(`(pointer:coarse)`).matches:!1),Nx}function Fx(e){let{element:t,orientation:n,panels:r,separators:i}=e,a=Dx(n,Array.from(t.children).filter(Ax).map(e=>({element:e}))).map(({element:e})=>e),o=[],s=!1,c=!1,l=-1,u=-1,d=0,f,p=[];{let e=-1;for(let t of a)t.hasAttribute(`data-panel`)&&(e++,t.hasAttribute(`data-disabled`)||(d++,l===-1&&(l=e),u=e))}if(d>1){let t=-1;for(let d of a)if(d.hasAttribute(`data-panel`)){t++;let i=r.find(e=>e.element===d);if(i){if(f){let r=f.element.getBoundingClientRect(),a=d.getBoundingClientRect(),m;if(c){let e=n===`horizontal`?new DOMRect(r.right,r.top,0,r.height):new DOMRect(r.left,r.bottom,r.width,0),t=n===`horizontal`?new DOMRect(a.left,a.top,0,a.height):new DOMRect(a.left,a.top,a.width,0);switch(p.length){case 0:m=[e,t];break;case 1:{let i=p[0];m=[i,Mx({orientation:n,rects:[r,a],targetRect:i.element.getBoundingClientRect()})===r?t:e];break}default:m=p;break}}else m=p.length?p:[n===`horizontal`?new DOMRect(r.right,a.top,a.left-r.right,a.height):new DOMRect(a.left,r.bottom,a.width,a.top-r.bottom)];for(let n of m){let r=`width`in n?n:n.element.getBoundingClientRect(),a=Px()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(r.width<a){let e=a-r.width;r=new DOMRect(r.x-e/2,r.y,r.width+e,r.height)}if(r.height<a){let e=a-r.height;r=new DOMRect(r.x,r.y-e/2,r.width,r.height+e)}!s&&!(t<=l||t>u)&&o.push({group:e,groupSize:wx({group:e}),panels:[f,i],separator:`width`in n?void 0:n,rect:r}),s=!1}}c=!1,f=i,p=[]}}else if(d.hasAttribute(`data-separator`)){d.ariaDisabled!==null&&(s=!0);let e=i.find(e=>e.element===d);e?p.push(e):(f=void 0,p=[])}else c=!0}return o}var Ix=class{#e={};addListener(e,t){let n=this.#e[e];return n===void 0?this.#e[e]=[t]:n.includes(t)||n.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let n=this.#e[e];if(n!==void 0)if(n.length===1)n[0].call(null,t);else{let e=!1,r=null,i=Array.from(n);for(let n=0;n<i.length;n++){let a=i[n];try{a.call(null,t)}catch(t){r===null&&(e=!0,r=t)}}if(e)throw r}}removeAllListeners(){this.#e={}}removeListener(e,t){let n=this.#e[e];if(n!==void 0){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}},Lx={cursorFlags:0,state:`inactive`},Rx=new Ix;function zx(){return Lx}function Bx(e){return Rx.addListener(`change`,e)}function Vx(e){let t=Lx,n={...Lx};n.cursorFlags=e,Lx=n,Rx.emit(`change`,{prev:t,next:n})}function Hx(e){let t=Lx;Lx=e,Rx.emit(`change`,{prev:t,next:e})}var Ux=e=>e,Wx=()=>{},Gx=1,Kx=2,qx=4,Jx=8,Yx=3,Xx=12,Zx;function Qx(){return Zx===void 0&&(Zx=!1,typeof window<`u`&&(window.navigator.userAgent.includes(`Chrome`)||window.navigator.userAgent.includes(`Firefox`))&&(Zx=!0)),Zx}function $x({cursorFlags:e,groups:t,state:n}){let r=0,i=0;switch(n){case`active`:case`hover`:t.forEach(e=>{if(!e.mutableState.disableCursor)switch(e.orientation){case`horizontal`:r++;break;case`vertical`:i++;break}})}if(!(r===0&&i===0)){switch(n){case`active`:if(e&&Qx()){let t=(e&Gx)!==0,n=(e&Kx)!==0,r=(e&qx)!==0,i=(e&Jx)!==0;if(t)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}break}return Qx()?r>0&&i>0?`move`:r>0?`ew-resize`:`ns-resize`:r>0&&i>0?`grab`:r>0?`col-resize`:`row-resize`}}var eS=new WeakMap;function tS(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=eS.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&(Object.isExtensible(e.adoptedStyleSheets)?e.adoptedStyleSheets.push(n):e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]));let r=zx();switch(r.state){case`active`:case`hover`:{let e=$x({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(e=>e.group),state:r.state}),i=`*, *:hover {cursor: ${e} !important; }`;if(t===i)return;t=i,e?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case`inactive`:t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}eS.set(e,{prevStyle:t,styleSheet:n})}var nS=new Map,rS=new Ix;function iS(e){nS=new Map(nS),nS.delete(e)}function aS(e,t){for(let[t]of nS)if(t.id===e)return t}function oS(e,t){for(let[t,n]of nS)if(t.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function sS(){return nS}function cS(e,t){return rS.addListener(`groupChange`,n=>{n.group.id===e&&t(n)})}function lS(e,t,n){let r=nS.get(e);nS=new Map(nS),nS.set(e,t),rS.emit(`groupChange`,{group:e,isUserInteraction:n?.isUserInteraction===!0,prev:r,next:t})}function uS(e){let t=zx(),n=!1;switch(t.state){case`active`:Hx({cursorFlags:0,state:`inactive`}),t.hitRegions.length>0&&(tS(e),n=!0,t.hitRegions.forEach(e=>{let t=oS(e.group.id,!0);lS(e.group,t,{isUserInteraction:!0})}))}return n}function dS(e){e.defaultPrevented||uS(e.currentTarget)}function fS(e,t,n){let r,i={x:1/0,y:1/0};for(let a of t){let t=jx(n,a.rect);switch(e){case`horizontal`:t.x<=i.x&&(r=a,i=t);break;case`vertical`:t.y<=i.y&&(r=a,i=t);break}}return r?{distance:i,hitRegion:r}:void 0}function pS(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function mS(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:bS(e),b:bS(t)},r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();Ex(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:yS(vS(n.a)),b:yS(vS(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var hS=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function gS(e){let t=getComputedStyle(xS(e)??e).display;return t===`flex`||t===`inline-flex`}function _S(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||gS(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||hS.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function vS(e){let t=e.length;for(;t--;){let n=e[t];if(Ex(n,`Missing node`),_S(n))return n}return null}function yS(e){return e&&Number(getComputedStyle(e).zIndex)||0}function bS(e){let t=[];for(;e;)t.push(e),e=xS(e);return t}function xS(e){let{parentNode:t}=e;return pS(t)?t.host:t}function SS(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function CS({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!Ax(n)||n.contains(e)||e.contains(n))return!0;if(mS(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(SS(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function wS(e,t){let n=[];return t.forEach((t,r)=>{if(r.disabled)return;let i=Fx(r),a=fS(r.orientation,i,{x:e.clientX,y:e.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&CS({groupElement:r.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function TS(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function ES(e,t,n=0){return Math.abs(Cx(e)-Cx(t))<=n}function DS(e,t){return ES(e,t)?0:e>t?1:-1}function OS({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){let{collapsedSize:i=0,collapsible:a,disabled:o,maxSize:s=100,minSize:c=0}=t;if(o&&!e)return n;if(DS(r,c)<0)if(a){let e=(i+c)/2;r=DS(r,e)<0?i:c}else r=c;return r=Math.min(s,r),r=Cx(r),r}function kS({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(ES(e,0))return t;let o=a===`imperative-api`,s=Object.values(t),c=Object.values(i),l=[...s],[u,d]=r;Ex(u!=null,`Invalid first pivot index`),Ex(d!=null,`Invalid second pivot index`);let f=0;switch(a){case`keyboard`:{let t=e<0?d:u,r=n[t];Ex(r,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(Ex(n!=null,`Previous layout not found for panel index ${t}`),ES(n,i)){let t=o-n;DS(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?u:d,r=n[t];Ex(r,`No panel constraints found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(Ex(n!=null,`Previous layout not found for panel index ${t}`),ES(n,o)){let t=n-i;DS(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}break;default:{let t=e<0?d:u,r=n[t];Ex(r,`Panel constraints not found for index ${t}`);let i=s[t],{collapsible:a,collapsedSize:o,minSize:c}=r;if(a&&DS(i,c)<0)if(e>0){let t=c-o,n=t/2;DS(i+e,c)<0&&(e=DS(e,n)<=0?0:t)}else{let t=c-o,n=100-t/2;DS(i-e,c)<0&&(e=DS(100+e,n)>0?0:-t)}break}}{let t=e<0?1:-1,r=e<0?d:u,i=0;for(;;){let e=s[r];Ex(e!=null,`Previous layout not found for panel index ${r}`);let a=OS({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:e,size:100})-e;if(i+=a,r+=t,r<0||r>=n.length)break}let a=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-a:a}{let t=e<0?u:d;for(;t>=0&&t<n.length;){let r=Math.abs(e)-Math.abs(f),i=s[t];Ex(i!=null,`Previous layout not found for panel index ${t}`);let a=i-r,c=OS({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:i,size:a});if(!ES(i,c)&&(f+=i-c,l[t]=c,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if(TS(c,l))return i;{let t=e<0?d:u,r=s[t];Ex(r!=null,`Previous layout not found for panel index ${t}`);let i=r+f,a=OS({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:r,size:i});if(l[t]=a,!ES(a,i)){let t=i-a,r=e<0?d:u;for(;r>=0&&r<n.length;){let i=l[r];Ex(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=OS({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:i,size:a});if(ES(i,s)||(t-=s-i,l[r]=s),ES(t,0))break;e>0?r--:r++}}}if(!ES(Object.values(l).reduce((e,t)=>t+e,0),100,.1))return i;let p=Object.keys(i);return l.reduce((e,t,n)=>(e[p[n]]=t,e),{})}function AS(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(t[n]===void 0||DS(e[n],t[n])!==0)return!1;return!0}function jS({layout:e,panelConstraints:t}){let n=Object.values(e),r=[...n],i=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(`, `)}`);if(!ES(i,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];Ex(t!=null,`No layout data found for index ${e}`),r[e]=100/i*t}let a=0;for(let e=0;e<t.length;e++){let i=n[e];Ex(i!=null,`No layout data found for index ${e}`);let o=r[e];Ex(o!=null,`No layout data found for index ${e}`);let s=OS({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:i,size:o});o!=s&&(a+=o-s,r[e]=s)}if(!ES(a,0))for(let e=0;e<t.length;e++){let n=r[e];Ex(n!=null,`No layout data found for index ${e}`);let i=n+a,o=OS({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:n,size:i});if(n!==o&&(a-=o-n,r[e]=o,ES(a,0)))break}let o=Object.keys(e);return r.reduce((e,t,n)=>(e[o[n]]=t,e),{})}function MS({groupId:e,panelId:t}){let n=()=>{let t=sS();for(let[n,{defaultLayoutDeferred:r,derivedPanelConstraints:i,layout:a,groupSize:o,separatorToPanels:s}]of t)if(n.id===e)return{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:n,groupSize:o,layout:a,separatorToPanels:s};throw Error(`Group ${e} not found`)},r=()=>{let e=n().derivedPanelConstraints.find(e=>e.panelId===t);if(e!==void 0)return e;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{let e=n().group.panels.find(e=>e.id===t);if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},a=()=>{let e=n().layout[t];if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},o=({nextSize:e,panels:n,prevLayout:r,derivedPanelConstraints:i})=>{let o=a(),s=n.findIndex(e=>e.id===t),c=s===0,l=s===n.length-1;if(l&&e<o&&(c||n.slice(0,s).every((e,t)=>{let n=i[t];return n?.collapsible&&ES(n.collapsedSize,r[n.panelId])}))){let e=n.slice(0,s).reduce((e,t)=>e+r[t.id],0);return{...r,[t]:Cx(100-e)}}return kS({delta:l?o-e:e-o,initialLayout:r,panelConstraints:i,pivotIndices:l?[s-1,s]:[s,s+1],prevLayout:r,trigger:`imperative-api`})},s=e=>{if(e===a())return;let{defaultLayoutDeferred:t,derivedPanelConstraints:r,group:i,groupSize:s,layout:c,separatorToPanels:l}=n(),u=jS({layout:o({nextSize:e,panels:i.panels,prevLayout:c,derivedPanelConstraints:r}),panelConstraints:r});AS(c,u)||lS(i,{defaultLayoutDeferred:t,derivedPanelConstraints:r,groupSize:s,layout:u,separatorToPanels:l})};return{collapse:()=>{let{collapsible:e,collapsedSize:t}=r(),{mutableValues:n}=i(),o=a();e&&o!==t&&(n.expandToSize=o,s(t))},expand:()=>{let{collapsible:e,collapsedSize:t,minSize:n}=r(),{mutableValues:o}=i(),c=a();if(e&&c===t){let e=o.expandToSize??n;e===0&&(e=1),s(e)}},getSize:()=>{let{group:e}=n(),t=a(),{element:r}=i();return{asPercentage:t,inPixels:e.orientation===`horizontal`?r.offsetWidth:r.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=r(),n=a();return e&&ES(t,n)},resize:e=>{let{group:t}=n(),{element:r}=i(),a=wx({group:t});s(Cx(Sx({groupSize:a,panelElement:r,styleProp:e})/a*100))}}}function NS(e){e.defaultPrevented||wS(e,sS()).forEach(t=>{if(t.separator&&!t.separator.disableDoubleClick){let n=t.panels.find(e=>e.panelConstraints.defaultSize!==void 0);if(n){let r=n.panelConstraints.defaultSize,i=MS({groupId:t.group.id,panelId:n.id});i&&r!==void 0&&(i.resize(r),e.preventDefault())}}})}function PS(e){let t=sS();for(let[n]of t)if(n.separators.some(t=>t.element===e))return n;throw Error(`Could not find parent Group for separator element`)}function FS({groupId:e}){let t=()=>{let t=sS();for(let[n,r]of t)if(n.id===e)return{group:n,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:n}=t();return e?{}:n},setLayout(e){let{defaultLayoutDeferred:n,derivedPanelConstraints:r,group:i,groupSize:a,layout:o,separatorToPanels:s}=t(),c=jS({layout:e,panelConstraints:r});return n?o:(AS(o,c)||lS(i,{defaultLayoutDeferred:n,derivedPanelConstraints:r,groupSize:a,layout:c,separatorToPanels:s}),c)}}}function IS(e,t){let n=PS(e),r=oS(n.id,!0),i=n.separators.find(t=>t.element===e);Ex(i,`Matching separator not found`);let a=r.separatorToPanels.get(i);Ex(a,`Matching panels not found`);let o=a.map(e=>n.panels.indexOf(e)),s=FS({groupId:n.id}).getLayout(),c=jS({layout:kS({delta:t,initialLayout:s,panelConstraints:r.derivedPanelConstraints,pivotIndices:o,prevLayout:s,trigger:`keyboard`}),panelConstraints:r.derivedPanelConstraints});AS(s,c)||lS(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:c,separatorToPanels:r.separatorToPanels},{isUserInteraction:!0})}function LS(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=PS(t);if(!n.disabled)switch(e.key){case`ArrowDown`:e.preventDefault(),n.orientation===`vertical`&&IS(t,5);break;case`ArrowLeft`:e.preventDefault(),n.orientation===`horizontal`&&IS(t,-5);break;case`ArrowRight`:e.preventDefault(),n.orientation===`horizontal`&&IS(t,5);break;case`ArrowUp`:e.preventDefault(),n.orientation===`vertical`&&IS(t,-5);break;case`End`:e.preventDefault(),IS(t,100);break;case`Enter`:{e.preventDefault();let n=PS(t),{derivedPanelConstraints:r,layout:i,separatorToPanels:a}=oS(n.id,!0),o=n.separators.find(e=>e.element===t);Ex(o,`Matching separator not found`);let s=a.get(o);Ex(s,`Matching panels not found`);let c=s[0],l=r.find(e=>e.panelId===c.id);if(Ex(l,`Panel metadata not found`),l.collapsible){let e=i[c.id];IS(t,(l.collapsedSize===e?n.mutableState.expandedPanelSizes[c.id]??l.minSize:l.collapsedSize)-e)}break}case`F6`:{e.preventDefault();let n=PS(t).separators.map(e=>e.element),r=Array.from(n).findIndex(t=>t===e.currentTarget);Ex(r!==null,`Index not found`),n[e.shiftKey?r>0?r-1:n.length-1:r+1<n.length?r+1:0].focus({preventScroll:!0});break}case`Home`:e.preventDefault(),IS(t,-100);break}}function RS(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=sS(),n=wS(e,t),r=new Map,i=!1;n.forEach(e=>{e.separator&&(i||(i=!0,e.separator.element.focus({focusVisible:!1,preventScroll:!0})));let n=t.get(e.group);n&&r.set(e.group,n.layout)}),Hx({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:`active`}),n.length&&e.preventDefault()}function zS({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:a,prevCursorFlags:o}){let s=0;n.forEach(e=>{let{group:n,groupSize:o}=e,{orientation:c,panels:l}=n,{disableCursor:u}=n.mutableState,d=0;d=a?c===`horizontal`?(t.clientX-a.x)/o*100:(t.clientY-a.y)/o*100:c===`horizontal`?t.clientX<0?-100:100:t.clientY<0?-100:100;let f=r.get(n),p=i.get(n);if(!f||!p)return;let{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:_,separatorToPanels:v}=p;if(h&&_&&v){let t=kS({delta:d,initialLayout:f,panelConstraints:h,pivotIndices:e.panels.map(e=>l.indexOf(e)),prevLayout:_,trigger:`mouse-or-touch`});if(AS(t,_)){if(d!==0&&!u)switch(c){case`horizontal`:s|=d<0?Gx:Kx;break;case`vertical`:s|=d<0?qx:Jx;break}}else lS(e.group,{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:t,separatorToPanels:v})}});let c=0;t.movementX===0?c|=o&Yx:c|=s&Yx,t.movementY===0?c|=o&Xx:c|=s&Xx,Vx(c),tS(e)}function BS(e){let t=sS(),n=zx();switch(n.state){case`active`:zS({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function VS(e){if(e.defaultPrevented)return;let t=zx(),n=sS();switch(t.state){case`active`:if(e.buttons===0){Hx({cursorFlags:0,state:`inactive`}),t.hitRegions.forEach(e=>{let t=oS(e.group.id,!0);lS(e.group,t,{isUserInteraction:!0})});return}for(let n of t.hitRegions)if(n.separator){let{element:t}=n.separator;t.hasPointerCapture?.(e.pointerId)||t.setPointerCapture?.(e.pointerId)}zS({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break;default:{let r=wS(e,n);r.length===0?t.state!==`inactive`&&Hx({cursorFlags:0,state:`inactive`}):Hx({cursorFlags:0,hitRegions:r,state:`hover`}),tS(e.currentTarget);break}}}function HS(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(zx().state){case`hover`:Hx({cursorFlags:0,state:`inactive`})}}function US(e){e.defaultPrevented||e.pointerType===`mouse`&&e.button>0||uS(e.currentTarget)&&e.preventDefault()}function WS(e){let t=0,n=0,r={};for(let i of e)if(i.defaultSize!==void 0){t++;let e=Cx(i.defaultSize);n+=e,r[i.panelId]=e}else r[i.panelId]=void 0;let i=e.length-t;if(i!==0){let t=Cx((100-n)/i);for(let n of e)n.defaultSize===void 0&&(r[n.panelId]=t)}return r}function GS(e,t,n){if(!n[0])return;let r=e.panels.find(e=>e.element===t);if(!r||!r.onResize)return;let i=wx({group:e}),a=e.orientation===`horizontal`?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,s={asPercentage:Cx(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,o)}function KS(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function qS({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let i=0,a=0,o=!1,s=new Map,c=[];for(let l of e.panels){let e=r[l.id]??0;switch(l.panelConstraints.groupResizeBehavior){case`preserve-pixel-size`:{o=!0;let r=Cx(e/100*n/t*100);s.set(l.id,r),i+=r;break}default:c.push(l.id),a+=e;break}}if(!o||c.length===0)return r;let l=100-i,u={...r};if(s.forEach((e,t)=>{u[t]=e}),a>0)for(let e of c)u[e]=Cx((r[e]??0)/a*l);else{let e=Cx(l/c.length);for(let t of c)u[t]=e}return u}function JS(e,t){let n=e.map(e=>e.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;return!0}var YS=new Map;function XS(e){let t=!0;Ex(e.element.ownerDocument.defaultView,`Cannot register an unmounted Group`);let n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,a=new n(n=>{for(let r of n){let{borderBoxSize:n,target:i}=r;if(i===e.element){if(t){let t=wx({group:e});if(t===0)return;let n=oS(e.id);if(!n)return;let r=Tx(e),i=n.defaultLayoutDeferred?WS(r):n.layout,a=jS({layout:qS({group:e,nextGroupSize:t,prevGroupSize:n.groupSize,prevLayout:i}),panelConstraints:r});if(!n.defaultLayoutDeferred&&AS(n.layout,a)&&KS(n.derivedPanelConstraints,r)&&n.groupSize===t)return;lS(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:r,groupSize:t,layout:a,separatorToPanels:n.separatorToPanels})}}else GS(e,i,n)}});a.observe(e.element),e.panels.forEach(e=>{Ex(!r.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),r.add(e.id),e.onResize&&a.observe(e.element)});let o=wx({group:e}),s=Tx(e),c=e.panels.map(({id:e})=>e).join(`,`),l=e.mutableState.defaultLayout;l&&(JS(e.panels,l)||(l=void 0));let u=jS({layout:e.mutableState.layouts[c]??l??WS(s),panelConstraints:s}),d=e.element.ownerDocument;YS.set(d,(YS.get(d)??0)+1);let f=new Map;return Fx(e).forEach(e=>{e.separator&&f.set(e.separator,e.panels)}),lS(e,{defaultLayoutDeferred:o===0,derivedPanelConstraints:s,groupSize:o,layout:u,separatorToPanels:f}),e.separators.forEach(e=>{Ex(!i.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),i.add(e.id),e.element.addEventListener(`keydown`,LS)}),YS.get(d)===1&&(d.addEventListener(`contextmenu`,dS,!0),d.addEventListener(`dblclick`,NS,!0),d.addEventListener(`pointerdown`,RS,!0),d.addEventListener(`pointerleave`,BS),d.addEventListener(`pointermove`,VS),d.addEventListener(`pointerout`,HS),d.addEventListener(`pointerup`,US,!0)),function(){t=!1,YS.set(d,Math.max(0,(YS.get(d)??0)-1)),iS(e),e.separators.forEach(e=>{e.element.removeEventListener(`keydown`,LS)}),YS.get(d)||(d.removeEventListener(`contextmenu`,dS,!0),d.removeEventListener(`dblclick`,NS,!0),d.removeEventListener(`pointerdown`,RS,!0),d.removeEventListener(`pointerleave`,BS),d.removeEventListener(`pointermove`,VS),d.removeEventListener(`pointerout`,HS),d.removeEventListener(`pointerup`,US,!0)),a.disconnect()}}function ZS(){let[e,t]=(0,Q.useState)({});return[e,(0,Q.useCallback)(()=>t({}),[])]}function QS(e){let t=(0,Q.useId)();return`${e??t}`}var $S=typeof window<`u`?Q.useLayoutEffect:Q.useEffect;function eC(e){let t=(0,Q.useRef)(e);return $S(()=>{t.current=e},[e]),(0,Q.useCallback)((...e)=>t.current?.(...e),[t])}function tC(...e){return eC(t=>{e.forEach(e=>{if(e)switch(typeof e){case`function`:e(t);break;case`object`:e.current=t;break}})})}function nC(e){let t=(0,Q.useRef)({...e});return $S(()=>{for(let n in e)t.current[n]=e[n]},[e]),t.current}var rC=(0,Q.createContext)(null);function iC(e,t){let n=(0,Q.useRef)({getLayout:()=>({}),setLayout:Ux});(0,Q.useImperativeHandle)(t,()=>n.current,[]),$S(()=>{Object.assign(n.current,FS({groupId:e}))})}function aC({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:i,elementRef:a,groupRef:o,id:s,onLayoutChange:c,onLayoutChanged:l,orientation:u=`horizontal`,resizeTargetMinimumSize:d={coarse:20,fine:10},style:f,...p}){let m=(0,Q.useRef)({onLayoutChange:{},onLayoutChanged:{}}),h=eC(e=>{AS(m.current.onLayoutChange,e)||(m.current.onLayoutChange=e,c?.(e))}),g=eC((e,t)=>{AS(m.current.onLayoutChanged,e)||(m.current.onLayoutChanged=e,l?.(e,{isUserInteraction:t}))}),_=QS(s),v=(0,Q.useRef)(null),[y,b]=ZS(),x=(0,Q.useRef)({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:d,separators:[]}),S=tC(v,a);iC(_,o);let C=eC((e,t)=>{let r=zx(),i=aS(e),a=oS(e);if(a){let e=!1;switch(r.state){case`active`:e=r.hitRegions.some(e=>e.group===i);break}return{flexGrow:a.layout[t]??1,pointerEvents:e?`none`:void 0}}if(n?.[t])return{flexGrow:n?.[t]}}),w=nC({defaultLayout:n,disableCursor:r}),T=(0,Q.useMemo)(()=>({get disableCursor(){return!!w.disableCursor},getPanelStyles:C,id:_,orientation:u,registerPanel:e=>{let t=x.current;return t.panels=Dx(u,[...t.panels,e]),b(),()=>{t.panels=t.panels.filter(t=>t!==e),b()}},registerSeparator:e=>{let t=x.current;return t.separators=Dx(u,[...t.separators,e]),b(),()=>{t.separators=t.separators.filter(t=>t!==e),b()}},updatePanelProps:(e,{disabled:t})=>{let n=x.current.panels.find(t=>t.id===e);n&&(n.panelConstraints.disabled=t);let r=aS(_),i=oS(_);r&&i&&lS(r,{...i,derivedPanelConstraints:Tx(r)})},updateSeparatorProps:(e,{disabled:t,disableDoubleClick:n})=>{let r=x.current.separators.find(t=>t.id===e);r&&(r.disabled=t,r.disableDoubleClick=n)}}),[C,_,b,u,w]),E=(0,Q.useRef)(null);return $S(()=>{let e=v.current;if(e===null)return;let t=x.current,n;if(w.defaultLayout!==void 0&&Object.keys(w.defaultLayout).length===t.panels.length){n={};for(let e of t.panels){let t=w.defaultLayout[e.id];t!==void 0&&(n[e.id]=t)}}let r={disabled:!!i,element:e,id:_,mutableState:{defaultLayout:n,disableCursor:!!w.disableCursor,expandedPanelSizes:x.current.lastExpandedPanelSizes,layouts:x.current.layouts},orientation:u,panels:t.panels,resizeTargetMinimumSize:t.resizeTargetMinimumSize,separators:t.separators};E.current=r;let a=XS(r),{defaultLayoutDeferred:o,derivedPanelConstraints:s,layout:c}=oS(r.id,!0);!o&&s.length>0&&(h(c),g(c,!1));let l=cS(_,e=>{let{defaultLayoutDeferred:t,derivedPanelConstraints:n,layout:i}=e.next;if(t||n.length===0)return;let a=r.panels.map(({id:e})=>e).join(`,`);r.mutableState.layouts[a]=i,n.forEach(t=>{if(t.collapsible){let{layout:n}=e.prev??{};if(n){let e=ES(t.collapsedSize,i[t.panelId]),a=ES(t.collapsedSize,n[t.panelId]);e&&!a&&(r.mutableState.expandedPanelSizes[t.panelId]=n[t.panelId])}}});let o=zx().state!==`active`;h(i),o&&g(i,e.isUserInteraction)});return()=>{E.current=null,a(),l()}},[i,_,g,h,u,y,w]),(0,Q.useEffect)(()=>{let e=E.current;e&&(e.mutableState.defaultLayout=n,e.mutableState.disableCursor=!!r)}),(0,Z.jsx)(rC.Provider,{value:T,children:(0,Z.jsx)(`div`,{...p,className:t,"data-group":!0,"data-testid":_,id:_,ref:S,style:{height:`100%`,width:`100%`,overflow:`hidden`,...f,display:`flex`,flexDirection:u===`horizontal`?`row`:`column`,flexWrap:`nowrap`,touchAction:u===`horizontal`?`pan-y`:`pan-x`},children:e})})}aC.displayName=`Group`;function oC(){return(0,Q.useRef)(null)}function sC(){let e=(0,Q.useContext)(rC);return Ex(e,`Group Context not found; did you render a Panel or Separator outside of a Group?`),e}function cC(e,t){let{id:n}=sC(),r=(0,Q.useRef)({collapse:Wx,expand:Wx,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:Wx});(0,Q.useImperativeHandle)(t,()=>r.current,[]),$S(()=>{Object.assign(r.current,MS({groupId:n,panelId:e}))})}function lC({children:e,className:t,collapsedSize:n=`0%`,collapsible:r=!1,defaultSize:i,disabled:a,elementRef:o,groupResizeBehavior:s=`preserve-relative-size`,id:c,maxSize:l=`100%`,minSize:u=`0%`,onResize:d,panelRef:f,style:p,...m}){let h=!!c,g=QS(c),_=nC({disabled:a}),v=(0,Q.useRef)(null),y=tC(v,o),{getPanelStyles:b,id:x,orientation:S,registerPanel:C,updatePanelProps:w}=sC(),T=d!==null,E=eC((e,t,n)=>{d?.(e,c,n)});$S(()=>{let e=v.current;if(e!==null)return C({element:e,id:g,idIsStable:h,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:T?E:void 0,panelConstraints:{groupResizeBehavior:s,collapsedSize:n,collapsible:r,defaultSize:i,disabled:_.disabled,maxSize:l,minSize:u}})},[s,n,r,i,T,g,h,l,u,E,C,_]),(0,Q.useEffect)(()=>{w(g,{disabled:a})},[a,g,w]),cC(g,f);let D=()=>{let e=b(x,g);if(e)return JSON.stringify(e)},O=(0,Q.useSyncExternalStore)(e=>cS(x,e),D,D),k;return k=O?JSON.parse(O):i===void 0?{flexGrow:1}:{flexGrow:void 0,flexShrink:void 0,flexBasis:i},(0,Z.jsx)(`div`,{...m,"data-disabled":a||void 0,"data-panel":!0,"data-testid":g,id:g,ref:y,style:{...uC,display:`flex`,flexBasis:0,flexShrink:1,overflow:`visible`,...k},children:(0,Z.jsx)(`div`,{className:t,style:{maxHeight:`100%`,maxWidth:`100%`,flexGrow:1,overflow:`auto`,...p,touchAction:S===`horizontal`?`pan-y`:`pan-x`},children:e})})}lC.displayName=`Panel`;var uC={minHeight:0,maxHeight:`100%`,height:`auto`,minWidth:0,maxWidth:`100%`,width:`auto`,border:`none`,borderWidth:0,padding:0,margin:0};function dC(){return(0,Q.useRef)(null)}function fC({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let i,a,o=e[n],s=t.find(e=>e.panelId===n);if(s){let c=s.maxSize,l=s.collapsible?s.collapsedSize:s.minSize,u=[r,r+1];a=jS({layout:kS({delta:l-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n],i=jS({layout:kS({delta:c-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:a,valueNow:o}}function pC({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:i,id:a,style:o,...s}){let c=QS(a),l=nC({disabled:n,disableDoubleClick:r}),[u,d]=(0,Q.useState)({}),[f,p]=(0,Q.useState)(`inactive`),[m,h]=(0,Q.useState)(!1),g=(0,Q.useRef)(null),_=tC(g,i),{disableCursor:v,id:y,orientation:b,registerSeparator:x,updateSeparatorProps:S}=sC(),C=b===`horizontal`?`vertical`:`horizontal`;$S(()=>{let e=g.current;if(e!==null){let t={disabled:l.disabled,disableDoubleClick:l.disableDoubleClick,element:e,id:c},n=x(t),r=Bx(e=>{p(e.next.state!==`inactive`&&e.next.hitRegions.some(e=>e.separator===t)?e.next.state:`inactive`)}),i=cS(y,e=>{let{derivedPanelConstraints:n,layout:r,separatorToPanels:i}=e.next,a=i.get(t);if(a){let e=a[0],t=a.indexOf(e);d(fC({layout:r,panelConstraints:n,panelId:e.id,panelIndex:t}))}});return()=>{r(),i(),n()}}},[y,c,x,l]),(0,Q.useEffect)(()=>{S(c,{disabled:n,disableDoubleClick:r})},[n,r,c,S]);let w;n&&!v&&(w=`not-allowed`);let T;if(n)T=`disabled`;else switch(f){case`active`:T=`active`;break;default:T=m?`focus`:f}return(0,Z.jsx)(`div`,{...s,"aria-controls":u.valueControls,"aria-disabled":n||void 0,"aria-orientation":C,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:e,className:t,"data-separator":T,"data-testid":c,id:c,onBlur:()=>h(!1),onFocus:()=>h(!0),ref:_,role:`separator`,style:{flexBasis:`auto`,cursor:w,...o,flexGrow:0,flexShrink:0,touchAction:`none`},tabIndex:n?void 0:0})}pC.displayName=`Separator`;function mC(e){let t=(0,$.c)(50),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({fileName:r,extension:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{_:a}=gt(),[o,s]=(0,Q.useState)(`diagram`),c=sf(i),l;t[4]===n?l=t[5]:(l={"data-mermaid-file-viewer-extension":n},t[4]=n,t[5]=l);let u=l;if(c.status===`loading`){let e;return t[6]!==u||t[7]!==r?(e=(0,Z.jsx)(rf,{fileName:r,dataAttr:`data-mermaid-file-viewer`,extraAttrs:u}),t[6]=u,t[7]=r,t[8]=e):e=t[8],e}if(c.status===`error`){let e;return t[9]!==u||t[10]!==c.message||t[11]!==r||t[12]!==i.src?(e=(0,Z.jsx)(af,{fileName:r,dataAttr:`data-mermaid-file-viewer`,extraAttrs:u,message:c.message,openHref:i.src}),t[9]=u,t[10]=c.message,t[11]=r,t[12]=i.src,t[13]=e):e=t[13],e}let d=c.content,f;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>{e&&s(e)},t[14]=f):f=t[14];let p;t[15]===a?p=t[16]:(p=a({id:`72xhRD`}),t[15]=a,t[16]=p);let m;t[17]===a?m=t[18]:(m=a({id:`DEWDbv`}),t[17]=a,t[18]=m);let h;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(on,{children:(0,Z.jsx)(E,{className:`size-4`})}),t[19]=h):h=t[19];let g;t[20]===m?g=t[21]:(g=(0,Z.jsx)(Hr,{value:`diagram`,"aria-label":m,className:`size-7 px-0 dark:data-[state=on]:bg-foreground/15`,asChild:!0,children:h}),t[20]=m,t[21]=g);let _;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Z.jsx)(sn,{side:`bottom`,children:(0,Z.jsx)(J,{id:`i-ShMB`})}),t[22]=_):_=t[22];let v;t[23]===g?v=t[24]:(v=(0,Z.jsxs)(ln,{children:[g,_]}),t[23]=g,t[24]=v);let y;t[25]===a?y=t[26]:(y=a({id:`Y6SK9K`}),t[25]=a,t[26]=y);let b;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Z.jsx)(on,{children:(0,Z.jsx)(at,{className:`size-4`})}),t[27]=b):b=t[27];let x;t[28]===y?x=t[29]:(x=(0,Z.jsx)(Hr,{value:`source`,"aria-label":y,className:`size-7 px-0 dark:data-[state=on]:bg-foreground/15`,asChild:!0,children:b}),t[28]=y,t[29]=x);let S;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(sn,{side:`bottom`,children:(0,Z.jsx)(J,{id:`wdxz7K`})}),t[30]=S):S=t[30];let C;t[31]===x?C=t[32]:(C=(0,Z.jsxs)(ln,{children:[x,S]}),t[31]=x,t[32]=C);let w;t[33]!==o||t[34]!==C||t[35]!==p||t[36]!==v?(w=(0,Z.jsx)(`div`,{className:`flex shrink-0 items-center justify-center border-b bg-background py-2`,children:(0,Z.jsxs)(Wr,{type:`single`,value:o,onValueChange:f,"aria-label":p,variant:`segmented`,size:`sm`,spacing:1,className:`shrink-0 bg-muted p-0.5 data-[size=sm]:rounded-[10px]`,children:[v,C]})}),t[33]=o,t[34]=C,t[35]=p,t[36]=v,t[37]=w):w=t[37];let T;t[38]!==n||t[39]!==r||t[40]!==o||t[41]!==i||t[42]!==d?(T=(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:o===`diagram`?(0,Z.jsx)(`div`,{className:`flex h-full min-h-0 flex-col p-3 [&_.mermaid-error-source]:hidden`,children:(0,Z.jsx)(xn,{chart:d,className:`min-h-0 flex-1`})}):(0,Z.jsx)(cf,{...i,fileName:r,extension:n})}),t[38]=n,t[39]=r,t[40]=o,t[41]=i,t[42]=d,t[43]=T):T=t[43];let D;return t[44]!==u||t[45]!==r||t[46]!==o||t[47]!==w||t[48]!==T?(D=(0,Z.jsxs)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":r,"data-mermaid-file-viewer":``,"data-mermaid-file-viewer-state":`loaded`,"data-mermaid-file-viewer-mode":o,...u,children:[w,T]}),t[44]=u,t[45]=r,t[46]=o,t[47]=w,t[48]=T,t[49]=D):D=t[49],D}function hC(e){return ba(`/api/asset?path=${encodeURIComponent(e)}`)}function gC(e){return`/api/asset-text?path=${encodeURIComponent(e)}`}function _C(e){let t=(0,$.c)(8),{assetPath:n,mediaKind:r}=e,i;t[0]===n?i=t[1]:(i=(0,Z.jsx)(of,{entry:{kind:`asset`,path:n},className:`shrink-0 border-b bg-background px-3 py-1.5`}),t[0]=n,t[1]=i);let a;t[2]!==n||t[3]!==r?(a=(0,Z.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Z.jsx)(vC,{assetPath:n,mediaKind:r})}),t[2]=n,t[3]=r,t[4]=a):a=t[4];let o;return t[5]!==i||t[6]!==a?(o=(0,Z.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[i,a]}),t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function vC(e){let t=(0,$.c)(33),{assetPath:n,mediaKind:r}=e,[i,a]=(0,Q.useState)(!1),o;t[0]===n?o=t[1]:(o=hC(n),t[0]=n,t[1]=o);let s=o,c;t[2]===n?c=t[3]:(c=n.split(`/`).pop()??n,t[2]=n,t[3]=c);let l=c,u,d,f,p;if(t[4]!==n||t[5]!==l||t[6]!==i||t[7]!==r||t[8]!==s){p=Symbol.for(`react.early_return_sentinel`);bb0:{if(f=l.includes(`.`)?l.split(`.`).pop()??``:``,d=f.length>0?f.toUpperCase():`FILE`,u=i?`text`:r,u===`pdf`){let e;t[13]!==l||t[14]!==s?(e=(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,Z.jsx)(D,{src:s,title:l,fillContainer:!0})}),t[13]=l,t[14]=s,t[15]=e):e=t[15];let n;t[16]!==l||t[17]!==e?(n=(0,Z.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":l,children:e}),t[16]=l,t[17]=e,t[18]=n):n=t[18],p=n;break bb0}if(u===`text`){let e;t[19]===n?e=t[20]:(e=gC(n),t[19]=n,t[20]=e),p=(0,Z.jsx)(cf,{src:e,fileName:l,extension:f.toLowerCase()},n);break bb0}if(u===`mermaid`){let e;t[21]===n?e=t[22]:(e=gC(n),t[21]=n,t[22]=e),p=(0,Z.jsx)(mC,{src:e,fileName:l,extension:f.toLowerCase()},n);break bb0}}t[4]=n,t[5]=l,t[6]=i,t[7]=r,t[8]=s,t[9]=u,t[10]=d,t[11]=f,t[12]=p}else u=t[9],d=t[10],f=t[11],p=t[12];if(p!==Symbol.for(`react.early_return_sentinel`))return p;let m;t[23]!==n||t[24]!==u||t[25]!==d||t[26]!==l||t[27]!==f||t[28]!==s?(m=(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-auto p-4`,children:u===`image`?(0,Z.jsx)(z,{src:s,alt:l,draggable:!1,slotClassName:`flex h-full w-full items-center justify-center`,className:`max-h-full max-w-full`}):u===`video`?(0,Z.jsx)(`video`,{src:s,controls:!0,className:`max-h-full max-w-full`}):u===`audio`?(0,Z.jsx)(`audio`,{src:s,controls:!0,className:`w-full max-w-md`}):(0,Z.jsxs)(`div`,{className:`flex max-w-sm flex-col items-center gap-8 text-center`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,Z.jsx)(`div`,{className:`flex items-center justify-center tracking-wide text-muted-foreground/80 text-2xs font-mono`,children:d}),(0,Z.jsx)(`div`,{className:`max-w-full text-balance break-words tracking-tight font-light text-2xl`,children:l})]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-2`,children:[(0,Z.jsx)(X,{variant:`default`,size:`sm`,onClick:()=>a(!0),"data-testid":`asset-preview-open-as-text`,className:`font-mono uppercase`,children:(0,Z.jsx)(J,{id:`qFWMl-`})}),(0,Z.jsx)(X,{variant:`outline`,size:`sm`,className:`font-mono uppercase`,onClick:()=>{Pn({url:s,projectRelPath:n,ext:f.toLowerCase(),title:l,forceOsDelegation:!1})},children:(0,Z.jsx)(J,{id:`9npOH9`})})]})]})}),t[23]=n,t[24]=u,t[25]=d,t[26]=l,t[27]=f,t[28]=s,t[29]=m):m=t[29];let h;return t[30]!==l||t[31]!==m?(h=(0,Z.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":l,children:m}),t[30]=l,t[31]=m,t[32]=h):h=t[32],h}function yC(){let e=(0,$.c)(5),{_:t}=gt(),n;e[0]===t?n=e[1]:(n=t({id:`3VsNTI`}),e[0]=t,e[1]=n);let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[(0,Z.jsx)(Jd,{className:`h-9 w-2/5 mt-6 mb-5`}),(0,Z.jsx)(Jd,{className:`h-4 w-full`}),(0,Z.jsx)(Jd,{className:`h-4 w-3/4`})]}),e[2]=r):r=e[2];let i;return e[3]===n?i=e[4]:(i=(0,Z.jsx)(`div`,{className:`tiptap-editor pt-10`,role:`status`,"aria-busy":`true`,"aria-label":n,children:r}),e[3]=n,e[4]=i),i}function bC(e){let{_:t}=gt();return e===`existing-repo`?[{id:`draft-spec`,icon:Ph,label:t({id:`LdKIHS`}),prompt:t({id:`N_7kkF`})},{id:`organize-specs`,icon:Qh,label:t({id:`cuA8QW`}),prompt:t({id:`mPy9lS`})},{id:`document-architecture`,icon:ng,label:t({id:`6eniID`}),prompt:t({id:`uDlyqd`})}]:[{id:`competitor-research`,icon:wg,label:t({id:`GUqTzn`}),prompt:t({id:`KOZud0`})},{id:`eng-specs`,icon:Ph,label:t({id:`Qvls7J`}),prompt:t({id:`6qMe0o`})},{id:`bird-wiki`,icon:xh,label:t({id:`FqTpiN`}),prompt:t({id:`jtg_8-`})}]}function xC(e){let t=(0,$.c)(13),{scenario:n,className:r}=e,{_:i}=gt(),a=bC(n),[o,s]=(0,Q.useState)(null),c=(0,Q.useRef)(void 0),l,u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>()=>clearTimeout(c.current),u=[],t[0]=l,t[1]=u):(l=t[0],u=t[1]),(0,Q.useEffect)(l,u);let d,f;if(t[2]!==i||t[3]!==r||t[4]!==o||t[5]!==a){let e=function(e,t){uf(t).then(()=>{s(e),clearTimeout(c.current),c.current=setTimeout(()=>s(null),1600)}).catch(SC)};t[8]===r?d=t[9]:(d=Y(`w-full divide-y divide-border/60 overflow-hidden rounded-2xl border border-border/60 bg-card`,r),t[8]=r,t[9]=d),f=a.map(t=>{let n=t.icon,r=o===t.id;return(0,Z.jsxs)(`li`,{className:`group flex items-start gap-3 p-3.5`,"data-testid":`copy-prompt-${t.id}`,children:[(0,Z.jsx)(n,{className:`mt-0.5 size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`text-sm font-medium leading-tight text-foreground`,children:t.label}),(0,Z.jsx)(`span`,{className:`truncate text-1sm leading-relaxed text-muted-foreground`,children:t.prompt})]}),(0,Z.jsxs)(X,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>e(t.id,t.prompt),"aria-label":i(r?{id:`6V3Ea3`}:{id:`RG4XHV`,values:{0:t.label}}),className:Y(`shrink-0 gap-1.5 transition-opacity focus-visible:opacity-100 uppercase font-mono`,r?`opacity-100`:`opacity-0 group-hover:opacity-100`),"data-testid":`copy-prompt-button-${t.id}`,children:[r?(0,Z.jsx)(zo,{className:`size-3.5`,"aria-hidden":`true`}):(0,Z.jsx)(ic,{className:`size-3.5`,"aria-hidden":`true`}),i(r?{id:`6V3Ea3`}:{id:`he3ygx`})]})]},t.id)}),t[2]=i,t[3]=r,t[4]=o,t[5]=a,t[6]=d,t[7]=f}else d=t[6],f=t[7];let p;return t[10]!==d||t[11]!==f?(p=(0,Z.jsx)(`ul`,{className:d,children:f}),t[10]=d,t[11]=f,t[12]=p):p=t[12],p}function SC(){}var CC=`ok-ask-ai-draft-v2`,wC={doc:null,dismissed:!1};function TC(){if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}var EC=null,DC=new Set;function OC(e){if(e===null)return!0;let t=e.content;return!Array.isArray(t)||t.length===0?!0:t.every(e=>{let t=e.content;return!Array.isArray(t)||t.length===0})}function kC(){let e=TC();if(!e)return wC;try{let t=e.getItem(CC);if(!t)return wC;let n=JSON.parse(t);return typeof n!=`object`||!n||Array.isArray(n)?wC:{doc:n,dismissed:!1}}catch(e){return console.warn(`failed to parse stored draft — clearing`,e),wC}}function AC(){return EC===null&&(EC=kC()),EC}function jC(e){let t=TC();if(t)try{e&&!OC(e)?t.setItem(CC,JSON.stringify(e)):t.removeItem(CC)}catch{}}function MC(){for(let e of DC)e()}function NC(){return AC()}function PC(e){let t=e&&!OC(e)?e:null;EC={...AC(),doc:t},jC(t),MC()}function FC(){PC(null)}var IC=ua;function LC(e){let t=Rn(e).kind;return t===`folder`||t===`asset`?t:`page`}function RC(e){let t=(0,$.c)(14),{items:n,query:r,selectedIndex:i,onSelect:a,loading:o,error:s,hasMore:c}=e,l=o===void 0?!1:o,u=s===void 0?!1:s,d=c===void 0?!1:c,{_:f}=gt(),p=(0,Q.useId)(),m=(0,Q.useRef)(null),h,g;t[0]===i?(h=t[1],g=t[2]):(h=()=>{(m.current?.querySelectorAll(`[role="option"]`))?.item(i)?.scrollIntoView({block:`nearest`})},g=[i],t[0]=i,t[1]=h,t[2]=g),(0,Q.useEffect)(h,g);let _=i>=0&&i<n.length?n[i]:null,v;return t[3]!==f||t[4]!==u||t[5]!==d||t[6]!==n||t[7]!==p||t[8]!==l||t[9]!==a||t[10]!==r||t[11]!==i||t[12]!==_?(v=(0,Z.jsx)(`div`,{ref:m,className:`w-80 max-w-[min(28rem,90vw)] overflow-hidden rounded-lg border bg-popover p-1 text-popover-foreground shadow-md`,children:l?(0,Z.jsx)(`p`,{className:`px-2 py-1.5 text-sm text-muted-foreground`,"aria-live":`polite`,children:f({id:`3m2GBo`})}):u?(0,Z.jsx)(`p`,{className:`px-2 py-1.5 text-sm text-muted-foreground`,"aria-live":`assertive`,children:f({id:`weP6me`})}):n.length===0?(0,Z.jsx)(`p`,{className:`px-2 py-1.5 text-sm text-muted-foreground`,"aria-live":`polite`,children:r.trim()===``?f({id:`0E9DR6`}):f({id:`yQyglE`})}):(0,Z.jsxs)(`div`,{role:`listbox`,id:p,"aria-label":f({id:`05n5wS`}),tabIndex:-1,className:`max-h-64 overflow-y-auto subtle-scrollbar`,children:[(0,Z.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:_?_.title:``}),n.map((e,t)=>{let n=t===i,r=LC(e.path),o=r===`folder`,s=o?`${e.path}/`:e.path;return(0,Z.jsxs)(`button`,{id:`${p}-option-${t}`,type:`button`,role:`option`,"aria-selected":n,"data-active":n,"data-mention-kind":r,"data-testid":`composer-mention-option-${e.docName}`,className:`flex w-full items-start gap-2 rounded-md px-2 py-1.5 text-left ${n?`bg-accent text-accent-foreground`:``}`,onMouseDown:t=>{t.preventDefault(),a(e)},children:[(0,Z.jsx)(mt,{path:e.path,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,Z.jsxs)(`span`,{className:`flex items-baseline gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`truncate text-sm font-medium`,children:e.title}),o?(0,Z.jsx)(`span`,{className:`shrink-0 text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:f({id:`kNqMMd`})}):null]}),(0,Z.jsx)(`span`,{className:`line-clamp-2 break-all text-xs text-muted-foreground`,children:s})]})]},e.docName)}),d?(0,Z.jsx)(`div`,{className:`px-2 py-1 text-xs text-muted-foreground`,"aria-hidden":!0,children:f({id:`F1T9y_`})}):null]})}),t[3]=f,t[4]=u,t[5]=d,t[6]=n,t[7]=p,t[8]=l,t[9]=a,t[10]=r,t[11]=i,t[12]=_,t[13]=v):v=t[13],v}var zC=8,BC=new fa(`composerMentionSuggestion`);function VC(e){return e.kind===`asset`?e.docName.replace(/^\//,``):e.kind===`folder`?e.docName:nc(e.docName)}var HC=Na.create({name:`doc`,topNode:!0,content:`paragraph+`}),UC=Na.create({name:`paragraph`,group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML(){return[`p`,0]}}),WC=Na.create({name:`text`,group:`inline`}),GC=Na.create({name:`hardBreak`,group:`inline`,inline:!0,selectable:!1,parseHTML(){return[{tag:`br`}]},renderHTML(){return[`br`]},addKeyboardShortcuts(){return{"Shift-Enter":()=>this.editor.commands.insertContent({type:`hardBreak`})}}}),KC=Hi.create({name:`composerHistory`,addProseMirrorPlugins(){return[io(),Ki({"Mod-z":ga,"Mod-y":co,"Shift-Mod-z":co})]}}),qC=Na.create({name:`composerMention`,group:`inline`,inline:!0,atom:!0,selectable:!0,addAttributes(){return{path:{default:``},label:{default:``}}},parseHTML(){return[{tag:`span[data-composer-mention]`}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.label||e.attrs.path);return[`span`,Mi(t,{"data-composer-mention":String(e.attrs.path??``),class:`composer-mention-chip`}),`@${n}`]},renderText({node:e}){return`@${e.attrs.path}`},addNodeView(){return({node:e,editor:t,getPos:n})=>{let r=String(e.attrs.path??``),i=String(e.attrs.label||e.attrs.path),a=document.createElement(`span`);a.className=`composer-mention-chip group/mention`,a.setAttribute(`data-composer-mention`,r),a.title=i;let o=document.createElement(`button`);o.type=`button`,o.className=`composer-mention-icon`,o.setAttribute(`aria-label`,Cl._({id:`Xzy0s0`,values:{fullLabel:i}}));let s=document.createElement(`span`);s.className=`composer-mention-glyph composer-mention-glyph-icon`,s.setAttribute(`aria-hidden`,`true`),s.innerHTML=b(r),o.appendChild(s);let c=document.createElement(`span`);c.className=`composer-mention-glyph composer-mention-glyph-x`,c.setAttribute(`aria-hidden`,`true`),c.innerHTML=K(hl),o.appendChild(c),o.addEventListener(`mousedown`,e=>e.preventDefault()),o.addEventListener(`click`,r=>{r.preventDefault();let i=typeof n==`function`?n():null;i!=null&&t.chain().focus().deleteRange({from:i,to:i+e.nodeSize}).run()}),a.appendChild(o);let l=document.createElement(`span`);return l.className=`composer-mention-label`,l.textContent=i,a.appendChild(l),{dom:a}}},addProseMirrorPlugins(){return[XC(this.editor)]}});function JC(e){return[HC,UC,WC,GC,KC,qC,...e?.placeholder?[IC.configure({placeholder:e.placeholder})]:[]]}function YC(e=Vn){let t=[],n=!1,r=null,i=!1;return{snapshot(){return{loaded:n,error:i}},async getItems(a){if(!n){r||=e();try{t=await r,n=!0,i=!1}catch(e){console.error(`[composer-mention] failed to fetch pages`,e),t=[],i=!0}finally{r=null}}return qn(t,a).map(e=>({docName:e.docName,title:e.title,path:VC(e)})).filter(e=>e.path!==``)},reset(){t=[],n=!1,r=null,i=!1}}}function XC(e){let t=YC();return Dn({editor:e,pluginKey:BC,char:`@`,items:({query:e})=>t.getItems(e),command:({editor:e,range:t,props:n})=>{try{e.chain().focus().deleteRange(t).insertContent([{type:`composerMention`,attrs:{path:n.path,label:n.title}},{type:`text`,text:` `}]).run()}catch(e){console.error(`[composer-mention] insert failed`,{item:n,range:t},e)}},render:()=>{let e=null,n=null,r=0,i={popup:null,stopAutoUpdate:null},a=null,o=null,s=e=>{n?.command(e)},c=e=>{let n=e.items??[],{loaded:i,error:a}=t.snapshot();return{items:n,query:e.query??``,selectedIndex:r,onSelect:s,loading:!i&&!a,error:a,hasMore:n.length>=zC}},l=()=>{!e||!n||e.updateProps(c(n))};return{onBeforeStart(t){n=t,r=0;let s=En(()=>n,`composer-mention`);i.popup=s.popup,a=s.doPosition,o=s.reveal,e=new kn(RC,{props:c(t),editor:t.editor}),s.popup.appendChild(e.element),i.stopAutoUpdate=s.startAutoUpdate()},onStart(e){n=e,r=0,l(),o?.()},onUpdate(e){n=e,r=Math.min(r,Math.max(0,e.items.length-1)),l(),a?.()},onKeyDown({event:e}){if(!n)return!1;let t=n.items;if(e.key===`ArrowDown`)return t.length===0?!1:(r=(r+1)%t.length,l(),!0);if(e.key===`ArrowUp`)return t.length===0?!1:(r=(r-1+t.length)%t.length,l(),!0);if(e.key===`Enter`||e.key===`Tab`){let e=t[r];return e?(n.command(e),!0):!1}return!1},onExit(){jn(i),a=null,o=null,e?.destroy(),e=null,n=null,r=0,t.reset()}}}})}function ZC(e){let t=[],n=new Set,r=[];return e.state.doc.forEach(e=>{let i=``;e.forEach(e=>{if(e.type.name===`composerMention`){let r=String(e.attrs.path??``);r!==``&&(i+=`@${r}`,n.has(r)||(n.add(r),t.push(r)))}else e.isText?i+=e.text??``:e.type.name===`hardBreak`&&(i+=`
5
+ `)}),r.push(i)}),{instruction:r.join(`
6
+ `).trim(),mentions:t}}function QC(e){let{instruction:t,mentions:n}=ZC(e);return t===``&&n.length===0}function $C(e){let t=e?.content;return!Array.isArray(t)||t.length===0?!1:t.some(e=>Array.isArray(e.content)&&e.content.length>0)}function ew(e){let t=(0,$.c)(29),{ref:n,ariaLabel:r,onEmptyChange:i,onContentChange:a,onMentionsChange:o,onSubmit:s,className:c,placeholder:l,initialDoc:u}=e,d=(0,Q.useRef)(i),f=(0,Q.useRef)(a),p=(0,Q.useRef)(o),m=(0,Q.useRef)(s),h;t[0]!==a||t[1]!==i||t[2]!==o||t[3]!==s?(h=()=>{d.current=i,f.current=a,p.current=o,m.current=s},t[0]=a,t[1]=i,t[2]=o,t[3]=s,t[4]=h):h=t[4],(0,Q.useEffect)(h);let g;t[5]===l?g=t[6]:(g=JC({placeholder:l}),t[5]=l,t[6]=g);let _=u??void 0,v;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(v=Y(`composer-prosemirror py-1 outline-none`),t[7]=v):v=t[7];let y;t[8]===r?y=t[9]:(y={role:`textbox`,"aria-label":r,"aria-multiline":`true`,class:v},t[8]=r,t[9]=y);let b;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(b=(e,t)=>t.key===`Escape`?BC.getState(e.state)?.active?!1:(e.dom.blur(),!0):t.key===`Enter`&&!t.shiftKey&&!t.isComposing&&!e.composing?BC.getState(e.state)?.active?!1:(m.current(),!0):!1,t[10]=b):b=t[10];let x;t[11]===y?x=t[12]:(x={attributes:y,handleKeyDown:b},t[11]=y,t[12]=x);let S;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(S=e=>{let{editor:t}=e;d.current(QC(t)),f.current?.(t.getJSON()),p.current?.(ZC(t).mentions)},t[13]=S):S=t[13];let C;t[14]!==g||t[15]!==_||t[16]!==x?(C={extensions:g,content:_,immediatelyRender:!0,editorProps:x,onUpdate:S},t[14]=g,t[15]=_,t[16]=x,t[17]=C):C=t[17];let w=Ln(C),T;t[18]!==w||t[19]!==u?(T=()=>{w&&(QC(w)&&$C(u)&&(console.warn(`composer draft was incompatible with the current schema — clearing it`),FC()),d.current(QC(w)),p.current?.(ZC(w).mentions))},t[18]=w,t[19]=u,t[20]=T):T=t[20];let E;t[21]===w?E=t[22]:(E=[w],t[21]=w,t[22]=E),(0,Q.useEffect)(T,E);let D,O;t[23]===w?(D=t[24],O=t[25]):(D=()=>({focus:()=>w?.commands.focus(),blur:()=>w?.commands.blur(),clear:()=>w?.commands.clearContent(!0),setText:e=>{w&&(w.commands.setContent(e),f.current?.(w.getJSON()),p.current?.(ZC(w).mentions))},getContent:()=>w?ZC(w):{instruction:``,mentions:[]}}),O=[w],t[23]=w,t[24]=D,t[25]=O),(0,Q.useImperativeHandle)(n,D,O);let k;return t[26]!==c||t[27]!==w?(k=(0,Z.jsx)(Wn,{editor:w,className:c}),t[26]=c,t[27]=w,t[28]=k):k=t[28],k}function tw(e,t,n){return e.trim().length>0||t.length>0||n}new Set(Zr.map(e=>e.id));function nw(e,t){Kc(e,t)}function rw(e){let t=(0,$.c)(2),{agentName:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(J,{id:`5PrrYw`,values:{agentName:n}}),t[0]=n,t[1]=r),r}function iw(e){let t=(0,$.c)(29),{scenario:n,className:r}=e,{_:i}=gt(),{states:a,refresh:o}=as(),s=Xr(),{dispatch:c}=$o(),l=fd(),u=es(),[d,f]=(0,Q.useState)(ow),p=Kr(),m=Gr(),h;t[0]===s?h=t[1]:(h=e=>Qr(s,e.source,e.id,!0,e.supported),t[0]=s,t[1]=h);let g=m.filter(h),_=ii(g,p),v;t[2]===u?.installedClis?v=t[3]:(v=u?.installedClis??{},t[2]=u?.installedClis,t[3]=v);let y=qc({sticky:d,effectiveThreadAgent:_,enabledClis:u===null?[]:Oc(s,u.installedClis),enabledDesktopTargets:Jc(s),installedClis:v,terminalAvailable:u!==null,threadsAvailable:!0,desktopSelectable:!0}),b=y.kind===`thread`,x=y.kind===`cli`?y.cli:null,S=y.kind===`desktop`?y.target:null,C=x!==null,w=(0,Q.useRef)(null),[T]=(0,Q.useState)(aw),[E,D]=(0,Q.useState)(!0),[O,k]=(0,Q.useState)(!1),A;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(A=function(e){D(e),e||k(!1)},t[4]=A):A=t[4];let j=A,M=bC(n),N;t[5]===s?N=t[6]:(N=e=>ni(s,e.id),t[5]=s,t[6]=N);let P=Zr.filter(N),F=Zr.every(e=>a[e.id]?.installed!=null),I=u!==null&&Oc(s,u.installedClis).length>0,L=F&&P.length===0&&g.length===0&&!I,R;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(R=function(e){f(e),Kc(e),nw(e)},t[7]=R):R=t[7];let z=R,B;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(B=function(e){f(Tc(e)),Kc(Tc(e))},t[8]=B):B=t[8];let V=B,H;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(H=function(e){Jr(e),f(wc),Kc(wc)},t[9]=H):H=t[9];let U=H,W=function(){let{instruction:e,mentions:t}=w.current?.getContent()??{instruction:``,mentions:[]};if(!tw(e,t,!1)){k(!0);return}let r=ts({workspace:l,description:e,scenario:n,mentions:t});r!==null&&(hs(r,_===null?void 0:{agent:{source:_.source,id:_.id}}),w.current?.clear(),FC())},G=function(){if(u===null||x===null)return;let{instruction:e,mentions:t}=w.current?.getContent()??{instruction:``,mentions:[]};if(!tw(e,t,!1)){k(!0);return}let r=ts({workspace:l,description:e,scenario:n,mentions:t});r!==null&&(u.launchInTerminal(r,x),w.current?.clear(),FC())},K=function(e){let{instruction:t,mentions:r}=w.current?.getContent()??{instruction:``,mentions:[]};if(!tw(t,r,!1)){k(!0);return}if(nw(e),a[e]?.installed!==!0){let t=Zr.find(t=>t.id===e);t&&ps(t);return}let i=ts({workspace:l,description:t,scenario:n,mentions:r});i!==null&&(c(e,i),w.current?.clear(),FC())},ee=function(){b?W():C?G():S!==null&&K(S)},te=function(e){w.current?.setText(e),w.current?.focus()};if(L){let e;t[10]===r?e=t[11]:(e=Y(`flex w-full flex-wrap items-center justify-between gap-3 rounded-2xl border border-border/60 bg-card px-4 py-3`,r),t[10]=r,t[11]=e);let n;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(Zs,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`}),t[12]=n):n=t[12];let i;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[n,(0,Z.jsx)(`span`,{className:`text-1sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`XT-L4j`})})]}),t[13]=i):i=t[13];let a;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsxs)(X,{type:`button`,variant:`outline`,size:`sm`,onClick:Ol,className:`gap-1.5`,"data-testid":`create-configure-agents`,children:[(0,Z.jsx)(cl,{"aria-hidden":`true`,className:`size-3.5`}),(0,Z.jsx)(J,{id:`jRAGrQ`})]}),t[14]=a):a=t[14];let o;return t[15]===e?o=t[16]:(o=(0,Z.jsxs)(`div`,{className:e,"data-testid":`create-no-agents`,children:[i,a]}),t[15]=e,t[16]=o),o}let ne=u?Oc(s,u.installedClis):[],q=P.length>0,re=ne.length>0,ie=g.length>0,ae=y.kind!==`none`,oe;t[17]===r?oe=t[18]:(oe=Y(`flex w-full flex-col gap-3`,r),t[17]=r,t[18]=oe);let se;t[19]===i?se=t[20]:(se=i({id:`7hctf2`}),t[19]=i,t[20]=se);let ce;t[21]===i?ce=t[22]:(ce=i({id:`0jD-Gn`}),t[21]=i,t[22]=ce);let le;t[23]!==E||t[24]!==O?(le=O&&E?(0,Z.jsx)(`p`,{role:`alert`,className:`text-1sm text-destructive`,"data-testid":`create-input-required`,children:(0,Z.jsx)(J,{id:`1FLarN`})}):(0,Z.jsx)(`span`,{}),t[23]=E,t[24]=O,t[25]=le):le=t[25];let ue=ae?(0,Z.jsxs)(df,{children:[(0,Z.jsx)(X,{type:`button`,onClick:()=>b?W():C?G():S===null?void 0:K(S),variant:`outline`,className:`gap-1.5`,"data-testid":`create-with-agent`,children:b&&_!==null?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(So,{agentId:_.id,iconUrl:_.iconUrl,className:`size-3.5`}),(0,Z.jsx)(rw,{agentName:_.name})]}):C&&x!==null?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)($r,{id:qr(x),"aria-hidden":`true`,className:`size-3.5`}),(0,Z.jsx)(J,{id:`4rjwLG`,values:{0:gi[x].displayName}})]}):S===null?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)($r,{id:S,"aria-hidden":`true`,className:`size-3.5`}),(0,Z.jsx)(J,{id:`9dw5bW`,values:{0:Zo(S)}})]})}),(0,Z.jsxs)(Pr,{onOpenChange:e=>{e&&o()},children:[(0,Z.jsx)(Or,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,"aria-label":i({id:`nskygk`}),size:`icon`,variant:`outline`,"data-testid":`create-with-agent-menu`,children:(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`size-3.5`})})}),(0,Z.jsxs)(Mr,{align:`end`,className:`max-h-80 min-w-[200px]`,children:[ie?(0,Z.jsxs)(Dr,{"aria-label":i({id:`vPKX2i`}),children:[(0,Z.jsxs)(Ar,{className:`flex items-center gap-1.5`,children:[(0,Z.jsx)(J,{id:`RXEbZy`}),(0,Z.jsx)(ti,{})]}),g.map(e=>(0,Z.jsxs)(wr,{onSelect:()=>U(e),"data-testid":`create-agent-option-thread-${e.source}:${e.id}`,children:[(0,Z.jsx)(So,{agentId:e.id,iconUrl:e.iconUrl,className:`size-4`}),(0,Z.jsx)(`span`,{className:`flex-1 truncate`,children:e.name}),b&&_!==null&&_.source===e.source&&_.id===e.id?(0,Z.jsx)(zo,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}):null]},`${e.source}:${e.id}`))]}):null,ie&&(re||q)?(0,Z.jsx)(Fr,{}):null,re?(0,Z.jsxs)(Dr,{"aria-label":i({id:`ALhMYW`}),children:[(0,Z.jsx)(Ar,{children:(0,Z.jsx)(J,{id:`ALhMYW`})}),ne.map(e=>{let{displayName:t}=gi[e];return(0,Z.jsxs)(wr,{onSelect:()=>V(e),"data-testid":`create-with-cli-${e}`,"aria-label":i({id:`QYfQdv`,values:{displayName:t}}),children:[(0,Z.jsx)($r,{id:qr(e),"aria-hidden":`true`,className:`size-4`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:t}),x===e?(0,Z.jsx)(zo,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}):null]},e)})]}):null,q?(0,Z.jsxs)(Z.Fragment,{children:[re?(0,Z.jsx)(Fr,{}):null,(0,Z.jsxs)(Dr,{"aria-label":i({id:`BBqGS9`}),children:[(0,Z.jsx)(Ar,{children:(0,Z.jsx)(J,{id:`BBqGS9`})}),P.map(e=>(0,Z.jsxs)(wr,{onSelect:()=>z(e.id),"data-testid":`create-agent-option-${e.id}`,children:[(0,Z.jsx)($r,{id:e.id,"aria-hidden":`true`,className:`size-4`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:e.displayName}),!C&&e.id===S?(0,Z.jsx)(zo,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}):null]},e.id))]})]}):null,(0,Z.jsx)(Fr,{}),(0,Z.jsxs)(wr,{onSelect:Ol,"data-testid":`create-agent-option-settings`,children:[(0,Z.jsx)(cl,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(J,{id:`jRAGrQ`})})]})]})]})]}):(0,Z.jsx)(X,{type:`button`,variant:`outline`,disabled:!0,className:`gap-1.5`,"data-testid":`create-with-agent`,children:(0,Z.jsx)(J,{id:`hYgDIe`})}),de;return t[26]!==le||t[27]!==ue?(de=(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 px-3 pb-3`,children:[le,ue]}),t[26]=le,t[27]=ue,t[28]=de):de=t[28],(0,Z.jsxs)(`div`,{className:oe,children:[(0,Z.jsxs)(`div`,{onMouseDown:e=>pf(e,w),className:`flex w-full cursor-text flex-col rounded-2xl border border-border/60 bg-card shadow-sm transition-colors focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50`,children:[(0,Z.jsx)(ew,{ref:w,ariaLabel:se,placeholder:ce,onEmptyChange:j,onContentChange:PC,onSubmit:ee,initialDoc:T,className:`max-h-96 overflow-y-auto px-4 py-3 text-sm leading-relaxed subtle-scrollbar [&_.ProseMirror]:min-h-16`}),de]}),n!==`existing-repo`&&M.length>0?(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`text-1sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`I5685_`})}),M.map(e=>{let t=e.icon;return(0,Z.jsxs)(X,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>te(e.prompt),className:`gap-1.5 rounded-md font-normal text-muted-foreground hover:text-foreground`,"data-testid":`create-suggestion-${e.id}`,children:[(0,Z.jsx)(t,{className:`size-3.5`,"aria-hidden":`true`}),e.label]},e.id)})]}):null]})}function aw(){return NC().doc??void 0}function ow(){return xc()}function sw(e){let t=(0,$.c)(12),{title:n,subtitle:r,celebrateSignal:i}=e,a;t[0]===i?a=t[1]:(a=(0,Z.jsx)(em,{size:64,celebrateSignal:i}),t[0]=i,t[1]=a);let o;t[2]===n?o=t[3]:(o=(0,Z.jsx)(`h2`,{className:`text-2xl font-light tracking-tighter text-balance`,children:n}),t[2]=n,t[3]=o);let s;t[4]===r?s=t[5]:(s=r?(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r}):null,t[4]=r,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;return t[9]!==a||t[10]!==c?(l=(0,Z.jsxs)(`div`,{className:`flex flex-col items-start gap-3 @md/emptystate:flex-row @md/emptystate:items-center @md/emptystate:gap-4`,children:[a,c]}),t[9]=a,t[10]=c,t[11]=l):l=t[11],l}function cw({isOnboarding:e,isEmbedded:t}){return e?{title:{id:`6h4zVU`},subtitle:t?{id:`vGeNNQ`}:{id:`qpQwGC`}}:{title:{id:`FOGD7m`},subtitle:t?{id:`3DTatP`}:{id:`MqQoV-`}}}var lw=`open-knowledge:create-top-level-file`;function uw(e={}){window.dispatchEvent(new CustomEvent(lw,{detail:e}))}function dw(e){let t=t=>{let n=t.detail;e(n??{})};return window.addEventListener(lw,t),()=>window.removeEventListener(lw,t)}function fw(e){let t=(0,$.c)(28),{celebrateSignal:n,onAddStarterPack:r}=e,{_:i}=gt(),a=ec(),{title:o,subtitle:s}=cw({isOnboarding:!1,isEmbedded:a}),c=xs(),l;t[0]!==c.data||t[1]!==c.status?(l=c.status===`ready`?c.data:[],t[0]=c.data,t[1]=c.status,t[2]=l):l=t[2];let u=l,d=c.status===`loading`||c.status===`idle`,f=c.status===`error`,p=sw,m=i(o),h=i(s),g;t[3]!==p||t[4]!==n||t[5]!==m||t[6]!==h?(g=(0,Z.jsx)(p,{title:m,subtitle:h,celebrateSignal:n}),t[3]=p,t[4]=n,t[5]=m,t[6]=h,t[7]=g):g=t[7];let _;t[8]===a?_=t[9]:(_=a?(0,Z.jsx)(xC,{scenario:`existing-repo`}):(0,Z.jsx)(iw,{scenario:`existing-repo`}),t[8]=a,t[9]=_);let v;t[10]!==u||t[11]!==f||t[12]!==d?(v=d||f||u.length>0?(0,Z.jsx)(hw,{templates:u,loading:d,error:f,onSelect:mw}):null,t[10]=u,t[11]=f,t[12]=d,t[13]=v):v=t[13];let y,b;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(Wt,{"aria-hidden":`true`,className:`size-3`}),b=(0,Z.jsx)(J,{id:`IajAbS`}),t[14]=y,t[15]=b):(y=t[14],b=t[15]);let x;t[16]===r?x=t[17]:(x=(0,Z.jsxs)(X,{onClick:r,variant:`link-muted`,size:`xs`,className:`font-mono text-xs uppercase tracking-wider`,children:[y,b]}),t[16]=r,t[17]=x);let S;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(X,{variant:`link-muted`,className:`justify-end`,size:`sm`,onClick:pw,children:(0,Z.jsx)(J,{id:`L4Cdd9`,components:{0:(0,Z.jsx)(Jn,{"aria-hidden":`true`,className:`size-3`})}})}),t[18]=S):S=t[18];let C;t[19]===x?C=t[20]:(C=(0,Z.jsxs)(`div`,{className:`-mt-6 flex w-full items-center justify-between gap-4`,children:[x,S]}),t[19]=x,t[20]=C);let w;t[21]!==C||t[22]!==v?(w=(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-8`,children:[v,C]}),t[21]=C,t[22]=v,t[23]=w):w=t[23];let T;return t[24]!==w||t[25]!==g||t[26]!==_?(T=(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-8 py-12 max-w-5xl my-auto`,children:[g,_,w]}),t[24]=w,t[25]=g,t[26]=_,t[27]=T):T=t[27],T}function pw(){return uw({initialDir:``})}function mw(e,t){return uw({template:{folder:e,name:t}})}function hw(e){let t=(0,$.c)(25),{templates:n,loading:r,error:i,onSelect:a}=e,{_:o}=gt(),s;t[0]===o?s=t[1]:(s=o({id:`_8quCH`}),t[0]=o,t[1]=s);let c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(`span`,{children:(0,Z.jsx)(J,{id:`_8quCH`})}),t[2]=c):c=t[2];let l;t[3]!==o||t[4]!==i||t[5]!==r||t[6]!==n?(l=r||i?null:(0,Z.jsx)(Eu,{className:`text-2xs`,variant:`gray`,"aria-label":o({id:`X7u0xR`,values:{0:n.length}}),children:n.length}),t[3]=o,t[4]=i,t[5]=r,t[6]=n,t[7]=l):l=t[7];let u;t[8]===l?u=t[9]:(u=(0,Z.jsxs)(`header`,{className:`flex items-center gap-2 font-mono text-2xs uppercase tracking-wider text-muted-foreground`,children:[c,l]}),t[8]=l,t[9]=u);let d;t[10]===o?d=t[11]:(d=o({id:`irFGwu`}),t[10]=o,t[11]=d);let f;t[12]!==i||t[13]!==r||t[14]!==a||t[15]!==n?(f=r?(0,Z.jsx)(`p`,{className:`p-4 text-1sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`Hl89Qd`})}):i?(0,Z.jsx)(`p`,{role:`alert`,className:`p-4 text-1sm text-destructive`,children:(0,Z.jsx)(J,{id:`54Y6Fg`})}):n.map(e=>(0,Z.jsx)(gw,{template:e,targetLabel:e.source_folder===``?`/`:`${e.source_folder}/`,onClick:()=>a(e.source_folder,e.name)},`${e.source_folder}/${e.name}`)),t[12]=i,t[13]=r,t[14]=a,t[15]=n,t[16]=f):f=t[16];let p;t[17]!==r||t[18]!==d||t[19]!==f?(p=(0,Z.jsx)(`div`,{className:`w-full overflow-hidden rounded-xl border border-border/60 bg-card`,children:(0,Z.jsx)(`section`,{"aria-busy":r,"aria-label":d,tabIndex:0,className:`subtle-scrollbar scroll-fade-mask flex max-h-[260px] w-full flex-col overflow-y-auto overscroll-contain focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,children:f})}),t[17]=r,t[18]=d,t[19]=f,t[20]=p):p=t[20];let m;return t[21]!==s||t[22]!==u||t[23]!==p?(m=(0,Z.jsxs)(`section`,{"aria-label":s,className:`flex w-full flex-col gap-3`,children:[u,p]}),t[21]=s,t[22]=u,t[23]=p,t[24]=m):m=t[24],m}function gw(e){let t=(0,$.c)(24),{template:n,targetLabel:r,onClick:i}=e,{_:a}=gt(),o;t[0]!==n.name||t[1]!==n.title?(o=n.title?.trim()||n.name,t[0]=n.name,t[1]=n.title,t[2]=o):o=t[2];let s=o,c=`${n.name}.md`,l=n.source_folder===``,u;t[3]!==a||t[4]!==s||t[5]!==c||t[6]!==l||t[7]!==r?(u=a(l?{id:`89TtiD`,values:{displayTitle:s,fileName:c}}:{id:`0_J12R`,values:{displayTitle:s,fileName:c,targetLabel:r}}),t[3]=a,t[4]=s,t[5]=c,t[6]=l,t[7]=r,t[8]=u):u=t[8];let d=u,f;t[9]===s?f=t[10]:(f=(0,Z.jsx)(`span`,{className:`truncate text-sm font-medium leading-tight text-foreground/80`,children:s}),t[9]=s,t[10]=f);let p;t[11]===c?p=t[12]:(p=(0,Z.jsx)(`span`,{className:`truncate font-mono text-1sm font-normal text-muted-foreground`,children:c}),t[11]=c,t[12]=p);let m;t[13]!==f||t[14]!==p?(m=(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,children:[f,p]}),t[13]=f,t[14]=p,t[15]=m):m=t[15];let h=`shrink-0 font-mono text-1sm ${l?`text-muted-foreground/70`:`text-muted-foreground`}`,g;t[16]!==h||t[17]!==r?(g=(0,Z.jsx)(`span`,{className:h,children:r}),t[16]=h,t[17]=r,t[18]=g):g=t[18];let _;return t[19]!==d||t[20]!==i||t[21]!==m||t[22]!==g?(_=(0,Z.jsxs)(X,{type:`button`,variant:`ghost`,onClick:i,"aria-label":d,className:`group flex h-auto w-full items-center justify-between gap-4 rounded-none p-4 text-left transition-colors hover:bg-muted/50 focus-visible:bg-muted/50`,children:[m,g]}),t[19]=d,t[20]=i,t[21]=m,t[22]=g,t[23]=_):_=t[23],_}function _w(e){let t=(0,$.c)(25),{terminalDock:n}=e,r=n===void 0?null:n,[i,a]=(0,Q.useState)(!1),[o,s]=(0,Q.useState)(void 0),[c,l]=(0,Q.useState)(null),[u,d]=(0,Q.useState)(0),f=(0,Q.useRef)(!1),p=(0,Q.useRef)(void 0),m,h;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m=()=>{let e=!1,t=async function(){try{let{ok:t,body:n}=await cu();if(e)return;let r=t?zi.safeParse(n):null;r?.success?(l(bw(r.data.documents)),f.current=!0):f.current||=(l(1),!0)}catch{!e&&!f.current&&(l(1),f.current=!0)}};t();let n=eu(e=>{e.includes(`files`)&&t()});return()=>{e=!0,n(),clearTimeout(p.current)}},h=[],t[0]=m,t[1]=h):(m=t[0],h=t[1]),(0,Q.useEffect)(m,h);let g;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(g=function(){clearTimeout(p.current),p.current=setTimeout(()=>d(yw),500),cu().then(e=>{let{ok:t,body:n}=e;if(!t)return;let r=zi.safeParse(n);r.success&&l(bw(r.data.documents))}).catch(vw)},t[2]=g):g=t[2];let _=g,v=c!==null,y=c===0,b;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(b=function(e){a(e),e||s(void 0)},t[3]=b):b=t[3];let x=b;if(r!==null){let e=r===`bottom`?`justify-end`:`justify-center`,n;t[4]===e?n=t[5]:(n=Y(`@container/emptystate flex min-h-0 flex-1 flex-col items-center pb-8 pt-10`,e),t[4]=e,t[5]=n);let i;t[6]!==u||t[7]!==y||t[8]!==v?(i=v?(0,Z.jsx)(xw,{isOnboarding:y,celebrateSignal:u}):null,t[6]=u,t[7]=y,t[8]=v,t[9]=i):i=t[9];let a;t[10]===i?a=t[11]:(a=(0,Z.jsx)(`div`,{className:`flex w-full flex-col items-center px-4 @md/emptystate:px-10 @2xl/emptystate:px-16`,children:i}),t[10]=i,t[11]=a);let o;return t[12]!==n||t[13]!==a?(o=(0,Z.jsx)(`div`,{className:n,children:a}),t[12]=n,t[13]=a,t[14]=o):o=t[14],o}let S;t[15]!==u||t[16]!==y||t[17]!==v?(S=v?y?(0,Z.jsx)(Sw,{celebrateSignal:u,onPackSelect:e=>{s(e),a(!0)}}):(0,Z.jsx)(fw,{celebrateSignal:u,onAddStarterPack:()=>{a(!0)}}):null,t[15]=u,t[16]=y,t[17]=v,t[18]=S):S=t[18];let C;t[19]!==o||t[20]!==i?(C=(0,Z.jsx)(Nv,{open:i,onOpenChange:x,onSeedApplied:_,initialPackId:o}),t[19]=o,t[20]=i,t[21]=C):C=t[21];let w;return t[22]!==S||t[23]!==C?(w=(0,Z.jsx)(`div`,{className:`@container/emptystate flex min-h-0 flex-1 flex-col items-center overflow-y-auto subtle-scrollbar`,children:(0,Z.jsxs)(`div`,{className:`flex w-full flex-1 flex-col items-center px-4 @md/emptystate:px-10 @2xl/emptystate:px-16`,children:[S,C]})}),t[22]=S,t[23]=C,t[24]=w):w=t[24],w}function vw(){}function yw(e){return e+1}function bw(e){return zl(e).filter(e=>e.kind===`document`||e.kind===`folder`).length}function xw(e){let t=(0,$.c)(15),{isOnboarding:n,celebrateSignal:r}=e,{_:i}=gt(),a=ec(),o,s,c,l;if(t[0]!==i||t[1]!==a||t[2]!==n){let{title:e,subtitle:r}=cw({isOnboarding:n,isEmbedded:a});l=`w-full max-w-5xl`,o=sw,s=i(e),c=i(r),t[0]=i,t[1]=a,t[2]=n,t[3]=o,t[4]=s,t[5]=c,t[6]=l}else o=t[3],s=t[4],c=t[5],l=t[6];let u;t[7]!==o||t[8]!==r||t[9]!==s||t[10]!==c?(u=(0,Z.jsx)(o,{title:s,subtitle:c,celebrateSignal:r}),t[7]=o,t[8]=r,t[9]=s,t[10]=c,t[11]=u):u=t[11];let d;return t[12]!==l||t[13]!==u?(d=(0,Z.jsx)(`div`,{className:l,children:u}),t[12]=l,t[13]=u,t[14]=d):d=t[14],d}function Sw(e){let t=(0,$.c)(29),{celebrateSignal:n,onPackSelect:r}=e,{_:i}=gt(),a=ec(),o,s,c,l;if(t[0]!==i||t[1]!==a){let{title:e,subtitle:n}=cw({isOnboarding:!0,isEmbedded:a});l=`flex w-full flex-col gap-10 py-12 max-w-5xl my-auto`,o=sw,s=i(e),c=i(n),t[0]=i,t[1]=a,t[2]=o,t[3]=s,t[4]=c,t[5]=l}else o=t[2],s=t[3],c=t[4],l=t[5];let u;t[6]!==o||t[7]!==n||t[8]!==s||t[9]!==c?(u=(0,Z.jsx)(o,{title:s,subtitle:c,celebrateSignal:n}),t[6]=o,t[7]=n,t[8]=s,t[9]=c,t[10]=u):u=t[10];let d;t[11]===a?d=t[12]:(d=a?(0,Z.jsx)(xC,{scenario:`new-project`}):(0,Z.jsx)(iw,{scenario:`new-project`}),t[11]=a,t[12]=d);let f;t[13]!==i||t[14]!==a?(f=i(a?{id:`GubkSu`}:{id:`xeXS4P`}),t[13]=i,t[14]=a,t[15]=f):f=t[15];let p;t[16]===f?p=t[17]:(p=(0,Z.jsx)(ww,{label:f}),t[16]=f,t[17]=p);let m;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(m=[`okf`,`entity-vault`],t[18]=m):m=t[18];let h;t[19]===r?h=t[20]:(h=(0,Z.jsx)(Dv,{onPackSelect:r,onCreateBlankFile:Cw,collapsedPackIds:m}),t[19]=r,t[20]=h);let g;t[21]!==p||t[22]!==h?(g=(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-3`,children:[p,h]}),t[21]=p,t[22]=h,t[23]=g):g=t[23];let _;return t[24]!==g||t[25]!==l||t[26]!==u||t[27]!==d?(_=(0,Z.jsxs)(`div`,{className:l,children:[u,d,g]}),t[24]=g,t[25]=l,t[26]=u,t[27]=d,t[28]=_):_=t[28],_}function Cw(){return uw()}function ww(e){let t=(0,$.c)(13),{label:n}=e,{_:r}=gt(),i;t[0]===n?i=t[1]:(i=(0,Z.jsx)(`span`,{className:`font-mono text-2xs uppercase tracking-wider text-muted-foreground whitespace-nowrap`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=r({id:`jAMpHn`}),t[2]=r,t[3]=a);let o;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(Yc,{className:`size-3.5`,"aria-hidden":!0}),t[4]=o):o=t[4];let s;t[5]===a?s=t[6]:(s=(0,Z.jsx)(on,{className:`text-muted-foreground transition-colors hover:text-foreground`,"aria-label":a,"data-testid":`starter-pack-info`,children:o}),t[5]=a,t[6]=s);let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(sn,{className:`max-w-xs`,children:(0,Z.jsx)(`p`,{className:`leading-relaxed wrap-break-word`,children:(0,Z.jsx)(J,{id:`k4CuuV`})})}),t[7]=c):c=t[7];let l;t[8]===s?l=t[9]:(l=(0,Z.jsxs)(ln,{children:[s,c]}),t[8]=s,t[9]=l);let u;return t[10]!==i||t[11]!==l?(u=(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[i,l]}),t[10]=i,t[11]=l,t[12]=u):u=t[12],u}function Tw(e){return e===``?`.ok/frontmatter.yml`:`${e}/.ok/frontmatter.yml`}function Ew(e){let t=(0,$.c)(70),{folderPath:n,state:r,onChange:i}=e,{_:a}=gt(),[o,s]=(0,Q.useState)(!1),[c,l]=(0,Q.useState)(null),[u,d]=(0,Q.useState)(null);if(r.status===`idle`||r.status===`loading`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(`section`,{className:`rounded-lg border bg-card p-4 space-y-3`,children:[(0,Z.jsx)(Ow,{}),(0,Z.jsx)(Jd,{className:`h-7 w-full`}),(0,Z.jsx)(Jd,{className:`h-7 w-full`}),(0,Z.jsx)(Jd,{className:`h-7 w-full`})]}),t[0]=e):e=t[0],e}if(r.status===`error`){let{message:e}=r,n;return t[1]===e?n=t[2]:(n=(0,Z.jsx)(`section`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive`,role:`alert`,children:(0,Z.jsx)(J,{id:`lzmtKp`,values:{message:e}})}),t[1]=e,t[2]=n),n}let f;t[3]===r.data.frontmatterLocal?f=t[4]:(f=r.data.frontmatterLocal??{},t[3]=r.data.frontmatterLocal,t[4]=f);let p=f,m;t[5]===r.data.folder.path?m=t[6]:(m=Tw(r.data.folder.path),t[5]=r.data.folder.path,t[6]=m);let h=m,g;t[7]===p?g=t[8]:(g=Object.keys(p),t[7]=p,t[8]=g);let _=g,v;t[9]!==a||t[10]!==n||t[11]!==i?(v=async function(e,t){let r=await _c(n,{[e]:t});if(!r.ok){let{error:e}=r;gl.error(a({id:`xXo8FT`,values:{error:e}}));return}i()},t[9]=a,t[10]=n,t[11]=i,t[12]=v):v=t[12];let y=v,b;t[13]!==a||t[14]!==n||t[15]!==i?(b=async function(e){let t=await _c(n,{[e]:null});if(!t.ok){let{error:e}=t;gl.error(a({id:`ZU8VV_`,values:{error:e}}));return}i()},t[13]=a,t[14]=n,t[15]=i,t[16]=b):b=t[16];let x=b,S;t[17]!==y||t[18]!==p?(S=function(e,t){let n=p[e];y(e,Eo(n,t))},t[17]=y,t[18]=p,t[19]=S):S=t[19];let C=S,w;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(w=function(){l({name:``,type:`text`,value:``,error:null}),s(!1)},t[20]=w):w=t[20];let T=w,E;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(E=function(e){l(t=>{if(!t)return t;let n=e===`date`?new Date().toISOString().slice(0,10):Lo[e];return{...t,type:e,value:n,error:null}})},t[21]=E):E=t[21];let D=E,O;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(O=function(e){l(t=>t&&{...t,value:e})},t[22]=O):O=t[22];let k=O,A;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(A=function(e){l(t=>t&&{...t,name:e,error:null})},t[23]=A):A=t[23];let j=A,M;t[24]!==a||t[25]!==c||t[26]!==n||t[27]!==i||t[28]!==p?(M=async function(e){if(!c)return;let t=e??c.value,r=c.name.trim();if(!r){l({...c,value:t,error:a({id:`8_brI5`})});return}if(ka(t)){l({...c,value:t,error:a({id:`hXUWyd`})});return}if(Object.hasOwn(p,r)){l({...c,value:t,error:a({id:`CTJLpz`,values:{trimmed:r}})});return}let o=await _c(n,{[r]:t});if(!o.ok){l({...c,value:t,error:o.error});return}l(null),i()},t[24]=a,t[25]=c,t[26]=n,t[27]=i,t[28]=p,t[29]=M):M=t[29];let N=M,P;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(P=function(e){d({key:e,draft:e,error:null})},t[30]=P):P=t[30];let F=P,I;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(I=function(e){d(t=>t&&{...t,draft:e,error:null})},t[31]=I):I=t[31];let L=I,R;t[32]!==a||t[33]!==n||t[34]!==i||t[35]!==p||t[36]!==u?(R=async function(){if(!u)return;let e=u.draft.trim();if(!e){d({...u,error:a({id:`8_brI5`})});return}if(e===u.key){d(null);return}if(Object.hasOwn(p,e)){d({...u,error:a({id:`CTJLpz`,values:{trimmed:e}})});return}let t=p[u.key],r=await _c(n,{[u.key]:null,[e]:t});if(!r.ok){d({...u,error:r.error});return}d(null),i()},t[32]=a,t[33]=n,t[34]=i,t[35]=p,t[36]=u,t[37]=R):R=t[37];let z=R,B;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(B=function(){d(null)},t[38]=B):B=t[38];let V=B,H=!o,U;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(U=e=>s(!e),t[39]=U):U=t[39];let W=`size-3 transition-transform ${o?``:`rotate-90`}`,G;t[40]===W?G=t[41]:(G=(0,Z.jsx)(Ho,{className:W,"aria-hidden":!0}),t[40]=W,t[41]=G);let K;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,Z.jsx)(`span`,{children:(0,Z.jsx)(J,{id:`vQIVHc`})}),t[42]=K):K=t[42];let ee;t[43]===G?ee=t[44]:(ee=(0,Z.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:[G,K]}),t[43]=G,t[44]=ee);let te;t[45]===h?te=t[46]:(te=(0,Z.jsx)(`code`,{className:`text-xs text-muted-foreground font-mono cursor-text select-text`,onClick:Dw,children:h}),t[45]=h,t[46]=te);let ne;t[47]!==ee||t[48]!==te?(ne=(0,Z.jsxs)(dn,{className:`flex w-full cursor-pointer items-center justify-between gap-2 px-3 py-2.5 data-[state=open]:border-b border-border`,children:[ee,te]}),t[47]=ee,t[48]=te,t[49]=ne):ne=t[49];let q;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,Z.jsx)(`p`,{className:`px-1 pb-2 text-sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`hSBIG-`})}),t[50]=q):q=t[50];let re;t[51]!==c||t[52]!==y||t[53]!==z||t[54]!==_||t[55]!==p||t[56]!==x||t[57]!==u||t[58]!==C?(re=_.length===0&&!c?(0,Z.jsx)(`p`,{className:`px-1 py-1 text-sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`4c_a6S`})}):_.map(e=>{let t=p[e];return(0,Z.jsx)(Fo,{keyName:e,value:t,declared:Ao(t,wa(t)),rename:{state:u?.key===e?u:null,onBegin:()=>F(e),onChangeDraft:L,onCommit:z,onCancel:V},badge:null,onCommit:t=>void y(e,t),onChangeType:t=>C(e,t),onRemove:()=>void x(e)},e)}),t[51]=c,t[52]=y,t[53]=z,t[54]=_,t[55]=p,t[56]=x,t[57]=u,t[58]=C,t[59]=re):re=t[59];let ie;t[60]!==c||t[61]!==N?(ie=c?(0,Z.jsx)(Mo,{draft:c,onChangeName:j,onChangeType:D,onChangeValue:k,onCommit:e=>void N(e),onCancel:()=>l(null)}):(0,Z.jsx)(`div`,{className:`mt-1 flex flex-wrap items-center gap-1`,children:(0,Z.jsxs)(X,{type:`button`,variant:`ghost`,size:`sm`,"data-testid":`add-property-trigger`,onClick:()=>T(),className:`flex items-center gap-1.5 rounded px-2 py-1 font-medium text-sm hover:bg-muted/50 hover:text-foreground`,children:[(0,Z.jsx)(Wt,{className:`size-3.5`}),(0,Z.jsx)(`span`,{children:(0,Z.jsx)(J,{id:`G8t9NN`})})]})}),t[60]=c,t[61]=N,t[62]=ie):ie=t[62];let ae;t[63]!==re||t[64]!==ie?(ae=(0,Z.jsx)(un,{children:(0,Z.jsxs)(`div`,{className:`px-2 py-2`,children:[q,re,ie]})}),t[63]=re,t[64]=ie,t[65]=ae):ae=t[65];let oe;return t[66]!==H||t[67]!==ne||t[68]!==ae?(oe=(0,Z.jsx)(`section`,{className:`rounded-lg border bg-card`,children:(0,Z.jsxs)(fn,{open:H,onOpenChange:U,children:[ne,ae]})}),t[66]=H,t[67]=ne,t[68]=ae,t[69]=oe):oe=t[69],oe}function Dw(e){return e.stopPropagation()}function Ow(){let e=(0,$.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(Bh,{className:`size-4 text-muted-foreground`,"aria-hidden":!0}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[t,(0,Z.jsx)(`h2`,{className:`text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:(0,Z.jsx)(J,{id:`vQIVHc`})})]}),e[1]=n):n=e[1],n}function kw(e){let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);return t<60?Cl._({id:`xOTzt5`}):t<3600?Cl._({id:`zbymaY`,values:{0:Math.floor(t/60)}}):t<86400?Cl._({id:`optX0N`,values:{0:Math.floor(t/3600)}}):t<86400*7?Cl._({id:`l1l8sj`,values:{0:Math.floor(t/86400)}}):new Date(e).toLocaleDateString(void 0,{month:`short`,day:`numeric`})}function Aw(e){return(e.split(`/`).pop()??e).replace(/\.md$/,``)}function jw(e){let t=e.message,n=t.indexOf(`: `),r=n===-1?t:t.slice(0,n),i=n===-1?``:t.slice(n+2);switch(r){case`template-create`:return{Icon:Ps,label:Cl._({id:`QR5SP1`}),detail:Aw(i)};case`template-edit`:return{Icon:rc,label:Cl._({id:`-LHLx7`}),detail:Aw(i)};case`template-delete`:return{Icon:ll,label:Cl._({id:`_gkGSK`}),detail:Aw(i)};case`template-rename`:case`template-move`:{let[e,t]=i.split(` -> `);return{Icon:yh,label:Cl._({id:`KPW5WC`}),detail:`${Aw(e??``)} → ${Aw(t??i)}`}}case`folder-frontmatter-edit`:return{Icon:Bh,label:Cl._({id:`_tekeB`}),detail:``};case`folder-frontmatter-delete`:return{Icon:Bh,label:Cl._({id:`ZWxfrc`}),detail:``};case`folder-create`:return{Icon:Bh,label:Cl._({id:`ZQLDTl`}),detail:``};default:return{Icon:Pc,label:r.replace(/-/g,` `),detail:Aw(i)}}}function Mw(e){return e.contributors.length>0?e.contributors[0].name:e.author===`openknowledge-service`||e.author===`server`?Cl._({id:`B2DrPb`}):e.author||Cl._({id:`Ef7StM`})}function Nw(e){let t=(0,$.c)(15),{folderPath:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],t[0]=r):r=t[0];let[i,a]=(0,Q.useState)(r),[o,s]=(0,Q.useState)(!0),[c,l]=(0,Q.useState)(!1),u,d;if(t[1]===n?(u=t[2],d=t[3]):(u=()=>{let e=!1,t=async function(){try{let t=await fetch(`/api/history?folder=${encodeURIComponent(n)}&limit=50`);if(e)return;if(!t.ok){l(!0),s(!1);return}let r=await t.json();if(e)return;a(r.entries??[]),l(!1),s(!1)}catch(t){e||(console.warn(`[FolderTimelineCard] failed to load folder timeline:`,t),l(!0),s(!1))}};s(!0),t();let r=su(t);return()=>{e=!0,r()}},d=[n],t[1]=n,t[2]=u,t[3]=d),(0,Q.useEffect)(u,d),c||!o&&i.length===0)return null;let f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(`h2`,{className:`text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:(0,Z.jsx)(J,{id:`XJOV1Y`})}),t[4]=f):f=t[4];let p;t[5]===i.length?p=t[6]:(p=i.length>0?(0,Z.jsx)(Eu,{className:`text-xs`,variant:`secondary`,children:i.length}):null,t[5]=i.length,t[6]=p);let m;t[7]===p?m=t[8]:(m=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-3 py-1`,children:[f,p]}),t[7]=p,t[8]=m);let h;t[9]!==i||t[10]!==o?(h=(0,Z.jsx)(`div`,{className:`px-3 py-2.5`,children:o?(0,Z.jsxs)(`div`,{className:`space-y-2`,role:`status`,"aria-busy":`true`,children:[(0,Z.jsx)(Jd,{className:`h-8 w-full`}),(0,Z.jsx)(Jd,{className:`h-8 w-full`})]}):(0,Z.jsx)(`ul`,{className:`space-y-1`,children:i.map(Pw)})}),t[9]=i,t[10]=o,t[11]=h):h=t[11];let g;return t[12]!==m||t[13]!==h?(g=(0,Z.jsxs)(`section`,{className:`rounded-lg border bg-card`,"data-testid":`folder-timeline-card`,children:[m,h]}),t[12]=m,t[13]=h,t[14]=g):g=t[14],g}function Pw(e){let{Icon:t,label:n,detail:r}=jw(e);return(0,Z.jsxs)(`li`,{className:`flex items-center gap-2.5 rounded-md px-2 py-1.5 text-sm`,children:[(0,Z.jsx)(t,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":!0}),(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[(0,Z.jsx)(`span`,{className:`text-foreground`,children:n}),r?(0,Z.jsx)(`code`,{className:`ml-1.5 font-mono text-xs text-muted-foreground`,children:r}):null]}),(0,Z.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1 text-xs text-muted-foreground`,children:[(0,Z.jsx)(Pg,{className:`size-3`,"aria-hidden":!0}),Mw(e)]}),(0,Z.jsx)(`time`,{className:`shrink-0 text-xs text-muted-foreground/80`,dateTime:e.timestamp,title:new Date(e.timestamp).toLocaleString(),children:kw(e.timestamp)})]},e.sha)}function Fw(e){let t=e.split(`/`).pop();return t?`${e}/${t}`:null}function Iw(e,t){let n=t.get(`${e}/index`);if(n)return n;let r=Fw(e);if(r){let e=t.get(r);if(e)return e}return e.split(`/`).pop()??e}function Lw(e,t,n){let r=n.get(e);return r&&r!==e?r:t}function Rw(e,t){let n=e===``?``:`${e}/`,r=[...t.folderPaths].filter(e=>e.startsWith(n)).map(e=>({path:e,rel:e.slice(n.length)})).filter(e=>e.rel.length>0&&!e.rel.includes(`/`)).map(({path:e,rel:n})=>({kind:`folder`,path:e,name:n,title:Iw(e,t.pageTitles)})),i=[...t.pages].filter(e=>e.startsWith(n)).map(e=>({docName:e,rel:e.slice(n.length)})).filter(e=>e.rel.length>0&&!e.rel.includes(`/`)).map(({docName:e,rel:n})=>{let r=t.pageMeta.get(e);return{kind:`file`,path:e,name:n,title:Lw(e,n,t.pageTitles),size:r?.size??0,modified:r?.modified??``}}),a=[...r,...i].sort((e,t)=>e.kind===t.kind?e.title.localeCompare(t.title)||e.name.localeCompare(t.name):e.kind===`folder`?-1:1);return{title:Iw(e,t.pageTitles),children:a}}function zw(e){let t=(0,$.c)(41),{folderPath:n,state:r,onChange:i,folderConfigHandle:a}=e,[o,s]=(0,Q.useState)(null),[c,l]=(0,Q.useState)(null),[u,d]=(0,Q.useState)(!1);if(r.status===`idle`||r.status===`loading`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(`section`,{className:`rounded-lg border bg-card px-3 py-2.5 space-y-3`,children:[(0,Z.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Z.jsx)(`h2`,{className:`text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:(0,Z.jsx)(J,{id:`-QCLWk`})})}),(0,Z.jsx)(Jd,{className:`h-12 w-full`}),(0,Z.jsx)(Jd,{className:`h-12 w-full`})]}),t[0]=e):e=t[0],e}if(r.status===`error`){let{message:e}=r,n;return t[1]===e?n=t[2]:(n=(0,Z.jsx)(`section`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive`,role:`alert`,children:(0,Z.jsx)(J,{id:`iDZtvM`,values:{message:e}})}),t[1]=e,t[2]=n),n}let f;t[3]===r.data.folder.templates_available?f=t[4]:(f=r.data.folder.templates_available??[],t[3]=r.data.folder.templates_available,t[4]=f);let p=f,m;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Z.jsx)(`h2`,{className:`text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:(0,Z.jsx)(J,{id:`-QCLWk`})}),t[5]=m):m=t[5];let h;t[6]===p.length?h=t[7]:(h=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[m,(0,Z.jsx)(Eu,{className:`text-xs`,variant:`secondary`,children:p.length})]}),t[6]=p.length,t[7]=h);let g;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Z.jsxs)(X,{variant:`ghost`,className:`font-mono uppercase`,size:`sm`,onClick:()=>d(!0),children:[(0,Z.jsx)(Wt,{className:`size-3.5`,"aria-hidden":!0}),(0,Z.jsx)(J,{id:`G1Gw0v`})]}),t[8]=g):g=t[8];let _;t[9]===h?_=t[10]:(_=(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border px-3 py-1`,children:[h,g]}),t[9]=h,t[10]=_);let v;t[11]===p?v=t[12]:(v=(0,Z.jsx)(`div`,{className:`px-3 py-2.5`,children:p.length===0?(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`MZSBsh`})}):(0,Z.jsx)(`ul`,{className:`space-y-1`,children:p.map(e=>(0,Z.jsx)(Es,{template:e,onCreate:()=>l(e.name),onEdit:()=>vc(Ve(e.source_folder,e.name)),onDelete:()=>s(e),badge:e.scope===`inherited`?(0,Z.jsx)(wo,{source:e.source_folder,target:`templates/${e.name}.md`}):void 0},e.path))})}),t[11]=p,t[12]=v);let y;t[13]!==_||t[14]!==v?(y=(0,Z.jsxs)(`section`,{className:`rounded-lg border bg-card`,children:[_,v]}),t[13]=_,t[14]=v,t[15]=y):y=t[15];let b;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(b=e=>{e||s(null)},t[16]=b):b=t[16];let x;t[17]!==o||t[18]!==i?(x=(0,Z.jsx)(Os,{template:o,onOpenChange:b,onDeleted:i}),t[17]=o,t[18]=i,t[19]=x):x=t[19];let S;t[20]===p?S=t[21]:(S=new Set(p.map(Bw)),t[20]=p,t[21]=S);let C;t[22]!==n||t[23]!==i?(C=e=>{i(),vc(Ve(n,e))},t[22]=n,t[23]=i,t[24]=C):C=t[24];let w;t[25]!==n||t[26]!==u||t[27]!==S||t[28]!==C?(w=(0,Z.jsx)(ys,{folderPath:n,existingNames:S,open:u,onOpenChange:d,onCreated:C}),t[25]=n,t[26]=u,t[27]=S,t[28]=C,t[29]=w):w=t[29];let T=c!==null,E;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(E=e=>{e||l(null)},t[30]=E):E=t[30];let D=c??void 0,O;t[31]!==a||t[32]!==n||t[33]!==T||t[34]!==D?(O=(0,Z.jsx)(av,{open:T,onOpenChange:E,kind:`file`,initialDir:n,initialTemplate:D,folderConfig:a}),t[31]=a,t[32]=n,t[33]=T,t[34]=D,t[35]=O):O=t[35];let k;return t[36]!==w||t[37]!==O||t[38]!==y||t[39]!==x?(k=(0,Z.jsxs)(Z.Fragment,{children:[y,x,w,O]}),t[36]=w,t[37]=O,t[38]=y,t[39]=x,t[40]=k):k=t[40],k}function Bw(e){return e.name}function Vw(e){let t=(0,$.c)(14),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,containerClassName:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=Y(`relative w-full overflow-x-auto subtle-scrollbar`,r),t[4]=r,t[5]=a);let o;t[6]===n?o=t[7]:(o=Y(`w-full caption-bottom text-sm`,n),t[6]=n,t[7]=o);let s;t[8]!==i||t[9]!==o?(s=(0,Z.jsx)(`table`,{"data-slot":`table`,className:o,...i}),t[8]=i,t[9]=o,t[10]=s):s=t[10];let c;return t[11]!==a||t[12]!==s?(c=(0,Z.jsx)(`div`,{"data-slot":`table-container`,className:a,children:s}),t[11]=a,t[12]=s,t[13]=c):c=t[13],c}function Hw(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Y(`[&_tr]:border-b`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`thead`,{"data-slot":`table-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Uw(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Y(`[&_tr:last-child]:border-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`tbody`,{"data-slot":`table-body`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ww(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,noHover:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=(i===void 0?!1:i)&&`hover:bg-transparent`,o;t[4]!==n||t[5]!==a?(o=Y(`hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors`,a,n),t[4]=n,t[5]=a,t[6]=o):o=t[6];let s;return t[7]!==r||t[8]!==o?(s=(0,Z.jsx)(`tr`,{"data-slot":`table-row`,className:o,...r}),t[7]=r,t[8]=o,t[9]=s):s=t[9],s}function Gw(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,scope:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`col`:i,o;t[4]===n?o=t[5]:(o=Y(`font-mono uppercase text-xs text-muted-foreground h-10 px-4 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,n),t[4]=n,t[5]=o);let s;return t[6]!==r||t[7]!==a||t[8]!==o?(s=(0,Z.jsx)(`th`,{"data-slot":`table-head`,scope:a,className:o,...r}),t[6]=r,t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function Kw(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Y(`py-3 px-4 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`td`,{"data-slot":`table-cell`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function qw(e){if(!e)return`—`;let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/6e4);if(r<1)return Cl._({id:`xOTzt5`});if(r<60)return Cl._({id:`NRSLBe`,values:{diffMin:r}});let i=Math.floor(r/60);if(i<24)return Cl._({id:`hDKtoF`,values:{diffHrs:i}});let a=Math.floor(i/24);return a<30?Cl._({id:`QDZbvN`,values:{diffDays:a}}):t.toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`})}function Jw(e,t,n){return[...e].sort((e,r)=>{if(e.kind!==r.kind)return e.kind===`folder`?-1:1;let i=0;switch(t){case`name`:i=e.title.localeCompare(r.title)||e.name.localeCompare(r.name);break;case`modified`:{let t=e.kind===`file`?e.modified:``,n=r.kind===`file`?r.modified:``;i=t.localeCompare(n);break}}return n===`asc`?i:-i})}function Yw(e){let t=(0,$.c)(10),{label:n,sortKey:r,activeKey:i,activeDir:a,onSort:o}=e,s=i===r,c;t[0]!==o||t[1]!==r?(c=()=>o(r),t[0]=o,t[1]=r,t[2]=c):c=t[2];let l;t[3]!==a||t[4]!==s?(l=s?a===`asc`?(0,Z.jsx)(Hn,{className:`ml-1 size-3`}):(0,Z.jsx)(zn,{className:`ml-1 size-3`}):(0,Z.jsx)(bh,{className:`ml-1 size-3 text-muted-foreground/50`}),t[3]=a,t[4]=s,t[5]=l):l=t[5];let u;return t[6]!==n||t[7]!==c||t[8]!==l?(u=(0,Z.jsxs)(X,{variant:`ghost`,size:`sm`,className:`-ml-3 h-8 uppercase font-mono`,onClick:c,children:[n,l]}),t[6]=n,t[7]=c,t[8]=l,t[9]=u):u=t[9],u}function Xw(e){let t=(0,$.c)(96),{folderPath:n}=e,{_:r}=gt(),{folderPaths:i,loading:a,pages:o,pageTitles:s,pageMeta:c}=Go(),l=Ms(n),{state:u,refresh:d}=l,[f,p]=(0,Q.useState)(!1),[m,h]=(0,Q.useState)(`name`),[g,_]=(0,Q.useState)(`asc`);if(a){let e;t[0]===r?e=t[1]:(e=r({id:`X9VpsP`}),t[0]=r,t[1]=e);let n;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Jd,{className:`size-5 rounded`}),(0,Z.jsx)(Jd,{className:`h-7 w-48`})]}),(0,Z.jsx)(Jd,{className:`h-9 w-20 rounded-md`})]}),t[2]=n):n=t[2];let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(Jd,{className:`h-4 w-16`}),t[3]=i):i=t[3];let a;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsxs)(`div`,{className:`mx-auto flex w-full max-w-4xl flex-col gap-6 px-6 py-8`,children:[n,(0,Z.jsxs)(`div`,{className:`rounded-lg border`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-4 border-b px-4 py-3`,children:[i,(0,Z.jsx)(`div`,{className:`ml-auto`,children:(0,Z.jsx)(Jd,{className:`h-4 w-20`})})]}),[`a`,`b`,`c`,`d`].map($w)]})]}),t[4]=a):a=t[4];let o;return t[5]===e?o=t[6]:(o=(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 items-start overflow-y-auto subtle-scrollbar`,role:`status`,"aria-busy":`true`,"aria-label":e,children:a}),t[5]=e,t[6]=o),o}let v,y,b,x,S,C,w,T,E,D,O;if(t[7]!==r||t[8]!==u||t[9]!==l||t[10]!==n||t[11]!==i||t[12]!==c||t[13]!==s||t[14]!==o||t[15]!==d||t[16]!==g||t[17]!==m){let e=Rw(n,{pages:o,pageTitles:s,pageMeta:c,folderPaths:i}),a=Jw(e.children,m,g),f=e.title||(n===``?r({id:`3aeN7X`}):e.title),k;t[29]===m?k=t[30]:(k=function(e){e===m?_(Qw):(h(e),_(`asc`))},t[29]=m,t[30]=k);let A=k;O=`flex min-h-0 flex-1 items-start overflow-y-auto subtle-scrollbar`,C=`mx-auto flex w-full max-w-4xl flex-col gap-6 px-6 py-8`;let j;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Z.jsx)(hc,{className:`size-5 text-muted-foreground`}),t[31]=j):j=t[31];let M=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[j,(0,Z.jsx)(`h1`,{className:`text-2xl font-light tracking-tight`,children:f})]}),N;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Z.jsxs)(X,{onClick:()=>p(!0),children:[(0,Z.jsx)(Wt,{className:`size-4`}),(0,Z.jsx)(J,{id:`isRobC`})]}),t[32]=N):N=t[32],t[33]===M?w=t[34]:(w=(0,Z.jsx)(`div`,{className:`flex flex-col gap-6`,children:(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[M,N]})}),t[33]=M,t[34]=w),t[35]!==u||t[36]!==n||t[37]!==d?(T=(0,Z.jsx)(Ew,{folderPath:n,state:u,onChange:d}),t[35]=u,t[36]=n,t[37]=d,t[38]=T):T=t[38],t[39]!==u||t[40]!==l||t[41]!==n||t[42]!==d?(E=(0,Z.jsx)(zw,{folderPath:n,state:u,onChange:d,folderConfigHandle:l}),t[39]=u,t[40]=l,t[41]=n,t[42]=d,t[43]=E):E=t[43],t[44]===n?D=t[45]:(D=(0,Z.jsx)(Nw,{folderPath:n}),t[44]=n,t[45]=D),S=`rounded-lg border`,y=Vw;let P=m===`name`?g===`asc`?`ascending`:`descending`:`none`,F;t[46]===r?F=t[47]:(F=r({id:`6YtxFj`}),t[46]=r,t[47]=F);let I;t[48]!==A||t[49]!==g||t[50]!==m||t[51]!==F?(I=(0,Z.jsx)(Yw,{label:F,sortKey:`name`,activeKey:m,activeDir:g,onSort:A}),t[48]=A,t[49]=g,t[50]=m,t[51]=F,t[52]=I):I=t[52];let L;t[53]!==P||t[54]!==I?(L=(0,Z.jsx)(Gw,{"aria-sort":P,children:I}),t[53]=P,t[54]=I,t[55]=L):L=t[55];let R=m===`modified`?g===`asc`?`ascending`:`descending`:`none`,z;t[56]===r?z=t[57]:(z=r({id:`tgWuMB`}),t[56]=r,t[57]=z);let B;t[58]!==A||t[59]!==g||t[60]!==m||t[61]!==z?(B=(0,Z.jsx)(Yw,{label:z,sortKey:`modified`,activeKey:m,activeDir:g,onSort:A}),t[58]=A,t[59]=g,t[60]=m,t[61]=z,t[62]=B):B=t[62];let V;t[63]!==R||t[64]!==B?(V=(0,Z.jsx)(Gw,{className:`w-32`,"aria-sort":R,children:B}),t[63]=R,t[64]=B,t[65]=V):V=t[65],t[66]!==L||t[67]!==V?(x=(0,Z.jsx)(Hw,{children:(0,Z.jsxs)(Ww,{children:[L,V]})}),t[66]=L,t[67]=V,t[68]=x):x=t[68],v=Uw,b=a.length?a.map(Zw):(0,Z.jsx)(Ww,{children:(0,Z.jsx)(Kw,{colSpan:2,className:`h-24 text-center text-muted-foreground`,children:(0,Z.jsx)(J,{id:`Pkw7J9`})})}),t[7]=r,t[8]=u,t[9]=l,t[10]=n,t[11]=i,t[12]=c,t[13]=s,t[14]=o,t[15]=d,t[16]=g,t[17]=m,t[18]=v,t[19]=y,t[20]=b,t[21]=x,t[22]=S,t[23]=C,t[24]=w,t[25]=T,t[26]=E,t[27]=D,t[28]=O}else v=t[18],y=t[19],b=t[20],x=t[21],S=t[22],C=t[23],w=t[24],T=t[25],E=t[26],D=t[27],O=t[28];let k;t[69]!==v||t[70]!==b?(k=(0,Z.jsx)(v,{children:b}),t[69]=v,t[70]=b,t[71]=k):k=t[71];let A;t[72]!==y||t[73]!==k||t[74]!==x?(A=(0,Z.jsxs)(y,{children:[x,k]}),t[72]=y,t[73]=k,t[74]=x,t[75]=A):A=t[75];let j;t[76]!==A||t[77]!==S?(j=(0,Z.jsx)(`div`,{className:S,children:A}),t[76]=A,t[77]=S,t[78]=j):j=t[78];let M;t[79]!==j||t[80]!==C||t[81]!==w||t[82]!==T||t[83]!==E||t[84]!==D?(M=(0,Z.jsxs)(`div`,{className:C,children:[w,T,E,D,j]}),t[79]=j,t[80]=C,t[81]=w,t[82]=T,t[83]=E,t[84]=D,t[85]=M):M=t[85];let N;t[86]!==M||t[87]!==O?(N=(0,Z.jsx)(`div`,{className:O,children:M}),t[86]=M,t[87]=O,t[88]=N):N=t[88];let P;t[89]!==f||t[90]!==l||t[91]!==n?(P=(0,Z.jsx)(av,{open:f,onOpenChange:p,kind:`file`,initialDir:n,folderConfig:l,suggestedName:`index`}),t[89]=f,t[90]=l,t[91]=n,t[92]=P):P=t[92];let F;return t[93]!==N||t[94]!==P?(F=(0,Z.jsxs)(Z.Fragment,{children:[N,P]}),t[93]=N,t[94]=P,t[95]=F):F=t[95],F}function Zw(e){return(0,Z.jsxs)(Ww,{children:[(0,Z.jsx)(Kw,{children:(0,Z.jsxs)(`a`,{href:Cu(e.path),className:`flex items-center gap-2 rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[e.kind===`folder`?(0,Z.jsx)(Hh,{className:`size-4 shrink-0 text-muted-foreground`}):(0,Z.jsx)(he,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`truncate`,children:e.title})]})}),(0,Z.jsx)(Kw,{className:`text-muted-foreground`,children:e.kind===`file`?qw(e.modified):`—`})]},e.path)}function Qw(e){return e===`asc`?`desc`:`asc`}function $w(e){return(0,Z.jsxs)(`div`,{className:`flex items-center gap-3 border-b px-4 py-3 last:border-b-0`,children:[(0,Z.jsx)(Jd,{className:`size-4 rounded`}),(0,Z.jsx)(Jd,{className:`h-4 w-40`}),(0,Z.jsx)(`div`,{className:`ml-auto`,children:(0,Z.jsx)(Jd,{className:`h-4 w-16`})})]},e)}function eT(e){let t=(0,$.c)(24),{docName:n,size:r,limit:i,backNav:a}=e,o=a!==void 0,s=(0,Q.useRef)(null),c=(0,Q.useRef)(null),l,u;t[0]===o?(l=t[1],u=t[2]):(l=()=>{o?s.current?.focus():c.current?.focus()},u=[o],t[0]=o,t[1]=l,t[2]=u),(0,Q.useEffect)(l,u);let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(`div`,{className:`flex size-16 items-center justify-center rounded-full border bg-muted/40 text-muted-foreground`,children:(0,Z.jsx)(Ih,{className:`size-9`,"aria-hidden":`true`})}),t[3]=d):d=t[3];let f=o?void 0:-1,p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsx)(J,{id:`P3hnm0`}),t[4]=p):p=t[4];let m;t[5]===f?m=t[6]:(m=(0,Z.jsx)(`h2`,{ref:c,id:`large-file-title`,tabIndex:f,className:`text-2xl font-light text-balance outline-none`,children:p}),t[5]=f,t[6]=m);let h;t[7]===r?h=t[8]:(h=ta(r),t[7]=r,t[8]=h);let g;t[9]===i?g=t[10]:(g=ta(i),t[9]=i,t[10]=g);let _;t[11]!==n||t[12]!==h||t[13]!==g?(_=(0,Z.jsx)(`p`,{className:`max-w-md text-sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`GJH-AT`,values:{0:h,1:g,docName:n}})}),t[11]=n,t[12]=h,t[13]=g,t[14]=_):_=t[14];let v;t[15]!==m||t[16]!==_?(v=(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[m,_]}),t[15]=m,t[16]=_,t[17]=v):v=t[17];let y;t[18]!==a||t[19]!==o?(y=o?(0,Z.jsxs)(X,{ref:s,variant:`default`,onClick:()=>a.onNavigateBack(a.previousDocName),children:[(0,Z.jsx)(In,{className:`size-4`,"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`CKyk7Q`})]}):null,t[18]=a,t[19]=o,t[20]=y):y=t[20];let b;return t[21]!==v||t[22]!==y?(b=(0,Z.jsxs)(`div`,{role:`status`,"aria-labelledby":`large-file-title`,"data-slot":`large-file-editor-state`,className:`flex h-full flex-col items-center justify-center gap-8 p-8 text-center`,children:[d,v,y]}),t[21]=v,t[22]=y,t[23]=b):b=t[23],b}function tT(e){let t=(0,$.c)(8),{docName:n}=e,[r,i]=(0,Q.useState)(nT),a,o;if(t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>qe(e=>{i(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n})}),o=[],t[0]=a,t[1]=o):(a=t[0],o=t[1]),(0,Q.useEffect)(a,o),!r.has(n))return null;let s;t[2]===n?s=t[3]:(s=function(){ot(n)?.abort(),i(e=>{if(!e.has(n))return e;let t=new Set(e);return t.delete(n),t})},t[2]=n,t[3]=s);let c=s,l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(`span`,{children:(0,Z.jsx)(J,{id:`A67Uwj`})}),t[4]=l):l=t[4];let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(J,{id:`dEgA5A`}),t[5]=u):u=t[5];let d;return t[6]===c?d=t[7]:(d=(0,Z.jsxs)(`div`,{className:`absolute inset-x-0 bottom-8 z-20 flex justify-center text-xs text-muted-foreground`,children:[l,(0,Z.jsx)(X,{variant:`link`,size:`sm`,className:`h-auto px-2 py-0 text-xs`,onClick:c,children:u})]}),t[6]=c,t[7]=d),d}function nT(){return new Set}function rT(e){let t=(0,$.c)(20),{nav:n}=e,{state:r,refetch:i}=cc(n),a=(0,Q.useRef)(null),o=n.branch,s,c;t[0]===r.phase?(s=t[1],c=t[2]):(s=()=>{r.phase===`resolved`&&a.current?.querySelector(`button`)?.focus()},c=[r.phase],t[0]=r.phase,t[1]=s,t[2]=c),(0,Q.useEffect)(s,c);let l;t[3]===n.path?l=t[4]:(l=function(){window.location.hash=pu(lc(n.path))},t[3]=n.path,t[4]=l);let u=l,d;t[5]!==o||t[6]!==n.kind?(d=function(e){uc.arm({kind:n.kind,path:e,branch:o}),window.location.hash=n.kind===`folder`?pu(e):Cu(e)},t[5]=o,t[6]=n.kind,t[7]=d):d=t[7];let f=d,p=r.phase===`pending`?`polite`:void 0,m=r.phase===`resolved`?r.resolution.verdict:void 0,h=r.phase===`pending`?`flex h-full flex-col items-center justify-center gap-3 p-8 text-center text-sm text-muted-foreground`:`flex h-full flex-col items-center justify-center gap-6 p-8 text-center`,g;t[8]!==u||t[9]!==n||t[10]!==f||t[11]!==i||t[12]!==r?(g=(0,Z.jsx)(fc,{nav:n,state:r,onBrowseFolder:u,onOpenRenamed:f,onEnableAutoSync:u,onSyncCompleted:i,onPullApplied:i}),t[8]=u,t[9]=n,t[10]=f,t[11]=i,t[12]=r,t[13]=g):g=t[13];let _;return t[14]!==r.phase||t[15]!==p||t[16]!==m||t[17]!==h||t[18]!==g?(_=(0,Z.jsx)(`div`,{ref:a,role:`status`,"aria-live":p,"data-testid":`share-receive-miss-panel`,"data-phase":r.phase,"data-verdict":m,className:h,children:g}),t[14]=r.phase,t[15]=p,t[16]=m,t[17]=h,t[18]=g,t[19]=_):_=t[19],_}var iT=e(zt(),1);function aT(e){let t=(0,$.c)(9),{text:n}=e,r;t[0]===n?r=t[1]:(r=Ga(n),t[0]=n,t[1]=r);let{map:i}=r,a,o;if(t[2]!==i||t[3]!==n){o=Symbol.for(`react.early_return_sentinel`);bb0:{let e=Fi(n),r=e.length>0?e:Object.keys(i);if(r.length===0){o=null;break bb0}let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(J,{id:`l_UFPv`}),t[6]=s):s=t[6];let c;t[7]===i?c=t[8]:(c=(e,t)=>{let n=i[e];return n===void 0?null:(0,Z.jsx)(oT,{keyName:e,value:n},`${e}-${t}`)},t[7]=i,t[8]=c),a=(0,Z.jsx)(Po,{title:s,count:r.length,testId:`readonly-property-panel`,className:`pt-4`,children:r.map(c)})}t[2]=i,t[3]=n,t[4]=a,t[5]=o}else a=t[4],o=t[5];return o===Symbol.for(`react.early_return_sentinel`)?a:o}function oT(e){let t=(0,$.c)(12),{keyName:n,value:r}=e,i=To[wa(r)],a;t[0]===i?a=t[1]:(a=(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`flex size-7 shrink-0 items-center justify-center rounded text-muted-foreground`,children:(0,Z.jsx)(i,{className:`size-3.5`})}),t[0]=i,t[1]=a);let o;t[2]===n?o=t[3]:(o=(0,Z.jsx)(`span`,{className:`flex h-7 w-32 shrink-0 items-center truncate px-2 text-sm text-muted-foreground`,children:n}),t[2]=n,t[3]=o);let s;t[4]!==n||t[5]!==r?(s=(0,Z.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,Z.jsx)(sT,{keyName:n,value:r})}),t[4]=n,t[5]=r,t[6]=s):s=t[6];let c;return t[7]!==n||t[8]!==a||t[9]!==o||t[10]!==s?(c=(0,Z.jsxs)(`div`,{className:`group flex items-start gap-1 py-0.5`,"data-testid":`readonly-property-row`,"data-key":n,children:[a,o,s]}),t[7]=n,t[8]=a,t[9]=o,t[10]=s,t[11]=c):c=t[11],c}function sT(e){let t=(0,$.c)(8),{keyName:n,value:r}=e;if(No(r)){let e;return t[0]!==n||t[1]!==r?(e=(0,Z.jsx)(ko,{keyName:n,value:r}),t[0]=n,t[1]=r,t[2]=e):e=t[2],e}let i;t[3]===r?i=t[4]:(i=Array.isArray(r)?r.filter(cT).join(`, `):String(r),t[3]=r,t[4]=i);let a=i,o;return t[5]!==a||t[6]!==n?(o=(0,Z.jsx)(`div`,{className:`flex min-h-7 items-center px-2 py-1 text-sm break-words`,"data-testid":`readonly-property-value`,"data-key":n,children:a}),t[5]=a,t[6]=n,t[7]=o):o=t[7],o}function cT(e){return typeof e==`string`}function lT(e){let t=(0,$.c)(29),{fileName:n,text:r}=e,i,a,o,s;if(t[0]!==r){let e=pa(r).body;s=Ln,i=Ie,a=!1,o=Bn().parseWithFallback(e),t[0]=r,t[1]=i,t[2]=a,t[3]=o,t[4]=s}else i=t[1],a=t[2],o=t[3],s=t[4];let c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(c={attributes:{class:`pt-4`}},t[5]=c):c=t[5];let l;t[6]!==i||t[7]!==a||t[8]!==o?(l={extensions:i,editable:a,content:o,editorProps:c},t[6]=i,t[7]=a,t[8]=o,t[9]=l):l=t[9];let u;t[10]===r?u=t[11]:(u=[r],t[10]=r,t[11]=u);let d=s(l,u),[f]=(0,Q.useState)(uT),p=(0,Q.useRef)(null),m,h;t[12]===f?(m=t[13],h=t[14]):(m=()=>{let e=p.current;if(e)return e.appendChild(f),()=>{f.parentNode===e&&e.removeChild(f)}},h=[f],t[12]=f,t[13]=m,t[14]=h),(0,Q.useLayoutEffect)(m,h);let g;t[15]===r?g=t[16]:(g=(0,Z.jsx)(aT,{text:r}),t[15]=r,t[16]=g);let _;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Z.jsx)(`div`,{className:`tiptap-editor`,children:(0,Z.jsx)(`div`,{ref:p,style:{display:`contents`}})}),t[17]=_):_=t[17];let v;t[18]===g?v=t[19]:(v=(0,Z.jsxs)(`div`,{className:`editor-doc-scroll min-h-0 flex-1 overflow-auto`,children:[g,_]}),t[18]=g,t[19]=v);let y;t[20]===d?y=t[21]:(y=(0,Z.jsx)(Wn,{editor:d,className:`tiptap-editor-portal-content h-full`}),t[20]=d,t[21]=y);let b;t[22]!==f||t[23]!==y?(b=(0,iT.createPortal)(y,f),t[22]=f,t[23]=y,t[24]=b):b=t[24];let x;return t[25]!==n||t[26]!==v||t[27]!==b?(x=(0,Z.jsxs)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":n,"data-skill-markdown-viewer":``,"data-skill-markdown-viewer-state":`loaded`,children:[v,b]}),t[25]=n,t[26]=v,t[27]=b,t[28]=x):x=t[28],x}function uT(){let e=document.createElement(`div`);return e.style.display=`contents`,e}var dT=`data-skill-markdown`;function fT(e){let t=(0,$.c)(12),{scope:n,name:r,path:i,fileName:a}=e,o;t[0]!==r||t[1]!==i||t[2]!==n?(o={loadText:e=>Ef({scope:n,name:r,path:i},e)},t[0]=r,t[1]=i,t[2]=n,t[3]=o):o=t[3];let s=sf(o);if(s.status===`loading`){let e;return t[4]===a?e=t[5]:(e=(0,Z.jsx)(rf,{fileName:a,dataAttr:dT}),t[4]=a,t[5]=e),e}if(s.status===`error`){let e;return t[6]!==s.message||t[7]!==a?(e=(0,Z.jsx)(af,{fileName:a,dataAttr:dT,message:s.message}),t[6]=s.message,t[7]=a,t[8]=e):e=t[8],e}let c;return t[9]!==s.content||t[10]!==a?(c=(0,Z.jsx)(lT,{fileName:a,text:s.content}),t[9]=s.content,t[10]=a,t[11]=c):c=t[11],c}var pT=new Set([`md`,`mdx`]);function mT(e){let t=(0,$.c)(19),{scope:n,name:r,path:i}=e,a;t[0]===i?a=t[1]:(a=i.split(`/`).pop()??i,t[0]=i,t[1]=a);let o=a,s=o.lastIndexOf(`.`),c,l;if(t[2]!==s||t[3]!==o?(c=s>=0?o.slice(s+1).toLowerCase():``,l=pT.has(c),t[2]=s,t[3]=o,t[4]=c,t[5]=l):(c=t[4],l=t[5]),l){let e;return t[6]!==o||t[7]!==r||t[8]!==i||t[9]!==n?(e=(0,Z.jsx)(fT,{scope:n,name:r,path:i,fileName:o}),t[6]=o,t[7]=r,t[8]=i,t[9]=n,t[10]=e):e=t[10],e}let u;t[11]!==r||t[12]!==i||t[13]!==n?(u=e=>Ef({scope:n,name:r,path:i},e),t[11]=r,t[12]=i,t[13]=n,t[14]=u):u=t[14];let d;return t[15]!==c||t[16]!==o||t[17]!==u?(d=(0,Z.jsx)(cf,{fileName:o,extension:c,loadText:u}),t[15]=c,t[16]=o,t[17]=u,t[18]=d):d=t[18],d}function hT(e){let t=null,n=()=>(t===null&&(t=e(),t.catch(()=>{})),t),r=(0,Q.lazy)(n);return r.preload=n,r}var gT=hT(()=>n(()=>import(`./SettingsDialogBody-DXovj0IS.js`).then(e=>({default:e.SettingsDialogBody})),__vite__mapDeps([110,1,111,17,12,6,2,3,7,8,9,84,68,22,11,85,86,87,10,88,30,31,14,15,16,19,49,24,25,29,18,20,36,13,21,35,23,26,27,112,113,50,92,114,89,115,116,48,51,72,73,74,75,76,77,78,79,80,81,82,83,47,4,90,37,38,40,61,62,63,43,65,91,28,32,60,64,66,67,93,94,95,96,33,97,98,99,100,39,41,101,102,117,59,118,105,119,120,121,106,122,44,123,124,125,126,127,128,42,129,130,131,132,133,134,135,136,137,138]),import.meta.url));function _T(e){let t=(0,$.c)(9),{error:n}=e,{_:r}=gt(),i;t[0]!==r||t[1]!==n?(i=n instanceof Error&&/dynamically imported module|Failed to fetch/i.test(n.message)?r({id:`Y8ViJx`}):r({id:`3h5zMp`}),t[0]=r,t[1]=n,t[2]=i):i=t[2];let a=i,o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(`h3`,{id:`settings-body-error-title`,className:`font-heading text-base leading-none font-medium`,children:(0,Z.jsx)(J,{id:`hwFOFD`})}),t[3]=o):o=t[3];let s;t[4]===a?s=t[5]:(s=(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[o,(0,Z.jsx)(`p`,{className:`max-w-xs text-sm text-muted-foreground`,children:a})]}),t[4]=a,t[5]=s);let c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(X,{variant:`default`,onClick:vT,children:(0,Z.jsx)(J,{id:`HpK_8d`})}),t[6]=c):c=t[6];let l;return t[7]===s?l=t[8]:(l=(0,Z.jsxs)(`div`,{role:`alert`,"aria-labelledby":`settings-body-error-title`,"data-slot":`settings-body-error-boundary`,className:`flex h-full flex-col items-center justify-center gap-5 p-8 text-center`,children:[s,c]}),t[7]=s,t[8]=l),l}function vT(){return window.location.reload()}function yT(e){let t=(0,$.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(Yt,{fallbackRender:xT,onError:bT,children:n}),t[0]=n,t[1]=r),r}function bT(e,t){console.error(`[SettingsDialogErrorBoundary] rendered fallback for Settings body`,e,t.componentStack)}function xT(e){return(0,Z.jsx)(_T,{...e})}function ST(e=typeof window>`u`?void 0:window.location){return e?.protocol===`file:`}function CT(e){let{groups:t,translate:n}=e,r=[],i=new Set;for(let e of t)if(e.enabled)for(let t of e.items)i.add(t.id),r.push({id:`section:${t.id}`,kind:`section`,sectionId:t.id,label:t.label,keywords:[e.label]});for(let e of Rs)if(i.has(e.sectionId))for(let t of e.fields){let i=t.path.join(`.`);r.push({id:`field:${e.sectionId}:${i}`,kind:`field`,sectionId:e.sectionId,label:n(t.label),keywords:t.description?[n(t.description)]:[],targetField:i})}if(i.has(`plugin:markdownlint`))for(let e of ha)r.push({id:`rule:${e.id}`,kind:`rule`,sectionId:`plugin:markdownlint`,label:e.name,keywords:[e.id,e.alias,...e.aliases],ruleId:e.id});return r}function wT(e){return`https://github.com/inkeep/open-knowledge/releases/tag/v${encodeURIComponent(e)}`}function TT(e){let t=(0,$.c)(43),{open:n,initialSection:r,onOpenChange:i}=e,a=r===void 0?null:r,{_:o}=gt(),{collabUrl:s}=Ye(),{userBinding:c,userSynced:l,okignoreBinding:u,okignoreSynced:d,projectConfig:f,merged:p}=od(),{desktopPresent:m}=Ts(),[h,g]=(0,Q.useState)(a??`preferences`),[_,v]=(0,Q.useState)(``),[y,b]=(0,Q.useState)(null),[x,S]=(0,Q.useState)(null),C=(0,Q.useRef)(0),w=(0,Q.useRef)(null),T,E;t[0]!==a||t[1]!==n?(T=()=>{n&&(g(a??`preferences`),v(``))},E=[n,a],t[0]=a,t[1]=n,t[2]=T,t[3]=E):(T=t[2],E=t[3]),(0,Q.useEffect)(T,E);let D,O;t[4]===y?(D=t[5],O=t[6]):(D=()=>{if(!y)return;let e=w.current;if(!e)return;let t=null,n=null,r=null,i=null,a=()=>{let r=e.querySelector(`[data-field="${y.path}"]`);return r?(r.scrollIntoView({block:`center`}),r.classList.add(`animate-settings-nav-flash`),t=r,n=setTimeout(()=>r.classList.remove(`animate-settings-nav-flash`),750),!0):!1};return a()||(i=new MutationObserver(()=>{a()&&i?.disconnect()}),i.observe(e,{childList:!0,subtree:!0}),r=setTimeout(()=>i?.disconnect(),4e3)),()=>{i?.disconnect(),n&&clearTimeout(n),r&&clearTimeout(r),t?.classList.remove(`animate-settings-nav-flash`)}},O=[y],t[4]=y,t[5]=D,t[6]=O),(0,Q.useEffect)(D,O);let k=s!==null,A=typeof window<`u`&&window.okDesktop!=null,j=A&&window.okDesktop?.config.ptyAvailable===!0,M,N;if(t[7]!==o||t[8]!==m||t[9]!==k||t[10]!==p?.appearance?.colorThemeEnabled||t[11]!==f?.contentRules){let e;t[14]===f?.contentRules?e=t[15]:(e=e=>f?.contentRules?.[e.id]?.enabled===!0,t[14]=f?.contentRules,t[15]=e);let n=qd.filter(e).map(ET),r=p?.appearance?.colorThemeEnabled!==!1,i=ST();M=[{id:`user`,label:o({id:`7PzzBU`}),enabled:!0,items:[{id:`preferences`,label:o({id:`Q6hhn8`})},{id:`configure-agents`,label:o({id:`jRAGrQ`})},{id:`hotkeys`,label:o({id:`4KmEoC`})},{id:`account`,label:o({id:`AeXO77`})},{id:`user-plugins-manage`,label:o({id:`ohUJJM`})},...A?[{id:`ai-tools`,label:o({id:`_5qBNl`})}]:[]]},{id:`project`,label:o({id:`ZWyHmq`}),enabled:k,items:[{id:`sync`,label:o({id:`Nu4DdT`})},{id:`search`,label:o({id:`A1taO8`})},{id:`plugins-manage`,label:o({id:`ohUJJM`})},{id:`content-rules`,label:o({id:`OPOiKn`})},...i?[]:[{id:`link-previews`,label:o({id:`gh27t1`})}],...j?[{id:`terminal`,label:o({id:`ALhMYW`})}]:[],...A?[{id:`project-ai-tools`,label:o({id:`crqzW5`})}]:[],{id:`project-templates`,label:o({id:`iTylMl`})},{id:`skills`,label:o({id:`PCSkw2`})},{id:`okignore`,label:o({id:`3zyg_A`})},{id:`sharing`,label:o({id:`cs4mps`})}]},{id:`plugins`,label:o({id:`ohUJJM`}),enabled:!0,items:[...k?n:[],...r?[{id:`plugin:theme`,label:o({id:`fJ3EbT`})}]:[]]},{id:`integrations`,label:o({id:`nbfdhU`}),enabled:!0,items:[]}],N=CT({groups:M,translate:o}),t[7]=o,t[8]=m,t[9]=k,t[10]=p?.appearance?.colorThemeEnabled,t[11]=f?.contentRules,t[12]=M,t[13]=N}else M=t[12],N=t[13];let P=N,F;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(F=function(e){C.current+=1;let t=C.current;g(e.sectionId),e.kind===`field`&&e.targetField?b({path:e.targetField}):e.kind===`rule`&&e.ruleId&&S({query:e.ruleId,nonce:t}),v(``)},t[16]=F):F=t[16];let I=F,L;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Z.jsx)(mn,{className:`sr-only`,children:(0,Z.jsx)(J,{id:`Tz0i8g`})}),t[17]=L):L=t[17];let R;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,Z.jsx)(pn,{className:`sr-only`,children:(0,Z.jsx)(J,{id:`RDrXh4`})}),t[18]=R):R=t[18];let z;t[19]!==h||t[20]!==M||t[21]!==P||t[22]!==_?(z=(0,Z.jsx)(DT,{groups:M,activeId:h,onSelect:g,entries:P,searchQuery:_,onSearchChange:v,onNavigate:I}),t[19]=h,t[20]=M,t[21]=P,t[22]=_,t[23]=z):z=t[23];let B;t[24]===o?B=t[25]:(B=o({id:`OXb_Df`}),t[24]=o,t[25]=B);let V;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,Z.jsx)(FT,{}),t[26]=V):V=t[26];let H=l?c:null,U;t[27]!==h||t[28]!==u||t[29]!==d||t[30]!==x||t[31]!==H?(U=(0,Z.jsx)(yT,{children:(0,Z.jsx)(Q.Suspense,{fallback:V,children:(0,Z.jsx)(gT,{activeId:h,userBinding:H,okignoreBinding:u,okignoreSynced:d,markdownlintRuleQuery:x})})}),t[27]=h,t[28]=u,t[29]=d,t[30]=x,t[31]=H,t[32]=U):U=t[32];let W;t[33]!==B||t[34]!==U?(W=(0,Z.jsx)(`section`,{ref:w,"aria-label":B,className:`min-h-0 flex-1 overflow-y-auto overscroll-contain subtle-scrollbar p-6`,tabIndex:0,children:U}),t[33]=B,t[34]=U,t[35]=W):W=t[35];let G;t[36]!==z||t[37]!==W?(G=(0,Z.jsxs)(hn,{className:`flex h-[700px] max-h-[calc(100dvh-4rem)] w-[900px] max-w-[calc(100%-2rem)] flex-col gap-0 overflow-hidden p-0 sm:grid sm:grid-cols-[220px_1fr] sm:max-w-[min(900px,calc(100%-2rem))]`,"data-testid":`settings-dialog`,children:[L,R,z,W]}),t[36]=z,t[37]=W,t[38]=G):G=t[38];let K;return t[39]!==i||t[40]!==n||t[41]!==G?(K=(0,Z.jsx)(yn,{open:n,onOpenChange:i,children:G}),t[39]=i,t[40]=n,t[41]=G,t[42]=K):K=t[42],K}function ET(e){return{id:`plugin:${e.id}`,label:e.label}}function DT(e){let t=(0,$.c)(46),{groups:n,activeId:r,onSelect:i,entries:a,searchQuery:o,onSearchChange:c,onNavigate:l}=e,{_:u}=gt(),d,f,p,m,h,g,_,v,y,b;if(t[0]!==u||t[1]!==a||t[2]!==l||t[3]!==c||t[4]!==o){f=o.trim();let e=f===``?[]:a.filter(e=>z_(e.label,f,e.keywords)),n=e.filter(AT),r=e.filter(kT),i=e.filter(OT);t[15]===u?y=t[16]:(y=u({id:`y1t8bQ`}),t[15]=u,t[16]=y),b=`flex shrink-0 gap-x-3 overflow-x-auto overscroll-contain subtle-scrollbar scroll-fade-mask-x-max-sm border-b bg-muted/30 px-3 py-2 max-sm:pt-10 sm:h-full sm:min-h-0 sm:flex-col sm:gap-0 sm:overflow-x-visible sm:border-r sm:border-b-0 sm:py-4`,d=s,p=!1,m=`h-auto w-full shrink-0 bg-transparent sm:mb-3 [&_[data-slot=command-input-wrapper]]:h-9 [&_[data-slot=command-input-wrapper]]:rounded-lg [&_[data-slot=command-input-wrapper]]:border [&_[data-slot=command-input-wrapper]]:border-input`,h=`settings-search`;let x;t[17]===u?x=t[18]:(x=u({id:`1DahsC`}),t[17]=u,t[18]=x),t[19]!==c||t[20]!==o||t[21]!==x?(g=(0,Z.jsx)(I,{value:o,onValueChange:c,placeholder:x,className:`py-0`,"data-testid":`settings-search-input`}),t[19]=c,t[20]=o,t[21]=x,t[22]=g):g=t[22];let C=f===``?null:(0,Z.jsx)(J,{id:`TQJCR6`,values:{0:e.length}});t[23]===C?_=t[24]:(_=(0,Z.jsx)(`span`,{"aria-live":`polite`,className:`sr-only`,"data-testid":`settings-search-result-count`,children:C}),t[23]=C,t[24]=_),v=f===``?null:(0,Z.jsxs)(S,{"data-testid":`settings-search-results`,className:`mt-1.5`,children:[(0,Z.jsx)(A,{"data-testid":`settings-search-empty`,children:(0,Z.jsx)(J,{id:`ljFWEt`})}),n.length>0?(0,Z.jsx)(M,{heading:u({id:`R4OWFD`}),children:n.map(e=>(0,Z.jsx)(jT,{entry:e,query:f,onNavigate:l},e.id))}):null,r.length>0?(0,Z.jsx)(M,{heading:u({id:`Tz0i8g`}),children:r.map(e=>(0,Z.jsx)(jT,{entry:e,query:f,onNavigate:l},e.id))}):null,i.length>0?(0,Z.jsx)(M,{heading:u({id:`v2a04T`}),children:i.map(e=>(0,Z.jsx)(jT,{entry:e,query:f,onNavigate:l},e.id))}):null]}),t[0]=u,t[1]=a,t[2]=l,t[3]=c,t[4]=o,t[5]=d,t[6]=f,t[7]=p,t[8]=m,t[9]=h,t[10]=g,t[11]=_,t[12]=v,t[13]=y,t[14]=b}else d=t[5],f=t[6],p=t[7],m=t[8],h=t[9],g=t[10],_=t[11],v=t[12],y=t[13],b=t[14];let x;t[25]!==d||t[26]!==p||t[27]!==m||t[28]!==h||t[29]!==g||t[30]!==_||t[31]!==v?(x=(0,Z.jsxs)(d,{shouldFilter:p,className:m,"data-testid":h,children:[g,_,v]}),t[25]=d,t[26]=p,t[27]=m,t[28]=h,t[29]=g,t[30]=_,t[31]=v,t[32]=x):x=t[32];let C;t[33]!==r||t[34]!==n||t[35]!==i||t[36]!==f?(C=f===``?n.map(e=>(0,Z.jsx)(PT,{group:e,activeId:r,onSelect:i},e.id)):null,t[33]=r,t[34]=n,t[35]=i,t[36]=f,t[37]=C):C=t[37];let w;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Z.jsx)(NT,{}),t[38]=w):w=t[38];let T;t[39]===C?T=t[40]:(T=(0,Z.jsxs)(`div`,{className:`contents subtle-scrollbar sm:flex sm:min-h-0 sm:flex-1 sm:flex-col sm:overflow-y-auto sm:overscroll-contain`,children:[C,w]}),t[39]=C,t[40]=T);let E;return t[41]!==T||t[42]!==y||t[43]!==b||t[44]!==x?(E=(0,Z.jsxs)(`nav`,{"aria-label":y,className:b,children:[x,T]}),t[41]=T,t[42]=y,t[43]=b,t[44]=x,t[45]=E):E=t[45],E}function OT(e){return e.kind===`rule`}function kT(e){return e.kind===`field`}function AT(e){return e.kind===`section`}function jT(e){let t=(0,$.c)(13),{entry:n,query:r,onNavigate:i}=e,a=n.id,o;t[0]!==n||t[1]!==i?(o=()=>i(n),t[0]=n,t[1]=i,t[2]=o):o=t[2];let s=`settings-search-result-${n.id}`,c;t[3]!==n.label||t[4]!==r?(c=I_(n.label,r).map(MT),t[3]=n.label,t[4]=r,t[5]=c):c=t[5];let l;t[6]===c?l=t[7]:(l=(0,Z.jsx)(`span`,{className:`truncate`,children:c}),t[6]=c,t[7]=l);let u;return t[8]!==n.id||t[9]!==o||t[10]!==s||t[11]!==l?(u=(0,Z.jsx)(g,{value:a,onSelect:o,"data-testid":s,children:l}),t[8]=n.id,t[9]=o,t[10]=s,t[11]=l,t[12]=u):u=t[12],u}function MT(e){return e.match?(0,Z.jsx)(`span`,{className:`font-semibold text-foreground`,children:e.text},e.start):(0,Z.jsx)(`span`,{children:e.text},e.start)}function NT(){let e=(0,$.c)(4),t=typeof window<`u`?window.okDesktop??null:null,n=t?.appVersion;if(!t||!n)return null;let r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=wT(n),e[0]=r):r=e[0];let i=r,a;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsxs)(`p`,{className:`whitespace-nowrap font-mono text-xs text-muted-foreground/70`,"data-testid":`settings-sidebar-version`,children:[`v`,n]}),e[1]=a):a=e[1];let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>{t.shell.openExternal(i)},e[2]=o):o=e[2];let s;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsxs)(`div`,{className:`ml-auto shrink-0 px-2 sm:ml-0 sm:mt-auto sm:pt-3`,children:[a,(0,Z.jsxs)(`button`,{type:`button`,onClick:o,"data-testid":`settings-sidebar-release-notes`,className:Y(`mt-0.5 inline-flex items-center gap-1 whitespace-nowrap rounded text-xs text-muted-foreground transition-colors hover:text-foreground`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`),children:[(0,Z.jsx)(J,{id:`_PACVa`}),(0,Z.jsx)(bo,{className:`size-3`,"aria-hidden":`true`})]})]}),e[3]=s):s=e[3],s}function PT(e){let t=(0,$.c)(28),{group:n,activeId:r,onSelect:i}=e;if(n.items.length===0)return null;let a=`settings-group-${n.id}`,o=`${a}-caption`,s=n.enabled?void 0:o,c=n.enabled?`text-muted-foreground/80`:`text-muted-foreground/50`,l;t[0]===c?l=t[1]:(l=Y(`shrink-0 whitespace-nowrap px-2 text-xs font-semibold uppercase tracking-wide font-mono sm:mb-1`,c),t[0]=c,t[1]=l);let u;t[2]!==n.label||t[3]!==a||t[4]!==s||t[5]!==l?(u=(0,Z.jsx)(`h3`,{id:a,"aria-describedby":s,className:l,children:n.label}),t[2]=n.label,t[3]=a,t[4]=s,t[5]=l,t[6]=u):u=t[6];let d;t[7]!==o||t[8]!==n.enabled?(d=n.enabled?null:(0,Z.jsx)(`p`,{id:o,className:`px-2 text-xs italic text-muted-foreground/60 sm:mb-1`,children:(0,Z.jsx)(J,{id:`JWsZlx`})}),t[7]=o,t[8]=n.enabled,t[9]=d):d=t[9];let f;if(t[10]!==r||t[11]!==o||t[12]!==n.enabled||t[13]!==n.items||t[14]!==i){let e;t[16]!==r||t[17]!==o||t[18]!==n.enabled||t[19]!==i?(e=e=>(0,Z.jsx)(`li`,{children:(0,Z.jsx)(`button`,{type:`button`,"aria-current":r===e.id?`page`:void 0,"aria-disabled":n.enabled?void 0:!0,"aria-describedby":n.enabled?void 0:o,tabIndex:n.enabled?0:-1,disabled:!n.enabled,onClick:()=>n.enabled&&i(e.id),"data-testid":`settings-sidebar-item-${e.id}`,className:Y(`w-auto whitespace-nowrap rounded px-2 py-1.5 text-left text-sm transition-colors sm:w-full`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-50`,r===e.id&&n.enabled?`bg-accent text-accent-foreground`:`hover:bg-accent/50`),children:e.label})},e.id),t[16]=r,t[17]=o,t[18]=n.enabled,t[19]=i,t[20]=e):e=t[20],f=n.items.map(e),t[10]=r,t[11]=o,t[12]=n.enabled,t[13]=n.items,t[14]=i,t[15]=f}else f=t[15];let p;t[21]!==a||t[22]!==f?(p=(0,Z.jsx)(`ul`,{"aria-labelledby":a,className:`flex gap-1 sm:block sm:space-y-0.5`,children:f}),t[21]=a,t[22]=f,t[23]=p):p=t[23];let m;return t[24]!==u||t[25]!==d||t[26]!==p?(m=(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 sm:mb-4 sm:block`,children:[u,d,p]}),t[24]=u,t[25]=d,t[26]=p,t[27]=m):m=t[27],m}function FT(){let e=(0,$.c)(4),t,n,r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(J,{id:`GsBUCk`})}),n=(0,Z.jsx)(Jd,{className:`h-5 w-32`}),r=(0,Z.jsx)(Jd,{className:`h-4 w-64`}),e[0]=t,e[1]=n,e[2]=r):(t=e[0],n=e[1],r=e[2]);let i;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`space-y-3`,"data-testid":`settings-content-skeleton`,children:[t,n,r,(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(Jd,{className:`h-9 w-full`}),(0,Z.jsx)(Jd,{className:`h-9 w-full`})]})]}),e[3]=i):i=e[3],i}function IT(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Y(`flex h-full w-full aria-[orientation=vertical]:flex-col`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(aC,{"data-slot":`resizable-panel-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function LT(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(lC,{"data-slot":`resizable-panel`,...n}),t[2]=n,t[3]=r),r}function RT(e){let t=(0,$.c)(12),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({withHandle:i,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=Y(`relative flex w-px items-center justify-center bg-border ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90`,n),t[4]=n,t[5]=a);let o;t[6]===i?o=t[7]:(o=i&&(0,Z.jsx)(`div`,{className:`z-10 flex h-6 w-1 shrink-0 rounded-lg bg-border`}),t[6]=i,t[7]=o);let s;return t[8]!==r||t[9]!==a||t[10]!==o?(s=(0,Z.jsx)(pC,{"data-slot":`resizable-handle`,className:a,...r,children:o}),t[8]=r,t[9]=a,t[10]=o,t[11]=s):s=t[11],s}function zT(e){let t=(0,$.c)(119),{findInputRef:n,query:r,replacement:i,replaceOpen:a,caseSensitive:o,wholeWord:s,current:c,total:l,onQueryChange:u,onReplacementChange:d,onReplaceOpenChange:f,onCaseSensitiveChange:p,onWholeWordChange:m,onNext:h,onPrevious:g,onReplaceCurrent:_,onReplaceAll:v,onClose:y}=e,{_:b}=gt(),x=r.length>0,S=l>0,C;t[0]!==b||t[1]!==c||t[2]!==S||t[3]!==x||t[4]!==l?(C=x?S?`${c} / ${l}`:b({id:`Ev2r9A`}):``,t[0]=b,t[1]=c,t[2]=S,t[3]=x,t[4]=l,t[5]=C):C=t[5];let w=C,T;t[6]!==y||t[7]!==h||t[8]!==g?(T=function(e){e.key===`Enter`?(e.preventDefault(),e.shiftKey?g():h()):e.key===`Escape`&&(e.preventDefault(),y())},t[6]=y,t[7]=h,t[8]=g,t[9]=T):T=t[9];let E=T,D;t[10]!==y||t[11]!==_?(D=function(e){e.key===`Enter`?(e.preventDefault(),_()):e.key===`Escape`&&(e.preventDefault(),y())},t[10]=y,t[11]=_,t[12]=D):D=t[12];let O=D,k;t[13]===b?k=t[14]:(k=b({id:`MVxpbf`}),t[13]=b,t[14]=k);let A;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Z.jsx)(`label`,{className:`sr-only`,htmlFor:`ok-find-input`,children:(0,Z.jsx)(J,{id:`KujtjC`})}),t[15]=A):A=t[15];let j;t[16]===u?j=t[17]:(j=e=>u(e.target.value),t[16]=u,t[17]=j);let M;t[18]===b?M=t[19]:(M=b({id:`KujtjC`}),t[18]=b,t[19]=M);let N;t[20]!==n||t[21]!==E||t[22]!==r||t[23]!==j||t[24]!==M?(N=(0,Z.jsx)(Ec,{ref:n,id:`ok-find-input`,value:r,onChange:j,onKeyDown:E,placeholder:M,autoComplete:`off`,spellCheck:!1,className:`h-7 px-2 text-sm`}),t[20]=n,t[21]=E,t[22]=r,t[23]=j,t[24]=M,t[25]=N):N=t[25];let P;t[26]===b?P=t[27]:(P=b({id:`-8PP0T`}),t[26]=b,t[27]=P);let F;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Z.jsx)(Ro,{"aria-hidden":`true`}),t[28]=F):F=t[28];let I;t[29]!==o||t[30]!==p||t[31]!==P?(I=(0,Z.jsx)(on,{asChild:!0,children:(0,Z.jsx)(Ur,{type:`button`,variant:`segmented`,size:`sm`,"aria-label":P,pressed:o,onPressedChange:p,className:`size-6 min-w-6 px-0`,children:F})}),t[29]=o,t[30]=p,t[31]=P,t[32]=I):I=t[32];let L;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Z.jsx)(sn,{side:`bottom`,children:(0,Z.jsx)(J,{id:`-8PP0T`})}),t[33]=L):L=t[33];let R;t[34]===I?R=t[35]:(R=(0,Z.jsxs)(ln,{children:[I,L]}),t[34]=I,t[35]=R);let z;t[36]===b?z=t[37]:(z=b({id:`_7UQ7y`}),t[36]=b,t[37]=z);let B;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,Z.jsx)(Fg,{"aria-hidden":`true`}),t[38]=B):B=t[38];let V;t[39]!==m||t[40]!==z||t[41]!==s?(V=(0,Z.jsx)(on,{asChild:!0,children:(0,Z.jsx)(Ur,{type:`button`,variant:`segmented`,size:`sm`,"aria-label":z,pressed:s,onPressedChange:m,className:`size-6 min-w-6 px-0`,children:B})}),t[39]=m,t[40]=z,t[41]=s,t[42]=V):V=t[42];let H;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,Z.jsx)(sn,{side:`bottom`,children:(0,Z.jsx)(J,{id:`_7UQ7y`})}),t[43]=H):H=t[43];let U;t[44]===V?U=t[45]:(U=(0,Z.jsxs)(ln,{children:[V,H]}),t[44]=V,t[45]=U);let W;t[46]!==R||t[47]!==U?(W=(0,Z.jsxs)(Mc,{align:`inline-end`,className:`gap-0.5`,children:[R,U]}),t[46]=R,t[47]=U,t[48]=W):W=t[48];let G;t[49]!==W||t[50]!==N?(G=(0,Z.jsxs)(Nc,{className:`h-7 w-56 rounded-[min(var(--radius-md),12px)]`,children:[N,W]}),t[49]=W,t[50]=N,t[51]=G):G=t[51];let K;t[52]===w?K=t[53]:(K=(0,Z.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`min-w-14 px-1 text-right text-muted-foreground text-xs tabular-nums shrink-0`,children:w}),t[52]=w,t[53]=K);let ee;t[54]===b?ee=t[55]:(ee=b({id:`oqB2ez`}),t[54]=b,t[55]=ee);let te=!S,ne;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,Z.jsx)(Lr,{"data-icon":`inline-start`,"aria-hidden":`true`}),t[56]=ne):ne=t[56];let q;t[57]!==g||t[58]!==ee||t[59]!==te?(q=(0,Z.jsx)(on,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":ee,disabled:te,onClick:g,children:ne})}),t[57]=g,t[58]=ee,t[59]=te,t[60]=q):q=t[60];let re;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,Z.jsx)(sn,{side:`bottom`,children:(0,Z.jsx)(J,{id:`oqB2ez`})}),t[61]=re):re=t[61];let ie;t[62]===q?ie=t[63]:(ie=(0,Z.jsxs)(ln,{children:[q,re]}),t[62]=q,t[63]=ie);let ae;t[64]===b?ae=t[65]:(ae=b({id:`SiUUCS`}),t[64]=b,t[65]=ae);let oe=!S,se;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,Z.jsx)(Vo,{"data-icon":`inline-start`,"aria-hidden":`true`}),t[66]=se):se=t[66];let ce;t[67]!==h||t[68]!==ae||t[69]!==oe?(ce=(0,Z.jsx)(on,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":ae,disabled:oe,onClick:h,children:se})}),t[67]=h,t[68]=ae,t[69]=oe,t[70]=ce):ce=t[70];let le;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,Z.jsx)(sn,{side:`bottom`,children:(0,Z.jsx)(J,{id:`SiUUCS`})}),t[71]=le):le=t[71];let ue;t[72]===ce?ue=t[73]:(ue=(0,Z.jsxs)(ln,{children:[ce,le]}),t[72]=ce,t[73]=ue);let de=a?`secondary`:`ghost`,fe;t[74]!==b||t[75]!==a?(fe=b(a?{id:`UkQGhd`}:{id:`1RluQD`}),t[74]=b,t[75]=a,t[76]=fe):fe=t[76];let pe=a?`ok-replace-input`:void 0,me;t[77]!==f||t[78]!==a?(me=()=>f(!a),t[77]=f,t[78]=a,t[79]=me):me=t[79];let he;t[80]===Symbol.for(`react.memo_cache_sentinel`)?(he=(0,Z.jsx)(fg,{"data-icon":`inline-start`,"aria-hidden":`true`}),t[80]=he):he=t[80];let ge;t[81]!==a||t[82]!==de||t[83]!==fe||t[84]!==pe||t[85]!==me?(ge=(0,Z.jsx)(on,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,variant:de,size:`icon-sm`,"aria-label":fe,"aria-expanded":a,"aria-controls":pe,onClick:me,children:he})}),t[81]=a,t[82]=de,t[83]=fe,t[84]=pe,t[85]=me,t[86]=ge):ge=t[86];let _e;t[87]===a?_e=t[88]:(_e=(0,Z.jsx)(sn,{side:`bottom`,children:a?(0,Z.jsx)(J,{id:`UkQGhd`}):(0,Z.jsx)(J,{id:`1RluQD`})}),t[87]=a,t[88]=_e);let ve;t[89]!==ge||t[90]!==_e?(ve=(0,Z.jsxs)(ln,{children:[ge,_e]}),t[89]=ge,t[90]=_e,t[91]=ve):ve=t[91];let ye;t[92]!==b||t[93]!==O||t[94]!==S||t[95]!==v||t[96]!==_||t[97]!==d||t[98]!==a||t[99]!==i?(ye=a?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`label`,{className:`sr-only`,htmlFor:`ok-replace-input`,children:(0,Z.jsx)(J,{id:`fqSfXY`})}),(0,Z.jsx)(Sl,{id:`ok-replace-input`,value:i,onChange:e=>d(e.target.value),onKeyDown:O,placeholder:b({id:`fqSfXY`}),autoComplete:`off`,spellCheck:!1,className:`h-7 w-48 rounded-[min(var(--radius-md),12px)] px-2 text-sm shadow-none focus-visible:ring-2`}),(0,Z.jsxs)(ln,{children:[(0,Z.jsx)(on,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":b({id:`bS_boY`}),disabled:!S,onClick:_,children:(0,Z.jsx)(fg,{"data-icon":`inline-start`,"aria-hidden":`true`})})}),(0,Z.jsx)(sn,{side:`bottom`,children:(0,Z.jsx)(J,{id:`bS_boY`})})]}),(0,Z.jsxs)(ln,{children:[(0,Z.jsx)(on,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":b({id:`dr1vFs`}),disabled:!S,onClick:v,children:(0,Z.jsx)(dg,{"data-icon":`inline-start`,"aria-hidden":`true`})})}),(0,Z.jsx)(sn,{side:`bottom`,children:(0,Z.jsx)(J,{id:`dr1vFs`})})]})]}):null,t[92]=b,t[93]=O,t[94]=S,t[95]=v,t[96]=_,t[97]=d,t[98]=a,t[99]=i,t[100]=ye):ye=t[100];let be;t[101]===b?be=t[102]:(be=b({id:`wJo9oS`}),t[101]=b,t[102]=be);let xe;t[103]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,Z.jsx)(hl,{"data-icon":`inline-start`,"aria-hidden":`true`}),t[103]=xe):xe=t[103];let Se;t[104]!==y||t[105]!==be?(Se=(0,Z.jsx)(on,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":be,onClick:y,children:xe})}),t[104]=y,t[105]=be,t[106]=Se):Se=t[106];let Ce;t[107]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=(0,Z.jsx)(sn,{side:`bottom`,children:(0,Z.jsx)(J,{id:`yz7wBu`})}),t[107]=Ce):Ce=t[107];let we;t[108]===Se?we=t[109]:(we=(0,Z.jsxs)(ln,{children:[Se,Ce]}),t[108]=Se,t[109]=we);let Te;return t[110]!==G||t[111]!==K||t[112]!==ie||t[113]!==ue||t[114]!==k||t[115]!==ve||t[116]!==ye||t[117]!==we?(Te=(0,Z.jsxs)(`search`,{"data-testid":`find-replace-bar`,"aria-label":k,className:`pointer-events-auto flex max-w-[min(calc(100vw-1rem),720px)] touch-manipulation items-center gap-1 rounded-[calc(var(--radius)+2px)] border border-input bg-popover/95 p-1 text-popover-foreground shadow-md shadow-black/10 backdrop-blur`,children:[A,G,K,ie,ue,ve,ye,we]}),t[110]=G,t[111]=K,t[112]=ie,t[113]=ue,t[114]=k,t[115]=ve,t[116]=ye,t[117]=we,t[118]=Te):Te=t[118],Te}var BT={current:0,total:0},VT=120,HT=100;function UT(e){let t=(0,$.c)(2),n;return t[0]===e?n=t[1]:(n=()=>e?ut(e):null,t[0]=e,t[1]=n),(0,Q.useSyncExternalStore)(d,n,WT)}function WT(){return null}function GT(e){if(!e||e.isDestroyed)return null;let{from:t,to:n,empty:r}=e.state.selection;if(r)return null;let i=e.state.doc.textBetween(t,n,`
7
+ `,`
8
+ `).trim();return i.length===0||i.length>VT||i.includes(`
9
+ `)?null:i}function KT(e){let t=_(e.state);return{current:t.matches.length===0?0:t.activeIndex+1,total:t.matches.length}}function qT(e,t){return e.current===t.current&&e.total===t.total}function JT(e,t,n){e&&!e.isDestroyed&&(e.commands.clearFindMatches(),e.commands.focus()),t(e=>({...e,open:!1,activeIndex:0})),n(BT)}function YT(e){!e||e.isDestroyed||typeof window>`u`||window.requestAnimationFrame(()=>{if(e.isDestroyed)return;let t=An(e);if(!t)return;let n=t.dom.querySelector(`.ok-find-match-active`);n instanceof HTMLElement&&n.scrollIntoView({block:`center`,inline:`nearest`,behavior:`auto`})})}function XT(e){let t=(0,$.c)(81),{activeDocName:n,isSourceMode:r}=e,i=UT(n),a=(0,Q.useRef)(null),o=(0,Q.useRef)(null),s=(0,Q.useRef)(n),c=(0,Q.useRef)(0),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l={open:!1,replaceOpen:!1,query:``,replacement:``,caseSensitive:!1,wholeWord:!1,activeIndex:0},t[0]=l):l=t[0];let[u,d]=(0,Q.useState)(l),[f,p]=(0,Q.useState)(BT),m,h;t[1]===n?(m=t[2],h=t[3]):(m=()=>{s.current!==n&&(s.current=n,d(QT))},h=[n],t[1]=n,t[2]=m,t[3]=h),(0,Q.useEffect)(m,h);let g,v;t[4]===u.activeIndex?(g=t[5],v=t[6]):(g=()=>{c.current=u.activeIndex},v=[u.activeIndex],t[4]=u.activeIndex,t[5]=g,t[6]=v),(0,Q.useEffect)(g,v);let y,b;t[7]===i?(y=t[8],b=t[9]):(y=()=>{let e=o.current;e&&e!==i&&!e.isDestroyed&&e.commands.clearFindMatches(),o.current=i},b=[i],t[7]=i,t[8]=y,t[9]=b),(0,Q.useEffect)(y,b);let x,S;t[10]===u.open?(x=t[11],S=t[12]):(x=()=>{if(!u.open||!a.current)return;let e=requestAnimationFrame(()=>{a.current?.focus(),a.current?.select()});return()=>cancelAnimationFrame(e)},S=[u.open],t[10]=u.open,t[11]=x,t[12]=S),(0,Q.useEffect)(x,S);let C,w;t[13]!==u.open||t[14]!==r?(C=()=>{!u.open||!r||d(ZT)},w=[u.open,r],t[13]=u.open,t[14]=r,t[15]=C,t[16]=w):(C=t[15],w=t[16]),(0,Q.useEffect)(C,w);let T,E;t[17]!==i||t[18]!==u.caseSensitive||t[19]!==u.open||t[20]!==u.query||t[21]!==u.wholeWord||t[22]!==r?(T=()=>{if(!i||i.isDestroyed){p(BT);return}if(!u.open||r){i.commands.clearFindMatches(),p(BT);return}let e=window.setTimeout(()=>{if(i.isDestroyed)return;i.commands.setFindQuery(u.query,{options:{caseSensitive:u.caseSensitive,wholeWord:u.wholeWord},activeIndex:c.current});let e=KT(i);p(t=>qT(t,e)?t:e)},HT);return()=>window.clearTimeout(e)},E=[i,u.open,u.query,u.caseSensitive,u.wholeWord,r],t[17]=i,t[18]=u.caseSensitive,t[19]=u.open,t[20]=u.query,t[21]=u.wholeWord,t[22]=r,t[23]=T,t[24]=E):(T=t[23],E=t[24]),(0,Q.useEffect)(T,E);let D,O;t[25]!==i||t[26]!==u.open||t[27]!==r?(D=()=>{if(!i||i.isDestroyed||!u.open||r)return;let e=()=>{let e=_(i.state),t=KT(i);p(e=>qT(e,t)?e:t),d(t=>t.activeIndex===e.activeIndex?t:{...t,activeIndex:e.activeIndex})};return i.on(`transaction`,e),()=>{i.off(`transaction`,e)}},O=[i,u.open,r],t[25]=i,t[26]=u.open,t[27]=r,t[28]=D,t[29]=O):(D=t[28],O=t[29]),(0,Q.useEffect)(D,O);let k,A;t[30]!==n||t[31]!==i||t[32]!==u.open||t[33]!==r?(k=()=>{let e=function(e){let t=GT(i);d(n=>({...n,open:!0,replaceOpen:e,query:t??n.query,activeIndex:0}))},t=function(t){if(!(!n||r||t.defaultPrevented)){if(El(t,`find`)){t.preventDefault(),u.open?JT(i,d,p):e(!1);return}if(El(t,`replace`)){t.preventDefault(),e(!0);return}if(u.open){let e=El(t,`find-next`),n=El(t,`find-previous`);if(e||n){t.preventDefault(),(n?i?.commands.selectPreviousFindMatch():i?.commands.selectNextFindMatch())&&YT(i);return}}t.key===`Escape`&&u.open&&(t.preventDefault(),JT(i,d,p))}};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},A=[n,i,u.open,r],t[30]=n,t[31]=i,t[32]=u.open,t[33]=r,t[34]=k,t[35]=A):(k=t[34],A=t[35]),(0,Q.useEffect)(k,A);let j;t[36]!==i||t[37]!==u.caseSensitive||t[38]!==u.query||t[39]!==u.wholeWord?(j=function(){return!i||i.isDestroyed?!1:(i.commands.setFindQuery(u.query,{options:{caseSensitive:u.caseSensitive,wholeWord:u.wholeWord},activeIndex:c.current}),!0)},t[36]=i,t[37]=u.caseSensitive,t[38]=u.query,t[39]=u.wholeWord,t[40]=j):j=t[40];let M=j,N;t[41]===i?N=t[42]:(N=function(){if(!i||i.isDestroyed)return;let e=_(i.state),t=KT(i);p(e=>qT(e,t)?e:t),d(t=>t.activeIndex===e.activeIndex?t:{...t,activeIndex:e.activeIndex})},t[41]=i,t[42]=N);let P=N,F;t[43]===i?F=t[44]:(F=function(){JT(i,d,p)},t[43]=i,t[44]=F);let I=F,L;t[45]!==M||t[46]!==i||t[47]!==P?(L=function(){!i||i.isDestroyed||(M(),i.commands.selectNextFindMatch()&&YT(i),P())},t[45]=M,t[46]=i,t[47]=P,t[48]=L):L=t[48];let R=L,z;t[49]!==M||t[50]!==i||t[51]!==P?(z=function(){!i||i.isDestroyed||(M(),i.commands.selectPreviousFindMatch()&&YT(i),P())},t[49]=M,t[50]=i,t[51]=P,t[52]=z):z=t[52];let B=z,V;t[53]!==M||t[54]!==i||t[55]!==u.replacement||t[56]!==P?(V=function(){!i||i.isDestroyed||(M(),i.commands.replaceCurrentFindMatch(u.replacement)&&YT(i),P())},t[53]=M,t[54]=i,t[55]=u.replacement,t[56]=P,t[57]=V):V=t[57];let H=V,U;t[58]!==M||t[59]!==i||t[60]!==u.replacement||t[61]!==P?(U=function(){!i||i.isDestroyed||(M(),i.commands.replaceAllFindMatches(u.replacement)&&YT(i),P())},t[58]=M,t[59]=i,t[60]=u.replacement,t[61]=P,t[62]=U):U=t[62];let W=U;if(!u.open||!n||r)return null;let G,K,ee,te,ne;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(G=e=>d(t=>({...t,query:e,activeIndex:0})),K=e=>d(t=>({...t,replacement:e})),ee=e=>d(t=>({...t,replaceOpen:e})),te=e=>d(t=>({...t,caseSensitive:e})),ne=e=>d(t=>({...t,wholeWord:e})),t[63]=G,t[64]=K,t[65]=ee,t[66]=te,t[67]=ne):(G=t[63],K=t[64],ee=t[65],te=t[66],ne=t[67]);let q;return t[68]!==I||t[69]!==u.caseSensitive||t[70]!==u.query||t[71]!==u.replaceOpen||t[72]!==u.replacement||t[73]!==u.wholeWord||t[74]!==f.current||t[75]!==f.total||t[76]!==W||t[77]!==H||t[78]!==R||t[79]!==B?(q=(0,Z.jsx)(`div`,{className:`editor-content-aligned pointer-events-none absolute inset-x-0 top-2 z-30 px-2`,children:(0,Z.jsx)(`div`,{className:`flex justify-end`,children:(0,Z.jsx)(zT,{findInputRef:a,query:u.query,replacement:u.replacement,replaceOpen:u.replaceOpen,caseSensitive:u.caseSensitive,wholeWord:u.wholeWord,current:f.current,total:f.total,onQueryChange:G,onReplacementChange:K,onReplaceOpenChange:ee,onCaseSensitiveChange:te,onWholeWordChange:ne,onNext:R,onPrevious:B,onReplaceCurrent:H,onReplaceAll:W,onClose:I})})}),t[68]=I,t[69]=u.caseSensitive,t[70]=u.query,t[71]=u.replaceOpen,t[72]=u.replacement,t[73]=u.wholeWord,t[74]=f.current,t[75]=f.total,t[76]=W,t[77]=H,t[78]=R,t[79]=B,t[80]=q):q=t[80],q}function ZT(e){return{...e,open:!1,activeIndex:0}}function QT(e){return{...e,activeIndex:0}}var $T=300;function eE(e,t){let n=(0,$.c)(4),[r,i]=(0,Q.useState)(jd),a,o;return n[0]!==t||n[1]!==e?(a=()=>{if(!e||!t){i(jd);return}let n=e.document.getText(`source`),r=!1,a=null,o=function(){r||i(Nd(n.toString()))};o();let s=function(){a&&clearTimeout(a),a=setTimeout(o,$T)};return n.observe(s),()=>{r=!0,n.unobserve(s),a&&clearTimeout(a)}},o=[e,t],n[0]=t,n[1]=e,n[2]=a,n[3]=o):(a=n[2],o=n[3]),(0,Q.useEffect)(a,o),r}function tE(e){return e&&e.document.getMap(`lifecycle`).get(`status`)===`conflict`?`conflict`:null}function nE(e){let t=(0,$.c)(8),{poolEntries:n}=Ye(),r;t[0]!==e||t[1]!==n?(r=e?n.find(t=>t.docName===e)??null:null,t[0]=e,t[1]=n,t[2]=r):r=t[2];let i=r?.provider??null,a;t[3]===i?a=t[4]:(a=()=>tE(i),t[3]=i,t[4]=a);let[o,s]=(0,Q.useState)(a),c,l;return t[5]===i?(c=t[6],l=t[7]):(c=()=>{if(!i){s(null);return}let e=i.document.getMap(`lifecycle`);s(tE(i));let t=()=>s(tE(i));return e.observe(t),()=>{e.unobserve(t)}},l=[i],t[5]=i,t[6]=c,t[7]=l),(0,Q.useEffect)(c,l),o}function rE(e,t){let n=(0,$.c)(3),r;return n[0]!==e||n[1]!==t?(r=()=>Pd(e,t),n[0]=e,n[1]=t,n[2]=r):r=n[2],(0,Q.useSyncExternalStore)(bd,r)}var iE=`ok-doc-panel-width-v1`;function aE(e){return Number.isFinite(e)?e<300?300:e>600?600:Math.round(e):320}function oE(e){try{let t=(e??localStorage).getItem(iE);if(t==null)return 320;let n=Number.parseInt(t,10);return Number.isFinite(n)?aE(n):320}catch{return 320}}function sE(e,t){try{(t??localStorage).setItem(iE,String(aE(e)))}catch{}}function cE(){try{return typeof localStorage>`u`?320:oE()}catch{return 320}}var lE=1024,uE=1280,dE={left:lE,right:uE};function fE(e,t,n){return e==null?t>=dE[n]?`above`:`below`:`embedded`}function pE(e){return e===`above`?`open`:`collapsed`}var mE=`ok-sidebar-pins-v2`;function hE(e){return e===`open`||e===`collapsed`}function gE(e){return e===`above`||e===`below`||e===`embedded`}function _E(e){if(typeof e!=`object`||!e)return!1;let t=e;for(let e of Object.keys(t))if(!gE(e)||!hE(t[e]))return!1;return!0}function vE(e){let t=JSON.parse(e);if(typeof t!=`object`||!t)return{};let n=t,r={};return _E(n.left)&&(r.left=n.left),_E(n.right)&&(r.right=n.right),r}function yE(e){try{let t=(e??localStorage).getItem(mE);return t==null?{}:vE(t)}catch{return{}}}function bE(e,t){try{t.setItem(mE,JSON.stringify(e))}catch{}}function xE(e,t,n){return n[e]?.[t]??pE(t)}function SE(e,t,n,r){let i=r??localStorage,a=yE(i);return a[e]={...a[e],[t]:n},bE(a,i),a}var CE=`ok-terminal-width-v1`;function wE(e){return Number.isFinite(e)?e<320?320:Math.round(e):480}function TE(e){try{let t=(e??localStorage).getItem(CE);if(t==null)return 480;let n=Number.parseInt(t,10);return Number.isFinite(n)?wE(n):480}catch{return 480}}function EE(e,t){try{(t??localStorage).setItem(CE,String(wE(e)))}catch{}}function DE(){try{return typeof localStorage>`u`?480:TE()}catch{return 480}}function OE(e){let t=(0,$.c)(3),[n,r]=(0,Q.useState)(`connecting`),i,a;return t[0]===e?(i=t[1],a=t[2]):(i=()=>{if(!e){r(`connecting`);return}let t=e.configuration.websocketProvider.status;e.isSynced?r(`synced`):r(t===`connected`?`connected`:t===`disconnected`?`disconnected`:`connecting`);let n=e=>{let{status:t}=e;r(t===`connected`?kE:t===`disconnected`?`disconnected`:`connecting`)},i=e=>{let{state:t}=e;r(t?`synced`:`connected`)},a=()=>r(`disconnected`);return e.on(`status`,n),e.on(`synced`,i),e.on(`disconnect`,a),()=>{e.off(`status`,n),e.off(`synced`,i),e.off(`disconnect`,a)}},a=[e],t[0]=e,t[1]=i,t[2]=a),(0,Q.useEffect)(i,a),n}function kE(e){return e===`synced`?`synced`:`connected`}function AE(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function jE(e){let t=(0,$.c)(21),{path:n,onRemove:r}=e,{_:i}=gt(),a,o;t[0]!==i||t[1]!==n?(a=AE(n),o=i({id:`hnq8fP`,values:{label:a}}),t[0]=i,t[1]=n,t[2]=a,t[3]=o):(a=t[2],o=t[3]);let s=o,c=`composer-context-chip-file-${n}`,l;t[4]===r?l=t[5]:(l=e=>{(e.key===`Backspace`||e.key===`Delete`)&&(e.preventDefault(),r())},t[4]=r,t[5]=l);let u;t[6]===n?u=t[7]:(u=(0,Z.jsx)(`span`,{className:`absolute top-1/2 left-1/2 inline-flex size-3 -translate-x-1/2 -translate-y-1/2 opacity-100 transition-opacity duration-150 ease-out group-hover/chip:opacity-0 group-focus-within/chip:opacity-0 motion-reduce:transition-none`,children:(0,Z.jsx)(mt,{path:n,className:`size-3`,showExtensionBadge:!1})}),t[6]=n,t[7]=u);let d;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(hl,{className:`absolute top-1/2 left-1/2 size-3 -translate-x-1/2 -translate-y-1/2 opacity-0 transition-opacity duration-150 ease-out group-hover/chip:opacity-100 group-focus-within/chip:opacity-100 motion-reduce:transition-none`,"aria-hidden":!0}),t[8]=d):d=t[8];let f;t[9]!==r||t[10]!==s||t[11]!==l||t[12]!==u?(f=(0,Z.jsxs)(X,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":s,onClick:r,onKeyDown:l,className:`group/remove relative size-3.5 shrink-0 rounded-sm text-muted-foreground/80 hover:text-foreground`,children:[u,d]}),t[9]=r,t[10]=s,t[11]=l,t[12]=u,t[13]=f):f=t[13];let p;t[14]===a?p=t[15]:(p=(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:a}),t[14]=a,t[15]=p);let m;return t[16]!==n||t[17]!==c||t[18]!==f||t[19]!==p?(m=(0,Z.jsxs)(`span`,{"data-testid":c,title:n,className:`group/chip inline-flex max-w-[14rem] items-center gap-1 rounded-md border bg-muted/40 py-0.5 pr-1.5 pl-1 text-muted-foreground text-xs`,children:[f,p]}),t[16]=n,t[17]=c,t[18]=f,t[19]=p,t[20]=m):m=t[20],m}function ME(e){let t=(0,$.c)(11),{files:n,onRemoveFile:r,className:i,children:a}=e;if(n.length===0&&a==null)return null;let o;t[0]===i?o=t[1]:(o=Y(`flex flex-wrap items-center gap-1`,i),t[0]=i,t[1]=o);let s;if(t[2]!==n||t[3]!==r){let e;t[5]===r?e=t[6]:(e=e=>(0,Z.jsx)(jE,{path:e,onRemove:()=>r(e)},e),t[5]=r,t[6]=e),s=n.map(e),t[2]=n,t[3]=r,t[4]=s}else s=t[4];let c;return t[7]!==a||t[8]!==o||t[9]!==s?(c=(0,Z.jsxs)(`div`,{className:o,"data-testid":`composer-context-chips`,children:[s,a]}),t[7]=a,t[8]=o,t[9]=s,t[10]=c):c=t[10],c}function NE(e){let t=(0,$.c)(52),{primary:n,onPrimary:r,primaryDisabled:i,installedTargets:a,selectedTargetId:o,onSelectTarget:s,threadAgents:c,onOpenSettings:l,terminal:u,terminals:d,menuEmptyState:f,onMenuOpenChange:p,menuAlign:m,triggerAriaLabel:h,testIds:g}=e,_=i===void 0?!1:i,v=m===void 0?`end`:m,{_:y}=gt(),b=a.length>0,x=d&&d.length>0?d:null,S=x!=null||u!=null,C=b||S,w=c!==void 0&&c.length>0,T;t[0]===g?T=t[1]:(T=e=>typeof g.terminal==`function`?g.terminal(e):g.terminal,t[0]=g,t[1]=T);let E=T,D;t[2]!==r||t[3]!==n||t[4]!==_||t[5]!==g.primary?(D=(0,Z.jsx)(X,{type:`button`,variant:`outline`,className:`gap-1.5`,disabled:_,onClick:r,"data-testid":g.primary,children:n}),t[2]=r,t[3]=n,t[4]=_,t[5]=g.primary,t[6]=D):D=t[6];let O;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`size-3.5 text-muted-foreground`}),t[7]=O):O=t[7];let k;t[8]!==g.trigger||t[9]!==h?(k=(0,Z.jsx)(Or,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,variant:`outline`,size:`icon`,"aria-label":h,"data-testid":g.trigger,children:O})}),t[8]=g.trigger,t[9]=h,t[10]=k):k=t[10];let A;t[11]!==y||t[12]!==C||t[13]!==w||t[14]!==g||t[15]!==c?(A=w?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Dr,{"aria-label":y({id:`vPKX2i`}),children:[(0,Z.jsxs)(Ar,{className:`flex items-center gap-1.5`,children:[(0,Z.jsx)(J,{id:`RXEbZy`}),(0,Z.jsx)(ti,{})]}),c?.map(e=>(0,Z.jsxs)(wr,{onSelect:e.onSelect,"data-testid":g.threadAgent?.(e.key),children:[(0,Z.jsx)(So,{agentId:e.id,iconUrl:e.iconUrl,className:`size-4`}),(0,Z.jsx)(`span`,{className:`flex-1 truncate`,children:e.name}),e.selected?(0,Z.jsx)(zo,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}):null]},e.key))]}),C?(0,Z.jsx)(Fr,{}):null]}):null,t[11]=y,t[12]=C,t[13]=w,t[14]=g,t[15]=c,t[16]=A):A=t[16];let j;t[17]!==y||t[18]!==x||t[19]!==C||t[20]!==a||t[21]!==s||t[22]!==o||t[23]!==b||t[24]!==S||t[25]!==u||t[26]!==E||t[27]!==g?(j=C?(0,Z.jsxs)(Z.Fragment,{children:[S?(0,Z.jsxs)(Dr,{"aria-label":y({id:`ALhMYW`}),children:[(0,Z.jsx)(Ar,{children:(0,Z.jsx)(J,{id:`ALhMYW`})}),x?x.map(e=>(0,Z.jsxs)(wr,{onSelect:e.onSelect,"data-testid":E(e.cli),"aria-label":e.ariaLabel,children:[(0,Z.jsx)($r,{id:qr(e.cli),className:`size-4`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:e.label}),e.selected?(0,Z.jsx)(zo,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}):null]},e.cli)):u?(0,Z.jsxs)(wr,{onSelect:u.onSelect,"data-testid":E(`claude`),"aria-label":y({id:`AcK_r0`}),children:[(0,Z.jsx)($r,{id:qr(`claude`),className:`size-4`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(J,{id:`fcgvCA`})}),u.selected?(0,Z.jsx)(zo,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}):null]}):null]}):null,b?(0,Z.jsxs)(Z.Fragment,{children:[S?(0,Z.jsx)(Fr,{}):null,(0,Z.jsxs)(Dr,{"aria-label":y({id:`BBqGS9`}),children:[(0,Z.jsx)(Ar,{children:(0,Z.jsx)(J,{id:`BBqGS9`})}),a.map(e=>(0,Z.jsxs)(wr,{onSelect:()=>s(e),"data-testid":g.option(e.id),children:[(0,Z.jsx)($r,{id:e.id,"aria-hidden":`true`,className:`size-4`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:e.displayName}),o===e.id?(0,Z.jsx)(zo,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}):null]},e.id))]})]}):null]}):null,t[17]=y,t[18]=x,t[19]=C,t[20]=a,t[21]=s,t[22]=o,t[23]=b,t[24]=S,t[25]=u,t[26]=E,t[27]=g,t[28]=j):j=t[28];let M=!w&&!C?f:null,N;t[29]!==C||t[30]!==w?(N=w||C?(0,Z.jsx)(Fr,{}):null,t[29]=C,t[30]=w,t[31]=N):N=t[31];let P;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Z.jsx)(cl,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}),t[32]=P):P=t[32];let F;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(J,{id:`jRAGrQ`})}),t[33]=F):F=t[33];let I;t[34]!==l||t[35]!==g.settings?(I=(0,Z.jsxs)(wr,{onSelect:l,"data-testid":g.settings,children:[P,F]}),t[34]=l,t[35]=g.settings,t[36]=I):I=t[36];let L;t[37]!==v||t[38]!==N||t[39]!==I||t[40]!==A||t[41]!==j||t[42]!==M||t[43]!==g.menu?(L=(0,Z.jsxs)(Mr,{align:v,className:`max-h-80 min-w-[200px]`,"data-testid":g.menu,children:[A,j,M,N,I]}),t[37]=v,t[38]=N,t[39]=I,t[40]=A,t[41]=j,t[42]=M,t[43]=g.menu,t[44]=L):L=t[44];let R;t[45]!==p||t[46]!==L||t[47]!==k?(R=(0,Z.jsxs)(Pr,{modal:!1,onOpenChange:p,children:[k,L]}),t[45]=p,t[46]=L,t[47]=k,t[48]=R):R=t[48];let z;return t[49]!==R||t[50]!==D?(z=(0,Z.jsxs)(df,{children:[D,R]}),t[49]=R,t[50]=D,t[51]=z):z=t[51],z}var PE=`ok-onboarding-card-v1`,FE={initialized:!1,steps:{file:!1,askedAi:!1},fileBaseline:0,dismissed:!1,completed:!1};function IE(e){return e===!0}function LE(e){if(typeof e!=`object`||!e)return FE;let t=e,n=typeof t.steps==`object`&&t.steps!==null?t.steps:{};return{initialized:IE(t.initialized),steps:{file:IE(n.file),askedAi:IE(n.askedAi)},fileBaseline:typeof t.fileBaseline==`number`&&Number.isFinite(t.fileBaseline)&&t.fileBaseline>=0?t.fileBaseline:0,dismissed:IE(t.dismissed),completed:IE(t.completed)}}function RE(e){try{let t=(e??localStorage).getItem(PE);return t==null?FE:LE(JSON.parse(t))}catch(e){return console.warn(`[onboarding-card-store] readPersistedState failed (corrupt/privacy/SSR)`,e),FE}}function zE(e,t){try{(t??localStorage).setItem(PE,JSON.stringify(e))}catch(e){console.warn(`[onboarding-card-store] writePersistedState failed (quota/privacy/SSR)`,e)}}function BE(e){let t=RE(e),n=new Set,r=!1;function i(){for(let e of n)e()}function a(n){t=n,zE(t,e),i()}return{getSnapshot(){return t},subscribe(e){return n.add(e),()=>{n.delete(e)}},activate(e=0){t.initialized||a({...t,initialized:!0,fileBaseline:e})},markStepComplete(e){t.steps[e]||a({...t,steps:{...t.steps,[e]:!0}})},dismiss(){t.dismissed||a({...t,dismissed:!0})},markCompleted(){t.completed||a({...t,completed:!0})},install(){r||(r=!0,t=RE(e),i())}}}var VE=BE();function HE(e){let t=e===void 0?VE:e;return(0,Q.useSyncExternalStore)(t.subscribe,t.getSnapshot,t.getSnapshot)}function UE(){VE.install()}function WE(e){return zl(e).filter(e=>e.kind===`document`||e.kind===`folder`).length}async function GE(){let e=await fetch(`/api/documents`);if(!e.ok)throw Error(`documents request failed: ${e.status}`);let t=await e.json(),n=zi.safeParse(t);if(!n.success)throw Error(`documents response did not match schema`,{cause:n.error});return WE(n.data.documents)}async function KE(e=VE){let t=e.getSnapshot();if(!(t.steps.file||!t.initialized))try{await GE()>t.fileBaseline&&e.markStepComplete(`file`)}catch(e){console.warn(`[onboarding-signals] file-step count read failed; leaving step incomplete`,e)}}function qE(e=VE){e.getSnapshot().initialized&&e.markStepComplete(`askedAi`)}var JE=5200,YE=500,XE=/\.(md|mdx)$/i;function ZE(e,t){return XE.test(e)?e:t?`${e}${t}`:nc(e)}function QE(e){return XE.test(e)?e.replace(XE,``):null}function $E(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName.toUpperCase();return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`}function eD(){let e=(0,$.c)(2),[t,n]=(0,Q.useState)(tD),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=window.matchMedia(`(prefers-reduced-motion: reduce)`);n(e.matches);let t=e=>n(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,Q.useEffect)(r,i),t}function tD(){return typeof window<`u`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function nD(e,t){let n=(0,$.c)(9),[r,i]=(0,Q.useState)(0),[a,o]=(0,Q.useState)(!0),s,c;if(n[0]!==t||n[1]!==a?(s=()=>{if(!t)return;if(a){let e=setTimeout(()=>o(!1),JE);return()=>clearTimeout(e)}let e=setTimeout(()=>{i(rD),o(!0)},YE);return()=>clearTimeout(e)},c=[a,t],n[0]=t,n[1]=a,n[2]=s,n[3]=c):(s=n[2],c=n[3]),(0,Q.useEffect)(s,c),!t){let t=e[0]??``,r;return n[4]===t?r=n[5]:(r={text:t,visible:!0},n[4]=t,n[5]=r),r}let l=e[e.length>0?r%e.length:0]??``,u;return n[6]!==l||n[7]!==a?(u={text:l,visible:a},n[6]=l,n[7]=a,n[8]=u):u=n[8],u}function rD(e){return e+1}function iD(e){let t=(0,$.c)(2),{agentName:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(J,{id:`5PrrYw`,values:{agentName:n}}),t[0]=n,t[1]=r),r}function aD(e){let t=(0,$.c)(104),{docName:n,surface:r,folderPath:i,dismissed:a,onDismiss:o,onReopen:s}=e,c=a===void 0?!1:a,{_:l}=gt(),u=i!==void 0,d=u?null:n??null,f=r??`wysiwyg`,p=eD(),m=fd(),{pageMeta:h}=Go(),{states:g}=as(),_=Xr(),{dispatch:v}=$o(),y=es(),[b]=(0,Q.useState)(_D),[x,S]=(0,Q.useState)(null),[C,w]=(0,Q.useState)(!0),[T,E]=(0,Q.useState)(!1),D=(0,Q.useRef)(null),O=(0,Q.useRef)(null),[k]=(0,Q.useState)(gD),A,j;t[0]!==c||t[1]!==n||t[2]!==u||t[3]!==r?(A=()=>{if(u||n==null)return;let e=document.documentElement,t=mD,i=()=>{r===`wysiwyg`&&requestAnimationFrame(()=>{let e=ut(n),t=O.current;if(!(!e||e.isDestroyed||!t))try{let n=e.view,r=n.coordsAtPos(e.state.selection.head).bottom-(t.getBoundingClientRect().top-28);if(r<=0)return;let i=n.dom.closest(`.editor-doc-scroll`);i instanceof HTMLElement&&(i.scrollTop+=r)}catch{}})},a=O.current;if(c||!a){t(),e.style.removeProperty(`--ask-composer-height`);return}let o=()=>{t(),e.style.setProperty(`--ask-composer-height`,`${a.offsetHeight+56}px`)};o(),i();let s=new ResizeObserver(o);return s.observe(a),()=>{s.disconnect(),t(),e.style.removeProperty(`--ask-composer-height`)}},j=[c,r,n,u],t[0]=c,t[1]=n,t[2]=u,t[3]=r,t[4]=A,t[5]=j):(A=t[4],j=t[5]),(0,Q.useEffect)(A,j);let M=(0,Q.useRef)(c),N=(0,Q.useRef)(s),P;t[6]!==c||t[7]!==s?(P=()=>{M.current=c,N.current=s},t[6]=c,t[7]=s,t[8]=P):P=t[8],(0,Q.useEffect)(P);let I,L;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>F(()=>{M.current?N.current?.():D.current?.focus()}),L=[],t[9]=I,t[10]=L):(I=t[9],L=t[10]),(0,Q.useEffect)(I,L);let R;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(R=[],t[11]=R):R=t[11],(0,Q.useEffect)(fD,R);let z=(0,Q.useRef)(c),B,V;t[12]===c?(B=t[13],V=t[14]):(B=()=>{let e=z.current;z.current=c,e&&!c&&D.current?.focus()},V=[c],t[12]=c,t[13]=B,t[14]=V),(0,Q.useEffect)(B,V);let H;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(H=[],t[15]=H):H=t[15];let[U,W]=(0,Q.useState)(H),[G,K]=(0,Q.useState)(dD),ee;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(ee=[],t[16]=ee):ee=t[16];let[te,ne]=(0,Q.useState)(ee),q;t[17]!==n||t[18]!==u||t[19]!==h?(q=u||n==null?``:ZE(n,h.get(n)?.docExt),t[17]=n,t[18]=u,t[19]=h,t[20]=q):q=t[20];let re=q,ie,ae;t[21]!==re||t[22]!==G||t[23]!==u||t[24]!==C?(ie=()=>{u||C||W(e=>{if(G.has(re))return e;let t=QE(re),n=t===null?e:e.filter(e=>e===re||QE(e)!==t);return n.includes(re)?n.length===e.length?e:n:[...n,re]})},ae=[u,C,re,G],t[21]=re,t[22]=G,t[23]=u,t[24]=C,t[25]=ie,t[26]=ae):(ie=t[25],ae=t[26]),(0,Q.useEffect)(ie,ae);let oe=u?i&&!G.has(i)&&!te.includes(i)?[i]:[]:U.filter(e=>!G.has(e)&&!te.includes(e)),se=jo(d,f),ce=jo(d,`frontmatter`),[le,ue]=(0,Q.useState)(null),[de,fe]=(0,Q.useState)(!1),pe,me;t[27]===se?(pe=t[28],me=t[29]):(pe=()=>{se&&ue(se)},me=[se],t[27]=se,t[28]=pe,t[29]=me),(0,Q.useEffect)(pe,me);let he,ge;t[30]===ce?(he=t[31],ge=t[32]):(he=()=>{ce&&ue(ce)},ge=[ce],t[30]=ce,t[31]=he,t[32]=ge),(0,Q.useEffect)(he,ge);let _e=Kr(),ve=Gr(),ye;t[33]===_?ye=t[34]:(ye=e=>Qr(_,e.source,e.id,!0,e.supported),t[33]=_,t[34]=ye);let be=ve.filter(ye),xe=ii(be,_e),Se;t[35]===y?.installedClis?Se=t[36]:(Se=y?.installedClis??{},t[35]=y?.installedClis,t[36]=Se);let Ce=qc({sticky:x??b,effectiveThreadAgent:xe,enabledClis:y===null?[]:Oc(_,y.installedClis),enabledDesktopTargets:Jc(_),installedClis:Se,terminalAvailable:y!==null,threadsAvailable:!0,desktopSelectable:!0}),we=Ce.kind===`thread`,Te=Ce.kind===`cli`?Ce.cli:null,Ee=Te!==null,De=Ce.kind===`desktop`?Zr.find(e=>e.id===Ce.target)??null:null,Oe=!T&&(!C||le!==null)&&(Ee||De!==null||we),ke;t[37]===_?ke=t[38]:(ke=Zr.filter(e=>ni(_,e.id)),t[37]=_,t[38]=ke);let Ae=ke,je;t[39]===g?je=t[40]:(je=Zr.some(e=>g[e.id]?.installed==null),t[39]=g,t[40]=je);let Me=je,Ne=y===null?void 0:Oc(_,y.installedClis).map(e=>{let{displayName:t}=gi[e];return{cli:e,label:t,ariaLabel:l({id:`QYfQdv`,values:{displayName:t}}),selected:Te===e,onSelect:()=>He(e)}}),Pe;t[41]===l?Pe=t[42]:(Pe=l({id:`KYSocE`}),t[41]=l,t[42]=Pe);let Fe;t[43]===l?Fe=t[44]:(Fe=l({id:`7Ongq0`}),t[43]=l,t[44]=Fe);let Ie;t[45]===l?Ie=t[46]:(Ie=l({id:`HPTPGr`}),t[45]=l,t[46]=Ie);let Le;t[47]===l?Le=t[48]:(Le=l({id:`qiRoLb`}),t[47]=l,t[48]=Le);let Re;t[49]!==Pe||t[50]!==Fe||t[51]!==Ie||t[52]!==Le?(Re=[Pe,Fe,Ie,Le],t[49]=Pe,t[50]=Fe,t[51]=Ie,t[52]=Le,t[53]=Re):Re=t[53];let ze=nD(Re,!p&&C&&!c),Be;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(Be=e=>{S(e.id),Kc(e.id)},t[54]=Be):Be=t[54];let Ve=Be,He=e=>{let t=Tc(e);S(t),Kc(t)},Ue;if(t[55]===Symbol.for(`react.memo_cache_sentinel`)){let e=()=>{S(wc),Kc(wc)};Ue=t=>{Jr(t),e()},t[55]=Ue}else Ue=t[55];let We=Ue,Ge=()=>{D.current?.clear(),ue(null),fe(!1),W([]),K(new Set),FC()},Ke=e=>{if(e===null){gl.error(l({id:`y8B54M`}));return}if(we){hs(e,xe===null?void 0:{agent:{source:xe.source,id:xe.id}}),qE(),Ge();return}if(Te!==null&&y!==null){try{y.launchInTerminal(e,Te)}catch{gl.error(l({id:`jBVUXo`}));return}qE(),Ge();return}if(De!==null){if(g[De.id]?.installed!==!0){ps(De),gl.info(l({id:`L1BQTH`,values:{0:De.displayName}})),Ge();return}E(!0),v(De.id,e).then(uD).finally(()=>{E(!1),Ge()})}},qe=()=>{let{instruction:e,mentions:t}=D.current?.getContent()??{instruction:``,mentions:[]};if(u)return fs({docName:null,folderRelativePath:i,workspace:m,instruction:e,mentions:[...new Set([...oe,...t])].filter(e=>e!==i)});let r=le?pd(le):void 0,a=le?.docName??null,o=le?a:oe.includes(re)?n??null:null,s=o===null?null:ZE(o,h.get(o)?.docExt),c=[...new Set([...oe,...t])].filter(e=>e!==s);return fs({docName:o,...s===null?{}:{docRelativePath:s},workspace:m,instruction:e,mentions:c,selection:r})},Je=()=>{Oe&&Ke(qe())};if(c)return null;let Ye=``,Xe=``;if(le){let e;t[56]!==h||t[57]!==le?(e=md(le,ZE(le.docName,h.get(le.docName)?.docExt).split(`/`).pop()??``),t[56]=h,t[57]=le,t[58]=e):e=t[58],Ye=e;let n;t[59]===le.markdown?n=t[60]:(n=hd(le.markdown),t[59]=le.markdown,t[60]=n),Xe=n}let Ze;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(Ze=e=>pf(e,D),t[61]=Ze):Ze=t[61];let Qe;t[62]!==l||t[63]!==u||t[64]!==o?(Qe=u?null:(0,Z.jsx)(X,{type:`button`,variant:`outline`,"aria-label":l({id:`EWX92Z`}),onClick:()=>o?.(),"data-testid":`ask-ai-collapse`,className:`-top-2.5 -translate-x-1/2 absolute left-1/2 z-10 h-5 w-10 rounded-md p-0 text-muted-foreground opacity-0 shadow-sm transition-opacity hover:text-foreground focus-visible:opacity-100 group-focus-within:opacity-100 group-hover:opacity-100`,children:(0,Z.jsx)(Vo,{className:`size-3.5`,"aria-hidden":!0})}),t[62]=l,t[63]=u,t[64]=o,t[65]=Qe):Qe=t[65];let $e;t[66]===Symbol.for(`react.memo_cache_sentinel`)?($e=e=>K(t=>{let n=new Set(t);return n.add(e),n}),t[66]=$e):$e=t[66];let et;t[67]!==l||t[68]!==Ye||t[69]!==Xe||t[70]!==le||t[71]!==de?(et=le?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`span`,{"data-testid":`composer-selection-pill`,title:Ye,className:`group/chip inline-flex max-w-[16rem] items-center gap-1 rounded-md border bg-muted/40 py-0.5 pr-1.5 pl-1 text-muted-foreground text-xs`,children:[(0,Z.jsxs)(X,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":l({id:`irrm_E`}),onClick:()=>{ue(null),fe(!1)},className:`group/remove relative size-3.5 shrink-0 rounded-sm text-muted-foreground/80 hover:text-foreground`,children:[(0,Z.jsx)(Og,{className:`absolute top-1/2 left-1/2 size-3 -translate-x-1/2 -translate-y-1/2 opacity-100 transition-opacity duration-150 ease-out group-hover/chip:opacity-0 group-focus-within/chip:opacity-0 motion-reduce:transition-none`,"aria-hidden":!0}),(0,Z.jsx)(hl,{className:`absolute top-1/2 left-1/2 size-3 -translate-x-1/2 -translate-y-1/2 opacity-0 transition-opacity duration-150 ease-out group-hover/chip:opacity-100 group-focus-within/chip:opacity-100 motion-reduce:transition-none`,"aria-hidden":!0})]}),(0,Z.jsx)(X,{type:`button`,variant:`ghost`,"aria-expanded":de,"aria-label":l(de?{id:`UaDyeb`}:{id:`eTL5y9`}),onClick:()=>fe(lD),"data-testid":`composer-selection-peek`,className:`h-auto min-h-0 min-w-0 shrink justify-start px-0 py-0 text-left font-normal text-muted-foreground text-xs hover:bg-transparent hover:text-foreground`,children:(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:Ye})})]}),de&&Xe!==``?(0,Z.jsx)(`p`,{className:`max-h-24 w-full basis-full overflow-y-auto whitespace-pre-wrap text-2xs text-muted-foreground/80 subtle-scrollbar`,"data-testid":`composer-selection-preview`,children:Xe}):null]}):null,t[67]=l,t[68]=Ye,t[69]=Xe,t[70]=le,t[71]=de,t[72]=et):et=t[72];let tt;t[73]===l?tt=t[74]:(tt=l({id:`xWEvuo`}),t[73]=l,t[74]=tt);let nt;t[75]!==C||t[76]!==p||t[77]!==ze?(nt=C?(0,Z.jsx)(`div`,{"aria-hidden":!0,className:Y(`pointer-events-none absolute inset-0 truncate px-0 py-1 text-base text-muted-foreground/60 md:text-sm`,!p&&`transition-opacity duration-500 ease-in-out`,ze.visible?`opacity-100`:`opacity-0`),children:ze.text}):null,t[75]=C,t[76]=p,t[77]=ze,t[78]=nt):nt=t[78];let rt=NE,it=we?(0,Z.jsx)(So,{agentId:xe?.id??``,iconUrl:xe?.iconUrl,className:`size-4`}):Te===null?De?(0,Z.jsx)($r,{id:De.id,className:`size-4`,"aria-hidden":!0}):null:(0,Z.jsx)($r,{id:qr(Te),className:`size-4`,"aria-hidden":!0}),at=we?xe===null?(0,Z.jsx)(J,{id:`G7bn_N`}):(0,Z.jsx)(iD,{agentName:xe.name}):Te===null?De?(0,Z.jsx)(J,{id:`nUNZL4`,values:{0:De.displayName}}):(0,Z.jsx)(J,{id:`F-vBv0`}):(0,Z.jsx)(J,{id:`ti6aF_`,values:{0:gi[Te].displayName}}),ot;t[79]===at?ot=t[80]:(ot=(0,Z.jsx)(`span`,{children:at}),t[79]=at,t[80]=ot);let st;t[81]===T?st=t[82]:(st=T?(0,Z.jsx)(Xc,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):null,t[81]=T,t[82]=st);let ct;t[83]!==it||t[84]!==ot||t[85]!==st?(ct=(0,Z.jsxs)(Z.Fragment,{children:[it,ot,st]}),t[83]=it,t[84]=ot,t[85]=st,t[86]=ct):ct=t[86];let lt=!Oe,dt=Ee?null:De?.id??null,ft=be.map(e=>({key:`${e.source}:${e.id}`,id:e.id,name:e.name,...e.iconUrl===void 0?{}:{iconUrl:e.iconUrl},selected:we&&xe!==null&&xe.source===e.source&&xe.id===e.id,onSelect:()=>We(e)})),pt;t[87]===Me?pt=t[88]:(pt=(0,Z.jsx)(`p`,{className:`px-2 py-1.5 text-sm text-muted-foreground`,"aria-live":`polite`,children:Me?(0,Z.jsx)(J,{id:`CPmYSG`}):(0,Z.jsx)(J,{id:`t9Qn8y`})}),t[87]=Me,t[88]=pt);let mt;t[89]===l?mt=t[90]:(mt=l({id:`nskygk`}),t[89]=l,t[90]=mt);let ht;t[91]===Symbol.for(`react.memo_cache_sentinel`)?(ht={primary:`ask-ai-send`,trigger:`ask-ai-agent-trigger`,menu:`ask-ai-agent-menu`,option:cD,threadAgent:sD,settings:`ask-ai-agent-option-settings`,terminal:oD},t[91]=ht):ht=t[91];let _t;t[92]!==rt||t[93]!==Ne||t[94]!==Ae||t[95]!==Ve||t[96]!==Je||t[97]!==ct||t[98]!==lt||t[99]!==dt||t[100]!==ft||t[101]!==pt||t[102]!==mt?(_t=(0,Z.jsx)(rt,{primary:ct,onPrimary:Je,primaryDisabled:lt,installedTargets:Ae,selectedTargetId:dt,onSelectTarget:Ve,threadAgents:ft,onOpenSettings:Ol,terminals:Ne,menuEmptyState:pt,triggerAriaLabel:mt,testIds:ht}),t[92]=rt,t[93]=Ne,t[94]=Ae,t[95]=Ve,t[96]=Je,t[97]=ct,t[98]=lt,t[99]=dt,t[100]=ft,t[101]=pt,t[102]=mt,t[103]=_t):_t=t[103];let vt=(0,Z.jsxs)(`div`,{ref:O,onMouseDown:Ze,className:`pointer-events-auto group relative flex cursor-text flex-col gap-1.5 rounded-2xl border border-border/60 bg-card px-3 py-2 shadow-sm transition-colors focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50`,children:[Qe,(0,Z.jsx)(ME,{files:oe,onRemoveFile:$e,children:et}),(0,Z.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,Z.jsxs)(`div`,{className:`relative flex-1`,children:[(0,Z.jsx)(ew,{ref:D,ariaLabel:tt,onEmptyChange:w,onContentChange:PC,onMentionsChange:ne,onSubmit:Je,initialDoc:k,className:`max-h-[200px] overflow-y-auto text-base md:text-sm`}),nt]}),_t]})]});return u?(0,Z.jsx)(`div`,{className:`shrink-0 pt-2 pb-3`,"data-testid":`bottom-composer`,children:(0,Z.jsx)(`div`,{className:`mx-auto w-full max-w-4xl px-6`,children:vt})}):(0,Z.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-[var(--conflict-footer-height,0px)] z-20 editor-content-aligned bg-gradient-to-t from-background from-65% via-background to-transparent pt-10 pb-2`,"data-testid":`bottom-composer`,children:vt})}function oD(e){return e===`claude`?`ask-ai-agent-option-terminal`:`ask-ai-agent-option-terminal-${e}`}function sD(e){return`ask-ai-agent-option-thread-${e}`}function cD(e){return`ask-ai-agent-option-${e}`}function lD(e){return!e}function uD(e){e.ok&&qE()}function dD(){return new Set}function fD(){let e=pD;return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})}function pD(e){El(e,`open-ask-ai`)&&($E(e.target)||(e.preventDefault(),j()))}function mD(){let e=[...document.querySelectorAll(`.editor-doc-scroll`)].filter(hD);if(e.length===0)return;let t=!1,n=()=>{t=!0};window.addEventListener(`wheel`,n,{passive:!0}),window.addEventListener(`touchstart`,n,{passive:!0});let r=performance.now(),i=()=>{if(t||performance.now()-r>=300){window.removeEventListener(`wheel`,n),window.removeEventListener(`touchstart`,n);return}for(let t of e)t.scrollTop=t.scrollHeight-t.clientHeight;requestAnimationFrame(i)};requestAnimationFrame(i)}function hD(e){let t=e.scrollHeight-e.clientHeight;return t>0&&e.scrollTop>=t-40}function gD(){return NC().doc??void 0}function _D(){return xc()}function vD(e){return!e.terminalVisible&&!e.isEmbedded&&e.activeDocName!==null}function yD(e){return!e.terminalVisible&&!e.isEmbedded}function bD(e,t={}){let n=x(e.componentName);return n.name===`*`?t.unregisteredSuffix?`${e.componentName} (unregistered)`:e.componentName:n.displayName??n.name}var xD=200,SD=`Outside any block`;function CD(e){let t=(0,$.c)(5),{editor:n}=e,r=fe(n),i=(0,Q.useRef)(null),a=(0,Q.useRef)(null),o=(0,Q.useRef)(!1),s,c;t[0]!==r||t[1]!==n?(s=()=>{if(a.current!==null&&(window.clearTimeout(a.current),a.current=null),!n||!i.current)return;let e=r!==null&&r.ancestorChain.length>0,t;return t=e?wD(n,r):o.current?SD:``,a.current=window.setTimeout(()=>{i.current&&(i.current.textContent=``,i.current.textContent=t),o.current=e,a.current=null},xD),()=>{a.current!==null&&(window.clearTimeout(a.current),a.current=null)}},c=[n,r],t[0]=r,t[1]=n,t[2]=s,t[3]=c):(s=t[2],c=t[3]),(0,Q.useEffect)(s,c);let l;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(`div`,{ref:i,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`sr-only`}),t[4]=l):l=t[4],l}function wD(e,t){if(!t||t.ancestorChain.length===0)return``;let n=t.ancestorChain,r=n[n.length-1],i=bD(r,{unregisteredSuffix:!0});if(n.length===1)return`Selected: ${i}`;let a=n[n.length-2],o=bD(a);try{let t=e.state.doc.resolve(r.pos),n=t.index(t.depth),a=t.parent.childCount;return`Selected: ${i}, ${n+1} of ${a} in ${o}`}catch{return`Selected: ${i} in ${o}`}}var TD=!1;function ED(e,t,n,r){let i=e[t];if(typeof i!=`function`){console.warn(`[cold-mount-instrumentation] target missing method "${t}"`);return}e[t]=function(...e){let t=performance.now(),a,o=!1;try{return a=i.apply(this,e),o=!0,a}finally{let e=performance.now()-t,i;if(o&&r)try{i=r(this,a,t,e)}catch(e){i={"instrumentation-error":e instanceof Error?e.message:String(e)}}try{lu(n,{durationMs:Math.round(e*1e3)/1e3,threw:!o,...i},{startTime:t,duration:e})}catch{}}}}function DD(e){return e?.doc?typeof e.doc.nodeSize==`number`?e.doc.nodeSize:e.doc.content&&typeof e.doc.content.size==`number`?e.doc.content.size:null:null}var OD=0,kD=0,AD=0,jD=0,MD=null,ND=[`linkResolutionDecoration$`],PD=new WeakSet,FD=new WeakSet;function ID(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase()}function LD(){return!1}function RD(){return!LD()}function zD(e,t){if(RD())return t;let n=`ok/cold/nodeview-factory-${ID(e)}`;return function(...r){let i=performance.now();try{return t(...r)}finally{let t=performance.now()-i;lu(n,{nodeType:e,durationMs:Math.round(t*1e3)/1e3},{startTime:i,duration:t})}}}function BD(e){if(RD())return;let t=e.state.plugins;for(let e of t){if(FD.has(e))continue;let t=e.spec?.key?.key;if(!t||!ND.some(e=>t.startsWith(e)))continue;let n=e.props,r=n.decorations;if(typeof r!=`function`){FD.add(e);continue}let i=`ok/cold/decoration-${ID(t.replace(/\$\d*$/,``))}`;n.decorations=function(...e){let n=performance.now();try{return r.apply(this,e)}finally{let e=performance.now()-n;lu(i,{pluginKey:t,durationMs:Math.round(e*1e3)/1e3},{startTime:n,duration:e})}},FD.add(e)}}function VD(e){if(RD())return;let t=e._props?.nodeViews;if(!(!t||typeof t!=`object`))for(let[e,n]of Object.entries(t)){if(typeof n!=`function`||n.__okWrapped===!0)continue;let r=zD(e,n);r.__okWrapped=!0,t[e]=r}}function HD(e){return RD()?e:e.map(e=>{let t=e.name??`unknown`,n=ID(t);return e.extend({onBeforeCreate(){let e=performance.now();try{this.parent?.()}finally{let r=performance.now()-e;lu(`ok/cold/ext-${n}-on-before-create`,{ext:t,hook:`onBeforeCreate`,durationMs:Math.round(r*1e3)/1e3},{startTime:e,duration:r})}},onCreate(){let e=performance.now();try{this.parent?.()}finally{let r=performance.now()-e;lu(`ok/cold/ext-${n}-on-create`,{ext:t,hook:`onCreate`,durationMs:Math.round(r*1e3)/1e3},{startTime:e,duration:r})}},onUpdate(){let e=performance.now();try{this.parent?.()}finally{let r=performance.now()-e;lu(`ok/cold/ext-${n}-on-update`,{ext:t,hook:`onUpdate`,durationMs:Math.round(r*1e3)/1e3},{startTime:e,duration:r})}},onDestroy(){let e=performance.now();try{this.parent?.()}finally{let r=performance.now()-e;lu(`ok/cold/ext-${n}-on-destroy`,{ext:t,hook:`onDestroy`,durationMs:Math.round(r*1e3)/1e3},{startTime:e,duration:r})}}})})}function UD(){if(!TD){TD=!0,ED(bi.prototype,`mount`,`ok/cold/editor-mount`,(e,t,n,r)=>{let i=e;return RD()||(MD=performance.now()),{elementDefault:i.options?.element?.nodeName??null,docSize:DD(i.editorState),durationMs:r}}),ED(bi.prototype,`createView`,`ok/cold/editor-create-view`,e=>{let t=e;return!RD()&&!PD.has(e)&&t.view&&(BD(t.view),VD(t.view),PD.add(e)),{docSize:DD(t.editorState)}}),ED(bi.prototype,`createNodeViews`,`ok/cold/create-node-views`,(e,t,n,r)=>{jD+=1;let i=e;return!RD()&&i.view&&VD(i.view),{docSize:DD(i.view),seq:jD,durationMs:r}}),ED(Qa.prototype,`updateState`,`ok/cold/pm-update-state`,(e,t,n,r)=>(kD+=1,{seq:kD,docSize:DD(e.state),durationMs:r})),ED(Qa.prototype,`setProps`,`ok/cold/pm-set-props`,(e,t,n,r)=>(AD+=1,{seq:AD,docSize:DD(e.state),durationMs:r})),ED(le.prototype,`_forceRerender`,`ok/cold/force-rerender`,(e,t,n,r)=>{OD+=1;let i=e,a=(()=>{try{return i.type?.toArray?i.type.toArray().length:null}catch{return null}})();return{seq:OD,topLevelYElements:a,durationMs:r}}),ED(Mn.prototype,`init`,`ok/cold/ec-init`,e=>({editorPresent:!!e.props?.editor}));try{typeof PerformanceObserver<`u`&&new PerformanceObserver(e=>{for(let t of e.getEntries()){let e=t.name;if((e===`first-paint`||e===`first-contentful-paint`)&&(lu(e===`first-paint`?`ok/cold/paint-fp`:`ok/cold/paint-fcp`,{entryType:t.entryType,startTime:Math.round(t.startTime*1e3)/1e3},{startTime:t.startTime,duration:0}),!RD()&&e===`first-paint`&&MD!==null)){let e=MD,n=Math.max(0,t.startTime-e);lu(`ok/cold/append-to-paint`,{paintEntryType:t.entryType,durationMs:Math.round(n*1e3)/1e3,paintAt:Math.round(t.startTime*1e3)/1e3},{startTime:e,duration:n}),MD=null}}}).observe({type:`paint`,buffered:!0})}catch{}globalThis.__okColdMountInstrumented=!0}}function WD(){let[e]=(0,Q.useState)(oa);return e}var GD=class{awareness=null;started=!1;renewIntervalMs;now;constructor(e,t={}){this.ticker=e,this.renewIntervalMs=t.renewIntervalMs??15e3,this.now=t.now??(()=>Date.now())}start(){this.started||(this.started=!0,this.ticker.start(()=>this.renewIfStale()))}stop(){this.started&&(this.started=!1,this.ticker.stop(),this.awareness=null)}setAwareness(e){this.awareness=e}clearAwareness(e){this.awareness===e&&(this.awareness=null)}renewIfStale(){let e=this.awareness;if(e===null)return;let t=e.getLocalState();if(t===null)return;let n=e.meta.get(e.clientID)?.lastUpdated??0;this.now()-n>=this.renewIntervalMs&&e.setLocalState(t)}},KD=class{worker=null;start(e){typeof Worker>`u`||this.worker!==null||(this.worker=new Worker(new URL(``+new URL(`awareness-heartbeat.worker-BYkbsKQ2.js`,import.meta.url).href,``+import.meta.url),{type:`module`}),this.worker.onmessage=t=>{t.data===`tick`&&e()},this.worker.postMessage(`start`))}stop(){this.worker!==null&&(this.worker.postMessage(`stop`),this.worker.terminate(),this.worker=null)}},qD=null;function JD(){return qD===null&&(qD=new GD(new KD)),qD}function YD({principal:e,identity:t}){return e&&e.source===`git-config`?{type:`human`,name:wi(e.display_name),color:da(e.id,ea),coeditor:t.coeditor,tabId:t.tabId,principalId:e.id}:e&&e.source===`synthesized`?{type:`human`,name:t.name,color:da(e.id,ea),coeditor:t.coeditor,tabId:t.tabId}:{type:`human`,name:t.name,color:t.color,coeditor:t.coeditor,tabId:t.tabId}}function XD(e,t){return e>t}function ZD(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.isChangeOrigin===!0?!0:`snapshot`in t&&`prevSnapshot`in t&&t.snapshot===null&&t.prevSnapshot===null}var QD=3,$D=6e4;function eO(e,t){let n=0;for(let r of e)t-r<$D&&(n+=1);return n<QD}var tO=new Map;function nO(e,t){for(let n of e.changed.keys()){let e=n;for(;e!=null;){if(e===t)return!0;let n=e._item;e=n==null?null:n.parent}}return!1}function rO(e){let t=pe.getState(e);return t?.snapshot!=null||t?.prevSnapshot!=null}function iO(e){let{fragment:t,docName:n,onWedged:r}=e,i=0,a=0,o=!1,s=!1,c=!1,l=null,u=new WeakSet,d=e=>{let t=pe.getState(e)?.binding;if(!t)return;if(typeof t._prosemirrorChanged!=`function`){lu.count(`ok/editor/binding-guard-disarmed`,{docName:n,reason:`no-prosemirror-changed`}),console.warn(`[binding-staleness-guard] ySync binding on "${n}" exposes no _prosemirrorChanged — write-back gate disarmed (vendored y-tiptap contract change?)`);return}if(u.has(t))return;u.add(t);let r=t._prosemirrorChanged.bind(t);t._prosemirrorChanged=e=>{XD(i,a)||r(e)}},f=()=>{if(c=!1,!s||o||!XD(i,a)||l!==null&&rO(l.state))return;o=!0;let e=Date.now();for(let[t,n]of tO)n.every(t=>e-t>=$D)&&tO.delete(t);let t=(tO.get(n)??[]).filter(t=>e-t<$D);if(!eO(t,e)){tO.set(n,t),lu.count(`ok/editor/binding-wedge-rate-capped`,{docName:n}),console.warn(`[binding-staleness-guard] wedge on "${n}" rate-capped (externalSeq=${i}, appliedSeq=${a}) — publication gate stays closed, no further recycle`);return}t.push(e),tO.set(n,t),console.warn(`[binding-staleness-guard] wedged binding on "${n}" — Y→PM apply missing (externalSeq=${i}, appliedSeq=${a})`);try{r({externalSeq:i,appliedSeq:a})}catch(e){o=!1,lu.count(`ok/editor/binding-wedge-recovery-error`,{docName:n}),console.error(`[binding-staleness-guard] wedge recovery threw for "${n}":`,e)}},p=e=>{e.origin!==pe&&nO(e,t)&&(i+=1,c||(c=!0,queueMicrotask(f)))};return new ja({state:{init:()=>null,apply:e=>(ZD(e.getMeta(pe))&&(a=i,o&&lu.count(`ok/editor/binding-wedge-recovered`,{docName:n}),o=!1),null)},filterTransaction:(e,t)=>!XD(i,a)||rO(t)?!0:e.getMeta(pe)!==void 0,view:e=>{let r=t.doc;return r==null?(lu.count(`ok/editor/binding-guard-disarmed`,{docName:n,reason:`no-ydoc`}),console.error(`[binding-staleness-guard] fragment has no Y.Doc for "${n}" — staleness guard disarmed`),{}):(s=!0,l=e,d(e.state),r.off(`beforeObserverCalls`,p),r.on(`beforeObserverCalls`,p),{destroy:()=>{s=!1,l=null,r.off(`beforeObserverCalls`,p)}})}})}function aO(e,t){let n=Math.min(e.top,t.top),r=Math.max(e.bottom,t.bottom),i=Math.min(e.left,t.left),a=Math.max(e.right,t.right)-i,o=r-n;return new DOMRect(i,n,a,o)}var oO=class{constructor({editor:e,element:t,view:n,pluginKey:r=`bubbleMenu`,updateDelay:i=250,resizeDelay:a=60,shouldShow:o,appendTo:s,getReferencedVirtualElement:c,options:l}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:`absolute`,placement:`top`,offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:e,state:t,from:n,to:r})=>{let{doc:i,selection:a}=t,{empty:o}=a,s=!i.textBetween(n,r).length&&Ua(t.selection),c=this.element.contains(document.activeElement);return!(!(e.hasFocus()||c)||o||s||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(e,t)=>{let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);!n&&!r||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(e,n,r,t)},this.updateDelay))},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;if(!(i||!t&&!n)){if(!this.getShouldShow(r)){this.hide();return}this.show(),this.updatePosition()}},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);t===`updatePosition`?this.updatePosition():t&&typeof t==`object`&&t.type===`updateOptions`?this.updateOptions(t.options):t===`hide`?this.hide():t===`show`&&(this.updatePosition(),this.show())},this.editor=e,this.element=t,this.view=n,this.pluginKey=r,this.updateDelay=i,this.resizeDelay=a,this.appendTo=s,this.scrollTarget=l?.scrollTarget??window,this.getReferencedVirtualElement=c,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,o&&(this.shouldShow=o),this.element.addEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener(`dragstart`,this.dragstartHandler),this.editor.on(`focus`,this.focusHandler),this.editor.on(`blur`,this.blurHandler),this.editor.on(`transaction`,this.transactionHandler),window.addEventListener(`resize`,this.resizeHandler),this.scrollTarget.addEventListener(`scroll`,this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(Zn(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(or(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(er(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(ar(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Qn(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(tr(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(nr(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(ir(typeof this.floatingUIOptions.inline==`boolean`?void 0:this.floatingUIOptions.inline)),e}get virtualElement(){let{selection:e}=this.editor.state,t=this.getReferencedVirtualElement?.call(this);if(t)return t;if(!this.view?.dom?.parentNode)return;let n=aa(this.view,e.from,e.to),r={getBoundingClientRect:()=>n,getClientRects:()=>[n]};if(e instanceof Ja){let t=this.view.nodeDOM(e.from),n=t.dataset.nodeViewWrapper?t:t.querySelector(`[data-node-view-wrapper]`);n&&(t=n),t&&(r={getBoundingClientRect:()=>t.getBoundingClientRect(),getClientRects:()=>[t.getBoundingClientRect()]})}if(e instanceof oo){let{$anchorCell:t,$headCell:n}=e,i=t?t.pos:n.pos,a=n?n.pos:t.pos,o=this.view.nodeDOM(i),s=this.view.nodeDOM(a);if(!o||!s)return;let c=o===s?o.getBoundingClientRect():aO(o.getBoundingClientRect(),s.getBoundingClientRect());r={getBoundingClientRect:()=>c,getClientRects:()=>[c]}}return r}updatePosition(){if(!this.isVisible)return;let e=this.virtualElement;e&&$n(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{if(!(!this.isVisible||this.editor.isDestroyed||!this.element.isConnected)){if(r.hide?.referenceHidden||r.hide?.escaped){this.element.style.visibility=`hidden`;return}this.element.style.visibility=`visible`,this.element.style.width=`max-content`,this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(e,t){let{state:n}=e,r=n.selection.from!==n.selection.to;if(this.updateDelay>0&&r){this.handleDebouncedUpdate(e,t);return}let i=!t?.selection.eq(e.state.selection),a=!t?.doc.eq(e.state.doc);this.updateHandler(e,i,a,t)}getShouldShow(e){let{state:t}=this.view,{selection:n}=t,{ranges:r}=n,i=Math.min(...r.map(e=>e.$from.pos)),a=Math.max(...r.map(e=>e.$to.pos));return this.shouldShow?.call(this,{editor:this.editor,element:this.element,view:this.view,state:t,oldState:e,from:i,to:a})||!1}show(){var e;this.isVisible||(this.element.style.visibility=`visible`,this.element.style.opacity=`1`,(e=(typeof this.appendTo==`function`?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0)}hide(){this.isVisible&&=(this.element.style.visibility=`hidden`,this.element.style.opacity=`0`,this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),!1)}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=e.getReferencedVirtualElement),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){let t=e.options.scrollTarget??window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.scrollTarget=t,this.scrollTarget.addEventListener(`scroll`,this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}destroy(){this.hide(),this.element.removeEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener(`dragstart`,this.dragstartHandler),window.removeEventListener(`resize`,this.resizeHandler),this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.editor.off(`focus`,this.focusHandler),this.editor.off(`blur`,this.blurHandler),this.editor.off(`transaction`,this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},sO=e=>new ja({key:typeof e.pluginKey==`string`?new fa(e.pluginKey):e.pluginKey,view:t=>new oO({view:t,...e})});Hi.create({name:`bubbleMenu`,addOptions(){return{element:null,pluginKey:`bubbleMenu`,updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[sO({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var cO=class{constructor({editor:e,element:t,view:n,pluginKey:r=`floatingMenu`,updateDelay:i=250,resizeDelay:a=60,options:o,appendTo:s,shouldShow:c}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:e,state:t})=>{let{selection:n}=t,{$anchor:r,empty:i}=n,a=r.depth===1,o=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent&&r.parent.childCount===0&&!this.getTextContent(r.parent);return!(!e.hasFocus()||!i||!a||!o||!this.editor.isEditable)},this.floatingUIOptions={strategy:`absolute`,placement:`right`,offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;if(!(i||!t&&!n)){if(!this.getShouldShow(r)){this.hide();return}this.updatePosition(),this.show()}},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);t===`updatePosition`?this.updatePosition():t&&typeof t==`object`&&t.type===`updateOptions`?this.updateOptions(t.options):t===`hide`?this.hide():t===`show`&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=e,this.element=t,this.view=n,this.pluginKey=r,this.updateDelay=i,this.resizeDelay=a,this.appendTo=s,this.scrollTarget=o?.scrollTarget??window,this.floatingUIOptions={...this.floatingUIOptions,...o},this.element.tabIndex=0,c&&(this.shouldShow=c),this.element.addEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.editor.on(`focus`,this.focusHandler),this.editor.on(`blur`,this.blurHandler),this.editor.on(`transaction`,this.transactionHandler),window.addEventListener(`resize`,this.resizeHandler),this.scrollTarget.addEventListener(`scroll`,this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getTextContent(e){return Oi(e,{textSerializers:Zi(this.editor.schema)})}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(Zn(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(or(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(er(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(ar(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Qn(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(tr(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(nr(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(ir(typeof this.floatingUIOptions.inline==`boolean`?void 0:this.floatingUIOptions.inline)),e}getShouldShow(e){let{state:t}=this.view,{selection:n}=t,{ranges:r}=n,i=Math.min(...r.map(e=>e.$from.pos)),a=Math.max(...r.map(e=>e.$to.pos));return this.shouldShow?.call(this,{editor:this.editor,view:this.view,state:t,oldState:e,from:i,to:a})}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){let t=e.options.scrollTarget??window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.scrollTarget=t,this.scrollTarget.addEventListener(`scroll`,this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}updatePosition(){let{selection:e}=this.editor.state,t=aa(this.view,e.from,e.to);$n({getBoundingClientRect:()=>t,getClientRects:()=>[t]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{if(r.hide?.referenceHidden||r.hide?.escaped){this.element.style.visibility=`hidden`;return}this.element.style.visibility=`visible`,this.element.style.width=`max-content`,this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);this.updateHandler(e,n,r,t)}show(){var e;this.isVisible||(this.element.style.visibility=`visible`,this.element.style.opacity=`1`,(e=(typeof this.appendTo==`function`?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0)}hide(){this.isVisible&&=(this.element.style.visibility=`hidden`,this.element.style.opacity=`0`,this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),!1)}destroy(){this.hide(),this.element.removeEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),window.removeEventListener(`resize`,this.resizeHandler),this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.editor.off(`focus`,this.focusHandler),this.editor.off(`blur`,this.blurHandler),this.editor.off(`transaction`,this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},lO=e=>new ja({key:typeof e.pluginKey==`string`?new fa(e.pluginKey):e.pluginKey,view:t=>new cO({view:t,...e})});Hi.create({name:`floatingMenu`,addOptions(){return{element:null,options:{},pluginKey:`floatingMenu`,updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}},addCommands(){return{updateFloatingMenuPosition:()=>({tr:e,dispatch:t})=>(t&&e.setMeta(this.options.pluginKey,`updatePosition`),!0)}},addProseMirrorPlugins(){return this.options.element?[lO({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});function uO(e,t){return e??new fa(t)}var dO=typeof window<`u`?Q.useLayoutEffect:Q.useEffect,fO=new Set([`left`,`opacity`,`position`,`top`,`visibility`,`width`]),pO=new Set(`animationIterationCount.aspectRatio.borderImageOutset.borderImageSlice.borderImageWidth.columnCount.columns.fillOpacity.flex.flexGrow.flexShrink.fontWeight.gridArea.gridColumn.gridColumnEnd.gridColumnStart.gridRow.gridRowEnd.gridRowStart.lineClamp.lineHeight.opacity.order.orphans.scale.stopOpacity.strokeDasharray.strokeDashoffset.strokeMiterlimit.strokeOpacity.strokeWidth.tabSize.widows.zIndex.zoom`.split(`.`)),mO=new Set([`children`,`className`,`style`]),hO=new Set([`tabIndex`]),gO=new Set([`accessKey`,`autoCapitalize`,`contentEditable`,`contextMenu`,`dir`,`draggable`,`enterKeyHint`,`hidden`,`id`,`lang`,`nonce`,`role`,`slot`,`spellCheck`,`tabIndex`,`title`,`translate`]),_O={Blur:`focusout`,DoubleClick:`dblclick`,Focus:`focusin`,MouseEnter:`mouseenter`,MouseLeave:`mouseleave`};function vO(e,t){return/^on[A-Z]/.test(e)&&typeof t==`function`}function yO(e){return e.startsWith(`aria-`)||e.startsWith(`data-`),e}function bO(e){return e.startsWith(`aria-`)||e.startsWith(`data-`)||gO.has(e)}function xO(e){return e.startsWith(`--`)?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function SO(e){let t=e.endsWith(`Capture`),n=(t?e.slice(0,-7):e).slice(2);return{eventName:_O[n]??n.toLowerCase(),options:t?{capture:!0}:void 0}}function CO(e,t){let n=t.defaultPrevented,r=!1,i=Object.create(t);return Object.defineProperties(i,{nativeEvent:{value:t},currentTarget:{value:e},target:{value:t.target},persist:{value:()=>void 0},isDefaultPrevented:{value:()=>n},isPropagationStopped:{value:()=>r},preventDefault:{value:()=>{n=!0,t.preventDefault()}},stopPropagation:{value:()=>{r=!0,t.stopPropagation()}}}),i}function wO(e){return hO.has(e)}function TO(e,t,n){if(t===`tabIndex`){e.tabIndex=Number(n);return}e[t]=n}function EO(e,t){if(t===`tabIndex`){e.removeAttribute(`tabindex`);return}let n=e[t];if(typeof n==`boolean`){e[t]=!1;return}if(typeof n==`number`){e[t]=0;return}e[t]=``}function DO(e,t){return typeof t!=`number`||t===0||e.startsWith(`--`)||pO.has(e)?String(t):`${t}px`}function OO(e,t){fO.has(t)||e.style.removeProperty(xO(t))}function kO(e,t,n){fO.has(t)||e.style.setProperty(xO(t),DO(t,n))}function AO(e,t,n){new Set([...Object.keys(t),...Object.keys(n)]).forEach(r=>{if(mO.has(r)||!bO(r)||vO(r,t[r])||vO(r,n[r]))return;let i=t[r],a=n[r];if(i===a)return;let o=yO(r);if(a==null||a===!1){wO(r)&&EO(e,r),e.removeAttribute(o);return}if(a===!0){wO(r)&&TO(e,r,!0),e.setAttribute(o,``);return}if(wO(r)){TO(e,r,a);return}e.setAttribute(o,String(a))})}function jO(e,t,n){if(t!==n){if(n){e.className=n;return}e.removeAttribute(`class`)}}function MO(e,t,n){let r=t??{},i=n??{};new Set([...Object.keys(r),...Object.keys(i)]).forEach(t=>{let n=r[t],a=i[t];if(n!==a){if(a==null){OO(e,t);return}kO(e,t,a)}})}function NO(e,t,n){t.forEach(({eventName:t,listener:n,options:r})=>{e.removeEventListener(t,n,r)});let r=[];return Object.entries(n).forEach(([t,n])=>{if(!vO(t,n))return;let{eventName:i,options:a}=SO(t),o=t=>{n(CO(e,t))};e.addEventListener(i,o,a),r.push({eventName:i,listener:o,options:a})}),r}function PO(e,t){let n=(0,Q.useRef)({}),r=(0,Q.useRef)([]);dO(()=>{let i=n.current;return jO(e,i.className,t.className),MO(e,i.style,t.style),AO(e,i,t),r.current=NO(e,r.current,t),n.current=t,()=>{r.current.forEach(({eventName:t,listener:n,options:r})=>{e.removeEventListener(t,n,r)}),r.current=[]}},[e,t])}var FO=Q.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:r,appendTo:i,shouldShow:a=null,getReferencedVirtualElement:o,options:s,children:c,...l},u)=>{let d=(0,Q.useRef)(document.createElement(`div`)),f=(0,Q.useRef)(uO(e,`bubbleMenu`)).current;PO(d.current,l),typeof u==`function`?u(d.current):u&&(u.current=d.current);let{editor:p}=bn(),m=t||p,h={updateDelay:n,resizeDelay:r,appendTo:i,pluginKey:f,shouldShow:a,getReferencedVirtualElement:o,options:s},g=(0,Q.useRef)(h);g.current=h;let[_,v]=(0,Q.useState)(!1),y=(0,Q.useRef)(!0);return(0,Q.useEffect)(()=>{if(m?.isDestroyed)return;if(!m){console.warn(`BubbleMenu component is not rendered inside of an editor component or does not have editor prop.`);return}let e=d.current;e.style.visibility=`hidden`,e.style.position=`absolute`;let t=sO({...g.current,editor:m,element:e});m.registerPlugin(t);let n=g.current.pluginKey;return y.current=!0,v(!0),()=>{v(!1),m.unregisterPlugin(n),window.requestAnimationFrame(()=>{e.parentNode&&e.parentNode.removeChild(e)})}},[m]),(0,Q.useEffect)(()=>{if(!(!_||!m||m.isDestroyed)){if(y.current){y.current=!1;return}m.view.dispatch(m.state.tr.setMeta(f,{type:`updateOptions`,options:g.current}))}},[_,m,n,r,a,s,i,o,f]),(0,iT.createPortal)(c,d.current)});Q.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:r,appendTo:i,shouldShow:a=null,options:o,children:s,...c},l)=>{let u=(0,Q.useRef)(document.createElement(`div`)),d=(0,Q.useRef)(uO(e,`floatingMenu`)).current;PO(u.current,c),typeof l==`function`?l(u.current):l&&(l.current=u.current);let{editor:f}=bn(),p=t||f,m={updateDelay:n,resizeDelay:r,appendTo:i,pluginKey:d,shouldShow:a,options:o},h=(0,Q.useRef)(m);h.current=m;let[g,_]=(0,Q.useState)(!1),v=(0,Q.useRef)(!0);return(0,Q.useEffect)(()=>{if(p?.isDestroyed)return;if(!p){console.warn(`FloatingMenu component is not rendered inside of an editor component or does not have editor prop.`);return}let e=u.current;e.style.visibility=`hidden`,e.style.position=`absolute`;let t=lO({...h.current,editor:p,element:e});p.registerPlugin(t);let n=h.current.pluginKey;return v.current=!0,_(!0),()=>{_(!1),p.unregisterPlugin(n),window.requestAnimationFrame(()=>{e.parentNode&&e.parentNode.removeChild(e)})}},[p]),(0,Q.useEffect)(()=>{if(!(!g||!p||p.isDestroyed)){if(v.current){v.current=!1;return}p.view.dispatch(p.state.tr.setMeta(d,{type:`updateOptions`,options:h.current}))}},[g,p,n,r,a,o,i,d]),(0,iT.createPortal)(s,u.current)});var IO=[{name:`paragraph`,label:`Text`,icon:sg,isActive:e=>e.isActive(`paragraph`)&&!e.isActive(`list`),command:e=>e.chain().focus().setParagraph().run()},{name:`heading1`,label:`Heading 1`,icon:$e,isActive:e=>e.isActive(`heading`,{level:1}),command:e=>e.chain().focus().toggleHeading({level:1}).run()},{name:`heading2`,label:`Heading 2`,icon:Ue,isActive:e=>e.isActive(`heading`,{level:2}),command:e=>e.chain().focus().toggleHeading({level:2}).run()},{name:`heading3`,label:`Heading 3`,icon:de,isActive:e=>e.isActive(`heading`,{level:3}),command:e=>e.chain().focus().toggleHeading({level:3}).run()},{name:`bulletList`,label:`Bullet List`,icon:a,isActive:e=>e.isActive(`list`,{ordered:!1})&&!e.isActive(`listItem`,{checked:!0})&&!e.isActive(`listItem`,{checked:!1}),command:e=>e.chain().focus().toggleBulletList().run()},{name:`orderedList`,label:`Ordered List`,icon:nt,isActive:e=>e.isActive(`list`,{ordered:!0}),command:e=>e.chain().focus().toggleOrderedList().run()},{name:`taskList`,label:`Task List`,icon:ye,isActive:e=>e.isActive(`listItem`,{checked:!0})||e.isActive(`listItem`,{checked:!1}),command:e=>e.chain().focus().toggleTaskList().run()},{name:`blockquote`,label:`Quote`,icon:se,isActive:e=>e.isActive(`blockquote`),command:e=>e.chain().focus().toggleBlockquote().run()},{name:`codeBlock`,label:`Code Block`,icon:vg,isActive:e=>e.isActive(`codeBlock`),command:e=>e.chain().focus().toggleCodeBlock({language:`js`}).run()}];function LO(e){let t=(0,$.c)(18),{editor:n}=e,r;t[0]===n?r=t[1]:(r={editor:n,selector:RO},t[0]=n,t[1]=r);let{current:i,activeStates:a}=Kn(r),o=i.icon,s;t[2]===o?s=t[3]:(s=(0,Z.jsx)(o,{className:`size-3.5`}),t[2]=o,t[3]=s);let c;t[4]===i.label?c=t[5]:(c=(0,Z.jsx)(`span`,{children:i.label}),t[4]=i.label,t[5]=c);let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(Vo,{className:`size-3 opacity-50`}),t[6]=l):l=t[6];let u;t[7]!==s||t[8]!==c?(u=(0,Z.jsx)(Or,{asChild:!0,children:(0,Z.jsxs)(X,{variant:`ghost`,size:`sm`,className:`gap-1 px-2 text-sm font-medium text-accent-foreground/80`,children:[s,c,l]})}),t[7]=s,t[8]=c,t[9]=u):u=t[9];let d;t[10]!==a||t[11]!==n?(d=IO.map(e=>{let t=e.icon,r=a[e.name];return(0,Z.jsxs)(wr,{className:r?`bg-accent text-accent-foreground`:``,onSelect:()=>{e.command(n)},children:[(0,Z.jsx)(t,{className:`size-4`}),(0,Z.jsx)(`span`,{children:e.label})]},e.name)}),t[10]=a,t[11]=n,t[12]=d):d=t[12];let f;t[13]===d?f=t[14]:(f=(0,Z.jsx)(Mr,{align:`start`,sideOffset:8,className:`w-44 max-h-(--radix-dropdown-menu-content-available-height) overflow-y-auto subtle-scrollbar`,children:d}),t[13]=d,t[14]=f);let p;return t[15]!==u||t[16]!==f?(p=(0,Z.jsxs)(Pr,{children:[u,f]}),t[15]=u,t[16]=f,t[17]=p):p=t[17],p}function RO(e){let t=Object.fromEntries(IO.map(t=>[t.name,t.isActive(e.editor)]));return{current:IO.find(e=>t[e.name])??IO[0],activeStates:t}}var zO=`0 2px 4px rgba(0, 0, 0, 0.08)`,BO=150,VO=globalThis.ScrollTimeline;function HO(e,t,n,r,i){let a=r-i;if(a<=0)return null;let o=e+n-(t+56);return{startOffset:o,endOffset:o+a,maxShift:a}}var UO=new WeakMap;function WO(e){let t=UO.get(e);if(t){for(let e of t.animations)e.cancel();UO.delete(e)}}function GO(e){for(let t of Array.from(e.cells))WO(t)}var KO=e=>e.cellIndex===0?`3`:`2`;function qO(e,t){return JO(e,t,e=>({transform:`translateY(${e}px)`}))}function JO(e,t,n){if(!(t>0))return[{offset:0,...n(0)},{offset:1,...n(0)}];let r=t=>Math.max(0,Math.min(t-e.startOffset,e.maxShift));return Array.from(new Set([0,e.startOffset/t,e.endOffset/t,1].map(e=>Math.max(0,Math.min(e,1))))).sort((e,t)=>e-t).map(e=>({offset:e,...n(r(e*t))}))}function YO(e,t,n,r){if(!(t>0))return[{...n,offset:0},{...n,offset:1}];let i=e.startOffset/t;if(i<=0)return[{...r,offset:0},{...r,offset:1}];if(i>=1)return[{...n,offset:0},{...n,offset:1}];let a=Math.min(i+1/t,1);return[{...n,offset:0},{...n,offset:i},{...r,offset:a},{...r,offset:1}]}function XO(e,t,n){return YO(e,t,{zIndex:`auto`,boxShadow:`none`},{zIndex:n,boxShadow:zO})}function ZO(e,t){return YO(e,t,{opacity:`0`},{opacity:`1`})}function QO(e,t,n,r){let i=KO(e),a=`sd|${n.startOffset}|${n.maxShift}|${r}|${i}`,o=UO.get(e);if(o?.key===a)return;if(o)for(let e of o.animations)e.cancel();let s={timeline:t,fill:`both`,easing:`linear`},c=e.animate(qO(n,r),s),l=e.animate(XO(n,r,i),s),u=e.animate(ZO(n,r),{...s,pseudoElement:`::before`});UO.set(e,{key:a,animations:[c,l,u]})}function $O(e,t){let n=KO(e),r=`in|${t}|${n}`,i=UO.get(e);if(i?.key===r)return;if(i)for(let e of i.animations)e.cancel();let a=e.animate([{transform:`translateY(${t}px)`,zIndex:n,boxShadow:zO}],{duration:0,fill:`forwards`}),o=e.animate([{opacity:`1`}],{duration:0,fill:`forwards`,pseudoElement:`::before`});UO.set(e,{key:r,animations:[a,o]})}function ek(e,t,n,r){let i=e.getBoundingClientRect().top,a=e.scrollTop,o=e.scrollHeight-e.clientHeight,s=t.querySelectorAll(`.tableWrapper`);for(let e of s){r?.(e);let t=e.querySelector(`table`);if(!t)continue;let s=t.querySelector(`tbody`)?.rows[0];if(!s||!Array.from(s.cells).some(e=>e.tagName===`TH`))continue;let c=t.getBoundingClientRect(),l=s.getBoundingClientRect(),u=HO(a,i,c.top,c.height,l.height);if(!u){GO(s);continue}if(n){if(o<=0){GO(s);continue}for(let e of Array.from(s.cells))QO(e,n,u,o);continue}let d=Math.max(0,Math.min(a-u.startOffset,u.maxShift));if(d<=0||c.bottom<=i+56){GO(s);continue}for(let e of Array.from(s.cells))$O(e,d)}}var tk=Hi.create({name:`frozenTableHeaders`,addProseMirrorPlugins(){return[new ja({key:new fa(`frozenTableHeaders`),view(e){let t=null,n=null,r=null,i=null,a=null,o=!1,s=new Set,c=()=>{o||!t||ek(t,e.dom,n,u)},l=()=>{r??=requestAnimationFrame(()=>{r=null,c()})};function u(e){s.has(e)||(s.add(e),e.addEventListener(`contentvisibilityautostatechange`,l))}let d=()=>{if(n){i??l(),i!=null&&clearTimeout(i),i=setTimeout(()=>{i=null,c()},BO);return}l()};return requestAnimationFrame(()=>{if(!o){if(t=e.dom.closest(`[data-testid="editor-scroll-container"]`),t&&VO)try{n=new VO({source:t,axis:`block`})}catch{n=null}t?.addEventListener(`scroll`,d,{passive:!0}),t&&typeof ResizeObserver<`u`&&(a=new ResizeObserver(l),a.observe(t),a.observe(e.dom)),c()}}),{update(e,t){t.doc.eq(e.state.doc)||c()},destroy(){o=!0,t?.removeEventListener(`scroll`,d),a?.disconnect(),r!=null&&cancelAnimationFrame(r),i!=null&&clearTimeout(i);for(let e of s)e.removeEventListener(`contentvisibilityautostatechange`,l);s.clear();for(let t of e.dom.querySelectorAll(`.tableWrapper > table > tbody > tr:first-child`))GO(t)}}}})]}});function nk(e){return()=>{let t=null;try{t=e.view.dom.closest(`.editor-doc-scroll`)}catch{}let n={top:56,bottom:rk(`--ask-composer-height`)+rk(`--conflict-footer-height`)};return t?{boundary:t,padding:n}:{padding:n}}}function rk(e){let t=Number.parseFloat(document.documentElement.style.getPropertyValue(e));return Number.isFinite(t)?t:0}function ik(e){let t=e.state.selection.node;if(!t||t.type.name!==`jsxComponent`)return null;let n=t.attrs.componentName;if(n!==`File`&&n!==`WikiEmbedFile`)return null;let r=(t.attrs.props??{}).src;return typeof r!=`string`||r.length===0?null:r}function ak(e){let t=e.state.selection.node;if(!t)return``;let n=t.attrs.props??{},r=typeof n.alias==`string`?n.alias:``;if(r.length>0)return r;let i=typeof n.name==`string`?n.name:``;return i.length>0?i:pt(typeof n.src==`string`?n.src:``)}function ok(e,t){let n=document.createElement(`a`);n.href=e,n.download=t,n.rel=`noopener noreferrer`,n.style.display=`none`,document.body.appendChild(n),n.click(),n.remove()}function sk(e){let t=(0,$.c)(13),{editor:n}=e,{_:r}=gt(),i;if(t[0]===n?i=t[1]:(i={editor:n,selector:ck},t[0]=n,t[1]=i),Kn(i)===null)return null;let a;t[2]===r?a=t[3]:(a=r({id:`WcWS__`}),t[2]=r,t[3]=a);let o;t[4]===n?o=t[5]:(o=e=>{e.preventDefault();let t=ik(n);t&&ok(t,ak(n))},t[4]=n,t[5]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(ac,{className:`size-3.5`}),t[6]=s):s=t[6];let c;t[7]!==a||t[8]!==o?(c=(0,Z.jsx)(on,{asChild:!0,children:(0,Z.jsx)(X,{variant:`ghost`,size:`icon-xs`,"aria-label":a,className:`text-accent-foreground`,onMouseDown:o,children:s})}),t[7]=a,t[8]=o,t[9]=c):c=t[9];let l;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(sn,{side:`bottom`,sideOffset:8,children:(0,Z.jsx)(J,{id:`WcWS__`})}),t[10]=l):l=t[10];let u;return t[11]===c?u=t[12]:(u=(0,Z.jsx)(`div`,{className:`flex items-center gap-0.5`,children:(0,Z.jsxs)(ln,{children:[c,l]})}),t[11]=c,t[12]=u),u}function ck(e){return ik(e.editor)}function lk(e){return ik(e)!==null}var uk=`img, .ok-embed, .ok-video`,dk=220,fk=`cubic-bezier(0.23, 1, 0.32, 1)`,pk=`ok-image-align-flip`,mk=.5;function hk(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function gk(){return typeof requestAnimationFrame==`function`}function _k(e){return e?e.querySelector(uk):null}function vk(e,t){if(hk()||!gk()){t();return}let n=_k(e);if(!n){t();return}let r=n.getBoundingClientRect().left;t(),requestAnimationFrame(()=>{let t=_k(e);if(!t)return;for(let e of t.getAnimations())e.id===pk&&e.cancel();let n=r-t.getBoundingClientRect().left;if(Math.abs(n)<mk)return;let i=t.animate([{transform:`translateX(${n}px)`},{transform:`translateX(0)`}],{duration:dk,easing:fk,fill:`none`});i.id=pk})}var yk=[{value:`left`,label:`Align left`,icon:Dg},{value:`center`,label:`Align center`,icon:Tg},{value:`right`,label:`Align right`,icon:Eg}];function bk(e){let t=e.state.selection.node;if(!t||t.type.name!==`jsxComponent`)return null;let n=t.attrs.componentName;if(!dt.has(String(n)))return null;let r=(t.attrs.props??{}).align;return r===`left`||r===`right`||r===`center`?r:`center`}function xk(e){let t=(0,$.c)(7),{editor:n}=e,r;t[0]===n?r=t[1]:(r={editor:n,selector:Sk},t[0]=n,t[1]=r);let i=Kn(r);if(i===null)return null;let a;t[2]!==i||t[3]!==n?(a=yk.map(e=>{let{value:t,label:r,icon:a}=e,o=i===t;return(0,Z.jsxs)(ln,{children:[(0,Z.jsx)(on,{asChild:!0,children:(0,Z.jsx)(X,{variant:`ghost`,size:`icon-xs`,"aria-label":r,"aria-pressed":o,className:o?`bg-accent text-primary`:`text-accent-foreground`,onMouseDown:e=>{e.preventDefault();let r=n.state.selection,i=r.node;if(!i||i.type.name!==`jsxComponent`)return;let a=String(i.attrs.componentName??``);if(!dt.has(a)||i.attrs.kind!==`element`)return;let o=a===`CommonMarkImage`,s=r.from,c={...i.attrs.props??{},align:t},l=o?{...i.attrs,componentName:`img`,props:c,sourceDirty:!0}:{...i.attrs,props:c,sourceDirty:!0},u=n.state.tr.setNodeMarkup(s,null,l);u.setSelection(Ja.create(u.doc,s)),vk(n.view.nodeDOM(s),()=>{n.view.dispatch(u)})},children:(0,Z.jsx)(a,{className:`size-3.5`})})}),(0,Z.jsx)(sn,{side:`bottom`,sideOffset:8,children:r})]},t)}),t[2]=i,t[3]=n,t[4]=a):a=t[4];let o;return t[5]===a?o=t[6]:(o=(0,Z.jsx)(`div`,{className:`flex items-center gap-0.5`,children:a}),t[5]=a,t[6]=o),o}function Sk(e){return bk(e.editor)}function Ck(e){return bk(e)!==null}function wk({editor:e}){if(_(e.state).query||e.isActive(`codeBlock`))return!1;if(Ck(e)||lk(e))return!0;if(e.state.selection.empty)return!1;let{from:t,to:n}=e.state.selection;return!!e.state.doc.textBetween(t,n,` `).trim()}function Tk(e){throw Error(`Unhandled AddLinkShortcutAction variant: ${JSON.stringify(e)}`)}function Ek(e){let{selection:t}=e.state;if(t.empty){if(!e.isActive(`link`))return null;let n=y(e.state,t.from,`link`);return n===null?null:{kind:`edit-link`,markId:n}}return!wk({editor:e})||Ck(e)||lk(e)?null:{kind:`open-popover`}}function Dk(e,t){return ao({relativePath:nc(e),instruction:``,selectionMarkdown:t,target:`claude-code`})}function Ok(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName.toUpperCase();return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`}function kk(e){let t=(0,$.c)(3),{editor:n,shortcutEnabled:r}=e,i=r===void 0?!1:r;if(ec())return null;let a;return t[0]!==n||t[1]!==i?(a=(0,Z.jsx)(Ak,{editor:n,shortcutEnabled:i}),t[0]=n,t[1]=i,t[2]=a):a=t[2],a}function Ak(e){let t=(0,$.c)(11),{editor:n,shortcutEnabled:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=Pi(),t[0]=i):i=t[0];let a=i,o,s;t[1]===r?(o=t[2],s=t[3]):(o=()=>{if(!a)return;let e=e=>{r&&El(e,`edit-with-ai`)&&(Ok(e.target)||(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),j()))};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},s=[r,a],t[1]=r,t[2]=o,t[3]=s),(0,Q.useEffect)(o,s);let c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(Vr,{orientation:`vertical`,className:`mx-0.5 h-5 data-vertical:self-center`}),t[4]=c):c=t[4];let l;t[5]===n?l=t[6]:(l=()=>{let e=Yn(n),t=U(n);requestAnimationFrame(()=>{if(e===null||t.trim()===``){j();return}Jt(Dk(e,t),{submit:!0})})},t[5]=n,t[6]=l);let u,d;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(Zs,{className:`size-3.5`,"aria-hidden":`true`}),d=(0,Z.jsx)(`span`,{children:(0,Z.jsx)(J,{id:`xWEvuo`})}),t[7]=u,t[8]=d):(u=t[7],d=t[8]);let f;return t[9]===l?f=t[10]:(f=(0,Z.jsxs)(Z.Fragment,{children:[c,(0,Z.jsxs)(X,{type:`button`,variant:`ghost`,size:`sm`,"data-testid":`edit-with-ai-bubble-button`,className:`gap-1 px-2 text-sm font-medium text-accent-foreground/80`,onClick:l,children:[u,d]})]}),t[9]=l,t[10]=f),f}function jk(e){let t=e.schema.nodes;return!!(t.footnoteReference&&t.footnoteDefinition)}function Mk(e){let{from:t,to:n}=e.state.selection,r=!1;return e.state.doc.nodesBetween(t,n,e=>e.type.name===`footnoteReference`?(r=!0,!1):!0),r}function Nk(e){let{$from:t,$to:n}=e.state.selection;return!t.sameParent(n)}function Pk(e){let t=(0,$.c)(21),{editor:n}=e,{_:r}=gt(),i;t[0]===n?i=t[1]:(i={editor:n,selector:Fk},t[0]=n,t[1]=i);let a=Kn(i),o;t[2]!==a||t[3]!==n?(o=()=>{if(a||!jk(n)||n.state.selection.empty||Nk(n)||Mk(n))return;let{from:e,to:t}=n.state.selection,r=n.state.doc.textBetween(e,t,` `);if(!r.trim())return;let i=Vi(Oa(n.state.doc)),o=ki(n.state.doc)+1-(t-e);n.chain().focus().deleteSelection().insertFootnoteReference(i).insertContentAt(o,{type:`footnoteDefinition`,attrs:{identifier:i,label:i},content:[{type:`paragraph`,content:[{type:`text`,text:r}]}]}).run()},t[2]=a,t[3]=n,t[4]=o):o=t[4];let s=o,c;t[5]===r?c=t[6]:(c=r({id:`sIGbBZ`}),t[5]=r,t[6]=c);let l;t[7]===s?l=t[8]:(l=e=>{e.preventDefault(),s()},t[7]=s,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(w,{className:`size-3.5`,"aria-hidden":`true`}),t[9]=u):u=t[9];let d;t[10]!==a||t[11]!==c||t[12]!==l?(d=(0,Z.jsx)(on,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-xs`,"data-testid":`footnote-bubble-button`,className:`text-accent-foreground/80`,"aria-label":c,onMouseDown:l,disabled:a,children:u})}),t[10]=a,t[11]=c,t[12]=l,t[13]=d):d=t[13];let f;t[14]===r?f=t[15]:(f=r({id:`sIGbBZ`}),t[14]=r,t[15]=f);let p;t[16]===f?p=t[17]:(p=(0,Z.jsx)(sn,{side:`bottom`,sideOffset:8,children:f}),t[16]=f,t[17]=p);let m;return t[18]!==d||t[19]!==p?(m=(0,Z.jsxs)(ln,{children:[d,p]}),t[18]=d,t[19]=p,t[20]=m):m=t[20],m}function Fk(e){let t=e.editor;return!!(!jk(t)||t.state.selection.empty||Nk(t)||Mk(t))}var Ik=[{name:`bold`,icon:Ch,command:e=>e.chain().focus().toggleBold().run(),isActive:e=>e.isActive(`strong`),shortcutId:`format-bold`},{name:`italic`,icon:qh,command:e=>e.chain().focus().toggleItalic().run(),isActive:e=>e.isActive(`emphasis`),shortcutId:`format-italic`},{name:`underline`,icon:Mg,command:e=>e.chain().focus().toggleUnderline().run(),isActive:e=>e.isActive(`underline`),shortcutId:`format-underline`},{name:`strikethrough`,icon:Sg,command:e=>e.chain().focus().toggleStrike().run(),isActive:e=>e.isActive(`strike`),shortcutId:`format-strike`},{name:`code`,icon:at,command:e=>e.chain().focus().toggleCode().run(),isActive:e=>e.isActive(`code`),shortcutId:`format-inline-code`},{name:`highlight`,icon:Kh,command:e=>e.chain().focus().toggleHighlight().run(),isActive:e=>e.isActive(`highlight`),shortcutId:`format-highlight`}];function Lk(e){let t=(0,$.c)(7),{editor:n}=e,r;t[0]===n?r=t[1]:(r={editor:n,selector:Rk},t[0]=n,t[1]=r);let i=Kn(r),a;t[2]!==i||t[3]!==n?(a=Ik.map(e=>{let t=e.icon,r=i[e.name];return(0,Z.jsxs)(ln,{children:[(0,Z.jsx)(on,{asChild:!0,children:(0,Z.jsx)(X,{variant:`ghost`,size:`icon-xs`,"aria-label":e.name,className:r?`bg-accent text-primary`:`text-accent-foreground`,onMouseDown:t=>{t.preventDefault(),e.command(n)},children:(0,Z.jsx)(t,{className:`size-3.5`})})}),(0,Z.jsxs)(sn,{side:`bottom`,sideOffset:8,children:[(0,Z.jsx)(`span`,{className:`capitalize`,children:e.name}),(0,Z.jsx)(p,{"aria-label":jl(e.shortcutId),children:Pl(e.shortcutId)})]})]},e.name)}),t[2]=i,t[3]=n,t[4]=a):a=t[4];let o;return t[5]===a?o=t[6]:(o=(0,Z.jsx)(`div`,{className:`flex items-center gap-0.5`,children:a}),t[5]=a,t[6]=o),o}function Rk(e){return Object.fromEntries(Ik.map(t=>[t.name,t.isActive(e.editor)]))}var zk=`open-knowledge:open-link-edit-popover`;function Bk(e=typeof window>`u`?new EventTarget:window){e.dispatchEvent(new CustomEvent(zk))}function Vk(e,t=typeof window>`u`?new EventTarget:window){let n=()=>e();return t.addEventListener(zk,n),()=>t.removeEventListener(zk,n)}function Hk(e){return e.state.selection.empty&&e.isActive(`link`)?e.getAttributes(`link`).href??``:``}async function Uk(e,t){let n;try{n=await navigator.clipboard.readText()}catch(e){e instanceof DOMException||console.warn(`[link-popover] clipboard pre-fill read failed unexpectedly`,e);return}let r=Me(n);r!==null&&(t(e=>e===``?r:e),requestAnimationFrame(()=>{let t=e.current;t&&t.value===r&&t.select()}))}function Wk(e,t,n,r){let i=Hk(e);n(i),r(!0),i===``&&Uk(t,n)}function Gk(e){let t=(0,$.c)(72),{editor:n,shortcutEnabled:r}=e,i=r===void 0?!1:r,{_:a}=gt(),[o,s]=(0,Q.useState)(!1),[l,u]=(0,Q.useState)(``),d=(0,Q.useRef)(null),{folderPaths:f,loading:m,pages:h}=Go(),g;t[0]===n?g=t[1]:(g=n.state.selection.empty&&n.isActive(`link`),t[0]=n,t[1]=g);let _=g,v;t[2]===n?v=t[3]:(v=n.getAttributes(`link`).href??``,t[2]=n,t[3]=v);let y=v,b,x;t[4]!==n||t[5]!==i?(b=()=>Vk(()=>{i&&Wk(n,d,u,s)}),x=[i,n],t[4]=n,t[5]=i,t[6]=b,t[7]=x):(b=t[6],x=t[7]),(0,Q.useEffect)(b,x);let S,C;t[8]!==n||t[9]!==i?(S=()=>{let e=e=>{if(!i||!El(e,`add-link`)||!n.editorView?.hasFocus())return;let t=Ek(n);if(t!==null)switch(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),t.kind){case`open-popover`:Bk();return;case`edit-link`:{let{markId:e}=t;G(e),requestAnimationFrame(()=>{c(n).setActiveNode(e)});return}default:Tk(t)}};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},C=[i,n],t[8]=n,t[9]=i,t[10]=S,t[11]=C):(S=t[10],C=t[11]),(0,Q.useEffect)(S,C);let w,T;t[12]===n?(w=t[13],T=t[14]):(w=()=>{let e=function(){n.state.selection.empty&&s(!1)};return n.on(`selectionUpdate`,e),()=>{n.off(`selectionUpdate`,e)}},T=[n],t[12]=n,t[13]=w,t[14]=T),(0,Q.useEffect)(w,T);let E,D;t[15]===o?(E=t[16],D=t[17]):(E=()=>{if(!o)return;let e=!1,t=0,n=r=>{if(e)return;let i=d.current;i&&(i.focus(),document.activeElement===i)||(r<60?t=requestAnimationFrame(()=>n(r+1)):console.warn(`[link-popover] URL input never became focusable`))};return t=requestAnimationFrame(()=>n(0)),()=>{e=!0,cancelAnimationFrame(t)}},D=[o],t[15]=o,t[16]=E,t[17]=D),(0,Q.useEffect)(E,D);let O;t[18]!==n||t[19]!==_||t[20]!==l?(O=function(){l.trim()?n.chain().focus().setLink({href:l.trim()}).run():_&&n.chain().focus().unsetLink().run(),s(!1)},t[18]=n,t[19]=_,t[20]=l,t[21]=O):O=t[21];let k=O,A;t[22]===n?A=t[23]:(A=function(){n.chain().focus().unsetLink().run(),s(!1)},t[22]=n,t[23]=A);let j=A,M;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(M=function(e){u(Un(e.path,null))},t[24]=M):M=t[24];let N=M,P;t[25]!==k||t[26]!==n?(P=function(e){e.key===`Enter`&&(e.preventDefault(),k()),e.key===`Escape`&&(e.preventDefault(),s(!1),n.chain().focus().run())},t[25]=k,t[26]=n,t[27]=P):P=t[27];let F=P;if(o){let e;t[28]===a?e=t[29]:(e=a({id:`ZsGpr_`}),t[28]=a,t[29]=e);let n;t[30]===a?n=t[31]:(n=a({id:`roAe2K`}),t[30]=a,t[31]=n);let r;t[32]!==f||t[33]!==F||t[34]!==m||t[35]!==h||t[36]!==e||t[37]!==n||t[38]!==l?(r=(0,Z.jsx)(V,{ref:d,type:`text`,placeholder:e,value:l,pages:h,folderPaths:f,loading:m,onValueChange:u,onSuggestionSelect:N,onKeyDown:F,"aria-label":n,className:`h-5 w-44 rounded-none border-none bg-transparent px-0 py-0 text-sm placeholder:text-muted-foreground focus-visible:border-transparent focus-visible:ring-0 dark:bg-transparent`}),t[32]=f,t[33]=F,t[34]=m,t[35]=h,t[36]=e,t[37]=n,t[38]=l,t[39]=r):r=t[39];let i;t[40]===a?i=t[41]:(i=a({id:`tP5DDk`}),t[40]=a,t[41]=i);let o;t[42]===k?o=t[43]:(o=()=>{k()},t[42]=k,t[43]=o);let s;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(Ah,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[44]=s):s=t[44];let c;t[45]!==i||t[46]!==o?(c=(0,Z.jsx)(X,{variant:`ghost`,size:`icon-xs`,"aria-label":i,onClick:o,children:s}),t[45]=i,t[46]=o,t[47]=c):c=t[47];let p;t[48]!==r||t[49]!==c?(p=(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5 rounded-md border bg-background px-2 py-1 focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50`,children:[r,c]}),t[48]=r,t[49]=c,t[50]=p):p=t[50];let g;t[51]!==a||t[52]!==y||t[53]!==_||t[54]!==j?(g=_&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(ln,{children:[(0,Z.jsx)(on,{asChild:!0,children:(0,Z.jsx)(X,{variant:`ghost`,size:`icon-xs`,"aria-label":a({id:`2vIPtm`}),onMouseDown:e=>{e.preventDefault(),Nn(y)},children:(0,Z.jsx)(bo,{className:`size-3.5`})})}),(0,Z.jsx)(sn,{side:`bottom`,sideOffset:8,children:(0,Z.jsx)(J,{id:`2vIPtm`})})]}),(0,Z.jsxs)(ln,{children:[(0,Z.jsx)(on,{asChild:!0,children:(0,Z.jsx)(X,{variant:`ghost`,size:`icon-xs`,"aria-label":a({id:`484LKL`}),onMouseDown:e=>{e.preventDefault(),j()},children:(0,Z.jsx)(ll,{className:`size-3.5`})})}),(0,Z.jsx)(sn,{side:`bottom`,sideOffset:8,children:(0,Z.jsx)(J,{id:`484LKL`})})]})]}),t[51]=a,t[52]=y,t[53]=_,t[54]=j,t[55]=g):g=t[55];let v;return t[56]!==p||t[57]!==g?(v=(0,Z.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[p,g]}),t[56]=p,t[57]=g,t[58]=v):v=t[58],v}let I;t[59]===a?I=t[60]:(I=a({id:`p0Iq25`}),t[59]=a,t[60]=I);let L=_?`bg-accent text-primary`:`text-accent-foreground`,R;t[61]===n?R=t[62]:(R=e=>{e.preventDefault(),Wk(n,d,u,s)},t[61]=n,t[62]=R);let z;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Z.jsx)(Yh,{className:`size-3.5`}),t[63]=z):z=t[63];let B;t[64]!==I||t[65]!==L||t[66]!==R?(B=(0,Z.jsx)(on,{asChild:!0,children:(0,Z.jsx)(X,{variant:`ghost`,size:`icon-xs`,"aria-label":I,className:L,onMouseDown:R,children:z})}),t[64]=I,t[65]=L,t[66]=R,t[67]=B):B=t[67];let H;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,Z.jsx)(J,{id:`yzF66j`}),t[68]=H):H=t[68];let U;t[69]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Z.jsxs)(sn,{side:`bottom`,sideOffset:8,children:[H,(0,Z.jsx)(p,{children:Pl(`add-link`)})]}),t[69]=U):U=t[69];let W;return t[70]===B?W=t[71]:(W=(0,Z.jsxs)(ln,{children:[B,U]}),t[70]=B,t[71]=W),W}function Kk(e){let t=(0,$.c)(30),{editor:n,shortcutEnabled:r}=e,i=r===void 0?!0:r,a=(0,Q.useRef)(null),[o,s]=(0,Q.useState)(0),c=(0,Q.useRef)(null),l;t[0]===n?l=t[1]:(l={editor:n,selector:Zk},t[0]=n,t[1]=l);let u=Kn(l),d;t[2]===n?d=t[3]:(d={editor:n,selector:Xk},t[2]=n,t[3]=d);let f=Kn(d),p;t[4]!==n.state||t[5]!==n.view?(p=()=>{try{let{from:e,to:t}=n.state.selection;return aa(n.view,e,t)}catch{return new DOMRect}},t[4]=n.state,t[5]=n.view,t[6]=p):p=t[6];let m;t[7]!==n.view.dom||t[8]!==p?(m={getBoundingClientRect:p,contextElement:n.view.dom},t[7]=n.view.dom,t[8]=p,t[9]=m):m=t[9];let h=m,g;t[10]===n?g=t[11]:(g=nk(n),t[10]=n,t[11]=g);let _=g,v;t[12]!==_||t[13]!==h?(v=()=>{let e=a.current;e&&(c.current?.(),c.current=rr(h,e,()=>{$n(h,e,{placement:`top`,strategy:`fixed`,middleware:[er(8),Zn(_),or({padding:8}),nr(_)]}).then(t=>{let{x:n,y:r,middlewareData:i}=t;e.isConnected&&(e.style.position=`fixed`,e.style.left=`${n}px`,e.style.top=`${r}px`,e.style.visibility=i.hide?.referenceHidden?`hidden`:`visible`)}).catch(Yk)}))},t[12]=_,t[13]=h,t[14]=v):v=t[14];let y=v,b;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(b=()=>{c.current?.(),c.current=null,s(Jk)},t[15]=b):b=t[15];let x=b,S;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(S={padding:8},t[16]=S):S=t[16];let C;t[17]!==_||t[18]!==y?(C={onShow:y,onHide:x,strategy:`fixed`,flip:_,shift:S,hide:_},t[17]=_,t[18]=y,t[19]=C):C=t[19];let w;t[20]!==n||t[21]!==f||t[22]!==u||t[23]!==i||t[24]!==o?(w=u?(0,Z.jsx)(xk,{editor:n},`${o}-img-align`):f?(0,Z.jsx)(sk,{editor:n},`${o}-file`):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(LO,{editor:n}),(0,Z.jsx)(Vr,{orientation:`vertical`,className:`mx-0.5 h-5 data-vertical:self-center`}),(0,Z.jsx)(Lk,{editor:n},o),(0,Z.jsx)(Vr,{orientation:`vertical`,className:`mx-0.5 h-5 data-vertical:self-center`}),(0,Z.jsx)(Gk,{editor:n,shortcutEnabled:i},`${o}-link`),(0,Z.jsx)(Pk,{editor:n},`${o}-footnote`),(0,Z.jsx)(kk,{editor:n,shortcutEnabled:i},`${o}-edit-ai`)]}),t[20]=n,t[21]=f,t[22]=u,t[23]=i,t[24]=o,t[25]=w):w=t[25];let T;return t[26]!==n||t[27]!==C||t[28]!==w?(T=(0,Z.jsx)(FO,{ref:a,editor:n,"data-testid":`bubble-menu-bar`,appendTo:qk,shouldShow:wk,updateDelay:250,options:C,className:`z-50 flex items-center gap-0.5 rounded-lg border bg-background p-1 shadow-md`,children:w}),t[26]=n,t[27]=C,t[28]=w,t[29]=T):T=t[29],T}function qk(){return document.body}function Jk(e){return e+1}function Yk(){}function Xk(e){return lk(e.editor)}function Zk(e){return Ck(e.editor)}var Qk=new fa(`markdownLintDecorations`),$k=`ok-lint-block`,eA=`ok-lint-block-error`,tA=`ok-lint-block-atom`,nA=400;function rA(e,t){let{frontmatter:n,body:r}=pa(e),i=n===``?0:n.split(`
10
+ `).length-1;return{spans:t.parseToMdast(r).children.map(e=>({start:(e.position?.start.line??1/0)+i,end:(e.position?.end.line??-1/0)+i})),fmLineCount:i}}function iA(e,t){let n=e.findIndex(e=>t>=e.start&&t<=e.end);if(n>=0)return n;let r=e.findIndex(e=>e.start>t);return r>=0?r:e.length>0?e.length-1:null}function aA(e,t,n){let r=new Map;if(t.length===0)return r;let{spans:i,fmLineCount:a}=rA(e,n);for(let e of t){let t=e.range.start.line+1;if(a>0&&t<=a)continue;let n=iA(i,t);if(n===null)continue;let o=r.get(n);o?o.push(e):r.set(n,[e])}return r}function oA(e){let t=e.childCount>0?e.child(e.childCount-1):null;return t!==null&&t.type.name===`paragraph`&&t.content.size===0?e.childCount-1:e.childCount}var sA=`data-ok-lint`,cA=`data-ok-lint-fixable`;function lA(e,t){let n=new Map;if(t.size===0)return{set:Ta.empty,fixesByOffset:n};let r=[],i=0;return e.forEach((e,a)=>{let o=t.get(i);if(i+=1,!o||o.length===0)return;let s=o.some(e=>e.severity===`error`),c=o.map(e=>`${e.source}/${e.code}: ${e.message}`).join(`
11
+ `),l=[$k];e.textContent.length===0&&l.push(tA),s&&l.push(eA);let u={class:l.join(` `),[sA]:c},d=ix(o);d.length>0&&(u[cA]=`1`,n.set(a,d)),r.push(di.node(a,a+e.nodeSize,u))}),{set:Ta.create(e,r),fixesByOffset:n}}function uA(e,t){let n=document.createElement(`div`);n.className=`ok-lint-tooltip`,n.hidden=!0;let r=document.createElement(`div`);r.className=`ok-lint-tooltip-message`,n.appendChild(r);let i=document.createElement(`button`);i.type=`button`,i.className=Y(`ok-lint-tooltip-fix`,Qt({variant:`default`,size:`xs`}),`mt-1 self-start`),i.hidden=!0,n.appendChild(i),n.style.position=`fixed`,n.style.top=`0`,n.style.left=`0`,document.body.appendChild(n);let a=null,o=!1,s=null,c=null,l=0,u=0,d={getBoundingClientRect:()=>({width:0,height:0,x:l,y:u,top:u,left:l,right:l,bottom:u})};function f(){s!==null&&(clearTimeout(s),s=null)}function p(){f(),a=null,n.hidden=!0,c?.(),c=null}function m(){o||(f(),s=setTimeout(p,140))}function h(){$n(d,n,{placement:`top-start`,middleware:[er(6),Zn(),or({padding:8})]}).then(({x:e,y:t})=>{n.isConnected&&(n.style.left=`${e}px`,n.style.top=`${t}px`)}).catch(e=>{n.isConnected&&console.warn(`[markdown-lint] tooltip computePosition failed`,e)})}function g(e){let s=e.getAttribute(sA);if(!s){m();return}f(),a=e,r.textContent=s;let l=t.applyFix?t.getFixes(e):[];l.length>0&&t.applyFix?(i.hidden=!1,i.textContent=Cl._({id:`c4fVUV`}),i.onclick=()=>{t.applyFix?.(l),o=!1,p()}):(i.hidden=!0,i.onclick=null),n.hidden=!1,c?.(),c=rr(d,n,h)}function _(e){let t=e,n=e.target?.closest(`.${$k}`)??null;n?n===a?f():(l=t.clientX,u=t.clientY,g(n)):a&&m()}function v(e){let t=e.relatedTarget;if(t===n||t?.closest(`.ok-lint-tooltip`)){f();return}t?.closest(`.${$k}`)||m()}function y(){o=!0,f()}function b(e){o=!1;let t=e.relatedTarget;t!==a&&!t?.closest(`.${$k}`)&&m()}return n.addEventListener(`pointerenter`,y),n.addEventListener(`pointerleave`,b),e.dom.addEventListener(`pointerover`,_),e.dom.addEventListener(`pointerout`,v),{destroy(){f(),c?.(),e.dom.removeEventListener(`pointerover`,_),e.dom.removeEventListener(`pointerout`,v),n.remove()}}}var dA=Hi.create({name:`markdownLintDecorations`,addOptions(){return{docName:``,getSource:void 0,applyFix:void 0}},addProseMirrorPlugins(){let{docName:e,getSource:t,applyFix:n}=this.options,r=new Ba({extensions:$a});return[new ja({key:Qk,state:{init:()=>Ta.empty,apply(e,t){return e.getMeta(Qk)||t.map(e.mapping,e.doc)}},props:{decorations(e){return Qk.getState(e)??null}},view(i){let a=null,o=null,s=!1,c=0,l=new Map;async function u(){if(s)return;let n=t?.()??null,r=a?.enabled?await d(a):{kind:`ok`,set:Ta.empty,fixesByOffset:new Map};if(s||r.kind===`stale`)return;if(r.kind===`mismatch`){c<2&&(c+=1,f());return}c=0,l=r.fixesByOffset;let o=r.set,u=Qk.getState(i.state)??Ta.empty;if((o.find().length>0||u.find().length>0)&&i.dispatch(i.state.tr.setMeta(Qk,o)),a?.enabled){let t=xd(e);t?.kind===`lint`&&g(t.detail)&&Id(e)}n!==null&&!s&&t?.()!==n&&f()}async function d(n){let a=i.state.doc,o=t?.()??r.serialize(a.toJSON()),s=await xi(o,n,e);if(!i.state.doc.eq(a))return{kind:`stale`};let{spans:c}=rA(o,r);return c.length===oA(a)?{kind:`ok`,...lA(a,aA(o,s,r))}:{kind:`mismatch`}}function f(){o&&clearTimeout(o),o=setTimeout(()=>{u().catch(e=>{console.warn(`[markdown-lint] decoration pass failed`,e)})},nA)}let p=0;async function m(){let t=++p,n=await Xd(e);s||t!==p||(a=n,await u())}let h=()=>{m().catch(e=>{console.warn(`[markdown-lint] config load/lint pass failed`,e)})};function g(e){if(!i.dom.isConnected||i.dom.offsetParent===null)return!1;let{spans:n,fmLineCount:a}=rA(t?.()??r.serialize(i.state.doc.toJSON()),r);if(n.length!==oA(i.state.doc)||a>0&&e.line<=a)return!1;let o=iA(n,e.line);if(o===null)return!1;let s=-1;if(i.state.doc.forEach((e,t,n)=>{n===o&&(s=t)}),s<0)return!1;i.dispatch(i.state.tr.setSelection(ya.near(i.state.doc.resolve(s+1)))),i.focus();let c=i.nodeDOM(s);return c instanceof HTMLElement&&c.scrollIntoView({behavior:`smooth`,block:`start`}),!0}function _(t){let n=t.detail;!n||s||g(n)&&Id(e)}h();let v=Yd(h),y=uA(i,{getFixes:e=>{if(e.getAttribute(cA)!==`1`||l.size===0)return[];let t;try{t=i.posAtDOM(e,0)}catch(e){return console.warn(`[markdown-lint] posAtDOM failed on lint block; Fix button suppressed`,e),[]}let n=Math.min(Math.max(t,0),i.state.doc.content.size),r=i.state.doc.resolve(n),a=r.depth>=1?r.before(1):0;return l.get(a)??[]},applyFix:n});window.addEventListener(Sd,_);let b=()=>{s||f()};return window.addEventListener(tx,b),{update(e,t){e.state.doc.eq(t.doc)||f()},destroy(){s=!0,o&&clearTimeout(o),v(),y.destroy(),window.removeEventListener(Sd,_),window.removeEventListener(tx,b)}}}})]}}),fA=1400,pA=new fa(`okAgentInsertFlash`);function mA(e,t){let n=e.content.findDiffStart(t.content);if(n==null)return null;let r=e.content.findDiffEnd(t.content),i=t.content.size,a=Math.max(0,Math.min(n,i)),o=Math.max(a,Math.min(r?.b??i,i));return o<=a?null:{from:a,to:o}}var hA=6e3;function gA(e,t,n){let r=e.childCount,i=Math.max(0,Math.min(t,r)),a=Math.max(i,Math.min(n,r));if(a<=i)return null;let o=0;for(let t=0;t<i;t++)o+=e.child(t).nodeSize;let s=o;for(let t=i;t<a;t++)o+=e.child(t).nodeSize;let c=o,l=e.content.size,u=Math.max(0,Math.min(s,l)),d=Math.max(u,Math.min(c,l));return d<=u?null:{from:u,to:d}}function _A(){return new ja({key:pA,state:{init:()=>Ta.empty,apply(e,t){let n=t.map(e.mapping,e.doc),r=e.getMeta(pA);if(r===void 0)return n;if(r.sweep===!0){let e=n.find().filter(e=>r.now-(e.spec.addedAt??0)>=fA);e.length>0&&(n=n.remove(e))}if(r.add!==void 0&&r.add.to>r.add.from){let t={addedAt:r.now};n=n.add(e.doc,[di.inline(r.add.from,r.add.to,{class:`ok-agent-insert-flash`},t)])}return n}},props:{decorations(e){return pA.getState(e)}}})}function vA(e,t){return(n,r)=>{let i=r,a=Mf(i.dataTransfer);return a?(i.preventDefault(),t?.(a),!0):e(n,i)}}function yA(e,t){let n=Af(e);t(n.target,{tabBehavior:`append`}),xu(n.hash)}var bA=5,xA=1;function SA(e){let t=(0,$.c)(14),{editor:n,axis:r,anchor:i,onClickGesture:a}=e,o=(0,Q.useRef)(null),s=(0,Q.useRef)(null),c=(0,Q.useRef)(a),l,u;t[0]===a?(l=t[1],u=t[2]):(l=()=>{c.current=a},u=[a],t[0]=a,t[1]=l,t[2]=u),(0,Q.useEffect)(l,u);let d,f;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>()=>{s.current?.abort(),s.current=null,o.current=null,document.body.style.cursor=``,document.body.style.userSelect=``},f=[],t[3]=d,t[4]=f):(d=t[3],f=t[4]),(0,Q.useEffect)(d,f);let[p,m]=(0,Q.useState)(!1),[h,g]=(0,Q.useState)(null),_;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>!(e&&o.current!==null),t[5]=_):_=t[5];let v=_,y;t[6]!==i||t[7]!==r||t[8]!==n?(y=e=>{if(e.button!==0)return;s.current?.abort(),o.current={startX:e.clientX,startY:e.clientY,isDragging:!1,lastTarget:null};let t=new AbortController;s.current=t;let{signal:a}=t,l=e=>{let t=o.current;if(!t)return;if(!t.isDragging){let n=e.clientX-t.startX,r=e.clientY-t.startY;if(Math.hypot(n,r)<bA)return;t.isDragging=!0,m(!0),document.body.style.cursor=`grabbing`,document.body.style.userSelect=`none`}let n=CA(i,r,e.clientX,e.clientY);t.lastTarget=n,g(n)},u=()=>{t.abort(),s.current===t&&(s.current=null),document.body.style.cursor=``,document.body.style.userSelect=``;let e=o.current;o.current=null,m(!1),g(null),e&&(e.isDragging&&e.lastTarget?DA(n,i,r,e.lastTarget.index):e.isDragging||c.current())};document.addEventListener(`pointermove`,l,{signal:a}),document.addEventListener(`pointerup`,u,{signal:a}),document.addEventListener(`pointercancel`,u,{signal:a})},t[6]=i,t[7]=r,t[8]=n,t[9]=y):y=t[9];let b=y,x;return t[10]!==h||t[11]!==p||t[12]!==b?(x={onPointerDown:b,shouldAllowOpen:v,isDragging:p,indicator:h},t[10]=h,t[11]=p,t[12]=b,t[13]=x):x=t[13],x}function CA(e,t,n,r){let i=e.closest(`table`);if(!i)return null;let a=i.getBoundingClientRect();if(t===`row`){let e=Array.from(i.rows);if(e.length===0)return null;for(let t=0;t<e.length;t++){let n=e[t].getBoundingClientRect();if(r<n.top)return{index:xA,rect:TA(a,wA(e,0,n.top))};if(r<=n.bottom){let i=r>=n.top+n.height/2,o=i?t+1:t,s=Math.max(xA,o);return{index:s,rect:TA(a,s===o?i?n.bottom:n.top:wA(e,0,n.top))}}}let t=e[e.length-1].getBoundingClientRect();return{index:e.length,rect:TA(a,t.bottom)}}let o=i.rows[0];if(!o)return null;let s=Array.from(o.cells);if(s.length===0)return null;for(let e=0;e<s.length;e++){let t=s[e].getBoundingClientRect();if(n<t.left)return{index:0,rect:EA(a,t.left)};if(n<=t.right){let r=n>=t.left+t.width/2,i=r?t.right:t.left;return{index:r?e+1:e,rect:EA(a,i)}}}let c=s[s.length-1].getBoundingClientRect();return{index:s.length,rect:EA(a,c.right)}}function wA(e,t,n){let r=e[t];return r?r.getBoundingClientRect().bottom:n}function TA(e,t){return{left:e.left,top:t-1,width:e.width,height:2}}function EA(e,t){return{left:t-1,top:e.top,width:2,height:e.height}}function DA(e,t,n,r){let i=n===`row`?OA(t):t.cellIndex;if(i<0||n===`row`&&(i<xA||r<xA)||r===i||r===i+1)return;let{state:a,view:o}=e,s=kA(a.selection.$from);if(s<0){console.warn(`[table-drag-reorder] no table found at selection depth`);return}let c=a.doc.nodeAt(s);if(!c){console.warn(`[table-drag-reorder] nodeAt returned null at tablePos`,s);return}let l=a.tr;MA(l,s,c,n===`row`?AA(c,i,r):jA(c,i,r)),o.dispatch(l)}function OA(e){let t=e.parentElement,n=t?.closest(`table`);return n?Array.prototype.indexOf.call(n.rows,t):-1}function kA(e){for(let t=e.depth;t>0;t--)if(e.node(t).type.spec.tableRole===`table`)return e.before(t);return-1}function AA(e,t,n){let r=[];e.forEach(e=>{r.push(e)});let[i]=r.splice(t,1),a=n>t?n-1:n;return r.splice(a,0,i),e.type.create(e.attrs,r,e.marks)}function jA(e,t,n){let r=n>t?n-1:n,i=[];return e.forEach(e=>{let n=[];e.forEach(e=>{n.push(e)});let[a]=n.splice(t,1);n.splice(r,0,a),i.push(e.type.create(e.attrs,n,e.marks))}),e.type.create(e.attrs,i,e.marks)}function MA(e,t,n,r){e.replaceRangeWith(t,t+n.nodeSize,r)}function NA(e){return[...e?[{label:`Toggle header column`,icon:Oh,run:e=>e.chain().focus().toggleHeaderColumn().run()}]:[],{label:`Insert column left`,icon:In,run:e=>e.chain().focus().addColumnBefore().run()},{label:`Insert column right`,icon:Jn,run:e=>e.chain().focus().addColumnAfter().run()},{label:`Delete column`,icon:ll,separatorBefore:!0,run:e=>e.chain().focus().deleteColumn().run()},{label:`Delete table`,icon:Uh,run:e=>e.chain().focus().deleteTable().run()}]}function PA(e){return[...e?[{label:`Toggle header row`,icon:Cg,run:e=>e.chain().focus().toggleHeaderRow().run()}]:[],{label:`Insert row above`,icon:Hn,run:e=>e.chain().focus().addRowBefore().run()},{label:`Insert row below`,icon:zn,run:e=>e.chain().focus().addRowAfter().run()},{label:`Delete row`,icon:ll,separatorBefore:!0,run:e=>e.chain().focus().deleteRow().run()},{label:`Delete table`,icon:Uh,run:e=>e.chain().focus().deleteTable().run()}]}function FA(e){if(!e.isEditable||_(e.state).query)return null;let{state:t,view:n}=e,r=t.selection.$from,i=-1;for(let e=r.depth;e>0;e--){let t=r.node(e).type.spec.tableRole;if(t===`cell`||t===`header_cell`){i=r.before(e);break}}if(i<0)return null;let a=n.nodeDOM(i);if(!(a instanceof HTMLTableCellElement))return null;let o=a.closest(`table`),s=a.closest(`tr`),c=a.closest(`.ProseMirror`);if(!o||!s||!c)return null;let l=Array.prototype.indexOf.call(o.rows,s),u=a.cellIndex,d=o.rows[0]?.cells[u],f=o.rows[l]?.cells[0];return!d||!f?null:{columnAnchor:d,rowAnchor:f,isFirstColumn:u===0,isFirstRow:l===0}}function IA(e){let t=(0,$.c)(37),{editor:n,anchor:r,axis:i,items:a}=e,o=(0,Q.useRef)(null),[s,c]=(0,Q.useState)(!1),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>c(!0),t[0]=l):l=t[0];let u;t[1]!==r||t[2]!==i||t[3]!==n?(u={editor:n,axis:i,anchor:r,onClickGesture:l},t[1]=r,t[2]=i,t[3]=n,t[4]=u):u=t[4];let d=SA(u),f,p;t[5]!==r||t[6]!==i?(f=()=>{let e=o.current;if(!e)return;let t=i===`column`?`top`:`left`,n=i===`column`?-14:-6;return rr(r,e,()=>{$n(r,e,{strategy:`absolute`,placement:t,middleware:[er(n)]}).then(t=>{let{x:n,y:r}=t;e.style.left=`${n}px`,e.style.top=`${r}px`,e.style.opacity=`1`}).catch(LA)})},p=[r,i],t[5]=r,t[6]=i,t[7]=f,t[8]=p):(f=t[7],p=t[8]),(0,Q.useEffect)(f,p);let m=i===`column`?Mh:bs,h;t[9]===d?h=t[10]:(h=e=>{d.shouldAllowOpen(e)&&c(e)},t[9]=d,t[10]=h);let g=i===`column`?`h-3 w-7 rounded-full p-0 text-gray-700 dark:text-muted-foreground bg-gray-200 dark:bg-gray-700 hover:bg-gray-300 hover:text-foreground dark:hover:bg-gray-600 dark:hover:text-gray-100 relative cursor-grab before:absolute before:-inset-[6px] before:content-[""]`:`h-7 w-3 rounded-full p-0 text-gray-700 dark:text-muted-foreground bg-gray-200 dark:bg-gray-700 hover:bg-gray-300 hover:text-foreground dark:hover:bg-gray-600 dark:hover:text-gray-100 relative cursor-grab before:absolute before:-inset-[6px] before:content-[""]`,_=i===`column`?`Column options`:`Row options`,v;t[11]===m?v=t[12]:(v=(0,Z.jsx)(m,{className:`size-3.5`,"aria-hidden":!0}),t[11]=m,t[12]=v);let y;t[13]!==d.onPointerDown||t[14]!==g||t[15]!==_||t[16]!==v?(y=(0,Z.jsx)(Or,{asChild:!0,children:(0,Z.jsx)(X,{variant:`secondary`,onPointerDown:d.onPointerDown,className:g,"aria-label":_,children:v})}),t[13]=d.onPointerDown,t[14]=g,t[15]=_,t[16]=v,t[17]=y):y=t[17];let b=i===`column`?`center`:`start`,x=i===`column`?`bottom`:`right`,S;if(t[18]!==n||t[19]!==a){let e;t[21]===n?e=t[22]:(e=e=>(0,Z.jsxs)(Q.Fragment,{children:[e.separatorBefore&&(0,Z.jsx)(Fr,{}),(0,Z.jsxs)(wr,{onSelect:()=>e.run(n),children:[(0,Z.jsx)(e.icon,{"aria-hidden":!0}),e.label]})]},e.label),t[21]=n,t[22]=e),S=a.map(e),t[18]=n,t[19]=a,t[20]=S}else S=t[20];let C;t[23]!==b||t[24]!==x||t[25]!==S?(C=(0,Z.jsx)(Mr,{align:b,side:x,className:`w-auto min-w-44 whitespace-nowrap`,children:S}),t[23]=b,t[24]=x,t[25]=S,t[26]=C):C=t[26];let w;t[27]!==s||t[28]!==C||t[29]!==h||t[30]!==y?(w=(0,Z.jsx)(`div`,{ref:o,"data-testid":`table-cell-handle`,className:`absolute left-0 top-0 z-10 opacity-0`,children:(0,Z.jsxs)(Pr,{open:s,onOpenChange:h,children:[y,C]})}),t[27]=s,t[28]=C,t[29]=h,t[30]=y,t[31]=w):w=t[31];let T;t[32]===d.indicator?T=t[33]:(T=d.indicator&&(0,Z.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none fixed z-50 bg-primary`,style:{left:d.indicator.rect.left,top:d.indicator.rect.top,width:d.indicator.rect.width,height:d.indicator.rect.height}}),t[32]=d.indicator,t[33]=T);let E;return t[34]!==w||t[35]!==T?(E=(0,Z.jsxs)(Z.Fragment,{children:[w,T]}),t[34]=w,t[35]=T,t[36]=E):E=t[36],E}function LA(){}function RA(e){let t=(0,$.c)(18),{editor:n}=e,[r,i]=(0,Q.useState)(null),a,o;if(t[0]===n?(a=t[1],o=t[2]):(a=()=>{let e=()=>i(e=>{let t=FA(n);return e&&t&&e.columnAnchor===t.columnAnchor&&e.rowAnchor===t.rowAnchor?e:t});return e(),n.on(`selectionUpdate`,e),n.on(`update`,e),()=>{n.off(`selectionUpdate`,e),n.off(`update`,e)}},o=[n],t[0]=n,t[1]=a,t[2]=o),(0,Q.useEffect)(a,o),!r)return null;let s=r.columnAnchor,c;t[3]===r.isFirstColumn?c=t[4]:(c=NA(r.isFirstColumn),t[3]=r.isFirstColumn,t[4]=c);let l;t[5]!==r.columnAnchor||t[6]!==n||t[7]!==c?(l=(0,Z.jsx)(IA,{editor:n,anchor:s,axis:`column`,items:c}),t[5]=r.columnAnchor,t[6]=n,t[7]=c,t[8]=l):l=t[8];let u=r.rowAnchor,d;t[9]===r.isFirstRow?d=t[10]:(d=PA(r.isFirstRow),t[9]=r.isFirstRow,t[10]=d);let f;t[11]!==r.rowAnchor||t[12]!==n||t[13]!==d?(f=(0,Z.jsx)(IA,{editor:n,anchor:u,axis:`row`,items:d}),t[11]=r.rowAnchor,t[12]=n,t[13]=d,t[14]=f):f=t[14];let p;return t[15]!==l||t[16]!==f?(p=(0,Z.jsxs)(`div`,{className:`ok-table-cell-handle-layer`,children:[l,f]}),t[15]=l,t[16]=f,t[17]=p):p=t[17],p}function zA(e){let{fragment:t,docName:n}=e,r=!1,i=!1,a=!1,o=()=>{r=!0},s=e=>{console.warn(`[walk-currency] ${e} at view init — stale pre-warm cannot be invalidated: a remote edit that landed in the construct→mount gap will not render, and the first local transaction may silently erase it from the CRDT for every peer and disk (vendored y-tiptap contract change? re-verify y-tiptap.cjs:263-268)`)},c=()=>{i&&(i=!1,t.unobserveDeep(o))},l=e=>{let t=pe.getState(e.state)?.binding;if(!t){lu.count(`ok/editor/walk-currency-disarmed`,{docName:n,reason:`no-binding`}),s(`no ySync binding on "${n}"`);return}if(typeof t._forceRerender!=`function`){lu.count(`ok/editor/walk-currency-disarmed`,{docName:n,reason:`no-force-rerender`}),s(`ySync binding on "${n}" exposes no _forceRerender`);return}lu.count(`ok/editor/pattern-d-stale-prewarm`,{docName:n}),t._forceRerender()};return Hi.create({name:`walkCurrency`,onBeforeCreate(){t.observeDeep(o),i=!0},onDestroy(){c()},addProseMirrorPlugins(){return[new ja({view:e=>(a||(a=!0,c(),r&&l(e)),{})})]}})}var BA=new WeakMap;function VA(e){let t=document.createElement(`span`);t.classList.add(`collaboration-cursor__caret`),t.style.borderColor=e.color;let n=document.createElement(`div`);return n.classList.add(`collaboration-cursor__label`),n.style.backgroundColor=e.color,n.style.color=Bi(e.color),n.textContent=e.name,t.append(n),t}var HA={state:`idle`,count:0,lastFiredAt:null,position:`append`,lastAgentId:null};function UA(e,t){let n=null;for(let[r,i]of e.entries()){let e=i;typeof e?.timestamp!=`number`||e.timestamp<=t||(n===null||e.timestamp>n.entry.timestamp)&&(n={key:`${r}:${e.timestamp}`,entry:e})}return n}var WA=100,GA=100,KA=3,qA=250;function JA(e){return`contentComponent`in e&&`isEditorContentInitialized`in e}function YA(e,t){let n=An(e);if(!n||t.contains(n.dom))return!1;if(!JA(e))return console.warn(`[TiptapEditor] TipTap EditorContent binding fields missing; detached editor repair skipped`),!1;let r=e;if(r.contentComponent==null)return!1;try{n.setProps({nodeViews:{}})}catch{}return r.contentComponent=null,r.isEditorContentInitialized=!1,!0}function XA(){let e=new Ba({extensions:$a});return{mdManager:e,text:k({mdManager:e}),html:Ae({mdManager:e}),paste:N({mdManager:e}),copy:o({mdManager:e}),drop:f({mdManager:e})}}function ZA(e,t){return t?{collaboration:ct.configure({document:e.document,ySyncOptions:{mapping:t}}),guard:[zA({fragment:e.document.getXmlFragment(`default`),docName:e.configuration.name??``})]}:{collaboration:ct.configure({document:e.document}),guard:[]}}function QA(e){let{provider:t,placeholder:n,prebuiltMapping:r,onWedged:i}=e,{collaboration:a,guard:o}=ZA(t,r);return[...Ie.map(e=>e.name===`link`||e.name===`wikiLink`||e.name===`jsxComponent`?e.configure({docName:t.configuration.name??``}):e),IC.configure({placeholder:n??`Type '/' for commands`,showOnlyCurrent:!0}),a,Hi.create({name:`imageUploadDecoration`,addProseMirrorPlugins(){return[ne]}}),Hi.create({name:`collaborationCursor`,addProseMirrorPlugins(){let e=t.awareness;if(!e)throw Error(`[TiptapEditor] HocuspocusProvider has no awareness instance — cursor plugin cannot initialize`);return[ft(e,{cursorBuilder:VA})]}}),Hi.create({name:`bindingStalenessGuard`,addProseMirrorPlugins(){return[iO({fragment:t.document.getXmlFragment(`default`),docName:t.configuration.name??``,onWedged:i??(()=>{})})]}}),...o,tk,dA.configure({docName:t.configuration.name??``,getSource:()=>t.document.getText(`source`).toString(),applyFix:e=>ax(t,e)})]}function $A(e){let{provider:t,clipboard:n,ctorStart:r}=e;return{onBeforeCreate:({editor:e})=>{BA.set(e,r)},onCreate:({editor:e})=>{n.html.setView(e.view);let r=BA.get(e);if(BA.delete(e),r==null)return;let i=performance.now();lu(`ok/editor/create-tiptap`,{docName:t.configuration.name??`unknown`,ytextLength:t.document.getText(`source`).length},{startTime:r,duration:Math.max(0,i-r)})},editorProps:{attributes:{class:`pt-4 pb-4 h-full`},clipboardTextParser:(e,t,r,i)=>{let a=n.mdManager.parse(e);return i.state.schema.nodeFromJSON(a).content},clipboardTextSerializer:(e,t)=>n.text(e,t),clipboardSerializer:n.html.serializer,handlePaste:(e,t)=>n.paste(e,t),handleDrop:vA(n.drop,e.onSidebarDrop),handleDOMEvents:{copy:(e,t)=>n.copy(e,t,!1),cut:(e,t)=>n.copy(e,t,!0)}},extensions:HD(QA(e))}}function ej(e){let{provider:t,placeholder:n,clipboard:r,ctorStart:i,onWedged:a,onSidebarDrop:o}=e,s=t.document.getXmlFragment(`default`),c=new Map,l=$A({provider:t,placeholder:n,clipboard:r,ctorStart:i,prebuiltMapping:c,onWedged:a,onSidebarDrop:o}),u=l.onBeforeCreate;return{...l,onBeforeCreate:e=>{u?.(e);let{editor:t}=e,{doc:n,mapping:r}=st(s,t.schema);r.forEach((e,t)=>{c.set(t,e)}),t.options.content=n.toJSON()},element:null}}var tj=e=>{let t=(0,$.c)(24),{provider:n,placeholder:r,isSourceMode:i,portalTarget:a}=e,o=(0,Q.useRef)(null),s=(0,Q.useRef)(HA),c=WD(),{principal:l,activeDocName:u,recycleDocument:d,openTarget:f}=Ye(),p=n.configuration.name??``,[m]=(0,Q.useState)(XA),h;t[0]!==m||t[1]!==p||t[2]!==f||t[3]!==r||t[4]!==n||t[5]!==d?(h=()=>()=>({editor:new bi(ej({provider:n,placeholder:r,clipboard:m,ctorStart:performance.now(),onWedged:e=>{let{externalSeq:t,appliedSeq:n}=e;lu(`ok/editor/binding-wedge-recycle`,{docName:p,externalSeq:t,appliedSeq:n}),d(p)},onSidebarDrop:e=>{yA(e,f)}})),ydoc:n.document,ytext:n.document.getText(`source`),provider:n}),t[0]=m,t[1]=p,t[2]=f,t[3]=r,t[4]=n,t[5]=d,t[6]=h):h=t[6];let[g]=(0,Q.useState)(h),_,v;if(t[7]!==g||t[8]!==p||t[9]!==n.document){let e={viewCount:0,bytes:n.document.getText(`source`).length},r=De(p)??crypto.randomUUID();_=Q.use,v=Ce({docName:p,mountId:r,construct:g,sizeStats:e}),t[7]=g,t[8]=p,t[9]=n.document,t[10]=_,t[11]=v}else _=t[10],v=t[11];let y=_(v),b=y.editor,x,S;t[12]===y?(x=t[13],S=t[14]):(x=()=>()=>{We(y)},S=[y],t[12]=y,t[13]=x,t[14]=S),(0,Q.useEffect)(x,S);let C;return t[15]!==u||t[16]!==p||t[17]!==b||t[18]!==c||t[19]!==i||t[20]!==a||t[21]!==l||t[22]!==n?(C=(0,Z.jsx)(nj,{provider:n,isSourceMode:i,docName:p,activeDocName:u,identity:c,principal:l,editor:b,wrapperRef:o,flashStateRef:s,portalTarget:a}),t[15]=u,t[16]=p,t[17]=b,t[18]=c,t[19]=i,t[20]=a,t[21]=l,t[22]=n,t[23]=C):C=t[23],C},nj=e=>{let t=(0,$.c)(110),{provider:n,isSourceMode:r,docName:i,activeDocName:a,identity:o,principal:s,editor:l,wrapperRef:u,flashStateRef:d,portalTarget:f}=e,p=(0,Q.useRef)(null),[m,h]=(0,Q.useState)(0),g,_;t[0]===f?(g=t[1],_=t[2]):(g=()=>{let e=p.current;if(e)return e.appendChild(f),()=>{f.parentNode===e&&e.removeChild(f)}},_=[f],t[0]=f,t[1]=g,t[2]=_),(0,Q.useLayoutEffect)(g,_);let v,y;t[3]!==l||t[4]!==f?(v=()=>{YA(l,f)&&h(rj)},y=[l,f],t[3]=l,t[4]=f,t[5]=v,t[6]=y):(v=t[5],y=t[6]),(0,Q.useEffect)(v,y);let b;t[7]!==l||t[8]!==n.configuration.name?(b=()=>(Sn(l,n.configuration.name??null),()=>{Sn(l,null)}),t[7]=l,t[8]=n.configuration.name,t[9]=b):b=t[9];let x;t[10]!==l||t[11]!==n?(x=[l,n],t[10]=l,t[11]=n,t[12]=x):x=t[12],(0,Q.useEffect)(b,x);let S;t[13]!==l||t[14]!==n.configuration.name?(S=()=>{let e=n.configuration.name;if(e)return H(e,l),()=>lt(e,l)},t[13]=l,t[14]=n.configuration.name,t[15]=S):S=t[15];let C;t[16]!==l||t[17]!==n?(C=[l,n],t[16]=l,t[17]=n,t[18]=C):C=t[18],(0,Q.useEffect)(S,C);let w;t[19]!==l||t[20]!==n.configuration.name?(w=()=>{let e=n.configuration.name;if(!e)return;let t=null,r=()=>{t=null,Ad(e,`wysiwyg`,Dd(l)),gd(e,`wysiwyg`,_d(l,e))},i=()=>{t&&clearTimeout(t),t=setTimeout(r,120)};return r(),l.on(`selectionUpdate`,i),l.on(`update`,i),()=>{t&&clearTimeout(t),l.off(`selectionUpdate`,i),l.off(`update`,i),Ad(e,`wysiwyg`,null),gd(e,`wysiwyg`,null)}},t[19]=l,t[20]=n.configuration.name,t[21]=w):w=t[21];let T;t[22]!==l||t[23]!==n?(T=[l,n],t[22]=l,t[23]=n,t[24]=T):T=t[24],(0,Q.useEffect)(w,T);let E;t[25]!==l||t[26]!==n.configuration.name?(E=()=>{},t[25]=l,t[26]=n.configuration.name,t[27]=E):E=t[27];let D;t[28]!==l||t[29]!==n?(D=[l,n],t[28]=l,t[29]=n,t[30]=D):D=t[30],(0,Q.useEffect)(E,D);let O,k;t[31]===l?(O=t[32],k=t[33]):(O=()=>{let e=ij,t=null,n=()=>{if(t||l.isDestroyed)return;let n=An(l);n&&(t=n.dom,t.addEventListener(`keydown`,e),t.addEventListener(`paste`,e),t.addEventListener(`drop`,e),t.addEventListener(`cut`,e))},r=()=>{t&&=(t.removeEventListener(`keydown`,e),t.removeEventListener(`paste`,e),t.removeEventListener(`drop`,e),t.removeEventListener(`cut`,e),null)};return An(l)?n():l.on(`create`,n),()=>{l.off(`create`,n),r()}},k=[l],t[31]=l,t[32]=O,t[33]=k),(0,Q.useEffect)(O,k);let A,j;t[34]!==i||t[35]!==l?(A=()=>{let e=!1,t=()=>{if(e||l.isDestroyed||!An(l))return;e=!0;let t=et(i)?.selection??null;if(t)try{let e=l.state.doc.content.size;if(t.type===`text`){let n=Math.max(0,Math.min(t.anchor,e)),r=Math.max(0,Math.min(t.head,e));l.commands.setTextSelection({from:n,to:r})}else{let n=Math.max(0,Math.min(t.from,e));l.commands.setNodeSelection(n)}}catch(e){let t=e,n=t instanceof Error?t.message:String(t);console.warn(JSON.stringify({event:`ok-editor-selection-restore-failed`,docName:i,message:n})),lu(`ok/editor/selection-restore-failed`,{docName:i,message:n})}Ze(i)};if(An(l)){t();return}return l.on(`create`,t),()=>{l.off(`create`,t)}},j=[l,i],t[34]=i,t[35]=l,t[36]=A,t[37]=j):(A=t[36],j=t[37]),(0,Q.useEffect)(A,j);let M,N;t[38]!==d||t[39]!==n.document||t[40]!==u?(M=()=>{let e=n.document.getMap(`agent-flash`),t=Date.now(),r=0,i=null,a=null,o=null,s=()=>{let t=null;for(let[,n]of e.entries()){let e=n;e.timestamp&&(!t||e.timestamp>t.timestamp)&&(t={agentId:e.agentId??`unknown`,timestamp:e.timestamp,type:e.type??`insert`,description:e.description})}return t},c=e=>{d.current=e;let t=u.current;t&&(t.setAttribute(`data-agent-flash-state`,e.state),t.setAttribute(`data-agent-flash-count`,String(e.count)),t.setAttribute(`data-agent-flash-position`,e.position),t.setAttribute(`data-agent-flash-agent-id`,e.lastAgentId??``))},l=()=>{let e=s(),t=e?.description?.toLowerCase().includes(`prepend`)?`prepend`:`append`,n={state:`editing`,count:(d.current?.count??0)+1,lastFiredAt:Date.now(),position:t,lastAgentId:e?.agentId??null};c(n),document.dispatchEvent(new CustomEvent(`agent-flash`,{detail:n})),a&&clearTimeout(a),o&&clearTimeout(o),a=window.setTimeout(()=>{let e={...n,state:`settled`};c(e),document.dispatchEvent(new CustomEvent(`agent-flash-end`,{detail:e})),o=window.setTimeout(()=>{c({...e,state:`idle`})},300)},Ji)};c(HA);let f=()=>{if(Ii(e),!sa(e,t)||document.visibilityState!==`visible`)return;let n=Date.now();if(t=n,n-r<500){if(!i){let e=500-(n-r);i=window.setTimeout(()=>{i=null,r=Date.now(),l()},e)}return}r=n,l()};e.observe(f);let p=()=>{document.visibilityState===`visible`?sa(e,t)&&(t=Date.now(),r=Date.now(),l()):t=Date.now()};return document.addEventListener(`visibilitychange`,p),()=>{e.unobserve(f),document.removeEventListener(`visibilitychange`,p),i&&clearTimeout(i),a&&clearTimeout(a),o&&clearTimeout(o)}},N=[n.document,d,u],t[38]=d,t[39]=n.document,t[40]=u,t[41]=M,t[42]=N):(M=t[41],N=t[42]),(0,Q.useEffect)(M,N);let P=(0,Q.useRef)(null),F;t[43]!==a||t[44]!==i||t[45]!==l||t[46]!==n?(F=()=>{let e=_A(),t=n.document.getMap(`agent-flash`),r=null,o=!1;queueMicrotask(()=>{o||l.isDestroyed||l.registerPlugin(e)});let s=[],c=()=>l.editorView??null,u=(e,t,n)=>{if(e.dispatch(e.state.tr.setMeta(pA,{add:{from:t,to:n},now:Date.now()})),r!==null&&clearTimeout(r),r=window.setTimeout(()=>{r=null;let e=c();e?.dispatch(e.state.tr.setMeta(pA,{now:Date.now(),sweep:!0}))},fA+50),!ff()||document.visibilityState!==`visible`||e.hasFocus())return;let i=()=>{let e=c();if(!(e==null||e.hasFocus()||document.visibilityState!==`visible`))try{let r=e.state.doc.content.size,i=Math.max(0,Math.min(Math.floor((t+n)/2),r-1)),a=e.domAtPos(i),o=a.node,s=o.nodeType===Node.TEXT_NODE?o.parentElement:o.childNodes[a.offset]??o,c=s instanceof HTMLElement?s:s?.parentElement??null;if(c==null)return;let l=c.getBoundingClientRect();if(l.top>=0&&l.bottom<=window.innerHeight)return;c.scrollIntoView({block:`center`,behavior:`smooth`})}catch{}};requestAnimationFrame(i),s.push(window.setTimeout(i,250),window.setTimeout(i,550))},d=e=>{let{transaction:n}=e;if(!n.docChanged||n.getMeta(pe)?.isChangeOrigin!==!0||!sa(t,Date.now()-1400)||i!==a)return;let r=UA(t,Date.now()-fA);if(r!==null&&r.key===P.current)return;let o=mA(n.before,n.doc);if(o===null)return;let s=c();s!=null&&(r!==null&&(P.current=r.key),u(s,o.from,o.to))};l.on(`transaction`,d);let f=()=>{if(o||i!==a)return;let e=c();if(e==null)return;let n=UA(t,Date.now()-hA);if(n===null||n.key===P.current)return;let r=n.entry.changedBlocks;if(r===void 0)return;let s=gA(e.state.doc,r.from,r.to);s!==null&&(P.current=n.key,u(e,s.from,s.to))},p=requestAnimationFrame(f),m=()=>{requestAnimationFrame(f)};return n.on(`synced`,m),()=>{o=!0,l.off(`transaction`,d),n.off(`synced`,m),cancelAnimationFrame(p),r!==null&&clearTimeout(r);for(let e of s)clearTimeout(e);l.unregisterPlugin(pA)}},t[43]=a,t[44]=i,t[45]=l,t[46]=n,t[47]=F):F=t[47];let I;t[48]!==a||t[49]!==i||t[50]!==l||t[51]!==n.document||t[52]!==n.off||t[53]!==n.on?(I=[l,n.document,i,a,n.on,n.off],t[48]=a,t[49]=i,t[50]=l,t[51]=n.document,t[52]=n.off,t[53]=n.on,t[54]=I):I=t[54],(0,Q.useEffect)(F,I);let L,R;t[55]!==a||t[56]!==i||t[57]!==l||t[58]!==n?(L=()=>{let e=0,t,r=null,o=null,s=null,c=function(){if(e<WA){e+=1,t=window.setTimeout(p,GA);return}r=null,o=null,e=0},u=function(e){let t=An(l);if(!t)return null;let n=CSS.escape(e);return t.dom.querySelector(`#${n}`)??t.dom.querySelector(`[data-mirror-source-id="${n}"]`)},d=function(e){let t=u(e);return t?(t.scrollIntoView({behavior:`smooth`,block:`start`}),!0):!1},f=function(e,n){let r=KA,o=()=>{t=void 0,!(i!==a||window.location.hash!==n)&&(d(e),--r,r>0&&(t=window.setTimeout(o,qA)))};t=window.setTimeout(o,qA)};function p(){if(!r||i!==a)return;let t=r,n=o;if(!n){c();return}d(t)?(s=n,r=null,o=null,e=0,f(t,n)):c()}let m=function(){if(i!==a)return;let n=window.location.hash;if(!r&&s===n)return;let c=wu(n);if(!c){s=n;return}r=c,o=n,e=0,t!==void 0&&(clearTimeout(t),t=void 0),p()},h=function(){if(i===a){if(r){p();return}m()}};return m(),n.on(`synced`,h),l.on(`transaction`,h),window.addEventListener(`hashchange`,m),()=>{t!==void 0&&clearTimeout(t),n.off(`synced`,h),l.off(`transaction`,h),window.removeEventListener(`hashchange`,m)}},R=[n,l,i,a],t[55]=a,t[56]=i,t[57]=l,t[58]=n,t[59]=L,t[60]=R):(L=t[59],R=t[60]),(0,Q.useEffect)(L,R);let z,B;t[61]===l?(z=t[62],B=t[63]):(z=()=>{let e=function(e){let t=e.detail;if(!t||t.mode!==`wysiwyg`||l.isDestroyed)return;let n=An(l);if(!n)return;let r=n.dom.querySelectorAll(`h1, h2, h3, h4, h5, h6`)[t.index];r&&r.scrollIntoView({behavior:`smooth`,block:`start`})};return window.addEventListener(Td,e),()=>window.removeEventListener(Td,e)},B=[l],t[61]=l,t[62]=z,t[63]=B),(0,Q.useEffect)(z,B);let V;t[64]!==a||t[65]!==i||t[66]!==o||t[67]!==r||t[68]!==s||t[69]!==n.awareness?(V=()=>{let e=n.awareness;if(!e)return;if(i!==a){e.setLocalState(null);return}e.setLocalState({user:YD({principal:s,identity:o}),mode:r?`source`:`wysiwyg`});let t=JD();return t.start(),t.setAwareness(e),()=>t.clearAwareness(e)},t[64]=a,t[65]=i,t[66]=o,t[67]=r,t[68]=s,t[69]=n.awareness,t[70]=V):V=t[70];let U;t[71]!==a||t[72]!==i||t[73]!==o||t[74]!==r||t[75]!==s||t[76]!==n?(U=[n,i,a,o,s,r],t[71]=a,t[72]=i,t[73]=o,t[74]=r,t[75]=s,t[76]=n,t[77]=U):U=t[77],(0,Q.useEffect)(V,U);let W,G;t[78]!==l||t[79]!==r?(W=()=>(Tn(l,r),()=>{Tn(l,!1)}),G=[l,r],t[78]=l,t[79]=r,t[80]=W,t[81]=G):(W=t[80],G=t[81]),(0,Q.useEffect)(W,G);let K;t[82]!==a||t[83]!==i||t[84]!==l||t[85]!==r?(K=!r&&(0,Z.jsx)(Kk,{editor:l,shortcutEnabled:i===a}),t[82]=a,t[83]=i,t[84]=l,t[85]=r,t[86]=K):K=t[86];let te;t[87]!==l||t[88]!==r?(te=!r&&(0,Z.jsx)(RA,{editor:l}),t[87]=l,t[88]=r,t[89]=te):te=t[89];let ne;t[90]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,Z.jsx)(`div`,{ref:p,style:{display:`contents`}}),t[90]=ne):ne=t[90];let q;t[91]!==l||t[92]!==m?(q=(0,Z.jsx)(Wn,{editor:l,className:`tiptap-editor-portal-content h-full`},m),t[91]=l,t[92]=m,t[93]=q):q=t[93];let re;t[94]!==f||t[95]!==q?(re=(0,iT.createPortal)(q,f),t[94]=f,t[95]=q,t[96]=re):re=t[96];let ie;t[97]===l?ie=t[98]:(ie=(0,Z.jsx)(CD,{editor:l}),t[97]=l,t[98]=ie);let ae;t[99]===l?ae=t[100]:(ae=c(l),t[99]=l,t[100]=ae);let oe;t[101]===ae.store?oe=t[102]:(oe=(0,Z.jsx)(ee,{store:ae.store}),t[101]=ae.store,t[102]=oe);let se;return t[103]!==K||t[104]!==te||t[105]!==re||t[106]!==ie||t[107]!==oe||t[108]!==u?(se=(0,Z.jsxs)(`div`,{ref:u,className:`tiptap-editor h-full`,"data-agent-flash-state":`idle`,"data-agent-flash-count":`0`,"data-agent-flash-position":`append`,"data-agent-flash-agent-id":``,children:[K,te,ne,re,ie,oe]}),t[103]=K,t[104]=te,t[105]=re,t[106]=ie,t[107]=oe,t[108]=u,t[109]=se):se=t[109],se};function rj(e){return e+1}function ij(){return wn()}var aj=null;function oj(e){let t=(0,$.c)(3),n=(0,Q.useRef)(null),r,i;return t[0]===e?(r=t[1],i=t[2]):(r=()=>{if(!e)return;let t=n.current;if(!t)return;let r={};aj=r;let i=document.documentElement,a=null,o=()=>{if(aj!==r)return;let e=`${t.offsetHeight}px`;e!==a&&(a=e,i.style.setProperty(`--conflict-footer-height`,e))};o();let s=new ResizeObserver(o);return s.observe(t),()=>{s.disconnect(),aj===r&&(aj=null,i.style.removeProperty(`--conflict-footer-height`))}},i=[e],t[0]=e,t[1]=r,t[2]=i),(0,Q.useEffect)(r,i),n}var sj=class e{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}offset(t,n=t){return new e(this.fromA+t,this.toA+t,this.fromB+n,this.toB+n)}};function cj(e,t,n,r,i,a){if(e==r)return[];let o=vj(e,t,n,r,i,a),s=yj(e,t+o,n,r,i+o,a);t+=o,n-=s,i+=o,a-=s;let c=n-t,l=a-i;if(!c||!l)return[new sj(t,n,i,a)];if(c>l){let o=e.slice(t,n).indexOf(r.slice(i,a));if(o>-1)return[new sj(t,t+o,i,i),new sj(t+o+l,n,a,a)]}else if(l>c){let o=r.slice(i,a).indexOf(e.slice(t,n));if(o>-1)return[new sj(t,t,i,i+o),new sj(n,n,i+o+c,a)]}if(c==1||l==1)return[new sj(t,n,i,a)];let u=xj(e,t,n,r,i,a);if(u){let[o,s,c]=u;return cj(e,t,o,r,i,s).concat(cj(e,o+c,n,r,s+c,a))}return fj(e,t,n,r,i,a)}var lj=1e9,uj=0,dj=!1;function fj(e,t,n,r,i,a){let o=n-t,s=a-i;if(lj<1e9&&Math.min(o,s)>lj*16||uj>0&&Date.now()>uj)return Math.min(o,s)>lj*64?[new sj(t,n,i,a)]:Sj(e,t,n,r,i,a);let c=Math.ceil((o+s)/2);mj.reset(c),hj.reset(c);let l=(n,a)=>e.charCodeAt(t+n)==r.charCodeAt(i+a),u=(t,i)=>e.charCodeAt(n-t-1)==r.charCodeAt(a-i-1),d=(o-s)%2==0?null:hj,f=d?null:mj;for(let p=0;p<c;p++){if(p>lj||uj>0&&!(p&63)&&Date.now()>uj)return Sj(e,t,n,r,i,a);let m=mj.advance(p,o,s,c,d,!1,l)||hj.advance(p,o,s,c,f,!0,u);if(m)return gj(e,t,n,t+m[0],r,i,a,i+m[1])}return[new sj(t,n,i,a)]}var pj=class{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let e=0;e<this.len;e++)this.vec[e]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,t,n,r,i,a,o){for(let s=-e+this.start;s<=e-this.end;s+=2){let c=r+s,l=s==-e||s!=e&&this.vec[c-1]<this.vec[c+1]?this.vec[c+1]:this.vec[c-1]+1,u=l-s;for(;l<t&&u<n&&o(l,u);)l++,u++;if(this.vec[c]=l,l>t)this.end+=2;else if(u>n)this.start+=2;else if(i){let e=r+(t-n)-s;if(e>=0&&e<this.len&&i.vec[e]!=-1)if(a){let n=i.vec[e];if(n>=t-l)return[n,r+n-e]}else{let n=t-i.vec[e];if(l>=n)return[l,u]}}}return null}},mj=new pj,hj=new pj;function gj(e,t,n,r,i,a,o,s){let c=!1;return!Lj(e,r)&&++r==n&&(c=!0),!Lj(i,s)&&++s==o&&(c=!0),c?[new sj(t,n,a,o)]:cj(e,t,r,i,a,s).concat(cj(e,r,n,i,s,o))}function _j(e,t){let n=1,r=Math.min(e,t);for(;n<r;)n<<=1;return n}function vj(e,t,n,r,i,a){if(t==n||t==a||e.charCodeAt(t)!=r.charCodeAt(i))return 0;let o=_j(n-t,a-i);for(let s=t,c=i;;){let i=s+o,l=c+o;if(i>n||l>a||e.slice(s,i)!=r.slice(c,l)){if(o==1)return s-t-+!Lj(e,s);o>>=1}else if(i==n||l==a)return i-t;else s=i,c=l}}function yj(e,t,n,r,i,a){if(t==n||i==a||e.charCodeAt(n-1)!=r.charCodeAt(a-1))return 0;let o=_j(n-t,a-i);for(let s=n,c=a;;){let a=s-o,l=c-o;if(a<t||l<i||e.slice(a,s)!=r.slice(l,c)){if(o==1)return n-s-+!Lj(e,s);o>>=1}else if(a==t||l==i)return n-a;else s=a,c=l}}function bj(e,t,n,r,i,a,o,s){let c=r.slice(i,a),l=null;for(;;){if(l||o<s)return l;for(let s=t+o;;){Lj(e,s)||s++;let u=s+o;if(Lj(e,u)||(u+=u==s+1?1:-1),u>=n)break;let d=e.slice(s,u),f=-1;for(;(f=c.indexOf(d,f+1))!=-1;){let o=vj(e,u,n,r,i+f+d.length,a),c=yj(e,t,s,r,i,i+f),p=d.length+o+c;(!l||l[2]<p)&&(l=[s-c,i+f-c,p])}s=u}if(s<0)return l;o>>=1}}function xj(e,t,n,r,i,a){let o=n-t,s=a-i;if(o<s){let o=xj(r,i,a,e,t,n);return o&&[o[1],o[0],o[2]]}return o<4||s*2<o?null:bj(e,t,n,r,i,a,Math.floor(o/4),-1)}function Sj(e,t,n,r,i,a){dj=!0;let o=n-t,s=a-i,c;if(o<s){let s=bj(r,i,a,e,t,n,Math.floor(o/6),50);c=s&&[s[1],s[0],s[2]]}else c=bj(e,t,n,r,i,a,Math.floor(s/6),50);if(!c)return[new sj(t,n,i,a)];let[l,u,d]=c;return cj(e,t,l,r,i,u).concat(cj(e,l+d,n,r,u+d,a))}function Cj(e,t){for(let n=1;n<e.length;n++){let r=e[n-1],i=e[n];r.toA>i.fromA-t&&r.toB>i.fromB-t&&(e[n-1]=new sj(r.fromA,i.toA,r.fromB,i.toB),e.splice(n--,1))}}function wj(e,t,n){for(;;){Cj(n,1);let r=!1;for(let i=0;i<n.length;i++){let a=n[i],o,s;(o=vj(e,a.fromA,a.toA,t,a.fromB,a.toB))&&(a=n[i]=new sj(a.fromA+o,a.toA,a.fromB+o,a.toB)),(s=yj(e,a.fromA,a.toA,t,a.fromB,a.toB))&&(a=n[i]=new sj(a.fromA,a.toA-s,a.fromB,a.toB-s));let c=a.toA-a.fromA,l=a.toB-a.fromB;if(c&&l)continue;let u=a.fromA-(i?n[i-1].toA:0),d=(i<n.length-1?n[i+1].fromA:e.length)-a.toA;if(!u||!d)continue;let f=c?e.slice(a.fromA,a.toA):t.slice(a.fromB,a.toB);u<=f.length&&e.slice(a.fromA-u,a.fromA)==f.slice(f.length-u)?(n[i]=new sj(a.fromA-u,a.toA-u,a.fromB-u,a.toB-u),r=!0):d<=f.length&&e.slice(a.toA,a.toA+d)==f.slice(0,d)&&(n[i]=new sj(a.fromA+d,a.toA+d,a.fromB+d,a.toB+d),r=!0)}if(!r)break}return n}function Tj(e,t,n){for(let r=0,i=0;i<e.length;i++){let a=e[i],o=a.toA-a.fromA,s=a.toB-a.fromB;if(o&&s||o>3||s>3){let c=i==e.length-1?t.length:e[i+1].fromA,l=a.fromA-r,u=c-a.toA,d=Mj(t,a.fromA,l),f=jj(t,a.toA,u),p=a.fromA-d,m=f-a.toA;if((!o||!s)&&p&&m){let l=Math.max(o,s),[u,h,g]=o?[t,a.fromA,a.toA]:[n,a.fromB,a.toB];l>p&&t.slice(d,a.fromA)==u.slice(g-p,g)?(a=e[i]=new sj(d,d+o,a.fromB-p,a.toB-p),d=a.fromA,f=jj(t,a.toA,c-a.toA)):l>m&&t.slice(a.toA,f)==u.slice(h,h+m)&&(a=e[i]=new sj(f-o,f,a.fromB+m,a.toB+m),f=a.toA,d=Mj(t,a.fromA,a.fromA-r)),p=a.fromA-d,m=f-a.toA}if(p||m)a=e[i]=new sj(a.fromA-p,a.toA+m,a.fromB-p,a.toB+m);else if(!o){let t=Pj(n,a.fromB,a.toB),r,o=t<0?-1:Nj(n,a.toB,a.fromB);t>-1&&(r=t-a.fromB)<=u&&n.slice(a.fromB,t)==n.slice(a.toB,a.toB+r)?a=e[i]=a.offset(r):o>-1&&(r=a.toB-o)<=l&&n.slice(a.fromB-r,a.fromB)==n.slice(o,a.toB)&&(a=e[i]=a.offset(-r))}else if(!s){let n=Pj(t,a.fromA,a.toA),r,o=n<0?-1:Nj(t,a.toA,a.fromA);n>-1&&(r=n-a.fromA)<=u&&t.slice(a.fromA,n)==t.slice(a.toA,a.toA+r)?a=e[i]=a.offset(r):o>-1&&(r=a.toA-o)<=l&&t.slice(a.fromA-r,a.fromA)==t.slice(o,a.toA)&&(a=e[i]=a.offset(-r))}}r=a.toA}return Cj(e,3),e}var Ej;try{Ej=RegExp(`[\\p{Alphabetic}\\p{Number}]`,`u`)}catch{}function Dj(e){return e>48&&e<58||e>64&&e<91||e>96&&e<123}function Oj(e,t){if(t==e.length)return 0;let n=e.charCodeAt(t);return n<192?+!!Dj(n):Ej?!Fj(n)||t==e.length-1?+!!Ej.test(String.fromCharCode(n)):Ej.test(e.slice(t,t+2))?2:0:0}function kj(e,t){if(!t)return 0;let n=e.charCodeAt(t-1);return n<192?+!!Dj(n):Ej?!Ij(n)||t==1?+!!Ej.test(String.fromCharCode(n)):Ej.test(e.slice(t-2,t))?2:0:0}var Aj=8;function jj(e,t,n){if(t==e.length||!kj(e,t))return t;for(let r=t,i=t+n,a=0;a<Aj;a++){let t=Oj(e,r);if(!t||r+t>i)return r;r+=t}return t}function Mj(e,t,n){if(!t||!Oj(e,t))return t;for(let r=t,i=t-n,a=0;a<Aj;a++){let t=kj(e,r);if(!t||r-t<i)return r;r-=t}return t}function Nj(e,t,n){for(;t!=n;t--)if(e.charCodeAt(t-1)==10)return t;return-1}function Pj(e,t,n){for(;t!=n;t++)if(e.charCodeAt(t)==10)return t;return-1}var Fj=e=>e>=55296&&e<=56319,Ij=e=>e>=56320&&e<=57343;function Lj(e,t){return!t||t==e.length||!Fj(e.charCodeAt(t-1))||!Ij(e.charCodeAt(t))}function Rj(e,t,n){let r=n?.override;return r?r(e,t):(lj=(n?.scanLimit??1e9)>>1,uj=n?.timeout?Date.now()+n.timeout:0,dj=!1,wj(e,t,cj(e,0,e.length,t,0,t.length)))}function zj(){return!dj}function Bj(e,t,n){return Tj(Rj(e,t,n),e,t)}var Vj=Zu.define({combine:e=>e[0]}),Hj=Ru.define(),Uj=Zu.define(),Wj=Bu.define({create(e){return null},update(e,t){for(let n of t.effects)n.is(Hj)&&(e=n.value);for(let n of t.state.facet(Uj))e=n(e,t);return e}});function Gj(e){let t=e.field(Wj,!1);if(!t)return null;let n=e.facet(Vj);return{chunks:t,side:n?n.side:null}}var Kj=class e{constructor(e,t,n,r,i,a=!0){this.changes=e,this.fromA=t,this.toA=n,this.fromB=r,this.toB=i,this.precise=a}offset(t,n){return t||n?new e(this.changes,this.fromA+t,this.toA+t,this.fromB+n,this.toB+n,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,t,n){return Yj(Bj(e.toString(),t.toString(),n),e,t,0,0,zj())}static updateA(e,t,n,r,i){return $j(Qj(e,r,!0,n.length),e,t,n,i)}static updateB(e,t,n,r,i){return $j(Qj(e,r,!1,t.length),e,t,n,i)}};function qj(e,t,n,r){let i=n.lineAt(e),a=r.lineAt(t);return i.to==e&&a.to==t&&e<n.length&&t<r.length?[e+1,t+1]:[i.from,a.from]}function Jj(e,t,n,r){let i=n.lineAt(e),a=r.lineAt(t);return i.from==e&&a.from==t?[e,t]:[i.to+1,a.to+1]}function Yj(e,t,n,r,i,a){let o=[];for(let s=0;s<e.length;s++){let c=e[s],[l,u]=qj(c.fromA+r,c.fromB+i,t,n),[d,f]=Jj(c.toA+r,c.toB+i,t,n),p=[c.offset(-l+r,-u+i)];for(;s<e.length-1;){let a=e[s+1],[o,c]=qj(a.fromA+r,a.fromB+i,t,n);if(o>d+1&&c>f+1)break;p.push(a.offset(-l+r,-u+i)),[d,f]=Jj(a.toA+r,a.toB+i,t,n),s++}o.push(new Kj(p,l,Math.max(l,d),u,Math.max(u,f),a))}return o}var Xj=1e3;function Zj(e,t,n,r){let i=0,a=e.length;for(;;){if(i==a){let r=0,a=0;i&&({toA:r,toB:a}=e[i-1]);let o=t-(n?r:a);return[r+o,a+o]}let o=i+a>>1,s=e[o],[c,l]=n?[s.fromA,s.toA]:[s.fromB,s.toB];if(c>t)a=o;else if(l<=t)i=o+1;else return r?[s.fromA,s.fromB]:[s.toA,s.toB]}}function Qj(e,t,n,r){let i=[];return t.iterChangedRanges((a,o,s,c)=>{let l=0,u=n?t.length:r,d=0,f=n?r:t.length;a>Xj&&([l,d]=Zj(e,a-Xj,n,!0)),o<t.length-Xj&&([u,f]=Zj(e,o+Xj,n,!1));let p=c-s-(o-a),m,[h,g]=n?[p,0]:[0,p];i.length&&(m=i[i.length-1]).toA>=l?i[i.length-1]={fromA:m.fromA,fromB:m.fromB,toA:u,toB:f,diffA:m.diffA+h,diffB:m.diffB+g}:i.push({fromA:l,toA:u,fromB:d,toB:f,diffA:h,diffB:g})}),i}function $j(e,t,n,r,i){if(!e.length)return t;let a=[];for(let o=0,s=0,c=0,l=0;;o++){let u=o==e.length?null:e[o],d=u?u.fromA+s:n.length,f=u?u.fromB+c:r.length;for(;l<t.length;){let e=t[l];if(u&&(e.toA+s>d||e.toB+c>f))break;a.push(e.offset(s,c)),l++}if(!u)break;let p=u.toA+s+u.diffA,m=u.toB+c+u.diffB,h=Bj(n.sliceString(d,p),r.sliceString(f,m),i);for(let e of Yj(h,n,r,d,f,zj()))a.push(e);for(s+=u.diffA,c+=u.diffB;l<t.length;){let e=t[l];if(e.fromA+s>p&&e.fromB+c>m)break;l++}}return a}var eM={scanLimit:500},tM=Ku.fromClass(class{constructor(e){({deco:this.deco,gutter:this.gutter}=dM(e))}update(e){(e.docChanged||e.viewportChanged||rM(e.startState,e.state)||iM(e.startState,e.state))&&({deco:this.deco,gutter:this.gutter}=dM(e.view))}},{decorations:e=>e.deco}),nM=Yu.low(Qu({class:`cm-changeGutter`,markers:e=>e.plugin(tM)?.gutter||Uu.empty}));function rM(e,t){return e.field(Wj,!1)!=t.field(Wj,!1)}function iM(e,t){return e.facet(Vj)!=t.facet(Vj)}var aM=Vu.line({class:`cm-changedLine`}),oM=Vu.mark({class:`cm-changedText`}),sM=Vu.mark({tagName:`ins`,class:`cm-insertedLine`}),cM=Vu.mark({tagName:`del`,class:`cm-deletedLine`}),lM=new class extends Ju{constructor(){super(...arguments),this.elementClass=`cm-changedLineGutter`}};function uM(e,t,n,r,i,a){let o=n?e.fromA:e.fromB,s=n?e.toA:e.toB,c=0;if(o!=s){i.add(o,o,aM),i.add(o,s,n?cM:sM),a&&a.add(o,o,lM);for(let l=t.iterRange(o,s-1),u=o;!l.next().done;){if(l.lineBreak){u++,i.add(u,u,aM),a&&a.add(u,u,lM);continue}let t=u+l.value.length;if(r)for(;c<e.changes.length;){let r=e.changes[c],a=o+(n?r.fromA:r.fromB),s=o+(n?r.toA:r.toB),l=Math.max(u,a),d=Math.min(t,s);if(l<d&&i.add(l,d,oM),s<t)c++;else break}u=t}}}function dM(e){let t=e.state.field(Wj),{side:n,highlightChanges:r,markGutter:i,overrideChunk:a}=e.state.facet(Vj),o=n==`a`,s=new Wu,c=i?new Wu:null,{from:l,to:u}=e.viewport;for(let n of t){if((o?n.fromA:n.fromB)>=u)break;(o?n.toA:n.toB)>l&&(!a||!a(e.state,n,s,c))&&uM(n,e.state.doc,o,r,s,c)}return{deco:s.finish(),gutter:c&&c.finish()}}var fM=class extends Iu{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement(`div`);return e.className=`cm-mergeSpacer`,e.style.height=this.height+`px`,e}updateDOM(e){return e.style.height=this.height+`px`,!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}},pM=Ru.define({map:(e,t)=>e.map(t)}),mM=Bu.define({create:()=>Vu.none,update:(e,t)=>{for(let e of t.effects)if(e.is(pM))return e.value;return e.map(t.changes)},provide:e=>qu.decorations.from(e)}),hM=.01;function gM(e,t){if(e.size!=t.size)return!1;let n=e.iter(),r=t.iter();for(;n.value;){if(n.from!=r.from||Math.abs(n.value.spec.widget.height-r.value.spec.widget.height)>1)return!1;n.next(),r.next()}return!0}function _M(e,t,n){let r=new Wu,i=new Wu,a=e.state.field(mM).iter(),o=t.state.field(mM).iter(),s=0,c=0,l=0,u=0,d=e.viewport,f=t.viewport;for(let p=0;;p++){let m=p<n.length?n[p]:null,h=m?m.fromA:e.state.doc.length,g=m?m.fromB:t.state.doc.length;if(s<h){let n=e.lineBlockAt(s).top+l-(t.lineBlockAt(c).top+u);n<-hM?(l-=n,r.add(s,s,Vu.widget({widget:new fM(-n),block:!0,side:-1}))):n>hM&&(u+=n,i.add(c,c,Vu.widget({widget:new fM(n),block:!0,side:-1})))}if(h>s+1e3&&s<d.from&&h>d.from&&c<f.from&&g>f.from){let e=Math.min(d.from-s,f.from-c);s+=e,c+=e,p--}else if(m)s=m.toA,c=m.toB;else break;for(;a.value&&a.from<s;)l-=a.value.spec.widget.height,a.next();for(;o.value&&o.from<c;)u-=o.value.spec.widget.height,o.next()}for(;a.value;)l-=a.value.spec.widget.height,a.next();for(;o.value;)u-=o.value.spec.widget.height,o.next();let p=e.contentHeight+l-(t.contentHeight+u);p<hM?r.add(e.state.doc.length,e.state.doc.length,Vu.widget({widget:new fM(-p),block:!0,side:1})):p>hM&&i.add(t.state.doc.length,t.state.doc.length,Vu.widget({widget:new fM(p),block:!0,side:1}));let m=r.finish(),h=i.finish();gM(m,e.state.field(mM))||e.dispatch({effects:pM.of(m)}),gM(h,t.state.field(mM))||t.dispatch({effects:pM.of(h)})}var vM=Ru.define({map:(e,t)=>t.mapPos(e)}),yM=class extends Iu{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let t=document.createElement(`div`);return t.className=`cm-collapsedLines`,t.textContent=e.state.phrase(`$ unchanged lines`,this.lines),t.addEventListener(`click`,t=>{let n=e.posAtDOM(t.target);e.dispatch({effects:vM.of(n)});let{side:r,sibling:i}=e.state.facet(Vj);i&&i().dispatch({effects:vM.of(bM(n,e.state.field(Wj),r==`a`))})}),t}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return`collapsed-unchanged-code`}};function bM(e,t,n){let r=0,i=0;for(let a=0;;a++){let o=a<t.length?t[a]:null;if(!o||(n?o.fromA:o.fromB)>=e)return i+(e-r);[r,i]=n?[o.toA,o.toB]:[o.toB,o.toA]}}var xM=Bu.define({create(e){return Vu.none},update(e,t){e=e.map(t.changes);for(let n of t.effects)n.is(vM)&&(e=e.update({filter:e=>e!=n.value}));if(e.size&&t.state.field(Wj)!=t.startState.field(Wj,!1)){let n=t.state.facet(Vj).side==`a`,r=[];for(let i of t.state.field(Wj))e.between(n?i.fromA:i.fromB,n?i.toA:i.toB,e=>{r.push(e)});r.length&&(e=e.update({filter:e=>r.indexOf(e)<0}))}return e},provide:e=>qu.decorations.from(e)});function SM({margin:e=3,minSize:t=4}){return xM.init(n=>CM(n,e,t))}function CM(e,t,n){let r=new Wu,i=e.facet(Vj).side==`a`,a=e.field(Wj),o=1;for(let s=0;;s++){let c=s<a.length?a[s]:null,l=s?o+t:1,u=c?e.doc.lineAt(i?c.fromA:c.fromB).number-1-t:e.doc.lines,d=u-l+1;if(d>=n&&r.add(e.doc.line(l).from,e.doc.line(u).to,Vu.replace({widget:new yM(d),block:!0})),!c)break;o=e.doc.lineAt(Math.min(e.doc.length,i?c.toA:c.toB)).number}return r.finish()}var wM=qu.styleModule.of(new td({".cm-mergeView":{overflowY:`auto`},".cm-mergeViewEditors":{display:`flex`,alignItems:`stretch`},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:`hidden`},".cm-merge-revert":{width:`1.6em`,flexGrow:0,flexShrink:0,position:`relative`},".cm-merge-revert button":{position:`absolute`,display:`block`,width:`100%`,boxSizing:`border-box`,textAlign:`center`,background:`none`,border:`none`,font:`inherit`,cursor:`pointer`}})),TM=qu.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:`auto !important`,overflowY:`visible !important`},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:`rgba(160, 128, 100, .08)`},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:`rgba(100, 160, 128, .08)`},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:`linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat`},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:`linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat`},"&light.cm-merge-b .cm-changedText":{background:`linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat`},"&dark.cm-merge-b .cm-changedText":{background:`linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat`},"&.cm-merge-b .cm-deletedText":{background:`#ff000033`},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:`none`},".cm-deletedChunk":{paddingLeft:`6px`,"& .cm-chunkButtons":{position:`absolute`,insetInlineEnd:`5px`},"& button":{border:`none`,cursor:`pointer`,color:`white`,margin:`0 2px`,borderRadius:`3px`,"&[name=accept]":{background:`#2a2`},"&[name=reject]":{background:`#d43`}}},".cm-collapsedLines":{padding:`5px 5px 5px 10px`,cursor:`pointer`,"&:before":{content:`"⦚"`,marginInlineEnd:`7px`},"&:after":{content:`"⦚"`,marginInlineStart:`7px`}},"&light .cm-collapsedLines":{color:`#444`,background:`linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)`},"&dark .cm-collapsedLines":{color:`#ddd`,background:`linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)`},".cm-changeGutter":{width:`3px`,paddingLeft:`1px`},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:`#e43`},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:`#fa9`},"&light.cm-merge-b .cm-changedLineGutter":{background:`#2b2`},"&dark.cm-merge-b .cm-changedLineGutter":{background:`#8f8`},".cm-inlineChangedLineGutter":{background:`#75d`}}),EM=new Lu,DM=new Lu,OM=class{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||eM;let t=[Yu.low(tM),TM,wM,mM,qu.updateListener.of(e=>{this.measuring<0&&(e.heightChanged||e.viewportChanged)&&!e.transactions.some(e=>e.effects.some(e=>e.is(pM)))&&this.measure()})],n=[Vj.of({side:`a`,sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&n.push(nM);let r=Gu.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],qu.editorAttributes.of({class:`cm-merge-a`}),DM.of(n),t]}),i=[Vj.of({side:`b`,sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&i.push(nM);let a=Gu.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],qu.editorAttributes.of({class:`cm-merge-b`}),DM.of(i),t]});this.chunks=Kj.build(r.doc,a.doc,this.diffConf);let o=[Wj.init(()=>this.chunks),EM.of(e.collapseUnchanged?SM(e.collapseUnchanged):[])];r=r.update({effects:Ru.appendConfig.of(o)}).state,a=a.update({effects:Ru.appendConfig.of(o)}).state,this.dom=document.createElement(`div`),this.dom.className=`cm-mergeView`,this.editorDOM=this.dom.appendChild(document.createElement(`div`)),this.editorDOM.className=`cm-mergeViewEditors`;let s=e.orientation||`a-b`,c=document.createElement(`div`);c.className=`cm-mergeViewEditor`;let l=document.createElement(`div`);l.className=`cm-mergeViewEditor`,this.editorDOM.appendChild(s==`a-b`?c:l),this.editorDOM.appendChild(s==`a-b`?l:c),this.a=new qu({state:r,parent:c,root:e.root,dispatchTransactions:e=>this.dispatch(e,this.a)}),this.b=new qu({state:a,parent:l,root:e.root,dispatchTransactions:e=>this.dispatch(e,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls==`b-to-a`,e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,t){if(e.some(e=>e.docChanged)){let n=e[e.length-1],r=e.reduce((e,t)=>e.compose(t.changes),ed.empty(e[0].startState.doc.length));this.chunks=t==this.a?Kj.updateA(this.chunks,n.newDoc,this.b.state.doc,r,this.diffConf):Kj.updateB(this.chunks,this.a.state.doc,n.newDoc,r,this.diffConf),t.update([...e,n.state.update({effects:Hj.of(this.chunks)})]);let i=t==this.a?this.b:this.a;i.update([i.state.update({effects:Hj.of(this.chunks)})]),this.scheduleMeasure()}else t.update(e)}reconfigure(e){if(`diffConfig`in e&&(this.diffConf=e.diffConfig),`orientation`in e){let t=e.orientation!=`b-a`;if(t!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let e=this.a.dom.parentNode,n=this.b.dom.parentNode;e.remove(),n.remove(),this.editorDOM.insertBefore(t?e:n,this.editorDOM.firstChild),this.editorDOM.appendChild(t?n:e),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent=``)}}if(`revertControls`in e||`renderRevertControl`in e){let t=!!this.revertDOM,n=this.revertToA,r=this.renderRevert;`revertControls`in e&&(t=!!e.revertControls,n=e.revertControls==`b-to-a`),`renderRevertControl`in e&&(r=e.renderRevertControl),this.setupRevertControls(t,n,r)}let t=`highlightChanges`in e,n=`gutter`in e,r=`collapseUnchanged`in e;if(t||n||r){let i=[],a=[];if(t||n){let r=this.a.state.facet(Vj),o=n?e.gutter!==!1:r.markGutter,s=t?e.highlightChanges!==!1:r.highlightChanges;i.push(DM.reconfigure([Vj.of({side:`a`,sibling:()=>this.b,highlightChanges:s,markGutter:o}),o?nM:[]])),a.push(DM.reconfigure([Vj.of({side:`b`,sibling:()=>this.a,highlightChanges:s,markGutter:o}),o?nM:[]]))}if(r){let t=EM.reconfigure(e.collapseUnchanged?SM(e.collapseUnchanged):[]);i.push(t),a.push(t)}this.a.dispatch({effects:i}),this.b.dispatch({effects:a})}this.scheduleMeasure()}setupRevertControls(e,t,n){this.revertToA=t,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=n,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement(`div`),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener(`mousedown`,e=>this.revertClicked(e)),this.revertDOM.className=`cm-merge-revert`):this.revertDOM&&(this.revertDOM.textContent=``)}scheduleMeasure(){this.measuring<0&&(this.measuring=(this.dom.ownerDocument.defaultView||window).requestAnimationFrame(()=>{this.measuring=-1,this.measure()}))}measure(){_M(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,t=e.firstChild,n=this.a.viewport,r=this.b.viewport;for(let i=0;i<this.chunks.length;i++){let a=this.chunks[i];if(a.fromA>n.to||a.fromB>r.to)break;if(a.fromA<n.from||a.fromB<r.from)continue;let o=this.a.lineBlockAt(a.fromA).top+`px`;for(;t&&+t.dataset.chunk<i;)t=kM(t);t&&t.dataset.chunk==String(i)?(t.style.top!=o&&(t.style.top=o),t=t.nextSibling):e.insertBefore(this.renderRevertButton(o,i),t)}for(;t;)t=kM(t)}renderRevertButton(e,t){let n;if(this.renderRevert)n=this.renderRevert();else{n=document.createElement(`button`);let e=this.a.state.phrase(`Revert this chunk`);n.setAttribute(`aria-label`,e),n.setAttribute(`title`,e),n.textContent=this.revertToLeft?`⇜`:`⇝`}return n.style.top=e,n.setAttribute(`data-chunk`,String(t)),n}revertClicked(e){let t=e.target,n;for(;t&&t.parentNode!=this.revertDOM;)t=t.parentNode;if(t&&(n=this.chunks[t.dataset.chunk])){let[t,r,i,a,o,s]=this.revertToA?[this.b,this.a,n.fromB,n.toB,n.fromA,n.toA]:[this.a,this.b,n.fromA,n.toA,n.fromB,n.toB],c=t.state.sliceDoc(i,Math.max(i,a-1));i!=a&&s<=r.state.doc.length&&(c+=t.state.lineBreak),r.dispatch({changes:{from:o,to:Math.min(r.state.doc.length,s),insert:c},userEvent:`revert`}),e.preventDefault()}}destroy(){this.a.destroy(),this.b.destroy(),this.measuring>-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}};function kM(e){let t=e.nextSibling;return e.remove(),t}var AM=new class extends Ju{constructor(){super(...arguments),this.elementClass=`cm-deletedLineGutter`}},jM=Yu.low(Qu({class:`cm-changeGutter`,markers:e=>e.plugin(tM)?.gutter||Uu.empty,widgetMarker:(e,t)=>t instanceof IM?AM:null}));function MM(e){let t=typeof e.original==`string`?Hu.of(e.original.split(/\r?\n/)):e.original,n=e.diffConfig||eM;return[Yu.low(tM),VM,TM,qu.editorAttributes.of({class:`cm-merge-b`}),Uj.of((e,t)=>{let r=t.effects.find(e=>e.is(NM));return r&&(e=Kj.updateA(e,r.value.doc,t.startState.doc,r.value.changes,n)),t.docChanged&&(e=Kj.updateB(e,t.state.field(PM),t.newDoc,t.changes,n)),e}),Vj.of({highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1,syntaxHighlightDeletions:e.syntaxHighlightDeletions!==!1,syntaxHighlightDeletionsMaxLength:3e3,mergeControls:e.mergeControls??!0,overrideChunk:e.allowInlineDiffs?qM:void 0,side:`b`}),PM.init(()=>t),e.gutter===!1?[]:jM,e.collapseUnchanged?SM(e.collapseUnchanged):[],Wj.init(e=>Kj.build(t,e.doc,n))]}var NM=Ru.define(),PM=Bu.define({create:()=>Hu.empty,update(e,t){for(let n of t.effects)n.is(NM)&&(e=n.value.doc);return e}}),FM=new WeakMap,IM=class extends Iu{constructor(e){super(),this.buildDOM=e,this.dom=null}eq(e){return this.dom==e.dom}toDOM(e){return this.dom||=this.buildDOM(e)}};function LM(e,t,n){let r=FM.get(t.changes);if(r)return r;let i=Vu.widget({block:!0,side:-1,widget:new IM(r=>{let{highlightChanges:i,syntaxHighlightDeletions:a,syntaxHighlightDeletionsMaxLength:o,mergeControls:s}=e.facet(Vj),c=document.createElement(`div`);if(c.className=`cm-deletedChunk`,s){let t=c.appendChild(document.createElement(`div`));t.className=`cm-chunkButtons`;let n=e=>{e.preventDefault(),RM(r,r.posAtDOM(c))},i=e=>{e.preventDefault(),zM(r,r.posAtDOM(c))};if(typeof s==`function`)t.appendChild(s(`accept`,n)),t.appendChild(s(`reject`,i));else{let r=t.appendChild(document.createElement(`button`));r.name=`accept`,r.textContent=e.phrase(`Accept`),r.onmousedown=n;let a=t.appendChild(document.createElement(`button`));a.name=`reject`,a.textContent=e.phrase(`Reject`),a.onmousedown=i}}if(n||t.fromA>=t.toA)return c;let l=r.state.field(PM).sliceString(t.fromA,t.endA),u=a&&e.facet(Xu),d=h(),f=t.changes,p=0,m=!1;function h(){let e=c.appendChild(document.createElement(`div`));return e.className=`cm-deletedLine`,e.appendChild(document.createElement(`del`))}function g(e,t,n){for(let r=e;r<t;){if(l.charAt(r)==`
12
+ `){d.firstChild||d.appendChild(document.createElement(`br`)),d=h(),r++;continue}let e=t,a=n+(m?` cm-deletedText`:``),o=!1,s=l.indexOf(`
13
+ `,r);if(s>-1&&s<t&&(e=s),i&&p<f.length){let t=Math.max(0,m?f[p].toA:f[p].fromA);t<=e&&(e=t,m&&p++,o=!0)}if(e>r){let t=document.createTextNode(l.slice(r,e));if(a){let e=d.appendChild(document.createElement(`span`));e.className=a,e.appendChild(t)}else d.appendChild(t);r=e}o&&(m=!m)}}if(u&&t.toA-t.fromA<=o){let t=u.parser.parse(l),n=0;zu(t,{style:t=>$u(e,t)},(e,t,r)=>{e>n&&g(n,e,``),g(e,t,r),n=t}),g(n,l.length,``)}else g(0,l.length,``);return d.firstChild||d.appendChild(document.createElement(`br`)),c})});return FM.set(t.changes,i),i}function RM(e,t){let{state:n}=e,r=t??n.selection.main.head,i=e.state.field(Wj).find(e=>e.fromB<=r&&e.endB>=r);if(!i)return!1;let a=e.state.sliceDoc(i.fromB,Math.max(i.fromB,i.toB-1)),o=e.state.field(PM);i.fromB!=i.toB&&i.toA<=o.length&&(a+=e.state.lineBreak);let s=ed.of({from:i.fromA,to:Math.min(o.length,i.toA),insert:a},o.length);return e.dispatch({effects:NM.of({doc:s.apply(o),changes:s}),userEvent:`accept`}),!0}function zM(e,t){let{state:n}=e,r=t??n.selection.main.head,i=n.field(Wj).find(e=>e.fromB<=r&&e.endB>=r);if(!i)return!1;let a=n.field(PM).sliceString(i.fromA,Math.max(i.fromA,i.toA-1));return i.fromA!=i.toA&&i.toB<=n.doc.length&&(a+=n.lineBreak),e.dispatch({changes:{from:i.fromB,to:Math.min(n.doc.length,i.toB),insert:a},userEvent:`revert`}),!0}function BM(e){let t=new Wu;for(let n of e.field(Wj)){let r=e.facet(Vj).overrideChunk&&UM(e,n);t.add(n.fromB,n.fromB,LM(e,n,!!r))}return t.finish()}var VM=Bu.define({create:e=>BM(e),update(e,t){return t.state.field(Wj,!1)==t.startState.field(Wj,!1)?e:BM(t.state)},provide:e=>qu.decorations.from(e)}),HM=new WeakMap;function UM(e,t){let n=HM.get(t);if(n!==void 0)return n;n=null;let r=e.field(PM),i=e.doc,a=r.lineAt(t.endA).number-r.lineAt(t.fromA).number+1,o=i.lineAt(t.endB).number-i.lineAt(t.fromB).number+1;abort:if(a==o&&a<10){let e=[],i=0,o=t.fromA,s=t.fromB;for(let n of t.changes){if(n.fromA<n.toA){i+=n.toA-n.fromA;let t=r.sliceString(o+n.fromA,o+n.toA);if(/\n/.test(t))break abort;e.push(Vu.widget({widget:new WM(t),side:-1}).range(s+n.fromB))}n.fromB<n.toB&&e.push(oM.range(s+n.fromB,s+n.toB))}i<t.endA-t.fromA-a*2&&(n=e)}return HM.set(t,n),n}var WM=class extends Iu{constructor(e){super(),this.text=e}eq(e){return this.text==e.text}toDOM(e){let t=document.createElement(`del`);return t.className=`cm-deletedText`,t.textContent=this.text,t}},GM=new class extends Ju{constructor(){super(...arguments),this.elementClass=`cm-inlineChangedLineGutter`}},KM=Vu.line({class:`cm-inlineChangedLine`});function qM(e,t,n,r){let i=UM(e,t),a=0;if(!i)return!1;for(let o=e.doc.lineAt(t.fromB);;){for(r&&r.add(o.from,o.from,GM),n.add(o.from,o.from,KM);a<i.length&&i[a].to<=o.to;){let e=i[a++];n.add(e.from,e.to,e.value)}if(o.to>=t.endB)break;o=e.doc.lineAt(o.to+1)}return!0}var JM=nd({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}}),YM=id({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}}),XM=qu.theme({".cm-deletedChunk .cm-chunkButtons":{display:`flex`,gap:`0.25rem`},".cm-deletedChunk .cm-chunkButtons button[data-slot='button']":{margin:`0`,border:`1px solid transparent`,borderRadius:`min(var(--radius-md), 10px)`,color:`var(--primary-foreground)`},".cm-deletedChunk .cm-chunkButtons button[data-slot='button'][data-variant='destructive']":{color:`var(--destructive)`}});function ZM({addControl:e,nextId:t,removeControl:n,root:r}){return(i,a)=>{let o=document.createElement(`span`);o.className=`inline-flex`;let s=t();return e({id:s,host:o,type:i,action:a}),queueMicrotask(()=>{r.contains(o)||n(s)}),o}}function QM(e){let t=(0,$.c)(33),{oldContent:n,newContent:r,layout:i,conflictMode:a,previewMode:o,oursOverride:s,onResolve:c,onAbort:l}=e,{_:u}=gt(),d=s??r,f=(0,Q.useRef)(null),p=(0,Q.useRef)(null),m=(0,Q.useRef)(0),{resolvedTheme:h}=Lt(),g=(0,Q.useRef)(c),_=(0,Q.useRef)(l),[v,y]=(0,Q.useState)(null),b;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(b=[],t[0]=b):b=t[0];let[x,S]=(0,Q.useState)(b),C=oj(a===!0),w;t[1]!==l||t[2]!==c?(w=()=>{g.current=c,_.current=l},t[1]=l,t[2]=c,t[3]=w):w=t[3],(0,Q.useEffect)(w);let T,E;t[4]!==a||t[5]!==d||t[6]!==i||t[7]!==n||t[8]!==o||t[9]!==h?(T=()=>{let e=f.current;if(!e)return;S([]);let t=new Map,r=!1,s=e=>{r||!t.delete(e)||S(t=>t.filter(t=>t.id!==e))},c=new MutationObserver(()=>{for(let[n,r]of t)e.contains(r)||s(n)});c.observe(e,{childList:!0,subtree:!0});let l=h===`dark`?JM:YM,u=[qu.editable.of(!1),Gu.readOnly.of(!0)],g=[nf,ad(),...u,l,qu.lineWrapping];if(p.current&&=(p.current.destroy(),null),o)p.current=new qu({doc:d,extensions:g,parent:e}),y(null);else if(a){let i=ZM({addControl:e=>{r||(t.set(e.id,e.host),S(t=>[...t,e]))},nextId:()=>(m.current+=1,m.current),removeControl:s,root:e}),a=new qu({doc:d,extensions:[nf,ad(),qu.editable.of(!1),l,XM,qu.lineWrapping,MM({original:n,highlightChanges:!0,gutter:!0,mergeControls:i,collapseUnchanged:{margin:3,minSize:4}}),qu.updateListener.of(e=>{let t=Gj(e.state);y(t?t.chunks.length:0)})],parent:e});p.current=a;let o=Gj(a.state);y(o?o.chunks.length:0)}else i===`split`?p.current=new OM({a:{doc:n,extensions:g},b:{doc:d,extensions:g},parent:e,highlightChanges:!0,gutter:!0,collapseUnchanged:{margin:3,minSize:4}}):p.current=new qu({doc:d,extensions:[...g,MM({original:n,highlightChanges:!0,gutter:!0,mergeControls:!1,collapseUnchanged:{margin:3,minSize:4}})],parent:e});return()=>{r=!0,c.disconnect(),p.current&&=(p.current.destroy(),null)}},E=[n,d,i,h,a,o],t[4]=a,t[5]=d,t[6]=i,t[7]=n,t[8]=o,t[9]=h,t[10]=T,t[11]=E):(T=t[10],E=t[11]),(0,Q.useEffect)(T,E);let D;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(D=function(){let e=p.current;!e||!(e instanceof qu)||g.current?.(e.state.doc.toString())},t[12]=D):D=t[12];let O=D,k;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(k=function(){let e=p.current;!e||!(e instanceof qu)||rd(e)},t[13]=k):k=t[13];let A=k,j=v===0,M;t[14]!==u||t[15]!==v?(M=v===null?``:v===0?u({id:`lPzyrU`}):Cl._({id:`8FqTCr`,values:{chunksRemaining:v}}),t[14]=u,t[15]=v,t[16]=M):M=t[16];let N=M,P;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Z.jsx)(`div`,{ref:f,className:`diff-view min-h-0 flex-1 overflow-y-auto subtle-scrollbar`}),t[17]=P):P=t[17];let F;if(t[18]!==u||t[19]!==x){let e;t[21]===u?e=t[22]:(e=e=>(0,iT.createPortal)((0,Z.jsx)(X,{type:`button`,variant:e.type===`accept`?`default`:`destructive`,size:`xs`,onClick:t=>{e.action(t.nativeEvent)},children:e.type===`accept`?u({id:`g3UF2V`}):u({id:`1t_NnN`})}),e.host,e.id),t[21]=u,t[22]=e),F=x.map(e),t[18]=u,t[19]=x,t[20]=F}else F=t[20];let I;t[23]!==j||t[24]!==C||t[25]!==a||t[26]!==N||t[27]!==l||t[28]!==c?(I=a&&(0,Z.jsxs)(`div`,{ref:C,className:`flex items-center justify-between gap-2 px-3 py-2 border-t shrink-0`,children:[(0,Z.jsx)(`span`,{className:`text-xs ${j?`text-emerald-600 dark:text-emerald-400`:`text-muted-foreground`}`,children:N}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[l&&(0,Z.jsx)(X,{className:`uppercase font-mono`,variant:`ghost`,size:`sm`,onClick:l,children:(0,Z.jsx)(J,{id:`XyOUTJ`})}),(0,Z.jsx)(X,{className:`uppercase font-mono`,variant:`outline`,size:`sm`,onClick:A,children:`Undo`}),c&&(0,Z.jsx)(X,{variant:`default`,size:`sm`,disabled:!j,onClick:O,children:(0,Z.jsx)(J,{id:`Lcehxn`})})]})]}),t[23]=j,t[24]=C,t[25]=a,t[26]=N,t[27]=l,t[28]=c,t[29]=I):I=t[29];let L;return t[30]!==I||t[31]!==F?(L=(0,Z.jsxs)(`div`,{className:`flex flex-col h-full`,children:[P,F,I]}),t[30]=I,t[31]=F,t[32]=L):L=t[32],L}async function $M(e,t,n){try{let r={file:e,strategy:t};n!==void 0&&(r.content=n);let i=await fetch(`/api/sync/resolve-conflict`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(r)});if(i.ok)return{ok:!0};let a;try{let e=await i.json();typeof e.detail==`string`?a=e.detail:typeof e.title==`string`&&(a=e.title)}catch{}return{ok:!1,detail:a}}catch(n){let r=n instanceof Error?n.message:String(n);return console.warn(JSON.stringify({event:`conflict-resolve-dispatch-failed`,file:e,strategy:t,detail:r})),{ok:!1,detail:r}}}async function eN(e,t){return $M(e,`content`,t)}async function tN(e){return $M(e,`mine`)}async function nN(e){return $M(e,`theirs`)}async function rN(e){return $M(e,`delete`)}async function iN(e){try{let t=await fetch(`/api/sync/conflict-content?file=${encodeURIComponent(e)}&source=ytext`);if(!t.ok){let n;try{let e=await t.json();typeof e.detail==`string`?n=e.detail:typeof e.title==`string`&&(n=e.title)}catch{}return console.warn(JSON.stringify({event:`conflict-content-fetch-failed`,file:e,status:t.status,detail:n})),null}let n=await t.json(),r=n.kind===`delete-modify`||n.kind===`modify-delete`||n.kind===`both-modified`?n.kind:`both-modified`;return n.kind!==r&&console.warn(JSON.stringify({event:`conflict-kind-missing-fallback`,file:e,receivedKind:n.kind??null})),{base:n.base??``,ours:n.ours??``,theirs:n.theirs??``,kind:r}}catch(t){return console.warn(JSON.stringify({event:`conflict-content-fetch-failed`,file:e,status:null,detail:t instanceof Error?t.message:String(t)})),null}}function aN(e){let t=(0,$.c)(86),{docName:n}=e,{_:r}=gt(),{conflicts:i,loading:a}=Ds(),o;if(t[0]!==i||t[1]!==n){let e;t[3]===n?e=t[4]:(e=e=>fu(e.file)===n,t[3]=n,t[4]=e),o=i.find(e),t[0]=i,t[1]=n,t[2]=o}else o=t[2];let s=o,c=s?.file??`${n}.md`,[l,u]=(0,Q.useState)(null),[d,f]=(0,Q.useState)(!1),[p,m]=(0,Q.useState)(!1),h=oj(l?.kind===`delete-modify`||l?.kind===`modify-delete`),g,_;t[5]===n?(g=t[6],_=t[7]):(g=()=>(console.warn(JSON.stringify({event:`editor-area-swap-to-diffview`,"doc.name":n})),()=>{console.warn(JSON.stringify({event:`editor-area-swap-from-diffview`,"doc.name":n}))}),_=[n],t[5]=n,t[6]=g,t[7]=_),(0,Q.useEffect)(g,_);let v=a||s===void 0,y,b;t[8]!==v||t[9]!==c?(y=()=>{if(v)return;let e=!1;return u(null),f(!1),iN(c).then(t=>{e||(t===null?f(!0):u(t))}),()=>{e=!0}},b=[c,v],t[8]=v,t[9]=c,t[10]=y,t[11]=b):(y=t[10],b=t[11]),(0,Q.useEffect)(y,b);let x;t[12]!==r||t[13]!==c?(x=async function(e){let t=await eN(c,e);t.ok||gl.error(r({id:`K-h9cT`,values:{filePath:c}}),{description:t.detail})},t[12]=r,t[13]=c,t[14]=x):x=t[14];let S=x,C;t[15]!==r||t[16]!==c?(C=async function(e){m(!0);let t=await e(c);t.ok||(m(!1),gl.error(r({id:`jPUPvG`,values:{filePath:c}}),{description:t.detail}))},t[15]=r,t[16]=c,t[17]=C):C=t[17];let w=C;if(d){let e;return t[18]===c?e=t[19]:(e=(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center p-6 text-sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`ajz9F8`,values:{filePath:c}})}),t[18]=c,t[19]=e),e}if(l===null){let e;return t[20]===c?e=t[21]:(e=(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center p-6 text-sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`DF1MtZ`,values:{filePath:c}})}),t[20]=c,t[21]=e),e}if(l.kind===`delete-modify`){let e;t[22]===l.theirs?e=t[23]:(e=(0,Z.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Z.jsx)(QM,{oldContent:``,newContent:l.theirs,layout:`unified`,previewMode:!0})}),t[22]=l.theirs,t[23]=e);let n;t[24]===c?n=t[25]:(n={filePath:c},t[24]=c,t[25]=n);let r;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(r={0:(0,Z.jsx)(`span`,{className:`font-medium text-foreground`})},t[26]=r):r=t[26];let i;t[27]===n?i=t[28]:(i=(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`V48OUT`,values:n,components:r})}),t[27]=n,t[28]=i);let a;t[29]===w?a=t[30]:(a=()=>void w(rN),t[29]=w,t[30]=a);let o;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(J,{id:`Vlc75q`}),t[31]=o):o=t[31];let s;t[32]!==p||t[33]!==a?(s=(0,Z.jsx)(X,{type:`button`,variant:`destructive`,disabled:p,onClick:a,children:o}),t[32]=p,t[33]=a,t[34]=s):s=t[34];let u;t[35]===w?u=t[36]:(u=()=>void w(nN),t[35]=w,t[36]=u);let d;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(J,{id:`3mFsc3`}),t[37]=d):d=t[37];let f;t[38]!==p||t[39]!==u?(f=(0,Z.jsx)(X,{type:`button`,variant:`default`,disabled:p,onClick:u,children:d}),t[38]=p,t[39]=u,t[40]=f):f=t[40];let m;t[41]!==s||t[42]!==f?(m=(0,Z.jsxs)(`div`,{className:`flex shrink-0 gap-3`,children:[s,f]}),t[41]=s,t[42]=f,t[43]=m):m=t[43];let g;t[44]!==h||t[45]!==i||t[46]!==m?(g=(0,Z.jsxs)(`div`,{ref:h,className:`flex flex-shrink-0 flex-wrap items-center justify-between gap-x-6 gap-y-3 border-t px-6 py-4`,children:[i,m]}),t[44]=h,t[45]=i,t[46]=m,t[47]=g):g=t[47];let _;return t[48]!==g||t[49]!==e?(_=(0,Z.jsxs)(`div`,{className:`flex h-full flex-col bg-background`,children:[e,g]}),t[48]=g,t[49]=e,t[50]=_):_=t[50],_}if(l.kind===`modify-delete`){let e;t[51]===l.ours?e=t[52]:(e=(0,Z.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Z.jsx)(QM,{oldContent:``,newContent:l.ours,layout:`unified`,previewMode:!0})}),t[51]=l.ours,t[52]=e);let n;t[53]===c?n=t[54]:(n={filePath:c},t[53]=c,t[54]=n);let r;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(r={0:(0,Z.jsx)(`span`,{className:`font-medium text-foreground`})},t[55]=r):r=t[55];let i;t[56]===n?i=t[57]:(i=(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`EhDLBx`,values:n,components:r})}),t[56]=n,t[57]=i);let a;t[58]===w?a=t[59]:(a=()=>void w(tN),t[58]=w,t[59]=a);let o;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(J,{id:`0NA4b3`}),t[60]=o):o=t[60];let s;t[61]!==p||t[62]!==a?(s=(0,Z.jsx)(X,{type:`button`,variant:`default`,disabled:p,onClick:a,children:o}),t[61]=p,t[62]=a,t[63]=s):s=t[63];let u;t[64]===w?u=t[65]:(u=()=>void w(rN),t[64]=w,t[65]=u);let d;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(J,{id:`qSxaOz`}),t[66]=d):d=t[66];let f;t[67]!==p||t[68]!==u?(f=(0,Z.jsx)(X,{type:`button`,variant:`destructive`,disabled:p,onClick:u,children:d}),t[67]=p,t[68]=u,t[69]=f):f=t[69];let m;t[70]!==s||t[71]!==f?(m=(0,Z.jsxs)(`div`,{className:`flex shrink-0 gap-3`,children:[s,f]}),t[70]=s,t[71]=f,t[72]=m):m=t[72];let g;t[73]!==h||t[74]!==i||t[75]!==m?(g=(0,Z.jsxs)(`div`,{ref:h,className:`flex flex-shrink-0 flex-wrap items-center justify-between gap-x-6 gap-y-3 border-t px-6 py-4`,children:[i,m]}),t[73]=h,t[74]=i,t[75]=m,t[76]=g):g=t[76];let _;return t[77]!==g||t[78]!==e?(_=(0,Z.jsxs)(`div`,{className:`flex h-full flex-col bg-background`,children:[e,g]}),t[77]=g,t[78]=e,t[79]=_):_=t[79],_}let T;t[80]===S?T=t[81]:(T=e=>void S(e),t[80]=S,t[81]=T);let E;return t[82]!==l.ours||t[83]!==l.theirs||t[84]!==T?(E=(0,Z.jsx)(QM,{oldContent:l.theirs,newContent:l.ours,layout:`unified`,conflictMode:!0,onResolve:T}),t[82]=l.ours,t[83]=l.theirs,t[84]=T,t[85]=E):E=t[85],E}function oN(e){let t=(0,$.c)(2),{docName:n,provider:r,children:i}=e;(0,Q.use)(_e(n,r));let a;return t[0]===i?a=t[1]:(a=(0,Z.jsx)(Z.Fragment,{children:i}),t[0]=i,t[1]=a),a}var sN=`__back-nav__`;function cN(e){return e instanceof Pe||e instanceof Qe||e instanceof He||e instanceof ue||e instanceof me||e instanceof Fe?e.docName:null}function lN(e){return e instanceof Pe||e instanceof Qe}function uN(e){if(e instanceof Pe){let t=e.docName;return{title:Cl._({id:`Jejur6`}),summary:Cl._({id:`jSY41h`,values:{docName:t}})}}if(e instanceof Qe){let t=e.docName;return{title:Cl._({id:`V7QxyT`}),summary:Cl._({id:`xG4tb6`,values:{docName:t}})}}if(e instanceof He){let t=e.docName;return{title:Cl._({id:`1di5fu`}),summary:Cl._({id:`PQCdtv`,values:{docName:t}})}}if(e instanceof ue){let t=e.docName;return{title:Cl._({id:`wvbc1r`}),summary:Cl._({id:`IX7-sq`,values:{docName:t}})}}if(e instanceof me)return{title:Cl._({id:`Gfr4fu`}),summary:Cl._({id:`UW2Fg3`})};if(e instanceof Fe){let t=e.docName;return{title:Cl._({id:`vv7kpg`}),summary:Cl._({id:`mdKFEy`,values:{docName:t}})}}let t=e instanceof Error&&e.message?e.message:Cl._({id:`W5A0Ly`});return{title:Cl._({id:`29VNqC`}),summary:t}}function dN(e){let t=(0,$.c)(37),{error:n,resetErrorBoundary:r,activeDocName:i,previousDocName:a,onNavigateBack:o}=e,s;t[0]===n?s=t[1]:(s=uN(n),t[0]=n,t[1]=s);let{title:c,summary:l}=s,u=!!a&&!!o,d=(0,Q.useRef)(null),[f,p]=(0,Q.useState)(!1),m=typeof window<`u`?window.okDesktop:void 0,h=m&&lN(n)?m:null,g,_;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{d.current?.focus()},_=[],t[2]=g,t[3]=_):(g=t[2],_=t[3]),(0,Q.useEffect)(g,_);let v;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsx)(em,{size:80,variant:`sleeping`}),t[4]=v):v=t[4];let y;t[5]===c?y=t[6]:(y=(0,Z.jsx)(`h2`,{id:`document-error-title`,className:`text-2xl font-light tracking-tighter text-balance`,children:c}),t[5]=c,t[6]=y);let b;t[7]===l?b=t[8]:(b=(0,Z.jsx)(`p`,{className:`max-w-sm text-sm text-muted-foreground`,children:l}),t[7]=l,t[8]=b);let x;t[9]!==y||t[10]!==b?(x=(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[y,b]}),t[9]=y,t[10]=b,t[11]=x):x=t[11];let S;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(J,{id:`KDw4GX`}),t[12]=S):S=t[12];let C;t[13]===r?C=t[14]:(C=(0,Z.jsx)(X,{ref:d,variant:`default`,onClick:r,children:S}),t[13]=r,t[14]=C);let w;t[15]===h?w=t[16]:(w=h?(0,Z.jsx)(X,{variant:`secondary`,onClick:()=>{Ay(h).then(pN).catch(fN)},children:(0,Z.jsx)(J,{id:`uaUc6t`})}):null,t[15]=h,t[16]=w);let T;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(T=m?(0,Z.jsx)(X,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>p(!0),children:(0,Z.jsx)(J,{id:`ii5mVn`})}):null,t[17]=T):T=t[17];let E;t[18]!==i||t[19]!==u||t[20]!==n||t[21]!==o||t[22]!==a||t[23]!==r?(E=u?(0,Z.jsx)(X,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>{!a||!o||(it(cN(n)??i),o(a),r(sN))},children:(0,Z.jsx)(J,{id:`CKyk7Q`})}):null,t[18]=i,t[19]=u,t[20]=n,t[21]=o,t[22]=a,t[23]=r,t[24]=E):E=t[24];let D;t[25]!==w||t[26]!==E||t[27]!==C?(D=(0,Z.jsxs)(`div`,{className:`mt-1 flex gap-2`,children:[C,w,T,E]}),t[25]=w,t[26]=E,t[27]=C,t[28]=D):D=t[28];let O;t[29]!==i||t[30]!==n||t[31]!==f?(O=m?(0,Z.jsx)(lm,{open:f,onOpenChange:p,crashContext:{source:`document view`,docName:cN(n)??i,errorMessage:n instanceof Error&&n.message?n.message:String(n),componentStack:lh(n)}}):null,t[29]=i,t[30]=n,t[31]=f,t[32]=O):O=t[32];let k;return t[33]!==D||t[34]!==O||t[35]!==x?(k=(0,Z.jsxs)(`div`,{role:`alert`,"aria-labelledby":`document-error-title`,"data-slot":`document-error-boundary`,className:`flex h-full flex-col items-center justify-center gap-8 p-8 text-center`,children:[v,x,D,O]}),t[33]=D,t[34]=O,t[35]=x,t[36]=k):k=t[36],k}function fN(){}function pN(e){e.ok||gl.error(e.message,{id:`server-restart-error`,duration:1/0})}function mN(e){let t=(0,$.c)(17),{activeDocName:n,previousDocName:r,onNavigateBack:i,onRecycle:a,children:o}=e,s;t[0]!==n||t[1]!==i||t[2]!==r?(s=e=>(0,Z.jsx)(dN,{...e,activeDocName:n,previousDocName:r,onNavigateBack:i}),t[0]=n,t[1]=i,t[2]=r,t[3]=s):s=t[3];let c;t[4]===n?c=t[5]:(c=[n],t[4]=n,t[5]=c);let l;t[6]!==n||t[7]!==a?(l=e=>{if(e.reason===`imperative-api`){if(Array.isArray(e.args)&&e.args[0]===sN){console.warn(`[DocumentErrorBoundary] back-nav reset (no recycle)`);return}a(n),console.warn(`[DocumentErrorBoundary] retry recycled ${n}`)}else console.warn(`[DocumentErrorBoundary] reset by key change (${e.prev?.[0]} → ${e.next?.[0]})`)},t[6]=n,t[7]=a,t[8]=l):l=t[8];let u;t[9]===n?u=t[10]:(u=(e,t)=>{ch(e,t.componentStack),console.error(`[DocumentErrorBoundary] rendered fallback for ${n}: ${uN(e).title}`,e,t.componentStack??``)},t[9]=n,t[10]=u);let d;return t[11]!==o||t[12]!==s||t[13]!==c||t[14]!==l||t[15]!==u?(d=(0,Z.jsx)(Yt,{fallbackRender:s,resetKeys:c,onReset:l,onError:u,children:o}),t[11]=o,t[12]=s,t[13]=c,t[14]=l,t[15]=u,t[16]=d):d=t[16],d}function hN(e){let t=e.document.getText(`source`).toString(),{map:n,parseError:r}=Ga(t);return{map:n,keys:Fi(t),parseError:r}}function gN(e){let t=(0,$.c)(21),{provider:n}=e,r;t[0]===n?r=t[1]:(r=()=>hN(n),t[0]=n,t[1]=r);let[i,a]=(0,Q.useState)(r),o,s;t[2]===n?(o=t[3],s=t[4]):(o=()=>{let e=eo(n);a(e.current());let t=e.subscribe(e=>{a(e)});return()=>{t(),e.dispose()}},s=[n],t[2]=n,t[3]=o,t[4]=s),(0,Q.useEffect)(o,s);let c;t[5]===i.map.icon?c=t[6]:(c=we(i.map.icon),t[5]=i.map.icon,t[6]=c);let l=c,u;t[7]===i.map.cover?u=t[8]:(u=Ee(i.map.cover),t[7]=i.map.cover,t[8]=u);let d=u,f=d.kind===`url`||d.kind===`path`,p=l.kind!==`unsupported`;if(!f&&!p)return null;let m=f?`true`:`false`,h=p?`true`:`false`,g;t[9]!==d||t[10]!==f?(g=f?(0,Z.jsx)(_N,{cover:d}):null,t[9]=d,t[10]=f,t[11]=g):g=t[11];let _;t[12]!==f||t[13]!==p||t[14]!==l?(_=p?(0,Z.jsx)(vN,{icon:l,hasCover:f}):null,t[12]=f,t[13]=p,t[14]=l,t[15]=_):_=t[15];let v;return t[16]!==m||t[17]!==h||t[18]!==g||t[19]!==_?(v=(0,Z.jsxs)(`div`,{className:`page-header editor-content-aligned`,"data-has-cover":m,"data-has-icon":h,"aria-hidden":`true`,"data-testid":`page-header`,children:[g,_]}),t[16]=m,t[17]=h,t[18]=g,t[19]=_,t[20]=v):v=t[20],v}function _N(e){let t=(0,$.c)(2),{cover:n}=e,r;return t[0]===n.value?r=t[1]:(r=(0,Z.jsx)(`div`,{className:`page-header-cover`,"data-testid":`page-header-cover`,children:(0,Z.jsx)(`img`,{src:n.value,alt:``,draggable:!1,loading:`lazy`,referrerPolicy:`no-referrer`,className:`page-header-cover-img`})}),t[0]=n.value,t[1]=r),r}function vN(e){let t=(0,$.c)(9),{icon:n,hasCover:r}=e,i=r?`page-header-icon page-header-icon--with-cover`:`page-header-icon`;if(n.kind===`emoji`){let e;return t[0]!==n.value||t[1]!==i?(e=(0,Z.jsx)(`span`,{className:i,"data-testid":`page-header-icon`,"data-kind":`emoji`,children:n.value}),t[0]=n.value,t[1]=i,t[2]=e):e=t[2],e}let a;t[3]===n.value?a=t[4]:(a=(0,Z.jsx)(`img`,{src:n.value,alt:``,draggable:!1,referrerPolicy:`no-referrer`,className:`page-header-icon-img`}),t[3]=n.value,t[4]=a);let o;return t[5]!==n.kind||t[6]!==i||t[7]!==a?(o=(0,Z.jsx)(`span`,{className:i,"data-testid":`page-header-icon`,"data-kind":n.kind,children:a}),t[5]=n.kind,t[6]=i,t[7]=a,t[8]=o):o=t[8],o}function yN(e,t){if(!t)return{kind:`absent`};if(t.getClientRects().length===0)return{kind:`unmeasurable`};let n=e.getBoundingClientRect().top;return{kind:`measured`,contentPos:t.getBoundingClientRect().top-n+e.scrollTop}}function bN(e,t,n){if(t===null)return e;switch(n.kind){case`measured`:return n.contentPos+t;case`absent`:return e;case`unmeasurable`:return null;default:return SN(n)}}function xN(e){switch(e.kind){case`measured`:case`absent`:return!0;case`unmeasurable`:return!1;default:return SN(e)}}function SN(e){throw Error(`Unhandled AnchorMeasurement variant: ${JSON.stringify(e)}`)}function CN(e,t){return Math.abs(e-t)<=1}function wN(e,t){return t-e>1}var TN=1e4,EN=(0,Q.lazy)(async()=>({default:(await n(async()=>{let{ManagedArtifactProperties:e}=await import(`./ManagedArtifactProperties-Bv97X2Kw.js`);return{ManagedArtifactProperties:e}},__vite__mapDeps([139,1,6,2,3,7,8,9,10,11,12,15,16,72,73,74,75,76,77,78,79,80,81,82,83,31,84,68,22,85,86,87,47,4,88,30,14,17,19,49,24,25,29,18,20,36,35,23,26,27,89,90,37,38,40,61,62,63,43,65,91,92,28,32,60,64,66,67,93,94,95,96,33,21,97,98,99,100,39,41,101,102,140,111,13,112,113,50,141,142,127,136,143,42,123]),import.meta.url)).ManagedArtifactProperties})),DN=(0,Q.lazy)(async()=>({default:(await n(async()=>{let{MermaidDocEditor:e}=await import(`./MermaidDocEditor-peOyXfDP.js`);return{MermaidDocEditor:e}},__vite__mapDeps([144,1,73,74,9,84,6,2,3,7,8,68,12,22,11,85,86,87,10,90,75,76,77,78,79,80,81,82,83,31,47,15,16,26,37,38,40,17,61,62,63,43,65,145,146,147]),import.meta.url)).MermaidDocEditor})),ON=du(`LARGE_DOC_CHAR_THRESHOLD`,5e5);function kN(e){let t=e.threshold??ON;return e.ytextLength>t?{renderSource:e.isSourceMode||e.visitedSource,renderVisual:!e.isSourceMode||e.visitedVisual,isLarge:!0}:{renderSource:!0,renderVisual:!0,isLarge:!1}}function AN(e){return e.hasEmittedFirstToggle||!e.isLarge?!1:e.renderSource&&e.renderVisual}var jN=du(`ACTIVITY_MOUNT_LIMIT`,3);function MN(){return n(()=>import(`./SourceEditor-C5A403lL.js`),__vite__mapDeps([148,1,73,74,9,79,146,6,2,3,7,8,84,68,12,22,11,85,86,87,72,75,76,77,78,80,81,82,83,31,47,10,4,88,30,14,15,16,17,19,49,24,25,29,18,20,36,35,23,26,27,89,90,37,38,40,61,62,63,43,65,91,92,28,32,60,64,66,67,93,94,95,96,33,21,97,98,99,100,39,41,101,102,147,149,48,50,51,120,150,132,70,134,136,122,143]),import.meta.url)}var NN=(0,Q.lazy)(async()=>({default:(await MN()).SourceEditor}));function PN(e,t,n){if(n<=0)return[];let r=e.filter(e=>!Ge(e.docName)),i=[...r].sort((e,t)=>t.lastAccessedAt-e.lastAccessedAt).slice(0,n);if(t===null||i.some(e=>e.docName===t))return i;let a=r.find(e=>e.docName===t);return a?[...i.slice(0,n-1),a]:i}function FN(e,t){return t.kind===`idle`?null:t.kind===`failed`&&t.failedDocNames.includes(e)?{kind:`failed`,title:Cl._({id:`MTs6g3`}),summary:t.reason===`clear-data-timeout`?Cl._({id:`Sc1bKE`,values:{docName:e}}):Cl._({id:`ovIGrT`,values:{docName:e}}),actionLabel:Cl._({id:`HpK_8d`})}:t.kind===`recovering`&&t.docNames.includes(e)?{kind:`recovering`,title:Cl._({id:`cF9DyA`}),summary:t.phase===`clearing-local-cache`?Cl._({id:`bmC18N`,values:{docName:e}}):Cl._({id:`pAgkuZ`,values:{docName:e}})}:null}function IN(e){let t=(0,$.c)(2),n;return t[0]===e?n=t[1]:(n=(0,Z.jsx)(uu,{name:`activity-pool`,children:(0,Z.jsx)(LN,{...e})}),t[0]=e,t[1]=n),n}function LN(e){let t=(0,$.c)(15),{activeDocName:n,isSourceMode:r,editorPlaceholder:i,previousDocName:a,onNavigateBack:o,onRecycle:s}=e,{poolEntries:c,serverRestartRecovery:l}=Ye(),{pages:u,loading:d}=Go(),f=PN(c,n,jN),p=(0,Q.useRef)(``),m=f.map(RN).join(`,`),h=(0,Q.useRef)(c),g,_;t[0]===c?(g=t[1],_=t[2]):(g=()=>{h.current=c},_=[c],t[0]=c,t[1]=g,t[2]=_),(0,Q.useLayoutEffect)(g,_),(0,Q.useLayoutEffect)(()=>{if(p.current===m)return;let e=p.current?p.current.split(`,`):[],t=m?m.split(`,`):[],r=e.filter(e=>!t.includes(e)),i=t.filter(t=>!e.includes(t));for(let e of r)Re(e);for(let e of i){let t=h.current.find(t=>t.docName===e)?.poolEventId;Te(e,t&&t.length>0?t:crypto.randomUUID())}lu(`ok/activity/mount-list-change`,{active:n,mounted:t,evicted:r}),p.current=m,ge(t)},[m,n]);let v;t[3]!==n||t[4]!==i||t[5]!==r||t[6]!==d||t[7]!==o||t[8]!==s||t[9]!==u||t[10]!==a||t[11]!==l?(v=e=>(0,Z.jsx)(qN,{entry:e,isActive:e.docName===n,isSourceMode:r,editorPlaceholder:i,isNewDoc:!d&&!u.has(e.docName)&&!lo(e.docName)&&!Di(e.docName),previousDocName:a,onNavigateBack:o,onRecycle:s,serverRestartRecovery:l},e.docName),t[3]=n,t[4]=i,t[5]=r,t[6]=d,t[7]=o,t[8]=s,t[9]=u,t[10]=a,t[11]=l,t[12]=v):v=t[12];let y=f.map(v),b;return t[13]===y?b=t[14]:(b=(0,Z.jsx)(Z.Fragment,{children:y}),t[13]=y,t[14]=b),b}function RN(e){return e.docName}var zN=256,BN=new Map;function VN(e,t){if(BN.delete(e),BN.set(e,t),BN.size>zN){let e=BN.keys().next().value;e!==void 0&&BN.delete(e)}}function HN(e){let t=(0,$.c)(15),{isActive:n,docName:r,initialScrollTop:i,bodyAnchorRef:a,children:o}=e,s=(0,Q.useRef)(null),c=(0,Q.useRef)(i??0),l=(0,Q.useRef)(null),u=(0,Q.useRef)(n),d=(0,Q.useRef)(!1),f,p;t[0]===n?(f=t[1],p=t[2]):(f=()=>{u.current=n},p=[n],t[0]=n,t[1]=f,t[2]=p),(0,Q.useEffect)(f,p);let m,h;t[3]!==a||t[4]!==r?(m=()=>{let e=s.current;if(!e)return;let t=()=>{if(!(!u.current||d.current)&&e.scrollTop>0){let t=yN(e,a?.current);if(!xN(t))return;c.current=e.scrollTop,l.current=t.kind===`measured`?t.contentPos:null,t.kind===`measured`&&VN(r,e.scrollTop-t.contentPos)}};return e.addEventListener(`scroll`,t,{passive:!0}),()=>e.removeEventListener(`scroll`,t)},h=[a,r],t[3]=a,t[4]=r,t[5]=m,t[6]=h):(m=t[5],h=t[6]),(0,Q.useEffect)(m,h);let g,_;t[7]!==a||t[8]!==r||t[9]!==n?(g=()=>{if(!n)return;let e=s.current;if(!e)return;let t=c.current,i=BN.get(r),o=l.current===null?null:t-l.current,u=i??o;if(t===0&&u===null)return;let f=()=>bN(t,u,yN(e,a?.current));d.current=!0;let p=e.style.overflowAnchor;e.style.overflowAnchor=`none`;let m=performance.now(),h=!1,g=!1,_=f();_!==null&&(e.scrollTop=_,CN(e.scrollTop,_)&&e.scrollHeight>_&&(g=!0,lu(`ok/scroll-restore/phase1-success`,{target:_,elapsedMs:performance.now()-m})));let v=e.scrollTop,y=!1,b=0,x=()=>{y||(y=!0,d.current=!1,e.style.overflowAnchor=p,cancelAnimationFrame(b),clearTimeout(w),e.removeEventListener(`wheel`,S),e.removeEventListener(`touchstart`,S),e.removeEventListener(`mousedown`,S),e.removeEventListener(`keydown`,S))},S=()=>{g||lu(`ok/scroll-restore/yielded`,{reason:`user`,elapsedMs:performance.now()-m,finalScrollTop:e.scrollTop}),x()};e.addEventListener(`wheel`,S,{passive:!0}),e.addEventListener(`touchstart`,S,{passive:!0}),e.addEventListener(`mousedown`,S),e.addEventListener(`keydown`,S);let C=()=>{if(!y){if(wN(v,e.scrollTop)){g||lu(`ok/scroll-restore/yielded`,{reason:`external`,elapsedMs:performance.now()-m,finalScrollTop:e.scrollTop}),x();return}_=f(),_!==null&&!CN(e.scrollTop,_)&&e.scrollHeight>_&&(e.scrollTop=_,CN(e.scrollTop,_)&&!h&&(lu(`ok/scroll-restore/phase2-success`,{target:_,elapsedMs:performance.now()-m}),h=!0,g=!0)),v=e.scrollTop,b=requestAnimationFrame(C)}};b=requestAnimationFrame(C);let w=setTimeout(()=>{if(y)return;let t=f();(t===null||!CN(e.scrollTop,t)&&e.scrollHeight>t)&&lu(`ok/scroll-restore/abandoned`,{...t===null?{}:{target:t},anchorMeasurable:t!==null,elapsedMs:performance.now()-m,scrollHeight:e.scrollHeight,finalScrollTop:e.scrollTop}),x()},TN);return x},_=[n,a,r],t[7]=a,t[8]=r,t[9]=n,t[10]=g,t[11]=_):(g=t[10],_=t[11]),(0,Q.useLayoutEffect)(g,_);let v;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(v={overflowAnchor:`auto`},t[12]=v):v=t[12];let y;return t[13]===o?y=t[14]:(y=(0,Z.jsx)(`div`,{ref:s,"data-testid":`editor-scroll-container`,className:`editor-doc-scroll subtle-scrollbar h-full overflow-y-auto pt-14 scroll-pt-14`,style:v,children:o}),t[13]=o,t[14]=y),y}function UN(e){let t=(0,$.c)(12),{entry:n,isActive:r,isSourceMode:i,editorPlaceholder:a}=e,o=r&&i,[s,c]=(0,Q.useState)(o),l,u;if(t[0]===o?(l=t[1],u=t[2]):(l=()=>{o&&c(!0)},u=[o],t[0]=o,t[1]=l,t[2]=u),(0,Q.useEffect)(l,u),!s&&!o)return null;let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(yC,{}),t[3]=d):d=t[3];let f=n.docName,p;t[4]===n.provider.document?p=t[5]:(p=n.provider.document.getText(`source`),t[4]=n.provider.document,t[5]=p);let m;return t[6]!==a||t[7]!==n.docName||t[8]!==n.provider||t[9]!==o||t[10]!==p?(m=(0,Z.jsx)(Q.Suspense,{fallback:d,children:(0,Z.jsx)(NN,{docName:f,ytext:p,provider:n.provider,placeholder:a,isSourceModeActive:o})}),t[6]=a,t[7]=n.docName,t[8]=n.provider,t[9]=o,t[10]=p,t[11]=m):m=t[11],m}function WN(e){let t=(0,$.c)(18),{view:n}=e,r=n.kind===`failed`,i=r?`alert`:`status`,a=!r,o;t[0]===r?o=t[1]:(o=(0,Z.jsx)(`div`,{className:`flex size-12 items-center justify-center rounded-full border bg-muted text-muted-foreground`,children:r?(0,Z.jsx)(tl,{className:`size-5`,"aria-hidden":`true`}):(0,Z.jsx)(Xc,{className:`size-5 animate-spin`,"aria-hidden":`true`})}),t[0]=r,t[1]=o);let s;t[2]===n.title?s=t[3]:(s=(0,Z.jsx)(`h2`,{className:`text-lg font-medium`,children:n.title}),t[2]=n.title,t[3]=s);let c;t[4]===n.summary?c=t[5]:(c=(0,Z.jsx)(`p`,{className:`max-w-md text-sm text-muted-foreground`,children:n.summary}),t[4]=n.summary,t[5]=c);let l;t[6]!==s||t[7]!==c?(l=(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[s,c]}),t[6]=s,t[7]=c,t[8]=l):l=t[8];let u;t[9]!==r||t[10]!==n.actionLabel?(u=r?(0,Z.jsxs)(X,{type:`button`,onClick:GN,children:[(0,Z.jsx)(tl,{className:`size-4`,"aria-hidden":`true`}),n.actionLabel]}):null,t[9]=r,t[10]=n.actionLabel,t[11]=u):u=t[11];let d;return t[12]!==i||t[13]!==a||t[14]!==o||t[15]!==l||t[16]!==u?(d=(0,Z.jsxs)(`div`,{"data-slot":`server-restart-recovery`,role:i,"aria-busy":a,className:`flex h-full flex-col items-center justify-center gap-6 p-8 text-center`,children:[o,l,u]}),t[12]=i,t[13]=a,t[14]=o,t[15]=l,t[16]=u,t[17]=d):d=t[17],d}function GN(){return window.location.reload()}function KN(e){let t=(0,$.c)(2),{html:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(`div`,{className:`tiptap-editor h-full pointer-events-none`,"aria-hidden":`true`,children:(0,Z.jsx)(`div`,{className:`tiptap ProseMirror tiptap-editor-portal-content`,dangerouslySetInnerHTML:{__html:n}})}),t[0]=n,t[1]=r),r}function qN(e){let t=(0,$.c)(57),{entry:n,isActive:r,isSourceMode:i,editorPlaceholder:a,isNewDoc:o,previousDocName:s,onNavigateBack:c,onRecycle:l,serverRestartRecovery:u}=e,d;t[0]!==n.docName||t[1]!==u?(d=FN(n.docName,u),t[0]=n.docName,t[1]=u,t[2]=d):d=t[2];let f=d,p=nE(n.docName)===`conflict`,m;t[3]===n.docName?m=t[4]:(m=Di(n.docName),t[3]=n.docName,t[4]=m);let h=m,g;t[5]===n.docName?g=t[6]:(g=()=>{let e=document.createElement(`div`);return e.setAttribute(`data-ok-editor-portal`,n.docName),e.style.display=`contents`,e},t[5]=n.docName,t[6]=g);let[_]=(0,Q.useState)(g),v=(0,Q.useRef)(null),y=n.provider.document.getText(`source`).length,[b,x]=(0,Q.useState)(i),[S,C]=(0,Q.useState)(!i),w,T;t[7]!==i||t[8]!==b||t[9]!==S?(w=()=>{i&&!b?x(!0):!i&&!S&&C(!0)},T=[i,b,S],t[7]=i,t[8]=b,t[9]=S,t[10]=w,t[11]=T):(w=t[10],T=t[11]),(0,Q.useEffect)(w,T);let E=kN({ytextLength:y,isSourceMode:i,visitedSource:b,visitedVisual:S}),D=(0,Q.useRef)(``),O=`${E.isLarge}-${E.renderSource}-${E.renderVisual}`,k,A;t[12]!==n.docName||t[13]!==E.isLarge||t[14]!==E.renderSource||t[15]!==E.renderVisual||t[16]!==O||t[17]!==i||t[18]!==y?(k=()=>{D.current!==O&&(D.current=O,E.isLarge&&lu(`ok/activity/defer-mount`,{docName:n.docName,ytextLength:y,isSourceMode:i,renderSource:E.renderSource,renderVisual:E.renderVisual}))},A=[O,E.isLarge,E.renderSource,E.renderVisual,n.docName,y,i],t[12]=n.docName,t[13]=E.isLarge,t[14]=E.renderSource,t[15]=E.renderVisual,t[16]=O,t[17]=i,t[18]=y,t[19]=k,t[20]=A):(k=t[19],A=t[20]),(0,Q.useEffect)(k,A);let j;t[21]===n.docName?j=t[22]:(j=()=>et(n.docName),t[21]=n.docName,t[22]=j);let[M]=(0,Q.useState)(j),N=M?.html??null,[P,F]=(0,Q.useState)(!1),I,L;t[23]!==n.docName||t[24]!==E.isLarge||t[25]!==E.renderSource||t[26]!==E.renderVisual||t[27]!==P||t[28]!==i||t[29]!==y?(L=()=>{AN({isLarge:E.isLarge,renderSource:E.renderSource,renderVisual:E.renderVisual,hasEmittedFirstToggle:P})&&(lu(`ok/cold/first-toggle`,{docName:n.docName,mountId:De(n.docName),ytextLength:y,modeEnteredFirst:i?`source`:`visual`}),F(!0))},I=[P,E.isLarge,E.renderSource,E.renderVisual,n.docName,y,i],t[23]=n.docName,t[24]=E.isLarge,t[25]=E.renderSource,t[26]=E.renderVisual,t[27]=P,t[28]=i,t[29]=y,t[30]=I,t[31]=L):(I=t[30],L=t[31]),(0,Q.useEffect)(L,I);let R=r?`visible`:`hidden`,z=`editor:${n.docName}`,B=M?.scrollTop,V;t[32]!==a||t[33]!==n||t[34]!==E.renderSource||t[35]!==E.renderVisual||t[36]!==r||t[37]!==p||t[38]!==h||t[39]!==o||t[40]!==i||t[41]!==c||t[42]!==l||t[43]!==_||t[44]!==s||t[45]!==f||t[46]!==N?(V=f?(0,Z.jsx)(WN,{view:f}):(0,Z.jsx)(Z.Fragment,{children:(0,Z.jsx)(mN,{activeDocName:n.docName,previousDocName:s,onNavigateBack:c,onRecycle:l,children:(0,Z.jsx)(Q.Suspense,{fallback:N?(0,Z.jsx)(KN,{html:N}):(0,Z.jsx)(yC,{}),children:(0,Z.jsx)(oN,{docName:n.docName,provider:n.provider,children:p?(0,Z.jsx)(aN,{docName:n.docName,provider:n.provider}):h?(0,Z.jsx)(DN,{docName:n.docName,provider:n.provider,isSourceMode:i}):(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[!i&&(lo(n.docName)||be(n.docName)?(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(EN,{docName:n.docName,provider:n.provider})}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(gN,{provider:n.provider}),(0,Z.jsx)(Io,{provider:n.provider})]})),(0,Z.jsx)(`div`,{ref:v,"aria-hidden":!0,className:`h-0`}),(0,Z.jsxs)(`div`,{className:`relative flex-1`,children:[E.renderSource?(0,Z.jsx)(`div`,{className:i?`h-full`:`ok-mode-hidden h-full`,children:(0,Z.jsx)(UN,{entry:n,isActive:r,isSourceMode:i,editorPlaceholder:a})}):null,E.renderVisual?(0,Z.jsx)(`div`,{className:i?`ok-mode-hidden h-full`:`h-full`,children:(0,Z.jsx)(tj,{provider:n.provider,placeholder:a,isSourceMode:i,portalTarget:_},`${n.docName}-${String(o)}-${n.poolEventId}`)}):null]})]})})})})}),t[32]=a,t[33]=n,t[34]=E.renderSource,t[35]=E.renderVisual,t[36]=r,t[37]=p,t[38]=h,t[39]=o,t[40]=i,t[41]=c,t[42]=l,t[43]=_,t[44]=s,t[45]=f,t[46]=N,t[47]=V):V=t[47];let H;t[48]!==n.docName||t[49]!==r||t[50]!==B||t[51]!==V?(H=(0,Z.jsx)(HN,{isActive:r,docName:n.docName,initialScrollTop:B,bodyAnchorRef:v,children:V}),t[48]=n.docName,t[49]=r,t[50]=B,t[51]=V,t[52]=H):H=t[52];let U;return t[53]!==R||t[54]!==z||t[55]!==H?(U=(0,Z.jsx)(Q.Activity,{mode:R,name:z,children:H}),t[53]=R,t[54]=z,t[55]=H,t[56]=U):U=t[56],U}function JN(e){let t=e.endsWith(`rem`)?`rem`:`px`;return{value:Number.parseFloat(e),unit:t}}function YN(e){let{value:t,unit:n}=JN(e);return n===`rem`?t*16:t}function XN(e,t){return`${t===`rem`?e.toFixed(1):Math.round(e)}${t}`}var ZN=3600*24*7;function QN(e){let t=(0,$.c)(28),{direction:n,currentWidth:r,onResize:i,onToggle:a,isCollapsed:o,minResizeWidth:s,maxResizeWidth:c,enableToggle:l,enableAutoCollapse:u,autoCollapseThreshold:d,expandThreshold:f,enableDrag:p,setIsDraggingRail:m,widthCookieName:h,widthCookieMaxAge:g,isNested:_}=e,v=n===void 0?`right`:n,y=o===void 0?!1:o,b=s===void 0?`14rem`:s,x=c===void 0?`24rem`:c,S=l===void 0?!0:l,C=u===void 0?!0:u,w=d===void 0?1.5:d,T=f===void 0?.2:f,E=p===void 0?!0:p,D=m===void 0?$N:m,O=g===void 0?ZN:g,k=_===void 0?!1:_,A=(0,Q.useRef)(null),j=(0,Q.useRef)(0),M=(0,Q.useRef)(0),N=(0,Q.useRef)(!1),P=(0,Q.useRef)(!1),F=(0,Q.useRef)(null),I=(0,Q.useRef)(0),L=(0,Q.useRef)(!1),R=(0,Q.useRef)(0),z=(0,Q.useRef)(0),B=(0,Q.useRef)(null),V=(0,Q.useRef)(r),H=(0,Q.useRef)(y),U,W;t[0]===r?(U=t[1],W=t[2]):(U=()=>{V.current=r},W=[r],t[0]=r,t[1]=U,t[2]=W),(0,Q.useEffect)(U,W);let G,K;t[3]===y?(G=t[4],K=t[5]):(G=()=>{H.current=y},K=[y],t[3]=y,t[4]=G,t[5]=K),(0,Q.useEffect)(G,K);let ee=YN(b),te;t[6]===x?te=t[7]:(te=YN(x),t[6]=x,t[7]=te);let ne=te,q;t[8]!==E||t[9]!==k?(q=function(e){E&&(P.current=!0,j.current=H.current?0:YN(V.current),M.current=e.clientX,I.current=e.clientX,F.current=null,L.current=!1,R.current=0,z.current=0,B.current=k&&A.current?A.current.getBoundingClientRect():null,e.preventDefault())},t[8]=E,t[9]=k,t[10]=q):q=t[10];let re=q,ie,ae;t[11]!==w||t[12]!==v||t[13]!==C||t[14]!==S||t[15]!==T||t[16]!==k||t[17]!==ne||t[18]!==ee||t[19]!==i||t[20]!==a||t[21]!==D||t[22]!==O||t[23]!==h?(ie=()=>{let e=function(e){h&&(document.cookie=`${h}=${e}; path=/; max-age=${O}`)},t=function(e,t){return v===`left`?e<t:e>t},n=function(e,t,n,r){if(k&&r){let r=e.clientX-t;return v===`left`?n-r:n+r}return v===`left`?window.innerWidth-e.clientX:e.clientX},r=function(r){if(!P.current)return;let o=Math.abs(r.clientX-M.current);if(!N.current&&o>5&&(N.current=!0,D(!0)),N.current){let{unit:o}=JN(V.current),s=B.current;k&&A.current&&(s=A.current.getBoundingClientRect());let c=t(r.clientX,I.current)?`expand`:`collapse`;F.current!==c&&(F.current=c),z.current=Math.abs(r.clientX-I.current);let l=Date.now();if(L.current&&l-R.current>200&&(L.current=!1),!L.current){if(C&&a&&!H.current){let e=n(r,M.current,j.current,s),t=!1;if(w<=1)t=e<=ee*w;else if(e<=ee){let n=ee*(w-1);t=ee-e>=n}if(c===`collapse`&&t){a(),I.current=r.clientX,L.current=!0,R.current=l;return}}if(a&&H.current&&c===`expand`&&z.current>ee*T){a();let t=n(r,M.current,j.current,s),c=Math.max(ee,Math.min(ne,t)),u=XN(o===`rem`?c/16:c,o);i(u),e(u),I.current=r.clientX,L.current=!0,R.current=l;return}}if(H.current)return;let u=n(r,M.current,j.current,s),d=Math.max(ee,Math.min(ne,u)),f=XN(o===`rem`?d/16:d,o);i(f),e(f)}},o=function(){P.current&&(!N.current&&a&&S&&a(),N.current=!1,P.current=!1,F.current=null,I.current=0,L.current=!1,R.current=0,z.current=0,B.current=null,D(!1))};return document.addEventListener(`mousemove`,r),document.addEventListener(`mouseup`,o),()=>{document.removeEventListener(`mousemove`,r),document.removeEventListener(`mouseup`,o)}},ae=[i,a,D,ee,ne,k,C,w,T,S,h,O,v],t[11]=w,t[12]=v,t[13]=C,t[14]=S,t[15]=T,t[16]=k,t[17]=ne,t[18]=ee,t[19]=i,t[20]=a,t[21]=D,t[22]=O,t[23]=h,t[24]=ie,t[25]=ae):(ie=t[24],ae=t[25]),(0,Q.useEffect)(ie,ae);let oe;return t[26]===re?oe=t[27]:(oe={dragRef:A,isDragging:N,handleMouseDown:re},t[26]=re,t[27]=oe),oe}function $N(){}var eP=3600*24*7,tP=`18rem`,nP=`3rem`,rP=`app-file-sidebar`,iP=`14.625rem`,aP=`32rem`,oP=`sidebar_width`,sP=/^\d+(?:\.\d+)?(?:rem|px)$/,cP=Q.createContext(null);function lP(e){if(typeof document>`u`)return e;let t=document.cookie.split(`; `).find(e=>e.startsWith(`${oP}=`))?.split(`=`)[1];if(!t)return e;let n;try{n=decodeURIComponent(t)}catch{return e}return sP.test(n)?n:e}function uP(){let e=Q.use(cP);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function dP(e){let t=(0,$.c)(58),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({open:i,onOpenChange:o,className:r,style:s,children:n,defaultWidth:c,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=c===void 0?tP:c,[u]=Q.useState(pP),d;t[8]===u?d=t[9]:(d=()=>fE(u,window.innerWidth,`left`),t[8]=u,t[9]=d);let[f,p]=Q.useState(d),m;t[10]===l?m=t[11]:(m=()=>lP(l),t[10]=l,t[11]=m);let[h,g]=Q.useState(m),[_,v]=Q.useState(!1),[y,b]=Q.useState(!1),x;t[12]===u?x=t[13]:(x=()=>{let e=yE();return xE(`left`,fE(u,window.innerWidth,`left`),e)===`open`},t[12]=u,t[13]=x);let[S,C]=Q.useState(x),w=i??S,T;t[14]!==w||t[15]!==f||t[16]!==o?(T=e=>{let t=typeof e==`function`?e(w):e;o?o(t):C(t),SE(`left`,f,t?`open`:`collapsed`)},t[14]=w,t[15]=f,t[16]=o,t[17]=T):T=t[17];let E=T,D;t[18]===E?D=t[19]:(D=function(){E(fP)},t[18]=E,t[19]=D);let O=D,k=Q.useRef(w),A;t[20]===w?A=t[21]:(A=()=>{k.current=w},t[20]=w,t[21]=A),Q.useLayoutEffect(A);let j;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(j=function(){window.innerWidth>=1024||k.current&&(window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||b(!0))},t[22]=j):j=t[22];let M=j,N,P;t[23]===u?(N=t[24],P=t[25]):(P=()=>{let e=window.matchMedia(`(min-width: ${lE}px)`),t=()=>{let e=fE(u,window.innerWidth,`left`);p(e),C(xE(`left`,e,yE())===`open`)};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},N=[u],t[23]=u,t[24]=N,t[25]=P),Q.useEffect(P,N);let F,I;t[26]===w?(F=t[27],I=t[28]):(F=()=>{w||document.getElementById(rP)?.contains(document.activeElement)&&document.querySelector(`[data-sidebar="trigger"]`)?.focus()},I=[w],t[26]=w,t[27]=F,t[28]=I),Q.useLayoutEffect(F,I);let L,R;t[29]!==w||t[30]!==f||t[31]!==E?(L=()=>{if(f===`above`||!w)return;let e=e=>{e.key===`Escape`&&(document.querySelector(`[data-state="open"][role="dialog"], [data-state="open"][role="alertdialog"], [data-state="open"][role="menu"], [data-state="open"][role="listbox"], [data-radix-popper-content-wrapper] [data-state="open"]`)||E(!1))};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},R=[f,w,E],t[29]=w,t[30]=f,t[31]=E,t[32]=L,t[33]=R):(L=t[32],R=t[33]),Q.useEffect(L,R);let z,B;t[34]===O?(z=t[35],B=t[36]):(z=()=>{if(typeof window<`u`&&window.okDesktop!=null)return;let e=e=>{El(e,`toggle-files-sidebar`)&&(e.preventDefault(),O())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},B=[O],t[34]=O,t[35]=z,t[36]=B),Q.useEffect(z,B);let V=w?`expanded`:`collapsed`,H;t[37]!==_||t[38]!==w||t[39]!==E||t[40]!==y||t[41]!==V||t[42]!==O||t[43]!==h?(H={state:V,open:w,setOpen:E,toggleSidebar:O,width:h,setWidth:g,isDraggingRail:_,setIsDraggingRail:v,showPushPulse:y,setShowPushPulse:b,notifySidebarFileSelected:M},t[37]=_,t[38]=w,t[39]=E,t[40]=y,t[41]=V,t[42]=O,t[43]=h,t[44]=H):H=t[44];let U;t[45]!==s||t[46]!==h?(U={"--sidebar-width":h,"--sidebar-width-icon":nP,...s},t[45]=s,t[46]=h,t[47]=U):U=t[47];let W=U,G;t[48]===r?G=t[49]:(G=Y(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),t[48]=r,t[49]=G);let K;t[50]!==n||t[51]!==a||t[52]!==W||t[53]!==G?(K=(0,Z.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:W,className:G,...a,children:n}),t[50]=n,t[51]=a,t[52]=W,t[53]=G,t[54]=K):K=t[54];let ee;return t[55]!==H||t[56]!==K?(ee=(0,Z.jsx)(cP.Provider,{value:H,children:K}),t[55]=H,t[56]=K,t[57]=ee):ee=t[57],ee}function fP(e){return!e}function pP(){return Wi()}function mP(e){let t=(0,$.c)(39),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({side:a,variant:o,collapsible:s,className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let c=a===void 0?`left`:a,l=o===void 0?`sidebar`:o,u=s===void 0?`offcanvas`:s,{_:d}=gt(),{state:f,isDraggingRail:p}=uP();if(u===`none`){let e;t[7]===r?e=t[8]:(e=Y(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),t[7]=r,t[8]=e);let a;return t[9]!==n||t[10]!==i||t[11]!==e||t[12]!==l?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar`,"data-variant":l,className:e,...i,children:n}),t[9]=n,t[10]=i,t[11]=e,t[12]=l,t[13]=a):a=t[13],a}let m=f===`collapsed`?u:``,h=l===`floating`||l===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`,g;t[14]===h?g=t[15]:(g=Y(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,h,`group-data-[dragging=true]:duration-0! group-data-[dragging=true]_*:!duration-0`),t[14]=h,t[15]=g);let _;t[16]===g?_=t[17]:(_=(0,Z.jsx)(`div`,{"data-slot":`sidebar-gap`,className:g}),t[16]=g,t[17]=_);let v;t[18]===d?v=t[19]:(v=d({id:`07q4Qk`}),t[18]=d,t[19]=v);let y=l===`floating`||l===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,b;t[20]!==r||t[21]!==y?(b=Y(`fixed inset-y-0 z-10 flex h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear motion-reduce:transition-none motion-reduce:duration-0 data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,y,`group-data-[dragging=true]:duration-0! group-data-[dragging=true]_*:!duration-0`,r),t[20]=r,t[21]=y,t[22]=b):b=t[22];let x;t[23]===n?x=t[24]:(x=(0,Z.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border`,children:n}),t[23]=n,t[24]=x);let S;t[25]!==i||t[26]!==c||t[27]!==b||t[28]!==x||t[29]!==v?(S=(0,Z.jsx)(`nav`,{id:rP,"aria-label":v,"data-slot":`sidebar-container`,"data-side":c,className:b,...i,children:x}),t[25]=i,t[26]=c,t[27]=b,t[28]=x,t[29]=v,t[30]=S):S=t[30];let C;return t[31]!==p||t[32]!==c||t[33]!==f||t[34]!==S||t[35]!==m||t[36]!==_||t[37]!==l?(C=(0,Z.jsxs)(`div`,{className:`group peer text-sidebar-foreground`,"data-state":f,"data-collapsible":m,"data-variant":l,"data-side":c,"data-slot":`sidebar`,"data-dragging":p,children:[_,S]}),t[31]=p,t[32]=c,t[33]=f,t[34]=S,t[35]=m,t[36]=_,t[37]=l,t[38]=C):C=t[38],C}function hP(e){let t=(0,$.c)(34),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,onClick:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{_:a}=gt(),{toggleSidebar:o,state:s}=uP(),c,l,u,d,f,p,m,h;if(t[4]!==a||t[5]!==s){let e=jl(`toggle-files-sidebar`);c=X,l=`trigger`,u=`sidebar-trigger`,d=`ghost`,f=`icon-sm`,p=s===`expanded`,m=rP,h=a(s===`expanded`?{id:`4PYsOz`,values:{sidebarShortcutLabel:e}}:{id:`jbSG8V`,values:{sidebarShortcutLabel:e}}),t[4]=a,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m,t[13]=h}else c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12],h=t[13];let g;t[14]===n?g=t[15]:(g=Y(n),t[14]=n,t[15]=g);let _;t[16]!==r||t[17]!==o?(_=e=>{r?.(e),o()},t[16]=r,t[17]=o,t[18]=_):_=t[18];let v;t[19]===s?v=t[20]:(v=s===`expanded`?(0,Z.jsx)(R,{}):(0,Z.jsx)(ag,{}),t[19]=s,t[20]=v);let y;return t[21]!==c||t[22]!==i||t[23]!==l||t[24]!==v||t[25]!==u||t[26]!==d||t[27]!==f||t[28]!==p||t[29]!==m||t[30]!==h||t[31]!==g||t[32]!==_?(y=(0,Z.jsx)(c,{"data-sidebar":l,"data-slot":u,variant:d,size:f,"aria-expanded":p,"aria-controls":m,"aria-label":h,className:g,onClick:_,...i,children:v}),t[21]=c,t[22]=i,t[23]=l,t[24]=v,t[25]=u,t[26]=d,t[27]=f,t[28]=p,t[29]=m,t[30]=h,t[31]=g,t[32]=_,t[33]=y):y=t[33],y}function gP(e){let t=(0,$.c)(32),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:n,enableDrag:a,enableToggle:o,onMouseDown:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=a===void 0?!0:a,c=o===void 0?!0:o,{_:l}=gt(),{toggleSidebar:u,setWidth:d,state:f,width:p,setIsDraggingRail:m}=uP(),h=f===`collapsed`,g;t[6]!==s||t[7]!==c||t[8]!==m||t[9]!==d||t[10]!==h||t[11]!==u||t[12]!==p?(g={direction:`right`,enableDrag:s,enableToggle:c,onResize:d,onToggle:u,currentWidth:p,isCollapsed:h,minResizeWidth:iP,maxResizeWidth:aP,setIsDraggingRail:m,widthCookieName:oP,widthCookieMaxAge:eP},t[6]=s,t[7]=c,t[8]=m,t[9]=d,t[10]=h,t[11]=u,t[12]=p,t[13]=g):g=t[13];let{dragRef:_,handleMouseDown:v}=QN(g),y;t[14]!==l||t[15]!==f?(y=l(f===`expanded`?{id:`w3vFfL`}:{id:`e8zRrb`}),t[14]=l,t[15]=f,t[16]=y):y=t[16];let b;t[17]!==v||t[18]!==r?(b=e=>{r?.(e),e.defaultPrevented||v(e)},t[17]=v,t[18]=r,t[19]=b):b=t[19];let x;t[20]!==l||t[21]!==f?(x=l(f===`expanded`?{id:`w3vFfL`}:{id:`e8zRrb`}),t[20]=l,t[21]=f,t[22]=x):x=t[22];let S;t[23]===n?S=t[24]:(S=Y(`absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2`,`in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize`,`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,`group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar`,`[[data-side=left][data-collapsible=offcanvas]_&]:-right-2`,`[[data-side=right][data-collapsible=offcanvas]_&]:-left-2`,`md:group-data-[variant=inset]:after:inset-y-5`,n),t[23]=n,t[24]=S);let C;return t[25]!==_||t[26]!==i||t[27]!==y||t[28]!==b||t[29]!==x||t[30]!==S?(C=(0,Z.jsx)(`button`,{ref:_,"data-sidebar":`rail`,"data-slot":`sidebar-rail`,"aria-label":y,tabIndex:-1,onMouseDown:b,title:x,className:S,...i}),t[25]=_,t[26]=i,t[27]=y,t[28]=b,t[29]=x,t[30]=S,t[31]=C):C=t[31],C}function _P(e){let t=(0,$.c)(14),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,onAnimationEnd:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{showPushPulse:a,setShowPushPulse:o}=uP(),s;t[4]!==r||t[5]!==o?(s=e=>{r?.(e),e.animationName===`sidebar-push-pulse`&&o(!1)},t[4]=r,t[5]=o,t[6]=s):s=t[6];let c=s,l=a?``:void 0,u;t[7]===n?u=t[8]:(u=Y(`relative flex w-full flex-1 flex-col bg-background peer-data-[variant=inset]:m-2 peer-data-[variant=inset]:ml-0 peer-data-[variant=inset]:rounded-xl peer-data-[variant=inset]:shadow-sm peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2`,n),t[7]=n,t[8]=u);let d;return t[9]!==c||t[10]!==i||t[11]!==l||t[12]!==u?(d=(0,Z.jsx)(`main`,{"data-slot":`sidebar-inset`,"data-push-pulse":l,onAnimationEnd:c,className:u,...i}),t[9]=c,t[10]=i,t[11]=l,t[12]=u,t[13]=d):d=t[13],d}function vP(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Y(`flex flex-col gap-2 p-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function yP(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Y(`flex flex-col gap-2 p-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function bP(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Y(`no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function xP(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Y(`relative flex w-full min-w-0 flex-col p-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function SP(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,asChild:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i!==void 0&&i?Xt:`div`,o;t[4]===n?o=t[5]:(o=Y(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,n),t[4]=n,t[5]=o);let s;return t[6]!==a||t[7]!==r||t[8]!==o?(s=(0,Z.jsx)(a,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:o,...r}),t[6]=a,t[7]=r,t[8]=o,t[9]=s):s=t[9],s}function CP(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,asChild:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i!==void 0&&i?Xt:`button`,o;t[4]===n?o=t[5]:(o=Y(`absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0`,n),t[4]=n,t[5]=o);let s;return t[6]!==a||t[7]!==r||t[8]!==o?(s=(0,Z.jsx)(a,{"data-slot":`sidebar-group-action`,"data-sidebar":`group-action`,className:o,...r}),t[6]=a,t[7]=r,t[8]=o,t[9]=s):s=t[9],s}function wP(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Y(`w-full text-sm`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function TP(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Y(`flex w-full min-w-0 flex-col gap-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function EP(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Y(`group/menu-item relative`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var DP=$t(`peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-hover hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-hover active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-hover data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground data-active:hover:bg-sidebar-accent [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate`,{variants:{variant:{default:`hover:bg-sidebar-hover hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-hover hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function OP(e){let t=(0,$.c)(28),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({asChild:i,isActive:a,variant:o,size:s,tooltip:c,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=i===void 0?!1:i,u=a===void 0?!1:a,d=o===void 0?`default`:o,f=s===void 0?`default`:s,p=l?Xt:`button`,{state:m}=uP(),h;t[8]!==n||t[9]!==f||t[10]!==d?(h=Y(DP({variant:d,size:f}),n),t[8]=n,t[9]=f,t[10]=d,t[11]=h):h=t[11];let g;t[12]!==p||t[13]!==u||t[14]!==r||t[15]!==f||t[16]!==h?(g=(0,Z.jsx)(p,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":f,"data-active":u,className:h,...r}),t[12]=p,t[13]=u,t[14]=r,t[15]=f,t[16]=h,t[17]=g):g=t[17];let _=g;if(!c)return _;if(typeof c==`string`){let e;t[18]===c?e=t[19]:(e={children:c},t[18]=c,t[19]=e),c=e}let v;t[20]===_?v=t[21]:(v=(0,Z.jsx)(on,{asChild:!0,children:_}),t[20]=_,t[21]=v);let y=m!==`collapsed`,b;t[22]!==y||t[23]!==c?(b=(0,Z.jsx)(sn,{side:`right`,align:`center`,hidden:y,...c}),t[22]=y,t[23]=c,t[24]=b):b=t[24];let x;return t[25]!==v||t[26]!==b?(x=(0,Z.jsxs)(ln,{children:[v,b]}),t[25]=v,t[26]=b,t[27]=x):x=t[27],x}function kP(e){let t=(0,$.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,asChild:i,showOnHover:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?!1:i,s=a===void 0?!1:a,c=o?Xt:`button`,l=s&&`group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-active/menu-button:text-sidebar-accent-foreground aria-expanded:opacity-100 md:opacity-0`,u;t[5]!==n||t[6]!==l?(u=Y(`absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0`,l,n),t[5]=n,t[6]=l,t[7]=u):u=t[7];let d;return t[8]!==c||t[9]!==r||t[10]!==u?(d=(0,Z.jsx)(c,{"data-slot":`sidebar-menu-action`,"data-sidebar":`menu-action`,className:u,...r}),t[8]=c,t[9]=r,t[10]=u,t[11]=d):d=t[11],d}function AP(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Y(`mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5 group-data-[collapsible=icon]:hidden`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`ul`,{"data-slot":`sidebar-menu-sub`,"data-sidebar":`menu-sub`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function jP(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Y(`group/menu-sub-item relative`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`li`,{"data-slot":`sidebar-menu-sub-item`,"data-sidebar":`menu-sub-item`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function MP(e){let t=(0,$.c)(14),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({asChild:i,size:a,isActive:o,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=i===void 0?!1:i,c=a===void 0?`md`:a,l=o===void 0?!1:o,u=s?Xt:`a`,d;t[6]===n?d=t[7]:(d=Y(`flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden group-data-[collapsible=icon]:hidden hover:bg-sidebar-hover hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-hover active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[size=md]:text-sm data-[size=sm]:text-xs data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground data-active:hover:bg-sidebar-accent [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground`,n),t[6]=n,t[7]=d);let f;return t[8]!==u||t[9]!==l||t[10]!==r||t[11]!==c||t[12]!==d?(f=(0,Z.jsx)(u,{"data-slot":`sidebar-menu-sub-button`,"data-sidebar":`menu-sub-button`,"data-size":c,"data-active":l,className:d,...r}),t[8]=u,t[9]=l,t[10]=r,t[11]=c,t[12]=d,t[13]=f):f=t[13],f}function NP(e){let t=null,n=!1,r=new Set;function i(e){if(e!==t){t=e;for(let e of r)e()}}e.subscribeToEvent(i);async function a(){if(!n){n=!0;try{i(await e.fetchBranch())}catch{}}}return{getSnapshot:()=>t,subscribe(e){return r.add(e),a(),()=>{r.delete(e)}}}}async function PP(){let e=await fetch(`/api/server-info`,{signal:AbortSignal.timeout(5e3)});if(!e.ok)return null;let t=await e.json(),n=Fa.safeParse(t);return n.success?n.data.currentBranch??null:null}var FP=typeof window>`u`?{getSnapshot:()=>null,subscribe:()=>()=>{}}:NP({fetchBranch:PP,subscribeToEvent:iu}),IP=FP.subscribe,LP=FP.getSnapshot;function RP(){return(0,Q.useSyncExternalStore)(IP,LP,LP)}function zP(){let e=(0,$.c)(6),t=RP(),n=fd(),{state:r}=uP(),i=typeof window<`u`?window.okDesktop:void 0;if(i&&r===`expanded`)return null;let a;e[0]===n?a=e[1]:(a=i?.config.projectName??(n&&_s(n.contentDir)||null),e[0]=n,e[1]=a);let o=a,s=i?.config.projectPath??n?.contentDir??null;if(o===null&&t===null)return null;let c;return e[2]!==t||e[3]!==o||e[4]!==s?(c={projectName:o,projectPath:s,branch:t},e[2]=t,e[3]=o,e[4]=s,e[5]=c):c=e[5],c}function BP(e){let t=(0,$.c)(30),{stats:n,selectionStats:r,showStats:i,composerBadge:a,reserveRightGutter:o}=e,s=i===void 0?!0:i,c=o===void 0?!1:o,{_:l}=gt(),u=zP();if(!s&&u===null&&a==null)return null;let d=r??n,f=r!=null,{words:p,chars:m,tokens:h}=d,g;t[0]!==l||t[1]!==f||t[2]!==s?(g=l(s?f?{id:`Bv5a9_`}:{id:`L1ZE3M`}:{id:`goO4Ll`}),t[0]=l,t[1]=f,t[2]=s,t[3]=g):g=t[3];let _=c&&`pr-12`,v;t[4]===_?v=t[5]:(v=Y(`relative flex h-6 shrink-0 items-center justify-between gap-3 bg-background px-3 text-2xs text-muted-foreground`,_),t[4]=_,t[5]=v);let y;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-x-0 bottom-full h-2 bg-linear-to-t from-background to-transparent`}),t[6]=y):y=t[6];let b;t[7]!==l||t[8]!==a?(b=a?(0,Z.jsxs)(X,{type:`button`,variant:`outline`,onClick:a.onReopen,"data-testid":`ask-ai-reopen-badge`,className:`-translate-x-1/2 absolute bottom-0 left-1/2 z-10 h-auto gap-1 rounded-md rounded-b-none bg-card px-2.5 py-0.5 text-2xs font-normal text-muted-foreground shadow-sm hover:text-foreground active:not-aria-[haspopup]:translate-y-0`,children:[(0,Z.jsx)(Zs,{className:`size-3`,"aria-hidden":!0}),l({id:`xWEvuo`}),(0,Z.jsx)(Lr,{className:`size-3`,"aria-hidden":!0})]}):null,t[7]=l,t[8]=a,t[9]=b):b=t[9];let x;t[10]===u?x=t[11]:(x=u===null?null:(0,Z.jsx)(VP,{identity:u}),t[10]=u,t[11]=x);let S;t[12]===x?S=t[13]:(S=(0,Z.jsx)(`span`,{className:`flex min-w-0 items-center gap-3`,children:x}),t[12]=x,t[13]=S);let C;t[14]!==l||t[15]!==d.chars||t[16]!==d.tokens||t[17]!==d.words||t[18]!==m||t[19]!==f||t[20]!==s||t[21]!==h||t[22]!==p?(C=s?(0,Z.jsxs)(`span`,{className:`flex shrink-0 items-center gap-3`,children:[f?(0,Z.jsx)(`span`,{className:`font-medium text-foreground/70`,"data-testid":`editor-footer-selected-label`,children:l({id:`ylXj1N`})}):null,(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(`span`,{className:`tabular-nums`,children:d.words.toLocaleString()}),` `,(0,Z.jsx)(J,{id:`gljvbT`,values:{words:p}})]}),(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(`span`,{className:`tabular-nums`,children:d.chars.toLocaleString()}),` `,(0,Z.jsx)(J,{id:`d5rK4X`,values:{chars:m}})]}),(0,Z.jsxs)(`span`,{children:[d.tokens>0?`~`:``,(0,Z.jsx)(`span`,{className:`tabular-nums`,children:d.tokens.toLocaleString()}),` `,(0,Z.jsx)(J,{id:`uynXup`,values:{tokens:h}})]})]}):null,t[14]=l,t[15]=d.chars,t[16]=d.tokens,t[17]=d.words,t[18]=m,t[19]=f,t[20]=s,t[21]=h,t[22]=p,t[23]=C):C=t[23];let w;return t[24]!==C||t[25]!==g||t[26]!==v||t[27]!==b||t[28]!==S?(w=(0,Z.jsxs)(`section`,{"aria-label":g,className:v,children:[y,b,S,C]}),t[24]=C,t[25]=g,t[26]=v,t[27]=b,t[28]=S,t[29]=w):w=t[29],w}function VP(e){let t=(0,$.c)(8),{identity:n}=e,{projectName:r,projectPath:i,branch:a}=n,o;t[0]!==r||t[1]!==i?(o=r===null?null:i?(0,Z.jsxs)(ln,{children:[(0,Z.jsx)(on,{asChild:!0,children:(0,Z.jsx)(`span`,{tabIndex:0,className:`truncate`,"data-testid":`editor-footer-project-name`,children:r})}),(0,Z.jsx)(sn,{side:`top`,className:`max-w-xs break-all`,children:i})]}):(0,Z.jsx)(`span`,{className:`truncate`,"data-testid":`editor-footer-project-name`,children:r}),t[0]=r,t[1]=i,t[2]=o):o=t[2];let s;t[3]===a?s=t[4]:(s=a===null?null:(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,"data-testid":`editor-footer-branch`,children:[(0,Z.jsx)(po,{"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,Z.jsx)(`span`,{className:`truncate`,children:a})]}),t[3]=a,t[4]=s);let c;return t[5]!==o||t[6]!==s?(c=(0,Z.jsxs)(Z.Fragment,{children:[o,s]}),t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function HP(e){let t=(0,$.c)(11),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let{_:i}=gt(),a;t[3]===i?a=t[4]:(a=i({id:`3__SjS`}),t[3]=i,t[4]=a);let o;t[5]===n?o=t[6]:(o=Y(n),t[5]=n,t[6]=o);let s;return t[7]!==r||t[8]!==a||t[9]!==o?(s=(0,Z.jsx)(`nav`,{"aria-label":a,"data-slot":`breadcrumb`,className:o,...r}),t[7]=r,t[8]=a,t[9]=o,t[10]=s):s=t[10],s}function UP(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Y(`flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`ol`,{"data-slot":`breadcrumb-list`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function WP(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Y(`inline-flex items-center gap-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`li`,{"data-slot":`breadcrumb-item`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function GP(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({current:i,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0||i?`page`:void 0,o;t[4]===n?o=t[5]:(o=Y(`font-normal text-foreground`,n),t[4]=n,t[5]=o);let s;return t[6]!==r||t[7]!==a||t[8]!==o?(s=(0,Z.jsx)(`span`,{"data-slot":`breadcrumb-page`,"aria-current":a,className:o,...r}),t[6]=r,t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function KP(e){let t=(0,$.c)(12),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({children:n,className:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=Y(`[&>svg]:size-3.5`,r),t[4]=r,t[5]=a);let o;t[6]===n?o=t[7]:(o=n??(0,Z.jsx)(Ho,{}),t[6]=n,t[7]=o);let s;return t[8]!==i||t[9]!==a||t[10]!==o?(s=(0,Z.jsx)(`li`,{"data-slot":`breadcrumb-separator`,role:`presentation`,"aria-hidden":`true`,className:a,...i,children:o}),t[8]=i,t[9]=a,t[10]=o,t[11]=s):s=t[11],s}var qP=1,JP=2,YP=4;function XP(e){let t=(0,$.c)(18),{docName:n,className:r}=e;if(!n)return null;let a,o,s,c,l,u;if(t[0]!==r||t[1]!==n){u=Symbol.for(`react.early_return_sentinel`);bb0:{let e=fo(n),d=e?e.kind===`template`?e.folder.split(`/`).filter(Boolean):[]:i(n,``).prefix.replace(/\/$/,``).split(`/`).filter(Boolean);if(d.length===0){u=null;break bb0}let f=(e,t)=>({kind:`segment`,value:e,key:d.slice(0,t+1).join(`/`)}),p=d.length>YP?[...d.slice(0,qP).map((e,t)=>f(e,t)),{kind:`ellipsis`,hidden:d.slice(qP,-JP)},...d.slice(-JP).map((e,t)=>f(e,d.length-JP+t))]:d.map((e,t)=>f(e,t));o=HP,t[8]===r?l=t[9]:(l=Y(`flex min-w-0 items-center`,r),t[8]=r,t[9]=l),a=UP,s=`min-w-0 flex-nowrap gap-1 overflow-hidden text-muted-foreground/70 text-xs`,c=p.map(ZP)}t[0]=r,t[1]=n,t[2]=a,t[3]=o,t[4]=s,t[5]=c,t[6]=l,t[7]=u}else a=t[2],o=t[3],s=t[4],c=t[5],l=t[6],u=t[7];if(u!==Symbol.for(`react.early_return_sentinel`))return u;let d;t[10]!==a||t[11]!==s||t[12]!==c?(d=(0,Z.jsx)(a,{className:s,children:c}),t[10]=a,t[11]=s,t[12]=c,t[13]=d):d=t[13];let f;return t[14]!==o||t[15]!==l||t[16]!==d?(f=(0,Z.jsx)(o,{className:l,children:d}),t[14]=o,t[15]=l,t[16]=d,t[17]=f):f=t[17],f}function ZP(e,t){let n=e.kind===`segment`?e.key:`ellipsis`;return(0,Z.jsxs)(Q.Fragment,{children:[t>0&&(0,Z.jsx)(KP,{className:`shrink-0 text-muted-foreground/70 [&>svg]:size-3`}),e.kind===`ellipsis`?(0,Z.jsxs)(WP,{className:`shrink-0`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,title:e.hidden.join(` / `),className:`flex size-4 items-center justify-center text-muted-foreground/70`,children:(0,Z.jsx)(Mh,{className:`size-3.5`})}),(0,Z.jsx)(`span`,{className:`sr-only`,children:e.hidden.join(` / `)})]}):(0,Z.jsx)(WP,{className:`min-w-0`,children:(0,Z.jsx)(GP,{current:!1,className:`min-w-0 truncate font-normal text-muted-foreground/70`,title:e.value,children:e.value})})]},n)}var QP=(0,Q.lazy)(async()=>({default:(await n(async()=>{let{SkillEditorActions:e}=await import(`./SkillEditorActions-ghSewPgo.js`);return{SkillEditorActions:e}},__vite__mapDeps([151,1,6,2,3,7,8,9,10,11,12,15,16,112,14,17,113,30,31,19,49,24,25,50,20,92,22,26,36,119,47,23,27,114,118,105,93,32,37,33,120,98,38,99,121,68,106,39,41,87,64,122,66,44,123,124]),import.meta.url)).SkillEditorActions}));function $P(e){let t=(0,$.c)(94),{activeDocName:n,isSourceMode:r,sourceDisabled:i,onModeChange:a,showAddPropertyButton:o,onAddProperty:s,isPanelCollapsed:c,onTogglePanel:l,reserveRightGutter:u}=e,d=u===void 0?!1:u,{_:f}=gt(),m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m=Pl(`toggle-document-panel`),t[0]=m):m=t[0];let h=m,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j;if(t[1]!==f||t[2]!==n||t[3]!==c||t[4]!==r||t[5]!==s||t[6]!==a||t[7]!==l||t[8]!==d||t[9]!==o||t[10]!==i){v=jl(`toggle-document-panel`);let e;t[27]===n?e=t[28]:(e=n?fo(n):null,t[27]=n,t[28]=e);let u=e,p;t[29]===n?p=t[30]:(p=n?be(n):null,t[29]=n,t[30]=p);let m=p,h;t[31]!==u||t[32]!==m?(h=u?.kind===`skill`?{scope:u.scope,name:u.name}:m?{scope:`project`,name:m}:null,t[31]=u,t[32]=m,t[33]=h):h=t[33];let M=h;S=`editor-toolbar`,C=`pointer-events-none absolute inset-x-0 top-0 z-10`;let N;t[34]!==n||t[35]!==M?(N=M?null:(0,Z.jsx)(XP,{docName:n}),t[34]=n,t[35]=M,t[36]=N):N=t[36];let P;t[37]===n?P=t[38]:(P=n===null?null:(0,Z.jsx)(of,{entry:{kind:`document`,docName:n},className:`shrink-0`}),t[37]=n,t[38]=P);let F;t[39]!==N||t[40]!==P?(F=(0,Z.jsxs)(`div`,{className:`pointer-events-auto flex min-w-0 items-center gap-2`,children:[N,P]}),t[39]=N,t[40]=P,t[41]=F):F=t[41];let I;t[42]!==r||t[43]!==a||t[44]!==i?(I=(0,Z.jsx)(`div`,{className:`pointer-events-auto flex justify-center`,children:(0,Z.jsx)(lf,{isSourceMode:r,onModeChange:a,sourceDisabled:i})}),t[42]=r,t[43]=a,t[44]=i,t[45]=I):I=t[45],t[46]!==F||t[47]!==I?(w=(0,Z.jsx)(`div`,{className:`editor-content-aligned bg-background py-2`,children:(0,Z.jsxs)(`div`,{className:`grid grid-cols-3 items-center`,children:[F,I]})}),t[46]=F,t[47]=I,t[48]=w):w=t[48];let L=d&&`pr-9`;t[49]===L?y=t[50]:(y=Y(`pointer-events-auto absolute top-0 right-0 flex items-center justify-end gap-1 py-2 pr-2`,L),t[49]=L,t[50]=y),t[51]===M?b=t[52]:(b=M?(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(QP,{scope:M.scope,name:M.name})}):null,t[51]=M,t[52]=b),t[53]!==f||t[54]!==s||t[55]!==o?(x=o&&(0,Z.jsxs)(ln,{children:[(0,Z.jsx)(X,{variant:`ghost`,size:`icon`,"aria-label":f({id:`81H_23`}),onClick:s,"data-testid":`add-properties-button`,asChild:!0,children:(0,Z.jsx)(on,{children:(0,Z.jsx)(Zh,{})})}),(0,Z.jsx)(sn,{side:`bottom`,children:(0,Z.jsx)(J,{id:`81H_23`})})]}),t[53]=f,t[54]=s,t[55]=o,t[56]=x):x=t[56],_=ln,g=X,T=``,E=`ghost`,D=`icon`,O=l,k=!c,A=`doc-panel`,j=f(c?{id:`u7H-Wn`,values:{panelShortcutLabel:v}}:{id:`2hpdRq`,values:{panelShortcutLabel:v}}),t[1]=f,t[2]=n,t[3]=c,t[4]=r,t[5]=s,t[6]=a,t[7]=l,t[8]=d,t[9]=o,t[10]=i,t[11]=g,t[12]=_,t[13]=v,t[14]=y,t[15]=b,t[16]=x,t[17]=S,t[18]=C,t[19]=w,t[20]=T,t[21]=E,t[22]=D,t[23]=O,t[24]=k,t[25]=A,t[26]=j}else g=t[11],_=t[12],v=t[13],y=t[14],b=t[15],x=t[16],S=t[17],C=t[18],w=t[19],T=t[20],E=t[21],D=t[22],O=t[23],k=t[24],A=t[25],j=t[26];let M;t[57]===c?M=t[58]:(M=(0,Z.jsx)(on,{children:c?(0,Z.jsx)($c,{}):(0,Z.jsx)(Qc,{})}),t[57]=c,t[58]=M);let N;t[59]!==g||t[60]!==M||t[61]!==T||t[62]!==E||t[63]!==D||t[64]!==O||t[65]!==k||t[66]!==A||t[67]!==j?(N=(0,Z.jsx)(g,{"data-doc-panel-toggle":T,variant:E,size:D,onClick:O,"aria-expanded":k,"aria-controls":A,"aria-label":j,asChild:!0,children:M}),t[59]=g,t[60]=M,t[61]=T,t[62]=E,t[63]=D,t[64]=O,t[65]=k,t[66]=A,t[67]=j,t[68]=N):N=t[68];let P;t[69]!==f||t[70]!==c?(P=f(c?{id:`6iDEWA`}:{id:`170Js2`}),t[69]=f,t[70]=c,t[71]=P):P=t[71];let F;t[72]===P?F=t[73]:(F=(0,Z.jsx)(`span`,{children:P}),t[72]=P,t[73]=F);let I;t[74]===v?I=t[75]:(I=(0,Z.jsx)(p,{"aria-label":v,children:h}),t[74]=v,t[75]=I);let L;t[76]!==F||t[77]!==I?(L=(0,Z.jsxs)(sn,{side:`bottom`,children:[F,` `,I]}),t[76]=F,t[77]=I,t[78]=L):L=t[78];let R;t[79]!==_||t[80]!==N||t[81]!==L?(R=(0,Z.jsxs)(_,{children:[N,L]}),t[79]=_,t[80]=N,t[81]=L,t[82]=R):R=t[82];let z;t[83]!==y||t[84]!==b||t[85]!==x||t[86]!==R?(z=(0,Z.jsxs)(`div`,{className:y,children:[b,x,R]}),t[83]=y,t[84]=b,t[85]=x,t[86]=R,t[87]=z):z=t[87];let B;t[88]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,Z.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none h-2 bg-linear-to-b from-background to-transparent`}),t[88]=B):B=t[88];let V;return t[89]!==S||t[90]!==C||t[91]!==w||t[92]!==z?(V=(0,Z.jsxs)(`div`,{"data-testid":S,className:C,children:[w,z,B]}),t[89]=S,t[90]=C,t[91]=w,t[92]=z,t[93]=V):V=t[93],V}function eF(e){let{activeDocName:t,deferredActiveDocName:n,mountResolved:r,syncResolved:i}=e;return t===null||t===n?!1:!(r&&i)}function tF(e){let{currentLayout:t,containerPx:n,pinnedPx:r,residualId:i}=e;if(n<=0||!(i in t))return t;let a={...t},o=0;for(let[e,i]of Object.entries(r)){if(!(e in t))continue;let r=i/n*100;a[e]=r,o+=r}let s=0;for(let[e,n]of Object.entries(t))e===i||e in r||(s+=n);let c=100-o-s;return c<0?t:(a[i]=c,a)}var nF=`ok-terminal-height-v1`,rF=1/3,iF=.5;function aF(e){return Math.max(120,Math.round((Number.isFinite(e)?e:0)*iF))}function oF(e){let t=Number.isFinite(e)?e:0;return t<=0?240:Math.round(t*rF)}function sF(e,t){let n=aF(t);return Number.isFinite(e)?e<120?120:e>n?n:Math.round(e):Math.min(oF(t),n)}function cF(){return typeof window>`u`?0:window.innerHeight}function lF(e,t){return sF(e,t??cF())}function uF(e,t){try{let n=e??localStorage,r=t??cF(),i=n.getItem(nF);if(i==null)return sF(oF(r),r);let a=Number.parseInt(i,10);return sF(Number.isFinite(a)?a:oF(r),r)}catch{return 240}}function dF(e,t,n){try{let r=t??localStorage,i=n??cF();r.setItem(nF,String(sF(e,i)))}catch{}}function fF(){try{return typeof localStorage>`u`?240:uF()}catch{return 240}}function pF(e){let t=(0,$.c)(19),{dockPosition:n,onReveal:r,className:i}=e,{_:a}=gt(),o=n===`right`,s;t[0]===a?s=t[1]:(s=a({id:`vja0Dg`}),t[0]=a,t[1]=s);let c=s,l=o?`rounded-r-none border-r-0`:`rounded-b-none border-b-0`,u;t[2]!==i||t[3]!==l?(u=Y(`absolute z-20 shrink-0 bg-background text-muted-foreground shadow-sm hover:text-foreground`,l,i),t[2]=i,t[3]=l,t[4]=u):u=t[4];let d;t[5]===o?d=t[6]:(d=o?(0,Z.jsx)(Bo,{"aria-hidden":`true`}):(0,Z.jsx)(Lr,{"aria-hidden":`true`}),t[5]=o,t[6]=d);let f;t[7]!==n||t[8]!==c||t[9]!==r||t[10]!==u||t[11]!==d?(f=(0,Z.jsx)(on,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,variant:`outline`,size:`icon-sm`,"aria-label":c,"data-terminal-reveal":n,onClick:r,className:u,children:d})}),t[7]=n,t[8]=c,t[9]=r,t[10]=u,t[11]=d,t[12]=f):f=t[12];let p=o?`left`:`top`,m;t[13]!==c||t[14]!==p?(m=(0,Z.jsx)(sn,{side:p,sideOffset:8,children:c}),t[13]=c,t[14]=p,t[15]=m):m=t[15];let h;return t[16]!==f||t[17]!==m?(h=(0,Z.jsxs)(ln,{children:[f,m]}),t[16]=f,t[17]=m,t[18]=h):h=t[18],h}var mF=`terminal-dock-panel`;function hF(e){let t=(0,$.c)(52),{children:n,visible:r,onVisibleChange:i,dockPosition:a,onBottomContainer:o,onEditorRegion:s,onReveal:c,showRevealTab:l}=e,u=a===void 0?`bottom`:a,d=l===void 0?!1:l,{resolvedTheme:f}=Lt(),p=dC(),[m,h]=(0,Q.useState)(!r),g=ip(f).background,_=r&&u===`bottom`,v=d&&u===`bottom`&&c!=null,[y]=(0,Q.useState)(gF),b=(0,Q.useRef)(y),[x,S]=(0,Q.useState)(!1),C=(0,Q.useRef)(!1),w=(0,Q.useRef)(null),T;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(T=function(e){w.current!=null&&clearTimeout(w.current),w.current=setTimeout(()=>{dF(e),w.current=null},100)},t[0]=T):T=t[0];let E=T,D=(0,Q.useRef)(0),O;t[1]!==u||t[2]!==r?(O=function(e,t){D.current>=5||(D.current+=1,console.warn(JSON.stringify({event:`ok-terminal-dock-stranded-while-hidden`,panelPx:Math.round(e),panelPct:Number.isFinite(t)?Math.round(t*10)/10:null,dockPosition:u,visible:r,dockHeightPx:b.current,innerWidth:window.innerWidth,innerHeight:window.innerHeight,devicePixelRatio:window.devicePixelRatio})))},t[1]=u,t[2]=r,t[3]=O):O=t[3];let k=O,A=(0,Q.useRef)(null),j,M;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(j=()=>()=>{w.current!=null&&clearTimeout(w.current),A.current!=null&&(window.removeEventListener(`pointerup`,A.current),A.current=null)},M=[],t[4]=j,t[5]=M):(j=t[4],M=t[5]),(0,Q.useEffect)(j,M);let N,P;t[6]!==_||t[7]!==p?(N=()=>{let e=p.current;if(e!=null)try{_?e.resize(`${b.current}px`):e.collapse()}catch{}},P=[_,p],t[6]=_,t[7]=p,t[8]=N,t[9]=P):(N=t[8],P=t[9]),(0,Q.useEffect)(N,P);let F,I;t[10]!==_||t[11]!==p?(I=()=>{let e=()=>{let e=lF(b.current);if(e!==b.current&&(b.current=e,_))try{p.current?.resize(`${e}px`)}catch{}};return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},F=[_,p],t[10]=_,t[11]=p,t[12]=F,t[13]=I):(F=t[12],I=t[13]),(0,Q.useEffect)(I,F);let L=x||void 0,R;t[14]!==c||t[15]!==v?(R=v&&c?(0,Z.jsx)(pF,{dockPosition:`bottom`,onReveal:c,className:`right-3 bottom-0`}):null,t[14]=c,t[15]=v,t[16]=R):R=t[16];let z;t[17]!==n||t[18]!==s||t[19]!==R?(z=(0,Z.jsx)(LT,{minSize:`5%`,className:`flex min-h-0 flex-col`,children:(0,Z.jsxs)(`div`,{ref:s,tabIndex:-1,className:`relative flex h-full min-h-0 flex-col outline-none`,children:[n,R]})}),t[17]=n,t[18]=s,t[19]=R,t[20]=z):z=t[20];let B=!_,V;t[21]===_?V=t[22]:(V=()=>{if(!_)return;S(!0),C.current=!0;let e=()=>{S(!1),C.current=!1,window.removeEventListener(`pointerup`,e),A.current=null};A.current=e,window.addEventListener(`pointerup`,e)},t[21]=_,t[22]=V);let H;t[23]!==_||t[24]!==B||t[25]!==V?(H=(0,Z.jsx)(RT,{withHandle:_,disabled:B,onPointerDown:V}),t[23]=_,t[24]=B,t[25]=V,t[26]=H):H=t[26];let U;t[27]===g?U=t[28]:(U={backgroundColor:g},t[27]=g,t[28]=U);let W=_?`${y}px`:0,G;t[29]!==_||t[30]!==i||t[31]!==p||t[32]!==k||t[33]!==r?(G=e=>{let t=e.asPercentage===0;if(h(t),!_&&e.inPixels>0&&!C.current){k(e.inPixels,e.asPercentage);try{p.current?.collapse()}catch{}return}C.current&&(t&&r?i(!1):!t&&!r&&i(!0),e.inPixels>0&&(b.current=e.inPixels,E(e.inPixels)))},t[29]=_,t[30]=i,t[31]=p,t[32]=k,t[33]=r,t[34]=G):G=t[34];let K=!x&&`transition-[flex-grow] duration-150 ease-out motion-reduce:transition-none motion-reduce:duration-0`,ee;t[35]===K?ee=t[36]:(ee=Y(`flex flex-col`,K),t[35]=K,t[36]=ee);let te;t[37]===o?te=t[38]:(te=(0,Z.jsx)(`div`,{ref:o,className:`flex min-h-0 flex-1 flex-col overflow-hidden`}),t[37]=o,t[38]=te);let ne;t[39]!==m||t[40]!==p||t[41]!==U||t[42]!==W||t[43]!==G||t[44]!==ee||t[45]!==te?(ne=(0,Z.jsx)(LT,{id:mF,style:U,panelRef:p,defaultSize:W,minSize:`120px`,maxSize:`95%`,collapsible:!0,collapsedSize:0,onResize:G,inert:m,className:ee,children:te}),t[39]=m,t[40]=p,t[41]=U,t[42]=W,t[43]=G,t[44]=ee,t[45]=te,t[46]=ne):ne=t[46];let q;return t[47]!==L||t[48]!==z||t[49]!==H||t[50]!==ne?(q=(0,Z.jsxs)(IT,{orientation:`vertical`,className:`min-h-0 flex-1`,"data-dragging":L,children:[z,H,ne]}),t[47]=L,t[48]=z,t[49]=H,t[50]=ne,t[51]=q):q=t[51],q}function gF(){return fF()}var _F=(0,Q.lazy)(async()=>({default:(await n(()=>import(`./ActivityModeContent-C2P34Oxp.js`),__vite__mapDeps([71,1,47,10,11,12,23,14,15,16,17,24,25,26,22,27,29,30,31,19,72,2,73,74,9,75,76,77,78,79,80,81,82,83,6,3,7,8,84,68,85,86,87,4,88,49,18,20,36,35,89,90,37,38,40,61,62,63,43,65,91,92,28,32,60,64,66,67,93,94,95,96,33,21,97,98,99,100,39,41,101,102,103,104,105,106,107,108,109]),import.meta.url)).ActivityModeContent})),vF=(0,Q.lazy)(async()=>({default:(await n(()=>import(`./LintConfigEditor-2sMpGsvn.js`),__vite__mapDeps([152,10,1,11,12,22,153,2,73,74,9,6,3,7,8,84,68,85,86,87,88,30,31,14,15,16,17,19,49,24,25,29,18,20,36,48,50,26,145,79,146,99,62,133,13,21,35,114,59,92,96,128,116,39,41,134,135,27,136,43,154]),import.meta.url)).LintConfigEditor})),yF=(0,Q.lazy)(async()=>({default:(await n(()=>import(`./SchemaConfigEditor-CINC-UXE.js`),__vite__mapDeps([155,1,10,11,12,88,30,31,14,15,16,17,19,49,24,25,29,22,18,20,36,114,26,142,156,95,38,99,153,2,73,74,9,6,3,7,8,84,68,85,86,87,48,50,145,79,146,62,131,39,41,135,27,136,154]),import.meta.url)).SchemaConfigEditor}));function bF(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(`div`,{role:`status`,"aria-busy":`true`,className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`NYn1cR`})}),e[0]=t):t=e[0],t}var xF=(0,Q.lazy)(async()=>({default:(await n(()=>import(`./TimelineDiffPane-CzDAeswG.js`),__vite__mapDeps([157,1,2,158,6,3,7,8,9,72,73,74,75,76,77,78,79,80,81,82,83,31,84,68,12,22,11,85,86,87,47,10,4,88,30,14,15,16,17,19,49,24,25,29,18,20,36,35,23,26,27,89,90,37,38,40,61,62,63,43,65,91,92,28,32,60,64,66,67,93,94,95,96,33,21,97,98,99,100,39,41,101,102,159,48,50,160,103,109]),import.meta.url)).TimelineDiffPane})),SF=(0,Q.lazy)(async()=>({default:(await n(()=>import(`./AgentDiffPane-DcYd6e4i.js`),__vite__mapDeps([161,1,2,158,6,3,7,8,9,72,73,74,75,76,77,78,79,80,81,82,83,31,84,68,12,22,11,85,86,87,47,10,4,88,30,14,15,16,17,19,49,24,25,29,18,20,36,35,23,26,27,89,90,37,38,40,61,62,63,43,65,91,92,28,32,60,64,66,67,93,94,95,96,33,21,97,98,99,100,39,41,101,102,159,48,50,160,104,105,106,109,107,108]),import.meta.url)).AgentDiffPane})),CF=`300px`,wF=`600px`,TF=new Set([`doc-panel`,`terminal-column`,`agent-panel`]);function EF(e){let t=(0,$.c)(5),n;t[0]===e?n=t[1]:(n=(0,Z.jsx)(OF,{...e}),t[0]=e,t[1]=n);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(DF,{}),t[2]=r):r=t[2];let i;return t[3]===n?i=t[4]:(i=(0,Z.jsx)(uu,{name:`editor-area`,children:(0,Z.jsxs)(Oo,{children:[n,r]})}),t[3]=n,t[4]=i),i}function DF(){let e=(0,$.c)(6),t=Al(),n;e[0]===t?n=e[1]:(n=e=>{e||t.close()},e[0]=t,e[1]=n);let r;return e[2]!==t.open||e[3]!==t.section||e[4]!==n?(r=(0,Z.jsx)(TT,{open:t.open,initialSection:t.section,onOpenChange:n}),e[2]=t.open,e[3]=t.section,e[4]=n,e[5]=r):r=e[5],r}function OF(e){let t=(0,$.c)(286),{editorMode:n,onModeChange:r,activeTab:i,onActiveTabChange:a,terminalBridge:o,terminalVisible:s,onTerminalVisibleChange:c,terminalDock:l,terminalHasSessions:u,onTerminalPlacement:d,onRevealTerminal:f}=e,p=s===void 0?!1:s,m=l===void 0?`right`:l,h=u===void 0?!1:u,{_:g}=gt(),{resolvedTheme:_}=Lt(),v=ip(_).background,{activeDocName:y,activeProvider:b,activeTarget:x,recycleDocument:S,docPanelMode:C,docPanelAgentId:w,docPanelExpandSignal:T}=Ye(),{openDocumentTransition:E}=Oe(),{requestAddProperty:D}=Co(),O=eE(b,y),k=rE(y,n===`source`?`source`:`wysiwyg`),A=OE(b),j=A===`connected`||A===`synced`,M=nE(y)===`conflict`,[N,P]=(0,Q.useState)(!1),F,I;t[0]!==b||t[1]!==N?(F=()=>{b!=null&&!N&&P(!0)},I=[b,N],t[0]=b,t[1]=N,t[2]=F,t[3]=I):(F=t[2],I=t[3]),(0,Q.useEffect)(F,I);let L=(0,Q.useDeferredValue)(y),R=x?.kind===`missing`,z=!!y&&x?.kind!==`folder`,B;t[4]!==g||t[5]!==R?(B=R?g({id:`K-a33w`}):void 0,t[4]=g,t[5]=R,t[6]=B):B=t[6];let V=B,H=pl(),U,W;t[7]!==y||t[8]!==H?(U=()=>{H&&H.docName!==y&&ml()},W=[y,H],t[7]=y,t[8]=H,t[9]=U,t[10]=W):(U=t[9],W=t[10]),(0,Q.useEffect)(U,W);let G=$d(),K=G?.docName??null,ee=(0,Q.useRef)(null),te;t[11]!==y||t[12]!==K||t[13]!==E?(te=()=>{if(K==null){ee.current=null;return}if(ee.current=K,K!==y){let e=Cu(K);window.location.hash===e?E(K):window.location.hash=e}},t[11]=y,t[12]=K,t[13]=E,t[14]=te):te=t[14];let ne;t[15]===K?ne=t[16]:(ne=[K],t[15]=K,t[16]=ne),(0,Q.useEffect)(te,ne);let q,re;t[17]!==y||t[18]!==K?(q=()=>{if(K!=null){if(K===y){ee.current=null;return}ee.current!==K&&tf()}},re=[y,K],t[17]=y,t[18]=K,t[19]=q,t[20]=re):(q=t[19],re=t[20]),(0,Q.useEffect)(q,re);let ie,ae;t[21]!==w||t[22]!==C?(ie=()=>{C===`agent`&&w!==null||tf()},ae=[C,w],t[21]=w,t[22]=C,t[23]=ie,t[24]=ae):(ie=t[23],ae=t[24]),(0,Q.useEffect)(ie,ae);let oe=(0,Q.useSyncExternalStore)(uc.subscribe,uc.getSnapshot,uc.getSnapshot),se;t[25]!==x||t[26]!==oe?(se=mc(x,oe),t[25]=x,t[26]=oe,t[27]=se):se=t[27];let ce=se,[le]=(0,Q.useState)(NF),ue=le!==null,de;t[28]===le?de=t[29]:(de=()=>fE(le,window.innerWidth,`right`),t[28]=le,t[29]=de);let[fe,pe]=(0,Q.useState)(de),me=(0,Q.useRef)(fe),he,ge;t[30]===fe?(he=t[31],ge=t[32]):(he=()=>{me.current=fe},ge=[fe],t[30]=fe,t[31]=he,t[32]=ge),(0,Q.useEffect)(he,ge);let _e=dC(),ye=dC(),be;t[33]===fe?be=t[34]:(be=()=>xE(`right`,fe,yE())===`collapsed`,t[33]=fe,t[34]=be);let[Se]=(0,Q.useState)(be),[Ce,we]=(0,Q.useState)(Se),Te=(0,Q.useRef)(Ce),[Ee,De]=(0,Q.useState)(null),[ke,Ae]=(0,Q.useState)(null),[je,Me]=(0,Q.useState)(null),Ne=o?.terminal!=null,Pe=m===`right`,Fe=Pe?`right`:`bottom`,Ie=Pe&&p,Le=!p&&f!=null&&(Ne||h),Re=Le&&!Pe,ze=Le&&Pe,Be=Pe&&p&&Ee!=null,Ve=Be?Ee:ke,He=(Pe?Be:p)&&Ve!=null,Ue,We;t[35]!==Ve||t[36]!==d||t[37]!==Fe||t[38]!==je||t[39]!==He?(Ue=()=>{d?.({container:Ve,isShowing:He,dockPosition:Fe,editorRegion:je})},We=[d,Ve,He,Fe,je],t[35]=Ve,t[36]=d,t[37]=Fe,t[38]=je,t[39]=He,t[40]=Ue,t[41]=We):(Ue=t[40],We=t[41]),(0,Q.useEffect)(Ue,We);let Ge,Ke;t[42]===Ce?(Ge=t[43],Ke=t[44]):(Ge=()=>{Te.current=Ce},Ke=[Ce],t[42]=Ce,t[43]=Ge,t[44]=Ke),(0,Q.useEffect)(Ge,Ke);let[qe,Je]=(0,Q.useState)(!1),Xe=(0,Q.useRef)(!1),[Ze]=(0,Q.useState)(MF),Qe=(0,Q.useRef)(Ze),$e=(0,Q.useRef)(null),et;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(et=function(e){$e.current!=null&&clearTimeout($e.current),$e.current=setTimeout(()=>{sE(e),$e.current=null},100)},t[45]=et):et=t[45];let tt=et,[nt]=(0,Q.useState)(jF),rt=(0,Q.useRef)(nt),[it,at]=(0,Q.useState)(!1),ot=(0,Q.useRef)(!1),st=(0,Q.useRef)(null),ct;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(ct=function(e){st.current!=null&&clearTimeout(st.current),st.current=setTimeout(()=>{EE(e),st.current=null},100)},t[46]=ct):ct=t[46];let lt=ct,ut,dt;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(ut=()=>()=>{$e.current!=null&&clearTimeout($e.current),st.current!=null&&clearTimeout(st.current)},dt=[],t[47]=ut,t[48]=dt):(ut=t[47],dt=t[48]),(0,Q.useEffect)(ut,dt);let[ft,pt]=(0,Q.useState)(null),mt=(0,Q.useRef)(null),ht=oC(),_t=(0,Q.useRef)(Ie),vt,yt;t[49]===Ie?(vt=t[50],yt=t[51]):(vt=()=>{_t.current=Ie},yt=[Ie],t[49]=Ie,t[50]=vt,t[51]=yt),(0,Q.useEffect)(vt,yt);let bt;t[52]!==_e||t[53]!==ye?(bt=function(){for(let e of[_e,ye]){let t=e.current?.getSize();if(t!=null&&t.asPercentage>1&&t.inPixels>0)return t.inPixels/t.asPercentage*100}let e=mt.current;return e!=null&&e.offsetWidth>0?e.offsetWidth:null},t[52]=_e,t[53]=ye,t[54]=bt):bt=t[54];let xt=bt,St;t[55]!==ht||t[56]!==xt?(St=function(e){if(Xe.current||ot.current)return;let t=ht.current;if(t!=null)try{let n=xt();if(n==null)return;let r=t.getLayout(),i=Object.keys(r);if(i.length===0)return;let a=i.find(AF);if(a==null)return;let o={};if(`doc-panel`in r&&(o[`doc-panel`]=e?0:Qe.current),`terminal-column`in r&&(o[`terminal-column`]=rt.current),Object.keys(o).length===0)return;let s=tF({currentLayout:r,containerPx:n,pinnedPx:o,residualId:a});s!==r&&t.setLayout(s)}catch{}},t[55]=ht,t[56]=xt,t[57]=St):St=t[57];let Ct=St,wt=(0,Q.useRef)(Ct),Tt;t[58]===Ct?Tt=t[59]:(Tt=()=>{wt.current=Ct},t[58]=Ct,t[59]=Tt),(0,Q.useEffect)(Tt);let Et;t[60]!==Ct||t[61]!==_e?(Et=function(){_t.current?Ct(!1):_e.current?.expand()},t[60]=Ct,t[61]=_e,t[62]=Et):Et=t[62];let Dt=Et,Ot;t[63]!==Ct||t[64]!==Ce||t[65]!==_e?(Ot=function(){if(_e.current==null)return;let e=me.current;Ce?(SE(`right`,e,`open`),_t.current?Ct(!1):_e.current?.expand()):(SE(`right`,e,`collapsed`),_t.current?Ct(!0):_e.current?.collapse())},t[63]=Ct,t[64]=Ce,t[65]=_e,t[66]=Ot):Ot=t[66];let kt=Ot,At,jt;t[67]!==Ct||t[68]!==le||t[69]!==_e?(At=()=>{let e=window.matchMedia(`(min-width: ${uE}px)`),t=()=>{let e=fE(le,window.innerWidth,`right`);pe(e);let t=xE(`right`,e,yE())===`collapsed`;we(t),_t.current?Ct(t):t?_e.current?.collapse():_e.current?.expand()};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},jt=[le,_e,Ct],t[67]=Ct,t[68]=le,t[69]=_e,t[70]=At,t[71]=jt):(At=t[70],jt=t[71]),(0,Q.useEffect)(At,jt);let Mt,Nt;t[72]!==ft||t[73]!==ue?(Mt=()=>{if(ft==null||ue)return;let e=new ResizeObserver(()=>{wt.current(Te.current)});return e.observe(ft),()=>e.disconnect()},Nt=[ft,ue],t[72]=ft,t[73]=ue,t[74]=Mt,t[75]=Nt):(Mt=t[74],Nt=t[75]),(0,Q.useEffect)(Mt,Nt);let Pt,Ft;t[76]!==Dt||t[77]!==a?(Pt=()=>{let e=e=>{a(e),Dt()},t=e_();return t&&e(t),n_(t=>{e_(),e(t)})},Ft=[a,Dt],t[76]=Dt,t[77]=a,t[78]=Pt,t[79]=Ft):(Pt=t[78],Ft=t[79]),(0,Q.useEffect)(Pt,Ft);let It,Rt;t[80]!==T||t[81]!==Dt?(It=()=>{T!==0&&Dt()},Rt=[T,Dt],t[80]=T,t[81]=Dt,t[82]=It,t[83]=Rt):(It=t[82],Rt=t[83]),(0,Q.useEffect)(It,Rt);let zt=(0,Q.useRef)(Ie),Bt,Vt;t[84]!==Ce||t[85]!==Ie?(Bt=()=>{if(zt.current===Ie)return;zt.current=Ie;let e=Ce;queueMicrotask(()=>{wt.current(e)})},Vt=[Ie,Ce],t[84]=Ce,t[85]=Ie,t[86]=Bt,t[87]=Vt):(Bt=t[86],Vt=t[87]),(0,Q.useLayoutEffect)(Bt,Vt);let Ht,Wt;t[88]===Ce?(Ht=t[89],Wt=t[90]):(Ht=()=>{if(!Ce||!document.getElementById(`doc-panel`)?.contains(document.activeElement))return;let e=document.querySelector(`[data-doc-panel-toggle]`);if(e){e.focus();return}document.querySelector(`[data-sidebar="trigger"]`)?.focus()},Wt=[Ce],t[88]=Ce,t[89]=Ht,t[90]=Wt),(0,Q.useLayoutEffect)(Ht,Wt);let Gt,Kt;t[91]===Ce?(Gt=t[92],Kt=t[93]):(Gt=()=>{Sc({docPanelVisible:!Ce}),window.okDesktop!=null&&window.okDesktop.editor.notifyViewMenuStateChanged({docPanelVisible:!Ce})},Kt=[Ce],t[91]=Ce,t[92]=Gt,t[93]=Kt),(0,Q.useEffect)(Gt,Kt);let qt,Jt;t[94]===kt?(qt=t[95],Jt=t[96]):(qt=()=>Ut(e=>{e===`toggle-doc-panel`&&kt()}),Jt=[kt],t[94]=kt,t[95]=qt,t[96]=Jt),(0,Q.useEffect)(qt,Jt);let Yt,Xt;t[97]===kt?(Yt=t[98],Xt=t[99]):(Yt=()=>{if(window.okDesktop!=null)return;let e=e=>{El(e,`toggle-document-panel`)&&(e.preventDefault(),kt())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},Xt=[kt],t[97]=kt,t[98]=Yt,t[99]=Xt),(0,Q.useEffect)(Yt,Xt);let Zt=(0,Q.useRef)(null),[Qt,$t]=(0,Q.useState)(null),[X,en]=(0,Q.useState)(!1),tn=x?.kind===`large-file`?x.docName:y,nn,rn;t[100]===tn?(nn=t[101],rn=t[102]):(nn=()=>{if(tn&&tn!==Zt.current){let e=Zt.current;Zt.current=tn,$t(e)}},rn=[tn],t[100]=tn,t[101]=nn,t[102]=rn),(0,Q.useEffect)(nn,rn);let an;t[103]===E?an=t[104]:(an=function(e){let t=Cu(e);window.location.hash===t?E(e):window.location.hash=t},t[103]=E,t[104]=an);let on=an,sn,cn=null;if(x?.kind===`large-file`){let e;t[105]!==on||t[106]!==Qt?(e=Qt?{previousDocName:Qt,onNavigateBack:on}:void 0,t[105]=on,t[106]=Qt,t[107]=e):e=t[107];let n;t[108]!==x.docName||t[109]!==x.limit||t[110]!==x.size||t[111]!==e?(n=(0,Z.jsx)(eT,{docName:x.docName,size:x.size,limit:x.limit,backNav:e}),t[108]=x.docName,t[109]=x.limit,t[110]=x.size,t[111]=e,t[112]=n):n=t[112],sn=n}else if(x?.kind===`folder`){let e;t[113]!==ue||t[114]!==p?(e=yD({terminalVisible:p,isEmbedded:ue}),t[113]=ue,t[114]=p,t[115]=e):e=t[115];let n=e,r;t[116]===x.folderPath?r=t[117]:(r=(0,Z.jsx)(Xw,{folderPath:x.folderPath}),t[116]=x.folderPath,t[117]=r);let i;t[118]===n?i=t[119]:(i=n?(0,Z.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-x-0 bottom-0 h-2 bg-linear-to-t from-background to-transparent`}):null,t[118]=n,t[119]=i);let a;t[120]!==r||t[121]!==i?(a=(0,Z.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,children:[r,i]}),t[120]=r,t[121]=i,t[122]=a):a=t[122];let o;t[123]!==x.folderPath||t[124]!==n?(o=n?(0,Z.jsx)(aD,{folderPath:x.folderPath}):null,t[123]=x.folderPath,t[124]=n,t[125]=o):o=t[125];let s;if(t[126]!==a||t[127]!==o?(s=(0,Z.jsxs)(`div`,{className:`relative flex h-full min-h-0 flex-col`,children:[a,o]}),t[126]=a,t[127]=o,t[128]=s):s=t[128],sn=s,C===`agent`&&w!==null){let e;t[129]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(RT,{withHandle:!0}),t[129]=e):e=t[129];let n;t[130]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsxs)(Z.Fragment,{children:[e,(0,Z.jsx)(LT,{id:`agent-panel`,defaultSize:`25%`,minSize:`300px`,maxSize:`40%`,className:`flex flex-col bg-muted/20`,children:(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsx)(`div`,{role:`status`,"aria-busy":`true`,className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`ONPvOb`})}),children:(0,Z.jsx)(_F,{showBackButton:!1})})})]}),t[130]=n):n=t[130],cn=n}}else if(x?.kind===`asset`&&_a(x.assetPath.split(`/`).pop()??x.assetPath)){let e;t[131]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(bF,{}),t[131]=e):e=t[131];let n;t[132]===x.assetPath?n=t[133]:(n=(0,Z.jsx)(Q.Suspense,{fallback:e,children:(0,Z.jsx)(vF,{assetPath:x.assetPath},x.assetPath)}),t[132]=x.assetPath,t[133]=n),sn=n}else if(x?.kind===`asset`&&Aa(x.assetPath)){let e;t[134]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(bF,{}),t[134]=e):e=t[134];let n;t[135]===x.assetPath?n=t[136]:(n=(0,Z.jsx)(Q.Suspense,{fallback:e,children:(0,Z.jsx)(yF,{assetPath:x.assetPath},x.assetPath)}),t[135]=x.assetPath,t[136]=n),sn=n}else if(x?.kind===`asset`){let e;t[137]!==x.assetPath||t[138]!==x.mediaKind?(e=(0,Z.jsx)(_C,{assetPath:x.assetPath,mediaKind:x.mediaKind},x.assetPath),t[137]=x.assetPath,t[138]=x.mediaKind,t[139]=e):e=t[139],sn=e}else if(x?.kind===`skill-file`){let e=`${x.scope}/${x.name}/${x.path}`,n;t[140]!==x.name||t[141]!==x.path||t[142]!==x.scope||t[143]!==e?(n=(0,Z.jsx)(mT,{scope:x.scope,name:x.name,path:x.path},e),t[140]=x.name,t[141]=x.path,t[142]=x.scope,t[143]=e,t[144]=n):n=t[144],sn=n}else if(ce){let e;t[145]===ce?e=t[146]:(e=(0,Z.jsx)(rT,{nav:ce},ce.path),t[145]=ce,t[146]=e),sn=e}else if(!b||!y)if((typeof window<`u`?Su(window.location.hash):null)!==null)if(o!=null&&N){let e;t[147]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(yC,{}),t[147]=e):e=t[147],sn=e;let n;t[148]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(RT,{withHandle:!0,disabled:!0}),t[148]=n):n=t[148];let r=Se?0:`${Ze}px`,i;t[149]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(`div`,{className:`min-h-0 flex-1`}),t[149]=i):i=t[149];let a;t[150]===r?a=t[151]:(a=(0,Z.jsxs)(Z.Fragment,{children:[n,(0,Z.jsx)(LT,{id:`doc-panel`,defaultSize:r,minSize:CF,maxSize:wF,collapsible:!0,collapsedSize:0,inert:!0,className:`flex flex-col bg-muted/20`,children:i})]}),t[150]=r,t[151]=a),cn=a}else{let e;return t[152]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(yC,{}),t[152]=e):e=t[152],e}else{let e=p?Fe:null,n;t[153]===e?n=t[154]:(n=(0,Z.jsx)(_w,{terminalDock:e}),t[153]=e,t[154]=n),sn=n}else{let e=n===`source`,o=!j,s=Ce,c;t[155]!==y||t[156]!==D?(c=function(){y&&D(y)},t[155]=y,t[156]=D,t[157]=c):c=t[157];let l=c,u;t[158]!==y||t[159]!==G||t[160]!==K||t[161]!==ue||t[162]!==p||t[163]!==H?(u=vD({terminalVisible:p,isEmbedded:ue,activeDocName:y})&&!(H&&H.docName===y)&&!(G&&K===y),t[158]=y,t[159]=G,t[160]=K,t[161]=ue,t[162]=p,t[163]=H,t[164]=u):u=t[164];let d=u,f=L??y,m=Qt??void 0,h;t[165]!==V||t[166]!==e||t[167]!==on||t[168]!==S||t[169]!==f||t[170]!==m?(h=(0,Z.jsx)(IN,{activeDocName:f,isSourceMode:e,editorPlaceholder:V,previousDocName:m,onNavigateBack:on,onRecycle:S}),t[165]=V,t[166]=e,t[167]=on,t[168]=S,t[169]=f,t[170]=m,t[171]=h):h=t[171];let g;t[172]!==y||t[173]!==e?(g=(0,Z.jsx)(XT,{activeDocName:y,isSourceMode:e}),t[172]=y,t[173]=e,t[174]=g):g=t[174];let _;t[175]!==y||t[176]!==L?(_=eF({activeDocName:y,deferredActiveDocName:L,mountResolved:y!==null&&ve(y),syncResolved:y!==null&&xe(y)})?(0,Z.jsxs)(`div`,{className:`absolute inset-0 z-10 bg-background`,children:[(0,Z.jsx)(yC,{}),y===null?null:(0,Z.jsx)(tT,{docName:y})]}):null,t[175]=y,t[176]=L,t[177]=_):_=t[177];let v;t[178]!==y||t[179]!==Ce||t[180]!==H||t[181]!==kt?(v=H&&H.docName===y?(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(xF,{view:H,isPanelCollapsed:Ce,onTogglePanel:kt})}):null,t[178]=y,t[179]=Ce,t[180]=H,t[181]=kt,t[182]=v):v=t[182];let b;t[183]!==y||t[184]!==G||t[185]!==K||t[186]!==Ce||t[187]!==kt?(b=G&&K===y?(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(SF,{view:G,isPanelCollapsed:Ce,onTogglePanel:kt})}):null,t[183]=y,t[184]=G,t[185]=K,t[186]=Ce,t[187]=kt,t[188]=b):b=t[188];let x;t[189]!==h||t[190]!==g||t[191]!==_||t[192]!==v||t[193]!==b?(x=(0,Z.jsxs)(`div`,{className:`relative h-full`,children:[h,g,_,v,b]}),t[189]=h,t[190]=g,t[191]=_,t[192]=v,t[193]=b,t[194]=x):x=t[194];let w;t[195]!==y||t[196]!==M||t[197]!==s||t[198]!==e||t[199]!==r||t[200]!==l||t[201]!==ze||t[202]!==o||t[203]!==kt?(w=!M&&(0,Z.jsx)($P,{activeDocName:y,isSourceMode:e,sourceDisabled:o,onModeChange:r,showAddPropertyButton:!e,onAddProperty:l,isPanelCollapsed:s,onTogglePanel:kt,reserveRightGutter:ze&&s}),t[195]=y,t[196]=M,t[197]=s,t[198]=e,t[199]=r,t[200]=l,t[201]=ze,t[202]=o,t[203]=kt,t[204]=w):w=t[204];let T;t[205]!==y||t[206]!==X||t[207]!==e||t[208]!==d?(T=d?(0,Z.jsx)(aD,{docName:y,surface:e?`source`:`wysiwyg`,dismissed:X,onDismiss:()=>en(!0),onReopen:()=>en(!1)}):null,t[205]=y,t[206]=X,t[207]=e,t[208]=d,t[209]=T):T=t[209];let E;t[210]!==x||t[211]!==w||t[212]!==T?(E=(0,Z.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[x,w,T]}),t[210]=x,t[211]=w,t[212]=T,t[213]=E):E=t[213];let A;t[214]!==X||t[215]!==d?(A=d&&X?{onReopen:()=>en(!1)}:null,t[214]=X,t[215]=d,t[216]=A):A=t[216];let N;t[217]!==Re||t[218]!==k||t[219]!==z||t[220]!==O||t[221]!==A?(N=(0,Z.jsx)(BP,{stats:O,selectionStats:k,showStats:z,composerBadge:A,reserveRightGutter:Re}),t[217]=Re,t[218]=k,t[219]=z,t[220]=O,t[221]=A,t[222]=N):N=t[222];let P;t[223]!==E||t[224]!==N?(P=(0,Z.jsxs)(`div`,{className:`relative flex h-full flex-col`,children:[E,N]}),t[223]=E,t[224]=N,t[225]=P):P=t[225],sn=P;let F=Ie&&Ce,I=!Ce,R;t[226]===Symbol.for(`react.memo_cache_sentinel`)?(R=()=>{Je(!0),Xe.current=!0;let e=()=>{Je(!1),Xe.current=!1,window.removeEventListener(`pointerup`,e)};window.addEventListener(`pointerup`,e)},t[226]=R):R=t[226];let B;t[227]!==Ce||t[228]!==I?(B=(0,Z.jsx)(RT,{withHandle:I,disabled:Ce,onPointerDown:R}),t[227]=Ce,t[228]=I,t[229]=B):B=t[229];let U=Se?0:`${Ze}px`,W=F?`0px`:CF,ee;t[230]===Symbol.for(`react.memo_cache_sentinel`)?(ee=e=>{we(e.asPercentage===0),e.inPixels>0&&Xe.current&&(Qe.current=e.inPixels,tt(e.inPixels))},t[230]=ee):ee=t[230];let te=!qe&&`transition-[flex-grow] duration-200 ease-out motion-reduce:transition-none motion-reduce:duration-0`,ne;t[231]===te?ne=t[232]:(ne=Y(`flex flex-col bg-muted/20`,te),t[231]=te,t[232]=ne);let q;t[233]!==y||t[234]!==i||t[235]!==C||t[236]!==e||t[237]!==a?(q=(0,Z.jsx)(hx,{docName:y,isSourceMode:e,activeTab:i,onActiveTabChange:a,mode:C}),t[233]=y,t[234]=i,t[235]=C,t[236]=e,t[237]=a,t[238]=q):q=t[238];let re;t[239]!==F||t[240]!==Ce||t[241]!==_e||t[242]!==U||t[243]!==W||t[244]!==ne||t[245]!==q?(re=(0,Z.jsx)(LT,{id:`doc-panel`,panelRef:_e,disabled:F,defaultSize:U,minSize:W,maxSize:wF,collapsible:!0,collapsedSize:0,onResize:ee,inert:Ce,className:ne,children:q}),t[239]=F,t[240]=Ce,t[241]=_e,t[242]=U,t[243]=W,t[244]=ne,t[245]=q,t[246]=re):re=t[246];let ie;t[247]!==B||t[248]!==re?(ie=(0,Z.jsxs)(Z.Fragment,{children:[B,re]}),t[247]=B,t[248]=re,t[249]=ie):ie=t[249],cn=ie}let ln=c??kF,un;t[250]!==Re||t[251]!==f||t[252]!==ln||t[253]!==Fe||t[254]!==p||t[255]!==sn?(un=(0,Z.jsx)(hF,{visible:p,onVisibleChange:ln,dockPosition:Fe,onBottomContainer:Ae,onEditorRegion:Me,onReveal:f,showRevealTab:Re,children:sn}),t[250]=Re,t[251]=f,t[252]=ln,t[253]=Fe,t[254]=p,t[255]=sn,t[256]=un):un=t[256];let dn=un,fn;t[257]!==nt||t[258]!==it||t[259]!==c||t[260]!==ye||t[261]!==Ie||t[262]!==v?(fn=Ie?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(RT,{withHandle:!0,onPointerDown:()=>{at(!0),ot.current=!0;let e=()=>{at(!1),ot.current=!1,window.removeEventListener(`pointerup`,e),ye.current?.isCollapsed()&&c?.(!1)};window.addEventListener(`pointerup`,e)}}),(0,Z.jsx)(LT,{id:`terminal-column`,panelRef:ye,style:{backgroundColor:v},defaultSize:`${nt}px`,minSize:`320px`,maxSize:`95%`,collapsible:!0,collapsedSize:0,onResize:e=>{e.inPixels>0&&ot.current&&(rt.current=e.inPixels,lt(e.inPixels))},className:Y(`flex flex-col`,!it&&`transition-[flex-grow] duration-200 ease-out motion-reduce:transition-none motion-reduce:duration-0`),children:(0,Z.jsx)(`div`,{ref:De,className:`flex min-h-0 flex-1 flex-col overflow-hidden`})})]}):null,t[257]=nt,t[258]=it,t[259]=c,t[260]=ye,t[261]=Ie,t[262]=v,t[263]=fn):fn=t[263];let pn=fn,mn=cn!=null&&!Se||Ie,hn;t[264]===Symbol.for(`react.memo_cache_sentinel`)?(hn=e=>{pt(e),mt.current=e},t[264]=hn):hn=t[264];let gn=qe||it||void 0,_n=Ie?`5%`:`30%`,vn;t[265]===mn?vn=t[266]:(vn=mn?{}:{defaultSize:`100%`},t[265]=mn,t[266]=vn);let yn=!(qe||it)&&`transition-[flex-grow] duration-200 ease-out motion-reduce:transition-none motion-reduce:duration-0`,bn;t[267]===yn?bn=t[268]:(bn=Y(yn),t[267]=yn,t[268]=bn);let xn;t[269]!==dn||t[270]!==_n||t[271]!==vn||t[272]!==bn?(xn=(0,Z.jsx)(LT,{minSize:_n,...vn,className:bn,children:dn}),t[269]=dn,t[270]=_n,t[271]=vn,t[272]=bn,t[273]=xn):xn=t[273];let Sn;t[274]!==ht||t[275]!==cn||t[276]!==gn||t[277]!==xn||t[278]!==pn?(Sn=(0,Z.jsxs)(IT,{orientation:`horizontal`,groupRef:ht,"data-dragging":gn,children:[xn,cn,pn]}),t[274]=ht,t[275]=cn,t[276]=gn,t[277]=xn,t[278]=pn,t[279]=Sn):Sn=t[279];let Cn;t[280]!==f||t[281]!==ze?(Cn=ze?(0,Z.jsx)(pF,{dockPosition:`right`,onReveal:f,className:`top-2.5 right-0`}):null,t[280]=f,t[281]=ze,t[282]=Cn):Cn=t[282];let wn;return t[283]!==Sn||t[284]!==Cn?(wn=(0,Z.jsxs)(`div`,{className:`relative flex min-h-0 flex-1`,ref:hn,children:[Sn,Cn]}),t[283]=Sn,t[284]=Cn,t[285]=wn):wn=t[285],wn}function kF(){}function AF(e){return!TF.has(e)}function jF(){return DE()}function MF(){return cE()}function NF(){return Wi()}function PF(){if(typeof window>`u`)return!1;let e=window.okDesktop;return e!=null&&e.menu!=null&&e.platform!==`darwin`}function FF(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.kind!==i.kind)return!1;if(r.kind===`human`&&i.kind===`human`){if(r.clientId!==i.clientId||r.mode!==i.mode||r.tabCount!==i.tabCount)return!1;let e=r.user,t=i.user;if(e.name!==t.name||e.color!==t.color||e.icon!==t.icon)return!1}else if(r.kind===`agent`&&i.kind===`agent`){if(r.agentId!==i.agentId)return!1;let e=r.presence,t=i.presence;if(e.displayName!==t.displayName||e.icon!==t.icon||e.color!==t.color||e.currentDoc!==t.currentDoc||e.mode!==t.mode)return!1}}return!0}function IF(e){let t=new Map;for(let n of e){let e=n.user.principalId;if(typeof e==`string`&&e.length>0){let r=t.get(e);r?r.push(n):t.set(e,[n])}}let n=new Map;for(let[e,r]of t){let t=r.reduce((e,t)=>Math.min(e,t.clientId),1/0);n.set(e,{repClientId:t,count:r.length})}let r=[];for(let t of e){let e=t.user.principalId;if(typeof e==`string`&&e.length>0){let i=n.get(e);i&&i.repClientId===t.clientId&&r.push({...t,tabCount:i.count})}else r.push({...t,tabCount:1})}return r}var LF=1e3,RF=!1;function zF(e){return!!(e.localPrincipalId&&e.entryPrincipalId===e.localPrincipalId||!e.localPrincipalId&&e.entryClientId===e.localClientId)}function BF(e,t,n){let r=(0,$.c)(9),i;r[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={current:[],crossDoc:[]},r[0]=i):i=r[0];let[a,o]=(0,Q.useState)(i),s;r[1]!==n||r[2]!==e?.awareness||r[3]!==t?.awareness?(s=()=>{let r=e?.awareness,i=t?.awareness,a;i==null?a=void 0:ap(i)?a=i:(a=void 0,RF||(RF=!0,console.warn(`[agent-presence] __system__ provider awareness missing getStates() — presence bar will render without agent peers`)));let s=()=>{let e=(r?.getLocalState())?.user?.principalId??null,t=r?.clientID??null,i=[];if(r)for(let[n,a]of r.getStates().entries()){let r=a;if(!r.user||typeof r.user!=`object`)continue;let o=r.user;o.type===`human`&&(zF({entryPrincipalId:o.principalId,entryClientId:n,localPrincipalId:e,localClientId:t})||i.push({kind:`human`,clientId:n,user:o,mode:r.mode??`wysiwyg`,tabCount:1}))}let s=IF(i),{current:c,crossDoc:l}=a?op(a,n,Date.now()):{current:[],crossDoc:[]},u=VF,d=c.map(u),f=l.map(u),p=[...s,...d],m=f;o(e=>FF(e.current,p)&&FF(e.crossDoc,m)?e:{current:p,crossDoc:m})};s();let c=()=>s(),l=()=>s();r?.on(`change`,c),t?.awareness?.on(`change`,l);let u=setInterval(s,LF);return()=>{r?.off(`change`,c),t?.awareness?.off(`change`,l),clearInterval(u)}},r[1]=n,r[2]=e?.awareness,r[3]=t?.awareness,r[4]=s):s=r[4];let c;return r[5]!==n||r[6]!==e||r[7]!==t?(c=[e,t,n],r[5]=n,r[6]=e,r[7]=t,r[8]=c):c=r[8],(0,Q.useEffect)(s,c),a}function VF(e){let{agentId:t,entry:n}=e;return{kind:`agent`,agentId:t,presence:n}}var HF=!1,UF=new Set,WF=!1;function GF(){for(let e of UF)e()}function KF(e){HF!==e&&(HF=e,GF())}function qF(){return HF}function JF(e){return UF.add(e),()=>{UF.delete(e)}}function YF(e){let t=[e.onUpdateRelaunching(()=>KF(!0)),e.onUpdateRelaunchFailed(()=>KF(!1))];return()=>{for(let e of t)e()}}function XF(){if(WF||typeof window>`u`)return;let e=window.okDesktop;e&&(WF=!0,YF(e))}function ZF(){return(0,Q.useSyncExternalStore)(JF,qF,QF)}function QF(){return!1}var $F=`sync-status`;async function eI(e){try{let t=await Ay(e);t.ok||gl.error(t.message,{id:$F,duration:1/0})}catch{}}function tI(e,t){let n=(0,$.c)(6),{_:r}=gt(),i=ZF(),a=(0,Q.useRef)(!1),o=(0,Q.useRef)(!1),s=(0,Q.useRef)(t),c,l;n[0]!==r||n[1]!==t||n[2]!==i||n[3]!==e?(c=()=>{if(s.current!==t&&(s.current=t,a.current=!1,o.current=!1),t)if(e===`synced`&&(a.current=!0),e===`disconnected`&&a.current){if(i){gl.dismiss($F);return}o.current=!0;let e=window.okDesktop;gl.warning(r({id:`HGNCsl`}),{id:$F,duration:1/0,...e?{action:{label:r({id:`uaUc6t`}),onClick:()=>{eI(e)}}}:{}})}else o.current&&e===`synced`&&(o.current=!1,gl.success(r({id:`GhjUB_`}),{id:$F,duration:3e3}))},l=[e,t,r,i],n[0]=r,n[1]=t,n[2]=i,n[3]=e,n[4]=c,n[5]=l):(c=n[4],l=n[5]),(0,Q.useEffect)(c,l)}var nI=4,rI=3,iI={Bird:xh,Cat:Th,Dog:jh,Fish:Rh,Mouse:ug,Rabbit:lg,Shrimp:hg,Snail:gg,Squirrel:yg,Turtle:jg};Object.freeze(Object.keys(iI));function aI(e){if(typeof e.principalId==`string`&&e.principalId.length>0)return{kind:`initials`};let t=e.name.split(` `)[1];return t&&Object.hasOwn(iI,t)?{kind:`animal`,animal:t}:{kind:`initials`}}var oI={claude:`Claude`,cursor:`Cursor`,windsurf:`Windsurf`,openai:`Codex`,github:`Copilot`,cline:`Cline`,bot:`Agent`};function sI(e){let t=(0,$.c)(28),{user:n,mode:r,tabCount:i}=e,{_:a}=gt(),o=aI(n),s=o.kind===`animal`?iI[o.animal]:void 0,c;t[0]===n.name?c=t[1]:(c=Ui(n.name),t[0]=n.name,t[1]=c);let l=c,u;t[2]===n.color?u=t[3]:(u=Bi(n.color),t[2]=n.color,t[3]=u);let d=u,f=n.name,p;t[4]!==a||t[5]!==i||t[6]!==f?(p=i>1?a({id:`qAhFeg`,values:{userName:f,tabCount:i}}):f,t[4]=a,t[5]=i,t[6]=f,t[7]=p):p=t[7];let m=p,h;t[8]!==a||t[9]!==i||t[10]!==f?(h=i>1?a({id:`BEkF-P`,values:{userName:f,tabCount:i}}):f,t[8]=a,t[9]=i,t[10]=f,t[11]=h):h=t[11];let g=h,_;t[12]===n.color?_=t[13]:(_={backgroundColor:n.color},t[12]=n.color,t[13]=_);let v;t[14]!==s||t[15]!==d||t[16]!==l?(v=s?(0,Z.jsx)(s,{size:18,color:d,strokeWidth:1.5}):(0,Z.jsx)(`span`,{className:`font-mono text-2xs font-semibold leading-none`,style:{color:d},children:l}),t[14]=s,t[15]=d,t[16]=l,t[17]=v):v=t[17];let y;t[18]!==g||t[19]!==r||t[20]!==_||t[21]!==v?(y=(0,Z.jsx)(on,{asChild:!0,children:(0,Z.jsx)(`div`,{"data-presence-badge":`human`,"data-presence-mode":r,role:`img`,"aria-label":g,className:`inline-flex size-7 shrink-0 cursor-default items-center justify-center rounded-full ring-2 ring-background`,style:_,children:v})}),t[18]=g,t[19]=r,t[20]=_,t[21]=v,t[22]=y):y=t[22];let b;t[23]===m?b=t[24]:(b=(0,Z.jsx)(sn,{children:m}),t[23]=m,t[24]=b);let x;return t[25]!==y||t[26]!==b?(x=(0,Z.jsxs)(ln,{children:[y,b]}),t[25]=y,t[26]=b,t[27]=x):x=t[27],x}function cI(e){let t=oI[e.icon];return e.displayName||t||Cl._({id:`iEQQyu`})}function lI(e){let t=(0,$.c)(3),[n,r]=(0,Q.useState)(e===`writing`),i=(0,Q.useRef)(null),a,o;return t[0]===e?(a=t[1],o=t[2]):(a=()=>{if(e===`writing`){i.current!==null&&(clearTimeout(i.current),i.current=null),r(!0);return}return i.current!==null&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,r(!1)},600),()=>{i.current!==null&&(clearTimeout(i.current),i.current=null)}},o=[e],t[0]=e,t[1]=a,t[2]=o),(0,Q.useEffect)(a,o),n}function uI(e){let t=(0,$.c)(33),{participant:n,crossDoc:r,scoped:i,onClickAgent:a}=e,{_:o}=gt(),{activeDocName:s}=Ye(),{presence:c,agentId:l}=n,u=cI(c),d=lI(c.mode),f=!r&&d,p=c.currentDoc&&!Yi(c.currentDoc)?c.currentDoc:null,m=s!==null||p!==null,h=m?`cursor-pointer`:`cursor-default opacity-50`,g=i?`ring-primary ring-offset-2 ring-offset-background`:`ring-background`,_=f&&!i?`ring-primary/40 animate-pulse`:``,v;t[0]!==h||t[1]!==g||t[2]!==_?(v=[`inline-flex size-7 shrink-0 items-center justify-center rounded-full ring-2`,h,g,_].filter(Boolean),t[0]=h,t[1]=g,t[2]=_,t[3]=v):v=t[3];let y=v.join(` `),b=r?`true`:void 0,x=i?`true`:void 0,S=m?void 0:`true`,C;t[4]!==c.mode||t[5]!==b||t[6]!==x||t[7]!==S?(C={"data-presence-badge":`agent`,"data-presence-mode":c.mode,"data-presence-crossdoc":b,"data-presence-scoped":x,"data-presence-inert":S},t[4]=c.mode,t[5]=b,t[6]=x,t[7]=S,t[8]=C):C=t[8];let w=C,T=o(r&&p?{id:`b4AQFK`,values:{tooltipName:u,realCurrentDoc:p}}:{id:`RfHNf8`,values:{tooltipName:u}}),E;t[9]!==l||t[10]!==T||t[11]!==w||t[12]!==m||t[13]!==a||t[14]!==c.color||t[15]!==c.icon||t[16]!==p||t[17]!==y||t[18]!==u?(E=m?(0,Z.jsx)(`button`,{type:`button`,...w,"aria-label":T,className:y,style:{backgroundColor:c.color},onClick:()=>a(l,p),children:(0,Z.jsx)(ef,{icon:c.icon,width:16,height:16,className:`text-white`,"aria-hidden":!0})}):(0,Z.jsx)(`div`,{...w,role:`img`,"aria-label":u,className:y,style:{backgroundColor:c.color},children:(0,Z.jsx)(ef,{icon:c.icon,width:16,height:16,className:`text-white`,"aria-hidden":!0})}),t[9]=l,t[10]=T,t[11]=w,t[12]=m,t[13]=a,t[14]=c.color,t[15]=c.icon,t[16]=p,t[17]=y,t[18]=u,t[19]=E):E=t[19];let D=E,O;t[20]===D?O=t[21]:(O=(0,Z.jsx)(on,{asChild:!0,children:D}),t[20]=D,t[21]=O);let k;t[22]===u?k=t[23]:(k=(0,Z.jsx)(`span`,{className:`font-medium`,children:u}),t[22]=u,t[23]=k);let A;t[24]!==r||t[25]!==p?(A=r&&p?(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:(0,Z.jsx)(J,{id:`Wh0im4`,values:{realCurrentDoc:p}})}):null,t[24]=r,t[25]=p,t[26]=A):A=t[26];let j;t[27]!==k||t[28]!==A?(j=(0,Z.jsxs)(sn,{className:`flex flex-col gap-0.5`,children:[k,A]}),t[27]=k,t[28]=A,t[29]=j):j=t[29];let M;return t[30]!==O||t[31]!==j?(M=(0,Z.jsxs)(ln,{children:[O,j]}),t[30]=O,t[31]=j,t[32]=M):M=t[32],M}function dI(e){let t=(0,$.c)(21),{count:n,remainder:r,crossDoc:i,scopedAgentId:a,onClickAgent:o}=e,s;t[0]!==n||t[1]!==i?(s=i?Cl._({id:`9euN0m`,values:{count:n}}):Cl._({id:`uhJEA2`,values:{count:n}}),t[0]=n,t[1]=i,t[2]=s):s=t[2];let c=s,l=i?`true`:void 0,u;t[3]!==n||t[4]!==c||t[5]!==l?(u=(0,Z.jsx)(Ht,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`presence-overflow`,"data-presence-crossdoc":l,className:`inline-flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-full bg-muted font-medium text-muted-foreground text-xs ring-2 ring-background hover:bg-muted/80`,"aria-label":c,children:[`+`,n]})}),t[3]=n,t[4]=c,t[5]=l,t[6]=u):u=t[6];let d;if(t[7]!==i||t[8]!==o||t[9]!==r||t[10]!==a){let e;t[12]!==i||t[13]!==o||t[14]!==a?(e=e=>e.kind===`human`?(0,Z.jsx)(sI,{user:e.user,mode:e.mode,tabCount:e.tabCount},e.clientId):(0,Z.jsx)(uI,{participant:e,crossDoc:i,scoped:a===e.agentId,onClickAgent:o},e.agentId),t[12]=i,t[13]=o,t[14]=a,t[15]=e):e=t[15],d=r.map(e),t[7]=i,t[8]=o,t[9]=r,t[10]=a,t[11]=d}else d=t[11];let f;t[16]===d?f=t[17]:(f=(0,Z.jsx)(qt,{align:`end`,className:`w-auto max-w-xs p-2`,children:(0,Z.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:d})}),t[16]=d,t[17]=f);let p;return t[18]!==u||t[19]!==f?(p=(0,Z.jsxs)(Vt,{children:[u,f]}),t[18]=u,t[19]=f,t[20]=p):p=t[20],p}function fI(e,t,n,r){return e.kind===`human`?(0,Z.jsx)(sI,{user:e.user,mode:e.mode,tabCount:e.tabCount},e.clientId):(0,Z.jsx)(uI,{participant:e,crossDoc:n,scoped:r===e.agentId,onClickAgent:t},e.agentId)}function pI(){let e=(0,$.c)(20),{activeProvider:t,activeDocName:n,systemProvider:r,openActivityPanel:i,docPanelMode:a,docPanelAgentId:o}=Ye(),{current:s,crossDoc:c}=BF(t,r,n);if(tI(OE(t),n),s.length===0&&c.length===0)return null;let l;if(e[0]!==c||e[1]!==s||e[2]!==o||e[3]!==a||e[4]!==i){let t=s.slice(0,nI),n;e[6]===s?n=e[7]:(n=s.slice(nI),e[6]=s,e[7]=n);let r=n,u=c.slice(0,rI),d;e[8]===c?d=e[9]:(d=c.slice(rI),e[8]=c,e[9]=d);let f=d,p=i,m=a===`agent`?o:null,h;e[10]!==p||e[11]!==m?(h=e=>fI(e,p,!1,m),e[10]=p,e[11]=m,e[12]=h):h=e[12];let g=t.map(h),_;e[13]!==r||e[14]!==p||e[15]!==m?(_=r.length>0?(0,Z.jsx)(dI,{count:r.length,remainder:r,crossDoc:!1,scopedAgentId:m,onClickAgent:p}):null,e[13]=r,e[14]=p,e[15]=m,e[16]=_):_=e[16];let v;e[17]!==g||e[18]!==_?(v=(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5`,"data-presence-section":`current`,children:[g,_]}),e[17]=g,e[18]=_,e[19]=v):v=e[19],l=(0,Z.jsxs)(`div`,{"data-slot":`presence-bar`,className:`flex items-center px-1 py-1.5`,children:[v,c.length>0?(0,Z.jsxs)(`div`,{className:`ml-1.5 flex items-center gap-1.5`,"data-presence-section":`crossdoc`,children:[u.map(e=>fI(e,p,!0,m)),f.length>0?(0,Z.jsx)(dI,{count:f.length,remainder:f,crossDoc:!0,scopedAgentId:m,onClickAgent:p}):null]}):null]}),e[0]=c,e[1]=s,e[2]=o,e[3]=a,e[4]=i,e[5]=l}else l=e[5];return l}function mI(){let e=(0,$.c)(4),[t,n]=(0,Q.useState)(null),r,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=window.okDesktop;if(!e)return;let t=!1;return e.state.query().then(e=>{t||n(e.channel)}).catch(hI),()=>{t=!0}},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,Q.useEffect)(r,i);let a;return e[2]===t?a=e[3]:(a={channel:t},e[2]=t,e[3]=a),a}function hI(e){console.warn(`[use-update-channel] bridge.state.query() failed`,e)}function gI(e){let t=(0,$.c)(6),{className:n}=e,{_:r}=gt(),{channel:i}=mI();if(i!==`beta`)return null;let a;t[0]===r?a=t[1]:(a=r({id:`9fhQRL`}),t[0]=r,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(J,{id:`cSCbv3`}),t[2]=o):o=t[2];let s;return t[3]!==n||t[4]!==a?(s=(0,Z.jsx)(Eu,{variant:`secondary`,"aria-label":a,"data-testid":`beta-badge`,className:n,children:o}),t[3]=n,t[4]=a,t[5]=s):s=t[5],s}function _I(e,t){return t.trim()}function vI(e){return![``,`.`,`..`].includes(e)&&!e.includes(`/`)&&!e.includes(`\\`)&&!e.includes(`\0`)}function yI(e,t){let n=_I(e.kind,t),r=e.path.split(`/`);return r[r.length-1]=n,r.join(`/`)}function bI(e,t,n=[],r=[],i=[]){if(t.length===0&&n.length===0&&r.length===0&&i.length===0)return e;let a=new Map(t.map(e=>[e.fromDocName,e.toDocName])),o=new Map(i.map(e=>[e.toDocName,e.docExt])),s=new Map(r.map(e=>[e.fromPath,e.toPath]));return e.map(e=>{if(Bl(e)){let t=s.get(Zf(e.docName,e.docExt));if(t){let n=ql(t);return{kind:`asset`,path:t,assetExt:n,mediaKind:Ni(n),size:e.size,modified:e.modified,referencedBy:[]}}let n=a.get(e.docName)??e.docName;return{...e,docName:n,docExt:o.get(n)??e.docExt}}if(Ul(e))return{...e,path:EI(e.path,n)};if(Kl(e)){let t=s.get(e.path);return t&&Il(t)?{kind:`document`,docName:Lf(t),docExt:Rl(t),size:e.size,modified:e.modified}:{...e,path:t??EI(e.path,n)}}return e})}function xI(e,t,n,r=[]){if(t.length===0&&!n&&r.length===0)return e;let i=new Set(t),a=new Set(r);return e.filter(e=>Bl(e)?!i.has(e.docName)&&!AI(e.docName,n):Ul(e)?!AI(e.path,n):Kl(e)?!a.has(e.path)&&!AI(e.path,n):!0)}function SI(e,t){if(e.kind!==`asset`||t.some(t=>Kl(t)&&t.path===e.path))return e;let n=ep(e.path,t);return n?{...e,path:n,name:n.split(`/`).pop()??n}:e}function CI(e,t,n,r=new Date().toISOString()){let i=!1,a=[...e],o=e=>{a.some(t=>DI(t,e))||(a.push(e),i=!0)};if(n.kind===`file`){let s=e.find(e=>Bl(e)&&e.docName===t.path);return o({kind:`document`,docName:n.path,docExt:s?.docExt??t.docExt,size:s?.size??0,modified:r}),i?a:e}let s=e.find(e=>Ul(e)&&e.path===t.path);o({kind:`folder`,path:n.path,size:s?.size??0,modified:r});let c=new Set(n.duplicatedDocNames);for(let i of e){if(Bl(i)){let e=kI(i.docName,t.path,n.path);e&&c.has(e)&&o({...i,docName:e,modified:r});continue}if(Ul(i)){let e=OI(i.path,t.path,n.path);e&&o({...i,path:e,modified:r})}}return i?a:e}function wI(e,t){return e?t.find(t=>t.fromDocName===e)?.toDocName??e:null}function TI(e,t){let n=e.kind===`file`?Zf(e.path,e.docExt):e.path;return Qs(t.contentDir,n,t.pathSeparator)}function EI(e,t){for(let{fromPath:n,toPath:r}of t){if(e===n)return r;if(e.startsWith(`${n}/`))return`${r}${e.slice(n.length)}`}return e}function DI(e,t){return Bl(e)&&Bl(t)?e.docName===t.docName:Ul(e)&&Ul(t)||Kl(e)&&Kl(t)?e.path===t.path:!1}function OI(e,t,n){return e===t?n:kI(e,t,n)}function kI(e,t,n){return e.startsWith(`${t}/`)?`${n}${e.slice(t.length)}`:null}function AI(e,t){return!!t&&(e===t||e.startsWith(`${t}/`))}var jI=[`.md`,`.mdx`],MI=`group relative -mb-px flex h-10 min-w-28 max-w-64 shrink-0 cursor-pointer items-center overflow-hidden border border-transparent font-medium transition-colors`,NI=`z-10 rounded-t-lg rounded-b-none border-border border-b-0 bg-background text-foreground`,PI=Y(NI,`bg-transparent hover:bg-muted focus-visible:bg-muted border-transparent hover:border-border focus-visible:border-border`),FI=`flex h-full min-w-0 flex-1 cursor-pointer items-center overflow-hidden px-3 text-left text-[13px]`;function II(e){return e.replace(/[^A-Za-z0-9_-]/g,`-`)}function LI(e){let t=Cu(e);window.location.hash!==t&&(window.location.hash=t)}function RI(e,t){let n=[t,...jI].filter((e,t,n)=>e&&n.indexOf(e)===t),r=e.toLowerCase(),i=n.find(t=>e.length>t.length&&r.endsWith(t.toLowerCase()));return i?e.slice(0,-i.length):e}function zI(e){return e.metaKey||e.ctrlKey}var BI=1e3;function VI(e,t){return e<0||e>=t?null:e<8?String(e+1):e===t-1?`9`:null}function HI(e,t){return VI(e,t)}function UI(e,t){let n=VI(e,t);if(n)return[`Meta+${n}`,`Control+${n}`].join(` `)}function WI(e,t){if(!zI(e)||e.altKey||e.shiftKey||!/^[1-9]$/.test(e.key))return null;let n=Number(e.key);if(n===9)return t>0?t-1:null;let r=n-1;return r<Math.min(8,t)?r:null}function GI(e){let t=(0,$.c)(3),{value:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=Y(Ac(!0),`font-mono tabular-nums hover:bg-transparent animate-in fade-in-0 zoom-in-95 duration-150 motion-reduce:animate-none motion-reduce:duration-0`),t[0]=r):r=t[0];let i=`⌘${n}`,a;return t[1]===i?a=t[2]:(a=(0,Z.jsx)(`span`,{"aria-hidden":`true`,"data-testid":`editor-tab-shortcut-hint`,className:r,children:(0,Z.jsx)(p,{className:`text-[10px]`,children:i})}),t[1]=i,t[2]=a),a}function KI(e){let t=(0,$.c)(37),n,r,i,a,o,s,c,l;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8]):({activateFromKeyboard:n,className:r,tabId:l,disabled:i,onKeyDown:a,ref:o,style:s,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l);let u;t[9]!==i||t[10]!==l?(u={id:l,disabled:i},t[9]=i,t[10]=l,t[11]=u):u=t[11];let{attributes:d,listeners:f,rect:p,setNodeRef:m,transform:h,transition:g,isDragging:_}=mf(u),v=p.current?.width,y;t[12]!==_||t[13]!==s||t[14]!==v||t[15]!==h||t[16]!==g?(y=Wc({activeWidth:v,isDragging:_,outerStyle:s,transform:h,transition:g}),t[12]=_,t[13]=s,t[14]=v,t[15]=h,t[16]=g,t[17]=y):y=t[17];let b=y,x;t[18]!==o||t[19]!==m?(x=function(e){m(e),typeof o==`function`?o(e):o&&`current`in o&&(o.current=e)},t[18]=o,t[19]=m,t[20]=x):x=t[20];let S=x,C=f?.onKeyDown,w;t[21]!==n||t[22]!==_||t[23]!==a||t[24]!==C?(w=function(e){a?.(e);let t=Ic({event:e,hasKeyboardActivation:!!n,isDragging:_});if(t!==`ignore`){if(t===`activate-tab`&&n){e.preventDefault(),n();return}C?.(e)}},t[21]=n,t[22]=_,t[23]=a,t[24]=C,t[25]=w):w=t[25];let T=w,E;t[26]!==r||t[27]!==_?(E=kc({className:r,isDragging:_}),t[26]=r,t[27]=_,t[28]=E):E=t[28];let D;return t[29]!==d||t[30]!==S||t[31]!==T||t[32]!==f||t[33]!==c||t[34]!==b||t[35]!==E?(D=(0,Z.jsx)(`div`,{ref:S,"data-editor-tab-sortable":``,className:E,style:b,...c,...d,...f,onKeyDown:T}),t[29]=d,t[30]=S,t[31]=T,t[32]=f,t[33]=c,t[34]=b,t[35]=E,t[36]=D):D=t[36],D}function qI(e){let t=(0,$.c)(52),{children:n,closeTab:r,closeTabs:i,canPin:a,disabled:o,openTabs:s,pinTab:c,pinnedTabIds:l,tabId:u,unpinTab:d}=e,f=a===void 0?!0:a;if(o!==void 0&&o)return n;let p;t[0]!==f||t[1]!==l||t[2]!==u?(p=f&&l.includes(u),t[0]=f,t[1]=l,t[2]=u,t[3]=p):p=t[3];let m=p,h;if(t[4]!==s||t[5]!==l||t[6]!==u){let e;t[8]===u?e=t[9]:(e=e=>e!==u,t[8]=u,t[9]=e),h=C(s.filter(e),l),t[4]=s,t[5]=l,t[6]=u,t[7]=h}else h=t[7];let g=h,_;t[10]!==s||t[11]!==l?(_=C(s,l),t[10]=s,t[11]=l,t[12]=_):_=t[12];let v=_,y;t[13]===n?y=t[14]:(y=(0,Z.jsx)(ey,{asChild:!0,children:n}),t[13]=n,t[14]=y);let b;t[15]!==r||t[16]!==u?(b=()=>r(u),t[15]=r,t[16]=u,t[17]=b):b=t[17];let x;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Z.jsx)(J,{id:`yz7wBu`}),t[18]=x):x=t[18];let S;t[19]!==m||t[20]!==b?(S=(0,Z.jsx)(iy,{disabled:m,onSelect:b,children:x}),t[19]=m,t[20]=b,t[21]=S):S=t[21];let w=g.length===0,T;t[22]!==i||t[23]!==g?(T=()=>{i(g)},t[22]=i,t[23]=g,t[24]=T):T=t[24];let E;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Z.jsx)(J,{id:`omXJcU`}),t[25]=E):E=t[25];let D;t[26]!==w||t[27]!==T?(D=(0,Z.jsx)(iy,{disabled:w,onSelect:T,children:E}),t[26]=w,t[27]=T,t[28]=D):D=t[28];let O=v.length===0,k;t[29]!==v||t[30]!==i?(k=()=>{i(v)},t[29]=v,t[30]=i,t[31]=k):k=t[31];let A;t[32]===l.length?A=t[33]:(A=l.length?(0,Z.jsx)(J,{id:`U2Kx6T`}):(0,Z.jsx)(J,{id:`WyXG7w`}),t[32]=l.length,t[33]=A);let j;t[34]!==O||t[35]!==k||t[36]!==A?(j=(0,Z.jsx)(iy,{disabled:O,"data-testid":`editor-tab-context-close-all`,onSelect:k,children:A}),t[34]=O,t[35]=k,t[36]=A,t[37]=j):j=t[37];let M;t[38]!==f||t[39]!==m||t[40]!==c||t[41]!==u||t[42]!==d?(M=f&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ly,{}),(0,Z.jsx)(iy,{"data-testid":`editor-tab-context-pin-toggle`,onSelect:()=>m?d(u):c(u),children:m?(0,Z.jsx)(J,{id:`SYfHmN`}):(0,Z.jsx)(J,{id:`3pU8e-`})})]}),t[38]=f,t[39]=m,t[40]=c,t[41]=u,t[42]=d,t[43]=M):M=t[43];let N;t[44]!==D||t[45]!==j||t[46]!==M||t[47]!==S?(N=(0,Z.jsxs)(ry,{className:`min-w-40`,children:[S,D,j,M]}),t[44]=D,t[45]=j,t[46]=M,t[47]=S,t[48]=N):N=t[48];let P;return t[49]!==N||t[50]!==y?(P=(0,Z.jsxs)($v,{children:[y,N]}),t[49]=N,t[50]=y,t[51]=P):P=t[51],P}function JI(e){let t=(0,$.c)(28),{accessibleLabel:n,closeTab:r,forceCloseVisible:i,isActive:a,isPinned:o,shortcutHint:s,tabId:c,unpinTab:l}=e,u=i===void 0?!1:i,d=s===void 0?null:s,{_:f}=gt();if(d){let e;return t[0]===d?e=t[1]:(e=(0,Z.jsx)(GI,{value:d}),t[0]=d,t[1]=e),e}if(o){let e;t[2]!==f||t[3]!==n?(e=f({id:`t18QYR`,values:{accessibleLabel:n}}),t[2]=f,t[3]=n,t[4]=e):e=t[4];let r;t[5]!==c||t[6]!==l?(r=e=>{e.stopPropagation(),l(c)},t[5]=c,t[6]=l,t[7]=r):r=t[7];let i;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(cg,{"aria-hidden":`true`}),t[8]=i):i=t[8];let a;return t[9]!==e||t[10]!==r?(a=(0,Z.jsx)(X,{variant:`ghost`,size:`icon-xs`,type:`button`,"aria-label":e,"data-testid":`editor-tab-unpin-button`,className:`mr-1.5 text-primary! hover:bg-primary/10!`,onClick:r,children:i}),t[9]=e,t[10]=r,t[11]=a):a=t[11],a}let p;t[12]!==f||t[13]!==n?(p=f({id:`JLzQi_`,values:{accessibleLabel:n}}),t[12]=f,t[13]=n,t[14]=p):p=t[14];let m=u||a,h;t[15]===m?h=t[16]:(h=Ac(m),t[15]=m,t[16]=h);let g;t[17]===a?g=t[18]:(g=jc(a),t[17]=a,t[18]=g);let _;t[19]!==r||t[20]!==c?(_=e=>{e.stopPropagation(),r(c)},t[19]=r,t[20]=c,t[21]=_):_=t[21];let v;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsx)(hl,{"aria-hidden":`true`}),t[22]=v):v=t[22];let y;return t[23]!==p||t[24]!==h||t[25]!==g||t[26]!==_?(y=(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":p,"data-testid":`editor-tab-close-button`,className:h,tabIndex:g,onClick:_,children:v}),t[23]=p,t[24]=h,t[25]=g,t[26]=_,t[27]=y):y=t[27],y}function YI(e){let t=(0,$.c)(1),{hasConflict:n}=e;if(!n)return null;let r;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(ul,{"aria-hidden":`true`,"data-testid":`editor-tab-conflict-badge`,className:`mr-1 size-3.5 shrink-0 text-amber-500`}),t[0]=r):r=t[0],r}function XI(e){let t=(0,$.c)(27),{accessibleLabel:n,activateTab:r,baseName:i,docName:a,enterRenameMode:o,extension:s,hideDocExtension:c,tabId:l}=e,{_:u}=gt(),d=nE(a)===`conflict`,f;t[0]!==u||t[1]!==n||t[2]!==d?(f=d?u({id:`mVFyH-`,values:{accessibleLabel:n}}):n,t[0]=u,t[1]=n,t[2]=d,t[3]=f):f=t[3];let p=f,m;t[4]!==r||t[5]!==l?(m=()=>{r(l)},t[4]=r,t[5]=l,t[6]=m):m=t[6];let h;t[7]!==a||t[8]!==o||t[9]!==l?(h=e=>{e.preventDefault(),e.stopPropagation(),o(l,a)},t[7]=a,t[8]=o,t[9]=l,t[10]=h):h=t[10];let g;t[11]===d?g=t[12]:(g=(0,Z.jsx)(YI,{hasConflict:d}),t[11]=d,t[12]=g);let _;t[13]===i?_=t[14]:(_=(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:i}),t[13]=i,t[14]=_);let v;t[15]!==s||t[16]!==c?(v=!c&&(0,Z.jsx)(`span`,{className:`shrink-0`,children:s}),t[15]=s,t[16]=c,t[17]=v):v=t[17];let y;t[18]!==_||t[19]!==v?(y=(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center`,children:[_,v]}),t[18]=_,t[19]=v,t[20]=y):y=t[20];let b;return t[21]!==p||t[22]!==m||t[23]!==h||t[24]!==g||t[25]!==y?(b=(0,Z.jsxs)(`button`,{type:`button`,"aria-label":p,title:p,className:FI,onClick:m,onDoubleClick:h,tabIndex:-1,children:[g,y]}),t[21]=p,t[22]=m,t[23]=h,t[24]=g,t[25]=y,t[26]=b):b=t[26],b}function ZI(){let e=(0,$.c)(94),{activeDocName:t,activeTabId:n,activeNewTabId:r,activeTarget:a,activateTab:o,activateNewTab:s,closeNewTab:c,closeTab:l,closeTabs:u,isNewTabActive:d,newTabIds:f,openNewTab:p,openTabs:m,pinTab:h,pinnedTabIds:g,reopenClosedTab:_,reconcileLocalRename:v,reorderTabs:y,unpinTab:b,visibleTabIds:x}=Ye(),{_:S}=gt(),{pageMeta:C}=Go(),w=(0,Q.useRef)(null),[T,E]=(0,Q.useState)(null),[D,O]=(0,Q.useState)(null),[k,A]=(0,Q.useState)(``),[j,M]=(0,Q.useState)(null),[N,F]=(0,Q.useState)(!1),[I,R]=(0,Q.useState)(!1),z=(0,Q.useRef)(null),B=(0,Q.useRef)(!1),V=(0,Q.useRef)(!1),H=(0,Q.useRef)(null),U=(0,Q.useRef)(t),W=(0,Q.useRef)(null),G=(0,Q.useRef)(!1),K=(0,Q.useRef)(!1),ee;e[0]!==n||e[1]!==t||e[2]!==a?(ee=n??(a?L(a):t?Je(t):null),e[0]=n,e[1]=t,e[2]=a,e[3]=ee):ee=e[3];let te=ee,ne;e[4]!==r||e[5]!==te||e[6]!==d||e[7]!==f||e[8]!==m?(ne=d?`${r??`__new-tab__`}\u0000${m.join(`\0`)}\u0000${f.join(`\0`)}`:te?`${te}\u0000${m.join(`\0`)}`:``,e[4]=r,e[5]=te,e[6]=d,e[7]=f,e[8]=m,e[9]=ne):ne=e[9];let q=ne,ie,ae;e[10]===t?(ie=e[11],ae=e[12]):(ie=()=>{U.current=t},ae=[t],e[10]=t,e[11]=ie,e[12]=ae),(0,Q.useEffect)(ie,ae);let oe,se;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(oe=()=>()=>{W.current!==null&&(window.clearTimeout(W.current),W.current=null)},se=[],e[13]=oe,e[14]=se):(oe=e[13],se=e[14]),(0,Q.useEffect)(oe,se);let ce,le;e[15]===q?(ce=e[16],le=e[17]):(ce=()=>{q&&(w.current?.querySelector(`[data-active-tab="true"]`))?.scrollIntoView({block:`nearest`,inline:`nearest`})},le=[q],e[15]=q,e[16]=ce,e[17]=le),(0,Q.useEffect)(ce,le);let ue,de;e[18]===D?(ue=e[19],de=e[20]):(ue=()=>{D&&(z.current?.focus(),z.current?.select())},de=[D],e[18]=D,e[19]=ue,e[20]=de),(0,Q.useEffect)(ue,de);let fe,pe;e[21]!==m||e[22]!==D?(fe=()=>{!D||m.includes(D.tabId)||(V.current=!0,H.current=null,O(null),A(``),M(null),F(!1))},pe=[m,D],e[21]=m,e[22]=D,e[23]=fe,e[24]=pe):(fe=e[23],pe=e[24]),(0,Q.useEffect)(fe,pe);let me;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(me=function(e,t){let n=t.split(`/`);V.current=!1,H.current=null,O({docName:t,tabId:e}),A(n[n.length-1]),M(null)},e[25]=me):me=e[25];let he=me,ge=function(){V.current=!0,H.current=null,O(null),A(``),M(null),F(!1)},_e=async function(){if(V.current){V.current=!1;return}if(B.current)return;let e=D?.docName;if(!e){ge();return}let t=_I(`file`,RI(k,C.get(e)?.docExt??`.md`)),n=e.split(`/`),r=n[n.length-1];if(t===r){ge();return}if(t===H.current){z.current?.focus();return}if(!vI(t)){M(S({id:`P8yDjG`})),z.current?.focus();return}let i=yI({kind:`file`,path:e,name:r},t);B.current=!0,F(!0),M(null);try{let n=await fetch(`/api/rename-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:`file`,fromPath:e,toPath:i})});if(V.current){F(!1),B.current=!1;return}let r=await P(n,`Server error (HTTP ${n.status})`);if(!r.ok){M(r.title),F(!1),B.current=!1,H.current=t,z.current?.focus();return}let a=Ne(Xi,r.body,`rename-path:tab`,{renamed:[],renamedAssets:[]}).renamed,o=U.current,s=wI(o,a),c=!0;try{await v({renamed:a}),au([`files`,`backlinks`,`graph`])}catch(n){let r=n;c=!1,console.warn(`[EditorTabs] post-rename reconciliation failed`,{err:r,docName:e,newDocName:i,normalized:t}),gl.error(S({id:`MUBR8r`}))}V.current=!0,O(null),A(``),M(null),F(!1),B.current=!1,H.current=null,c&&s&&s!==o&&LI(s)}catch(n){console.warn(`[EditorTabs] rename failed`,{err:n,docName:e,newDocName:i,normalized:t}),M(S({id:`HIb0vl`})),F(!1),B.current=!1,H.current=t,z.current?.focus()}},ve=typeof window<`u`&&window.okDesktop!=null,ye;e[26]===f?ye=e[27]:(ye=new Set(f),e[26]=f,e[27]=ye);let be=ye,xe;e[28]===T?xe=e[29]:(xe=Hc(T),e[28]=T,e[29]=xe);let Se;e[30]===xe?Se=e[31]:(Se=[xe],e[30]=xe,e[31]=Se);let Ce=Se,we;e[32]!==c||e[33]!==u||e[34]!==be?(we=function(e){let t=[],n=[];for(let r of e)be.has(r)?n.push(r):t.push(r);t.length>0&&u(t);for(let e of n)c(e)},e[32]=c,e[33]=u,e[34]=be,e[35]=we):we=e[35];let Te=we,Ee,De;e[36]!==s||e[37]!==o||e[38]!==r||e[39]!==te||e[40]!==d||e[41]!==f||e[42]!==p||e[43]!==_||e[44]!==x?(Ee=()=>{let e=new Set(f),t=function(){W.current!==null&&(window.clearTimeout(W.current),W.current=null)},n=function(e){G.current!==e&&(G.current=e)},i=function(e){K.current!==e&&(K.current=e,R(e))},a=function(){n(!0),!(K.current||W.current!==null)&&(W.current=window.setTimeout(()=>{W.current=null,G.current&&i(!0)},BI))},c=function(){t(),n(!1),i(!1)},l=function(t){e.has(t)?s(t):o(t)},u=function(e){if(x.length===0)return;let t=d?r:te,n=t?x.indexOf(t):-1;l(x[((n>=0?n:0)+e+x.length)%x.length])},m=function(e){if(zI(e)&&a(),El(e,`tab-new`)){e.preventDefault(),p();return}if(El(e,`tab-reopen-closed`)){e.preventDefault(),_();return}if(El(e,`tab-next`)){e.preventDefault(),u(1);return}if(El(e,`tab-previous`)){e.preventDefault(),u(-1);return}let t=WI(e,x.length);t!==null&&(e.preventDefault(),l(x[t]))},h=function(e){!e.metaKey&&!e.ctrlKey&&c()};return window.addEventListener(`keydown`,m,{capture:!0}),window.addEventListener(`keyup`,h,{capture:!0}),window.addEventListener(`blur`,c),document.addEventListener(`visibilitychange`,c),()=>{window.removeEventListener(`keydown`,m,{capture:!0}),window.removeEventListener(`keyup`,h,{capture:!0}),window.removeEventListener(`blur`,c),document.removeEventListener(`visibilitychange`,c)}},De=[r,te,s,o,d,f,p,_,x],e[36]=s,e[37]=o,e[38]=r,e[39]=te,e[40]=d,e[41]=f,e[42]=p,e[43]=_,e[44]=x,e[45]=Ee,e[46]=De):(Ee=e[45],De=e[46]),(0,Q.useEffect)(Ee,De);let Oe;e[47]===Symbol.for(`react.memo_cache_sentinel`)?(Oe={activationConstraint:{distance:8}},e[47]=Oe):Oe=e[47];let ke;e[48]===Symbol.for(`react.memo_cache_sentinel`)?(ke={coordinateGetter:gf,keyboardCodes:zc},e[48]=ke):ke=e[48];let Ae=yf(hf(Cf,Oe),hf(_f,ke)),je=I,Me;e[49]===Symbol.for(`react.memo_cache_sentinel`)?(Me=function(){E(Bc(w.current,`[data-editor-tab-sortable]`))},e[49]=Me):Me=e[49];let Pe=Me,Fe;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=function(){E(null)},e[50]=Fe):Fe=e[50];let Ie=Fe,Le;e[51]!==Ie||e[52]!==y||e[53]!==x?(Le=function(e){Ie();let t=String(e.active.id),n=e.over?String(e.over.id):null;if(!n||t===n)return;let r=x.indexOf(t),i=x.indexOf(n);r<0||i<0||r===i||y(vf([...x],r,i),t)},e[51]=Ie,e[52]=y,e[53]=x,e[54]=Le):Le=e[54];let Re=Le,ze=ve?``:void 0,Be;e[55]===Symbol.for(`react.memo_cache_sentinel`)?(Be=Y(`pl-2 flex h-12 min-w-0 touch-manipulation flex-1 items-end overflow-x-auto overflow-y-hidden overscroll-x-contain scroll-fade-mask-x [scrollbar-width:none]`,ve&&`[-webkit-app-region:drag]`),e[55]=Be):Be=e[55];let Ve=Dc,He;e[56]===Symbol.for(`react.memo_cache_sentinel`)?(He=Y(`flex items-end gap-1`,ve&&`[-webkit-app-region:no-drag]`),e[56]=He):He=e[56];let Ue=xf,We=Lc,Ge;e[57]===Symbol.for(`react.memo_cache_sentinel`)?(Ge={container:typeof document<`u`?document.body:void 0},e[57]=Ge):Ge=e[57];let Ke=Sf,qe;e[58]===x?qe=e[59]:(qe=[...x],e[58]=x,e[59]=qe);let Xe=bf,Ze=x.map((e,t)=>{let n=I?HI(t,x.length):null,a=UI(t,x.length);if(be.has(e)){let t=e===r;return(0,Z.jsx)(qI,{tabId:e,canPin:!1,openTabs:x,closeTab:c,closeTabs:Te,pinTab:h,pinnedTabIds:g,unpinTab:b,children:(0,Z.jsxs)(KI,{tabId:e,activateFromKeyboard:()=>s(e),"aria-current":t?`page`:void 0,"aria-keyshortcuts":a,"data-active-tab":t?`true`:void 0,className:Y(MI,t?NI:PI),onAuxClick:t=>{t.button===1&&(t.preventDefault(),c(e))},onClick:t=>{t.target===t.currentTarget&&s(e)},children:[(0,Z.jsx)(`button`,{type:`button`,"aria-label":S({id:`zLak8b`}),"data-testid":`editor-new-tab-placeholder-button`,className:FI,onClick:()=>s(e),tabIndex:-1,children:(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:(0,Z.jsx)(J,{id:`3YvS-c`})})}),n?(0,Z.jsx)(GI,{value:n}):(0,Z.jsx)(`button`,{type:`button`,"aria-label":S({id:`xCdTnb`}),"data-testid":`editor-new-tab-placeholder-close`,className:Ac(je||t),tabIndex:jc(t),onClick:t=>{t.stopPropagation(),c(e)},children:(0,Z.jsx)(hl,{"aria-hidden":`true`,className:`size-3.5`})})]})},e)}let u=re(e),d=e===te,f=g.includes(e);if(u.kind===`folder`){let{baseName:t,label:r,prefix:s}=i(u.folderPath,`/`),c=`${s}${r}`;return(0,Z.jsx)(qI,{tabId:e,openTabs:x,closeTab:l,closeTabs:Te,pinTab:h,pinnedTabIds:g,unpinTab:b,children:(0,Z.jsxs)(KI,{tabId:e,activateFromKeyboard:()=>o(e),"aria-current":d?`page`:void 0,"aria-keyshortcuts":a,"data-active-tab":d?`true`:void 0,className:Y(MI,d?NI:PI),onAuxClick:t=>{t.button===1&&(t.preventDefault(),!f&&l(e))},onClick:t=>{t.target===t.currentTarget&&o(e)},children:[(0,Z.jsxs)(`button`,{type:`button`,"aria-label":c,title:c,className:FI,onClick:()=>{o(e)},tabIndex:-1,children:[s&&(0,Z.jsx)(`span`,{className:Y(`min-w-0 flex-1 truncate`,d&&`text-muted-foreground`),children:s}),(0,Z.jsxs)(`span`,{className:Y(`flex min-w-0 items-center`,s?`max-w-[70%] shrink-0`:`flex-1`),children:[(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:t}),(0,Z.jsx)(`span`,{className:`shrink-0`,children:`/`})]})]}),(0,Z.jsx)(JI,{accessibleLabel:c,closeTab:l,forceCloseVisible:je,isActive:d,isPinned:f,shortcutHint:n,tabId:e,unpinTab:b})]})},e)}if(u.kind===`asset`||u.kind===`skill-file`){let{baseName:t,label:r,prefix:s}=i(u.kind===`asset`?u.assetPath:u.path,``),c=`${s}${r}`;return(0,Z.jsx)(qI,{tabId:e,openTabs:x,closeTab:l,closeTabs:Te,pinTab:h,pinnedTabIds:g,unpinTab:b,children:(0,Z.jsxs)(KI,{tabId:e,activateFromKeyboard:()=>o(e),"aria-current":d?`page`:void 0,"aria-keyshortcuts":a,"data-active-tab":d?`true`:void 0,className:Y(MI,d?NI:PI),onAuxClick:t=>{t.button===1&&(t.preventDefault(),!f&&l(e))},onClick:t=>{t.target===t.currentTarget&&o(e)},children:[(0,Z.jsxs)(`button`,{type:`button`,"aria-label":c,className:FI,onClick:()=>{o(e)},tabIndex:-1,children:[s?(0,Z.jsx)(`span`,{className:Y(`min-w-0 flex-1 truncate text-muted-foreground/60`,d&&`text-muted-foreground`),children:s}):null,(0,Z.jsx)(`span`,{className:Y(`min-w-0 truncate`,s?`max-w-[70%] shrink-0`:`flex-1`),children:t})]}),(0,Z.jsx)(JI,{accessibleLabel:c,closeTab:l,forceCloseVisible:je,isActive:d,isPinned:f,shortcutHint:n,tabId:e,unpinTab:b})]})},e)}let p=u.docName,m=C.get(p)?.docExt??`.md`,{baseName:_,extension:v,label:y,prefix:w}=i(p,m),T=`${w}${y}`,E=m===`.md`||m===`.mdx`,O=D?.tabId===e,P=`editor-tab-rename-error-${II(p)}`;return(0,Z.jsx)(qI,{disabled:O,tabId:e,openTabs:x,closeTab:l,closeTabs:Te,pinTab:h,pinnedTabIds:g,unpinTab:b,children:(0,Z.jsx)(KI,{tabId:e,activateFromKeyboard:()=>o(e),disabled:O,"aria-current":d?`page`:void 0,"aria-keyshortcuts":a,"data-active-tab":d?`true`:void 0,className:Y(MI,d?NI:PI,O&&j&&`border-destructive`),onAuxClick:t=>{t.button===1&&(t.preventDefault(),!f&&l(e))},onClick:t=>{t.target===t.currentTarget&&o(e)},children:O?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Nc,{className:`h-full min-w-0 flex-1 rounded-none border-0 bg-transparent dark:bg-transparent`,children:[(0,Z.jsx)(Ec,{ref:z,value:k,disabled:N,"aria-label":S({id:`Dw1T_W`,values:{label:y}}),"data-testid":`editor-tab-rename-input`,"aria-invalid":j?!0:void 0,"aria-describedby":j?P:void 0,"aria-busy":N||void 0,title:j??p,className:`h-full min-w-0 px-2 py-0 font-medium text-foreground text-xs selection:bg-primary selection:text-primary-foreground`,onChange:e=>{A(RI(e.target.value,m)),M(null),H.current=null},onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),_e()):e.key===`Escape`&&(e.preventDefault(),ge())},onBlur:_e}),(0,Z.jsx)(Mc,{align:`inline-end`,"aria-hidden":`true`,className:`pr-2 text-xs`,children:(0,Z.jsx)(Gc,{className:`text-muted-foreground/60 text-xs`,children:m})})]}),j?(0,Z.jsx)(`span`,{id:P,role:`alert`,className:`sr-only`,children:j}):null]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(XI,{accessibleLabel:T,activateTab:o,baseName:_,docName:p,enterRenameMode:he,extension:v,hideDocExtension:E,tabId:e}),(0,Z.jsx)(JI,{accessibleLabel:T,closeTab:l,forceCloseVisible:je,isActive:d,isPinned:f,shortcutHint:n,tabId:e,unpinTab:b})]})})},e)}),Qe;e[60]!==Ke||e[61]!==qe||e[62]!==Xe||e[63]!==Ze?(Qe=(0,Z.jsx)(Ke,{items:qe,strategy:Xe,children:Ze}),e[60]=Ke,e[61]=qe,e[62]=Xe,e[63]=Ze,e[64]=Qe):Qe=e[64];let $e;e[65]!==Ue||e[66]!==Ie||e[67]!==Re||e[68]!==Pe||e[69]!==Ae||e[70]!==!1||e[71]!==We||e[72]!==Ge||e[73]!==Qe||e[74]!==Ce?($e=(0,Z.jsx)(Ue,{sensors:Ae,autoScroll:!1,collisionDetection:We,modifiers:Ce,onDragStart:Pe,onDragEnd:Re,onDragCancel:Ie,accessibility:Ge,children:Qe}),e[65]=Ue,e[66]=Ie,e[67]=Re,e[68]=Pe,e[69]=Ae,e[70]=!1,e[71]=We,e[72]=Ge,e[73]=Qe,e[74]=Ce,e[75]=$e):$e=e[75];let et;e[76]===S?et=e[77]:(et=S({id:`3YvS-c`}),e[76]=S,e[77]=et);let tt;e[78]===Symbol.for(`react.memo_cache_sentinel`)?(tt=(0,Z.jsx)(Wt,{"aria-hidden":`true`}),e[78]=tt):tt=e[78];let nt;e[79]!==p||e[80]!==et?(nt=(0,Z.jsx)(on,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,size:`icon-xs`,variant:`ghost`,"aria-label":et,"data-testid":`editor-new-tab-button`,className:`first:mb-3 mb-1.5`,onClick:p,children:tt})}),e[79]=p,e[80]=et,e[81]=nt):nt=e[81];let rt;e[82]===Symbol.for(`react.memo_cache_sentinel`)?(rt=(0,Z.jsx)(sn,{children:(0,Z.jsx)(J,{id:`3YvS-c`})}),e[82]=rt):rt=e[82];let it;e[83]===nt?it=e[84]:(it=(0,Z.jsxs)(ln,{children:[nt,rt]}),e[83]=nt,e[84]=it);let at;e[85]!==He||e[86]!==$e||e[87]!==it?(at=(0,Z.jsxs)(`div`,{className:He,children:[$e,it]}),e[85]=He,e[86]=$e,e[87]=it,e[88]=at):at=e[88];let ot;return e[89]!==ze||e[90]!==Be||e[91]!==Ve||e[92]!==at?(ot=(0,Z.jsx)(`div`,{ref:w,"data-electron-drag":ze,className:Be,onWheel:Ve,children:at}),e[89]=ze,e[90]=Be,e[91]=Ve,e[92]=at,e[93]=ot):ot=e[93],ot}var QI=(e,t,n)=>{if(e&&`reportValidity`in e){let r=vp(n,t);e.setCustomValidity(r&&r.message||``),e.reportValidity()}},$I=(e,t)=>{for(let n in t.fields){let r=t.fields[n];r&&r.ref&&`reportValidity`in r.ref?QI(r.ref,n,e):r&&r.refs&&r.refs.forEach(t=>QI(t,n,e))}},eL=(e,t)=>{t.shouldUseNativeValidation&&$I(e,t);let n={};for(let r in e){let i=vp(t.fields,r),a=Object.assign(e[r]||{},{ref:i&&i.ref});if(tL(t.names||Object.keys(e),r)){let e=Object.assign({},vp(n,r));lp(e,`root`,a),lp(n,r,e)}else lp(n,r,a)}return n},tL=(e,t)=>{let n=nL(t).replace(/[.*+?^${}()|\\]/g,`\\$&`);return e.some(e=>nL(e).match(`^${n}\\.\\d+`))};function nL(e){return e.replace(/[\[\]]/g,``)}function rL(){return rL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rL.apply(null,arguments)}function iL(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function aL(e,t){for(var n={};e.length;){var r=e[0],i=r.code,a=r.message,o=r.path.join(`.`);if(!n[o])if(`unionErrors`in r){var s=r.unionErrors[0].errors[0];n[o]={message:s.message,type:s.code}}else n[o]={message:a,type:i};if(`unionErrors`in r&&r.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var c=n[o].types,l=c&&c[r.code];n[o]=fp(o,t,n,i,l?[].concat(l,r.message):r.message)}e.shift()}return n}function oL(e,t){for(var n={},r=function(){var r=e[0],i=r.code,a=r.message,o=r.path.join(`.`);if(!n[o])if(r.code===`invalid_union`&&r.errors.length>0){var s=r.errors[0][0];n[o]={message:s.message,type:s.code}}else n[o]={message:a,type:i};if(r.code===`invalid_union`&&r.errors.forEach(function(t){return t.forEach(function(t){return e.push(rL({},t,{path:[].concat(r.path,t.path)}))})}),t){var c=n[o].types,l=c&&c[r.code];n[o]=fp(o,t,n,i,l?[].concat(l,r.message):r.message)}e.shift()};e.length;)r();return n}function sL(e,t,n){if(n===void 0&&(n={}),function(e){return`_def`in e&&typeof e._def==`object`&&`typeName`in e._def}(e))return function(r,i,a){try{return Promise.resolve(iL(function(){return Promise.resolve(e[n.mode===`sync`?`parse`:`parseAsync`](r,t)).then(function(e){return a.shouldUseNativeValidation&&$I({},a),{errors:{},values:n.raw?Object.assign({},r):e}})},function(e){if(function(e){return Array.isArray(e?.issues)}(e))return{values:{},errors:eL(aL(e.errors,!a.shouldUseNativeValidation&&a.criteriaMode===`all`),a)};throw e}))}catch(e){return Promise.reject(e)}};if(function(e){return`_zod`in e&&typeof e._zod==`object`}(e))return function(r,i,a){try{return Promise.resolve(iL(function(){return Promise.resolve((n.mode===`sync`?za:Xa)(e,r,t)).then(function(e){return a.shouldUseNativeValidation&&$I({},a),{errors:{},values:n.raw?Object.assign({},r):e}})},function(e){if(function(e){return e instanceof xa}(e))return{values:{},errors:eL(oL(e.issues,!a.shouldUseNativeValidation&&a.criteriaMode===`all`),a)};throw e}))}catch(e){return Promise.reject(e)}};throw Error(`Invalid input: not a Zod schema`)}var cL=`https://openknowledge.ai/api/subscribe`;async function lL(e,t){try{let n=await fetch(cL,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({email:e,source:t}),signal:AbortSignal.timeout(15e3)});return n.ok?{ok:!0}:n.status===400?{ok:!1,reason:`invalid`}:n.status===503?{ok:!1,reason:`unavailable`}:(console.warn(`[subscribe] action=submit result=http-error status=${n.status}`),{ok:!1,reason:`error`})}catch(e){return console.warn(`[subscribe] action=submit result=network-error message=${e instanceof Error?e.message:String(e)}`),{ok:!1,reason:`error`}}}function uL(e){let t=(0,$.c)(49),{source:n,title:r,description:i,onSuccess:a,onDismiss:o,autoFocus:s,compactSubmit:c,className:l}=e,{_:u}=gt(),[d,f]=(0,Q.useState)(!1),p=(0,Q.useRef)(null),m,h;t[0]===d?(m=t[1],h=t[2]):(m=()=>{d&&p.current?.focus()},h=[d],t[0]=d,t[1]=m,t[2]=h),(0,Q.useEffect)(m,h);let g,_;if(t[3]!==u){let e=Ma({email:La({message:u({id:`Wq6Wcm`})})});_=up,g=sL(e),t[3]=u,t[4]=g,t[5]=_}else g=t[4],_=t[5];let v;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(v={email:``},t[6]=v):v=t[6];let y;t[7]===g?y=t[8]:(y={resolver:g,defaultValues:v},t[7]=g,t[8]=y);let b=_(y),{isSubmitting:x}=b.formState,S=b.formState.errors.email?.message??b.formState.errors.root?.message,C;t[9]!==u||t[10]!==b||t[11]!==a||t[12]!==n?(C=async function(e){b.clearErrors(`root`);let t=await lL(e.email,n);if(t.ok){f(!0),a?.();return}if(t.reason===`invalid`){b.setError(`email`,{message:u({id:`Wq6Wcm`})});return}if(t.reason===`unavailable`){b.setError(`root`,{message:u({id:`4mLBx9`})});return}b.setError(`root`,{message:u({id:`fWsBTs`})})},t[9]=u,t[10]=b,t[11]=a,t[12]=n,t[13]=C):C=t[13];let w=C,T;t[14]===l?T=t[15]:(T=Y(`flex flex-col gap-3`,l),t[14]=l,t[15]=T);let E=d?-1:void 0,D;t[16]!==d||t[17]!==r?(D=d?(0,Z.jsxs)(`span`,{className:`mb-1.5 inline-flex flex-row items-center gap-2`,children:[(0,Z.jsx)(zo,{className:`size-4 text-primary`}),(0,Z.jsx)(J,{id:`PIMM5l`})]}):r??(0,Z.jsx)(J,{id:`GzPQ2f`}),t[16]=d,t[17]=r,t[18]=D):D=t[18];let O;t[19]!==D||t[20]!==E?(O=(0,Z.jsx)(`p`,{ref:p,tabIndex:E,className:`text-sm font-medium leading-tight text-foreground focus:outline-none`,children:D}),t[19]=D,t[20]=E,t[21]=O):O=t[21];let k;t[22]!==i||t[23]!==d?(k=d?(0,Z.jsx)(J,{id:`pBROkv`}):i??(0,Z.jsx)(J,{id:`WmPbvm`}),t[22]=i,t[23]=d,t[24]=k):k=t[24];let A;t[25]===k?A=t[26]:(A=(0,Z.jsx)(`p`,{className:`text-1sm text-muted-foreground`,role:`status`,children:k}),t[25]=k,t[26]=A);let j;t[27]!==O||t[28]!==A?(j=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[O,A]}),t[27]=O,t[28]=A,t[29]=j):j=t[29];let M;t[30]!==u||t[31]!==o?(M=o?(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon`,onClick:o,"aria-label":u({id:`yz7wBu`}),className:`-mr-1.5 -mt-1 size-7 shrink-0 text-muted-foreground opacity-60`,children:(0,Z.jsx)(hl,{className:`size-4`})}):null,t[30]=u,t[31]=o,t[32]=M):M=t[32];let N;t[33]!==j||t[34]!==M?(N=(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[j,M]}),t[33]=j,t[34]=M,t[35]=N):N=t[35];let P;t[36]!==u||t[37]!==s||t[38]!==c||t[39]!==S||t[40]!==b||t[41]!==x||t[42]!==w||t[43]!==d?(P=d?null:(0,Z.jsxs)(`form`,{onSubmit:b.handleSubmit(w),className:`flex flex-col gap-2`,noValidate:!0,children:[(0,Z.jsx)(cp,{control:b.control,name:`email`,render:e=>{let{field:t,fieldState:n}=e;return(0,Z.jsxs)(Nc,{className:`h-10 rounded-xl`,children:[(0,Z.jsx)(Mc,{className:`pl-2.5`,children:(0,Z.jsx)($h,{className:`size-4 text-muted-foreground opacity-60`})}),(0,Z.jsx)(Ec,{...t,id:t.name,type:`email`,inputMode:`email`,autoComplete:`email`,spellCheck:!1,autoFocus:s,placeholder:u({id:`2hYmUH`}),"aria-invalid":n.invalid,"aria-label":u({id:`ATGYL1`}),"data-testid":`subscribe-email`,className:`placeholder:text-muted-foreground/60`}),(0,Z.jsx)(X,{type:`submit`,disabled:x,size:c?`icon`:`default`,className:Y(`mr-1 ml-auto text-1sm`,c&&`size-8 shrink-0 rounded-lg`),"data-testid":`subscribe-submit`,children:x?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Xc,{className:`size-3.5 animate-spin`,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(J,{id:`lCC_D5`})})]}):c?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Jn,{className:`size-4`,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(J,{id:`EDl9kS`})})]}):(0,Z.jsx)(J,{id:`EDl9kS`})})]})}}),S?(0,Z.jsx)(`p`,{className:`text-sm text-destructive`,role:`alert`,children:S}):null]}),t[36]=u,t[37]=s,t[38]=c,t[39]=S,t[40]=b,t[41]=x,t[42]=w,t[43]=d,t[44]=P):P=t[44];let F;return t[45]!==N||t[46]!==P||t[47]!==T?(F=(0,Z.jsxs)(`div`,{className:T,children:[N,P]}),t[45]=N,t[46]=P,t[47]=T,t[48]=F):F=t[48],F}var dL=`ok-feedback-nudge-v1`,fL={firstSeenAt:null,shownAt:null,dismissed:!1};function pL(e){let t=0;for(let n of e)Gl(n)||t++;return t}function mL(e,t,n){return!e.dismissed&&e.shownAt==null&&e.firstSeenAt!=null&&t-e.firstSeenAt>=12096e5&&n>=10}function hL(e){return e===!0}function gL(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:null}function _L(e){if(typeof e!=`object`||!e)return fL;let t=e;return{firstSeenAt:gL(t.firstSeenAt),shownAt:gL(t.shownAt),dismissed:hL(t.dismissed)}}function vL(e){try{let t=(e??localStorage).getItem(dL);return t==null?fL:_L(JSON.parse(t))}catch(e){return console.warn(`[feedback-nudge-store] readPersistedState failed (corrupt/privacy/SSR)`,e),fL}}function yL(e,t){try{(t??localStorage).setItem(dL,JSON.stringify(e))}catch(e){console.warn(`[feedback-nudge-store] writePersistedState failed (quota/privacy/SSR)`,e)}}function bL(e){let t=vL(e),n=new Set,r=!1;function i(){for(let e of n)e()}function a(n){t=n,yL(t,e),i()}function o(){t=vL(e),i()}return{getSnapshot(){return t},subscribe(e){return n.add(e),()=>{n.delete(e)}},recordFirstSeen(e){t.firstSeenAt??a({...t,firstSeenAt:e})},recordShown(e){t.shownAt??a({...t,shownAt:e})},dismiss(){t.dismissed||a({...t,dismissed:!0})},syncFromStorage:o,install(){r||(r=!0,o())}}}var xL=bL();typeof window<`u`&&typeof window.addEventListener==`function`&&window.addEventListener(`storage`,e=>{(e.key===`ok-feedback-nudge-v1`||e.key===null)&&xL.syncFromStorage()});function SL(){xL.install()}var CL=`https://github.com/inkeep/open-knowledge`,wL=`https://discord.gg/VRKk2EaGHN`,TL=`https://x.com/OpenKnowledge`,EL=`ok-subscribe-card-v1`,DL={subscribed:!1,dismissed:!1,shownVersions:[]};function OL(e,t){return!e.subscribed&&!e.dismissed&&e.shownVersions.length<3&&!e.shownVersions.includes(t)}function kL(e){return e===!0}function AL(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function jL(e){if(typeof e!=`object`||!e)return DL;let t=e;return{subscribed:kL(t.subscribed),dismissed:kL(t.dismissed),shownVersions:AL(t.shownVersions)}}function ML(e){try{let t=(e??localStorage).getItem(EL);return t==null?DL:jL(JSON.parse(t))}catch(e){return console.warn(`[subscribe-card-store] readPersistedState failed (corrupt/privacy/SSR)`,e),DL}}function NL(e,t){try{(t??localStorage).setItem(EL,JSON.stringify(e))}catch(e){console.warn(`[subscribe-card-store] writePersistedState failed (quota/privacy/SSR)`,e)}}function PL(e){let t=ML(e),n=new Set,r=!1;function i(){for(let e of n)e()}function a(n){t=n,NL(t,e),i()}return{getSnapshot(){return t},subscribe(e){return n.add(e),()=>{n.delete(e)}},markSubscribed(){t.subscribed||a({...t,subscribed:!0})},dismiss(){t.dismissed||a({...t,dismissed:!0})},recordShown(e){t.shownVersions.includes(e)||a({...t,shownVersions:[...t.shownVersions,e]})},install(){r||(r=!0,t=ML(e),i())}}}var FL=PL();function IL(){FL.install()}function LL(e){let t=(0,$.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`Discord`}),r=(0,Z.jsx)(`path`,{d:`M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9554 2.4189-2.1568 2.4189Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,Z.jsxs)(`svg`,{role:`img`,fill:`currentColor`,height:24,width:24,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}function RL(e){let t=(0,$.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`X (Twitter)`}),r=(0,Z.jsx)(`path`,{d:`M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,Z.jsxs)(`svg`,{role:`img`,fill:`currentColor`,height:24,width:24,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}var zL=[{key:`resources`,heading:{id:`s-MGs7`},links:[{label:{id:`TbjyhA`},href:`https://openknowledge.ai/docs`,icon:Le}]},{key:`community`,heading:{id:`chL5IG`},links:[{label:`Discord`,href:wL,icon:LL},{label:`X (Twitter)`,href:TL,icon:RL},{label:`GitHub`,href:CL,icon:r_}]}],BL=`${CL}/releases`,VL=`group flex items-center gap-2.5 rounded-md px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-azure-900/5 dark:hover:bg-white/20 hover:text-primary`;function HL(e){if(e<1e3)return String(e);let t=e/1e3;return`${t>=10?Math.round(t):t.toFixed(1)}k`}var UL=e=>{let t=(0,$.c)(12),{count:n}=e,{_:r}=gt(),i,a,o,s;t[0]!==r||t[1]!==n?(i=HL(n),a=`img`,o=`ml-auto flex items-center gap-1 text-xs tabular-nums text-muted-foreground`,s=r({id:`SVLPt5`,values:{formatted:i}}),t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=s):(i=t[2],a=t[3],o=t[4],s=t[5]);let c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(bg,{className:`size-3 fill-current`,"aria-hidden":`true`}),t[6]=c):c=t[6];let l;return t[7]!==i||t[8]!==a||t[9]!==o||t[10]!==s?(l=(0,Z.jsxs)(`span`,{role:a,className:o,"aria-label":s,children:[c,i]}),t[7]=i,t[8]=a,t[9]=o,t[10]=s,t[11]=l):l=t[11],l},WL=e=>{let t=(0,$.c)(15),{link:n,trailing:r}=e,{_:i}=gt(),{label:a,href:o,icon:s}=n,c,l;t[0]===o?(c=t[1],l=t[2]):(c=e=>cd(e,o),l=e=>cd(e,o),t[0]=o,t[1]=c,t[2]=l);let u;t[3]===s?u=t[4]:(u=(0,Z.jsx)(s,{"aria-hidden":`true`,className:`size-4 shrink-0`}),t[3]=s,t[4]=u);let d;t[5]!==i||t[6]!==a?(d=typeof a==`string`?a:i(a),t[5]=i,t[6]=a,t[7]=d):d=t[7];let f;return t[8]!==o||t[9]!==c||t[10]!==l||t[11]!==u||t[12]!==d||t[13]!==r?(f=(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`a`,{href:o,target:`_blank`,rel:`noopener noreferrer`,onClick:c,onAuxClick:l,className:VL,children:[u,d,r]})}),t[8]=o,t[9]=c,t[10]=l,t[11]=u,t[12]=d,t[13]=r,t[14]=f):f=t[14],f},GL=e=>{let t=(0,$.c)(7),{icon:n,onSelect:r,children:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=Y(VL,`h-auto w-full justify-start font-normal`),t[0]=a):a=t[0];let o;t[1]===n?o=t[2]:(o=(0,Z.jsx)(n,{"aria-hidden":`true`,className:`size-4 shrink-0`}),t[1]=n,t[2]=o);let s;return t[3]!==i||t[4]!==r||t[5]!==o?(s=(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(X,{variant:`ghost`,className:a,onClick:r,children:[o,i]})}),t[3]=i,t[4]=r,t[5]=o,t[6]=s):s=t[6],s},KL=e=>{let t=(0,$.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(`p`,{className:`font-mono tracking-wide uppercase text-muted-foreground text-xs mb-1`,children:n}),t[0]=n,t[1]=r),r},qL=()=>{let e=(0,$.c)(36),{_:t}=gt(),[n,r]=(0,Q.useState)(!1),[i,a]=(0,Q.useState)(!1),[o,s]=(0,Q.useState)(!1),[c,l]=(0,Q.useState)(!1),[u,d]=(0,Q.useState)(null),f=typeof window<`u`&&window.okDesktop!=null,p,m;e[0]!==n||e[1]!==u?(p=()=>{if(!n||u!==null)return;let e=new AbortController;return Wa({signal:e.signal}).then(e=>{e!==null&&d(e)}),()=>e.abort()},m=[n,u],e[0]=n,e[1]=u,e[2]=p,e[3]=m):(p=e[2],m=e[3]),(0,Q.useEffect)(p,m);let h;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=e=>{r(e),e||a(!1)},e[4]=h):h=e[4];let g;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Z.jsx)(Se,{className:`size-4`}),e[5]=g):g=e[5];let _;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Z.jsx)(on,{asChild:!0,children:(0,Z.jsx)(Ht,{asChild:!0,children:(0,Z.jsxs)(X,{variant:`ghost`,size:`icon`,className:`size-7 hover:bg-accent text-muted-foreground`,children:[g,(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(J,{id:`s-MGs7`})})]})})}),e[6]=_):_=e[6];let v;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsxs)(ln,{children:[_,(0,Z.jsx)(sn,{children:(0,Z.jsx)(J,{id:`s-MGs7`})})]}),e[7]=v):v=e[7];let y;e[8]!==t||e[9]!==u?(y=zL.map((e,n)=>(0,Z.jsxs)(`div`,{className:Y(n>0&&`mt-3`),children:[(0,Z.jsx)(KL,{children:t(e.heading)}),(0,Z.jsx)(`nav`,{"aria-label":t(e.heading),children:(0,Z.jsxs)(`ul`,{className:`space-y-0.5`,children:[e.links.map(e=>(0,Z.jsx)(WL,{link:e,trailing:e.href===`https://github.com/inkeep/open-knowledge`&&u!==null?(0,Z.jsx)(UL,{count:u}):void 0},e.href)),e.key===`resources`&&(0,Z.jsxs)(Z.Fragment,{children:[f&&(0,Z.jsx)(GL,{icon:Ke,onSelect:()=>{r(!1),s(!0)},children:(0,Z.jsx)(J,{id:`cd5EXh`})}),(0,Z.jsx)(GL,{icon:tg,onSelect:()=>{r(!1),l(!0)},children:(0,Z.jsx)(J,{id:`RoafuO`})})]})]})})]},e.key)),e[8]=t,e[9]=u,e[10]=y):y=e[10];let b;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Z.jsx)(KL,{children:(0,Z.jsx)(J,{id:`arUUsK`})}),e[11]=b):b=e[11];let x;e[12]===t?x=e[13]:(x=t({id:`arUUsK`}),e[12]=t,e[13]=x);let S;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(WL,{link:{label:{id:`3ePd3I`},href:BL,icon:eg}}),e[14]=S):S=e[14];let C;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Z.jsx)(Ht,{asChild:!0,children:(0,Z.jsxs)(X,{variant:`ghost`,className:Y(VL,`h-auto w-full justify-start font-normal`),children:[(0,Z.jsx)($h,{"aria-hidden":`true`,className:`size-4 shrink-0`}),(0,Z.jsx)(J,{id:`EDl9kS`})]})}),e[15]=C):C=e[15];let w;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Z.jsx)(qt,{side:`left`,align:`center`,sideOffset:20,className:`w-80`,children:(0,Z.jsx)(uL,{source:`resources_menu`,autoFocus:!0,onDismiss:()=>a(!1),onSuccess:JL})}),e[16]=w):w=e[16];let T;e[17]===i?T=e[18]:(T=(0,Z.jsxs)(`ul`,{className:`space-y-0.5`,children:[S,(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(Vt,{open:i,onOpenChange:a,children:[C,w]})})]}),e[17]=i,e[18]=T);let E;e[19]!==T||e[20]!==x?(E=(0,Z.jsxs)(`div`,{className:`mt-3`,children:[b,(0,Z.jsx)(`nav`,{"aria-label":x,children:T})]}),e[19]=T,e[20]=x,e[21]=E):E=e[21];let D;e[22]!==E||e[23]!==y?(D=(0,Z.jsxs)(qt,{align:`end`,className:`w-56 p-3`,children:[y,E]}),e[22]=E,e[23]=y,e[24]=D):D=e[24];let O;e[25]!==n||e[26]!==D?(O=(0,Z.jsxs)(Vt,{open:n,onOpenChange:h,children:[v,D]}),e[25]=n,e[26]=D,e[27]=O):O=e[27];let k;e[28]===o?k=e[29]:(k=f&&(0,Z.jsx)(lm,{open:o,onOpenChange:s}),e[28]=o,e[29]=k);let A;e[30]===c?A=e[31]:(A=(0,Z.jsx)(J_,{open:c,onOpenChange:l,onSuccess:YL}),e[30]=c,e[31]=A);let j;return e[32]!==O||e[33]!==k||e[34]!==A?(j=(0,Z.jsxs)(Z.Fragment,{children:[O,k,A]}),e[32]=O,e[33]=k,e[34]=A,e[35]=j):j=e[35],j};function JL(){return FL.markSubscribed()}function YL(){return xL.dismiss()}function XL(e){let t=(0,$.c)(14),{className:n}=e,{_:r}=gt(),i=typeof window<`u`?window.okDesktop?.instanceLabel??null:null;if(!i)return null;let a;t[0]===r?a=t[1]:(a=r({id:`iRdfLr`,values:{label:i}}),t[0]=r,t[1]=a);let o,s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(po,{"aria-hidden":`true`}),s=(0,Z.jsx)(`span`,{className:`max-w-40 truncate`,children:i}),t[2]=o,t[3]=s):(o=t[2],s=t[3]);let c;t[4]!==n||t[5]!==a?(c=(0,Z.jsx)(on,{asChild:!0,children:(0,Z.jsxs)(Eu,{variant:`secondary`,"aria-label":a,"data-testid":`instance-badge`,className:n,children:[o,s]})}),t[4]=n,t[5]=a,t[6]=c):c=t[6];let l;t[7]===r?l=t[8]:(l=r({id:`c5PTFE`,values:{label:i}}),t[7]=r,t[8]=l);let u;t[9]===l?u=t[10]:(u=(0,Z.jsx)(sn,{children:l}),t[9]=l,t[10]=u);let d;return t[11]!==c||t[12]!==u?(d=(0,Z.jsxs)(ln,{children:[c,u]}),t[11]=c,t[12]=u,t[13]=d):d=t[13],d}var ZL=1,QL=2,$L=ZL|QL;function eR(){if(!(typeof window>`u`))return window.navigation}function tR(){let e=eR();return e?(e.canGoBack?ZL:0)|(e.canGoForward?QL:0):$L}function nR(e){let t=eR();return t?(t.addEventListener(`currententrychange`,e),()=>t.removeEventListener(`currententrychange`,e)):()=>{}}function rR(){let e=(0,$.c)(42),{_:t}=gt(),n=(0,Q.useSyncExternalStore)(nR,tR,oR),r=(n&ZL)!==0,i=(n&QL)!==0,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=Pl(`navigate-back`),e[0]=a):a=e[0];let o=a,s;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=jl(`navigate-back`),e[1]=s):s=e[1];let c=s,l;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=Pl(`navigate-forward`),e[2]=l):l=e[2];let u=l,d;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=jl(`navigate-forward`),e[3]=d):d=e[3];let f=d,m;e[4]===t?m=e[5]:(m=t({id:`kBNHN1`}),e[4]=t,e[5]=m);let h;e[6]===t?h=e[7]:(h=t({id:`iH8pgl`}),e[6]=t,e[7]=h);let g=!r,_;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Z.jsx)(In,{"aria-hidden":`true`}),e[8]=_):_=e[8];let v;e[9]!==h||e[10]!==g?(v=(0,Z.jsx)(on,{asChild:!0,children:(0,Z.jsx)(X,{"aria-label":h,disabled:g,onClick:aR,size:`icon-sm`,variant:`ghost`,children:_})}),e[9]=h,e[10]=g,e[11]=v):v=e[11];let y;e[12]===t?y=e[13]:(y=t({id:`iH8pgl`}),e[12]=t,e[13]=y);let b;e[14]===y?b=e[15]:(b=(0,Z.jsx)(`span`,{children:y}),e[14]=y,e[15]=b);let x;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Z.jsx)(p,{"aria-label":c,children:o}),e[16]=x):x=e[16];let S;e[17]===b?S=e[18]:(S=(0,Z.jsxs)(sn,{children:[b,` `,x]}),e[17]=b,e[18]=S);let C;e[19]!==S||e[20]!==v?(C=(0,Z.jsxs)(ln,{children:[v,S]}),e[19]=S,e[20]=v,e[21]=C):C=e[21];let w;e[22]===t?w=e[23]:(w=t({id:`rxWGWX`}),e[22]=t,e[23]=w);let T=!i,E;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Z.jsx)(Jn,{"aria-hidden":`true`}),e[24]=E):E=e[24];let D;e[25]!==w||e[26]!==T?(D=(0,Z.jsx)(on,{asChild:!0,children:(0,Z.jsx)(X,{"aria-label":w,disabled:T,onClick:iR,size:`icon-sm`,variant:`ghost`,children:E})}),e[25]=w,e[26]=T,e[27]=D):D=e[27];let O;e[28]===t?O=e[29]:(O=t({id:`rxWGWX`}),e[28]=t,e[29]=O);let k;e[30]===O?k=e[31]:(k=(0,Z.jsx)(`span`,{children:O}),e[30]=O,e[31]=k);let A;e[32]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Z.jsx)(p,{"aria-label":f,children:u}),e[32]=A):A=e[32];let j;e[33]===k?j=e[34]:(j=(0,Z.jsxs)(sn,{children:[k,` `,A]}),e[33]=k,e[34]=j);let M;e[35]!==D||e[36]!==j?(M=(0,Z.jsxs)(ln,{children:[D,j]}),e[35]=D,e[36]=j,e[37]=M):M=e[37];let N;return e[38]!==C||e[39]!==M||e[40]!==m?(N=(0,Z.jsxs)(df,{"aria-label":m,className:`shrink-0 [-webkit-app-region:no-drag]`,"data-testid":`navigation-history-controls`,children:[C,M]}),e[38]=C,e[39]=M,e[40]=m,e[41]=N):N=e[41],N}function iR(){return Kt(`navigate-forward`)}function aR(){return Kt(`navigate-back`)}function oR(){return $L}var sR=50,cR=()=>{let e=(0,$.c)(8),t=(0,Q.useRef)(null),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=()=>{t.current===null&&(t.current=setTimeout(()=>{t.current=null,gT.preload()},sR))},e[0]=n):n=e[0];let r=n,i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{t.current!==null&&(clearTimeout(t.current),t.current=null)},e[1]=i):i=e[1];let a=i,o,s;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>()=>{t.current!==null&&clearTimeout(t.current)},s=[],e[2]=o,e[3]=s):(o=e[2],s=e[3]),(0,Q.useEffect)(o,s);let c,l;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{a(),window.location.hash!==`#settings`&&(window.location.hash=Nl)},l=(0,Z.jsx)(pg,{className:`size-4`}),e[4]=c,e[5]=l):(c=e[4],l=e[5]);let u;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(on,{asChild:!0,children:(0,Z.jsxs)(X,{variant:`ghost`,size:`icon`,className:`size-7 hover:bg-accent text-muted-foreground`,"data-testid":`header-settings-button`,onMouseEnter:r,onMouseLeave:a,onFocus:r,onBlur:a,onClick:c,children:[l,(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(J,{id:`Tz0i8g`})})]})}),e[6]=u):u=e[6];let d;return e[7]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsxs)(ln,{children:[u,(0,Z.jsx)(sn,{children:(0,Z.jsx)(J,{id:`Tz0i8g`})})]}),e[7]=d):d=e[7],d},lR=`https://openknowledge.ai/docs/features/share`,uR={mac:`⌘ C`,windowsLinux:`Ctrl C`};function dR(e){let t=(0,$.c)(52),{input:n,onClickWhenNoRemote:r}=e,{_:i}=gt(),{status:a}=go(),[o,s]=(0,Q.useState)(!1),[c,l]=(0,Q.useState)(null),u=(0,Q.useRef)(null),d;t[0]===c?.autoCopyFailed?d=t[1]:(d=()=>{!c?.autoCopyFailed||!u.current||(u.current.focus(),u.current.select())},t[0]=c?.autoCopyFailed,t[1]=d);let f;t[2]===c?f=t[3]:(f=[c],t[2]=c,t[3]=f),(0,Q.useEffect)(d,f);let m=a?.hasRemote===!0,h=n===null,g=pc(c?.freshness,a),_;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(_=wl(uR),t[4]=_):_=t[4];let v=_,y;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(y=Tl(uR),t[5]=y):y=t[5];let b=y,x;t[6]!==i||t[7]!==o||t[8]!==m||t[9]!==n||t[10]!==r?(x=async function(){if(!o&&n!==null){s(!0),l(null);try{let e=await vs({...n,hasRemote:m,onClickWhenNoRemote:r},{clipboardWrite:uf,toastSuccess:yR,toastError:vR,logEvent:_R});e.kind===`copied`?l({url:e.shareUrl,autoCopyFailed:!1,freshness:e.freshness}):e.kind===`clipboard-failed`&&l({url:e.shareUrl,autoCopyFailed:!0,freshness:e.freshness})}catch{gl.error(i({id:`u3YnKw`}))}s(!1)}},t[6]=i,t[7]=o,t[8]=m,t[9]=n,t[10]=r,t[11]=x):x=t[11];let S=x,C=c!==null,w;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(w=e=>{e||l(null)},t[12]=w):w=t[12];let T;t[13]!==i||t[14]!==n?.kind?(T=n?.kind===`folder`?i({id:`WR0y2O`}):i({id:`F4IYWe`}),t[13]=i,t[14]=n?.kind,t[15]=T):T=t[15];let E=o||h,D,O;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Z.jsx)(mg,{className:`size-3.5`,"aria-hidden":!0}),O=(0,Z.jsx)(J,{id:`Z8lGw6`}),t[16]=D,t[17]=O):(D=t[16],O=t[17]);let k;t[18]!==S||t[19]!==T||t[20]!==E?(k=(0,Z.jsx)(Gt,{asChild:!0,children:(0,Z.jsxs)(X,{variant:`ghost`,size:`sm`,"aria-label":T,onClick:S,disabled:E,className:`gap-1.5 text-muted-foreground px-1.5`,"data-testid":`share-button`,children:[D,O]})}),t[18]=S,t[19]=T,t[20]=E,t[21]=k):k=t[21];let A=g?`w-96`:`w-80`,j;t[22]===A?j=t[23]:(j=Y(`flex flex-col gap-2`,A),t[22]=A,t[23]=j);let M;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Z.jsx)(`p`,{className:`font-mono tracking-wide uppercase text-muted-foreground text-xs`,children:(0,Z.jsx)(J,{id:`Z8lGw6`})}),t[24]=M):M=t[24];let N;t[25]===c?.autoCopyFailed?N=t[26]:(N=c?.autoCopyFailed?(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,Z.jsx)(J,{id:`vj-33a`,values:{copyShortcut:v},components:{0:(0,Z.jsx)(p,{"aria-label":b})}})}):null,t[25]=c?.autoCopyFailed,t[26]=N);let P=c?.url??``,F;t[27]===i?F=t[28]:(F=i({id:`5-FeN2`}),t[27]=i,t[28]=F);let I;t[29]!==P||t[30]!==F?(I=(0,Z.jsx)(Sl,{ref:u,readOnly:!0,value:P,onFocus:gR,onClick:hR,onContextMenu:mR,className:`select-all bg-muted font-mono text-xs text-muted-foreground`,"data-testid":`share-button-url`,"aria-label":F}),t[29]=P,t[30]=F,t[31]=I):I=t[31];let L=c?.url??``,R=c?.autoCopyFailed===!1,z;t[32]!==L||t[33]!==R?(z=(0,Z.jsx)(`div`,{className:`absolute inset-y-0 right-1 flex items-center`,children:(0,Z.jsx)(`div`,{className:`rounded-md bg-background/50 backdrop-blur-sm`,children:(0,Z.jsx)(Uo,{copyContent:L,clipboardWrite:uf,initialCopied:R})})}),t[32]=L,t[33]=R,t[34]=z):z=t[34];let B;t[35]!==I||t[36]!==z?(B=(0,Z.jsxs)(`div`,{className:`relative`,children:[I,z]}),t[35]=I,t[36]=z,t[37]=B):B=t[37];let V=c?.freshness,H=n?.kind??`doc`,U;t[38]!==a||t[39]!==V||t[40]!==H?(U=(0,Z.jsx)(dc,{freshness:V,status:a,kind:H}),t[38]=a,t[39]=V,t[40]=H,t[41]=U):U=t[41];let W;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Z.jsxs)(`a`,{href:lR,target:`_blank`,rel:`noopener noreferrer`,onClick:pR,onAuxClick:fR,className:`mt-2 flex items-center gap-1.5 self-start text-xs text-muted-foreground transition-colors hover:text-primary`,children:[(0,Z.jsx)(Se,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,Z.jsx)(J,{id:`aByJ8j`})]}),t[42]=W):W=t[42];let G;t[43]!==j||t[44]!==N||t[45]!==B||t[46]!==U?(G=(0,Z.jsxs)(qt,{align:`end`,className:j,"data-testid":`share-button-popover`,children:[M,N,B,U,W]}),t[43]=j,t[44]=N,t[45]=B,t[46]=U,t[47]=G):G=t[47];let K;return t[48]!==k||t[49]!==G||t[50]!==C?(K=(0,Z.jsxs)(Vt,{open:C,onOpenChange:w,children:[k,G]}),t[48]=k,t[49]=G,t[50]=C,t[51]=K):K=t[51],K}function fR(e){return cd(e,lR)}function pR(e){return cd(e,lR)}function mR(e){return e.currentTarget.select()}function hR(e){return e.currentTarget.select()}function gR(e){return e.currentTarget.select()}function _R(e){return console.log(e)}function vR(e){e!==`Link ready but could not copy to clipboard.`&&gl.error(e)}function yR(e){return gl.success(e)}var bR=(0,Q.lazy)(()=>n(()=>import(`./AppMenubar-BU0HYo5c.js`).then(e=>({default:e.AppMenubar})),__vite__mapDeps([162,1,10,11,12,14,15,16,17,49,113,30,31,19,24,25,50,20,92,22]),import.meta.url));function xR(e){let t=(0,$.c)(40),{onSignIn:n,onSetIdentity:r,onOpenSearch:i}=e,{_:a}=gt(),{activeDocName:o,activeTarget:s}=Ye(),c=o?fo(o):null,{state:l,isDraggingRail:u}=uP(),d=Jv(),f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=Pl(`toggle-files-sidebar`),t[0]=f):f=t[0];let m=f,h;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(h=jl(`toggle-files-sidebar`),t[1]=h):h=t[1];let g=h,_;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(_=Pl(`command-palette`),t[2]=_):_=t[2];let v=_,y=jl(`command-palette`),[b,x]=(0,Q.useState)(!1),S;bb0:{if(s?.kind===`folder`){let e;t[3]===s.folderPath?e=t[4]:(e=js(s.folderPath),t[3]=s.folderPath,t[4]=e),S=e;break bb0}if(o&&!c){let e;t[5]===o?e=t[6]:(e=Ks(o),t[5]=o,t[6]=e),S=e;break bb0}if(!s&&!o){let e;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=js(``),t[7]=e):e=t[7],S=e;break bb0}S=null}let C=S,w=typeof window<`u`&&window.okDesktop!=null,T=l===`collapsed`,E=w?``:void 0,D=w&&T&&`pl-[var(--ok-titlebar-reserve-left,1rem)]`,O=w&&!u&&`motion-safe:transition-[padding] motion-safe:duration-200 motion-safe:ease-linear`,k;t[8]!==D||t[9]!==O?(k=Y(`flex h-12 shrink-0 items-center bg-muted/35 shadow-[inset_0_-1px_0_var(--border)]`,w&&`[-webkit-app-region:drag]`,D,O),t[8]=D,t[9]=O,t[10]=k):k=t[10];let A;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(A=PF()&&(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(bR,{})}),t[11]=A):A=t[11];let j=!d&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(df,{"aria-label":a({id:`V6AIOn`}),className:Y(`-ml-1 shrink-0 has-[>[data-slot=button-group]]:gap-0`,w&&`[-webkit-app-region:no-drag]`),children:[(0,Z.jsxs)(ln,{children:[(0,Z.jsx)(on,{asChild:!0,children:(0,Z.jsx)(hP,{className:Y(`shrink-0 text-muted-foreground`,w&&`[-webkit-app-region:no-drag]`)})}),(0,Z.jsxs)(sn,{children:[(0,Z.jsx)(`span`,{children:a(l===`expanded`?{id:`w3vFfL`}:{id:`e8zRrb`})}),` `,(0,Z.jsx)(p,{"aria-label":g,children:m})]})]}),T&&i&&(0,Z.jsxs)(ln,{children:[(0,Z.jsx)(on,{asChild:!0,children:(0,Z.jsx)(X,{variant:`ghost`,size:`icon-sm`,onClick:i,"aria-label":a({id:`DbCfXV`,values:{searchShortcutLabel:y}}),"data-telemetry-event":`ok.editor_header.search.click`,className:Y(`shrink-0 text-muted-foreground`,w&&`[-webkit-app-region:no-drag]`),children:(0,Z.jsx)(ie,{"aria-hidden":`true`})})}),(0,Z.jsxs)(sn,{children:[(0,Z.jsx)(`span`,{children:a({id:`A1taO8`})}),` `,(0,Z.jsx)(p,{"aria-label":y,children:v})]})]}),w&&T&&(0,Z.jsx)(rR,{})]}),(0,Z.jsx)(Vr,{orientation:`vertical`,className:`mr-1 h-4 shrink-0 data-vertical:self-center`}),(0,Z.jsx)(ZI,{})]}),M;t[12]!==A||t[13]!==j?(M=(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1 px-3`,children:[A,j]}),t[12]=A,t[13]=j,t[14]=M):M=t[14];let N;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(N=Y(`flex shrink-0 items-center justify-end gap-2 px-3`,w&&`*:[-webkit-app-region:no-drag]`,w&&`mr-[var(--ok-titlebar-reserve-right,0px)]`),t[15]=N):N=t[15];let P;t[16]!==b||t[17]!==x||t[18]!==C||t[19]!==d?(P=!d&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(dR,{input:C,onClickWhenNoRemote:()=>x(!0)}),(0,Z.jsx)(As,{open:b,onOpenChange:x})]}),t[16]=b,t[17]=x,t[18]=C,t[19]=d,t[20]=P):P=t[20];let F;t[21]!==r||t[22]!==n?(F=(0,Z.jsx)(Gs,{onSignIn:n,onSetIdentity:r}),t[21]=r,t[22]=n,t[23]=F):F=t[23];let I,L,R,z;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Z.jsx)(pI,{}),L=(0,Z.jsx)(Vr,{orientation:`vertical`,className:`h-4 shrink-0 data-vertical:self-center`}),R=(0,Z.jsx)(XL,{}),z=(0,Z.jsx)(gI,{}),t[24]=I,t[25]=L,t[26]=R,t[27]=z):(I=t[24],L=t[25],R=t[26],z=t[27]);let B;t[28]===d?B=t[29]:(B=!d&&(0,Z.jsx)(cR,{}),t[28]=d,t[29]=B);let V;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,Z.jsx)(qL,{}),t[30]=V):V=t[30];let H;t[31]!==P||t[32]!==F||t[33]!==B?(H=(0,Z.jsxs)(`div`,{className:N,children:[P,F,I,L,R,z,B,V]}),t[31]=P,t[32]=F,t[33]=B,t[34]=H):H=t[34];let U;return t[35]!==M||t[36]!==H||t[37]!==E||t[38]!==k?(U=(0,Z.jsxs)(`header`,{"data-electron-drag":E,className:k,children:[M,H]}),t[35]=M,t[36]=H,t[37]=E,t[38]=k,t[39]=U):U=t[39],U}var SR=(0,Q.lazy)(()=>n(()=>import(`./AgentThreadClientBinder-Dc_ZvYaC.js`).then(e=>({default:e.AgentThreadClientBinder})),__vite__mapDeps([163,1,22,12,164,47,99,17,101,6,2,3,7,8,9]),import.meta.url)),CR=(0,Q.lazy)(()=>n(()=>import(`./TerminalSessionsHost-DXQM6Nk-.js`).then(e=>({default:e.TerminalSessionsHost})),__vite__mapDeps([165,1,2,111,17,12,6,3,7,8,9,47,10,11,14,15,16,49,112,113,30,31,19,24,25,50,20,92,22,89,29,51,26,118,105,36,166,121,68,106,39,41,42,33,98,38,27,99,137,84,85,86,87,138,164,167,122]),import.meta.url));function wR(e){let t=(0,$.c)(91),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{onOpenSearch:r}=n,[i,a]=ob(),[o,s]=(0,Q.useState)(i),[c,l]=(0,Q.useState)(!1),[u,d]=(0,Q.useState)(`auth`),[f,p]=(0,Q.useState)(lx[0].id),[m,h]=(0,Q.useState)(!1),g=typeof window<`u`?window.okDesktop??null:null,_=g!=null&&g.terminal!=null&&g.config.ptyAvailable===!0,[v,y]=(0,Q.useState)(!1),b=Rd(),[x,S]=(0,Q.useState)(!1),[C,w]=(0,Q.useState)(!1),T=(0,Q.useRef)(!1),[E,D]=(0,Q.useState)(null),[O,k]=(0,Q.useState)(null),A=(0,Q.useRef)(0),[j,M]=(0,Q.useState)(hb),N;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(N=function(e){M(e),mb(e),y(!0)},t[2]=N):N=t[2];let P=N,F;t[3]===j?F=t[4]:(F=function(){P(j===`right`?`bottom`:`right`)},t[3]=j,t[4]=F);let I=F,L;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(L={container:null,isShowing:!1,dockPosition:`bottom`,editorRegion:null},t[5]=L):L=t[5];let[R,z]=(0,Q.useState)(L),B=(0,Q.useRef)(0),V;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(V=function(){y(!0),Vc()},t[6]=V):V=t[6];let H=V,U;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(U=function(){y(!0)},t[7]=U):U=t[7];let W=U,G=ho(),{projectConfig:K,projectLocalConfig:ee,projectLocalSynced:te,projectSynced:ne}=od(),{activeDocName:q}=Ye(),re=G?.hasRemote,ie=G?.pushPermission?.checkStatus,ae;t[8]!==m||t[9]!==K||t[10]!==ee||t[11]!==te||t[12]!==ne||t[13]!==re||t[14]!==ie?(ae=vb({autoSyncOnboardingDismissed:m,hasRemote:re,projectLocalSynced:te,projectSynced:ne,projectLocalConfig:ee,projectConfig:K,pushPermissionCheckStatus:ie}),t[8]=m,t[9]=K,t[10]=ee,t[11]=te,t[12]=ne,t[13]=re,t[14]=ie,t[15]=ae):ae=t[15];let oe=ae,se,ce;t[16]===q?(se=t[17],ce=t[18]):(se=()=>{let e=function(e){let t=e.detail;t&&q&&Ld(q,{kind:`raw-mdx`,detail:t}),s(`source`)};return window.addEventListener(Qy,e),()=>window.removeEventListener(Qy,e)},ce=[q],t[16]=q,t[17]=se,t[18]=ce),(0,Q.useEffect)(se,ce);let le;t[19]!==q||t[20]!==o?(le=function(e){if(!_||q==null)return!1;let t=vd(q,o)?.markdown??``;if(t.trim()===``)return!1;let n=`${Dk(q,t)}\n\n`;return y(!0),Jt(n,{newTab:e,submit:!1}),!0},t[19]=q,t[20]=o,t[21]=le):le=t[21];let ue=(0,Q.useEffectEvent)(le),de;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(de=()=>H(),t[22]=de):de=t[22];let fe=(0,Q.useEffectEvent)(de),pe;t[23]===ue?pe=t[24]:(pe=()=>Ut(e=>{if(e===`toggle-terminal`){if(ue(!1))return;y(DR)}else e===`new-terminal`&&y(!0)}),t[23]=ue,t[24]=pe);let me;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(me=[],t[25]=me):me=t[25],(0,Q.useEffect)(pe,me);let he;t[26]===ue?he=t[27]:(he=()=>{if(window.okDesktop!=null)return;let e=function(e){if(El(e,`toggle-terminal-panel`)){if(e.preventDefault(),ue(!1))return;y(ER)}};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},t[26]=ue,t[27]=he);let ge;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(ge=[],t[28]=ge):ge=t[28],(0,Q.useEffect)(he,ge);let _e;t[29]!==fe||t[30]!==ue?(_e=()=>{if(!_)return;let e=function(e){El(e,`new-terminal-tab`)&&(e.preventDefault(),ue(!0)||fe())};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},t[29]=fe,t[30]=ue,t[31]=_e):_e=t[31];let ve;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(ve=[_],t[32]=ve):ve=t[32],(0,Q.useEffect)(_e,ve);let ye,be;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(ye=()=>Rc((e,t,n)=>{let{stage:r}=n;y(!0),B.current+=1,D({prompt:r?null:e,cli:t,nonce:B.current,stagePaste:r?e:void 0})}),be=[],t[33]=ye,t[34]=be):(ye=t[33],be=t[34]),(0,Q.useEffect)(ye,be);let xe,Se;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(xe=()=>ms(e=>{y(!0),A.current+=1,k({agentSource:e.agentSource,agentId:e.agentId,prompt:e.prompt,docName:e.docName,titleHint:e.titleHint,nonce:A.current})}),Se=[],t[35]=xe,t[36]=Se):(xe=t[35],Se=t[36]),(0,Q.useEffect)(xe,Se);let Ce,we;t[37]===v?(Ce=t[38],we=t[39]):(Ce=()=>{v||D(null)},we=[v],t[37]=v,t[38]=Ce,t[39]=we),(0,Q.useEffect)(Ce,we);let Te,Ee;t[40]!==C||t[41]!==v?(Te=()=>{window.okDesktop!=null&&C&&(Sc({terminalVisible:v}),window.okDesktop.editor.notifyViewMenuStateChanged({terminalVisible:v}))},Ee=[v,C],t[40]=C,t[41]=v,t[42]=Te,t[43]=Ee):(Te=t[42],Ee=t[43]),(0,Q.useEffect)(Te,Ee);let De,Oe;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(De=()=>{let e=window.okDesktop;if(e==null)return;if(typeof e.terminal?.getDockState!=`function`){w(!0);return}let t=!1;return e.terminal.getDockState().then(e=>{t||!e.visible||(T.current=!0,y(!0))}).catch(TR).finally(()=>{t||w(!0)}),()=>{t=!0}},Oe=[],t[44]=De,t[45]=Oe):(De=t[44],Oe=t[45]),(0,Q.useEffect)(De,Oe);let ke,Ae;t[46]===v?(ke=t[47],Ae=t[48]):(ke=()=>{if(window.okDesktop!=null){if(T.current){T.current=!1;return}v&&ci()}},Ae=[v],t[46]=v,t[47]=ke,t[48]=Ae),(0,Q.useEffect)(ke,Ae),sb(G?.pausedReason),lb();let je;t[49]===a?je=t[50]:(je=function(e){s(e),a(e)},t[49]=a,t[50]=je);let Me=je,Ne;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(SR,{})}),t[51]=Ne):Ne=t[51];let Pe,Fe;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(Pe=()=>{d(`auth`),l(!0)},Fe=()=>{d(`identity`),l(!0)},t[52]=Pe,t[53]=Fe):(Pe=t[52],Fe=t[53]);let Ie;t[54]===r?Ie=t[55]:(Ie=(0,Z.jsx)(xR,{onSignIn:Pe,onSetIdentity:Fe,onOpenSearch:r}),t[54]=r,t[55]=Ie);let Le;t[56]!==f||t[57]!==o||t[58]!==Me||t[59]!==x||t[60]!==j||t[61]!==v?(Le=(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:(0,Z.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:(0,Z.jsx)(EF,{editorMode:o,onModeChange:Me,activeTab:f,onActiveTabChange:p,terminalBridge:_?g:null,terminalVisible:v,onTerminalVisibleChange:y,terminalDock:j,terminalHasSessions:x,onTerminalPlacement:z,onRevealTerminal:W})})}),t[56]=f,t[57]=o,t[58]=Me,t[59]=x,t[60]=j,t[61]=v,t[62]=Le):Le=t[62];let Re;t[63]===R.editorRegion?Re=t[64]:(Re=()=>R.editorRegion?.focus(),t[63]=R.editorRegion,t[64]=Re);let ze;t[65]!==b||t[66]!==Re||t[67]!==j||t[68]!==E||t[69]!==R.container||t[70]!==R.isShowing||t[71]!==v||t[72]!==O||t[73]!==I?(ze=(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(CR,{bridge:_?g:null,visible:v,onVisibleChange:y,launch:E,threadLaunch:O,installedClis:b,container:R.container,isShowing:R.isShowing,onRequestEditorFocus:Re,dockPosition:j,onToggleDock:I,onHasSessionsChange:S})}),t[65]=b,t[66]=Re,t[67]=j,t[68]=E,t[69]=R.container,t[70]=R.isShowing,t[71]=v,t[72]=O,t[73]=I,t[74]=ze):ze=t[74];let Be=u===`identity`,Ve;t[75]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=()=>{l(!1)},t[75]=Ve):Ve=t[75];let He;t[76]!==c||t[77]!==Be?(He=(0,Z.jsx)(Ss,{open:c,onOpenChange:l,identityPrompt:Be,onSuccess:Ve}),t[76]=c,t[77]=Be,t[78]=He):He=t[78];let Ue=oe!==null,We=oe??`full`,Ge;t[79]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=()=>h(!0),t[79]=Ge):Ge=t[79];let Ke;t[80]!==Ue||t[81]!==We?(Ke=(0,Z.jsx)(gb,{open:Ue,variant:We,onResolved:Ge}),t[80]=Ue,t[81]=We,t[82]=Ke):Ke=t[82];let qe,Je;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(qe=(0,Z.jsx)(Yy,{}),Je=(0,Z.jsx)(qy,{}),t[83]=qe,t[84]=Je):(qe=t[83],Je=t[84]);let Xe;return t[85]!==Ie||t[86]!==Le||t[87]!==ze||t[88]!==He||t[89]!==Ke?(Xe=(0,Z.jsxs)(Z.Fragment,{children:[Ne,Ie,Le,ze,He,Ke,qe,Je]}),t[85]=Ie,t[86]=Le,t[87]=ze,t[88]=He,t[89]=Ke,t[90]=Xe):Xe=t[90],Xe}function TR(e){console.error(`[terminal] dock-state restore failed; staying hidden:`,e)}function ER(e){return!e}function DR(e){return!e}function OR(){let e=(0,$.c)(4),[t,n]=(0,Q.useState)(!1),r,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>Ut(e=>{e===`send-feedback`&&n(!0)}),i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,Q.useEffect)(r,i);let a;return e[2]===t?a=e[3]:(a=(0,Z.jsx)(J_,{open:t,onOpenChange:n,source:`help_menu`}),e[2]=t,e[3]=a),a}function kR(e){let t=Cu(fu(e));typeof window>`u`||window.location.hash!==t&&(window.location.hash=t)}function AR(){let e=(0,$.c)(11),{conflicts:t,loading:n,error:r}=Ds();if(n)return null;if(r===`server`){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(`section`,{"data-testid":`conflicts-section`,"aria-label":`Conflicted files`,className:`border-b border-amber-200/60 bg-amber-50/40 px-2 py-2 dark:border-amber-900/40 dark:bg-amber-950/20`,children:(0,Z.jsxs)(`p`,{"data-testid":`conflicts-section-error`,className:`px-2 py-1.5 text-[12px] text-amber-700 dark:text-amber-400`,children:[(0,Z.jsx)(ul,{"aria-hidden":`true`,className:`mr-1.5 inline size-3`}),`Couldn't load conflicts — reload to retry.`]})}),e[0]=t):t=e[0],t}if(t.length===0)return null;let i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsxs)(`span`,{className:`flex items-center gap-1.5 font-mono text-[11px] uppercase tracking-wider text-amber-700 dark:text-amber-400`,children:[(0,Z.jsx)(ul,{"aria-hidden":`true`,className:`size-3`}),`Conflicts`]}),e[1]=i):i=e[1];let a;e[2]===t.length?a=e[3]:(a=(0,Z.jsxs)(`header`,{className:`flex items-center justify-between px-2 pb-1.5`,children:[i,(0,Z.jsx)(`span`,{"data-testid":`conflicts-section-count`,className:`rounded-full bg-amber-500 px-1.5 py-0.5 font-mono text-[10px] font-medium leading-none text-white`,children:t.length})]}),e[2]=t.length,e[3]=a);let o;e[4]===t?o=e[5]:(o=t.map(jR),e[4]=t,e[5]=o);let s;e[6]===o?s=e[7]:(s=(0,Z.jsx)(`ul`,{className:`flex flex-col gap-px`,children:o}),e[6]=o,e[7]=s);let c;return e[8]!==a||e[9]!==s?(c=(0,Z.jsxs)(`section`,{"data-testid":`conflicts-section`,"aria-label":`Conflicted files`,className:`border-b border-amber-200/60 bg-amber-50/40 px-2 py-2 dark:border-amber-900/40 dark:bg-amber-950/20`,children:[a,s]}),e[8]=a,e[9]=s,e[10]=c):c=e[10],c}function jR(e){return(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(X,{variant:`ghost`,size:`sm`,"data-testid":`conflicts-section-row`,"data-file":e.file,title:e.file,className:`h-7 w-full justify-start gap-1.5 px-2 font-normal text-[13px] text-amber-800 hover:bg-amber-100/60 hover:text-amber-900 dark:text-amber-300 dark:hover:bg-amber-900/30 dark:hover:text-amber-200`,onClick:()=>kR(e.file),children:[(0,Z.jsx)(ul,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:e.file})]})},e.file)}var MR=`proactive_card`;function NR(){let e=!1,t=!1;return{isEvaluated:()=>e,isShown:()=>t,latchEvaluated:()=>{e=!0},latchShown:()=>{t=!0}}}var PR=NR();function FR(e){let t=(0,$.c)(14),{pages:n,ready:r,blocked:i,store:a,now:o,session:s}=e,c=a===void 0?xL:a,l=o===void 0?Date.now:o,u=s===void 0?PR:s,{dismissed:d}=(0,Q.useSyncExternalStore)(c.subscribe,c.getSnapshot,c.getSnapshot),f;t[0]===u?f=t[1]:(f=u.isShown(),t[0]=u,t[1]=f);let[p,m]=(0,Q.useState)(f),h,g;t[2]!==l||t[3]!==c?(h=()=>{c.recordFirstSeen(l())},g=[c,l],t[2]=l,t[3]=c,t[4]=h,t[5]=g):(h=t[4],g=t[5]),(0,Q.useEffect)(h,g);let _,v;return t[6]!==i||t[7]!==l||t[8]!==n||t[9]!==r||t[10]!==u||t[11]!==c?(_=()=>{u.isEvaluated()||!r||n==null||(u.latchEvaluated(),!i&&mL(c.getSnapshot(),l(),pL(n))&&(c.recordShown(l()),u.latchShown(),m(!0)))},v=[r,i,n,c,l,u],t[6]=i,t[7]=l,t[8]=n,t[9]=r,t[10]=u,t[11]=c,t[12]=_,t[13]=v):(_=t[12],v=t[13]),(0,Q.useEffect)(_,v),p&&!d}var IR=`Relaunch`,LR=`Release notes`,RR=`Updates paused`,zR=`Download`,BR=`Reset to defaults`,VR=`Relaunching to install the update…`,HR=`Relaunch failed — please restart manually`;function UR(e){return`Update to ${e} didn't install.`}var WR=`Retry`,GR=`Download manually`,KR=`Recovery action failed — please try again`;function qR(e,t){let n=t instanceof Error&&t.message?t.message:``;return n?`${e}: ${n}`:e}function JR(e){return`Version ${e} ready to install`}function YR(e){return`Updated to Version ${e}`}function XR(e){return`Your settings and recent projects were saved by a newer build than this one (v${e}). Reset to defaults to continue.`}var ZR=0,QR=0,$R=1,ez=2,tz=3,nz=6e4;function rz(e,t,n=()=>{},r=nz,i={isEligible:()=>!1,onShown:()=>{}}){let a=[],o=new Set,s=`update-downloaded`;return a.push(e.onUpdateDownloaded(({version:r})=>{let i=s,a=()=>{t({id:i,body:JR(r),priority:ez,action:{label:IR,onClick:()=>{t({id:i,body:VR,priority:ez,dismissible:!1}),e.update.relaunchNow().then(()=>{n(i)},e=>{a(),t({id:`relaunch-error-${r}`,body:qR(HR,e),variant:`error`,priority:$R})})}}})};a()})),a.push(e.onUpdateRelaunching(()=>{t({id:s,body:VR,priority:ez,dismissible:!1})})),a.push(e.onUpdateRelaunchFailed(({version:r,message:i,downloadUrl:a})=>{if(a){let i=`install-failed-${r}`,o=()=>{t({id:i,body:UR(r),variant:`error`,priority:$R,action:{label:WR,onClick:()=>{e.update.relaunchNow().then(()=>{n(i)},e=>{console.warn(`[update-notice] install-failed retry rejected`,e),o()})}},secondaryAction:{label:GR,onClick:()=>{e.shell.openExternal(a)}}})};o();return}t({id:`relaunch-error-${r}`,body:i?`${HR}: ${i}`:HR,variant:`error`,priority:$R})})),a.push(e.onWhatsNew(({version:a,releaseUrl:s})=>{if(i.isEligible(a)){i.onShown(a),t({id:`whats-new-combined-${a}`,body:YR(a),variant:`success`,priority:tz,combinedSubscribe:!0,whatsNew:{version:a,releaseUrl:s},action:{label:LR,onClick:()=>{e.shell.openExternal(s)}}}),e.update.dismissWhatsNew(a);return}let c=`whats-new-${a}`;t({id:c,body:YR(a),variant:`success`,priority:tz,action:{label:LR,onClick:()=>{e.shell.openExternal(s)}},onDismiss:()=>{e.update.dismissWhatsNew(a)}});let l=setTimeout(()=>{o.delete(l),n(c),e.update.dismissWhatsNew(a)},r);o.add(l)})),a.push(e.onWhatsNewDismissed(({version:e})=>{n(`whats-new-${e}`)})),a.push(e.onUpdateStuckHint(({downloadUrl:n})=>{t({id:`update-stuck-hint`,body:RR,priority:QR,action:{label:zR,onClick:()=>{e.shell.openExternal(n)}}})})),()=>{for(let e of a)e();for(let e of o)clearTimeout(e);o.clear()}}function iz(e,t,n,r=()=>{}){let i=`schema-incompatibility-${t.persistedSchemaVersion}`,a=`schema-incompatibility-error-${t.persistedSchemaVersion}`,o=e=>{r(i),n({id:a,body:qR(KR,e),variant:`error`,priority:ZR})};n({id:i,body:XR(t.currentBuild),priority:ZR,action:{label:BR,onClick:()=>{e.state.resetIncompatible().then(()=>{r(i)},o)}}})}var az=[],oz=new Set,sz=!1;function cz(){for(let e of oz)e()}function lz(e){let t=az.findIndex(t=>t.id===e.id);if(t===-1)az=[...az,e];else{let n=az.slice();n[t]=e,az=n}cz()}function uz(e){let t=az.filter(t=>t.id!==e);t.length!==az.length&&(az=t,cz())}function dz(){return az}function fz(e){return oz.add(e),()=>{oz.delete(e)}}function pz(){if(sz||typeof window>`u`)return;let e=window.okDesktop;e&&(sz=!0,rz(e,lz,uz,void 0,{isEligible:e=>OL(FL.getSnapshot(),e),onShown:e=>FL.recordShown(e)}),e.state.query().then(t=>{t.schemaIncompatibility&&iz(e,t.schemaIncompatibility,lz,uz)},e=>{console.warn(`[update-notices-store] bridge.state.query() failed`,e)}))}var mz=new URL(`/api/feedback`,{BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.41.4`}?.VITE_OK_FEEDBACK_INTAKE_ORIGIN||`https://openknowledge.ai`).href;function hz(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>{let e=typeof r.result==`string`?r.result:``,n=e.indexOf(`,`);t(n===-1?``:e.slice(n+1))},r.onerror=()=>n(r.error??Error(`file read failed`)),r.readAsDataURL(e)})}async function gz(e){return{contentType:e.type,base64:await hz(e)}}function _z(){return typeof window<`u`&&window.okDesktop?.platform||`web`}async function vz(e){try{let t=await fetch(mz,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({...e,appVersion:Fu,platform:_z()}),signal:AbortSignal.timeout(3e4)});if(t.ok){let e=await t.json().catch(e=>(console.warn(`[feedback] action=submit result=ok-parse-error message=${e instanceof Error?e.message:String(e)}`),null));return{ok:!0,reference:e&&typeof e.reference==`string`?e.reference:``}}return t.status===400||t.status===413?{ok:!1,reason:`invalid`}:t.status===503?{ok:!1,reason:`unavailable`}:(console.warn(`[feedback] action=submit result=http-error status=${t.status}`),{ok:!1,reason:`error`})}catch(e){return console.warn(`[feedback] action=submit result=network-error message=${e instanceof Error?e.message:String(e)}`),{ok:!1,reason:`error`}}}var yz=$t(`group/attachment relative flex w-fit max-w-full min-w-0 shrink-0 flex-wrap rounded-xl border bg-card text-card-foreground transition-colors focus-within:ring-1 focus-within:ring-ring/50 has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 data-[state=idle]:border-dashed`,{variants:{size:{default:`gap-2 text-sm has-data-[slot=attachment-content]:px-2.5 has-data-[slot=attachment-content]:py-2 has-data-[slot=attachment-media]:p-2`,sm:`gap-2.5 text-xs has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5`,xs:`gap-1.5 rounded-lg text-xs has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1`},orientation:{horizontal:`min-w-40 items-center`,vertical:`w-24 flex-col has-data-[slot=attachment-content]:w-30`}}});function bz(e){let t=(0,$.c)(16),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:n,state:i,size:a,orientation:o,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=i===void 0?`done`:i,c=a===void 0?`default`:a,l=o===void 0?`horizontal`:o,u;t[6]!==n||t[7]!==l||t[8]!==c?(u=Y(yz({size:c,orientation:l}),n),t[6]=n,t[7]=l,t[8]=c,t[9]=u):u=t[9];let d;return t[10]!==l||t[11]!==r||t[12]!==c||t[13]!==s||t[14]!==u?(d=(0,Z.jsx)(`div`,{"data-slot":`attachment`,"data-state":s,"data-size":c,"data-orientation":l,className:u,...r}),t[10]=l,t[11]=r,t[12]=c,t[13]=s,t[14]=u,t[15]=d):d=t[15],d}var xz=$t(`relative flex aspect-square w-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted text-foreground group-data-[orientation=vertical]/attachment:w-full group-data-[size=sm]/attachment:w-8 group-data-[size=xs]/attachment:w-7 group-data-[size=xs]/attachment:rounded-md group-data-[state=error]/attachment:bg-destructive/10 group-data-[state=error]/attachment:text-destructive group-data-[orientation=vertical]/attachment:*:data-[slot=spinner]:size-6! [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 group-data-[orientation=vertical]/attachment:[&_svg:not([class*='size-'])]:size-6 group-data-[size=xs]/attachment:[&_svg:not([class*='size-'])]:size-3.5`,{variants:{variant:{icon:``,image:`opacity-60 group-data-[state=done]/attachment:opacity-100 group-data-[state=idle]/attachment:opacity-100 *:[img]:aspect-square *:[img]:w-full *:[img]:object-cover`}},defaultVariants:{variant:`icon`}});function Sz(e){let t=(0,$.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,variant:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`icon`:i,o;t[4]!==n||t[5]!==a?(o=Y(xz({variant:a}),n),t[4]=n,t[5]=a,t[6]=o):o=t[6];let s;return t[7]!==r||t[8]!==o||t[9]!==a?(s=(0,Z.jsx)(`div`,{"data-slot":`attachment-media`,"data-variant":a,className:o,...r}),t[7]=r,t[8]=o,t[9]=a,t[10]=s):s=t[10],s}function Cz(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Y(`max-w-full min-w-0 flex-1 leading-tight group-data-[orientation=vertical]/attachment:px-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`attachment-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function wz(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Y(`block max-w-full min-w-0 truncate font-medium group-data-[state=processing]/attachment:shimmer group-data-[state=uploading]/attachment:shimmer`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`span`,{"data-slot":`attachment-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Tz(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Y(`mt-0.5 block min-w-0 truncate text-xs text-muted-foreground group-data-[state=error]/attachment:text-destructive/80`,`max-w-full`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`span`,{"data-slot":`attachment-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ez(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Y(`relative z-20 flex shrink-0 items-center group-data-[orientation=vertical]/attachment:absolute group-data-[orientation=vertical]/attachment:top-3 group-data-[orientation=vertical]/attachment:right-3 group-data-[orientation=vertical]/attachment:gap-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`attachment-actions`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Dz(e){let t=(0,$.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,variant:a,size:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`icon-xs`:i,s=a??`ghost`,c;t[5]===n?c=t[6]:(c=Y(n),t[5]=n,t[6]=c);let l;return t[7]!==r||t[8]!==o||t[9]!==s||t[10]!==c?(l=(0,Z.jsx)(X,{"data-slot":`attachment-action`,variant:s,size:o,className:c,...r}),t[7]=r,t[8]=o,t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function Oz(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Y(`flex min-w-0 scroll-fade-x snap-x snap-mandatory scroll-px-1 scrollbar-none gap-3 overflow-x-auto overscroll-x-contain py-1 *:data-[slot=attachment]:flex-none *:data-[slot=attachment]:snap-start`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`attachment-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var kz=[{value:`too-slow`,label:{id:`YJPN3F`}},{value:`hard-to-use`,label:{id:`MDBJwN`}},{value:`missing-feature`,label:{id:`anmUZq`}},{value:`something-broke`,label:{id:`dXCi3J`}},{value:`formatting`,label:{id:`RcrskJ`}},{value:`other`,label:{id:`_IX_7x`}}],Az=3,jz=3*1024*1024,Mz=[`image/png`,`image/jpeg`,`image/webp`],Nz=`data-[state=on]:border-primary data-[state=on]:bg-primary/5 data-[state=on]:text-primary`,Pz=`rounded-full border border-input bg-transparent px-3 ${Nz}`;function Fz(e){return e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Iz(e,t){let n=new Set(e.map(e=>`${e.name}:${e.size}`)),r=Array.from(t??[]).filter(e=>Mz.includes(e.type)&&!n.has(`${e.name}:${e.size}`));return[...e,...r].slice(0,Az)}var Lz=e=>{let t=(0,$.c)(5),{file:n}=e,[r,i]=(0,Q.useState)(null),a,o;t[0]===n?(a=t[1],o=t[2]):(a=()=>{let e=URL.createObjectURL(n);return i(e),()=>URL.revokeObjectURL(e)},o=[n],t[0]=n,t[1]=a,t[2]=o),(0,Q.useEffect)(a,o);let s;return t[3]===r?s=t[4]:(s=r?(0,Z.jsx)(`img`,{src:r,alt:``,className:`size-full object-cover`}):null,t[3]=r,t[4]=s),s},Rz=e=>{let t=(0,$.c)(58),{onSuccess:n,source:r,compact:i,title:a,onDismiss:o,className:s}=e,c=r===void 0?`resources_menu`:r,{_:l}=gt(),u=(0,Q.useRef)(null),d,f;if(t[0]!==l){let e=Ma({rating:Gi([`positive`,`negative`],{error:l({id:`H-hzll`})}),reasons:Ea(ma()),message:ma(),attachments:Ea(ui(File)).max(Az,l({id:`E9gh86`,values:{MAX_ATTACHMENTS:Az}})).refine(Bz,l({id:`s7us1p`})).refine(Hz,l({id:`ItxGi3`})),shareEmail:to(),email:ma()}).refine(Uz,{path:[`email`],message:l({id:`fwrPh4`})});f=up,d=sL(e),t[0]=l,t[1]=d,t[2]=f}else d=t[1],f=t[2];let p;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(p=[],t[3]=p):p=t[3];let m;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(m={rating:void 0,reasons:p,message:``,attachments:[],shareEmail:!1,email:``},t[4]=m):m=t[4];let h;t[5]===d?h=t[6]:(h={resolver:d,defaultValues:m},t[5]=d,t[6]=h);let g=f(h),_;t[7]===g.control?_=t[8]:(_={control:g.control,name:`rating`},t[7]=g.control,t[8]=_);let v=pp(_),y=!i||v!=null,b;t[9]===g.control?b=t[10]:(b={control:g.control,name:`shareEmail`},t[9]=g.control,t[10]=b);let x=pp(b),S;t[11]===g.control?S=t[12]:(S={control:g.control,name:`attachments`},t[11]=g.control,t[12]=S);let C=pp(S),w=C.length>=Az,T=g.formState.errors.attachments,E;t[13]===g?E=t[14]:(E=e=>g.setValue(`attachments`,e,{shouldValidate:!0}),t[13]=g,t[14]=E);let D=E,O;t[15]!==l||t[16]!==g||t[17]!==n||t[18]!==c?(O=async e=>{try{let t=e.attachments.length?await Promise.all(e.attachments.map(gz)):void 0,r=await vz({kind:`general`,rating:e.rating,reasons:e.reasons,message:e.message.trim()||void 0,email:e.shareEmail&&e.email?e.email:void 0,attachments:t,source:c});if(r.ok){gl.success(l({id:`LvdLef`})),g.reset(),n?.();return}if(r.reason===`unavailable`){gl.error(l({id:`D8JJwQ`}));return}gl.error(l({id:`D2emTw`}))}catch(e){let t=e;console.warn(`[feedback] action=submit result=unexpected-error message=${t instanceof Error?t.message:String(t)}`),gl.error(l({id:`D2emTw`}))}},t[15]=l,t[16]=g,t[17]=n,t[18]=c,t[19]=O):O=t[19];let k=O,A;t[20]!==g||t[21]!==k?(A=g.handleSubmit(k),t[20]=g,t[21]=k,t[22]=A):A=t[22];let j=i?`space-y-3`:`space-y-5`,M;t[23]!==s||t[24]!==j?(M=Y(j,s),t[23]=s,t[24]=j,t[25]=M):M=t[25];let N;t[26]!==l||t[27]!==o||t[28]!==a?(N=(a||o)&&(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[a?(0,Z.jsx)(`p`,{className:`font-medium text-1sm`,children:a}):(0,Z.jsx)(`span`,{}),o?(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon`,onClick:o,"aria-label":l({id:`yz7wBu`}),className:`-mr-1.5 -mt-1 size-7 shrink-0 text-muted-foreground opacity-60`,children:(0,Z.jsx)(hl,{className:`size-4`})}):null]}),t[26]=l,t[27]=o,t[28]=a,t[29]=N):N=t[29];let P;t[30]!==l||t[31]!==i||t[32]!==g?(P=e=>{let{field:t}=e;return(0,Z.jsxs)(sp,{children:[(0,Z.jsx)(mp,{children:(0,Z.jsxs)(Wr,{type:`single`,variant:`outline`,spacing:2,"aria-label":l({id:`rg7hNd`}),value:t.value??``,onValueChange:e=>{e&&(t.onChange(e),e===`positive`&&g.setValue(`reasons`,[]))},className:`w-full`,children:[(0,Z.jsxs)(Hr,{value:`positive`,className:Y(`h-auto flex-1 justify-center py-2`,i?`gap-1.5 text-xs`:`gap-2`,Nz),children:[(0,Z.jsx)(Ag,{className:`size-4`}),(0,Z.jsx)(J,{id:`OEEQKT`})]}),(0,Z.jsxs)(Hr,{value:`negative`,className:Y(`h-auto flex-1 justify-center py-2`,i?`gap-1.5 text-xs`:`gap-2`,Nz),children:[(0,Z.jsx)(kg,{className:`size-4`}),(0,Z.jsx)(J,{id:`U0QBh4`})]})]})}),(0,Z.jsx)(gp,{})]})},t[30]=l,t[31]=i,t[32]=g,t[33]=P):P=t[33];let F;t[34]!==g.control||t[35]!==P?(F=(0,Z.jsx)(dp,{control:g.control,name:`rating`,render:P}),t[34]=g.control,t[35]=P,t[36]=F):F=t[36];let I;t[37]!==l||t[38]!==w||t[39]!==C||t[40]!==T||t[41]!==i||t[42]!==g.control||t[43]!==g.formState.isSubmitting||t[44]!==v||t[45]!==D||t[46]!==x||t[47]!==y?(I=y&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[v===`negative`&&(0,Z.jsx)(dp,{control:g.control,name:`reasons`,render:e=>{let{field:t}=e;return(0,Z.jsxs)(sp,{children:[(0,Z.jsx)(hp,{children:(0,Z.jsx)(J,{id:`Fqx38P`})}),(0,Z.jsx)(mp,{children:(0,Z.jsx)(Wr,{type:`multiple`,variant:`outline`,spacing:2,value:t.value,onValueChange:t.onChange,className:`w-full flex-wrap justify-start`,children:kz.map(e=>(0,Z.jsx)(Hr,{value:e.value,className:Pz,children:l(e.label)},e.value))})})]})}}),(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(dp,{control:g.control,name:`message`,render:e=>{let{field:t}=e;return(0,Z.jsx)(sp,{children:(0,Z.jsx)(mp,{children:(0,Z.jsxs)(`div`,{className:`relative`,children:[(0,Z.jsx)(wf,{...t,placeholder:l({id:`QlAG4m`}),className:Y(`resize-none pb-9`,i?`min-h-16`:`min-h-20`)}),(0,Z.jsxs)(ln,{children:[(0,Z.jsx)(on,{asChild:!0,children:(0,Z.jsx)(`span`,{className:Y(`absolute bottom-1.5 left-1.5 inline-flex`,w&&`cursor-not-allowed`),children:(0,Z.jsxs)(X,{type:`button`,variant:`ghost`,size:`icon`,disabled:w,onClick:()=>u.current?.click(),className:`size-7 text-muted-foreground`,children:[(0,Z.jsx)(el,{className:`size-4`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(J,{id:`3LbBJn`})})]})})}),(0,Z.jsx)(sn,{children:w?(0,Z.jsx)(J,{id:`ASqqsQ`,values:{MAX_ATTACHMENTS:Az}}):(0,Z.jsx)(J,{id:`3LbBJn`})})]}),(0,Z.jsx)(Sl,{ref:u,type:`file`,accept:Mz.join(`,`),multiple:!0,className:`hidden`,onChange:e=>{D(Iz(C,e.target.files)),e.target.value=``}})]})})})}}),C.length>0&&(0,Z.jsx)(Oz,{children:C.map((e,t)=>(0,Z.jsxs)(bz,{size:`xs`,children:[(0,Z.jsx)(Sz,{variant:`image`,children:(0,Z.jsx)(Lz,{file:e})}),(0,Z.jsxs)(Cz,{children:[(0,Z.jsx)(wz,{children:e.name}),(0,Z.jsx)(Tz,{children:Fz(e.size)})]}),(0,Z.jsx)(Ez,{children:(0,Z.jsx)(Dz,{type:`button`,"aria-label":l({id:`w61W3L`,values:{0:e.name}}),onClick:()=>D(C.filter((e,n)=>n!==t)),children:(0,Z.jsx)(hl,{className:`size-3.5`})})})]},`${e.name}:${e.size}`))}),T?.message&&(0,Z.jsx)(`p`,{className:`text-destructive text-sm`,children:T.message})]})]}),(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(dp,{control:g.control,name:`shareEmail`,render:Wz}),x&&(0,Z.jsx)(dp,{control:g.control,name:`email`,render:e=>{let{field:t}=e;return(0,Z.jsxs)(sp,{children:[(0,Z.jsx)(mp,{children:(0,Z.jsx)(Sl,{...t,type:`email`,placeholder:l({id:`JHf6qZ`})})}),(0,Z.jsx)(gp,{})]})}})]}),(0,Z.jsx)(`div`,{className:`flex justify-end`,children:(0,Z.jsx)(X,{type:`submit`,size:i?`sm`:`default`,disabled:g.formState.isSubmitting,children:g.formState.isSubmitting?(0,Z.jsx)(J,{id:`9bG48P`}):(0,Z.jsx)(J,{id:`JlFcis`})})})]}),t[37]=l,t[38]=w,t[39]=C,t[40]=T,t[41]=i,t[42]=g.control,t[43]=g.formState.isSubmitting,t[44]=v,t[45]=D,t[46]=x,t[47]=y,t[48]=I):I=t[48];let L;t[49]!==A||t[50]!==M||t[51]!==N||t[52]!==F||t[53]!==I?(L=(0,Z.jsxs)(`form`,{onSubmit:A,className:M,children:[N,F,I]}),t[49]=A,t[50]=M,t[51]=N,t[52]=F,t[53]=I,t[54]=L):L=t[54];let R;return t[55]!==g||t[56]!==L?(R=(0,Z.jsx)(_p,{...g,children:L}),t[55]=g,t[56]=L,t[57]=R):R=t[57],R};function zz(e){return Mz.includes(e.type)}function Bz(e){return e.every(zz)}function Vz(e,t){return e+t.size}function Hz(e){return e.reduce(Vz,0)<=jz}function Uz(e){return!e.shareEmail||La().safeParse(e.email).success}function Wz(e){let{field:t}=e;return(0,Z.jsxs)(sp,{className:`flex flex-row items-center gap-2 space-y-0`,children:[(0,Z.jsx)(mp,{children:(0,Z.jsx)(Xn,{checked:t.value,onCheckedChange:e=>t.onChange(e===!0)})}),(0,Z.jsx)(hp,{className:`font-normal`,children:(0,Z.jsx)(J,{id:`SF9qpO`})})]})}function Gz(e){let t=(0,$.c)(10),{onClose:n}=e,{_:r}=gt(),i;t[0]===r?i=t[1]:(i=r({id:`u5hSeG`}),t[0]=r,t[1]=i);let a;t[2]===r?a=t[3]:(a=r({id:`s0-xF4`}),t[2]=r,t[3]=a);let o;t[4]!==n||t[5]!==a?(o=(0,Z.jsx)(`div`,{className:`px-3 py-2.5`,children:(0,Z.jsx)(Rz,{compact:!0,source:MR,title:a,onDismiss:n,onSuccess:n})}),t[4]=n,t[5]=a,t[6]=o):o=t[6];let s;return t[7]!==i||t[8]!==o?(s=(0,Z.jsx)(`section`,{"aria-label":i,className:`mx-1 mb-1 overflow-hidden rounded-lg border bg-card text-card-foreground`,children:o}),t[7]=i,t[8]=o,t[9]=s):s=t[9],s}function Kz(){let e=(0,$.c)(5),t=Jo(),n=(0,Q.useSyncExternalStore)(VE.subscribe,VE.getSnapshot,VE.getSnapshot),r=(0,Q.useSyncExternalStore)(fz,dz,dz),i=n.initialized&&!n.dismissed&&!n.completed||r.length>0,a=t?.pages??null,o=t!=null&&!t.loading,s;if(e[0]!==i||e[1]!==a||e[2]!==o?(s={pages:a,ready:o,blocked:i},e[0]=i,e[1]=a,e[2]=o,e[3]=s):s=e[3],!FR(s))return null;let c;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(Gz,{onClose:qz}),e[4]=c):c=e[4],c}function qz(){return xL.dismiss()}var Jz=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
14
+ <symbol id="file-tree-icon-chevron" viewBox="0 0 16 16">
15
+ <path d="M12.4697 5.46973C12.7626 5.17684 13.2374 5.17684 13.5303 5.46973C13.8232 5.76262 13.8232 6.23738 13.5303 6.53028L8.53028 11.5303C8.23738 11.8232 7.76262 11.8232 7.46973 11.5303L2.46973 6.53028C2.17684 6.23738 2.17684 5.76262 2.46973 5.46973C2.76262 5.17684 3.23738 5.17684 3.53028 5.46973L8 9.93946L12.4697 5.46973Z" fill="currentcolor"/>
16
+ </symbol>
17
+ <symbol id="file-tree-icon-dot" viewBox="0 0 6 6">
18
+ <circle cx="3" cy="3" r="3" />
19
+ </symbol>
20
+ <symbol id="file-tree-icon-file" viewBox="0 0 16 16">
21
+ <path fill="currentColor" d="M8 1v3a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1z" class="bg" opacity=".5"/>
22
+ <path fill="currentColor" d="M9.5 1a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z" class="fg"/>
23
+ </symbol>
24
+ <symbol id="file-tree-icon-lock" viewBox="0 0 16 16">
25
+ <path fill="currentcolor" d="M4 5.336V4a4 4 0 1 1 8 0v1.336c1.586.54 2 1.843 2 4.664v1c0 4.118-.883 5-5 5H7c-4.117 0-5-.883-5-5v-1c0-2.821.414-4.124 2-4.664M5.5 4v1.054Q6.166 4.998 7 5h2q.834-.002 1.5.054V4a2.5 2.5 0 0 0-5 0m-2 6v1c0 .995.055 1.692.167 2.193.107.483.246.686.35.79s.307.243.79.35c.5.112 1.198.167 2.193.167h2c.995 0 1.692-.055 2.193-.166.483-.108.686-.247.79-.35.104-.105.243-.308.35-.791.112-.5.167-1.198.167-2.193v-1c0-.995-.055-1.692-.166-2.193-.108-.483-.247-.686-.35-.79-.105-.104-.308-.243-.791-.35C10.693 6.555 9.995 6.5 9 6.5H7c-.995 0-1.692.055-2.193.167-.483.107-.686.246-.79.35s-.243.307-.35.79C3.555 8.307 3.5 9.005 3.5 10" />
26
+ </symbol>
27
+ <symbol id="file-tree-icon-ellipsis" viewBox="0 0 16 16">
28
+ <path d="M5 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0M9.5 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0M14 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0" />
29
+ </symbol>
30
+ </svg>`,Yz=`<symbol id="file-tree-builtin-astro" viewBox="0 0 16 16">
31
+ <path fill="currentColor" d="M6.08 13.92c-.63-.57-.81-1.79-.55-2.67.45.56 1.08.73 1.73.83 1 .15 1.99.1 2.92-.37l.32-.19q.13.38.08.78a2.1 2.1 0 0 1-.9 1.5q-.3.24-.61.43c-.64.44-.81.95-.57 1.69l.02.08a1.7 1.7 0 0 1-.74-.64 2 2 0 0 1-.3-.98q0-.27-.02-.52-.07-.61-.61-.62a.7.7 0 0 0-.75.6z" class="bg" opacity=".6"/>
32
+ <path fill="currentColor" d="M2.5 11.1s1.86-.9 3.72-.9l1.4-4.39c.05-.21.2-.36.38-.36s.33.15.38.36l1.4 4.38c2.2 0 3.72.92 3.72.92l-3.16-8.69q-.13-.4-.45-.42H6.11q-.3.02-.45.42z" class="fg"/>
33
+ </symbol>`,Xz=`<symbol id="file-tree-builtin-babel" viewBox="0 0 16 16">
34
+ <path fill="currentColor" fill-rule="evenodd" d="M9.49.5q1.92.05 2.66.54 1.27.6 1.35 1.52v.23a4 4 0 0 1-.53 1.9l-1.38 1.24q-.74.38-.72.63c.77.82 1.33 1.29.85 2.42q-.47 1.1-2.04 2.28c-.5.32-1.88 1.35-2.96 1.86-1.64.77-3.1 1.4-4.65 1.89-.51.16-1.5.16-1.5.16L.5 15A76 76 0 0 0 5.76 3.49q-.1-.08-.1-.2.1 0 .32-.35l-.03-.09q-1.17.39-2.38 1.3l-.13.03q0-.1-.21-.16-.46.31-.82.7l-.13-.19.16-.06-.03-.16-.34.29L2 4.5q.36-.48.72-.54l.04-.1V3.8q.16 0 .15-.06l.13-.06a6 6 0 0 0 1.13-.9v-.03H4.1l-.12.07q0-.1-.1-.1l-.15.07-.04-.1q.93-.52 1.63-1.05Q7.89.65 9.5.5M8.46 7.83l-.32.04c-1.31.54-2.31.82-2.91.88a71 71 0 0 0-2.2 4.54h.07q.58-.04 3.04-1.42.13 0 1.66-1.05L9.18 9.7v.03q.45-.2.81-1.3v-.2q-.5-.46-1.53-.4m.28-5.75c-.5.1-.75.19-.72.38l-1.16 2.6q-.17.1-.34.95-.3.48-.25.77v.1l.22.05A15 15 0 0 1 8.86 6c1.1-.71 2.12-1.38 2.8-2.54q.24-.33.21-.54-.02-.33-.4-.54c-.54 0-1.07-.34-1.63-.28l-.94-.03z" clip-rule="evenodd"/>
35
+ </symbol>`,Zz=`<symbol id="file-tree-builtin-bash" viewBox="0 0 16 16">
36
+ <path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
37
+ <path fill="currentColor" d="M11.5 11a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1zM7 6.75C7 6.42 6.64 6 6 6s-1 .42-1 .75q-.01.25.22.41.26.21.89.35.74.14 1.28.53c.37.29.61.7.61 1.21 0 .87-.68 1.5-1.5 1.7v.55a.5.5 0 0 1-1 0v-.56c-.82-.18-1.5-.82-1.5-1.69a.5.5 0 0 1 1 0c0 .33.36.75 1 .75s1-.42 1-.75q.01-.25-.22-.41a2 2 0 0 0-.89-.35q-.74-.14-1.28-.53A1.5 1.5 0 0 1 4 6.75c0-.87.68-1.5 1.5-1.7V4.5a.5.5 0 0 1 1 0v.56c.82.18 1.5.82 1.5 1.69a.5.5 0 0 1-1 0" class="fg-stroke"/>
38
+ </symbol>`,Qz=`<symbol id="file-tree-builtin-biome" viewBox="0 0 16 16">
39
+ <path fill="currentColor" d="M8 2 4.88 7.35a7 7 0 0 1 3.7-.13l1.04.25-.99 4.16-1.05-.25a2.7 2.7 0 0 0-3.07 1.45l-.98-.47a4 4 0 0 1 1.07-1.31 3.8 3.8 0 0 1 3.23-.71l.5-2.08a6 6 0 0 0-5.07 1.12A5.9 5.9 0 0 0 1 14h14z"/>
40
+ </symbol>`,$z=`<symbol id="file-tree-builtin-bootstrap" viewBox="0 0 16 16">
41
+ <path fill="currentColor" fill-rule="evenodd" d="M11.72 1.5A2.5 2.5 0 0 1 14.2 4q.02 1.08.3 2.09c.22.73.56 1.24 1.08 1.45.22.08.4.27.4.5s-.18.43-.4.51q-.76.34-1.08 1.45c-.2.65-.27 1.32-.3 2a2.5 2.5 0 0 1-2.48 2.5H4.25A2.6 2.6 0 0 1 1.7 12c-.04-.85-.1-1.68-.22-2.04C1.26 9.23.92 8.7.4 8.5.18 8.42 0 8.23 0 8s.18-.42.4-.5q.77-.35 1.09-1.46c.1-.36.17-1.19.2-2.04a2.6 2.6 0 0 1 2.56-2.5z" class="bg" clip-rule="evenodd" opacity=".2"/>
42
+ <path fill="currentColor" fill-rule="evenodd" d="M8.47 4.54c1.23 0 2.04.68 2.04 1.73 0 .73-.55 1.39-1.24 1.5v.04c.94.1 1.58.77 1.58 1.7 0 1.2-.9 1.95-2.37 1.95H5.97a.3.3 0 0 1-.2-.08.3.3 0 0 1-.08-.2V4.82a.3.3 0 0 1 .08-.2.3.3 0 0 1 .2-.08zm-1.7 6.04h1.49q1.47-.01 1.49-1.15Q9.74 8.31 8.2 8.3H6.77zm0-5.16v2.06h1.21c.93 0 1.45-.38 1.45-1.06 0-.65-.44-1-1.22-1z" class="fg" clip-rule="evenodd"/>
43
+ </symbol>`,eB=`<symbol id="file-tree-builtin-browserslist" viewBox="0 0 16 16">
44
+ <path fill="currentColor" d="M8.88 6.96c0 3.82 3.72 4.7 5.7 3.74-.23.9-1.04 1.67-2.35 1.93-.02.4.42 1.28.82 1.63-.9.35-1.94-.12-2.51-.48a5 5 0 0 0-.32 1.87c-.68 0-1.57-1-1.8-1.37-.3.18-.85 1.15-.96 1.72a2.4 2.4 0 0 1-.81-.86 2.4 2.4 0 0 1-.3-1.15c-.38.27-1.48.95-1.99 1.18-.25-.58-.15-1.3 0-2.06-.21.12-1.8.27-2.43.12.32-.36.75-1.19.94-1.57A4.5 4.5 0 0 1 .44 10.6c.48-.22.97-.53 1.49-1.06C1.26 9.17.24 8.64 0 7.7a6 6 0 0 0 1.79-.32C1.28 7.08.44 6.15.6 5.01c.42.21 1.3.37 1.73.3a3.4 3.4 0 0 1-.25-2.75 5 5 0 0 0 1.48 1c-.08-.8.3-2.31.8-2.71.2.46.73 1.21 1.08 1.4.09-.61.87-2.06 1.57-2.25 0 .5.27 1.4.5 1.67.51-.54 2.25-1.44 3.64-1.13-.43.45-.75.61-.86.98 1.05 0 2.78.34 4.27 1.93-2.34-.89-5.69.56-5.69 3.5" class="bg" opacity=".5"/>
45
+ <path fill="currentColor" d="M11.21 3.59a4.1 4.1 0 0 0 2.47 2.89c.24-.22.61-.38.95-.19.76.44.2 1.26-.34 1.66l-.07.06a13 13 0 0 1-4.49 1.61l-.3-.43a10.5 10.5 0 0 0 4.13-1.31 1 1 0 0 0 .23-.25.5.5 0 0 0-.21-.69l-.15-.06a4.5 4.5 0 0 1-1.77-1.31 4.5 4.5 0 0 1-.88-1.77q.2-.12.43-.21"/>
46
+ <path fill="currentColor" d="M10.36 5.18a.4.4 0 0 0-.03.38c.09.2.3.3.46.23s.24-.3.15-.5l-.01-.02q.23.13.34.39a.83.83 0 0 1-.43 1.08.8.8 0 0 1-1.08-.43.83.83 0 0 1 .6-1.13"/>
47
+ </symbol>`,tB=`<symbol id="file-tree-builtin-bun" viewBox="0 0 16 16">
48
+ <path fill="currentColor" d="M8 14c3.87 0 7-2.46 7-5.49 0-1.88-1.2-3.53-3.04-4.52q-1.1-.61-1.84-1.07C9.2 2.35 8.64 2 8 2s-1.36.45-2.31 1.03A29 29 0 0 1 4.04 4C2.2 4.98 1 6.63 1 8.51 1 11.54 4.13 14 8 14M7.18 3.88q.3-.66.3-1.37c0-.08.11-.1.13-.01.38 1.57-.53 2.35-1.2 2.61-.08.03-.12-.07-.06-.12a3 3 0 0 0 .83-1.12m1.2-.05a3 3 0 0 0-.45-1.3V2.5c-.04-.07.05-.15.1-.1 1.15 1.2.77 2.3.33 2.87-.05.05-.13 0-.11-.08q.21-.67.13-1.37m1.04-.32a3 3 0 0 0-.94-1.02v-.01c-.06-.05-.01-.16.07-.12 1.51.61 1.61 1.8 1.43 2.5l-.03.03a.07.07 0 0 1-.1-.06 3 3 0 0 0-.43-1.32m-2.97.32c-.36.3-.74.43-1.2.56q-.11 0-.1-.1a3.5 3.5 0 0 0 1.76-1.57s.09-.07.1.04c0 .18-.2.76-.56 1.07m2.89 6.36q-.13.52-.55.88a1.3 1.3 0 0 1-.75.35 1.3 1.3 0 0 1-.77-.35 1.7 1.7 0 0 1-.54-.88.13.13 0 0 1 .15-.15h2.31a.14.14 0 0 1 .15.15M6.15 8.95a1.1 1.1 0 0 1-1.39-.14A1.1 1.1 0 0 1 5.12 7a1.1 1.1 0 0 1 1.2.25 1.1 1.1 0 0 1-.17 1.69m4.96 0a1.1 1.1 0 0 1-1.4-.14 1.1 1.1 0 0 1 .37-1.8 1.1 1.1 0 0 1 1.2.25 1.1 1.1 0 0 1 .24 1.2 1 1 0 0 1-.41.5"/>
49
+ </symbol>`,nB=`<symbol id="file-tree-builtin-c" viewBox="0 0 16 16">
50
+ <path fill="currentColor" fill-rule="evenodd" d="M8 1q.084 0 .166.021.098.023.186.075c1.055.624 4.22 2.486 5.277 3.11.085.05.15.112.209.192h-.002l.028.037a.5.5 0 0 1 .103.21q.031.102.033.21v6.29a.71.71 0 0 1-.347.616l-5.307 3.144a.68.68 0 0 1-.693 0l-5.307-3.144A.72.72 0 0 1 2 11.145V4.832a.71.71 0 0 1 .346-.612l5.288-3.126A.7.7 0 0 1 7.992 1zm2.901 4.349a3.75 3.75 0 1 0 0 5.302l-1.06-1.06a2.25 2.25 0 1 1 0-3.182z" clip-rule="evenodd"/>
51
+ </symbol>`,rB=`<symbol id="file-tree-builtin-claude" viewBox="0 0 16 16">
52
+ <path fill="currentColor" d="M3.75 10.31 6.5 8.77l.04-.14-.04-.07h-.14l-.46-.03-1.57-.04-1.38-.07-1.33-.07-.34-.07L1 7.86l.03-.21.28-.18.4.03.89.07 1.33.08.97.06 1.43.16h.22l.03-.1-.07-.05-.06-.06-1.39-.92-1.48-.98-.79-.57-.42-.28-.2-.28-.1-.6.39-.41.52.04.12.03.52.4 1.12.86L6.2 6.04l.2.17.09-.06.01-.04-.1-.15-.76-1.46-.85-1.46-.37-.6-.1-.36a1 1 0 0 1-.06-.42l.42-.59.25-.07.6.08.22.2.36.84.58 1.3.9 1.77.29.53.14.47.04.14h.1v-.07l.07-1 .14-1.22.14-1.57.04-.45.23-.53.42-.28.36.15.28.41-.04.25-.16 1.08-.36 1.7-.21 1.14h.12l.14-.15.58-.76.97-1.2.42-.5.5-.51.32-.25h.6l.44.66-.2.68-.61.79-.52.65-.74 1-.45.8.04.05h.1l1.68-.36.9-.16 1.06-.18.5.23.05.22-.2.48-1.15.28-1.34.28-2 .46-.04.01.03.04.9.09.4.03h.94l1.77.14.46.28.27.37-.04.28-.72.37-.95-.23-2.24-.53-.76-.18h-.11v.06l.64.63L12 10.86l1.48 1.35.07.34-.18.28-.2-.03-1.29-.98-.5-.42-1.12-.95h-.07v.1l.25.38 1.37 2.05.07.63-.1.2-.36.14-.38-.08-.8-1.12-.85-1.26-.66-1.15-.07.05-.4 4.23-.19.21-.42.17-.35-.28-.2-.42.2-.87.23-1.12.18-.9.17-1.1.1-.36v-.03h-.1l-.84 1.16-1.27 1.72-1 1.07-.24.1-.42-.22.04-.39.22-.32 1.4-1.8.84-1.1.57-.64-.02-.07h-.04l-3.7 2.4-.66.09-.28-.28.03-.42.14-.14 1.12-.77z"/>
53
+ </symbol>`,iB=`<symbol id="file-tree-builtin-cpp" viewBox="0 0 16 16">
54
+ <path fill="currentColor" fill-rule="evenodd" d="M8 1q.084 0 .166.021.098.023.186.075c1.055.624 4.22 2.486 5.277 3.11.085.05.15.112.209.192h-.002l.028.037a.5.5 0 0 1 .103.21q.031.102.033.21v6.29a.71.71 0 0 1-.347.616l-5.307 3.144a.68.68 0 0 1-.693 0l-5.307-3.144A.72.72 0 0 1 2 11.145V4.832a.71.71 0 0 1 .346-.612l5.288-3.126A.7.7 0 0 1 7.992 1zm2.901 4.349a3.75 3.75 0 1 0 0 5.302l-1.06-1.06a2.25 2.25 0 1 1 0-3.182z" clip-rule="evenodd"/>
55
+ </symbol>`,aB=`<symbol id="file-tree-builtin-css" viewBox="0 0 16 16">
56
+ <path fill="currentColor" d="M8 15c-5.76 0-7-1.24-7-7V2a1 1 0 0 1 1-1h6c5.77 0 7 1.24 7 7s-1.24 7-7 7" class="vector" opacity=".2"/>
57
+ <path fill="currentColor" d="M10.1 9.19h.73c.03.49.22.6 1 .6.76 0 .93-.12.93-.68 0-.52-.17-.67-.94-.85-1.38-.3-1.68-.56-1.68-1.47 0-1.05.3-1.29 1.67-1.29 1.29 0 1.57.2 1.6 1.13h-.74c-.01-.34-.17-.42-.85-.42-.77 0-.94.1-.94.58 0 .42.17.55.96.73 1.36.3 1.66.58 1.66 1.59 0 1.14-.31 1.39-1.73 1.39-1.39 0-1.69-.24-1.67-1.31m-3.9 0h.74c.03.49.21.6.99.6.76 0 .93-.12.93-.68 0-.52-.17-.67-.93-.85-1.39-.3-1.69-.56-1.69-1.47 0-1.05.3-1.29 1.67-1.29 1.3 0 1.58.2 1.6 1.13h-.73c-.02-.34-.18-.42-.85-.42-.78 0-.95.1-.95.58 0 .42.17.55.96.73 1.37.3 1.67.58 1.67 1.59 0 1.14-.32 1.39-1.74 1.39-1.38 0-1.68-.24-1.66-1.31m-1.22 0h.75c-.09 1.07-.37 1.31-1.56 1.31-1.37 0-1.68-.45-1.68-2.5 0-1.96.36-2.5 1.68-2.5 1.16 0 1.44.25 1.52 1.35h-.76c-.08-.52-.22-.64-.76-.64-.74 0-.9.33-.9 1.78 0 1.47.16 1.8.9 1.8.58 0 .74-.11.8-.6"/>
58
+ </symbol>`,oB=`<symbol id="file-tree-builtin-database" viewBox="0 0 16 16">
59
+ <path fill="currentColor" d="M14.953 9.733a12.4 12.4 0 0 1-.244 1.936c-.207.933-.532 1.58-.996 2.044s-1.11.789-2.044.996C10.73 14.918 9.533 15 8 15s-2.73-.082-3.669-.291c-.933-.207-1.58-.532-2.044-.996s-.789-1.11-.996-2.044c-.122-.547-.2-1.182-.244-1.92q.23.364.532.667c.64.639 1.482 1.031 2.533 1.265 1.046.232 2.33.315 3.884.315 1.555 0 2.838-.083 3.884-.315 1.051-.234 1.893-.626 2.532-1.265a4 4 0 0 0 .541-.683"/>
60
+ <path fill="currentColor" d="M14.93 5.924c-.046.663-.118 1.24-.23 1.743-.207.932-.532 1.579-.995 2.042s-1.11.789-2.042.996c-.938.209-2.135.291-3.667.291-1.531 0-2.729-.082-3.667-.29-.932-.208-1.579-.534-2.042-.997s-.789-1.11-.996-2.042a12 12 0 0 1-.227-1.683l.016-.188a4 4 0 0 0 .5.62c.638.639 1.48 1.031 2.532 1.265 1.046.232 2.33.315 3.884.315 1.555 0 2.838-.083 3.884-.315 1.051-.234 1.893-.626 2.532-1.265.192-.192.357-.404.506-.633z"/>
61
+ <path fill="currentColor" d="M8 1c1.533 0 2.73.082 3.669.291.933.207 1.58.533 2.044.996.403.404.904.944.91 1.695.004.764-.509 1.318-.918 1.727-.463.463-1.11.789-2.042.996-.938.209-2.135.291-3.667.291-1.531 0-2.729-.082-3.667-.29-.932-.208-1.579-.534-2.042-.997-.406-.406-.915-.953-.915-1.71 0-.758.509-1.305.915-1.712.464-.463 1.11-.789 2.044-.996C5.27 1.082 6.467 1 8 1"/>
62
+ </symbol>`,sB=`<symbol id="file-tree-builtin-default" viewBox="0 0 16 16">
63
+ <path fill="currentColor" d="M8 1v3a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1z" class="bg" opacity=".4"/>
64
+ <path fill="currentColor" d="M9.5 1a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z" class="fg"/>
65
+ </symbol>`,cB=`<symbol id="file-tree-builtin-docker" viewBox="0 0 16 16">
66
+ <path fill="currentColor" d="M15.85 6.54c-.05-.04-.45-.36-1.31-.36q-.34 0-.68.06a2.7 2.7 0 0 0-1.14-1.79l-.23-.14-.15.23a3 3 0 0 0-.4 1q-.24 1.01.26 1.84c-.4.24-1.03.3-1.17.3H.5a.5.5 0 0 0-.5.52q-.01 1.46.46 2.83.55 1.5 1.6 2.18c.79.5 2.08.79 3.54.79q.96 0 1.94-.18a8 8 0 0 0 2.55-.97 7 7 0 0 0 1.73-1.5 10 10 0 0 0 1.7-3.06h.15a2.4 2.4 0 0 0 1.8-.7 2 2 0 0 0 .47-.74l.06-.2z"/>
67
+ <path fill="currentColor" d="M1.48 7.36h1.4a.14.14 0 0 0 .14-.13V5.91q-.01-.12-.13-.14H1.48a.13.13 0 0 0-.13.14v1.32q.02.13.13.13m1.94 0h1.41a.14.14 0 0 0 .13-.13V5.91q-.01-.12-.13-.14h-1.4a.13.13 0 0 0-.13.14v1.32q0 .13.12.13m1.98 0h1.4q.13 0 .14-.13V5.91a.13.13 0 0 0-.14-.14H5.4q-.1.01-.12.14v1.32q0 .13.12.13m1.95 0h1.42q.1 0 .12-.13V5.91q0-.12-.12-.14H7.35q-.1.01-.12.14v1.32q.01.13.12.13M3.42 5.5h1.41c.07 0 .13-.08.13-.15V4.03a.13.13 0 0 0-.13-.14h-1.4q-.12 0-.13.14v1.31q0 .13.12.15m1.98 0h1.4c.08 0 .14-.08.14-.15V4.03q0-.13-.14-.14H5.4q-.1 0-.12.14v1.31q0 .13.12.15m1.95 0h1.42c.06 0 .12-.08.12-.15V4.03q-.01-.13-.12-.14H7.35q-.1 0-.12.14v1.31q.01.13.12.15m0-1.9h1.42q.1-.02.12-.14v-1.3Q8.88 2 8.77 2H7.35q-.1 0-.12.14v1.3q.01.13.12.14m1.97 3.78h1.4a.13.13 0 0 0 .14-.13V5.91q-.01-.12-.13-.14H9.32q-.1.01-.12.14v1.32q.01.13.12.13" opacity=".5"/>
68
+ </symbol>`,lB=`<symbol id="file-tree-builtin-eslint" viewBox="0 0 16 16">
69
+ <path fill="currentColor" d="M11.16 6.1 8.12 4.35a.3.3 0 0 0-.24 0L4.84 6.1a.3.3 0 0 0-.12.2v3.5q0 .14.12.22l3.04 1.74q.12.08.24 0l3.04-1.74a.2.2 0 0 0 .13-.22V6.3a.3.3 0 0 0-.13-.2" opacity=".5"/>
70
+ <path fill="currentColor" d="m.1 7.69 3.63-6.3A.8.8 0 0 1 4.37 1h7.26c.26 0 .5.17.64.4l3.63 6.27a.8.8 0 0 1 0 .75l-3.63 6.24a.7.7 0 0 1-.64.34H4.37a.7.7 0 0 1-.64-.34L.1 8.41a.7.7 0 0 1 0-.72m3 3.02q.01.15.14.23l4.63 2.66q.13.06.26 0l4.63-2.66a.3.3 0 0 0 .14-.23V5.4a.3.3 0 0 0-.14-.23L8.13 2.52a.3.3 0 0 0-.26 0L3.24 5.17a.3.3 0 0 0-.14.23z"/>
71
+ </symbol>`,uB=`<symbol id="file-tree-builtin-font" viewBox="0 0 16 16">
72
+ <path fill="currentColor" d="M12.3 13c-1.59 0-2.68-.99-2.68-2.5 0-1.43 1-2.34 2.88-2.35h2.16v-.83c0-1.08-.62-1.68-1.73-1.68-1.05 0-1.66.54-1.73 1.36H9.93c.09-1.43 1.06-2.48 3.05-2.48 1.75 0 3.02.95 3.02 2.68v5.66h-1.29v-1.02h-.04c-.41.66-1.16 1.16-2.37 1.16m.36-1.12c1.14 0 2-.72 2-1.74v-.96H12.6c-1.12 0-1.6.54-1.6 1.28 0 .97.8 1.42 1.66 1.42m-11.24.98H0L3.8 2h1.39l3.8 10.86H7.54l-1.08-3.2H2.5zm3.09-9.25h-.04l-1.6 4.95H6.1z"/>
73
+ </symbol>`,dB=`<symbol id="file-tree-builtin-git" viewBox="0 0 16 16">
74
+ <path fill="currentColor" d="M14.74 7.38 8.62 1.26a.9.9 0 0 0-1.27 0L6.08 2.53l1.61 1.61a1.07 1.07 0 0 1 1.36 1.37l1.55 1.55a1.07 1.07 0 0 1 1.1 1.77 1.07 1.07 0 0 1-1.74-1.16L8.5 6.22v3.8a1.07 1.07 0 1 1-.89-.02V6.15a1.07 1.07 0 0 1-.58-1.4l-1.58-1.6-4.2 4.2a.9.9 0 0 0 0 1.27l6.12 6.12a.9.9 0 0 0 1.27 0l6.09-6.09a.9.9 0 0 0 0-1.27"/>
75
+ </symbol>`,fB=`<symbol id="file-tree-builtin-go" viewBox="0 0 16 16">
76
+ <path fill="currentColor" fill-rule="evenodd" d="M4.41 4.57A3.2 3.2 0 0 1 6.87 5q.74.49 1.08 1.29.08.12-.1.16l-1.55.4c-.14.03-.15.04-.27-.1a1 1 0 0 0-.44-.34 1.6 1.6 0 0 0-1.68.14q-.95.61-.94 1.73c0 .73.52 1.33 1.25 1.43q.95.1 1.58-.6l.25-.34h-1.8c-.19 0-.24-.12-.17-.27.12-.28.34-.76.47-1a.3.3 0 0 1 .24-.14h2.98a4 4 0 0 1 .64-1.19 4 4 0 0 1 2.6-1.52 3.5 3.5 0 0 1 2.64.46q1.13.73 1.31 2.04a3.5 3.5 0 0 1-1.06 3.09q-.93.92-2.23 1.17l-.74.08a3.5 3.5 0 0 1-2.27-.8 3 3 0 0 1-.93-1.42 4 4 0 0 1-.39.61 4 4 0 0 1-2.64 1.56 3.3 3.3 0 0 1-2.5-.6 3 3 0 0 1-1.18-2.03 3.5 3.5 0 0 1 .8-2.67 4 4 0 0 1 2.6-1.58M13.1 7.5a1.53 1.53 0 0 0-1.9-1.21q-1.3.3-1.62 1.59a1.5 1.5 0 0 0 .85 1.72q.77.33 1.52-.05a2 2 0 0 0 1.18-1.74q0-.17-.03-.3" clip-rule="evenodd"/>
77
+ </symbol>`,pB=`<symbol id="file-tree-builtin-graphql" viewBox="0 0 16 16">
78
+ <path fill="currentColor" fill-rule="evenodd" d="M8 1a1.25 1.25 0 0 1 1.18 1.65l2.8 1.61q.33-.25.77-.26a1.25 1.25 0 0 1 .48 2.4v3.2a1.25 1.25 0 1 1-1.25 2.13l-2.8 1.62A1.25 1.25 0 0 1 8 15a1.25 1.25 0 0 1-1.18-1.65l-2.8-1.62q-.33.26-.77.27a1.25 1.25 0 0 1-.48-2.4V6.4a1.25 1.25 0 1 1 1.25-2.14l2.8-1.61A1.25 1.25 0 0 1 8 1M4.44 11.14l-.06.13 2.75 1.58a1.25 1.25 0 0 1 1.74 0l2.74-1.58-.05-.13zm3.89-7.68a1.3 1.3 0 0 1-.66 0L4.03 9.77q.37.3.45.78h7.04q.08-.48.45-.78zM4.38 4.73a1.24 1.24 0 0 1-1.02 1.76v3.02l.13.01 3.67-6.35-.03-.02zm4.46-1.56 3.67 6.35.13-.01V6.49a1.25 1.25 0 0 1-1.03-1.76L8.87 3.15z" clip-rule="evenodd"/>
79
+ </symbol>`,mB=`<symbol id="file-tree-builtin-html" viewBox="0 0 16 16">
80
+ <path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
81
+ <path fill="currentColor" d="M10.48 3.76a.5.5 0 0 1 .4.58L10.6 5.8h1.14a.5.5 0 0 1 0 1h-1.32L10 9.2h1.08a.5.5 0 0 1 0 1H9.8l-.3 1.64a.5.5 0 1 1-.98-.18l.27-1.46H6.4l-.3 1.64a.5.5 0 1 1-.98-.18l.27-1.46H4.25a.5.5 0 0 1 0-1h1.32L6 6.8H4.93a.5.5 0 0 1 0-1H6.2l.3-1.64a.5.5 0 1 1 .98.18L7.2 5.8h2.4l.3-1.64a.5.5 0 0 1 .58-.4M6.58 9.2h2.4l.44-2.4h-2.4z" class="fg"/>
82
+ </symbol>`,hB=`<symbol id="file-tree-builtin-image" viewBox="0 0 16 16">
83
+ <path fill="currentColor" d="M12.5 2A2.5 2.5 0 0 1 15 4.5v4.67l-4.05-3.54-4.08 4.08-3-2L1 10.6V4.5A2.5 2.5 0 0 1 3.5 2z" opacity=".3"/>
84
+ <path fill="currentColor" d="M15 10.5v1a2.5 2.5 0 0 1-2.5 2.5h-9a2.5 2.5 0 0 1-2.46-2.04L4 9l3 2 4-4zm-7-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"/>
85
+ </symbol>`,gB=`<symbol id="file-tree-builtin-javascript" viewBox="0 0 16 16">
86
+ <path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
87
+ <path fill="currentColor" d="M8.1 9.64h.95c.04.62.28.76 1.28.76s1.2-.14 1.2-.85c0-.66-.2-.85-1.2-1.07-1.79-.38-2.18-.7-2.18-1.86C8.15 5.3 8.54 5 10.31 5c1.67 0 2.04.26 2.07 1.42h-.95c-.02-.43-.23-.53-1.1-.53-1 0-1.22.14-1.22.74 0 .52.22.7 1.24.92 1.76.38 2.15.73 2.15 2 0 1.44-.4 1.75-2.24 1.75-1.8 0-2.18-.3-2.15-1.66M3.5 9.5h.98c0 .76.15.92.85.92.77 0 .94-.18.94-1.02V5.1h1v4.34c0 1.54-.35 1.87-1.92 1.87-1.55 0-1.89-.32-1.86-1.8"/>
88
+ </symbol>`,_B=`<symbol id="file-tree-builtin-json" viewBox="0 0 16 16">
89
+ <path fill="currentColor" d="M13.25 11.5V9.75a.5.5 0 0 1 .36-.48l.55-.15a1.16 1.16 0 0 0 0-2.24l-.55-.15a.5.5 0 0 1-.36-.48V4.5a2.5 2.5 0 0 0-2.5-2.5h-.25a.5.5 0 0 0 0 1h.25a1.5 1.5 0 0 1 1.5 1.5v1.75a1.5 1.5 0 0 0 1.09 1.44l.54.15a.16.16 0 0 1 0 .32l-.54.15a1.5 1.5 0 0 0-1.09 1.44v1.75a1.5 1.5 0 0 1-1.5 1.5h-.25a.5.5 0 0 0 0 1h.25a2.5 2.5 0 0 0 2.5-2.5m-10.5 0V9.75a.5.5 0 0 0-.36-.48l-.55-.15a1.16 1.16 0 0 1 0-2.24l.55-.15a.5.5 0 0 0 .36-.48V4.5A2.5 2.5 0 0 1 5.25 2h.25a.5.5 0 0 1 0 1h-.25a1.5 1.5 0 0 0-1.5 1.5v1.75a1.5 1.5 0 0 1-1.09 1.44l-.54.15a.16.16 0 0 0 0 .32l.54.15a1.5 1.5 0 0 1 1.09 1.45v1.74a1.5 1.5 0 0 0 1.5 1.5h.25a.5.5 0 0 1 0 1h-.25a2.5 2.5 0 0 1-2.5-2.5"/>
90
+ </symbol>`,vB=`<symbol id="file-tree-builtin-markdown" viewBox="0 0 16 16">
91
+ <path fill="currentColor" d="M1 12V4h2l2 2.5L7 4h2v8H7V7.5l-2 2-2-2V12zm9-3 3 3.5L16 9h-2V4h-2v5z"/>
92
+ </symbol>`,yB=`<symbol id="file-tree-builtin-mcp" viewBox="0 0 16 16">
93
+ <path fill="currentColor" d="M9.26-.04a3 3 0 0 1 2 .82 2.8 2.8 0 0 1 .8 2.35 2.9 2.9 0 0 1 2.41.8l.03.02a2.74 2.74 0 0 1 0 3.94l-5.8 5.69-.04.06-.02.07q0 .04.02.07.01.04.04.06l1.2 1.17a.55.55 0 0 1 0 .79.6.6 0 0 1-.81 0l-1.2-1.17a1.3 1.3 0 0 1 0-1.84L13.7 7.1a1.65 1.65 0 0 0 .37-1.82 2 2 0 0 0-.37-.54l-.03-.03a1.73 1.73 0 0 0-2.4 0L6.47 9.4l-.07.06a.58.58 0 0 1-.92-.18.6.6 0 0 1 .12-.6l4.85-4.76a1.65 1.65 0 0 0 0-2.36 1.73 1.73 0 0 0-2.4 0l-6.43 6.3a.6.6 0 0 1-.8 0 .55.55 0 0 1 0-.8L7.25.79a3 3 0 0 1 2-.82"/>
94
+ <path fill="currentColor" d="M9.26 2.19a.6.6 0 0 1 .52.34.6.6 0 0 1 0 .43l-.12.18L4.9 7.79a1.65 1.65 0 0 0 0 2.36 1.73 1.73 0 0 0 2.4 0l4.75-4.66a.58.58 0 0 1 .93.18.6.6 0 0 1-.12.61l-4.75 4.66a2.9 2.9 0 0 1-4.01 0 2.75 2.75 0 0 1-.62-3.04A3 3 0 0 1 4.1 7l4.74-4.65a.6.6 0 0 1 .4-.16"/>
95
+ </symbol>`,bB=`<symbol id="file-tree-builtin-nextjs" viewBox="0 0 16 16">
96
+ <defs>
97
+ <linearGradient id="a" x1="4.522" x2="14" y1="3.943" y2="16" gradientUnits="userSpaceOnUse">
98
+ <stop stop-color="currentColor"/>
99
+ <stop offset="1" stop-color="currentColor" stop-opacity="0"/>
100
+ </linearGradient>
101
+ </defs>
102
+ <path fill="currentColor" d="M3 2h1.522v9.09H3z"/>
103
+ <path fill="url(#a)" d="M4.903 2 15 15.075q-.565.5-1.195.925L4.522 3.943z"/>
104
+ <path fill="currentColor" d="M12.172 2h-1.508v9.094h1.508z"/>
105
+ </symbol>`,xB=`<symbol id="file-tree-builtin-npm" viewBox="0 0 16 16">
106
+ <path fill="currentColor" d="M2 1a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1z" class="vector" opacity=".2"/>
107
+ <path fill="currentColor" d="M10.5 13H13V3H3v10h5V5.5h2.5z"/>
108
+ </symbol>`,SB=`<symbol id="file-tree-builtin-oxc" viewBox="0 0 16 16">
109
+ <path fill="currentColor" d="M9.5 1a.5.5 0 0 1 .5.5V3h3.5a.5.5 0 0 1 .38.83L10.5 7.69v1.44q.41.04.95-.16a4 4 0 0 0 .72-.35l.04-.03h.01a.5.5 0 0 1 .67.1l2 2.5a.5.5 0 0 1 0 .62c-.76.96-3.14 2.69-6.89 2.69s-6.13-1.73-6.89-2.69a.5.5 0 0 1 0-.62l2-2.5a.5.5 0 0 1 .67-.1l.05.03.16.09q.22.13.56.26.54.2.95.16V7.69L2.12 3.83A.5.5 0 0 1 2.5 3H6V1.5a.5.5 0 0 1 .5-.5zM7 3.5a.5.5 0 0 1-.5.5H3.6l2.78 3.17a.5.5 0 0 1 .12.33v2a.5.5 0 0 1-.28.45c-.7.35-1.5.15-2.02-.05a5 5 0 0 1-.58-.26l-1.46 1.84c.82.78 2.8 2.02 5.84 2.02s5.02-1.24 5.84-2.02l-1.46-1.83a5 5 0 0 1-.58.26c-.52.2-1.33.39-2.02.04a.5.5 0 0 1-.28-.45v-2a.5.5 0 0 1 .12-.33L12.4 4H9.5a.5.5 0 0 1-.5-.5V2H7z"/>
110
+ </symbol>`,CB=`<symbol id="file-tree-builtin-postcss" viewBox="0 0 16 16">
111
+ <path fill="currentColor" d="M14.5 8a6.5 6.5 0 0 0-5.9-6.47l5.42 8.93A7 7 0 0 0 14.5 8M2.88 12A6.5 6.5 0 0 0 8 14.5c2.08 0 3.93-.98 5.12-2.5zm8.62-1h1.68L11.5 8.24zm-1-.55a4 4 0 0 1-.7.55h.7zM8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5M5.5 11h.7a4 4 0 0 1-.7-.55zm-2.68 0H4.5V8.24zm3.76-6.2A4 4 0 0 1 8 4.5q.76 0 1.42.3L8 2.46zM1.5 8q0 1.31.48 2.46L7.4 1.53A6.5 6.5 0 0 0 1.5 8m14 0a7.5 7.5 0 0 1-.99 3.72l-.01.03-.02.03A7.5 7.5 0 0 1 8 15.5a7.5 7.5 0 0 1-6.5-3.75l-.01-.03A7.5 7.5 0 1 1 15.5 8"/>
112
+ </symbol>`,wB=`<symbol id="file-tree-builtin-prettier" viewBox="0 0 16 16">
113
+ <path fill="currentColor" d="M6 12v1H4.93v-1zm1-2v1H2v-1zm6-4v1h-3V6zm-1-4v1H9V2z"/>
114
+ <path fill="currentColor" d="M11.5 10v1H8v-1zM5 6v1H2V6zm5-2v1H9V4z" opacity=".8"/>
115
+ <path fill="currentColor" d="M6 14v1H2v-1zm-.5-6v1H2V8zM13 4v1h-3V4zM4.93 2v1H2V2z" opacity=".6"/>
116
+ <path fill="currentColor" d="M4.93 12v1H2v-1zM13 8v1H9V8zM5.5 4v1H2V4zM9 2v1H4.93V2z" opacity=".4"/>
117
+ </symbol>`,TB=`<symbol id="file-tree-builtin-python" viewBox="0 0 16 16">
118
+ <path fill="currentColor" d="M8.33 8.4H10c1.16 0 1.9-.73 1.9-1.86V5.08q0-.24.25-.24h.74c.75 0 1.33.32 1.66.97q.4.73.41 1.46c.09.9.09 1.78-.24 2.67-.25.73-.75 1.3-1.58 1.46h-4.8c-.08 0-.25 0-.25.08v.4s.17.09.25.09h2.82q.34-.02.33.32v1.06c0 .56-.25.97-.75 1.13-.41.16-.83.33-1.24.4a7 7 0 0 1-2.98-.07 3 3 0 0 1-1.16-.49c-.33-.32-.58-.65-.5-1.14v-2.91c0-1.13.67-1.78 1.82-1.78q.89-.1 1.66-.08m2.32 4.86a.65.65 0 0 0-.66-.65c-.34 0-.67.33-.67.65s.33.57.67.65a.65.65 0 0 0 .66-.65" class="bg" opacity=".8"/>
119
+ <path fill="currentColor" d="M7.67 7.6H6c-1.16 0-1.9.73-1.9 1.86v1.46q0 .24-.25.24h-.74c-.75 0-1.33-.32-1.66-.97a3 3 0 0 1-.41-1.46 6 6 0 0 1 .24-2.67c.25-.73.75-1.3 1.58-1.46h4.8c.08 0 .25 0 .25-.08v-.4s-.17-.09-.25-.09H4.85c-.24 0-.33-.08-.33-.32V2.65c0-.56.25-.97.75-1.13.41-.16.83-.33 1.24-.4a7 7 0 0 1 2.98.07c.41.09.83.25 1.16.49.33.32.58.65.5 1.13v2.92c0 1.14-.67 1.78-1.82 1.78-.58.08-1.16.08-1.66.08M5.35 2.73c0 .33.25.65.66.65.33 0 .66-.32.66-.65 0-.32-.33-.56-.66-.64a.65.65 0 0 0-.66.64" class="fg"/>
120
+ </symbol>`,EB=`<symbol id="file-tree-builtin-react" viewBox="0 0 16 16">
121
+ <path fill="currentColor" d="M8 6.65c.73 0 1.31.6 1.31 1.35S8.73 9.35 8 9.35 6.69 8.75 6.69 8 7.27 6.65 8 6.65"/>
122
+ <path fill="currentColor" fill-rule="evenodd" d="M8 2.55c1.3-.99 2.59-1.34 3.5-.8.92.55 1.27 1.87 1.08 3.53C14.06 5.94 15 6.9 15 8s-.94 2.06-2.42 2.72c.19 1.65-.16 2.98-1.08 3.52-.91.55-2.2.2-3.5-.8-1.3 1-2.58 1.35-3.5.8-.91-.54-1.27-1.87-1.08-3.52C1.94 10.06 1 9.1 1 8s.94-2.06 2.42-2.72c-.19-1.66.17-2.98 1.08-3.52s2.2-.2 3.5.8M4.26 11.2c-.08 1.34.28 2.03.68 2.26s1.15.22 2.25-.52l.11-.09a12 12 0 0 1-1.24-1.39 11 11 0 0 1-1.8-.41zm7.47-.15q-.83.27-1.79.41-.6.8-1.24 1.4l.11.08c1.1.74 1.86.76 2.25.52.4-.23.76-.92.68-2.26zm-3.04.54a14 14 0 0 1-1.38 0q.34.38.69.7.35-.32.7-.7M8 5.29q-.76 0-1.47.1A13 13 0 0 0 5.07 8a14 14 0 0 0 1.46 2.62 13 13 0 0 0 2.94 0A13 13 0 0 0 10.93 8a14 14 0 0 0-1.46-2.62A13 13 0 0 0 8 5.3M4.64 9.18q-.15.5-.25.96.44.16.94.27a15 15 0 0 1-.7-1.23m6.73 0a15 15 0 0 1-.7 1.23q.5-.11.95-.27a10 10 0 0 0-.25-.96M3.44 6.26C2.27 6.86 1.87 7.53 1.87 8s.4 1.14 1.57 1.74l.13.07q.18-.88.55-1.81a12 12 0 0 1-.55-1.8q-.07.02-.13.06m8.99-.07A12 12 0 0 1 11.88 8q.36.94.55 1.8l.13-.06c1.17-.6 1.56-1.27 1.56-1.74s-.39-1.14-1.56-1.74zm-7.1-.6q-.5.11-.94.27.1.46.25.96a15 15 0 0 1 .69-1.23m5.34 0a15 15 0 0 1 .7 1.23q.14-.5.24-.96-.44-.15-.94-.27M7.18 3.06c-1.09-.74-1.85-.76-2.24-.52s-.76.92-.69 2.26l.01.15a11 11 0 0 1 1.8-.41q.6-.8 1.24-1.4zm3.88-.52c-.4-.24-1.15-.22-2.25.52l-.12.08q.65.6 1.25 1.4.96.15 1.8.41v-.14c.08-1.35-.28-2.04-.68-2.27M8 3.7a10 10 0 0 0-.7.7 14 14 0 0 1 1.4 0 10 10 0 0 0-.7-.7" clip-rule="evenodd"/>
123
+ </symbol>`,DB=`<symbol id="file-tree-builtin-ruby" viewBox="0 0 16 16">
124
+ <path fill="currentColor" fill-rule="evenodd" d="M11.04 2c.48 0 .92.23 1.18.6l2.54 3.65c.37.52.3 1.23-.15 1.69l-5.58 5.64a1.47 1.47 0 0 1-2.06 0L1.39 7.94a1.3 1.3 0 0 1-.15-1.7l2.54-3.63q.2-.3.5-.45.33-.16.68-.16zm.84 2.17a.5.5 0 0 0-.7-.05L8 6.84 4.83 4.12a.5.5 0 0 0-.65.76L6.65 7H3.5a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1H9.35l2.48-2.12a.5.5 0 0 0 .05-.7" clip-rule="evenodd"/>
125
+ </symbol>`,OB=`<symbol id="file-tree-builtin-rust" viewBox="0 0 16 16">
126
+ <path fill="currentColor" fill-rule="evenodd" d="M8 .8a.2.2 0 0 1 .18.1l.38.6.16.02.5-.53.01-.01a.2.2 0 0 1 .33.08l.25.68.16.05.59-.43h.02a.2.2 0 0 1 .3.14l.12.71.15.08.65-.3a.2.2 0 0 1 .2.02.2.2 0 0 1 .1.18l-.03.72.12.1.71-.16a.2.2 0 0 1 .25.25l-.17.7q.06.06.1.13l.73-.03A.2.2 0 0 1 14 4a.2.2 0 0 1 .02.2l-.3.66.08.14.71.12a.2.2 0 0 1 .14.32l-.43.59.05.16.68.25a.2.2 0 0 1 .07.35l-.53.49.01.16.62.38a.2.2 0 0 1 0 .36l-.62.38-.01.16.53.5a.2.2 0 0 1-.07.34l-.68.25-.05.16.43.59a.2.2 0 0 1-.14.32l-.72.12-.07.15.3.65a.2.2 0 0 1-.02.2.2.2 0 0 1-.18.1l-.72-.03-.1.13.16.7a.2.2 0 0 1-.25.25l-.7-.17-.13.1.03.73a.2.2 0 0 1-.1.18.2.2 0 0 1-.2.02l-.66-.3-.14.08-.12.71a.2.2 0 0 1-.32.14l-.59-.43-.16.05-.25.68a.2.2 0 0 1-.34.07l-.5-.53-.16.01-.38.62a.2.2 0 0 1-.36 0l-.38-.62-.16-.01-.5.53a.2.2 0 0 1-.34-.07l-.25-.68-.16-.05-.59.43a.2.2 0 0 1-.32-.14L5 13.78l-.15-.07-.65.3a.2.2 0 0 1-.2-.02.2.2 0 0 1-.1-.18l.03-.72-.13-.1-.7.16a.2.2 0 0 1-.25-.25l.17-.7-.1-.13-.73.03a.2.2 0 0 1-.2-.3l.3-.66-.08-.14-.71-.12a.2.2 0 0 1-.14-.32l.43-.59-.05-.16-.68-.25A.2.2 0 0 1 1 9.22l.53-.5-.02-.16-.6-.38A.2.2 0 0 1 .8 8a.2.2 0 0 1 .1-.18l.6-.38.02-.16-.53-.5a.2.2 0 0 1 .07-.34l.68-.25.05-.16-.43-.59a.2.2 0 0 1 .14-.32L2.2 5l.08-.15L2 4.2a.2.2 0 0 1 .2-.3l.72.03.1-.13-.16-.7a.2.2 0 0 1 .25-.25l.7.16.13-.1-.03-.72A.2.2 0 0 1 4 2a.2.2 0 0 1 .2-.02l.65.3L5 2.2l.12-.71v-.03a.2.2 0 0 1 .32-.1l.59.41.16-.04.25-.68.01-.02A.2.2 0 0 1 6.8.99l.49.53.16-.02.38-.61.02-.02A.2.2 0 0 1 8 .79M6.8 9.45h1.26l.06.01q.03.01.03.05v1.52q0 .07-.09.06h-4.5A5.4 5.4 0 0 0 8 13.42a5.4 5.4 0 0 0 4.45-2.33h-2.42c-.36 0-.68-.5-.77-.75-.08-.22-.2-.91-.25-1.12-.15-.61-.59-.71-.78-.73H6.8zM8 2.58a5.4 5.4 0 0 0-4.07 1.85h5.74l.17.02c.23.03.6.12.96.35.34.23.83.68.83 1.4 0 .66-.55 1.16-1.08 1.5.42.33.7.53.86 1.44.04.17.34.32.62.29.29-.03.62-.16.62-.75v-.24q0-.1.07-.1h.68A5.43 5.43 0 0 0 8 2.59M2.96 6.03a5.4 5.4 0 0 0-.19 3.37h1.66V6.03zM6.8 7.06h1.66c.35 0 .77-.12.77-.47 0-.42-.55-.53-.65-.53H6.8z" clip-rule="evenodd"/>
127
+ </symbol>`,kB=`<symbol id="file-tree-builtin-sass" viewBox="0 0 16 16">
128
+ <path fill="currentColor" fill-rule="evenodd" d="M8.08 1.44c2.41-.91 4.96-.37 5.35 1.27.39 1.62-.92 3.56-2.6 4.25a5 5 0 0 1-3.26.35c-.58-.2-.92-.62-1-.85-.03-.09-.09-.24 0-.3.05-.03.08-.02.22.15s.7.6 1.75.48c2.78-.34 4.45-2.64 3.92-3.88-.37-.87-2.5-1.26-5.18.16C4.03 4.81 3.85 6.24 3.82 6.8c-.08 1.5 1.73 2.28 2.7 3.4q.04.03.07.08c.3-.12.7-.19 1.35-.2 1.58-.03 2.47 1.08 2.43 2.08-.03.78-.7 1.1-.82 1.13-.1.01-.14.02-.15-.06q-.03-.06.13-.15c.16-.09.42-.3.48-.72.05-.43-.24-1.44-1.76-1.63a3 3 0 0 0-1.33.08c.27.62.32 1.87-.29 2.83-.63 1-1.8 1.61-2.93 1.27-.37-.1-.93-.92-.45-2.05.46-1.07 2.4-2.12 2.66-2.26-.9-.83-3.08-1.95-3.4-3.65-.08-.49.13-1.65 1.46-2.98a12 12 0 0 1 4.11-2.52m-1.88 9.7c-.01.01-.9.47-1.52 1.17-.59.66-.75 1.48-.43 1.69.3.18 1-.04 1.51-.62a3 3 0 0 0 .5-.9q.2-.64.02-1.39z" clip-rule="evenodd"/>
129
+ </symbol>`,AB=`<symbol id="file-tree-builtin-stylelint" viewBox="0 0 16 16">
130
+ <path fill="currentColor" d="M4 3v3.5l1.5-1L7 15 .5 6l1-1.5L0 3l2.5-2h1zm12 0-1.5 1.5 1 1.5L9 15l1.5-9.5 1.5 1V3l.5-2h1zm-8 8.5a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1m0-3a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1m0-3a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1"/>
131
+ <path fill="currentColor" d="M6.5 2.5V4l-2 1.5v-4zm5 3L9.5 4V2.5l2-1zM9 4H7V2.5h2z"/>
132
+ </symbol>`,jB=`<symbol id="file-tree-builtin-svelte" viewBox="0 0 16 16">
133
+ <path fill="currentColor" d="m3.98 3.7 3.36-2.08a4.5 4.5 0 0 1 5.9 1.23 4 4 0 0 1 .7 3.02q-.16.75-.58 1.4c.42.77.56 1.66.4 2.52a3.7 3.7 0 0 1-1.57 2.4l-.17.1-3.36 2.09a4.5 4.5 0 0 1-5.9-1.23 4 4 0 0 1-.66-1.44 4 4 0 0 1-.04-1.58 4 4 0 0 1 .58-1.4 4 4 0 0 1-.4-2.52 3.7 3.7 0 0 1 1.57-2.4zl3.36-2.08zm7.87 0a2.7 2.7 0 0 0-1.26-.95 2.7 2.7 0 0 0-1.6-.07 3 3 0 0 0-.52.2l-.16.09-3.36 2.08a2 2 0 0 0-.69.64 2 2 0 0 0-.36.86 2.3 2.3 0 0 0 .42 1.81A2.7 2.7 0 0 0 7.18 9.4q.28-.06.53-.2l.16-.09 1.28-.79.2-.09a.8.8 0 0 1 .87.31.7.7 0 0 1 .13.55.7.7 0 0 1-.24.4l-.08.05-3.36 2.08-.2.09a1 1 0 0 1-.49-.02 1 1 0 0 1-.38-.3 1 1 0 0 1-.13-.37v-.1l.01-.13-.13-.03a4 4 0 0 1-1.1-.5l-.2-.14-.18-.12-.07.18-.08.3a2.3 2.3 0 0 0 .43 1.82q.45.64 1.19.93.73.28 1.51.14l.16-.04q.27-.07.52-.2l.16-.09 3.36-2.08q.4-.25.69-.64.27-.4.36-.86a2.3 2.3 0 0 0-.42-1.82 2.7 2.7 0 0 0-1.27-.95 2.7 2.7 0 0 0-1.6-.08q-.27.07-.52.2l-.16.1-1.28.79-.2.09a1 1 0 0 1-.49-.03 1 1 0 0 1-.38-.29.7.7 0 0 1-.13-.54.7.7 0 0 1 .24-.4l.08-.06L9.33 4.4l.2-.1a.8.8 0 0 1 .87.32 1 1 0 0 1 .13.38v.22l.11.04q.6.18 1.12.5l.2.14.17.12.06-.19.08-.3a2.3 2.3 0 0 0-.42-1.81z"/>
134
+ </symbol>`,MB=`<symbol id="file-tree-builtin-svg" viewBox="0 0 16 16">
135
+ <path fill="currentColor" d="M5 7a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2z"/>
136
+ <path fill="currentColor" d="M6 1a5 5 0 0 1 4.58 3H7a3 3 0 0 0-3 3v3.58A5 5 0 0 1 6 1" opacity=".5"/>
137
+ </symbol>`,NB=`<symbol id="file-tree-builtin-svgo" viewBox="0 0 16 16">
138
+ <path fill="currentColor" d="M9.43 4.8A.6.6 0 1 1 9.19 6l-.56.96a1.2 1.2 0 0 1 .32 1.58l.7.53a.89.89 0 1 1-.17.22l-.7-.52a1.2 1.2 0 0 1-1.4.25l-.56.87a.75.75 0 1 1-.57-.2 1 1 0 0 1 .32.05l.56-.87a1.2 1.2 0 0 1-.4-1.24l-1.2-.47a.56.56 0 1 1 .1-.28v.02l1.2.47a1.2 1.2 0 0 1 1.56-.55l.56-.97a.6.6 0 0 1-.15-.64.6.6 0 0 1 .63-.4"/>
139
+ <path fill="currentColor" fill-rule="evenodd" d="M9.17 1q.16.63.27 1.26a6 6 0 0 1 1.61.67q.52-.38 1.08-.71l1.65 1.64q-.32.56-.68 1.05.48.78.72 1.67.6.09 1.18.25v2.32q-.55.15-1.11.24a6 6 0 0 1-.7 1.82q.31.44.59.91l-1.65 1.65-.85-.55a6 6 0 0 1-1.9.83q-.08.47-.2.95H6.84q-.12-.46-.2-.93a6 6 0 0 1-1.96-.81q-.39.27-.8.51l-1.65-1.65q.25-.43.53-.84a6 6 0 0 1-.75-1.9L1 9.16V6.83q.54-.14 1.09-.24a6 6 0 0 1 .77-1.74q-.33-.47-.63-.98l1.65-1.65q.54.32 1.03.68a6 6 0 0 1 1.66-.66q.1-.61.26-1.24zM7.96 3.73a4 4 0 0 0-1.74.36 4.5 4.5 0 0 0-2.3 2.3 4.4 4.4 0 0 0-.1 3.29l.03.06a4.4 4.4 0 0 0 2.4 2.47 4.4 4.4 0 0 0 3.48-.02l.03-.02a4.4 4.4 0 0 0 2.3-2.42l.06-.14a4.4 4.4 0 0 0-.2-3.4 4.4 4.4 0 0 0-2.13-2.07L9.47 4a4 4 0 0 0-1.51-.27" clip-rule="evenodd"/>
140
+ </symbol>`,PB=`<symbol id="file-tree-builtin-swift" viewBox="0 0 16 16">
141
+ <path fill="currentColor" d="M9.63 1c6.15 4.35 4.16 9.15 4.16 9.15s1.75 2.05 1.04 3.85c0 0-.72-1.26-1.93-1.26-1.17 0-1.85 1.26-4.2 1.26C3.47 14 1 9.46 1 9.46c4.71 3.22 7.93.94 7.93.94C6.8 9.12 2.29 3 2.29 3c3.93 3.47 5.63 4.39 5.63 4.39-1.01-.87-3.86-5.13-3.86-5.13C6.34 4.66 10.86 8 10.86 8c1.28-3.7-1.23-7-1.23-7"/>
142
+ </symbol>`,FB=`<symbol id="file-tree-builtin-table" viewBox="0 0 16 16">
143
+ <path fill="currentColor" d="M8 4a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1H8z" class="bg" opacity=".4"/>
144
+ <path fill="currentColor" d="M11.5 8a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-7a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 .5-.5zM5 12h2.5v-1H5zm3.5 0H11v-1H8.5zM5 10h2.5V9H5zm3.5 0H11V9H8.5zm1-9a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z" class="fg"/>
145
+ </symbol>`,IB=`<symbol id="file-tree-builtin-tailwind" viewBox="0 0 16 16">
146
+ <path fill="currentColor" fill-rule="evenodd" d="M8 4Q5.2 4 4.5 6.67q1.05-1.34 2.45-1c.53.12.91.5 1.33.9C8.98 7.23 9.77 8 11.5 8q2.8 0 3.5-2.67-1.05 1.34-2.45 1c-.53-.12-.91-.5-1.33-.9C10.52 4.77 9.73 4 8 4M4.5 8Q1.7 8 1 10.67q1.05-1.34 2.45-1c.53.12.91.5 1.33.9C5.48 11.23 6.26 12 8 12q2.8 0 3.5-2.67-1.05 1.34-2.45 1c-.53-.12-.91-.5-1.33-.9C7.02 8.77 6.24 8 4.5 8" clip-rule="evenodd"/>
147
+ </symbol>`,LB=`<symbol id="file-tree-builtin-terraform" viewBox="0 0 16 16">
148
+ <path fill="currentColor" d="M1 0v5.05l4.35 2.53V2.53zm9.18 5.34L5.83 2.82v5.05l4.35 2.53zm.47 5.06V5.34L15 2.82v5.05zm-.48 5.6-4.35-2.53V8.42l4.35 2.53z"/>
149
+ </symbol>`,RB=`<symbol id="file-tree-builtin-text" viewBox="0 0 16 16">
150
+ <path fill="currentColor" fill-rule="evenodd" d="M8 4a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1H8z" class="bg" clip-rule="evenodd" opacity=".4"/>
151
+ <path fill="currentColor" d="M8.5 11a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1zm2-2a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1zm-1-8a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z"/>
152
+ </symbol>`,zB=`<symbol id="file-tree-builtin-typescript" viewBox="0 0 16 16">
153
+ <path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
154
+ <path fill="currentColor" d="M8.1 9.64h.95c.04.62.28.76 1.28.76s1.2-.14 1.2-.85c0-.66-.2-.85-1.2-1.07-1.79-.38-2.18-.7-2.18-1.86C8.15 5.3 8.54 5 10.31 5c1.67 0 2.04.26 2.07 1.42h-.95c-.02-.43-.23-.53-1.1-.53-1 0-1.22.14-1.22.74 0 .52.22.7 1.24.92 1.76.38 2.15.73 2.15 2 0 1.44-.4 1.75-2.24 1.75-1.8 0-2.18-.3-2.15-1.66m-3 1.57V5.99H3.5v-.9h4.21v.9H6.1v5.22z"/>
155
+ </symbol>`,BB=`<symbol id="file-tree-builtin-vite" viewBox="0 0 16 16">
156
+ <path fill="currentColor" d="M8.57 14.87c-.18.26-.55.11-.55-.22v-3.18l-.05-.27-.13-.22-.2-.15-.24-.06H4.29c-.26 0-.4-.32-.26-.55L6.08 7c.3-.46 0-1.1-.5-1.1H1.8c-.25 0-.4-.32-.25-.56l2.65-4.2A.3.3 0 0 1 4.46 1h7.9c.26 0 .4.32.26.55l-2.05 3.23c-.29.46 0 1.1.5 1.1h3.12c.26 0 .4.34.24.57z"/>
157
+ </symbol>`,VB=`<symbol id="file-tree-builtin-vscode" viewBox="0 0 16 16">
158
+ <path fill="currentColor" d="m5.11 9.68-2.4 1.84a.6.6 0 0 1-.75-.04l-.77-.7a.6.6 0 0 1 0-.87L3.28 8zm5.52-8.42a.51.51 0 0 1 .87.36V4.8L7.32 8 5.1 6.32z" opacity=".75"/>
159
+ <path fill="currentColor" d="M11.1 14.99h.03zM1.96 4.52a.6.6 0 0 1 .75-.04l8.8 6.71v3.19a.51.51 0 0 1-.88.36L1.19 6.1a.6.6 0 0 1 0-.87z" opacity=".65"/>
160
+ <path fill="currentColor" d="M11.62 14.91a.9.9 0 0 1-1-.17.51.51 0 0 0 .88-.36V1.62a.51.51 0 0 0-.87-.36.9.9 0 0 1 1-.17l2.87 1.39a.9.9 0 0 1 .5.8v9.44a.9.9 0 0 1-.5.8z"/>
161
+ </symbol>`,HB=`<symbol id="file-tree-builtin-vue" viewBox="0 0 16 16">
162
+ <path fill="currentColor" d="M9.62 2.25 8 5.02 6.38 2.25H1l7 12 7-12z" opacity=".5"/>
163
+ <path fill="currentColor" d="M9.54 2.25 8 4.95l-1.54-2.7H4l4 7 4-7z"/>
164
+ </symbol>`,UB=`<symbol id="file-tree-builtin-wasm" viewBox="0 0 16 16">
165
+ <path fill="currentColor" d="M13 1a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h3a2 2 0 1 0 4 0z" class="subtract" opacity=".2"/>
166
+ <path fill="currentColor" d="M4.64 11.4h.02l.8-3.4h.91l.73 3.45L7.88 8h.96l-1.25 5h-.97L5.9 9.6 5.1 13h-1L3 8h.98z"/>
167
+ <path fill="currentColor" fill-rule="evenodd" d="M13 13h-1.02l-.33-1.11H9.9L9.64 13h-.97l1.26-5h1.54zm-2.49-3.77-.42 1.84h1.32l-.49-1.84z" clip-rule="evenodd"/>
168
+ </symbol>`,WB=`<symbol id="file-tree-builtin-webpack" viewBox="0 0 16 16">
169
+ <path fill="currentColor" d="M14.1 11.79 8.26 15v-2.5l3.64-1.94zm.4-.35V4.73l-2.14 1.2v4.3zm-12.6.35L7.74 15v-2.5L4.1 10.56zm-.4-.35V4.73l2.14 1.2v4.3zm.25-7.15 6-3.29v2.42L3.9 5.47l-.03.01zm12.5 0L8.25 1v2.42l3.85 2.05.03.01z" class="bg" opacity=".4"/>
170
+ <path fill="currentColor" d="m7.74 11.93-3.59-1.92v-3.8l3.6 2.02zm.52 0 3.59-1.92v-3.8l-3.6 2.02zM4.4 5.77 8 3.85l3.6 1.93L8 7.8z" class="fg"/>
171
+ </symbol>`,GB=`<symbol id="file-tree-builtin-yml" viewBox="0 0 16 16">
172
+ <path fill="currentColor" d="M7.5 2A1.5 1.5 0 0 1 9 3.5v3A1.5 1.5 0 0 1 7.5 8h-2v2A1.5 1.5 0 0 0 7 11.5v-1A1.5 1.5 0 0 1 8.5 9h5a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1-1.5 1.5h-5A1.5 1.5 0 0 1 7 13.5v-1A2.5 2.5 0 0 1 4.5 10V8h-2A1.5 1.5 0 0 1 1 6.5v-3A1.5 1.5 0 0 1 2.5 2zm1 8a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h5a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5zm-6-7a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h5a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5z"/>
173
+ </symbol>`,KB=`<symbol id="file-tree-builtin-zig" viewBox="0 0 16 16">
174
+ <path fill="currentColor" d="m14.73 1.5-7.29 8.82h4.17l-1.73 2.04H5.76L1.27 14.5l7.3-8.91H4.39l1.73-2.05h4.12z"/>
175
+ <path fill="currentColor" d="M5.21 3.54 3.56 5.6h-.55v4.73h.83L2.1 12.36H1V3.54zm9.79 0v8.82h-4.3l1.74-2.04h.55V5.68h-.83l1.74-2.14z"/>
176
+ </symbol>`,qB=[Zz,nB,iB,aB,oB,sB,uB,dB,fB,mB,hB,gB,_B,vB,yB,TB,DB,OB,PB,FB,RB,zB,`<symbol id="file-tree-builtin-zip" viewBox="0 0 16 16">
177
+ <path fill="currentColor" d="M4.585 2a2 2 0 0 1 1.028.285l1.788 1.072a1 1 0 0 0 .514.143H12A2 2 0 0 1 13.935 5H0V4a2 2 0 0 1 2-2z" class="bg" opacity=".5"/>
178
+ <path fill="currentColor" fill-rule="evenodd" d="M14 12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-1.25h1v-1H0V6h14zM9.9 8.25c-.883 0-1.9.5-1.9.5H7v1h1v1s1.017.5 1.9.5c.884 0 1.6-.672 1.6-1.5s-.716-1.5-1.6-1.5M2 9.75v1h1v-1zm2 0v1h1v-1zm2 0v1h1v-1zm-5-1v1h1v-1zm2 0v1h1v-1zm2 0v1h1v-1z" class="fg" clip-rule="evenodd"/>
179
+ </symbol>`],JB=[Yz,Xz,Qz,$z,eB,tB,rB,cB,lB,pB,bB,xB,SB,CB,wB,EB,kB,AB,jB,MB,NB,IB,LB,BB,VB,HB,UB,WB,GB,KB];function YB(e,t){return t.length===0?e:e.replace(`</svg>`,`\n ${t.join(`
180
+ `)}\n</svg>`)}var XB=YB(Jz,qB),ZB={minimal:Jz,standard:XB,complete:YB(XB,JB)},QB={".babelrc":`babel`,".babelrc.json":`babel`,".bash_profile":`bash`,".bashrc":`bash`,".browserslistrc":`browserslist`,".dockerignore":`docker`,".eslintignore":`eslint`,".eslintrc":`eslint`,".eslintrc.cjs":`eslint`,".eslintrc.js":`eslint`,".eslintrc.json":`eslint`,".eslintrc.yaml":`eslint`,".eslintrc.yml":`eslint`,".gitattributes":`git`,".gitignore":`git`,".gitkeep":`git`,".gitmodules":`git`,".oxlintrc.json":`oxc`,".postcssrc":`postcss`,".postcssrc.json":`postcss`,".postcssrc.yaml":`postcss`,".postcssrc.yml":`postcss`,".prettierignore":`prettier`,".prettierrc":`prettier`,".prettierrc.cjs":`prettier`,".prettierrc.js":`prettier`,".prettierrc.json":`prettier`,".prettierrc.mjs":`prettier`,".prettierrc.toml":`prettier`,".prettierrc.yaml":`prettier`,".prettierrc.yml":`prettier`,".stylelintignore":`stylelint`,".stylelintrc":`stylelint`,".stylelintrc.cjs":`stylelint`,".stylelintrc.js":`stylelint`,".stylelintrc.json":`stylelint`,".stylelintrc.mjs":`stylelint`,".stylelintrc.yaml":`stylelint`,".stylelintrc.yml":`stylelint`,".terraform.lock.hcl":`terraform`,".zprofile":`bash`,".zshenv":`bash`,".zshrc":`bash`,"babel.config.cjs":`babel`,"babel.config.js":`babel`,"babel.config.json":`babel`,"babel.config.mjs":`babel`,"biome.json":`biome`,"biome.jsonc":`biome`,"bootstrap.bundle.js":`bootstrap`,"bootstrap.bundle.min.js":`bootstrap`,"bootstrap.css":`bootstrap`,"bootstrap.js":`bootstrap`,"bootstrap.min.css":`bootstrap`,"bootstrap.min.js":`bootstrap`,"bun.lock":`bun`,"bun.lockb":`bun`,"bunfig.toml":`bun`,"claude.md":`claude`,"compose.yaml":`docker`,"compose.yml":`docker`,"docker-compose.override.yml":`docker`,"docker-compose.yaml":`docker`,"docker-compose.yml":`docker`,dockerfile:`docker`,"eslint.config.cjs":`eslint`,"eslint.config.js":`eslint`,"eslint.config.mjs":`eslint`,"eslint.config.mts":`eslint`,"eslint.config.ts":`eslint`,gemfile:`ruby`,"next.config.js":`nextjs`,"next.config.mjs":`nextjs`,"next.config.mts":`nextjs`,"next.config.ts":`nextjs`,"postcss.config.cjs":`postcss`,"postcss.config.js":`postcss`,"postcss.config.mjs":`postcss`,"postcss.config.ts":`postcss`,"prettier.config.cjs":`prettier`,"prettier.config.js":`prettier`,"prettier.config.mjs":`prettier`,rakefile:`ruby`,"readme.md":`markdown`,"stylelint.config.cjs":`stylelint`,"stylelint.config.js":`stylelint`,"stylelint.config.mjs":`stylelint`,"svgo.config.cjs":`svgo`,"svgo.config.js":`svgo`,"svgo.config.mjs":`svgo`,"svgo.config.ts":`svgo`,"tailwind.config.cjs":`tailwind`,"tailwind.config.js":`tailwind`,"tailwind.config.mjs":`tailwind`,"tailwind.config.ts":`tailwind`,"vite.config.js":`vite`,"vite.config.mjs":`vite`,"vite.config.mts":`vite`,"vite.config.ts":`vite`,"webpack.config.babel.js":`webpack`,"webpack.config.cjs":`webpack`,"webpack.config.js":`webpack`,"webpack.config.mjs":`webpack`,"webpack.config.ts":`webpack`},$B={"7z":`zip`,astro:`astro`,AUTHORS:`text`,avif:`image`,bash:`bash`,bmp:`image`,bz2:`zip`,c:`c`,cc:`cpp`,cfg:`text`,CHANGELOG:`text`,cjs:`javascript`,"code-workspace":`vscode`,conf:`text`,CONTRIBUTORS:`text`,cpp:`cpp`,csh:`bash`,css:`css`,csv:`table`,cts:`typescript`,cxx:`cpp`,db:`database`,editorconfig:`text`,env:`text`,"env.development":`text`,"env.local":`text`,"env.production":`text`,eot:`font`,erb:`ruby`,fish:`bash`,gemspec:`ruby`,gif:`image`,go:`go`,gql:`graphql`,graphql:`graphql`,gz:`zip`,h:`c`,hh:`cpp`,hpp:`cpp`,htm:`html`,html:`html`,hxx:`cpp`,icns:`image`,ico:`image`,ini:`text`,inl:`cpp`,jar:`zip`,jpeg:`image`,jpg:`image`,js:`javascript`,json:`json`,json5:`json`,jsonc:`json`,jsonl:`json`,jsx:`javascript`,ksh:`bash`,less:`css`,LICENSE:`text`,log:`text`,markdown:`markdown`,mcp:`mcp`,md:`markdown`,mdx:`markdown`,"mdx.tsx":`markdown`,mjs:`javascript`,mm:`cpp`,mts:`typescript`,ods:`table`,otf:`font`,png:`image`,postcss:`css`,py:`python`,pyi:`python`,pyw:`python`,pyx:`python`,rake:`ruby`,rar:`zip`,rb:`ruby`,rs:`rust`,rst:`text`,rtf:`text`,sass:`css`,scss:`css`,sh:`bash`,sql:`database`,sqlite:`database`,sqlite3:`database`,styl:`css`,svelte:`svelte`,svg:`svg`,swift:`swift`,tar:`zip`,tf:`terraform`,tfstate:`terraform`,tfvars:`terraform`,tgz:`zip`,tif:`image`,tiff:`image`,ts:`typescript`,tsv:`table`,tsx:`typescript`,ttf:`font`,txt:`text`,vue:`vue`,war:`zip`,wasm:`wasm`,wast:`wasm`,wat:`wasm`,webp:`image`,woff:`font`,woff2:`font`,xhtml:`html`,xls:`table`,xlsx:`table`,xz:`zip`,yaml:`yml`,yml:`yml`,zig:`zig`,zip:`zip`,zsh:`bash`},eV={jsx:`react`,sass:`sass`,scss:`sass`,tsx:`react`},tV=new Set([`bash`,`c`,`cpp`,`css`,`database`,`default`,`font`,`git`,`go`,`html`,`image`,`javascript`,`json`,`markdown`,`mcp`,`python`,`ruby`,`rust`,`swift`,`table`,`text`,`typescript`,`zip`]),nV=new Set([`complete`]);function rV(e){return ZB[e===`none`?`minimal`:e]}function iV(e){return`file-tree-builtin-${e}`}function aV(e){return e!==`none`&&nV.has(e)}function oV(e,t,n){if(e===`minimal`||e===`none`)return;let r=e===`complete`,i=QB[t.toLowerCase()];if(i!=null&&(r||tV.has(i)))return i;for(let e of n){if(r){let t=eV[e];if(t!=null)return t}let t=$B[e];if(t!=null&&(r||tV.has(t)))return t}return`default`}var sV=`file-tree-container`,cV=`data-file-tree-style`,lV=`data-file-tree-unsafe-css`,uV=`data-file-tree-scrollbar-measure`,dV=`data-file-tree-scrollbar-gutter-measured`,fV=`--trees-scrollbar-gutter-measured`,pV=`header`,mV=`context-menu`,hV=`context-menu-trigger`;function gV(e){return e.spriteSheet!=null||e.remap!=null||e.byFileName!=null||e.byFileExtension!=null||e.byFileNameContains!=null}function _V(e){return e==null?{set:`complete`,colored:!0}:typeof e==`string`?{set:e,colored:!0}:{...e,set:e.set??(gV(e)?`none`:`complete`),colored:e.colored??!0}}var vV=e=>e.trim().toLowerCase(),yV=e=>e.split(`/`).at(-1)??e,bV=e=>{let t=e.toLowerCase().split(`.`),n=[];for(let e=1;e<t.length;e+=1)n.push(t.slice(e).join(`.`));return n};function xV(e,t){return typeof e==`string`?{name:e,remappedFrom:t}:{...e,remappedFrom:t}}function SV(e){let t=_V(e),n=t.remap,r=new Map;for(let[e,n]of Object.entries(t.byFileName??{}))r.set(e.toLowerCase(),n);let i=new Map;for(let[e,n]of Object.entries(t.byFileExtension??{}))i.set(vV(e),n);let a=Object.entries(t.byFileNameContains??{}).map(([e,t])=>[e.toLowerCase(),t]);return{resolveIcon:(e,o)=>{if(e===`file-tree-icon-file`&&o!=null){let n=yV(o),s=n.toLowerCase(),c=r.get(s);if(c!=null)return xV(c,e);for(let[t,n]of a)if(s.includes(t))return xV(n,e);let l=bV(n);for(let t of l){let n=i.get(t);if(n!=null)return xV(n,e)}let u=oV(t.set,n,l);if(u!=null&&t.set!==`none`)return{name:iV(u),remappedFrom:e,token:u}}let s=n?.[e];return s==null?{name:e}:xV(s,e)}}}var CV=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,wV=/^0(?:\.0+)?%?$/;function TV(e){let t=e.indexOf(`(`);if(t<=0||!e.endsWith(`)`))return;let n=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(n))return;let r=e.slice(t+1,-1).trim();if(r.length===0)return;let i=r.lastIndexOf(`/`);if(i!==-1)return r.slice(i+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){let e=r.split(`,`);if(e.length===4)return e[3]?.trim()}}function EV(e){if(e==null)return!1;let t=e.trim().toLowerCase();if(t===`transparent`||CV.test(t))return!0;let n=TV(t);return n!=null&&wV.test(n)}function DV(e){return EV(e)?void 0:e}function OV(e){let t=e.colors??{},n=t[`sideBar.background`]??t[`editor.background`]??e.bg,r=t[`sideBar.foreground`]??t[`editor.foreground`]??e.fg,i=t[`sideBar.border`],a=t[`list.activeSelectionForeground`]??t[`sideBar.foreground`],o=n?.toLowerCase(),s=t[`list.hoverBackground`],c=s?.toLowerCase()===o?void 0:s,l=t[`list.activeSelectionBackground`],u=l?.toLowerCase()===o?t[`list.focusBackground`]??t[`editor.selectionBackground`]:l??t[`editor.selectionBackground`],d=DV(t[`list.focusOutline`])??DV(t.focusBorder),f=t[`input.background`]??n,p=t[`input.border`],m=t[`scrollbarSlider.background`],h=t[`sideBarSectionHeader.foreground`]??r,g=t[`gitDecoration.addedResourceForeground`]??t[`terminal.ansiGreen`]??t[`editorGutter.addedBackground`],_=t[`gitDecoration.modifiedResourceForeground`]??t[`terminal.ansiBlue`]??t[`editorGutter.modifiedBackground`],v=t[`gitDecoration.deletedResourceForeground`]??t[`terminal.ansiRed`]??t[`editorGutter.deletedBackground`],y=e.type===`dark`,b={colorScheme:y?`dark`:`light`,backgroundColor:n??``,color:r??``,borderColor:`var(--trees-theme-sidebar-border, light-dark(oklch(0% 0 0 / 0.15), oklch(100% 0 0 / 0.15)))`,"--trees-theme-sidebar-bg":n??``,"--trees-theme-sidebar-fg":r??``,"--trees-theme-sidebar-header-fg":h??``,"--trees-theme-list-active-selection-fg":a??r??``,"--trees-theme-list-hover-bg":c??(y?`rgba(255,255,255,0.08)`:`rgba(0,0,0,0.06)`),"--trees-theme-list-active-selection-bg":u??`transparent`,"--trees-theme-focus-ring":d??r??``,"--trees-theme-input-bg":f??``};return i!=null&&i!==``&&(b[`--trees-theme-sidebar-border`]=i),p!=null&&p!==``&&(b[`--trees-theme-input-border`]=p),m!=null&&m!==``&&(b[`--trees-theme-scrollbar-thumb`]=m),g!=null&&g!==``&&(b[`--trees-theme-git-added-fg`]=g),_!=null&&_!==``&&(b[`--trees-theme-git-modified-fg`]=_),v!=null&&v!==``&&(b[`--trees-theme-git-deleted-fg`]=v),b}var kV=5,AV=1<<kV,jV=AV*4;function MV(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function NV(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function PV(e,t){if(t.childIdByNameId!=null)return t.childIdByNameId;let n=new Map;for(let r of t.childIds){let t=e[r];t!=null&&n.set(t.nameId,r)}return t.childIdByNameId=n,n}function FV(e){if(e.childPositionById!=null)return e.childPositionById;let t=new Map;for(let n=0;n<e.childIds.length;n++){let r=e.childIds[n];r!=null&&t.set(r,n)}return e.childPositionById=t,t}function IV(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function LV(e,t){if(e.childPositionById!=null)for(let n=t;n<e.childIds.length;n++){let t=e.childIds[n];t!=null&&e.childPositionById.set(t,n)}}function RV(e,t){let n=0,r=0;for(let i of t.childIds){let t=e[i];t!=null&&(n+=t.subtreeNodeCount,r+=t.visibleSubtreeCount)}t.totalChildSubtreeNodeCount=n,t.totalChildVisibleSubtreeCount=r,HV(e,t)}function zV(e,t,n,r){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=r,e.childVisibleChunkSums==null||r===0)return;let i=FV(e).get(t);if(i===void 0)return;let a=i>>kV;e.childVisibleChunkSums[a]+=r}function BV(e,t,n){let r=t.childVisibleChunkSums;if(r!=null){let i=n,a=0;for(let o of r){if(i<o){let r=UV(e,t,a,i);return{...r,childVisibleIndex:n-r.localVisibleIndex}}i-=o,a+=AV}throw Error(`Visible child index ${String(n)} is out of range`)}let i=n;for(let r=0;r<t.childIds.length;r++){let a=t.childIds[r];if(a==null)continue;let o=e[a];if(o!=null){if(i<o.visibleSubtreeCount)return{childIndex:r,childVisibleIndex:n-i,localVisibleIndex:i};i-=o.visibleSubtreeCount}}throw Error(`Visible child index ${String(n)} is out of range`)}function VV(e,t,n){let r=0,i=t.childVisibleChunkSums,a=0;if(i!=null){let e=n>>kV;for(let t=0;t<e;t+=1)r+=i[t]??0;a=e<<kV}for(let i=a;i<n;i+=1){let n=t.childIds[i];if(n==null)continue;let a=e[n];a!=null&&(r+=a.visibleSubtreeCount)}return r}function HV(e,t){if(t.childIds.length<jV){t.childVisibleChunkSums=null;return}let n=Math.ceil(t.childIds.length/AV),r=new Int32Array(n);for(let n=0;n<t.childIds.length;n++){let i=t.childIds[n];if(i==null)continue;let a=e[i];a!=null&&(r[n>>kV]+=a.visibleSubtreeCount)}t.childVisibleChunkSums=r}function UV(e,t,n,r){let i=Math.min(t.childIds.length,n+AV),a=r;for(let r=n;r<i;r++){let n=t.childIds[r];if(n==null)continue;let i=e[n];if(i!=null){if(a<i.visibleSubtreeCount)return{childIndex:r,localVisibleIndex:a};a-=i.visibleSubtreeCount}}throw Error(`Visible child index ${String(r)} is out of range`)}var WV=7,GV=3,KV=1<<GV,qV=4;function JV(e,t,n=0){return e<<qV|n<<GV|t}function YV(e){return e.depthAndFlags>>>qV}function XV(e){return(e.depthAndFlags&KV)>>GV}function ZV(e){return(e.depthAndFlags&KV)!==0}function QV(e){return e.depthAndFlags&WV}function $V(e,t){return(QV(e)&t)!==0}function eH(e,t){e.depthAndFlags|=t}function tH(e,t){e.depthAndFlags=JV(t,QV(e),XV(e))}var nH=Symbol(`benchmarkInstrumentation`);function rH(e,t){return t==null||Object.defineProperty(e,nH,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function iH(e){return e==null?null:e[nH]??null}function aH(e,t,n){return e==null?n():e.measurePhase(t,n)}function oH(e,t,n){!Number.isFinite(n)||e==null||e.setCounter(t,n)}function sH(e){return e>=48&&e<=57}function cH(e){let t=[],n=0,r=0;for(;r<e.length;){for(;r<e.length&&!sH(e.charCodeAt(r));)r+=1;if(r>=e.length)break;r>n&&t.push(e.slice(n,r));let i=0;for(;r<e.length&&sH(e.charCodeAt(r));)i=i*10+(e.charCodeAt(r)-48),r+=1;t.push(i),n=r}return(n<e.length||t.length===0)&&t.push(e.slice(n)),t}function lH(e){let t=e.toLowerCase();return{lowerValue:t,tokens:cH(t)}}function uH(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++){let n=e[r],i=t[r];if(n===i)continue;if(typeof n==`number`&&typeof i==`number`)return n<i?-1:1;let a=String(n),o=String(i);if(a!==o)return a<o?-1:1}return e.length===t.length?0:e.length<t.length?-1:1}function dH(e,t){if(e.tokens.length===1&&t.tokens.length===1&&typeof e.tokens[0]==`string`&&typeof t.tokens[0]==`string`)return e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1;let n=uH(e.tokens,t.tokens);return n===0?e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1:n}function fH(e,t,n){let r=dH(n(e),n(t));return r===0?e===t?0:e<t?-1:1:r}function pH(e,t){return fH(e,t,lH)}function mH(e,t){return t===e.segments.length-1?+!!e.isDirectory:1}function hH(e,t){let n=Math.min(e.segments.length,t.segments.length);for(let r=0;r<n;r++){let n=e.segments[r],i=t.segments[r];if(n===i)continue;let a=mH(e,r);return a===mH(t,r)?pH(n,i):a===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function gH(e,t){return hH(e,t)}function _H(e,t,n){let r=e=>{let t=n.get(e);if(t!=null)return t;let r=lH(e);return n.set(e,r),r},i=Math.min(e.segments.length,t.segments.length);for(let n=0;n<i;n++){let i=e.segments[n],a=t.segments[n];if(i===a)continue;let o=mH(e,n);return o===mH(t,n)?fH(i,a,r):o===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function vH(e,t){let n=e.sortKeyById[t];if(n!==void 0)return n;let r=e.valueById[t],i=lH(r);return e.sortKeyById[t]=i,i}function yH(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??`default`}}function bH(e){let t=e.length>0&&e.charCodeAt(e.length-1)===47,n=t?e.length-1:e.length,r=[],i=0;for(let t=0;t<n;t++)e.charCodeAt(t)===47&&(r.push(e.slice(i,t)),i=t+1);return r.push(e.slice(i,n)),{hasTrailingSlash:t,segments:r}}function xH(e){let{hasTrailingSlash:t,segments:n}=bH(e);return{basename:n[n.length-1]??``,isDirectory:t,path:e,segments:n}}function SH(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};let{hasTrailingSlash:t,segments:n}=bH(e);return{requiresDirectory:t,segments:n}}var CH=``;function wH(){let e=new Map;return e.set(CH,0),{idByValue:e,valueById:[CH],sortKeyById:[lH(CH)]}}function TH(e,t){let n=e.idByValue.get(t);if(n!==void 0)return n;let r=e.valueById.length;return e.idByValue.set(t,r),e.valueById.push(t),r}function EH(e,t){let n=e.valueById[t];if(n===void 0)throw Error(`Unknown segment ID: ${String(t)}`);return n}var DH=Symbol(`pathStorePreparedInputKind`);function OH(e,t){return e[DH]=t,e}function kH(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function AH(e,t,n){return n===`default`?gH(e,t):n(kH(e),kH(t))}function jH(){return{depthAndFlags:JV(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function MH(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return r;return n}function NH(e){return e.isDirectory?e.segments.length:e.segments.length-1}function PH(e){return Array.isArray(e)&&e.every(e=>typeof e==`object`&&!!e&&typeof e.path==`string`&&Array.isArray(e.segments)&&typeof e.basename==`string`&&typeof e.isDirectory==`boolean`)}function FH(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function IH(e,t={}){return HH(e,t).map(e=>e.path)}function LH(e,t={}){let n=HH(e,t);return OH({paths:n.map(e=>e.path),preparedPaths:n},`prepared`)}function RH(e){let t=e.length,n=!1;for(let r=0;r<t;r+=1){let t=e[r];if(t.length>0&&t.charCodeAt(t.length-1)===47){n=!0;break}}return OH({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},`presorted`)}function zH(e){let t=e,n=t.preparedPaths;if(t[DH]===`prepared`&&n!=null)return n;if(!PH(n))throw Error(`preparedInput must come from PathStore.prepareInput()`);return n}function BH(e){let t=e;return t[DH]===`presorted`&&t.presortedPaths!=null||FH(t.presortedPaths)?t.presortedPaths:null}function VH(e){let t=e;return typeof t.presortedPathsContainDirectories==`boolean`?t.presortedPathsContainDirectories:null}function HH(e,t={}){let n=yH(t),r=iH(t);oH(r,`workload.inputFiles`,e.length);let i=aH(r,`store.preparePathEntries.parse`,()=>e.map(e=>xH(e)));return aH(r,`store.preparePathEntries.sort`,()=>i.sort((e,t)=>AH(e,t,n.sort))),i}var UH=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[jH()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=wH();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=iH(e),this.options=yH(e);let t=e.initialExpandedPaths??null;if(t==null||t.length===0)this.initialExpandedPathSet=null;else{let e=new Set,n=t.length;for(let r=0;r<n;r+=1){let n=t[r],i=n.length;e.add(i>0&&n.charCodeAt(i-1)===47?n.slice(0,i-1):n)}this.initialExpandedPathSet=e,this.createdDirectoriesAllExpanded=!0}this.directories.set(0,MV())}appendPaths(e){return aH(this.instrumentation,`store.builder.appendPaths.parse`,()=>this.appendPreparedPaths(e.map(e=>xH(e))))}appendPreparedPaths(e,t=!0){return this.createdDirectoriesAllExpanded=!1,aH(this.instrumentation,`store.builder.appendPreparedPaths`,()=>{for(let n of e)this.appendPreparedPath(n,t)}),this}appendPresortedPaths(e,t=null){return aH(this.instrumentation,`store.builder.appendPresortedPaths`,()=>{if(t===!1){this.appendPresortedFilePaths(e);return}this.createdDirectoriesAllExpanded=!1;let n=null,r=0,i=this.nodes,a=this.segmentTable,o=a.idByValue,s=a.valueById,c=this.directoryStack,l=0,u=``,d=0;for(let t of e){if(n===t)throw Error(`Duplicate path: "${t}"`);let e=t.length>0&&t.charCodeAt(t.length-1)===47,a=e?t.length-1:t.length,f=0,p=0;if(n!=null)if(u.length>0&&t.length>u.length&&t.startsWith(u))f=d,p=u.length;else{let r=Math.min(a,n.length),i=!0;for(let e=0;e<r;e++){let r=t.charCodeAt(e);if(r!==n.charCodeAt(e)){i=!1;break}r===47&&(f++,p=e+1)}i&&e&&r===a&&n.length>a&&n.charCodeAt(a)===47&&(f++,p=a+1)}l=f,r=f;let m=p,h=t.indexOf(`/`,m);for(;h>=0&&h<a;){let e=c[l];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);r++;let n=t.slice(m,h),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n));let u=i.length;i.push({depthAndFlags:JV(r,0,1),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(t.slice(0,h)),l++,c[l]=u,m=h+1,h=t.indexOf(`/`,m)}if(e){if(m<a){let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory parent for "${t}"`);r++;let n=t.slice(m,a),u=o.get(n);u===void 0&&(u=s.length,o.set(n,u),s.push(n));let d=i.length;i.push({depthAndFlags:JV(r,0,1),nameId:u,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),l++,c[l]=d}let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory node for "${t}"`);this.promoteDirectoryToExplicit(e,t)}else{let e=c[l];if(e===void 0)throw Error(`Unable to resolve file parent for "${t}"`);let n=t.slice(m),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n)),i.push({depthAndFlags:JV(r+1,0),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1})}m!==u.length&&(u=t.substring(0,m),d=r),n=t}c.length=l+1,n!=null&&(this.lastPreparedPath=xH(n)),this.hasDeferredDirectoryIndexes=!0}),this}appendPresortedFilePaths(e){let t=null,n=0,r=this.nodes,i=this.segmentTable,a=i.idByValue,o=i.valueById,s=this.directoryStack,c=0,l=``,u=0;for(let i of e){if(t===i)throw Error(`Duplicate path: "${i}"`);let e=i.length,d=0,f=0;if(t!=null)if(l.length>0&&i.length>l.length&&i.startsWith(l))d=u,f=l.length;else{let n=Math.min(e,t.length);for(let e=0;e<n;e++){let n=i.charCodeAt(e);if(n!==t.charCodeAt(e))break;n===47&&(d++,f=e+1)}}c=d,n=d;let p=f,m=i.indexOf(`/`,p);for(;m>=0;){let e=s[c];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);n++;let t=i.slice(p,m),l=a.get(t);l===void 0&&(l=o.length,a.set(t,l),o.push(t));let u=r.length;r.push({depthAndFlags:JV(n,0,1),nameId:l,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(i.slice(0,m)),this.presortedDirectoryNodeIds.push(u),c++,s[c]=u,p=m+1,m=i.indexOf(`/`,p)}let h=s[c];if(h===void 0)throw Error(`Unable to resolve file parent for "${i}"`);let g=i.slice(p),_=a.get(g);_===void 0&&(_=o.length,a.set(g,_),o.push(g)),r.push({depthAndFlags:JV(n+1,0),nameId:_,parentId:h,subtreeNodeCount:1,visibleSubtreeCount:1}),p!==l.length&&(l=i.substring(0,p),u=n),t=i}s.length=c+1,t!=null&&(this.lastPreparedPath=xH(t)),this.hasDeferredDirectoryIndexes=!0}finish(e={}){let t=e.skipSubtreeCountPass===!0;return this.hasDeferredDirectoryIndexes?(aH(this.instrumentation,`store.builder.buildDirectoryIndexes`,()=>this.buildPresortedFinish(t)),this.hasDeferredDirectoryIndexes=!1):t||aH(this.instrumentation,`store.builder.computeSubtreeCounts`,()=>this.computeSubtreeCounts(0)),{directories:this.directories,nodes:this.nodes,options:this.options,rootId:0,segmentTable:this.segmentTable,presortedDirectoryNodeIds:this.presortedDirectoryNodeIds.length>0?this.presortedDirectoryNodeIds:null}}didMatchAllInitialExpandedPaths(){return this.createdDirectoriesAllExpanded&&this.initialExpandedPathSet!=null&&this.createdDirectoryCount===this.initialExpandedPathSet.size}appendPreparedPath(e,t){if(this.hasDeferredDirectoryIndexes&&=(this.buildDirectoryIndexes(),!1),this.lastPreparedPath!=null){if(e.path===this.lastPreparedPath.path)throw Error(`Duplicate path: "${e.path}"`);if(t&&(this.options.sort===`default`?_H(this.lastPreparedPath,e,this.segmentSortKeyCache):AH(this.lastPreparedPath,e,this.options.sort))>0)throw Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}let n=this.lastPreparedPath,r=NH(e),i=n==null?0:NH(n),a=n==null?0:MH(n.segments,e.segments),o=Math.min(a,r,i);this.directoryStack.length=o+1;for(let n=o;n<r;n++){let r=this.directoryStack[this.directoryStack.length-1];if(r===void 0)throw Error(`Directory stack underflow while building the path store`);let i=t?this.getOrCreateDirectoryChild(r,e.segments[n]):this.createDirectoryChild(r,e.segments[n]);this.directoryStack.push(i)}if(e.isDirectory){let t=this.directoryStack[this.directoryStack.length-1];if(t===void 0)throw Error(`Unable to resolve directory node for "${e.path}"`);this.promoteDirectoryToExplicit(t,e.path),this.lastPreparedPath=e;return}let s=this.directoryStack[this.directoryStack.length-1];if(s===void 0)throw Error(`Unable to resolve file parent for "${e.path}"`);t?this.createFileChild(s,e.basename,e.path):this.createFileChildUnchecked(s,e.basename),this.lastPreparedPath=e}recordCreatedDirectoryPath(e){!this.createdDirectoriesAllExpanded||this.initialExpandedPathSet==null||(this.createdDirectoryCount+=1,this.initialExpandedPathSet.has(e)||(this.createdDirectoriesAllExpanded=!1))}createFileChild(e,t,n){let r=TH(this.segmentTable,t),i=this.getDirectoryIndex(e),a=i.childIdByNameId;if(a!=null&&a.get(r)!==void 0)throw Error(`Path collides with an existing entry: "${n}"`);let o=this.nodes[e];if(o===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let s=this.nodes.length;return this.nodes.push({depthAndFlags:JV(YV(o)+1,0),nameId:r,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),a?.set(r,s),IV(i,s),s}createFileChildUnchecked(e,t){let n=TH(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:JV(YV(i)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),IV(r,a),a}getOrCreateDirectoryChild(e,t){let n=TH(this.segmentTable,t),r=this.getDirectoryIndex(e);if(r.childIdByNameId!=null){let e=r.childIdByNameId.get(n);if(e!==void 0){let n=this.nodes[e];if(n!=null&&!ZV(n))throw Error(`Path collides with an existing file while creating directory "${t}"`);return e}}let i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:JV(YV(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),IV(r,a),this.directories.set(a,MV()),a}createDirectoryChild(e,t){let n=TH(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:JV(YV(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),IV(r,a),this.directories.set(a,MV()),a}promoteDirectoryToExplicit(e,t){let n=this.nodes[e];if(n===void 0)throw Error(`Unknown directory node ID: ${String(e)}`);if(!ZV(n))throw Error(`Path is not a directory: "${t}"`);if($V(n,1))throw Error(`Duplicate path: "${t}"`);eH(n,1)}getDirectoryIndex(e){let t=this.directories.get(e);if(t!==void 0)return t;throw Error(`Unknown directory child index for node ${String(e)}`)}buildPresortedFinish(e){let t=this.nodes,n=this.directories;n.set(0,NV());let r=-1,i=null;for(let e=1;e<t.length;e++){let a=t[e];if(a==null)continue;if(ZV(a)){let t=NV();n.set(e,t),r=e,i=t}let o;a.parentId===r?o=i:(o=n.get(a.parentId),r=a.parentId,i=o??null),o?.childIds.push(e)}if(!e)for(let e=t.length-1;e>=1;e--){let n=t[e];if(n==null)continue;let r=t[n.parentId];r!=null&&(r.subtreeNodeCount+=n.subtreeNodeCount,r.visibleSubtreeCount+=n.visibleSubtreeCount)}}buildDirectoryIndexes(){let e=this.nodes;for(let t=1;t<e.length;t++){let n=e[t];if(n==null)continue;ZV(n)&&this.directories.set(t,MV());let r=this.directories.get(n.parentId);r!=null&&(r.childIdByNameId!=null&&r.childIdByNameId.set(n.nameId,t),IV(r,t))}}computeSubtreeCounts(e){let t=this.nodes[e];if(t===void 0)throw Error(`Unknown node ID: ${String(e)}`);if(!ZV(t))return t.subtreeNodeCount=1,t.visibleSubtreeCount=1,1;let n=this.getDirectoryIndex(e),r=1;for(let e of n.childIds)r+=this.computeSubtreeCounts(e);return RV(this.nodes,n),t.subtreeNodeCount=r,t.visibleSubtreeCount=r,r}};function WH(e,t=`closed`,n=null){let r=KH(t);return{activeNodeCount:e.nodes.length-1,collapsedDirectoryIds:new Set,collapseNewDirectoriesByDefault:!1,defaultExpansion:r,directoriesOpenByDefault:r===`open`,hasCollapsedDirectoryOverrides:!1,directoryLoadInfoById:new Map,expandedDirectoryIds:new Set,instrumentation:n,listeners:new Map,pathCacheByNodeId:new Map([[e.rootId,{path:``,version:0}]]),pathCacheVersion:0,snapshot:e,transactionStack:[]}}function GH(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function KH(e){if(typeof e!=`number`)return e;if(!Number.isInteger(e)||e<0)throw Error(`initialExpansion must be "open", "closed", or a non-negative integer depth. Received: ${String(e)}`);return e}function qH(e,t){return $V(t,2)||e.defaultExpansion===`open`?!0:e.defaultExpansion===`closed`?!1:YV(t)<=e.defaultExpansion}function JH(e,t,n=e.snapshot.nodes[t]){return n==null||!ZV(n)?!1:e.directoriesOpenByDefault&&!e.hasCollapsedDirectoryOverrides?!0:e.collapsedDirectoryIds.has(t)?!1:e.expandedDirectoryIds.has(t)?!0:qH(e,n)}function YH(e,t,n,r=e.snapshot.nodes[t]){if(r==null||!ZV(r))return;let i=qH(e,r);if(n){if(i){e.collapsedDirectoryIds.delete(t),e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0;return}e.expandedDirectoryIds.add(t);return}if(i){e.collapsedDirectoryIds.add(t),e.hasCollapsedDirectoryOverrides=!0;return}e.expandedDirectoryIds.delete(t)}function XH(e,t){let n=e.directoryLoadInfoById.get(t);if(n!=null)return n;let r={activeAttemptId:null,errorMessage:null,nextAttemptId:1,state:`loaded`};return e.directoryLoadInfoById.set(t,r),r}function ZH(e,t){return e.directoryLoadInfoById.get(t)?.state??`loaded`}function QH(e,t){let n=XH(e,t);if(n.state===`loading`&&n.activeAttemptId!=null)return{attemptId:n.activeAttemptId,nodeId:t,reused:!0};let r=n.nextAttemptId;return n.activeAttemptId=r,n.errorMessage=null,n.nextAttemptId+=1,n.state=`loading`,{attemptId:r,nodeId:t,reused:!1}}function $H(e,t){let n=XH(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state=`unloaded`}function eU(e,t,n){let r=e.directoryLoadInfoById.get(t);return r==null||r.activeAttemptId!==n?!1:(r.activeAttemptId=null,r.errorMessage=null,r.state=`loaded`,!0)}function tU(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function nU(e,t,n,r){let i=e.directoryLoadInfoById.get(t);return i==null||i.activeAttemptId!==n?!1:(i.activeAttemptId=null,i.errorMessage=r??null,i.state=`error`,!0)}function rU(e,t){e.directoryLoadInfoById.delete(t)}function iU(e,t,n){let r=n,i=e.listeners.get(t);return i==null?e.listeners.set(t,new Set([r])):i.add(r),()=>{let n=e.listeners.get(t);n!=null&&(n.delete(r),n.size===0&&e.listeners.delete(t))}}function aU(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`add`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function oU(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`remove`,path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function sU(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:`move`,projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function cU(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`expand`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function lU(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`collapse`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function uU(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`mark-directory-unloaded`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function dU(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`begin-child-load`,path:e.path,projectionChanged:e.projectionChanged,reused:e.reused,visibleCountDelta:null}}function fU(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:e.childEvents.some(e=>e.canonicalChanged),childEvents:e.childEvents,operation:`apply-child-patch`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function pU(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`complete-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function mU(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,errorMessage:e.errorMessage,operation:`fail-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function hU(e){return{activeNodeCountAfter:e.activeNodeCountAfter,activeNodeCountBefore:e.activeNodeCountBefore,affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],cachedPathEntryCountAfter:e.cachedPathEntryCountAfter,cachedPathEntryCountBefore:e.cachedPathEntryCountBefore,canonicalChanged:!1,idsPreserved:e.idsPreserved,loadInfoEntryCountAfter:e.loadInfoEntryCountAfter,loadInfoEntryCountBefore:e.loadInfoEntryCountBefore,mode:e.mode,operation:`cleanup`,projectionChanged:e.projectionChanged,reclaimedCachedPathEntryCount:e.reclaimedCachedPathEntryCount,reclaimedLoadInfoEntryCount:e.reclaimedLoadInfoEntryCount,reclaimedNodeSlotCount:e.reclaimedNodeSlotCount,reclaimedSegmentCount:e.reclaimedSegmentCount,segmentCountAfter:e.segmentCountAfter,segmentCountBefore:e.segmentCountBefore,totalNodeSlotCountAfter:e.totalNodeSlotCountAfter,totalNodeSlotCountBefore:e.totalNodeSlotCountBefore,visibleCountDelta:null}}function gU(e,t,n){return{...n,visibleCountDelta:DU(e)-t}}function _U(e,t){let n=DU(e),r=GH();e.transactionStack.push(r);try{t()}catch(t){throw bU(e,r,!1),t}bU(e,r,!0,DU(e)-n)}function vU(e,t){let n=e.instrumentation;if(n==null){yU(e,t);return}aH(n,`store.events.record`,()=>yU(e,t))}function yU(e,t){let n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){TU(e,t);return}n.events.push(t),wU(n,t)}function bU(e,t,n,r=null){if(e.transactionStack.pop()!==t)throw Error(`Transaction stack underflow`);if(!n)return;let i=e.transactionStack[e.transactionStack.length-1]??null;if(i!=null){let n=e.instrumentation;n==null?CU(i,t):aH(n,`store.events.batch.merge`,()=>CU(i,t));return}let a=xU(t,r),o=e.instrumentation;if(o==null){TU(e,a);return}aH(o,`store.events.batch.commit`,()=>TU(e,a))}function xU(e,t){return{affectedAncestorIds:[...e.affectedAncestorIds],affectedNodeIds:[...e.affectedNodeIds],canonicalChanged:e.events.some(e=>e.canonicalChanged),events:[...e.events],operation:`batch`,projectionChanged:e.events.some(e=>e.projectionChanged),visibleCountDelta:t}}function SU(e,t){for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function CU(e,t){for(let n of t.events)e.events.push(n);SU(e,t)}function wU(e,t){for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function TU(e,t){let n=e.instrumentation;if(n==null){EU(e,t);return}aH(n,`store.events.emit`,()=>EU(e,t))}function EU(e,t){e.listeners.get(t.operation)?.forEach(e=>e(t)),e.listeners.get(`*`)?.forEach(e=>e(t))}function DU(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function OU(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;let n=e.snapshot.nodes[t];if(n==null||!ZV(n)||$V(n,2))return null;let r=e.snapshot.directories.get(t);if(r==null||r.childIds.length!==1)return null;let i=r.childIds[0];if(i==null)return null;let a=e.snapshot.nodes[i];return a==null||!ZV(a)?null:i}function kU(e,t){let n=t;for(;;){let t=OU(e,n);if(t==null)return n;n=t}}function AU(e,t){let n=[t],r=t;for(;;){let t=OU(e,r);if(t==null)return n;n.push(t),r=t}}function jU(e,t){let n=t==null?e.snapshot.rootId:VU(e,t);return n==null?[]:GU(e,n)}function MU(e,t){let n=xH(t),r=n.isDirectory?n.segments:n.segments.slice(0,-1),i=oW(e,aW(e,r)),{createdNodeIds:a,directoryId:o}=KU(e,r),s=new Set(a),c=o;if(n.isDirectory){let n=WU(e,o);if($V(n,1))throw Error(`Path already exists: "${t}"`);eH(n,1),e.pathCacheByNodeId.set(o,{path:t,version:e.pathCacheVersion}),s.add(o)}else c=JU(e,o,n.basename),s.add(c);RU(e,o);let l=oW(e,o);return aU({affectedAncestorIds:BU(e,c),affectedNodeIds:[...s],path:t,projectionChanged:sW(i,l)})}function NU(e,t,n){let r=VU(e,t);if(r==null)throw Error(`Path does not exist: "${t}"`);let i=WU(e,r);if($V(i,2))throw Error(`The root node cannot be removed`);if(ZV(i)&&UU(e,r).childIds.length>0&&n.recursive!==!0)throw Error(`Cannot remove a non-empty directory without recursive: "${t}"`);let a=i.parentId,o=oW(e,a),s=rW(e,r);ZU(e,a,r,i.nameId),iW(e,a),RU(e,a);let c=oW(e,a);return oU({affectedAncestorIds:BU(e,a),affectedNodeIds:s,path:t,projectionChanged:sW(o,c),recursive:n.recursive===!0})}function PU(e,t,n,r){let i=VU(e,t);if(i==null)throw Error(`Source path does not exist: "${t}"`);let a=WU(e,i);if($V(a,2))throw Error(`The root node cannot be moved`);let o=r.collision??`error`,s=tW(e,i,n),c=oW(e,a.parentId),l=oW(e,s.parentId),u=EH(e.snapshot.segmentTable,a.nameId),d=TH(e.snapshot.segmentTable,s.basename);if(s.parentId===a.parentId&&u===s.basename)return null;if(ZV(a)&&dW(e,i,s.parentId))throw Error(`Cannot move a directory into one of its descendants`);let f=PV(e.snapshot.nodes,UU(e,s.parentId)).get(d),p=s.existingNodeId??f??null;if(p!=null&&p!==i&&nW(e,p,o,XV(a))===`skip`)return null;let m=a.parentId;ZU(e,m,i,a.nameId),a.parentId=s.parentId,a.nameId=d,e.pathCacheByNodeId.delete(i),uW(e,i),XU(e,s.parentId,i),iW(e,m),e.pathCacheVersion++,RU(e,m),s.parentId!==m&&RU(e,s.parentId);let h=oW(e,m),g=oW(e,s.parentId);return sU({affectedAncestorIds:[...new Set([...BU(e,m),...BU(e,s.parentId)])],affectedNodeIds:[i],from:t,projectionChanged:cW([c,l],[h,g]),to:LU(e,i)})}function FU(e,t){let n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function IU(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function LU(e,t){let n=WU(e,t),r=FU(e,t);if(r!=null)return r;if($V(n,2))return IU(e,t,``);let i=LU(e,n.parentId),a=EH(e.snapshot.segmentTable,n.nameId),o=i.length===0?a:`${i}${a}`;return IU(e,t,ZV(n)?`${o}/`:o)}function RU(e,t){let n=e.instrumentation;if(n==null){pW(e,t);return}aH(n,`store.recomputeCountsUpwardFrom`,()=>pW(e,t))}function zU(e,t){let n=[[t,0]],{nodes:r,directories:i}=e.snapshot;for(;n.length>0;){let t=n[n.length-1],a=t[0],o=r[a];if(o==null||!ZV(o)){fW(e,a,o,!0),n.pop();continue}let s=i.get(a);if(s==null||t[1]>=s.childIds.length){fW(e,a,o,!0),n.pop();continue}let c=s.childIds[t[1]++];n.push([c,0])}}function BU(e,t){let n=[],r=t;for(;r!=null;){let t=WU(e,r);if(n.push(r),r===e.snapshot.rootId)break;r=t.parentId}return n}function VU(e,t){if(t.length===0)return e.snapshot.rootId;let n=SH(t);return HU(e,n.segments,n.requiresDirectory)}function HU(e,t,n){let r=e.snapshot.rootId;for(let n of t){let t=e.snapshot.segmentTable.idByValue.get(n);if(t===void 0)return null;let i=UU(e,r),a=PV(e.snapshot.nodes,i).get(t);if(a===void 0)return null;r=a}let i=WU(e,r);return n&&!ZV(i)?null:r}function UU(e,t){let n=e.snapshot.directories.get(t);if(n===void 0)throw Error(`Unknown directory child index for node ${String(t)}`);return n}function WU(e,t){let n=e.snapshot.nodes[t];if(n===void 0||$V(n,4))throw Error(`Unknown node ID: ${String(t)}`);return n}function GU(e,t){let n=e.snapshot.nodes[t];if(n===void 0||$V(n,4))return[];if(!ZV(n))return[LU(e,t)];if(UU(e,t).childIds.length===0)return $V(n,1)&&!$V(n,2)?[LU(e,t)]:[];let r=[],i=[{childIndex:0,nodeId:t}];for(;i.length>0;){let t=i[i.length-1];if(t==null)break;let n=e.snapshot.nodes[t.nodeId];if(n===void 0||$V(n,4)){i.pop();continue}if(!ZV(n)){r.push(LU(e,t.nodeId)),i.pop();continue}let a=UU(e,t.nodeId);if(a.childIds.length===0){$V(n,1)&&!$V(n,2)&&r.push(LU(e,t.nodeId)),i.pop();continue}let o=a.childIds[t.childIndex];if(o==null){i.pop();continue}t.childIndex++,i.push({childIndex:0,nodeId:o})}return r}function KU(e,t){let n=[],r=e.snapshot.rootId;for(let i of t){let t=TH(e.snapshot.segmentTable,i),a=UU(e,r),o=PV(e.snapshot.nodes,a).get(t);if(o!==void 0){if(!ZV(WU(e,o)))throw Error(`Cannot create a directory that collides with an existing file: "${i}"`);r=o;continue}r=qU(e,r,t),n.push(r)}return{createdNodeIds:n,directoryId:r}}function qU(e,t,n){let r=WU(e,t),i=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:JV(YV(r)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(i,MV()),XU(e,t,i),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(i),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,i}function JU(e,t,n){let r=TH(e.snapshot.segmentTable,n),i=UU(e,t);if(PV(e.snapshot.nodes,i).has(r))throw Error(`Path already exists: "${hW(e,t,n)}"`);let a=WU(e,t),o=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:JV(YV(a)+1,0),nameId:r,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),XU(e,t,o),e.activeNodeCount++,o}function YU(e,t,n){let r=0,i=t.childIds.length;for(;r<i;){let a=r+i>>>1,o=t.childIds[a];if(o==null){i=a;continue}QU(e,n,o)<0?i=a:r=a+1}return r}function XU(e,t,n){let r=UU(e,t),i=WU(e,n);PV(e.snapshot.nodes,r).set(i.nameId,n),zV(r,n,i.subtreeNodeCount,i.visibleSubtreeCount);let a=YU(e,r,n);r.childIds.splice(a,0,n),LV(r,a),HV(e.snapshot.nodes,r)}function ZU(e,t,n,r){let i=UU(e,t),a=FV(i),o=a.get(n)??-1;PV(e.snapshot.nodes,i).delete(r),a.delete(n);let s=e.snapshot.nodes[n];s!=null&&zV(i,n,-s.subtreeNodeCount,-s.visibleSubtreeCount),o>=0&&(i.childIds.splice(o,1),LV(i,o),HV(e.snapshot.nodes,i))}function QU(e,t,n){let r=e.snapshot.options.sort;return r===`default`?$U(e,t,n):r(eW(e,t),eW(e,n))}function $U(e,t,n){let r=WU(e,t),i=WU(e,n),a=ZV(r);if(a!==ZV(i))return a?-1:1;let o=dH(vH(e.snapshot.segmentTable,r.nameId),vH(e.snapshot.segmentTable,i.nameId));if(o!==0)return o;let s=EH(e.snapshot.segmentTable,r.nameId),c=EH(e.snapshot.segmentTable,i.nameId);return s===c?t<n?-1:1:s<c?-1:1}function eW(e,t){let n=WU(e,t),r=LU(e,t),i=ZV(n),a=i?r.slice(0,-1):r;return{basename:EH(e.snapshot.segmentTable,n.nameId),depth:YV(n),isDirectory:i,path:r,segments:a.length===0?[]:a.split(`/`)}}function tW(e,t,n){let r=WU(e,t),i=VU(e,n);if(i!=null){let t=WU(e,i);if(ZV(t))return{basename:EH(e.snapshot.segmentTable,r.nameId),existingNodeId:null,parentId:i};let a=SH(n).segments;return{basename:a[a.length-1]??``,existingNodeId:i,parentId:t.parentId}}let a=SH(n),o=a.segments[a.segments.length-1]??``,s=a.segments.slice(0,-1),c=s.length===0?e.snapshot.rootId:HU(e,s,!0);if(c==null)throw Error(`Destination parent does not exist: "${n}"`);return{basename:o,existingNodeId:null,parentId:c}}function nW(e,t,n,r){if(n===`skip`)return`skip`;if(n===`error`)throw Error(`Destination already exists: "${LU(e,t)}"`);let i=WU(e,t);if(XV(i)!==r)throw Error(`replace collision requires the same source and destination kinds`);if(ZV(i)&&UU(e,t).childIds.length>0)throw Error(`replace collision does not support non-empty directories`);let a=i.parentId,o=i.nameId;return rW(e,t),ZU(e,a,t,o),iW(e,a),RU(e,a),`handled`}function rW(e,t){let n=[],r=[{nodeId:t,visitedChildren:!1}];for(;r.length>0;){let t=r.pop();if(t==null)break;let i=WU(e,t.nodeId);if(t.visitedChildren||!ZV(i)){ZV(i)&&e.snapshot.directories.delete(t.nodeId),eH(i,4),e.pathCacheByNodeId.delete(t.nodeId),e.collapsedDirectoryIds.delete(t.nodeId)&&(e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0),e.expandedDirectoryIds.delete(t.nodeId),rU(e,t.nodeId),e.activeNodeCount--,n.push(t.nodeId);continue}r.push({nodeId:t.nodeId,visitedChildren:!0});let a=UU(e,t.nodeId);for(let e=a.childIds.length-1;e>=0;e--){let t=a.childIds[e];t!=null&&r.push({nodeId:t,visitedChildren:!1})}}return n}function iW(e,t){let n=t;for(;n!=null;){let t=WU(e,n);if(!ZV(t)||$V(t,2)||UU(e,n).childIds.length>0)return;eH(t,1),n=t.parentId===n?null:t.parentId}}function aW(e,t){let n=e.snapshot.rootId;for(let r of t){let t=e.snapshot.segmentTable.idByValue.get(r);if(t==null)break;let i=PV(e.snapshot.nodes,UU(e,n)).get(t);if(i==null||!ZV(WU(e,i)))break;n=i}return n}function oW(e,t){let n=lW(e,t);if(n==null)return null;let r=kU(e,n),i=WU(e,r),a=n===r?null:AU(e,n).map(t=>LU(e,t));return JSON.stringify({flattenedSegmentPaths:a,hasChildren:UU(e,r).childIds.length>0,path:LU(e,r),terminalKind:XV(i)})}function sW(e,t){return cW([e],[t])}function cW(e,t){for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(r==null||i==null||r!==i)return!0}return!1}function lW(e,t){let n=t;for(;n!=null;){let t=WU(e,n);if(!ZV(t)||$V(t,2))return null;if(!JH(e,n,t))return n;n=t.parentId}return null}function uW(e,t){let n=WU(e,t);if(tH(n,(t===e.snapshot.rootId?-1:YV(WU(e,n.parentId)))+1),!ZV(n))return;let r=UU(e,t);for(let t of r.childIds)uW(e,t)}function dW(e,t,n){let r=n;for(;r!=null;){if(r===t)return!0;let n=WU(e,r);if(r===e.snapshot.rootId)return!1;r=n.parentId}return!1}function fW(e,t,n=WU(e,t),r=!1){let i=e.instrumentation;if(i==null){mW(e,t,n,r);return}aH(i,`store.recomputeNodeCounts`,()=>mW(e,t,n,r))}function pW(e,t){let n=t;for(;n!=null;){let t=WU(e,n),r=t.subtreeNodeCount,i=t.visibleSubtreeCount;if(fW(e,n,t),n===e.snapshot.rootId)return;let a=t.subtreeNodeCount-r,o=t.visibleSubtreeCount-i,s=t.parentId;(a!==0||o!==0)&&zV(UU(e,s),n,a,o),n=s}}function mW(e,t,n,r){if(!ZV(n)){n.subtreeNodeCount=1,n.visibleSubtreeCount=1;return}let i=UU(e,t);if(r){let t=e.instrumentation;t==null?RV(e.snapshot.nodes,i):aH(t,`store.recomputeNodeCounts.rebuildChildAggregates`,()=>RV(e.snapshot.nodes,i))}let a=1+i.totalChildSubtreeNodeCount,o=i.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=a,$V(n,2)){n.visibleSubtreeCount=o;return}n.visibleSubtreeCount=OU(e,t)==null?JH(e,t,n)?1+o:1:o}function hW(e,t,n){let r=LU(e,t);return r.length===0?n:`${r}${n}`}function gW(e){return e!=null&&!$V(e,4)}function _W(e,t){let n=e.snapshot.nodes[t];return!gW(n)||!ZV(n)||$V(n,2)?null:n}function vW(e){let t=0;for(let[n,r]of e.pathCacheByNodeId)r.version===e.pathCacheVersion&&gW(e.snapshot.nodes[n])&&(t+=1);return t}function yW(e){return Math.max(0,e.valueById.length-1)}function bW(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:vW(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:yW(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function xW(e,t,n,r){return{activeNodeCountAfter:r.activeNodeCount,activeNodeCountBefore:n.activeNodeCount,cachedPathEntryCountAfter:r.cachedPathEntryCount,cachedPathEntryCountBefore:n.cachedPathEntryCount,idsPreserved:t,loadInfoEntryCountAfter:r.loadInfoEntryCount,loadInfoEntryCountBefore:n.loadInfoEntryCount,mode:e,reclaimedCachedPathEntryCount:n.cachedPathEntryCount-r.cachedPathEntryCount,reclaimedLoadInfoEntryCount:n.loadInfoEntryCount-r.loadInfoEntryCount,reclaimedNodeSlotCount:n.totalNodeSlotCount-r.totalNodeSlotCount,reclaimedSegmentCount:n.segmentCount-r.segmentCount,segmentCountAfter:r.segmentCount,segmentCountBefore:n.segmentCount,totalNodeSlotCountAfter:r.totalNodeSlotCount,totalNodeSlotCountBefore:n.totalNodeSlotCount}}function SW(e){let t=[],n=[];for(let n of e.collapsedDirectoryIds)_W(e,n)!=null&&t.push(LU(e,n));for(let t of e.expandedDirectoryIds)_W(e,t)!=null&&n.push(LU(e,t));return{collapsedPaths:t,expandedPaths:n}}function CW(e){let t=[];for(let[n,r]of e.directoryLoadInfoById)_W(e,n)==null||ZH(e,n)===`loaded`||t.push({info:{activeAttemptId:null,errorMessage:r.errorMessage,nextAttemptId:r.nextAttemptId,state:r.state},path:LU(e,n)});return t}function wW(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(let n of t.expandedPaths){let t=VU(e,n);t!=null&&YH(e,t,!0,WU(e,t))}for(let n of t.collapsedPaths){let t=VU(e,n);t!=null&&YH(e,t,!1,WU(e,t))}}function TW(e,t){e.directoryLoadInfoById.clear();for(let n of t){let t=VU(e,n.path);t!=null&&_W(e,t)!=null&&e.directoryLoadInfoById.set(t,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function EW(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:``,version:e.pathCacheVersion})}function DW(e){let t=e.snapshot.segmentTable,n=wH();for(let r of e.snapshot.nodes)if(gW(r)){if($V(r,2)){r.nameId=0;continue}r.nameId=TH(n,EH(t,r.nameId))}e.snapshot.segmentTable=n}function OW(e){for(let[t,n]of e.snapshot.directories){let r=e.snapshot.nodes[t];if(!gW(r)||!ZV(r)){e.snapshot.directories.delete(t);continue}let i=n.childIds.filter(n=>{let r=e.snapshot.nodes[n];return gW(r)&&r.parentId===t});n.childIds=i,n.childIdByNameId=new Map(i.map(t=>[WU(e,t).nameId,t])),n.childPositionById=new Map(i.map((e,t)=>[e,t])),RV(e.snapshot.nodes,n)}}function kW(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){let n=e.snapshot.nodes[t];if(gW(n))break;--t}e.snapshot.nodes.length=t+1}function AW(e){let t=SW(e),n=CW(e);aH(e.instrumentation,`store.cleanup.stable.clearPathCaches`,()=>EW(e)),aH(e.instrumentation,`store.cleanup.stable.rebuildSegmentTable`,()=>DW(e)),aH(e.instrumentation,`store.cleanup.stable.rebuildDirectoryIndexes`,()=>OW(e)),aH(e.instrumentation,`store.cleanup.stable.trimTrailingRemovedNodeSlots`,()=>kW(e)),aH(e.instrumentation,`store.cleanup.stable.restoreExpansionOverrides`,()=>wW(e,t)),aH(e.instrumentation,`store.cleanup.stable.restoreDirectoryLoadInfos`,()=>TW(e,n)),aH(e.instrumentation,`store.cleanup.stable.recomputeCounts`,()=>zU(e,e.snapshot.rootId))}function jW(e){let t=SW(e),n=CW(e),r=aH(e.instrumentation,`store.cleanup.aggressive.listPaths`,()=>jU(e)),i=rH({...e.snapshot.options},e.instrumentation),a=aH(e.instrumentation,`store.cleanup.aggressive.rebuildSnapshot`,()=>{let e=new UH(i);return e.appendPaths(r),e.finish()});e.snapshot=a,e.activeNodeCount=a.nodes.length-1,e.pathCacheByNodeId=new Map([[a.rootId,{path:``,version:0}]]),e.pathCacheVersion=0,aH(e.instrumentation,`store.cleanup.aggressive.restoreExpansionOverrides`,()=>wW(e,t)),aH(e.instrumentation,`store.cleanup.aggressive.restoreDirectoryLoadInfos`,()=>TW(e,n)),aH(e.instrumentation,`store.cleanup.aggressive.recomputeCounts`,()=>zU(e,e.snapshot.rootId))}function MW(e){for(let t of e.directoryLoadInfoById.values())if(t.state===`loading`&&t.activeAttemptId!=null)return!0;return!1}function NW(e,t){let n=bW(e);t===`stable`?aH(e.instrumentation,`store.cleanup.stable`,()=>AW(e)):aH(e.instrumentation,`store.cleanup.aggressive`,()=>jW(e));let r=bW(e);return xW(t,t===`stable`,n,r)}var PW=64;function FW(e,t){let n=t+2;if(n<=e.length)return e;let r=e.length;for(;r<n;)r*=2;let i=new Int32Array(r);return i.fill(-1),i.set(e),i}function IW(e){return WU(e,e.snapshot.rootId).visibleSubtreeCount}function LW(e,t,n,r){let i=WU(e,t.terminalNodeId),a=Math.max(1,i.visibleSubtreeCount);return Math.min(r-1,n+a-1)}function RW(e,t,n,r){return{ancestorPaths:r,index:t.index,posInSet:t.posInSet,row:rG(e,t.cursor),setSize:t.setSize,subtreeEndIndex:LW(e,t.cursor,t.index,n)}}function zW(e,t,n,r,i,a){let o=UU(e,t),{childIndex:s,childVisibleIndex:c,localVisibleIndex:l}=BV(e.snapshot.nodes,o,n),u=o.childIds[s];if(u==null)throw Error(`Visible index ${String(n)} is out of range`);return BW(e,u,l,r+c,i+1,s,o.childIds.length,a)}function BW(e,t,n,r,i,a,o,s){if(!ZV(WU(e,t))){if(n===0)return{ancestors:s,cursor:{headNodeId:t,terminalNodeId:t,visibleDepth:i},index:r,posInSet:a,setSize:o};throw Error(`Visible index ${String(n)} is out of range for file`)}let c=ZW(e,t,i);if(n===0)return{ancestors:s,cursor:c,index:r,posInSet:a,setSize:o};let l=WU(e,c.terminalNodeId);if(!ZV(l)||!JH(e,c.terminalNodeId,l))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return zW(e,c.terminalNodeId,n-1,r+1,c.visibleDepth,[...s,{cursor:c,index:r,posInSet:a,setSize:o}])}function VW(e,t){let n=IW(e);if(t<0||t>=n)return null;let r=zW(e,e.snapshot.rootId,t,0,-1,[]),i=r.ancestors.map(t=>LU(e,t.cursor.terminalNodeId)),a=null;return{ancestorPaths:i,get ancestorRows(){if(a!=null)return a;let t=[],i=[];for(let a of r.ancestors){let r=RW(e,a,n,[...i]);t.push(r),i.push(r.row.path)}return a=t,a},index:r.index,posInSet:r.posInSet,row:rG(e,r.cursor),setSize:r.setSize,subtreeEndIndex:LW(e,r.cursor,r.index,n)}}function HW(e,t,n){let r=e.instrumentation,i=IW(e);if(i<=0||n<t)return[];let a=Math.max(0,Math.min(t,i-1)),o=Math.max(a,Math.min(n,i-1));if(r==null){if(a===0)return nG(e,o+1);let t=[],n=JW(e,a);for(let r=a;r<=o&&n!=null;r++){let r=rG(e,n);t.push(r),n=$W(e,n)}return t}let s=[],c=0,l=0,u=aH(r,`store.getVisibleSlice.selectFirstRow`,()=>JW(e,a));for(let t=a;t<=o&&u!=null;t++){let t=aH(r,`store.getVisibleSlice.materializeRow`,()=>rG(e,u));s.push(t),t.isFlattened&&(c++,l+=t.flattenedSegments?.length??0),u=aH(r,`store.getVisibleSlice.advanceCursor`,()=>$W(e,u))}return oH(r,`workload.visibleRowsRead`,s.length),oH(r,`workload.flattenedRowsRead`,c),oH(r,`workload.flattenedSegmentsRead`,l),s}function UW(e,t=IW(e)){let n=e.instrumentation;return n==null?tG(e,t):aH(n,`store.getVisibleTreeProjection`,()=>tG(e,t))}function WW(e){return eG(UW(e))}function GW(e,t){let n=VU(e,t);if(n==null||n===e.snapshot.rootId||ZV(WU(e,n))&&kU(e,n)!==n)return null;let r=0,i=n,{nodes:a,rootId:o}=e.snapshot;for(;i!==o;){let t=WU(e,i).parentId,n=UU(e,t),s=FV(n).get(i);if(s==null)throw Error(`Child ${String(i)} was not found in its parent index`);if(r+=VV(a,n,s),t!==o){let n=WU(e,t),a=OU(e,t);if(!JH(e,t,n)&&a!==i)return null;kU(e,t)===t&&(r+=1)}i=t}return r}function KW(e,t){let n=VU(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=WU(e,n);if(!ZV(r))throw Error(`Path is not a directory: "${t}"`);return JH(e,n,r)?null:(YH(e,n,!0,r),RU(e,n),cU({affectedAncestorIds:BU(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0}))}function qW(e,t){let n=VU(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=WU(e,n);if(!ZV(r))throw Error(`Path is not a directory: "${t}"`);return JH(e,n,r)?(YH(e,n,!1,r),RU(e,n),lU({affectedAncestorIds:BU(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0})):null}function JW(e,t){return t<0||t>=IW(e)?null:YW(e,e.snapshot.rootId,t,-1)}function YW(e,t,n,r){let i=UU(e,t),a=e.instrumentation,{childIndex:o,localVisibleIndex:s}=a==null?BV(e.snapshot.nodes,i,n):aH(a,`store.getVisibleSlice.selectChildIndex`,()=>BV(e.snapshot.nodes,i,n)),c=i.childIds[o];if(c!=null)return XW(e,c,s,r+1);throw Error(`Visible index ${String(n)} is out of range`)}function XW(e,t,n,r){if(!ZV(WU(e,t))){if(n===0)return{headNodeId:t,terminalNodeId:t,visibleDepth:r};throw Error(`Visible index ${String(n)} is out of range for file`)}let i=ZW(e,t,r);if(n===0)return i;let a=WU(e,i.terminalNodeId);if(!ZV(a)||!JH(e,i.terminalNodeId,a))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return YW(e,i.terminalNodeId,n-1,i.visibleDepth)}function ZW(e,t,n){return ZV(WU(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:kU(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:aH(e.instrumentation,`store.getVisibleSlice.flatten.resolveTerminalDirectory`,()=>kU(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function QW(e,t){let n=WU(e,t);if(!ZV(n))return!0;let r=n.parentId;return r===e.snapshot.rootId?!0:OU(e,r)!==t}function $W(e,t){let n=WU(e,t.terminalNodeId);if(ZV(n)){let r=UU(e,t.terminalNodeId);if(JH(e,t.terminalNodeId,n)&&r.childIds.length>0){let n=r.childIds[0];return n==null?null:XW(e,n,0,t.visibleDepth+1)}}let r=t.terminalNodeId,i=t.visibleDepth;for(;;){let t=WU(e,r);if(r===e.snapshot.rootId)return null;let n=t.parentId,a=UU(e,n),o=FV(a).get(r)??-1;if(o<0)throw Error(`Child ${String(r)} was not found in its parent index`);let s=a.childIds[o+1]??null;if(s!=null)return XW(e,s,0,i);QW(e,r)&&i--,r=n}}function eG(e){let t=e.paths.length,n=Array(t);for(let r=0;r<t;r+=1){let t=e.getParentIndex(r);n[r]={index:r,parentPath:t>=0?e.paths[t]??null:null,path:e.paths[r]??``,posInSet:e.posInSetByIndex[r]??0,setSize:e.setSizeByIndex[r]??0}}return{getParentIndex:e.getParentIndex,rows:n,get visibleIndexByPath(){return e.visibleIndexByPath}}}function tG(e,t){let n=Array(t),r=new Int32Array(t),i=new Int32Array(t),a=new Int32Array(t),o=new Int32Array(PW);o.fill(-1);let s=0,{nodes:c,directories:l,segmentTable:u}=e.snapshot,d=[[l.get(e.snapshot.rootId),0,-1,``]],f=e.snapshot.options.flattenEmptyDirectories,p=e.pathCacheByNodeId,m=e.pathCacheVersion,h=u.valueById;for(;d.length>0&&s<t;){let t=d[d.length-1],u=t[0];if(t[1]>=u.childIds.length){d.pop();continue}let g=t[1],_=u.childIds[t[1]++],v=c[_],y=t[2]+1,b=t[3];o=FW(o,y);let x,S=_;if(ZV(v))S=f?kU(e,_):_,x=S===_?`${b}${h[v.nameId]}/`:LU(e,S);else{let e=p.get(_);x=e!=null&&e.version===m?e.path:`${b}${h[v.nameId]}`}r[s]=o[y],n[s]=x,i[s]=g,a[s]=u.childIds.length,o[y+1]=s,s+=1;let C=c[S];C!=null&&ZV(C)&&JH(e,S,C)&&d.push([l.get(S),0,y,x])}s<t&&(n.length=s);let g=r.subarray(0,s),_=i.subarray(0,s),v=a.subarray(0,s),y=null;return{getParentIndex(e){return e<0||e>=s?-1:g[e]??-1},paths:n,posInSetByIndex:_,setSizeByIndex:v,get visibleIndexByPath(){if(y==null){y=new Map;for(let e=0;e<s;e+=1)y.set(n[e]??``,e)}return y}}}function nG(e,t){let n=Array(t),r=0,{nodes:i,directories:a,segmentTable:o}=e.snapshot,s=[[a.get(e.snapshot.rootId),0,-1]],c=o.valueById,l=e.snapshot.options.flattenEmptyDirectories,u=e.pathCacheByNodeId,d=e.pathCacheVersion;for(;s.length>0&&r<t;){let t=s[s.length-1],o=t[0];if(t[1]>=o.childIds.length){s.pop();continue}let f=o.childIds[t[1]++],p=i[f],m=t[2]+1;if(!ZV(p)){let t=u.get(f);n[r++]={depth:m,flattenedSegments:void 0,hasChildren:!1,id:f,isExpanded:!1,isFlattened:!1,isLoading:!1,kind:`file`,loadState:void 0,name:c[p.nameId],path:t!=null&&t.version===d?t.path:LU(e,f)};continue}let h=l?kU(e,f):f,g={headNodeId:f,terminalNodeId:h,visibleDepth:m};n[r++]=rG(e,g);let _=i[h];_!=null&&ZV(_)&&JH(e,h,_)&&s.push([a.get(h),0,m])}return r<t&&(n.length=r),n}function rG(e,t){let n=WU(e,t.terminalNodeId),r=ZV(n)?iG(e,t):null,i=LU(e,t.terminalNodeId),a=EH(e.snapshot.segmentTable,n.nameId),o=ZV(n)&&UU(e,t.terminalNodeId).childIds.length>0,s=t.headNodeId!==t.terminalNodeId,c=e.instrumentation,l=s?c==null?AU(e,t.headNodeId).map(n=>{let r=WU(e,n);return{isTerminal:n===t.terminalNodeId,name:EH(e.snapshot.segmentTable,r.nameId),nodeId:n,path:LU(e,n)}}):aH(c,`store.getVisibleSlice.flatten.collectSegments`,()=>AU(e,t.headNodeId).map(n=>{let r=WU(e,n);return{isTerminal:n===t.terminalNodeId,name:EH(e.snapshot.segmentTable,r.nameId),nodeId:n,path:LU(e,n)}})):void 0;return{depth:t.visibleDepth,flattenedSegments:l,hasChildren:o,id:t.terminalNodeId,isExpanded:ZV(n)&&JH(e,t.terminalNodeId,n),isFlattened:s,isLoading:r===`loading`,kind:ZV(n)?`directory`:`file`,loadState:r==null||r===`loaded`?void 0:r,name:a,path:i}}function iG(e,t){if(t.headNodeId===t.terminalNodeId)return ZH(e,t.terminalNodeId);let n=AU(e,t.headNodeId),r=!1,i=!1;for(let t of n){let n=ZH(e,t);if(n===`loading`)return`loading`;if(n===`error`){i=!0;continue}n===`unloaded`&&(r=!0)}return i?`error`:r?`unloaded`:`loaded`}function aG(e){let{directories:t,nodes:n,options:r,rootId:i,presortedDirectoryNodeIds:a}=e.snapshot,o=r.flattenEmptyDirectories===!0,s=e=>{let r=n[e];if(r==null||!ZV(r))return;let i=t.get(e);if(i==null)throw Error(`Unknown directory child index for node ${String(e)}`);let a=i.childIds,s=a.length,c=0,l=0;for(let e=0;e<s;e++){let t=a[e];if(t==null)continue;let r=n[t];c+=r.subtreeNodeCount,l+=r.visibleSubtreeCount}i.totalChildSubtreeNodeCount=c,i.totalChildVisibleSubtreeCount=l,s>=128&&HV(n,i),r.subtreeNodeCount=1+c;let u;if(o&&s===1){let e=n[a[0]];u=e!=null&&ZV(e)?l:1+l}else u=1+l;r.visibleSubtreeCount=u};if(a!=null)for(let e=a.length-1;e>=0;e--)s(a[e]);else for(let e=n.length-1;e>=1;e--)s(e);let c=n[i],l=t.get(i);if(c==null||l==null)return;let u=l.childIds,d=0,f=0;for(let e=0;e<u.length;e++){let t=u[e];if(t==null)continue;let r=n[t];d+=r.subtreeNodeCount,f+=r.visibleSubtreeCount}l.totalChildSubtreeNodeCount=d,l.totalChildVisibleSubtreeCount=f,HV(n,l),c.subtreeNodeCount=1+d,c.visibleSubtreeCount=f}function oG(e){return e.initialExpansion===`open`&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var sG=class e{#e;constructor(e={}){let t=iH(e),n=aH(t,`store.builder.create`,()=>new UH(e));if(e.preparedInput!=null){let t=BH(e.preparedInput);t==null?n.appendPreparedPaths(zH(e.preparedInput),!1):n.appendPresortedPaths(t,VH(e.preparedInput))}else{let r=e.paths??[];e.presorted===!0?n.appendPaths(r):n.appendPreparedPaths(aH(t,`store.preparePathEntries`,()=>HH(r,e)))}let r=aH(t,`store.builder.finish`,()=>n.finish({skipSubtreeCountPass:!0})),i=aH(t,`store.state.detectAllDirectoriesExpanded`,()=>(e.initialExpansion??`closed`)===`closed`&&n.didMatchAllInitialExpandedPaths());this.#e=aH(t,`store.state.create`,()=>WH(r,i?`open`:e.initialExpansion??`closed`,t)),i&&(this.#e.collapseNewDirectoriesByDefault=!0);let a=i?this.#e.snapshot.directories.size-1:aH(t,`store.state.initializeExpandedPaths`,()=>this.initializeExpandedPaths(e.initialExpandedPaths));i||oG(e)||(e.initialExpansion??`closed`)===`closed`&&a===this.#e.snapshot.directories.size-1||(e.initialExpandedPaths?.length??0)>0&&aH(t,`store.state.checkAllDirectoriesExpanded`,()=>this.hasAllDirectoriesExpanded())?aH(t,`store.state.initializeOpenVisibleCounts`,()=>aG(this.#e)):aH(t,`store.state.recomputeCounts`,()=>zU(this.#e,this.#e.snapshot.rootId))}static preparePaths(e,t={}){return IH(e,t)}static prepareInput(e,t={}){return LH(e,t)}static preparePresortedInput(e){return RH(e)}list(e){return aH(this.#e.instrumentation,`store.list`,()=>jU(this.#e,e))}add(e){aH(this.#e.instrumentation,`store.add`,()=>{let t=IW(this.#e);vU(this.#e,gU(this.#e,t,MU(this.#e,e)))})}remove(e,t={}){aH(this.#e.instrumentation,`store.remove`,()=>{let n=IW(this.#e);vU(this.#e,gU(this.#e,n,NU(this.#e,e,t)))})}move(e,t,n={}){aH(this.#e.instrumentation,`store.move`,()=>{let r=IW(this.#e),i=PU(this.#e,e,t,n);i!=null&&vU(this.#e,gU(this.#e,r,i))})}batch(e){_U(this.#e,()=>{if(typeof e==`function`){e(this);return}for(let t of e)switch(t.type){case`add`:this.add(t.path);break;case`remove`:this.remove(t.path,{recursive:t.recursive});break;case`move`:this.move(t.from,t.to,{collision:t.collision});break}})}getVisibleCount(){return aH(this.#e.instrumentation,`store.getVisibleCount`,()=>IW(this.#e))}getVisibleSlice(e,t){return aH(this.#e.instrumentation,`store.getVisibleSlice`,()=>HW(this.#e,e,t))}getVisibleRowContext(e){return aH(this.#e.instrumentation,`store.getVisibleRowContext`,()=>VW(this.#e,e))}getVisibleTreeProjection(){return WW(this.#e)}getVisibleTreeProjectionData(e){return UW(this.#e,e)}getVisibleIndex(e){return aH(this.#e.instrumentation,`store.getVisibleIndex`,()=>GW(this.#e,e))}getPathInfo(e){return aH(this.#e.instrumentation,`store.getPathInfo`,()=>{let t=VU(this.#e,e);if(t==null)return null;let n=WU(this.#e,t);return{depth:YV(n),kind:ZV(n)?`directory`:`file`,path:LU(this.#e,t)}})}isExpanded(e){return aH(this.#e.instrumentation,`store.isExpanded`,()=>{let t=this.requireDirectoryNodeId(e),n=WU(this.#e,t);return JH(this.#e,t,n)})}expand(e){aH(this.#e.instrumentation,`store.expand`,()=>{let t=IW(this.#e),n=KW(this.#e,e);n!=null&&vU(this.#e,gU(this.#e,t,n))})}collapse(e){aH(this.#e.instrumentation,`store.collapse`,()=>{let t=IW(this.#e),n=qW(this.#e,e);n!=null&&vU(this.#e,gU(this.#e,t,n))})}on(e,t){return iU(this.#e,e,t)}getDirectoryLoadState(e){let t=this.requireDirectoryNodeId(e);return ZH(this.#e,t)}markDirectoryUnloaded(e){aH(this.#e.instrumentation,`store.markDirectoryUnloaded`,()=>{let t=this.requireDirectoryNodeId(e);if(UU(this.#e,t).childIds.length>0)throw Error(`Cannot mark a directory with known children as unloaded: "${e}"`);let n=IW(this.#e);$H(this.#e,t),vU(this.#e,gU(this.#e,n,uU({affectedAncestorIds:BU(this.#e,t),affectedNodeIds:[t],path:e,projectionChanged:this.isDirectoryProjectionVisible(t)})))})}beginChildLoad(e){return aH(this.#e.instrumentation,`store.beginChildLoad`,()=>{let t=this.requireDirectoryNodeId(e),n=IW(this.#e),r=QH(this.#e,t);return vU(this.#e,gU(this.#e,n,dU({affectedAncestorIds:BU(this.#e,t),affectedNodeIds:[t],attemptId:r.attemptId,path:e,projectionChanged:this.isDirectoryProjectionVisible(t),reused:r.reused}))),r})}applyChildPatch(e,t){return aH(this.#e.instrumentation,`store.applyChildPatch`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null||ZH(this.#e,n)!==`loading`||!tU(this.#e,n,e.attemptId))return!1;let r=LU(this.#e,n);this.validateChildPatch(r,t);let i=IW(this.#e),a=[];for(let e of t.operations){cG(r,e);let t=IW(this.#e);switch(e.type){case`add`:a.push(gU(this.#e,t,MU(this.#e,e.path)));break;case`remove`:a.push(gU(this.#e,t,NU(this.#e,e.path,{recursive:e.recursive})));break;case`move`:{let n=PU(this.#e,e.from,e.to,{collision:e.collision});n!=null&&a.push(gU(this.#e,t,n));break}}}let o=a.some(e=>e.projectionChanged)||this.isDirectoryProjectionVisible(n);return vU(this.#e,gU(this.#e,i,fU({affectedAncestorIds:BU(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,childEvents:a,path:LU(this.#e,n),projectionChanged:o}))),!0})}completeChildLoad(e){return aH(this.#e.instrumentation,`store.completeChildLoad`,()=>{let t=this.resolveActiveDirectoryNodeId(e.nodeId);if(t==null)return!1;let n=IW(this.#e),r=eU(this.#e,t,e.attemptId);return vU(this.#e,gU(this.#e,n,pU({affectedAncestorIds:BU(this.#e,t),affectedNodeIds:[t],attemptId:e.attemptId,path:LU(this.#e,t),projectionChanged:this.isDirectoryProjectionVisible(t),stale:!r}))),r})}failChildLoad(e,t){return aH(this.#e.instrumentation,`store.failChildLoad`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null)return!1;let r=IW(this.#e),i=nU(this.#e,n,e.attemptId,t);return vU(this.#e,gU(this.#e,r,mU({affectedAncestorIds:BU(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,errorMessage:t,path:LU(this.#e,n),projectionChanged:this.isDirectoryProjectionVisible(n),stale:!i}))),i})}cleanup(e={}){return aH(this.#e.instrumentation,`store.cleanup`,()=>{if(this.#e.transactionStack.length>0)throw Error(`Cleanup cannot run during an open batch or transaction.`);if(MW(this.#e))throw Error(`Cleanup cannot run while directory loads are active.`);let t=IW(this.#e),n=NW(this.#e,e.mode??`stable`);return vU(this.#e,gU(this.#e,t,hU({...n,affectedAncestorIds:[],affectedNodeIds:[],projectionChanged:n.idsPreserved===!1}))),n})}getNodeCount(){return this.#e.activeNodeCount}initializeExpandedPaths(e){if(e==null||e.length===0)return 0;let t=0,n=[],r=[],i=0,a=null,o=this.#e.snapshot.segmentTable,s=o.valueById,c=this.#e.snapshot.nodes,l=new Map;for(let u of e){a!=null&&u<a&&(a=null,i=0,n.length=0,r.length=0);let e=u.length>0&&u.charCodeAt(u.length-1)===47?u.length-1:u.length;if(e===0){a=u,i=e,n.length=0,r.length=0;continue}let d=0,f=0;if(a!=null){let t=Math.min(e,i),n=!0;for(let e=0;e<t;e+=1){let t=u.charCodeAt(e);if(t!==a.charCodeAt(e)){n=!1;break}t===47&&(d+=1,f=e+1)}n&&(t===i&&e>t&&u.charCodeAt(t)===47?(d+=1,f=t+1):t===e&&i>t&&a.charCodeAt(t)===47&&(d+=1,f=e+1)),d=Math.min(d,r.length)}let p=d===0?this.#e.snapshot.rootId:r[d-1]??this.#e.snapshot.rootId,m=d,h=!0,g=f;for(;g<=e;){let t=u.indexOf(`/`,g),i=t===-1||t>e?e:t,a=u.slice(g,i),f=UU(this.#e,p).childIds,_=m===d?n[m]??0:0,v=_,y,b=l.get(a)??lH(a);l.set(a,b);let x=(e,t)=>{for(v=e;v<t;v+=1){let e=f[v],t=c[e],n=s[t.nameId];if(n===a)return y=e,!0;let r=dH(vH(o,t.nameId),b);if(r>0||r===0&&n>a)return!1}return!1};if(!x(_,f.length)&&_>0&&x(0,_),y===void 0){h=!1;break}if(!ZV(WU(this.#e,y))){h=!1;break}if(n[m]=v,r[m]=y,p=y,m+=1,i===e)break;g=i+1}if(a=u,i=e,n.length=m,r.length=m,!h){a=null,i=0,n.length=0,r.length=0;continue}for(let e=d;e<m;e+=1){let n=r[e];if(n==null)continue;let i=WU(this.#e,n);JH(this.#e,n,i)||(YH(this.#e,n,!0,i),t+=1)}}return t}hasAllDirectoriesExpanded(){for(let e of this.#e.snapshot.directories.keys()){if(e===this.#e.snapshot.rootId)continue;let t=WU(this.#e,e);if(!JH(this.#e,e,t))return!1}return!0}requireDirectoryNodeId(e){let t=VU(this.#e,e);if(t==null)throw Error(`Path does not exist: "${e}"`);if(!ZV(WU(this.#e,t)))throw Error(`Path is not a directory: "${e}"`);return t}resolveActiveDirectoryNodeId(e){try{if(!ZV(WU(this.#e,e)))throw Error(`Node is not a directory: ${String(e)}`);return e}catch{return null}}isDirectoryProjectionVisible(e){let t=e;for(;t!==this.#e.snapshot.rootId;){let e=WU(this.#e,t).parentId;if(e!==this.#e.snapshot.rootId){let n=WU(this.#e,e),r=OU(this.#e,e);if(!JH(this.#e,e,n)&&r!==t)return!1}t=e}return!0}validateChildPatch(t,n){new e({paths:this.list(t),presorted:!0,sort:this.#e.snapshot.options.sort}).batch(n.operations)}};function cG(e,t){switch(t.type){case`add`:case`remove`:if(!t.path.startsWith(e)||t.path===e)throw Error(`Child patch operation must stay within ${e}: "${t.path}"`);break;case`move`:if(!t.from.startsWith(e)||!t.to.startsWith(e)||t.from===e||t.to===e)throw Error(`Child patch move must stay within ${e}: "${t.from}" -> "${t.to}"`);break}}var lG={compact:{itemHeight:24,factor:.8},default:{itemHeight:30,factor:1},relaxed:{itemHeight:36,factor:1.2}};function uG(e,t){if(typeof e==`number`)return{itemHeight:t??lG.default.itemHeight,factor:e};let n=lG[e??`default`];return{itemHeight:t??n.itemHeight,factor:n.factor}}var dG=lG.default.itemHeight,fG=`@layer base, theme, unsafe;
181
+
182
+ @layer base {
183
+ :host {
184
+ /*
185
+ CSS variables use a fallback stack to ensure user and theme colors slot
186
+ in with ease. User colors take precedence over theme colors, which take
187
+ precedence over defaults.
188
+
189
+ Fallback order:
190
+
191
+ 1. --trees-*-override (explicit)
192
+ 2. --trees-theme-* (e.g. Shiki/VS Code tokens)
193
+ 3. defaults
194
+
195
+ Theme variable names mirror Shiki/VS Code theme file JSON tokens.
196
+
197
+ // Available CSS Color Overrides
198
+ --trees-fg-override
199
+ --trees-fg-muted-override
200
+ --trees-bg-override
201
+ --trees-bg-muted-override
202
+ --trees-accent-override
203
+ --trees-border-color-override
204
+
205
+ --trees-focus-ring-color-override
206
+ --trees-focus-ring-width-override
207
+ --trees-focus-ring-offset-override
208
+
209
+ --trees-search-fg-override
210
+ --trees-search-font-weight-override
211
+ --trees-search-bg-override
212
+
213
+ --trees-selected-fg-override
214
+ --trees-selected-bg-override
215
+ --trees-selected-focused-border-color-override
216
+
217
+ // Git Status Color Overrides
218
+ --trees-status-added-override
219
+ --trees-status-ignored-override
220
+ --trees-status-modified-override
221
+ --trees-status-renamed-override
222
+ --trees-status-untracked-override
223
+ --trees-status-deleted-override
224
+ --trees-git-added-color-override
225
+ --trees-git-ignored-color-override
226
+ --trees-git-modified-color-override
227
+ --trees-git-renamed-color-override
228
+ --trees-git-untracked-color-override
229
+ --trees-git-deleted-color-override
230
+
231
+ // Built-in File Icon Color Overrides
232
+ --trees-file-icon-color
233
+ --trees-file-icon-color-astro
234
+ --trees-file-icon-color-babel
235
+ --trees-file-icon-color-bash
236
+ --trees-file-icon-color-biome
237
+ --trees-file-icon-color-bootstrap
238
+ --trees-file-icon-color-browserslist
239
+ --trees-file-icon-color-bun
240
+ --trees-file-icon-color-c
241
+ --trees-file-icon-color-cpp
242
+ --trees-file-icon-color-claude
243
+ --trees-file-icon-color-css
244
+ --trees-file-icon-color-database
245
+ --trees-file-icon-color-default
246
+ --trees-file-icon-color-docker
247
+ --trees-file-icon-color-eslint
248
+ --trees-file-icon-color-git
249
+ --trees-file-icon-color-go
250
+ --trees-file-icon-color-graphql
251
+ --trees-file-icon-color-html
252
+ --trees-file-icon-color-image
253
+ --trees-file-icon-color-javascript
254
+ --trees-file-icon-color-json
255
+ --trees-file-icon-color-markdown
256
+ --trees-file-icon-color-mcp
257
+ --trees-file-icon-color-npm
258
+ --trees-file-icon-color-oxc
259
+ --trees-file-icon-color-postcss
260
+ --trees-file-icon-color-prettier
261
+ --trees-file-icon-color-python
262
+ --trees-file-icon-color-react
263
+ --trees-file-icon-color-ruby
264
+ --trees-file-icon-color-rust
265
+ --trees-file-icon-color-sass
266
+ --trees-file-icon-color-svg
267
+ --trees-file-icon-color-svelte
268
+ --trees-file-icon-color-svgo
269
+ --trees-file-icon-color-swift
270
+ --trees-file-icon-color-table
271
+ --trees-file-icon-color-text
272
+ --trees-file-icon-color-tailwind
273
+ --trees-file-icon-color-terraform
274
+ --trees-file-icon-color-typescript
275
+ --trees-file-icon-color-vite
276
+ --trees-file-icon-color-vscode
277
+ --trees-file-icon-color-vue
278
+ --trees-file-icon-color-wasm
279
+ --trees-file-icon-color-webpack
280
+ --trees-file-icon-color-yml
281
+ --trees-file-icon-color-zig
282
+ --trees-file-icon-color-zip
283
+
284
+ // Density
285
+ //
286
+ // A unitless scale factor for padding, gaps, and indentation. Usually
287
+ // set via \`density\` on useFileTree. Individual overrides take precedence.
288
+ //
289
+ // Compact: 0.8
290
+ // Default: 1
291
+ // Relaxed: 1.2
292
+ //
293
+ --trees-density-override
294
+
295
+ // Available CSS Layout Overrides
296
+ --trees-gap-override
297
+ --trees-border-radius-override
298
+ --trees-font-family-override
299
+ --trees-font-size-override
300
+ --trees-font-weight-regular-override
301
+ --trees-font-weight-semibold-override
302
+ --trees-level-gap-override
303
+ --trees-item-padding-x-override
304
+ --trees-item-margin-x-override
305
+ --trees-item-row-gap-override
306
+ --trees-icon-width-override
307
+ --trees-icon-nudge-override
308
+ --trees-scrollbar-gutter-override
309
+ --trees-padding-inline-override
310
+ */
311
+
312
+ --trees-accent: var(--trees-accent-override, #009fff);
313
+ --trees-fg: var(
314
+ --trees-fg-override,
315
+ var(--trees-theme-sidebar-fg, light-dark(#6c6c71, #adadb1))
316
+ );
317
+ --trees-fg-muted: var(
318
+ --trees-fg-muted-override,
319
+ var(--trees-theme-sidebar-header-fg, light-dark(#84848a, #84848a))
320
+ );
321
+ --trees-bg: var(
322
+ --trees-bg-override,
323
+ var(--trees-theme-sidebar-bg, light-dark(#f8f8f8, #141415))
324
+ );
325
+ /* var(--trees-theme-list-hover-bg, light-dark(#dfebff59, #19283c59)) */
326
+ --trees-bg-muted: var(
327
+ --trees-bg-muted-override,
328
+ var(
329
+ --trees-theme-list-hover-bg,
330
+ light-dark(
331
+ color-mix(
332
+ in lab,
333
+ var(--trees-accent) var(--trees-bg-alpha-light, 8%),
334
+ var(--trees-bg)
335
+ ),
336
+ color-mix(
337
+ in lab,
338
+ var(--trees-accent) var(--trees-bg-alpha-dark, 10%),
339
+ var(--trees-bg)
340
+ )
341
+ )
342
+ )
343
+ );
344
+ --trees-input-bg: var(
345
+ --trees-input-bg-override,
346
+ light-dark(#f8f8f8, #070707)
347
+ );
348
+
349
+ --trees-added-light: #16a994;
350
+ --trees-added-dark: #00cab1;
351
+ --trees-ignored-light: #adadb1;
352
+ --trees-ignored-dark: #4a4a4e;
353
+ --trees-modified-light: #1ca1c7;
354
+ --trees-modified-dark: #08c0ef;
355
+ --trees-renamed-light: #d5a910;
356
+ --trees-renamed-dark: #ffd452;
357
+ --trees-untracked-light: #16a994;
358
+ --trees-untracked-dark: #00cab1;
359
+ --trees-deleted-light: #ff2e3f;
360
+ --trees-deleted-dark: #ff6762;
361
+
362
+ --trees-border-color: var(
363
+ --trees-border-color-override,
364
+ var(--trees-theme-sidebar-border, light-dark(#eeeeef, #070707))
365
+ );
366
+ --trees-indent-guide-bg: var(
367
+ --trees-indent-guide-bg-override,
368
+ color-mix(in lab, var(--trees-fg-muted) 25%, transparent)
369
+ );
370
+ --trees-density: var(--trees-density-override, 1);
371
+ --trees-border-radius: var(
372
+ --trees-border-radius-override,
373
+ calc(6px * var(--trees-density))
374
+ );
375
+
376
+ --trees-font-family: var(--trees-font-family-override, system-ui);
377
+ --trees-font-size: var(--trees-font-size-override, 13px);
378
+ --trees-font-weight-regular: var(--trees-font-weight-regular-override, 400);
379
+ --trees-font-weight-semibold: var(
380
+ --trees-font-weight-semibold-override,
381
+ 600
382
+ );
383
+
384
+ --trees-focus-ring-color: var(
385
+ --trees-focus-ring-color-override,
386
+ var(--trees-theme-focus-ring, var(--trees-accent))
387
+ );
388
+ --trees-focus-ring-width: var(--trees-focus-ring-width-override, 1px);
389
+ --trees-focus-ring-offset: var(--trees-focus-ring-offset-override, -1px);
390
+
391
+ --trees-search-fg: var(
392
+ --trees-search-fg-override,
393
+ var(--trees-theme-input-fg, var(--trees-fg))
394
+ );
395
+ --trees-search-font-weight: var(--trees-search-font-weight-override, 600);
396
+ --trees-search-bg: var(
397
+ --trees-search-bg-override,
398
+ var(--trees-theme-input-bg, var(--trees-input-bg))
399
+ );
400
+
401
+ --trees-scrollbar-thumb: var(
402
+ --trees-scrollbar-thumb-override,
403
+ var(
404
+ --trees-theme-scrollbar-thumb,
405
+ color-mix(in lab, var(--trees-fg) 25%, var(--trees-bg))
406
+ )
407
+ );
408
+
409
+ --trees-selected-fg: var(
410
+ --trees-selected-fg-override,
411
+ var(--trees-theme-list-active-selection-fg, var(--trees-fg))
412
+ );
413
+ --trees-selected-bg: var(
414
+ --trees-selected-bg-override,
415
+ var(
416
+ --trees-theme-list-active-selection-bg,
417
+ light-dark(
418
+ color-mix(in lab, var(--trees-accent) 12%, var(--trees-bg)),
419
+ color-mix(in lab, var(--trees-accent) 15%, var(--trees-bg))
420
+ )
421
+ )
422
+ );
423
+ --trees-selected-focused-border-color: var(
424
+ --trees-selected-focused-border-color-override,
425
+ var(--trees-theme-focus-ring, var(--trees-accent))
426
+ );
427
+
428
+ /* Git status (e.g. from Shiki theme gitDecoration.*) */
429
+ --trees-status-added: var(
430
+ --trees-status-added-override,
431
+ var(
432
+ --trees-theme-git-added-fg,
433
+ light-dark(var(--trees-added-light), var(--trees-added-dark))
434
+ )
435
+ );
436
+ --trees-status-ignored: var(
437
+ --trees-status-ignored-override,
438
+ var(
439
+ --trees-theme-git-ignored-fg,
440
+ light-dark(var(--trees-ignored-light), var(--trees-ignored-dark))
441
+ )
442
+ );
443
+ --trees-status-modified: var(
444
+ --trees-status-modified-override,
445
+ var(
446
+ --trees-theme-git-modified-fg,
447
+ light-dark(var(--trees-modified-light), var(--trees-modified-dark))
448
+ )
449
+ );
450
+ --trees-status-renamed: var(
451
+ --trees-status-renamed-override,
452
+ var(
453
+ --trees-theme-git-renamed-fg,
454
+ light-dark(var(--trees-renamed-light), var(--trees-renamed-dark))
455
+ )
456
+ );
457
+ --trees-status-untracked: var(
458
+ --trees-status-untracked-override,
459
+ var(
460
+ --trees-theme-git-untracked-fg,
461
+ light-dark(var(--trees-untracked-light), var(--trees-untracked-dark))
462
+ )
463
+ );
464
+ --trees-status-deleted: var(
465
+ --trees-status-deleted-override,
466
+ var(
467
+ --trees-theme-git-deleted-fg,
468
+ light-dark(var(--trees-deleted-light), var(--trees-deleted-dark))
469
+ )
470
+ );
471
+ --trees-git-modified-color: var(
472
+ --trees-git-modified-color-override,
473
+ var(--trees-status-modified)
474
+ );
475
+ --trees-git-added-color: var(
476
+ --trees-git-added-color-override,
477
+ var(--trees-status-added)
478
+ );
479
+ --trees-git-ignored-color: var(
480
+ --trees-git-ignored-color-override,
481
+ var(--trees-status-ignored)
482
+ );
483
+ --trees-git-deleted-color: var(
484
+ --trees-git-deleted-color-override,
485
+ var(--trees-status-deleted)
486
+ );
487
+ --trees-git-renamed-color: var(
488
+ --trees-git-renamed-color-override,
489
+ var(--trees-status-renamed)
490
+ );
491
+ --trees-git-untracked-color: var(
492
+ --trees-git-untracked-color-override,
493
+ var(--trees-status-untracked)
494
+ );
495
+
496
+ --trees-icon-gray: light-dark(#84848a, #adadb1);
497
+ --trees-icon-red: light-dark(#d52c36, #ff6762);
498
+ --trees-icon-vermilion: light-dark(#ff8c5b, #d5512f);
499
+ --trees-icon-orange: light-dark(#d47628, #ffa359);
500
+ --trees-icon-yellow: light-dark(#d5a910, #ffd452);
501
+ --trees-icon-green: light-dark(#199f43, #5ecc71);
502
+ --trees-icon-teal: light-dark(#17a5af, #64d1db);
503
+ --trees-icon-cyan: light-dark(#1ca1c7, #68cdf2);
504
+ --trees-icon-blue: light-dark(#1a85d4, #69b1ff);
505
+ --trees-icon-indigo: light-dark(#693acf, #9d6afb);
506
+ --trees-icon-purple: light-dark(#a631be, #d568ea);
507
+ --trees-icon-pink: light-dark(#d32a61, #ff678d);
508
+ --trees-icon-mauve: light-dark(#594c5b, #79697b);
509
+
510
+ --trees-file-icon-color-default: var(
511
+ --trees-file-icon-color,
512
+ var(--trees-icon-gray)
513
+ );
514
+ --trees-file-icon-color-astro: var(
515
+ --trees-file-icon-color,
516
+ var(--trees-icon-purple)
517
+ );
518
+ --trees-file-icon-color-babel: var(
519
+ --trees-file-icon-color,
520
+ var(--trees-icon-yellow)
521
+ );
522
+ --trees-file-icon-color-bash: var(
523
+ --trees-file-icon-color,
524
+ var(--trees-icon-green)
525
+ );
526
+ --trees-file-icon-color-biome: var(
527
+ --trees-file-icon-color,
528
+ var(--trees-icon-blue)
529
+ );
530
+ --trees-file-icon-color-bootstrap: var(
531
+ --trees-file-icon-color,
532
+ var(--trees-icon-indigo)
533
+ );
534
+ --trees-file-icon-color-browserslist: var(
535
+ --trees-file-icon-color,
536
+ var(--trees-icon-yellow)
537
+ );
538
+ --trees-file-icon-color-bun: var(
539
+ --trees-file-icon-color,
540
+ var(--trees-icon-mauve)
541
+ );
542
+ --trees-file-icon-color-c: var(
543
+ --trees-file-icon-color,
544
+ var(--trees-icon-blue)
545
+ );
546
+ --trees-file-icon-color-cpp: var(
547
+ --trees-file-icon-color,
548
+ var(--trees-icon-blue)
549
+ );
550
+ --trees-file-icon-color-claude: var(
551
+ --trees-file-icon-color,
552
+ var(--trees-icon-orange)
553
+ );
554
+ --trees-file-icon-color-css: var(
555
+ --trees-file-icon-color,
556
+ var(--trees-icon-indigo)
557
+ );
558
+ --trees-file-icon-color-database: var(
559
+ --trees-file-icon-color,
560
+ var(--trees-icon-purple)
561
+ );
562
+ --trees-file-icon-color-docker: var(
563
+ --trees-file-icon-color,
564
+ var(--trees-icon-blue)
565
+ );
566
+ --trees-file-icon-color-eslint: var(
567
+ --trees-file-icon-color,
568
+ var(--trees-icon-indigo)
569
+ );
570
+ --trees-file-icon-color-git: var(
571
+ --trees-file-icon-vermilion,
572
+ var(--trees-icon-vermilion)
573
+ );
574
+ --trees-file-icon-color-go: var(
575
+ --trees-file-icon-color,
576
+ var(--trees-icon-cyan)
577
+ );
578
+ --trees-file-icon-color-graphql: var(
579
+ --trees-file-icon-color,
580
+ var(--trees-icon-pink)
581
+ );
582
+ --trees-file-icon-color-html: var(
583
+ --trees-file-icon-color,
584
+ var(--trees-icon-orange)
585
+ );
586
+ --trees-file-icon-color-image: var(
587
+ --trees-file-icon-color,
588
+ var(--trees-icon-pink)
589
+ );
590
+ --trees-file-icon-color-javascript: var(
591
+ --trees-file-icon-color,
592
+ var(--trees-icon-yellow)
593
+ );
594
+ --trees-file-icon-color-json: var(
595
+ --trees-file-icon-color,
596
+ var(--trees-icon-orange)
597
+ );
598
+ --trees-file-icon-color-markdown: var(
599
+ --trees-file-icon-color,
600
+ var(--trees-icon-green)
601
+ );
602
+ --trees-file-icon-color-mcp: var(
603
+ --trees-file-icon-color,
604
+ var(--trees-icon-teal)
605
+ );
606
+ --trees-file-icon-color-npm: var(
607
+ --trees-file-icon-color,
608
+ var(--trees-icon-red)
609
+ );
610
+ --trees-file-icon-color-oxc: var(
611
+ --trees-file-icon-cyan,
612
+ var(--trees-icon-cyan)
613
+ );
614
+ --trees-file-icon-color-postcss: var(
615
+ --trees-file-icon-color,
616
+ var(--trees-icon-red)
617
+ );
618
+ --trees-file-icon-color-prettier: var(
619
+ --trees-file-icon-color,
620
+ var(--trees-icon-teal)
621
+ );
622
+ --trees-file-icon-color-python: var(
623
+ --trees-file-icon-color,
624
+ var(--trees-icon-blue)
625
+ );
626
+ --trees-file-icon-color-react: var(
627
+ --trees-file-icon-color,
628
+ var(--trees-icon-cyan)
629
+ );
630
+ --trees-file-icon-color-ruby: var(
631
+ --trees-file-icon-color,
632
+ var(--trees-icon-red)
633
+ );
634
+ --trees-file-icon-color-rust: var(
635
+ --trees-file-icon-color,
636
+ var(--trees-icon-orange)
637
+ );
638
+ --trees-file-icon-color-sass: var(
639
+ --trees-file-icon-color,
640
+ var(--trees-icon-pink)
641
+ );
642
+ --trees-file-icon-color-svg: var(
643
+ --trees-file-icon-color,
644
+ var(--trees-icon-orange)
645
+ );
646
+ --trees-file-icon-color-svelte: var(
647
+ --trees-file-icon-color,
648
+ var(--trees-icon-red)
649
+ );
650
+ --trees-file-icon-color-svgo: var(
651
+ --trees-file-icon-color,
652
+ var(--trees-icon-green)
653
+ );
654
+ --trees-file-icon-color-swift: var(
655
+ --trees-file-icon-color,
656
+ var(--trees-icon-orange)
657
+ );
658
+ --trees-file-icon-color-table: var(
659
+ --trees-file-icon-color,
660
+ var(--trees-icon-teal)
661
+ );
662
+ --trees-file-icon-color-text: var(
663
+ --trees-file-icon-color,
664
+ var(--trees-icon-gray)
665
+ );
666
+ --trees-file-icon-color-tailwind: var(
667
+ --trees-file-icon-color,
668
+ var(--trees-icon-cyan)
669
+ );
670
+ --trees-file-icon-color-terraform: var(
671
+ --trees-file-icon-color,
672
+ var(--trees-icon-indigo)
673
+ );
674
+ --trees-file-icon-color-typescript: var(
675
+ --trees-file-icon-color,
676
+ var(--trees-icon-blue)
677
+ );
678
+ --trees-file-icon-color-vite: var(
679
+ --trees-file-icon-color,
680
+ var(--trees-icon-purple)
681
+ );
682
+ --trees-file-icon-color-vscode: var(
683
+ --trees-file-icon-color,
684
+ var(--trees-icon-blue)
685
+ );
686
+ --trees-file-icon-color-vue: var(
687
+ --trees-file-icon-color,
688
+ var(--trees-icon-green)
689
+ );
690
+ --trees-file-icon-color-wasm: var(
691
+ --trees-file-icon-color,
692
+ var(--trees-icon-indigo)
693
+ );
694
+ --trees-file-icon-color-webpack: var(
695
+ --trees-file-icon-color,
696
+ var(--trees-icon-blue)
697
+ );
698
+ --trees-file-icon-color-yml: var(
699
+ --trees-file-icon-color,
700
+ var(--trees-icon-red)
701
+ );
702
+ --trees-file-icon-color-zig: var(
703
+ --trees-file-icon-color,
704
+ var(--trees-icon-orange)
705
+ );
706
+ --trees-file-icon-color-zip: var(
707
+ --trees-file-icon-color,
708
+ var(--trees-icon-orange)
709
+ );
710
+
711
+ --trees-level-gap: var(
712
+ --trees-level-gap-override,
713
+ calc(8px * var(--trees-density))
714
+ );
715
+ --trees-item-padding-x: var(
716
+ --trees-item-padding-x-override,
717
+ calc(8px * var(--trees-density))
718
+ );
719
+ --trees-item-margin-x: var(
720
+ --trees-item-margin-x-override,
721
+ calc(2px * var(--trees-density))
722
+ );
723
+ --trees-item-row-gap: var(
724
+ --trees-item-row-gap-override,
725
+ calc(6px * var(--trees-density))
726
+ );
727
+ --trees-icon-width: var(--trees-icon-width-override, 16px);
728
+ --trees-icon-nudge: var(
729
+ --trees-icon-nudge-override,
730
+ calc(1px * var(--trees-density))
731
+ );
732
+ --trees-row-height: var(--trees-item-height, 30px);
733
+ --trees-git-lane-width: var(--trees-git-lane-width-override, 12px);
734
+ --trees-action-lane-width: var(
735
+ --trees-action-lane-width-override,
736
+ calc(var(--trees-icon-width) + 2px)
737
+ );
738
+ /* Keep the floating trigger aligned with the row's action lane. Going in
739
+ from the root's right edge: the scroll container reserves
740
+ \`--trees-padding-inline\` of effective inset on each side (its asymmetric
741
+ padding formula cancels the scrollbar gutter on the right), the row
742
+ sits inside that inset, and its trailing \`--trees-item-padding-x\` is the
743
+ action lane itself. The trigger's own focus-ring margin then trims one
744
+ pixel back so the button's visible right edge lines up with the lane. */
745
+ --trees-context-menu-trigger-inline-offset: calc(
746
+ var(--trees-padding-inline) + var(--trees-item-padding-x) -
747
+ var(--trees-focus-ring-width)
748
+ );
749
+
750
+ --trees-scrollbar-gutter: var(--trees-scrollbar-gutter-override, 6px);
751
+ --trees-padding-inline: var(--trees-padding-inline-override, 16px);
752
+
753
+ color-scheme: light dark;
754
+ display: flex;
755
+ flex-direction: column;
756
+ font-size: var(--trees-font-size);
757
+ color: var(--trees-fg);
758
+ background-color: var(--trees-bg);
759
+ --truncate-marker-background-color: var(--trees-bg);
760
+ --truncate-marker-background-overlay-color: transparent;
761
+ font-family: var(--trees-font-family);
762
+ font-weight: var(--trees-font-weight-regular);
763
+ }
764
+
765
+ :host([data-file-tree-virtualized='true']) {
766
+ height: 100%;
767
+ overflow: hidden;
768
+ }
769
+
770
+ [data-file-tree-virtualized-wrapper='true'] {
771
+ height: 100%;
772
+ overflow: hidden;
773
+ display: flex;
774
+ flex-direction: column;
775
+ }
776
+
777
+ [data-file-tree-virtualized-root='true'] {
778
+ height: 100%;
779
+ display: flex;
780
+ flex-direction: column;
781
+ overflow: hidden;
782
+ }
783
+
784
+ [data-file-tree-virtualized-scroll='true'],
785
+ [data-file-tree-scrollbar-measure='true'] {
786
+ --trees-scrollbar-thumb-current: transparent;
787
+ overflow-y: auto;
788
+ scrollbar-gutter: stable;
789
+
790
+ &:hover {
791
+ --trees-scrollbar-thumb-current: var(--trees-scrollbar-thumb);
792
+ }
793
+
794
+ &::-webkit-scrollbar {
795
+ width: var(--trees-scrollbar-gutter);
796
+ height: var(--trees-scrollbar-gutter);
797
+ }
798
+
799
+ &::-webkit-scrollbar-track {
800
+ background: transparent;
801
+ }
802
+
803
+ &::-webkit-scrollbar-thumb {
804
+ background-color: var(--trees-scrollbar-thumb-current);
805
+ border: 1px solid transparent;
806
+ background-clip: content-box;
807
+ border-radius: calc(var(--trees-scrollbar-gutter) / 2);
808
+ }
809
+
810
+ &::-webkit-scrollbar-corner {
811
+ background-color: transparent;
812
+ }
813
+ }
814
+
815
+ /* These are styles for a temporarily generated element to measure the size
816
+ * of the scrollbar. It's intended to be somewhat similar in scrollbar style
817
+ * scope to the scrollable tree so \`--trees-scrollbar-gutter-measured\` is an
818
+ * accurate reflection of the size the scrollbar gutter takes up. */
819
+ [data-file-tree-scrollbar-measure='true'] {
820
+ position: absolute;
821
+ top: 0;
822
+ left: 0;
823
+ visibility: hidden;
824
+ pointer-events: none;
825
+ width: 100px;
826
+ height: 100px;
827
+ }
828
+
829
+ @supports (-moz-appearance: none) {
830
+ [data-file-tree-virtualized-scroll='true'],
831
+ [data-file-tree-scrollbar-measure='true'] {
832
+ scrollbar-width: thin;
833
+ scrollbar-color: var(--trees-scrollbar-thumb-current) transparent;
834
+ }
835
+ }
836
+
837
+ [data-file-tree-virtualized-scroll='true'] {
838
+ position: relative;
839
+ overflow-y: auto;
840
+ flex: 1 1 0;
841
+ min-height: 0;
842
+ padding-inline: max(
843
+ calc(var(--trees-padding-inline) - var(--trees-item-margin-x)),
844
+ 0px
845
+ )
846
+ /* NOTE(amadeus): We can assume that all Webkit based browser gutters
847
+ * will align to the value of '--trees-scrollbar-gutter', however if not, then
848
+ * \`--trees-scrollbar-gutter-measured\` should correct it. Mostly we are
849
+ * hoping to avoid SSR alignment jumps if possible. In non-SSR'd environments
850
+ * \`--trees-scrollbar-gutter-measured\` should always be immediately available.
851
+ */
852
+ max(
853
+ calc(
854
+ var(--trees-padding-inline) - var(--trees-item-margin-x) -
855
+ var(
856
+ --trees-scrollbar-gutter-measured,
857
+ var(--trees-scrollbar-gutter)
858
+ )
859
+ ),
860
+ 0px
861
+ );
862
+ }
863
+
864
+ @supports (-moz-appearance: none) {
865
+ [data-file-tree-virtualized-scroll='true'] {
866
+ padding-inline: max(
867
+ calc(var(--trees-padding-inline) - var(--trees-item-margin-x)),
868
+ 0px
869
+ )
870
+ /* NOTE(amadeus): However on Firefox it can vary a little bit, but most
871
+ * likely the majority of cases will default to a 0px width scrollbar lets
872
+ * inherit that first to avoid SSR jumps. In non-SSR'd environments
873
+ * \`--trees-scrollbar-gutter-measured\` should always be immediately available.
874
+ */
875
+ max(
876
+ calc(
877
+ var(--trees-padding-inline) - var(--trees-item-margin-x) -
878
+ var(--trees-scrollbar-gutter-measured, 0px)
879
+ ),
880
+ 0px
881
+ );
882
+ }
883
+ }
884
+
885
+ [data-file-tree-sticky-overlay='true'] {
886
+ position: sticky;
887
+ top: 0;
888
+ height: 0;
889
+ z-index: 4;
890
+ overflow: visible;
891
+ pointer-events: none;
892
+ }
893
+
894
+ /* The overlay DOM is kept populated even at scrollTop=0 so the browser has
895
+ * the rendered rows on hand the moment scrolling begins — otherwise the
896
+ * compositor paints a scrolled frame before React can mount the overlay,
897
+ * and the topmost sticky folder jumps up by a couple of pixels before it
898
+ * "snaps" into its pinned position. We hide it via CSS whenever the scroll
899
+ * is at the top and no scroll is in progress, so the preview doesn't leak
900
+ * through at rest. \`data-overlay-reveal\` is stamped on the root only when
901
+ * the user initiates a scroll while already at the top — exactly the case
902
+ * where we need the pre-mounted overlay to be visible through the first
903
+ * compositor frame. It is deliberately distinct from the general
904
+ * \`data-is-scrolling\` flag so a scroll that ends at the top (e.g. ArrowUp
905
+ * navigation) re-hides the overlay the instant the scroll lands, rather
906
+ * than waiting for the hover-suppression timer to elapse. */
907
+ [data-file-tree-virtualized-root='true'][data-scroll-at-top='true']:not(
908
+ [data-overlay-reveal]
909
+ )
910
+ [data-file-tree-sticky-overlay='true'] {
911
+ visibility: hidden;
912
+ }
913
+
914
+ [data-file-tree-sticky-overlay-content='true'] {
915
+ background-color: var(--trees-bg);
916
+ position: relative;
917
+ pointer-events: none;
918
+ }
919
+
920
+ [data-file-tree-virtualized-list='true'] {
921
+ background-color: var(--trees-bg);
922
+ position: relative;
923
+ min-height: 100%;
924
+ width: 100%;
925
+ overflow-anchor: none;
926
+
927
+ &[data-is-scrolling] {
928
+ pointer-events: none;
929
+ }
930
+ }
931
+
932
+ [data-file-tree-virtualized-sticky-offset='true'] {
933
+ contain: layout size;
934
+ }
935
+
936
+ [data-file-tree-virtualized-sticky='true'] {
937
+ position: sticky;
938
+ top: 0;
939
+ width: 100%;
940
+ display: flex;
941
+ flex-direction: column;
942
+ isolation: isolate;
943
+ /* Promote to its own compositor layer so text inside the window is
944
+ * rasterized once and GPU-translated during scroll. Without this, the
945
+ * browser re-paints the window (and its text) at every scroll frame,
946
+ * which produces visible 1px shake / character tearing. */
947
+ will-change: transform;
948
+ }
949
+
950
+ [data-file-tree-search-container] {
951
+ display: flex;
952
+ padding: 0;
953
+ padding-inline: var(--trees-padding-inline);
954
+ margin-bottom: var(--trees-item-row-gap);
955
+ }
956
+
957
+ [data-file-tree-search-input] {
958
+ --trees-focus-ring-width: 2px;
959
+ font-family: var(--trees-font-family);
960
+ font-size: var(--trees-font-size);
961
+ flex: 1;
962
+ height: var(--trees-row-height);
963
+ /* 1px breathing room so the focus-visible outline isn't clipped when the
964
+ * input sits flush against the top of the scroll container. */
965
+ margin-block: 1px;
966
+ padding-inline: var(--trees-item-padding-x);
967
+ line-height: var(--trees-row-height);
968
+ color: var(--trees-search-fg);
969
+ background-color: var(--trees-search-bg);
970
+ border: 1px solid var(--trees-border-color);
971
+ border-radius: var(--trees-border-radius);
972
+ outline: none;
973
+
974
+ &::placeholder {
975
+ color: color-mix(
976
+ in lab,
977
+ var(--trees-search-fg) 65%,
978
+ var(--trees-search-bg)
979
+ );
980
+ }
981
+
982
+ &:focus-visible,
983
+ &[data-file-tree-search-input-fake-focus='true'] {
984
+ outline: var(--trees-focus-ring-width) solid var(--trees-focus-ring-color);
985
+ outline-offset: var(--trees-focus-ring-offset);
986
+ }
987
+ }
988
+
989
+ /* The wrapper for the tree items */
990
+ [role='tree'] {
991
+ position: relative;
992
+ display: flex;
993
+ flex-direction: column;
994
+ gap: var(--trees-gap-override, 0);
995
+ }
996
+
997
+ /* LIST ITEM */
998
+ [data-type='item'] {
999
+ color: inherit;
1000
+ font-family: var(--trees-font-family);
1001
+ font-size: var(--trees-font-size);
1002
+ text-align: start;
1003
+ outline: none;
1004
+ background-color: var(--trees-bg);
1005
+ border: none;
1006
+ position: relative;
1007
+
1008
+ padding: 0 var(--trees-item-padding-x);
1009
+ margin: 0 var(--trees-item-margin-x);
1010
+ cursor: pointer;
1011
+ -webkit-user-select: none;
1012
+ user-select: none;
1013
+ -webkit-touch-callout: none;
1014
+ touch-action: manipulation;
1015
+ display: flex;
1016
+ flex: 0 0 var(--trees-row-height);
1017
+ align-items: center;
1018
+ height: var(--trees-row-height);
1019
+ line-height: var(--trees-row-height);
1020
+ gap: var(--trees-item-row-gap);
1021
+ border-radius: var(--trees-border-radius);
1022
+ /* Row states may be translucent, so markers paint the tree background first
1023
+ * and then the state color on top to avoid compositing the same alpha twice. */
1024
+ --truncate-marker-background-color: var(--trees-bg);
1025
+ --truncate-marker-background-overlay-color: transparent;
1026
+ --truncate-marker-block-inset: 0px;
1027
+
1028
+ &:hover,
1029
+ &[data-item-context-hover='true'] {
1030
+ background-color: var(--trees-bg-muted);
1031
+ --truncate-marker-background-overlay-color: var(--trees-bg-muted);
1032
+ }
1033
+
1034
+ &[data-item-focused='true'],
1035
+ &:focus-visible {
1036
+ z-index: 2;
1037
+
1038
+ /* Flattened segment markers sit high enough to cover the row outline unless
1039
+ * their painted background is inset by the focus ring width. */
1040
+ [data-item-flattened-subitems] {
1041
+ --truncate-marker-block-inset: var(--trees-focus-ring-width);
1042
+ }
1043
+
1044
+ &::before {
1045
+ position: absolute;
1046
+ inset: 0;
1047
+ content: '';
1048
+ display: block;
1049
+ border-radius: var(--trees-border-radius);
1050
+ outline: var(--trees-focus-ring-width) solid
1051
+ var(--trees-focus-ring-color);
1052
+ outline-offset: var(--trees-focus-ring-offset);
1053
+ pointer-events: none;
1054
+ }
1055
+
1056
+ &[data-item-selected='true']::before {
1057
+ outline-color: var(--trees-selected-focused-border-color);
1058
+ }
1059
+ }
1060
+
1061
+ &[data-item-selected='true'] {
1062
+ color: var(--trees-selected-fg);
1063
+ background-color: var(--trees-selected-bg);
1064
+ --truncate-marker-background-overlay-color: var(--trees-selected-bg);
1065
+ z-index: 3;
1066
+
1067
+ [data-item-section='icon'] {
1068
+ color: var(--trees-selected-fg);
1069
+ }
1070
+ }
1071
+
1072
+ &[data-item-search-match='true'] {
1073
+ font-weight: var(--trees-search-font-weight);
1074
+ }
1075
+ }
1076
+
1077
+ [data-type='item'][data-file-tree-sticky-row='true'] {
1078
+ pointer-events: auto;
1079
+ }
1080
+
1081
+ /* Sticky rows opt back into pointer events because the overlay wrapper is
1082
+ * inert. During scroll, put them back under the same hover suppression as
1083
+ * the virtualized list so translucent hover states and menu triggers do not
1084
+ * paint over rows moving beneath the sticky stack. */
1085
+ [data-file-tree-virtualized-root='true'][data-is-scrolling]
1086
+ [data-type='item'][data-file-tree-sticky-row='true'] {
1087
+ pointer-events: none;
1088
+ }
1089
+
1090
+ [data-file-tree-virtualized-root='true'][data-is-scrolling]
1091
+ [data-type='item'][data-file-tree-sticky-row='true']:hover:not(
1092
+ [data-item-selected='true']
1093
+ ),
1094
+ [data-file-tree-virtualized-root='true'][data-is-scrolling]
1095
+ [data-type='item'][data-file-tree-sticky-row='true'][data-item-context-hover='true']:not(
1096
+ [data-item-selected='true']
1097
+ ) {
1098
+ background-color: var(--trees-bg);
1099
+ --truncate-marker-background-overlay-color: transparent;
1100
+ }
1101
+
1102
+ [data-item-selected='true']:has(+ [data-item-selected='true']) {
1103
+ border-bottom-left-radius: 0;
1104
+ border-bottom-right-radius: 0;
1105
+ }
1106
+
1107
+ [data-item-selected='true'] + [data-item-selected='true'] {
1108
+ border-top-left-radius: 0;
1109
+ border-top-right-radius: 0;
1110
+ }
1111
+
1112
+ /* Flattened Directory Parts */
1113
+ [data-item-flattened-subitems] {
1114
+ display: inline-flex;
1115
+ align-items: center;
1116
+ gap: 2px;
1117
+ }
1118
+ [data-item-flattened-subitem]:hover,
1119
+ [data-item-flattened-subitem-drag-target='true'] {
1120
+ text-decoration: underline;
1121
+ }
1122
+
1123
+ /* Icon for each item */
1124
+ [data-item-section='icon'] {
1125
+ flex-shrink: 0;
1126
+ display: flex;
1127
+ align-items: center;
1128
+ justify-content: center;
1129
+ color: var(--trees-fg-muted);
1130
+ fill: currentColor;
1131
+ width: var(--trees-icon-width);
1132
+ }
1133
+
1134
+ :where([data-item-section='icon'] > [data-icon-token]) {
1135
+ color: var(--trees-fg-muted);
1136
+ }
1137
+
1138
+ [data-file-tree-colored-icons='true'] {
1139
+ [data-icon-token='astro'] {
1140
+ color: var(--trees-file-icon-color-astro);
1141
+ }
1142
+ [data-icon-token='babel'] {
1143
+ color: var(--trees-file-icon-color-babel);
1144
+ }
1145
+ [data-icon-token='bash'] {
1146
+ color: var(--trees-file-icon-color-bash);
1147
+ }
1148
+ [data-icon-token='biome'] {
1149
+ color: var(--trees-file-icon-color-biome);
1150
+ }
1151
+ [data-icon-token='bootstrap'] {
1152
+ color: var(--trees-file-icon-color-bootstrap);
1153
+ }
1154
+ [data-icon-token='browserslist'] {
1155
+ color: var(--trees-file-icon-color-browserslist);
1156
+ }
1157
+ [data-icon-token='bun'] {
1158
+ color: var(--trees-file-icon-color-bun);
1159
+ }
1160
+ [data-icon-token='c'] {
1161
+ color: var(--trees-file-icon-color-c);
1162
+ }
1163
+ [data-icon-token='cpp'] {
1164
+ color: var(--trees-file-icon-color-cpp);
1165
+ }
1166
+ [data-icon-token='claude'] {
1167
+ color: var(--trees-file-icon-color-claude);
1168
+ }
1169
+ [data-icon-token='css'] {
1170
+ color: var(--trees-file-icon-color-css);
1171
+ }
1172
+ [data-icon-token='database'] {
1173
+ color: var(--trees-file-icon-color-database);
1174
+ }
1175
+ [data-icon-token='default'] {
1176
+ color: var(--trees-file-icon-color-default);
1177
+ }
1178
+ [data-icon-token='docker'] {
1179
+ color: var(--trees-file-icon-color-docker);
1180
+ }
1181
+ [data-icon-token='eslint'] {
1182
+ color: var(--trees-file-icon-color-eslint);
1183
+ }
1184
+ [data-icon-token='git'] {
1185
+ color: var(--trees-file-icon-color-git);
1186
+ }
1187
+ [data-icon-token='go'] {
1188
+ color: var(--trees-file-icon-color-go);
1189
+ }
1190
+ [data-icon-token='graphql'] {
1191
+ color: var(--trees-file-icon-color-graphql);
1192
+ }
1193
+ [data-icon-token='html'] {
1194
+ color: var(--trees-file-icon-color-html);
1195
+ }
1196
+ [data-icon-token='image'] {
1197
+ color: var(--trees-file-icon-color-image);
1198
+ }
1199
+ [data-icon-token='javascript'] {
1200
+ color: var(--trees-file-icon-color-javascript);
1201
+ }
1202
+ [data-icon-token='json'] {
1203
+ color: var(--trees-file-icon-color-json);
1204
+ }
1205
+ [data-icon-token='markdown'] {
1206
+ color: var(--trees-file-icon-color-markdown);
1207
+ }
1208
+ [data-icon-token='mcp'] {
1209
+ color: var(--trees-file-icon-color-mcp);
1210
+ }
1211
+ [data-icon-token='npm'] {
1212
+ color: var(--trees-file-icon-color-npm);
1213
+ }
1214
+ [data-icon-token='oxc'] {
1215
+ color: var(--trees-file-icon-color-oxc);
1216
+ }
1217
+ [data-icon-token='postcss'] {
1218
+ color: var(--trees-file-icon-color-postcss);
1219
+ }
1220
+ [data-icon-token='prettier'] {
1221
+ color: var(--trees-file-icon-color-prettier);
1222
+ }
1223
+ [data-icon-token='python'] {
1224
+ color: var(--trees-file-icon-color-python);
1225
+ }
1226
+ [data-icon-token='react'] {
1227
+ color: var(--trees-file-icon-color-react);
1228
+ }
1229
+ [data-icon-token='ruby'] {
1230
+ color: var(--trees-file-icon-color-ruby);
1231
+ }
1232
+ [data-icon-token='rust'] {
1233
+ color: var(--trees-file-icon-color-rust);
1234
+ }
1235
+ [data-icon-token='sass'] {
1236
+ color: var(--trees-file-icon-color-sass);
1237
+ }
1238
+ [data-icon-token='svg'] {
1239
+ color: var(--trees-file-icon-color-svg);
1240
+ }
1241
+ [data-icon-token='svelte'] {
1242
+ color: var(--trees-file-icon-color-svelte);
1243
+ }
1244
+ [data-icon-token='svgo'] {
1245
+ color: var(--trees-file-icon-color-svgo);
1246
+ }
1247
+ [data-icon-token='swift'] {
1248
+ color: var(--trees-file-icon-color-swift);
1249
+ }
1250
+ [data-icon-token='table'] {
1251
+ color: var(--trees-file-icon-color-table);
1252
+ }
1253
+ [data-icon-token='text'] {
1254
+ color: var(--trees-file-icon-color-text);
1255
+ }
1256
+ [data-icon-token='tailwind'] {
1257
+ color: var(--trees-file-icon-color-tailwind);
1258
+ }
1259
+ [data-icon-token='terraform'] {
1260
+ color: var(--trees-file-icon-color-terraform);
1261
+ }
1262
+ [data-icon-token='typescript'] {
1263
+ color: var(--trees-file-icon-color-typescript);
1264
+ }
1265
+ [data-icon-token='vite'] {
1266
+ color: var(--trees-file-icon-color-vite);
1267
+ }
1268
+ [data-icon-token='vscode'] {
1269
+ color: var(--trees-file-icon-color-vscode);
1270
+ }
1271
+ [data-icon-token='vue'] {
1272
+ color: var(--trees-file-icon-color-vue);
1273
+ }
1274
+ [data-icon-token='wasm'] {
1275
+ color: var(--trees-file-icon-color-wasm);
1276
+ }
1277
+ [data-icon-token='webpack'] {
1278
+ color: var(--trees-file-icon-color-webpack);
1279
+ }
1280
+ [data-icon-token='yml'] {
1281
+ color: var(--trees-file-icon-color-yml);
1282
+ }
1283
+ [data-icon-token='zig'] {
1284
+ color: var(--trees-file-icon-color-zig);
1285
+ }
1286
+ [data-icon-token='zip'] {
1287
+ color: var(--trees-file-icon-color-zip);
1288
+ }
1289
+ }
1290
+
1291
+ /* Chevron rotation and visual alignment */
1292
+ /* Chevron pointing down */
1293
+ [data-icon-name='file-tree-icon-chevron'] {
1294
+ &[data-align-capitals='false'] {
1295
+ transform: translate(0, var(--trees-icon-nudge));
1296
+ }
1297
+ &[data-align-capitals='true'] {
1298
+ transform: translate(0, 0);
1299
+ }
1300
+ }
1301
+
1302
+ [data-item-section='content'] {
1303
+ flex: 0 1 auto;
1304
+ text-align: start;
1305
+ min-width: 0;
1306
+ max-width: 100%;
1307
+ overflow: hidden;
1308
+ text-overflow: ellipsis;
1309
+ /* Breaks middle truncate component to also set this */
1310
+ /* white-space: nowrap; */
1311
+ }
1312
+
1313
+ [data-item-section='decoration'] {
1314
+ flex: 1 1 0;
1315
+ min-width: 0;
1316
+ display: flex;
1317
+ justify-content: flex-end;
1318
+ text-align: end;
1319
+ overflow: hidden;
1320
+ color: var(--trees-fg-muted);
1321
+ }
1322
+
1323
+ [data-item-section='decoration'] > span {
1324
+ min-width: 0;
1325
+ max-width: 100%;
1326
+ display: inline-flex;
1327
+ align-items: center;
1328
+ justify-content: flex-end;
1329
+ overflow: hidden;
1330
+ text-overflow: ellipsis;
1331
+ white-space: nowrap;
1332
+ }
1333
+
1334
+ [data-item-section='git'],
1335
+ [data-item-section='action'] {
1336
+ flex: 0 0 auto;
1337
+ display: flex;
1338
+ align-items: center;
1339
+ justify-content: center;
1340
+ }
1341
+
1342
+ [data-item-section='git'] {
1343
+ width: var(--trees-git-lane-width);
1344
+ }
1345
+
1346
+ [data-item-section='action'] {
1347
+ width: var(--trees-action-lane-width);
1348
+ color: var(--trees-fg-muted);
1349
+ fill: currentColor;
1350
+ pointer-events: none;
1351
+ }
1352
+
1353
+ [data-item-section='git'] > span,
1354
+ [data-item-section='action'] > span {
1355
+ width: 100%;
1356
+ display: inline-flex;
1357
+ align-items: center;
1358
+ justify-content: center;
1359
+ }
1360
+
1361
+ [data-item-action-affordance='decorative'] {
1362
+ opacity: 0.85;
1363
+ }
1364
+
1365
+ [data-item-rename-input] {
1366
+ appearance: none;
1367
+ width: 100%;
1368
+ min-width: 0;
1369
+ height: calc(var(--trees-row-height) - 4px);
1370
+ font-family: inherit;
1371
+ font-size: inherit;
1372
+ /* line-height: calc(var(--trees-row-height) - 8px); */
1373
+ color: inherit;
1374
+ background-color: transparent;
1375
+ border: 0;
1376
+ padding-inline: 6px;
1377
+ outline: none;
1378
+ box-sizing: border-box;
1379
+ }
1380
+
1381
+ [data-item-section='content']:has([data-item-rename-input])
1382
+ ~ [data-item-section='action'],
1383
+ [data-item-section='content']:has([data-item-rename-input])
1384
+ ~ [data-item-section='decoration'] {
1385
+ display: none;
1386
+ }
1387
+
1388
+ /* Chevron pointing right */
1389
+ [aria-expanded='false'][data-item-type='folder']
1390
+ > [data-item-section='icon']
1391
+ > [data-icon-name='file-tree-icon-chevron'] {
1392
+ &[data-align-capitals='true'] {
1393
+ transform: rotate(-90deg)
1394
+ translate(
1395
+ calc(var(--trees-icon-nudge) / 2),
1396
+ calc(var(--trees-icon-nudge) / 2)
1397
+ );
1398
+ }
1399
+ &[data-align-capitals='false'] {
1400
+ transform: rotate(-90deg)
1401
+ translate(
1402
+ calc(var(--trees-icon-nudge) / 2 * -1),
1403
+ calc(var(--trees-icon-nudge) / 2)
1404
+ );
1405
+ }
1406
+ }
1407
+
1408
+ /* LIST IDENTATION */
1409
+ /* Spacing container */
1410
+ [data-item-section='spacing'] {
1411
+ display: flex;
1412
+ flex-direction: row;
1413
+ align-items: center;
1414
+ justify-content: center;
1415
+ height: var(--trees-row-height);
1416
+ padding-left: calc(calc(var(--trees-icon-width) / 2) - 0.5px);
1417
+
1418
+ &:empty {
1419
+ padding-left: 0;
1420
+ }
1421
+ }
1422
+
1423
+ /* Spacing per level */
1424
+ [data-item-section='spacing-item'] {
1425
+ transform: translateX(-0.25px);
1426
+ display: inline-block;
1427
+ border-left: 1px solid var(--trees-indent-guide-bg);
1428
+ height: 100%;
1429
+ margin-right: calc(var(--trees-level-gap) - 1px);
1430
+ opacity: 0;
1431
+ transition: opacity 150ms ease;
1432
+
1433
+ & + & {
1434
+ margin-left: calc(
1435
+ var(--trees-item-row-gap) + calc(var(--trees-icon-width) / 2) - 0.5px
1436
+ );
1437
+ }
1438
+ }
1439
+
1440
+ :host(:hover) [data-item-section='spacing-item'] {
1441
+ opacity: 0.75;
1442
+ }
1443
+
1444
+ /* Git status indicator */
1445
+
1446
+ /* This is a folder that contains a git change */
1447
+ [data-item-contains-git-change='true'] > [data-item-section='git'] {
1448
+ color: var(--trees-git-modified-color);
1449
+ opacity: 0.5;
1450
+ fill: currentColor;
1451
+ }
1452
+
1453
+ /* These are files that have a git change */
1454
+ [data-item-git-status] {
1455
+ &
1456
+ > :where([data-item-section='icon'])
1457
+ > :where(:not([data-icon-name='file-tree-icon-chevron'])) {
1458
+ color: var(--trees-item-git-status-color);
1459
+ }
1460
+ & > [data-item-section='content'] {
1461
+ color: var(--trees-item-git-status-color);
1462
+ }
1463
+ & > [data-item-section='git'] {
1464
+ color: var(--trees-item-git-status-color);
1465
+ font-weight: var(--trees-font-weight-semibold);
1466
+ }
1467
+ }
1468
+
1469
+ [data-item-git-status='added'] {
1470
+ --trees-item-git-status-color: var(--trees-git-added-color);
1471
+ }
1472
+
1473
+ [data-item-git-status='deleted'] {
1474
+ --trees-item-git-status-color: var(--trees-git-deleted-color);
1475
+ }
1476
+
1477
+ [data-item-git-status='ignored'] {
1478
+ --trees-item-git-status-color: var(--trees-git-ignored-color);
1479
+
1480
+ & > [data-item-section='icon'] {
1481
+ opacity: 0.5;
1482
+ }
1483
+ }
1484
+
1485
+ [data-item-section='git'] [data-icon-name='file-tree-icon-dot'] {
1486
+ /* this is a nudge to align the dot with the likely lowercase text. it's slightly
1487
+ generalizable, but other fonts are gonna need other nudges i assume */
1488
+ transform: translateY(calc(0.65ex - 50%));
1489
+ }
1490
+
1491
+ [data-item-git-status='modified'] {
1492
+ --trees-item-git-status-color: var(--trees-git-modified-color);
1493
+ }
1494
+
1495
+ [data-item-git-status='renamed'] {
1496
+ --trees-item-git-status-color: var(--trees-git-renamed-color);
1497
+ }
1498
+
1499
+ [data-item-git-status='untracked'] {
1500
+ --trees-item-git-status-color: var(--trees-git-untracked-color);
1501
+ }
1502
+
1503
+ /* Drag and drop */
1504
+ [data-item-drag-target='true'] {
1505
+ background-color: var(--trees-selected-bg);
1506
+ }
1507
+
1508
+ [data-item-dragging='true'] {
1509
+ opacity: 0.5;
1510
+ }
1511
+
1512
+ /* Lock icon for locked paths (sibling of content) */
1513
+ [data-item-section='lock'] {
1514
+ flex: 0 0 auto;
1515
+ margin-left: auto;
1516
+ display: flex;
1517
+ align-items: center;
1518
+ color: var(--trees-fg-muted);
1519
+ }
1520
+ [data-item-section='lock'] svg {
1521
+ display: block;
1522
+ }
1523
+
1524
+ [data-type='header-slot'] {
1525
+ display: block;
1526
+ flex: 0 0 auto;
1527
+ }
1528
+
1529
+ [data-type='context-menu-wash'] {
1530
+ position: absolute;
1531
+ inset: 0;
1532
+ z-index: 3;
1533
+ background-color: transparent;
1534
+ touch-action: none;
1535
+ }
1536
+
1537
+ [data-type='context-menu-anchor'] {
1538
+ position: absolute;
1539
+ top: 0;
1540
+ right: var(--trees-context-menu-trigger-inline-offset);
1541
+ z-index: 4;
1542
+ display: none;
1543
+ align-items: center;
1544
+
1545
+ &[data-visible='true'] {
1546
+ display: flex;
1547
+ }
1548
+ }
1549
+
1550
+ /* Hide the floating trigger while the scroll container is actively moving.
1551
+ * The anchor is positioned against the root, not the scroll content, so its
1552
+ * \`top\` follows the row via a React state update — one frame behind the
1553
+ * compositor. That delay is visible as the trigger hovering over the wrong
1554
+ * row during the first frame of a scroll. The \`data-is-scrolling\` flag on
1555
+ * the root is flipped synchronously on \`wheel\`/\`touchmove\`/\`keydown\` before
1556
+ * the compositor commits the next paint, so this selector hides the anchor
1557
+ * in the same frame the scroll begins. */
1558
+ [data-file-tree-virtualized-root='true'][data-is-scrolling]
1559
+ [data-type='context-menu-anchor'] {
1560
+ display: none;
1561
+ }
1562
+
1563
+ [data-type='context-menu-anchor'] > slot[name='context-menu'] {
1564
+ display: block;
1565
+ width: 0;
1566
+ min-width: 0;
1567
+ flex: 0 0 0;
1568
+ overflow: visible;
1569
+ }
1570
+
1571
+ /* Single floating context menu trigger */
1572
+ [data-type='context-menu-trigger'] {
1573
+ all: unset;
1574
+ align-items: center;
1575
+ justify-content: center;
1576
+ width: var(--trees-action-lane-width);
1577
+ color: var(--trees-fg-muted);
1578
+ fill: currentColor;
1579
+ cursor: pointer;
1580
+ font-family: var(--trees-font-family);
1581
+ font-size: var(--trees-font-size);
1582
+ border-top-right-radius: var(--trees-border-radius);
1583
+ border-bottom-right-radius: var(--trees-border-radius);
1584
+ margin: var(--trees-focus-ring-width);
1585
+ height: calc(var(--trees-row-height) - var(--trees-focus-ring-width) * 2);
1586
+ border-width: 0;
1587
+ transition: color 120ms ease;
1588
+
1589
+ display: flex;
1590
+ }
1591
+
1592
+ [data-type='context-menu-trigger']:hover,
1593
+ [data-type='context-menu-trigger'][aria-expanded='true'] {
1594
+ color: var(--trees-fg);
1595
+ }
1596
+
1597
+ /** @pierre/truncate css here, manually copy pasted for now */
1598
+ [data-truncate-container] {
1599
+ /* CUSTOM TO TREES, TO SUPPORT THE OUTLINE */
1600
+ margin-top: -1px;
1601
+ margin-bottom: -1px;
1602
+
1603
+ /* Width of the fade from default marker to text */
1604
+ --truncate-internal-marker-fade-width: var(
1605
+ --truncate-marker-fade-width,
1606
+ 2px
1607
+ );
1608
+ /* Width of the solid color between the fade from the default marker to the text */
1609
+ --truncate-internal-marker-gap: var(--truncate-marker-gap, 0px);
1610
+ /* Opacity of the marker 'color' property, not of the element itself */
1611
+ --truncate-internal-marker-opacity: var(--truncate-marker-opacity, 50%);
1612
+ /* Opacity of the marker 'color' property specifically for the middle truncate, not opacity of the element itself */
1613
+ --truncate-internal-middle-marker-opacity: var(
1614
+ --truncate-middle-marker-opacity,
1615
+ 80%
1616
+ );
1617
+ /* Background color of the default marker */
1618
+ --truncate-internal-marker-background-color: var(
1619
+ --truncate-marker-background-color,
1620
+ light-dark(white, black)
1621
+ );
1622
+ --truncate-internal-marker-background-overlay-color: var(
1623
+ --truncate-marker-background-overlay-color,
1624
+ transparent
1625
+ );
1626
+ --truncate-internal-marker-block-inset: var(
1627
+ --truncate-marker-block-inset,
1628
+ 0px
1629
+ );
1630
+ /* Duration of the fade out animation for the marker */
1631
+ --truncate-internal-marker-fade-out-duration: var(
1632
+ --truncate-marker-fade-out-duration,
1633
+ 0ms
1634
+ );
1635
+ /* Duration of the fade in animation for the marker */
1636
+ --truncate-internal-marker-fade-in-duration: var(
1637
+ --truncate-marker-fade-in-duration,
1638
+ 100ms
1639
+ );
1640
+
1641
+ /* FADE Variant specifics */
1642
+ --truncate-internal-fade-marker-color: var(
1643
+ --truncate-fade-marker-color,
1644
+ #000
1645
+ );
1646
+ --truncate-internal-fade-marker-width: var(
1647
+ --truncate-fade-marker-width,
1648
+ 0.2lh
1649
+ );
1650
+
1651
+ /*
1652
+ In some special cases people might be adding spacing in other ways
1653
+ that would benefit from being able to override this, however the container
1654
+ query below can't use this and would need to be redeclared with the overridden
1655
+ value. It's a bad time, but better than nothing.
1656
+ */
1657
+ --truncate-internal-single-line-height: 1lh;
1658
+
1659
+ height: var(--truncate-internal-single-line-height);
1660
+ min-width: 0;
1661
+ overflow: hidden;
1662
+ }
1663
+
1664
+ [data-truncate-marker] {
1665
+ display: flex;
1666
+ position: absolute;
1667
+ height: var(--truncate-internal-single-line-height);
1668
+ padding-block: var(--truncate-internal-marker-block-inset);
1669
+ box-sizing: border-box;
1670
+ align-items: center;
1671
+ background-clip: content-box;
1672
+ z-index: 2;
1673
+ color: color-mix(
1674
+ in srgb,
1675
+ currentColor var(--truncate-internal-marker-opacity),
1676
+ transparent
1677
+ );
1678
+
1679
+ /* Core trick for hiding the marker until overflow occurs */
1680
+ opacity: 0;
1681
+ transition: opacity var(--truncate-internal-marker-fade-out-duration)
1682
+ ease-in-out;
1683
+ }
1684
+
1685
+ @container measure (height > 1lh) {
1686
+ [data-truncate-marker] {
1687
+ opacity: 1;
1688
+ transition: opacity var(--truncate-internal-marker-fade-in-duration)
1689
+ ease-in-out;
1690
+ }
1691
+ }
1692
+
1693
+ [data-truncate-grid] {
1694
+ display: grid;
1695
+ position: relative;
1696
+ }
1697
+
1698
+ [data-truncate-content='visible'] {
1699
+ white-space: nowrap;
1700
+ }
1701
+
1702
+ [data-truncate-content='overflow'] {
1703
+ opacity: 0;
1704
+ pointer-events: none;
1705
+ -webkit-user-select: none;
1706
+ user-select: none;
1707
+ word-break: break-all;
1708
+ margin-top: calc(-1 * var(--truncate-internal-single-line-height));
1709
+ }
1710
+
1711
+ [data-truncate-marker-cell] {
1712
+ container: measure / size;
1713
+ overflow: visible;
1714
+ -webkit-user-select: none;
1715
+ user-select: none;
1716
+ pointer-events: none;
1717
+ }
1718
+
1719
+ [data-truncate-container='truncate'] {
1720
+ & [data-truncate-grid] {
1721
+ grid-template-columns: minmax(0, max-content) 0;
1722
+ }
1723
+ & [data-truncate-marker] {
1724
+ right: 0;
1725
+ }
1726
+ & [data-truncate-fade] {
1727
+ margin-right: calc(-2 * var(--truncate-internal-fade-marker-width));
1728
+ }
1729
+ }
1730
+
1731
+ [data-truncate-container='fruncate'] {
1732
+ & [data-truncate-grid] {
1733
+ grid-template-columns: 0 minmax(0, max-content) auto;
1734
+ }
1735
+ & [data-truncate-content] {
1736
+ direction: rtl;
1737
+ }
1738
+ & [data-truncate-content] > span {
1739
+ unicode-bidi: plaintext;
1740
+ }
1741
+ & [data-truncate-fade] {
1742
+ margin-left: calc(-2 * var(--truncate-internal-fade-marker-width));
1743
+ }
1744
+ }
1745
+
1746
+ [data-truncate-variant='default'] {
1747
+ & [data-truncate-marker] {
1748
+ background-color: var(--truncate-internal-marker-background-color);
1749
+ background-image: linear-gradient(
1750
+ var(--truncate-internal-marker-background-overlay-color),
1751
+ var(--truncate-internal-marker-background-overlay-color)
1752
+ );
1753
+ }
1754
+ & [data-truncate-marker]::after,
1755
+ & [data-truncate-marker]::before {
1756
+ content: '';
1757
+ position: absolute;
1758
+ width: calc(
1759
+ var(--truncate-internal-marker-fade-width) +
1760
+ var(--truncate-internal-marker-gap)
1761
+ );
1762
+ inset-block-start: var(--truncate-internal-marker-block-inset);
1763
+ height: max(
1764
+ 0px,
1765
+ calc(
1766
+ var(--truncate-internal-single-line-height) -
1767
+ var(--truncate-internal-marker-block-inset) * 2
1768
+ )
1769
+ );
1770
+ background-color: var(--truncate-internal-marker-background-color);
1771
+ background-image: linear-gradient(
1772
+ var(--truncate-internal-marker-background-overlay-color),
1773
+ var(--truncate-internal-marker-background-overlay-color)
1774
+ );
1775
+ mask-image: linear-gradient(
1776
+ var(--truncate-internal-fade-dir),
1777
+ #000 0%,
1778
+ #000 var(--truncate-internal-marker-gap),
1779
+ transparent 100%
1780
+ );
1781
+ }
1782
+ & [data-truncate-marker]::after {
1783
+ --truncate-internal-fade-dir: to right;
1784
+ right: calc(
1785
+ -1 *
1786
+ (
1787
+ var(--truncate-internal-marker-fade-width) +
1788
+ var(--truncate-internal-marker-gap)
1789
+ )
1790
+ );
1791
+ }
1792
+ & [data-truncate-marker]::before {
1793
+ --truncate-internal-fade-dir: to left;
1794
+ left: calc(
1795
+ -1 *
1796
+ (
1797
+ var(--truncate-internal-marker-fade-width) +
1798
+ var(--truncate-internal-marker-gap)
1799
+ )
1800
+ );
1801
+ }
1802
+ }
1803
+
1804
+ [data-truncate-variant='fade'] {
1805
+ & [data-truncate-marker] {
1806
+ background: transparent;
1807
+ }
1808
+ }
1809
+
1810
+ [data-truncate-fade] {
1811
+ box-shadow:
1812
+ 0 0 calc(var(--truncate-internal-fade-marker-width) / 2)
1813
+ var(--truncate-internal-fade-marker-color),
1814
+ 0 0 var(--truncate-internal-fade-marker-width)
1815
+ var(--truncate-internal-fade-marker-color);
1816
+ width: calc(var(--truncate-internal-fade-marker-width) * 2);
1817
+ height: calc(
1818
+ var(--truncate-internal-single-line-height) -
1819
+ (var(--truncate-internal-fade-marker-width) * 2)
1820
+ );
1821
+ margin: var(--truncate-internal-fade-marker-width) 0;
1822
+ }
1823
+
1824
+ [data-truncate-group-container='middle'] {
1825
+ & [data-truncate-container] {
1826
+ --truncate-marker-opacity: var(--truncate-internal-middle-marker-opacity);
1827
+ }
1828
+
1829
+ display: flex;
1830
+ min-width: 0;
1831
+
1832
+ & > div {
1833
+ min-width: 0;
1834
+ }
1835
+
1836
+ & > div[data-truncate-segment-priority='1'] {
1837
+ flex: 0 1 max-content;
1838
+ }
1839
+ & > div[data-truncate-segment-priority='2'] {
1840
+ flex: 0 999999 max-content;
1841
+ }
1842
+ }
1843
+ }
1844
+ `,pG=`@layer base, unsafe;`;function mG(e){return`${pG}
1845
+ @layer base {
1846
+ ${e}
1847
+ }`}function hG(e){return`${pG}
1848
+ @layer unsafe {
1849
+ ${e}
1850
+ }`}var gG=new WeakMap;function _G(e){let t=gG.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(uV,`true`);let r=document.createElement(`div`);r.style.position=`relative`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n);let i=Math.max(n.offsetWidth-n.clientWidth,0);return n.remove(),gG.set(e,i),i}function vG(e,t){if(!e.isConnected)return;let n=_G(t);if(n==null)return;let r=t.querySelector(`style[${dV}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(dV,``),t.appendChild(i)),i.textContent=`:host { ${fV}: ${n}px; }`}var yG;function bG(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){yG??(yG=new CSSStyleSheet,yG.replaceSync(mG(fG)));let t=!1;try{e.adoptedStyleSheets=[yG],t=!0}catch{}if(t){e.querySelector(`style[${cV}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(cV,``),t.textContent=mG(fG),e.prepend(t)}}function xG(e,t){SG(e,t),bG(t),vG(e,t)}function SG(e,t){let n=e.querySelector(`template[shadowrootmode="open"], template[data-file-tree-shadowrootmode="open"]`);n instanceof HTMLTemplateElement&&(t.childNodes.length>0||(t.appendChild(n.content.cloneNode(!0)),n.hasAttribute(`shadowrootmode`)&&n.remove()))}if(typeof HTMLElement<`u`&&customElements.get(`file-tree-container`)==null){class e extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.shadowRoot??this.attachShadow({mode:`open`});xG(this,e)}}if(customElements.define(sV,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(sV)))e instanceof HTMLElement&&xG(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var CG=e=>e.startsWith(`f::`)?e.slice(3):e;function wG(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function TG(e,t){return e===``?t:`${e}/${t}`}function EG({files:e,path:t,isFolder:n,nextBasename:r}){let i=CG(t),a=r.trim();if(a.length===0)return{error:`Name cannot be empty.`};if(a.includes(`/`))return{error:`Name cannot include "/".`};let{parentPath:o,baseName:s}=wG(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=TG(o,a),l=Array(e.length),u=new Set;if(!n){let t=`${c}/`,r=!1;for(let n=0;n<e.length;n++){let a=e[n];if(a!==i&&a.startsWith(t))return{error:`"${c}" already exists.`};let o=a===i?c:a;if(u.has(o))return{error:`"${c}" already exists.`};u.add(o),l[n]=o,a===i&&(r=!0)}return r?{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}:{error:`Could not find the selected file to rename.`}}let d=`${i}/`,f=`${c}/`,p=0;for(let t=0;t<e.length;t++){let n=e[t],r=n===i||n.startsWith(d);if(!r&&(n===c||n.startsWith(f)))return{error:`"${c}" already exists.`};let a=r?`${c}${n.slice(i.length)}`:n;if(u.has(a))return{error:`"${c}" already exists.`};u.add(a),l[t]=a,r&&p++}return p===0?{error:`Could not find the selected folder to rename.`}:{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}}function DG(e){return e.endsWith(`/`)}function OG(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`),r=n<0?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function kG(e){let t=[],n=new Set;for(let r of e)n.has(r)||(n.add(r),t.push(r));let r=new Set;for(let e of t.toSorted((e,t)=>e.length===t.length?e.localeCompare(t):e.length-t.length)){let t=(e.endsWith(`/`)?e.slice(0,-1):e).split(`/`),n=!1;for(let e=0;e<t.length-1;e+=1){let i=`${t.slice(0,e+1).join(`/`)}/`;if(r.has(i)){n=!0;break}}n||r.add(e)}return t.filter(e=>r.has(e))}function AG(e,t){return t.includes(e)?kG(t):[e]}function jG(e,t){return e===t?!0:e==null||t==null?!1:e.kind===t.kind&&e.directoryPath===t.directoryPath&&e.flattenedSegmentPath===t.flattenedSegmentPath&&e.hoveredPath===t.hoveredPath}function MG(e,t){return{draggedPaths:e,target:t}}function NG(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(DG(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function PG(e,t){return t.kind===`root`||t.directoryPath==null?OG(e):t.directoryPath}function FG(e,t){let n=e.map(e=>{let n=PG(e,t);return n===e?null:{from:e,to:n,type:`move`}}).filter(e=>e!=null);return n.length===0?null:{operations:n,result:{draggedPaths:e,operation:n.length===1?`move`:`batch`,target:t}}}function IG(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function LG(e,t,n){let{paths:r,preparedInput:i}=e;if(i==null){if(r==null)throw Error(`FileTree requires paths or preparedInput`);return{paths:r,preparedInput:void 0}}let a=i.paths;if(r==null)return{paths:a,preparedInput:i};if(!IG(sG.preparePaths(r,n==null?{}:{sort:n}),a))throw Error(`FileTree ${t} received paths and preparedInput for different path lists`);return{paths:a,preparedInput:i}}function RG(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}function zG(e,t,n){if(e===t)return n;let r=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(r)?`${n.endsWith(`/`)?n:`${n}/`}${e.slice(r.length)}`:e}function BG(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function VG(e,t,n=!1){if(e==null)return null;switch(t.operation){case`add`:case`expand`:case`collapse`:case`mark-directory-unloaded`:case`begin-child-load`:case`apply-child-patch`:case`complete-child-load`:case`fail-child-load`:case`cleanup`:return e;case`remove`:return BG(e,t.path)?n?e:null:e;case`move`:return zG(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=VG(r,e,n),r==null)return null;return r}}}function HG(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function UG(e){switch(e.operation){case`add`:return{...HG(e),operation:`add`,path:e.path};case`remove`:return{...HG(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...HG(e),from:e.from,operation:`move`,to:e.to}}}function WG(e){return{...HG(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>UG(e)),operation:`batch`}}function GG(e){switch(e.operation){case`add`:case`remove`:case`move`:return UG(e);case`batch`:return WG(e);default:return null}}function KG(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function qG(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function JG(e){return qG(e).at(-1)??null}function YG(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}function XG(e){return e.endsWith(`/`)}var ZG=e=>e.toLowerCase();function QG(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function $G(e){return e.endsWith(`/`)?e.slice(0,-1):e}function eK(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}var tK=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},nK=Symbol(`FILE_TREE_RENAME_VIEW`),rK=512,iK=512;function aK(e){return e===`top`||e===`center`?e:`nearest`}function oK(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=qG(n);for(let e=r.length-1;e>=0;--e){let n=r[e];if(n==null)continue;let i=t(n);if(i!=null)return i}}return 0}function sK(e,t,n){if(e.paths.length===0)return{focusedIndex:-1,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};if(t==null)return{focusedIndex:0,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};let r=n??(t=>e.visibleIndexByPath.get(t)??null);return{focusedIndex:oK(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var cK=class{#e;#t=new Set;#n=new Map;#r=null;#i=null;#a=new Map;#o=new Map;#s=-1;#c=null;#l=!1;#u=e=>-1;#d=new Map;#f=null;#p=null;#m=null;#h=null;#g=null;#_;#v;#y;#b=[];#x=new Int32Array;#S=new Int32Array;#C=void 0;#w=!1;#T=null;#E=``;#D=!1;#O=new Set;#k=[];#A;#j=null;#M=null;#N=null;#P=null;#F=null;#I=null;#L=null;#R=0;#z=null;#B=new Set;#V=0;#H;#U=0;#W=!1;#G=0;#K;constructor(e){let{dragAndDrop:t,fileTreeSearchMode:n,initialSearchQuery:r,initialSelectedPaths:i,renaming:a,onSearchChange:o,paths:s,preparedInput:c,...l}=e,u=LG({paths:s,preparedInput:c},`constructor`,l.sort);this.#e=l,t!=null&&t!==!1&&(this.#r=t===!0?{}:t),this.#w=a!=null&&a!==!1,a!=null&&a!==!1&&a!==!0&&(this.#C=a.canRename,this.#v=a.onError,this.#_=a.onRename),this.#y=o,this.#A=n??`hide-non-matches`,this.#H=this.#le(u.paths,u.preparedInput);let d=i?.map(e=>this.#Ne(e)).filter(e=>e!=null)??[],f=d.at(-1)??null;d.length>0&&(this.#B=new Set(d),this.#z=f,this.#V=1),this.#je(f,!1),r!=null&&this.#Te(r,!1),this.#K=this.#Re()}destroy(){this.#K?.(),this.#K=null,this.#n.clear(),this.#t.clear(),this.#d.clear(),this.#i=null,this.#he()}focusFirstItem(){this.#be().length>0&&this.#Fe(0)}focusLastItem(){this.#G<=0||(this.#Ie(),this.#Fe(this.#G-1))}focusNextItem(){this.#Ae(1)}focusParentItem(){if(this.#c==null)return;let e=JG(this.#c);if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t)}focusPath(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;this.#Ie();let n=this.#Z(t);n>=0&&this.#Fe(n)}scrollToPath(e,t){let n=this.#H.getPathInfo(e)?.path??null;if(n==null)return;this.#Ie();let r=this.#xe(n);r<0||this.#Me(r)!=null&&(t?.focus!==!1&&this.#Fe(r,!1),this.#L={id:this.#R+=1,offset:aK(t?.offset),visibleIndex:r},this.#De())}focusMountedPathFromInput(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;let n=this.#Z(t);n>=0&&this.#Fe(n)}focusNearestPath(e){let t=this.resolveNearestVisiblePath(e);if(t==null)return null;let n=this.#Z(t);return n>=0?(this.#Fe(n),this.#be()[n]??t):null}focusPreviousItem(){this.#Ae(-1)}getFocusedIndex(){return this.#s}getFocusedItem(){return this.#c==null?null:this.#Q(this.#c)}getFocusedPath(){return this.#c}getScrollRequest(){return this.#L}clearScrollRequest(e){this.#L?.id===e&&(this.#L=null)}resolveNearestVisiblePath(e){let t=this.#be();if(this.#G===0)return null;if(e==null)return this.#c??t[0]??null;let n=this.#H.getPathInfo(e)?.path??e,r=this.#Z(n);return r>=0?t[r]??n:this.#X(n)??this.#c??t[0]??null}getSelectedPaths(){return[...this.#B]}getSelectionVersion(){return this.#V}getVisibleCount(){return this.#G}getVisibleRows(e,t){if(t<e||this.#G===0)return[];let n=Math.max(0,e),r=Math.min(this.#G-1,t);if(r<n)return[];let i=r-n+1;if(this.#F==null&&!this.#l&&r>=this.#b.length&&i<=iK){let e=[];for(let t=n;t<=r;t+=1){let n=this.#H.getVisibleRowContext(t);if(n==null)break;e.push(this.#ee(n))}return e}if(!this.#l&&r>=this.#b.length&&this.#Ie(),this.#F!=null){let e=Array.from({length:r-n+1},(e,t)=>this.#Se(n+t)),t=new Map,i=e[0]??-1,a=i;for(let n=1;n<=e.length;n+=1){let r=e[n];if(r!=null&&r===a+1){a=r;continue}if(i>=0&&this.#H.getVisibleSlice(i,a).forEach((e,n)=>{t.set(i+n,e)}),r==null){i=-1,a=-1;continue}i=r,a=r}return Array.from({length:r-n+1},(e,r)=>{let i=n+r,a=this.#Se(i),o=t.get(a),s=this.#b[a];if(o==null||s==null)throw Error(`Missing projection row for filtered visible index ${String(i)}`);return this.#$(o,i,a,{ancestorPaths:this.#re(a),path:s})})}return this.#H.getVisibleSlice(n,r).map((e,t)=>{let r=n+t,i=this.#b[r];if(i==null)throw Error(`Missing projection path for visible index ${String(r)}`);return this.#$(e,r,r,{ancestorPaths:this.#re(r),path:i})})}getStickyRowCandidates(e,t){if(this.#F!=null)return null;if(this.#G===0||e<=0||t<=0)return[];let n=[];for(let r=0;r<this.#G;r+=1){let i=e+r*t,a=Math.min(this.#G-1,Math.floor(i/t)),o=this.#te(a,r)??(a>0?this.#te(a-1,r):void 0);if(o==null)break;n.push({row:this.#ee(o),subtreeEndIndex:o.subtreeEndIndex})}return n}getItem(e){let t=this.#H.getPathInfo(e);return t==null?null:this.#Q(t.path,t)}resolveMountedDirectoryPathFromInput(e){let t=this.#H.getPathInfo(e);return t?.kind===`directory`?t.path:null}toggleMountedDirectoryFromInput(e){let t=this.resolveMountedDirectoryPathFromInput(e);t!=null&&this.#ze(t)}selectAllVisiblePaths(){this.#Ie();let e=[...this.#be()];this.#ae(e,this.#c??this.#z)}selectOnlyPath(e){let t=this.#Ne(e);t!=null&&this.#ae([t],t)}selectOnlyMountedPathFromInput(e){this.#ae([e],e)}selectPath(e){let t=this.#Ne(e);t==null||this.#B.has(t)||this.#ae([...this.#B,t])}deselectPath(e){let t=this.#Ne(e);t==null||!this.#B.has(t)||this.#ae([...this.#B].filter(e=>e!==t))}toggleFocusedSelection(){this.#c!=null&&this.togglePathSelectionFromInput(this.#c)}togglePathSelection(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.deselectPath(t);return}this.selectPath(t)}}togglePathSelectionFromInput(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.#ae([...this.#B].filter(e=>e!==t),t);return}this.#ae([...this.#B,t],t)}}selectPathRange(e,t){let n=this.#Ne(e);if(n==null)return;this.#Ie();let r=this.#z,i=r==null?-1:this.#Ce(r),a=this.#Ce(n);if(i===-1||a===-1){let e=t?[...this.#B,n]:[n];this.#ae(e,n);return}let[o,s]=i<=a?[i,a]:[a,i],c=this.#be().slice(o,s+1),l=t?[...this.#B,...c]:c;this.#ae(l,r)}extendSelectionFromFocused(e){if(this.#c==null)return;let t=this.#s;if(t===-1)return;let n=Math.min(this.#G-1,Math.max(0,t+e));if(n===t)return;!this.#l&&n>=this.#b.length&&this.#Ie();let r=this.#be(),i=r[t]??null,a=r[n]??null;if(i==null||a==null)return;let o=new Set(this.#B);o.has(i)&&o.has(a)?o.delete(i):o.add(a),this.#ae([...o],this.#z??i,!1),this.#Fe(n)}getDragAndDropConfig(){return this.#r}isDragAndDropEnabled(){return this.#r!=null}getDragSession(){return this.#i==null?null:{draggedPaths:[...this.#i.draggedPaths],primaryPath:this.#i.primaryPath,target:this.#i.target==null?null:{...this.#i.target}}}startDrag(e){if(this.#r==null)return!1;let t=this.#Ne(e);if(t==null||this.#M!=null&&this.#M.length>0)return!1;let n=this.getSelectedPaths(),r=AG(t,n);return this.#r.canDrag?.(r)===!1?!1:(n.includes(t)||this.#ae([t],t,!1),this.#Pe(t),this.#i={draggedPaths:r,primaryPath:t,target:null},this.#De(),!0)}setDragTarget(e){let t=this.#i;if(t==null)return;let n=e;if(n!=null){let e=MG(t.draggedPaths,n);(NG(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}jG(t.target,n)||(this.#i={...t,target:n},this.#De())}cancelDrag(){this.#i!=null&&(this.#i=null,this.#De())}completeDrag(){let e=this.#i;if(e==null)return!1;this.#i=null;let t=e.target==null?null:{...e.target};if(t==null)return this.#De(),!1;let n=MG(e.draggedPaths,t);if(NG(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#De(),!1;let r=FG(e.draggedPaths,t);if(r==null)return this.#De(),!1;try{if(r.operations.length===1){let e=r.operations[0];if(e==null||e.type!==`move`)throw Error(`Expected a single move operation for one-item drops`);this.#H.move(e.from,e.to,{collision:e.collision})}else this.#ce(r.operations),this.#H.batch(r.operations)}catch(e){return this.#De(),this.#r?.onDropError?.(e instanceof Error?e.message:String(e),n),!1}return this.#r?.onDropComplete?.(r.result),!0}subscribe(e){return this.#t.add(e),e(),()=>{this.#t.delete(e)}}add(e){this.#H.add(e)}remove(e,t={}){this.#H.remove(e,t)}move(e,t,n={}){this.#H.move(e,t,n)}batch(e){this.#H.batch(e)}onMutation(e,t){let n=e,r=t,i=this.#n.get(n);return i??(i=new Set,this.#n.set(n,i)),i.add(r),()=>{let e=this.#n.get(n);e?.delete(r),e?.size===0&&this.#n.delete(n)}}setSearch(e){this.#Te(e,!0)}openSearch(e=``){this.#Te(e,!0)}closeSearch(){this.#Te(null,!0)}isSearchOpen(){return this.#M!==null}getSearchValue(){return this.#M??``}getSearchMatchingPaths(){return this.#k}focusNextSearchMatch(){this.#we(1)}focusPreviousSearchMatch(){this.#we(-1)}startRenaming(e=this.#c??``,t={}){if(!this.#w)return!1;let n=this.#H.getPathInfo(e);if(n==null)return!1;let r=n.path,i=XG(r),a=$G(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of qG(r))this.#H.isExpanded(e)||this.#H.expand(e);return this.#ae([r],r,!1),this.#M!=null&&(this.#Te(null,!1),this.#y?.(this.#M)),this.#Pe(r),this.#T=r,this.#E=QG(r),this.#D=t.removeIfCanceled??!1,this.#De(),!0}[nK](){return{cancel:()=>{this.#q()},commit:()=>{this.#J()},getPath:()=>this.#T,getValue:()=>this.#E,isActive:()=>this.#T!=null,setValue:e=>{this.#Y(e)}}}#q(){if(this.#T==null)return;let e=this.#T,t=this.#D;if(this.#T=null,this.#E=``,this.#D=!1,t){this.remove(e,XG(e)?{recursive:!0}:void 0);return}this.#Pe(e),this.#De()}#J(){let e=this.#T;if(e==null)return;if(this.#D&&this.#E.trim().length===0){this.#T=null,this.#E=``,this.#D=!1,this.remove(e,XG(e)?{recursive:!0}:void 0);return}let t=XG(e),n=EG({files:this.#H.list(),isFolder:t,nextBasename:this.#E,path:$G(e)});if(this.#T=null,this.#E=``,this.#D=!1,`error`in n){this.#Pe(e),this.#v?.(n.error),this.#De();return}if(n.sourcePath===n.destinationPath){this.#Pe(e),this.#De();return}this.#_?.({destinationPath:n.destinationPath,isFolder:n.isFolder,sourcePath:n.sourcePath}),this.move(eK(n.sourcePath,t),eK(n.destinationPath,t))}#Y(e){this.#T==null||this.#E===e||(this.#E=e,this.#De())}resetPaths(e,t={}){let n=this.#H.list().length,r=this.#G,i=LG({paths:e,preparedInput:t.preparedInput},`resetPaths`,this.#e.sort),a=this.#le(i.paths,i.preparedInput,t.initialExpandedPaths),o=this.#c,s=this.#T,c=this.getSelectedPaths(),l=this.#z;this.#K?.(),this.#H=a,this.#d.clear(),this.#he();let u=c.map(e=>a.getPathInfo(e)?.path??null).filter(e=>e!=null),d=!KG(this.#B,u);this.#B=new Set(u),d&&(this.#V+=1),this.#z=l==null?null:a.getPathInfo(l)?.path??null,this.#T=s==null?null:a.getPathInfo(s)?.path??null,this.#T??(this.#E=``,this.#D=!1),this.#je(o,o!=null||u.length>0||this.#z!=null),this.#K=this.#Re(),this.#De(),this.#Oe({canonicalChanged:!0,operation:`reset`,pathCountAfter:i.paths.length,pathCountBefore:n,projectionChanged:!0,usedPreparedInput:t.preparedInput!=null,visibleCountDelta:this.#G-r})}#X(e){this.#Ie();let t=JG(e),n=YG(e,t),r=null,i=null;for(let e of this.#be()){if(JG(e)!==t)continue;let a=YG(e,t);if(a<n){r=e;continue}if(a>n){i=e;break}}return r??i}#Z(e){let t=this.#Ce(e);if(t!==-1)return t;let n=qG(e);for(let e=n.length-1;e>=0;--e){let t=n[e];if(t==null)continue;let r=this.#Ce(t);if(r!==-1)return r}return this.#be().length>0?0:-1}#Q(e,t){let n=this.#d.get(e);if(n!=null)return n;let r=t??this.#H.getPathInfo(e);if(r==null)return null;let i=r.kind===`directory`?this.#oe(r.path):this.#se(r.path);return this.#d.set(r.path,i),i}#$(e,t,n,r){return{ancestorPaths:r.ancestorPaths,depth:e.depth,flattenedSegments:e.flattenedSegments?.map(e=>({isTerminal:e.isTerminal,name:e.name,path:e.path})),hasChildren:e.hasChildren,index:t,isExpanded:e.isExpanded,isFlattened:e.isFlattened,isFocused:r.path===this.#c,isSelected:this.#B.has(r.path),kind:e.kind,level:e.depth,name:e.name,path:r.path,posInSet:r.posInSet??this.#x[n]??0,setSize:r.setSize??this.#S[n]??0}}#ee(e){return this.#$(e.row,e.index,e.index,{ancestorPaths:e.ancestorPaths,path:e.row.path,posInSet:e.posInSet,setSize:e.setSize})}#te(e,t){let n=this.#H.getVisibleRowContext(e);return n==null?void 0:n.ancestorRows[t]??(t===n.ancestorRows.length&&n.row.kind===`directory`&&n.row.isExpanded?n:void 0)}#ne(e){let t=this.#a.get(e);if(t!=null)return t;let n=this.#u(e),r=n<0?[]:[...this.#ne(n),n];return this.#a.set(e,r),r}#re(e){let t=this.#o.get(e);if(t!=null)return t;let n=this.#ne(e).map(e=>this.#b[e]??``).filter(e=>e!==``);return this.#o.set(e,n),n}#ie(e){this.#H.collapse(e)}#ae(e,t=this.#z,n=!0){let r=[...new Set(e)],i=!KG(this.#B,r),a=this.#z!==t;!i&&!a||(this.#B=new Set(r),this.#z=t,i&&(this.#V+=1),n&&this.#De())}#oe(e){return{collapse:()=>{this.#ie(e)},deselect:()=>{this.deselectPath(e)},expand:()=>{this.#ke(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!0,isExpanded:()=>this.#H.isExpanded(e),isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)},toggle:()=>{this.#ze(e)}}}#se(e){return{deselect:()=>{this.deselectPath(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!1,isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)}}}#ce(e){let t=this.#H.list();this.#le(t).batch(e)}#le(e,t,n){return new sG({...this.#e,paths:e,preparedInput:t??void 0,...n===void 0?{}:{initialExpandedPaths:n}})}#ue(){return this.#h??=this.#H.list(),this.#h}#de(){if(this.#m!=null)return this.#m;let e=new Set;for(let t of this.#ue()){e.add(t);for(let n of qG(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#fe(){return this.#g??=this.#ue().map(ZG),this.#g}#pe(){return this.#f??=this.#de().filter(e=>e.endsWith(`/`)),this.#f}#me(){return this.#p??=this.#pe().map(ZG),this.#p}#he(){this.#f=null,this.#p=null,this.#m=null,this.#h=null,this.#g=null}#ge(){return this.#pe().filter(e=>this.#H.isExpanded(e))}#_e(e){let t=new Set(this.#j??[]);if(e)for(let e of this.#B)for(let n of qG(e))t.add(n);this.#ve(t)}#ve(e){this.#W=!0;try{for(let t of this.#pe()){let n=e.has(t),r=this.#H.isExpanded(t);n&&!r?this.#H.expand(t):!n&&r&&this.#H.collapse(t)}}finally{this.#W=!1}}#ye(){if(this.#M==null||this.#M.length===0){this.#k=[],this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let e=this.#b;if(this.#k=e.filter(e=>this.#O.has(e)),this.#A!==`hide-non-matches`||this.#O.size===0){this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let t=[],n=[],r=new Map;for(let[i,a]of e.entries())this.#N?.has(a)===!0&&(r.set(a,n.length),t.push(i),n.push(a));this.#F=t,this.#I=n,this.#P=r,this.#G=n.length}#be(){return this.#I??this.#b}#xe(e){return this.#I==null?this.#H.getVisibleIndex(e)??-1:this.#P?.get(e)??-1}#Se(e){return this.#F?.[e]??e}#Ce(e){return this.#P?.get(e)??this.#H.getVisibleIndex(e)??-1}#we(e){let t=this.#k;if(t.length===0)return;let n=this.#c,r=n==null?-1:t.indexOf(n),i=t[r<0?e>0?0:t.length-1:Math.min(t.length-1,Math.max(0,r+e))];i!=null&&this.focusPath(i)}#Te(e,t){let n=e==null?null:tK(e),r=this.#M;if(r!==n){if(r==null&&n!=null&&(this.#j=this.#ge()),this.#M=n,n==null)this.#_e(!0),this.#j=null,this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else if(n.length===0)this.#_e(!1),this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else{let e=this.#Ee();this.#je(e,!0)}t&&(this.#y?.(this.#M),this.#De())}}#Ee(){if(this.#M==null||this.#M.length===0)return this.#O.clear(),this.#c;let e=this.#M,t=this.#ue(),n=this.#fe(),r=[],i=new Set,a=null;for(let o=0;o<t.length;o+=1){if(!n[o].includes(e))continue;let s=t[o];r.push(s),i.add(s),a??=s}let o=this.#pe(),s=this.#me();for(let t=0;t<o.length;t+=1){if(!s[t].includes(e))continue;let n=o[t];i.has(n)||(r.push(n),i.add(n),a??=n)}this.#O=i;let c=this.#A===`hide-non-matches`&&r.length>0?new Set:null;this.#N=c;let l=this.#A===`expand-matches`?new Set(this.#j??[]):new Set;for(let e of r){c?.add(e),e.endsWith(`/`)&&l.add(e);for(let t of qG(e))l.add(t),c?.add(t)}return this.#ve(l),a??this.#c}#De(){for(let e of this.#t)e()}#Oe(e){this.#n.get(e.operation)?.forEach(t=>{t(e)}),this.#n.get(`*`)?.forEach(t=>{t(e)})}#ke(e){for(let t of qG(e))this.#H.isExpanded(t)||this.#H.expand(t);this.#H.isExpanded(e)||this.#H.expand(e)}#Ae(e){let t=this.#G;if(t===0)return;let n=this.#s===-1?0:this.#s,r=Math.min(t-1,Math.max(0,n+e));(r!==n||this.#s===-1)&&(!this.#l&&this.#F==null&&r>=this.#b.length&&this.#Ie(),this.#Fe(r))}#je(e,t=!0){let n=this.#H.getVisibleCount();this.#U=n;let r=sK(this.#H.getVisibleTreeProjectionData(t?void 0:Math.min(n,rK)),e,t?e=>this.#H.getVisibleIndex(e):void 0);this.#a.clear(),this.#o.clear(),this.#l=r.paths.length>=n,this.#u=r.getParentIndex,this.#b=r.paths,this.#x=r.posInSetByIndex,this.#S=r.setSizeByIndex,this.#ye(),this.#s=e==null?this.#be().length>0?0:-1:this.#Z(e),this.#c=this.#s<0?null:this.#Me(this.#s)}#Me(e){return this.#be()[e]??(this.#F==null?this.#H.getVisibleRowContext(e)?.row.path??null:null)}#Ne(e){return this.#H.getPathInfo(e)?.path??null}#Pe(e){if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t,!1)}#Fe(e,t=!0){let n=this.#Me(e);n!=null&&(this.#s===e&&this.#c===n||(this.#s=e,this.#c=n,t&&this.#De()))}#Ie(){this.#l||this.#je(this.#c,!0)}#Le(e){let t=VG(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=VG(this.#c,e,!0),r=[...this.#B].map(t=>VG(t,e)).filter(e=>e!=null).map(e=>this.#H.getPathInfo(e)?.path??null).filter(e=>e!=null),i=VG(this.#z,e),a=i==null?null:this.#H.getPathInfo(i)?.path??null,o=[...new Set(r)];return KG(this.#B,o)||(this.#B=new Set(o),this.#V+=1),this.#z=a,n}#Re(){return this.#H.on(`*`,e=>{if(this.#W)return;e.canonicalChanged&&(this.#d.clear(),this.#he()),this.#i!=null&&RG(e)&&(this.#i=null);let t=RG(e)?this.#Le(e):this.#c,n=this.#M!=null&&this.#M.length>0?this.#Ee():this.#M===``?this.#c:t,r=this.#M!=null||e.operation!==`expand`&&e.operation!==`collapse`;this.#je(n,r),this.#De();let i=GG(e);i!=null&&this.#Oe(i)})}#ze(e){if(this.#H.isExpanded(e)){this.#ie(e);return}this.#ke(e)}},lK=e=>{if(e==null||e.length===0)return`0`;let t=`${e.length}`;for(let n of e)t+=`\0${n.path}\0${n.status}`;return t};function uK(e){let t=e.endsWith(`/`),n=``,r=-1;for(let t=0;t<=e.length;t+=1){if(!(e[t]===`/`||t===e.length)){r===-1&&(r=t);continue}r!==-1&&(n!==``&&(n+=`/`),n+=e.slice(r,t),r=-1)}return n===``?null:{isDirectory:t,path:n}}function dK(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function fK(e,t){return t?`${e}/`:e}function pK(e,t=null){let n=lK(e==null?void 0:[...e]);if(n===`0`)return null;if(t?.signature===n)return t;let r=new Map,i=new Set,a=new Set;for(let t of e??[]){let e=uK(t.path);if(e==null)continue;let n=fK(e.path,e.isDirectory);r.set(n,t.status),t.status===`ignored`&&e.isDirectory?a.add(n):e.isDirectory&&a.delete(n);for(let t of dK(e.path))i.add(t)}return{directoriesWithChanges:i,ignoredDirectoryPaths:a,signature:n,statusByPath:r}}var mK,hK,gK,_K,vK,yK,bK,xK,SK,CK,wK={},TK=[],EK=Array.isArray,DK=TK.slice,OK=Object.assign;function kK(e){e&&e.parentNode&&e.remove()}function AK(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e!=`function`?i=t[a]:o[a]=t[a];return arguments.length>2&&(o.children=arguments.length>3?DK.call(arguments,2):n),jK(e,o,r,i,null)}function jK(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++hK,__i:-1,__u:0};return i==null&&mK.vnode!=null&&mK.vnode(a),a}function MK(e){return e.children}function NK(e,t){this.props=e,this.context=t,this.__g=0}function PK(e,t){if(t==null)return e.__?PK(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?PK(e):null}function FK(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=n.__e;break}return FK(e)}}function IK(e){(8&e.__g||!(e.__g|=8)||!gK.push(e)||vK++)&&_K==mK.debounceRendering||((_K=mK.debounceRendering)||queueMicrotask)(LK)}function LK(){for(var e,t,n,r,i,a,o,s,c=1;gK.length;)gK.length>c&&gK.sort(yK),e=gK.shift(),c=gK.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=OK({},r)).__v=r.__v+1,mK.vnode&&mK.vnode(n),GK(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??PK(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,qK(a,n,o),n.__e!=i&&FK(n)));vK=0}function RK(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||TK,b=t.length;for(c=zK(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?wK:y[m.__i]||wK,m.__i=f,_=GK(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&XK(p.ref,null,m),u.push(m.ref,m.__c||h,m)),g==null&&h!=null&&(g=h),(v=!!(4&m.__u))||p.__k===m.__k?c=BK(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function zK(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(c=a+f,(o=e.__k[a]=typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?jK(null,o,null,null,null):EK(o)?jK(MK,{children:o},null,null,null):o.constructor==null&&o.__b>0?jK(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,s=null,(l=o.__i=VK(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=PK(s)),ZK(s,s));return r}function BK(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=BK(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=PK(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function VK(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;if(l===null&&e.key==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function HK(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function UK(e,t,n,r,i){var a;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||HK(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||HK(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(bK,`$1`)),(t=t.slice(2))[0].toLowerCase()!=t[0]&&(t=t.toLowerCase()),e.__l||={},e.__l[t+a]=n,n?r?n.l=r.l:(n.l=xK,e.addEventListener(t,a?CK:SK,a)):e.removeEventListener(t,a?CK:SK,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function WK(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=xK++;else if(t.u<n.l)return;return n(mK.event?mK.event(t):t)}}}function GK(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),n.__c.__z&&(s=t.__e=n.__e=(a=n.__c.__z)[0],n.__c.__z=null)),(d=mK.__b)&&d(t);n:if(typeof M==`function`)try{if(v=t.props,y=`prototype`in M&&M.prototype.render,b=(d=M.contextType)&&r[d.__c],x=d?b?b.props.value:d.__:r,n.__c?2&(f=t.__c=n.__c).__g&&(f.__g|=1,_=!0):(y?t.__c=f=new M(v,x):(t.__c=f=new NK(v,x),f.constructor=M,f.render=QK),b&&b.sub(f),f.props=v,f.state||={},f.context=x,f.__n=r,p=!0,f.__g|=8,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&M.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=OK({},f.__s)),OK(f.__s,M.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&M.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&M.getDerivedStateFromProps==null&&v!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),!(4&f.__g)&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(v,f.__s,x)||t.__v==n.__v){for(t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),S=0;S<f._sb.length;S++)f.__h.push(f._sb[S]);f._sb=[],f.__h.length&&o.push(f);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,g)})}if(f.context=x,f.props=v,f.__P=e,f.__g&=-5,C=mK.__r,w=0,y){for(f.state=f.__s,f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),T=0;T<f._sb.length;T++)f.__h.push(f._sb[T]);f._sb=[]}else do f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(8&f.__g&&++w<25);f.state=f.__s,f.getChildContext!=null&&(r=OK({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),E=d,d!=null&&d.type===MK&&d.key==null&&(E=JK(d.props.children)),s=RK(e,EK(E)?E:[E],t,n,r,i,a,o,s,c,l,u),t.__u&=-161,f.__h.length&&o.push(f),_&&(f.__g&=-4)}catch(e){if(t.__v=null,c||a!=null)if(e.then){for(D=0,O=!1,t.__u|=c?160:128,t.__c.__z=[],k=0;k<a.length;k++)(A=a[k])==null||O||(A.nodeType==8&&A.data==`$s`?(D>0&&t.__c.__z.push(A),D++,a[k]=null):A.nodeType==8&&A.data==`/$s`?(--D>0&&t.__c.__z.push(A),O=D===0,s=a[k],a[k]=null):D>0&&(t.__c.__z.push(A),a[k]=null));if(!O){for(;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__c.__z=[s]}t.__e=s}else{for(j=a.length;j--;)kK(a[j]);KK(t)}else t.__e=n.__e,t.__k=n.__k,e.then||KK(t);mK.__e(e,t,n)}else s=t.__e=YK(n.__e,t,n,r,i,a,o,c,l,u);return(d=mK.diffed)&&d(t),128&t.__u?void 0:s}function KK(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(KK)}function qK(e,t,n){for(var r=0;r<n.length;r++)XK(n[r],n[++r],n[++r]);mK.__c&&mK.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){mK.__e(e,t.__v)}})}function JK(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:EK(e)?e.map(JK):OK({},e)}function YK(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v=n.props,y=t.props,b=t.type;if(b==`svg`?i=`http://www.w3.org/2000/svg`:b==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||=`http://www.w3.org/1999/xhtml`,a!=null){for(u=0;u<a.length;u++)if((m=a[u])&&`setAttribute`in m==!!b&&(b?m.localName==b:m.nodeType==3)){e=m,a[u]=null;break}}if(e==null){if(b==null)return l.createTextNode(y);e=l.createElementNS(i,b,y.is&&y),s&&=(mK.__m&&mK.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=DK.call(e.childNodes),v=n.props||wK,!s&&a!=null)for(v={},u=0;u<e.attributes.length;u++)v[(m=e.attributes[u]).name]=m.value;for(u in v)if(m=v[u],u!=`children`){if(u==`dangerouslySetInnerHTML`)f=m;else if(!(u in y)){if(u==`value`&&`defaultValue`in y||u==`checked`&&`defaultChecked`in y)continue;UK(e,u,null,m,i)}}for(u in _=1&n.__u,y)m=y[u],u==`children`?p=m:u==`dangerouslySetInnerHTML`?d=m:u==`value`?h=m:u==`checked`?g=m:s&&typeof m!=`function`||v[u]===m&&!_||UK(e,u,m,v[u],i);if(d)s||f&&(d.__html==f.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(f&&(e.innerHTML=``),RK(b==`template`?e.content:e,EK(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&PK(n,0),s,c,l),a!=null)for(u=a.length;u--;)kK(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||UK(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&UK(e,u,g,v[u],i))}return e}function XK(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){mK.__e(e,n)}}function ZK(e,t,n){var r,i;if(mK.unmount&&mK.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||XK(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){mK.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&ZK(r[i],t,n||typeof e.type!=`function`);n||kK(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function QK(e,t,n){return this.constructor(e,n)}function $K(e,t){var n,r,i,a;t==document&&(t=document.documentElement),mK.__&&mK.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=AK(MK,null,[e]),i=[],a=[],GK(t,e,r||wK,wK,t.namespaceURI,r?null:t.firstChild?DK.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),qK(i,e,a)}function eq(e,t){e.__u|=32,$K(e,t)}mK={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!(1&i.__g)){i.__g|=4;try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=8&i.__g),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=8&i.__g),o)return void(i.__g|=2)}catch(t){e=t}}throw vK=0,e}},hK=0,NK.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=OK({},this.state);typeof e==`function`&&(e=e(OK({},n),this.props)),e&&OK(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),IK(this))},NK.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),IK(this))},NK.prototype.render=MK,gK=[],vK=0,yK=function(e,t){return e.__v.__b-t.__v.__b},bK=/(PointerCapture)$|Capture$/i,xK=0,SK=WK(!1),CK=WK(!0);var tq=0;Array.isArray;function nq(e,t,n,r,i,a){t||={};var o,s,c=t;if(`ref`in c&&typeof e!=`function`)for(s in c={},t)s==`ref`?o=t[s]:c[s]=t[s];var l={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--tq,__i:-1,__u:0,__source:i,__self:a};return mK.vnode&&mK.vnode(l),l}var rq=16,iq=16,aq={};function oq({name:e,remappedFrom:t,token:n,width:r,height:i,viewBox:a,label:o,alignCapitals:s=!1}){"use no memo";let c=`#${e.replace(/^#/,``)}`,{width:l,height:u,viewBox:d}=aq[e]??{width:rq,height:iq},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`;return nq(`svg`,{"data-icon-name":t??e,"data-icon-token":n,"data-align-capitals":s,...o==null?{"aria-hidden":!0}:{"aria-label":o,role:`img`},viewBox:m,width:f,height:p,children:nq(`use`,{href:c})})}var sq=e=>{if(e.length<2)return[e,``];let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]},cq=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`.`)+1,n=e.length-t>10,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},lq=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`/`)+1,n=e.length-t>25,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},uq=(e,{splitIndex:t}={})=>{if(typeof t!=`number`){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}return[e.slice(0,t),e.slice(t)]},dq=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=e.length-t;return[e.slice(0,n),e.slice(n)]},fq=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=t;return[e.slice(0,n),e.slice(n)]};function pq({children:e,marker:t,variant:n=`default`}){"use no memo";return nq(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:nq(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):n===`fade`?nq(`span`,{"data-truncate-fade":!0}):t})})}function mq(e){"use no memo";let{mode:t,children:n}=e;return nq(`div`,{children:[nq(`div`,{"data-truncate-content":`visible`,children:t===`fruncate`?nq(`span`,{children:n}):n}),nq(`div`,{"data-truncate-content":`overflow`,"aria-hidden":!0,children:t===`fruncate`?nq(`span`,{children:n}):n})]})}function hq({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=nq(mq,{mode:t,children:e},`content`),o=nq(pq,{marker:n,mode:t,variant:r},`marker`),s=nq(`div`,{"data-truncate-fill":!0},`fill`);return nq(`div`,{"data-truncate-container":t,"data-truncate-variant":r,...i,children:nq(`div`,{"data-truncate-grid":!0,children:t===`truncate`?[a,o]:[o,a,s]})})}function gq({children:e,...t}){"use no memo";return nq(hq,{mode:`truncate`,...t,children:e})}function _q({children:e,...t}){"use no memo";return nq(hq,{mode:`fruncate`,...t,children:e})}function vq({children:e,contents:t,priority:n=`end`,split:r=`center`,minimumLength:i=12,className:a,style:o,...s}){"use no memo";let c=null,l=null;if(Array.isArray(t)){if(t.length!==2)return console.error(`MiddleTruncate: contents must be an array of two items`),null;c=nq(gq,{...s,children:t[0]}),l=nq(_q,{...s,children:t[1]})}else{if(typeof e!=`string`)return console.error(`MiddleTruncate: children must be a string`),null;if(e.length===0)return nq(`div`,{className:a,style:o});if(e.length<i)return nq(n===`end`?_q:gq,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=sq:r===`extension`?t=cq:r===`leaf-path`&&(t=lq);else if(typeof r==`number`)t=uq,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=dq:e===`first`&&(t=fq)}else typeof r==`function`&&(t=r);t??=sq;let[f,p]=t(e,{priority:n,variant:s.variant,splitIndex:typeof u==`number`?u:void 0,splitOffset:typeof d==`number`?d:void 0}),m=f.length>=p.length,h=n===`equal`&&!m,g=n===`equal`&&m,_={},v={};h&&(_.marker=``),g&&(v.marker=``),c=nq(gq,{...s,..._,children:f}),l=nq(_q,{...s,...v,children:p})}return nq(`div`,{"data-truncate-group-container":`middle`,className:a,style:o,children:[nq(`div`,{"data-truncate-segment-priority":n===`start`||n===`equal`?`1`:`2`,children:c}),nq(`div`,{"data-truncate-segment-priority":n===`end`||n===`equal`?`1`:`2`,children:l})]})}var yq={endIndex:-1,startIndex:-1};function bq(e,t,n){return Math.min(Math.max(e,t),n)}function xq(e,t){return e<0||t<e?yq:{endIndex:t,startIndex:e}}function Sq(e){return e.startIndex<0||e.endIndex<e.startIndex}function Cq(e,t){return Sq(e)?0:(e.endIndex-e.startIndex+1)*t}function wq(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function Tq(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function Eq(e){let t=new Map;return e.forEach((e,n)=>{if(e.kind!==`directory`||!e.isExpanded)return;let r=e.ancestorPaths.length,i=t.get(r);if(i==null){t.set(r,[n]);return}i.push(n)}),t}function Dq(e,t){let n=0,r=e.length-1,i=-1;for(;n<=r;){let a=Math.floor((n+r)/2),o=e[a];if(o==null)break;if(o<=t){i=a,n=a+1;continue}r=a-1}return i}function Oq(e){let t=new Map,n=[];for(let r=0;r<e.length;r+=1){let i=e[r];if(i==null)continue;let a=i.kind===`directory`&&i.isExpanded?[...i.ancestorPaths,i.path]:i.ancestorPaths,o=0;for(;o<n.length&&o<a.length&&n[o]===a[o];)o+=1;for(let e=n.length-1;e>=o;--e){let i=n[e];i!=null&&t.set(i,r-1)}n.length=o;for(let e=o;e<a.length;e+=1){let t=a[e];t!=null&&n.push(t)}}let r=e.length-1;for(let e of n)t.set(e,r);return t}function kq(e,t,n){if(e.length===0||t<=0)return[];let r=Oq(e),i=Eq(e),a=[];for(let r=0;r<e.length;r+=1){let o=i.get(r);if(o==null||o.length===0)break;let s=t+r*n,c=Dq(o,Math.min(e.length-1,Math.floor(s/n))),l=null;for(;c>=0;){let t=o[c],n=t==null?null:e[t]??null;if(n!=null&&(r===0||n.ancestorPaths[r-1]===a[r-1]?.path)){l=n;break}--c}if(l==null)break;a.push(l)}return a.map((i,a)=>{let o=a*n,s=(r.get(i.path)??e.length-1)+1;if(s>=e.length)return{row:i,top:o};let c=s*n-t;return{row:i,top:Math.min(o,c-n)}}).filter(e=>e.top+n>0)}function Aq(e,t){let n=t.totalRowCount??e.length,r=n*t.itemHeight,i=Math.max(0,t.viewportHeight),a=Math.max(0,Math.floor(t.overscan)),o=Math.max(0,r-i),s=bq(t.scrollTop,0,o),c=t.stickyRows??kq(e,s,t.itemHeight),l=c.reduce((e,n)=>Math.max(e,n.top+t.itemHeight),0),u=Math.min(r,s+l),d=Math.max(0,i-l),f=Math.max(0,r-u),p=wq(s,n,t.itemHeight),m=wq(u,n,t.itemHeight),h=l<=0||p<0||p>=n?-1:p,g=h===-1?-1:Math.min(n-1,m-1),_=h===-1||g<h?0:g-h+1,v=d<=0||m>=n?yq:xq(m,Tq(u+d,n,t.itemHeight)),y=g+1,b=Sq(v)?yq:xq(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=Cq(b,t.itemHeight);return{occlusion:{firstOccludedIndex:h,lastOccludedIndex:g,occludedCount:_},physical:{itemHeight:t.itemHeight,maxScrollTop:o,overscan:a,scrollTop:s,totalHeight:r,totalRowCount:n,viewportHeight:i},projected:{contentHeight:f,paneHeight:d,paneTop:u},sticky:{height:l,rows:c},visible:v,window:{endIndex:b.endIndex,height:x,offsetTop:Sq(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var jq={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},Mq={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},Nq=`Contains git status items`;function Pq(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:i=0,viewportHeight:a}=e;if(n<0)return null;let o=Math.max(0,i),s=n*r,c=s+r;if(s<t+o){let e=Math.max(0,s-o);return e===t?null:e}if(c>t+a){let e=c-a;return e===t?null:e}return null}function Fq(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,offset:i,topInset:a=0,totalHeight:o,viewportHeight:s}=e;if(i===`nearest`)return Pq({currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:a,viewportHeight:s});if(n<0)return null;let c=Math.max(0,a),l=n*r,u=Math.max(0,s-c),d=i===`center`?c+Math.max(0,(u-r)/2):c,f=Math.max(0,o-s),p=Math.max(0,Math.min(l-d,f));return p===t?null:p}function Iq(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,targetViewportOffset:i,totalHeight:a,viewportHeight:o}=e;if(n<0)return null;let s=Math.max(0,i),c=n*r,l=c+r,u=t+s,d=t+o;if(c>=u&&l<=d)return null;let f=Math.max(0,a-o),p=Math.max(0,Math.min(c-s,f));return p===t?null:p}function Lq(e){if(e==null||!e.isConnected||e===document.body||e===document.documentElement)return!1;e.focus({preventScroll:!0});let t=e.getRootNode();return t instanceof ShadowRoot?t.activeElement===e:document.activeElement===e}function Rq(e){let t=e.getRootNode();if(t instanceof ShadowRoot){let e=t.activeElement;return e instanceof HTMLElement?e:null}let n=document.activeElement;return n instanceof HTMLElement&&e.contains(n)?n:null}function zq(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function Bq(e,t){return e!=null&&e>0?e:t}function Vq(e){let t=e.borderBoxSize,n=Array.isArray(t)?t[0]:t;return n!=null&&Number.isFinite(n.blockSize)&&n.blockSize>0?n.blockSize:e.contentRect.height>0?e.contentRect.height:null}function Hq(e,t,n,r,i=0){let a=Pq({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a==null?!1:(e.scrollTop=a,!0)}function Uq(e,t,n,r,i,a,o=0){let s=Fq({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,offset:a,topInset:o,totalHeight:i,viewportHeight:r});return s==null?!1:(e.scrollTop=s,!0)}function Wq(e,t,n,r,i,a){let o=Iq({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o==null?!1:(e.scrollTop=o,!0)}function Gq(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function Kq(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function qq({ariaLabel:e,isFlattened:t=!1,ref:n,value:r,onBlur:i,onInput:a}){return nq(`input`,{ref:n,"data-item-rename-input":!0,...t?{"data-item-flattened-rename-input":!0}:{},"aria-label":e,value:r,onBlur:i,onInput:a,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation()})}function Jq(e){let{row:t,mode:n,targetPath:r,ariaLabel:i,domId:a,isParked:o,itemHeight:s,features:c,state:l,extraStyle:u}=e,d=n===`sticky`,f=t.ancestorPaths.at(-1)??``,p={};return l.isFocusRinged&&(p[`data-item-focused`]=!0),t.isSelected&&(p[`data-item-selected`]=!0),l.isContextHovered&&(p[`data-item-context-hover`]=`true`),l.isDragTarget&&(p[`data-item-drag-target`]=!0),l.isDragging&&(p[`data-item-dragging`]=!0),l.effectiveGitStatus!=null&&(p[`data-item-git-status`]=l.effectiveGitStatus),l.containsGitChange&&(p[`data-item-contains-git-change`]=`true`),{"aria-expanded":!d&&t.kind===`directory`?t.isExpanded:void 0,"aria-haspopup":c.contextMenuEnabled?`menu`:void 0,"aria-label":i,"aria-level":d?void 0:t.level+1,"aria-posinset":d?void 0:t.posInSet+1,"aria-selected":d?void 0:t.isSelected?`true`:`false`,"aria-setsize":d?void 0:t.setSize,"data-file-tree-sticky-path":d?r:void 0,"data-file-tree-sticky-row":d?`true`:void 0,"data-item-context-menu-button-visibility":c.actionLaneEnabled?c.contextMenuButtonVisibility:void 0,"data-item-context-menu-trigger-mode":c.contextMenuEnabled?c.contextMenuTriggerMode:void 0,"data-item-has-context-menu-action-lane":c.actionLaneEnabled?`true`:void 0,"data-item-has-git-lane":c.gitLaneActive?`true`:void 0,"data-item-parent-path":f.length>0?f:void 0,"data-item-parked":o?`true`:void 0,"data-item-path":r,"data-item-type":t.kind===`directory`?`folder`:`file`,"data-type":`item`,id:d?void 0:a,role:d?void 0:`treeitem`,style:{minHeight:`${s}px`,...u},tabIndex:!d&&t.isFocused?0:-1,...p}}function Yq(e){let{event:t,mode:n,isSearchOpen:r,isDirectory:i}=e,a=t.ctrlKey||t.metaKey,o=t.shiftKey||a,s=t.shiftKey?{additive:a,kind:`range`}:a?{kind:`toggle`}:{kind:`single`};return{closeSearch:r,revealCanonical:n===`sticky`,selection:s,toggleDirectory:!o&&i}}var Xq,Zq,Qq,$q,eJ=Object.is,tJ=0,nJ=[],rJ=mK,iJ=rJ.__b,aJ=rJ.__r,oJ=rJ.diffed,sJ=rJ.__c,cJ=rJ.unmount,lJ=rJ.__;function uJ(e,t){rJ.__h&&rJ.__h(Zq,e,tJ||t),tJ=0;var n=Zq.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function dJ(e){return tJ=1,fJ(wJ,e)}function fJ(e,t,n){var r=uJ(Xq++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):wJ(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);eJ(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=Zq,!Zq.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,eJ(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};Zq.__f=!0;var a=Zq.shouldComponentUpdate,o=Zq.componentWillUpdate;Zq.componentWillUpdate=function(e,t,n){if(4&this.__g){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},Zq.shouldComponentUpdate=i}return r.__N||r.__}function pJ(e,t){var n=uJ(Xq++,3);!rJ.__s&&CJ(n.__H,t)&&(n.__=e,n.u=t,Zq.__H.__h.push(n))}function mJ(e,t){var n=uJ(Xq++,4);!rJ.__s&&CJ(n.__H,t)&&(n.__=e,n.u=t,Zq.__h.push(n))}function hJ(e){return tJ=5,gJ(function(){return{current:e}},[])}function gJ(e,t){var n=uJ(Xq++,7);return CJ(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function _J(e,t){return tJ=8,gJ(function(){return e},t)}function vJ(){for(var e;e=nJ.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(xJ),e.__H.__h.forEach(SJ),e.__H.__h=[]}catch(t){e.__H.__h=[],rJ.__e(t,e.__v)}}rJ.__b=function(e){Zq=null,iJ&&iJ(e)},rJ.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),lJ&&lJ(e,t)},rJ.__r=function(e){aJ&&aJ(e),Xq=0;var t=(Zq=e.__c).__H;t&&(Qq===Zq?(t.__h=[],Zq.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(xJ),t.__h.forEach(SJ),t.__h=[],Xq=0)),Qq=Zq},rJ.diffed=function(e){oJ&&oJ(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(nJ.push(t)!==1&&$q===rJ.requestAnimationFrame||(($q=rJ.requestAnimationFrame)||bJ)(vJ)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),Qq=Zq=null},rJ.__c=function(e,t){t.some(function(e){try{e.__h.forEach(xJ),e.__h=e.__h.filter(function(e){return!e.__||SJ(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],rJ.__e(n,e.__v)}}),sJ&&sJ(e,t)},rJ.unmount=function(e){cJ&&cJ(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{xJ(e)}catch(e){t=e}}),n.__H=void 0,t&&rJ.__e(t,n.__v))};var yJ=typeof requestAnimationFrame==`function`;function bJ(e){var t,n=function(){clearTimeout(r),yJ&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);yJ&&(t=requestAnimationFrame(n))}function xJ(e){var t=Zq,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),Zq=t}function SJ(e){var t=Zq;e.__c=e.__(),Zq=t}function CJ(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!eJ(t,e[n])})}function wJ(e,t){return typeof t==`function`?t(e):t}function TJ(e,t=null,n=null){"use no memo";let r=e.flattenedSegments;return r==null||r.length===0?t??e.name:nq(`span`,{"data-item-flattened-subitems":!0,children:r.map((e,i)=>{let a=i===r.length-1;return nq(MK,{children:[nq(`span`,{"data-item-flattened-subitem":e.path,"data-item-flattened-subitem-drag-target":n===e.path?`true`:void 0,children:a&&t!=null?t:nq(gq,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function EJ(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function DJ(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function OJ(e,t,n,r){return e.map((e,i)=>{let a=i*n,o=e.subtreeEndIndex+1;if(o>=r)return{row:e.row,top:a};let s=o*n-t;return{row:e.row,top:Math.min(a,s-n)}}).filter(e=>e.top+n>0)}function kJ({controller:e,itemHeight:t,overscan:n,scrollTop:r,stickyFolders:i,viewportHeight:a}){let o=e.getVisibleCount(),s=i&&o>0?e.getStickyRowCandidates(r,t):[],c=s==null&&i&&o>0?e.getVisibleRows(0,o-1):[],l=Aq(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:OJ(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?OJ(u,1,t,o):i&&r<=0&&c.length>0?kq(c,1,t):l.sticky.rows;return{overlayHeight:d.reduce((e,n)=>Math.max(e,n.top+t),0),overlayRows:d,snapshot:l,visibleRows:c}}var AJ=400,jJ=10,MJ=40,NJ=18;function PJ(e,t,n){let r=e,i=document.elementFromPoint?.bind(document)??null,a=r.elementFromPoint?.(t,n)??i?.(t,n)??null;return e instanceof ShadowRoot&&(a==null||!e.contains(a))?FJ(e,t,n):a instanceof HTMLElement?a:null}function FJ(e,t,n){let r=Array.from(e.querySelectorAll(`[data-type="item"], [data-item-flattened-subitem]`));for(let e=r.length-1;e>=0;e--){let i=r[e],a=i.getBoundingClientRect();if(t>=a.left&&t<=a.right&&n>=a.top&&n<=a.bottom)return i}return null}function IJ(e){let t=e?.closest?.(`[data-type="item"]`);if(!(t instanceof HTMLElement))return e?.closest?.(`[data-file-tree-virtualized-scroll]`)instanceof HTMLElement?{directoryPath:null,flattenedSegmentPath:null,hoveredPath:null,kind:`root`}:null;let n=t.dataset.itemPath??null;if(n==null)return null;let r=e?.closest?.(`[data-item-flattened-subitem]`),i=r instanceof HTMLElement?r.getAttribute(`data-item-flattened-subitem`)??null:null;if(i!=null&&i.endsWith(`/`))return{directoryPath:i,flattenedSegmentPath:i,hoveredPath:n,kind:`directory`};if(t.dataset.itemType===`folder`)return{directoryPath:n,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`};let a=t.dataset.itemParentPath??null;return a==null||a.length===0?{directoryPath:null,flattenedSegmentPath:null,hoveredPath:n,kind:`root`}:{directoryPath:a,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`}}function LJ(e){let t=e.cloneNode(!0);return t.removeAttribute(`id`),t.dataset.fileTreeDragPreview=`true`,t.setAttribute(`aria-hidden`,`true`),t.tabIndex=-1,Object.assign(t.style,{boxShadow:`0 4px 12px rgba(0, 0, 0, 0.15)`,left:`0px`,margin:`0`,pointerEvents:`none`,position:`fixed`,top:`0px`,willChange:`transform`,zIndex:`10000`}),t}function RJ(){return navigator.vendor!==`Apple Computer, Inc.`}function zJ(e,t){let n=e-t.top;if(n<MJ)return-Math.ceil((MJ-Math.max(0,n))/MJ*NJ);let r=t.bottom-e;return r<MJ?Math.ceil((MJ-Math.max(0,r))/MJ*NJ):0}function BJ(e,t){if(e!=null){let t=jq[e];return t==null?null:{text:t,title:Mq[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:Nq}:null}function VJ(e,t,n){if(t==null||t.size===0)return null;let r=[];for(let i=e.length-1;i>=0;--i){let a=e[i],o=n.get(a);if(o!=null){for(let e of r)n.set(e,o);return o?`ignored`:null}if(t.has(a)){n.set(a,!0);for(let e of r)n.set(e,!0);return`ignored`}r.push(a)}for(let e of r)n.set(e,!1);return null}function HJ(e){return e!=null&&`toggle`in e}function UJ(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function WJ(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function GJ(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function KJ(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function qJ(e,t){return t&&KJ(e)||(e.ctrlKey||e.metaKey)&&UJ(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var JJ=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function YJ(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&(t.dataset.fileTreeContextMenuRoot===`true`||t.dataset.type===`context-menu-anchor`||t.dataset.type===`context-menu-trigger`||t.getAttribute(`slot`)===`context-menu`))return!0;return!1}function XJ(e){return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width,x:e.x,y:e.y}}function ZJ(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function QJ(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function $J(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function eY(e,t,n){if(e==null)return null;let r=t.get(e)??null;if(r!=null)return r;let i=n.get(e)??null;return i?.dataset.itemParked===`true`?null:i}function tY(e){if(e==null)return[];let t=[];for(let n of e.querySelectorAll(`button[data-file-tree-sticky-row="true"]`)){if(!(n instanceof HTMLElement))continue;let e=n.dataset.fileTreeStickyPath;e!=null&&t.push(e)}return t}function nY(e,t){if(e==null||t==null)return null;for(let n of e.querySelectorAll(`button[data-item-focused="true"][data-item-parked="true"]`))if(n instanceof HTMLElement&&n.dataset.itemPath===t)return n;return null}function rY(e,t,n,r,i,a,o){let s=Math.max(0,a-i),c=t?.getBoundingClientRect()??null,l=c==null||n==null?null:n.getBoundingClientRect().top-c.top,u=nY(e,r),d=c==null||u==null?null:u.getBoundingClientRect().top-c.top;return Math.max(0,Math.min(d??Math.max(l??0,s),Math.max(0,o-i)))}function iY(e,t){return{kind:e.kind,name:DJ(e),path:t}}function aY(e){return e==null?void 0:`${e}__tree`}function oY(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function sY(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function cY(e,t){if(e==null)return null;if(`text`in e)return nq(`span`,{title:e.title,children:e.text});let n=typeof e.icon==`string`?sY(e.icon)?t(e.icon):{name:e.icon}:sY(e.icon.name)?(()=>{let n=t(e.icon.name),{name:r,...i}=e.icon;return{...n,...i}})():e.icon;return nq(`span`,{title:e.title,children:nq(oq,{...n})})}function lY(e){e!=null&&Lq(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function uY(e,t,{actionLaneEnabled:n=!1,customDecoration:r=null,decorationLaneEnabled:i=!1,dragTargetFlattenedSegmentPath:a=null,gitDecoration:o=null,gitLaneActive:s=!1,renameInput:c=null,showDecorativeActionAffordance:l=!1}={}){let u=EJ(e);return nq(MK,{children:[e.depth>0?nq(`div`,{"data-item-section":`spacing`,children:Array.from({length:e.depth}).map((t,n)=>nq(`div`,{"data-item-section":`spacing-item`,"data-ancestor-path":e.ancestorPaths[n]},n))}):null,nq(`div`,{"data-item-section":`icon`,children:e.kind===`directory`?nq(oq,{...t(`file-tree-icon-chevron`)}):nq(oq,{...t(`file-tree-icon-file`,u)})}),nq(`div`,{"data-item-section":`content`,children:e.isFlattened?TJ(e,c,a):c??nq(vq,{minimumLength:5,split:`extension`,children:e.name})}),i?nq(`div`,{"data-item-section":`decoration`,children:r==null?null:cY(r,t)}):null,s?nq(`div`,{"data-item-section":`git`,children:cY(o,t)}):null,n?nq(`div`,{"data-item-section":`action`,children:l?nq(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:nq(oq,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function dY(e,t,n,r={}){let{controller:i,renameView:a,visualFocusPath:o,contextHoverPath:s,draggedPathSet:c,dragTarget:l,dragAndDropEnabled:u,shouldSuppressContextMenu:d,handleRowDragStart:f,handleRowDragEnd:p,handleRowTouchStart:m,instanceId:h,itemHeight:g,gitStatusByPath:_,ignoredGitDirectories:v,ignoredInheritanceCache:y,directoriesWithGitChanges:b,gitLaneActive:x,contextMenuEnabled:S,contextMenuTriggerMode:C,contextMenuButtonTriggerEnabled:w,contextMenuButtonVisibility:T,contextMenuRightClickEnabled:E,registerRenameInput:D,registerButton:O,resolveIcon:k,renderDecorationForRow:A,openContextMenuForRow:j,onRowClick:M,onKeyDown:N}=e,P=EJ(t),{isParked:F=!1,mode:I=`flow`,style:L}=r,R=I===`sticky`,z=_?.get(P)??null??VJ(t.ancestorPaths,v,y),B=t.kind===`directory`&&(b?.has(P)??!1),V=A(t,P),H=BJ(z,B),U=S&&w,W=V!=null||x||U,G=U&&T===`always`,K=a.getPath()===P,ee=K?a.getValue():``,te=R||!K?null:nq(qq,{ref:D,ariaLabel:`Rename ${DJ(t)}`,isFlattened:t.isFlattened,value:ee,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),ne=uY(t,k,{actionLaneEnabled:U,customDecoration:V,decorationLaneEnabled:W,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:H,gitLaneActive:x,renameInput:te,showDecorativeActionAffordance:G}),q={...Jq({ariaLabel:DJ(t),domId:t.isFocused?oY(h,P,F):void 0,extraStyle:L,features:{actionLaneEnabled:U,contextMenuButtonVisibility:U?T:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:F,itemHeight:g,mode:I,row:t,state:{containsGitChange:B,effectiveGitStatus:z,isContextHovered:s===P,isDragTarget:l?.kind===`directory`&&l.directoryPath===P,isDragging:c?.has(P)===!0,isFocusRinged:t.isFocused&&o===P},targetPath:P}),key:n,onContextMenu:S||u?e=>{if(d()){e.preventDefault();return}S&&(e.preventDefault(),E&&(i.focusMountedPathFromInput(P),j(t,P,{anchorRect:ZJ(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:R?void 0:()=>{i.focusMountedPathFromInput(P)},onKeyDown:R?void 0:N,ref:e=>{O(P,e)}};return!R&&K?nq(`div`,{...q,children:ne}):nq(`button`,{...q,type:`button`,draggable:u&&!F,onDragEnd:u&&!F?p:void 0,onDragStart:u&&!F?e=>{f(e,t,P)}:void 0,onMouseDown:e=>{if(R){e.preventDefault();return}i.isSearchOpen()&&e.preventDefault()},onTouchStart:u&&!F?e=>{m(e,t,P)}:void 0,onClick:e=>{M(e,t,P,I)},children:ne})}function fY(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(EJ(e))).map((n,r)=>dY(e,n,t.start+r))}function pY({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=dG,overscan:c=10,renamingEnabled:l=!1,renderRowDecoration:u,searchBlurBehavior:d=`close`,searchEnabled:f=!1,searchFakeFocus:p=!1,slotHost:m,stickyFolders:h=!1,initialViewportHeight:g=420}){"use no memo";let _=hJ(null),v=hJ(null),y=hJ(!1),b=hJ(null),x=hJ(null),S=hJ(null),C=hJ(null),w=hJ(null),T=hJ(new Map),E=hJ(new Map),D=hJ(()=>{}),O=hJ(null),k=hJ(0),A=hJ(!1),j=hJ(null);j.current!==t&&(A.current=!1,j.current=t);let M=hJ(!1),N=hJ(null),P=hJ(null),F=hJ(!1),I=hJ(null),L=hJ(null),R=hJ(null),z=hJ(null),B=hJ(null),V=hJ(null),H=hJ(null),U=hJ(null),W=hJ(!1),G=hJ(null),K=hJ(null),ee=hJ(null),te=hJ(null),ne=gJ(()=>new Map,[]),[,q]=dJ(0),[re,ie]=dJ(null),[ae,oe]=dJ(null),[se,ce]=dJ(null),[le,ue]=dJ(null),[de,fe]=dJ(0),[pe,me]=dJ(null),he=hJ(pe);he.current=pe;let ge=hJ(null),_e=hJ(null),ve=hJ(null),ye=hJ(null),be=hJ(null),xe=hJ(!1),Se=()=>{_e.current=null,ve.current=null,ye.current=null},Ce=(e,t)=>{_e.current=e,ve.current=null,ye.current=t==null?null:{path:e,scrollTop:t}},we=(e,t)=>{_e.current=null,ve.current={path:e,viewportOffset:t},ye.current=null},Te=hJ(d===`retain`&&t.isSearchOpen()),[Ee,De]=dJ(p);pJ(()=>{p||De(!1)},[p]);let Oe=hJ(!1),ke=_J(()=>{Oe.current=!0,De(e=>e&&!1)},[]),[Ae,je]=dJ(()=>kJ({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[Me,Ne]=dJ(!1);pJ(()=>{Ne(!0)},[]);let Pe=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,Fe=e?.contextMenu?.triggerMode??(Pe?`right-click`:`both`),Ie=Fe===`both`||Fe===`button`,Le=e?.contextMenu?.buttonVisibility??`when-needed`,Re=Fe===`both`||Fe===`right-click`;mJ(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;be.current=t,oe(t),ue(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(xe.current=e.detail?.disabled===!0)};return e.addEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.addEventListener(`file-tree-debug-set-scroll-suppression`,n),()=>{e.removeEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.removeEventListener(`file-tree-debug-set-scroll-suppression`,n)}},[]);let ze=_J((e,t)=>{$J(T.current,e,t)},[]),Be=_J((e,t)=>{$J(E.current,e,t)},[]),Ve=_J(e=>{x.current=e},[]),He=_J(e=>eY(e,E.current,T.current),[]),Ue=n!=null||r!=null||i!=null,{resolveIcon:We}=gJ(()=>SV(a),[a]),Ge=t[nK](),Ke=Ge.getPath(),qe=Ke!=null,Je=t.isSearchOpen(),Ye=t.getSearchValue(),Xe=t.getFocusedPath(),Ze=t.getFocusedIndex(),Qe=t.getScrollRequest(),$e=t.isDragAndDropEnabled(),et=t.getDragSession(),tt=gJ(()=>et==null?null:new Set(et.draggedPaths),[et]),nt=et?.target??null,rt=et?.primaryPath??null,it=aY(o),{overlayHeight:at,overlayRows:ot,snapshot:st,visibleRows:ct}=Ae,lt=st.physical.viewportHeight,ut=gJ(()=>({end:st.window.endIndex,start:st.window.startIndex}),[st.window.endIndex,st.window.startIndex]),dt=ot,ft=st.sticky.rows,pt=st.physical.totalHeight,mt=st.sticky.height,ht=gJ(()=>new Set(ft.map(e=>EJ(e.row))),[ft]),J=Ze>=0&&Ze>=ut.start&&Ze<=ut.end,gt=_J((e,t)=>u?.({item:iY(e,t),row:e})??null,[u]),_t=_J(e=>Lq(e==null?null:T.current.get(e)??null)?!0:Lq(S.current),[]),vt=_J(e=>{_t(t.focusNearestPath(e))},[t,_t]),yt=hJ(vt);yt.current=vt;let bt=hJ(!0),xt=hJ(()=>{}),St=_J((t=!0)=>{let n=he.current;n!=null&&(bt.current=bt.current&&t,me(null),e?.contextMenu?.onClose?.(),bt.current&&vt(n.path))},[e?.contextMenu,vt]);xt.current=St;let Ct=_J(e=>{let t=e==null?null:QJ(S.current,e);ce(e=>e===t?e:t)},[]),wt=_J((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=He(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;Ce(n,e?.scrollTop??null),M.current=!0,ie(e=>e===n?e:n)}i.focus(),Ct(a),bt.current=!0,me({anchorRect:r?.anchorRect??null,item:iY(e,n),path:n,source:r?.source??`keyboard`})},[t,He,Ct]),Tt=_J(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=zq(e,lt);I.current=Ze<0||e==null?null:Math.max(0,Math.min(Ze*s-e.scrollTop,Math.max(0,t-s))),F.current=!0}t.startRenaming(e)!==!1&&(ue(`focus`),q(e=>e+1))}},[t,Ze,s,l,lt]),Et=_J((e,{restoreTreeFocus:n=!0,targetOffset:r=`live-overlay`}={})=>{let i=C.current;if(i==null)return!1;t.focusPath(e);let a=t.getFocusedIndex();if(a<0)return!1;let o=t.getVisibleRows(a,a)[0]??null;if(o==null)return!1;let l=zq(i,lt),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:kJ({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return M.current=!0,Wq(i,a,s,l,u,d),D.current(),ge.current=n?e:null,!0},[t,s,c,lt,h]),Dt=()=>y.current===!0||te.current!=null||W.current===!0,Ot=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),kt=e=>{if(e!=null){if(typeof window.cancelAnimationFrame==`function`){window.cancelAnimationFrame(e);return}window.clearTimeout(e)}},At=()=>{z.current!=null&&(clearTimeout(z.current),z.current=null),R.current=null},jt=()=>{V.current?.remove(),V.current=null},Mt=()=>{kt(L.current),L.current=null,B.current=null},Nt=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},Pt=()=>{U.current?.(),U.current=null,te.current!=null&&(clearTimeout(te.current),te.current=null),W.current=!1,G.current=null,ee.current=null,K.current!=null&&(K.current.setAttribute(`draggable`,`true`),K.current.style.removeProperty(`touch-action`),K.current=null),jt(),At(),Mt(),H.current=null},Ft=(e,n)=>{let r=S.current?.getRootNode(),i=IJ(PJ(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},It=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){At();return}let r=t.getItem(e.directoryPath),i=HJ(r)?r:null;if(i==null||i.isExpanded()){At();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;R.current!==a&&(At(),R.current=a,z.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind!==`directory`||n.directoryPath!==e.directoryPath||n.flattenedSegmentPath!==e.flattenedSegmentPath||i.expand()},n))},Lt=()=>{L.current=null;let e=B.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=zJ(e.clientY,r);if(i===0)return;let a=Math.max(0,n.scrollHeight-n.clientHeight),o=Math.max(0,Math.min(a,n.scrollTop+i));o!==n.scrollTop&&(n.scrollTop=o,D.current()),It(Ft(e.clientX,e.clientY)),L.current=Ot(Lt)},Rt=(e,t)=>{B.current={clientX:e,clientY:t},L.current??=Ot(Lt)},zt=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(Pt(),jt(),At(),Mt(),t.startDrag(r)===!1){e.preventDefault();return}if(H.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),RJ())){let t=LJ(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),Nt(t),V.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},Bt=()=>{jt(),At(),Mt(),H.current=null,t.cancelDrag()},Vt=(e,n,r)=>{if(te.current!=null||W.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;ee.current={clientX:i.clientX,clientY:i.clientY},K.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!W.current;te.current!=null&&(clearTimeout(te.current),te.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),U.current===o&&(U.current=null),t&&(a.setAttribute(`draggable`,`true`),K.current===a&&(K.current=null),ee.current=null)},s=e=>{let t=e.touches[0],n=ee.current;if(t==null||n==null)return;let r=t.clientX-n.clientX,i=t.clientY-n.clientY;r*r+i*i<=jJ*jJ||o()},c=()=>{o()};document.addEventListener(`touchmove`,s,{passive:!0}),document.addEventListener(`touchend`,c),document.addEventListener(`touchcancel`,c),U.current=o,te.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),K.current===a&&(K.current=null),ee.current=null;return}W.current=!0,K.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),H.current=n;let e=a.getBoundingClientRect(),s=LJ(a);Object.assign(s.style,{height:`${e.height}px`,opacity:`0.85`,transform:`translate3d(${e.left}px, ${e.top}px, 0)`,width:`${e.width}px`}),Nt(s),V.current=s,G.current={x:i.clientX-e.left,y:i.clientY-e.top};let c=e=>{let t=e.touches[0];if(t==null)return;e.preventDefault();let n=G.current;n!=null&&V.current!=null&&(V.current.style.transform=`translate3d(${t.clientX-n.x}px, ${t.clientY-n.y}px, 0)`),It(Ft(t.clientX,t.clientY)),Rt(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&Ft(n.clientX,n.clientY),t.completeDrag(),Pt()},u=()=>{t.cancelDrag(),Pt()};U.current=()=>{document.removeEventListener(`touchmove`,c),document.removeEventListener(`touchend`,l),document.removeEventListener(`touchcancel`,u)},document.addEventListener(`touchmove`,c,{passive:!1}),document.addEventListener(`touchend`,l),document.addEventListener(`touchcancel`,u)},AJ)},Ht=e=>{if(pe!=null){if(e.key===`Escape`){St(),e.preventDefault(),e.stopPropagation();return}JJ.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(Ge.isActive()){if(e.key===`Escape`)Ge.cancel();else if(e.key===`Enter`)Ge.commit();else return;ue(`focus`),q(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){Tt(Xe??void 0),e.preventDefault(),e.stopPropagation();return}if(Je){if(e.key===`Escape`)F.current=!1,I.current=null,t.closeSearch();else if(e.key===`Enter`){let e=t.getFocusedPath();e!=null&&t.selectOnlyPath(e);let n=C.current,r=zq(n,lt);I.current=Ze<0||n==null?null:Math.max(0,Math.min(Ze*s-n.scrollTop,Math.max(0,r-s))),F.current=!0,t.closeSearch()}else if(e.key===`ArrowDown`)t.focusNextSearchMatch();else if(e.key===`ArrowUp`)t.focusPreviousSearchMatch();else return;ue(`focus`),q(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&WJ(e)){t.openSearch(e.key),q(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=Pe&&KJ(e),r=qJ(e,Pe),i=r&&S.current!=null?Rq(S.current):null,a=r?new Set(tY(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==Xe&&a.has(o)){let e=C.current;Ce(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=HJ(p)?p:null,h=u!=null&&(ht.has(u)||c&&o===u&&a.has(u)),g=e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`ArrowRight`&&m!=null&&m.isExpanded(),_=e.key===`ArrowLeft`&&h&&m!=null&&m.isExpanded(),v=C.current,y=!0;if(e.shiftKey&&e.key===`ArrowDown`)t.extendSelectionFromFocused(1);else if(e.shiftKey&&e.key===`ArrowUp`)t.extendSelectionFromFocused(-1);else if(n&&u!=null&&d>=0){let e=t.getVisibleRows(d,d)[0]??null,n=eY(u,E.current,T.current);e==null||n==null?y=!1:wt(e,u)}else if((e.ctrlKey||e.metaKey)&&UJ(e))t.toggleFocusedSelection();else if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`a`)t.selectAllVisiblePaths();else switch(e.key){case`ArrowDown`:t.focusNextItem();break;case`ArrowUp`:t.focusPreviousItem();break;case`ArrowRight`:m==null||m.isExpanded()?t.focusNextItem():m.expand();break;case`ArrowLeft`:m!=null&&m.isExpanded()?m.collapse():t.focusParentItem();break;case`Home`:t.focusFirstItem();break;case`End`:t.focusLastItem();break;default:y=!1}if(!y)return;ue(`focus`);let b=t.getFocusedPath(),x=b!=null&&(ht.has(b)||a.has(b)),w=g&&b!==u,D=n&&c&&o===u&&b===u;if((h||D)&&b!=null&&(w&&x||D))Ce(b,v?.scrollTop??null),M.current=!0,ie(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(we(b,rY(S.current,v,i,u,s,mt,lt)),M.current=!0,ie(e=>e===b?e:b)):Se()}q(e=>e+1),e.preventDefault(),e.stopPropagation()};mJ(()=>{if(!(!f||!Je)){if(Te.current){Te.current=!1;return}Lq(w.current)}},[Je,f]),mJ(()=>{let e=x.current;switch(Kq({hasRenderedInput:e!=null,previousRenamingPath:P.current,renamingPath:Ke})){case`reset`:P.current=null;return;case`reveal-canonical`:Ke!=null&&Et(Ke,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(ge.current=null,P.current=Ke,Lq(e),e.select());return}},[ut.end,ut.start,Ke,Et,ht]),mJ(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=Rq(e)?.dataset.itemPath??null;ie(e=>e===t?e:t)},i=()=>{n(),M.current=!0,r()},a=i=>{let a=i.relatedTarget;if(a==null){n(),t=setTimeout(()=>{if(t=null,Rq(e)!=null){r();return}M.current=!1,ie(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),M.current=!1,ie(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;ie(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),mJ(()=>{let e=S.current;e!=null&&(st.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[st.physical.scrollTop]),mJ(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;O.current=zq(n,g);let a=()=>{let e=t.getVisibleCount(),r=Bq(O.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),je(kJ({controller:t,itemHeight:s,overscan:c,scrollTop:Math.min(n.scrollTop,i),stickyFolders:h,viewportHeight:r}))};if(!A.current){A.current=!0;let e=t.getFocusedIndex();if(e>=0){let r=Bq(O.current,g),i=t.getVisibleRows(e,e)[0]??null;Hq(n,e,s,r,h&&i!=null?Math.max(0,Math.min(i.ancestorPaths.length*s,Math.max(0,r-s))):0)}}D.current=a;let o=!1,l=t.subscribe(()=>{o?q(e=>e+1):o=!0,a()}),u=()=>{xe.current!==!0&&(r!=null&&(r.dataset.isScrolling??=``),i!=null&&(i.dataset.isScrolling??=``),y.current=!0,e!=null&&clearTimeout(e),e=setTimeout(()=>{r!=null&&delete r.dataset.isScrolling,i!=null&&delete i.dataset.isScrolling,y.current=!1,fe(e=>e+1),e=null},50))},d=null,f=()=>{i!=null&&delete i.dataset.overlayReveal,d!=null&&(clearTimeout(d),d=null)},p=()=>{i==null||xe.current===!0||n.scrollTop>0||(i.dataset.overlayReveal=`true`,d!=null&&clearTimeout(d),d=setTimeout(()=>{f()},200))},m=()=>{if(a(),n.scrollTop>0&&f(),he.current!=null&&y.current&&xt.current(),xe.current===!0){y.current=!1;return}oe(e=>e==null?e:null),u()},_=()=>{u(),p()},v=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`,` `,`Spacebar`]),x=e=>{v.has(e.key)&&_()};n.addEventListener(`scroll`,m,{passive:!0}),n.addEventListener(`wheel`,_,{passive:!0}),n.addEventListener(`touchmove`,_,{passive:!0}),n.addEventListener(`keydown`,x);let w=typeof ResizeObserver<`u`?new ResizeObserver(e=>{O.current=(e[0]==null?null:Vq(e[0]))??zq(n,g),a()}):null;return w?.observe(n),()=>{D.current=()=>{},l(),n.removeEventListener(`scroll`,m),n.removeEventListener(`wheel`,_),n.removeEventListener(`touchmove`,_),n.removeEventListener(`keydown`,x),e!=null&&clearTimeout(e),d!=null&&clearTimeout(d),r!=null&&delete r.dataset.isScrolling,i!=null&&(delete i.dataset.isScrolling,delete i.dataset.overlayReveal),y.current=!1,O.current=null,w?.disconnect()}},[t,g,s,c,h]),mJ(()=>{Pe||pe==null||St(!1)},[St,Pe,pe]);let Ut=gJ(()=>pe==null?null:`${pe.path}::${pe.source}`,[pe]);mJ(()=>{if(Ut==null){m?.clearSlotContent(mV);return}let t=he.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??XJ(n.getBoundingClientRect()),close:e=>{xt.current(e?.restoreFocus??!0)},restoreFocus:()=>{bt.current&&yt.current(he.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(mV,i),e?.contextMenu?.onOpen?.(t.item,r),lY(i),queueMicrotask(()=>{i==null||!i.isConnected||document.activeElement===i&&lY(i)}),()=>{m?.clearSlotContent(mV)}},[Ut,e?.contextMenu,m]),mJ(()=>{pe!=null&&t.getItem(pe.path)==null&&St()},[St,pe,t]),mJ(()=>{if(pe==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(YJ(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&St())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),St())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[St,pe]),mJ(()=>{let e=C.current,n=S.current;if(e==null||n==null){N.current=Xe;return}let r=Xe==null?null:T.current.get(Xe)??null,i=Rq(n),a=i?.dataset.itemPath??null,o=qe&&x.current===i,c=f&&w.current===i,l=F.current&&!Je,u=I.current??0,d=ge.current,p=_e.current,m=ve.current,g=ye.current,_=i!=null,v=M.current||_,y=N.current!==Xe,b=p!=null&&p===Xe&&Xe!=null,E=!1,O=!1;if(Qe!=null&&Qe.id!==k.current){k.current=Qe.id;let n=Qe.visibleIndex,r=t.getVisibleRows(n,n)[0]??null;if(r!=null){let t=h?Math.max(0,Math.min(r.ancestorPaths.length*s,Math.max(0,lt-s))):mt;E=!0,O=Uq(e,n,s,lt,pt,Qe.offset,t)}t.clearScrollRequest(Qe.id)}let A=!E&&l&&Wq(e,Ze,s,lt,pt,u),j=!E&&d!=null&&d===Xe&&Wq(e,Ze,s,lt,pt,mt),P=!E&&m!=null&&m.path===Xe&&Wq(e,Ze,s,lt,pt,m.viewportOffset),L=!E&&g!=null&&g.path===Xe&&e.scrollTop!==g.scrollTop;if(L&&(e.scrollTop=g.scrollTop),(L||O||j||P||A||v&&y&&d!==Xe&&!b&&Hq(e,Ze,s,lt,mt))&&D.current(),E){N.current=Xe;return}if(!v){N.current=Xe;return}if(o){N.current=Xe;return}if(c&&!l){N.current=Xe;return}if(r==null){l&&Ze>=0&&(Wq(e,Ze,s,lt,pt,u),D.current()),N.current=Xe;return}(y||l||d===Xe||p===Xe||m?.path===Xe||g?.path===Xe||a==null||a!==Xe)&&(Lq(r),d===Xe&&(ge.current=null),p===Xe&&(_e.current=null),m?.path===Xe&&(ve.current=null),g?.path===Xe&&(ye.current=null),F.current=!1,I.current=null),N.current=Xe},[t,Ze,Xe,J,s,qe,Je,ut,lt,f,Qe,h,mt,pt,ct]);let Wt=Ze>=0&&Ze>=st.visible.startIndex&&Ze<=st.visible.endIndex,Gt=Xe!=null&&dt.some(e=>EJ(e.row)===Xe),Kt=Wt||Gt,qt=Ie&&M.current===!0&&Kt?Xe:null,Jt=le===`pointer`?ae:null,Yt=pe?.path??be.current??Jt??qt??ae,Xt=pe?.source===`right-click`;mJ(()=>{y.current&&pe==null||Ct(He(Yt))},[pe,He,ut,lt,de,dt,Yt,Ct,ct]);let Y=_J(e=>{if(y.current||YJ(e))return;let t=e.target;if(!(t instanceof HTMLElement)||t.closest?.(`[data-type="context-menu-trigger"]`)!=null)return;let n=t.closest?.(`[data-file-tree-sticky-row="true"]`),r=t.closest?.(`[data-type="item"]`),i=n instanceof HTMLElement?n.dataset.fileTreeStickyPath??null:r instanceof HTMLElement?r.dataset.itemPath??null:null;i!=null&&ue(e=>e===`pointer`?e:`pointer`),oe(e=>e===i?e:i)},[]),Zt=_J(()=>{oe(null)},[]);mJ(()=>{if(!$e)return;let e=()=>{Pt(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),Pt(),t.cancelDrag()}},[t,$e]);let Qt=e=>{if(!$e||t.getDragSession()==null||W.current)return;let n=IJ(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),It(t.getDragSession()?.target??null),Rt(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},$t=e=>{if(!$e||t.getDragSession()==null||W.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(At(),Mt(),t.setDragTarget(null))},X=e=>{!$e||t.getDragSession()==null||W.current||(e.preventDefault(),Ft(e.clientX,e.clientY),t.completeDrag(),jt(),At(),Mt(),H.current=null)},en=st.window.height,tn=st.window.offsetTop,nn=Math.min(0,lt-en),rn=Math.min(0,lt-en-mt),an=re===Xe||F.current,on=Xe!=null&&an&&!J&&Ze>=0?ct[Ze]??t.getVisibleRows(Ze,Ze)[0]??null:null,sn=on==null?null:Gq(Ze,s,ut,en),cn=H.current,ln=rt!=null&&cn!=null&&cn.path===rt&&cn.index>=ut.start&&cn.index<=ut.end,un=rt!=null&&cn!=null&&cn.path===rt&&!ln&&cn.path!==on?.path?cn:null,dn=un==null?null:Gq(un.index,s,ut,en),fn=GJ((Ze>=0?ct[Ze]??t.getVisibleRows(Ze,Ze)[0]??null:null)?.ancestorPaths.at(-1)??null),pn=Je&&Xe!=null?oY(o,Xe,!J):void 0,mn=pe?.path??(Je?Xe:re),hn=pe?.path??ae,gn=He(Yt),_n=Pe&&Ie&&!Xt&&!qe&&gn!=null&&se!=null&&Yt!=null,vn=Pe&&(_n||pe!=null),yn=pe?.anchorRect,bn=yn==null&&gn!=null&&se!=null&&(pe!=null||_n)?se:null,xn=yn==null?bn==null?void 0:{top:`${bn}px`}:{left:`${yn.left}px`,position:`fixed`,right:`auto`,top:`${yn.top}px`},Sn=Xt?{opacity:`0`}:void 0,Cn=_J((e,n,r,i)=>{let a=Yq({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:Je,mode:i}),o=a.toggleDirectory&&n.kind===`directory`,s=o?t.resolveMountedDirectoryPathFromInput(r):null;if(o&&s==null)return;let c=s??r;switch(a.selection.kind){case`range`:t.selectPathRange(c,a.selection.additive);break;case`toggle`:t.togglePathSelectionFromInput(c);break;case`single`:t.selectOnlyMountedPathFromInput(c);break}let l=e.currentTarget instanceof HTMLElement?e.currentTarget:null,u=n.index>=st.visible.startIndex&&n.index<=st.visible.endIndex,d=i===`flow`&&u&&l!=null&&l.dataset.itemParked!==`true`;t.focusMountedPathFromInput(c),d&&(M.current=!0,ie(e=>e===c?e:c),ue(`focus`)),o&&t.toggleMountedDirectoryFromInput(c),a.closeSearch&&t.closeSearch(),a.revealCanonical&&Et(c,{targetOffset:`sticky-parents`})},[t,Je,st.visible.endIndex,st.visible.startIndex,Et]),wn=()=>{if(y.current||!Ie||Yt==null||gn==null)return;let e=t.getItem(Yt);e!=null&&(Ct(gn),bt.current=!0,me({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:gn.getAttribute(`aria-label`)??Yt,path:e.getPath()},path:e.getPath(),source:`button`}))},Tn={contextHoverPath:hn,contextMenuButtonTriggerEnabled:Ie,contextMenuButtonVisibility:Le,contextMenuEnabled:Pe,contextMenuRightClickEnabled:Re,contextMenuTriggerMode:Fe,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:$e,draggedPathSet:tt,dragTarget:nt,gitLaneActive:Ue,gitStatusByPath:n,handleRowDragEnd:Bt,handleRowDragStart:zt,handleRowTouchStart:Vt,ignoredGitDirectories:r,ignoredInheritanceCache:ne,instanceId:o,itemHeight:s,onKeyDown:Ht,onRowClick:Cn,openContextMenuForRow:wt,registerButton:ze,registerRenameInput:Ve,renameView:Ge,renderDecorationForRow:gt,resolveIcon:We,shouldSuppressContextMenu:Dt,visualFocusPath:mn},En={...Tn,registerButton:Be};return nq(`div`,{ref:S,id:it,"data-file-tree-context-menu-button-visibility":Pe&&Ie?Le:void 0,"data-file-tree-context-menu-trigger-mode":Pe?Fe:void 0,"data-file-tree-has-context-menu-action-lane":Pe&&Ie?`true`:void 0,"data-file-tree-has-git-lane":Ue?`true`:void 0,"data-file-tree-virtualized-root":`true`,"data-file-tree-root-drag-target":nt?.kind===`root`?`true`:void 0,onDragLeave:$e?$t:void 0,onDragOver:$e?Qt:void 0,onDrop:$e?X:void 0,onKeyDown:Ht,onPointerLeave:Pe?Zt:void 0,onPointerOver:Pe?Y:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[nq(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:fn}}),nq(`slot`,{name:pV,"data-type":`header-slot`}),f?nq(`div`,{"data-file-tree-search-container":!0,"data-open":Je?`true`:`false`,children:nq(`input`,{ref:w,"aria-activedescendant":pn,"aria-controls":it,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":Ee?`true`:void 0,value:Ye,onBlur:()=>{d===`retain`&&!Oe.current||t.closeSearch()},onFocus:ke,onPointerDown:ke,onInput:e=>{ke();let n=e.currentTarget;t.setSearch(n.value)}})}):null,nq(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&Me&&dt.length>0?nq(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:nq(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${at}px`},children:dt.map((e,t)=>dY(En,e.row,`sticky:${EJ(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${dt.length-t}`}}))})}):null,nq(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${pt}px`},children:[nq(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${tn}px`}}),nq(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${en}px`,top:`${nn}px`,bottom:`${rn}px`},children:[fY(Tn,ut,ht),on!=null&&sn!=null?dY(Tn,on,`parked:${on.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:rt===on.path?`none`:void 0,position:`absolute`,right:`0`,top:`${sn}px`}}):null,un!=null&&dn!=null?dY(Tn,un,`parked-drag:${un.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${dn}px`}}):null]})]})]}),Pe?nq(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":vn?`true`:`false`,style:xn,children:[nq(`button`,{ref:v,type:`button`,"data-type":hV,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":pe==null?`false`:`true`,"data-visible":_n?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),pe!=null){St();return}wn()},tabIndex:-1,style:Sn,children:nq(oq,{...We(`file-tree-icon-ellipsis`)})}),pe==null?null:nq(`slot`,{name:mV})]}):null,pe==null?null:nq(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),St()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),St()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var mY={hydrateRoot:(e,t)=>{eq(AK(pY,t),e)},renderRoot:(e,t)=>{$K(AK(pY,t),e)},unmountRoot:e=>{$K(null,e)}};function hY(e,t){mY.renderRoot(e,t)}function gY(e,t){mY.hydrateRoot(e,t)}function _Y(e){mY.unmountRoot(e)}var vY=class{#e=new Map;#t=null;clearAll(){for(let e of this.#e.values())e.remove();this.#e.clear()}clearSlotContent(e){let t=this.#n(e);t!=null&&(t.remove(),this.#e.delete(e))}setHost(e){if(this.#t=e,e!=null){this.#i(e);for(let[e,t]of this.#e)this.#r(e,t)}}setSlotContent(e,t){let n=this.#n(e);if(n===t){t!=null&&(this.#e.set(e,t),this.#r(e,t));return}if(n?.remove(),t==null){this.#e.delete(e);return}this.#e.set(e,t),this.#r(e,t)}setSlotHtml(e,t){let n=t?.trim()??``;if(n.length===0){this.setSlotContent(e,null);return}let r=this.#n(e);if(r!=null&&r.innerHTML===n){this.#e.set(e,r),this.#r(e,r);return}let i=document.createElement(`div`);i.innerHTML=n,this.setSlotContent(e,i)}#n(e){let t=this.#e.get(e)??null;if(t!=null)return t;let n=this.#t;if(n==null)return null;for(let t of Array.from(n.children))if(t instanceof HTMLElement&&t.dataset.fileTreeManagedSlot===e)return t;return null}#r(e,t){t.slot=e,t.dataset.fileTreeManagedSlot=e,this.#t!=null&&t.parentNode!==this.#t&&this.#t.appendChild(t)}#i(e){for(let t of Array.from(e.children)){if(!(t instanceof HTMLElement))continue;let e=t.dataset.fileTreeManagedSlot;e==null||this.#e.has(e)||this.#e.set(e,t)}}},yY=`__c`,bY=`__k`,xY=`__d`,SY=`__s`,CY=/[\s\n\\/='"\0<>]/,wY=/^(xlink|xmlns|xml)([A-Z])/,TY=/^(?:accessK|auto[A-Z]|cell|ch|col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|src[A-Z]|tabI|useM|item[A-Z])/,EY=/^ac|^ali|arabic|basel|cap|clipPath$|clipRule$|color|dominant|enable|fill|flood|font|glyph[^R]|horiz|image|letter|lighting|marker[^WUH]|overline|panose|pointe|paint|rendering|shape|stop|strikethrough|stroke|text[^L]|transform|underline|unicode|units|^v[^i]|^w|^xH/,DY=new Set([`draggable`,`spellcheck`]);function OY(e){e.__g===void 0?e[xY]=!0:e.__g|=8}function kY(e){e.__g===void 0?e[xY]=!1:e.__g&=-9}function AY(e){return e.__g===void 0?!0===e[xY]:!!(8&e.__g)}var jY=/["&<]/;function MY(e){if(e.length===0||!1===jY.test(e))return e;for(var t=0,n=0,r=``,i=``;n<e.length;n++){switch(e.charCodeAt(n)){case 34:i=`&quot;`;break;case 38:i=`&amp;`;break;case 60:i=`&lt;`;break;default:continue}n!==t&&(r+=e.slice(t,n)),r+=i,t=n+1}return n!==t&&(r+=e.slice(t,n)),r}var NY={},PY=new Set(`animation-iteration-count.border-image-outset.border-image-slice.border-image-width.box-flex.box-flex-group.box-ordinal-group.column-count.fill-opacity.flex.flex-grow.flex-negative.flex-order.flex-positive.flex-shrink.flood-opacity.font-weight.grid-column.grid-row.line-clamp.line-height.opacity.order.orphans.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.widows.z-index.zoom`.split(`.`)),FY=/[A-Z]/g;function IY(e){var t=``;for(var n in e){var r=e[n];if(r!=null&&r!==``){var i=n[0]==`-`?n:NY[n]||(NY[n]=n.replace(FY,`-$&`).toLowerCase()),a=`;`;typeof r!=`number`||i.startsWith(`--`)||PY.has(i)||(a=`px;`),t=t+i+`:`+r+a}}return t||void 0}function LY(){this.__d=!0}function RY(e,t){return{__v:e,context:t,props:e.props,setState:LY,forceUpdate:LY,__d:!0,__h:[]}}function zY(e,t,n){if(!e.s){if(n instanceof BY){if(!n.s)return void(n.o=zY.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(zY.bind(null,e,t),zY.bind(null,e,2));e.s=t,e.v=n;let r=e.o;r&&r(e)}}var BY=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,i=this.s;if(i){var a=1&i?t:n;if(a){try{zY(r,1,a(this.v))}catch(e){zY(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?zY(r,1,t?t(i):i):n?zY(r,1,n(i)):zY(r,2,i)}catch(e){zY(r,2,e)}},r},e}(),VY,HY,UY,WY,GY={},KY=Array.isArray,qY=Object.assign,JY=``,YY=`<!--$s-->`,XY=`<!--/$s-->`;function ZY(e,t){var n,r=e.type,i=!0;return e[yY]?(i=!1,(n=e[yY]).state=n[SY]):n=new r(e.props,t),e[yY]=n,n.__v=e,n.props=e.props,n.context=t,OY(n),n.state??=GY,n[SY]??(n[SY]=n.state),r.getDerivedStateFromProps?n.state=qY({},n.state,r.getDerivedStateFromProps(n.props,n.state)):i&&n.componentWillMount?(n.componentWillMount(),n.state=n[SY]===n.state?n.state:n[SY]):!i&&n.componentWillUpdate&&n.componentWillUpdate(),UY&&UY(e),n.render(n.props,n.state,t)}function QY(e,t,n,r,i,a,o){if(e==null||!0===e||!1===e||e===JY)return JY;var s=typeof e;if(s!=`object`)return s==`function`?JY:s==`string`?MY(e):e+JY;if(KY(e)){var c,l=JY;i[bY]=e;for(var u=e.length,d=0;d<u;d++){var f=e[d];if(f!=null&&typeof f!=`boolean`){var p,m=QY(f,t,n,r,i,a,o);typeof m==`string`?l+=m:(c||=Array(u),l&&c.push(l),l=JY,KY(m)?(p=c).push.apply(p,m):c.push(m))}}return c?(l&&c.push(l),c):l}if(e.constructor!==void 0)return JY;e.__=i,VY&&VY(e);var h=e.type,g=e.props;if(typeof h==`function`){var _,v,y,b=t;if(h===MK){if(`tpl`in g){for(var x=JY,S=0;S<g.tpl.length;S++)if(x+=g.tpl[S],g.exprs&&S<g.exprs.length){var C=g.exprs[S];if(C==null)continue;typeof C!=`object`||C.constructor!==void 0&&!KY(C)?x+=C:x+=QY(C,t,n,r,e,a,o)}return x}if(`UNSTABLE_comment`in g)return`<!--`+MY(g.UNSTABLE_comment)+`-->`;v=g.children}else{if((_=h.contextType)!=null){var w=t[_.__c];b=w?w.props.value:_.__}var T=h.prototype&&typeof h.prototype.render==`function`;if(T)v=ZY(e,b),y=e[yY];else{e[yY]=y=RY(e,b);for(var E=0;AY(y)&&E++<25;){kY(y),UY&&UY(e);try{v=h.call(y,g,b)}catch(t){throw a&&t&&typeof t.then==`function`&&(e._suspended=!0),t}}OY(y)}if(y.getChildContext!=null&&(t=qY({},t,y.getChildContext())),T&&mK.errorBoundaries&&(h.getDerivedStateFromError||y.componentDidCatch)){v=v!=null&&v.type===MK&&v.key==null&&v.props.tpl==null?v.props.children:v;try{return QY(v,t,n,r,e,a,!1)}catch(i){return h.getDerivedStateFromError&&(y[SY]=h.getDerivedStateFromError(i)),y.componentDidCatch&&y.componentDidCatch(i,GY),AY(y)?(v=ZY(e,t),(y=e[yY]).getChildContext!=null&&(t=qY({},t,y.getChildContext())),QY(v=v!=null&&v.type===MK&&v.key==null&&v.props.tpl==null?v.props.children:v,t,n,r,e,a,o)):JY}finally{HY&&HY(e),WY&&WY(e)}}}v=v!=null&&v.type===MK&&v.key==null&&v.props.tpl==null?v.props.children:v;try{var D=QY(v,t,n,r,e,a,o);return HY&&HY(e),mK.unmount&&mK.unmount(e),e._suspended?typeof D==`string`?YY+D+XY:KY(D)?(D.unshift(YY),D.push(XY),D):D.then(function(e){return YY+e+XY}):D}catch(i){if(!a&&o&&o.onError){var O=function i(s){return o.onError(s,e,function(e,s){try{return QY(e,t,n,r,s,a,o)}catch(e){return i(e)}})}(i);if(O!==void 0)return O;var k=mK.__e;return k&&k(i,e),JY}if(!a||!i||typeof i.then!=`function`)throw i;return i.then(function i(){try{var s=QY(v,t,n,r,e,a,o);return e._suspended?YY+s+XY:s}catch(e){if(!e||typeof e.then!=`function`)throw e;return e.then(i)}})}}var A,j=`<`+h,M=JY;for(var N in g){var P=g[N];if(typeof(P=eX(P)?P.value:P)!=`function`||N===`class`||N===`className`){switch(N){case`children`:A=P;continue;case`key`:case`ref`:case`__self`:case`__source`:continue;case`htmlFor`:if(`for`in g)continue;N=`for`;break;case`className`:if(`class`in g)continue;N=`class`;break;case`defaultChecked`:N=`checked`;break;case`defaultSelected`:N=`selected`;break;case`defaultValue`:case`value`:switch(N=`value`,h){case`textarea`:A=P;continue;case`select`:r=P;continue;case`option`:r!=P||`selected`in g||(j+=` selected`)}break;case`dangerouslySetInnerHTML`:M=P&&P.__html;continue;case`style`:typeof P==`object`&&(P=IY(P));break;case`acceptCharset`:N=`accept-charset`;break;case`httpEquiv`:N=`http-equiv`;break;default:if(wY.test(N))N=N.replace(wY,`$1:$2`).toLowerCase();else{if(CY.test(N))continue;N[4]!==`-`&&!DY.has(N)||P==null?n?EY.test(N)&&(N=N===`panose1`?`panose-1`:N.replace(/([A-Z])/g,`-$1`).toLowerCase()):TY.test(N)&&(N=N.toLowerCase()):P+=JY}}P!=null&&!1!==P&&(j=!0===P||P===JY?j+` `+N:j+` `+N+`="`+(typeof P==`string`?MY(P):P+JY)+`"`)}}if(CY.test(h))throw Error(h+` is not a valid HTML tag name in `+j+`>`);if(M||(typeof A==`string`?M=MY(A):A!=null&&!1!==A&&!0!==A&&(M=QY(A,t,h===`svg`||h!==`foreignObject`&&n,r,e,a,o))),HY&&HY(e),WY&&WY(e),!M&&$Y.has(h))return j+`/>`;var F=`</`+h+`>`,I=j+`>`;return KY(M)?[I].concat(M,[F]):typeof M==`string`?I+M+F:[I,M,F]}var $Y=new Set([`area`,`base`,`br`,`col`,`command`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]);function eX(e){return typeof e==`object`&&!!e&&typeof e.peek==`function`&&`value`in e}var tX=0;function nX(e){return e!=null&&e.length>0?e:(tX+=1,`pst_ft_${tX}`)}function rX({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??dG)}function iX(e){if(typeof document>`u`)return;let t=document.createElement(`div`);t.innerHTML=e;let n=t.querySelector(`svg`);return n instanceof SVGElement?n:void 0}function aX(e){return e.querySelector(`#file-tree-icon-chevron`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-file`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-dot`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-lock`)instanceof SVGElement}function oX(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var sX=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new vY;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y=null;#b;#x=!1;#S=!1;constructor(e){let{composition:t,density:n,fileTreeSearchMode:r,gitStatus:i,id:a,initialSearchQuery:o,icons:s,itemHeight:c,onSearchChange:l,onSelectionChange:u,overscan:d,renderRowDecoration:f,renaming:p,search:m,searchBlurBehavior:h,searchFakeFocus:g,stickyFolders:_,unsafeCSS:v,initialVisibleRowCount:y,...b}=e;this.#e=t,this.#n=nX(a),this.#p=pK(i),this.#m=s,this.#h=v,this.#r=u,this.#i=f,this.#a=p!=null&&p!==!1,this.#o=h,this.#s=m===!0,this.#c=g===!0,this.#u=uG(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new cK({...b,fileTreeSearchMode:r,initialSearchQuery:o,onSearchChange:l,renaming:p}),this.#v=this.#t.getSelectionVersion(),this.#y=this.#r==null?null:this.subscribe(()=>{this.#D()})}unmount(){this.#b!=null&&(_Y(this.#b),delete this.#b.dataset.fileTreeVirtualizedWrapper,this.#b=void 0),this.#l.clearAll(),this.#l.setHost(null),this.#f!=null&&(delete this.#f.dataset.fileTreeVirtualized,this.#I(this.#f),this.#f=void 0)}cleanUp(){this.unmount(),this.#y?.(),this.#y=null,this.#t.destroy()}getFileTreeContainer(){return this.#f}getItem(e){return this.#t.getItem(e)}getFocusedItem(){return this.#t.getFocusedItem()}getFocusedPath(){return this.#t.getFocusedPath()}getSelectedPaths(){return this.#t.getSelectedPaths()}getComposition(){return this.#e}getItemHeight(){return this.#u.itemHeight}getDensityFactor(){return this.#u.factor}subscribe(e){let t=!1;return this.#t.subscribe(()=>{if(!t){t=!0;return}e()})}focusPath(e){this.#t.focusPath(e)}scrollToPath(e,t){this.#t.scrollToPath(e,t)}focusNearestPath(e){return this.#t.focusNearestPath(e)}add(e){this.#t.add(e)}batch(e){this.#t.batch(e)}move(e,t,n){this.#t.move(e,t,n)}onMutation(e,t){return this.#t.onMutation(e,t)}setSearch(e){this.#t.setSearch(e)}openSearch(e){this.#t.openSearch(e)}closeSearch(){this.#t.closeSearch()}isSearchOpen(){return this.#t.isSearchOpen()}getSearchValue(){return this.#t.getSearchValue()}getSearchMatchingPaths(){return this.#t.getSearchMatchingPaths()}focusNextSearchMatch(){this.#t.focusNextSearchMatch()}focusPreviousSearchMatch(){this.#t.focusPreviousSearchMatch()}startRenaming(e,t){return this.#t.startRenaming(e,t)}remove(e,t){this.#t.remove(e,t)}resetPaths(e,t){this.#t.resetPaths(e,t)}setComposition(e){this.#e=e;let t=this.#T();t!=null&&(this.#O(),hY(t.wrapper,this.#w()))}setGitStatus(e){this.#p=pK(e,this.#p);let t=this.#T();t!=null&&hY(t.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),hY(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),gY(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),hY(r,this.#w())}#C(){return{initialViewportHeight:rX({initialVisibleRowCount:this.#d.initialVisibleRowCount,itemHeight:this.#d.itemHeight}),itemHeight:this.#d.itemHeight,overscan:this.#d.overscan,stickyFolders:this.#d.stickyFolders}}#w(){return{composition:this.#e,controller:this.#t,gitStatusByPath:this.#p?.statusByPath,ignoredGitDirectories:this.#p?.ignoredDirectoryPaths,directoriesWithGitChanges:this.#p?.directoriesWithChanges,icons:this.#m,instanceId:this.#n,renamingEnabled:this.#a,renderRowDecoration:this.#i,searchBlurBehavior:this.#o,searchEnabled:this.#s,searchFakeFocus:this.#c,slotHost:this.#l,...this.#C()}}#T(){let e=this.#f,t=this.#b;return e==null||t==null?null:{host:e,wrapper:t}}#E(e,t){let n=e.shadowRoot;n!=null&&(this.#k(n),this.#A(n)),this.#j(t)}#D(){let e=this.#r;if(e==null)return;let t=this.#t.getSelectionVersion();t!==this.#v&&(this.#v=t,e(this.#t.getSelectedPaths()))}#O(){let e=this.#e?.header?.render;if(e!=null){this.#l.setSlotContent(pV,e());return}this.#l.setSlotHtml(pV,this.#e?.header?.html??null)}#k(e){let t=oX(e).find(e=>aX(e)),n=iX(rV(_V(this.#m).set));n!=null&&(t!=null&&t.outerHTML===n.outerHTML||(t==null?e.prepend(n):t.replaceWith(n)))}#A(e){let t=oX(e),n=t.find(e=>aX(e)),r=t.filter(e=>e!==n),i=_V(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=iX(i);if(a==null){for(let e of r)e.remove();return}if(!(r.length===1&&r[0].outerHTML===a.outerHTML)){for(let e of r)e.remove();e.appendChild(a)}}#j(e){let t=_V(this.#m);t.colored&&aV(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${lV}]`);if(this.#g==null&&t instanceof HTMLStyleElement&&(this.#g=t),this.#h==null||this.#h===``){this.#g?.remove(),this.#g=void 0,this.#_=void 0;return}this.#g?.parentNode===e&&this.#_===this.#h||(this.#g??=document.createElement(`style`),this.#g.setAttribute(lV,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=hG(this.#h),this.#_=this.#h)}#N(e){if(this.#b!=null)return this.#b;let t=e.shadowRoot;if(t==null)throw Error(`FileTree requires a shadow root`);let n=Array.from(t.children).filter(e=>e instanceof HTMLDivElement&&typeof e.dataset.fileTreeId==`string`&&e.dataset.fileTreeId.length>0),r=n.find(e=>e.dataset.fileTreeId===this.#n)??n[0];return r!=null&&(this.#n=r.dataset.fileTreeId??this.#n),this.#b=r??document.createElement(`div`),this.#b.dataset.fileTreeId=this.#n,this.#b.dataset.fileTreeVirtualizedWrapper=`true`,this.#E(e,this.#b),this.#b.parentNode!==t&&t.appendChild(this.#b),this.#b}#P(e,t){let n=e??this.#f??document.createElement(`file-tree-container`);t!=null&&n.parentNode!==t&&t.appendChild(n);let r=n.shadowRoot??n.attachShadow({mode:`open`});return xG(n,r),this.#M(r),n.dataset.fileTreeVirtualized=`true`,n.style.display=`flex`,this.#F(n),this.#l.setHost(n),this.#f=n,n}#F(e){e.style.getPropertyValue(`--trees-item-height`)===``&&(e.style.setProperty(`--trees-item-height`,`${String(this.#u.itemHeight)}px`),this.#x=!0),e.style.getPropertyValue(`--trees-density-override`)===``&&(e.style.setProperty(`--trees-density-override`,String(this.#u.factor)),this.#S=!0)}#I(e){this.#x&&=(e.style.removeProperty(`--trees-item-height`),!1),this.#S&&=(e.style.removeProperty(`--trees-density-override`),!1)}},cX=typeof window>`u`?Q.useEffect:Q.useLayoutEffect;function lX(e,t,n){let r=e==null?null:(0,Z.jsx)(`div`,{slot:pV,children:e}),i=t!=null&&n!=null?(0,Z.jsx)(`div`,{slot:mV,children:t(n.item,n.context)}):null;return r==null&&i==null?null:(0,Z.jsxs)(Z.Fragment,{children:[r,i]})}function uX(e,t){return typeof window>`u`&&t!=null?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`template`,{shadowrootmode:`open`,dangerouslySetInnerHTML:{__html:t.shadowHtml}}),e]}):(0,Z.jsx)(Z.Fragment,{children:e})}function dX(e){let t=e.shadowRoot;return t?.querySelector(`[data-file-tree-id]`)instanceof HTMLElement||t?.querySelector(`[data-file-tree-id]`)instanceof SVGElement?!0:e.querySelector(`template[shadowrootmode="open"]`)instanceof HTMLTemplateElement}function fX(e,t,n,r,i){let a={...e??{}};if(t!=null&&delete a.header,n){let t=e?.contextMenu,n=t?.onClose,o=t?.onOpen;a.contextMenu={...t??{},enabled:!0,onClose:()=>{n?.(),r()},onOpen:(e,t)=>{i(e,t),o?.(e,t)}},delete a.contextMenu.render}return a.header!=null||a.contextMenu!=null?a:void 0}function pX({header:e,id:t,model:n,preloadedData:r,renderContextMenu:i,...a}){let[o,s]=(0,Q.useState)(null),[c,l]=(0,Q.useState)(null),u=(0,Q.useRef)(n.getComposition()),d=(0,Q.useRef)(n);d.current!==n&&(d.current=n,u.current=n.getComposition());let f=i!=null,p=(0,Q.useCallback)(()=>{s(null)},[]),m=(0,Q.useCallback)((e,t)=>{s({context:t,item:e})},[]),h=u.current,g=(0,Q.useMemo)(()=>fX(h,e,f,p,m),[h,p,m,f,e]),_=(0,Q.useCallback)(e=>{l(e)},[]);(0,Q.useEffect)(()=>{f||s(null)},[f]),cX(()=>{n.setComposition(g)},[g,n]),cX(()=>{if(c!=null)return r!=null&&dX(c)?n.hydrate({fileTreeContainer:c}):n.render({fileTreeContainer:c}),()=>{n.unmount(),n.setComposition(h)}},[h,c,n,r]);let v=uX(lX(e,i,o),r),y=t??r?.id,b={"--trees-item-height":`${String(n.getItemHeight())}px`,"--trees-density-override":n.getDensityFactor(),...a.style};return(0,Z.jsx)(sV,{...a,id:y,ref:_,style:b,suppressHydrationWarning:r!=null,children:v})}function mX(e){let[t]=(0,Q.useState)(()=>new sX(e)),n=(0,Q.useRef)({timeout:null,model:t});return(0,Q.useEffect)(()=>{let{current:e}=n;return e.timeout!=null&&(clearTimeout(e.timeout),e.timeout=null),()=>{e.timeout=setTimeout(()=>e.model.cleanUp(),1)}},[]),{model:t}}function hX(){let e=(0,$.c)(16),{_:t}=gt(),{projectLocalBinding:n}=od(),r;e[0]!==t||e[1]!==n?(r=()=>{if(n===null)return;let e=n.patch({appearance:{sidebar:{showHiddenFiles:!1,showOnlyMarkdownFiles:!1,showOkFolders:!1}}});e.ok||(console.warn(`[FileTreeFilteredToZeroNotice] view-filter reset rejected:`,hi(e.error)),gl.error(t({id:`P47EWZ`}),{description:hi(e.error)}))},e[0]=t,e[1]=n,e[2]=r):r=e[2];let i=r,a;e[3]===t?a=e[4]:(a=t({id:`WHPvOb`}),e[3]=t,e[4]=a);let o;e[5]===a?o=e[6]:(o=(0,Z.jsx)(`span`,{className:`select-none text-sidebar-foreground/30 text-sm`,children:a}),e[5]=a,e[6]=o);let s=n===null,c;e[7]===t?c=e[8]:(c=t({id:`jC8LSZ`}),e[7]=t,e[8]=c);let l;e[9]!==i||e[10]!==s||e[11]!==c?(l=(0,Z.jsx)(X,{variant:`link`,size:`sm`,className:`font-mono uppercase`,disabled:s,onClick:i,"data-testid":`reset-view-filters`,children:c}),e[9]=i,e[10]=s,e[11]=c,e[12]=l):l=e[12];let u;return e[13]!==o||e[14]!==l?(u=(0,Z.jsxs)(`div`,{"data-testid":`file-tree-filtered-to-zero`,className:`flex flex-1 flex-col items-center justify-center gap-3 py-8`,children:[o,l]}),e[13]=o,e[14]=l,e[15]=u):u=e[15],u}var gX={density:`compact`,itemHeight:26,flattenEmptyDirectories:!1},_X={"--trees-level-gap-override":`4px`,"--trees-item-row-gap-override":`4px`,"--trees-icon-width-override":`14px`,"--trees-item-height":`${gX.itemHeight}px`,"--trees-indent-guide-bg-override":`color-mix(in oklab, var(--trees-fg-muted) 30%, transparent)`},vX=`
1851
+ [data-item-section='spacing-item'] {
1852
+ opacity: 0.5;
1853
+ }
1854
+ :host(:hover) [data-item-section='spacing-item'] {
1855
+ opacity: 0.85;
1856
+ }
1857
+ `,yX=`
1858
+ [data-file-tree-sticky-overlay-content='true'] {
1859
+ --trees-bg: color-mix(in oklab, var(--sidebar) 92%, var(--sidebar-foreground) 8%);
1860
+ box-shadow: 0 1px 0 0 var(--sidebar-border);
1861
+ }
1862
+ /* Forced-colors mode suppresses box-shadow and overrides color-mix tints,
1863
+ so the divider above would vanish and the pinned region would read as
1864
+ part of scrolling content. Borders survive forced-colors — mirror the
1865
+ fallback pattern used by FILE_TREE_ROOT_DROP_CSS. */
1866
+ @media (forced-colors: active) {
1867
+ [data-file-tree-sticky-overlay-content='true'] {
1868
+ border-bottom: 1px solid CanvasText;
1869
+ }
1870
+ }
1871
+ `;function bX(e){return{...OV({type:e===`dark`?`dark`:`light`,colors:{"sideBar.background":`var(--sidebar)`,"sideBar.foreground":`var(--sidebar-foreground)`,"sideBar.border":`var(--sidebar-border)`,"list.activeSelectionBackground":`var(--sidebar-accent)`,"list.activeSelectionForeground":`var(--sidebar-accent-foreground)`,"list.hoverBackground":`var(--sidebar-hover)`,focusBorder:`var(--color-primary)`,"input.background":`var(--input)`,"input.border":`var(--border)`}}),"--trees-font-family-override":`var(--font-sans)`,"--trees-font-size-override":`0.875rem`,"--trees-item-padding-x-override":`0.5rem`,"--trees-padding-inline-override":`0.5rem`,"--trees-border-radius-override":`0.375rem`,"--trees-selected-fg":`var(--color-primary)`,"--truncate-marker-fade-in-duration":`0s`,"--trees-file-icon-color-markdown":`light-dark(var(--color-gray-400), var(--color-gray-500))`,"--trees-fg-muted":`light-dark(var(--color-gray-400), var(--color-gray-500))`,..._X}}var xX=`data-ok-ext-badge`,SX=`data-ok-ext-row`,CX=`data-ok-fullname-row`,wX=`
1872
+ [data-item-selected='true'] [data-icon-token='markdown'] {
1873
+ color: var(--trees-selected-fg);
1874
+ }
1875
+ [data-type='item'][${SX}] [data-truncate-segment-priority]:last-child {
1876
+ display: none;
1877
+ }
1878
+ [data-type='item'][${CX}] [data-truncate-segment-priority]:last-child {
1879
+ display: none;
1880
+ }
1881
+ [${xX}] {
1882
+ display: inline-block;
1883
+ margin-left: 0.375rem;
1884
+ margin-right: 0.25rem;
1885
+ align-self: center;
1886
+ color: color-mix(in oklab, var(--muted-foreground) 60%, transparent);
1887
+ font-size: 0.75rem;
1888
+ text-transform: uppercase;
1889
+ flex-shrink: 0;
1890
+ pointer-events: none;
1891
+ user-select: none;
1892
+ }
1893
+ `;function TX(e){let t=e.querySelectorAll(`[data-type="item"][data-item-path]`);for(let e of t){let t=e.dataset.itemPath;if(!t){DX(e);continue}if(t.endsWith(`/`)){kX(e,t);continue}let n=Rl(t);if(!n){DX(e);continue}let r=OX(e);if(r){if(e.setAttribute(SX,``),e.removeAttribute(CX),NX(r),n.toLowerCase()===`.md`){EX(e);continue}PX(e,n.slice(1).toUpperCase())}}}function EX(e){let t=e.querySelector(`[${xX}]`);t&&t.remove()}function DX(e){e.removeAttribute(SX),e.removeAttribute(CX),EX(e)}function OX(e){let t=e.querySelector(`[data-truncate-group-container="middle"]`);if(!t)return null;let n=t.querySelectorAll(`[data-truncate-segment-priority]`);return n.length<2?null:n[0]??null}function kX(e,t){e.removeAttribute(SX),EX(e);let n=OX(e),r=AX(t);if(!n||!r){e.removeAttribute(CX);return}MX(n,r),e.setAttribute(CX,``)}function AX(e){let t=e.replace(/\/+$/,``),n=t.lastIndexOf(`/`);return n>=0?t.slice(n+1):t}function jX(e,t){let n=e.querySelectorAll(`[data-truncate-content]`);for(let e of n){let n=e.firstChild;if(!n||n.nodeType!==Node.TEXT_NODE)continue;let r=n.textContent??``,i=t(r);i!==r&&(n.textContent=i)}}function MX(e,t){jX(e,()=>t)}function NX(e){jX(e,e=>e.replace(/\.+$/,``))}function PX(e,t){let n=e.querySelector(`[${xX}]`);if(!n){n=e.ownerDocument.createElement(`span`),n.setAttribute(xX,``),n.setAttribute(`aria-hidden`,`true`);let t=e.querySelector(`[data-item-section="action"]`);t?t.before(n):e.appendChild(n)}n.textContent!==t&&(n.textContent=t)}var FX=`ok-file-tree-link-decoration`,IX=`ok-file-tree-agent-decoration`,LX=`ok-file-tree-markdown`,RX=`<symbol id="${LX}" viewBox="${te}" fill="currentColor"><path d="${l}"/></symbol>`;function zX(e){return e.map(([e,{key:t,...n}])=>`<${e} ${Object.entries(n).map(([e,t])=>`${e}="${t}"`).join(` `)} />`).join(``)}function BX(e,t){return`<symbol id="${e}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${zX(t)}</symbol>`}var VX=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
1894
+ ${BX(FX,Xe)}
1895
+ ${BX(IX,xo)}
1896
+ ${RX}
1897
+ </svg>`;function HX(e){return e.replace(/\\/g,`\\\\`).replace(/\[/g,`\\[`).replace(/\]/g,`\\]`).replace(/\*/g,`\\*`)}function UX(e){let t=HX(e.path);return e.kind===`folder`?`/${t}/`:`/${t}${e.docExt??`.md`}`}var WX=/\.(md|mdx)$/i;function GX(e){let t=e.match(/^"(.+)" already exists\.$/);return t?t[1]:null}function KX(e){let t=e.match(WX);return t?t[0]:null}var qX=new Set([`agents`,`agent`,`claude`,`skill`]);function JX(e){let t=e.split(`/`).pop()?.replace(/\.md$/i,``).toLowerCase();return!!t&&qX.has(t)}function YX(e,t){return Nf({kind:e.endsWith(`/`)?`directory`:`file`,name:e,path:e},t)}function XX(e){let t=e.match(/\.(md|mdx)$/i);if(!t)return null;let n=t[0].toLowerCase()===`.md`?`.mdx`:`.md`;return`${e.slice(0,-t[0].length)}${n}`}function ZX(e,t){let n=XX(e);return n?t.includes(n):!1}function QX(e,t){return e!==t&&e.startsWith(t)}function $X(e,t){let n=[...new Set(e)].filter(e=>!Gl(e)),r=n.filter(e=>e.endsWith(`/`));return n.filter(e=>!r.some(t=>QX(e,t))).map(e=>YX(e,t))}function eZ(e,t){let n=e.getItem(t)??e.getItem(Yf(t));return n?.isDirectory()?Yf(rp(n.getPath())):t}function tZ(e){let t=e.getFocusedPath()??e.getSelectedPaths()[0]??null;return t?eZ(e,t):null}function nZ(e,t,n){let r=tZ(e);return!r||n.has(r)||Gl(r)?null:YX(r,t)}function rZ(e,t){let n=e.getSelectedPaths(),r=tZ(e);return $X(n.length>0?n.map(t=>eZ(e,t)):r?[r]:[],t)}function iZ(e,t){return e===t||e.startsWith(`${t}/`)}function aZ(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName;return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||e.isContentEditable||e.closest(`[contenteditable="true"]`)!==null}function oZ(e,t,n){let r=new Set,i=new Set,a=new Set;for(let o of e){if(o.kind===`file`){r.add(o.path);continue}if(o.kind===`asset`){a.add(o.path);continue}i.add(o.path);for(let e of t)Bl(e)&&e.docName.startsWith(`${o.path}/`)?r.add(e.docName):Kl(e)&&e.path.startsWith(`${o.path}/`)&&a.add(e.path);for(let e of n){let t=rp(e);iZ(t,o.path)&&i.add(t)}}return{docNames:r,folderPaths:i,assetPaths:a}}function sZ(e,t){return e.kind===`file`?t.kind===`file`&&e.path===t.createdPath:e.kind===`asset`?!1:iZ(t.createdPath,e.path)}function cZ(e){let t=new Map,n=new Map;for(let r of e)if(Bl(r)){let e=Zf(r.docName,r.docExt);t.has(e)||t.set(e,r)}else if(Ul(r)){let e=Yf(r.path);n.has(e)||n.set(e,r)}return{docsByTreePath:t,foldersByTreeDirectoryPath:n}}var lZ=`data-ok-problem`,uZ=`data-ok-problem-badge`,dZ=`
1898
+ [data-type='item'][${lZ}='warning'] [data-item-section='content'] {
1899
+ color: var(--ok-tree-problem-warning, oklch(70% 0.15 75));
1900
+ }
1901
+ [data-type='item'][${lZ}='error'] [data-item-section='content'] {
1902
+ color: var(--ok-tree-problem-error, oklch(55% 0.15 25));
1903
+ }
1904
+ [${uZ}] {
1905
+ display: inline-block;
1906
+ margin-left: 0.375rem;
1907
+ margin-right: 0.25rem;
1908
+ align-self: center;
1909
+ font-size: 0.6875rem;
1910
+ line-height: 1rem;
1911
+ min-width: 1rem;
1912
+ text-align: center;
1913
+ border-radius: 0.5rem;
1914
+ padding: 0 0.25rem;
1915
+ flex-shrink: 0;
1916
+ pointer-events: none;
1917
+ user-select: none;
1918
+ color: var(--ok-tree-problem-warning, oklch(70% 0.15 75));
1919
+ background: color-mix(in oklab, currentColor 14%, transparent);
1920
+ }
1921
+ [data-type='item'][${lZ}='error'] [${uZ}] {
1922
+ color: var(--ok-tree-problem-error, oklch(55% 0.15 25));
1923
+ }
1924
+ `;function fZ(e,t){let n=e.querySelectorAll(`[data-type="item"][data-item-path]`);for(let e of n){let n=e.dataset.itemPath;if(!n||n.endsWith(`/`)){pZ(e);continue}let r=t.get(fu(n));if(r===void 0||r.errorCount===0&&r.warningCount===0){pZ(e);continue}let i=r.errorCount>0?`error`:`warning`;e.getAttribute(`data-ok-problem`)!==i&&e.setAttribute(lZ,i),mZ(e,r.errorCount+r.warningCount)}}function pZ(e){e.hasAttribute(`data-ok-problem`)&&e.removeAttribute(lZ),e.querySelector(`[${uZ}]`)?.remove()}function mZ(e,t){let n=t>99?`99+`:String(t),r=e.querySelector(`[${uZ}]`);if(!r){r=e.ownerDocument.createElement(`span`),r.setAttribute(uZ,``),r.setAttribute(`aria-hidden`,`true`);let t=e.querySelector(`[data-item-section="action"]`);t?t.before(r):e.appendChild(r)}r.textContent!==n&&(r.textContent=n)}var hZ=`data-ok-renaming`,gZ=`data-ok-rename-selection-applied`,_Z=null,vZ=null,yZ=5e3,bZ=`
1925
+ /* Pierre's icon decoration keys off the row's data-item-path. If the user
1926
+ deletes the extension before commit, Pierre can temporarily key the row
1927
+ by an extensionless path and swap [data-icon-token] from 'markdown' to
1928
+ 'default' until the disk-truth refresh restores .md.
1929
+ Cover the wrong icon with a CSS-rendered markdown glyph for the duration.
1930
+ applyRenameInputAffordance records the in-flight markdown extension when
1931
+ the input mounts; the sweep stamps the marker only if Pierre later moves
1932
+ the row to an extensionless path, then clears it when the path next
1933
+ includes the saved extension (settle / cancel / row recycle to a settled
1934
+ file). */
1935
+ [${hZ}='.md'] [data-item-section="icon"],
1936
+ [${hZ}='.mdx'] [data-item-section="icon"] {
1937
+ position: relative;
1938
+ }
1939
+ [${hZ}='.md'] [data-item-section="icon"] [data-icon-token]:not([data-icon-token='markdown']),
1940
+ [${hZ}='.mdx'] [data-item-section="icon"] [data-icon-token]:not([data-icon-token='markdown']) {
1941
+ visibility: hidden;
1942
+ }
1943
+ [${hZ}='.md'] [data-item-section="icon"]::before,
1944
+ [${hZ}='.mdx'] [data-item-section="icon"]::before {
1945
+ content: '';
1946
+ display: block;
1947
+ position: absolute;
1948
+ inset: 0;
1949
+ margin: auto;
1950
+ width: 16px;
1951
+ height: 16px;
1952
+ background-color: currentColor;
1953
+ mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M1 12V4h2l2 2.5L7 4h2v8H7V7.5l-2 2-2-2V12zm9-3 3 3.5L16 9h-2V4h-2v5z'/></svg>") center / contain no-repeat;
1954
+ pointer-events: none;
1955
+ }
1956
+ `;function xZ(e){wZ(e);let t=e.querySelector(`[data-item-rename-input]`);if(!t)return;let n=t.closest(`[data-type="item"]`);if(!n)return;let r=n.dataset.itemPath??``;if(r.endsWith(`/`))return;let i=Rl(r);Il(r)&&SZ(i),!t.hasAttribute(gZ)&&(TZ(t),t.setAttribute(gZ,``))}function SZ(e){_Z=e,vZ!==null&&clearTimeout(vZ),vZ=setTimeout(CZ,yZ)}function CZ(){_Z=null,vZ!==null&&(clearTimeout(vZ),vZ=null)}function wZ(e){let t=e.querySelectorAll(`[${hZ}]`);for(let e of t){if(e.querySelector(`[data-item-rename-input]`))continue;let t=e.getAttribute(hZ);if(!t){e.removeAttribute(hZ);continue}let n=e.dataset.itemPath??``;if(n.toLowerCase().endsWith(t.toLowerCase())){e.removeAttribute(hZ);continue}let r=Rl(n);r&&r.toLowerCase()!==t.toLowerCase()&&e.removeAttribute(hZ)}if(_Z===null)return;let n=e.querySelectorAll(`[data-type="item"][data-item-path]`),r=!1;for(let e of n){let t=e.dataset.itemPath??``;!t||t.endsWith(`/`)||Rl(t)||(r=!0,e.getAttribute(`data-item-selected`)===`true`&&e.getAttribute(`data-ok-renaming`)!==_Z&&e.setAttribute(hZ,_Z))}let i=!!e.querySelector(`[data-item-rename-input]`);!r&&!i&&CZ()}function TZ(e){let t=Rl(e.value),n=t?e.value.length-t.length:e.value.length;e.setSelectionRange(0,n)}function EZ(e,t){e.getFocusedPath()===t&&e.scrollToPath(t,{offset:`nearest`,focus:!1})}function DZ(e){return{selectedFilePath:e,selectedFolderPath:null,navigationPath:e}}function OZ(e,t,n={}){if(!e)return DZ(t);let r=Xl(e);if(t&&r!==t)return DZ(t);switch(e.kind){case`doc`:return DZ(t??e.docName);case`large-file`:return DZ(e.docName);case`folder`:case`folder-index`:return{selectedFilePath:null,selectedFolderPath:e.folderPath,navigationPath:e.folderPath};case`missing`:return t&&n.isKnownDocument?.(t)?DZ(t):{selectedFilePath:null,selectedFolderPath:null,navigationPath:null};case`asset`:case`skill-file`:return{selectedFilePath:null,selectedFolderPath:null,navigationPath:null}}}function kZ(e,t){if(!e)return{kind:`none`};let n=t.find(t=>zf(t)===e),r=tp(e),i=e.endsWith(`/`)?r:np(e,t);return i===r?n&&Kl(n)?n.mediaKind===`mermaid`?{kind:`document`,path:n.path}:{kind:`asset`,path:n.path,hash:bu(n.path),mediaKind:n.mediaKind}:n&&Bl(n)?{kind:`document`,path:n.docName}:e.endsWith(`/`)?t.some(e=>Ul(e)?e.path===r||e.path.startsWith(`${r}/`):(Kl(e)?e.path:e.docName).startsWith(`${r}/`))?{kind:`folder`,path:r}:{kind:`none`}:t.some(e=>Bl(e)&&e.docName===r)?{kind:`document`,path:r}:{kind:`none`}:{kind:`document`,path:i}}var AZ=`You can restore this file from the Trash.`;function jZ(e){let t=AZ,n=`Move to Trash`,r=`Moving`;if(e.length===0)return{title:`Are you sure you want to delete the selected items?`,detail:t,listedTargets:null,confirmLabel:n,confirmLabelBusy:r};if(e.length===1){let i=e[0];return i?i.kind===`folder`?{title:`Are you sure you want to delete '${i.name}' and its contents?`,detail:t,listedTargets:null,confirmLabel:n,confirmLabelBusy:r}:{title:`Are you sure you want to delete '${i.name}'?`,detail:t,listedTargets:null,confirmLabel:n,confirmLabelBusy:r}:{title:`Are you sure you want to delete the selected item?`,detail:t,listedTargets:null,confirmLabel:n,confirmLabelBusy:r}}let i=e.some(e=>e.kind===`folder`),a=e.some(e=>e.kind!==`folder`);return i&&a?{title:`Are you sure you want to delete the following ${e.length} files/directories and their contents?`,detail:t,listedTargets:e,confirmLabel:n,confirmLabelBusy:r}:i?{title:`Are you sure you want to delete the following ${e.length} directories and their contents?`,detail:t,listedTargets:e,confirmLabel:n,confirmLabelBusy:r}:{title:`Are you sure you want to delete the following ${e.length} files?`,detail:t,listedTargets:e,confirmLabel:n,confirmLabelBusy:r}}function MZ(e,t){return e===`web`?null:jZ(t)}function NZ(e){return e.kind===`folder`?`${e.name}/`:e.kind===`asset`?e.name:e.docExt?`${e.name}${e.docExt}`:e.name}function PZ(e,t,n){let r=kZ(e,t);if(r.kind===`none`)return null;if(r.kind===`asset`)return{v:1,kind:`asset`,assetPath:r.path,mediaKind:r.mediaKind};if(r.kind===`folder`)return{v:1,kind:`folder`,folderPath:r.path};let i=t.find(e=>Bl(e)&&e.docName===r.path);return{v:1,kind:`doc`,docName:r.path,size:i?.size??n?.get(r.path)?.size??null}}var FZ=[`not-found`,`permission-denied`,`system-error`,`path-escape`];function IZ(e){return typeof e==`string`&&FZ.includes(e)?e:`system-error`}function LZ(e){switch(e){case`not-found`:return Cl._({id:`v41fCm`});case`permission-denied`:return Cl._({id:`sJK6pq`});case`system-error`:return Cl._({id:`Jqqevv`});case`path-escape`:return Cl._({id:`WL6puM`})}}function RZ(e){let t=LZ(e.reason),n=e.detail;return n?Cl._({id:`Z2M5XM`,values:{reason:t,osDetail:n}}):Cl._({id:`dTaauv`,values:{reason:t}})}function zZ(e){return e.kind===`folder`?`${e.name}/`:e.name}function BZ(e){let t=(0,$.c)(34),{failedTargets:n,isSubmitting:r,onDeletePermanently:i,onRetry:a,onCancel:o}=e,s=n.length>1,c=n[0],l=n.length,u;if(t[0]!==l||t[1]!==s||t[2]!==c){let e=c?zZ(c):``;u=s?Cl._({id:`5qNxOe`,values:{count:l}}):c?`${Cl._({id:`E_BHoD`,values:{targetName:e}})}\n${RZ(c)}`:Cl._({id:`kolRU1`}),t[0]=l,t[1]=s,t[2]=c,t[3]=u}else u=t[3];let d=u,f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(mn,{children:(0,Z.jsx)(J,{id:`aOp3hw`})}),t[4]=f):f=t[4];let p;t[5]===d?p=t[6]:(p=(0,Z.jsxs)(vn,{children:[f,(0,Z.jsx)(pn,{className:`whitespace-pre-wrap`,children:d})]}),t[5]=d,t[6]=p);let m;t[7]!==n||t[8]!==s?(m=s?(0,Z.jsx)(gn,{children:(0,Z.jsx)(`ul`,{className:`flex flex-col gap-2 text-xs`,children:n.map(VZ)})}):null,t[7]=n,t[8]=s,t[9]=m):m=t[9];let h;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(J,{id:`dEgA5A`}),t[10]=h):h=t[10];let g;t[11]!==r||t[12]!==o?(g=(0,Z.jsx)(X,{variant:`outline`,className:`font-mono uppercase`,onClick:o,disabled:r,"data-testid":`trash-failure-modal-cancel`,children:h}),t[11]=r,t[12]=o,t[13]=g):g=t[13];let _;t[14]===r?_=t[15]:(_=r?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Xc,{className:`size-4 animate-spin`}),` `,(0,Z.jsx)(J,{id:`mf37rL`})]}):(0,Z.jsx)(J,{id:`6gRgw8`}),t[14]=r,t[15]=_);let v;t[16]!==r||t[17]!==a||t[18]!==_?(v=(0,Z.jsx)(X,{variant:`outline`,className:`font-mono uppercase`,onClick:a,disabled:r,"data-testid":`trash-failure-modal-retry`,children:_}),t[16]=r,t[17]=a,t[18]=_,t[19]=v):v=t[19];let y;t[20]===r?y=t[21]:(y=r?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Xc,{className:`size-4 animate-spin`}),` `,(0,Z.jsx)(J,{id:`s3caR3`})]}):(0,Z.jsx)(J,{id:`UBv8UK`}),t[20]=r,t[21]=y);let b;t[22]!==r||t[23]!==i||t[24]!==y?(b=(0,Z.jsx)(X,{variant:`destructive`,onClick:i,disabled:r,"data-testid":`trash-failure-modal-delete-permanently`,children:y}),t[22]=r,t[23]=i,t[24]=y,t[25]=b):b=t[25];let x;t[26]!==b||t[27]!==g||t[28]!==v?(x=(0,Z.jsxs)(_n,{children:[g,v,b]}),t[26]=b,t[27]=g,t[28]=v,t[29]=x):x=t[29];let S;return t[30]!==x||t[31]!==p||t[32]!==m?(S=(0,Z.jsxs)(hn,{className:`sm:max-w-md`,children:[p,m,x]}),t[30]=x,t[31]=p,t[32]=m,t[33]=S):S=t[33],S}function VZ(e){return(0,Z.jsxs)(`li`,{"data-testid":`trash-failure-modal-target`,children:[(0,Z.jsx)(`div`,{className:`font-mono text-foreground`,children:zZ(e)}),(0,Z.jsx)(`div`,{className:`text-muted-foreground`,children:RZ(e)})]},e.path)}function HZ(e){let t=(0,$.c)(21),{parentDir:n,onSelectTemplate:r,ItemComponent:i}=e,{state:a}=Ms(n);if(a.status===`idle`||a.status===`loading`){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(J,{id:`Hl89Qd`}),t[0]=e):e=t[0];let n;return t[1]===i?n=t[2]:(n=(0,Z.jsx)(i,{disabled:!0,className:`text-muted-foreground`,children:e}),t[1]=i,t[2]=n),n}if(a.status===`error`){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(J,{id:`AQ-Lfg`}),t[3]=e):e=t[3];let n;return t[4]===i?n=t[5]:(n=(0,Z.jsx)(i,{disabled:!0,className:`text-muted-foreground`,children:e}),t[4]=i,t[5]=n),n}let o,s;if(t[6]!==i||t[7]!==r||t[8]!==a.data.folder.templates_available){s=Symbol.for(`react.early_return_sentinel`);bb0:{let e;t[11]===a.data.folder.templates_available?e=t[12]:(e=a.data.folder.templates_available??[],t[11]=a.data.folder.templates_available,t[12]=e);let n=Q_(e);if(n.length===0){let e;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(J,{id:`iGCs04`}),t[13]=e):e=t[13];let n;t[14]===i?n=t[15]:(n=(0,Z.jsx)(i,{disabled:!0,className:`text-muted-foreground`,children:e}),t[14]=i,t[15]=n),s=n;break bb0}let c;t[16]!==i||t[17]!==r?(c=e=>(0,Z.jsx)(i,{onSelect:()=>r(e.name),children:e.title??e.name},`${e.scope}:${e.source_folder}:${e.name}`),t[16]=i,t[17]=r,t[18]=c):c=t[18],o=n.map(c)}t[6]=i,t[7]=r,t[8]=a.data.folder.templates_available,t[9]=o,t[10]=s}else o=t[9],s=t[10];if(s!==Symbol.for(`react.early_return_sentinel`))return s;let c;return t[19]===o?c=t[20]:(c=(0,Z.jsx)(Z.Fragment,{children:o}),t[19]=o,t[20]=c),c}function UZ(e){return e?.isDirectory()?e:null}function WZ(e,t){let n=t.getPath();for(let t of e.getSelectedPaths())t!==n&&e.getItem(t)?.deselect();t.isSelected()||t.select()}function GZ(e){for(let t of e.getSelectedPaths())e.getItem(t)?.deselect()}function KZ(e,t,n,r,i){let a=(0,$.c)(11),o;a[0]!==n||a[1]!==t||a[2]!==e||a[3]!==r?(o=()=>{let i=()=>{queueMicrotask(()=>{r.current=!1})};if(r.current=!0,!t){GZ(e),i();return}let a=n?n.split(`\0`):[];for(let t of a){let n=UZ(e.getItem(t));n&&!n.isExpanded()&&n.expand()}let o=e.getItem(t);if(!o){GZ(e),i();return}if(e.getSelectedPaths().length>1&&o.isSelected()){o.focus(),i();return}WZ(e,o),o.focus(),i()},a[0]=n,a[1]=t,a[2]=e,a[3]=r,a[4]=o):o=a[4];let s;a[5]!==n||a[6]!==t||a[7]!==e||a[8]!==r||a[9]!==i?(s=[n,t,e,r,i],a[5]=n,a[6]=t,a[7]=e,a[8]=r,a[9]=i,a[10]=s):s=a[10],(0,Q.useEffect)(o,s)}var qZ=`open-knowledge:file-tree-menu-action-delete`,JZ=`open-knowledge:file-tree-menu-action-rename`,YZ=`open-knowledge:file-tree-menu-action-duplicate`;function XZ(e){window.dispatchEvent(new CustomEvent(qZ,{detail:{target:e}}))}function ZZ(e){let t=t=>{let n=t.detail;n?.target&&e(n.target)};return window.addEventListener(qZ,t),()=>window.removeEventListener(qZ,t)}function QZ(e){window.dispatchEvent(new CustomEvent(JZ,{detail:{target:e}}))}function $Z(e){let t=t=>{let n=t.detail;n?.target&&e(n.target)};return window.addEventListener(JZ,t),()=>window.removeEventListener(JZ,t)}function eQ(e){window.dispatchEvent(new CustomEvent(YZ,{detail:{target:e}}))}function tQ(e){let t=t=>{let n=t.detail;n?.target&&e(n.target)};return window.addEventListener(YZ,t),()=>window.removeEventListener(YZ,t)}var nQ={Accept:`application/x-ndjson, application/json`};function rQ(e){return!e.ok||!e.body?!1:(e.headers.get(`content-type`)??``).includes(`application/x-ndjson`)}var iQ=class extends Error{};function aQ(e){return typeof e==`object`&&!!e&&`type`in e}async function oQ(e,t={}){let n=e.body;if(!n)throw new iQ(`Show All Files stream had no response body.`);let{onBatch:r}=t,i=n.getReader(),a=new TextDecoder,o=[],s=[],c=!1,l=``,u=e=>{let t=e.trim();if(t.length===0)return!1;let n;try{n=JSON.parse(t)}catch{return console.warn(`[show-all-stream] dropping unparseable NDJSON line:`,t.slice(0,200)),!1}if(aQ(n)){if(n.type===`error`)throw new iQ(typeof n.problem?.title==`string`?n.problem.title:`Show All Files stream failed.`);return c=n.truncated===!0,!0}let r=Li.safeParse(n);return r.success?(o.push(r.data),s.push(r.data)):console.warn(`[show-all-stream] dropping schema-divergent entry line:`,r.error.issues),!1},d=()=>{if(!r||s.length===0)return;let e=s;s=[],r(e)};try{let e=!1;for(;!e;){let t=await i.read();if(t.done)break;l+=a.decode(t.value,{stream:!0});let n=l.indexOf(`
1957
+ `);for(;n!==-1;){let t=u(l.slice(0,n));if(l=l.slice(n+1),t){e=!0;break}n=l.indexOf(`
1958
+ `)}d()}l+=a.decode(),l.includes(`
1959
+ `)||u(l),d()}finally{i.releaseLock()}return{entries:o,truncated:c}}function sQ(e,t,n,r=Date.now()){if(n.size===0)return[...e];let i=new Set(e.map(e=>zf(e))),a=[];for(let e of t){let t=zf(e);if(i.has(t)){n.delete(t);continue}let o=n.get(t);if(o!==void 0){if(r-o>5e3){n.delete(t);continue}a.push(e)}}return a.length===0?[...e]:[...e,...a]}function cQ(e,t){if(t.length===0)return[...e];let n=new Set(e.map(e=>zf(e))),r=[...e];for(let e of t){let t=zf(e);n.has(t)||(n.add(t),r.push(e))}return r}function lQ(e,t,n,r,i=Date.now()){if(t!==``&&!e.some(e=>zf(e)===t))return[...e];let a=[],o=[];for(let n of e)uQ(t,zf(n))?a.push(n):o.push(n);let s=sQ(n,a,r,i),c=new Set(s.map(e=>zf(e)).filter(e=>e.endsWith(`/`)));return[...o.filter(e=>{let n=zf(e);if(!n.startsWith(t))return!0;let r=n.slice(t.length),i=r.indexOf(`/`);return i===-1?!0:c.has(t+r.slice(0,i+1))}),...s]}function uQ(e,t){if(!t.startsWith(e))return!1;let n=t.slice(e.length);if(n===``)return!1;let r=n.endsWith(`/`)?n.slice(0,-1):n;return r!==``&&!r.includes(`/`)}var dQ=du(`HOVER_INTENT_MS`,80),fQ=3,pQ=20,mQ=new Map,hQ=new Set,gQ=[],_Q=new Map;function vQ(e){for(_Q.delete(e),_Q.set(e,!0);_Q.size>pQ;){let e=_Q.keys().next().value;if(e===void 0)break;_Q.delete(e)}}function yQ(e){hQ.delete(e),xQ()}function bQ(e,t){let n=Date.now();lu(`ok/sidebar/prewarm-success`,{docName:e,t:n,poolEventId:t}),m(e,t,n)}function xQ(){for(;hQ.size<fQ&&gQ.length>0;){let e=gQ.shift();if(!e)break;if(!_Q.has(e.docName)){hQ.add(e.docName),vQ(e.docName);try{let t=e.prewarm(e.docName);t&&bQ(e.docName,t)}catch(t){lu(`ok/sidebar/prewarm-failed`,{docName:e.docName,message:t instanceof Error?t.message:String(t)})}finally{yQ(e.docName)}}}}function SQ(e,t){if(Ge(e)||_Q.has(e))return;let n=mQ.get(e);n&&clearTimeout(n.timer);let r=setTimeout(()=>{if(mQ.delete(e),hQ.size>=fQ){gQ.push({docName:e,prewarm:t});return}vQ(e),hQ.add(e);try{let n=t(e);n&&bQ(e,n)}catch(t){lu(`ok/sidebar/prewarm-failed`,{docName:e,message:t instanceof Error?t.message:String(t)})}finally{yQ(e)}},dQ);mQ.set(e,{timer:r,prewarm:t})}function CQ(e){let t=mQ.get(e);t&&(clearTimeout(t.timer),mQ.delete(e))}function wQ(e){window.requestAnimationFrame(()=>{let t=ut(e);if(!(!t||t.isDestroyed))try{t.commands.focus()}catch{}})}function TQ(e){let t=e.current;t.row?.removeAttribute(kQ),t.root?.removeAttribute(AQ),e.current={row:null,root:null}}function EQ(e,t){let n=e.current;n.row===t.row&&n.root===t.root||(TQ(e),t.row?.setAttribute(kQ,`true`),t.root?.setAttribute(AQ,`true`),e.current={row:t.row,root:t.root})}async function DQ(e,t){try{await navigator.clipboard.writeText(e),gl.success(t===`full`?Cl._({id:`6_ZOw4`}):Cl._({id:`haHgQj`}),{description:e})}catch(e){console.warn(`[FileTree] clipboard write failed:`,e),gl.error(t===`full`?Cl._({id:`vfRlCI`}):Cl._({id:`5QGTaA`}))}}var OQ=`
1960
+ [data-file-tree-virtualized-root][data-file-tree-root-drag-target="true"] {
1961
+ position: relative;
1962
+ }
1963
+ [data-file-tree-virtualized-root][data-file-tree-root-drag-target="true"]::after {
1964
+ content: "";
1965
+ position: absolute;
1966
+ inset: 0;
1967
+ z-index: 20;
1968
+ border-radius: 0.375rem;
1969
+ box-shadow: inset 0 0 0 2px color-mix(in oklab, var(--color-primary) 80%, transparent);
1970
+ background: color-mix(in oklab, var(--color-primary) 6%, transparent);
1971
+ pointer-events: none;
1972
+ }
1973
+ /* Forced-colors (Windows High Contrast) suppresses box-shadow and overrides
1974
+ color-mix backgrounds, so the ring above would vanish. Borders survive
1975
+ forced-colors — fall back to a system Highlight border (mirrors the JSX
1976
+ in-range halo fallback in globals.css). */
1977
+ @media (forced-colors: active) {
1978
+ [data-file-tree-virtualized-root][data-file-tree-root-drag-target="true"]::after {
1979
+ border: 2px solid Highlight;
1980
+ }
1981
+ }
1982
+ `,kQ=`data-ok-external-file-drop-target`,AQ=`data-ok-external-file-drop-root-target`,jQ=`__external-file-drop__`,MQ=2e3,NQ=`
1983
+ [data-type="item"][${kQ}="true"] {
1984
+ background: color-mix(in oklab, var(--color-primary) 10%, transparent);
1985
+ box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--color-primary) 72%, transparent);
1986
+ }
1987
+ [data-file-tree-virtualized-root][${AQ}="true"] {
1988
+ position: relative;
1989
+ }
1990
+ [data-file-tree-virtualized-root][${AQ}="true"]::after {
1991
+ content: "";
1992
+ position: absolute;
1993
+ inset: 0;
1994
+ z-index: 20;
1995
+ border-radius: 0.375rem;
1996
+ box-shadow: inset 0 0 0 2px color-mix(in oklab, var(--color-primary) 80%, transparent);
1997
+ background: color-mix(in oklab, var(--color-primary) 6%, transparent);
1998
+ pointer-events: none;
1999
+ }
2000
+ @media (forced-colors: active) {
2001
+ [data-type="item"][${kQ}="true"] {
2002
+ outline: 2px solid Highlight;
2003
+ outline-offset: -2px;
2004
+ }
2005
+ [data-file-tree-virtualized-root][${AQ}="true"]::after {
2006
+ border: 2px solid Highlight;
2007
+ }
2008
+ }
2009
+ `,PQ=`data-ok-creation-cleared`,FQ=`${wX}\n${dZ}\n${bZ}\n${OQ}\n${NQ}\n${`
2010
+ :host([${PQ}]) [data-item-focused="true"] {
2011
+ --trees-focus-ring-color: transparent;
2012
+ }
2013
+ `}\n${vX}\n${yX}`;function IQ(e){return e===`darwin`?Cl._({id:`LtSYdi`}):e===`win32`?Cl._({id:`qi1F96`}):Cl._({id:`e1Rn_k`})}function LQ(e){let t=(0,$.c)(18),{item:n,workspace:r,onClose:i}=e,{_:a}=gt(),o=typeof window<`u`?window.okDesktop:void 0;if(!o)return null;let s=o.platform,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=IQ(s),t[0]=c):c=t[0];let l=c,u,d;t[1]!==a||t[2]!==r?(u=r?null:a({id:`wTcjov`}),d=a(s===`darwin`?u?{id:`FvpFSZ`,values:{hint:u}}:{id:`LtSYdi`}:s===`win32`?u?{id:`o4dcAf`,values:{hint:u}}:{id:`qi1F96`}:u?{id:`zUhPuR`,values:{hint:u}}:{id:`e1Rn_k`}),t[1]=a,t[2]=r,t[3]=u,t[4]=d):(u=t[3],d=t[4]);let f=d,p=!r,m;t[5]!==n||t[6]!==i||t[7]!==r?(m=()=>{if(!r)return;i();let e=Qs(r.contentDir,Ff(n),r.pathSeparator);o.shell.showItemInFolder(e)},t[5]=n,t[6]=i,t[7]=r,t[8]=m):m=t[8];let h,g;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(hc,{"aria-hidden":`true`}),g=(0,Z.jsx)(`span`,{className:`flex-1`,children:l}),t[9]=h,t[10]=g):(h=t[9],g=t[10]);let _;t[11]===u?_=t[12]:(_=u?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:u}):null,t[11]=u,t[12]=_);let v;return t[13]!==f||t[14]!==p||t[15]!==m||t[16]!==_?(v=(0,Z.jsxs)(wr,{disabled:p,onSelect:m,"aria-label":f,children:[h,g,_]}),t[13]=f,t[14]=p,t[15]=m,t[16]=_,t[17]=v):v=t[17],v}function RQ(e){let t=(0,$.c)(69),{item:n,context:r,anyActionBusy:i,workspace:a,handoff:o,model:s,okignoreBinding:c,onStartCreating:l,onCreateFromTemplate:u,onDuplicate:d,onImportTemplate:f,onDelete:p,onExpandSubtree:m,onCollapseSubtree:h,folderTreePaths:g,isAsset:_,documents:v}=e,{_:y}=gt(),b=Nf(n,v),x=n.kind===`directory`,S;t[0]===n.path?S=t[1]:(S=Gl(n.path),t[0]=n.path,t[1]=S);let C=S,w=b.kind===`asset`?null:b,T=w!==null&&c!==null,E;t[2]!==y||t[3]!==x?(E=y(x?{id:`5D3Ior`}:{id:`dbhUX1`}),t[2]=y,t[3]=x,t[4]=E):E=t[4];let D=E,O;t[5]!==x||t[6]!==n.path?(O=x?rp(n.path):null,t[5]=x,t[6]=n.path,t[7]=O):O=t[7];let k=Ms(O),A=k.state.status===`ready`?(k.state.data.folder.templates_available?.length??0)>0:!0,j=s.getSelectedPaths(),M=j.includes(b.treePath)?$X(j,v):[],N=M.length>1?M:[b],P=N.length,F=Cl._({id:`djjdjr`,values:{deleteCount:P}}),I;t[8]!==v||t[9]!==_||t[10]!==x||t[11]!==n||t[12]!==a?(I=_?null:x?ns({folderRelativePath:Ff(n),workspace:a}):ls({docName:np(n.path,v),workspace:a}),t[8]=v,t[9]=_,t[10]=x,t[11]=n,t[12]=a,t[13]=I):I=t[13];let L=I,R;t[14]===r?R=t[15]:(R=()=>r.close({restoreFocus:!1}),t[14]=r,t[15]=R);let z=R,B;t[16]===r?B=t[17]:(B=()=>r.close(),t[16]=r,t[17]=B);let V=B,{status:H}=go(),U=H?.hasRemote===!0,W;t[18]!==v||t[19]!==_||t[20]!==x||t[21]!==n.path||t[22]!==b?(W=_||b.kind===`asset`?null:x?js(rp(n.path)):Ks(np(n.path,v)),t[18]=v,t[19]=_,t[20]=x,t[21]=n.path,t[22]=b,t[23]=W):W=t[23];let G=W,K=U&&G!==null,ee;t[24]!==y||t[25]!==U||t[26]!==G?(ee=()=>{G&&vs({...G,hasRemote:U,onClickWhenNoRemote:()=>{gl.error(y({id:`WyQxwa`}))}},{clipboardWrite:uf,toastSuccess:VQ,toastError:BQ,logEvent:zQ})},t[24]=y,t[25]=U,t[26]=G,t[27]=ee):ee=t[27];let te=ee,ne;t[28]!==K||t[29]!==V||t[30]!==te?(ne=K?(0,Z.jsxs)(wr,{"data-testid":`file-tree-menu-share`,onSelect:()=>{V(),te()},children:[(0,Z.jsx)(mg,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`Z8lGw6`})]}):null,t[28]=K,t[29]=V,t[30]=te,t[31]=ne):ne=t[31];let q=ne,re=0,ie=0;if(x){let e=Yf(n.path);for(let t of g)(t===e||t.startsWith(e))&&(re++,UZ(s.getItem(t))?.isExpanded()&&ie++)}let ae=x&&ie<re,oe=x&&ie>0,se;t[32]===V?se=t[33]:(se=e=>{e||V()},t[32]=V,t[33]=se);let ce;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,Z.jsx)(Or,{asChild:!0,children:(0,Z.jsx)(`span`,{"aria-hidden":`true`,"data-file-tree-context-menu-root":`true`,className:`block size-px`})}),t[34]=ce):ce=t[34];let le;t[35]!==y||t[36]!==i||t[37]!==T||t[38]!==V||t[39]!==z||t[40]!==F||t[41]!==N||t[42]!==A||t[43]!==o||t[44]!==L||t[45]!==D||t[46]!==_||t[47]!==x||t[48]!==C||t[49]!==n||t[50]!==s||t[51]!==c||t[52]!==w||t[53]!==h||t[54]!==u||t[55]!==p||t[56]!==d||t[57]!==m||t[58]!==f||t[59]!==l||t[60]!==q||t[61]!==oe||t[62]!==ae||t[63]!==b||t[64]!==a?(le=(0,Z.jsx)(Mr,{sideOffset:0,align:`start`,"data-file-tree-context-menu-root":`true`,className:`min-w-52`,children:x?(0,Z.jsxs)(Z.Fragment,{children:[C?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(wr,{disabled:i,onSelect:()=>{z(),l(`file`,rp(n.path))},children:[(0,Z.jsx)(oc,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`HdkSiO`})]}),A?(0,Z.jsxs)(Tr,{children:[(0,Z.jsxs)(jr,{disabled:i,children:[(0,Z.jsx)(Ps,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`Uuj_R4`})]}),(0,Z.jsx)(Er,{children:(0,Z.jsx)(HZ,{parentDir:rp(n.path),onSelectTemplate:e=>{z(),u(rp(n.path),e)},ItemComponent:wr})})]}):null,(0,Z.jsxs)(wr,{disabled:i,onSelect:()=>{z(),l(`folder`,rp(n.path))},children:[(0,Z.jsx)(Vh,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`96G6Re`})]}),(0,Z.jsx)(Fr,{})]}),(0,Z.jsx)(LQ,{item:n,workspace:a,onClose:V}),(0,Z.jsx)(Qo,{input:L,installStates:o.installStates,isElectronHost:o.isElectronHost,dispatch:o.dispatch,onBeforeLaunch:V}),q,(0,Z.jsxs)(Tr,{children:[(0,Z.jsxs)(jr,{children:[(0,Z.jsx)(ic,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`oCZkaG`})]}),(0,Z.jsxs)(Er,{children:[(0,Z.jsx)(wr,{disabled:!a,onSelect:()=>{a&&(V(),DQ(Qs(a.contentDir,Ff(n),a.pathSeparator),`full`))},children:(0,Z.jsx)(J,{id:`oQA-cA`})}),(0,Z.jsx)(wr,{onSelect:()=>{V(),DQ(Ff(n),`relative`)},children:(0,Z.jsx)(J,{id:`s061i4`})})]})]}),ae||oe?(0,Z.jsx)(Fr,{}):null,ae?(0,Z.jsxs)(wr,{onSelect:()=>{V(),m(n.path)},children:[(0,Z.jsx)(Ng,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`OlAl5i`})]}):null,oe?(0,Z.jsxs)(wr,{onSelect:()=>{V(),h(n.path)},children:[(0,Z.jsx)(zh,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`qvWGzP`})]}):null,C?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Fr,{}),(0,Z.jsxs)(wr,{disabled:i,onSelect:()=>{b.kind!==`asset`&&(V(),d(b))},children:[(0,Z.jsx)(Ys,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`euc6Ns`})]}),(0,Z.jsxs)(wr,{disabled:i,onSelect:()=>{z(),s.startRenaming(n.path)},children:[(0,Z.jsx)(rc,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`2wxgft`})]}),(0,Z.jsxs)(wr,{"data-testid":`file-tree-menu-hide`,disabled:!T,onSelect:()=>{if(!c||!w)return;V();let e=UX(w),t=Bs(c.current()),n=Ws(t,e);if(n===t)return;c.patch(Fs(n));let r=w.path.split(`/`).pop()||w.path;gl.success(y({id:`4xtLTl`,values:{basename:r}}),{description:y({id:`nWv1ja`}),duration:5e3})},children:[(0,Z.jsx)(Rr,{"aria-hidden":`true`}),D]}),(0,Z.jsxs)(wr,{variant:`destructive`,disabled:i,onSelect:()=>{V(),p(N)},children:[(0,Z.jsx)(ll,{"aria-hidden":`true`}),F]})]})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(LQ,{item:n,workspace:a,onClose:V}),!_&&(0,Z.jsx)(Qo,{input:L,installStates:o.installStates,isElectronHost:o.isElectronHost,dispatch:o.dispatch,onBeforeLaunch:V}),q,(0,Z.jsxs)(Tr,{children:[(0,Z.jsxs)(jr,{children:[(0,Z.jsx)(ic,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`oCZkaG`})]}),(0,Z.jsxs)(Er,{children:[(0,Z.jsx)(wr,{disabled:!a,onSelect:()=>{a&&(V(),DQ(Qs(a.contentDir,Ff(n),a.pathSeparator),`full`))},children:(0,Z.jsx)(J,{id:`oQA-cA`})}),(0,Z.jsx)(wr,{onSelect:()=>{V(),DQ(Ff(n),`relative`)},children:(0,Z.jsx)(J,{id:`s061i4`})})]})]}),C?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Fr,{}),_?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Tr,{children:[(0,Z.jsxs)(jr,{disabled:i,children:[(0,Z.jsx)(Lh,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`PYmp-0`})]}),(0,Z.jsxs)(Er,{children:[(0,Z.jsx)(wr,{disabled:i,onSelect:()=>{V(),f(b,!1)},children:(0,Z.jsx)(J,{id:`-FeyRg`})}),(0,Z.jsx)(wr,{disabled:i,onSelect:()=>{V(),f(b,!0)},children:(0,Z.jsx)(J,{id:`dQHSCs`})})]})]}),(0,Z.jsxs)(wr,{disabled:i,onSelect:()=>{V(),d(b)},children:[(0,Z.jsx)(Ys,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`euc6Ns`})]})]}),(0,Z.jsxs)(wr,{disabled:i,onSelect:()=>{z(),s.startRenaming(n.path)},children:[(0,Z.jsx)(rc,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`2wxgft`})]}),w?(0,Z.jsxs)(wr,{"data-testid":`file-tree-menu-hide`,disabled:!T,onSelect:()=>{if(!c)return;V();let e=UX(w),t=Bs(c.current()),n=Ws(t,e);if(n===t)return;c.patch(Fs(n));let r=w.path.split(`/`).pop()||w.path;gl.success(y({id:`OD0FCX`,values:{basename:r}}),{description:y({id:`nWv1ja`}),duration:5e3})},children:[(0,Z.jsx)(Rr,{"aria-hidden":`true`}),D]}):null,(0,Z.jsxs)(wr,{variant:`destructive`,disabled:i,onSelect:()=>{V(),p(N)},children:[(0,Z.jsx)(ll,{"aria-hidden":`true`}),F]})]})]})}),t[35]=y,t[36]=i,t[37]=T,t[38]=V,t[39]=z,t[40]=F,t[41]=N,t[42]=A,t[43]=o,t[44]=L,t[45]=D,t[46]=_,t[47]=x,t[48]=C,t[49]=n,t[50]=s,t[51]=c,t[52]=w,t[53]=h,t[54]=u,t[55]=p,t[56]=d,t[57]=m,t[58]=f,t[59]=l,t[60]=q,t[61]=oe,t[62]=ae,t[63]=b,t[64]=a,t[65]=le):le=t[65];let ue;return t[66]!==se||t[67]!==le?(ue=(0,Z.jsxs)(Pr,{open:!0,modal:!1,onOpenChange:se,children:[ce,le]}),t[66]=se,t[67]=le,t[68]=ue):ue=t[68],ue}function zQ(e){return console.log(e)}function BQ(e){return gl.error(e)}function VQ(e){return gl.success(e)}function HQ(e,t){return`/api/documents?showAll=true${t?`&showOk=true`:``}&dir=${encodeURIComponent(e)}&depth=1`}async function UQ(e,t,n,r,i){try{let a=await fetch(HQ(e,t),{signal:n,headers:nQ});if(rQ(a)){let e=await oQ(a);return{kind:`entries`,entries:Vl(e.entries),truncated:e.truncated}}let o=await P(a,r);if(!o.ok)return{kind:`http-error`,title:o.title};let s=zi.safeParse(o.body);return s.success?{kind:`entries`,entries:Vl(s.data.documents),truncated:s.data.truncated===!0}:{kind:`http-error`,title:i}}catch(e){return e instanceof iQ?{kind:`http-error`,title:e.message}:{kind:`network-error`,cause:e}}}function WQ(e){let t=(0,$.c)(367),{ref:n,onContentHeightChange:r}=e,{_:i,i18n:a}=gt(),{activeDocName:o,activeTarget:s,closeTabs:c,closeDocument:l,isNewTabActive:u,openTarget:d,prewarm:f,reconcileLocalRemoval:p,reconcileLocalRename:m}=Ye(),{notifySidebarFileSelected:h}=uP(),{resolvedTheme:g}=Lt(),{addPage:_,pageMeta:v,pages:y}=Go(),b;t[0]===v?b=t[1]:(b=function(e,t){return Yl(e,t??v.get(e)?.size)??{kind:`doc`,target:e,docName:e}},t[0]=v,t[1]=b);let x=b,S;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(S=[],t[2]=S):S=t[2];let[C,w]=(0,Q.useState)(S),[T,E]=(0,Q.useState)(!0),[D,O]=(0,Q.useState)(null),[k,A]=(0,Q.useState)(!1),j=ZF(),M=(0,Q.useRef)(null),[N,F]=(0,Q.useState)(null),[I,L]=(0,Q.useState)(0),[R,z]=(0,Q.useState)(null),[B,V]=(0,Q.useState)(null),[H,U]=(0,Q.useState)(null),[W,G]=(0,Q.useState)(null),{conflicts:K}=Ds(),[ee,ne]=(0,Q.useState)(null),[q,re]=(0,Q.useState)(null),[ie,se]=(0,Q.useState)(!1),ce=(0,Q.useRef)(ie),le;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(le=new Set,t[3]=le):le=t[3];let ue=(0,Q.useRef)(le),de=(0,Q.useRef)(C),fe=(0,Q.useRef)(v),pe=(0,Q.useRef)(null),me;t[4]!==_||t[5]!==x||t[6]!==h||t[7]!==d?(me=function(e){if(e.kind===`doc`)e.registerPage&&_(e.docName),d(x(e.docName,e.size),{tabBehavior:`replace-active`}),xu(Cu(e.docName));else if(e.kind===`folder`)d({kind:`folder`,target:e.folderPath,folderPath:e.folderPath},{tabBehavior:`replace-active`}),xu(pu(e.folderPath));else{let t=(e.entries??de.current).find(t=>Kl(t)&&t.path===e.assetPath);d({kind:`asset`,target:e.assetPath,assetPath:e.assetPath,mediaKind:t?.mediaKind??null},{tabBehavior:`replace-active`}),xu(bu(e.assetPath))}h()},t[4]=_,t[5]=x,t[6]=h,t[7]=d,t[8]=me):me=t[8];let he=me,ge;t[9]!==C||t[10]!==he||t[11]!==h||t[12]!==d||t[13]!==y?(ge=function(e,t){let n=t===void 0?C:t,r=kZ(e,n);if(r.kind===`none`){console.debug(`[FileTree] Dropped selection for unknown docName:`,tp(e));return}if(r.kind===`asset`){d({kind:`asset`,target:r.path,assetPath:r.path,mediaKind:r.mediaKind},{tabBehavior:`replace-active`}),xu(r.hash),h();return}if(r.kind===`folder`){he({kind:`folder`,folderPath:r.path});return}let i=n.find(e=>Bl(e)&&e.docName===r.path),a=Jl(r.path,{pages:y,docExt:i?.docExt});if(a?.kind===`asset`){d(a,{tabBehavior:`replace-active`}),xu(bu(a.assetPath)),h();return}if(a?.kind===`doc`){he({kind:`doc`,docName:a.docName});return}he({kind:`doc`,docName:r.path,size:i?.size,registerPage:Il(r.path)})},t[9]=C,t[10]=he,t[11]=h,t[12]=d,t[13]=y,t[14]=ge):ge=t[14];let _e=ge,ve=(0,Q.useRef)(o),ye;t[15]===C?ye=t[16]:(ye=new Set(C.filter(Kl).map(v$)),t[15]=C,t[16]=ye);let be=ye,xe=(0,Q.useRef)(be),Se;t[17]===C?Se=t[18]:(Se=cZ(C),t[17]=C,t[18]=Se);let Ce=Se,we=(0,Q.useRef)(Ce),Te;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(Te=[],t[19]=Te):Te=t[19];let Ee=(0,Q.useRef)(Te),De=(0,Q.useRef)(null),Oe=(0,Q.useRef)(_$),ke=(0,Q.useRef)(null),Ae=(0,Q.useRef)(null),je=(0,Q.useRef)(!1),Me=(0,Q.useRef)(!1),Pe=(0,Q.useRef)(null),Fe;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(Fe={row:null,root:null},t[20]=Fe):Fe=t[20];let Ie=(0,Q.useRef)(Fe),Le=(0,Q.useRef)(g$),Re=(0,Q.useRef)(null),ze=(0,Q.useRef)(null),Be;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(Be=new Map,t[21]=Be):Be=t[21];let Ve=(0,Q.useRef)(Be),He;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(He=new Set,t[22]=He):He=t[22];let Ue=(0,Q.useRef)(He),We;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(We=new Map,t[23]=We):We=t[23];let Ge=(0,Q.useRef)(We),Ke=(0,Q.useRef)(0),qe;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(qe=new Set,t[24]=qe):qe=t[24];let Je=(0,Q.useRef)(qe),Xe=(0,Q.useRef)(h$),Ze=(0,Q.useRef)(m$),Qe=(0,Q.useRef)(!1),$e=(0,Q.useRef)(!1),et=(0,Q.useRef)(!1),tt;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(tt=()=>({showHiddenFiles:Qe.current,showOnlyMarkdownFiles:$e.current,showOkFolders:et.current}),t[25]=tt):tt=t[25];let nt=tt,rt=(0,Q.useRef)(null),it=(0,Q.useRef)(null),at=(0,Q.useRef)(p$),ot=(0,Q.useRef)(f$),st=(0,Q.useRef)(d$),ct=(0,Q.useRef)(u$),lt=(0,Q.useRef)(s),[ut,dt]=(0,Q.useState)(!1),ft;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(ft=function(){M.current!==null&&(clearTimeout(M.current),M.current=null)},t[26]=ft):ft=t[26];let pt=ft,mt;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(mt=function(){pt(),A(!1)},t[27]=mt):mt=t[27];let ht=mt,_t;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(_t=function(e){ht(),O(e)},t[28]=_t):_t=t[28];let vt=_t,yt;t[29]===i?yt=t[30]:(yt=function(){if(pt(),qF()){O(null),A(!0),M.current=setTimeout(()=>{M.current=null,rt.current?.()},MQ);return}A(!1),O(i({id:`34qyH5`}))},t[29]=i,t[30]=yt);let bt=yt,xt=(0,Q.useRef)(!0),St;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(St=()=>{if(xt.current){xt.current=!1;return}rt.current?.()},t[31]=St):St=t[31];let Ct;t[32]===j?Ct=t[33]:(Ct=[j],t[32]=j,t[33]=Ct),(0,Q.useEffect)(St,Ct);let wt,Tt;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(wt=()=>pt,Tt=[],t[34]=wt,t[35]=Tt):(wt=t[34],Tt=t[35]),(0,Q.useEffect)(wt,Tt);let Et,Dt;t[36]!==C.length||t[37]!==T?(Et=()=>{if(T||C.length===0)return;let e=it.current?.querySelector(sV)?.shadowRoot;if(!e)return;let t=e,n=function(){Pe.current!==null&&clearTimeout(Pe.current),Pe.current=setTimeout(()=>{Me.current=!1,Pe.current=null},0)},r=function(e){if(!(e instanceof DragEvent))return;let t=b$(e),n=t?.dataset.itemPath;if(!n)return;let r=PZ(t.dataset.itemType===`folder`?Yf(n):n,de.current,fe.current);r&&(Pe.current!==null&&(clearTimeout(Pe.current),Pe.current=null),Me.current=!0,e.dataTransfer?.setData(jf,Wf(r)))},i=function(e){if(!(e instanceof DragEvent)||!Kf(e))return;let t=S$(e);if(!t){TQ(Ie);return}e.preventDefault(),e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`),EQ(Ie,t)},a=function(e){if(!(e instanceof DragEvent)||!Kf(e))return;let n=e.relatedTarget;n instanceof Node&&t.contains(n)||TQ(Ie)},o=function(e){if(!(e instanceof DragEvent)||!Kf(e))return;let t=S$(e),n=Bf(e);if(!t||n.length===0){TQ(Ie);return}e.preventDefault(),e.stopPropagation(),TQ(Ie),Le.current(n,t.parentDir,t.busyPath)};return e.addEventListener(`dragstart`,r,{capture:!0}),e.addEventListener(`dragover`,i,{capture:!0}),e.addEventListener(`dragleave`,a,{capture:!0}),e.addEventListener(`drop`,o,{capture:!0}),e.addEventListener(`dragend`,n,{capture:!0}),window.addEventListener(`drop`,n,!0),window.addEventListener(`dragend`,n,!0),()=>{e.removeEventListener(`dragstart`,r,{capture:!0}),e.removeEventListener(`dragover`,i,{capture:!0}),e.removeEventListener(`dragleave`,a,{capture:!0}),e.removeEventListener(`drop`,o,{capture:!0}),e.removeEventListener(`dragend`,n,{capture:!0}),window.removeEventListener(`drop`,n,!0),window.removeEventListener(`dragend`,n,!0),TQ(Ie),Pe.current!==null&&(clearTimeout(Pe.current),Pe.current=null),Me.current=!1}},Dt=[C.length,T],t[36]=C.length,t[37]=T,t[38]=Et,t[39]=Dt):(Et=t[38],Dt=t[39]),(0,Q.useEffect)(Et,Dt);let{selectedFilePath:Ot,selectedFolderPath:kt,navigationPath:At}=OZ(s,u?null:o),jt=Ot?Zf(Ot,C.find(e=>Bl(e)&&e.docName===Ot)?.docExt):kt?Yf(kt):s?.kind===`asset`?s.assetPath:null,Mt=ie?null:jt,Nt=as().states,{dispatch:Pt}=$o(),Ft;t[40]!==Pt||t[41]!==Nt?(Ft={installStates:Nt,isElectronHost:typeof window<`u`&&window.okDesktop!=null,dispatch:Pt},t[40]=Pt,t[41]=Nt,t[42]=Ft):Ft=t[42];let It=Ft,{okignoreBinding:Rt,merged:zt}=od(),Bt=zt?.appearance?.sidebar?.showHiddenFiles??!1,Vt=zt?.appearance?.sidebar?.showOnlyMarkdownFiles??!1,Ht=zt?.appearance?.sidebar?.showOkFolders??!1,Ut;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(Ut=()=>Re.current===null,t[43]=Ut):Ut=t[43];let Wt=Ut,Gt;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(Gt=[],t[44]=Gt):Gt=t[44];let Kt;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(Kt={set:`complete`,spriteSheet:VX,byFileExtension:{md:{name:LX,viewBox:te},mdx:{name:LX,viewBox:te}}},t[45]=Kt):Kt=t[45];let qt;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(qt={contextMenu:{enabled:!0,triggerMode:`both`,buttonVisibility:`when-needed`}},t[46]=qt):qt=t[46];let Jt;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(Jt={canDrag:Wt,canDrop:Wt,onDropComplete:e=>ct.current(e),onDropError:l$},t[47]=Jt):Jt=t[47];let Yt,Xt;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(Yt={canRename:Wt,onRename:e=>ot.current(e),onError:e=>st.current(e)},Xt=e=>at.current(e),t[48]=Yt,t[49]=Xt):(Yt=t[48],Xt=t[49]);let Zt;t[50]===i?Zt=t[51]:(Zt={paths:Gt,initialExpansion:`closed`,fileTreeSearchMode:`hide-non-matches`,initialVisibleRowCount:18,stickyFolders:!0,...gX,icons:Kt,unsafeCSS:FQ,composition:qt,dragAndDrop:Jt,renaming:Yt,onSelectionChange:Xt,renderRowDecoration:e=>{let{item:t}=e;if(t.kind===`file`){let e=we.current.docsByTreePath.get(t.path);if(e?.isSymlink){let t=e.targetPath;return{icon:FX,title:i(t?{id:`JE21eh`,values:{targetPath:t}}:{id:`BQu9Pg`})}}return JX(t.path)?{icon:IX,title:i({id:`i9toLO`})}:null}let n=we.current.foldersByTreeDirectoryPath.get(Yf(t.path));if(n?.isSymlink){let e=n.targetPath;return{icon:FX,title:i(e?{id:`JE21eh`,values:{targetPath:e}}:{id:`BQu9Pg`})}}return null}},t[50]=i,t[51]=Zt);let{model:Qt}=mX(Zt),$t;t[52]===Qt?$t=t[53]:($t=function(e){let t=Qt.getItem(e)??Qt.getItem(Yf(e));return t?.isDirectory()?Yf(rp(t.getPath())):e},t[52]=Qt,t[53]=$t);let en=$t,tn,nn;t[54]===C?(tn=t[55],nn=t[56]):(nn=Rf(C),tn=kf(nn),t[54]=C,t[55]=tn,t[56]=nn);let rn=tn,an=(0,Q.useRef)(nn),on;t[57]!==C||t[58]!==Ht?(on=qf(C,{includeOkFolders:Ht}),t[57]=C,t[58]=Ht,t[59]=on):on=t[59];let sn=on,cn=(0,Q.useRef)(sn),ln=kt?Xf(Yf(kt)).slice(0,-1):Xf(Mt??At),un=ln.join(`\0`),dn;t[60]===Qt?dn=t[61]:(dn=()=>{let e=new Set;for(let t of cn.current)UZ(Qt.getItem(t))?.isExpanded()&&e.add(t);return e},t[60]=Qt,t[61]=dn);let fn=dn,pn;t[62]===fn?pn=t[63]:(pn=e=>{let t=new Set(qf(e??de.current,{includeOkFolders:et.current})),n=fn();for(let e of Ee.current)n.add(e);return[...n].filter(e=>t.has(e))},t[62]=fn,t[63]=pn);let mn=pn,hn;t[64]!==mn||t[65]!==Qt?(hn=e=>{let t=Rf(e??de.current);Qt.resetPaths(t,{initialExpandedPaths:mn(e)})},t[64]=mn,t[65]=Qt,t[66]=hn):hn=t[66];let gn=hn,_n;t[67]!==i||t[68]!==bt?(_n=async function(e){let t=Ke.current,n=new AbortController;Ge.current.set(e,n);let r=await UQ(rp(e),et.current,n.signal,i({id:`8RtNI0`}),i({id:`HlmZBk`}));if(Ge.current.get(e)===n&&Ge.current.delete(e),n.signal.aborted||t!==Ke.current)return;if(r.kind===`network-error`){bt(),console.warn(`[FileTree] lazy folder children fetch failed:`,e,r.cause);return}if(r.kind===`http-error`){console.warn(`[FileTree] lazy folder children http error:`,e,r.title),vt(r.title);return}let a=zl(r.entries,nt());Ue.current.add(e),w(t=>lQ(t,e,a,Ve.current)),O(null),ht(),r.truncated&&F(r.entries.length)},t[67]=i,t[68]=bt,t[69]=_n):_n=t[69];let vn=_n,bn;t[70]!==fn||t[71]!==vn?(bn=()=>{let e=fn(),t=Je.current;Je.current=e;for(let n of e){if(t.has(n)||Ue.current.has(n)||Ge.current.has(n))continue;let e=rp(n);de.current.find(t=>Ul(t)&&t.path===e)?.hasChildren!==!1&&vn(n)}},t[70]=fn,t[71]=vn,t[72]=bn):bn=t[72];let xn=bn,Sn;t[73]!==fn||t[74]!==vn?(Sn=()=>{for(let e of fn())Ue.current.has(e)||Ge.current.has(e)||vn(e)},t[73]=fn,t[74]=vn,t[75]=Sn):Sn=t[75];let Cn=Sn,wn;t[76]!==Qt||t[77]!==gn?(wn=(e,t,n,r)=>{let i=r===void 0?[]:r,a=0,o=null;for(let{fromDocName:r,toDocName:i}of n){let n=e.find(e=>Bl(e)&&e.docName===r);if(n==null||Qt.getItem(i)==null)continue;let s=Zf(i,t.find(e=>Bl(e)&&e.docName===i)?.docExt??n.docExt);Qt.move(i,s),o=s,a+=1}for(let{toPath:e}of i){let t=Rl(e);if(t===``)continue;let n=e.slice(0,-t.length);Qt.getItem(n)!=null&&(Qt.getItem(e)??Qt.move(n,e),o=e,a+=1)}a!==0&&(gn(t),o!=null&&Qt.focusPath(o))},t[76]=Qt,t[77]=gn,t[78]=wn):wn=t[78];let Tn=wn,En;t[79]===Symbol.for(`react.memo_cache_sentinel`)?(En=e=>{ke.current=Gf(e)},t[79]=En):En=t[79];let Dn=En,On;t[80]===Symbol.for(`react.memo_cache_sentinel`)?(On=e=>xe.current.has(e),t[80]=On):On=t[80];let kn=On,An;t[81]!==i||t[82]!==_||t[83]!==he||t[84]!==gn?(An=async function(e){if(e.kind===`asset`||Re.current!==null)return;let t=()=>{z(null),Re.current=null};Re.current=e.path,z(e.path),O(null);try{let n=await P(await fetch(`/api/duplicate-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:e.kind,path:e.path})}),i({id:`dw_dUJ`}));if(!n.ok){gl.error(n.title),gn(),t();return}let r=Ne(Ci,n.body,`duplicate-path`,null);if(r===null){let e=i({id:`67f-3g`});gl.error(e),O(e),au([`files`,`backlinks`,`graph`]),gn(),t();return}for(let e of r.duplicatedDocNames)_(e);w(t=>{let n=CI(t,e,r);return gn(n),Dn(n),n}),au([`files`,`backlinks`,`graph`]),r.path!==e.path&&(r.kind===`folder`?he({kind:`folder`,folderPath:r.path}):he({kind:`doc`,docName:r.path})),gl.success(r.kind===`folder`?i({id:`iilQXA`}):i({id:`A6h5b-`}),{description:r.path}),t()}catch(e){let n=e,r=n instanceof Error?n.message:String(n);console.warn(`[FileTree] duplicate failed:`,n),gl.error(i({id:`EBVbtP`}),{description:r}),gn(),t()}},t[81]=i,t[82]=_,t[83]=he,t[84]=gn,t[85]=An):An=t[85];let jn=An,Mn=(0,Q.useRef)(jn),Nn;t[86]===jn?Nn=t[87]:(Nn=()=>{Mn.current=jn},t[86]=jn,t[87]=Nn),(0,Q.useEffect)(Nn);let Pn=async function(e,t){if(e.kind===`file`){if(t){U(e);return}await Fn(e,!1)}};async function Fn(e,t){if(Re.current!==null)return;let n=()=>{z(null),Re.current=null,U(null)};Re.current=e.path,z(e.path),O(null);let r=e.path,a=r.lastIndexOf(`/`),o=a===-1?``:r.slice(0,a),s=await gc({sourcePath:e.path,targetFolder:o,deleteSource:t});if(!s.ok){gl.error(i({id:`rDOuNw`}),{description:s.error}),n();return}t&&(await Jr([e],[e.path],[]),w(t=>{let n=t.filter(t=>!(Bl(t)&&t.docName===e.path));return gn(n),Dn(n),n}),au([`files`,`backlinks`,`graph`])),gl.success(i({id:`Ba4D2x`}),{description:s.path}),n()}let In=function(e){let t=GX(e);if(!t||KX(t))return!1;let n=Qt.getFocusedPath()??Qt.getSelectedPaths()[0]??null;if(!n||n.endsWith(`/`)||kn(n))return!1;let r=KX(n);if(!r)return!1;let i=Yf(t);if(!cn.current.includes(i))return!1;let a=`${t}${r}`;return an.current.includes(a)?!1:(mr({sourcePath:n,destinationPath:a,isFolder:!1}),Qt.move(n,a),!0)},Ln;t[88]===Symbol.for(`react.memo_cache_sentinel`)?(Ln=e=>{let t=e??De.current;!t||De.current!==t||(t.disposeCommitListener(),De.current=null)},t[88]=Ln):Ln=t[88];let Rn=Ln,zn;t[89]!==i||t[90]!==Rn||t[91]!==l||t[92]!==c||t[93]!==gn?(zn=async function(e,t){let n=t===void 0?{}:t,r=n.updateUi??!0,a=n.restoreLocation??r;Rn(e),r&&z(e.renamePath);try{let t=await fetch(`/api/delete-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:e.kind,path:e.createdPath})});if(!t.ok&&t.status!==404){let n=e.kind,a=e.createdPath,o=await P(t,i({id:`EcM3k7`,values:{kind:n}}));if(o.ok)return;let s=o.title,c=i({id:`YPFBfr`,values:{detail:s,kind:n,createdPath:a}});r?gl.error(c):console.warn(`[FileTree] cleanup pending create failed: ${c}`),r&&(z(null),gn());return}}catch(t){if(console.warn(`[FileTree] cleanup pending create failed:`,t),r){let t=e.kind,n=e.createdPath;gl.error(i({id:`_TDESN`,values:{kind:t,createdPath:n}}))}r&&(z(null),gn());return}r&&(e.kind===`file`?l(e.createdPath):c([ae(e.createdPath)],{force:!0})),r&&w(t=>{let n=xI(t,e.kind===`file`?[e.createdPath]:[],e.kind===`folder`?e.createdPath:void 0);return Dn(n),n}),au([`files`,`backlinks`,`graph`]),a&&(window.location.hash=e.previousHash),r&&z(null)},t[89]=i,t[90]=Rn,t[91]=l,t[92]=c,t[93]=gn,t[94]=zn):zn=t[94];let Bn=zn,Vn,Hn;t[95]===Symbol.for(`react.memo_cache_sentinel`)?(Vn=()=>()=>{let e=De.current;e&&Oe.current(e,{restoreLocation:!1,updateUi:!1}).catch(c$)},Hn=[],t[95]=Vn,t[96]=Hn):(Vn=t[95],Hn=t[96]),(0,Q.useEffect)(Vn,Hn);let Un;t[97]!==i||t[98]!==bt?(Un=()=>{let e=!0,t=null,n=Wo(async function(){t?.abort();let n=new AbortController;t=n,Ke.current+=1;for(let e of Ge.current.values())e.abort();Ge.current.clear(),Ue.current.clear();try{let t=await fetch(HQ(``,et.current),{signal:n.signal,headers:nQ});if(rQ(t)){let r=nt(),i=!1,{entries:a,truncated:o}=await oQ(t,{onBatch:t=>{if(!e||n.signal.aborted)return;let a=zl(Vl(t),r);a.length!==0&&(w(e=>cQ(e,a)),i||(i=!0,O(null),ht(),E(!1)))}});if(!e)return;let s=Vl(a),c=zl(s,r);w(e=>lQ(e,``,c,Ve.current)),O(null),ht(),F(o?a.length:null),L(s.length),Ze.current()}else{let n=await P(t,i({id:`8RtNI0`}));if(!e)return;if(!n.ok)vt(n.title),F(null);else{let e=zi.safeParse(n.body);if(!e.success)vt(i({id:`HlmZBk`})),F(null);else{let t=Vl(e.data.documents),n=zl(t,nt());w(e=>lQ(e,``,n,Ve.current)),O(null),ht(),F(e.data.truncated===!0?e.data.documents.length:null),L(t.length),Ze.current()}}}}catch(t){let r=t;if(n.signal.aborted)return;e&&(r instanceof iQ?vt(r.message):bt()),console.warn(`[FileTree] fetch failed:`,r)}e&&E(!1)},()=>t?.abort());rt.current=()=>n.request(),n.request();let r=()=>{document.visibilityState===`visible`&&n.request()};window.addEventListener(`focus`,r),window.addEventListener(`visibilitychange`,r);let a=eu(e=>{e.includes(`files`)&&n.request()});return()=>{e=!1,rt.current=null,n.dispose();for(let e of Ge.current.values())e.abort();Ge.current.clear(),window.removeEventListener(`focus`,r),window.removeEventListener(`visibilitychange`,r),a()}},t[97]=i,t[98]=bt,t[99]=Un):Un=t[99];let Wn;t[100]===i?Wn=t[101]:(Wn=[i],t[100]=i,t[101]=Wn),(0,Q.useEffect)(Un,Wn);let Gn=(0,Q.useRef)(!0),Kn;t[102]===Symbol.for(`react.memo_cache_sentinel`)?(Kn=()=>{if(Gn.current){Gn.current=!1;return}rt.current?.()},t[102]=Kn):Kn=t[102];let qn;t[103]!==Bt||t[104]!==Ht||t[105]!==Vt?(qn=[Bt,Vt,Ht],t[103]=Bt,t[104]=Ht,t[105]=Vt,t[106]=qn):qn=t[106],(0,Q.useEffect)(Kn,qn);let Jn,Yn;t[107]===Symbol.for(`react.memo_cache_sentinel`)?(Jn=()=>{let e=!0;return fetch(`/api/workspace`).then(async t=>{let n=await t.json();if(!e||!t.ok)return;let r=Ne(la,n,`workspace`,null);r&&re({contentDir:r.contentDir,pathSeparator:r.pathSeparator})}).catch(s$),()=>{e=!1}},Yn=[],t[107]=Jn,t[108]=Yn):(Jn=t[107],Yn=t[108]),(0,Q.useEffect)(Jn,Yn);let Xn;t[109]!==mn||t[110]!==Qt||t[111]!==rn?(Xn=()=>{if(ke.current===rn){ke.current=null;return}Qt.resetPaths(an.current,{initialExpandedPaths:mn()})},t[109]=mn,t[110]=Qt,t[111]=rn,t[112]=Xn):Xn=t[112];let Zn;t[113]!==Qt||t[114]!==rn?(Zn=[Qt,rn],t[113]=Qt,t[114]=rn,t[115]=Zn):Zn=t[115],(0,Q.useEffect)(Xn,Zn),KZ(Qt,Mt,un,je,rn);let Qn,$n;t[116]!==Qt||t[117]!==r?(Qn=()=>{if(!r)return;let e=0,t=0,n=()=>it.current?.querySelector(`file-tree-container`)?.shadowRoot?.querySelector(`[data-file-tree-virtualized-list]`)??null,i=()=>{let e=n();if(!e)return;let t=Number.parseFloat(e.style.height);Number.isFinite(t)&&r(t)},a=()=>{cancelAnimationFrame(e),e=requestAnimationFrame(i)},o=new MutationObserver(i),s=()=>{let e=n();e?(o.observe(e,{attributes:!0,attributeFilter:[`style`]}),i()):t=requestAnimationFrame(s)};s();let c=Qt.subscribe(a);return window.addEventListener(`resize`,a),()=>{cancelAnimationFrame(e),cancelAnimationFrame(t),o.disconnect(),c(),window.removeEventListener(`resize`,a)}},$n=[r,Qt],t[116]=Qt,t[117]=r,t[118]=Qn,t[119]=$n):(Qn=t[118],$n=t[119]),(0,Q.useEffect)(Qn,$n);let er;t[120]===Symbol.for(`react.memo_cache_sentinel`)?(er=()=>{se(!1)},t[120]=er):er=t[120];let tr;t[121]===jt?tr=t[122]:(tr=[jt],t[121]=jt,t[122]=tr),(0,Q.useEffect)(er,tr);let nr,rr;t[123]===ie?(nr=t[124],rr=t[125]):(nr=()=>{ce.current=ie;for(let e of ue.current)e()},rr=[ie],t[123]=ie,t[124]=nr,t[125]=rr),(0,Q.useEffect)(nr,rr);let ir;t[126]!==Mt||t[127]!==T||t[128]!==Qt?(ir=()=>{T||!Mt||EZ(Qt,Mt)},t[126]=Mt,t[127]=T,t[128]=Qt,t[129]=ir):ir=t[129];let ar;t[130]!==un||t[131]!==Mt||t[132]!==T||t[133]!==Qt||t[134]!==rn?(ar=[Mt,un,rn,T,Qt],t[130]=un,t[131]=Mt,t[132]=T,t[133]=Qt,t[134]=rn,t[135]=ar):ar=t[135],(0,Q.useEffect)(ir,ar);let or,sr;t[136]===Qt?(or=t[137],sr=t[138]):(or=()=>Qt.subscribe(()=>{if(!Qt.isSearchOpen())for(let e of Ee.current){let t=UZ(Qt.getItem(e));t&&!t.isExpanded()&&t.expand()}}),sr=[Qt],t[136]=Qt,t[137]=or,t[138]=sr),(0,Q.useEffect)(or,sr);let cr,lr;t[139]===Qt?(cr=t[140],lr=t[141]):(cr=()=>Qt.subscribe(()=>Xe.current()),lr=[Qt],t[139]=Qt,t[140]=cr,t[141]=lr),(0,Q.useEffect)(cr,lr);let ur,dr;t[142]===Qt?(ur=t[143],dr=t[144]):(ur=()=>Qt.onMutation(`remove`,e=>{let t=De.current;!t||e.path!==t.renamePath||Oe.current(t)}),dr=[Qt],t[142]=Qt,t[143]=ur,t[144]=dr),(0,Q.useEffect)(ur,dr);let fr;t[145]!==_||t[146]!==he||t[147]!==m||t[148]!==Tn?(fr=async(e,t,n,r,i)=>{let a=t===void 0?[]:t,o=n===void 0?[]:n,s=i===void 0?[]:i,c=r?.docName??ve.current,l=new Map,u=new Map;for(let e of de.current){if(Bl(e)){let t=o.find(t=>t.fromPath===Zf(e.docName,e.docExt))?.toPath;t&&l.set(e.docName,t);continue}if(Kl(e)){let t=o.find(t=>t.fromPath===e.path)?.toPath;t&&Il(t)&&u.set(e.path,Lf(t))}}let d=c?l.get(c)??null:null,f=r?.folderPath??(lt.current?.kind===`folder`?lt.current.folderPath:null),p=f?oe(f,a):null,h=r?.assetPath??(lt.current?.kind===`asset`?lt.current.assetPath:null),g=h?u.get(h)??null:null,v=d?null:g??wI(c,e),y=d??(h?g?null:o.find(e=>e.fromPath===h)?.toPath??oe(h,a):null);await m({renamed:e,renamedFolders:a,renamedAssets:o,additionalRemovedDocNames:[...l.keys()]});for(let t of e)_(t.toDocName);for(let e of u.values())_(e);let b=null;w(t=>{let n=bI(t,e,a,o,s);return b=n,Tn(t,n,e,o),Dn(n),n}),f&&p&&p!==f?he({kind:`folder`,folderPath:p}):v&&v!==c?(he({kind:`doc`,docName:v}),wQ(v)):y&&(d||y!==h)&&he({kind:`asset`,assetPath:y,entries:b??de.current}),au([`files`,`backlinks`,`graph`])},t[145]=_,t[146]=he,t[147]=m,t[148]=Tn,t[149]=fr):fr=t[149];let pr=fr;async function mr(e){let t=!e.isFolder&&kn(e.sourcePath),n=t?e.sourcePath:Hf(e.sourcePath,e.isFolder);z(n),O(null);try{let r=Ll(e.sourcePath,e.destinationPath,e.isFolder),a=!e.isFolder&&!t&&!Il(r.destinationPath),o=t||a?r.destinationPath:Hf(r.destinationPath,e.isFolder),s=e.isFolder?{kind:`folder`,fromPath:rp(n),toPath:rp(o)}:t||a?{kind:`asset`,fromPath:n,toPath:o}:{kind:`file`,fromPath:np(n,de.current),toPath:o},c={docName:ve.current,folderPath:lt.current?.kind===`folder`?lt.current.folderPath:null,assetPath:lt.current?.kind===`asset`?lt.current.assetPath:null},l=await P(await fetch(`/api/rename-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(s)}),i({id:`gijbne`}));if(!l.ok){gl.error(l.title),gn();let e=De.current;e&&e.renamePath===n?await Bn(e):Rn(),z(null);return}let u=Ne(Xi,l.body,`rename-path`,{renamed:[],renamedAssets:[]});try{await pr(u.renamed,e.isFolder?[{fromPath:rp(n),toPath:rp(o)}]:[],u.renamedAssets,c,!e.isFolder&&!t&&!a?u.renamed.flatMap(e=>{let t=Rl(o);return t?[{toDocName:e.toDocName,docExt:t}]:[]}):[])}catch(e){console.warn(`[FileTree] post-rename reconciliation failed`,{err:e,sourceTreePath:n,destinationTreePath:o,renamedCount:u.renamed.length,renamedAssetCount:u.renamedAssets.length}),gl.error(i({id:`dDpCOp`}))}Rn(),z(null)}catch(e){console.warn(`[FileTree] rename failed:`,e);let t=i({id:`HIb0vl`});gl.error(t),O(t),gn();let r=De.current;r&&r.renamePath===n?await Bn(r):Rn(),z(null)}}let hr;t[150]!==i||t[151]!==pr||t[152]!==gn?(hr=async function(e){let t=e.draggedPaths.map(t=>{let n=Uf(t,e.target);return t===n?null:{sourcePath:t,destinationTreePath:n}}).filter(o$);if(t.length!==0){z(t[0]?.sourcePath??null),O(null);try{let e=[],n=[],r=[],a={docName:ve.current,folderPath:lt.current?.kind===`folder`?lt.current.folderPath:null,assetPath:lt.current?.kind===`asset`?lt.current.assetPath:null};for(let a of t){let t=a.sourcePath.endsWith(`/`),o=!t&&kn(a.sourcePath),s=o?null:np(a.sourcePath,de.current),c=t?{kind:`folder`,fromPath:rp(a.sourcePath),toPath:rp(a.destinationTreePath)}:o?{kind:`asset`,fromPath:a.sourcePath,toPath:a.destinationTreePath}:{kind:`file`,fromPath:s??Lf(a.sourcePath),toPath:s&&Il(s)?a.destinationTreePath:Lf(a.destinationTreePath)},l=await P(await fetch(`/api/rename-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(c)}),i({id:`dOHMA0`}));if(!l.ok){gl.error(l.title),gn(),z(null);return}let u=Ne(Xi,l.body,`rename-path:drop`,{renamed:[],renamedAssets:[]});e=e.concat(u.renamed),n=n.concat(u.renamedAssets),t&&r.push({fromPath:rp(a.sourcePath),toPath:rp(a.destinationTreePath)})}try{await pr(e,r,n,a)}catch(r){console.warn(`[FileTree] post-move reconciliation failed`,{err:r,operationCount:t.length,renamedCount:e.length,renamedAssetCount:n.length}),gl.error(i({id:`8OxKZy`}))}z(null)}catch(e){console.warn(`[FileTree] move failed:`,e),gl.error(i({id:`HIb0vl`})),gn(),z(null)}}},t[150]=i,t[151]=pr,t[152]=gn,t[153]=hr):hr=t[153];let gr=hr,_r;t[154]!==i||t[155]!==_||t[156]!==gn?(_r=async function(e,t,n){if(e.length===0||Re.current!==null)return;let r=()=>{Re.current=null,z(null)};Re.current=n,z(n),O(null);let a=[],o=0,s=0;for(let n of e){let e=new FormData;e.append(`file`,n),Qf(e,t,n.name||`upload`);try{let r=await P(await fetch(`/api/upload`,{method:`POST`,body:e}),i({id:`4Gz2wC`}));if(!r.ok){s+=1,gl.error(r.title,{description:n.name});continue}let c=Ne(Ka,r.body,`upload:drop`,null);if(c===null){s+=1,gl.error(i({id:`4Gz2wC`}),{description:n.name});continue}let l=Pf(t,c);if(c.deduped===!0){s+=1,gl.error(i({id:`4sKwf6`}),{description:l});continue}o+=1;let u=$f(l,n);u&&a.push(u)}catch(e){let t=e;s+=1,console.warn(`[FileTree] external file upload failed:`,t),gl.error(t instanceof TypeError?i({id:`HIb0vl`}):i({id:`4Gz2wC`}),{description:n.name})}}try{if(a.length>0){for(let e of a)Bl(e)&&_(e.docName);w(e=>{let t=new Set(e.map(zf)),n=!1,r=[...e];for(let e of a){let i=zf(e);Ve.current.set(i,Date.now()),!t.has(i)&&(t.add(i),r.push(e),n=!0)}return n?(gn(r),Dn(r),r):e})}o>0&&(au([`files`,`backlinks`,`graph`]),rt.current?.(),gl.success(Cl._({id:`v75Em9`,values:{uploadedCount:o}}),{description:t||i({id:`RSqaSd`})})),s>0&&O(o>0?Cl._({id:`yH7T4q`,values:{failedCount:s}}):i({id:`4Gz2wC`})),r()}catch(e){let t=e,n=i({id:`VcqWBy`});console.warn(`[FileTree] upload post-upload reconciliation failed:`,t),gl.error(n),O(n),r()}},t[154]=i,t[155]=_,t[156]=gn,t[157]=_r):_r=t[157];let vr=_r,yr;t[158]===Symbol.for(`react.memo_cache_sentinel`)?(yr=function(e){ne({parentDir:e})},t[158]=yr):yr=t[158];let br=yr,xr;t[159]!==i||t[160]!==_||t[161]!==Bn||t[162]!==Rn||t[163]!==Qt||t[164]!==he||t[165]!==gn||t[166]!==nn?(xr=async function(e,t,n){if(Re.current)return;let r=De.current;r&&Rn(r);try{let r=Jf(e,t,[...nn,...cn.current]);z(r.renamePath),Re.current=r.renamePath;let a=window.location.hash,o;if(e===`file`){let e=If(`file`,r.addPath),t={path:e};n?.template&&(t.template=n.template);let a=await P(await fetch(`/api/create-page`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)}),i({id:`fJgQHX`}));if(!a.ok){gl.error(a.title),z(null),Re.current=null;return}let s=Lf(e),c=Ne(yi,a.body,`create-page`,{docName:s}).docName;o=c;let l={kind:`document`,docName:c,docExt:e.toLowerCase().endsWith(`.mdx`)?`.mdx`:`.md`,modified:new Date().toISOString(),size:0};_(c),w(e=>{if(e.some(e=>Bl(e)&&e.docName===c))return e;let t=[...e,l];return Dn(t),Ve.current.set(zf(l),Date.now()),t}),au([`files`,`backlinks`,`graph`]),he({kind:`doc`,docName:c})}else{let e=rp(r.addPath),t=await P(await fetch(`/api/create-folder`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e})}),i({id:`K1ckLX`}));if(!t.ok){gl.error(t.title),z(null),Re.current=null;return}o=Ne(Si,t.body,`create-folder`,{path:e}).path;let n={kind:`folder`,path:o,modified:new Date().toISOString(),size:0};w(e=>{if(e.some(e=>Ul(e)&&e.path===o))return e;let t=[...e,n];return Dn(t),Ve.current.set(zf(n),Date.now()),t}),au([`files`]),he({kind:`folder`,folderPath:o})}let s=!1,c=e=>{if(e.key!==`Enter`)return;let t=De.current;!t||t.renamePath!==r.renamePath||queueMicrotask(()=>Rn(t))};document.addEventListener(`keydown`,c,!0),De.current={kind:e,renamePath:r.renamePath,createdPath:o,previousHash:a,disposeCommitListener:()=>{s||(s=!0,document.removeEventListener(`keydown`,c,!0))}},z(null),Re.current=null,Qt.add(r.addPath),Qt.startRenaming(r.renamePath,{removeIfCanceled:!0})}catch(e){console.warn(`[FileTree] create placeholder failed:`,e),gl.error(i({id:`S6l5dv`}));let t=De.current;t?await Bn(t):Rn(),z(null),Re.current=null,gn()}},t[159]=i,t[160]=_,t[161]=Bn,t[162]=Rn,t[163]=Qt,t[164]=he,t[165]=gn,t[166]=nn,t[167]=xr):xr=t[167];let Sr=xr,Cr;t[168]===Qt?Cr=t[169]:(Cr=function(e){let t=Yf(e);(0,Q.startTransition)(()=>{for(let e of cn.current)if(e===t||e.startsWith(t)){let t=UZ(Qt.getItem(e));t&&t.expand()}})},t[168]=Qt,t[169]=Cr);let wr=Cr,Tr;t[170]===Qt?Tr=t[171]:(Tr=function(e){let t=Yf(e),n=new Set(Ee.current);(0,Q.startTransition)(()=>{for(let e of[...cn.current].reverse())if((e===t||e.startsWith(t))&&!n.has(e)){let t=UZ(Qt.getItem(e));t&&t.collapse()}})},t[170]=Qt,t[171]=Tr);let Er=Tr,Dr;t[172]===Symbol.for(`react.memo_cache_sentinel`)?(Dr=function(){return((it.current?.querySelector(`file-tree-container`)?.shadowRoot)?.querySelector(`[aria-selected="true"][data-item-path]`))?.dataset.itemPath??null},t[172]=Dr):Dr=t[172];let Or=Dr,kr;t[173]!==_e||t[174]!==ln||t[175]!==o||t[176]!==s||t[177]!==be||t[178]!==R||t[179]!==Bn||t[180]!==xn||t[181]!==C||t[182]!==sn||t[183]!==gr||t[184]!==mr||t[185]!==en||t[186]!==v||t[187]!==In||t[188]!==Cn||t[189]!==Ce||t[190]!==Bt||t[191]!==Ht||t[192]!==Vt||t[193]!==nn||t[194]!==vr?(kr=()=>{de.current=C,we.current=Ce,fe.current=v,ve.current=o,lt.current=s,xe.current=be,Re.current=R,Qe.current=Bt,$e.current=Vt,et.current=Ht,an.current=nn,cn.current=sn,Ee.current=ln,Xe.current=xn,Ze.current=Cn,Oe.current=Bn,Le.current=(e,t,n)=>{vr(e,t,n)},at.current=e=>{if(je.current||Me.current||e.length!==1)return;let t=e[0];if(t){se(!1);let e=en(t),n=pe.current,r=n!==null&&Lf(n)===Lf(e),i=r?n:e;pe.current=null,queueMicrotask(()=>{_e(en((r?null:Or())??i),de.current)})}},st.current=e=>{In(e)||gl.error(e)},ot.current=mr,ct.current=gr},t[173]=_e,t[174]=ln,t[175]=o,t[176]=s,t[177]=be,t[178]=R,t[179]=Bn,t[180]=xn,t[181]=C,t[182]=sn,t[183]=gr,t[184]=mr,t[185]=en,t[186]=v,t[187]=In,t[188]=Cn,t[189]=Ce,t[190]=Bt,t[191]=Ht,t[192]=Vt,t[193]=nn,t[194]=vr,t[195]=kr):kr=t[195],(0,Q.useLayoutEffect)(kr);let Ar,jr;t[196]===Qt?(Ar=t[197],jr=t[198]):(Ar=()=>{let e=e=>{let t=(e.metaKey||e.ctrlKey)&&!e.altKey,n=e.key.toLowerCase(),r=t&&n===`a`,i=t&&!e.shiftKey&&n===`d`,a=t&&!e.shiftKey&&n===`c`,o=t&&!e.shiftKey&&n===`v`,s=!e.altKey&&!e.shiftKey&&(e.metaKey&&!e.ctrlKey&&n===`backspace`||!e.metaKey&&!e.ctrlKey&&n===`delete`);if(!r&&!i&&!a&&!o&&!s||aZ(e.target))return;let c=it.current,l=e.target,u=document.activeElement,d=l instanceof Node&&c?.contains(l),f=u instanceof Node&&c?.contains(u);if(!d&&!f)return;if(a){let t=nZ(Qt,de.current,xe.current);if(!t)return;ze.current=t,e.preventDefault(),e.stopPropagation();return}if(o){let t=ze.current;if(!t)return;Mn.current(t),e.preventDefault(),e.stopPropagation();return}if(i){let t=nZ(Qt,de.current,xe.current);if(!t)return;Mn.current(t),e.preventDefault(),e.stopPropagation();return}if(s){if(Re.current!==null)return;let t=rZ(Qt,de.current);if(t.length===0)return;V({targets:t}),e.preventDefault(),e.stopPropagation();return}let p=new Set([...cn.current,...an.current]);je.current=!0;for(let e of p)e&&Qt.getItem(e)?.select();queueMicrotask(()=>{je.current=!1}),e.preventDefault(),e.stopPropagation()};return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)},jr=[Qt],t[196]=Qt,t[197]=Ar,t[198]=jr),(0,Q.useEffect)(Ar,jr);let Mr,Nr;t[199]!==C.length||t[200]!==T?(Mr=()=>{if(T||C.length===0)return;let e=it.current?.querySelector(sV)?.shadowRoot;if(!e)return;let t=a$,n=()=>{for(let n of e.querySelectorAll(`[data-item-path]`)){let e=n.dataset.itemPath;if(!e)continue;let r=t(e);n.title!==r&&(n.title=r)}let n=e.querySelector(`[data-type="context-menu-anchor"]`);if(n){let r=e.querySelector(`[data-item-context-hover="true"][data-item-path]`)?.dataset.itemPath,i=r?t(r):``;n.title!==i&&(n.title=i)}};n();let r=new MutationObserver(n);return r.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`data-item-path`,`data-item-context-hover`]}),()=>r.disconnect()},Nr=[T,C.length],t[199]=C.length,t[200]=T,t[201]=Mr,t[202]=Nr):(Mr=t[201],Nr=t[202]),(0,Q.useEffect)(Mr,Nr);let Pr,Fr;t[203]!==C.length||t[204]!==T?(Pr=()=>{if(T||C.length===0)return;let e=it.current?.querySelector(sV)?.shadowRoot;if(!e)return;let t=()=>TX(e);t();let n=new MutationObserver(t);return n.observe(e,{subtree:!0,childList:!0,characterData:!0,attributes:!0,attributeFilter:[`data-item-path`]}),()=>n.disconnect()},Fr=[T,C.length],t[203]=C.length,t[204]=T,t[205]=Pr,t[206]=Fr):(Pr=t[205],Fr=t[206]),(0,Q.useEffect)(Pr,Fr);let Ir=zt?.validation?.fileTreeIndicators!==!1,Lr,Rr;t[207]!==C.length||t[208]!==T||t[209]!==Ir?(Lr=()=>{if(T||C.length===0)return;let e=it.current?.querySelector(sV)?.shadowRoot;if(!e)return;if(!Ir){fZ(e,new Map);return}let t=()=>fZ(e,Fd());t();let n=new MutationObserver(t);n.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`data-item-path`]});let r=Md(t);return()=>{n.disconnect(),r()}},Rr=[T,C.length,Ir],t[207]=C.length,t[208]=T,t[209]=Ir,t[210]=Lr,t[211]=Rr):(Lr=t[210],Rr=t[211]),(0,Q.useEffect)(Lr,Rr);let zr,Br;t[212]!==C.length||t[213]!==T?(zr=()=>{if(T||C.length===0)return;let e=it.current?.querySelector(sV)?.shadowRoot;if(!e)return;let t=()=>xZ(e);t();let n=new MutationObserver(t);return n.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`data-item-path`]}),()=>n.disconnect()},Br=[T,C.length],t[212]=C.length,t[213]=T,t[214]=zr,t[215]=Br):(zr=t[214],Br=t[215]),(0,Q.useEffect)(zr,Br);let Vr;t[216]===Symbol.for(`react.memo_cache_sentinel`)?(Vr={folderCount:0,expandedCount:0},t[216]=Vr):Vr=t[216];let Hr=(0,Q.useRef)(Vr),Ur=(0,Q.useRef)(Sr),Wr=(0,Q.useRef)(br),Gr;t[217]===Sr?Gr=t[218]:(Gr=()=>{Ur.current=Sr,Wr.current=br},t[217]=Sr,t[218]=Gr),(0,Q.useEffect)(Gr);let Kr,qr;t[219]===Qt?(Kr=t[220],qr=t[221]):(Kr=()=>({startCreating(e,t){Ur.current(e,t)},startCreatingFromTemplate(e){Wr.current(e)},createFromTemplate(e,t){Ur.current(`file`,e,{template:t})},expandAll(){(0,Q.startTransition)(()=>{for(let e of cn.current){let t=UZ(Qt.getItem(e));t&&t.expand()}})},collapseAll(){let e=new Set(Ee.current);(0,Q.startTransition)(()=>{for(let t of[...cn.current].reverse()){if(e.has(t))continue;let n=UZ(Qt.getItem(t));n&&n.collapse()}})},getFolderState(){let e=cn.current,t=0;for(let n of e)UZ(Qt.getItem(n))?.isExpanded()&&t++;let n=e.length,r=Hr.current;if(r.folderCount===n&&r.expandedCount===t)return r;let i={folderCount:n,expandedCount:t};return Hr.current=i,i},isCreationTargetCleared(){return ce.current},clearCreationTarget(){se(!0)},subscribe(e){ue.current.add(e);let t=Qt.subscribe(e);return()=>{ue.current.delete(e),t()}}}),qr=[Qt],t[219]=Qt,t[220]=Kr,t[221]=qr),(0,Q.useImperativeHandle)(n,Kr,qr);async function Jr(e,t,n){let r=oZ(e,de.current,cn.current),i=De.current;i&&e.some(e=>sZ(e,i))&&(i.kind===`file`?r.docNames.add(i.createdPath):r.folderPaths.add(i.createdPath),Rn(i));let a=new Set([...r.docNames,...t]),o=new Set([...r.folderPaths,...n]),s=new Set([...r.assetPaths,...e.filter(i$).map(r$)]);await p({tabIdsToClose:[...[...a].map(n$),...[...o].map(t$),...[...s].map(e$)],docNamesToClear:[...a]});for(let t of e){let e=t.kind===`folder`?Yf(t.path):t.kind===`asset`?t.path:Zf(t.path,t.docExt);Qt.getItem(e)&&Qt.remove(e,t.kind===`folder`?{recursive:!0}:void 0)}w(e=>{let t=xI(e,[...a],void 0,[...s]);for(let e of o)t=xI(t,[],e);return Dn(t),t}),au([`files`,`backlinks`,`graph`])}let Yr;t[222]!==i||t[223]!==Jr?(Yr=async function(e){let t=[],n=[],r=[];for(let a of e){let e=a.kind;z(a.path);let o=await P(await fetch(`/api/delete-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:e,path:a.path})}),i({id:`7JtSLi`}));if(!o.ok)return r.length>0&&await Jr(r,t,n),gl.error(o.title),!1;let s=Ne(pi,o.body,`delete-path`,{deletedDocNames:[]});t.push(...s.deletedDocNames),e===`folder`&&n.push(a.path),r.push(a)}return await Jr(r,t,n),!0},t[222]=i,t[223]=Jr,t[224]=Yr):Yr=t[224];let Xr=Yr,Zr;t[225]===Symbol.for(`react.memo_cache_sentinel`)?(Zr=async function(e,t,n){let r=[],i=[];for(let a of e){z(a.path);let e=TI(a,n),o=await t.shell.trashItem(e);o.ok?r.push(a):i.push({kind:a.kind,path:a.path,name:a.name,reason:IZ(o.reason),detail:o.detail})}return{trashed:r,failed:i}},t[225]=Zr):Zr=t[225];let Qr=Zr,$r;t[226]===i?$r=t[227]:($r=async function(e){let t=[],n=[],r=[];for(let a of e){let e=a.kind;try{let o=await P(await fetch(`/api/trash/cleanup`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:e,path:a.path})}),i({id:`DVh_Tb`}));if(!o.ok){console.warn(`[FileTree] trash-cleanup failed`,{target:`${a.kind}:${a.path}`,reason:o.title}),r.push({target:a,reason:o.title});continue}let s=Ne(na,o.body,`trash-cleanup`,{deletedDocNames:[]});t.push(...s.deletedDocNames),e===`folder`&&n.push(a.path)}catch(e){let t=e;console.warn(`[FileTree] trash-cleanup threw`,{target:`${a.kind}:${a.path}`,err:t}),r.push({target:a,reason:i({id:`r4R7AZ`})})}}if(r.length>0){let e=r.length;gl.error(i({id:`IrB5AK`,values:{failedCount:e}}),{description:i({id:`vEJDlt`})})}return r.length===e.length&&e.length>0?null:{deletedDocNames:t,deletedFolderPaths:n}},t[226]=i,t[227]=$r);let ei=$r,ti;t[228]!==i||t[229]!==K||t[230]!==Jr||t[231]!==Xr||t[232]!==ei||t[233]!==gn||t[234]!==q?(ti=async function(e){let t=e.filter($Q).map(e=>SI(e,de.current)),n=t[0];if(!n)return;let r=K.filter(e=>t.some(t=>{if(t.kind===`file`){let n=`${t.path}${t.docExt??`.md`}`;return e.file===n}return t.kind===`folder`?e.file.startsWith(`${t.path}/`):!1}));if(r.length>0){let e=r.slice(0,3).map(QQ),t=r.length>e.length?`, +${r.length-e.length} more`:``;gl.error(`Cannot delete files with unresolved conflicts`,{description:`Resolve the conflict on ${e.join(`, `)}${t} before deleting.`});return}z(n.path),V(null);let a=typeof window<`u`?window.okDesktop:void 0;try{if(a&&q){let{trashed:e,failed:n}=await Qr(t,a,q);if(e.length>0){let t=await ei(e);t?await Jr(e,t.deletedDocNames,t.deletedFolderPaths):await Jr(e,e.filter(ZQ).map(XQ),e.filter(YQ).map(JQ))}n.length>0&&G({failed:n,originalTargets:[...t]}),z(null)}else{let e=await Xr(t);z(null),e||gn()}}catch(e){let t=e,n=t instanceof Error?t.message:String(t);console.warn(`[FileTree] delete failed:`,t),gl.error(i({id:`0eHrMb`}),{description:n}),z(null),gn()}},t[228]=i,t[229]=K,t[230]=Jr,t[231]=Xr,t[232]=ei,t[233]=gn,t[234]=q,t[235]=ti):ti=t[235];let ni=ti,ri;t[236]!==i||t[237]!==Xr||t[238]!==gn||t[239]!==W?(ri=async function(){if(!W)return;let e=new Set(W.failed.map(qQ)),t=W.originalTargets.filter(t=>e.has(`${t.kind}:${t.path}`));if(G(null),t.length!==0){z(t[0]?.path??null);try{let e=await Xr(t);z(null),e||gn()}catch(e){let t=e,n=t instanceof Error?t.message:String(t);console.warn(`[FileTree] hard-delete fallback failed:`,t),gl.error(i({id:`0eHrMb`}),{description:n}),z(null),gn()}}},t[236]=i,t[237]=Xr,t[238]=gn,t[239]=W,t[240]=ri):ri=t[240];let ii=ri,ai;t[241]!==ni||t[242]!==W?(ai=async function(){if(!W)return;let e=new Set(W.failed.map(KQ)),t=W.originalTargets.filter(t=>e.has(`${t.kind}:${t.path}`));G(null),await ni(t)},t[241]=ni,t[242]=W,t[243]=ai):ai=t[243];let oi=ai,si=(0,Q.useRef)(ni),ci;t[244]===ni?ci=t[245]:(ci=()=>{si.current=ni},t[244]=ni,t[245]=ci),(0,Q.useEffect)(ci);let li,ui;t[246]===Symbol.for(`react.memo_cache_sentinel`)?(li=()=>ZZ(e=>{if(e.kind===`doc`||e.kind===`folder-index`){let t=e.docName,n=de.current.find(e=>Bl(e)&&e.docName===t);si.current([{kind:`file`,path:t,name:t.split(`/`).pop()??t,docExt:n?.docExt}]);return}if(e.kind===`folder`){si.current([{kind:`folder`,path:e.folderPath,name:e.folderPath.split(`/`).pop()??e.folderPath}]);return}if(e.kind===`asset`){si.current([{kind:`asset`,path:e.assetPath,name:e.assetPath.split(`/`).pop()??e.assetPath}]);return}console.warn(JSON.stringify({event:`file-tree-menu-action-delete-unsupported-kind`,kind:e.kind}))}),ui=[],t[246]=li,t[247]=ui):(li=t[246],ui=t[247]),(0,Q.useEffect)(li,ui);let di,fi;t[248]===Symbol.for(`react.memo_cache_sentinel`)?(di=()=>tQ(e=>{if(e.kind===`doc`||e.kind===`folder-index`){let t=e.docName,n=de.current.find(e=>Bl(e)&&e.docName===t);Mn.current({kind:`file`,path:t,name:t.split(`/`).pop()??t,docExt:n?.docExt});return}if(e.kind===`folder`){Mn.current({kind:`folder`,path:e.folderPath,name:e.folderPath.split(`/`).pop()??e.folderPath});return}console.warn(JSON.stringify({event:`file-tree-menu-action-duplicate-unsupported-kind`,kind:e.kind}))}),fi=[],t[248]=di,t[249]=fi):(di=t[248],fi=t[249]),(0,Q.useEffect)(di,fi);let mi,hi;t[250]===Qt?(mi=t[251],hi=t[252]):(mi=()=>$Z(e=>{if(e.kind===`doc`||e.kind===`folder-index`){let t=e.docName,n=Zf(t,de.current.find(e=>Bl(e)&&e.docName===t)?.docExt);Qt.startRenaming(n);return}if(e.kind===`folder`){Qt.startRenaming(e.folderPath);return}if(e.kind===`asset`){Qt.startRenaming(e.assetPath);return}console.warn(JSON.stringify({event:`file-tree-menu-action-rename-unsupported-kind`,kind:e.kind}))}),hi=[Qt],t[250]=Qt,t[251]=mi,t[252]=hi),(0,Q.useEffect)(mi,hi);let gi;t[253]===Symbol.for(`react.memo_cache_sentinel`)?(gi=function(){let e=Ae.current;e&&CQ(e),Ae.current=null},t[253]=gi):gi=t[253];let _i=gi,vi;t[254]===Symbol.for(`react.memo_cache_sentinel`)?(vi=function(e){let t=XX(e);if(!t)return!1;let n=it.current?.querySelector(sV)?.shadowRoot;if(!n)return!1;for(let e of n.querySelectorAll(`[data-item-path]`))if(e.dataset.itemPath===t)return!0;return!1},t[254]=vi):vi=t[254];let bi=vi,xi;t[255]===f?xi=t[256]:(xi=function(e){let t=y$(e.nativeEvent);if(!t||t.endsWith(`/`)){_i();return}let n=de.current.find(e=>zf(e)===t);if(n&&Kl(n)){_i();return}let r=n&&Bl(n)?n.docName:np(t,de.current);if(n&&Bl(n)&&Va(n.size)){_i();return}Ae.current!==r&&(_i(),Ae.current=r,SQ(r,e=>f(e)))},t[255]=f,t[256]=xi);let wi=xi,Ti;t[257]!==_e||t[258]!==Qt||t[259]!==he?(Ti=function(e){if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=b$(e.nativeEvent);if(!t){C$(e.nativeEvent)&&se(!0);return}let n=t.getAttribute(`aria-selected`)===`true`,r=t.dataset.itemPath;if(!r)return;let i=t.dataset.itemType===`folder`?Yf(r):r;if(t.dataset.itemType===`folder`){let t=rp(i),r=UZ(Qt.getItem(i));if(!n){e.preventDefault(),e.stopPropagation(),r&&!r.isExpanded()&&r.expand(),queueMicrotask(()=>he({kind:`folder`,folderPath:t}));return}if(Qt.getSelectedPaths().length!==1||window.location.hash===pu(t))return;e.preventDefault(),e.stopPropagation(),r&&!r.isExpanded()&&r.expand(),queueMicrotask(()=>he({kind:`folder`,folderPath:t}));return}if(!n){if(ZX(i,an.current)||bi(i)){pe.current=i,setTimeout(()=>he({kind:`doc`,docName:i,registerPage:!0}),0);return}queueMicrotask(()=>_e(i));return}let a=np(i,de.current);Qt.getSelectedPaths().length===1&&window.location.hash!==Cu(a)&&queueMicrotask(()=>_e(i))},t[257]=_e,t[258]=Qt,t[259]=he,t[260]=Ti):Ti=t[260];let Ei=Ti,Di;t[261]===Symbol.for(`react.memo_cache_sentinel`)?(Di=function(e){Kf(e.nativeEvent)&&(e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect=`copy`,dt(!0))},t[261]=Di):Di=t[261];let Oi=Di,ki;t[262]===Symbol.for(`react.memo_cache_sentinel`)?(ki=function(e){let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||dt(!1)},t[262]=ki):ki=t[262];let Ai=ki,ji;t[263]===vr?ji=t[264]:(ji=function(e){if(!Kf(e.nativeEvent))return;let t=Bf(e.nativeEvent);t.length!==0&&(e.preventDefault(),e.stopPropagation(),dt(!1),vr(t,``,jQ))},t[263]=vr,t[264]=ji);let Mi=ji;if(T){let e;return t[265]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(T$,{}),t[265]=e):e=t[265],e}let Ni;t[266]!==i||t[267]!==k||t[268]!==j?(Ni=k?i(j?{id:`H-vDm3`}:{id:`09Tv5j`}):null,t[266]=i,t[267]=k,t[268]=j,t[269]=Ni):Ni=t[269];let Pi=Ni;if(C.length===0){if(Pi!==null){let e;return t[270]===Pi?e=t[271]:(e=(0,Z.jsx)(`div`,{className:`flex flex-1 items-center justify-center py-8`,children:(0,Z.jsx)(`span`,{role:`status`,className:`select-none text-sidebar-foreground/50 text-sm`,children:Pi})}),t[270]=Pi,t[271]=e),e}if(D){let e;return t[272]===D?e=t[273]:(e=(0,Z.jsx)(`div`,{className:`flex flex-1 items-center justify-center py-8`,children:(0,Z.jsx)(`span`,{role:`alert`,className:`select-none text-sidebar-foreground/50 text-sm`,children:D})}),t[272]=D,t[273]=e),e}if(Wl({visibility:{showHiddenFiles:Bt,showOnlyMarkdownFiles:Vt},unfilteredRootEntryCount:I,knownPageCount:y.size})===`filtered-to-zero`){let e;return t[274]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(hX,{}),t[274]=e):e=t[274],e}let e;t[275]===i?e=t[276]:(e=i({id:`5ZB7XC`}),t[275]=i,t[276]=e);let n=ut&&`bg-primary/5 ring-2 ring-primary/70 ring-inset`,r;t[277]===n?r=t[278]:(r=Y(`flex flex-1 flex-col items-center justify-center gap-3 rounded-md py-8`,n),t[277]=n,t[278]=r);let a;t[279]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(`span`,{className:`select-none text-sidebar-foreground/30 text-sm`,children:(0,Z.jsx)(J,{id:`xiv-dW`})}),t[279]=a):a=t[279];let o;t[280]===Sr?o=t[281]:(o=()=>Sr(`file`,``),t[280]=Sr,t[281]=o);let s;t[282]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(J,{id:`6ibbCg`}),t[282]=s):s=t[282];let c;t[283]===o?c=t[284]:(c=(0,Z.jsx)(X,{variant:`link`,size:`sm`,className:`font-mono uppercase`,onClick:o,children:s}),t[283]=o,t[284]=c);let l;return t[285]!==Mi||t[286]!==e||t[287]!==r||t[288]!==c?(l=(0,Z.jsxs)(`section`,{"aria-label":e,className:r,onDragOver:Oi,onDragLeave:Ai,onDrop:Mi,children:[a,c]}),t[285]=Mi,t[286]=e,t[287]=r,t[288]=c,t[289]=l):l=t[289],l}let Fi=R!==null,Ii=B?.targets[0]??null,Li=null;if(N!==null){let e;if(t[290]!==a.locale||t[291]!==N){let n=new Intl.NumberFormat(a.locale).format(N);e=Cl._({id:`LuoJWu`,values:{truncatedShownCount:N,formattedCount:n}}),t[290]=a.locale,t[291]=N,t[292]=e}else e=t[292];Li=e}let Ri;t[293]!==D||t[294]!==Pi||t[295]!==Li?(Ri=(D||Pi!==null||Li!==null)&&(0,Z.jsxs)(Z.Fragment,{children:[Pi===null?D&&(0,Z.jsx)(D$,{kind:`error`,children:D}):(0,Z.jsx)(D$,{kind:`reconnecting`,children:Pi}),Li!==null&&(0,Z.jsx)(D$,{kind:`info`,children:Li})]}),t[293]=D,t[294]=Pi,t[295]=Li,t[296]=Ri):Ri=t[296];let Bi;t[297]===g?Bi=t[298]:(Bi=bX(g),t[297]=g,t[298]=Bi);let Vi=ie?``:void 0,Hi;t[299]===Vi?Hi=t[300]:(Hi={[PQ]:Vi},t[299]=Vi,t[300]=Hi);let Ui;t[301]!==Fi||t[302]!==be||t[303]!==Er||t[304]!==C||t[305]!==wr||t[306]!==sn||t[307]!==jn||t[308]!==Pn||t[309]!==It||t[310]!==Qt||t[311]!==Rt||t[312]!==Sr||t[313]!==q?(Ui=(e,t)=>(0,Z.jsx)(RQ,{item:e,context:t,anyActionBusy:Fi,workspace:q,handoff:It,model:Qt,okignoreBinding:Rt,onStartCreating:Sr,onCreateFromTemplate:(e,t)=>Sr(`file`,e,{template:t}),onDuplicate:jn,onImportTemplate:Pn,onDelete:e=>V({targets:e}),onExpandSubtree:wr,onCollapseSubtree:Er,folderTreePaths:sn,isAsset:be.has(e.path),documents:C}),t[301]=Fi,t[302]=be,t[303]=Er,t[304]=C,t[305]=wr,t[306]=sn,t[307]=jn,t[308]=Pn,t[309]=It,t[310]=Qt,t[311]=Rt,t[312]=Sr,t[313]=q,t[314]=Ui):Ui=t[314];let Wi;t[315]!==Ei||t[316]!==wi||t[317]!==Qt||t[318]!==Ri||t[319]!==Bi||t[320]!==Hi||t[321]!==Ui?(Wi=(0,Z.jsx)(`div`,{ref:it,className:`flex min-h-0 flex-1 flex-col`,children:(0,Z.jsx)(pX,{header:Ri,model:Qt,style:Bi,...Hi,onClickCapture:Ei,onMouseMove:wi,onMouseLeave:_i,renderContextMenu:Ui})}),t[315]=Ei,t[316]=wi,t[317]=Qt,t[318]=Ri,t[319]=Bi,t[320]=Hi,t[321]=Ui,t[322]=Wi):Wi=t[322];let Gi=!!B,Ki;t[323]===R?Ki=t[324]:(Ki=e=>{!e&&!R&&V(null)},t[323]=R,t[324]=Ki);let qi;t[325]!==i||t[326]!==R||t[327]!==B||t[328]!==ni||t[329]!==Ii?(qi=B&&Ii&&(0,Z.jsx)(cs,{...(()=>{let e=MZ(typeof window<`u`&&window.okDesktop!=null?`electron`:`web`,B.targets);if(e)return{customTitle:e.title,customDescription:``,customDetail:e.detail,customConfirmLabel:e.confirmLabel,customConfirmLabelBusy:e.confirmLabelBusy,children:e.listedTargets?(0,Z.jsx)(`ul`,{className:`flex flex-col gap-1 font-mono text-foreground text-xs`,children:e.listedTargets.map(GQ)}):null};let t=B.targets.length,n=Ii.name;return{itemName:t===1?Ii.kind===`folder`?`${Ii.name}/`:Ii.kind===`file`?`${Ii.name}${Ii.docExt??`.md`}`:Ii.name:void 0,customTitle:t>1?i({id:`abiHje`}):void 0,customDescription:t>1?i({id:`WMIKXK`,values:{targetCount:t}}):Ii.kind===`folder`?i({id:`a5W0q0`,values:{folderName:n}}):void 0}})(),isSubmitting:R!==null,onDelete:()=>ni(B.targets)}),t[325]=i,t[326]=R,t[327]=B,t[328]=ni,t[329]=Ii,t[330]=qi):qi=t[330];let Ji;t[331]!==Gi||t[332]!==Ki||t[333]!==qi?(Ji=(0,Z.jsx)(yn,{open:Gi,onOpenChange:Ki,children:qi}),t[331]=Gi,t[332]=Ki,t[333]=qi,t[334]=Ji):Ji=t[334];let Yi=!!H,Zi;t[335]===R?Zi=t[336]:(Zi=e=>{!e&&!R&&U(null)},t[335]=R,t[336]=Zi);let Qi;t[337]!==i||t[338]!==R||t[339]!==Fn||t[340]!==H?(Qi=H&&(0,Z.jsx)(cs,{itemName:H.name+(H.kind===`file`?H.docExt??`.md`:`.md`),customTitle:i({id:`hLod4_`}),customDescription:i({id:`RMQe3p`}),customConfirmLabel:i({id:`hvZwVx`}),customConfirmLabelBusy:i({id:`ul1Atu`}),isSubmitting:R!==null,onDelete:()=>Fn(H,!0)}),t[337]=i,t[338]=R,t[339]=Fn,t[340]=H,t[341]=Qi):Qi=t[341];let $i;t[342]!==Yi||t[343]!==Zi||t[344]!==Qi?($i=(0,Z.jsx)(yn,{open:Yi,onOpenChange:Zi,children:Qi}),t[342]=Yi,t[343]=Zi,t[344]=Qi,t[345]=$i):$i=t[345];let ea=!!W,ta;t[346]===R?ta=t[347]:(ta=e=>{!e&&!R&&G(null)},t[346]=R,t[347]=ta);let ra;t[348]!==R||t[349]!==ii||t[350]!==oi||t[351]!==W?(ra=W&&(0,Z.jsx)(BZ,{failedTargets:W.failed,isSubmitting:R!==null,onDeletePermanently:ii,onRetry:oi,onCancel:()=>G(null)}),t[348]=R,t[349]=ii,t[350]=oi,t[351]=W,t[352]=ra):ra=t[352];let ia;t[353]!==ea||t[354]!==ta||t[355]!==ra?(ia=(0,Z.jsx)(yn,{open:ea,onOpenChange:ta,children:ra}),t[353]=ea,t[354]=ta,t[355]=ra,t[356]=ia):ia=t[356];let aa=ee!==null,oa;t[357]===Symbol.for(`react.memo_cache_sentinel`)?(oa=e=>{e||ne(null)},t[357]=oa):oa=t[357];let sa=ee?.parentDir??``,ca;t[358]!==aa||t[359]!==sa?(ca=(0,Z.jsx)(av,{open:aa,onOpenChange:oa,kind:`file`,initialDir:sa,defaultToTemplate:!0}),t[358]=aa,t[359]=sa,t[360]=ca):ca=t[360];let ua;return t[361]!==Wi||t[362]!==Ji||t[363]!==$i||t[364]!==ia||t[365]!==ca?(ua=(0,Z.jsxs)(Z.Fragment,{children:[Wi,Ji,$i,ia,ca]}),t[361]=Wi,t[362]=Ji,t[363]=$i,t[364]=ia,t[365]=ca,t[366]=ua):ua=t[366],ua}function GQ(e){return(0,Z.jsx)(`li`,{"data-testid":`delete-target-row`,children:NZ(e)},`${e.kind}:${e.path}`)}function KQ(e){return`${e.kind}:${e.path}`}function qQ(e){return`${e.kind}:${e.path}`}function JQ(e){return e.path}function YQ(e){return e.kind===`folder`}function XQ(e){return e.path}function ZQ(e){return e.kind===`file`}function QQ(e){return e.file}function $Q(e){return!Gl(e.path)}function e$(e){return T(e)}function t$(e){return ae(e)}function n$(e){return Je(e)}function r$(e){return e.path}function i$(e){return e.kind===`asset`}function a$(e){return e.endsWith(`/`)?e.slice(0,-1):e}function o$(e){return!!e}function s$(e){console.warn(`[FileTree] /api/workspace fetch failed:`,e)}function c$(e){console.warn(`[FileTree] unmount cleanup failed:`,e)}function l$(e){gl.error(e)}function u$(){}function d$(e){return gl.error(e)}function f$(){}function p$(){}function m$(){}function h$(){}function g$(){}async function _$(){}function v$(e){return zf(e)}function y$(e){return b$(e)?.dataset.itemPath??null}function b$(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&t.dataset.itemPath)return t;return null}function x$(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&t.matches(`[data-file-tree-virtualized-root]`))return t;return null}function S$(e){let t=b$(e);if(t){let e=t.dataset.itemPath;if(!e)return null;let n=t.dataset.itemType===`folder`,r=Vf(e,n);return{parentDir:r,row:t,root:null,busyPath:n?Yf(r):e}}return C$(e)?{parentDir:``,row:null,root:x$(e),busyPath:jQ}:null}function C$(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&t.matches(`[data-file-tree-virtualized-scroll]`))return!0;return!1}var w$=[`w-3/4`,`w-2/3`,`w-4/5`,`w-1/2`,`w-3/5`,`w-2/3`];function T$(){let e=(0,$.c)(5),{_:t}=gt(),n;e[0]===t?n=e[1]:(n=t({id:`5Tk8Fb`}),e[0]=t,e[1]=n);let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=w$.map(E$),e[2]=r):r=e[2];let i;return e[3]===n?i=e[4]:(i=(0,Z.jsx)(`div`,{className:`flex flex-1 flex-col gap-1 px-2 py-2`,role:`status`,"aria-busy":`true`,"aria-label":n,children:r}),e[3]=n,e[4]=i),i}function E$(e,t){return(0,Z.jsxs)(`div`,{className:`flex h-6 items-center gap-2`,children:[(0,Z.jsx)(Jd,{className:`h-3 w-3 shrink-0 rounded-sm`}),(0,Z.jsx)(Jd,{className:`h-3 ${e}`})]},t)}function D$(e){let t=(0,$.c)(14),{kind:n,children:r}=e,i=n===`error`?ul:n===`reconnecting`?tl:Yc,a=n===`error`?`alert`:`status`,o=n===`error`?`text-destructive`:`text-muted-foreground`,s;t[0]===o?s=t[1]:(s=Y(`mx-2 mb-1 flex items-start gap-1.5 rounded-md bg-muted/50 px-2 py-1.5 text-xs leading-snug`,o),t[0]=o,t[1]=s);let c=n===`reconnecting`&&`animate-spin motion-reduce:animate-none`,l;t[2]===c?l=t[3]:(l=Y(`mt-0.5 size-3.5 shrink-0`,c),t[2]=c,t[3]=l);let u;t[4]!==i||t[5]!==l?(u=(0,Z.jsx)(i,{"aria-hidden":`true`,className:l}),t[4]=i,t[5]=l,t[6]=u):u=t[6];let d;t[7]===r?d=t[8]:(d=(0,Z.jsx)(`span`,{className:`min-w-0`,children:r}),t[7]=r,t[8]=d);let f;return t[9]!==a||t[10]!==s||t[11]!==u||t[12]!==d?(f=(0,Z.jsxs)(`span`,{role:a,className:s,children:[u,d]}),t[9]=a,t[10]=s,t[11]=u,t[12]=d,t[13]=f):f=t[13],f}function O$(e){return e?Cl._({id:`wTcjov`}):null}function k$(e){let t=(0,$.c)(46),{_:n}=gt(),r=ec(),i=es(),a=Gr(),o=Xr();if(r)return null;let{input:s,installStates:c,dispatch:l}=e,u=s===null,d,f,p,m,h,g,_,v,y,b,x;if(t[0]!==n||t[1]!==l||t[2]!==s||t[3]!==u||t[4]!==c||t[5]!==o||t[6]!==a||t[7]!==i){let e=O$(u),r;t[19]===o?r=t[20]:(r=e=>ni(o,e.id),t[19]=o,t[20]=r);let S=Zr.filter(r),C;t[21]===o?C=t[22]:(C=e=>Qr(o,e.source,e.id,!0,e.supported),t[21]=o,t[22]=C);let w=a.filter(C),T=i?$i.filter(e=>ei(o,e,i.installedClis)):[];p=S.length>0,m=i!==null&&T.length>0,h=w.length>0,f=ny,t[23]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Z.jsxs)(ay,{children:[(0,Z.jsx)(Zs,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`O7_W_a`})]}),t[23]=x):x=t[23],d=oy,g=`max-h-80`,_=h?(0,Z.jsxs)(ty,{"aria-label":n({id:`vPKX2i`}),children:[(0,Z.jsxs)(cy,{className:`flex items-center gap-1.5`,children:[(0,Z.jsx)(J,{id:`RXEbZy`}),(0,Z.jsx)(ti,{})]}),w.map(t=>{let r=t.name;return(0,Z.jsxs)(iy,{onSelect:()=>{s!==null&&hs(s,{agent:{source:t.source,id:t.id}})},disabled:u,"data-testid":`empty-space-open-in-thread-${t.id}`,"aria-label":e?n({id:`gtGQ9S`,values:{agentName:r,hint:e}}):void 0,children:[(0,Z.jsx)(So,{agentId:t.id,iconUrl:t.iconUrl,className:`size-4`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(J,{id:`5PrrYw`,values:{agentName:r}})}),e?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},`${t.source}:${t.id}`)})]}):null,t[24]!==p||t[25]!==m||t[26]!==h?(v=h&&(m||p)?(0,Z.jsx)(ly,{}):null,t[24]=p,t[25]=m,t[26]=h,t[27]=v):v=t[27],y=m?(0,Z.jsxs)(ty,{"aria-label":n({id:`ALhMYW`}),children:[(0,Z.jsx)(cy,{children:(0,Z.jsx)(J,{id:`ALhMYW`})}),T.map(t=>{let{displayName:r}=gi[t];return(0,Z.jsxs)(iy,{onSelect:()=>{s!==null&&i.launchInTerminal(s,t)},disabled:u,"data-testid":`empty-space-open-in-terminal-${t}`,"aria-label":n(e?{id:`AIn2Yv`,values:{displayName:r,hint:e}}:{id:`QYfQdv`,values:{displayName:r}}),children:[(0,Z.jsx)($r,{id:qr(t),"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:r}),e?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t)})]}):null,b=p?(0,Z.jsxs)(Z.Fragment,{children:[m?(0,Z.jsx)(ly,{}):null,(0,Z.jsxs)(ty,{"aria-label":n({id:`BBqGS9`}),children:[(0,Z.jsx)(cy,{children:(0,Z.jsx)(J,{id:`BBqGS9`})}),S.map(t=>{let r=!u,{displayName:i}=t,a=n(e?{id:`1ZpfyB`,values:{displayName:i,hint:e}}:{id:`WqLq6M`,values:{displayName:i}});return(0,Z.jsxs)(iy,{disabled:!r,onSelect:()=>{if(s){if(c[t.id]?.installed!==!0){ps(t);return}l(t.id,s)}},"data-testid":`empty-space-open-in-${t.id}`,"aria-label":a,children:[(0,Z.jsx)($r,{id:t.id,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:t.displayName}),e?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t.id)})]})]}):null,t[0]=n,t[1]=l,t[2]=s,t[3]=u,t[4]=c,t[5]=o,t[6]=a,t[7]=i,t[8]=d,t[9]=f,t[10]=p,t[11]=m,t[12]=h,t[13]=g,t[14]=_,t[15]=v,t[16]=y,t[17]=b,t[18]=x}else d=t[8],f=t[9],p=t[10],m=t[11],h=t[12],g=t[13],_=t[14],v=t[15],y=t[16],b=t[17],x=t[18];let S;t[28]!==p||t[29]!==m||t[30]!==h?(S=h||m||p?(0,Z.jsx)(ly,{}):null,t[28]=p,t[29]=m,t[30]=h,t[31]=S):S=t[31];let C;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Z.jsx)(cl,{"aria-hidden":`true`}),t[32]=C):C=t[32];let w;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Z.jsxs)(iy,{onSelect:Ol,"data-testid":`empty-space-open-in-settings`,children:[C,(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(J,{id:`jRAGrQ`})})]}),t[33]=w):w=t[33];let T;t[34]!==d||t[35]!==g||t[36]!==_||t[37]!==v||t[38]!==y||t[39]!==b||t[40]!==S?(T=(0,Z.jsxs)(d,{className:g,children:[_,v,y,b,S,w]}),t[34]=d,t[35]=g,t[36]=_,t[37]=v,t[38]=y,t[39]=b,t[40]=S,t[41]=T):T=t[41];let E;return t[42]!==f||t[43]!==x||t[44]!==T?(E=(0,Z.jsxs)(f,{children:[x,T]}),t[42]=f,t[43]=x,t[44]=T,t[45]=E):E=t[45],E}async function A$(e){try{let t=await e.project.listRecent(),n=e.config.projectPath;if(t.some(e=>e.path!==n))return null;let r=await GE();return e.config.freshlyCreated?r:r===0?0:null}catch(e){return console.warn(`[onboarding-card-visible] fresh-project probe failed; suppressing card`,e),null}}function j$(e){let t=(0,$.c)(4),n=e===void 0?VE:e,{initialized:r,dismissed:i,completed:a}=(0,Q.useSyncExternalStore)(n.subscribe,n.getSnapshot,n.getSnapshot),o=i||a,s=!r&&!o,c,l;return t[0]!==s||t[1]!==n?(c=()=>{if(!s)return;let e=window.okDesktop;if(e==null)return;let t=!1;return A$(e).then(e=>{!t&&e!==null&&n.activate(e)}),()=>{t=!0}},l=[s,n],t[0]=s,t[1]=n,t[2]=c,t[3]=l):(c=t[2],l=t[3]),(0,Q.useEffect)(c,l),r&&!o}function M$(e){let t=(0,$.c)(3),n=e===void 0?VE:e,r,i;t[0]===n?(r=t[1],i=t[2]):(r=()=>{if(n.getSnapshot().steps.file)return;let e=eu(e=>{e.includes(`files`)&&KE(n)});return KE(n),e},i=[n],t[0]=n,t[1]=r,t[2]=i),(0,Q.useEffect)(r,i)}var N$=3,P$=5200,F$=1500,I$=220;function L$(e){let t=(0,$.c)(14),{complete:n,label:r,shortcutId:i}=e,a;t[0]===n?a=t[1]:(a=(0,Z.jsx)(Xn,{checked:n,disabled:!0,"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none opacity-100 disabled:opacity-100`}),t[0]=n,t[1]=a);let o=n?`flex-1 text-muted-foreground/60`:`flex-1`,s;t[2]===n?s=t[3]:(s=n?(0,Z.jsxs)(`span`,{className:`sr-only`,children:[(0,Z.jsx)(J,{id:`Qj4RL5`}),` `]}):null,t[2]=n,t[3]=s);let c;t[4]!==r||t[5]!==o||t[6]!==s?(c=(0,Z.jsxs)(`span`,{className:o,children:[s,r]}),t[4]=r,t[5]=o,t[6]=s,t[7]=c):c=t[7];let l;t[8]===i?l=t[9]:(l=i?(0,Z.jsx)(p,{children:Pl(i)}):null,t[8]=i,t[9]=l);let u;return t[10]!==a||t[11]!==c||t[12]!==l?(u=(0,Z.jsxs)(`li`,{className:`flex items-center gap-2 py-0.5 text-sm`,children:[a,c,l]}),t[10]=a,t[11]=c,t[12]=l,t[13]=u):u=t[13],u}function R$(e){let t=(0,$.c)(24),{store:n,lingerMs:r}=e,i=n===void 0?VE:n,a=r===void 0?P$:r,{_:o}=gt(),{steps:s}=HE(i);M$(i);let[c,l]=(0,Q.useState)(0),[u,d]=(0,Q.useState)(!1),f=1+ +!!s.file+ +!!s.askedAi,p=f===N$,m,h;t[0]!==p||t[1]!==a?(m=()=>{if(!p)return;l(B$);let e=setInterval(()=>l(z$),F$),t=setTimeout(()=>{clearInterval(e),d(!0)},a);return()=>{clearInterval(e),clearTimeout(t)}},h=[p,a],t[0]=p,t[1]=a,t[2]=m,t[3]=h):(m=t[2],h=t[3]),(0,Q.useEffect)(m,h);let g,_;t[4]!==u||t[5]!==i?(g=()=>{if(!u)return;let e=setTimeout(()=>i.markCompleted(),I$);return()=>clearTimeout(e)},_=[u,i],t[4]=u,t[5]=i,t[6]=g,t[7]=_):(g=t[6],_=t[7]),(0,Q.useEffect)(g,_);let v;t[8]!==o||t[9]!==p?(v=p?o({id:`7jIIFX`}):``,t[8]=o,t[9]=p,t[10]=v):v=t[10];let y;t[11]===v?y=t[12]:(y=(0,Z.jsx)(`div`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:v}),t[11]=v,t[12]=y);let b;t[13]!==p||t[14]!==c||t[15]!==f||t[16]!==u||t[17]!==s.askedAi||t[18]!==s.file||t[19]!==i?(b=p?(0,Z.jsxs)(`section`,{"aria-hidden":!0,className:Y(`mx-2 mb-1 flex items-center gap-3 rounded-lg border bg-card px-4 py-3 text-card-foreground`,`motion-reduce:animate-none motion-reduce:duration-0`,u?`animate-out fade-out-0 zoom-out-95 fill-mode-forwards duration-200`:`animate-in fade-in-0 zoom-in-95 duration-300`),children:[(0,Z.jsx)(em,{size:36,celebrateSignal:c}),(0,Z.jsx)(`span`,{className:`font-medium text-sm`,children:(0,Z.jsx)(J,{id:`7jIIFX`})})]}):(0,Z.jsxs)(`section`,{"aria-labelledby":`onboarding-card-heading`,className:`mx-2 mb-1 rounded-lg border bg-card px-4 py-3 text-card-foreground`,children:[(0,Z.jsxs)(`header`,{className:`mb-3 flex items-center justify-between`,children:[(0,Z.jsx)(`h2`,{id:`onboarding-card-heading`,className:`font-medium text-sm`,children:(0,Z.jsx)(J,{id:`Y1QMlM`})}),(0,Z.jsx)(`span`,{className:`text-muted-foreground/60 text-xs tabular-nums`,children:`${f} / ${N$}`})]}),(0,Z.jsxs)(`ul`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(L$,{complete:!0,label:(0,Z.jsx)(J,{id:`4E9jPa`})}),(0,Z.jsx)(L$,{complete:s.file,label:(0,Z.jsx)(J,{id:`6ibbCg`}),shortcutId:`new-item`}),(0,Z.jsx)(L$,{complete:s.askedAi,label:(0,Z.jsx)(J,{id:`xWEvuo`}),shortcutId:`open-ask-ai`})]}),(0,Z.jsx)(`footer`,{className:`-mb-1 mt-2 flex justify-end`,children:(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`sm`,className:`h-auto px-2 py-1 text-muted-foreground text-xs`,onClick:()=>i.dismiss(),children:(0,Z.jsx)(J,{id:`1QfxQT`})})})]}),t[13]=p,t[14]=c,t[15]=f,t[16]=u,t[17]=s.askedAi,t[18]=s.file,t[19]=i,t[20]=b):b=t[20];let x;return t[21]!==y||t[22]!==b?(x=(0,Z.jsxs)(Z.Fragment,{children:[y,b]}),t[21]=y,t[22]=b,t[23]=x):x=t[23],x}function z$(e){return e+1}function B$(e){return e+1}function V$(){let e=(0,$.c)(1);if(!j$())return null;let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(R$,{}),e[0]=t):t=e[0],t}function H$(e){return e===null?null:e.kind===`local`?e.name:e.ref}function U$(e,t){if(e.length===0)return null;let n=`origin/${e}`;return t.includes(n)?n:t.find(t=>Ra(t)===e)??null}function W$(e){switch(e){case`branch-exists`:return{id:`wzq9Rv`};case`already-checked-out`:return{id:`ljHjfg`};case`path-exists`:return{id:`mYzDD_`};case`invalid-branch`:return{id:`r-OJYm`};case`no-git`:return{id:`CFnavk`};case`helper-not-found`:return{id:`HqOPpj`};default:return{id:`-zA2E7`}}}function G$(e){let t=(0,$.c)(71),{open:n,onOpenChange:r,bridge:i,currentBranch:a,branches:o,existingWorktreeBranches:s,remoteBranches:c,behindByBranch:l,initialBranchName:u}=e,d=o===void 0?[]:o,f=c===void 0?[]:c,p=u===void 0?``:u,{_:m}=gt(),h=(0,Q.useId)(),g=(0,Q.useId)(),_=(0,Q.useId)(),v=(0,Q.useId)(),y=(0,Q.useId)(),b=(0,Q.useId)(),[x,S]=(0,Q.useState)(``),C;t[0]===a?C=t[1]:(C=a===null?null:{kind:`local`,name:a},t[0]=a,t[1]=C);let[w,T]=(0,Q.useState)(C),[E,D]=(0,Q.useState)(!1),[O,k]=(0,Q.useState)(``),[A,j]=(0,Q.useState)(!1),[M,N]=(0,Q.useState)(null),P=(0,Q.useRef)(null),F=(0,Q.useRef)(null),I,L;t[2]!==a||t[3]!==p||t[4]!==n?(I=()=>{if(!n)return;S(p),T(a===null?null:{kind:`local`,name:a}),D(!1),k(``),j(!1),N(null);let e=requestAnimationFrame(()=>P.current?.focus());return()=>cancelAnimationFrame(e)},L=[n,a,p],t[2]=a,t[3]=p,t[4]=n,t[5]=I,t[6]=L):(I=t[5],L=t[6]),(0,Q.useEffect)(I,L);let R=x.trim(),z=!A&&R.length>0,B=R.length>0&&d.includes(R),V=B?null:U$(R,f),H=V!==null,U=B||H,W=B&&(s?.has(R)??!1),G=d.filter(e=>e.toLowerCase().startsWith(R.toLowerCase())),K=!A&&G.length>0&&!U,ee=(a!==null&&!d.includes(a)?[a,...d]:d).map(X$),te=f.map(Y$),ne=H$(w),q=O.trim().toLowerCase(),re=q===``?ee:ee.filter(e=>e.name.toLowerCase().includes(q)),ae=q===``?te:te.filter(e=>e.ref.toLowerCase().includes(q)),oe=q!==``&&re.length===0&&ae.length===0,se=async function(e){if(e.preventDefault(),z){j(!0),N(null);try{let e=H?{branch:R,createBranch:!0,remoteRef:V}:B?{branch:R,createBranch:!1}:{branch:R,createBranch:!0,baseBranch:w?.kind===`local`?w.name:void 0,baseRef:w?.kind===`remote`?w.ref:void 0},t=await i.worktree.create(e);if(!t.ok){N(W$(t.reason)),j(!1);return}ld(),r(!1),await i.project.open({path:t.path,target:`new-window`,entryPoint:`worktree`})}catch(e){console.warn(`[NewWorktreeDialog] worktree create/open failed:`,e),gl.error(m({id:`vAYoCZ`})),j(!1)}}},ce=yn,le;t[7]!==A||t[8]!==r?(le=e=>{A||r(e)},t[7]=A,t[8]=r,t[9]=le):le=t[9];let ue=hn,de;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,Z.jsx)(mn,{children:(0,Z.jsx)(J,{id:`DXd9LM`})}),t[10]=de):de=t[10];let fe;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(fe=(0,Z.jsxs)(vn,{children:[de,(0,Z.jsx)(pn,{children:(0,Z.jsx)(J,{id:`NEzPEh`})})]}),t[11]=fe):fe=t[11];let pe=gn,me;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,Z.jsx)(J,{id:`ng2Ibo`}),t[12]=me):me=t[12];let he;t[13]===g?he=t[14]:(he=(0,Z.jsx)(Ir,{htmlFor:g,children:me}),t[13]=g,t[14]=he);let ge;t[15]===m?ge=t[16]:(ge=m({id:`IX_uXB`}),t[15]=m,t[16]=ge);let _e;t[17]===M?_e=t[18]:(_e=e=>{S(e.target.value),M!==null&&N(null)},t[17]=M,t[18]=_e);let ve=M!==null,ye=M===null?y:`${y} ${b}`,be;t[19]!==x||t[20]!==A||t[21]!==g||t[22]!==ge||t[23]!==_e||t[24]!==ve||t[25]!==ye?(be=(0,Z.jsx)(Sl,{id:g,ref:P,value:x,placeholder:ge,onChange:_e,disabled:A,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-invalid":ve,"aria-describedby":ye,"data-testid":`new-worktree-branch`}),t[19]=x,t[20]=A,t[21]=g,t[22]=ge,t[23]=_e,t[24]=ve,t[25]=ye,t[26]=be):be=t[26];let xe=R.length>0?(0,Z.jsxs)(`p`,{id:y,className:`flex items-start gap-1.5 text-1sm text-muted-foreground`,"data-testid":W?`new-worktree-mode-existing-worktree`:H?`new-worktree-mode-remote-checkout`:B?`new-worktree-mode-checkout`:`new-worktree-mode-create`,children:[W?(0,Z.jsx)(hc,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-amber-600 dark:text-amber-400`}):H?(0,Z.jsx)(Cs,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-violet-600 dark:text-violet-400`}):B?(0,Z.jsx)(zo,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-blue-600 dark:text-blue-400`}):(0,Z.jsx)(Wt,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-green-600 dark:text-green-400`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1`,children:W?(0,Z.jsx)(J,{id:`QAi7Q9`,values:{trimmed:R},components:{0:(0,Z.jsx)(`code`,{className:`font-mono break-words`})}}):H?(0,Z.jsx)(J,{id:`oAGN8p`,values:{remoteCheckoutRef:V,trimmed:R},components:{0:(0,Z.jsx)(`code`,{className:`font-mono break-words`}),1:(0,Z.jsx)(`code`,{className:`font-mono break-words`}),2:(0,Z.jsx)(`code`,{className:`font-mono`})}}):B?(0,Z.jsx)(J,{id:`b4VvP-`,values:{trimmed:R},components:{0:(0,Z.jsx)(`code`,{className:`font-mono break-words`}),1:(0,Z.jsx)(`code`,{className:`font-mono`})}}):ne===null?(0,Z.jsx)(J,{id:`t4sFKC`,values:{trimmed:R},components:{0:(0,Z.jsx)(`code`,{className:`font-mono break-words`}),1:(0,Z.jsx)(`code`,{className:`font-mono`})}}):(0,Z.jsx)(J,{id:`dGAdpH`,values:{trimmed:R,currentBaseLabel:ne},components:{0:(0,Z.jsx)(`code`,{className:`font-mono break-words`}),1:(0,Z.jsx)(`code`,{className:`font-mono break-words`}),2:(0,Z.jsx)(`code`,{className:`font-mono`})}})})]}):null,Se=K?(0,Z.jsx)(`div`,{className:`max-h-40 overflow-y-auto rounded-md border bg-popover p-1 shadow-xs`,"data-testid":`new-worktree-branch-list`,children:G.map(e=>(0,Z.jsxs)(X,{type:`button`,variant:`ghost`,size:`sm`,tabIndex:-1,onClick:()=>{S(e),M!==null&&N(null),P.current?.focus()},"data-testid":`new-worktree-branch-option-${e}`,className:`h-8 w-full justify-start gap-2 font-normal`,children:[(0,Z.jsx)(po,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-left`,children:e})]},e))}):null,Ce=U?null:(0,Z.jsxs)(`div`,{className:`mt-1 flex flex-col gap-2`,children:[(0,Z.jsx)(Ir,{id:v,htmlFor:_,children:(0,Z.jsx)(J,{id:`ZWwYwM`})}),(0,Z.jsxs)(Vt,{open:E,onOpenChange:e=>{D(e),e||k(``)},children:[(0,Z.jsx)(Ht,{asChild:!0,children:(0,Z.jsxs)(X,{id:_,type:`button`,variant:`outline`,role:`combobox`,"aria-expanded":E,"aria-haspopup":`listbox`,"aria-labelledby":`${v} ${_}`,"aria-label":m({id:`ZWwYwM`}),disabled:A,"data-testid":`new-worktree-base-trigger`,className:`w-full justify-between font-normal`,children:[(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[w?.kind===`remote`?(0,Z.jsx)(Cs,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}):(0,Z.jsx)(po,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`min-w-0 truncate text-left`,children:ne===null?(0,Z.jsx)(J,{id:`EbjWsS`}):ne})]}),(0,Z.jsx)(Eh,{"aria-hidden":`true`,className:`ml-2 size-4 shrink-0 opacity-50`})]})}),(0,Z.jsxs)(qt,{align:`start`,className:`w-[var(--radix-popover-trigger-width)] p-1`,onWheel:J$,onTouchMove:q$,onOpenAutoFocus:e=>{e.preventDefault(),F.current?.focus()},children:[(0,Z.jsxs)(Nc,{className:`mb-1 h-8`,children:[(0,Z.jsx)(Ec,{ref:F,"aria-label":m({id:`fuJZKk`}),placeholder:m({id:`hQXiDc`}),value:O,onChange:e=>k(e.target.value),onKeyDown:K$,"data-testid":`new-worktree-base-search`}),(0,Z.jsx)(Mc,{children:(0,Z.jsx)(ie,{"aria-hidden":`true`})})]}),(0,Z.jsxs)(`div`,{role:`listbox`,"aria-label":m({id:`ZWwYwM`}),className:`max-h-56 overflow-y-auto`,"data-testid":`new-worktree-base-list`,children:[oe?(0,Z.jsx)(`p`,{className:`px-2 py-1.5 text-1sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`Sh3Qkg`})}):null,re.map(e=>{let t=e.name,n=l?.get(t);return(0,Z.jsxs)(X,{type:`button`,role:`option`,"aria-selected":w?.kind===`local`&&w.name===t,variant:`ghost`,size:`sm`,onClick:()=>{T(e),D(!1),k(``)},"data-testid":`new-worktree-base-option-${t}`,className:`h-8 w-full justify-start gap-2 font-normal`,children:[(0,Z.jsx)(po,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-left`,children:t}),n!==void 0&&n>0?(0,Z.jsx)(`span`,{className:`shrink-0 text-xs text-amber-600 dark:text-amber-400`,"data-testid":`new-worktree-base-behind-${t}`,children:(0,Z.jsx)(J,{id:`6-wLTJ`,values:{behind:n}})}):null]},`local:${t}`)}),ae.map(e=>{let t=e.ref;return(0,Z.jsxs)(X,{type:`button`,role:`option`,"aria-selected":w?.kind===`remote`&&w.ref===t,variant:`ghost`,size:`sm`,onClick:()=>{T(e),D(!1),k(``)},"data-testid":`new-worktree-base-option-${t}`,className:`h-8 w-full justify-start gap-2 font-normal`,children:[(0,Z.jsx)(Cs,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-left`,children:t}),(0,Z.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:(0,Z.jsx)(J,{id:`dIYSqk`})})]},`remote:${t}`)})]})]})]})]}),we;t[27]!==m||t[28]!==M||t[29]!==b?(we=M===null?null:(0,Z.jsx)(`p`,{id:b,role:`alert`,className:`text-1sm text-destructive`,"data-testid":`new-worktree-error`,children:m(M)}),t[27]=m,t[28]=M,t[29]=b,t[30]=we):we=t[30];let Te;t[31]!==h||t[32]!==se||t[33]!==he||t[34]!==be||t[35]!==xe||t[36]!==Se||t[37]!==Ce||t[38]!==we?(Te=(0,Z.jsxs)(`form`,{id:h,onSubmit:se,className:`flex flex-col gap-2`,children:[he,be,xe,Se,Ce,we]}),t[31]=h,t[32]=se,t[33]=he,t[34]=be,t[35]=xe,t[36]=Se,t[37]=Ce,t[38]=we,t[39]=Te):Te=t[39];let Ee;t[40]!==pe||t[41]!==Te?(Ee=(0,Z.jsx)(pe,{children:Te}),t[40]=pe,t[41]=Te,t[42]=Ee):Ee=t[42];let De;t[43]===r?De=t[44]:(De=()=>r(!1),t[43]=r,t[44]=De);let Oe;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,Z.jsx)(J,{id:`dEgA5A`}),t[45]=Oe):Oe=t[45];let ke;t[46]!==A||t[47]!==De?(ke=(0,Z.jsx)(X,{type:`button`,variant:`outline`,onClick:De,disabled:A,"data-testid":`new-worktree-cancel`,children:Oe}),t[46]=A,t[47]=De,t[48]=ke):ke=t[48];let Ae=!z,je;t[49]!==A||t[50]!==W||t[51]!==B||t[52]!==H?(je=A?(0,Z.jsx)(J,{id:`b4itZn`}):W?(0,Z.jsx)(J,{id:`XV5sC0`}):H?(0,Z.jsx)(J,{id:`XAyxsa`}):B?(0,Z.jsx)(J,{id:`uGaIIS`}):(0,Z.jsx)(J,{id:`iO8V-7`}),t[49]=A,t[50]=W,t[51]=B,t[52]=H,t[53]=je):je=t[53];let Me;t[54]!==h||t[55]!==Ae||t[56]!==je?(Me=(0,Z.jsx)(X,{type:`submit`,form:h,disabled:Ae,"data-testid":`new-worktree-create`,children:je}),t[54]=h,t[55]=Ae,t[56]=je,t[57]=Me):Me=t[57];let Ne;t[58]!==ke||t[59]!==Me?(Ne=(0,Z.jsxs)(_n,{children:[ke,Me]}),t[58]=ke,t[59]=Me,t[60]=Ne):Ne=t[60];let Pe;t[61]!==ue||t[62]!==fe||t[63]!==Ee||t[64]!==Ne?(Pe=(0,Z.jsxs)(ue,{className:`sm:max-w-md`,"data-testid":`new-worktree-dialog`,children:[fe,Ee,Ne]}),t[61]=ue,t[62]=fe,t[63]=Ee,t[64]=Ne,t[65]=Pe):Pe=t[65];let Fe;return t[66]!==ce||t[67]!==n||t[68]!==Pe||t[69]!==le?(Fe=(0,Z.jsx)(ce,{open:n,onOpenChange:le,children:Pe}),t[66]=ce,t[67]=n,t[68]=Pe,t[69]=le,t[70]=Fe):Fe=t[70],Fe}function K$(e){return e.stopPropagation()}function q$(e){e.stopPropagation()}function J$(e){e.stopPropagation()}function Y$(e){return{kind:`remote`,ref:e}}function X$(e){return{kind:`local`,name:e}}function Z$(e){let t=(0,$.c)(54),{bridge:n,recents:r,currentPath:i,query:a,worktreeModel:o,closeMenu:s,guardStaleSelect:c,onRemoveRecent:l,flyoutPath:u,setFlyoutPath:d,openNewWorktreeWith:f}=e,{_:p}=gt(),m;t[0]!==p||t[1]!==n.project||t[2]!==s?(m=function(e,t){s(),n.project.open({path:e,target:`new-window`,entryPoint:t}).catch(e=>{console.warn(`[RecentProjectsMenu] project.open failed:`,e),gl.error(p({id:`6HCOwA`}))})},t[0]=p,t[1]=n.project,t[2]=s,t[3]=m):m=t[3];let h=m,g;t[4]!==p||t[5]!==n.project||t[6]!==n.worktree?(g=async function(e){try{let t=await n.worktree.create({branch:e,createBranch:!1});if(!t.ok){gl.error(p({id:`teD0H9`}));return}ld(),await n.project.open({path:t.path,target:`new-window`,entryPoint:`worktree`})}catch(e){console.warn(`[RecentProjectsMenu] create/open branch failed:`,e),gl.error(p({id:`LwMxXg`}))}},t[4]=p,t[5]=n.project,t[6]=n.worktree,t[7]=g):g=t[7];let _=g,v;t[8]!==s||t[9]!==i||t[10]!==h?(v=function(e){if(e.path===i){s();return}h(e.path,e.isLinkedWorktree?`worktree`:`recents`)},t[8]=s,t[9]=i,t[10]=h,t[11]=v):v=t[11];let y=v,b;t[12]!==s||t[13]!==_||t[14]!==i||t[15]!==h?(b=function(e){if(e.path!==null){if(e.path===i){s();return}h(e.path,e.isMain?`recents`:`worktree`);return}e.branch!==null&&(s(),_(e.branch))},t[12]=s,t[13]=_,t[14]=i,t[15]=h,t[16]=b):b=t[16];let x=b;if(a!==``){let e;t[17]!==s||t[18]!==_?(e=e=>{s(),_(e)},t[17]=s,t[18]=_,t[19]=e):e=t[19];let n;return t[20]!==i||t[21]!==c||t[22]!==y||t[23]!==l||t[24]!==a||t[25]!==r||t[26]!==e||t[27]!==o?(n=(0,Z.jsx)(n1,{recents:r,currentPath:i,query:a,worktreeModel:o,onPickEntry:y,onPickBranch:e,guardStaleSelect:c,onRemoveRecent:l}),t[20]=i,t[21]=c,t[22]=y,t[23]=l,t[24]=a,t[25]=r,t[26]=e,t[27]=o,t[28]=n):n=t[28],n}let S;if(t[29]!==s||t[30]!==i||t[31]!==u||t[32]!==c||t[33]!==x||t[34]!==l||t[35]!==f||t[36]!==h||t[37]!==r||t[38]!==d||t[39]!==o){let e=Qv(r),n;t[41]!==s||t[42]!==i||t[43]!==u||t[44]!==c||t[45]!==x||t[46]!==l||t[47]!==f||t[48]!==h||t[49]!==d||t[50]!==o?(n=e=>(0,Z.jsx)(Q$,{group:e,currentPath:i,worktreeModel:o,flyoutOpen:u===e.project.path,setFlyoutOpen:t=>d(n=>t?e.project.path:n===e.project.path?null:n),onPickProject:()=>{if(e.project.path===i){s();return}h(e.project.path,`recents`)},onPickFlyoutEntry:x,guardStaleSelect:c,onRemoveRecent:l,openNewWorktreeWith:f},e.project.path),t[41]=s,t[42]=i,t[43]=u,t[44]=c,t[45]=x,t[46]=l,t[47]=f,t[48]=h,t[49]=d,t[50]=o,t[51]=n):n=t[51],S=e.map(n),t[29]=s,t[30]=i,t[31]=u,t[32]=c,t[33]=x,t[34]=l,t[35]=f,t[36]=h,t[37]=r,t[38]=d,t[39]=o,t[40]=S}else S=t[40];let C;return t[52]===S?C=t[53]:(C=(0,Z.jsx)(Z.Fragment,{children:S}),t[52]=S,t[53]=C),C}function Q$(e){let t=(0,$.c)(45),{group:n,currentPath:r,worktreeModel:i,flyoutOpen:a,setFlyoutOpen:o,onPickProject:s,onPickFlyoutEntry:c,guardStaleSelect:l,onRemoveRecent:u,openNewWorktreeWith:d}=e,f=n.project.path===r,p,m;t[0]!==r||t[1]!==n||t[2]!==i?(p=Yv(n,i,r),m=p.filter($$),t[0]=r,t[1]=n,t[2]=i,t[3]=p,t[4]=m):(p=t[3],m=t[4]);let h=m.length;if(h===0){let e;t[5]!==l||t[6]!==s?(e=e=>{l(e)||s()},t[5]=l,t[6]=s,t[7]=e):e=t[7];let r=`project-switcher-recent-${n.project.path}`,i=f?`true`:void 0,a;t[8]!==n.project.name||t[9]!==n.project.path||t[10]!==f?(a=(0,Z.jsx)(a1,{name:n.project.name,path:n.project.path,current:f}),t[8]=n.project.name,t[9]=n.project.path,t[10]=f,t[11]=a):a=t[11];let o;t[12]!==e||t[13]!==r||t[14]!==i||t[15]!==a?(o=(0,Z.jsx)(wr,{onSelect:e,className:`flex w-full min-w-0 flex-col items-start gap-0.5 pr-8`,"data-testid":r,"data-current":i,children:a}),t[12]=e,t[13]=r,t[14]=i,t[15]=a,t[16]=o):o=t[16];let c;t[17]!==n.project.name||t[18]!==n.project.path||t[19]!==u?(c=(0,Z.jsx)(uy,{path:n.project.path,name:n.project.name,onRemoveRecent:u,testIdPrefix:`project-switcher-recent`}),t[17]=n.project.name,t[18]=n.project.path,t[19]=u,t[20]=c):c=t[20];let d;t[21]!==o||t[22]!==c?(d=(0,Z.jsxs)(`div`,{className:`group/recent relative flex items-center`,children:[o,c]}),t[21]=o,t[22]=c,t[23]=d):d=t[23];let p;return t[24]!==n.project.path||t[25]!==u||t[26]!==d?(p=(0,Z.jsx)(dy,{path:n.project.path,onRemoveRecent:u,testIdPrefix:`project-switcher-recent`,children:d}),t[24]=n.project.path,t[25]=u,t[26]=d,t[27]=p):p=t[27],p}let g;t[28]!==r||t[29]!==n.worktrees||t[30]!==f?(g=f||n.worktrees.some(e=>e.path===r),t[28]=r,t[29]=n.worktrees,t[30]=f,t[31]=g):g=t[31];let _=g,v;return t[32]!==_||t[33]!==r||t[34]!==p||t[35]!==a||t[36]!==n||t[37]!==l||t[38]!==c||t[39]!==s||t[40]!==d||t[41]!==h||t[42]!==o||t[43]!==i?(v=(0,Z.jsx)(e1,{group:n,currentPath:r,containsCurrent:_,worktreeModel:i,flyoutEntries:p,openedWorktreeCount:h,flyoutOpen:a,setFlyoutOpen:o,onPickProject:s,onPickFlyoutEntry:c,guardStaleSelect:l,openNewWorktreeWith:d}),t[32]=_,t[33]=r,t[34]=p,t[35]=a,t[36]=n,t[37]=l,t[38]=c,t[39]=s,t[40]=d,t[41]=h,t[42]=o,t[43]=i,t[44]=v):v=t[44],v}function $$(e){return e.opened&&!e.isMain}function e1(e){let t=(0,$.c)(46),{group:n,currentPath:r,containsCurrent:i,worktreeModel:a,flyoutEntries:o,openedWorktreeCount:s,flyoutOpen:c,setFlyoutOpen:l,onPickProject:u,onPickFlyoutEntry:d,guardStaleSelect:f,openNewWorktreeWith:p}=e,{_:m}=gt(),h=n.project.path===r,g;t[0]!==f||t[1]!==u?(g=e=>{f(e)||u()},t[0]=f,t[1]=u,t[2]=g):g=t[2];let _=g,v,y;t[3]===_?(v=t[4],y=t[5]):(v=e=>{e.target.closest(`[data-project-open]`)!==null&&(e.preventDefault(),_(e.nativeEvent))},y=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),_(e.nativeEvent))},t[3]=_,t[4]=v,t[5]=y);let b=`project-switcher-group-${n.project.path}`,x=c?`true`:void 0,S=i?`true`:void 0,C;t[6]===n.project.name?C=t[7]:(C=(0,Z.jsx)(`span`,{className:`truncate font-medium text-sm`,"data-project-open":``,title:n.project.name,children:n.project.name}),t[6]=n.project.name,t[7]=C);let w;t[8]===n.project.path?w=t[9]:(w=(0,Z.jsx)(`span`,{className:`truncate text-muted-foreground text-xs`,title:n.project.path,children:n.project.path}),t[8]=n.project.path,t[9]=w);let T;t[10]!==C||t[11]!==w?(T=(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[C,w]}),t[10]=C,t[11]=w,t[12]=T):T=t[12];let E;t[13]!==m||t[14]!==h?(E=h?(0,Z.jsx)(zo,{"aria-label":m({id:`Hp1l6f`}),className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground`}):null,t[13]=m,t[14]=h,t[15]=E):E=t[15];let D=`project-switcher-toggle-${n.project.path}`,O;t[16]===s?O=t[17]:(O=(0,Z.jsx)(`span`,{className:`tabular-nums`,children:s}),t[16]=s,t[17]=O);let k;t[18]===s?k=t[19]:(k=(0,Z.jsx)(J,{id:`AKxFtn`,values:{openedWorktreeCount:s}}),t[18]=s,t[19]=k);let A;t[20]!==D||t[21]!==O||t[22]!==k?(A=(0,Z.jsxs)(`span`,{className:`mt-0.5 shrink-0 text-muted-foreground text-xs`,"data-testid":D,children:[O,` `,k]}),t[20]=D,t[21]=O,t[22]=k,t[23]=A):A=t[23];let j;t[24]!==E||t[25]!==A||t[26]!==v||t[27]!==y||t[28]!==b||t[29]!==x||t[30]!==S||t[31]!==T?(j=(0,Z.jsxs)(jr,{onClick:v,onKeyDown:y,className:`flex w-full min-w-0 items-start gap-2`,"data-testid":b,"data-flyout-open":x,"data-current":S,children:[T,E,A]}),t[24]=E,t[25]=A,t[26]=v,t[27]=y,t[28]=b,t[29]=x,t[30]=S,t[31]=T,t[32]=j):j=t[32];let M;t[33]!==o||t[34]!==c||t[35]!==n||t[36]!==f||t[37]!==d||t[38]!==p||t[39]!==a?(M=(0,Z.jsx)(t1,{group:n,open:c,worktreeModel:a,entries:o,onPickFlyoutEntry:d,guardStaleSelect:f,openNewWorktreeWith:p}),t[33]=o,t[34]=c,t[35]=n,t[36]=f,t[37]=d,t[38]=p,t[39]=a,t[40]=M):M=t[40];let N;return t[41]!==c||t[42]!==l||t[43]!==j||t[44]!==M?(N=(0,Z.jsxs)(Tr,{open:c,onOpenChange:l,children:[j,M]}),t[41]=c,t[42]=l,t[43]=j,t[44]=M,t[45]=N):N=t[45],N}function t1(e){let t=(0,$.c)(15),{group:n,open:r,worktreeModel:i,entries:a,onPickFlyoutEntry:o,guardStaleSelect:s,openNewWorktreeWith:c}=e,{_:l}=gt(),[u,d]=(0,Q.useState)(``),f=(0,Q.useRef)(null),p=(0,Q.useRef)(null),m,h;t[0]===r?(m=t[1],h=t[2]):(m=()=>{r&&f.current?.focus({preventScroll:!0})},h=[r],t[0]=r,t[1]=m,t[2]=h),(0,Q.useEffect)(m,h);let g=function(){let e=p.current;return e===null?[]:[...e.querySelectorAll(`[role="menuitem"]`)]},_=function(e){g()[e]?.focus()},v=function(e,t){if(e.key===`ArrowDown`){e.preventDefault(),e.stopPropagation();let t=g(),n=t.indexOf(e.currentTarget);_(Math.min(n+1,t.length-1))}else if(e.key===`ArrowUp`){e.preventDefault(),e.stopPropagation();let t=g().indexOf(e.currentTarget);t<=0?f.current?.focus():_(t-1)}else e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),t())},y;if(t[3]!==a||t[4]!==u){let e=u.trim().toLowerCase();y=e===``?a:a.filter(t=>(t.branch??``).toLowerCase().includes(e)),t[3]=a,t[4]=u,t[5]=y}else y=t[5];let b=y,x=i!==null&&i.mainRoot===n.project.mainRoot,S=u.trim(),C=x&&S.length>0,w;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Z.jsx)(Mc,{align:`inline-start`,children:(0,Z.jsx)(ie,{"aria-hidden":`true`})}),t[6]=w):w=t[6];let T;t[7]===l?T=t[8]:(T=l({id:`bSD4im`}),t[7]=l,t[8]=T);let E;t[9]===l?E=t[10]:(E=l({id:`Skr_7L`}),t[9]=l,t[10]=E);let D;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>d(e.target.value),t[11]=D):D=t[11];let O=b.length===0?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Ar,{className:`font-normal text-muted-foreground text-xs`,role:`status`,"aria-live":`polite`,children:l({id:`-uaQnI`})}),C?(0,Z.jsxs)(wr,{onSelect:e=>{s(e)||c(S)},onKeyDown:e=>v(e,()=>c(S)),className:`flex items-center gap-2`,"data-testid":`project-switcher-flyout-create`,children:[(0,Z.jsx)(Wt,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,title:S,children:(0,Z.jsx)(J,{id:`gHSAWT`,values:{typedName:S},components:{0:(0,Z.jsx)(`span`,{className:`font-medium`}),1:(0,Z.jsx)(`span`,{className:`font-mono`})}})})]}):null]}):b.map(e=>{let t=e.path??`branch:${e.branch}`,n=e.branch??l({id:`D12vtS`});return(0,Z.jsxs)(wr,{onSelect:t=>{s(t)||o(e)},onKeyDown:t=>v(t,()=>o(e)),className:`flex items-center gap-2`,"data-testid":`project-switcher-flyout-entry-${t}`,"data-current":e.isCurrent?`true`:void 0,children:[(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,title:n,children:n}),e.isMain?(0,Z.jsx)(`span`,{className:`shrink-0 text-muted-foreground text-xs`,children:l({id:`Bn9-El`})}):e.opened?null:(0,Z.jsx)(`span`,{className:`shrink-0 text-muted-foreground text-xs`,title:l({id:`Dvwa0U`}),children:l({id:`nfoduq`})}),e.isCurrent?(0,Z.jsx)(o1,{}):null]},t)}),k;return t[12]!==p||t[13]!==O?(k=(0,Z.jsx)(`div`,{ref:p,className:`min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain subtle-scrollbar`,children:O}),t[12]=p,t[13]=O,t[14]=k):k=t[14],(0,Z.jsx)(Nr,{children:(0,Z.jsxs)(Er,{avoidCollisions:!1,sideOffset:-8,className:`flex max-h-80 w-96 flex-col gap-1 overflow-hidden p-1`,"data-testid":`project-switcher-flyout-${n.project.path}`,children:[(0,Z.jsxs)(Nc,{className:`mb-1 h-8 shrink-0`,children:[w,(0,Z.jsx)(Ec,{ref:f,"aria-label":T,placeholder:E,value:u,onChange:D,onKeyDown:e=>{e.key===`ArrowDown`&&(e.preventDefault(),_(0)),e.stopPropagation()},"data-testid":`project-switcher-flyout-search-${n.project.path}`})]}),k]})})}function n1(e){let t=(0,$.c)(43),{recents:n,currentPath:r,query:i,worktreeModel:a,onPickEntry:o,onPickBranch:s,guardStaleSelect:c,onRemoveRecent:l}=e,{_:u}=gt(),d;t[0]===i?d=t[1]:(d=e=>e.toLowerCase().includes(i),t[0]=i,t[1]=d);let f=d,p,m,h,g;if(t[2]!==u||t[3]!==r||t[4]!==c||t[5]!==f||t[6]!==s||t[7]!==o||t[8]!==l||t[9]!==n||t[10]!==a){g=Symbol.for(`react.early_return_sentinel`);bb0:{let e;t[15]===f?e=t[16]:(e=e=>!e.isLinkedWorktree&&(f(e.name)||f(e.path)),t[15]=f,t[16]=e);let i=n.filter(e),d;t[17]===f?d=t[18]:(d=e=>e.isLinkedWorktree===!0&&(f(e.branch??``)||f(e.path)),t[17]=f,t[18]=d);let _=n.filter(d),v=new Set(_.map(r1)),y;t[19]===a?.entries?y=t[20]:(y=a?.entries??[],t[19]=a?.entries,t[20]=y);let b=y.filter(e=>e.branch!==null&&f(e.branch)&&(e.worktreePath===null||!v.has(e.worktreePath))&&e.worktreePath!==r);if(i.length===0&&_.length===0&&b.length===0){let e;t[21]===u?e=t[22]:(e=u({id:`pEQFsW`}),t[21]=u,t[22]=e);let n;t[23]===e?n=t[24]:(n=(0,Z.jsx)(Ar,{className:`font-normal text-muted-foreground text-xs`,role:`status`,"aria-live":`polite`,children:e}),t[23]=e,t[24]=n),g=n;break bb0}let x;t[25]!==r||t[26]!==c||t[27]!==o||t[28]!==l?(x=e=>(0,Z.jsx)(dy,{path:e.path,onRemoveRecent:l,testIdPrefix:`project-switcher-recent`,children:(0,Z.jsxs)(`div`,{className:`group/recent relative flex items-center`,children:[(0,Z.jsx)(wr,{onSelect:t=>{c(t)||o(e)},className:`flex w-full min-w-0 flex-col items-start gap-0.5 pr-8`,"data-testid":`project-switcher-recent-${e.path}`,children:(0,Z.jsx)(a1,{name:e.name,path:e.path,current:e.path===r})}),(0,Z.jsx)(uy,{path:e.path,name:e.name,onRemoveRecent:l,testIdPrefix:`project-switcher-recent`})]})},e.path),t[25]=r,t[26]=c,t[27]=o,t[28]=l,t[29]=x):x=t[29],p=i.map(x);let S;t[30]!==r||t[31]!==c||t[32]!==o?(S=e=>(0,Z.jsxs)(wr,{onSelect:t=>{c(t)||o(e)},className:`flex items-start gap-2`,"data-testid":`project-switcher-worktree-${e.path}`,"data-current":e.path===r?`true`:void 0,children:[(0,Z.jsx)(po,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0`}),(0,Z.jsx)(i1,{branch:e.branch??e.name,project:e.mainRoot===void 0?null:Zv(e.mainRoot)})]},e.path),t[30]=r,t[31]=c,t[32]=o,t[33]=S):S=t[33],m=_.map(S);let C;t[34]!==u||t[35]!==c||t[36]!==s||t[37]!==a?(C=e=>(0,Z.jsxs)(wr,{onSelect:t=>{c(t)||e.branch!==null&&s(e.branch)},className:`flex items-start gap-2`,"data-testid":`project-switcher-branch-${e.branch}`,children:[(0,Z.jsx)(po,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 opacity-40`}),(0,Z.jsx)(i1,{branch:e.branch??``,project:a===null?null:Zv(a.mainRoot),hint:u({id:`nfoduq`})})]},`branch:${e.branch}`),t[34]=u,t[35]=c,t[36]=s,t[37]=a,t[38]=C):C=t[38],h=b.map(C)}t[2]=u,t[3]=r,t[4]=c,t[5]=f,t[6]=s,t[7]=o,t[8]=l,t[9]=n,t[10]=a,t[11]=p,t[12]=m,t[13]=h,t[14]=g}else p=t[11],m=t[12],h=t[13],g=t[14];if(g!==Symbol.for(`react.early_return_sentinel`))return g;let _;return t[39]!==p||t[40]!==m||t[41]!==h?(_=(0,Z.jsxs)(Z.Fragment,{children:[p,m,h]}),t[39]=p,t[40]=m,t[41]=h,t[42]=_):_=t[42],_}function r1(e){return e.path}function i1(e){let t=(0,$.c)(12),{branch:n,project:r,hint:i}=e,a;t[0]===n?a=t[1]:(a=(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,children:n}),t[0]=n,t[1]=a);let o;t[2]===i?o=t[3]:(o=i===void 0?null:(0,Z.jsx)(`span`,{className:`shrink-0 text-muted-foreground text-xs`,children:i}),t[2]=i,t[3]=o);let s;t[4]!==a||t[5]!==o?(s=(0,Z.jsxs)(`span`,{className:`flex w-full min-w-0 items-center gap-1.5`,children:[a,o]}),t[4]=a,t[5]=o,t[6]=s):s=t[6];let c;t[7]===r?c=t[8]:(c=r===null?null:(0,Z.jsx)(`span`,{className:`truncate text-muted-foreground text-xs`,title:r,children:r}),t[7]=r,t[8]=c);let l;return t[9]!==s||t[10]!==c?(l=(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[s,c]}),t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function a1(e){let t=(0,$.c)(15),{name:n,path:r,current:i}=e,a=i&&`font-medium`,o;t[0]===a?o=t[1]:(o=Y(`flex w-full items-center gap-1.5`,a),t[0]=a,t[1]=o);let s;t[2]===n?s=t[3]:(s=(0,Z.jsx)(`span`,{className:`truncate font-medium text-sm`,title:n,children:n}),t[2]=n,t[3]=s);let c;t[4]===i?c=t[5]:(c=i?(0,Z.jsx)(zo,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}):null,t[4]=i,t[5]=c);let l;t[6]!==o||t[7]!==s||t[8]!==c?(l=(0,Z.jsxs)(`span`,{className:o,children:[s,c]}),t[6]=o,t[7]=s,t[8]=c,t[9]=l):l=t[9];let u;t[10]===r?u=t[11]:(u=(0,Z.jsx)(`span`,{className:`w-full truncate text-muted-foreground text-xs`,title:r,children:r}),t[10]=r,t[11]=u);let d;return t[12]!==l||t[13]!==u?(d=(0,Z.jsxs)(`span`,{className:`flex w-full min-w-0 flex-col gap-0.5`,children:[l,u]}),t[12]=l,t[13]=u,t[14]=d):d=t[14],d}function o1(){let e=(0,$.c)(4),{_:t}=gt(),n;e[0]===t?n=e[1]:(n=t({id:`Hp1l6f`}),e[0]=t,e[1]=n);let r;return e[2]===n?r=e[3]:(r=(0,Z.jsx)(zo,{"aria-label":n,className:`size-3.5 shrink-0 text-muted-foreground`}),e[2]=n,e[3]=r),r}var s1=(e,t,n)=>Uv(e,t,n,`ProjectSwitcher`),c1=350;function l1(e){let t=(0,$.c)(121),{bridge:n}=e,{_:r}=gt(),[i,a]=(0,Q.useState)(null),[o,s]=(0,Q.useState)(!1),[c,l]=(0,Q.useState)(``),[u,d]=(0,Q.useState)(!1),[f,p]=(0,Q.useState)(!1),[m,h]=(0,Q.useState)(``),[g,_]=(0,Q.useState)(null),v=RP(),y=Bv(),b=typeof window<`u`&&window.okDesktop!=null,x=(0,Q.useRef)(!1),S=(0,Q.useRef)(!1),C=(0,Q.useRef)(null),w;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(w=e=>{e&&(S.current=!0,C.current!==null&&clearTimeout(C.current),C.current=setTimeout(()=>{S.current=!1},c1)),s(e),e||(l(``),_(null))},t[0]=w):w=t[0];let T=w,E;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(E=e=>!b||!S.current?!1:(e.preventDefault(),!0),t[1]=E):E=t[1];let D=E,O;t[2]!==r||t[3]!==n.project||t[4]!==o?(O=()=>{if(!o)return;let e=!1;return s1(async()=>{let t=await n.project.listRecent();e||a(t)},r({id:`fYKgzG`})),()=>{e=!0}},t[2]=r,t[3]=n.project,t[4]=o,t[5]=O):O=t[5];let k;t[6]!==r||t[7]!==n||t[8]!==o?(k=[o,n,r],t[6]=r,t[7]=n,t[8]=o,t[9]=k):k=t[9],(0,Q.useEffect)(O,k);let A,j;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(A=()=>Ut(e=>{e===`new-worktree`?(s(!1),_(null),h(``),p(!0)):e===`switch-worktree`&&s(!0)}),j=[],t[10]=A,t[11]=j):(A=t[10],j=t[11]),(0,Q.useEffect)(A,j);let M;t[12]!==r||t[13]!==n.dialog||t[14]!==n.project?(M=()=>{T(!1),s1(async()=>{let e=await n.dialog.openFolder();e&&await n.project.open({path:e,target:`new-window`,entryPoint:`pick-existing`})},r({id:`gmJ0An`}))},t[12]=r,t[13]=n.dialog,t[14]=n.project,t[15]=M):M=t[15];let N=M,P;t[16]!==r||t[17]!==n.project?(P=()=>{T(!1),s1(()=>n.project.openFile(),r({id:`8vCZcs`}))},t[16]=r,t[17]=n.project,t[18]=P):P=t[18];let F=P,I;t[19]!==r||t[20]!==n.navigator?(I=()=>{T(!1),s1(()=>n.navigator.open(),r({id:`jol95m`}))},t[19]=r,t[20]=n.navigator,t[21]=I):I=t[21];let L=I,R;t[22]!==r||t[23]!==n.project?(R=e=>s1(async()=>{await n.project.removeRecent(e),a(t=>t===null?t:t.filter(t=>t.path!==e))},r({id:`viwC-K`})),t[22]=r,t[23]=n.project,t[24]=R):R=t[24];let z=R,B;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(B=()=>{T(!1),d(!0)},t[25]=B):B=t[25];let V=B,H;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(H=e=>{T(!1),h(e),p(!0)},t[26]=H):H=t[26];let U=H,W=n.config.projectPath,G;t[27]===c?G=t[28]:(G=c.trim().toLowerCase(),t[27]=c,t[28]=G);let K=G,ee=K!==``,te;t[29]===i?te=t[30]:(te=i??[],t[29]=i,t[30]=te);let ne=te,q;t[31]!==ee||t[32]!==ne?(q=ee?ne.filter(_1):ne,t[31]=ee,t[32]=ne,t[33]=q):q=t[33];let re=q,ae=ee?null:y,oe=v!==null&&`h-auto py-1.5`,se;t[34]===oe?se=t[35]:(se=Y(`justify-between text-sidebar-foreground/70 hover:text-sidebar-foreground! data-open:hover:text-sidebar-foreground!`,oe),t[34]=oe,t[35]=se);let ce;t[36]===r?ce=t[37]:(ce=r({id:`zZ_I5K`}),t[36]=r,t[37]=ce);let le;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(le=b?()=>{x.current=!0}:void 0,t[38]=le):le=t[38];let ue;t[39]===o?ue=t[40]:(ue=b?()=>{if(x.current){x.current=!1;return}T(!o)}:void 0,t[39]=o,t[40]=ue);let de;t[41]===n.config.projectName?de=t[42]:(de=(0,Z.jsx)(`span`,{className:`truncate`,children:n.config.projectName}),t[41]=n.config.projectName,t[42]=de);let fe;t[43]===v?fe=t[44]:(fe=v===null?null:(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 text-xs text-sidebar-foreground/50 group-hover/menu-button:text-sidebar-foreground`,"data-testid":`project-switcher-branch`,children:[(0,Z.jsx)(po,{"aria-hidden":`true`,className:`size-3! shrink-0`}),(0,Z.jsx)(`span`,{className:`truncate`,children:v})]}),t[43]=v,t[44]=fe);let pe;t[45]!==de||t[46]!==fe?(pe=(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[de,fe]}),t[45]=de,t[46]=fe,t[47]=pe):pe=t[47];let me;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,Z.jsx)(Eh,{"aria-hidden":`true`,className:`opacity-60`}),t[48]=me):me=t[48];let he;t[49]!==n.config.projectPath||t[50]!==se||t[51]!==ce||t[52]!==ue||t[53]!==pe?(he=(0,Z.jsx)(Or,{asChild:!0,children:(0,Z.jsxs)(OP,{className:se,"data-testid":`project-switcher-trigger`,"aria-label":ce,title:n.config.projectPath,onPointerDown:le,onClick:ue,children:[pe,me]})}),t[49]=n.config.projectPath,t[50]=se,t[51]=ce,t[52]=ue,t[53]=pe,t[54]=he):he=t[54];let ge;t[55]!==r||t[56]!==n||t[57]!==W||t[58]!==g||t[59]!==re||t[60]!==ae||t[61]!==z||t[62]!==K||t[63]!==i||t[64]!==c?(ge=i===null?null:i.length===0?(0,Z.jsx)(Ar,{className:`font-normal text-muted-foreground text-xs`,children:(0,Z.jsx)(J,{id:`MUrVEo`})}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Nc,{className:`mb-1 h-8 border-0 shadow-none has-[[data-slot=input-group-control]:focus-visible]:ring-0`,children:[(0,Z.jsx)(Ec,{"aria-label":r({id:`blFttG`}),placeholder:r({id:`RVZJWQ`}),value:c,onChange:e=>{e.target.value!==``&&_(null),l(e.target.value)},onKeyDown:g1,"data-testid":`project-switcher-search`}),(0,Z.jsx)(Mc,{children:(0,Z.jsx)(ie,{"aria-hidden":`true`})})]}),(0,Z.jsx)(Fr,{}),(0,Z.jsx)(`div`,{className:`max-h-64 overflow-x-hidden overflow-y-auto overscroll-contain subtle-scrollbar scroll-fade-mask`,"data-testid":`project-switcher-scroll`,onScroll:()=>{g!==null&&_(null)},children:(0,Z.jsx)(Z$,{bridge:n,recents:re,currentPath:W,query:K,worktreeModel:ae,closeMenu:()=>T(!1),guardStaleSelect:D,onRemoveRecent:z,flyoutPath:g,setFlyoutPath:_,openNewWorktreeWith:U})})]}),t[55]=r,t[56]=n,t[57]=W,t[58]=g,t[59]=re,t[60]=ae,t[61]=z,t[62]=K,t[63]=i,t[64]=c,t[65]=ge):ge=t[65];let _e;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(_e=(0,Z.jsx)(Fr,{}),t[66]=_e):_e=t[66];let ve;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(ve=e=>{D(e)||V()},t[67]=ve):ve=t[67];let ye;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(ye=(0,Z.jsxs)(wr,{onSelect:ve,"data-testid":`project-switcher-new-project`,children:[(0,Z.jsx)(Wt,{"aria-hidden":`true`,className:`text-muted-foreground`}),(0,Z.jsx)(J,{id:`gKi-a_`})]}),t[68]=ye):ye=t[68];let be;t[69]===L?be=t[70]:(be=e=>{D(e)||L()},t[69]=L,t[70]=be);let xe,Se;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,Z.jsx)(ke,{"aria-hidden":`true`,className:`text-muted-foreground`}),Se=(0,Z.jsx)(J,{id:`xaDWAI`}),t[71]=xe,t[72]=Se):(xe=t[71],Se=t[72]);let Ce;t[73]===be?Ce=t[74]:(Ce=(0,Z.jsxs)(wr,{onSelect:be,"data-testid":`project-switcher-switch-project`,children:[xe,Se]}),t[73]=be,t[74]=Ce);let we;t[75]===N?we=t[76]:(we=e=>{D(e)||N()},t[75]=N,t[76]=we);let Te,Ee;t[77]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,Z.jsx)(hc,{"aria-hidden":`true`,className:`text-muted-foreground`}),Ee=(0,Z.jsx)(J,{id:`PVUn_c`}),t[77]=Te,t[78]=Ee):(Te=t[77],Ee=t[78]);let De;t[79]===we?De=t[80]:(De=(0,Z.jsxs)(wr,{onSelect:we,"data-testid":`project-switcher-open-folder`,children:[Te,Ee]}),t[79]=we,t[80]=De);let Oe;t[81]===F?Oe=t[82]:(Oe=e=>{D(e)||F()},t[81]=F,t[82]=Oe);let Ae,je;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=(0,Z.jsx)(Gn,{"aria-hidden":`true`,className:`text-muted-foreground`}),je=(0,Z.jsx)(J,{id:`9npOH9`}),t[83]=Ae,t[84]=je):(Ae=t[83],je=t[84]);let Me;t[85]===Oe?Me=t[86]:(Me=(0,Z.jsxs)(wr,{onSelect:Oe,"data-testid":`project-switcher-open-file`,children:[Ae,je]}),t[85]=Oe,t[86]=Me);let Ne;t[87]===v?Ne=t[88]:(Ne=v===null?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Fr,{}),(0,Z.jsxs)(wr,{onSelect:e=>{D(e)||(T(!1),h(``),p(!0))},"data-testid":`project-switcher-new-worktree`,children:[(0,Z.jsx)(po,{"aria-hidden":`true`,className:`text-muted-foreground`}),(0,Z.jsx)(J,{id:`DXd9LM`})]})]}),t[87]=v,t[88]=Ne);let Pe;t[89]!==ge||t[90]!==Ce||t[91]!==De||t[92]!==Me||t[93]!==Ne?(Pe=(0,Z.jsxs)(Mr,{align:`start`,side:`top`,className:`min-w-[260px]`,"data-testid":`project-switcher-menu`,children:[ge,_e,ye,Ce,De,Me,Ne]}),t[89]=ge,t[90]=Ce,t[91]=De,t[92]=Me,t[93]=Ne,t[94]=Pe):Pe=t[94];let Fe;t[95]!==o||t[96]!==he||t[97]!==Pe?(Fe=(0,Z.jsxs)(Pr,{open:o,onOpenChange:T,modal:!1,children:[he,Pe]}),t[95]=o,t[96]=he,t[97]=Pe,t[98]=Fe):Fe=t[98];let Ie;t[99]!==n||t[100]!==u?(Ie=(0,Z.jsx)(Ug,{open:u,onOpenChange:d,bridge:n}),t[99]=n,t[100]=u,t[101]=Ie):Ie=t[101];let Le;t[102]===y?.entries?Le=t[103]:(Le=y?.entries.map(h1).filter(m1),t[102]=y?.entries,t[103]=Le);let Re;t[104]===y?.entries?Re=t[105]:(Re=new Set(y?.entries.filter(p1).map(f1)),t[104]=y?.entries,t[105]=Re);let ze=y?.remoteBranches,Be;t[106]===y?.entries?Be=t[107]:(Be=new Map(y?.entries.filter(d1).map(u1)),t[106]=y?.entries,t[107]=Be);let Ve;t[108]!==v||t[109]!==n||t[110]!==m||t[111]!==f||t[112]!==Le||t[113]!==Re||t[114]!==ze||t[115]!==Be?(Ve=(0,Z.jsx)(G$,{open:f,onOpenChange:p,bridge:n,currentBranch:v,initialBranchName:m,branches:Le,existingWorktreeBranches:Re,remoteBranches:ze,behindByBranch:Be}),t[108]=v,t[109]=n,t[110]=m,t[111]=f,t[112]=Le,t[113]=Re,t[114]=ze,t[115]=Be,t[116]=Ve):Ve=t[116];let He;return t[117]!==Fe||t[118]!==Ie||t[119]!==Ve?(He=(0,Z.jsxs)(Z.Fragment,{children:[Fe,Ie,Ve]}),t[117]=Fe,t[118]=Ie,t[119]=Ve,t[120]=He):He=t[120],He}function u1(e){return[e.branch,e.behind]}function d1(e){return e.branch!==null&&e.behind!==void 0}function f1(e){return e.branch}function p1(e){return e.branch!==null&&e.worktreePath!==null}function m1(e){return e!==null}function h1(e){return e.branch}function g1(e){return e.stopPropagation()}function _1(e){return!e.isLinkedWorktree}function v1(e,t){let n=e instanceof Error?e:Error(String(e));console.warn(JSON.stringify({event:`jsx-render-failure`,component:`sidebarSearchPill`,rawComponentName:`sidebarSearchPill`,error:String(n),stack:t.componentStack})),Sa(`sidebarSearchPill`)}function y1(e){let t=(0,$.c)(8),{onClick:n,className:r}=e,i;t[0]===r?i=t[1]:(i=Y(`rounded-lg h-9 w-full justify-start gap-2 px-3 font-normal text-muted-foreground`,r),t[0]=r,t[1]=i);let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(ie,{"aria-hidden":`true`}),t[2]=a):a=t[2];let o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(`span`,{className:`flex-1 text-left text-sm`,children:(0,Z.jsx)(J,{id:`A1taO8`})}),t[3]=o):o=t[3];let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(p,{className:`text-foreground/70`,children:Pl(`command-palette`)}),t[4]=s):s=t[4];let c;return t[5]!==n||t[6]!==i?(c=(0,Z.jsxs)(X,{variant:`outline`,onClick:n,"data-telemetry-event":`ok.sidebar.search_pill.click`,className:i,children:[a,o,s]}),t[5]=n,t[6]=i,t[7]=c):c=t[7],c}function b1(){let e=(0,$.c)(36),{_:t}=gt(),n=is(),{activeDocName:r}=Ye(),[i,a]=(0,Q.useState)(!1),o=us(),s;e[0]!==n.data||e[1]!==n.status?(s=n.status===`ready`?n.data:[],e[0]=n.data,e[1]=n.status,e[2]=s):s=e[2];let c=s,l;e[3]===c?l=e[4]:(l=$s(c),e[3]=c,e[4]=l);let u=l,d=tc(),f;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(f={},e[5]=f):f=e[5];let[p,m]=(0,Q.useState)(f),h;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(SP,{asChild:!0,children:(0,Z.jsxs)(dn,{className:`flex w-full items-center gap-1.5`,children:[(0,Z.jsx)(Gh,{className:`size-3.5 shrink-0`}),(0,Z.jsx)(J,{id:`PCSkw2`}),(0,Z.jsx)(Ho,{className:`size-3.5 shrink-0 text-muted-foreground transition-transform group-data-[state=open]/skills:rotate-90`})]})}),e[6]=h):h=e[6];let g;e[7]===t?g=e[8]:(g=t({id:`MdpSC1`}),e[7]=t,e[8]=g);let _,v;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(_=()=>a(!0),v=(0,Z.jsx)(Wt,{}),e[9]=_,e[10]=v):(_=e[9],v=e[10]);let y;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(J,{id:`MdpSC1`})}),e[11]=y):y=e[11];let b;e[12]===g?b=e[13]:(b=(0,Z.jsxs)(CP,{title:g,onClick:_,children:[v,y]}),e[12]=g,e[13]=b);let x;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Z.jsx)(A1,{}),e[14]=x):x=e[14];let S;e[15]===c?S=e[16]:(S=c.some(S1),e[15]=c,e[16]=S);let C;e[17]===S?C=e[18]:(C=(0,Z.jsx)(O1,{hasProjectSkills:S}),e[17]=S,e[18]=C);let w;e[19]!==o||e[20]!==r||e[21]!==u||e[22]!==p||e[23]!==d||e[24]!==c?(w=c.length===0?(0,Z.jsx)(`p`,{className:`px-2 py-1 text-xs text-muted-foreground`,children:(0,Z.jsx)(J,{id:`PdJZ5p`})}):Xs.filter(e=>c.some(t=>t.scope===e)).map(e=>(0,Z.jsxs)(fn,{className:`group/scope`,open:c.some(t=>t.scope===e&&Ya(t.scope,t.name)===r)||(p[e]??!1),onOpenChange:t=>m(n=>({...n,[e]:t})),children:[(0,Z.jsxs)(dn,{className:`flex w-full items-center gap-1 px-2 pt-1 pb-0.5 text-[11px] text-muted-foreground/70 hover:text-muted-foreground`,children:[(0,Z.jsx)(Ho,{className:`size-3 shrink-0 transition-transform group-data-[state=open]/scope:rotate-90`}),(0,Z.jsx)(`span`,{className:`truncate`,children:d[e]})]}),(0,Z.jsx)(un,{children:(0,Z.jsx)(TP,{className:`pl-2`,children:c.filter(t=>t.scope===e).map(e=>(0,Z.jsx)(C1,{skill:e,activeDocName:r,actions:o,existingNames:u[e.scope]},`${e.scope}::${e.name}`))})})]},e)),e[19]=o,e[20]=r,e[21]=u,e[22]=p,e[23]=d,e[24]=c,e[25]=w):w=e[25];let T;e[26]!==C||e[27]!==w?(T=(0,Z.jsx)(un,{children:(0,Z.jsxs)(wP,{children:[x,C,w]})}),e[26]=C,e[27]=w,e[28]=T):T=e[28];let E;e[29]===i?E=e[30]:(E=(0,Z.jsx)(zs,{defaultScope:`project`,open:i,onOpenChange:a,onCreated:x1}),e[29]=i,e[30]=E);let D;return e[31]!==o.dialogs||e[32]!==T||e[33]!==E||e[34]!==b?(D=(0,Z.jsx)(fn,{className:`group/skills shrink-0`,children:(0,Z.jsxs)(xP,{className:`px-0`,children:[h,b,T,o.dialogs,E]})}),e[31]=o.dialogs,e[32]=T,e[33]=E,e[34]=b,e[35]=D):D=e[35],D}function x1(e){let{scope:t,name:n}=e;return vc(Ya(t,n))}function S1(e){return e.scope===`project`&&!e.managed}function C1(e){let t=(0,$.c)(52),{skill:n,activeDocName:r,actions:i,existingNames:a}=e,{_:o}=gt(),[s,c]=(0,Q.useState)(!1),[l,u]=(0,Q.useState)(!1),d;t[0]!==n.name||t[1]!==n.scope?(d=Ya(n.scope,n.name),t[0]=n.name,t[1]=n.scope,t[2]=d):d=t[2];let f=r===d,p,m,h;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>{e.preventDefault(),u(!0)},m=(0,Z.jsx)(Ho,{className:`size-3 shrink-0 text-muted-foreground transition-transform group-data-[state=open]/skill:rotate-90`}),h=(0,Z.jsx)(Gh,{className:`size-3 shrink-0 text-muted-foreground`}),t[3]=p,t[4]=m,t[5]=h):(p=t[3],m=t[4],h=t[5]);let g=n.name,_;t[6]===n.name?_=t[7]:(_=Js(n.name),t[6]=n.name,t[7]=_);let v;t[8]!==n.name||t[9]!==_?(v=(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:g,children:_}),t[8]=n.name,t[9]=_,t[10]=v):v=t[10];let y;t[11]!==o||t[12]!==n.bundledVersion||t[13]!==n.updateAvailable?(y=n.updateAvailable?(0,Z.jsx)(`span`,{title:o({id:`1YJ4Yg`,values:{0:n.bundledVersion?` (${n.bundledVersion})`:``}}),className:`flex items-center`,children:(0,Z.jsx)(tl,{className:`size-3 text-primary`,"aria-label":o({id:`CifUuG`})})}):null,t[11]=o,t[12]=n.bundledVersion,t[13]=n.updateAvailable,t[14]=y):y=t[14];let b;t[15]!==o||t[16]!==n.installed||t[17]!==n.managed?(b=n.managed?(0,Z.jsx)(`span`,{title:o({id:`U7HJ4y`}),className:`flex items-center`,children:(0,Z.jsx)(Xo,{className:`size-3 text-muted-foreground`,"aria-label":o({id:`U7HJ4y`})})}):(0,Z.jsx)(Ls,{installed:n.installed,subtle:!0,className:`shrink-0`}),t[15]=o,t[16]=n.installed,t[17]=n.managed,t[18]=b):b=t[18];let x;t[19]!==y||t[20]!==b?(x=(0,Z.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1`,children:[y,b]}),t[19]=y,t[20]=b,t[21]=x):x=t[21];let S;t[22]!==f||t[23]!==x||t[24]!==v?(S=(0,Z.jsx)(dn,{asChild:!0,children:(0,Z.jsxs)(OP,{size:`sm`,isActive:f,className:`h-6 text-[11px]`,onContextMenu:p,children:[m,h,v,x]})}),t[22]=f,t[23]=x,t[24]=v,t[25]=S):S=t[25];let C;t[26]!==o||t[27]!==n.name?(C=o({id:`RlLl3G`,values:{0:n.name}}),t[26]=o,t[27]=n.name,t[28]=C):C=t[28];let w;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Z.jsx)(Mh,{}),t[29]=w):w=t[29];let T;t[30]===C?T=t[31]:(T=(0,Z.jsx)(Or,{asChild:!0,children:(0,Z.jsx)(kP,{showOnHover:!0,"aria-label":C,children:w})}),t[30]=C,t[31]=T);let E;t[32]!==i||t[33]!==a||t[34]!==n?(E=(0,Z.jsx)(Mr,{side:`right`,align:`start`,className:`min-w-52`,children:(0,Z.jsx)(ss,{skill:n,actions:i,existingNames:a})}),t[32]=i,t[33]=a,t[34]=n,t[35]=E):E=t[35];let D;t[36]!==l||t[37]!==T||t[38]!==E?(D=(0,Z.jsxs)(Pr,{open:l,onOpenChange:u,children:[T,E]}),t[36]=l,t[37]=T,t[38]=E,t[39]=D):D=t[39];let O;t[40]!==s||t[41]!==n?(O=s?(0,Z.jsx)(E1,{skill:n}):null,t[40]=s,t[41]=n,t[42]=O):O=t[42];let k;t[43]===O?k=t[44]:(k=(0,Z.jsx)(un,{children:O}),t[43]=O,t[44]=k);let A;t[45]!==S||t[46]!==D||t[47]!==k?(A=(0,Z.jsxs)(EP,{children:[S,D,k]}),t[45]=S,t[46]=D,t[47]=k,t[48]=A):A=t[48];let j;return t[49]!==s||t[50]!==A?(j=(0,Z.jsx)(fn,{open:s,onOpenChange:c,className:`group/skill`,children:A}),t[49]=s,t[50]=A,t[51]=j):j=t[51],j}function w1(e){let t=[];for(let n of e){let e=n.path.split(`/`),r=t;e.forEach((t,i)=>{let a=i===e.length-1,o=r.find(e=>e.name===t);o||(o=a?{name:t,path:n.path,text:n.text}:{name:t,path:e.slice(0,i+1).join(`/`),children:[]},r.push(o)),!a&&o.children&&(r=o.children)})}return T1(t),t}function T1(e){e.sort((e,t)=>{let n=+!e.children,r=+!t.children;return n===r?e.name.localeCompare(t.name):n-r});for(let t of e)t.children&&T1(t.children)}function E1(e){let t=(0,$.c)(36),{skill:n}=e,{_:r}=gt(),[i,a]=(0,Q.useState)(null),[o,s]=(0,Q.useState)(!1),{openTarget:c}=Ye(),l;t[0]===c?l=t[1]:(l=function(e){c({kind:`doc`,target:e,docName:e},{tabBehavior:`append`}),xu(Cu(e))},t[0]=c,t[1]=l);let u=l,d;t[2]!==c||t[3]!==n.name||t[4]!==n.scope?(d=function(e){c({kind:`skill-file`,target:`${n.scope}/${n.name}/${e}`,scope:n.scope,name:n.name,path:e},{tabBehavior:`replace-active`}),xu(vu({scope:n.scope,name:n.name,path:e}))},t[2]=c,t[3]=n.name,t[4]=n.scope,t[5]=d):d=t[5];let f=d,p;t[6]!==u||t[7]!==f||t[8]!==n.managed||t[9]!==n.name||t[10]!==n.scope?(p=function(e){if(n.managed){f(e);return}let t=e.lastIndexOf(`.`),r=t>=0?e.slice(t+1).toLowerCase():``;if(n.scope===`project`&&(r===`md`||r===`mdx`)){u(rt(n.name,e.replace(/\.mdx?$/i,``)));return}f(e)},t[6]=u,t[7]=f,t[8]=n.managed,t[9]=n.name,t[10]=n.scope,t[11]=p):p=t[11];let m=p,h,g;t[12]!==n.name||t[13]!==n.scope?(h=()=>{let e=!0,t=()=>{Df(n.scope,n.name).then(t=>{e&&(t.ok?(a(t.files),s(!1)):(a([]),s(!0)))})};t();let r=nu(t);return()=>{e=!1,r()}},g=[n.scope,n.name],t[12]=n.name,t[13]=n.scope,t[14]=h,t[15]=g):(h=t[14],g=t[15]),(0,Q.useEffect)(h,g);let _;if(t[16]!==r||t[17]!==i||t[18]!==o||t[19]!==m||t[20]!==u||t[21]!==f||t[22]!==n.managed||t[23]!==n.name||t[24]!==n.scope){let e=i?w1(i):[],a;t[26]!==u||t[27]!==f||t[28]!==n.managed||t[29]!==n.name||t[30]!==n.scope?(a=()=>n.managed?f(`SKILL.md`):n.scope===`project`?u(Ti(n.name)):vc(Ya(n.scope,n.name)),t[26]=u,t[27]=f,t[28]=n.managed,t[29]=n.name,t[30]=n.scope,t[31]=a):a=t[31];let s,c;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(Gn,{className:`size-3 shrink-0 text-muted-foreground`}),c=(0,Z.jsx)(`span`,{className:`truncate`,children:`SKILL.md`}),t[32]=s,t[33]=c):(s=t[32],c=t[33]);let l;t[34]===a?l=t[35]:(l=(0,Z.jsx)(jP,{children:(0,Z.jsxs)(MP,{size:`sm`,onClick:a,className:`text-[11px]`,children:[s,c]})}),t[34]=a,t[35]=l),_=(0,Z.jsxs)(AP,{className:`mr-0 pr-0`,children:[l,i===null?(0,Z.jsx)(jP,{children:(0,Z.jsx)(`span`,{className:`px-2 py-0.5 text-[11px] text-muted-foreground/70`,children:(0,Z.jsx)(J,{id:`yQE2r9`})})}):o?(0,Z.jsx)(jP,{children:(0,Z.jsx)(`span`,{className:`px-2 py-0.5 text-[11px] text-muted-foreground/70`,title:r({id:`3Ijjy1`}),children:(0,Z.jsx)(J,{id:`ZARuZJ`})})}):e.map(e=>(0,Z.jsx)(D1,{node:e,depth:0,onOpenFile:m},e.path))]}),t[16]=r,t[17]=i,t[18]=o,t[19]=m,t[20]=u,t[21]=f,t[22]=n.managed,t[23]=n.name,t[24]=n.scope,t[25]=_}else _=t[25];return _}function D1(e){let t=(0,$.c)(34),{node:n,depth:r,onOpenFile:i}=e,[a,o]=(0,Q.useState)(!1),s=`${r*.6}rem`,c;t[0]===s?c=t[1]:(c={paddingLeft:s},t[0]=s,t[1]=c);let l=c;if(n.children){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Ho,{className:`size-3 shrink-0 text-muted-foreground transition-transform group-data-[state=open]/dir:rotate-90`}),t[2]=e):e=t[2];let s;t[3]===n.name?s=t[4]:(s=(0,Z.jsxs)(`span`,{className:`truncate`,children:[n.name,`/`]}),t[3]=n.name,t[4]=s);let c;t[5]!==l||t[6]!==s?(c=(0,Z.jsx)(dn,{asChild:!0,children:(0,Z.jsxs)(MP,{size:`sm`,className:`text-[11px]`,style:l,children:[e,s]})}),t[5]=l,t[6]=s,t[7]=c):c=t[7];let u;if(t[8]!==r||t[9]!==n.children||t[10]!==i){let e;t[12]!==r||t[13]!==i?(e=e=>(0,Z.jsx)(D1,{node:e,depth:r+1,onOpenFile:i},e.path),t[12]=r,t[13]=i,t[14]=e):e=t[14],u=n.children.map(e),t[8]=r,t[9]=n.children,t[10]=i,t[11]=u}else u=t[11];let d;t[15]===u?d=t[16]:(d=(0,Z.jsx)(un,{children:u}),t[15]=u,t[16]=d);let f;t[17]!==c||t[18]!==d?(f=(0,Z.jsxs)(jP,{children:[c,d]}),t[17]=c,t[18]=d,t[19]=f):f=t[19];let p;return t[20]!==a||t[21]!==f?(p=(0,Z.jsx)(fn,{open:a,onOpenChange:o,className:`group/dir`,children:f}),t[20]=a,t[21]=f,t[22]=p):p=t[22],p}let u=`skill-file-${n.path}`,d;t[23]!==n.path||t[24]!==i?(d=()=>i(n.path),t[23]=n.path,t[24]=i,t[25]=d):d=t[25];let f;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(Fh,{className:`size-3 shrink-0 text-muted-foreground`}),t[26]=f):f=t[26];let p;t[27]===n.name?p=t[28]:(p=(0,Z.jsx)(`span`,{className:`truncate`,children:n.name}),t[27]=n.name,t[28]=p);let m;return t[29]!==l||t[30]!==u||t[31]!==d||t[32]!==p?(m=(0,Z.jsx)(jP,{children:(0,Z.jsxs)(MP,{size:`sm`,className:`text-[11px]`,style:l,"data-testid":u,onClick:d,children:[f,p]})}),t[29]=l,t[30]=u,t[31]=d,t[32]=p,t[33]=m):m=t[33],m}function O1(e){let t=(0,$.c)(12),{hasProjectSkills:n}=e,{_:r}=gt(),[i,a]=(0,Q.useState)(null),[o,s]=(0,Q.useState)(!1),c,l;if(t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=window.okDesktop?.sharing;if(!e)return;let t=!1,n=()=>{e.status().then(e=>{t||a(e.mode===`local-only`&&!e.skillsShared)}).catch(k1)};return n(),window.addEventListener(`focus`,n),()=>{t=!0,window.removeEventListener(`focus`,n)}},l=[],t[0]=c,t[1]=l):(c=t[0],l=t[1]),(0,Q.useEffect)(c,l),!n||i!==!0)return null;let u;t[2]!==r||t[3]!==o?(u=async()=>{let e=window.okDesktop?.sharing;if(!e||o)return;s(!0);let t=null,n=null;try{t=await e.setSkillsShared(!0)}catch(e){n=e}if(s(!1),n!==null){let e=n instanceof Error?n.message:``;gl.error(e.startsWith(`ok:sharing:dispatch:`)?r({id:`qXN416`}):e||r({id:`K2v7QF`}));return}if(t!==null){if(t.kind===`applied`)gl.success(r({id:`Q7cNKe`})),a(!1);else if(t.kind===`no-exclude`){let e=t.reason===`no-git`?r({id:`Xwump4`}):t.reason===`inaccessible`?r({id:`PlGC6r`}):r({id:`zcmYx4`});gl.warning(r({id:`EARn6h`,values:{detail:e}}))}}},t[2]=r,t[3]=o,t[4]=u):u=t[4];let d=u,f;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(`p`,{className:`mb-2 text-amber-900 dark:text-amber-200`,children:(0,Z.jsx)(J,{id:`Bh9671`})}),t[5]=f):f=t[5];let p;t[6]===d?p=t[7]:(p=()=>void d(),t[6]=d,t[7]=p);let m;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Z.jsx)(J,{id:`TUzThQ`}),t[8]=m):m=t[8];let h;return t[9]!==o||t[10]!==p?(h=(0,Z.jsxs)(`div`,{className:`mx-2 mb-1 rounded-md border border-amber-300 bg-amber-50 p-2 text-xs dark:border-amber-700 dark:bg-amber-950`,children:[f,(0,Z.jsx)(X,{size:`sm`,className:`h-6 px-2 text-xs`,disabled:o,onClick:p,children:m})]}),t[9]=o,t[10]=p,t[11]=h):h=t[11],h}function k1(e){console.warn(JSON.stringify({event:`skills-share-status-read-failed`,error:e instanceof Error?e.message:String(e)}))}function A1(){let e=(0,$.c)(19),[t,n]=(0,Q.useState)(null),[r,i]=(0,Q.useState)(!1),a,o;if(e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>{let e=!1;return Tf().then(t=>{e||n(t)}),()=>{e=!0}},o=[],e[0]=a,e[1]=o):(a=e[0],o=e[1]),(0,Q.useEffect)(a,o),!t||t.managed!==null||t.importable===0)return null;let s;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=async e=>{if(i(!0),!await Of(e)){i(!1);return}n({managed:e,importable:0})},e[2]=s):s=e[2];let c=s,l;e[3]===t.importable?l=e[4]:(l=(0,Z.jsx)(`p`,{className:`mb-2 text-muted-foreground`,children:(0,Z.jsx)(J,{id:`mu1O0q`,values:{0:t.importable}})}),e[3]=t.importable,e[4]=l);let u,d;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>c(!0),d=(0,Z.jsx)(J,{id:`l3s5ri`}),e[5]=u,e[6]=d):(u=e[5],d=e[6]);let f;e[7]===r?f=e[8]:(f=(0,Z.jsx)(X,{size:`sm`,className:`h-6 px-2 text-xs`,disabled:r,onClick:u,children:d}),e[7]=r,e[8]=f);let p,m;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>c(!1),m=(0,Z.jsx)(J,{id:`PBxg_E`}),e[9]=p,e[10]=m):(p=e[9],m=e[10]);let h;e[11]===r?h=e[12]:(h=(0,Z.jsx)(X,{size:`sm`,variant:`ghost`,className:`h-6 px-2 text-xs`,disabled:r,onClick:p,children:m}),e[11]=r,e[12]=h);let g;e[13]!==f||e[14]!==h?(g=(0,Z.jsxs)(`div`,{className:`flex gap-1.5`,children:[f,h]}),e[13]=f,e[14]=h,e[15]=g):g=e[15];let _;return e[16]!==g||e[17]!==l?(_=(0,Z.jsxs)(`div`,{className:`mx-2 mb-1 rounded-md border border-border/60 bg-muted/40 p-2 text-xs`,children:[l,g]}),e[16]=g,e[17]=l,e[18]=_):_=e[18],_}var j1=6e4,M1=e=>{let t=(0,$.c)(11),{href:n,label:r,icon:i}=e,a,o;t[0]===n?(a=t[1],o=t[2]):(a=e=>cd(e,n),o=e=>cd(e,n),t[0]=n,t[1]=a,t[2]=o);let s;t[3]===i?s=t[4]:(s=(0,Z.jsx)(i,{"aria-hidden":`true`,className:`size-3.5`}),t[3]=i,t[4]=s);let c;return t[5]!==n||t[6]!==r||t[7]!==a||t[8]!==o||t[9]!==s?(c=(0,Z.jsx)(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,onClick:a,onAuxClick:o,"aria-label":r,className:`rounded-md p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,children:s}),t[5]=n,t[6]=r,t[7]=a,t[8]=o,t[9]=s,t[10]=c):c=t[10],c};function N1(e){let t=(0,$.c)(34),{version:n,onOpenReleaseNotes:r,onClose:i,store:a,autoDismissMs:o}=e,s=a===void 0?FL:a,c=o===void 0?j1:o,{_:l}=gt(),[u,d]=(0,Q.useState)(!1),f,p;t[0]!==c||t[1]!==i||t[2]!==u?(f=()=>{if(!u)return;let e=setTimeout(i,c);return()=>clearTimeout(e)},p=[u,i,c],t[0]=c,t[1]=i,t[2]=u,t[3]=f,t[4]=p):(f=t[3],p=t[4]),(0,Q.useEffect)(f,p);let m;t[5]===l?m=t[6]:(m=l({id:`GzPQ2f`}),t[5]=l,t[6]=m);let h;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(J,{id:`yLEyuq`}),t[7]=h):h=t[7];let g;t[8]===s?g=t[9]:(g=()=>{s.markSubscribed(),d(!0)},t[8]=s,t[9]=g);let _;t[10]!==i||t[11]!==s?(_=()=>{s.dismiss(),i()},t[10]=i,t[11]=s,t[12]=_):_=t[12];let v;t[13]!==g||t[14]!==_?(v=(0,Z.jsx)(uL,{source:`post_update_card`,compactSubmit:!0,description:h,onSuccess:g,onDismiss:_}),t[13]=g,t[14]=_,t[15]=v):v=t[15];let y;t[16]!==l||t[17]!==u?(y=u?null:(0,Z.jsxs)(`nav`,{"aria-label":l({id:`dbapvC`}),className:`mt-3 flex items-center gap-1.5 text-muted-foreground text-xs`,children:[(0,Z.jsx)(`span`,{className:`mr-0.5`,children:(0,Z.jsx)(J,{id:`9sBe85`})}),(0,Z.jsx)(M1,{href:TL,label:l({id:`I7Exsw`}),icon:RL}),(0,Z.jsx)(M1,{href:CL,label:l({id:`zyKa-I`}),icon:r_}),(0,Z.jsx)(M1,{href:wL,label:l({id:`36aWJD`}),icon:LL})]}),t[16]=l,t[17]=u,t[18]=y):y=t[18];let b;t[19]!==y||t[20]!==v?(b=(0,Z.jsxs)(`div`,{className:`px-3 py-2.5`,children:[v,y]}),t[19]=y,t[20]=v,t[21]=b):b=t[21];let x;t[22]===n?x=t[23]:(x=(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:(0,Z.jsx)(J,{id:`hLy8b1`,values:{version:n}})}),t[22]=n,t[23]=x);let S;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(J,{id:`_PACVa`}),t[24]=S):S=t[24];let C;t[25]===r?C=t[26]:(C=(0,Z.jsx)(X,{variant:`link`,size:`sm`,className:`h-auto p-0 text-muted-foreground text-xs hover:text-foreground`,onClick:r,children:S}),t[25]=r,t[26]=C);let w;t[27]!==x||t[28]!==C?(w=(0,Z.jsxs)(`div`,{className:`flex items-center justify-between border-t bg-muted/30 px-3 py-2.5 space-x-2`,children:[x,C]}),t[27]=x,t[28]=C,t[29]=w):w=t[29];let T;return t[30]!==b||t[31]!==w||t[32]!==m?(T=(0,Z.jsxs)(`section`,{"aria-label":m,className:`mx-1 mb-1 overflow-hidden rounded-lg border bg-card text-card-foreground`,children:[b,w]}),t[30]=b,t[31]=w,t[32]=m,t[33]=T):T=t[33],T}function P1(e){let t=(0,$.c)(37),{notice:n,onDismiss:r}=e,{_:i}=gt(),a=n.variant===`error`?`border-destructive/60 bg-sidebar-accent/30 text-muted-foreground`:n.variant===`success`?`border-emerald-500/40 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400`:`border-sidebar-border bg-sidebar-accent/30 text-muted-foreground`,o;t[0]!==i||t[1]!==n.dismissible||t[2]!==r?(o=n.dismissible===!1?null:(0,Z.jsx)(X,{variant:`ghost`,size:`icon`,className:`size-5 shrink-0 text-muted-foreground hover:text-sidebar-foreground`,"aria-label":i({id:`GUYwCr`}),onClick:r,children:(0,Z.jsx)(hl,{"aria-hidden":`true`,className:`size-3`})}),t[0]=i,t[1]=n.dismissible,t[2]=r,t[3]=o):o=t[3];let s=o,c=`shrink-0 text-xs font-medium underline underline-offset-2 ${n.variant===`success`?`decoration-emerald-500/40`:`decoration-muted-foreground/40`} hover:text-sidebar-foreground hover:decoration-sidebar-foreground`;if(n.secondaryAction){let e=`update-notice-${n.id}`,r=`flex flex-col gap-2 rounded-md border px-2 py-2 text-xs ${a}`,i;t[4]===n.body?i=t[5]:(i=(0,Z.jsx)(`span`,{className:`flex-1 leading-snug`,children:n.body}),t[4]=n.body,t[5]=i);let o;t[6]!==s||t[7]!==i?(o=(0,Z.jsxs)(`div`,{className:`flex items-start gap-2`,children:[i,s]}),t[6]=s,t[7]=i,t[8]=o):o=t[8];let l;t[9]!==c||t[10]!==n.action?(l=n.action?(0,Z.jsx)(`button`,{type:`button`,className:c,onClick:()=>{n.action?.onClick()},children:n.action.label}):null,t[9]=c,t[10]=n.action,t[11]=l):l=t[11];let u;t[12]===n.secondaryAction?u=t[13]:(u=()=>{n.secondaryAction?.onClick()},t[12]=n.secondaryAction,t[13]=u);let d;t[14]!==c||t[15]!==n.secondaryAction.label||t[16]!==u?(d=(0,Z.jsx)(`button`,{type:`button`,className:c,onClick:u,children:n.secondaryAction.label}),t[14]=c,t[15]=n.secondaryAction.label,t[16]=u,t[17]=d):d=t[17];let f;t[18]!==l||t[19]!==d?(f=(0,Z.jsxs)(`div`,{className:`flex gap-3 pl-1`,children:[l,d]}),t[18]=l,t[19]=d,t[20]=f):f=t[20];let p;return t[21]!==e||t[22]!==r||t[23]!==o||t[24]!==f?(p=(0,Z.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"data-testid":e,className:r,children:[o,f]}),t[21]=e,t[22]=r,t[23]=o,t[24]=f,t[25]=p):p=t[25],p}let l=`update-notice-${n.id}`,u=`flex items-center gap-2 rounded-md border px-2 py-1.5 text-xs ${a}`,d;t[26]===n.body?d=t[27]:(d=(0,Z.jsx)(`span`,{className:`flex-1 leading-snug`,children:n.body}),t[26]=n.body,t[27]=d);let f;t[28]!==c||t[29]!==n.action?(f=n.action?(0,Z.jsx)(`button`,{type:`button`,className:c,onClick:()=>{n.action?.onClick()},children:n.action.label}):null,t[28]=c,t[29]=n.action,t[30]=f):f=t[30];let p;return t[31]!==s||t[32]!==l||t[33]!==u||t[34]!==d||t[35]!==f?(p=(0,Z.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"data-testid":l,className:u,children:[d,f,s]}),t[31]=s,t[32]=l,t[33]=u,t[34]=d,t[35]=f,t[36]=p):p=t[36],p}function F1(e){if(e.length===0)return null;let t=e[0];if(!t)return null;for(let n=1;n<e.length;n++){let r=e[n];r&&r.priority<t.priority&&(t=r)}return t}function I1(){let e=(0,$.c)(15),t=(0,Q.useSyncExternalStore)(fz,dz,dz),n;e[0]===t?n=e[1]:(n=F1(t),e[0]=t,e[1]=n);let r=n;if(!r)return null;if(r.combinedSubscribe&&r.whatsNew){let t;e[2]===r.action?t=e[3]:(t=()=>r.action?.onClick(),e[2]=r.action,e[3]=t);let n;e[4]===r.id?n=e[5]:(n=()=>uz(r.id),e[4]=r.id,e[5]=n);let i;return e[6]!==r.whatsNew.version||e[7]!==t||e[8]!==n?(i=(0,Z.jsx)(`div`,{"data-testid":`update-notices-list`,children:(0,Z.jsx)(N1,{version:r.whatsNew.version,onOpenReleaseNotes:t,onClose:n})}),e[6]=r.whatsNew.version,e[7]=t,e[8]=n,e[9]=i):i=e[9],i}let i;e[10]===r?i=e[11]:(i=()=>{r.onDismiss?.(),uz(r.id)},e[10]=r,e[11]=i);let a;return e[12]!==r||e[13]!==i?(a=(0,Z.jsx)(`div`,{"data-testid":`update-notices-list`,children:(0,Z.jsx)(P1,{notice:r,onDismiss:i})}),e[12]=r,e[13]=i,e[14]=a):a=e[14],a}function L1(e,t){return e?.kind===`doc`||e?.kind===`folder-index`?Qs(t.contentDir,nc(e.docName),t.pathSeparator):e?.kind===`folder`?Qs(t.contentDir,e.folderPath,t.pathSeparator):e?.kind===`asset`?Qs(t.contentDir,e.assetPath,t.pathSeparator):t.contentDir}function R1(e){return e?.kind===`doc`||e?.kind===`folder-index`?nc(e.docName):e?.kind===`folder`?e.folderPath:e?.kind===`asset`?e.assetPath:``}function z1(e,t){return e===null?os({workspace:t}):e.kind===`folder`?t?ns({folderRelativePath:e.folderPath,workspace:t}):null:e.kind===`doc`||e.kind===`folder-index`?ls({docName:e.docName,workspace:t}):null}var B1={folderCount:0,expandedCount:0},V1=`button, [role="button"], [role="menuitem"], input, textarea, select, a[href]`;function H1(e){return typeof Element>`u`||!(e instanceof Element)?!1:e.closest(V1)!==null}function U1(e){let t=(0,$.c)(2),{onOpenSearch:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(uu,{name:`file-sidebar`,children:(0,Z.jsx)(J1,{onOpenSearch:n})}),t[0]=n,t[1]=r),r}var W1=`[&_svg:not([class*='size-'])]:size-3.5`,G1=e=>{let t=(0,$.c)(7),{label:n,shortcutId:r}=e,i;t[0]===n?i=t[1]:(i=(0,Z.jsx)(`span`,{children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=r?(0,Z.jsxs)(Z.Fragment,{children:[` `,(0,Z.jsx)(p,{"aria-label":jl(r),children:Pl(r)})]}):null,t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,Z.jsxs)(sn,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o},K1=e=>{let t=(0,$.c)(21),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:r,icon:n,label:i,shortcutId:o,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s;t[6]===r?s=t[7]:(s=Y(W1,r),t[6]=r,t[7]=s);let c;t[8]===n?c=t[9]:(c=(0,Z.jsx)(n,{"aria-hidden":`true`}),t[8]=n,t[9]=c);let l;t[10]!==i||t[11]!==a||t[12]!==s||t[13]!==c?(l=(0,Z.jsx)(on,{asChild:!0,children:(0,Z.jsx)(X,{variant:`ghost`,size:`icon-sm`,"aria-label":i,className:s,...a,children:c})}),t[10]=i,t[11]=a,t[12]=s,t[13]=c,t[14]=l):l=t[14];let u;t[15]!==i||t[16]!==o?(u=(0,Z.jsx)(G1,{label:i,shortcutId:o}),t[15]=i,t[16]=o,t[17]=u):u=t[17];let d;return t[18]!==l||t[19]!==u?(d=(0,Z.jsxs)(ln,{children:[l,u]}),t[18]=l,t[19]=u,t[20]=d):d=t[20],d},q1=e=>{let t=(0,$.c)(21),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:r,icon:n,label:i,shortcutId:o,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s;t[6]===r?s=t[7]:(s=Y(W1,r),t[6]=r,t[7]=s);let c;t[8]===n?c=t[9]:(c=(0,Z.jsx)(n,{"aria-hidden":`true`}),t[8]=n,t[9]=c);let l;t[10]!==i||t[11]!==a||t[12]!==s||t[13]!==c?(l=(0,Z.jsx)(on,{asChild:!0,children:(0,Z.jsx)(Or,{asChild:!0,children:(0,Z.jsx)(X,{variant:`ghost`,size:`icon-sm`,"aria-label":i,className:s,...a,children:c})})}),t[10]=i,t[11]=a,t[12]=s,t[13]=c,t[14]=l):l=t[14];let u;t[15]!==i||t[16]!==o?(u=(0,Z.jsx)(G1,{label:i,shortcutId:o}),t[15]=i,t[16]=o,t[17]=u):u=t[17];let d;return t[18]!==l||t[19]!==u?(d=(0,Z.jsxs)(ln,{children:[l,u]}),t[18]=l,t[19]=u,t[20]=d):d=t[20],d};function J1(e){let t=(0,$.c)(317),{onOpenSearch:n}=e,{_:r}=gt(),[i,a]=(0,Q.useState)(null),[o,s]=(0,Q.useState)(null),{activeDocName:c,activeTarget:l}=Ye(),u;t[0]!==c||t[1]!==l?(u=l?.kind===`folder`||l?.kind===`folder-index`?l.folderPath:Hl(c),t[0]=c,t[1]=l,t[2]=u):u=t[2];let d=u,f;t[3]===d?f=t[4]:(f=Gl(d)?``:d,t[3]=d,t[4]=f);let p=f,[m,h]=(0,Q.useState)(!1),g=m?``:p,_=typeof window<`u`&&window.okDesktop!=null,{state:v,toggleSidebar:y}=uP(),b=ec(),x=v===`expanded`,S=_&&v===`collapsed`,[C,w]=(0,Q.useState)(B1),T,E;t[5]===i?(T=t[6],E=t[7]):(T=()=>{if(i===null)return;let e=()=>{w(i.getFolderState()),h(i.isCreationTargetCleared())};return e(),i.subscribe(e)},E=[i],t[5]=i,t[6]=T,t[7]=E),(0,Q.useEffect)(T,E);let D,O;t[8]===i?(D=t[9],O=t[10]):(D=()=>{if(i!==null)return dw(e=>{let t=e.initialDir??``;if(e.template){i.createFromTemplate(e.template.folder,e.template.name);return}i.startCreating(`file`,t)})},O=[i],t[8]=i,t[9]=D,t[10]=O),(0,Q.useEffect)(D,O);let k=C.folderCount>0,A=k&&C.expandedCount===C.folderCount,j=C.expandedCount===0,M=Ms(``),N=Ms(g===``?null:g),P=g===``?M:N,F=M.state.status===`ready`?(M.state.data.folder.templates_available?.length??0)>0:!0,I=P.state.status===`ready`?(P.state.data.folder.templates_available?.length??0)>0:!0,L=typeof window<`u`?window.okDesktop:void 0,R=fd(),{status:z}=go(),B=z?.hasRemote===!0,V;t[11]!==r||t[12]!==R?.contentDir?(V=L?.config?.projectName||R?.contentDir.split(`/`).filter(Boolean).pop()||r({id:`sER-bs`}),t[11]=r,t[12]=R?.contentDir,t[13]=V):V=t[13];let H=V,U=as().states,{dispatch:W}=$o(),G;t[14]===R?G=t[15]:(G=os({workspace:R}),t[14]=R,t[15]=G);let K=G,{projectLocalBinding:ee,merged:te}=od(),ne=te?.appearance?.sidebar?.showHiddenFiles??!1,q=te?.appearance?.sidebar?.showOkFolders??!1,re=te?.appearance?.sidebar?.showOnlyMarkdownFiles??!1,ie=te?.appearance?.sidebar?.showSkillsSection??!0,ae=k&&!A,oe=k&&!j,se=ae||oe,ce=(0,Q.useRef)(!1),le;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(le=e=>{ce.current&&(ce.current=!1,e.preventDefault())},t[16]=le):le=t[16];let ue=le,de=$1,fe;t[17]!==i||t[18]!==R?(fe=()=>{R&&(ce.current=!0,i?.startCreating(`file`,``))},t[17]=i,t[18]=R,t[19]=fe):fe=t[19];let pe=fe,me;t[20]!==i||t[21]!==R?(me=e=>{R&&(ce.current=!0,i?.createFromTemplate(``,e))},t[20]=i,t[21]=R,t[22]=me):me=t[22];let he=me,ge;t[23]!==i||t[24]!==R?(ge=()=>{R&&(ce.current=!0,i?.startCreating(`folder`,``))},t[23]=i,t[24]=R,t[25]=ge):ge=t[25];let _e=ge,ve;t[26]===R?ve=t[27]:(ve=()=>{!R||!L||L.shell.showItemInFolder(R.contentDir)},t[26]=R,t[27]=ve);let ye=ve,be;t[28]!==r||t[29]!==R?(be=async()=>{if(R)try{await navigator.clipboard.writeText(R.contentDir),gl.success(r({id:`6_ZOw4`}),{description:R.contentDir})}catch(e){console.warn(`[FileSidebar] clipboard write failed:`,e),gl.error(r({id:`vfRlCI`}))}},t[28]=r,t[29]=R,t[30]=be):be=t[30];let xe=be,Se;t[31]!==r||t[32]!==B?(Se=()=>{vs({...js(``),hasRemote:B,onClickWhenNoRemote:()=>{gl.error(r({id:`WyQxwa`}))}},{clipboardWrite:uf,toastSuccess:Q1,toastError:Z1,logEvent:X1})},t[31]=r,t[32]=B,t[33]=Se):Se=t[33];let Ce=Se,we;t[34]!==r||t[35]!==ee?(we=e=>{if(ee===null)return;let t=ee.patch({appearance:{sidebar:e}});t.ok||(console.warn(`[FileSidebar] sidebar visibility toggle rejected:`,hi(t.error)),gl.error(r({id:`P47EWZ`}),{description:hi(t.error)}))},t[34]=r,t[35]=ee,t[36]=we):we=t[36];let Te=we,Ee;t[37]===i?Ee=t[38]:(Ee=()=>{i?.expandAll()},t[37]=i,t[38]=Ee);let De=Ee,Oe;t[39]===i?Oe=t[40]:(Oe=()=>{i?.collapseAll()},t[39]=i,t[40]=Oe);let ke=Oe,Ae,je;t[41]!==oe||t[42]!==ae||t[43]!==ne||t[44]!==q||t[45]!==re||t[46]!==ie||t[47]!==v?(Ae=()=>{let e={showHiddenFiles:ne,showOkFolders:q,showOnlyMarkdownFiles:re,showSkillsSection:ie,canExpandAll:ae,canCollapseAll:oe,sidebarVisible:v===`expanded`};Sc(e),L&&L.editor.notifyViewMenuStateChanged(e)},je=[L,ne,q,re,ie,ae,oe,v],t[41]=oe,t[42]=ae,t[43]=ne,t[44]=q,t[45]=re,t[46]=ie,t[47]=v,t[48]=Ae,t[49]=je):(Ae=t[48],je=t[49]),(0,Q.useEffect)(Ae,je);let Me;t[50]!==r||t[51]!==l||t[52]!==W||t[53]!==U||t[54]!==g||t[55]!==Te||t[56]!==ne||t[57]!==q||t[58]!==re||t[59]!==ie||t[60]!==y||t[61]!==i||t[62]!==R?(Me=()=>Ut(e=>{let t=l!==null&&Gl(R1(l));switch(e){case`new-doc`:if(!R||!i)return;i.startCreating(`file`,g);return;case`new-folder`:if(!R||!i)return;i.startCreating(`folder`,g);return;case`new-from-template`:if(!R||!i)return;i.startCreatingFromTemplate(g);return;case`rename`:if(!l||t)return;QZ(l);return;case`duplicate`:if(!l||t)return;eQ(l);return;case`move-to-trash`:if(!l||t)return;XZ(l);return;case`reveal-in-finder`:{if(!L||!R)return;let e=L1(l,R);L.shell.showItemInFolder(e);return}case`send-to-ai`:{let e=Zr.filter(e=>U[e.id]?.installed===!0);if(e.length===0){gl.error(r({id:`LKOLNn`}));return}let t=z1(l,R);if(!t)return;let[n]=e;if(!n)return;W(n.id,t);return}case`copy-full-path`:{if(!R)return;let e=L1(l,R);navigator.clipboard.writeText(e).then(()=>gl.success(r({id:`6_ZOw4`}),{description:e})).catch(e=>{console.warn(`[FileSidebar] clipboard write failed:`,e),gl.error(r({id:`vfRlCI`}))});return}case`copy-relative-path`:{let e=R1(l);if(e===``){gl.error(r({id:`74eHt-`}));return}navigator.clipboard.writeText(e).then(()=>gl.success(r({id:`haHgQj`}),{description:e})).catch(e=>{console.warn(`[FileSidebar] clipboard write failed:`,e),gl.error(r({id:`5QGTaA`}))});return}case`toggle-show-ok-folders`:Te({showOkFolders:!q});return;case`toggle-show-hidden-files`:Te({showHiddenFiles:!ne});return;case`toggle-show-only-markdown-files`:Te({showOnlyMarkdownFiles:!re});return;case`toggle-show-skills-section`:Te({showSkillsSection:!ie});return;case`expand-all-tree`:i?.expandAll();return;case`collapse-all-tree`:i?.collapseAll();return;case`toggle-sidebar`:y();return;case`delete`:case`toggle-source`:case`save-version`:case`version-history`:case`focus-search`:case`focus-command-palette`:case`close-active-tab-or-window`:case`toggle-doc-panel`:return}}),t[50]=r,t[51]=l,t[52]=W,t[53]=U,t[54]=g,t[55]=Te,t[56]=ne,t[57]=q,t[58]=re,t[59]=ie,t[60]=y,t[61]=i,t[62]=R,t[63]=Me):Me=t[63];let Ne;t[64]!==r||t[65]!==l||t[66]!==W||t[67]!==U||t[68]!==g||t[69]!==ee||t[70]!==ne||t[71]!==q||t[72]!==re||t[73]!==ie||t[74]!==y||t[75]!==i||t[76]!==R?(Ne=[L,i,R,l,g,ee,ne,q,re,ie,U,W,y,r],t[64]=r,t[65]=l,t[66]=W,t[67]=U,t[68]=g,t[69]=ee,t[70]=ne,t[71]=q,t[72]=re,t[73]=ie,t[74]=y,t[75]=i,t[76]=R,t[77]=Ne):Ne=t[77],(0,Q.useEffect)(Me,Ne);let Pe=_&&x&&`motion-safe:delay-100`,Fe=S&&`opacity-0`,Ie;t[78]!==Pe||t[79]!==Fe?(Ie=Y(`flex-row h-12 items-center py-0 px-3`,`justify-between`,_&&`overflow-x-clip`,_&&`motion-safe:transition-opacity motion-safe:duration-100 motion-safe:ease-out`,Pe,Fe,_&&`[-webkit-app-region:drag]`),t[78]=Pe,t[79]=Fe,t[80]=Ie):Ie=t[80];let Le;t[81]===Symbol.for(`react.memo_cache_sentinel`)?(Le=_?(0,Z.jsx)(`div`,{"aria-hidden":`true`,"data-testid":`sidebar-traffic-light-reserve`,className:`w-[var(--ok-titlebar-reserve-left,0px)] shrink-0 self-stretch`}):null,t[81]=Le):Le=t[81];let Re;t[82]===x?Re=t[83]:(Re=x&&!_?(0,Z.jsx)(`span`,{className:`shrink-0 font-mono text-sm uppercase tracking-wider text-sidebar-foreground/50`,children:(0,Z.jsx)(J,{id:`sER-bs`})}):null,t[82]=x,t[83]=Re);let ze;t[84]===x?ze=t[85]:(ze=_&&x?(0,Z.jsx)(rR,{}):null,t[84]=x,t[85]=ze);let Be;t[86]!==Ie||t[87]!==Re||t[88]!==ze?(Be=(0,Z.jsxs)(vP,{"data-electron-drag":_?``:void 0,className:Ie,children:[Le,Re,ze]}),t[86]=Ie,t[87]=Re,t[88]=ze,t[89]=Be):Be=t[89];let Ve=_&&x&&`motion-safe:delay-100`,He=S&&`opacity-0`,Ue;t[90]!==Ve||t[91]!==He?(Ue=Y(`px-2 pb-2`,_&&`[-webkit-app-region:no-drag]`,_&&`motion-safe:transition-opacity motion-safe:duration-100 motion-safe:ease-out`,Ve,He),t[90]=Ve,t[91]=He,t[92]=Ue):Ue=t[92];let We;t[93]===v?We=t[94]:(We=[v],t[93]=v,t[94]=We);let Ge;t[95]===n?Ge=t[96]:(Ge=(0,Z.jsx)(y1,{onClick:n}),t[95]=n,t[96]=Ge);let Ke;t[97]!==We||t[98]!==Ge?(Ke=(0,Z.jsx)(Yt,{fallbackRender:Y1,onError:v1,resetKeys:We,children:Ge}),t[97]=We,t[98]=Ge,t[99]=Ke):Ke=t[99];let qe;t[100]!==Ue||t[101]!==Ke?(qe=(0,Z.jsx)(`div`,{className:Ue,children:Ke}),t[100]=Ue,t[101]=Ke,t[102]=qe):qe=t[102];let Je;t[103]===Symbol.for(`react.memo_cache_sentinel`)?(Je=(0,Z.jsx)(AR,{}),t[103]=Je):Je=t[103];let Xe;t[104]===Symbol.for(`react.memo_cache_sentinel`)?(Xe=(0,Z.jsx)(hc,{className:`size-3.5 shrink-0`}),t[104]=Xe):Xe=t[104];let Ze;t[105]===H?Ze=t[106]:(Ze=(0,Z.jsx)(`span`,{className:`truncate`,children:H}),t[105]=H,t[106]=Ze);let Qe;t[107]===Symbol.for(`react.memo_cache_sentinel`)?(Qe=(0,Z.jsx)(Ho,{className:`size-3.5 shrink-0 text-muted-foreground transition-transform group-data-[state=open]/files:rotate-90`}),t[107]=Qe):Qe=t[107];let $e;t[108]===Ze?$e=t[109]:($e=(0,Z.jsxs)(dn,{"data-sidebar-root-context":!0,className:`flex min-w-0 flex-1 items-center gap-1.5`,children:[Xe,Ze,Qe]}),t[108]=Ze,t[109]=$e);let et;t[110]===r?et=t[111]:(et=r({id:`eaHUxx`}),t[110]=r,t[111]=et);let tt;t[112]===Symbol.for(`react.memo_cache_sentinel`)?(tt=Y(_&&`*:[-webkit-app-region:no-drag]`),t[112]=tt):tt=t[112];let nt;t[113]===r?nt=t[114]:(nt=r({id:`Rq1vFD`}),t[113]=r,t[114]=nt);let rt;t[115]===nt?rt=t[116]:(rt=(0,Z.jsx)(q1,{icon:Xh,label:nt}),t[115]=nt,t[116]=rt);let it;t[117]!==ae||t[118]!==i?(it=ae?(0,Z.jsxs)(wr,{onSelect:()=>i?.expandAll(),children:[(0,Z.jsx)(Ng,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`OlAl5i`})]}):null,t[117]=ae,t[118]=i,t[119]=it):it=t[119];let at;t[120]!==oe||t[121]!==i?(at=oe?(0,Z.jsxs)(wr,{onSelect:()=>i?.collapseAll(),children:[(0,Z.jsx)(zh,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`qvWGzP`})]}):null,t[120]=oe,t[121]=i,t[122]=at):at=t[122];let ot;t[123]===se?ot=t[124]:(ot=se?(0,Z.jsx)(Fr,{}):null,t[123]=se,t[124]=ot);let st;t[125]===r?st=t[126]:(st=r({id:`8vETh9`}),t[125]=r,t[126]=st);let ct;t[127]===Symbol.for(`react.memo_cache_sentinel`)?(ct=(0,Z.jsx)(Ar,{children:(0,Z.jsx)(J,{id:`8vETh9`})}),t[127]=ct):ct=t[127];let lt;t[128]===Te?lt=t[129]:(lt=e=>Te({showHiddenFiles:e}),t[128]=Te,t[129]=lt);let ut=ee===null,dt;t[130]===Symbol.for(`react.memo_cache_sentinel`)?(dt=(0,Z.jsx)(J,{id:`6KCH4m`}),t[130]=dt):dt=t[130];let ft;t[131]!==ne||t[132]!==lt||t[133]!==ut?(ft=(0,Z.jsx)(kr,{checked:ne,onCheckedChange:lt,disabled:ut,"data-testid":`tree-options-show-hidden-files`,children:dt}),t[131]=ne,t[132]=lt,t[133]=ut,t[134]=ft):ft=t[134];let pt;t[135]===Te?pt=t[136]:(pt=e=>Te({showOkFolders:e}),t[135]=Te,t[136]=pt);let mt=ee===null,ht;t[137]===Symbol.for(`react.memo_cache_sentinel`)?(ht=(0,Z.jsx)(J,{id:`ELYtNJ`}),t[137]=ht):ht=t[137];let _t;t[138]!==q||t[139]!==pt||t[140]!==mt?(_t=(0,Z.jsx)(kr,{checked:q,onCheckedChange:pt,disabled:mt,"data-testid":`tree-options-show-ok-folders`,children:ht}),t[138]=q,t[139]=pt,t[140]=mt,t[141]=_t):_t=t[141];let vt;t[142]===Te?vt=t[143]:(vt=e=>Te({showOnlyMarkdownFiles:e}),t[142]=Te,t[143]=vt);let yt=ee===null,bt;t[144]===Symbol.for(`react.memo_cache_sentinel`)?(bt=(0,Z.jsx)(J,{id:`5-o4kO`}),t[144]=bt):bt=t[144];let xt;t[145]!==re||t[146]!==vt||t[147]!==yt?(xt=(0,Z.jsx)(kr,{checked:re,onCheckedChange:vt,disabled:yt,"data-testid":`tree-options-show-only-markdown-files`,children:bt}),t[145]=re,t[146]=vt,t[147]=yt,t[148]=xt):xt=t[148];let St;t[149]===Te?St=t[150]:(St=e=>Te({showSkillsSection:e}),t[149]=Te,t[150]=St);let Ct=ee===null,wt;t[151]===Symbol.for(`react.memo_cache_sentinel`)?(wt=(0,Z.jsx)(J,{id:`PCSkw2`}),t[151]=wt):wt=t[151];let Tt;t[152]!==ie||t[153]!==St||t[154]!==Ct?(Tt=(0,Z.jsx)(kr,{checked:ie,onCheckedChange:St,disabled:Ct,"data-testid":`tree-options-show-skills`,children:wt}),t[152]=ie,t[153]=St,t[154]=Ct,t[155]=Tt):Tt=t[155];let Et;t[156]!==st||t[157]!==ft||t[158]!==_t||t[159]!==xt||t[160]!==Tt?(Et=(0,Z.jsxs)(Dr,{"aria-label":st,children:[ct,ft,_t,xt,Tt]}),t[156]=st,t[157]=ft,t[158]=_t,t[159]=xt,t[160]=Tt,t[161]=Et):Et=t[161];let Dt;t[162]!==it||t[163]!==at||t[164]!==ot||t[165]!==Et?(Dt=(0,Z.jsxs)(Mr,{align:`end`,className:`min-w-52`,"data-testid":`tree-options-menu`,children:[it,at,ot,Et]}),t[162]=it,t[163]=at,t[164]=ot,t[165]=Et,t[166]=Dt):Dt=t[166];let Ot;t[167]!==rt||t[168]!==Dt?(Ot=(0,Z.jsxs)(Pr,{children:[rt,Dt]}),t[167]=rt,t[168]=Dt,t[169]=Ot):Ot=t[169];let kt;t[170]===r?kt=t[171]:(kt=r({id:`HdkSiO`}),t[170]=r,t[171]=kt);let At;t[172]!==g||t[173]!==i?(At=()=>i?.startCreating(`file`,g),t[172]=g,t[173]=i,t[174]=At):At=t[174];let jt;t[175]!==kt||t[176]!==At?(jt=(0,Z.jsx)(K1,{icon:oc,label:kt,onClick:At,shortcutId:`new-item`}),t[175]=kt,t[176]=At,t[177]=jt):jt=t[177];let Mt;t[178]!==r||t[179]!==I||t[180]!==g||t[181]!==i?(Mt=I?(0,Z.jsxs)(Pr,{children:[(0,Z.jsx)(q1,{icon:Ps,label:r({id:`Uuj_R4`})}),(0,Z.jsx)(Mr,{align:`end`,className:`min-w-52`,onCloseAutoFocus:ue,children:(0,Z.jsx)(HZ,{parentDir:g,onSelectTemplate:e=>{ce.current=!0,i?.createFromTemplate(g,e)},ItemComponent:wr})})]}):null,t[178]=r,t[179]=I,t[180]=g,t[181]=i,t[182]=Mt):Mt=t[182];let Nt;t[183]===r?Nt=t[184]:(Nt=r({id:`96G6Re`}),t[183]=r,t[184]=Nt);let Pt;t[185]!==g||t[186]!==i?(Pt=()=>i?.startCreating(`folder`,g),t[185]=g,t[186]=i,t[187]=Pt):Pt=t[187];let Ft;t[188]!==Nt||t[189]!==Pt?(Ft=(0,Z.jsx)(K1,{icon:Vh,label:Nt,onClick:Pt,shortcutId:_?`new-folder`:void 0}),t[188]=Nt,t[189]=Pt,t[190]=Ft):Ft=t[190];let It;t[191]!==et||t[192]!==Ot||t[193]!==jt||t[194]!==Mt||t[195]!==Ft?(It=(0,Z.jsxs)(df,{"aria-label":et,"data-testid":`sidebar-toolbar`,className:tt,children:[Ot,jt,Mt,Ft]}),t[191]=et,t[192]=Ot,t[193]=jt,t[194]=Mt,t[195]=Ft,t[196]=It):It=t[196];let Lt;t[197]!==$e||t[198]!==It?(Lt=(0,Z.jsxs)(SP,{className:`shrink-0 gap-1`,children:[$e,It]}),t[197]=$e,t[198]=It,t[199]=Lt):Lt=t[199];let Rt=o==null?`50vh`:`${o}px`,zt;t[200]===Rt?zt=t[201]:(zt={height:Rt},t[200]=Rt,t[201]=zt);let Bt;t[202]===Symbol.for(`react.memo_cache_sentinel`)?(Bt=(0,Z.jsx)(WQ,{ref:a,onContentHeightChange:s}),t[202]=Bt):Bt=t[202];let Vt;t[203]===zt?Vt=t[204]:(Vt=(0,Z.jsx)(un,{className:`flex max-h-[70vh] flex-col overflow-hidden`,style:zt,children:Bt}),t[203]=zt,t[204]=Vt);let Ht;t[205]!==Lt||t[206]!==Vt?(Ht=(0,Z.jsx)(fn,{defaultOpen:!0,className:`group/files flex shrink-0 flex-col`,children:(0,Z.jsxs)(xP,{className:`min-h-0 px-0`,children:[Lt,Vt]})}),t[205]=Lt,t[206]=Vt,t[207]=Ht):Ht=t[207];let Wt;t[208]===ie?Wt=t[209]:(Wt=ie?(0,Z.jsx)(b1,{}):null,t[208]=ie,t[209]=Wt);let Gt;t[210]===i?Gt=t[211]:(Gt=(0,Z.jsx)(`div`,{"aria-hidden":!0,"data-sidebar-empty-deselect":!0,className:`min-h-8 flex-1 cursor-default`,onClick:()=>i?.clearCreationTarget()}),t[210]=i,t[211]=Gt);let Kt;t[212]!==Ht||t[213]!==Wt||t[214]!==Gt?(Kt=(0,Z.jsxs)(bP,{children:[Je,Ht,Wt,Gt]}),t[212]=Ht,t[213]=Wt,t[214]=Gt,t[215]=Kt):Kt=t[215];let qt;t[216]===Symbol.for(`react.memo_cache_sentinel`)?(qt=(0,Z.jsxs)(yP,{className:`px-0`,children:[(0,Z.jsx)(V$,{}),(0,Z.jsx)(I1,{}),(0,Z.jsx)(Kz,{}),typeof window<`u`&&window.okDesktop?(0,Z.jsx)(TP,{children:(0,Z.jsx)(EP,{children:(0,Z.jsx)(l1,{bridge:window.okDesktop})})}):null]}),t[216]=qt):qt=t[216];let Jt=!(b&&v===`collapsed`),Xt;t[217]===Jt?Xt=t[218]:(Xt=(0,Z.jsx)(gP,{enableToggle:!1,enableDrag:Jt}),t[217]=Jt,t[218]=Xt);let Zt;t[219]!==Be||t[220]!==qe||t[221]!==Kt||t[222]!==Xt?(Zt=(0,Z.jsx)(ey,{asChild:!0,children:(0,Z.jsxs)(`div`,{className:`contents`,onContextMenu:de,children:[Be,qe,Kt,qt,Xt]})}),t[219]=Be,t[220]=qe,t[221]=Kt,t[222]=Xt,t[223]=Zt):Zt=t[223];let Qt=!R,$t,X;t[224]===Symbol.for(`react.memo_cache_sentinel`)?($t=(0,Z.jsx)(oc,{"aria-hidden":`true`}),X=(0,Z.jsx)(J,{id:`HdkSiO`}),t[224]=$t,t[225]=X):($t=t[224],X=t[225]);let en;t[226]!==pe||t[227]!==Qt?(en=(0,Z.jsxs)(iy,{disabled:Qt,onSelect:pe,"data-testid":`empty-space-menu-new-file`,children:[$t,X]}),t[226]=pe,t[227]=Qt,t[228]=en):en=t[228];let tn;t[229]!==he||t[230]!==F||t[231]!==R?(tn=F?(0,Z.jsxs)(ny,{children:[(0,Z.jsxs)(ay,{disabled:!R,"data-testid":`empty-space-menu-new-from-template`,children:[(0,Z.jsx)(Ps,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`Uuj_R4`})]}),(0,Z.jsx)(oy,{children:(0,Z.jsx)(HZ,{parentDir:``,onSelectTemplate:he,ItemComponent:iy})})]}):null,t[229]=he,t[230]=F,t[231]=R,t[232]=tn):tn=t[232];let nn=!R,rn,an;t[233]===Symbol.for(`react.memo_cache_sentinel`)?(rn=(0,Z.jsx)(Vh,{"aria-hidden":`true`}),an=(0,Z.jsx)(J,{id:`96G6Re`}),t[233]=rn,t[234]=an):(rn=t[233],an=t[234]);let on;t[235]!==_e||t[236]!==nn?(on=(0,Z.jsxs)(iy,{disabled:nn,onSelect:_e,"data-testid":`empty-space-menu-new-folder`,children:[rn,an]}),t[235]=_e,t[236]=nn,t[237]=on):on=t[237];let sn;t[238]===Symbol.for(`react.memo_cache_sentinel`)?(sn=(0,Z.jsx)(ly,{}),t[238]=sn):sn=t[238];let cn;t[239]!==r||t[240]!==ye||t[241]!==R?(cn=L?(0,Z.jsxs)(iy,{disabled:!R,onSelect:ye,"data-testid":`empty-space-menu-reveal-in-finder`,"aria-label":r(R?{id:`LtSYdi`}:{id:`o2yoFu`}),children:[(0,Z.jsx)(hc,{"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(J,{id:`LtSYdi`})}),R?null:(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:(0,Z.jsx)(J,{id:`wTcjov`})})]}):null,t[239]=r,t[240]=ye,t[241]=R,t[242]=cn):cn=t[242];let ln;t[243]!==W||t[244]!==K||t[245]!==U?(ln=(0,Z.jsx)(k$,{input:K,installStates:U,dispatch:W}),t[243]=W,t[244]=K,t[245]=U,t[246]=ln):ln=t[246];let pn;t[247]!==Ce||t[248]!==B?(pn=B?(0,Z.jsxs)(iy,{onSelect:Ce,"data-testid":`empty-space-menu-share`,children:[(0,Z.jsx)(mg,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`Z8lGw6`})]}):null,t[247]=Ce,t[248]=B,t[249]=pn):pn=t[249];let mn=!R,hn;t[250]!==r||t[251]!==R?(hn=r(R?{id:`Up2_7p`}:{id:`U8CD-l`}),t[250]=r,t[251]=R,t[252]=hn):hn=t[252];let gn;t[253]===Symbol.for(`react.memo_cache_sentinel`)?(gn=(0,Z.jsx)(ic,{"aria-hidden":`true`}),t[253]=gn):gn=t[253];let _n;t[254]===Symbol.for(`react.memo_cache_sentinel`)?(_n=(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(J,{id:`Up2_7p`})}),t[254]=_n):_n=t[254];let vn;t[255]===R?vn=t[256]:(vn=R?null:(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:(0,Z.jsx)(J,{id:`wTcjov`})}),t[255]=R,t[256]=vn);let yn;t[257]!==xe||t[258]!==mn||t[259]!==hn||t[260]!==vn?(yn=(0,Z.jsxs)(iy,{disabled:mn,onSelect:xe,"data-testid":`empty-space-menu-copy-full-path`,"aria-label":hn,children:[gn,_n,vn]}),t[257]=xe,t[258]=mn,t[259]=hn,t[260]=vn,t[261]=yn):yn=t[261];let bn;t[262]===Symbol.for(`react.memo_cache_sentinel`)?(bn=(0,Z.jsx)(ly,{}),t[262]=bn):bn=t[262];let xn;t[263]===Te?xn=t[264]:(xn=e=>Te({showHiddenFiles:e}),t[263]=Te,t[264]=xn);let Sn=ee===null,Cn;t[265]===Symbol.for(`react.memo_cache_sentinel`)?(Cn=(0,Z.jsx)(J,{id:`XcGbim`}),t[265]=Cn):Cn=t[265];let wn;t[266]!==ne||t[267]!==xn||t[268]!==Sn?(wn=(0,Z.jsx)(sy,{checked:ne,onCheckedChange:xn,disabled:Sn,"data-testid":`empty-space-menu-show-hidden-files`,children:Cn}),t[266]=ne,t[267]=xn,t[268]=Sn,t[269]=wn):wn=t[269];let Tn;t[270]===Te?Tn=t[271]:(Tn=e=>Te({showOkFolders:e}),t[270]=Te,t[271]=Tn);let En=ee===null,Dn;t[272]===Symbol.for(`react.memo_cache_sentinel`)?(Dn=(0,Z.jsx)(J,{id:`GHsJb8`}),t[272]=Dn):Dn=t[272];let On;t[273]!==q||t[274]!==Tn||t[275]!==En?(On=(0,Z.jsx)(sy,{checked:q,onCheckedChange:Tn,disabled:En,"data-testid":`empty-space-menu-show-ok-folders`,children:Dn}),t[273]=q,t[274]=Tn,t[275]=En,t[276]=On):On=t[276];let kn;t[277]===Te?kn=t[278]:(kn=e=>Te({showOnlyMarkdownFiles:e}),t[277]=Te,t[278]=kn);let An=ee===null,jn;t[279]===Symbol.for(`react.memo_cache_sentinel`)?(jn=(0,Z.jsx)(J,{id:`WkTLN7`}),t[279]=jn):jn=t[279];let Mn;t[280]!==re||t[281]!==kn||t[282]!==An?(Mn=(0,Z.jsx)(sy,{checked:re,onCheckedChange:kn,disabled:An,"data-testid":`empty-space-menu-show-only-markdown-files`,children:jn}),t[280]=re,t[281]=kn,t[282]=An,t[283]=Mn):Mn=t[283];let Nn;t[284]===Te?Nn=t[285]:(Nn=e=>Te({showSkillsSection:e}),t[284]=Te,t[285]=Nn);let Pn=ee===null,Fn;t[286]===Symbol.for(`react.memo_cache_sentinel`)?(Fn=(0,Z.jsx)(J,{id:`NF_Wcg`}),t[286]=Fn):Fn=t[286];let In;t[287]!==ie||t[288]!==Nn||t[289]!==Pn?(In=(0,Z.jsx)(sy,{checked:ie,onCheckedChange:Nn,disabled:Pn,"data-testid":`empty-space-menu-show-skills-section`,children:Fn}),t[287]=ie,t[288]=Nn,t[289]=Pn,t[290]=In):In=t[290];let Ln;t[291]===se?Ln=t[292]:(Ln=se?(0,Z.jsx)(ly,{}):null,t[291]=se,t[292]=Ln);let Rn;t[293]!==De||t[294]!==ae?(Rn=ae?(0,Z.jsxs)(iy,{onSelect:De,"data-testid":`empty-space-menu-expand-all`,children:[(0,Z.jsx)(Ng,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`OlAl5i`})]}):null,t[293]=De,t[294]=ae,t[295]=Rn):Rn=t[295];let zn;t[296]!==ke||t[297]!==oe?(zn=oe?(0,Z.jsxs)(iy,{onSelect:ke,"data-testid":`empty-space-menu-collapse-all`,children:[(0,Z.jsx)(zh,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`qvWGzP`})]}):null,t[296]=ke,t[297]=oe,t[298]=zn):zn=t[298];let Bn;t[299]!==cn||t[300]!==ln||t[301]!==pn||t[302]!==yn||t[303]!==wn||t[304]!==On||t[305]!==Mn||t[306]!==In||t[307]!==Ln||t[308]!==Rn||t[309]!==zn||t[310]!==en||t[311]!==tn||t[312]!==on?(Bn=(0,Z.jsxs)(ry,{className:`min-w-52`,onCloseAutoFocus:ue,children:[en,tn,on,sn,cn,ln,pn,yn,bn,wn,On,Mn,In,Ln,Rn,zn]}),t[299]=cn,t[300]=ln,t[301]=pn,t[302]=yn,t[303]=wn,t[304]=On,t[305]=Mn,t[306]=In,t[307]=Ln,t[308]=Rn,t[309]=zn,t[310]=en,t[311]=tn,t[312]=on,t[313]=Bn):Bn=t[313];let Vn;return t[314]!==Bn||t[315]!==Zt?(Vn=(0,Z.jsx)(mP,{variant:`inset`,children:(0,Z.jsxs)($v,{children:[Zt,Bn]})}),t[314]=Bn,t[315]=Zt,t[316]=Vn):Vn=t[316],Vn}function Y1(){return null}function X1(e){return console.log(e)}function Z1(e){return gl.error(e)}function Q1(e){return gl.success(e)}function $1(e){e.target instanceof Element&&e.target.closest(`[data-sidebar-root-context]`)||H1(e.target)&&(e.preventDefault(),e.stopPropagation())}var e0=(0,Q.lazy)(()=>n(()=>import(`./McpConsentDialogBody-g1cYKWmV.js`),__vite__mapDeps([168,1,6,2,3,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,114,29,30,31,59,96,99,43,169]),import.meta.url));function t0(){let e=(0,$.c)(1);if(!(0,Q.useSyncExternalStore)(yp.subscribe,r0,n0))return null;let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(e0,{})}),e[0]=t):t=e[0],t}function n0(){return!1}function r0(){return yp.getSnapshot()!==null}function i0(){let e=(0,$.c)(4),[t,n]=(0,Q.useState)(!1),r,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>Ut(e=>{e===`report-bug`&&n(!0)}),i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,Q.useEffect)(r,i);let a;return e[2]===t?a=e[3]:(a=(0,Z.jsx)(lm,{open:t,onOpenChange:n}),e[2]=t,e[3]=a),a}function a0(){let e=(0,$.c)(17),t=jt(),{collabUrl:n,setSystemProvider:r,updateServerInstanceId:i,onBranchSwitched:a,observeBranch:o,observeDiskAck:s,refreshServerInfo:c}=Ye(),l;e[0]!==o||e[1]!==s||e[2]!==a||e[3]!==c||e[4]!==i?(l={updateServerInstanceId:i,onBranchSwitched:a,observeBranch:o,observeDiskAck:s,refreshServerInfo:c},e[0]=o,e[1]=s,e[2]=a,e[3]=c,e[4]=i,e[5]=l):l=e[5];let u=(0,Q.useRef)(l),d;e[6]!==o||e[7]!==s||e[8]!==a||e[9]!==c||e[10]!==i?(d=()=>{u.current={updateServerInstanceId:i,onBranchSwitched:a,observeBranch:o,observeDiskAck:s,refreshServerInfo:c}},e[6]=o,e[7]=s,e[8]=a,e[9]=c,e[10]=i,e[11]=d):d=e[11],(0,Q.useEffect)(d);let f,p;return e[12]!==n||e[13]!==t||e[14]!==r?(f=()=>{if(n===null)return;let e=new Du,i=new Ou({url:n,name:mi,document:e,onStateless:e=>{let{payload:t}=e;Mu(t,{onServerInfo:e=>{u.current.updateServerInstanceId(e.serverInstanceId),e.currentBranch!==void 0&&u.current.observeBranch(e.currentBranch)},onBranchSwitched:e=>{u.current.onBranchSwitched(e.branch)},onDiskAck:e=>{u.current.observeDiskAck(e.docName,e.sv),ru(e.docName)},onDerivedView:d0,onConfigValidationRejected:u0,onConfigIgnoreNestedError:l0,onUnknown:c0})},onClose:s0,onDisconnect:o0}),a=eu(e=>{(e.includes(`files`)||e.includes(`backlinks`))&&(t.invalidateQueries({queryKey:[`backlinks`]}),t.invalidateQueries({queryKey:[`forward-links`]})),(e.includes(`files`)||e.includes(`graph`))&&(t.invalidateQueries({queryKey:[`orphans`]}),t.invalidateQueries({queryKey:[`hubs`]})),e.includes(`lint-config`)&&Qd()}),o=W(()=>{u.current.refreshServerInfo()});i.on(`synced`,()=>{au([`files`,`backlinks`,`graph`]),o()});let s=new Set,c=()=>{if(i.awareness)for(let[e,t]of i.awareness.getStates().entries())s.has(e)||t.user?.type===`agent`&&(s.add(e),console.warn(`[agent-presence] observed stale AwarenessUser.type === 'agent' from clientID ${e} — probably a stale bundled client`))};return i.awareness?.on(`change`,c),r(i),()=>{a(),i.awareness?.off(`change`,c),r(null),i.destroy(),e.destroy()}},p=[t,n,r],e[12]=n,e[13]=t,e[14]=r,e[15]=f,e[16]=p):(f=e[15],p=e[16]),(0,Q.useEffect)(f,p),null}function o0(){console.warn(`[CC1] __system__ disconnected - derived views may be stale`)}function s0(e){let{event:t}=e;console.warn(`[CC1] __system__ connection closed:`,t.code,t.reason)}function c0(e){console.warn(`[CC1] Unparseable stateless payload, skipping:`,e.slice(0,100))}function l0(e){Is(e)}function u0(e){Hs(e)}function d0(e){au([e.ch])}var f0=500;function p0(e){return!e.startsWith(`__`)&&!/\.(mmd|mermaid)$/i.test(e)}function m0(){let e=(0,$.c)(3),{merged:t}=od(),n=t?.validation?.fileTreeIndicators!==!1,r,i;return e[0]===n?(r=e[1],i=e[2]):(r=()=>{if(!n)return;let e=new Map,t=!1,r=e=>{kd({kind:`doc`,docName:e}).then(n=>{t||n===null||Cd(e,n.files.filter(t=>fu(t.file)===e).flatMap(h0))})},i=ou(t=>{if(!p0(t))return;let n=e.get(t);n!==void 0&&clearTimeout(n),e.set(t,setTimeout(()=>{e.delete(t),r(t)},f0))});return()=>{t=!0,i();for(let t of e.values())clearTimeout(t);e.clear()}},i=[n],e[0]=n,e[1]=r,e[2]=i),(0,Q.useEffect)(r,i),null}function h0(e){return e.diagnostics}function g0(e){let t=null,n=()=>{let n=e.hasAnyUnsyncedWork();n!==t&&(t=n,e.report({hasPendingWork:n,enabled:e.enabled}))};return n(),e.addUnsyncedWorkListener(n)}function _0(){let e=(0,$.c)(4),{collabUrl:t}=Ye(),{projectConfig:n}=od(),r=n?.bridge?.backgroundThrottle?.enabled??!0,i,a;return e[0]!==t||e[1]!==r?(i=()=>{if(t===null)return;let e=window.okDesktop?.editor?.notifyBackgroundThrottle;if(typeof e!=`function`)return;let n=ze(t);return g0({enabled:r,hasAnyUnsyncedWork:()=>n.hasAnyUnsyncedWork(),addUnsyncedWorkListener:e=>n.addUnsyncedWorkListener(e),report:t=>e(t)})},a=[t,r],e[0]=t,e[1]=r,e[2]=i,e[3]=a):(i=e[2],a=e[3]),(0,Q.useEffect)(i,a),null}function v0(e){let t=e.win??(typeof window<`u`?window:void 0),n=e.doc??(typeof document<`u`?document:void 0);if(t===void 0||n===void 0)return()=>{};let r=!1,i=()=>{r||(r=!0,e.onHide())},a=()=>i(),o=()=>{n.visibilityState===`hidden`?i():n.visibilityState===`visible`&&(r=!1,e.onVisible())};return t.addEventListener(`pagehide`,a),n.addEventListener(`visibilitychange`,o),()=>{t.removeEventListener(`pagehide`,a),n.removeEventListener(`visibilitychange`,o)}}function y0(){let e=(0,$.c)(4),{collabUrl:t}=Ye(),{projectConfig:n}=od(),r=n?.bridge?.flushOnHide?.enabled??!0,i,a;return e[0]!==t||e[1]!==r?(i=()=>{if(t===null)return;let e=ze(t);return e.setFlushOnHideEnabled(r),v0({onHide:()=>e.flushOnHide(),onVisible:()=>e.resyncOnVisible()})},a=[t,r],e[0]=t,e[1]=r,e[2]=i,e[3]=a):(i=e[2],a=e[3]),(0,Q.useEffect)(i,a),null}function b0(e){let t=be(e);if(t)return{scope:`project`,name:t};let n=fo(e);return n?.kind===`skill`?{scope:n.scope,name:n.name}:null}function x0(e,t){let n=new Set(t.map(e=>`${e.scope}\u0000${e.name}`)),r=[];for(let t of e){let e=b0(t);if(!e||n.has(`${e.scope}\u0000${e.name}`))continue;let i=e.scope===`project`?`global`:`project`;n.has(`${i}\u0000${e.name}`)?r.push({kind:`retarget`,fromDocName:t,toDocName:Ya(i,e.name)}):r.push({kind:`close`,docName:t})}return r}function S0(){let e=(0,$.c)(13),{openTabs:t,closeDocument:n}=Ye(),r;e[0]===t?r=e[1]:(r=t.some(w0),e[0]=t,e[1]=r);let i=r,a;e[2]===i?a=e[3]:(a={enabled:i},e[2]=i,e[3]=a);let o=is(a),s=(0,Q.useRef)(null),c;e[4]!==n||e[5]!==t||e[6]!==o.data||e[7]!==o.status?(c=()=>{if(o.status!==`ready`)return;let e=o.data,r=`${t.join(``)}\u0002${e.map(C0).sort().join(``)}`;if(s.current===r)return;s.current=r;let i=x0(t,e);for(let e of i)e.kind===`retarget`?(vc(e.toDocName),n(e.fromDocName)):n(e.docName)},e[4]=n,e[5]=t,e[6]=o.data,e[7]=o.status,e[8]=c):c=e[8];let l;e[9]!==n||e[10]!==t||e[11]!==o?(l=[o,t,n],e[9]=n,e[10]=t,e[11]=o,e[12]=l):l=e[12],(0,Q.useEffect)(c,l)}function C0(e){return`${e.scope}\u0000${e.name}`}function w0(e){return b0(e)!==null}var T0=1e3,E0=3e4;function D0(e){let t=e.scheduler??{setTimeout:(e,t)=>globalThis.setTimeout(e,t),clearTimeout:e=>globalThis.clearTimeout(e)},n=e.initialBackoffMs??T0,r=e.maxBackoffMs??E0,i=e.rng??Math.random,a=e.createWebSocket??(e=>new WebSocket(e)),o=e.logger??null,s=e.log,c=null,l=null,u=!1,d=n;function f(e,t,n){try{o?o[e](t,n):s?.(t)}catch{}}function p(){if(u)return;l!==null&&t.clearTimeout(l);let e=d;d=Math.min(d*2,r);let n=i(),a=Math.max(1,Math.floor(e*(1-n/2)));f(`debug`,`scheduling reconnect`,{backoffMs:a,ceilMs:e}),l=t.setTimeout(()=>{l=null,m().catch(e=>f(`warn`,`reconnect failed`,{error:String(e)}))},a)}async function m(){if(u)return;let t;try{t=await e.resolveWsUrl()}catch(e){f(`warn`,`resolveWsUrl threw`,{error:String(e)}),p();return}if(!t){p();return}let r=[];e.pid!==void 0&&r.push(`pid=${encodeURIComponent(String(e.pid))}`),e.connectionId&&r.push(`connectionId=${encodeURIComponent(e.connectionId)}`),e.connectionId&&e.displayName!==void 0&&e.clientName!==void 0&&e.colorSeed!==void 0&&(r.push(`displayName=${encodeURIComponent(e.displayName)}`),r.push(`clientName=${encodeURIComponent(e.clientName)}`),r.push(`colorSeed=${encodeURIComponent(e.colorSeed)}`));let i=r.length>0?`?${r.join(`&`)}`:``,o=`${t}/collab/keepalive${i}`;try{c=a(o)}catch(e){f(`warn`,`WebSocket constructor failed`,{url:o,error:String(e)}),c=null,p();return}c.addEventListener(`open`,()=>{f(`info`,`connected`,{url:t}),d=n}),c.addEventListener(`close`,()=>{u||(f(`info`,`disconnected`,{url:t}),c=null,p())}),c.addEventListener(`error`,()=>{f(`debug`,`websocket error observed`,{url:t,readyState:c?.readyState,reason:`error-event`})})}return queueMicrotask(()=>{m().catch(e=>f(`warn`,`initial connect failed`,{error:String(e)}))}),{close:()=>{if(!u&&(u=!0,l!==null&&(t.clearTimeout(l),l=null),c)){try{c.close()}catch{}c=null}},isConnected:()=>c!==null&&c.readyState===1}}function O0(e){if(e)return e.replace(/\/collab\/?$/,``)}function k0(){return Nu(window)!==null}function A0(e,t){let n=(0,$.c)(5),r=(0,Q.useRef)(e),i=(0,Q.useRef)(t),a,o;n[0]===e?(a=n[1],o=n[2]):(a=()=>{r.current=e},o=[e],n[0]=e,n[1]=a,n[2]=o),(0,Q.useEffect)(a,o);let s,c;n[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{let e=i.current?.startKeepalive??D0;if((i.current?.isElectronHost??k0)())return;let t=e({resolveWsUrl:async()=>O0(r.current)});return()=>t.close()},c=[],n[3]=s,n[4]=c):(s=n[3],c=n[4]),(0,Q.useEffect)(s,c)}var j0=(0,Q.lazy)(()=>n(()=>import(`./ShareBranchSwitchDialog-Dfc-qPui.js`).then(e=>({default:e.ShareBranchSwitchDialog})),__vite__mapDeps([170,1,10,11,12,23,14,15,16,17,24,25,26,22,27,91,33,171,99,172,173,174,6,2,3,7,8,9,175]),import.meta.url)),M0=(0,Q.lazy)(()=>n(()=>import(`./ShareReceiveMissDialog-RIU6HaEy.js`).then(e=>({default:e.ShareReceiveMissDialog})),__vite__mapDeps([176,1,23,10,11,12,14,15,16,17,24,25,26,22,27,177,117,6,2,3,7,8,9,84,68,85,86,87,94,99,64,59,20,37,96,33,171,120,40,43,63]),import.meta.url)),N0=`#install-claude-desktop`,P0=/\.(md|mdx)$/i;function F0(e){return kl(e)||e===N0}function I0(e,t){if(!P0.test(e))return null;for(let n of t){let t=re(n);if(t.kind===`doc`&&t.docName===e)return{kind:`doc`,target:e,docName:e}}return null}function L0(e,t,n,r){return[e,t,n,r].map(e=>[...e].sort().join(`\0`)).join(``)}function R0(){let e=(0,$.c)(27),{clearTarget:t,openTabs:n,syncOpenTabsWithKnownTargets:r,tabSessionLoaded:i}=Ye(),{openTargetTransition:a}=Oe();S0();let{assetPaths:o,filePaths:s,folderPaths:c,loading:l,pageMeta:u,pages:d,pagesBySlug:f,pagesByBasename:p}=Go(),m=(0,Q.useRef)(null),h=(0,Q.useRef)(null),g;e[0]!==o||e[1]!==s||e[2]!==c||e[3]!==d?(g=L0(d,c,o,s),e[0]=o,e[1]=s,e[2]=c,e[3]=d,e[4]=g):g=e[4];let _=g,v;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(v=[],e[5]=v):v=e[5],(0,Q.useEffect)(z0,v);let y,b;e[6]!==o||e[7]!==s||e[8]!==c||e[9]!==l||e[10]!==d||e[11]!==r||e[12]!==i||e[13]!==_?(y=()=>{l||!i||m.current===_||(m.current=_,r({pages:d,folderPaths:c,assetPaths:o,filePaths:s}))},b=[o,s,c,l,d,r,i,_],e[6]=o,e[7]=s,e[8]=c,e[9]=l,e[10]=d,e[11]=r,e[12]=i,e[13]=_,e[14]=y,e[15]=b):(y=e[14],b=e[15]),(0,Q.useEffect)(y,b);let x,S;return e[16]!==t||e[17]!==c||e[18]!==l||e[19]!==n||e[20]!==a||e[21]!==u||e[22]!==d||e[23]!==p||e[24]!==f?(x=()=>{r();let e=function(e){h.current=mu(e.state)?window.location.href:null};function r(){let e=h.current===window.location.href;h.current=null,hu();let r=t=>{if(e){a(t,{tabBehavior:`replace-active`});return}a(t)};if(F0(window.location.hash))return;let i=yu(window.location.hash);if(i){let e=Ni(i.split(`.`).pop()??``);lu(`ok/nav/hash-change`,{docName:null,kind:`asset`}),r({kind:`asset`,target:i,assetPath:i,mediaKind:e});return}let o=gu(window.location.hash);if(o){lu(`ok/nav/hash-change`,{docName:null,kind:`skill-file`}),r({kind:`skill-file`,target:`${o.scope}/${o.name}/${o.path}`,scope:o.scope,name:o.name,path:o.path});return}if(Tu(window.location.hash)){lu(`ok/nav/hash-change`,{docName:null,kind:`folder`}),r({kind:`folder`,target:``,folderPath:``});return}let s=Su(window.location.hash);if(!s){lu(`ok/nav/hash-change`,{docName:null,kind:`clear`}),t();return}if(l){lu(`ok/nav/hash-change`,{docName:s,kind:`deferred-loading`});return}let m=I0(s,n)??Zl(s,{pages:d,folderPaths:c,pagesBySlug:f,pagesByBasename:p});if(m.kind===`missing`&&/\/+$/.test(s.trim())){lu(`ok/nav/hash-change`,{docName:s,kind:`deferred-missing-folder`});return}let g=$l(Ql(m),u);lu(`ok/nav/hash-change`,{docName:s,kind:g.kind}),r(g)}return window.addEventListener(`popstate`,e),window.addEventListener(`hashchange`,r),()=>{window.removeEventListener(`popstate`,e),window.removeEventListener(`hashchange`,r)}},S=[t,c,l,a,n,u,d,f,p],e[16]=t,e[17]=c,e[18]=l,e[19]=n,e[20]=a,e[21]=u,e[22]=d,e[23]=p,e[24]=f,e[25]=x,e[26]=S):(x=e[25],S=e[26]),(0,Q.useEffect)(x,S),null}function z0(){return Ut(B0)}function B0(e){e===`navigate-back`&&window.history.back(),e===`navigate-forward`&&window.history.forward()}function V0(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0],(0,Q.useEffect)(H0,t),null}function H0(){let e=function(e){let t=e.target;Ml({target:t,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,key:e.key})&&(e.preventDefault(),window.location.hash!==`#settings`&&(window.location.hash=Nl))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)}function U0(){let e=(0,$.c)(4),{activeTarget:t}=Ye(),n=typeof window<`u`?window.okDesktop??null:null,r=t?.kind===`doc`||t?.kind===`folder`||t?.kind===`asset`?t.kind:null,i=t?.kind===`doc`?t.docName:t?.kind===`folder`?t.folderPath:t?.kind===`asset`?t.assetPath:null,a,o;return e[0]!==i||e[1]!==r?(a=()=>{if(n){if(r===null){n.editor.notifyActiveTargetChanged({kind:null});return}i!==null&&n.editor.notifyActiveTargetChanged({kind:r,identifier:i})}},o=[n,r,i],e[0]=i,e[1]=r,e[2]=a,e[3]=o):(a=e[2],o=e[3]),(0,Q.useEffect)(a,o),null}function W0(){let e=(0,$.c)(8),{activeDocName:t,activeTarget:n}=Ye(),[r,i]=(0,Q.useState)(!1),a;e[0]!==t||e[1]!==n?(a=n?.kind===`folder`?n.folderPath:Hl(t),e[0]=t,e[1]=n,e[2]=a):a=e[2];let o=a,s,c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{let e=function(e){let t=e.target;rv({target:t,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,key:e.key})&&(e.preventDefault(),i(!0))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},c=[],e[3]=s,e[4]=c):(s=e[3],c=e[4]),(0,Q.useEffect)(s,c);let l;return e[5]!==r||e[6]!==o?(l=(0,Z.jsx)(av,{open:r,onOpenChange:i,kind:`file`,initialDir:o}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function G0(e){let t=(0,$.c)(5),{children:n}=e,{collabUrl:r}=Ye();A0(r);let i,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(y0,{}),a=(0,Z.jsx)(_0,{}),t[0]=i,t[1]=a):(i=t[0],a=t[1]);let o;return t[2]!==n||t[3]!==r?(o=(0,Z.jsxs)(Au,{collabUrl:r,children:[i,a,n]}),t[2]=n,t[3]=r,t[4]=o):o=t[4],o}function K0(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(uu,{name:`app`,children:(0,Z.jsx)(tt,{children:(0,Z.jsx)(G0,{children:(0,Z.jsx)(Gv,{children:(0,Z.jsx)(q0,{})})})})}),e[0]=t):t=e[0],t}function q0(){let e=(0,$.c)(32),t=typeof window<`u`?window.okDesktop??null:null,n=typeof window<`u`&&window.okDesktop!=null,[r,i]=(0,Q.useState)(!1),a=Jv(),o=Rd(),s;e[0]===o?s=e[1]:(s=t&&t.config.ptyAvailable===!0?{launchInTerminal:J0,installedClis:o}:null,e[0]=o,e[1]=s);let c=s,l;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(Fy,{}),e[2]=l):l=e[2];let u,d,f,p,m;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(a0,{}),d=(0,Z.jsx)(m0,{}),f=(0,Z.jsx)(R0,{}),p=(0,Z.jsx)(U0,{}),m=(0,Z.jsx)(W0,{}),e[3]=u,e[4]=d,e[5]=f,e[6]=p,e[7]=m):(u=e[3],d=e[4],f=e[5],p=e[6],m=e[7]);let h;e[8]===a?h=e[9]:(h=!a&&(0,Z.jsx)(V0,{}),e[8]=a,e[9]=h);let g,_,v,y,b,x,S;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(x=!1,S=t?(0,Z.jsx)(Iy,{bridge:t}):null,g=t?(0,Z.jsx)(Wy,{}):null,_=t?(0,Z.jsx)(i0,{}):null,v=t?(0,Z.jsx)(OR,{}):null,y=(0,Z.jsx)(t0,{}),b=t?(0,Z.jsxs)(Q.Suspense,{fallback:null,children:[(0,Z.jsx)(j0,{bridge:t}),(0,Z.jsx)(M0,{})]}):null,e[10]=g,e[11]=_,e[12]=v,e[13]=y,e[14]=b,e[15]=x,e[16]=S):(g=e[10],_=e[11],v=e[12],y=e[13],b=e[14],x=e[15],S=e[16]);let C;e[17]===r?C=e[18]:(C=(0,Z.jsx)(wy,{bridge:t,open:r,onOpenChange:i}),e[17]=r,e[18]=C);let w;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(w=n&&(0,Z.jsx)(`div`,{"aria-hidden":`true`,"data-testid":`editor-window-chrome-drag-strip`,"data-electron-drag":``,className:`pointer-events-none fixed inset-x-0 top-0 z-50 h-2 [-webkit-app-region:drag]`}),e[19]=w):w=e[19];let T;e[20]===a?T=e[21]:(T=!a&&(0,Z.jsx)(U1,{onOpenSearch:()=>i(!0)}),e[20]=a,e[21]=T);let E;e[22]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Z.jsx)(_P,{className:`overflow-hidden h-[calc(100vh-var(--layout-inset-offset))]`,children:(0,Z.jsx)(wR,{onOpenSearch:()=>i(!0)})}),e[22]=E):E=e[22];let D;e[23]===T?D=e[24]:(D=(0,Z.jsxs)(dP,{className:`h-screen overflow-hidden`,children:[T,E]}),e[23]=T,e[24]=D);let O;e[25]!==D||e[26]!==c?(O=(0,Z.jsx)(ds,{value:c,children:D}),e[25]=D,e[26]=c,e[27]=O):O=e[27];let k;return e[28]!==C||e[29]!==O||e[30]!==h?(k=(0,Z.jsxs)(Z.Fragment,{children:[l,(0,Z.jsxs)(Ko,{children:[u,d,f,p,m,h,x,S,g,_,v,y,b,C,w,O]})]}),e[28]=C,e[29]=O,e[30]=h,e[31]=k):k=e[31],k}function J0(e,t){Uc(rs(e,t),t)}function Y0(e){let t=/\/([^/]+?)(?:\.git)?\/?$/.exec(e);return t?t[1]:`repo`}function X0(e){return{async getAuthStatus(t){return e.authQueryTransport.status(t?{host:t}:void 0)},async startSignIn(){return e.openSignIn()},async runClone({url:t,branch:n}){let r=await e.bridge.dialog.openFolder();if(!r)return{kind:`cancelled`};let i=Y0(t),a=`${r.replace(/\/$/,``)}/${i}`,o=gl.loading(Cl._({id:`GXf9hG`,values:{repoName:i}}),{duration:1/0}),s=typeof n==`string`&&n.length>0?n:null;try{let n=e.cloneTransport.start({url:t,dir:a,branch:s});for await(let e of n.events){if(e.type===`progress`){let t=e.phase,n=Math.round(e.pct);gl.loading(Cl._({id:`GXf9hG`,values:{repoName:i}}),{id:o,description:Cl._({id:`SCzAbA`,values:{phase:t,pct:n}}),duration:1/0});continue}if(e.type===`branch-fallback`){console.log(xp({branch_action:`fallback`,branch:e.branch})),gl.info(Cl._({id:`3JYy1p`,values:{0:e.branch}}),{duration:8e3});continue}if(e.type===`complete`)return gl.success(Cl._({id:`IRv9cH`,values:{repoName:i}}),{id:o,duration:4e3}),{kind:`ok`,dir:e.dir};if(e.type===`error`)return gl.dismiss(o),{kind:`error`,detail:e.message}}return gl.dismiss(o),{kind:`error`,detail:`Clone ended unexpectedly.`}}catch(e){console.warn(`[clone-controller] clone transport threw`,e);let t=e instanceof Error?e.message:`Unknown error`;return gl.dismiss(o),{kind:`error`,detail:t}}}}}function Z0(){return{start(e){return ks((t,n)=>{(async()=>{try{let r=await fetch(`/api/local-op/clone`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({url:e.url,dir:e.dir||void 0,branch:typeof e.branch==`string`&&e.branch.length>0?e.branch:void 0}),signal:n});if(!r.ok){let e=`Clone failed — check the URL and try again (${r.status})`;try{let t=await r.json(),n=uo.safeParse(t);n.success&&(e=`Clone failed: ${n.data.title}`)}catch{}t({type:`error`,message:e});return}if(!r.body){t({type:`error`,message:`Clone failed — empty response body`});return}let i=r.body.getReader(),a=new TextDecoder,o=``;for(;;){let{done:e,value:r}=await i.read();if(e)break;o+=a.decode(r,{stream:!0});let s=o.split(`
2014
+ `);o=s.pop()??``;for(let e of s){if(!e.trim())continue;let n;try{n=JSON.parse(e)}catch{console.warn(`[clone-transport] Dropped unparseable NDJSON line:`,e.slice(0,100));continue}if(n&&typeof n==`object`&&n.type===`error`&&`problem`in n){let e=n.problem;t({type:`error`,message:e?.detail||e?.title||`Unknown error`});break}t(n)}if(n.aborted)break}n.aborted||t({type:`error`,message:`Clone stream ended unexpectedly — check if the clone completed`})}catch(e){if(e instanceof Error&&e.name===`AbortError`)return;t({type:`error`,message:`Clone failed — connection error`})}})()})}}}function Q0(e){return{start(t){let n=typeof t.branch==`string`&&t.branch.length>0?t.branch:null;return e.localOp.clone.start({url:t.url,dir:t.dir,branch:n})}}}function $0(e){switch(e){case`receiving`:return{id:`qbfj1f`};case`resolving`:return{id:`adsMWO`};case`checking`:return{id:`1HBhDS`};case`init`:return{id:`LlHqdU`};case`done`:return{id:`bD8I7O`};default:return{id:`25Pw6a`}}}function e2(e){let t=e.trim();if(/^[\w.-]+\/[\w.-]+$/.test(t))return t.split(`/`)[1];try{return new URL(t.replace(/^git@([^:]+):/,`https://$1/`)).pathname.replace(/\.git$/,``).split(`/`).pop()??`repo`}catch{return t.split(`/`).pop()?.replace(/\.git$/,``)??`repo`}}function t2(e){let t=(0,$.c)(100),{open:n,onOpenChange:r,onSignIn:i,onCloneComplete:a,transport:o,authQueryTransport:s,pickParentFolder:c,initialUrl:l}=e,{_:u}=gt(),d;t[0]===o?d=t[1]:(d=o??Z0(),t[0]=o,t[1]=d);let f=d,p;t[2]===s?p=t[3]:(p=s??qs(),t[2]=s,t[3]=p);let m=p,h=c!==void 0,[g,_]=(0,Q.useState)(``),[v,y]=(0,Q.useState)(``),[b,x]=(0,Q.useState)(null),[S,C]=(0,Q.useState)(!1),w;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(w=Us(),t[4]=w):w=t[4];let[T,E]=(0,Q.useState)(w),[D,O]=(0,Q.useState)(!1),[k,A]=(0,Q.useState)(!1),[j,M]=(0,Q.useState)(-1),N=(0,Q.useRef)(null),P=(0,Q.useRef)(null),F=(0,Q.useRef)(null),I=(0,Q.useId)(),L;t[5]!==n||t[6]!==m?(L=()=>{if(!n)return;let e=!1;return m.status().then(t=>{Vs(t.authenticated),e||E(t.authenticated)}).catch(()=>{e||E(!1)}),()=>{e=!0}},t[5]=n,t[6]=m,t[7]=L):L=t[7];let R;t[8]===n?R=t[9]:(R=[n],t[8]=n,t[9]=R),(0,Q.useEffect)(L,R);let z;t[10]!==T||t[11]!==n||t[12]!==m?(z=()=>{if(!T||!n)return;let e=!1;return C(!0),m.repos().then(t=>{e||(x(t.ok?t.repos:[]),C(!1))}).catch(()=>{e||(x([]),C(!1))}),()=>{e=!0}},t[10]=T,t[11]=n,t[12]=m,t[13]=z):z=t[13];let B;t[14]!==T||t[15]!==n?(B=[T,n],t[14]=T,t[15]=n,t[16]=B):B=t[16],(0,Q.useEffect)(z,B);let V,H;t[17]!==l||t[18]!==n||t[19]!==h?(V=()=>{if(!n||!l||(_(l),h))return;let e=e2(l);e&&y(`~/Documents/${e}`)},H=[n,l,h],t[17]=l,t[18]=n,t[19]=h,t[20]=V,t[21]=H):(V=t[20],H=t[21]),(0,Q.useEffect)(V,H);let U,W;t[22]!==j||t[23]!==I?(U=()=>{j<0||document.getElementById(`${I}-opt-${j}`)?.scrollIntoView({block:`nearest`})},W=[j,I],t[22]=j,t[23]=I,t[24]=U,t[25]=W):(U=t[24],W=t[25]),(0,Q.useEffect)(U,W);let G;t[26]===h?G=t[27]:(G=function(e){if(_(e),A(!0),M(-1),h)return;let t=e2(e);t&&y(`~/Documents/${t}`)},t[26]=h,t[27]=G);let K=G,ee;t[28]===h?ee=t[29]:(ee=function(e){if(_(e.clone_url),h)return;let t=e.full_name.split(`/`)[1];y(`~/Documents/${t}`)},t[28]=h,t[29]=ee);let te=ee,ne;t[30]!==u||t[31]!==v||t[32]!==a||t[33]!==r||t[34]!==c||t[35]!==f||t[36]!==g?(ne=async function(){let e=g.trim();if(!e){gl.error(u({id:`FTUGgh`}));return}let t=v||``;if(c){O(!0);let n=await c();if(!n){O(!1);return}let r=e2(e);t=`${n.replace(/\/$/,``)}/${r}`}else O(!0);let n=gl.loading(u({id:`2tgFCe`}),{duration:1/0});P.current=n;let i=f.start({url:e,dir:t});N.current=i.cancel;try{let e=i.events[Symbol.asyncIterator](),t=await e.next();for(;!t.done;){let i=t.value;if(i.type===`progress`){let e=u($0(i.phase));gl.loading(`${e} — ${i.pct}%`,{id:n})}else if(i.type===`complete`){gl.success(u({id:`u_lS4C`}),{id:n}),r(!1),O(!1),N.current=null;let e=`port`in i?i.port:void 0;a?a({port:e,dir:i.dir}):e!==void 0&&(window.location.href=`http://localhost:${e}`);return}else if(i.type===`error`){let e=i.message;gl.error(u({id:`eFJkVt`,values:{cloneError:e}}),{id:n}),O(!1),N.current=null;return}t=await e.next()}gl.error(u({id:`Tz9pJB`}),{id:n}),O(!1),N.current=null}catch(e){console.error(`[CloneDialog] clone iteration failed:`,e),gl.error(u({id:`K9J00P`}),{id:n}),O(!1),N.current=null}},t[30]=u,t[31]=v,t[32]=a,t[33]=r,t[34]=c,t[35]=f,t[36]=g,t[37]=ne):ne=t[37];let q=ne,re;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(re=function(){N.current?.(),N.current=null,O(!1),gl.dismiss(P.current??void 0)},t[38]=re):re=t[38];let ie=re,ae;t[39]!==D||t[40]!==r||t[41]!==h?(ae=function(e){D||(r(e),e||(_(``),h||y(``),A(!1),M(-1)))},t[39]=D,t[40]=r,t[41]=h,t[42]=ae):ae=t[42];let oe=ae,se;t[43]===te?se=t[44]:(se=function(e){te(e),A(!1),M(-1),F.current?.focus()},t[43]=te,t[44]=se);let ce=se,le=T===null||S&&b===null,ue;if(t[45]!==b||t[46]!==g){let e=g.trim().toLowerCase(),n;t[48]===b?n=t[49]:(n=b??[],t[48]=b,t[49]=n),ue=n.filter(t=>`${t.full_name} ${t.clone_url}`.toLowerCase().includes(e)),t[45]=b,t[46]=g,t[47]=ue}else ue=t[47];let de=ue,fe;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(fe=/:\/\/|^git@|\.git$/i,t[50]=fe):fe=t[50];let pe;t[51]===g?pe=t[52]:(pe=fe.test(g.trim()),t[51]=g,t[52]=pe);let me=pe,he=T===!0&&b!==null&&de.length===0&&!me,ge=k&&T!==!1&&!D&&(le||de.length>0||he),_e=de.length,ve=`${I}-loading`,ye,be;t[53]===_e?(ye=t[54],be=t[55]):(ye=()=>{M(e=>e>=_e?_e-1:e)},be=[_e],t[53]=_e,t[54]=ye,t[55]=be),(0,Q.useEffect)(ye,be);let xe;t[56]!==j||t[57]!==D||t[58]!==ge||t[59]!==ce||t[60]!==de?(xe=function(e){if(!D)if(e.key===`ArrowDown`){if(e.preventDefault(),!ge){A(!0);return}M(e=>Math.min(e+1,de.length-1))}else e.key===`ArrowUp`?(e.preventDefault(),M(s2)):e.key===`Enter`?ge&&j>=0&&j<de.length&&(e.preventDefault(),ce(de[j])):e.key===`Escape`&&ge&&(e.preventDefault(),e.stopPropagation(),A(!1),M(-1))},t[56]=j,t[57]=D,t[58]=ge,t[59]=ce,t[60]=de,t[61]=xe):xe=t[61];let Se=xe,Ce;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=(0,Z.jsx)(vn,{children:(0,Z.jsx)(mn,{children:(0,Z.jsx)(J,{id:`VdXv4D`})})}),t[62]=Ce):Ce=t[62];let we;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(we=(0,Z.jsx)(`label`,{htmlFor:`clone-source`,className:`text-sm font-medium`,children:(0,Z.jsx)(J,{id:`IreQBq`})}),t[63]=we):we=t[63];let Te;t[64]!==u||t[65]!==j||t[66]!==D||t[67]!==Se||t[68]!==K||t[69]!==T||t[70]!==I||t[71]!==ve||t[72]!==i||t[73]!==ge||t[74]!==le||t[75]!==b||t[76]!==ce||t[77]!==de||t[78]!==g?(Te=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[we,T===!1?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Sl,{id:`clone-source`,placeholder:u({id:`Xv_ijG`}),value:g,onChange:e=>K(e.target.value),disabled:D}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 text-1sm text-muted-foreground`,children:[(0,Z.jsx)(`span`,{children:(0,Z.jsx)(J,{id:`9oE4C3`})}),(0,Z.jsx)(X,{variant:`link`,className:`h-auto p-0`,onClick:()=>i?.(),disabled:D,children:(0,Z.jsx)(J,{id:`3jod3l`})})]})]}):(0,Z.jsxs)(Vt,{open:ge,onOpenChange:A,children:[(0,Z.jsx)(Gt,{asChild:!0,children:(0,Z.jsx)(Sl,{id:`clone-source`,ref:F,role:`combobox`,"aria-expanded":ge,"aria-controls":ge?le?ve:I:void 0,"aria-activedescendant":j>=0?`${I}-opt-${j}`:void 0,"aria-autocomplete":`list`,autoComplete:`off`,placeholder:u({id:`R0jJzV`}),value:g,onChange:e=>K(e.target.value),onFocus:()=>A(!0),onKeyDown:Se,disabled:D})}),(0,Z.jsx)(qt,{align:`start`,sideOffset:4,className:`w-(--radix-popover-trigger-width) max-h-56 overflow-y-auto overscroll-y-contain subtle-scrollbar p-0`,onOpenAutoFocus:o2,onCloseAutoFocus:a2,onInteractOutside:e=>{F.current?.contains(e.target)&&e.preventDefault()},onWheel:i2,onTouchMove:r2,children:le?(0,Z.jsxs)(`output`,{id:ve,className:`flex flex-col gap-1.5 px-3 py-2`,"aria-label":u({id:`8XQRON`}),children:[(0,Z.jsx)(Jd,{className:`h-4 w-2/3`}),(0,Z.jsx)(Jd,{className:`h-4 w-1/2`}),(0,Z.jsx)(Jd,{className:`h-4 w-3/4`}),(0,Z.jsx)(Jd,{className:`h-4 w-2/5`})]}):(0,Z.jsx)(`div`,{id:I,role:`listbox`,"aria-label":u({id:`KX1MZR`}),className:`py-1`,children:de.length===0?(0,Z.jsx)(`div`,{role:`presentation`,className:`px-3 py-2 text-xs text-muted-foreground`,children:b&&b.length===0?(0,Z.jsx)(J,{id:`cOSAfL`}):(0,Z.jsx)(J,{id:`8eW0WQ`})}):de.map((e,t)=>(0,Z.jsxs)(`div`,{id:`${I}-opt-${t}`,role:`option`,tabIndex:-1,"aria-selected":t===j,onMouseDown:n2,onMouseEnter:()=>M(t),onClick:()=>ce(e),className:Y(`flex cursor-default items-center gap-2 px-3 py-1.5 text-sm`,t===j&&`bg-accent text-accent-foreground`),children:[e.private?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Xo,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(J,{id:`n5n_vi`})})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(qo,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(J,{id:`NuH1jp`})})]}),(0,Z.jsx)(`span`,{className:`truncate`,children:e.full_name})]},e.full_name))})})]})]}),t[64]=u,t[65]=j,t[66]=D,t[67]=Se,t[68]=K,t[69]=T,t[70]=I,t[71]=ve,t[72]=i,t[73]=ge,t[74]=le,t[75]=b,t[76]=ce,t[77]=de,t[78]=g,t[79]=Te):Te=t[79];let Ee;t[80]!==D||t[81]!==v||t[82]!==h?(Ee=!h&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`label`,{htmlFor:`clone-path`,className:`text-sm font-medium`,children:(0,Z.jsx)(J,{id:`Gp_twO`})}),(0,Z.jsx)(Sl,{id:`clone-path`,placeholder:`~/Documents/repo-name`,value:v,onChange:e=>y(e.target.value),disabled:D})]}),t[80]=D,t[81]=v,t[82]=h,t[83]=Ee):Ee=t[83];let De;t[84]!==Te||t[85]!==Ee?(De=(0,Z.jsx)(gn,{children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[Te,Ee]})}),t[84]=Te,t[85]=Ee,t[86]=De):De=t[86];let Oe;t[87]!==D||t[88]!==q||t[89]!==oe||t[90]!==g||t[91]!==h?(Oe=(0,Z.jsx)(_n,{children:D?(0,Z.jsx)(X,{variant:`outline`,className:`font-mono uppercase`,onClick:ie,children:(0,Z.jsx)(J,{id:`dEgA5A`})}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(X,{variant:`outline`,className:`font-mono uppercase`,onClick:()=>oe(!1),children:(0,Z.jsx)(J,{id:`dEgA5A`})}),(0,Z.jsx)(X,{onClick:()=>void q(),disabled:!g.trim(),"aria-describedby":h?`clone-picker-hint`:void 0,children:(0,Z.jsx)(J,{id:`9UQ730`})}),h&&(0,Z.jsx)(`span`,{id:`clone-picker-hint`,className:`sr-only`,children:(0,Z.jsx)(J,{id:`EvPX7f`})})]})}),t[87]=D,t[88]=q,t[89]=oe,t[90]=g,t[91]=h,t[92]=Oe):Oe=t[92];let ke;t[93]!==De||t[94]!==Oe?(ke=(0,Z.jsxs)(hn,{className:`sm:max-w-lg`,children:[Ce,De,Oe]}),t[93]=De,t[94]=Oe,t[95]=ke):ke=t[95];let Ae;return t[96]!==oe||t[97]!==n||t[98]!==ke?(Ae=(0,Z.jsx)(yn,{open:n,onOpenChange:oe,children:ke}),t[96]=oe,t[97]=n,t[98]=ke,t[99]=Ae):Ae=t[99],Ae}function n2(e){return e.preventDefault()}function r2(e){return e.stopPropagation()}function i2(e){return e.stopPropagation()}function a2(e){return e.preventDefault()}function o2(e){return e.preventDefault()}function s2(e){return Math.max(e-1,-1)}var c2=(0,Q.lazy)(()=>n(()=>import(`./ConsentDialogBody-CerQg1mw.js`),__vite__mapDeps([178,1,10,11,12,13,14,15,16,17,18,19,20,21,22,35,23,24,25,26,27,92,99,179,114,115,49,50,130,29,30,31,96,41,42]),import.meta.url));function l2(){let e=(0,$.c)(1);if(!(0,Q.useSyncExternalStore)(xl.subscribe,d2,u2))return null;let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(c2,{})}),e[0]=t):t=e[0],t}function u2(){return!1}function d2(){return xl.getSnapshot()!==null}function f2(e){let t=(0,$.c)(5),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`OpenKnowledge icon`}),t[0]=n):n=t[0];let r;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsxs)(`g`,{filter:`url(#filter0_d_ok)`,children:[(0,Z.jsx)(`path`,{d:`M66.8902 16.1017C58.2694 3.86669 46.1739 -0.690239 29.9182 2.17749C21.3995 3.67813 13.4602 9.555 8.67934 17.9009C3.93974 26.1701 2.98514 35.6533 6.05714 43.9166C9.31574 52.6868 16.7168 58.4752 24.2299 63.4231C25.7973 64.4562 26.1351 65.7172 26.3551 68.9896C26.5221 71.4625 26.799 75.6011 30.6842 77.7204C31.8176 78.3372 33.0648 78.6515 34.3946 78.6515C37.0796 78.6515 39.4033 77.3649 40.5189 76.7482C47.1049 73.1046 68.8878 59.7147 72.6453 40.4027C74.3444 31.6679 70.9797 21.9019 66.8922 16.1017H66.8902Z`,fill:`white`}),(0,Z.jsx)(`path`,{d:`M37.4214 71.154C28.7888 75.929 36.787 64.0397 27.7458 58.0843C21.6372 54.0616 14.788 49.0568 12.0499 41.6911C6.74463 27.4192 17.5438 10.8473 31.028 8.47262C45.1977 5.97613 54.6946 9.8947 61.6635 19.7844C65.2089 24.8167 67.6013 32.8365 66.3658 39.1828C63.6906 52.9341 49.073 64.7075 37.4214 71.154Z`,fill:`#69A3FF`}),(0,Z.jsx)(`path`,{d:`M52.7244 29.2638C53.4665 28.5217 54.6697 28.5217 55.4119 29.2638V29.2638C56.154 30.0059 56.154 31.2091 55.4119 31.9513L49.2589 38.1042L46.5715 35.4167L52.7244 29.2638Z`,fill:`#D5E5FF`}),(0,Z.jsx)(`path`,{d:`M55.4119 38.8821C56.154 39.6242 56.154 40.8274 55.4119 41.5696V41.5696C54.6698 42.3117 53.4665 42.3117 52.7244 41.5696L46.5715 35.4166L49.259 32.7292L55.4119 38.8821Z`,fill:`#D5E5FF`})]}),t[1]=r):r=t[1];let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(`defs`,{children:(0,Z.jsxs)(`filter`,{id:`filter0_d_ok`,x:`-9.53674e-07`,y:`-0.0799994`,width:`77.3817`,height:`85.8743`,filterUnits:`userSpaceOnUse`,colorInterpolationFilters:`sRGB`,children:[(0,Z.jsx)(`feFlood`,{floodOpacity:`0`,result:`BackgroundImageFix`}),(0,Z.jsx)(`feColorMatrix`,{in:`SourceAlpha`,type:`matrix`,values:`0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0`,result:`hardAlpha`}),(0,Z.jsx)(`feOffset`,{dy:`2.85714`}),(0,Z.jsx)(`feGaussianBlur`,{stdDeviation:`2.14286`}),(0,Z.jsx)(`feComposite`,{in2:`hardAlpha`,operator:`out`}),(0,Z.jsx)(`feColorMatrix`,{type:`matrix`,values:`0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0`}),(0,Z.jsx)(`feBlend`,{mode:`normal`,in2:`BackgroundImageFix`,result:`effect1_dropShadow_ok`}),(0,Z.jsx)(`feBlend`,{mode:`normal`,in:`SourceGraphic`,in2:`effect1_dropShadow_ok`,result:`shape`})]})}),t[2]=i):i=t[2];let a;return t[3]===e?a=t[4]:(a=(0,Z.jsxs)(`svg`,{role:`img`,"aria-label":`OpenKnowledge icon`,fill:`none`,height:24,width:24,viewBox:`0 0 78 80`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[n,r,i]}),t[3]=e,t[4]=a),a}var p2=(0,Q.lazy)(()=>n(()=>import(`./ShareReceiveDialog-mjee2gdk.js`).then(e=>({default:e.ShareReceiveDialog})),__vite__mapDeps([180,1,6,2,3,7,8,9,10,11,12,23,14,15,16,17,24,25,26,22,27,33,99,172,173,174]),import.meta.url)),m2=(0,Q.lazy)(()=>n(()=>import(`./AppMenubar-BU0HYo5c.js`).then(e=>({default:e.AppMenubar})),__vite__mapDeps([162,1,10,11,12,14,15,16,17,49,113,30,31,19,24,25,50,20,92,22]),import.meta.url)),h2=(e,t,n)=>Hv(e,t,n,`NavigatorApp`);function g2(e,t){return e.filter(e=>e.path!==t)}function _2(e){let t=(0,$.c)(153),{bridge:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],t[0]=r):r=t[0];let[i,a]=(0,Q.useState)(r),o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=new Map,t[1]=o):o=t[1];let[s,c]=(0,Q.useState)(o),[l,u]=(0,Q.useState)(!0),[d,f]=(0,Q.useState)(!1),[p,m]=(0,Q.useState)(null),[h,g]=(0,Q.useState)(null),[_,v]=(0,Q.useState)(!1),[y,b]=(0,Q.useState)(!1),[x,S]=(0,Q.useState)(!1),[C,w]=(0,Q.useState)(!1),[T,E]=(0,Q.useState)(void 0),[D,O]=(0,Q.useState)(void 0),[k,A]=(0,Q.useState)(!1),[j,M]=(0,Q.useState)(!1),[N,P]=(0,Q.useState)(null),F=typeof window<`u`&&window.okDesktop!=null,[I,L]=(0,Q.useState)(`auth`),{theme:R}=Lt(),{_:z}=gt();ku(n,R??`system`);let B;t[2]!==z||t[3]!==n.project?(B=()=>{let e=!1;return n.project.listRecent().then(async t=>{if(e)return;a(t);let r=t.filter(v2),i=await Promise.all(r.map(async e=>{try{let{currentBranch:t}=await n.project.readHeadBranch(e.path);return[e.path,t]}catch{return[e.path,null]}}));e||c(e=>{let t=new Map(e);for(let[e,n]of i)t.set(e,n);return t})}).catch(t=>{console.error(`[NavigatorApp] listRecent failed:`,t),e||(m(t instanceof Error?t.message:z({id:`fYKgzG`})),f(!0))}).finally(()=>{e||u(!1)}),()=>{e=!0}},t[2]=z,t[3]=n.project,t[4]=B):B=t[4];let V;t[5]!==z||t[6]!==n?(V=[n,z],t[5]=z,t[6]=n,t[7]=V):V=t[7],(0,Q.useEffect)(B,V);let H,U;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(H=()=>Ut(e=>{e===`new-project`&&b(!0),e===`report-bug`&&S(!0),e===`send-feedback`&&w(!0),e===`close-active-tab-or-window`&&window.close()}),U=[],t[8]=H,t[9]=U):(H=t[8],U=t[9]),(0,Q.useEffect)(H,U);let W,G;t[10]===n?(W=t[11],G=t[12]):(W=()=>n.onRecentRemovedMissing(e=>{let{path:t}=e;a(e=>g2(e,t)),c(e=>{if(!e.has(t))return e;let n=new Map(e);return n.delete(t),n})}),G=[n],t[10]=n,t[11]=W,t[12]=G),(0,Q.useEffect)(W,G);let K;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(K=(e,t)=>h2(e,t,m),t[13]=K):K=t[13];let ee=K,te;t[14]!==z||t[15]!==n?(te=(e,t,r)=>ee(()=>(g(r),C2(n,e,t).finally(()=>g(null))),z({id:`SUOoXn`})),t[14]=z,t[15]=n,t[16]=te):te=t[16];let ne=te,q;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(q=()=>v(!0),t[17]=q):q=t[17];let re=q,ie;t[18]!==z||t[19]!==n?(ie=()=>ee(async()=>{let e=await n.dialog.openFolder();e&&(g(w2(e)),await C2(n,e,`pick-existing`).finally(()=>g(null)))},z({id:`gmJ0An`})),t[18]=z,t[19]=n,t[20]=ie):ie=t[20];let ae=ie,oe;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(oe=()=>b(!0),t[21]=oe):oe=t[21];let se=oe,ce;t[22]!==z||t[23]!==n.project?(ce=()=>ee(()=>n.project.openFile(),z({id:`8vCZcs`})),t[22]=z,t[23]=n.project,t[24]=ce):ce=t[24];let le=ce,ue;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(ue=(e,t)=>{E(e),O(t),b(!0)},t[25]=ue):ue=t[25];let de=ue,fe;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(fe=e=>{b(e),e||(E(void 0),O(void 0))},t[26]=fe):fe=t[26];let pe=fe,me;t[27]===ne?me=t[28]:(me=e=>ne(e,`recents`,w2(e)),t[27]=ne,t[28]=me);let he=me,ge;t[29]!==z||t[30]!==n.project?(ge=e=>ee(async()=>{await n.project.removeRecent(e),a(t=>g2(t,e)),c(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},z({id:`viwC-K`})),t[29]=z,t[30]=n.project,t[31]=ge):ge=t[31];let _e=ge,ve;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(ve=(0,Z.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 top-0 z-10 h-9 ${F?`[-webkit-app-region:drag]`:``}`,"data-electron-drag":F?``:void 0,"data-testid":`nav-chrome-row`,children:PF()&&(0,Z.jsx)(`div`,{className:`pointer-events-auto flex h-full items-center px-2`,children:(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(m2,{})})})}),t[32]=ve):ve=t[32];let ye;t[33]!==z||t[34]!==h?(ye=h===null?null:(0,Z.jsxs)(`div`,{className:`absolute inset-0 z-20 flex flex-col items-center justify-center gap-3 bg-primary-foreground/85 dark:bg-background/85 backdrop-blur-sm`,"data-testid":`nav-opening-overlay`,role:`status`,"aria-live":`polite`,children:[(0,Z.jsx)(Xc,{className:`size-6 animate-spin text-muted-foreground`}),(0,Z.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:z({id:`s0_GnA`,values:{openingLabel:h}})})]}),t[33]=z,t[34]=h,t[35]=ye):ye=t[35];let be;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(be=(0,Z.jsx)(f2,{className:`size-12 shrink-0`}),t[36]=be):be=t[36];let xe;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`h1`,{className:`font-medium text-xl tracking-tight`,children:`OpenKnowledge`}),(0,Z.jsx)(gI,{})]}),t[37]=xe):xe=t[37];let Se;t[38]===n.appVersion?Se=t[39]:(Se=(0,Z.jsxs)(`header`,{className:`shrink-0 flex-wrap flex items-center gap-2.5`,children:[be,(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[xe,(0,Z.jsxs)(`p`,{className:`text-muted-foreground text-xs font-mono`,children:[`v`,n.appVersion]})]})]}),t[38]=n.appVersion,t[39]=Se);let Ce;t[40]===z?Ce=t[41]:(Ce=z({id:`wbv9xO`}),t[40]=z,t[41]=Ce);let we;t[42]===z?we=t[43]:(we=z({id:`0uTHCg`}),t[42]=z,t[43]=we);let Te;t[44]!==Ce||t[45]!==we?(Te=(0,Z.jsx)(y2,{title:Ce,description:we,onClick:se,dataTestId:`nav-create-new`,Icon:Wt}),t[44]=Ce,t[45]=we,t[46]=Te):Te=t[46];let Ee;t[47]===z?Ee=t[48]:(Ee=z({id:`WPwDin`}),t[47]=z,t[48]=Ee);let De;t[49]===z?De=t[50]:(De=z({id:`tUvUfp`}),t[49]=z,t[50]=De);let Oe;t[51]!==ae||t[52]!==Ee||t[53]!==De?(Oe=(0,Z.jsx)(y2,{title:Ee,description:De,onClick:ae,dataTestId:`nav-open`,Icon:hc}),t[51]=ae,t[52]=Ee,t[53]=De,t[54]=Oe):Oe=t[54];let ke;t[55]===z?ke=t[56]:(ke=z({id:`ka6Eke`}),t[55]=z,t[56]=ke);let Ae;t[57]===z?Ae=t[58]:(Ae=z({id:`gOD68k`}),t[57]=z,t[58]=Ae);let je;t[59]!==le||t[60]!==ke||t[61]!==Ae?(je=(0,Z.jsx)(y2,{title:ke,description:Ae,onClick:le,dataTestId:`nav-open-file`,Icon:Gn}),t[59]=le,t[60]=ke,t[61]=Ae,t[62]=je):je=t[62];let Me;t[63]===z?Me=t[64]:(Me=z({id:`VdXv4D`}),t[63]=z,t[64]=Me);let Ne;t[65]===z?Ne=t[66]:(Ne=z({id:`JOcPqH`}),t[65]=z,t[66]=Ne);let Pe;t[67]!==Me||t[68]!==Ne?(Pe=(0,Z.jsx)(y2,{title:Me,description:Ne,onClick:re,dataTestId:`nav-clone`,Icon:r_}),t[67]=Me,t[68]=Ne,t[69]=Pe):Pe=t[69];let Fe;t[70]!==Te||t[71]!==Oe||t[72]!==je||t[73]!==Pe?(Fe=(0,Z.jsxs)(`section`,{className:`grid sm:grid-cols-2 gap-3`,children:[Te,Oe,je,Pe]}),t[70]=Te,t[71]=Oe,t[72]=je,t[73]=Pe,t[74]=Fe):Fe=t[74];let Ie;t[75]!==l||t[76]!==i||t[77]!==d?(Ie=!l&&!d&&i.length===0?(0,Z.jsx)(x2,{onPackSelect:de}):null,t[75]=l,t[76]=i,t[77]=d,t[78]=Ie):Ie=t[78];let Le;t[79]!==Fe||t[80]!==Ie?(Le=(0,Z.jsxs)(`div`,{className:`shrink-0 space-y-6`,children:[Fe,Ie]}),t[79]=Fe,t[80]=Ie,t[81]=Le):Le=t[81];let Re;t[82]===p?Re=t[83]:(Re=p===null?null:(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between gap-3 rounded-md border border-red-500/30 bg-red-500/10 px-3 py-2`,"data-testid":`nav-error-banner`,role:`alert`,children:[(0,Z.jsx)(`span`,{className:`text-red-700 text-xs dark:text-red-300`,children:p}),(0,Z.jsx)(X,{type:`button`,variant:`link`,size:`sm`,onClick:()=>m(null),className:`h-auto p-0 text-red-700 text-xs dark:text-red-300`,"data-testid":`nav-error-dismiss`,children:(0,Z.jsx)(J,{id:`1QfxQT`})})]}),t[82]=p,t[83]=Re);let ze;t[84]!==l||t[85]!==he||t[86]!==_e||t[87]!==s||t[88]!==i?(ze=l?(0,Z.jsx)(`section`,{className:`flex shrink-0 flex-col items-center`,children:(0,Z.jsx)(Xc,{className:`size-4 animate-spin text-muted-foreground/60`})}):i.length>0?(0,Z.jsxs)(`section`,{className:`flex min-h-0 flex-col`,children:[(0,Z.jsx)(`h2`,{className:`mb-2 shrink-0 font-medium text-muted-foreground font-mono text-xs uppercase tracking-wide`,children:(0,Z.jsx)(J,{id:`CCTop_`})}),(0,Z.jsx)(`ul`,{className:`min-h-0 max-h-48 subtle-scrollbar scroll-fade-mask overflow-y-auto space-y-0.5 -mx-4`,"data-testid":`nav-recent-list`,children:i.map(e=>(0,Z.jsx)(S2,{project:e,branch:s.get(e.path)??null,onOpen:()=>he(e.path),onRemove:()=>_e(e.path)},e.path))})]}):null,t[84]=l,t[85]=he,t[86]=_e,t[87]=s,t[88]=i,t[89]=ze):ze=t[89];let Be;t[90]!==Se||t[91]!==Le||t[92]!==Re||t[93]!==ze?(Be=(0,Z.jsx)(`div`,{className:`mx-auto flex h-full w-full max-w-5xl flex-col overflow-hidden px-12 py-12`,children:(0,Z.jsxs)(`div`,{className:`my-auto flex min-h-0 flex-col space-y-10`,children:[Se,Le,Re,ze]})}),t[90]=Se,t[91]=Le,t[92]=Re,t[93]=ze,t[94]=Be):Be=t[94];let Ve,He;t[95]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=(0,Z.jsx)(t0,{}),He=(0,Z.jsx)(l2,{}),t[95]=Ve,t[96]=He):(Ve=t[95],He=t[96]);let Ue;t[97]!==n||t[98]!==y||t[99]!==T||t[100]!==D?(Ue=(0,Z.jsx)(Ug,{open:y,onOpenChange:pe,bridge:n,initialPackId:T,packs:D}),t[97]=n,t[98]=y,t[99]=T,t[100]=D,t[101]=Ue):Ue=t[101];let We;t[102]===x?We=t[103]:(We=(0,Z.jsx)(lm,{open:x,onOpenChange:S,systemWide:!0}),t[102]=x,t[103]=We);let Ge;t[104]===C?Ge=t[105]:(Ge=(0,Z.jsx)(J_,{open:C,onOpenChange:w,source:`help_menu`}),t[104]=C,t[105]=Ge);let Ke;t[106]===N?Ke=t[107]:(Ke=e=>{A(e),e||(M(!1),N&&(N(null),P(null)))},t[106]=N,t[107]=Ke);let qe;t[108]===n?qe=t[109]:(qe=ws(n),t[108]=n,t[109]=qe);let Je;t[110]===n?Je=t[111]:(Je=gs(n),t[110]=n,t[111]=Je);let Ye=I===`identity`,Xe;t[112]!==j||t[113]!==N?(Xe=e=>{A(!1),j&&(M(!1),v(!0)),N&&(N({authenticated:!0,host:`github.com`,login:e.login}),P(null))},t[112]=j,t[113]=N,t[114]=Xe):Xe=t[114];let Ze;t[115]!==k||t[116]!==Ke||t[117]!==qe||t[118]!==Je||t[119]!==Ye||t[120]!==Xe?(Ze=(0,Z.jsx)(Ss,{open:k,onOpenChange:Ke,transport:qe,queryTransport:Je,identityPrompt:Ye,onSuccess:Xe}),t[115]=k,t[116]=Ke,t[117]=qe,t[118]=Je,t[119]=Ye,t[120]=Xe,t[121]=Ze):Ze=t[121];let Qe;t[122]===n?Qe=t[123]:(Qe=Q0(n),t[122]=n,t[123]=Qe);let $e;t[124]===n?$e=t[125]:($e=gs(n),t[124]=n,t[125]=$e);let et;t[126]===n.dialog?et=t[127]:(et=()=>n.dialog.openFolder(),t[126]=n.dialog,t[127]=et);let tt;t[128]===Symbol.for(`react.memo_cache_sentinel`)?(tt=()=>{v(!1),L(`auth`),M(!0),A(!0)},t[128]=tt):tt=t[128];let nt;t[129]!==z||t[130]!==n?(nt=e=>{let{dir:t}=e;ee(()=>(g(w2(t)),C2(n,t,`pick-existing`).finally(()=>g(null))),z({id:`iSnkwB`}))},t[129]=z,t[130]=n,t[131]=nt):nt=t[131];let rt;t[132]!==_||t[133]!==Qe||t[134]!==$e||t[135]!==et||t[136]!==nt?(rt=(0,Z.jsx)(t2,{open:_,onOpenChange:v,transport:Qe,authQueryTransport:$e,pickParentFolder:et,onSignIn:tt,onCloneComplete:nt}),t[132]=_,t[133]=Qe,t[134]=$e,t[135]=et,t[136]=nt,t[137]=rt):rt=t[137];let it;if(t[138]!==n){let e;t[140]===Symbol.for(`react.memo_cache_sentinel`)?(e=()=>new Promise(e=>{P(()=>e),A(!0)}),t[140]=e):e=t[140],it=X0({bridge:n,authQueryTransport:gs(n),cloneTransport:Q0(n),openSignIn:e}),t[138]=n,t[139]=it}else it=t[139];let at;t[141]!==n||t[142]!==it?(at=(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(p2,{bridge:n,cloneController:it})}),t[141]=n,t[142]=it,t[143]=at):at=t[143];let ot;return t[144]!==ye||t[145]!==Be||t[146]!==Ue||t[147]!==We||t[148]!==Ge||t[149]!==Ze||t[150]!==rt||t[151]!==at?(ot=(0,Z.jsxs)(`div`,{className:`relative flex h-screen w-screen flex-col overflow-hidden bg-primary-foreground dark:bg-background text-foreground`,children:[ve,ye,Be,Ve,He,Ue,We,Ge,Ze,rt,at]}),t[144]=ye,t[145]=Be,t[146]=Ue,t[147]=We,t[148]=Ge,t[149]=Ze,t[150]=rt,t[151]=at,t[152]=ot):ot=t[152],ot}function v2(e){return!e.missing}function y2(e){let t=(0,$.c)(14),{title:n,description:r,onClick:i,dataTestId:a,Icon:o}=e,s;t[0]===o?s=t[1]:(s=o?(0,Z.jsx)(o,{className:`size-4 shrink-0 text-muted-foreground`}):null,t[0]=o,t[1]=s);let c;t[2]===n?c=t[3]:(c=(0,Z.jsx)(`span`,{className:`font-medium text-foreground text-sm`,children:n}),t[2]=n,t[3]=c);let l;t[4]!==s||t[5]!==c?(l=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[s,c]}),t[4]=s,t[5]=c,t[6]=l):l=t[6];let u;t[7]===r?u=t[8]:(u=(0,Z.jsx)(`span`,{className:`line-clamp-2 text-muted-foreground text-xs leading-snug`,children:r}),t[7]=r,t[8]=u);let d;return t[9]!==a||t[10]!==i||t[11]!==l||t[12]!==u?(d=(0,Z.jsxs)(X,{type:`button`,variant:`outline`,onClick:i,"data-testid":a,className:`h-auto flex-col items-start justify-start gap-1.5 whitespace-normal bg-card px-4 py-3.5 text-left`,children:[l,u]}),t[9]=a,t[10]=i,t[11]=l,t[12]=u,t[13]=d):d=t[13],d}var b2=3;function x2(e){let t=(0,$.c)(36),{onPackSelect:n}=e,{_:r}=gt(),[i,a]=(0,Q.useState)(null),[o,s]=(0,Q.useState)(!1),c,l;if(t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=!1;return(async()=>{try{let t=await wv().listPacks();if(e)return;t.ok?a(t.packs):(console.error(`[NavigatorApp] listPacks returned error:`,t),a([]))}catch(t){let n=t;if(e)return;console.error(`[NavigatorApp] listPacks failed:`,n),a([])}})(),()=>{e=!0}},l=[],t[0]=c,t[1]=l):(c=t[0],l=t[1]),(0,Q.useEffect)(c,l),i===null||i.length===0)return null;let u,d,f,p,m,h,g;if(t[2]!==n||t[3]!==i){let e=i.slice(0,b2);u=i.length-e.length,d=e=>{s(!1),n(e,i)},m=`flex flex-wrap items-center gap-x-3 gap-y-2`,h=`nav-starter-packs`,t[11]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Z.jsx)(`span`,{className:`text-muted-foreground text-sm`,children:(0,Z.jsx)(J,{id:`C-xgad`})}),t[11]=g):g=t[11],f=`flex flex-wrap items-center gap-2`;let r;t[12]===d?r=t[13]:(r=e=>{let t=Ev(e.id);return(0,Z.jsxs)(X,{type:`button`,variant:`outline`,size:`sm`,className:`rounded-full`,onClick:()=>d(e.id),"data-testid":`nav-pack-pill-${e.id}`,children:[(0,Z.jsx)(t,{className:`size-3.5 text-muted-foreground`}),e.name]},e.id)},t[12]=d,t[13]=r),p=e.map(r),t[2]=n,t[3]=i,t[4]=u,t[5]=d,t[6]=f,t[7]=p,t[8]=m,t[9]=h,t[10]=g}else u=t[4],d=t[5],f=t[6],p=t[7],m=t[8],h=t[9],g=t[10];let _;t[14]!==r||t[15]!==u||t[16]!==i.length?(_=u>0?(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`sm`,className:`rounded-full`,onClick:()=>s(!0),"aria-label":r({id:`e4FxjG`,values:{0:i.length}}),"data-testid":`nav-pack-more`,children:(0,Z.jsx)(J,{id:`B6Lac2`,values:{overflowCount:u}})}):null,t[14]=r,t[15]=u,t[16]=i.length,t[17]=_):_=t[17];let v;t[18]!==f||t[19]!==p||t[20]!==_?(v=(0,Z.jsxs)(`div`,{className:f,children:[p,_]}),t[18]=f,t[19]=p,t[20]=_,t[21]=v):v=t[21];let y;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(mn,{children:(0,Z.jsx)(J,{id:`tcjTlU`})}),t[22]=y):y=t[22];let b;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Z.jsxs)(vn,{children:[y,(0,Z.jsx)(pn,{children:(0,Z.jsx)(J,{id:`b6Fgpe`})})]}),t[23]=b):b=t[23];let x;t[24]!==i||t[25]!==d?(x=(0,Z.jsxs)(hn,{className:`sm:max-w-3xl`,"data-testid":`nav-pack-picker`,children:[b,(0,Z.jsx)(gn,{children:(0,Z.jsx)(Dv,{packs:i,onPackSelect:d})})]}),t[24]=i,t[25]=d,t[26]=x):x=t[26];let S;t[27]!==o||t[28]!==x?(S=(0,Z.jsx)(yn,{open:o,onOpenChange:s,children:x}),t[27]=o,t[28]=x,t[29]=S):S=t[29];let C;return t[30]!==S||t[31]!==m||t[32]!==h||t[33]!==g||t[34]!==v?(C=(0,Z.jsxs)(`section`,{className:m,"data-testid":h,children:[g,v,S]}),t[30]=S,t[31]=m,t[32]=h,t[33]=g,t[34]=v,t[35]=C):C=t[35],C}function S2(e){let t=(0,$.c)(43),{project:n,branch:r,onOpen:i,onRemove:a}=e,{_:o}=gt(),{name:s}=n,c=n.isLinkedWorktree===!0,l=c?n.branch??r:r,u=n.path,d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(Hh,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-muted-foreground`}),t[0]=d):d=t[0];let f;t[1]===n.name?f=t[2]:(f=(0,Z.jsx)(`span`,{className:`truncate font-medium text-sm text-gray-700 dark:text-foreground`,children:n.name}),t[1]=n.name,t[2]=f);let p;t[3]===c?p=t[4]:(p=c?(0,Z.jsxs)(Eu,{variant:`secondary`,className:`shrink-0 gap-1 rounded-full border-transparent bg-green-600/10 px-2 py-0 font-medium text-2xs text-green-800 dark:bg-green-400/10 dark:text-green-400`,children:[(0,Z.jsx)(po,{"aria-hidden":`true`,className:`size-2.5`}),(0,Z.jsx)(J,{id:`z-lawV`})]}):null,t[3]=c,t[4]=p);let m;t[5]!==f||t[6]!==p?(m=(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[f,p]}),t[5]=f,t[6]=p,t[7]=m):m=t[7];let h=c?n.mainRoot??``:n.path,g;t[8]!==c||t[9]!==n.mainRoot||t[10]!==n.path?(g=c?(0,Z.jsx)(J,{id:`PRnH8G`,values:{0:Zv(n.mainRoot??``)}}):n.path,t[8]=c,t[9]=n.mainRoot,t[10]=n.path,t[11]=g):g=t[11];let _;t[12]!==h||t[13]!==g?(_=(0,Z.jsx)(`span`,{className:`truncate w-full text-muted-foreground text-xs`,title:h,children:g}),t[12]=h,t[13]=g,t[14]=_):_=t[14];let v;t[15]!==m||t[16]!==_?(v=(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[d,(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1 truncate`,children:[m,_]})]}),t[15]=m,t[16]=_,t[17]=v):v=t[17];let y;t[18]!==n.path||t[19]!==l?(y=l==null?null:(0,Z.jsxs)(`span`,{className:`flex max-w-[40%] items-center gap-1 text-muted-foreground text-xs`,"data-testid":`nav-recent-branch-${n.path}`,children:[(0,Z.jsx)(po,{"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,Z.jsx)(`span`,{className:`truncate font-mono`,children:l})]}),t[18]=n.path,t[19]=l,t[20]=y):y=t[20];let b;t[21]!==i||t[22]!==y||t[23]!==v?(b=(0,Z.jsxs)(X,{type:`button`,variant:`ghost`,onClick:i,className:`h-auto min-w-0 flex-1 justify-between gap-3 py-3.5 pl-4 pr-2 text-left hover:bg-transparent`,children:[v,y]}),t[21]=i,t[22]=y,t[23]=v,t[24]=b):b=t[24];let x;t[25]!==o||t[26]!==s?(x=o({id:`hDoLrm`,values:{projectName:s}}),t[25]=o,t[26]=s,t[27]=x):x=t[27];let S;t[28]===o?S=t[29]:(S=o({id:`Es-eZU`}),t[28]=o,t[29]=S);let C=`nav-recent-remove-${n.path}`,w;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Z.jsx)(hl,{"aria-hidden":`true`}),t[30]=w):w=t[30];let T;t[31]!==a||t[32]!==x||t[33]!==S||t[34]!==C?(T=(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-sm`,onClick:a,"aria-label":x,title:S,className:`pointer-events-none mr-2 opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 focus-visible:pointer-events-auto focus-visible:opacity-100`,"data-testid":C,children:w}),t[31]=a,t[32]=x,t[33]=S,t[34]=C,t[35]=T):T=t[35];let E;t[36]!==b||t[37]!==T?(E=(0,Z.jsxs)(`li`,{className:`group flex items-center justify-between rounded-lg hover:bg-accent`,children:[b,T]}),t[36]=b,t[37]=T,t[38]=E):E=t[38];let D;return t[39]!==a||t[40]!==n.path||t[41]!==E?(D=(0,Z.jsx)(dy,{path:u,onRemoveRecent:a,testIdPrefix:`nav-recent`,children:E}),t[39]=a,t[40]=n.path,t[41]=E,t[42]=D):D=t[42],D}async function C2(e,t,n){await e.project.open({path:t,target:`new-window`,entryPoint:n})}function w2(e){let t=e.split(/[/\\]/).filter(Boolean);return t.length>0?t[t.length-1]??e:e}var T2=(0,Q.lazy)(()=>n(()=>import(`./TerminalWindowApp-DFkdh_Dr.js`).then(e=>({default:e.TerminalWindowApp})),__vite__mapDeps([181,1,84,6,2,3,7,8,9,68,12,22,11,85,86,87,165,111,17,47,10,14,15,16,49,112,113,30,31,19,24,25,50,20,92,89,29,51,26,118,105,36,166,121,106,39,41,42,33,98,38,27,99,137,138,164,167,122,182,183]),import.meta.url));function E2(e){return e?.config.mode===`terminal`?(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(T2,{bridge:e})}):e?.config.mode===`navigator`?(0,Z.jsx)(_2,{bridge:e}):(0,Z.jsx)(K0,{})}function D2(){let e=null,t=new Set,n=!1,r=null;function i(){for(let e of t)e()}function a(){e!==null&&(e=null,i())}return{install({bridge:t}){let o=t?.bugReport?.onCrashDetected;if(typeof o==`function`)return n?r??void 0:(n=!0,r=o(t=>{e=t,i()}),()=>{r?.(),r=null,n=!1,a()})},getSnapshot(){return e},subscribe(e){return t.add(e),()=>{t.delete(e)}},dismiss(){a()}}}var O2=D2();function k2(e){return O2.install(e)}function A2(e){let t=(0,$.c)(7),{bridge:n}=e,r=(0,Q.useSyncExternalStore)(O2.subscribe,O2.getSnapshot);if(r===null)return null;let i;t[0]!==n.bugReport||t[1]!==r?(i=e=>{e||(n.bugReport.crashAck({eventId:r.eventId}),O2.dismiss())},t[0]=n.bugReport,t[1]=r,t[2]=i):i=t[2];let a=n.config.mode===`navigator`,o;return t[3]!==r||t[4]!==i||t[5]!==a?(o=(0,Z.jsx)(lm,{open:!0,onOpenChange:i,systemWide:a,crashInvite:r}),t[3]=r,t[4]=i,t[5]=a,t[6]=o):o=t[6],o}var j2=e=>{let t=(0,$.c)(8),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let{theme:r}=Lt(),i=r===void 0?`system`:r,a,o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a={success:(0,Z.jsx)(Yo,{className:`size-4`}),info:(0,Z.jsx)(Yc,{className:`size-4`}),warning:(0,Z.jsx)(ul,{className:`size-4`}),error:(0,Z.jsx)(rg,{className:`size-4`}),loading:(0,Z.jsx)(Xc,{className:`size-4 animate-spin`})},o={"--normal-bg":`var(--popover)`,"--normal-text":`var(--popover-foreground)`,"--normal-border":`var(--border)`,"--border-radius":`var(--radius)`},t[2]=a,t[3]=o):(a=t[2],o=t[3]);let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s={classNames:{toast:`cn-toast`}},t[4]=s):s=t[4];let c;return t[5]!==n||t[6]!==i?(c=(0,Z.jsx)(_l,{theme:i,className:`toaster group`,icons:a,style:o,toastOptions:s,...n}),t[5]=n,t[6]=i,t[7]=c):c=t[7],c},M2=Symbol.for(`ok.client.fetchWrapper`);function N2(e={}){if(typeof window>`u`)return;let t=e.apiOrigin&&e.apiOrigin.length>0?e.apiOrigin:void 0;if(window.fetch[M2])return;let n=window.fetch.bind(window),r=Pu(),i=((e,i)=>{let a=F2(e,t);if(!a.isApi)return n(e,i);if(e instanceof Request){let t=P2(e.headers,r);return n(new Request(a.url,e),{headers:t})}let o=P2(i?.headers,r);return n(a.url,{...i,headers:o})});i[M2]=!0,window.fetch=i}function P2(e,t){let n=new Headers(e);for(let[e,r]of Object.entries(t))n.set(e,r);return n}function F2(e,t){if(typeof e==`string`){if(e.startsWith(`/api/`))return{isApi:!0,url:t?t+e:e};let n=I2(e);return n&&L2(n,t)?{isApi:!0,url:e}:{isApi:!1,url:e}}let n=e instanceof URL?e:I2(e.url,window.location.origin);if(n&&L2(n,t)){let r=e instanceof URL?e.href:e.url;return t&&(n.origin===window.location.origin||n.protocol===`file:`)?{isApi:!0,url:t+n.pathname+n.search+n.hash}:{isApi:!0,url:r}}return{isApi:!1,url:e instanceof URL?e.href:e.url}}function I2(e,t){try{return new URL(e,t)}catch{return null}}function L2(e,t){if(!e.pathname.startsWith(`/api/`))return!1;if(e.origin===window.location.origin||e.protocol===`file:`)return!0;if(t){let n=I2(t);if(n&&e.origin===n.origin)return!0}return!1}var R2=Symbol.for(`ok.client.logForwarder`),z2=2e3,B2=[`log`,`info`,`warn`,`error`],V2={log:`info`,info:`info`,warn:`warn`,error:`error`};function H2(e){if(typeof e==`string`)return e;if(e instanceof Error)return`${e.name}: ${e.message}`;try{return JSON.stringify(e)??String(e)}catch{return String(e)}}function U2(e){let t=e.message.length+80;if(e.event&&(t+=e.event.length),e.fields)try{t+=JSON.stringify(e.fields).length}catch{}return t}function W2(e={}){let t=e.windowObj??(typeof window<`u`?window:void 0);if(!t||t.okDesktop)return;let n=t;if(n[R2])return;n[R2]=!0;let r=e.consoleObj??console,i=e.documentObj===void 0?typeof document<`u`?document:null:e.documentObj,a=e.flushIntervalMs??z2,o=e.fetchImpl??n.fetch.bind(n),s=e.now??Date.now,c=[],l=0,u=null,d=!1,f=0,p={log:r.log.bind(r),info:r.info.bind(r),warn:r.warn.bind(r),error:r.error.bind(r)};function m(){if(u!==null&&(clearTimeout(u),u=null),c.length===0)return;let e=c.splice(0,100);l=0;let t=f;d=!0;try{o(`/api/client-logs`,{method:`POST`,headers:{"content-type":`application/json`},keepalive:!0,body:JSON.stringify(t>0?{entries:e,droppedSinceLastFlush:t}:{entries:e})}).then(n=>{n.ok?f=Math.max(0,f-t):f+=e.length},()=>{f+=e.length})}catch{f+=e.length}finally{d=!1}}function h(e){if(c.push(e),l+=U2(e),c.length>100){let e=c.shift();e&&(l-=U2(e),f+=1)}if(c.length>=100||l>=32768){m();return}u===null&&(u=setTimeout(m,a))}function g(e,t){if(!d)try{let n=Ca(ca(t.map(H2).join(` `))),r=t[0],i=typeof r==`string`&&r.length<=32768?r:void 0,a=i?Qi(i):null,o=a?.fields;if(o)try{JSON.stringify(o).length>8192&&(o=void 0)}catch{o=void 0}h({level:e,message:n,ts:s(),...a?.event?{event:a.event}:{},...o?{fields:o}:{}})}catch{}}for(let e of B2)r[e]=(...t)=>{p[e](...t),g(V2[e],t)};let _=e=>{if(d)return;let t=e;g(`error`,[`uncaught error: ${t.message} (${t.filename}:${t.lineno}:${t.colno})`])},v=e=>{d||g(`error`,[`unhandledrejection: ${H2(e.reason)}`])},y=()=>m(),b=()=>{i&&i.visibilityState===`hidden`&&m()};n.addEventListener(`error`,_),n.addEventListener(`unhandledrejection`,v),n.addEventListener(`pagehide`,y),i&&i.addEventListener(`visibilitychange`,b);function x(){for(let e of B2)r[e]=p[e];n.removeEventListener(`error`,_),n.removeEventListener(`unhandledrejection`,v),n.removeEventListener(`pagehide`,y),i&&i.removeEventListener(`visibilitychange`,b),u!==null&&(clearTimeout(u),u=null),c.length=0,delete n[R2]}return{flushNow:m,uninstall:x}}function G2(e,t){return e.branch===void 0||e.branch===null||e.branch===``||t===``||e.multiCandidate!==!0?null:{message:`Opened on branch ${e.branch}`,description:t}}function K2(e){let t=e.bridge;if(!t)return;let n=e.setHash??(e=>{window.location.hash=e}),r=e.emitToast??((e,t)=>{gl(e,t)});return t.onDeepLink(e=>{let i=e.kind??`doc`,a={kind:i,path:e.doc,branch:e.branch??null};if(e.targetMissing===!0){Zc.arm(a);return}uc.arm(a),n(_u(i,e.doc,i===`doc`?e.branch:void 0));let o=G2(e,t.config.projectPath);o!==null&&r(o.message,{description:o.description,duration:3e3})})}var q2=4e3,J2=1440*60*1e3;function Y2(e){let t=e.bridge;if(t&&t.onboarding)return t.onboarding.onToast(e=>{if(e.kind===`ancestor-promote`){gl.success(`Opened existing OpenKnowledge project at ${e.ancestorPath}`,{duration:q2});return}if(e.kind===`startup-reclaim`){let t=[];if(e.mcp.status===`repaired`){let n=e.mcp.editors.map(e=>Ai[e]??e).join(`, `);t.push(`repaired ${n} MCP integration`)}else e.mcp.status===`failed`&&t.push(`MCP auto-repair failed`);e.path.status===`installed`&&t.push(e.path.summary),e.path.status===`failed`&&t.push(`PATH install failed: ${e.path.summary}`);let n=t.length>0?t.join(`; `):`OpenKnowledge integrations checked.`,r=e.mcp.status===`failed`||e.path.status===`failed`,i=e.path.status!==`none`;gl[r?`error`:`success`](n,{duration:r||i?J2:q2,position:`bottom-left`});return}if(e.kind===`sharing-refused-tracked`){gl.error(`Config sharing unchanged: ${e.tracked.length} OK file(s) tracked upstream — see message below.`,{duration:J2,description:e.remediation});return}if(e.kind===`sharing-no-git`){gl.warning(`Local-only requested but no git repository was created. Switch later via Settings → Config sharing once the project is in a git repo.`,{duration:q2});return}let t=bl(e.gitRoot,e.pickedPath)??e.pickedPath;gl.success(`Initialized OpenKnowledge at ${e.gitRoot} — opened parent of ${t} because it contains a .git folder`,{duration:q2})})}function X2(e){return Cl._({id:`wXw19Y`,values:{projectName:e}})}function Z2(e){let t=e.bridge;if(t)return t.onRecentRemovedMissing(({projectName:e})=>{gl(X2(e))})}function Q2(e){let t=(0,$.c)(18),{body:n,warning:r,restartLabel:i,cancelLabel:a,onRestart:o,onDismiss:s}=e,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(ul,{className:`mt-0.5 size-4 shrink-0 text-amber-500`}),t[0]=c):c=t[0];let l;t[1]===n?l=t[2]:(l=(0,Z.jsx)(`p`,{className:`font-medium text-sm`,children:n}),t[1]=n,t[2]=l);let u;t[3]===r?u=t[4]:(u=(0,Z.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:r}),t[3]=r,t[4]=u);let d;t[5]!==o||t[6]!==i?(d=(0,Z.jsx)(X,{size:`sm`,onClick:o,children:i}),t[5]=o,t[6]=i,t[7]=d):d=t[7];let f;t[8]!==a||t[9]!==s?(f=(0,Z.jsx)(X,{size:`sm`,variant:`ghost`,onClick:s,children:a}),t[8]=a,t[9]=s,t[10]=f):f=t[10];let p;t[11]!==d||t[12]!==f?(p=(0,Z.jsxs)(`div`,{className:`mt-1 flex flex-wrap gap-2`,children:[d,f]}),t[11]=d,t[12]=f,t[13]=p):p=t[13];let m;return t[14]!==l||t[15]!==u||t[16]!==p?(m=(0,Z.jsxs)(`div`,{className:`flex w-full gap-3 rounded-lg border bg-popover p-4 text-popover-foreground shadow-lg`,children:[c,(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[l,u,p]})]}),t[14]=l,t[15]=u,t[16]=p,t[17]=m):m=t[17],m}function $2(){return Cl._({id:`f_PkYv`})}function e4(e){return e.serverRuntime===e.appRuntime?Cl._({id:`FWQuPE`,values:{0:e.appRuntime}}):e.relation===`older`?Cl._({id:`LhQlGR`,values:{0:e.serverRuntime,1:e.appRuntime}}):Cl._({id:`yZmvQ4`,values:{0:e.serverRuntime,1:e.appRuntime}})}function t4(e){return Cl._({id:`2YOwme`,values:{appRuntime:e}})}function n4(e){return e===`eperm`?Cl._({id:`uQewpR`}):Cl._({id:`PqYWiC`})}async function r4(e){let t=gl.loading(Cl._({id:`Kf7GG5`}),{duration:1/0}),n;try{n=await e.restartServer(e.config.projectPath)}catch{return}gl.dismiss(t),n.ok===!1&&gl.error(n4(n.reason),{duration:1/0})}function i4(e){let t=e.bridge;if(!t)return;let n=t.onServerVersionDrift(e=>{gl.custom(n=>(0,Q.createElement)(Q2,{body:e4(e),warning:$2(),restartLabel:Cl._({id:`ppDgFi`}),cancelLabel:Cl._({id:`PBxg_E`}),onRestart:()=>{gl.dismiss(n),r4(t)},onDismiss:()=>gl.dismiss(n)}),{duration:1/0})}),r=t.onServerRestarted(e=>{gl.success(t4(e.appRuntime))});return()=>{n(),r()}}async function a4(e=typeof navigator<`u`?navigator:void 0){try{let t=e?.storage;return t===void 0||typeof t.persist!=`function`?!1:await t.persist()}catch{return!1}}function o4(e){let{initialDoc:t}=e;if(!t)return;let n=e.getHash();n!==``&&n!==`#`&&n!==`#/`||e.setHash(Cu(t))}function s4(){typeof window>`u`||!window.okDesktop||o4({initialDoc:window.okDesktop.config.initialDoc,getHash:()=>window.location.hash,setHash:e=>{window.location.hash=e}})}Cp(),n(()=>import(`./telemetry-startup-DEYbhmGw.js`).then(e=>e.initStartupTrace()),__vite__mapDeps([184,0,1,2,3,4,67,22,12,11]),import.meta.url),N2({apiOrigin:typeof window<`u`?window.okDesktop?.config.apiOrigin:void 0}),W2(),a4(),LD()&&UD(),pz(),UE(),IL(),SL(),XF(),typeof window<`u`&&K2({bridge:window.okDesktop}),typeof window<`u`&&i4({bridge:window.okDesktop}),typeof window<`u`&&Z2({bridge:window.okDesktop}),typeof window<`u`&&bp({bridge:window.okDesktop}),typeof window<`u`&&yl({bridge:window.okDesktop}),typeof window<`u`&&Y2({bridge:window.okDesktop}),typeof window<`u`&&Sp({bridge:window.okDesktop}),typeof window<`u`&&k2({bridge:window.okDesktop}),s4();var c4=new kp({defaultOptions:{queries:{retry:1,staleTime:1e4}}}),l4=document.getElementById(`root`);if(!l4)throw Error(`Root element not found`);var u4=typeof window>`u`?void 0:window.okDesktop;function d4(){return oi(),null}(0,Ap.createRoot)(l4).render((0,Z.jsx)(Q.StrictMode,{children:(0,Z.jsx)(_t,{i18n:Cl,children:(0,Z.jsxs)(Ot,{client:c4,children:[(0,Z.jsx)(hh,{}),(0,Z.jsxs)(Rt,{attribute:`class`,defaultTheme:`system`,enableSystem:!0,disableTransitionOnChange:!0,storageKey:`ok-theme-v1`,children:[(0,Z.jsx)(d4,{}),(0,Z.jsxs)(cn,{children:[(0,Z.jsx)(dh,{children:E2(u4)}),u4!==void 0&&(0,Z.jsx)(ph,{children:(0,Z.jsx)(A2,{bridge:u4})})]}),(0,Z.jsx)(j2,{richColors:!0,closeButton:!0})]})]})})}));export{Rz as t};