decocms 4.3.0 → 4.4.0

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 (249) hide show
  1. package/dist/client/assets/{AlertCircle-DC-zDzV-.js → AlertCircle-CM6D9elR.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-OJZisFPQ.js → ArrowUpRight-Kqa5fEjt.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-Cgnheu-R.js → CheckCircle-8DKF8Yx5.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-DyHvxYlc.js → ChevronDown-DGuR7uUZ.js} +1 -1
  5. package/dist/client/assets/{ChevronRight-Cpfh3gza.js → ChevronRight-BswIt99A.js} +1 -1
  6. package/dist/client/assets/{ChevronUp-DBpw6M-L.js → ChevronUp-DSdWQUoR.js} +1 -1
  7. package/dist/client/assets/{DotsVertical-5jSu3d1f.js → DotsVertical-DSosYpI1.js} +1 -1
  8. package/dist/client/assets/{Eye-bojNLUjA.js → Eye-Dn1AISrx.js} +1 -1
  9. package/dist/client/assets/{FilterLines-CFl65nng.js → FilterLines-CmWI-8pG.js} +1 -1
  10. package/dist/client/assets/{Globe01-CyfpzbeQ.js → Globe01-CcXDI4W7.js} +1 -1
  11. package/dist/client/assets/{Globe04-DFpdKSRI.js → Globe04-B9Btoycr.js} +1 -1
  12. package/dist/client/assets/{HardDrive-B1mtnaeA.js → HardDrive-BqXWgcmp.js} +1 -1
  13. package/dist/client/assets/{Key01-CwrJlZo0.js → Key01-F6-x7vNY.js} +1 -1
  14. package/dist/client/assets/{LayoutLeft-fsm0LcB8.js → LayoutLeft-DpqtgcH3.js} +1 -1
  15. package/dist/client/assets/{LinkExternal01-BHwVyDja.js → LinkExternal01-DOU6-C1w.js} +1 -1
  16. package/dist/client/assets/{Monitor01-ChA6ov2I.js → Monitor01-SkSQUhmT.js} +1 -1
  17. package/dist/client/assets/{Palette-DusYqL0W.js → Palette-CnoObDqZ.js} +1 -1
  18. package/dist/client/assets/{Play-CnXG8qqP.js → Play-DzGcMRv3.js} +1 -1
  19. package/dist/client/assets/{Plus-eGxBB1d8.js → Plus-DDlkoJBs.js} +1 -1
  20. package/dist/client/assets/{SearchLg-CDpA_lbT.js → SearchLg-CdT_y89m.js} +1 -1
  21. package/dist/client/assets/{SearchMd-ujiTPCmg.js → SearchMd-UY2xUREv.js} +1 -1
  22. package/dist/client/assets/{Settings02-BcAnTzm5.js → Settings02-QyYEyYyn.js} +1 -1
  23. package/dist/client/assets/{Shield01-ZxmFmrvL.js → Shield01-V8b5EFFL.js} +1 -1
  24. package/dist/client/assets/{Star01-DHEkWySe.js → Star01-GVe4t6O1.js} +1 -1
  25. package/dist/client/assets/{Stars01-BdCaKqhF.js → Stars01-BIVPeWqS.js} +1 -1
  26. package/dist/client/assets/{Stars02-qnq-_X9g.js → Stars02-DVZm69DV.js} +1 -1
  27. package/dist/client/assets/{Sun-lTiqxOzH.js → Sun-B2ndPBZP.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-DAZXInW8.js → SwitchHorizontal01-BL4xnvxO.js} +1 -1
  29. package/dist/client/assets/{Tool01-CvnpFI53.js → Tool01-Ci5EQ1tM.js} +1 -1
  30. package/dist/client/assets/{Trash01-ByxlxTiZ.js → Trash01-Cc007jho.js} +1 -1
  31. package/dist/client/assets/{Upload01-Z77n1bV8.js → Upload01-DB9meUjO.js} +1 -1
  32. package/dist/client/assets/{User01-COQtf360.js → User01-Dz-_mMMJ.js} +1 -1
  33. package/dist/client/assets/{Users01-wtRJYQKX.js → Users01-Ctg0iuAM.js} +1 -1
  34. package/dist/client/assets/{Users03-DknrDMtT.js → Users03-BazvU-rC.js} +1 -1
  35. package/dist/client/assets/{X-DrMVHLcw.js → X-_dGiBqSn.js} +1 -1
  36. package/dist/client/assets/{XCircle-Ct0eqqsw.js → XCircle-CmN6DNsv.js} +1 -1
  37. package/dist/client/assets/{XClose-BaZ908gw.js → XClose-BpreRuFP.js} +1 -1
  38. package/dist/client/assets/{Zap-wRIFSWIq.js → Zap-CWxLsQ6b.js} +1 -1
  39. package/dist/client/assets/{ZapSquare-PMiGcZpW.js → ZapSquare-D5x1wm0t.js} +1 -1
  40. package/dist/client/assets/{ZoomOut-6ix2H92j.js → ZoomOut-C0bVPfpC.js} +1 -1
  41. package/dist/client/assets/{access-gate-D6dGDGRI.js → access-gate-CpQ3bOMg.js} +1 -1
  42. package/dist/client/assets/{add-section-modal-DOhGqRCL.js → add-section-modal-D22Rp_ry.js} +1 -1
  43. package/dist/client/assets/agent-icon-BjxA8YR3.js +1 -0
  44. package/dist/client/assets/agents-list-C17XwfcN.js +1 -0
  45. package/dist/client/assets/{ai-providers-Crp7kidL.js → ai-providers-DNjwL7U0.js} +1 -1
  46. package/dist/client/assets/{alert-CKj_5smu.js → alert-CTzYtGwN.js} +1 -1
  47. package/dist/client/assets/{alert-dialog-CYizItFp.js → alert-dialog-DMWXmTGp.js} +2 -2
  48. package/dist/client/assets/app-editor-uAXMllzs.js +1 -0
  49. package/dist/client/assets/{auth-Bej0Tx2Y.js → auth-DraSXrC6.js} +1 -1
  50. package/dist/client/assets/{auth-catchall-CmNVpp-8.js → auth-catchall--3ZAEbBd.js} +1 -1
  51. package/dist/client/assets/{auth-entry-PwLVm-jX.js → auth-entry-DRJ-aW15.js} +1 -1
  52. package/dist/client/assets/{auth-split-layout-5YwPgbAb.js → auth-split-layout-B77S9w6i.js} +1 -1
  53. package/dist/client/assets/{authenticate-and-persist-oauth-DoPUB_Bh.js → authenticate-and-persist-oauth-HBteAcVm.js} +1 -1
  54. package/dist/client/assets/{automation-list-row-CsTyBm4M.js → automation-list-row-NZNZGrlr.js} +1 -1
  55. package/dist/client/assets/automation-runs-BoQeZ1gh.js +1 -0
  56. package/dist/client/assets/automations-bd5MK3eJ.js +1 -0
  57. package/dist/client/assets/{avatar-CJP1BOq4.js → avatar-COMRxqae.js} +1 -1
  58. package/dist/client/assets/{badge-DhpSM7g_.js → badge-B1dPfLuK.js} +1 -1
  59. package/dist/client/assets/{block-document-B2vhG8Ii.js → block-document-B6TgjyKW.js} +2 -2
  60. package/dist/client/assets/{brand-context-BRpHgxfT.js → brand-context-DGv078pp.js} +1 -1
  61. package/dist/client/assets/{buckets-DDR0G33f.js → buckets-LnyV7EWC.js} +1 -1
  62. package/dist/client/assets/bulk-category-panel-BP0Mtj3P.js +1 -0
  63. package/dist/client/assets/{capability-load-error-CCgNL5xi.js → capability-load-error-WTr85D-I.js} +1 -1
  64. package/dist/client/assets/{card-BFb5m83e.js → card-Bys-wDTW.js} +1 -1
  65. package/dist/client/assets/category-editor-Cm1sAVk_.js +1 -0
  66. package/dist/client/assets/{chat-context-n9syhvq-.js → chat-context-huSCeR82.js} +4 -4
  67. package/dist/client/assets/{checkbox-DmOzmKLP.js → checkbox-BIDlFz_0.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-BVPtMYcv.js → cli-auth-success-DJ5lbMQC.js} +1 -1
  69. package/dist/client/assets/collection-detail-UTQtN0-J.js +1 -0
  70. package/dist/client/assets/{collection-display-button-Bf9dlJRy.js → collection-display-button-Bnm_JutP.js} +1 -1
  71. package/dist/client/assets/{collection-search-8iNXnGlM.js → collection-search-CKMDHnku.js} +1 -1
  72. package/dist/client/assets/{collection-tabs-KA2be3wH.js → collection-tabs-CWrBkWhe.js} +1 -1
  73. package/dist/client/assets/{command-C34397s2.js → command-DrgMAh0a.js} +1 -1
  74. package/dist/client/assets/commerce-onboarding-B8pBrcvE.js +1 -0
  75. package/dist/client/assets/{connect-desktop-dialog-Brra3cMC.js → connect-desktop-dialog-CvuFk-NY.js} +1 -1
  76. package/dist/client/assets/{connection-card-C6NYo4Gp.js → connection-card-DIh-SIqT.js} +1 -1
  77. package/dist/client/assets/connection-detail-CWog7XFK.js +1 -0
  78. package/dist/client/assets/{connection-form-helpers-CwZx7WkC.js → connection-form-helpers-DV-bwjt7.js} +1 -1
  79. package/dist/client/assets/connections-BkvcH3F-.js +1 -0
  80. package/dist/client/assets/{context-menu-BW_OZBmV.js → context-menu-BPHfkJEs.js} +1 -1
  81. package/dist/client/assets/{decopilot-BItqS11w.js → decopilot-BxOK0Z8W.js} +1 -1
  82. package/dist/client/assets/{decopilot-sse-pool-CvYk1hkc.js → decopilot-sse-pool-Chmwc1_x.js} +1 -1
  83. package/dist/client/assets/{dialog-BAqFyO8a.js → dialog-o7scRbG9.js} +1 -1
  84. package/dist/client/assets/{domain-settings-r_E3rHsG.js → domain-settings-DIv14WFm.js} +1 -1
  85. package/dist/client/assets/{drawer-CFkqEC3w.js → drawer-B-Vy7tMY.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-C62KNjwK.js → dropdown-menu-D-VNET4I.js} +1 -1
  87. package/dist/client/assets/{empty-state-Sh_DuDcy.js → empty-state-1p_UpPHY.js} +1 -1
  88. package/dist/client/assets/{extract-connection-data-D6bQrejT.js → extract-connection-data-BVX9Eneo.js} +1 -1
  89. package/dist/client/assets/file-explorer-Bh9kp1sm.js +2 -0
  90. package/dist/client/assets/{file-type-icon-DPWxBpNL.js → file-type-icon-LHBbJJTG.js} +1 -1
  91. package/dist/client/assets/{files-B9ekmQa_.js → files-Bw3w16xX.js} +1 -1
  92. package/dist/client/assets/{form-DGE2mWLL.js → form-DX8cQ4SA.js} +1 -1
  93. package/dist/client/assets/{general-BMDKtyZB.js → general-DzJAxzRR.js} +1 -1
  94. package/dist/client/assets/{github-repo-picker-B5tZucJa.js → github-repo-picker-ZmfhFTO6.js} +1 -1
  95. package/dist/client/assets/{hooks-CUSV6Enf.js → hooks-BUt6AoQh.js} +6 -6
  96. package/dist/client/assets/{import-from-deco-dialog-M3CP3Gmn.js → import-from-deco-dialog-DZhtwoRn.js} +1 -1
  97. package/dist/client/assets/{index-Bb-tYGNK.js → index-BBTFoidO.js} +1 -1
  98. package/dist/client/assets/{index-CkTyYAY1.js → index-BPD9Iyv5.js} +1 -1
  99. package/dist/client/assets/index-BcXb7VeZ.css +1 -0
  100. package/dist/client/assets/index-CAV1BNai.js +173 -0
  101. package/dist/client/assets/{index-mEtg0zTM.js → index-CL3KBg-D.js} +1 -1
  102. package/dist/client/assets/{index-CFiyU0D9.js → index-CXy6rN6i.js} +3 -3
  103. package/dist/client/assets/{index-DGzNvPy2.js → index-CjKis1yy.js} +1 -1
  104. package/dist/client/assets/{index-jBUpmiBg.js → index-Cod7u1PQ.js} +1 -1
  105. package/dist/client/assets/{index-CRxAjd1d.js → index-CpgVJVWB.js} +27 -27
  106. package/dist/client/assets/{index-B6hcksS9.js → index-DCwPnlYH.js} +1 -1
  107. package/dist/client/assets/index-DKs6HTlj.js +1 -0
  108. package/dist/client/assets/{index-Dj7TxcSd.js → index-Db3cPjnW.js} +2 -2
  109. package/dist/client/assets/index-DvDkdoxH.js +1 -0
  110. package/dist/client/assets/{index-hmJjUPum.js → index-NJ9aYDVC.js} +1 -1
  111. package/dist/client/assets/{index-DIBoN36v.js → index-VkScKLdP.js} +1 -1
  112. package/dist/client/assets/{index-redirect-C9Kkmz45.js → index-redirect-B6MtHNAq.js} +1 -1
  113. package/dist/client/assets/{input-BwRH-Gsz.js → input-BlhkemhH.js} +1 -1
  114. package/dist/client/assets/{integration-icon-LQhkkaLl.js → integration-icon-BSHD1Ijr.js} +1 -1
  115. package/dist/client/assets/{label-CdBSUJpf.js → label-CL8Vh65B.js} +1 -1
  116. package/dist/client/assets/{login-d0UWtw9N.js → login-B4UwjrwL.js} +1 -1
  117. package/dist/client/assets/{mcp-oauth-IblqU9XT.js → mcp-oauth-CXj7zg3h.js} +1 -1
  118. package/dist/client/assets/{members-Bpdrl2e9.js → members-CZJJNFCT.js} +1 -1
  119. package/dist/client/assets/{monaco-editor-5JIc-lnc.js → monaco-editor-DBScTPL_.js} +2 -2
  120. package/dist/client/assets/{monitoring-stats-row-DPsQ-OAn.js → monitoring-stats-row-DS-oLjL7.js} +1 -1
  121. package/dist/client/assets/{oauth-callback-B1AvYYRn.js → oauth-callback-DmaJ1bda.js} +1 -1
  122. package/dist/client/assets/{oauth-callback-ai-provider-BtGHmjpp.js → oauth-callback-ai-provider-BQMnSXh3.js} +1 -1
  123. package/dist/client/assets/{onboarding-DfUmI7F5.js → onboarding-Byb6DxyK.js} +1 -1
  124. package/dist/client/assets/{org-install-CpJAFt1s.js → org-install-DE37K5KN.js} +1 -1
  125. package/dist/client/assets/{org-layout-BsuFzdH_.js → org-layout-des0Y5a9.js} +1 -1
  126. package/dist/client/assets/{organization-choice-DrxWffZp.js → organization-choice-COkZ5W_o.js} +1 -1
  127. package/dist/client/assets/{page-seo-form-BLqpZnj6.js → page-seo-form-BcrUATEU.js} +1 -1
  128. package/dist/client/assets/page-seo-sheet-D1Z6hzyV.js +1 -0
  129. package/dist/client/assets/popover-SD8gnUXm.js +1 -0
  130. package/dist/client/assets/post-editor-BDlfII0z.js +1 -0
  131. package/dist/client/assets/{primitives-BF1opf4F.js → primitives-CVsZF3ex.js} +1 -1
  132. package/dist/client/assets/{profile-C8meo3ry.js → profile-DBUkydtR.js} +1 -1
  133. package/dist/client/assets/project-app-view-Bk8oTYIF.js +1 -0
  134. package/dist/client/assets/record-editor-DL8IQ3xy.js +1 -0
  135. package/dist/client/assets/registry-Bd0JPSYO.js +2 -0
  136. package/dist/client/assets/{registry-layout-C4UMhzml.js → registry-layout-BL9jjFNp.js} +1 -1
  137. package/dist/client/assets/{require-capability--mIKExbX.js → require-capability-CLQ4GBGj.js} +1 -1
  138. package/dist/client/assets/{required-auth-layout-DDJmFi3U.js → required-auth-layout-BzYoSj-D.js} +1 -1
  139. package/dist/client/assets/{reset-password-CuNa1ife.js → reset-password-C3Zmx-Z-.js} +1 -1
  140. package/dist/client/assets/roles-RwbAlbhC.js +1 -0
  141. package/dist/client/assets/{scroll-area-BM-54tW1.js → scroll-area-DgIklajW.js} +54 -54
  142. package/dist/client/assets/{search-input-M7ubuBMG.js → search-input-BwHA7yOt.js} +1 -1
  143. package/dist/client/assets/{secrets-BN1JMG5V.js → secrets-Cu_Gp7gT.js} +1 -1
  144. package/dist/client/assets/{sections-editor-Buouhx1S.js → sections-editor-CaNl1tLu.js} +2 -2
  145. package/dist/client/assets/select-DM3pFFAV.js +1 -0
  146. package/dist/client/assets/{select-model-Cz9R_UN3.js → select-model-C1odlJ1X.js} +1 -1
  147. package/dist/client/assets/seo-editor-C28ZayGa.js +1 -0
  148. package/dist/client/assets/settings-layout-C_nc5y3_.js +1 -0
  149. package/dist/client/assets/{settings-section-MeT61nuY.js → settings-section-6b9w_VoZ.js} +1 -1
  150. package/dist/client/assets/{sheet-DyU03ddw.js → sheet-BJF6qruz.js} +1 -1
  151. package/dist/client/assets/shell-controls-C9tE75mS.js +1 -0
  152. package/dist/client/assets/{shell-layout-Nyz7GHu7.js → shell-layout-gi6XYvgE.js} +1 -1
  153. package/dist/client/assets/shell-route-loading-Agan4lHM.js +1 -0
  154. package/dist/client/assets/{sidebar-BNrafefE.js → sidebar-BD77ZDQ1.js} +1 -1
  155. package/dist/client/assets/{skeleton-B0I93PJP.js → skeleton-CuVDGSZE.js} +1 -1
  156. package/dist/client/assets/{sortable.esm-MymOIPKk.js → sortable.esm-DpWg8tde.js} +2 -2
  157. package/dist/client/assets/{sso-CfyYgWAs.js → sso-B9XBpXX9.js} +1 -1
  158. package/dist/client/assets/{store-T7GJ1SPI.js → store-Il1Qjdpz.js} +1 -1
  159. package/dist/client/assets/store-registry-BN4Ygwm2.js +2 -0
  160. package/dist/client/assets/{studio-tools-CNO5iCKk.js → studio-tools-C-Eel15b.js} +1 -1
  161. package/dist/client/assets/{switch-CCMIMmOF.js → switch-DWXEjjcR.js} +1 -1
  162. package/dist/client/assets/{tab-id-BptcWVWa.js → tab-id-AX1D_RMI.js} +1 -1
  163. package/dist/client/assets/{table-DeNuxLMl.js → table-sXVKQ5vt.js} +1 -1
  164. package/dist/client/assets/{tabs-Ca0vDJqc.js → tabs-BeXAqCdo.js} +1 -1
  165. package/dist/client/assets/{task-status-B3nPzwP7.js → task-status-CaQuE65s.js} +1 -1
  166. package/dist/client/assets/{textarea-BYT525JZ.js → textarea-C30KYfio.js} +1 -1
  167. package/dist/client/assets/{toggle-group-9TrYMc69.js → toggle-group-B6oTaI1f.js} +1 -1
  168. package/dist/client/assets/toolbar-DuZrnshW.js +1 -0
  169. package/dist/client/assets/toolbar-icon-button-CG8gWMNZ.js +1 -0
  170. package/dist/client/assets/{tools-list-uWC3Ij6C.js → tools-list-BSe55AC9.js} +1 -1
  171. package/dist/client/assets/tooltip-BRQCINXK.js +1 -0
  172. package/dist/client/assets/{types-C7syjwde.js → types-ywta9rZ4.js} +4 -4
  173. package/dist/client/assets/{use-ai-providers-C7KmiuqP.js → use-ai-providers-CpUPA2Pj.js} +1 -1
  174. package/dist/client/assets/{use-automations-RMjkwkxX.js → use-automations-BSn8_z4p.js} +1 -1
  175. package/dist/client/assets/{use-capability-C6Dwri-U.js → use-capability-AkUZCu97.js} +1 -1
  176. package/dist/client/assets/{use-clock-tick-BcxdOJLx.js → use-clock-tick-7J301cSN.js} +1 -1
  177. package/dist/client/assets/{use-collections-B4atckEK.js → use-collections-BhzLncHB.js} +1 -1
  178. package/dist/client/assets/{use-connection-Dz29RF9P.js → use-connection-CSQdDXlG.js} +1 -1
  179. package/dist/client/assets/{use-copy-Xy0buIqd.js → use-copy-3aLRhzTZ.js} +1 -1
  180. package/dist/client/assets/use-create-virtual-mcp-ClyuqzV0.js +1 -0
  181. package/dist/client/assets/{use-debounced-autosave-B4mbwJnu.js → use-debounced-autosave-DwyO4Yri.js} +1 -1
  182. package/dist/client/assets/{use-debounced-value-C6U3mliE.js → use-debounced-value-BGsbVLHA.js} +1 -1
  183. package/dist/client/assets/{use-decopilot-events-CpQNzv3e.js → use-decopilot-events-B8-U5_6h.js} +1 -1
  184. package/dist/client/assets/{use-delete-connection-CqeuxO_6.js → use-delete-connection-yP5RphYi.js} +1 -1
  185. package/dist/client/assets/{use-file-configs-CFCmr--W.js → use-file-configs-XF2AvMPs.js} +1 -1
  186. package/dist/client/assets/{use-infinite-scroll-BX1nHHVY.js → use-infinite-scroll-CkXtceVR.js} +1 -1
  187. package/dist/client/assets/{use-join-requests-j9WpmFq7.js → use-join-requests-mfteqXVe.js} +1 -1
  188. package/dist/client/assets/{use-mcp-client-xOK-OF8p.js → use-mcp-client-CRWIqSWI.js} +1 -1
  189. package/dist/client/assets/{use-mcp-prompts-Crr3H7P7.js → use-mcp-prompts-BV9cBymv.js} +1 -1
  190. package/dist/client/assets/{use-mcp-tools-C8tMWwG9.js → use-mcp-tools-Dgj65Z69.js} +1 -1
  191. package/dist/client/assets/{use-members-BMNjJExY.js → use-members-BZOJ4ncQ.js} +1 -1
  192. package/dist/client/assets/{use-mobile-NlF-3RoP.js → use-mobile-DgvzRDzB.js} +1 -1
  193. package/dist/client/assets/{use-navigate-to-agent-DZubxUSm.js → use-navigate-to-agent-DTqeD3lq.js} +1 -1
  194. package/dist/client/assets/{use-org-auth-client-C_UJ3Vg_.js → use-org-auth-client-Dx974y4u.js} +1 -1
  195. package/dist/client/assets/{use-org-fs-DyK8omii.js → use-org-fs-DI1Q1Ycz.js} +1 -1
  196. package/dist/client/assets/{use-org-sso-DkqH8Zpz.js → use-org-sso-kfQLtl8D.js} +1 -1
  197. package/dist/client/assets/{use-organization-roles-Cu69Rnex.js → use-organization-roles-B2GmBYYT.js} +1 -1
  198. package/dist/client/assets/{use-organization-settings-DksiQdGc.js → use-organization-settings-ClL7mSbK.js} +1 -1
  199. package/dist/client/assets/{use-registry-connections-BOZLpkM5.js → use-registry-connections-DzyhBLO8.js} +1 -1
  200. package/dist/client/assets/{use-secrets-CLmhH-Rb.js → use-secrets-BX0N_3N-.js} +1 -1
  201. package/dist/client/assets/{use-status-sounds-DxV7deix.js → use-status-sounds-BsVH7G2F.js} +1 -1
  202. package/dist/client/assets/{use-view-mode-C2dllj6L.js → use-view-mode-D4v-Vh_n.js} +1 -1
  203. package/dist/client/assets/{use-virtual-mcp-2U_MnYnK.js → use-virtual-mcp-7AWl-thI.js} +1 -1
  204. package/dist/client/assets/useInfiniteQuery-DbI8AV-k.js +1 -0
  205. package/dist/client/assets/useSuspenseInfiniteQuery-DT-JxV4F.js +1 -0
  206. package/dist/client/assets/{useSuspenseQueries-Cysvk68n.js → useSuspenseQueries-D4Gfj0Tf.js} +1 -1
  207. package/dist/client/assets/variant-calendar-C9mxKuI5.js +1 -0
  208. package/dist/client/assets/{view-mode-toggle-4CQodGfa.js → view-mode-toggle-Dcs21C2T.js} +1 -1
  209. package/dist/client/index.html +2 -2
  210. package/dist/server/cli.js +11 -2
  211. package/dist/server/server.js +1 -1
  212. package/package.json +1 -1
  213. package/dist/client/assets/ChevronLeft-dyRjFCmp.js +0 -1
  214. package/dist/client/assets/agent-icon-oDx9Z_Be.js +0 -1
  215. package/dist/client/assets/agents-list-BgSM_QG_.js +0 -1
  216. package/dist/client/assets/app-editor-Xoia35dq.js +0 -1
  217. package/dist/client/assets/automation-runs-B-dNDEWH.js +0 -1
  218. package/dist/client/assets/automations-D395202A.js +0 -1
  219. package/dist/client/assets/bulk-category-panel-CM1bMunr.js +0 -1
  220. package/dist/client/assets/category-editor-2T4Y_ABL.js +0 -1
  221. package/dist/client/assets/collection-detail-BQKV3UU7.js +0 -1
  222. package/dist/client/assets/commerce-onboarding-D2H83R0U.js +0 -1
  223. package/dist/client/assets/connection-detail-gJ5ITUXe.js +0 -1
  224. package/dist/client/assets/connections-CicrEJbU.js +0 -1
  225. package/dist/client/assets/file-explorer-C8pgfKCz.js +0 -2
  226. package/dist/client/assets/index-B2yJy2sB.js +0 -1
  227. package/dist/client/assets/index-BqKQnks_.css +0 -1
  228. package/dist/client/assets/index-DQnTjiix.js +0 -1
  229. package/dist/client/assets/index-D_S_Rq8A.js +0 -169
  230. package/dist/client/assets/page-seo-sheet-C7jjKuEW.js +0 -1
  231. package/dist/client/assets/popover-BXFiEQtN.js +0 -1
  232. package/dist/client/assets/post-editor-Tve7DmSa.js +0 -1
  233. package/dist/client/assets/preview-dialog-CQgf0QcR.js +0 -5
  234. package/dist/client/assets/project-app-view-BR2-hR46.js +0 -1
  235. package/dist/client/assets/record-editor-DbXO7U7E.js +0 -1
  236. package/dist/client/assets/registry-jjhvqeDq.js +0 -2
  237. package/dist/client/assets/roles-BMhGnq_F.js +0 -1
  238. package/dist/client/assets/select-C6v8Xcth.js +0 -1
  239. package/dist/client/assets/seo-editor-D9o3utSQ.js +0 -1
  240. package/dist/client/assets/settings-layout-CSaUQUXv.js +0 -1
  241. package/dist/client/assets/shell-controls-DtGb6E4l.js +0 -1
  242. package/dist/client/assets/shell-route-loading-BRcTX0VT.js +0 -1
  243. package/dist/client/assets/store-registry-B-YJeGRV.js +0 -2
  244. package/dist/client/assets/toolbar-p8VcpV1N.js +0 -1
  245. package/dist/client/assets/tooltip-DrpiSbRG.js +0 -1
  246. package/dist/client/assets/use-create-virtual-mcp-DVmI--_C.js +0 -1
  247. package/dist/client/assets/useInfiniteQuery-RUqqRph1.js +0 -1
  248. package/dist/client/assets/useSuspenseInfiniteQuery-fRYRtDkY.js +0 -1
  249. package/dist/client/assets/variant-calendar-mZn_D1Zo.js +0 -1
@@ -0,0 +1,173 @@
1
+ import{r as k,aM as ys,c as R,l as ae,j as s,J as ws,i as js,B as Y,K as se,k as me,ac as yn,D as Ve,m as Ft,t as ce,ae as ks,G as Ss,e as zs,b as wn,u as jn,E as $t}from"./index-CXy6rN6i.js";import{i as Ns}from"./ChevronRight-BswIt99A.js";import{a as Cs,s as kn}from"./Eye-Dn1AISrx.js";import{n as qe,i as pt}from"./Globe01-CcXDI4W7.js";import{b as $s,c as Ps,e as Es,i as Ds,f as Sn,a as _t,g as Ts,h as Ms,d as Os}from"./ZoomOut-C0bVPfpC.js";import{a as ct}from"./Palette-CnoObDqZ.js";import{s as As}from"./Plus-DDlkoJBs.js";import{i as Rs}from"./SearchLg-CdT_y89m.js";import{t as Is}from"./Stars01-BIVPeWqS.js";import{i as dt}from"./Upload01-DB9meUjO.js";import{s as zn}from"./XClose-BpreRuFP.js";import{i as Ut}from"./Zap-CWxLsQ6b.js";import{u as Nn}from"./use-mobile-DgvzRDzB.js";import{f as Ls,a as Fs,b as _s,c as Us,d as Bs,e as Hs,A as qs,g as Ws}from"./alert-dialog-DMWXmTGp.js";import{c as Cn,a as Le,d as Xe,e as Qe,f as $n,b as Ks,D as Gs}from"./dialog-o7scRbG9.js";import{I as We}from"./input-BlhkemhH.js";import{S as oe}from"./skeleton-CuVDGSZE.js";import{F as we,M as Bt,d as Pn}from"./file-type-icon-LHBbJJTG.js";import{T as Vs}from"./toolbar-DuZrnshW.js";import{u as Xs}from"./use-debounced-value-BGsbVLHA.js";import{i as En,f as Dn,j as Qs,d as Tn,e as Ys,a as Ye,u as At,k as Ht,l as Zs,b as Js,m as Mn,n as el}from"./use-org-fs-DI1Q1Ycz.js";import{i as xt}from"./DotsVertical-DSosYpI1.js";import{i as On}from"./Key01-F6-x7vNY.js";import{s as gt}from"./Trash01-Cc007jho.js";import{D as Ze,a as Je,b as et,c as pe}from"./dropdown-menu-D-VNET4I.js";import{T as tl}from"./textarea-C30KYfio.js";import{t as nl}from"./ChevronDown-DGuR7uUZ.js";import{i as sl,n as ll}from"./ChevronUp-DSdWQUoR.js";import{i as ut}from"./X-_dGiBqSn.js";import{a as rl,P as il,b as ol}from"./popover-SD8gnUXm.js";import{T as xe,a as ge,b as be}from"./tooltip-BRQCINXK.js";import{n as An}from"./LinkExternal01-DOU6-C1w.js";import{l as al,F as cl}from"./index-DCwPnlYH.js";import{i as dl}from"./LayoutLeft-DpqtgcH3.js";const bt=k.createContext(null);bt.displayName="PanelGroupContext";const ne={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},qt=10,Ee=k.useLayoutEffect,en=ys.useId,ul=typeof en=="function"?en:()=>null;let fl=0;function Wt(t=null){const e=ul(),n=k.useRef(t||e||null);return n.current===null&&(n.current=""+fl++),t??n.current}function Rn({children:t,className:e="",collapsedSize:n,collapsible:l,defaultSize:r,forwardedRef:i,id:o,maxSize:a,minSize:c,onCollapse:d,onExpand:f,onResize:u,order:m,style:h,tagName:p="div",...g}){const y=k.useContext(bt);if(y===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:x,expandPanel:b,getPanelSize:j,getPanelStyle:z,groupId:N,isPanelCollapsed:C,reevaluatePanelConstraints:w,registerPanel:M,resizePanel:O,unregisterPanel:T}=y,v=Wt(o),$=k.useRef({callbacks:{onCollapse:d,onExpand:f,onResize:u},constraints:{collapsedSize:n,collapsible:l,defaultSize:r,maxSize:a,minSize:c},id:v,idIsFromProps:o!==void 0,order:m});k.useRef({didLogMissingDefaultSizeWarning:!1}),Ee(()=>{const{callbacks:F,constraints:_}=$.current,B={..._};$.current.id=v,$.current.idIsFromProps=o!==void 0,$.current.order=m,F.onCollapse=d,F.onExpand=f,F.onResize=u,_.collapsedSize=n,_.collapsible=l,_.defaultSize=r,_.maxSize=a,_.minSize=c,(B.collapsedSize!==_.collapsedSize||B.collapsible!==_.collapsible||B.maxSize!==_.maxSize||B.minSize!==_.minSize)&&w($.current,B)}),Ee(()=>{const F=$.current;return M(F),()=>{T(F)}},[m,v,M,T]),k.useImperativeHandle(i,()=>({collapse:()=>{x($.current)},expand:F=>{b($.current,F)},getId(){return v},getSize(){return j($.current)},isCollapsed(){return C($.current)},isExpanded(){return!C($.current)},resize:F=>{O($.current,F)}}),[x,b,j,C,v,O]);const K=z($.current,r);return k.createElement(p,{...g,children:t,className:e,id:v,style:{...K,...h},[ne.groupId]:N,[ne.panel]:"",[ne.panelCollapsible]:l||void 0,[ne.panelId]:v,[ne.panelSize]:parseFloat(""+K.flexGrow).toFixed(1)})}const In=k.forwardRef((t,e)=>k.createElement(Rn,{...t,forwardedRef:e}));Rn.displayName="Panel";In.displayName="forwardRef(Panel)";let Rt=null,at=-1,Se=null;function ml(t,e){if(e){const n=(e&Bn)!==0,l=(e&Hn)!==0,r=(e&qn)!==0,i=(e&Wn)!==0;if(n)return r?"se-resize":i?"ne-resize":"e-resize";if(l)return r?"sw-resize":i?"nw-resize":"w-resize";if(r)return"s-resize";if(i)return"n-resize"}switch(t){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function hl(){Se!==null&&(document.head.removeChild(Se),Rt=null,Se=null,at=-1)}function Pt(t,e){var n,l;const r=ml(t,e);if(Rt!==r){if(Rt=r,Se===null&&(Se=document.createElement("style"),document.head.appendChild(Se)),at>=0){var i;(i=Se.sheet)===null||i===void 0||i.removeRule(at)}at=(n=(l=Se.sheet)===null||l===void 0?void 0:l.insertRule(`*{cursor: ${r} !important;}`))!==null&&n!==void 0?n:-1}}function Ln(t){return t.type==="keydown"}function Fn(t){return t.type.startsWith("pointer")}function _n(t){return t.type.startsWith("mouse")}function vt(t){if(Fn(t)){if(t.isPrimary)return{x:t.clientX,y:t.clientY}}else if(_n(t))return{x:t.clientX,y:t.clientY};return{x:1/0,y:1/0}}function pl(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function xl(t,e,n){return t.x<e.x+e.width&&t.x+t.width>e.x&&t.y<e.y+e.height&&t.y+t.height>e.y}function gl(t,e){if(t===e)throw new Error("Cannot compare node with itself");const n={a:sn(t),b:sn(e)};let l;for(;n.a.at(-1)===n.b.at(-1);)t=n.a.pop(),e=n.b.pop(),l=t;V(l,"Stacking order can only be calculated for elements with a common ancestor");const r={a:nn(tn(n.a)),b:nn(tn(n.b))};if(r.a===r.b){const i=l.childNodes,o={a:n.a.at(-1),b:n.b.at(-1)};let a=i.length;for(;a--;){const c=i[a];if(c===o.a)return 1;if(c===o.b)return-1}}return Math.sign(r.a-r.b)}const bl=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function vl(t){var e;const n=getComputedStyle((e=Un(t))!==null&&e!==void 0?e:t).display;return n==="flex"||n==="inline-flex"}function yl(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||vl(t))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||bl.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function tn(t){let e=t.length;for(;e--;){const n=t[e];if(V(n,"Missing node"),yl(n))return n}return null}function nn(t){return t&&Number(getComputedStyle(t).zIndex)||0}function sn(t){const e=[];for(;t;)e.push(t),t=Un(t);return e}function Un(t){const{parentNode:e}=t;return e&&e instanceof ShadowRoot?e.host:e}const Bn=1,Hn=2,qn=4,Wn=8,wl=pl()==="coarse";let fe=[],Ie=!1,Pe=new Map,yt=new Map;const Ke=new Set;function jl(t,e,n,l,r){var i;const{ownerDocument:o}=e,a={direction:n,element:e,hitAreaMargins:l,setResizeHandlerState:r},c=(i=Pe.get(o))!==null&&i!==void 0?i:0;return Pe.set(o,c+1),Ke.add(a),ft(),function(){var f;yt.delete(t),Ke.delete(a);const u=(f=Pe.get(o))!==null&&f!==void 0?f:1;if(Pe.set(o,u-1),ft(),u===1&&Pe.delete(o),fe.includes(a)){const m=fe.indexOf(a);m>=0&&fe.splice(m,1),Gt(),r("up",!0,null)}}}function kl(t){const{target:e}=t,{x:n,y:l}=vt(t);Ie=!0,Kt({target:e,x:n,y:l}),ft(),fe.length>0&&(mt("down",t),t.preventDefault(),Kn(e)||t.stopImmediatePropagation())}function Et(t){const{x:e,y:n}=vt(t);if(Ie&&t.buttons===0&&(Ie=!1,mt("up",t)),!Ie){const{target:l}=t;Kt({target:l,x:e,y:n})}mt("move",t),Gt(),fe.length>0&&t.preventDefault()}function Dt(t){const{target:e}=t,{x:n,y:l}=vt(t);yt.clear(),Ie=!1,fe.length>0&&(t.preventDefault(),Kn(e)||t.stopImmediatePropagation()),mt("up",t),Kt({target:e,x:n,y:l}),Gt(),ft()}function Kn(t){let e=t;for(;e;){if(e.hasAttribute(ne.resizeHandle))return!0;e=e.parentElement}return!1}function Kt({target:t,x:e,y:n}){fe.splice(0);let l=null;(t instanceof HTMLElement||t instanceof SVGElement)&&(l=t),Ke.forEach(r=>{const{element:i,hitAreaMargins:o}=r,a=i.getBoundingClientRect(),{bottom:c,left:d,right:f,top:u}=a,m=wl?o.coarse:o.fine;if(e>=d-m&&e<=f+m&&n>=u-m&&n<=c+m){if(l!==null&&document.contains(l)&&i!==l&&!i.contains(l)&&!l.contains(i)&&gl(l,i)>0){let p=l,g=!1;for(;p&&!p.contains(i);){if(xl(p.getBoundingClientRect(),a)){g=!0;break}p=p.parentElement}if(g)return}fe.push(r)}})}function Tt(t,e){yt.set(t,e)}function Gt(){let t=!1,e=!1;fe.forEach(l=>{const{direction:r}=l;r==="horizontal"?t=!0:e=!0});let n=0;yt.forEach(l=>{n|=l}),t&&e?Pt("intersection",n):t?Pt("horizontal",n):e?Pt("vertical",n):hl()}let Mt=new AbortController;function ft(){Mt.abort(),Mt=new AbortController;const t={capture:!0,signal:Mt.signal};Ke.size&&(Ie?(fe.length>0&&Pe.forEach((e,n)=>{const{body:l}=n;e>0&&(l.addEventListener("contextmenu",Dt,t),l.addEventListener("pointerleave",Et,t),l.addEventListener("pointermove",Et,t))}),window.addEventListener("pointerup",Dt,t),window.addEventListener("pointercancel",Dt,t)):Pe.forEach((e,n)=>{const{body:l}=n;e>0&&(l.addEventListener("pointerdown",kl,t),l.addEventListener("pointermove",Et,t))}))}function mt(t,e){Ke.forEach(n=>{const{setResizeHandlerState:l}=n,r=fe.includes(n);l(t,r,e)})}function Sl(){const[t,e]=k.useState(0);return k.useCallback(()=>e(n=>n+1),[])}function V(t,e){if(!t)throw console.error(e),Error(e)}function De(t,e,n=qt){return t.toFixed(n)===e.toFixed(n)?0:t>e?1:-1}function ve(t,e,n=qt){return De(t,e,n)===0}function ue(t,e,n){return De(t,e,n)===0}function zl(t,e,n){if(t.length!==e.length)return!1;for(let l=0;l<t.length;l++){const r=t[l],i=e[l];if(!ue(r,i,n))return!1}return!0}function Re({panelConstraints:t,panelIndex:e,size:n}){const l=t[e];V(l!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:r=0,collapsible:i,maxSize:o=100,minSize:a=0}=l;if(De(n,a)<0)if(i){const c=(r+a)/2;De(n,c)<0?n=r:n=a}else n=a;return n=Math.min(o,n),n=parseFloat(n.toFixed(qt)),n}function _e({delta:t,initialLayout:e,panelConstraints:n,pivotIndices:l,prevLayout:r,trigger:i}){if(ue(t,0))return e;const o=[...e],[a,c]=l;V(a!=null,"Invalid first pivot index"),V(c!=null,"Invalid second pivot index");let d=0;if(i==="keyboard"){{const u=t<0?c:a,m=n[u];V(m,`Panel constraints not found for index ${u}`);const{collapsedSize:h=0,collapsible:p,minSize:g=0}=m;if(p){const y=e[u];if(V(y!=null,`Previous layout not found for panel index ${u}`),ue(y,h)){const x=g-y;De(x,Math.abs(t))>0&&(t=t<0?0-x:x)}}}{const u=t<0?a:c,m=n[u];V(m,`No panel constraints found for index ${u}`);const{collapsedSize:h=0,collapsible:p,minSize:g=0}=m;if(p){const y=e[u];if(V(y!=null,`Previous layout not found for panel index ${u}`),ue(y,g)){const x=y-h;De(x,Math.abs(t))>0&&(t=t<0?0-x:x)}}}}{const u=t<0?1:-1;let m=t<0?c:a,h=0;for(;;){const g=e[m];V(g!=null,`Previous layout not found for panel index ${m}`);const x=Re({panelConstraints:n,panelIndex:m,size:100})-g;if(h+=x,m+=u,m<0||m>=n.length)break}const p=Math.min(Math.abs(t),Math.abs(h));t=t<0?0-p:p}{let m=t<0?a:c;for(;m>=0&&m<n.length;){const h=Math.abs(t)-Math.abs(d),p=e[m];V(p!=null,`Previous layout not found for panel index ${m}`);const g=p-h,y=Re({panelConstraints:n,panelIndex:m,size:g});if(!ue(p,y)&&(d+=p-y,o[m]=y,d.toPrecision(3).localeCompare(Math.abs(t).toPrecision(3),void 0,{numeric:!0})>=0))break;t<0?m--:m++}}if(zl(r,o))return r;{const u=t<0?c:a,m=e[u];V(m!=null,`Previous layout not found for panel index ${u}`);const h=m+d,p=Re({panelConstraints:n,panelIndex:u,size:h});if(o[u]=p,!ue(p,h)){let g=h-p,x=t<0?c:a;for(;x>=0&&x<n.length;){const b=o[x];V(b!=null,`Previous layout not found for panel index ${x}`);const j=b+g,z=Re({panelConstraints:n,panelIndex:x,size:j});if(ue(b,z)||(g-=z-b,o[x]=z),ue(g,0))break;t>0?x--:x++}}}const f=o.reduce((u,m)=>m+u,0);return ue(f,100)?o:r}function Nl({layout:t,panelsArray:e,pivotIndices:n}){let l=0,r=100,i=0,o=0;const a=n[0];V(a!=null,"No pivot index found"),e.forEach((u,m)=>{const{constraints:h}=u,{maxSize:p=100,minSize:g=0}=h;m===a?(l=g,r=p):(i+=g,o+=p)});const c=Math.min(r,100-i),d=Math.max(l,100-o),f=t[a];return{valueMax:c,valueMin:d,valueNow:f}}function Ge(t,e=document){return Array.from(e.querySelectorAll(`[${ne.resizeHandleId}][data-panel-group-id="${t}"]`))}function Gn(t,e,n=document){const r=Ge(t,n).findIndex(i=>i.getAttribute(ne.resizeHandleId)===e);return r??null}function Vn(t,e,n){const l=Gn(t,e,n);return l!=null?[l,l+1]:[-1,-1]}function Xn(t,e=document){var n;if(e instanceof HTMLElement&&(e==null||(n=e.dataset)===null||n===void 0?void 0:n.panelGroupId)==t)return e;const l=e.querySelector(`[data-panel-group][data-panel-group-id="${t}"]`);return l||null}function wt(t,e=document){const n=e.querySelector(`[${ne.resizeHandleId}="${t}"]`);return n||null}function Cl(t,e,n,l=document){var r,i,o,a;const c=wt(e,l),d=Ge(t,l),f=c?d.indexOf(c):-1,u=(r=(i=n[f])===null||i===void 0?void 0:i.id)!==null&&r!==void 0?r:null,m=(o=(a=n[f+1])===null||a===void 0?void 0:a.id)!==null&&o!==void 0?o:null;return[u,m]}function $l({committedValuesRef:t,eagerValuesRef:e,groupId:n,layout:l,panelDataArray:r,panelGroupElement:i,setLayout:o}){k.useRef({didWarnAboutMissingResizeHandle:!1}),Ee(()=>{if(!i)return;const a=Ge(n,i);for(let c=0;c<r.length-1;c++){const{valueMax:d,valueMin:f,valueNow:u}=Nl({layout:l,panelsArray:r,pivotIndices:[c,c+1]}),m=a[c];if(m!=null){const h=r[c];V(h,`No panel data found for index "${c}"`),m.setAttribute("aria-controls",h.id),m.setAttribute("aria-valuemax",""+Math.round(d)),m.setAttribute("aria-valuemin",""+Math.round(f)),m.setAttribute("aria-valuenow",u!=null?""+Math.round(u):"")}}return()=>{a.forEach((c,d)=>{c.removeAttribute("aria-controls"),c.removeAttribute("aria-valuemax"),c.removeAttribute("aria-valuemin"),c.removeAttribute("aria-valuenow")})}},[n,l,r,i]),k.useEffect(()=>{if(!i)return;const a=e.current;V(a,"Eager values not found");const{panelDataArray:c}=a,d=Xn(n,i);V(d!=null,`No group found for id "${n}"`);const f=Ge(n,i);V(f,`No resize handles found for group id "${n}"`);const u=f.map(m=>{const h=m.getAttribute(ne.resizeHandleId);V(h,"Resize handle element has no handle id attribute");const[p,g]=Cl(n,h,c,i);if(p==null||g==null)return()=>{};const y=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const b=c.findIndex(j=>j.id===p);if(b>=0){const j=c[b];V(j,`No panel data found for index ${b}`);const z=l[b],{collapsedSize:N=0,collapsible:C,minSize:w=0}=j.constraints;if(z!=null&&C){const M=_e({delta:ue(z,N)?w-N:N-z,initialLayout:l,panelConstraints:c.map(O=>O.constraints),pivotIndices:Vn(n,h,i),prevLayout:l,trigger:"keyboard"});l!==M&&o(M)}}break}}};return m.addEventListener("keydown",y),()=>{m.removeEventListener("keydown",y)}});return()=>{u.forEach(m=>m())}},[i,t,e,n,l,r,o])}function ln(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function Qn(t,e){const n=t==="horizontal",{x:l,y:r}=vt(e);return n?l:r}function Pl(t,e,n,l,r){const i=n==="horizontal",o=wt(e,r);V(o,`No resize handle element found for id "${e}"`);const a=o.getAttribute(ne.groupId);V(a,"Resize handle element has no group id attribute");let{initialCursorPosition:c}=l;const d=Qn(n,t),f=Xn(a,r);V(f,`No group element found for id "${a}"`);const u=f.getBoundingClientRect(),m=i?u.width:u.height;return(d-c)/m*100}function El(t,e,n,l,r,i){if(Ln(t)){const o=n==="horizontal";let a=0;t.shiftKey?a=100:r!=null?a=r:a=10;let c=0;switch(t.key){case"ArrowDown":c=o?0:a;break;case"ArrowLeft":c=o?-a:0;break;case"ArrowRight":c=o?a:0;break;case"ArrowUp":c=o?0:-a;break;case"End":c=100;break;case"Home":c=-100;break}return c}else return l==null?0:Pl(t,e,n,l,i)}function Dl({panelDataArray:t}){const e=Array(t.length),n=t.map(i=>i.constraints);let l=0,r=100;for(let i=0;i<t.length;i++){const o=n[i];V(o,`Panel constraints not found for index ${i}`);const{defaultSize:a}=o;a!=null&&(l++,e[i]=a,r-=a)}for(let i=0;i<t.length;i++){const o=n[i];V(o,`Panel constraints not found for index ${i}`);const{defaultSize:a}=o;if(a!=null)continue;const c=t.length-l,d=r/c;l++,e[i]=d,r-=d}return e}function Te(t,e,n){e.forEach((l,r)=>{const i=t[r];V(i,`Panel data not found for index ${r}`);const{callbacks:o,constraints:a,id:c}=i,{collapsedSize:d=0,collapsible:f}=a,u=n[c];if(u==null||l!==u){n[c]=l;const{onCollapse:m,onExpand:h,onResize:p}=o;p&&p(l,u),f&&(m||h)&&(h&&(u==null||ve(u,d))&&!ve(l,d)&&h(),m&&(u==null||!ve(u,d))&&ve(l,d)&&m())}})}function ot(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n])return!1;return!0}function Tl({defaultSize:t,dragState:e,layout:n,panelData:l,panelIndex:r,precision:i=3}){const o=n[r];let a;return o==null?a=t!=null?t.toPrecision(i):"1":l.length===1?a="1":a=o.toPrecision(i),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function Ml(t,e=10){let n=null;return(...r)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{t(...r)},e)}}function rn(t){try{if(typeof localStorage<"u")t.getItem=e=>localStorage.getItem(e),t.setItem=(e,n)=>{localStorage.setItem(e,n)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),t.getItem=()=>null,t.setItem=()=>{}}}function Yn(t){return`react-resizable-panels:${t}`}function Zn(t){return t.map(e=>{const{constraints:n,id:l,idIsFromProps:r,order:i}=e;return r?l:i?`${i}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((e,n)=>e.localeCompare(n)).join(",")}function Jn(t,e){try{const n=Yn(t),l=e.getItem(n);if(l){const r=JSON.parse(l);if(typeof r=="object"&&r!=null)return r}}catch{}return null}function Ol(t,e,n){var l,r;const i=(l=Jn(t,n))!==null&&l!==void 0?l:{},o=Zn(e);return(r=i[o])!==null&&r!==void 0?r:null}function Al(t,e,n,l,r){var i;const o=Yn(t),a=Zn(e),c=(i=Jn(t,r))!==null&&i!==void 0?i:{};c[a]={expandToSizes:Object.fromEntries(n.entries()),layout:l};try{r.setItem(o,JSON.stringify(c))}catch(d){console.error(d)}}function on({layout:t,panelConstraints:e}){const n=[...t],l=n.reduce((i,o)=>i+o,0);if(n.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${n.map(i=>`${i}%`).join(", ")}`);if(!ue(l,100)&&n.length>0)for(let i=0;i<e.length;i++){const o=n[i];V(o!=null,`No layout data found for index ${i}`);const a=100/l*o;n[i]=a}let r=0;for(let i=0;i<e.length;i++){const o=n[i];V(o!=null,`No layout data found for index ${i}`);const a=Re({panelConstraints:e,panelIndex:i,size:o});o!=a&&(r+=o-a,n[i]=a)}if(!ue(r,0))for(let i=0;i<e.length;i++){const o=n[i];V(o!=null,`No layout data found for index ${i}`);const a=o+r,c=Re({panelConstraints:e,panelIndex:i,size:a});if(o!==c&&(r-=c-o,n[i]=c,ue(r,0)))break}return n}const Rl=100,Ue={getItem:t=>(rn(Ue),Ue.getItem(t)),setItem:(t,e)=>{rn(Ue),Ue.setItem(t,e)}},an={};function es({autoSaveId:t=null,children:e,className:n="",direction:l,forwardedRef:r,id:i=null,onLayout:o=null,keyboardResizeBy:a=null,storage:c=Ue,style:d,tagName:f="div",...u}){const m=Wt(i),h=k.useRef(null),[p,g]=k.useState(null),[y,x]=k.useState([]),b=Sl(),j=k.useRef({}),z=k.useRef(new Map),N=k.useRef(0),C=k.useRef({autoSaveId:t,direction:l,dragState:p,id:m,keyboardResizeBy:a,onLayout:o,storage:c}),w=k.useRef({layout:y,panelDataArray:[],panelDataArrayChanged:!1});k.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),k.useImperativeHandle(r,()=>({getId:()=>C.current.id,getLayout:()=>{const{layout:S}=w.current;return S},setLayout:S=>{const{onLayout:I}=C.current,{layout:L,panelDataArray:U}=w.current,D=on({layout:S,panelConstraints:U.map(H=>H.constraints)});ln(L,D)||(x(D),w.current.layout=D,I&&I(D),Te(U,D,j.current))}}),[]),Ee(()=>{C.current.autoSaveId=t,C.current.direction=l,C.current.dragState=p,C.current.id=m,C.current.onLayout=o,C.current.storage=c}),$l({committedValuesRef:C,eagerValuesRef:w,groupId:m,layout:y,panelDataArray:w.current.panelDataArray,setLayout:x,panelGroupElement:h.current}),k.useEffect(()=>{const{panelDataArray:S}=w.current;if(t){if(y.length===0||y.length!==S.length)return;let I=an[t];I==null&&(I=Ml(Al,Rl),an[t]=I);const L=[...S],U=new Map(z.current);I(t,L,U,y,c)}},[t,y,c]),k.useEffect(()=>{});const M=k.useCallback(S=>{const{onLayout:I}=C.current,{layout:L,panelDataArray:U}=w.current;if(S.constraints.collapsible){const D=U.map(de=>de.constraints),{collapsedSize:H=0,panelSize:Q,pivotIndices:ee}=$e(U,S,L);if(V(Q!=null,`Panel size not found for panel "${S.id}"`),!ve(Q,H)){z.current.set(S.id,Q);const P=Oe(U,S)===U.length-1?Q-H:H-Q,X=_e({delta:P,initialLayout:L,panelConstraints:D,pivotIndices:ee,prevLayout:L,trigger:"imperative-api"});ot(L,X)||(x(X),w.current.layout=X,I&&I(X),Te(U,X,j.current))}}},[]),O=k.useCallback((S,I)=>{const{onLayout:L}=C.current,{layout:U,panelDataArray:D}=w.current;if(S.constraints.collapsible){const H=D.map(te=>te.constraints),{collapsedSize:Q=0,panelSize:ee=0,minSize:de=0,pivotIndices:P}=$e(D,S,U),X=I??de;if(ve(ee,Q)){const te=z.current.get(S.id),he=te!=null&&te>=X?te:X,Ne=Oe(D,S)===D.length-1?ee-he:he-ee,ie=_e({delta:Ne,initialLayout:U,panelConstraints:H,pivotIndices:P,prevLayout:U,trigger:"imperative-api"});ot(U,ie)||(x(ie),w.current.layout=ie,L&&L(ie),Te(D,ie,j.current))}}},[]),T=k.useCallback(S=>{const{layout:I,panelDataArray:L}=w.current,{panelSize:U}=$e(L,S,I);return V(U!=null,`Panel size not found for panel "${S.id}"`),U},[]),v=k.useCallback((S,I)=>{const{panelDataArray:L}=w.current,U=Oe(L,S);return Tl({defaultSize:I,dragState:p,layout:y,panelData:L,panelIndex:U})},[p,y]),$=k.useCallback(S=>{const{layout:I,panelDataArray:L}=w.current,{collapsedSize:U=0,collapsible:D,panelSize:H}=$e(L,S,I);return V(H!=null,`Panel size not found for panel "${S.id}"`),D===!0&&ve(H,U)},[]),K=k.useCallback(S=>{const{layout:I,panelDataArray:L}=w.current,{collapsedSize:U=0,collapsible:D,panelSize:H}=$e(L,S,I);return V(H!=null,`Panel size not found for panel "${S.id}"`),!D||De(H,U)>0},[]),F=k.useCallback(S=>{const{panelDataArray:I}=w.current;I.push(S),I.sort((L,U)=>{const D=L.order,H=U.order;return D==null&&H==null?0:D==null?-1:H==null?1:D-H}),w.current.panelDataArrayChanged=!0,b()},[b]);Ee(()=>{if(w.current.panelDataArrayChanged){w.current.panelDataArrayChanged=!1;const{autoSaveId:S,onLayout:I,storage:L}=C.current,{layout:U,panelDataArray:D}=w.current;let H=null;if(S){const ee=Ol(S,D,L);ee&&(z.current=new Map(Object.entries(ee.expandToSizes)),H=ee.layout)}H==null&&(H=Dl({panelDataArray:D}));const Q=on({layout:H,panelConstraints:D.map(ee=>ee.constraints)});ln(U,Q)||(x(Q),w.current.layout=Q,I&&I(Q),Te(D,Q,j.current))}}),Ee(()=>{const S=w.current;return()=>{S.layout=[]}},[]);const _=k.useCallback(S=>{let I=!1;const L=h.current;return L&&window.getComputedStyle(L,null).getPropertyValue("direction")==="rtl"&&(I=!0),function(D){D.preventDefault();const H=h.current;if(!H)return()=>null;const{direction:Q,dragState:ee,id:de,keyboardResizeBy:P,onLayout:X}=C.current,{layout:te,panelDataArray:he}=w.current,{initialLayout:je}=ee??{},Ne=Vn(de,S,H);let ie=El(D,S,Q,ee,P,H);const lt=Q==="horizontal";lt&&I&&(ie=-ie);const Nt=he.map(Ct=>Ct.constraints),Ce=_e({delta:ie,initialLayout:je??te,panelConstraints:Nt,pivotIndices:Ne,prevLayout:te,trigger:Ln(D)?"keyboard":"mouse-or-touch"}),rt=!ot(te,Ce);(Fn(D)||_n(D))&&N.current!=ie&&(N.current=ie,!rt&&ie!==0?lt?Tt(S,ie<0?Bn:Hn):Tt(S,ie<0?qn:Wn):Tt(S,0)),rt&&(x(Ce),w.current.layout=Ce,X&&X(Ce),Te(he,Ce,j.current))}},[]),B=k.useCallback((S,I)=>{const{onLayout:L}=C.current,{layout:U,panelDataArray:D}=w.current,H=D.map(te=>te.constraints),{panelSize:Q,pivotIndices:ee}=$e(D,S,U);V(Q!=null,`Panel size not found for panel "${S.id}"`);const P=Oe(D,S)===D.length-1?Q-I:I-Q,X=_e({delta:P,initialLayout:U,panelConstraints:H,pivotIndices:ee,prevLayout:U,trigger:"imperative-api"});ot(U,X)||(x(X),w.current.layout=X,L&&L(X),Te(D,X,j.current))},[]),G=k.useCallback((S,I)=>{const{layout:L,panelDataArray:U}=w.current,{collapsedSize:D=0,collapsible:H}=I,{collapsedSize:Q=0,collapsible:ee,maxSize:de=100,minSize:P=0}=S.constraints,{panelSize:X}=$e(U,S,L);X!=null&&(H&&ee&&ve(X,D)?ve(D,Q)||B(S,Q):X<P?B(S,P):X>de&&B(S,de))},[B]),q=k.useCallback((S,I)=>{const{direction:L}=C.current,{layout:U}=w.current;if(!h.current)return;const D=wt(S,h.current);V(D,`Drag handle element not found for id "${S}"`);const H=Qn(L,I);g({dragHandleId:S,dragHandleRect:D.getBoundingClientRect(),initialCursorPosition:H,initialLayout:U})},[]),J=k.useCallback(()=>{g(null)},[]),Z=k.useCallback(S=>{const{panelDataArray:I}=w.current,L=Oe(I,S);L>=0&&(I.splice(L,1),delete j.current[S.id],w.current.panelDataArrayChanged=!0,b())},[b]),A=k.useMemo(()=>({collapsePanel:M,direction:l,dragState:p,expandPanel:O,getPanelSize:T,getPanelStyle:v,groupId:m,isPanelCollapsed:$,isPanelExpanded:K,reevaluatePanelConstraints:G,registerPanel:F,registerResizeHandle:_,resizePanel:B,startDragging:q,stopDragging:J,unregisterPanel:Z,panelGroupElement:h.current}),[M,p,l,O,T,v,m,$,K,G,F,_,B,q,J,Z]),W={display:"flex",flexDirection:l==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return k.createElement(bt.Provider,{value:A},k.createElement(f,{...u,children:e,className:n,id:i,ref:h,style:{...W,...d},[ne.group]:"",[ne.groupDirection]:l,[ne.groupId]:m}))}const ts=k.forwardRef((t,e)=>k.createElement(es,{...t,forwardedRef:e}));es.displayName="PanelGroup";ts.displayName="forwardRef(PanelGroup)";function Oe(t,e){return t.findIndex(n=>n===e||n.id===e.id)}function $e(t,e,n){const l=Oe(t,e),i=l===t.length-1?[l-1,l]:[l,l+1],o=n[l];return{...e.constraints,panelSize:o,pivotIndices:i}}function Il({disabled:t,handleId:e,resizeHandler:n,panelGroupElement:l}){k.useEffect(()=>{if(t||n==null||l==null)return;const r=wt(e,l);if(r==null)return;const i=o=>{if(!o.defaultPrevented)switch(o.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{o.preventDefault(),n(o);break}case"F6":{o.preventDefault();const a=r.getAttribute(ne.groupId);V(a,`No group element found for id "${a}"`);const c=Ge(a,l),d=Gn(a,e,l);V(d!==null,`No resize element found for id "${e}"`);const f=o.shiftKey?d>0?d-1:c.length-1:d+1<c.length?d+1:0;c[f].focus();break}}};return r.addEventListener("keydown",i),()=>{r.removeEventListener("keydown",i)}},[l,t,e,n])}function ns({children:t=null,className:e="",disabled:n=!1,hitAreaMargins:l,id:r,onBlur:i,onClick:o,onDragging:a,onFocus:c,onPointerDown:d,onPointerUp:f,style:u={},tabIndex:m=0,tagName:h="div",...p}){var g,y;const x=k.useRef(null),b=k.useRef({onClick:o,onDragging:a,onPointerDown:d,onPointerUp:f});k.useEffect(()=>{b.current.onClick=o,b.current.onDragging=a,b.current.onPointerDown=d,b.current.onPointerUp=f});const j=k.useContext(bt);if(j===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:z,groupId:N,registerResizeHandle:C,startDragging:w,stopDragging:M,panelGroupElement:O}=j,T=Wt(r),[v,$]=k.useState("inactive"),[K,F]=k.useState(!1),[_,B]=k.useState(null),G=k.useRef({state:v});Ee(()=>{G.current.state=v}),k.useEffect(()=>{if(n)B(null);else{const A=C(T);B(()=>A)}},[n,T,C]);const q=(g=l?.coarse)!==null&&g!==void 0?g:15,J=(y=l?.fine)!==null&&y!==void 0?y:5;k.useEffect(()=>{if(n||_==null)return;const A=x.current;V(A,"Element ref not attached");let W=!1;return jl(T,A,z,{coarse:q,fine:J},(I,L,U)=>{if(!L){$("inactive");return}switch(I){case"down":{$("drag"),W=!1,V(U,'Expected event to be defined for "down" action'),w(T,U);const{onDragging:D,onPointerDown:H}=b.current;D?.(!0),H?.();break}case"move":{const{state:D}=G.current;W=!0,D!=="drag"&&$("hover"),V(U,'Expected event to be defined for "move" action'),_(U);break}case"up":{$("hover"),M();const{onClick:D,onDragging:H,onPointerUp:Q}=b.current;H?.(!1),Q?.(),W||D?.();break}}})},[q,z,n,J,C,T,_,w,M]),Il({disabled:n,handleId:T,resizeHandler:_,panelGroupElement:O});const Z={touchAction:"none",userSelect:"none"};return k.createElement(h,{...p,children:t,className:e,id:r,onBlur:()=>{F(!1),i?.()},onFocus:()=>{F(!0),c?.()},ref:x,role:"separator",style:{...Z,...u},tabIndex:m,[ne.groupDirection]:z,[ne.groupId]:N,[ne.resizeHandle]:"",[ne.resizeHandleActive]:v==="drag"?"pointer":K?"keyboard":void 0,[ne.resizeHandleEnabled]:!n,[ne.resizeHandleId]:T,[ne.resizeHandleState]:v})}ns.displayName="PanelResizeHandle";function Ll(t){const e=R.c(10);let n,l,r;e[0]!==t?({className:n,ref:r,...l}=t,e[0]=t,e[1]=n,e[2]=l,e[3]=r):(n=e[1],l=e[2],r=e[3]);let i;e[4]!==n?(i=ae("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",n),e[4]=n,e[5]=i):i=e[5];let o;return e[6]!==l||e[7]!==r||e[8]!==i?(o=s.jsx(ts,{ref:r,"data-slot":"resizable-panel-group",className:i,...l}),e[6]=l,e[7]=r,e[8]=i,e[9]=o):o=e[9],o}function cn(t){const e=R.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let l;return e[2]!==n?(l=s.jsx(In,{"data-slot":"resizable-panel",...n}),e[2]=n,e[3]=l):l=e[3],l}function Fl(t){const e=R.c(12);let n,l,r;e[0]!==t?({withHandle:r,className:n,...l}=t,e[0]=t,e[1]=n,e[2]=l,e[3]=r):(n=e[1],l=e[2],r=e[3]);let i;e[4]!==n?(i=ae("bg-border focus-visible:ring-ring relative flex w-[0.5px] items-center justify-center 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-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",n),e[4]=n,e[5]=i):i=e[5];let o;e[6]!==r?(o=r&&s.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:s.jsx($s,{className:"size-2.5"})}),e[6]=r,e[7]=o):o=e[7];let a;return e[8]!==l||e[9]!==i||e[10]!==o?(a=s.jsx(ns,{"data-slot":"resizable-handle",className:i,...l,children:o}),e[8]=l,e[9]=i,e[10]=o,e[11]=a):a=e[11],a}function _l(t){if(!t||t.includes("\\")||t.includes("..")||t.includes("\0"))return!0;try{const e=decodeURIComponent(t);if(e.includes("\\")||e.includes("..")||e.includes("\0"))return!0;if(e!==t&&e.includes("/")){const n=(t.match(/\//g)??[]).length;if((e.match(/\//g)??[]).length>n)return!0}return!1}catch{return!0}}function Ul(t){if(_l(t))throw new Error(`Invalid block key: ${t||"(empty)"}`)}function Bl(t){try{return decodeURIComponent(t)}catch{return t}}function Hl(t){return Ul(t),encodeURIComponent(t)}function ql(t){return`.deco/blocks/${Hl(t)}.json`}function bo(t){return`/${ql(t)}`}const vo=1e4,Wl=3;function It(t){return t.trim()?(t.startsWith("/")?t:`/${t}`).replace(/\/+/g,"/"):"/"}function Vt(t){return t.startsWith("/")?t.slice(1):t}function ht(t){return t.trim()?t.startsWith("/")?t:`/${t}`:"/"}function Kl(t){const e=ht(t);if(e==="/")return"/";const n=e.split("/").filter(Boolean);return n.pop(),n.length===0?"/":`/${n.join("/")}`}function yo(t,e){const n=e.replace(/^\/+|\/+$/g,"");return ht(n?`${t==="/"?"":t}/${n}`:t)}function wo(t,e){return e==="directory"?t:Kl(t)}function jo(t){const e=t.trim();return e?e.includes("/")||e.includes("\\")||e.includes("..")||e.includes("\0")?"Name cannot contain /, \\, or ..":null:"Name is required"}function Gl(t){const e=Vt(t);return e?e.split("/").filter(Boolean).length:0}function ko(t,e,n,l=!1){return{files:[...new Set([...t,...n.files])],directories:[...new Set([...e,...n.directories??[]])],truncated:l||!!n.truncated}}function So(t,e){return Gl(t)>=Wl&&!e.has(t)}function zo(t,e,n=[]){const l=Vt(t);if(e.includes(l)||n.includes(l))return!0;if(!l)return!1;const r=`${l}/`;return e.some(i=>i.startsWith(r))||n.some(i=>i.startsWith(r))}function No(t){const e=Vt(t),n=".deco/blocks/";if(!e.startsWith(n)||!e.endsWith(".json"))return null;const l=e.slice(n.length,-5);return Bl(l)}function Vl(t){if(!t)return"plaintext";const e=t.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?"typescript":e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?"javascript":e.endsWith(".json")?"json":e.endsWith(".md")||e.endsWith(".mdx")?"markdown":e.endsWith(".css")?"css":e.endsWith(".scss")?"scss":e.endsWith(".html")?"html":e.endsWith(".yaml")||e.endsWith(".yml")?"yaml":e.endsWith(".xml")||e.endsWith(".svg")?"xml":e.endsWith(".py")?"python":e.endsWith(".sql")?"sql":e.endsWith(".sh")?"shell":"plaintext"}function Co(t){const e=It(t).split("/").filter(Boolean),n=["/"];let l="";for(const r of e.slice(0,-1))l+=`/${r}`,n.push(l);return n}function $o(t,e=[]){const n={children:[]},l=i=>{const a=It(i).split("/").filter(Boolean);let c=n,d="";for(const f of a){d+=`/${f}`;let u=c.children.find(m=>m.name===f);u?u.kind==="file"&&(u.kind="directory"):(u={name:f,path:d,kind:"directory",children:[]},c.children.push(u)),c=u}};for(const i of t){const a=It(i).split("/").filter(Boolean);let c=n,d="";a.forEach((f,u)=>{d+=`/${f}`;const m=u===a.length-1;let h=c.children.find(p=>p.name===f);h||(h={name:f,path:d,kind:m?"file":"directory",children:[]},c.children.push(h)),c=h})}for(const i of e)l(ht(i));const r=i=>{i.sort((o,a)=>o.kind!==a.kind?o.kind==="directory"?-1:1:o.name.localeCompare(a.name));for(const o of i)o.children.length>0&&r(o.children)};return r(n.children),n.children}function Xl(t,e,n=0){const l=[];for(const r of t)r.name!==".gitkeep"&&(l.push({node:r,depth:n}),r.kind==="directory"&&r.children.length>0&&e.has(r.path)&&l.push(...Xl(r.children,e,n+1)));return l}function Po(t){return t.split(`
2
+ `).map(e=>{const n=e.match(/^\d+\t(.*)/);return n?n[1]:e}).join(`
3
+ `)}al.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function Ql(t){const e=R.c(11),{value:n,filename:l}=t,[r]=ws(),i=r.theme==="dark"||r.theme==="system"&&typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;let o;e[0]!==l?(o=Vl(l),e[0]=l,e[1]=o):o=e[1];const a=i?"vs-dark":"light";let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"flex h-full w-full items-center justify-center",children:s.jsx(js,{size:20,className:"animate-spin text-muted-foreground"})}),e[2]=c):c=e[2];let d,f;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={enabled:!1},f={top:12,bottom:12},e[3]=d,e[4]=f):(d=e[3],f=e[4]);let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u={readOnly:!0,domReadOnly:!0,fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:3,wordWrap:"on",minimap:d,padding:f,renderLineHighlight:"none",scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}},e[5]=u):u=e[5];let m;return e[6]!==l||e[7]!==o||e[8]!==a||e[9]!==n?(m=s.jsx(cl,{path:l,language:o,value:n,theme:a,loading:c,options:u},l),e[6]=l,e[7]=o,e[8]=a,e[9]=n,e[10]=m):m=e[10],m}function ss(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}const Yl=new Set(["png","jpg","jpeg","gif","webp","svg","avif"]),Zl=new Set(["txt","json","csv","tsv","log","yaml","yml","xml","toml","ts","tsx","js","jsx","py","rb","go","rs","java","sh","sql"]),dn=2*1024*1024;function Jl(t,e){const n=t.split(".").pop()?.toLowerCase()??"";return Yl.has(n)?"image":n==="pdf"?"pdf":n==="html"||n==="htm"?"html":n==="md"||n==="markdown"?e<=dn?"markdown":"download":Zl.has(n)&&e<=dn?"text":"download"}function ls(){const t=R.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(oe,{className:"h-6 w-2/3"}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"flex h-full w-full items-center justify-center",children:s.jsxs("div",{className:"flex w-3/4 max-w-md flex-col gap-3 p-6",children:[e,s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(oe,{className:"h-3 w-full"}),s.jsx(oe,{className:"h-3 w-5/6"}),s.jsx(oe,{className:"h-3 w-2/3"})]})]})}),t[1]=n):n=t[1],n}function rs(t){const e=R.c(20),{file:n,note:l}=t;let r;e[0]!==n.filename?(r=s.jsx(we,{filename:n.filename,className:"h-12 w-10"}),e[0]=n.filename,e[1]=r):r=e[1];let i;e[2]!==n.filename?(i=s.jsx("span",{className:"text-sm font-medium text-foreground",children:n.filename}),e[2]=n.filename,e[3]=i):i=e[3];let o;e[4]!==n.size?(o=ss(n.size),e[4]=n.size,e[5]=o):o=e[5];const a=l?` · ${l}`:"";let c;e[6]!==o||e[7]!==a?(c=s.jsxs("span",{className:"text-xs text-muted-foreground",children:[o,a]}),e[6]=o,e[7]=a,e[8]=c):c=e[8];let d;e[9]!==i||e[10]!==c?(d=s.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[i,c]}),e[9]=i,e[10]=c,e[11]=d):d=e[11];let f;e[12]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(qe,{size:14}),e[12]=f):f=e[12];let u;e[13]!==n.downloadUrl||e[14]!==n.filename?(u=s.jsx(Y,{asChild:!0,variant:"outline",size:"sm",children:s.jsxs("a",{href:n.downloadUrl,download:n.filename,children:[f,"Download"]})}),e[13]=n.downloadUrl,e[14]=n.filename,e[15]=u):u=e[15];let m;return e[16]!==r||e[17]!==d||e[18]!==u?(m=s.jsx("div",{className:"flex h-full w-full items-center justify-center",children:s.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-xl border border-border bg-muted/30 px-10 py-8",children:[r,d,u]})}),e[16]=r,e[17]=d,e[18]=u,e[19]=m):m=e[19],m}function un(t){const e=R.c(16),{file:n,markdown:l}=t;let r;e[0]!==n.downloadUrl?(r=se.fileText(n.downloadUrl),e[0]=n.downloadUrl,e[1]=r):r=e[1];let i;e[2]!==n.downloadUrl?(i=async()=>{const u=await fetch(n.downloadUrl,{credentials:"include"});if(!u.ok)throw new Error(`fetch failed: ${u.status}`);return u.text()},e[2]=n.downloadUrl,e[3]=i):i=e[3];let o;e[4]!==r||e[5]!==i?(o={queryKey:r,queryFn:i,staleTime:6e4,retry:!1},e[4]=r,e[5]=i,e[6]=o):o=e[6];const{data:a,isPending:c,isError:d}=me(o);if(c){let u;return e[7]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(ls,{}),e[7]=u):u=e[7],u}if(d||a===void 0){let u;return e[8]!==n?(u=s.jsx(rs,{file:n,note:"preview unavailable"}),e[8]=n,e[9]=u):u=e[9],u}if(l){const u=`file-preview-${n.key}`;let m;return e[10]!==a||e[11]!==u?(m=s.jsx("div",{className:"h-full overflow-y-auto",children:s.jsx("div",{className:"prose prose-sm dark:prose-invert mx-auto max-w-3xl px-6 py-6",children:s.jsx(Bt,{id:u,text:a})})}),e[10]=a,e[11]=u,e[12]=m):m=e[12],m}let f;return e[13]!==a||e[14]!==n.filename?(f=s.jsx(Ql,{value:a,filename:n.filename}),e[13]=a,e[14]=n.filename,e[15]=f):f=e[15],f}function is(t){const e=R.c(15),{file:n}=t;switch(Jl(n.filename,n.size)){case"image":{let r;return e[0]!==n.downloadUrl||e[1]!==n.filename?(r=s.jsx("div",{className:"flex h-full w-full items-center justify-center overflow-auto bg-muted/30 p-4",children:s.jsx("img",{src:n.downloadUrl,alt:n.filename,className:"max-h-full max-w-full rounded-lg object-contain"})}),e[0]=n.downloadUrl,e[1]=n.filename,e[2]=r):r=e[2],r}case"pdf":{let r;return e[3]!==n.downloadUrl||e[4]!==n.filename?(r=s.jsx("iframe",{src:n.downloadUrl,title:n.filename,className:"block h-full w-full bg-white"}),e[3]=n.downloadUrl,e[4]=n.filename,e[5]=r):r=e[5],r}case"html":{let r;return e[6]!==n.downloadUrl||e[7]!==n.filename?(r=s.jsx("iframe",{src:n.downloadUrl,title:n.filename,sandbox:"allow-scripts",className:"block h-full w-full bg-white"}),e[6]=n.downloadUrl,e[7]=n.filename,e[8]=r):r=e[8],r}case"markdown":{let r;return e[9]!==n?(r=s.jsx(un,{file:n,markdown:!0}),e[9]=n,e[10]=r):r=e[10],r}case"text":{let r;return e[11]!==n?(r=s.jsx(un,{file:n,markdown:!1}),e[11]=n,e[12]=r):r=e[12],r}default:{let r;return e[13]!==n?(r=s.jsx(rs,{file:n}),e[13]=n,e[14]=r):r=e[14],r}}}function er(t){const e=R.c(40),{readUrl:n,editor:l,downloadName:r,trailing:i}=t;let o;e[0]!==n?(o=new URL(n,window.location.origin).toString(),e[0]=n,e[1]=o):o=e[1];const a=o;let c;e[2]!==l?(c=l.deckDetected&&s.jsxs(xe,{children:[s.jsx(ge,{asChild:!0,children:s.jsx(Y,{variant:l.railOpen?"secondary":"ghost",size:"icon","aria-label":l.railOpen?"Hide slide list":"Show slide list",onClick:()=>l.setRailOpen(!l.railOpen),children:s.jsx(dl,{size:14})})}),s.jsx(be,{side:"bottom",children:l.railOpen?"Hide slide list":"Show slide list"})]}),e[2]=l,e[3]=c):c=e[3];let d;e[4]!==a?(d=()=>window.open(a,"_blank","noopener"),e[4]=a,e[5]=d):d=e[5];let f;e[6]!==a?(f=s.jsx("span",{className:"truncate",children:a}),e[6]=a,e[7]=f):f=e[7];let u;e[8]!==a||e[9]!==d||e[10]!==f?(u=s.jsx("button",{type:"button",onClick:d,className:"flex min-w-0 flex-1 items-center rounded-md px-2 py-1 text-left text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",title:a,children:f}),e[8]=a,e[9]=d,e[10]=f,e[11]=u):u=e[11];let m;e[12]!==l.agentUpdated||e[13]!==l.reload?(m=l.agentUpdated&&s.jsxs(xe,{children:[s.jsx(ge,{asChild:!0,children:s.jsxs(Y,{variant:"outline",size:"sm",className:"h-7 gap-1 text-xs",onClick:l.reload,children:[s.jsx(yn,{size:12}),"Agent updated — reload"]})}),s.jsx(be,{side:"bottom",children:"The agent rewrote this deck while you were editing. Reloading discards unsaved differences."})]}),e[12]=l.agentUpdated,e[13]=l.reload,e[14]=m):m=e[14];let h;e[15]!==l.saving?(h=l.saving&&s.jsx("span",{className:"px-1 text-xs text-muted-foreground",children:"Saving…"}),e[15]=l.saving,e[16]=h):h=e[16];let p;e[17]!==l?(p=l.deckDetected&&l.writable&&s.jsxs(xe,{children:[s.jsx(ge,{asChild:!0,children:s.jsx(Y,{variant:l.editMode?"secondary":"ghost",size:"icon","aria-label":l.editMode?"Done editing":"Edit inline",className:ae(l.editMode&&"text-primary"),onClick:()=>l.setEditMode(!l.editMode),children:s.jsx(Ps,{size:14})})}),s.jsx(be,{side:"bottom",children:l.editMode?"Done editing":"Edit inline (text, reorder, delete)"})]}),e[17]=l,e[18]=p):p=e[18];let g;e[19]!==a||e[20]!==r||e[21]!==l.deckDetected?(g=l.deckDetected?s.jsxs(Ze,{children:[s.jsx(Je,{asChild:!0,children:s.jsx(Y,{variant:"ghost",size:"icon","aria-label":"Download",children:s.jsx(qe,{size:14})})}),s.jsxs(et,{align:"end",children:[s.jsxs(pe,{onClick:()=>window.open(`${a}#print`,"_blank","noopener"),children:[s.jsx(Es,{size:14}),"Export as PDF"]}),s.jsx(pe,{asChild:!0,children:s.jsxs("a",{href:a,download:r,children:[s.jsx(Ds,{size:14}),"Download HTML"]})})]})]}):s.jsxs(xe,{children:[s.jsx(ge,{asChild:!0,children:s.jsx(Y,{variant:"ghost",size:"icon","aria-label":"Download",asChild:!0,children:s.jsx("a",{href:a,download:r,children:s.jsx(qe,{size:14})})})}),s.jsx(be,{side:"bottom",children:"Download"})]}),e[19]=a,e[20]=r,e[21]=l.deckDetected,e[22]=g):g=e[22];let y;e[23]!==a?(y=()=>window.open(a,"_blank","noopener"),e[23]=a,e[24]=y):y=e[24];let x;e[25]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(An,{size:14}),e[25]=x):x=e[25];let b;e[26]!==y?(b=s.jsx(ge,{asChild:!0,children:s.jsx(Y,{variant:"ghost",size:"icon","aria-label":"Open in new tab",onClick:y,children:x})}),e[26]=y,e[27]=b):b=e[27];let j;e[28]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(be,{side:"bottom",children:"Open in new tab"}),e[28]=j):j=e[28];let z;e[29]!==b?(z=s.jsxs(xe,{children:[b,j]}),e[29]=b,e[30]=z):z=e[30];let N;return e[31]!==z||e[32]!==c||e[33]!==u||e[34]!==m||e[35]!==h||e[36]!==p||e[37]!==g||e[38]!==i?(N=s.jsxs("div",{className:"flex h-9 shrink-0 items-center gap-1 border-b border-border/60 px-2",children:[c,u,m,h,p,g,z,i]}),e[31]=z,e[32]=c,e[33]=u,e[34]=m,e[35]=h,e[36]=p,e[37]=g,e[38]=i,e[39]=N):N=e[39],N}const Ae=1;function tr(t){if(typeof t!="object"||t===null||t.v!==Ae||t.source!=="deck-viewer")return null;const e=t;return e.type==="ready"||e.type==="state"||e.type==="op"&&typeof e.opId=="string"&&e.op?e:null}class ke extends Error{constructor(e,n){super(e),this.code=n,this.name="DeckOpError"}code}function os(t){return[...t.children].filter(e=>!/^(TEMPLATE|SCRIPT|STYLE)$/.test(e.tagName))}function nr(t){const n=new DOMParser().parseFromString(t,"text/html").querySelector("deck-viewer");return n?os(n).length:null}function sr(t,e){const n=new DOMParser().parseFromString(t,"text/html"),l=n.querySelector("deck-viewer");if(!l)throw new ke("no <deck-viewer> element in source","no-viewer");const r=os(l),i=e.kind==="move"?e.from:e.at,o=r[i];if(!o)throw new ke(`slide index ${i} out of range (${r.length})`,"stale-index");switch(e.kind){case"remove":{if(r.length<=1)throw new ke("cannot remove the last slide","bad-op");o.remove();break}case"duplicate":{const c=o.cloneNode(!0);c.removeAttribute("id");for(const d of c.querySelectorAll("[id]"))d.removeAttribute("id");o.after(c);break}case"move":{if(e.to<0||e.to>=r.length)throw new ke(`move target ${e.to} out of range`,"stale-index");if(e.to!==e.from){const c=e.to<e.from?r[e.to]:r[e.to].nextSibling;l.insertBefore(o,c)}break}case"set-attr":{if(!/^[a-zA-Z][\w-]*$/.test(e.name))throw new ke(`invalid attribute name: ${e.name}`,"bad-op");o.setAttribute(e.name,e.value);break}case"remove-attr":{o.removeAttribute(e.name);break}case"replace":{const d=new DOMParser().parseFromString(e.html,"text/html").body.firstElementChild;if(!d)throw new ke("replace html has no root element","bad-op");o.replaceWith(n.importNode(d,!0));break}default:throw new ke(`unknown op kind: ${e.kind}`,"bad-op")}return`${t.trimStart().toLowerCase().startsWith("<!doctype")?`<!DOCTYPE html>
4
+ `:""}${n.documentElement.outerHTML}
5
+ `}const fn="home",lr=400,rr=800;function ir(t){const e=t.savePath!==void 0,{org:n}=Ve(),l=Ft(),r=En(fn),[i,o]=k.useState(!1),[a,c]=k.useState(!1),[d,f]=k.useState(!1),[u,m]=k.useState(!1),[h,p]=k.useState(!1),[g,y]=k.useState(!1),[x,b]=k.useState(null),[j,z]=k.useState(null),[N,C]=k.useState(0),[w]=k.useState(()=>({iframe:null,source:null,queue:Promise.resolve(),saveTimer:null,selfMarkers:new Set})),M=i||g||h,O=()=>{t.savePath!==void 0&&(l.invalidateQueries({queryKey:se.orgFsStat(n.id,fn,t.savePath)}),l.invalidateQueries({queryKey:se.orgFsRecent(n.id)}))},T=A=>{w.iframe?.contentWindow?.postMessage(A,"*")},v=()=>{w.source=null,m(!1),j&&b(j),C(A=>A+1),O()};t.statMarker!==j&&(z(t.statMarker),t.statMarker!==null&&(x===null?b(t.statMarker):w.selfMarkers.has(t.statMarker)||t.statMarker!==x&&(M?m(!0):(w.source=null,b(t.statMarker)))));const $=async()=>{w.saveTimer=null;const A=w.source;if(A===null){y(!1);return}p(!0);try{const W=await r.mutateAsync({path:t.savePath,body:A});w.selfMarkers.add(Dn(W)),O()}catch(W){console.error("[deck-editor] save failed",W),ce.error("Couldn't save deck edits — reloading the preview."),G.current.reload()}finally{p(!1),y(!1)}},K=A=>{y(!0),w.saveTimer&&clearTimeout(w.saveTimer),w.saveTimer=setTimeout(()=>{G.current.flushSave()},A)},F=(A,W,S)=>{T({v:Ae,type:"ack",opId:A,ok:W,error:S})},_=async A=>{if(!e){F(A.opId,!1,"read-only preview");return}try{if(w.source===null){const S=await fetch(t.readUrl,{credentials:"include"});if(!S.ok)throw new Error(`HTTP ${S.status}`);w.source=await S.text()}const W=nr(w.source);if(W===null||W!==A.witness.childCount)throw new ke(`slide count drifted (source ${W}, iframe ${A.witness.childCount})`,"stale-index");w.source=sr(w.source,A.op),F(A.opId,!0),K(A.op.kind==="replace"?rr:lr)}catch(W){console.error("[deck-editor] op failed",A.op,W),F(A.opId,!1,W instanceof Error?W.message:String(W)),ce.error("That edit couldn't be saved — reloading the preview."),G.current.reload()}},B=A=>{if(!w.iframe||A.source!==w.iframe.contentWindow)return;const W=tr(A.data);if(W){if(W.type==="ready"){c(!0),G.current.editMode?T({v:Ae,type:"set-edit-mode",enabled:!0}):G.current.railOpen&&T({v:Ae,type:"set-rail",open:!0});return}W.type==="op"&&(w.queue=w.queue.then(()=>G.current.handleOp(W)).catch(()=>{}))}},G=k.useRef({onMessage:B,handleOp:_,flushSave:$,reload:v,editMode:i,railOpen:d});G.current={onMessage:B,handleOp:_,flushSave:$,reload:v,editMode:i,railOpen:d};const[q]=k.useState(()=>{let A=null;return W=>{if(W){w.iframe=W;const S=I=>G.current.onMessage(I);window.addEventListener("message",S),A=()=>window.removeEventListener("message",S)}else A?.(),A=null,w.iframe=null}}),J=A=>{f(A),T({v:Ae,type:"set-rail",open:A})},Z=A=>{o(A),T({v:Ae,type:"set-edit-mode",enabled:A}),A&&f(!0),!A&&u&&!g&&!h&&v()};return{iframeRef:q,deckDetected:a,writable:e,displayedMarker:x===null?null:`${x}.${N}`,editMode:i,setEditMode:Z,railOpen:d,setRailOpen:J,saving:h,agentUpdated:u,reload:v,postToIframe:T}}const or=300;function ar({readUrl:t,marker:e,title:n,savePath:l,trailing:r}){const i=ir({readUrl:t,statMarker:e,savePath:l}),[o,a]=k.useState(null);if(i.displayedMarker===null)return null;const c=t.includes("?")?"&":"?",d=`${t}${c}v=${encodeURIComponent(i.displayedMarker)}`,f=o===d;return s.jsxs("div",{className:"flex h-full w-full flex-col bg-background",children:[s.jsx(er,{readUrl:t,editor:i,downloadName:n.split("/").pop()??n,trailing:r}),s.jsx("div",{className:"relative flex-1",children:s.jsx("iframe",{ref:i.iframeRef,src:d,onLoad:()=>a(d),sandbox:"allow-scripts",className:ae("absolute inset-0 block h-full w-full bg-white","transition-opacity ease-out",f?"opacity-100":"opacity-0"),style:{transitionDuration:`${or}ms`},title:n},d)})]})}const cr=[{mode:"private",label:"Org only",Icon:ks},{mode:"public",label:"Public",Icon:pt},{mode:"password",label:"Password",Icon:On}];function as(t){const e=R.c(38),{volume:n,path:l,kind:r,shareMode:i,effectivePublic:o,url:a}=t,c=Qs(n),{data:d}=Tn(n,l),f=d?.shareMode??i,m=(d?.effectivePublic??o)&&f==="private",h=r==="dir",p=h?"folder":"file",[g,y]=k.useState(!1),[x,b]=k.useState(""),[j,z]=k.useState(!1);let N;e[0]!==l||e[1]!==c||e[2]!==p?(N=(Z,A)=>{c.mutate({path:l,mode:Z,password:A},{onSuccess:()=>{y(!1),b(""),ce.success(Z==="private"?`This ${p} is now org-only`:Z==="public"?`Anyone with the link can now view this ${p}`:`This ${p} is now password-protected`)},onError:dr})},e[0]=l,e[1]=c,e[2]=p,e[3]=N):N=e[3];const C=N;let w;e[4]!==C?(w=Z=>{if(Z==="password"){y(!0);return}y(!1),C(Z)},e[4]=C,e[5]=w):w=e[5];const M=w,O=g?"password":f;let T;e[6]!==a?(T=async()=>{a&&(await navigator.clipboard.writeText(a),z(!0),ce.success("Link copied to clipboard"),setTimeout(()=>z(!1),2e3))},e[6]=a,e[7]=T):T=e[7];const v=T;let $;e[8]!==j||e[9]!==v||e[10]!==a?($=a?s.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-input bg-muted/50 px-2 py-1.5",children:[s.jsx("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:a}),s.jsx(Y,{variant:"ghost",size:"icon",className:"size-6 shrink-0",onClick:v,"aria-label":"Copy link",children:j?s.jsx(sl,{size:12,className:"text-green-600"}):s.jsx(Cs,{size:12})})]}):null,e[8]=j,e[9]=v,e[10]=a,e[11]=$):$=e[11];const K=$;if(m){let Z;e[12]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsx("div",{className:"mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:s.jsx(pt,{size:16})}),e[12]=Z):Z=e[12];let A;e[13]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx("span",{className:"text-sm font-medium text-foreground",children:"Shared via a parent folder"}),e[13]=A):A=e[13];const W=h?"files in this folder":"this file";let S;e[14]!==W?(S=s.jsxs("div",{className:"flex items-start gap-3",children:[Z,s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[A,s.jsxs("span",{className:"text-xs text-muted-foreground",children:["Anyone with the link can view"," ",W,". Manage sharing on the parent folder."]})]})]}),e[14]=W,e[15]=S):S=e[15];let I;return e[16]!==K||e[17]!==S?(I=s.jsxs("div",{className:"flex w-full min-w-0 flex-col gap-3",children:[S,K]}),e[16]=K,e[17]=S,e[18]=I):I=e[18],I}let F;e[19]!==O||e[20]!==M||e[21]!==c.isPending?(F=cr.map(Z=>{const{mode:A,label:W,Icon:S}=Z;return s.jsxs("button",{type:"button",disabled:c.isPending,onClick:()=>M(A),className:ae("flex flex-col items-center gap-1 rounded-md px-2 py-2 text-xs font-medium transition-colors disabled:opacity-60",O===A?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[s.jsx(S,{size:15}),W]},A)}),e[19]=O,e[20]=M,e[21]=c.isPending,e[22]=F):F=e[22];let _;e[23]!==F?(_=s.jsx("div",{className:"grid grid-cols-3 gap-1 rounded-lg bg-muted p-1",children:F}),e[23]=F,e[24]=_):_=e[24];const B=O==="private"?`Only members of your organization can open ${h?"these files":"this link"}.`:O==="public"?h?"Anyone on the internet can view files in this folder via their link.":"Anyone on the internet with the link can view this file.":`Anyone with the link AND the password can view ${h?"files in this folder":"this file"}.`;let G;e[25]!==B?(G=s.jsx("p",{className:"text-xs text-muted-foreground",children:B}),e[25]=B,e[26]=G):G=e[26];let q;e[27]!==O||e[28]!==C||e[29]!==f||e[30]!==x||e[31]!==c.isPending?(q=O==="password"&&s.jsxs("form",{className:"flex items-center gap-2",onSubmit:Z=>{Z.preventDefault(),x&&C("password",x)},children:[s.jsx(We,{type:"password",value:x,onChange:Z=>b(Z.target.value),placeholder:f==="password"?"New password":"Password",autoComplete:"new-password",className:"h-8 text-xs"}),s.jsx(Y,{type:"submit",size:"sm",className:"shrink-0",disabled:!x||c.isPending,children:f==="password"?"Update":"Set"})]}),e[27]=O,e[28]=C,e[29]=f,e[30]=x,e[31]=c.isPending,e[32]=q):q=e[32];let J;return e[33]!==K||e[34]!==_||e[35]!==G||e[36]!==q?(J=s.jsxs("div",{className:"flex w-full min-w-0 flex-col gap-3",children:[_,G,q,K]}),e[33]=K,e[34]=_,e[35]=G,e[36]=q,e[37]=J):J=e[37],J}function dr(t){return ce.error(t instanceof Error?t.message:"Failed to update sharing")}function mn(t){const e=R.c(7),{volume:n,path:l,shareMode:r,effectivePublic:i,url:o}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs(xe,{children:[s.jsx(ge,{asChild:!0,children:s.jsx(rl,{asChild:!0,children:s.jsx(Y,{variant:"ghost",size:"icon","aria-label":"Share",children:s.jsx(Sn,{size:14})})})}),s.jsx(be,{side:"bottom",children:"Share"})]}),e[0]=a):a=e[0];let c;return e[1]!==i||e[2]!==l||e[3]!==r||e[4]!==o||e[5]!==n?(c=s.jsxs(il,{children:[a,s.jsx(ol,{align:"end",className:"w-80 p-3",children:s.jsx(as,{volume:n,path:l,kind:"file",shareMode:r,effectivePublic:i,url:o})})]}),e[1]=i,e[2]=l,e[3]=r,e[4]=o,e[5]=n,e[6]=c):c=e[6],c}function ur(t){const e=R.c(11),{target:n,onOpenChange:l}=t,r=!!n,i=n?.kind==="dir"?"folder":"file";let o;e[0]!==i?(o=s.jsx(Cn,{children:s.jsxs(Le,{children:["Share ",i]})}),e[0]=i,e[1]=o):o=e[1];let a;e[2]!==n?(a=n&&s.jsx(as,{...n}),e[2]=n,e[3]=a):a=e[3];let c;e[4]!==o||e[5]!==a?(c=s.jsxs(Xe,{className:"sm:max-w-md",children:[o,a]}),e[4]=o,e[5]=a,e[6]=c):c=e[6];let d;return e[7]!==l||e[8]!==r||e[9]!==c?(d=s.jsx(Qe,{open:r,onOpenChange:l,children:c}),e[7]=l,e[8]=r,e[9]=c,e[10]=d):d=e[10],d}function jt(t){const e=t?t.split("/").filter(Boolean):[],n=e[0]==="public",l=n?e[1]??null:null,r=n?l?`public-${l}`:null:e[0]??null,i=(n?e.slice(2):e.slice(1)).join("/");return{segments:e,volume:r,dirPath:i,isPublic:n,publicSet:l,readOnly:n}}function Me(t,e){return t.isPublic&&t.publicSet?`public/${t.publicSet}/${e}`:t.volume?`${t.volume}/${e}`:e}const hn="public-";function Xt(t){return t.startsWith(hn)?t.slice(hn.length):null}function fr(t,e){const n=Xt(t);return n?`public/${n}/${e}`:`${t}/${e}`}function le(t){const e=t.lastIndexOf("/");return e===-1?t:t.slice(e+1)}function mr(t){const e=R.c(11),{org:n,previewPath:l}=t;let r;e[0]!==l?(r=l.split("/").slice(0,-1).join("/"),e[0]=l,e[1]=r):r=e[1];const i=r;let o;e[2]!==n?(o={org:n},e[2]=n,e[3]=o):o=e[3];let a;e[4]!==i||e[5]!==l?(a={path:i,preview:l},e[4]=i,e[5]=l,e[6]=a):a=e[6];let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(_t,{size:14}),e[7]=c):c=e[7];let d;return e[8]!==o||e[9]!==a?(d=s.jsx(Y,{variant:"ghost",size:"sm",asChild:!0,className:"shrink-0 gap-1.5 text-xs text-muted-foreground",children:s.jsxs(Ss,{to:"/$org/files",params:o,search:a,children:[c,"See in library"]})}),e[8]=o,e[9]=a,e[10]=d):d=e[10],d}const hr=t=>/\.html?$/i.test(t);function pn(t){const e=R.c(6),{onClose:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(zn,{size:14}),e[0]=l):l=e[0];let r;e[1]!==n?(r=s.jsx(ge,{asChild:!0,children:s.jsx(Y,{variant:"ghost",size:"icon",onClick:n,children:l})}),e[1]=n,e[2]=r):r=e[2];let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(be,{side:"bottom",children:"Close"}),e[3]=i):i=e[3];let o;return e[4]!==r?(o=s.jsxs(xe,{children:[r,i]}),e[4]=r,e[5]=o):o=e[5],o}function cs(t){const e=R.c(37),{previewPath:n,onClose:l,showSeeInLibrary:r,variant:i}=t,o=r===void 0?!1:r;let a;e[0]!==n?(a=jt(n),e[0]=n,e[1]=a):a=e[1];const c=a,{volume:d,dirPath:f}=c,{data:u,isPending:m}=Tn(d,f),h=Ys(d??""),p=le(f);let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g={strict:!1},e[2]=g):g=e[2];const{org:y}=zs(g),x=i==="dialog";let b;e[3]!==y||e[4]!==n||e[5]!==o?(b=o&&y?s.jsx(mr,{org:y,previewPath:n}):null,e[3]=y,e[4]=n,e[5]=o,e[6]=b):b=e[6];const j=b,z=u&&u.kind==="file"?{key:n,filename:p,size:u.size,downloadUrl:h(u.path)}:null;if(z&&u&&hr(p)){const T=z.downloadUrl;let v;e[7]!==u?(v=Dn(u),e[7]=u,e[8]=v):v=e[8];const $=d??"",K=u.shareMode??"private",F=u.effectivePublic??!1,_=window.location.origin+z.downloadUrl;let B;e[9]!==f||e[10]!==_||e[11]!==$||e[12]!==K||e[13]!==F?(B=s.jsx(mn,{volume:$,path:f,shareMode:K,effectivePublic:F,url:_}),e[9]=f,e[10]=_,e[11]=$,e[12]=K,e[13]=F,e[14]=B):B=e[14];let G;e[15]!==x||e[16]!==l?(G=x?s.jsx("div",{className:"w-8 shrink-0"}):s.jsx(pn,{onClose:l}),e[15]=x,e[16]=l,e[17]=G):G=e[17];let q;return e[18]!==j||e[19]!==B||e[20]!==G?(q=s.jsxs(s.Fragment,{children:[B,j,G]}),e[18]=j,e[19]=B,e[20]=G,e[21]=q):q=e[21],s.jsxs(s.Fragment,{children:[x&&s.jsx(Le,{className:"sr-only",children:p}),s.jsx(ar,{readUrl:T,marker:v,title:p,savePath:d==="home"?f:void 0,trailing:q},n)]})}const N=x?"h-11 py-1 pr-12 pl-2":"h-9 px-2";let C;e[22]!==N?(C=ae("flex shrink-0 items-center gap-1 border-b border-border/60",N),e[22]=N,e[23]=C):C=e[23];let w;e[24]!==u?.effectivePublic||e[25]!==u?.shareMode||e[26]!==z||e[27]!==f||e[28]!==d?(w=z&&s.jsxs(s.Fragment,{children:[s.jsx(mn,{volume:d??"",path:f,shareMode:u?.shareMode??"private",effectivePublic:u?.effectivePublic??!1,url:window.location.origin+z.downloadUrl}),s.jsxs(xe,{children:[s.jsx(ge,{asChild:!0,children:s.jsx(Y,{variant:"ghost",size:"icon",asChild:!0,children:s.jsx("a",{href:z.downloadUrl,download:z.filename,children:s.jsx(qe,{size:14})})})}),s.jsx(be,{side:"bottom",children:"Download"})]}),s.jsxs(xe,{children:[s.jsx(ge,{asChild:!0,children:s.jsx(Y,{variant:"ghost",size:"icon",onClick:()=>window.open(z.downloadUrl,"_blank","noopener"),children:s.jsx(An,{size:14})})}),s.jsx(be,{side:"bottom",children:"Open in new tab"})]})]}),e[24]=u?.effectivePublic,e[25]=u?.shareMode,e[26]=z,e[27]=f,e[28]=d,e[29]=w):w=e[29];let M;e[30]!==x||e[31]!==l?(M=!x&&s.jsx(pn,{onClose:l}),e[30]=x,e[31]=l,e[32]=M):M=e[32];let O;return e[33]!==z||e[34]!==p||e[35]!==m?(O=s.jsx("div",{className:"relative min-h-0 flex-1 bg-background",children:z?s.jsx(is,{file:z}):m?s.jsx(ls,{}):s.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[s.jsx(we,{filename:p,className:"h-7.5 w-6"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"This file is no longer available."})]})}),e[33]=z,e[34]=p,e[35]=m,e[36]=O):O=e[36],s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:C,children:[s.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2 px-2",children:[s.jsx(we,{filename:p,className:"h-4.5 w-3.5 shrink-0"}),x?s.jsx(Le,{className:"truncate text-xs font-medium text-foreground",children:p}):s.jsx("span",{className:"truncate text-xs font-medium text-foreground",children:p}),z&&s.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:ss(z.size)})]}),j,w,M]}),O]})}function pr(t){const e=R.c(4),{previewPath:n,onClose:l,showSeeInLibrary:r}=t,i=r===void 0?!1:r;let o;return e[0]!==l||e[1]!==n||e[2]!==i?(o=s.jsx("div",{className:"flex h-full w-full flex-col bg-background",children:s.jsx(cs,{previewPath:n,onClose:l,showSeeInLibrary:i,variant:"panel"})}),e[0]=l,e[1]=n,e[2]=i,e[3]=o):o=e[3],o}const xr=new Set(["output","upload","public","home"]),gr=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;function ds(t){return xr.has(t)||!gr.test(t)?"home":t}function br(t){const e=R.c(5),{icon:n}=t;if(n.kind==="component"){const{Component:r}=n;let i;return e[0]!==r?(i=s.jsx(r,{className:"size-4"}),e[0]=r,e[1]=i):i=e[1],i}if(n.kind==="url"){let r;return e[2]!==n.src?(r=s.jsx("img",{src:n.src,alt:"",className:"size-4 rounded-sm object-cover"}),e[2]=n.src,e[3]=r):r=e[3],r}let l;return e[4]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Ts,{className:"size-4"}),e[4]=l):l=e[4],l}function vr(t){const e=R.c(13),{title:n,icon:l,active:r,onClick:i}=t,o=r?"bg-sidebar-accent text-sidebar-foreground":"text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground";let a;e[0]!==o?(a=ae("shrink-0 flex items-center gap-1.5 h-8 rounded-md px-2","[transition:background-color_180ms_ease,color_180ms_ease]",o),e[0]=o,e[1]=a):a=e[1];let c;e[2]!==l?(c=s.jsx("span",{className:"flex size-5 items-center justify-center shrink-0",children:s.jsx(br,{icon:l})}),e[2]=l,e[3]=c):c=e[3];let d;e[4]!==n?(d=s.jsx("span",{className:"whitespace-nowrap text-sm font-medium leading-none",children:n}),e[4]=n,e[5]=d):d=e[5];let f;return e[6]!==r||e[7]!==i||e[8]!==a||e[9]!==c||e[10]!==d||e[11]!==n?(f=s.jsxs("button",{type:"button",onClick:i,"aria-pressed":r,"aria-label":n,className:a,children:[c,d]}),e[6]=r,e[7]=i,e[8]=a,e[9]=c,e[10]=d,e[11]=n,e[12]=f):f=e[12],f}function yr(t){const e=R.c(33);let n,l,r;e[0]!==t?({glyph:n,readOnly:r,...l}=t,e[0]=t,e[1]=n,e[2]=l,e[3]=r):(n=e[1],l=e[2],r=e[3]);const i=k.useId(),o=`${i}-back`,a=`${i}-front`,c=`url(#${o})`;let d;e[4]!==c?(d=s.jsx("path",{d:"M2.53738 2.55C1.13602 2.55 0 3.68602 0 5.08738V11.535H31.931V7.65326C31.931 6.23616 30.7822 5.08738 29.3651 5.08738H14.7681L13.8775 5.02542C13.3886 4.99141 12.9197 4.81809 12.5261 4.52596L10.7726 3.22419C10.1828 2.78638 9.46784 2.55 8.73334 2.55H2.53738Z",fill:c}),e[4]=c,e[5]=d):d=e[5];const f=`url(#${a})`;let u;e[6]!==f?(u=s.jsx("rect",{y:"8.72",width:"32",height:"21",rx:"2.566",fill:f}),e[6]=f,e[7]=u):u=e[7];let m,h,p;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("rect",{x:"0.3",y:"8.86",width:"31.4",height:"0.55",rx:"0.275",fill:"#FFFFFF",opacity:"0.25"}),h=s.jsx("rect",{y:"25.81",width:"32",height:"0.552",fill:"#84CDFB"}),p=s.jsx("rect",{y:"27.05",width:"32",height:"0.552",fill:"#84CDFB"}),e[8]=m,e[9]=h,e[10]=p):(m=e[8],h=e[9],p=e[10]);let g;e[11]!==n?(g=n&&s.jsx(n,{x:10.5,y:13.2,width:11,height:11,strokeWidth:2.2,style:{color:"#014AC9",opacity:.55}}),e[11]=n,e[12]=g):g=e[12];let y;e[13]!==r?(y=r&&s.jsxs(s.Fragment,{children:[s.jsx("circle",{cx:"25.5",cy:"25.5",r:"6.2",strokeWidth:"1",className:"fill-background stroke-border"}),s.jsx(kn,{x:22.1,y:22.1,width:6.8,height:6.8,strokeWidth:2.2,className:"text-muted-foreground"})]}),e[13]=r,e[14]=y):y=e[14];let x,b;e[15]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("stop",{offset:"0.3",stopColor:"#4D87DF"}),b=s.jsx("stop",{offset:"1",stopColor:"#296FE8"}),e[15]=x,e[16]=b):(x=e[15],b=e[16]);let j;e[17]!==o?(j=s.jsxs("linearGradient",{id:o,x1:"15.97",y1:"2.55",x2:"15.97",y2:"9.53",gradientUnits:"userSpaceOnUse",children:[x,b]}),e[17]=o,e[18]=j):j=e[18];let z,N;e[19]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx("stop",{stopColor:"#72B6FA"}),N=s.jsx("stop",{offset:"1",stopColor:"#5BB1EF"}),e[19]=z,e[20]=N):(z=e[19],N=e[20]);let C;e[21]!==a?(C=s.jsxs("radialGradient",{id:a,cx:"0",cy:"0",r:"10",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(1.6 0 0 2.1538 16 19.22)",children:[z,N]}),e[21]=a,e[22]=C):C=e[22];let w;e[23]!==j||e[24]!==C?(w=s.jsxs("defs",{children:[j,C]}),e[23]=j,e[24]=C,e[25]=w):w=e[25];let M;return e[26]!==l||e[27]!==w||e[28]!==d||e[29]!==u||e[30]!==g||e[31]!==y?(M=s.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...l,children:[d,u,m,h,p,g,y,w]}),e[26]=l,e[27]=w,e[28]=d,e[29]=u,e[30]=g,e[31]=y,e[32]=M):M=e[32],M}function wr(t,e,n){return e?"color":n?"font":/^--brand-(text|fw|leading|tracking)/i.test(t)?"type":/^--brand-space/i.test(t)?"space":/^--brand-radius/i.test(t)?"radius":/^--brand-shadow/i.test(t)?"shadow":/^--brand-(duration|delay|ease)/i.test(t)?"motion":"other"}const jr=/^(rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)\(/i,kr=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,Sr=["svg","png","jpg","jpeg","webp","avif","gif"];function zr(t){return t.split(".").pop()?.toLowerCase()??""}function Nr(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Cr(t){const e=t.trim();return kr.test(e)||jr.test(e)}function $r(t){const e=t.trim(),n=e.match(/^#([0-9a-f]{3})$/i);return n?.[1]?`#${[...n[1]].map(l=>l+l).join("")}`:e}function us(t){const e=[],n=new Map,l=/(--brand-[\w-]+)\s*:\s*([^;]+);/g;let r;for(;(r=l.exec(t))!==null;){const i=r[1],o=r[2].trim();n.has(i)||e.push(i),n.set(i,o)}return e.map(i=>{const o=n.get(i),a=Cr(o),c=/^--brand-font/i.test(i);return{name:i,value:o,isColor:a,isFont:c,kind:wr(i,a,c)}})}const xn=["primary","secondary","accent","neutral","success","warning","error","info","bg","fg","border","ring"];function Pr(t){return t.match(/^--brand-([a-z]+)/i)?.[1]?.toLowerCase()??t}function Er(t){const e=[],n=new Map;for(const r of t){if(r.kind!=="color")continue;const i=Pr(r.name);n.has(i)||(e.push(i),n.set(i,[])),n.get(i).push(r)}return e.map(r=>{const i=n.get(r);return{family:r,tokens:i,isRamp:i.filter(o=>/-\d+$/.test(o.name)).length>=5}}).sort((r,i)=>{const o=xn.indexOf(r.family),a=xn.indexOf(i.family);return o===-1&&a===-1?0:o===-1?1:a===-1?-1:o-a})}function Dr(t,e,n){const l=new RegExp(`(${Nr(e)}\\s*:\\s*)[^;]+(;)`);if(l.test(t))return t.replace(l,(o,a,c)=>`${a}${n}${c}`);const r=t.search(/:root\s*\{/);if(r!==-1){const o=t.indexOf("{",r)+1;return`${t.slice(0,o)}
6
+ ${e}: ${n};${t.slice(o)}`}const i=t.length>0&&!t.endsWith(`
7
+ `)?`
8
+ `:"";return`${t}${i}:root {
9
+ ${e}: ${n};
10
+ }
11
+ `}function Tr(t){const e=t.filter(l=>l.kind==="file"),n=e.find(l=>/(^|\/)logo\.(svg|png|jpe?g|webp|avif|gif)$/i.test(l.path));return n?n.path:e.find(l=>Sr.includes(zr(l.path)))?.path??null}function Mr(t){const e={};for(const n of t.split(`
12
+ `)){const l=n.match(/^([A-Za-z][\w-]*):\s*(.*)$/);l?.[1]&&l[2]!==void 0&&(e[l[1].toLowerCase()]=l[2].trim())}return e}function gn(t){for(const e of t.split(/\n\s*\n/)){const n=e.trim();if(!(!n||n.startsWith("#")))return n.replace(/\n/g," ")}return null}function fs(t){const e=t.match(/^---\n([\s\S]*?)\n---\n?/);if(!e||e[1]===void 0)return{name:null,description:gn(t),body:t};const n=Mr(e[1]),l=t.slice(e[0].length);return{name:n.name||null,description:n.description||gn(l),body:l}}const Or=new Set(["png","jpg","jpeg","gif","webp","svg","avif"]),Ar=new Set(["csv","tsv"]),Rr=new Set(["mp4","webm","mov","m4v"]),Ir=new Set(["txt","md","markdown","json","log","yaml","yml","xml","html","htm"]),Lr=256*1024;function tt(t){const e=new Date(t);if(Number.isNaN(e.getTime()))return"";const n=Date.now()-e.getTime(),l=Math.floor(n/6e4);if(l<1)return"just now";if(l<60)return`${l}m ago`;const r=Math.floor(l/60);if(r<24)return`${r}h ago`;const i=Math.floor(r/24);return i<30?`${i}d ago`:e.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function Fr(t){return t.split(".").pop()?.toLowerCase()??""}function Qt(t){const e=R.c(3),{onShare:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Sn,{size:14}),e[0]=l):l=e[0];let r;return e[1]!==n?(r=s.jsxs(pe,{onClick:n,children:[l,"Share"]}),e[1]=n,e[2]=r):r=e[2],r}function _r(t){const e=R.c(9),{state:n}=t,l=n==="password"?"Password-protected — link + password to view":n==="inherited"?"Shared via a parent folder":"Public — anyone with the link can view",r=n==="password"?On:pt,i=n==="inherited"?"text-muted-foreground/60":"text-primary";let o;e[0]!==i?(o=ae(i),e[0]=i,e[1]=o):o=e[1];let a;e[2]!==r||e[3]!==l||e[4]!==o?(a=s.jsx(r,{size:12,className:o,"aria-label":l}),e[2]=r,e[3]=l,e[4]=o,e[5]=a):a=e[5];let c;return e[6]!==l||e[7]!==a?(c=s.jsx("span",{title:l,className:"mt-0.5 flex shrink-0 items-center",children:a}),e[6]=l,e[7]=a,e[8]=c):c=e[8],c}function ms(t){const e=R.c(18),{downloadUrl:n,filename:l,onShare:r,onDelete:i}=t,o=`Actions for ${l}`;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(xt,{size:14}),e[0]=a):a=e[0];let c;e[1]!==o?(c=s.jsx(Je,{asChild:!0,children:s.jsx(Y,{variant:"ghost",size:"icon",className:"size-6 shrink-0 opacity-0 transition-opacity group-hover/card:opacity-100 data-[state=open]:opacity-100",onClick:Br,"aria-label":o,children:a})}),e[1]=o,e[2]=c):c=e[2];let d;e[3]!==r?(d=r&&s.jsx(Qt,{onShare:r}),e[3]=r,e[4]=d):d=e[4];let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(qe,{size:14}),e[5]=f):f=e[5];let u;e[6]!==n||e[7]!==l?(u=s.jsx(pe,{asChild:!0,children:s.jsxs("a",{href:n,download:l,children:[f,"Download"]})}),e[6]=n,e[7]=l,e[8]=u):u=e[8];let m;e[9]!==i?(m=i&&s.jsxs(pe,{variant:"destructive",onClick:i,children:[s.jsx(gt,{size:14}),"Delete"]}),e[9]=i,e[10]=m):m=e[10];let h;e[11]!==d||e[12]!==u||e[13]!==m?(h=s.jsxs(et,{align:"end",onClick:Ur,children:[d,u,m]}),e[11]=d,e[12]=u,e[13]=m,e[14]=h):h=e[14];let p;return e[15]!==c||e[16]!==h?(p=s.jsxs(Ze,{children:[c,h]}),e[15]=c,e[16]=h,e[17]=p):p=e[17],p}function Ur(t){return t.stopPropagation()}function Br(t){return t.stopPropagation()}function nt(t){const e=R.c(9),{onOpen:n,children:l,className:r}=t;let i;e[0]!==n?(i=c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),n())},e[0]=n,e[1]=i):i=e[1];let o;e[2]!==r?(o=ae("group/card flex cursor-pointer flex-col gap-3 rounded-2xl border border-border bg-background p-4 text-left transition-colors hover:border-border hover:bg-muted/40",r),e[2]=r,e[3]=o):o=e[3];let a;return e[4]!==l||e[5]!==n||e[6]!==i||e[7]!==o?(a=s.jsx("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:i,className:o,children:l}),e[4]=l,e[5]=n,e[6]=i,e[7]=o,e[8]=a):a=e[8],a}function st(t){const e=R.c(19),{icon:n,name:l,meta:r,subtitle:i,publicState:o,actions:a}=t;let c;e[0]!==l?(c=s.jsx("span",{className:"min-w-0 flex-1 truncate text-[13px] text-foreground",title:l,children:l}),e[0]=l,e[1]=c):c=e[1];let d;e[2]!==o?(d=o&&s.jsx(_r,{state:o}),e[2]=o,e[3]=d):d=e[3];let f;e[4]!==r?(f=r&&s.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:r}),e[4]=r,e[5]=f):f=e[5];let u;e[6]!==c||e[7]!==d||e[8]!==f?(u=s.jsxs("div",{className:"flex items-start gap-3",children:[c,d,f]}),e[6]=c,e[7]=d,e[8]=f,e[9]=u):u=e[9];let m;e[10]!==i?(m=i&&s.jsx("span",{className:"truncate text-xs text-muted-foreground",title:i,children:i}),e[10]=i,e[11]=m):m=e[11];let h;e[12]!==u||e[13]!==m?(h=s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col justify-center",children:[u,m]}),e[12]=u,e[13]=m,e[14]=h):h=e[14];let p;return e[15]!==a||e[16]!==n||e[17]!==h?(p=s.jsxs("div",{className:"flex w-full items-center gap-2.5",children:[n,h,a]}),e[15]=a,e[16]=n,e[17]=h,e[18]=p):p=e[18],p}function kt(t){const e=R.c(17),{name:n,meta:l,subtitle:r,glyph:i,readOnly:o,publicState:a,onOpen:c,onShare:d,onDelete:f}=t;let u;e[0]!==i||e[1]!==o?(u=s.jsx(yr,{glyph:i,readOnly:o,className:"size-8 shrink-0"}),e[0]=i,e[1]=o,e[2]=u):u=e[2];let m;e[3]!==n||e[4]!==f||e[5]!==d?(m=d||f?s.jsxs(Ze,{children:[s.jsx(Je,{asChild:!0,children:s.jsx(Y,{variant:"ghost",size:"icon",className:"size-6 shrink-0 opacity-0 transition-opacity group-hover/card:opacity-100 data-[state=open]:opacity-100",onClick:qr,"aria-label":`Actions for ${n}`,children:s.jsx(xt,{size:14})})}),s.jsxs(et,{align:"end",onClick:Hr,children:[d&&s.jsx(Qt,{onShare:d}),f&&s.jsxs(pe,{variant:"destructive",onClick:f,children:[s.jsx(gt,{size:14}),"Delete"]})]})]}):void 0,e[3]=n,e[4]=f,e[5]=d,e[6]=m):m=e[6];let h;e[7]!==l||e[8]!==n||e[9]!==a||e[10]!==r||e[11]!==u||e[12]!==m?(h=s.jsx(st,{icon:u,name:n,meta:l,subtitle:r,publicState:a,actions:m}),e[7]=l,e[8]=n,e[9]=a,e[10]=r,e[11]=u,e[12]=m,e[13]=h):h=e[13];let p;return e[14]!==c||e[15]!==h?(p=s.jsx(nt,{onOpen:c,children:h}),e[14]=c,e[15]=h,e[16]=p):p=e[16],p}function Hr(t){return t.stopPropagation()}function qr(t){return t.stopPropagation()}function hs(t){const e=R.c(22),{filename:n,updatedAt:l,downloadUrl:r,subtitle:i,publicState:o,onOpen:a,onShare:c,onDelete:d}=t;let f;e[0]!==n?(f=s.jsx(we,{filename:n,className:"h-8 w-6.5 shrink-0"}),e[0]=n,e[1]=f):f=e[1];let u;e[2]!==l?(u=tt(l),e[2]=l,e[3]=u):u=e[3];let m;e[4]!==n||e[5]!==i?(m=i??Pn(n),e[4]=n,e[5]=i,e[6]=m):m=e[6];let h;e[7]!==r||e[8]!==n||e[9]!==d||e[10]!==c?(h=s.jsx(ms,{downloadUrl:r,filename:n,onShare:c,onDelete:d}),e[7]=r,e[8]=n,e[9]=d,e[10]=c,e[11]=h):h=e[11];let p;e[12]!==n||e[13]!==o||e[14]!==f||e[15]!==u||e[16]!==m||e[17]!==h?(p=s.jsx(st,{icon:f,name:n,meta:u,subtitle:m,publicState:o,actions:h}),e[12]=n,e[13]=o,e[14]=f,e[15]=u,e[16]=m,e[17]=h,e[18]=p):p=e[18];let g;return e[19]!==a||e[20]!==p?(g=s.jsx(nt,{onOpen:a,children:p}),e[19]=a,e[20]=p,e[21]=g):g=e[21],g}function Wr(t){const e=R.c(40),{dirName:n,updatedAt:l,skillMdUrl:r,publicState:i,onOpen:o,onBrowse:a,onShare:c,onDelete:d}=t;let f;e[0]!==r?(f=se.fileText(r),e[0]=r,e[1]=f):f=e[1];let u;e[2]!==r?(u=async()=>{const B=await fetch(r,{credentials:"include"});if(!B.ok)throw new Error(`fetch failed: ${B.status}`);return B.text()},e[2]=r,e[3]=u):u=e[3];let m;e[4]!==f||e[5]!==u?(m={queryKey:f,queryFn:u,staleTime:6e4,retry:!1},e[4]=f,e[5]=u,e[6]=m):m=e[6];const{data:h}=me(m);let p;e[7]!==h?(p=h?fs(h):null,e[7]=h,e[8]=p):p=e[8];const g=p;let y;e[9]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:s.jsx(Ut,{size:16})}),e[9]=y):y=e[9];const x=g?.name??n;let b;e[10]!==l?(b=tt(l),e[10]=l,e[11]=b):b=e[11];const j=`Actions for ${n}`;let z;e[12]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(xt,{size:14}),e[12]=z):z=e[12];let N;e[13]!==j?(N=s.jsx(Je,{asChild:!0,children:s.jsx(Y,{variant:"ghost",size:"icon",className:"size-6 shrink-0 opacity-0 transition-opacity group-hover/card:opacity-100 data-[state=open]:opacity-100",onClick:Gr,"aria-label":j,children:z})}),e[13]=j,e[14]=N):N=e[14];let C;e[15]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(_t,{size:14}),e[15]=C):C=e[15];let w;e[16]!==a?(w=s.jsxs(pe,{onClick:a,children:[C,"Browse files"]}),e[16]=a,e[17]=w):w=e[17];let M;e[18]!==c?(M=c&&s.jsx(Qt,{onShare:c}),e[18]=c,e[19]=M):M=e[19];let O;e[20]!==d?(O=d&&s.jsxs(pe,{variant:"destructive",onClick:d,children:[s.jsx(gt,{size:14}),"Delete"]}),e[20]=d,e[21]=O):O=e[21];let T;e[22]!==w||e[23]!==M||e[24]!==O?(T=s.jsxs(et,{align:"end",onClick:Kr,children:[w,M,O]}),e[22]=w,e[23]=M,e[24]=O,e[25]=T):T=e[25];let v;e[26]!==N||e[27]!==T?(v=s.jsxs(Ze,{children:[N,T]}),e[26]=N,e[27]=T,e[28]=v):v=e[28];let $;e[29]!==i||e[30]!==v||e[31]!==x||e[32]!==b?($=s.jsx(st,{icon:y,name:x,meta:b,subtitle:"Skill",publicState:i,actions:v}),e[29]=i,e[30]=v,e[31]=x,e[32]=b,e[33]=$):$=e[33];const K=g?.description??"";let F;e[34]!==K?(F=s.jsx("p",{className:"line-clamp-2 min-h-8 text-xs leading-4 text-muted-foreground",children:K}),e[34]=K,e[35]=F):F=e[35];let _;return e[36]!==o||e[37]!==$||e[38]!==F?(_=s.jsxs(nt,{onOpen:o,children:[$,F]}),e[36]=o,e[37]=$,e[38]=F,e[39]=_):_=e[39],_}function Kr(t){return t.stopPropagation()}function Gr(t){return t.stopPropagation()}function Vr(t){const e=R.c(47),{dirName:n,updatedAt:l,tokensUrl:r,onOpen:i,onBrowse:o,onDelete:a}=t;let c;e[0]!==r?(c=se.fileText(r),e[0]=r,e[1]=c):c=e[1];let d;e[2]!==r?(d=async()=>{const j=await fetch(r,{credentials:"include"});if(!j.ok)throw new Error(`fetch failed: ${j.status}`);return j.text()},e[2]=r,e[3]=d):d=e[3];let f;e[4]!==c||e[5]!==d?(f={queryKey:c,queryFn:d,staleTime:6e4,retry:!1},e[4]=c,e[5]=d,e[6]=f):f=e[6];const{data:u}=me(f);let m,h,p,g,y;if(e[7]!==u||e[8]!==n||e[9]!==o||e[10]!==a||e[11]!==i||e[12]!==l){const j=u?us(u).filter(Zr).slice(0,6):[];m=nt,g=i;let z;e[18]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:s.jsx(ct,{size:16})}),e[18]=z):z=e[18];let N;e[19]!==l?(N=tt(l),e[19]=l,e[20]=N):N=e[20];const C=`Actions for ${n}`;let w;e[21]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(xt,{size:14}),e[21]=w):w=e[21];let M;e[22]!==C?(M=s.jsx(Je,{asChild:!0,children:s.jsx(Y,{variant:"ghost",size:"icon",className:"size-6 shrink-0 opacity-0 transition-opacity group-hover/card:opacity-100 data-[state=open]:opacity-100",onClick:Yr,"aria-label":C,children:w})}),e[22]=C,e[23]=M):M=e[23];let O;e[24]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(_t,{size:14}),e[24]=O):O=e[24];let T;e[25]!==o?(T=s.jsxs(pe,{onClick:o,children:[O,"Browse files"]}),e[25]=o,e[26]=T):T=e[26];let v;e[27]!==a?(v=a&&s.jsxs(pe,{variant:"destructive",onClick:a,children:[s.jsx(gt,{size:14}),"Delete"]}),e[27]=a,e[28]=v):v=e[28];let $;e[29]!==T||e[30]!==v?($=s.jsxs(et,{align:"end",onClick:Qr,children:[T,v]}),e[29]=T,e[30]=v,e[31]=$):$=e[31];let K;e[32]!==M||e[33]!==$?(K=s.jsxs(Ze,{children:[M,$]}),e[32]=M,e[33]=$,e[34]=K):K=e[34],e[35]!==n||e[36]!==K||e[37]!==N?(y=s.jsx(st,{icon:z,name:n,meta:N,subtitle:"Brand",actions:K}),e[35]=n,e[36]=K,e[37]=N,e[38]=y):y=e[38],h="flex min-h-5 items-center gap-1.5",p=j.map(Xr),e[7]=u,e[8]=n,e[9]=o,e[10]=a,e[11]=i,e[12]=l,e[13]=m,e[14]=h,e[15]=p,e[16]=g,e[17]=y}else m=e[13],h=e[14],p=e[15],g=e[16],y=e[17];let x;e[39]!==h||e[40]!==p?(x=s.jsx("div",{className:h,children:p}),e[39]=h,e[40]=p,e[41]=x):x=e[41];let b;return e[42]!==m||e[43]!==g||e[44]!==y||e[45]!==x?(b=s.jsxs(m,{onOpen:g,children:[y,x]}),e[42]=m,e[43]=g,e[44]=y,e[45]=x,e[46]=b):b=e[46],b}function Xr(t){return s.jsx("span",{className:"size-5 rounded-full border border-border/60",style:{backgroundColor:t.value},title:`${t.name}: ${t.value}`},t.name)}function Qr(t){return t.stopPropagation()}function Yr(t){return t.stopPropagation()}function Zr(t){return t.isColor}function Ot(t){const e=R.c(4),{children:n}=t,[l,r]=k.useState(!1);let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=()=>c=>{if(!c)return;const d=new IntersectionObserver(f=>{const[u]=f;u?.isIntersecting&&(r(!0),d.disconnect())},{rootMargin:"200px"});d.observe(c)},e[0]=i):i=e[0];const[o]=k.useState(i);if(l){let c;return e[1]!==n?(c=s.jsx(s.Fragment,{children:n}),e[1]=n,e[2]=c):c=e[2],c}let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{ref:o,className:"h-full w-full"}),e[3]=a):a=e[3],a}function Jr(t){const e=R.c(11),{url:n}=t;let l;e[0]!==n?(l=se.fileText(n),e[0]=n,e[1]=l):l=e[1];let r;e[2]!==n?(r=async()=>{const d=await fetch(n,{credentials:"include"});if(!d.ok)throw new Error(`fetch failed: ${d.status}`);return d.text()},e[2]=n,e[3]=r):r=e[3];let i;e[4]!==l||e[5]!==r?(i={queryKey:l,queryFn:r,staleTime:6e4,retry:!1},e[4]=l,e[5]=r,e[6]=i):i=e[6];const{data:o}=me(i);if(!o)return null;let a;e[7]!==o?(a=o.slice(0,2e3),e[7]=o,e[8]=a):a=e[8];let c;return e[9]!==a?(c=s.jsx("pre",{className:"pointer-events-none h-full w-full overflow-hidden bg-background p-3 font-mono text-[9px] leading-[1.5] text-muted-foreground select-none",children:a}),e[9]=a,e[10]=c):c=e[10],c}function ei(t){const e=R.c(23),{url:n,ext:l}=t;let r;e[0]!==n?(r=se.csvThumb(n),e[0]=n,e[1]=r):r=e[1];let i;e[2]!==n?(i=async()=>{const y=await fetch(n,{credentials:"include",headers:{Range:"bytes=0-8191"}});if(!y.ok)throw new Error(`fetch failed: ${y.status}`);return y.text()},e[2]=n,e[3]=i):i=e[3];let o;e[4]!==r||e[5]!==i?(o={queryKey:r,queryFn:i,staleTime:6e4,retry:!1},e[4]=r,e[5]=i,e[6]=o):o=e[6];const{data:a}=me(o);if(!a)return null;const c=l==="tsv"?" ":",";let d,f,u,m;if(e[7]!==a||e[8]!==c){m=Symbol.for("react.early_return_sentinel");e:{let y;e[13]!==c?(y=b=>b.split(c).slice(0,6).map(si),e[13]=c,e[14]=y):y=e[14];const x=a.split(`
13
+ `).filter(Boolean).slice(0,7).map(y);if(x.length===0){m=null;break e}u="pointer-events-none h-full w-full overflow-hidden bg-background p-2 select-none",f="w-full border-collapse",d=x.map(ti)}e[7]=a,e[8]=c,e[9]=d,e[10]=f,e[11]=u,e[12]=m}else d=e[9],f=e[10],u=e[11],m=e[12];if(m!==Symbol.for("react.early_return_sentinel"))return m;let h;e[15]!==d?(h=s.jsx("tbody",{children:d}),e[15]=d,e[16]=h):h=e[16];let p;e[17]!==f||e[18]!==h?(p=s.jsx("table",{className:f,children:h}),e[17]=f,e[18]=h,e[19]=p):p=e[19];let g;return e[20]!==u||e[21]!==p?(g=s.jsx("div",{className:u,children:p}),e[20]=u,e[21]=p,e[22]=g):g=e[22],g}function ti(t,e){return s.jsx("tr",{className:ae(e===0&&"bg-muted/50 font-medium"),children:t.map(ni)},e)}function ni(t,e){return s.jsx("td",{className:"max-w-[56px] overflow-hidden border border-border/30 px-1 py-px text-[7px] leading-[1.4] text-muted-foreground",style:{maxWidth:56},children:s.jsx("span",{className:"block truncate",children:t})},e)}function si(t){return t.trim().replace(/^"|"$/g,"")}function li(t){const e=R.c(14),{filename:n,size:l,downloadUrl:r}=t;let i;if(e[0]!==r||e[1]!==n||e[2]!==l){const o=Fr(n);let a;if(Or.has(o)){let c;e[4]!==r?(c=s.jsx("img",{src:r,alt:"",loading:"lazy",className:"h-full w-full object-cover"}),e[4]=r,e[5]=c):c=e[5],a=c}else if(Rr.has(o)){const c=`${r}#t=0.1`;let d;e[6]!==c?(d=s.jsx(Ot,{children:s.jsx("video",{src:c,preload:"metadata",muted:!0,playsInline:!0,className:"pointer-events-none h-full w-full object-cover"})}),e[6]=c,e[7]=d):d=e[7],a=d}else if(o==="pdf"){let c;e[8]!==n?(c=s.jsx("div",{className:"flex h-full w-full items-center justify-center",children:s.jsx(we,{filename:n,className:"h-14 w-11 opacity-60"})}),e[8]=n,e[9]=c):c=e[9],a=c}else if(Ar.has(o))a=s.jsx(Ot,{children:s.jsx(ei,{url:r,ext:o})});else if(Ir.has(o)&&l<=Lr){let c;e[10]!==r?(c=s.jsx(Ot,{children:s.jsx(Jr,{url:r})}),e[10]=r,e[11]=c):c=e[11],a=c}else{let c;e[12]!==n?(c=s.jsx("div",{className:"flex h-full w-full items-center justify-center",children:s.jsx(we,{filename:n,className:"h-14 w-11 opacity-60"})}),e[12]=n,e[13]=c):c=e[13],a=c}i=s.jsx("div",{className:"aspect-[400/265] w-full overflow-hidden rounded-lg border border-border/60 bg-muted/30",children:a}),e[0]=r,e[1]=n,e[2]=l,e[3]=i}else i=e[3];return i}function ri(t){const e=R.c(27),n=t.onOpen;let l;e[0]!==t.filename?(l=s.jsx(we,{filename:t.filename,className:"h-8 w-6.5 shrink-0"}),e[0]=t.filename,e[1]=l):l=e[1];const r=t.filename;let i;e[2]!==t.updatedAt?(i=tt(t.updatedAt),e[2]=t.updatedAt,e[3]=i):i=e[3];let o;e[4]!==t.filename||e[5]!==t.subtitle?(o=t.subtitle??Pn(t.filename),e[4]=t.filename,e[5]=t.subtitle,e[6]=o):o=e[6];let a;e[7]!==t.downloadUrl||e[8]!==t.filename||e[9]!==t.onDelete||e[10]!==t.onShare?(a=s.jsx(ms,{downloadUrl:t.downloadUrl,filename:t.filename,onShare:t.onShare,onDelete:t.onDelete}),e[7]=t.downloadUrl,e[8]=t.filename,e[9]=t.onDelete,e[10]=t.onShare,e[11]=a):a=e[11];let c;e[12]!==t.filename||e[13]!==t.publicState||e[14]!==l||e[15]!==i||e[16]!==o||e[17]!==a?(c=s.jsx(st,{icon:l,name:r,meta:i,subtitle:o,publicState:t.publicState,actions:a}),e[12]=t.filename,e[13]=t.publicState,e[14]=l,e[15]=i,e[16]=o,e[17]=a,e[18]=c):c=e[18];let d;e[19]!==t.downloadUrl||e[20]!==t.filename||e[21]!==t.size?(d=s.jsx(li,{filename:t.filename,size:t.size,downloadUrl:t.downloadUrl}),e[19]=t.downloadUrl,e[20]=t.filename,e[21]=t.size,e[22]=d):d=e[22];let f;return e[23]!==t.onOpen||e[24]!==c||e[25]!==d?(f=s.jsxs(nt,{onOpen:n,children:[c,d]}),e[23]=t.onOpen,e[24]=c,e[25]=d,e[26]=f):f=e[26],f}async function ii(t){const e=await fetch(t,{credentials:"include"});if(!e.ok)throw new Error(`fetch failed: ${e.status}`);return e.text()}const oi=`
14
+ *{box-sizing:border-box}
15
+ body{margin:0;padding:24px;background:var(--brand-bg,#0b0f1a);color:var(--brand-fg,#f5f7ff);font-family:var(--brand-font-body,system-ui,sans-serif);font-size:14px;line-height:1.5}
16
+ .stack{display:flex;flex-direction:column;gap:18px;max-width:760px}
17
+ .row{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
18
+ h1{font-family:var(--brand-font-display,inherit);font-size:28px;font-weight:700;letter-spacing:-0.02em;margin:0}
19
+ .muted{color:var(--brand-fg-muted,#9fb0c9)}
20
+ .btn{border:0;border-radius:var(--brand-radius,12px);padding:10px 16px;font:inherit;font-weight:600;cursor:pointer}
21
+ .btn-primary{background:var(--brand-primary,#0a84ff);color:#fff}
22
+ .btn-secondary{background:transparent;color:var(--brand-fg,#f5f7ff);border:1.5px solid var(--brand-border-strong,rgba(255,255,255,.22))}
23
+ .btn-ghost{background:transparent;color:var(--brand-fg-muted,#9fb0c9)}
24
+ .card{background:var(--brand-bg-subtle,#121826);border:1px solid var(--brand-border,rgba(255,255,255,.1));border-radius:var(--brand-radius-lg,16px);padding:20px;box-shadow:var(--brand-shadow-md,0 6px 16px rgba(8,12,22,.45))}
25
+ .kpi{font-family:var(--brand-font-display,inherit);font-size:44px;font-weight:700;color:var(--brand-primary,#0a84ff);line-height:1;letter-spacing:-0.02em}
26
+ .input{width:100%;background:var(--brand-bg-elevated,#1a2233);border:1.5px solid var(--brand-border,rgba(255,255,255,.12));border-radius:var(--brand-radius,12px);padding:10px 12px;color:inherit;font:inherit}
27
+ .badge{display:inline-flex;align-items:center;border-radius:999px;padding:4px 10px;font-size:12px;font-weight:600}
28
+ .badge-success{background:var(--brand-success-bg,#e7f6ec);color:var(--brand-success-fg,#0f7a37)}
29
+ .badge-warning{background:var(--brand-warning-bg,#fdf3d6);color:var(--brand-warning-fg,#8a6500)}
30
+ .badge-error{background:var(--brand-error-bg,#fde7e8);color:var(--brand-error-fg,#b01319)}
31
+ .badge-info{background:var(--brand-info-bg,#e8f1ff);color:var(--brand-info-fg,#0b54a8)}
32
+ .chip{border:1.5px solid var(--brand-border-strong,rgba(255,255,255,.22));border-radius:999px;padding:6px 14px;font-size:13px}
33
+ .chip-active{background:var(--brand-primary,#0a84ff);border-color:transparent;color:#fff}
34
+ `,ai=`
35
+ <div class="stack">
36
+ <div>
37
+ <h1>Your brand, applied</h1>
38
+ <p class="muted" style="margin:6px 0 0">Buttons, cards, inputs and badges in your tokens.</p>
39
+ </div>
40
+ <div class="row">
41
+ <button class="btn btn-primary">Primary</button>
42
+ <button class="btn btn-secondary">Secondary</button>
43
+ <button class="btn btn-ghost">Ghost</button>
44
+ </div>
45
+ <div class="card">
46
+ <p class="muted" style="margin:0 0 6px">Monthly savings</p>
47
+ <div class="kpi">$240</div>
48
+ </div>
49
+ <input class="input" placeholder="you@example.com" />
50
+ <div class="row">
51
+ <span class="badge badge-success">Success</span>
52
+ <span class="badge badge-warning">Warning</span>
53
+ <span class="badge badge-error">Error</span>
54
+ <span class="badge badge-info">Info</span>
55
+ </div>
56
+ <div class="row">
57
+ <span class="chip chip-active">All</span>
58
+ <span class="chip">Income</span>
59
+ <span class="chip">Spending</span>
60
+ </div>
61
+ </div>
62
+ `;function ci(t){return`<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><style>${t??""}</style><style>${oi}</style></head><body>${ai}</body></html>`}function di(t){const e=R.c(13),{tokensUrl:n}=t;let l;e[0]!==n?(l=se.fileText(n??""),e[0]=n,e[1]=l):l=e[1];const r=!!n;let i;e[2]!==n?(i=()=>ii(n??""),e[2]=n,e[3]=i):i=e[3];let o;e[4]!==l||e[5]!==r||e[6]!==i?(o={queryKey:l,enabled:r,queryFn:i,staleTime:6e4,retry:!1},e[4]=l,e[5]=r,e[6]=i,e[7]=o):o=e[7];const a=me(o);if(n&&a.isPending){let u;return e[8]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("div",{className:"flex h-full w-full items-center justify-center p-6",children:s.jsx(oe,{className:"h-full w-full rounded-xl"})}),e[8]=u):u=e[8],u}const c=a.data??null;let d;e[9]!==c?(d=ci(c),e[9]=c,e[10]=d):d=e[10];let f;return e[11]!==d?(f=s.jsx("iframe",{title:"Brand components",srcDoc:d,sandbox:"",className:"block h-full w-full border-0 bg-white"}),e[11]=d,e[12]=f):f=e[12],f}const ui="Theme preview",fi=[`<section class="slide-center">
63
+ <p class="eyebrow">Brand deck</p>
64
+ <h1 class="deck-h1">Your brand, on every slide</h1>
65
+ <p class="deck-sub">A live preview of each slide layout in your brand style.</p>
66
+ <p class="deck-meta">Theme preview</p>
67
+ </section>`,`<section>
68
+ <p class="eyebrow">Agenda</p>
69
+ <h2 class="deck-h2">What's in this theme</h2>
70
+ <ol class="agenda">
71
+ <li>Title &amp; section dividers</li>
72
+ <li>Bulleted content</li>
73
+ <li>Side-by-side columns</li>
74
+ <li>Metrics &amp; timelines</li>
75
+ <li>Quotes &amp; closing</li>
76
+ </ol>
77
+ </section>`,`<section class="slide-center divider">
78
+ <p class="giant-number">01</p>
79
+ <h2 class="deck-h1">Content layouts</h2>
80
+ <p class="deck-sub">How text-heavy slides look.</p>
81
+ </section>`,`<section>
82
+ <p class="eyebrow">Bullets</p>
83
+ <h2 class="deck-h2">Key points land cleanly</h2>
84
+ <p class="deck-body intro">Short, scannable lines with the brand accent marker.</p>
85
+ <ul class="bullets">
86
+ <li>Each point is one idea</li>
87
+ <li>Accent color draws the eye</li>
88
+ <li>Plenty of breathing room</li>
89
+ </ul>
90
+ </section>`,`<section>
91
+ <p class="eyebrow">Two column</p>
92
+ <h2 class="deck-h2">Compare side by side</h2>
93
+ <div class="cols">
94
+ <div class="card grow">
95
+ <h3 class="col-title">Before</h3>
96
+ <div class="deck-body"><p>Generic slides that ignore your brand.</p></div>
97
+ </div>
98
+ <div class="card grow">
99
+ <h3 class="col-title">After</h3>
100
+ <div class="deck-body"><p>Every deck on-brand, automatically.</p></div>
101
+ </div>
102
+ </div>
103
+ </section>`,`<section>
104
+ <p class="eyebrow">Metrics</p>
105
+ <h2 class="deck-h2">Numbers that matter</h2>
106
+ <div class="cols kpis">
107
+ <div class="card kpi grow">
108
+ <p class="kpi-value">3&times;</p>
109
+ <p class="kpi-label">Faster deck creation</p>
110
+ <p class="kpi-delta">since adopting the theme</p>
111
+ </div>
112
+ <div class="card kpi grow">
113
+ <p class="kpi-value">100%</p>
114
+ <p class="kpi-label">On-brand slides</p>
115
+ <p class="kpi-delta">no manual restyling</p>
116
+ </div>
117
+ <div class="card kpi grow">
118
+ <p class="kpi-value">1</p>
119
+ <p class="kpi-label">Source of truth</p>
120
+ <p class="kpi-delta">tokens.css</p>
121
+ </div>
122
+ </div>
123
+ </section>`,`<section>
124
+ <p class="eyebrow">Timeline</p>
125
+ <h2 class="deck-h2">How it unfolds</h2>
126
+ <div class="cols timeline">
127
+ <div class="step grow">
128
+ <p class="step-label">Step 1</p>
129
+ <h3 class="col-title">Define</h3>
130
+ <p class="deck-body">Set brand tokens once.</p>
131
+ </div>
132
+ <div class="step grow">
133
+ <p class="step-label">Step 2</p>
134
+ <h3 class="col-title">Generate</h3>
135
+ <p class="deck-body">Create decks from data.</p>
136
+ </div>
137
+ <div class="step grow">
138
+ <p class="step-label">Step 3</p>
139
+ <h3 class="col-title">Present</h3>
140
+ <p class="deck-body">Ship, always on-brand.</p>
141
+ </div>
142
+ </div>
143
+ </section>`,`<section>
144
+ <p class="eyebrow">Comparison</p>
145
+ <h2 class="deck-h2">Plans at a glance</h2>
146
+ <div class="cols">
147
+ <div class="card grow">
148
+ <h3 class="col-title">Starter</h3>
149
+ <ul class="bullets compact">
150
+ <li>Core layouts</li>
151
+ <li>Brand colors</li>
152
+ <li>Logo</li>
153
+ </ul>
154
+ </div>
155
+ <div class="card grow">
156
+ <h3 class="col-title">Pro</h3>
157
+ <ul class="bullets compact">
158
+ <li>Everything in Starter</li>
159
+ <li>Custom fonts</li>
160
+ <li>Theme shell</li>
161
+ </ul>
162
+ </div>
163
+ </div>
164
+ </section>`,`<section class="slide-center">
165
+ <blockquote class="deck-quote">&ldquo;Design once, stay on-brand everywhere.&rdquo;</blockquote>
166
+ <p class="attribution">Brand system &middot; Studio</p>
167
+ </section>`,`<section class="slide-center">
168
+ <h2 class="deck-h1">Ready to present</h2>
169
+ <p class="deck-sub">Generate a deck with this theme via the slides skill.</p>
170
+ <p class="cta">slides-create --theme &hellip;</p>
171
+ </section>`].join(`
172
+
173
+ `);async function bn(t){const e=await fetch(t,{credentials:"include"});if(!e.ok)throw new Error(`fetch failed: ${e.status}`);return e.text()}function mi(t,e){const n=e?`<style>${e}</style>`:"";return t.replaceAll("{{{slides}}}",fi).replaceAll("{{title}}",ui).replace(/(src=")(\/deck-runtime\/)/g,`$1${window.location.origin}$2`).replace("</head>",`${n}</head>`)}function hi(t){const e=R.c(23),{readUrl:n,title:l,tokensUrl:r}=t;let i;e[0]!==n?(i=se.fileText(n),e[0]=n,e[1]=i):i=e[1];let o;e[2]!==n?(o=()=>bn(n),e[2]=n,e[3]=o):o=e[3];let a;e[4]!==i||e[5]!==o?(a={queryKey:i,queryFn:o,staleTime:6e4,retry:!1},e[4]=i,e[5]=o,e[6]=a):a=e[6];const c=me(a);let d;e[7]!==r?(d=se.fileText(r??""),e[7]=r,e[8]=d):d=e[8];const f=!!r;let u;e[9]!==r?(u=()=>bn(r??""),e[9]=r,e[10]=u):u=e[10];let m;e[11]!==d||e[12]!==f||e[13]!==u?(m={queryKey:d,enabled:f,queryFn:u,staleTime:6e4,retry:!1},e[11]=d,e[12]=f,e[13]=u,e[14]=m):m=e[14];const h=me(m);if(c.isPending||r&&h.isPending){let x;return e[15]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("div",{className:"flex h-full w-full items-center justify-center p-6",children:s.jsx(oe,{className:"aspect-[16/9] w-full max-w-3xl rounded-xl"})}),e[15]=x):x=e[15],x}if(c.isError||!c.data){let x;return e[16]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"This theme is no longer available."}),e[16]=x):x=e[16],x}const p=h.data??null;let g;e[17]!==p||e[18]!==c.data?(g=mi(c.data,p),e[17]=p,e[18]=c.data,e[19]=g):g=e[19];let y;return e[20]!==g||e[21]!==l?(y=s.jsx("iframe",{title:l,srcDoc:g,sandbox:"allow-scripts",className:"block h-full w-full border-0 bg-white"}),e[20]=g,e[21]=l,e[22]=y):y=e[22],y}async function vn(t){const e=await fetch(t,{credentials:"include"});if(!e.ok)throw new Error(`fetch failed: ${e.status}`);return e.text()}function Be(t){const e=R.c(2),{children:n}=t;let l;return e[0]!==n?(l=s.jsx("p",{className:"text-sm font-medium text-foreground",children:n}),e[0]=n,e[1]=l):l=e[1],l}function pi(t){const e=R.c(16),{family:n,tokens:l,editing:r,valueOf:i,onEdit:o}=t;let a;e[0]!==n?(a=s.jsx("span",{className:"text-xs text-muted-foreground",children:n}),e[0]=n,e[1]=a):a=e[1];let c;if(e[2]!==r||e[3]!==o||e[4]!==l||e[5]!==i){let u;e[7]!==r||e[8]!==o||e[9]!==i?(u=m=>{const h=i(m),p=`${m.name.replace(/^--brand-/,"")}: ${h}`;return r&&/^#/.test(h)?s.jsx("input",{type:"color","aria-label":m.name,title:p,value:$r(h),onChange:g=>o(m.name,g.target.value),className:"size-7 cursor-pointer rounded-md border border-border/60 bg-transparent p-0.5"},m.name):s.jsx("span",{title:p,className:"size-7 rounded-md border border-border/60",style:{backgroundColor:h}},m.name)},e[7]=r,e[8]=o,e[9]=i,e[10]=u):u=e[10],c=l.map(u),e[2]=r,e[3]=o,e[4]=l,e[5]=i,e[6]=c}else c=e[6];let d;e[11]!==c?(d=s.jsx("div",{className:"flex flex-wrap gap-1",children:c}),e[11]=c,e[12]=d):d=e[12];let f;return e[13]!==a||e[14]!==d?(f=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[a,d]}),e[13]=a,e[14]=d,e[15]=f):f=e[15],f}function xi(t){const e=R.c(9),{token:n,value:l}=t;if(n.kind==="space"){let i;return e[0]!==l?(i=s.jsx("span",{className:"flex h-7 w-16 shrink-0 items-center",children:s.jsx("span",{className:"h-1.5 rounded-full bg-primary",style:{width:l,maxWidth:"100%"}})}),e[0]=l,e[1]=i):i=e[1],i}if(n.kind==="radius"){let i;return e[2]!==l?(i=s.jsx("span",{className:"size-7 shrink-0 border border-border bg-muted/50",style:{borderRadius:l}}),e[2]=l,e[3]=i):i=e[3],i}if(n.kind==="shadow"){let i;return e[4]!==l?(i=s.jsx("span",{className:"size-7 shrink-0 rounded-md bg-background",style:{boxShadow:l}}),e[4]=l,e[5]=i):i=e[5],i}if(n.kind==="type"&&/^--brand-text-/.test(n.name)){const i=`min(${l}, 22px)`;let o;return e[6]!==i?(o=s.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center overflow-hidden leading-none text-foreground",style:{fontSize:i},children:"Ag"}),e[6]=i,e[7]=o):o=e[7],o}let r;return e[8]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("span",{className:"size-7 shrink-0"}),e[8]=r):r=e[8],r}function ps(t){const e=R.c(17),{token:n,value:l,editing:r,onEdit:i}=t;let o;e[0]!==n||e[1]!==l?(o=s.jsx(xi,{token:n,value:l}),e[0]=n,e[1]=l,e[2]=o):o=e[2];let a;if(e[3]!==n.name){let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=/^--brand-/,e[5]=u):u=e[5],a=n.name.replace(u,""),e[3]=n.name,e[4]=a}else a=e[4];let c;e[6]!==a?(c=s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:a}),e[6]=a,e[7]=c):c=e[7];let d;e[8]!==r||e[9]!==i||e[10]!==n.name||e[11]!==l?(d=r?s.jsx(We,{value:l,onChange:u=>i(n.name,u.target.value),className:"h-8 w-40 font-mono text-xs"}):s.jsx("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:l}),e[8]=r,e[9]=i,e[10]=n.name,e[11]=l,e[12]=d):d=e[12];let f;return e[13]!==o||e[14]!==c||e[15]!==d?(f=s.jsxs("div",{className:"flex items-center gap-3",children:[o,c,d]}),e[13]=o,e[14]=c,e[15]=d,e[16]=f):f=e[16],f}function Fe(t){const e=R.c(16),{label:n,tokens:l,editing:r,valueOf:i,onEdit:o}=t;if(l.length===0)return null;let a;e[0]!==n?(a=s.jsx(Be,{children:n}),e[0]=n,e[1]=a):a=e[1];let c;if(e[2]!==r||e[3]!==o||e[4]!==l||e[5]!==i){let u;e[7]!==r||e[8]!==o||e[9]!==i?(u=m=>s.jsx(ps,{token:m,value:i(m),editing:r,onEdit:o},m.name),e[7]=r,e[8]=o,e[9]=i,e[10]=u):u=e[10],c=l.map(u),e[2]=r,e[3]=o,e[4]=l,e[5]=i,e[6]=c}else c=e[6];let d;e[11]!==c?(d=s.jsx("div",{className:"flex flex-col gap-2.5",children:c}),e[11]=c,e[12]=d):d=e[12];let f;return e[13]!==a||e[14]!==d?(f=s.jsxs("div",{className:"flex flex-col gap-3",children:[a,d]}),e[13]=a,e[14]=d,e[15]=f):f=e[15],f}function xs({brandPath:t,onClose:e,variant:n}){const{org:l}=Ve(),r=jt(t),i=r.volume??"",o=r.dirPath,a=le(o),c=r.readOnly,d=Ft(),f=Ye(),u=En(i),{upload:m,remove:h}=At(i),p=k.useRef(null),g=Ht(i,o),y=g.data??[],x=E=>y.some(re=>re.kind==="file"&&le(re.path)===E),b=x("tokens.css"),j=x("brand.md"),z=x("slides-theme.html"),N=Tr(y),C=f(i,`${o}/tokens.css`),w=f(i,`${o}/brand.md`),M=f(i,`${o}/slides-theme.html`),O=me({queryKey:se.fileText(C),enabled:b,queryFn:()=>vn(C),staleTime:6e4,retry:!1}),T=me({queryKey:se.fileText(w),enabled:j,queryFn:()=>vn(w),staleTime:6e4,retry:!1}),[v,$]=k.useState(!1),[K,F]=k.useState({}),[_,B]=k.useState(null),[G,q]=k.useState(!1),[J,Z]=k.useState(!1),[A,W]=k.useState("deck"),S=O.data?us(O.data):[],I=E=>S.find(re=>re.name===E)?.value,L=E=>K[E.name]??E.value,U=Er(S),D=S.filter(E=>E.kind==="font"),H=S.filter(E=>E.kind==="type"),Q=S.filter(E=>E.kind==="space"),ee=S.filter(E=>E.kind==="radius"),de=S.filter(E=>E.kind==="shadow"),P=S.filter(E=>E.kind==="motion"),X=S.filter(E=>E.kind==="other"),te=(E,re)=>F(it=>({...it,[E]:re})),he=z&&A==="deck",je=_??T.data??"",Ne=Object.entries(K).filter(([E,re])=>I(E)!==re),ie=_!==null&&_!==(T.data??""),lt=Ne.length>0||ie;function Nt(){F({}),B(null),$(!1)}async function Ce(){q(!0);try{if(Ne.length>0){let E=O.data??"";for(const[re,it]of Ne)E=Dr(E,re,it);await u.mutateAsync({path:`${o}/tokens.css`,body:E,contentType:"text/css; charset=utf-8"}),d.invalidateQueries({queryKey:se.fileText(C)})}ie&&_!==null&&(await u.mutateAsync({path:`${o}/brand.md`,body:_,contentType:"text/markdown; charset=utf-8"}),d.invalidateQueries({queryKey:se.fileText(w)})),d.invalidateQueries({queryKey:se.orgFsVolume(l.id,i)}),d.invalidateQueries({queryKey:se.orgFsRecent(l.id)}),F({}),B(null),$(!1),ce.success("Brand saved")}catch(E){ce.error(E instanceof Error?E.message:"Failed to save brand")}finally{q(!1)}}async function rt(E){const re=E?.[0];if(!re)return;const Zt=`logo.${(re.name.split(".").pop()??"png").toLowerCase()}`;try{await m.mutateAsync({dir:o,files:[new File([re],Zt,{type:re.type})]}),N&&le(N)!==Zt&&await h.mutateAsync(N),ce.success("Logo updated")}catch(Jt){ce.error(Jt instanceof Error?Jt.message:"Logo upload failed")}finally{p.current&&(p.current.value="")}}const Ct=!g.isPending&&!b&&!j&&!N;return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-3",children:[s.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:s.jsx(ct,{size:18})}),n==="dialog"?s.jsx(Le,{className:"flex-1 truncate text-base font-medium text-foreground",children:a}):s.jsx("span",{className:"flex-1 truncate text-base font-medium text-foreground",children:a}),!c&&(v?s.jsxs(s.Fragment,{children:[s.jsx(Y,{variant:"ghost",size:"sm",onClick:Nt,disabled:G,children:"Cancel"}),s.jsx(Y,{size:"sm",disabled:!lt||G,onClick:()=>{Ce()},children:G?"Saving…":"Save"})]}):s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>$(!0),children:[s.jsx(Ms,{size:14}),"Edit"]})),n==="dialog"?s.jsx($n,{asChild:!0,children:s.jsx(Y,{variant:"ghost",size:"icon",className:"size-8 shrink-0",children:s.jsx(ut,{size:16})})}):s.jsx(Y,{variant:"ghost",size:"icon",className:"size-8 shrink-0",onClick:e,children:s.jsx(ut,{size:16})})]}),s.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:g.isPending?s.jsxs("div",{className:"flex flex-col gap-3 p-6",children:[s.jsx(oe,{className:"h-40 w-full rounded-xl"}),s.jsx(oe,{className:"h-4 w-1/3"}),s.jsx(oe,{className:"h-4 w-2/3"})]}):Ct?s.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"This brand is no longer available."}):s.jsxs(s.Fragment,{children:[(z||b)&&s.jsxs("div",{className:"shrink-0 border-b border-border",children:[s.jsxs("div",{role:"button",tabIndex:0,"aria-label":J?"Show preview":"Hide preview",onClick:()=>Z(E=>!E),onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),Z(re=>!re))},className:"flex cursor-pointer items-center justify-between gap-2 px-4 py-2.5 hover:bg-muted/40",children:[s.jsxs("div",{className:"flex gap-0.5 rounded-lg bg-muted p-0.5 text-xs font-medium",onClick:E=>E.stopPropagation(),children:[z&&s.jsx("button",{type:"button",onClick:()=>{W("deck"),Z(!1)},className:ae("rounded-md px-2.5 py-1",he?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Deck"}),s.jsx("button",{type:"button",onClick:()=>{W("components"),Z(!1)},className:ae("rounded-md px-2.5 py-1",he?"text-muted-foreground hover:text-foreground":"bg-background text-foreground shadow-sm"),children:"Components"})]}),J?s.jsx(nl,{size:16,className:"shrink-0 text-muted-foreground"}):s.jsx(ll,{size:16,className:"shrink-0 text-muted-foreground"})]}),!J&&s.jsx("div",{className:"px-4 pb-4",children:s.jsx("div",{className:ae("w-full overflow-hidden rounded-xl border border-border bg-muted/30",he?"aspect-[16/9]":"h-96"),children:he?s.jsx(hi,{readUrl:M,title:`${a} deck theme`,tokensUrl:C}):s.jsx(di,{tokensUrl:C})})})]}),s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-8 overflow-y-auto p-6",children:[s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx(Be,{children:"Logo"}),s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("div",{className:"flex size-24 items-center justify-center overflow-hidden rounded-xl border border-border bg-muted/30",children:N?s.jsx("img",{src:f(i,N),alt:`${a} logo`,className:"max-h-full max-w-full object-contain"}):s.jsx(ct,{size:28,className:"text-muted-foreground/50"})}),v&&s.jsxs("div",{children:[s.jsxs(Y,{variant:"outline",size:"sm",disabled:m.isPending,onClick:()=>p.current?.click(),children:[s.jsx(dt,{size:14}),N?"Replace logo":"Add logo"]}),s.jsx("input",{ref:p,type:"file",accept:"image/*",className:"hidden",onChange:E=>{rt(E.target.files)}})]})]})]}),U.length>0&&s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx(Be,{children:"Colors"}),U.map(E=>s.jsx(pi,{family:E.family,tokens:E.tokens,editing:v,valueOf:L,onEdit:te},E.family))]}),(D.length>0||H.length>0)&&s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx(Be,{children:"Typography"}),D.map(E=>s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:E.name.replace(/^--brand-font-?/,"")||"font"}),v?s.jsx(We,{value:L(E),onChange:re=>te(E.name,re.target.value),className:"h-9"}):s.jsx("span",{className:"truncate text-lg text-foreground",style:{fontFamily:L(E)},children:L(E)})]},E.name)),H.map(E=>s.jsx(ps,{token:E,value:L(E),editing:v,onEdit:te},E.name))]}),s.jsx(Fe,{label:"Spacing",tokens:Q,editing:v,valueOf:L,onEdit:te}),s.jsx(Fe,{label:"Radius",tokens:ee,editing:v,valueOf:L,onEdit:te}),s.jsx(Fe,{label:"Shadows",tokens:de,editing:v,valueOf:L,onEdit:te}),s.jsx(Fe,{label:"Motion",tokens:P,editing:v,valueOf:L,onEdit:te}),s.jsx(Fe,{label:"Tokens",tokens:X,editing:v,valueOf:L,onEdit:te}),s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx(Be,{children:"Voice & guidelines"}),v?s.jsx(tl,{value:je,onChange:E=>B(E.target.value),placeholder:"Describe the brand voice, tone, do's and don'ts…",className:"min-h-48 font-mono text-sm"}):T.isPending&&j?s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx(oe,{className:"h-3 w-full"}),s.jsx(oe,{className:"h-3 w-5/6"})]}):je.trim()?s.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:s.jsx(Bt,{id:`brand-preview-${t}`,text:je})}):s.jsx("p",{className:"text-sm text-muted-foreground",children:"No brand voice written yet."})]})]})]})})]})}function gi(t){const e=R.c(8),{brandPath:n,onClose:l}=t;let r;e[0]!==l?(r=a=>{a||l()},e[0]=l,e[1]=r):r=e[1];let i;e[2]!==n||e[3]!==l?(i=s.jsx(Xe,{className:"flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-2xl!",closeButtonClassName:"hidden",children:s.jsx(xs,{brandPath:n,onClose:l,variant:"dialog"})}),e[2]=n,e[3]=l,e[4]=i):i=e[4];let o;return e[5]!==r||e[6]!==i?(o=s.jsx(Qe,{open:!0,onOpenChange:r,children:i}),e[5]=r,e[6]=i,e[7]=o):o=e[7],o}function bi(t){const e=R.c(3),{brandPath:n,onClose:l}=t;let r;return e[0]!==n||e[1]!==l?(r=s.jsx("div",{className:"flex h-full w-full flex-col overflow-hidden bg-background",children:s.jsx(xs,{brandPath:n,onClose:l,variant:"panel"})}),e[0]=n,e[1]=l,e[2]=r):r=e[2],r}function vi(t){const e=R.c(9),{previewPath:n,onClose:l,showSeeInLibrary:r}=t,i=r===void 0?!1:r;let o;e[0]!==l?(o=d=>{d||l()},e[0]=l,e[1]=o):o=e[1];let a;e[2]!==l||e[3]!==n||e[4]!==i?(a=s.jsx(Xe,{className:"flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-5xl!",children:s.jsx(cs,{previewPath:n,onClose:l,showSeeInLibrary:i,variant:"dialog"})}),e[2]=l,e[3]=n,e[4]=i,e[5]=a):a=e[5];let c;return e[6]!==o||e[7]!==a?(c=s.jsx(Qe,{open:!0,onOpenChange:o,children:a}),e[6]=o,e[7]=a,e[8]=c):c=e[8],c}function gs(t){const e=R.c(23),{skillPath:n,onClose:l,variant:r}=t,i=jt(n),{volume:o,dirPath:a}=i,c=Ye(),d=c(o??"",`${a}/SKILL.md`),f=se.fileText(d);let u;e[0]!==d?(u=async()=>{const q=await fetch(d,{credentials:"include"});if(!q.ok)throw new Error(`fetch failed: ${q.status}`);return q.text()},e[0]=d,e[1]=u):u=e[1];let m;e[2]!==f||e[3]!==u?(m={queryKey:f,queryFn:u,staleTime:6e4,retry:!1},e[2]=f,e[3]=u,e[4]=m):m=e[4];const h=me(m),p=Ht(o??"",a);let g;e[5]!==a?(g=le(a),e[5]=a,e[6]=g):g=e[6];const y=g;let x;e[7]!==h.data?(x=h.data?fs(h.data):null,e[7]=h.data,e[8]=x):x=e[8];const b=x,j=wi;let z;e[9]===Symbol.for("react.memo_cache_sentinel")?(z=(q,J)=>j(q.path)?-1:j(J.path)?1:le(q.path).localeCompare(le(J.path)),e[9]=z):z=e[9];const N=(p.data??[]).filter(yi).sort(z),[C,w]=k.useState(null),M=C===null?null:N.find(q=>q.path===C)??null,O=b?.name??y;let T;e[10]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:s.jsx(Ut,{size:18})}),e[10]=T):T=e[10];let v;e[11]!==O||e[12]!==r?(v=r==="dialog"?s.jsx(Le,{className:"flex-1 truncate text-base font-medium text-foreground",children:O}):s.jsx("span",{className:"flex-1 truncate text-base font-medium text-foreground",children:O}),e[11]=O,e[12]=r,e[13]=v):v=e[13];let $;e[14]!==l||e[15]!==r?($=r==="dialog"?s.jsx($n,{asChild:!0,children:s.jsx(Y,{variant:"ghost",size:"icon",className:"size-8 shrink-0",children:s.jsx(ut,{size:16})})}):s.jsx(Y,{variant:"ghost",size:"icon",className:"size-8 shrink-0",onClick:l,children:s.jsx(ut,{size:16})}),e[14]=l,e[15]=r,e[16]=$):$=e[16];let K;e[17]!==v||e[18]!==$?(K=s.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-3",children:[T,v,$]}),e[17]=v,e[18]=$,e[19]=K):K=e[19];let F;e[20]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx("p",{className:"px-2 py-1.5 text-sm font-medium text-foreground",children:"Files"}),e[20]=F):F=e[20];const _="relative flex min-w-0 flex-1 flex-col overflow-y-auto",B=M?s.jsx(is,{file:{key:M.path,filename:le(M.path),size:M.size,downloadUrl:c(o??"",M.path)}}):h.isPending?s.jsxs("div",{className:"flex flex-col gap-2 p-6",children:[s.jsx(oe,{className:"h-4 w-1/3"}),s.jsx(oe,{className:"h-3 w-full"}),s.jsx(oe,{className:"h-3 w-5/6"}),s.jsx(oe,{className:"h-3 w-2/3"})]}):h.isError||!b?s.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"This skill is no longer available."}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex flex-col gap-4 border-b border-border p-6",children:[s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Description"}),s.jsx("p",{className:"text-base text-muted-foreground",children:b.description??"Claude Code skill"})]}),s.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none p-6",children:s.jsx(Bt,{id:`skill-preview-${n}`,text:b.body})})]});let G;return e[21]!==B?(G=s.jsx("div",{className:_,children:B}),e[21]=B,e[22]=G):G=e[22],s.jsxs(s.Fragment,{children:[K,s.jsxs("div",{className:"flex min-h-0 flex-1",children:[s.jsxs("div",{className:"flex w-[220px] shrink-0 flex-col gap-1 overflow-y-auto border-r border-border bg-muted p-3",children:[F,p.isPending?s.jsx(oe,{className:"mx-2 h-4 w-24"}):N.map(q=>{const J=j(q.path)?M===null:C===q.path;return s.jsxs("button",{type:"button",onClick:()=>w(j(q.path)?null:q.path),className:ae("flex items-center gap-2.5 rounded-lg px-2 py-1.5 text-left",J?"bg-background shadow-sm":"hover:bg-muted/60"),children:[s.jsx(we,{filename:le(q.path),className:"h-6 w-5 shrink-0"}),s.jsx("span",{className:ae("truncate text-sm",J?"text-foreground":"text-muted-foreground"),children:le(q.path)})]},q.path)})]}),G]})]})}function yi(t){return t.kind==="file"}function wi(t){return le(t)==="SKILL.md"}function ji(t){const e=R.c(8),{skillPath:n,onClose:l}=t;let r;e[0]!==l?(r=a=>{a||l()},e[0]=l,e[1]=r):r=e[1];let i;e[2]!==l||e[3]!==n?(i=s.jsx(Xe,{className:"flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-5xl!",closeButtonClassName:"hidden",children:s.jsx(gs,{skillPath:n,onClose:l,variant:"dialog"})}),e[2]=l,e[3]=n,e[4]=i):i=e[4];let o;return e[5]!==r||e[6]!==i?(o=s.jsx(Qe,{open:!0,onOpenChange:r,children:i}),e[5]=r,e[6]=i,e[7]=o):o=e[7],o}function ki(t){const e=R.c(3),{skillPath:n,onClose:l}=t;let r;return e[0]!==l||e[1]!==n?(r=s.jsx("div",{className:"flex h-full w-full flex-col overflow-hidden bg-background",children:s.jsx(gs,{skillPath:n,onClose:l,variant:"panel"})}),e[0]=l,e[1]=n,e[2]=r):r=e[2],r}function Yt(t){return`${window.location.origin}${t}`}function He(t){if(t.shareMode==="password")return"password";if(t.shareMode==="public"||t.readPublic)return"public";if(t.effectivePublic)return"inherited"}const bs=[{id:"home",description:"Your organization's home folder",glyph:Os},{id:"uploads",description:"Files your team uploads",glyph:dt},{id:"outputs",description:"Agent run outputs",glyph:Is}],Si=6;function vs(t,e,n){const l=e.includes("/")?e.slice(0,e.lastIndexOf("/")):"",r=Xt(t),i=r?`public/${r}`:t==="home"?ds(n):t;return l?`${i}/${l}`:i}function ze(t){const e=R.c(2),{children:n}=t;let l;return e[0]!==n?(l=s.jsx("p",{className:"text-[13px] text-foreground",children:n}),e[0]=n,e[1]=l):l=e[1],l}function ye(t){const e=R.c(2),{children:n}=t;let l;return e[0]!==n?(l=s.jsx("div",{className:"@container",children:s.jsx("div",{className:"grid grid-cols-1 gap-3 @[440px]:grid-cols-2 @[660px]:grid-cols-3",children:n})}),e[0]=n,e[1]=l):l=e[1],l}function St(t){const e=R.c(2),{rows:n}=t,l=n===void 0?1:n;let r;return e[0]!==l?(r=s.jsx(ye,{children:Array.from({length:l*3},zi)}),e[0]=l,e[1]=r):r=e[1],r}function zi(t,e){return s.jsx(oe,{className:"h-16 rounded-2xl"},e)}function zt(t){const e=R.c(2),{children:n}=t;let l;return e[0]!==n?(l=s.jsx("p",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=l):l=e[1],l}function Ni(t){const e=R.c(6),{volume:n,displayName:l,description:r,glyph:i,onOpen:o}=t,a=el(n),c=l??n,d=a.data?`${a.data.files} files`:void 0;let f;return e[0]!==r||e[1]!==i||e[2]!==o||e[3]!==c||e[4]!==d?(f=s.jsx(kt,{name:c,meta:d,subtitle:r,glyph:i,onOpen:o}),e[0]=r,e[1]=i,e[2]=o,e[3]=c,e[4]=d,e[5]=f):f=e[5],f}function Ci(t){const e=R.c(8),{segments:n,onNavigate:l}=t;let r;e[0]!==l?(r=s.jsx("button",{type:"button",className:"text-muted-foreground hover:text-foreground hover:underline",onClick:()=>l(""),children:"Library"}),e[0]=l,e[1]=r):r=e[1];let i;e[2]!==l||e[3]!==n?(i=n.map((a,c)=>{const d=n.slice(0,c+1).join("/"),f=c===n.length-1;return s.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[s.jsx(Ns,{size:12,className:"shrink-0 text-muted-foreground"}),f?s.jsx("span",{className:"truncate font-medium text-foreground",children:a}):s.jsx("button",{type:"button",className:"truncate text-muted-foreground hover:text-foreground hover:underline",onClick:()=>l(d),children:a})]},d)}),e[2]=l,e[3]=n,e[4]=i):i=e[4];let o;return e[5]!==r||e[6]!==i?(o=s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1 text-sm",children:[r,i]}),e[5]=r,e[6]=i,e[7]=o):o=e[7],o}function $i(t){const e=R.c(32),{query:n,stale:l,onOpenFile:r,onShare:i,onDelete:o}=t,{org:a}=Ve(),c=Ye(),d=Zs(n);let f;e[0]!==c||e[1]!==i?(f=N=>i({volume:N.volume,path:N.path,kind:"file",shareMode:N.shareMode??"private",effectivePublic:N.effectivePublic??!1,url:Yt(c(N.volume,N.path))}),e[0]=c,e[1]=i,e[2]=f):f=e[2];const u=f;if(d.isPending){let N;return e[3]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(St,{rows:2}),e[3]=N):N=e[3],N}let m;e[4]!==d.data?(m=d.data??[],e[4]=d.data,e[5]=m):m=e[5];const h=m;if(h.length===0){let N;return e[6]!==n?(N=s.jsxs(zt,{children:["No files match “",n,"”."]}),e[6]=n,e[7]=N):N=e[7],N}const p=(l||d.isPlaceholderData)&&"opacity-50";let g;e[8]!==p?(g=ae("flex flex-col gap-3",p),e[8]=p,e[9]=g):g=e[9];const y=h.length===1?"result":"results";let x;e[10]!==h.length||e[11]!==y?(x=s.jsxs(ze,{children:[h.length," ",y]}),e[10]=h.length,e[11]=y,e[12]=x):x=e[12];let b;if(e[13]!==c||e[14]!==o||e[15]!==r||e[16]!==a||e[17]!==h||e[18]!==u){let N;e[20]!==c||e[21]!==o||e[22]!==r||e[23]!==a||e[24]!==u?(N=C=>{const w=Xt(C.volume)!==null;return s.jsx(hs,{filename:le(C.path),updatedAt:C.updatedAt,downloadUrl:c(C.volume,C.path),subtitle:vs(C.volume,C.path,a.slug),publicState:He(C),onOpen:()=>r(fr(C.volume,C.path)),onShare:w?void 0:()=>u(C),onDelete:w?void 0:()=>o({volume:C.volume,path:C.path,kind:"file"})},`${C.volume}/${C.path}`)},e[20]=c,e[21]=o,e[22]=r,e[23]=a,e[24]=u,e[25]=N):N=e[25],b=h.map(N),e[13]=c,e[14]=o,e[15]=r,e[16]=a,e[17]=h,e[18]=u,e[19]=b}else b=e[19];let j;e[26]!==b?(j=s.jsx(ye,{children:b}),e[26]=b,e[27]=j):j=e[27];let z;return e[28]!==g||e[29]!==x||e[30]!==j?(z=s.jsxs("div",{className:g,children:[x,j]}),e[28]=g,e[29]=x,e[30]=j,e[31]=z):z=e[31],z}function Pi(t){const e=R.c(24),{onOpenDir:n,onOpenFile:l,onShare:r,onDelete:i}=t,{org:o}=Ve(),a=Js(),c=Mn(),d=Ye();let f;e[0]!==d||e[1]!==r?(f=b=>r({volume:b.volume,path:b.path,kind:"file",shareMode:b.shareMode??"private",effectivePublic:b.effectivePublic??!1,url:Yt(d(b.volume,b.path))}),e[0]=d,e[1]=r,e[2]=f):f=e[2];const u=f;let m;if(e[3]!==d||e[4]!==i||e[5]!==l||e[6]!==o||e[7]!==a.data||e[8]!==a.isPending||e[9]!==u){const b=(a.data??[]).slice(0,Si);m=a.isPending?s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx(ze,{children:"Recently added"}),s.jsx(St,{})]}):b.length>0?s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx(ze,{children:"Recently added"}),s.jsx(ye,{children:b.map(j=>s.jsx(ri,{filename:le(j.path),updatedAt:j.updatedAt,size:j.size,downloadUrl:d(j.volume,j.path),subtitle:vs(j.volume,j.path,o.slug),publicState:He(j),onOpen:()=>l(`${j.volume}/${j.path}`),onShare:()=>u(j),onDelete:()=>i({volume:j.volume,path:j.path,kind:"file"})},`${j.volume}/${j.path}`))})]}):s.jsx(zt,{children:"No files yet — upload one, or ask an agent to produce something."}),e[3]=d,e[4]=i,e[5]=l,e[6]=o,e[7]=a.data,e[8]=a.isPending,e[9]=u,e[10]=m}else m=e[10];let h;e[11]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(ze,{children:"Folders"}),e[11]=h):h=e[11];let p;e[12]!==n||e[13]!==o?(p=bs.map(b=>s.jsx(Ni,{volume:b.id,displayName:b.id==="home"?ds(o.slug):void 0,description:b.description,glyph:b.glyph,onOpen:()=>n(b.id)},b.id)),e[12]=n,e[13]=o,e[14]=p):p=e[14];let g;e[15]!==n||e[16]!==c.data?.length?(g=(c.data?.length??0)>0&&s.jsx(kt,{name:"public",meta:`${c.data?.length} sets`,subtitle:"Curated skill sets — read-only",glyph:pt,readOnly:!0,onOpen:()=>n("public")}),e[15]=n,e[16]=c.data?.length,e[17]=g):g=e[17];let y;e[18]!==p||e[19]!==g?(y=s.jsxs("div",{className:"flex flex-col gap-3",children:[h,s.jsxs(ye,{children:[p,g]})]}),e[18]=p,e[19]=g,e[20]=y):y=e[20];let x;return e[21]!==m||e[22]!==y?(x=s.jsxs(s.Fragment,{children:[m,y]}),e[21]=m,e[22]=y,e[23]=x):x=e[23],x}function Ei(t){const e=R.c(11),{onOpenDir:n}=t,l=Mn();if(l.isPending){let c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(St,{}),e[0]=c):c=e[0],c}let r;e[1]!==l.data?(r=l.data??[],e[1]=l.data,e[2]=r):r=e[2];const i=r;if(i.length===0){let c;return e[3]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(zt,{children:"No public skill sets are configured."}),e[3]=c):c=e[3],c}let o;if(e[4]!==n||e[5]!==i){let c;e[7]!==n?(c=d=>s.jsx(kt,{name:d,subtitle:"Read-only",readOnly:!0,onOpen:()=>n(`public/${d}`)},d),e[7]=n,e[8]=c):c=e[8],o=i.map(c),e[4]=n,e[5]=i,e[6]=o}else o=e[6];let a;return e[9]!==o?(a=s.jsx(ye,{children:o}),e[9]=o,e[10]=a):a=e[10],a}function Di(t){const e=R.c(34),{location:n,onOpenDir:l,onOpenFile:r,onOpenSkill:i,onOpenBrand:o,onShare:a,onDelete:c}=t,d=n.volume??"",f=Ht(d,n.dirPath),u=Ye();if(f.isPending){let b;return e[0]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(St,{rows:2}),e[0]=b):b=e[0],b}if(f.isError){const b=f.error instanceof Error?f.error.message:"Failed to load";let j;return e[1]!==b?(j=s.jsx("p",{className:"text-sm text-destructive",children:b}),e[1]=b,e[2]=j):j=e[2],j}let m,h,p,g,y;if(e[3]!==u||e[4]!==f.data||e[5]!==n||e[6]!==c||e[7]!==o||e[8]!==l||e[9]!==r||e[10]!==i||e[11]!==a||e[12]!==d){y=Symbol.for("react.early_return_sentinel");e:{const b=f.data??[],j=b.filter(Ai),z=b.filter(Oi),N=b.filter(Mi),C=b.filter(Ti);if(b.length===0){const v=n.readOnly?"Empty — this read-only set syncs from its GitHub source.":"Empty folder — upload a file or create a folder to get started.";let $;e[18]!==v?($=s.jsx(zt,{children:v}),e[18]=v,e[19]=$):$=e[19],y=$;break e}let w;e[20]!==n.readOnly||e[21]!==c||e[22]!==d?(w=v=>n.readOnly?void 0:()=>c({volume:d,path:v.path,kind:v.kind}),e[20]=n.readOnly,e[21]=c,e[22]=d,e[23]=w):w=e[23];const M=w;let O;e[24]!==u||e[25]!==n.readOnly||e[26]!==a||e[27]!==d?(O=v=>n.readOnly?void 0:()=>a({volume:d,path:v.path,kind:v.kind,shareMode:v.shareMode??"private",effectivePublic:v.effectivePublic??!1,url:v.kind==="file"?Yt(u(d,v.path)):void 0}),e[24]=u,e[25]=n.readOnly,e[26]=a,e[27]=d,e[28]=O):O=e[28];const T=O;m=j.length>0&&s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx(ze,{children:"Skills"}),s.jsx(ye,{children:j.map(v=>s.jsx(Wr,{dirName:le(v.path),updatedAt:v.updatedAt,skillMdUrl:u(d,`${v.path}/SKILL.md`),publicState:He(v),onOpen:()=>i(Me(n,v.path)),onBrowse:()=>l(Me(n,v.path)),onShare:T(v),onDelete:M(v)},v.path))})]}),h=z.length>0&&s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx(ze,{children:"Brands"}),s.jsx(ye,{children:z.map(v=>s.jsx(Vr,{dirName:le(v.path),updatedAt:v.updatedAt,tokensUrl:u(d,`${v.path}/tokens.css`),onOpen:()=>o(Me(n,v.path)),onBrowse:()=>l(Me(n,v.path)),onDelete:M(v)},v.path))})]}),p=N.length>0&&s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx(ze,{children:"Folders"}),s.jsx(ye,{children:N.map(v=>s.jsx(kt,{name:le(v.path),meta:tt(v.updatedAt),readOnly:n.readOnly,publicState:He(v),onOpen:()=>l(Me(n,v.path)),onShare:T(v),onDelete:M(v)},v.path))})]}),g=C.length>0&&s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx(ze,{children:"Files"}),s.jsx(ye,{children:C.map(v=>s.jsx(hs,{filename:le(v.path),updatedAt:v.updatedAt,downloadUrl:u(d,v.path),publicState:He(v),onOpen:()=>r(Me(n,v.path)),onShare:T(v),onDelete:M(v)},v.path))})]})}e[3]=u,e[4]=f.data,e[5]=n,e[6]=c,e[7]=o,e[8]=l,e[9]=r,e[10]=i,e[11]=a,e[12]=d,e[13]=m,e[14]=h,e[15]=p,e[16]=g,e[17]=y}else m=e[13],h=e[14],p=e[15],g=e[16],y=e[17];if(y!==Symbol.for("react.early_return_sentinel"))return y;let x;return e[29]!==m||e[30]!==h||e[31]!==p||e[32]!==g?(x=s.jsxs(s.Fragment,{children:[m,h,p,g]}),e[29]=m,e[30]=h,e[31]=p,e[32]=g,e[33]=x):x=e[33],x}function Ti(t){return t.kind==="file"}function Mi(t){return t.kind==="dir"&&!t.hasSkill&&!t.hasBrand}function Oi(t){return t.kind==="dir"&&t.hasBrand&&!t.hasSkill}function Ai(t){return t.kind==="dir"&&t.hasSkill}function Lt({onOpenFile:t,onOpenSkill:e,onOpenBrand:n}={}){const{org:l}=Ve(),r=Ft(),i=wn(),o=Nn(),a=jn({strict:!1}),c=a.path??"",d=jt(c),f=d.segments.length===0,u=(P,X)=>i({to:".",search:te=>({...te,[P]:X||void 0})}),m=P=>u("path",P),h=(P,X)=>i({to:".",search:te=>({...te,preview:void 0,skill:void 0,brand:void 0,[P]:X})}),p=t??(P=>h("preview",P)),g=e??(P=>h("skill",P)),y=n??(P=>h("brand",P)),[x,b]=k.useState(""),j=Xs(x.trim(),300),[z,N]=k.useState(null),[C,w]=k.useState(null),[M,O]=k.useState(!1),[T,v]=k.useState(""),$=k.useRef(null),[K,F]=k.useState(!1),_=k.useRef(0),B=d.readOnly?null:d.volume??"uploads",G=d.volume?d.dirPath:"",{upload:q,mkdir:J}=At(B??"uploads"),{remove:Z}=At(z?.volume??"uploads");async function A(P){if(!(!B||!P||P.length===0))try{await q.mutateAsync({dir:G,files:[...P]}),ce.success(P.length===1?`Uploaded ${P[0]?.name}`:`Uploaded ${P.length} files`)}catch(X){ce.error(X instanceof Error?X.message:"Upload failed")}finally{$.current&&($.current.value="")}}const W=B!==null,S=f?"uploads":d.segments.at(-1)??"this folder";function I(P){return P.dataTransfer.types.includes("Files")}function L(P){!W||!I(P)||(P.preventDefault(),_.current+=1,F(!0))}function U(P){!W||!I(P)||P.preventDefault()}function D(){W&&(_.current=Math.max(0,_.current-1),_.current===0&&F(!1))}function H(P){W&&(P.preventDefault(),_.current=0,F(!1),P.dataTransfer.files.length>0&&A(P.dataTransfer.files))}async function Q(){const P=T.trim();if(!(!B||!P))try{await J.mutateAsync(G?`${G}/${P}`:P),ce.success(`Folder "${P}" created`),O(!1),v("")}catch(X){ce.error(X instanceof Error?X.message:"Failed to create folder")}}async function ee(){if(!z)return;const P=z;try{await Z.mutateAsync(P.path),ce.success(`Deleted ${le(P.path)}`)}catch(X){ce.error(X instanceof Error?X.message:"Delete failed")}finally{N(null)}}function de(){for(const P of bs)r.invalidateQueries({queryKey:se.orgFsVolume(l.id,P.id)});d.volume&&r.invalidateQueries({queryKey:se.orgFsVolume(l.id,d.volume)}),r.invalidateQueries({queryKey:se.orgFsRecent(l.id)}),r.invalidateQueries({queryKey:se.orgFsSearchRoot(l.id)}),r.invalidateQueries({queryKey:se.orgFsPublicSets(l.id)})}return s.jsxs("div",{className:"relative h-full",onDragEnter:L,onDragOver:U,onDragLeave:D,onDrop:H,children:[K&&s.jsx("div",{className:"pointer-events-none absolute inset-0 z-20 flex items-center justify-center bg-background/80 p-6 backdrop-blur-sm",children:s.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-2xl border-2 border-dashed border-primary px-10 py-8 text-center",children:[s.jsx(dt,{size:28,className:"text-primary"}),s.jsxs("p",{className:"text-sm font-medium text-foreground",children:["Drop to upload to ",S]})]})}),s.jsx("div",{className:"h-full overflow-y-auto",children:s.jsxs("div",{className:"mx-auto flex w-full max-w-[900px] flex-col gap-10 px-6 py-10 lg:px-10",children:[s.jsxs("div",{className:"flex flex-col gap-2",children:[!f&&s.jsx(Ci,{segments:d.segments,onNavigate:m}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("h1",{className:"min-w-0 flex-1 truncate text-xl font-medium text-foreground",children:f?"Library":d.segments.at(-1)??"Library"}),s.jsx(Y,{variant:"ghost",size:"icon",onClick:de,"aria-label":"Refresh",children:s.jsx(yn,{size:14})}),!f&&B&&s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>O(!0),children:[s.jsx(As,{size:14}),"New folder"]}),d.readOnly?s.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[s.jsx(kn,{size:12}),"Read-only"]}):s.jsxs(Y,{size:"sm",disabled:q.isPending,onClick:()=>$.current?.click(),children:[s.jsx(dt,{size:14}),q.isPending?"Uploading…":"Upload file"]}),s.jsx("input",{ref:$,type:"file",multiple:!0,className:"hidden",onChange:P=>{A(P.target.files)}})]})]}),s.jsxs("div",{className:"relative",children:[s.jsx(Rs,{size:16,className:"pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 text-muted-foreground"}),s.jsx(We,{value:x,onChange:P=>b(P.target.value),onKeyDown:P=>{P.key==="Escape"&&b("")},placeholder:"Search all files…",className:"h-10 rounded-xl pr-9 pl-9"}),x&&s.jsx(Y,{variant:"ghost",size:"icon",className:"absolute top-1/2 right-1.5 size-7 -translate-y-1/2",onClick:()=>b(""),"aria-label":"Clear search",children:s.jsx(zn,{size:14})})]}),j?s.jsx($i,{query:j,stale:x.trim()!==j,onOpenFile:p,onShare:w,onDelete:N}):f?s.jsx(Pi,{onOpenDir:m,onOpenFile:p,onShare:w,onDelete:N}):d.volume===null?s.jsx(Ei,{onOpenDir:m}):s.jsx(Di,{location:d,onOpenDir:m,onOpenFile:p,onOpenSkill:g,onOpenBrand:y,onShare:w,onDelete:N},d.volume)]})}),o&&(a.preview?s.jsx(vi,{previewPath:a.preview,onClose:()=>u("preview",null)}):a.skill?s.jsx(ji,{skillPath:a.skill,onClose:()=>u("skill",null)},a.skill):a.brand?s.jsx(gi,{brandPath:a.brand,onClose:()=>u("brand",null)},a.brand):null),s.jsx(Qe,{open:M,onOpenChange:O,children:s.jsxs(Xe,{children:[s.jsxs(Cn,{children:[s.jsx(Le,{children:"New folder"}),s.jsxs(Ks,{children:["Create a folder in ",c||"the library","."]})]}),s.jsx(We,{autoFocus:!0,placeholder:"folder-name",value:T,onChange:P=>v(P.target.value),onKeyDown:P=>{P.key==="Enter"&&Q()}}),s.jsxs(Gs,{children:[s.jsx(Y,{variant:"outline",onClick:()=>O(!1),children:"Cancel"}),s.jsx(Y,{disabled:!T.trim()||J.isPending,onClick:()=>{Q()},children:"Create"})]})]})}),s.jsx(ur,{target:C,onOpenChange:P=>{P||w(null)}}),s.jsx(Ls,{open:z!==null,onOpenChange:P=>{P||N(null)},children:s.jsxs(Fs,{children:[s.jsxs(_s,{children:[s.jsxs(Us,{children:["Delete ",z?le(z.path):"","?"]}),s.jsx(Bs,{children:z?.kind==="dir"?"The folder and everything inside it will be deleted for the whole organization. Sandboxes see this change within seconds.":"The file will be deleted for the whole organization. Sandboxes see this change within seconds."})]}),s.jsxs(Hs,{children:[s.jsx(qs,{children:"Cancel"}),s.jsx(Ws,{onClick:()=>{ee()},children:"Delete"})]})]})})]})}function Ri(){const t=R.c(12),e=Nn(),n=wn();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},t[0]=l):l=t[0];const r=jn(l);let i;t[1]!==n?(i=d=>n({to:".",search:f=>({...f,[d]:void 0})}),t[1]=n,t[2]=i):i=t[2];const o=i;let a,c;if(t[3]!==o||t[4]!==e||t[5]!==r.brand||t[6]!==r.preview||t[7]!==r.skill){c=Symbol.for("react.early_return_sentinel");e:{const d=r.preview?{key:"preview",path:r.preview,panel:s.jsx(pr,{previewPath:r.preview,onClose:()=>o("preview")})}:r.skill?{key:"skill",path:r.skill,panel:s.jsx(ki,{skillPath:r.skill,onClose:()=>o("skill")},r.skill)}:r.brand?{key:"brand",path:r.brand,panel:s.jsx(bi,{brandPath:r.brand,onClose:()=>o("brand")},r.brand)}:null;if(e){let u;t[10]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden bg-background",children:s.jsx($t,{children:s.jsx(Lt,{})})}),t[10]=u):u=t[10],c=u;break e}let f;t[11]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(cn,{order:1,minSize:30,defaultSize:55,children:s.jsx("div",{className:"h-full p-0.5 pt-0.25",children:s.jsx("div",{className:"card-shadow flex h-full flex-col overflow-hidden rounded-[0.75rem] bg-background",children:s.jsx($t,{children:s.jsx(Lt,{})})})})}),t[11]=f):f=t[11],a=s.jsxs(Ll,{direction:"horizontal",className:"min-h-0 flex-1 pt-0 pr-1 pb-1 pl-0",children:[f,d&&s.jsxs(s.Fragment,{children:[s.jsx(Vs.Tabs,{children:s.jsx(vr,{title:le(d.path),icon:{kind:"component",Component:u=>d.key==="preview"?s.jsx(we,{filename:le(d.path),...u}):d.key==="skill"?s.jsx(Ut,{...u}):s.jsx(ct,{...u})},active:!0,onClick:()=>o(d.key)})}),s.jsx(Fl,{className:"bg-sidebar"}),s.jsx(cn,{order:2,minSize:25,defaultSize:45,children:s.jsx("div",{className:"h-full p-0.5 pt-0.25",children:s.jsx("div",{className:"card-shadow flex h-full flex-col overflow-hidden rounded-[0.75rem] bg-background",children:s.jsx($t,{children:d.panel})})})})]})]})}t[3]=o,t[4]=e,t[5]=r.brand,t[6]=r.preview,t[7]=r.skill,t[8]=a,t[9]=c}else a=t[8],c=t[9];return c!==Symbol.for("react.early_return_sentinel")?c:a}const Eo=Object.freeze(Object.defineProperty({__proto__:null,LibraryPage:Lt,default:Ri},Symbol.toStringTag,{value:"Module"}));export{ko as A,gi as B,Eo as C,Wl as E,ls as F,ar as H,pr as L,Ll as R,ji as S,br as T,bo as a,Ul as b,is as c,ql as d,mn as e,ss as f,Vl as g,Lt as h,Fl as i,cn as j,vr as k,vi as l,vo as m,Co as n,$o as o,Xl as p,wo as q,ht as r,So as s,Vt as t,Po as u,jo as v,Kl as w,yo as x,zo as y,No as z};