decocms 4.51.2 → 4.52.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 (233) hide show
  1. package/dist/client/assets/{AlertCircle-D3-xinjs.js → AlertCircle-sapu7kKO.js} +1 -1
  2. package/dist/client/assets/{ArrowUp-BDUzeu95.js → ArrowUp-DPPDVfHN.js} +1 -1
  3. package/dist/client/assets/{ArrowUpRight-C3_2cXeW.js → ArrowUpRight-CtAzQA2i.js} +1 -1
  4. package/dist/client/assets/{Check-ocZ9qfNA.js → Check-lZiXfst_.js} +1 -1
  5. package/dist/client/assets/{CheckCircle-C0j5UyGw.js → CheckCircle-BmDrauHy.js} +1 -1
  6. package/dist/client/assets/{ChevronDown-wJWuHepF.js → ChevronDown-UXwj6_DS.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-BjCnVhIo.js → ChevronRight-YNJrw7T7.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-CJAHlnYn.js → ChevronUp-CbEwrEJd.js} +1 -1
  9. package/dist/client/assets/{Circle-BTXhFI7S.js → Circle-Da0JHWxg.js} +1 -1
  10. package/dist/client/assets/{Copy01-jaaWVisn.js → Copy01-DusTW9YE.js} +1 -1
  11. package/dist/client/assets/{DotsVertical-DtV5Fnad.js → DotsVertical-DPI55j50.js} +1 -1
  12. package/dist/client/assets/{Eye-wkJjtmH2.js → Eye-CdLtH4sp.js} +1 -1
  13. package/dist/client/assets/{FilterLines-DlRQ5-i5.js → FilterLines-CfwehRe5.js} +1 -1
  14. package/dist/client/assets/{Globe01-BGRBT0T0.js → Globe01-ClkxCHYw.js} +1 -1
  15. package/dist/client/assets/{Globe04-DRckETTE.js → Globe04-DeSzqTzY.js} +1 -1
  16. package/dist/client/assets/{HardDrive-B5qdyv_Y.js → HardDrive-CxwveR2a.js} +1 -1
  17. package/dist/client/assets/{Key01-JqQROwH3.js → Key01-5zu6DjT3.js} +1 -1
  18. package/dist/client/assets/{LayoutLeft-j7RNB7Kr.js → LayoutLeft-BT4hpymA.js} +1 -1
  19. package/dist/client/assets/{LinkExternal01-BOVv-eRf.js → LinkExternal01-CE1gy0KD.js} +1 -1
  20. package/dist/client/assets/{List-B14rXxdk.js → List-Ckf20wTy.js} +1 -1
  21. package/dist/client/assets/{Loading02-pQoaBc8-.js → Loading02-BG6zHG-1.js} +1 -1
  22. package/dist/client/assets/{Monitor01-p4fXdA6F.js → Monitor01-DA6SNL7R.js} +1 -1
  23. package/dist/client/assets/{Palette-Ba4t1bDZ.js → Palette-CeXkOlbG.js} +1 -1
  24. package/dist/client/assets/{Play-BRUiwJ0P.js → Play-CbmTLrmo.js} +1 -1
  25. package/dist/client/assets/{Plus-CD0lb0Z8.js → Plus-BI6RJ5xd.js} +1 -1
  26. package/dist/client/assets/{SearchLg-DomSsZ58.js → SearchLg-Co2FsVdE.js} +1 -1
  27. package/dist/client/assets/{SearchMd-BcwHGb7L.js → SearchMd-Ba4WmyTy.js} +1 -1
  28. package/dist/client/assets/{Settings02-C124V1Xc.js → Settings02-CsczW6gZ.js} +1 -1
  29. package/dist/client/assets/{Shield01-xKRFJ51X.js → Shield01-Db-Bt9nk.js} +1 -1
  30. package/dist/client/assets/{Star01-8j7H5tvN.js → Star01-0ywvA3G7.js} +1 -1
  31. package/dist/client/assets/{Stars01-D-3hvZEh.js → Stars01-C1j06l6D.js} +1 -1
  32. package/dist/client/assets/{Stars02-Cb9neMzf.js → Stars02-rJTMnXZP.js} +1 -1
  33. package/dist/client/assets/{Sun-f1oBLB5X.js → Sun-8NTUD4se.js} +1 -1
  34. package/dist/client/assets/{SwitchHorizontal01-DENI6_WB.js → SwitchHorizontal01-BXu6sACY.js} +1 -1
  35. package/dist/client/assets/{Tool01-DWMuD8TU.js → Tool01-6s5VfVVP.js} +1 -1
  36. package/dist/client/assets/{Trash01-CWwPWzB6.js → Trash01-BVLzg5_A.js} +1 -1
  37. package/dist/client/assets/{Upload01-mS32ZgCv.js → Upload01-COBVtjLn.js} +1 -1
  38. package/dist/client/assets/{User01-ByTCset0.js → User01-DYLzgoln.js} +1 -1
  39. package/dist/client/assets/{Users01-C_ia9S0h.js → Users01-DuigWSec.js} +1 -1
  40. package/dist/client/assets/{Users03-DgaczNXO.js → Users03-CT9Jz-R8.js} +1 -1
  41. package/dist/client/assets/{X-Dntrg8W3.js → X-BNQfs1Pt.js} +1 -1
  42. package/dist/client/assets/{XCircle-Cc0xPE71.js → XCircle-DRzzrhlx.js} +1 -1
  43. package/dist/client/assets/{XClose-BKzJufOf.js → XClose-Q-X-b3kB.js} +1 -1
  44. package/dist/client/assets/{Zap-B8LjXKlt.js → Zap-DD3Nytx8.js} +1 -1
  45. package/dist/client/assets/{ZapSquare-BaPWVQ37.js → ZapSquare-BvPZm-4b.js} +1 -1
  46. package/dist/client/assets/{ZoomOut-0JxM3Azv.js → ZoomOut-BmrbNv1d.js} +1 -1
  47. package/dist/client/assets/{access-gate-CuWTKtSI.js → access-gate-DgVWwKEc.js} +1 -1
  48. package/dist/client/assets/add-section-modal-BOq8uYnL.js +1 -0
  49. package/dist/client/assets/{agent-capabilities-DSzooKp7.js → agent-capabilities-CR08IVyb.js} +1 -1
  50. package/dist/client/assets/{agent-icon-aq9fahDc.js → agent-icon-DrSlNYim.js} +1 -1
  51. package/dist/client/assets/{agents-list-CaUeXqG0.js → agents-list-BRNAakdT.js} +1 -1
  52. package/dist/client/assets/{ai-providers-CQLJ_8tO.js → ai-providers-DO1tu6iF.js} +1 -1
  53. package/dist/client/assets/{alert-fs5gPaUM.js → alert-B6LMjWUr.js} +1 -1
  54. package/dist/client/assets/{alert-dialog-Ctmy7BUh.js → alert-dialog-BxTpiDih.js} +1 -1
  55. package/dist/client/assets/app-editor-DQiXlPx8.js +1 -0
  56. package/dist/client/assets/{auth-Bj2JBDn0.js → auth-D2uUzB0u.js} +1 -1
  57. package/dist/client/assets/{auth-catchall-JbJLOIeZ.js → auth-catchall-ukwwnI9L.js} +1 -1
  58. package/dist/client/assets/{auth-entry-C1NUF8ZX.js → auth-entry-BdHfLckm.js} +1 -1
  59. package/dist/client/assets/{auth-split-layout-CfwFLRNN.js → auth-split-layout-BPhWsg7X.js} +1 -1
  60. package/dist/client/assets/{authenticate-and-persist-oauth-Dq14rQ5H.js → authenticate-and-persist-oauth-Bx3kTE1E.js} +1 -1
  61. package/dist/client/assets/{automation-list-row-B4UVZ48v.js → automation-list-row-Bo059cMj.js} +1 -1
  62. package/dist/client/assets/{automation-runs-COPPnkgJ.js → automation-runs-3ziteMmu.js} +1 -1
  63. package/dist/client/assets/{automations-k4gVYYGR.js → automations-Ddx_zBz9.js} +1 -1
  64. package/dist/client/assets/{autosend-DCYPaCYz.js → autosend-BP0AYXhQ.js} +1 -1
  65. package/dist/client/assets/{avatar-B58RA_6l.js → avatar-D35nv5Su.js} +1 -1
  66. package/dist/client/assets/{badge-OQCPYGcq.js → badge-_yz9J9BR.js} +1 -1
  67. package/dist/client/assets/{block-document-LDG191Ua.js → block-document-DO3RZdbu.js} +3 -3
  68. package/dist/client/assets/{brand-context-D_AxwSWO.js → brand-context-CMVpLFW9.js} +1 -1
  69. package/dist/client/assets/{breadcrumb-BgOeMiKF.js → breadcrumb-BAbS3DD8.js} +1 -1
  70. package/dist/client/assets/{buckets-DucCPVYS.js → buckets-DnzgWgLE.js} +1 -1
  71. package/dist/client/assets/{bulk-category-panel-oOfbKD4q.js → bulk-category-panel-BYrpSsWd.js} +1 -1
  72. package/dist/client/assets/{calendar-DWypRNoG.js → calendar-zeRepdK6.js} +1 -1
  73. package/dist/client/assets/{capability-load-error-C9fFHl6G.js → capability-load-error-DVbqY7-K.js} +1 -1
  74. package/dist/client/assets/{card-CFUuQQ1M.js → card-ChlCwcfh.js} +1 -1
  75. package/dist/client/assets/category-editor-BAcrlE5G.js +1 -0
  76. package/dist/client/assets/{chat-context-BDLg73HV.js → chat-context-V-_g4_mi.js} +5 -5
  77. package/dist/client/assets/{checkbox-BN0UcVyB.js → checkbox-CIV87iwv.js} +1 -1
  78. package/dist/client/assets/{cli-auth-success-0s8PkjYa.js → cli-auth-success-DRbbJ_3F.js} +1 -1
  79. package/dist/client/assets/collection-detail-BJMLAeSJ.js +1 -0
  80. package/dist/client/assets/{collection-display-button-BLiQdNGK.js → collection-display-button-CNuoRbdM.js} +1 -1
  81. package/dist/client/assets/{collection-search-IN2QsdDZ.js → collection-search-CJzUBS5K.js} +1 -1
  82. package/dist/client/assets/{collection-table-wrapper-DjickeiC.js → collection-table-wrapper-DzB8r7hm.js} +1 -1
  83. package/dist/client/assets/{collection-tabs-DEEctqY7.js → collection-tabs-C-fiJhM-.js} +1 -1
  84. package/dist/client/assets/{command-B-zA3-tK.js → command-C0OyFylL.js} +1 -1
  85. package/dist/client/assets/{commerce-onboarding-CSQzdWRv.js → commerce-onboarding-DfDRvrD8.js} +1 -1
  86. package/dist/client/assets/{connect-desktop-dialog-DZCJkLGC.js → connect-desktop-dialog-DNZXoNKY.js} +1 -1
  87. package/dist/client/assets/{connection-card-CLhBW468.js → connection-card-qpmDLTc9.js} +1 -1
  88. package/dist/client/assets/{connection-detail-DWSgMsK8.js → connection-detail-widnNgCu.js} +1 -1
  89. package/dist/client/assets/{connection-form-helpers-CYnQot14.js → connection-form-helpers-B4jacBLY.js} +1 -1
  90. package/dist/client/assets/{connections-BCohgvy9.js → connections-D4FqZR1G.js} +1 -1
  91. package/dist/client/assets/{decopilot-sse-pool-DSmv0lZi.js → decopilot-sse-pool-BYtWcKFG.js} +1 -1
  92. package/dist/client/assets/{dialog-CzN8avhL.js → dialog-DXBIUaRX.js} +1 -1
  93. package/dist/client/assets/{domain-settings-WMRLNbvN.js → domain-settings-GrnhSCSe.js} +1 -1
  94. package/dist/client/assets/{drawer-HThdP5uB.js → drawer-CzVSsYBP.js} +1 -1
  95. package/dist/client/assets/{dropdown-menu-BK5FaV5k.js → dropdown-menu-ByvoTU0t.js} +1 -1
  96. package/dist/client/assets/{empty-state-CcJIYptY.js → empty-state-CQMKxbAb.js} +1 -1
  97. package/dist/client/assets/{extract-connection-data-DSL7Y8A3.js → extract-connection-data-C6xhLpOX.js} +1 -1
  98. package/dist/client/assets/file-explorer-BIFtuXc1.js +2 -0
  99. package/dist/client/assets/{file-type-icon-GpEKUsdD.js → file-type-icon-x7TFcIF9.js} +1 -1
  100. package/dist/client/assets/{files-CcROi9t6.js → files-BL8Ilbtk.js} +1 -1
  101. package/dist/client/assets/{form-CGcaRTOA.js → form-DMGOTtEF.js} +1 -1
  102. package/dist/client/assets/{general-DF7PHO03.js → general-o17_4az2.js} +1 -1
  103. package/dist/client/assets/{github-repo-picker-KQYx5bF_.js → github-repo-picker-S0GU3ioE.js} +1 -1
  104. package/dist/client/assets/{hooks-BFJHOTt4.js → hooks-CeE2zVuW.js} +1 -1
  105. package/dist/client/assets/{index-DyKFz-Wv.js → index-3iGjYU8k.js} +1 -1
  106. package/dist/client/assets/{index-DRgsUNzQ.js → index-BIHQtLvv.js} +2 -2
  107. package/dist/client/assets/{index-CP4HAVaa.js → index-C1_KWbOK.js} +1 -1
  108. package/dist/client/assets/{index-DjoZL3mB.js → index-C2FYWxyZ.js} +1 -1
  109. package/dist/client/assets/{index-BcE0UPe9.js → index-CE1nmE6L.js} +1 -1
  110. package/dist/client/assets/{index-CylmZ2ca.js → index-CFR9fWrC.js} +1 -1
  111. package/dist/client/assets/{index-C_F4X9gQ.js → index-CQPqmzH5.js} +1 -1
  112. package/dist/client/assets/{index-CJs4YG_y.js → index-CmqY5ba2.js} +10 -10
  113. package/dist/client/assets/{index-C7hMTAFR.js → index-Cn-3DA8L.js} +1 -1
  114. package/dist/client/assets/{index-CZ4WVu9U.js → index-DgTySPwS.js} +27 -27
  115. package/dist/client/assets/{index-C2LXo0VC.js → index-Dt6O307X.js} +1 -1
  116. package/dist/client/assets/{index-Cu4sMkIs.js → index-KpRFJpee.js} +1 -1
  117. package/dist/client/assets/{index-C7WjeY76.js → index-NQ2L0YOZ.js} +1 -1
  118. package/dist/client/assets/{index-CPqDQfOw.js → index-mLNN8A3P.js} +1 -1
  119. package/dist/client/assets/{index-redirect-DOgz12Hs.js → index-redirect-BBWttsbc.js} +1 -1
  120. package/dist/client/assets/{input-B0aQnFKg.js → input-Bs55eT5u.js} +1 -1
  121. package/dist/client/assets/{integration-icon-BrvrOk5H.js → integration-icon-QuImefmy.js} +1 -1
  122. package/dist/client/assets/{invite-member-dialog-B0C0bNkM.js → invite-member-dialog-C9Ud-qxW.js} +1 -1
  123. package/dist/client/assets/{label-CAEQU6Kw.js → label-CpxouVYu.js} +1 -1
  124. package/dist/client/assets/{layout-CAQxuDfc.js → layout-Dj3pn7cL.js} +1 -1
  125. package/dist/client/assets/{login-BNl3DyrG.js → login-Dw3xrzI0.js} +1 -1
  126. package/dist/client/assets/{mcp-oauth-WkAErzUM.js → mcp-oauth-DyuoRGc8.js} +1 -1
  127. package/dist/client/assets/{members-CFAG47YG.js → members-BARE8mZx.js} +1 -1
  128. package/dist/client/assets/{monaco-editor-DTLtlpMl.js → monaco-editor-CtH5Wuhv.js} +1 -1
  129. package/dist/client/assets/{monitoring-stats-row-Byzwo_hq.js → monitoring-stats-row-DHONRI3T.js} +1 -1
  130. package/dist/client/assets/{oauth-callback-Dl7hbaaA.js → oauth-callback-D4FJxEbO.js} +1 -1
  131. package/dist/client/assets/{oauth-callback-ai-provider-DZWV38Z5.js → oauth-callback-ai-provider-Bt3M53T3.js} +1 -1
  132. package/dist/client/assets/{onboarding-BSMPev5P.js → onboarding-C98jXpo6.js} +1 -1
  133. package/dist/client/assets/{org-install-ByQXqxL7.js → org-install-BGLb95jQ.js} +1 -1
  134. package/dist/client/assets/{org-layout-CKgpdyFk.js → org-layout-BNvHqoTm.js} +1 -1
  135. package/dist/client/assets/{organization-choice-B79IthHJ.js → organization-choice-B2Swyvxj.js} +1 -1
  136. package/dist/client/assets/{orgs-BiSSAVq9.js → orgs-yACg37ZE.js} +1 -1
  137. package/dist/client/assets/page-seo-form-BGKUO1UE.js +1 -0
  138. package/dist/client/assets/page-seo-sheet-CYZVfoem.js +1 -0
  139. package/dist/client/assets/{popover-uE71epyh.js → popover-BRFVNGaf.js} +1 -1
  140. package/dist/client/assets/post-editor-Dj0ugfuP.js +1 -0
  141. package/dist/client/assets/{primitives-CFiyHFxY.js → primitives-DGNo0VQN.js} +1 -1
  142. package/dist/client/assets/{profile-BSZd_-p5.js → profile-Ds8vnne-.js} +1 -1
  143. package/dist/client/assets/project-app-view-C25IB-Gg.js +1 -0
  144. package/dist/client/assets/record-editor-C67X1amz.js +1 -0
  145. package/dist/client/assets/registry-Bfjf0VvK.js +2 -0
  146. package/dist/client/assets/{registry-layout-N861VHnw.js → registry-layout-BwebSrQs.js} +1 -1
  147. package/dist/client/assets/{require-capability-XY6ZhzOS.js → require-capability-72X6JmDO.js} +1 -1
  148. package/dist/client/assets/{required-auth-layout-Mghc_qb4.js → required-auth-layout-snI516kq.js} +1 -1
  149. package/dist/client/assets/{reset-password-Dsq-8-D_.js → reset-password-CRqFM5na.js} +1 -1
  150. package/dist/client/assets/{roles-Bh63EYOm.js → roles-BOHpNWyx.js} +1 -1
  151. package/dist/client/assets/{search-input-CfI7XQSB.js → search-input-DaluzwxN.js} +1 -1
  152. package/dist/client/assets/{secrets-Bqyd0QgI.js → secrets-CA9v4hBY.js} +1 -1
  153. package/dist/client/assets/sections-editor-wHV083T0.js +2 -0
  154. package/dist/client/assets/{select-IQqkuyke.js → select-BhYy0zt-.js} +1 -1
  155. package/dist/client/assets/{select-model-_ueK9IUW.js → select-model-ypzzL6P8.js} +1 -1
  156. package/dist/client/assets/seo-editor-Zv7i6c_T.js +1 -0
  157. package/dist/client/assets/{settings-layout-B_2KA4xq.js → settings-layout-CbJg4mcc.js} +1 -1
  158. package/dist/client/assets/{settings-section-B4wKOM9N.js → settings-section-BRoziUtC.js} +1 -1
  159. package/dist/client/assets/{shell-controls-CZKEytTQ.js → shell-controls-_gh60kxs.js} +1 -1
  160. package/dist/client/assets/{shell-layout--i4S_y1a.js → shell-layout-B1DRw4th.js} +1 -1
  161. package/dist/client/assets/{sidebar-ciphtA4J.js → sidebar-DEC76rj-.js} +1 -1
  162. package/dist/client/assets/{skeleton-CtTBfwRk.js → skeleton-Dq93TJh5.js} +1 -1
  163. package/dist/client/assets/{sso-CTXCmsBb.js → sso-Cspk1c6M.js} +1 -1
  164. package/dist/client/assets/{store-CdG0vY93.js → store-5CsiNs58.js} +1 -1
  165. package/dist/client/assets/store-registry-DeTH1zN1.js +2 -0
  166. package/dist/client/assets/{studio-tools-C8sSWr27.js → studio-tools-vwEq0QCf.js} +1 -1
  167. package/dist/client/assets/{switch-WmIvORwZ.js → switch-BSRVl-y3.js} +1 -1
  168. package/dist/client/assets/{table-BtAQhFli.js → table-BwA-0fe3.js} +1 -1
  169. package/dist/client/assets/{tabs-dnRCcMZW.js → tabs-CgyNQ-BD.js} +1 -1
  170. package/dist/client/assets/{textarea-BWkJXpt-.js → textarea-DmTl3XWA.js} +1 -1
  171. package/dist/client/assets/{toggle-group-BWqkPPRz.js → toggle-group-k42gsINm.js} +1 -1
  172. package/dist/client/assets/{toolbar-CJcI1ONf.js → toolbar-D-9bAdG-.js} +1 -1
  173. package/dist/client/assets/{toolbar-icon-button-cVkvjja9.js → toolbar-icon-button-BnnyITD-.js} +1 -1
  174. package/dist/client/assets/{tools-list-DEAw8kBy.js → tools-list-DlCAhjuV.js} +1 -1
  175. package/dist/client/assets/{tooltip-B3Xu0WsU.js → tooltip-DjgnnJdf.js} +1 -1
  176. package/dist/client/assets/{types-CDMEICfs.js → types-BJm0fK9H.js} +1 -1
  177. package/dist/client/assets/{use-ai-providers-Dy1XYekN.js → use-ai-providers-CEvyTr6l.js} +1 -1
  178. package/dist/client/assets/{use-automations-89YCo463.js → use-automations-CzH6-v68.js} +1 -1
  179. package/dist/client/assets/{use-capability-vmeCrW9g.js → use-capability-nwN-c3jd.js} +1 -1
  180. package/dist/client/assets/{use-clock-tick-Dums0r6j.js → use-clock-tick-BjIcqPGd.js} +1 -1
  181. package/dist/client/assets/{use-collections-Q9vyVcYX.js → use-collections-BlhcA5QS.js} +1 -1
  182. package/dist/client/assets/{use-connection-M87KpiDN.js → use-connection-BCDrc1oS.js} +1 -1
  183. package/dist/client/assets/{use-copy-D3B6kIY8.js → use-copy-BdYCY9P9.js} +1 -1
  184. package/dist/client/assets/{use-create-virtual-mcp-BqvwF4Bt.js → use-create-virtual-mcp-DNSbCgfE.js} +1 -1
  185. package/dist/client/assets/{use-debounced-autosave-Bt96Pub1.js → use-debounced-autosave-CXOXleDq.js} +1 -1
  186. package/dist/client/assets/{use-debounced-value-KutXID4s.js → use-debounced-value-CxSmoTdZ.js} +1 -1
  187. package/dist/client/assets/{use-decopilot-events-BCbLJTtF.js → use-decopilot-events-D9y5VqTB.js} +1 -1
  188. package/dist/client/assets/{use-delete-connection-DTuplEmy.js → use-delete-connection-QWUFDej8.js} +1 -1
  189. package/dist/client/assets/{use-deployment-admin-7ATx6QPd.js → use-deployment-admin-BdDZ796c.js} +1 -1
  190. package/dist/client/assets/{use-file-configs-BJxRx26Q.js → use-file-configs-COeolMpZ.js} +1 -1
  191. package/dist/client/assets/{use-infinite-scroll-DJF4Bq88.js → use-infinite-scroll-C6D_07Z_.js} +1 -1
  192. package/dist/client/assets/{use-join-requests-D-cXu4uc.js → use-join-requests-BYOfeNCV.js} +1 -1
  193. package/dist/client/assets/{use-mcp-client-BdcH2AAr.js → use-mcp-client-DZ6pOmBc.js} +1 -1
  194. package/dist/client/assets/{use-mcp-prompts-DUZPd05e.js → use-mcp-prompts-CZUzNxX-.js} +1 -1
  195. package/dist/client/assets/{use-mcp-tools-BhZCZNca.js → use-mcp-tools-CqUgoZJ7.js} +1 -1
  196. package/dist/client/assets/{use-members-D2ADy_SQ.js → use-members-Dw1Yfahx.js} +1 -1
  197. package/dist/client/assets/{use-mobile-CMaygZmb.js → use-mobile-BIz7TFn6.js} +1 -1
  198. package/dist/client/assets/{use-navigate-to-agent-BFFz8mSO.js → use-navigate-to-agent-DgySy46B.js} +1 -1
  199. package/dist/client/assets/{use-org-auth-client-Mq6_dHl5.js → use-org-auth-client-BONLCj1F.js} +1 -1
  200. package/dist/client/assets/{use-org-sso-Br7EvSJS.js → use-org-sso-CJa85qVO.js} +1 -1
  201. package/dist/client/assets/{use-organization-roles-vbXYDT1Q.js → use-organization-roles-DXMeTFvw.js} +1 -1
  202. package/dist/client/assets/{use-organization-settings-DqYIIvrP.js → use-organization-settings-CB_hb9xs.js} +1 -1
  203. package/dist/client/assets/{use-registry-connections-BcjXByDN.js → use-registry-connections-MbtQElFJ.js} +1 -1
  204. package/dist/client/assets/{use-secrets-Bf4bTSxf.js → use-secrets-PcgfLqpl.js} +1 -1
  205. package/dist/client/assets/{use-status-sounds-VC5seyB1.js → use-status-sounds-CCMOQ68t.js} +1 -1
  206. package/dist/client/assets/{use-view-mode-sA-TbW6V.js → use-view-mode-2XEGvfJJ.js} +1 -1
  207. package/dist/client/assets/{use-virtual-mcp-C8ctxJhX.js → use-virtual-mcp-DP8ZhIWW.js} +1 -1
  208. package/dist/client/assets/useInfiniteQuery-BtpKFyjR.js +1 -0
  209. package/dist/client/assets/{useRouterState-BmwO-4b6.js → useRouterState-DRH_Jef4.js} +1 -1
  210. package/dist/client/assets/useSuspenseInfiniteQuery-DwUXbCoT.js +1 -0
  211. package/dist/client/assets/{users-CBHdkzLg.js → users-CJFAOJlj.js} +1 -1
  212. package/dist/client/assets/{variant-calendar-8twey6VW.js → variant-calendar-BNHqbNJK.js} +1 -1
  213. package/dist/client/assets/{view-mode-toggle-1IeTPrvb.js → view-mode-toggle-CzdXCB47.js} +1 -1
  214. package/dist/client/index.html +1 -1
  215. package/dist/server/cli.js +1 -1
  216. package/dist/server/server.js +1 -1
  217. package/package.json +1 -1
  218. package/dist/client/assets/add-section-modal-NS1ZCez1.js +0 -1
  219. package/dist/client/assets/app-editor-9YM-GZC2.js +0 -1
  220. package/dist/client/assets/category-editor-ChglZmxt.js +0 -1
  221. package/dist/client/assets/collection-detail-UOi2wnnk.js +0 -1
  222. package/dist/client/assets/file-explorer-BvdpftwY.js +0 -2
  223. package/dist/client/assets/page-seo-sheet-CiZnYdHp.js +0 -1
  224. package/dist/client/assets/post-editor-BSDKdvDJ.js +0 -1
  225. package/dist/client/assets/project-app-view-DQB3cq3D.js +0 -1
  226. package/dist/client/assets/record-editor-D4XAQGuN.js +0 -1
  227. package/dist/client/assets/registry-OhtqP004.js +0 -2
  228. package/dist/client/assets/sections-editor-B8NpwMFb.js +0 -2
  229. package/dist/client/assets/seo-editor-DUryeA6Q.js +0 -1
  230. package/dist/client/assets/seo-save-FLLGxIUK.js +0 -1
  231. package/dist/client/assets/store-registry-DZliD663.js +0 -2
  232. package/dist/client/assets/useInfiniteQuery-GaTpQKsb.js +0 -1
  233. package/dist/client/assets/useSuspenseInfiniteQuery-BMdxCWpS.js +0 -1
@@ -1,4 +1,4 @@
1
- import{c as $,a1 as ce,n as Je,d as We,K as Q,m as ie,aW as kn,r as k,am as Ss,l as de,j as l,a3 as Ns,i as zs,B as J,aJ as Sn,t as ue,aD as Cs,L as $s,e as Ps,b as Nn,u as zn,U as Tt}from"./index-CJs4YG_y.js";import{i as Es}from"./ChevronRight-BjCnVhIo.js";import{s as Cn}from"./Eye-wkJjtmH2.js";import{n as Ve,i as yt}from"./Globe01-BGRBT0T0.js";import{b as Ds,c as Ts,e as Fs,i as Ms,f as $n,a as Ht,g as Is,h as Ls,d as Os}from"./ZoomOut-0JxM3Azv.js";import{a as ht}from"./Palette-Ba4t1bDZ.js";import{s as Rs}from"./Plus-CD0lb0Z8.js";import{i as As}from"./SearchLg-DomSsZ58.js";import{t as _s}from"./Stars01-D-3hvZEh.js";import{i as mt}from"./Upload01-mS32ZgCv.js";import{s as Pn}from"./XClose-BKzJufOf.js";import{i as qt}from"./Zap-B8LjXKlt.js";import{u as En}from"./use-mobile-CMaygZmb.js";import{f as Us,a as Bs,b as Hs,c as qs,d as Ks,e as Ws,A as Gs,g as Vs}from"./alert-dialog-Ctmy7BUh.js";import{D as Dn,a as Ue,d as Ze,e as et,g as Tn,f as Xs,c as Qs}from"./dialog-CzN8avhL.js";import{I as Xe}from"./input-B0aQnFKg.js";import{S as oe}from"./skeleton-CtTBfwRk.js";import{F as Se,M as Kt,d as Fn}from"./file-type-icon-GpEKUsdD.js";import{T as Ys}from"./toolbar-CJcI1ONf.js";import{u as Js}from"./use-debounced-value-KutXID4s.js";import{i as vt}from"./DotsVertical-DtV5Fnad.js";import{i as Mn}from"./Key01-JqQROwH3.js";import{s as wt}from"./Trash01-CWwPWzB6.js";import{D as tt,a as nt,c as st,d as be}from"./dropdown-menu-BK5FaV5k.js";import{T as Zs}from"./textarea-BWkJXpt-.js";import{t as el}from"./ChevronDown-wJWuHepF.js";import{n as tl}from"./ChevronUp-CJAHlnYn.js";import{i as pt}from"./X-Dntrg8W3.js";import{a as nl,P as sl,b as ll}from"./popover-uE71epyh.js";import{T as ye,a as ve,b as we}from"./tooltip-B3Xu0WsU.js";import{i as rl}from"./Check-ocZ9qfNA.js";import{a as il}from"./Copy01-jaaWVisn.js";import{n as In}from"./LinkExternal01-BOVv-eRf.js";import{l as al,F as ol}from"./index-C7hMTAFR.js";import{i as cl}from"./LayoutLeft-j7RNB7Kr.js";function Ln(n){return n.contentHash??`${n.size}-${n.updatedAt}`}function pe(n,e,t,s){const r=new URLSearchParams(s).toString();return`/api/${encodeURIComponent(n)}/fs/${encodeURIComponent(e)}/${t}${r?`?${r}`:""}`}async function he(n,e){const t=await fetch(n,e);if(!t.ok){let s="";try{s=(await t.json()).error??""}catch{}throw new Error(s||`HTTP ${t.status}`)}return t}function Wt(n,e){const t=$.c(11),{org:s}=ce();let r;t[0]!==s.id||t[1]!==e||t[2]!==n?(r=Q.orgFsList(s.id,n,e),t[0]=s.id,t[1]=e,t[2]=n,t[3]=r):r=t[3];let i;t[4]!==s.slug||t[5]!==e||t[6]!==n?(i=async()=>(await(await he(pe(s.slug,n,"list",{path:e}))).json()).entries.toSorted(dl),t[4]=s.slug,t[5]=e,t[6]=n,t[7]=i):i=t[7];let a;return t[8]!==r||t[9]!==i?(a={queryKey:r,placeholderData:kn,queryFn:i},t[8]=r,t[9]=i,t[10]=a):a=t[10],ie(a)}function dl(n,e){return n.kind!==e.kind?n.kind==="dir"?-1:1:n.path.localeCompare(e.path)}function On(n,e,t){const s=$.c(15),{org:r}=ce();let i;s[0]!==r.id||s[1]!==e||s[2]!==n?(i=Q.orgFsStat(r.id,n??"",e),s[0]=r.id,s[1]=e,s[2]=n,s[3]=i):i=s[3];const a=n!==null;let o;s[4]!==t?(o=t?.refetchIntervalWhenAbsent?f=>f.state.data?!1:t.refetchIntervalWhenAbsent??!1:void 0,s[4]=t,s[5]=o):o=s[5];let c;s[6]!==r.slug||s[7]!==e||s[8]!==n?(c=async()=>{const f=await fetch(pe(r.slug,n??"","stat",{path:e}));if(f.status===404)return null;if(!f.ok)throw new Error(`HTTP ${f.status}`);return(await f.json()).entry},s[6]=r.slug,s[7]=e,s[8]=n,s[9]=c):c=s[9];let d;return s[10]!==i||s[11]!==a||s[12]!==o||s[13]!==c?(d={queryKey:i,enabled:a,refetchInterval:o,queryFn:c},s[10]=i,s[11]=a,s[12]=o,s[13]=c,s[14]=d):d=s[14],ie(d)}function ul(n){const e=$.c(9),{org:t}=ce();let s;e[0]!==t.id||e[1]!==n?(s=Q.orgFsUsage(t.id,n),e[0]=t.id,e[1]=n,e[2]=s):s=e[2];let r;e[3]!==t.slug||e[4]!==n?(r=async()=>await(await he(pe(t.slug,n,"usage"))).json(),e[3]=t.slug,e[4]=n,e[5]=r):r=e[5];let i;return e[6]!==s||e[7]!==r?(i={queryKey:s,queryFn:r},e[6]=s,e[7]=r,e[8]=i):i=e[8],ie(i)}function fl(n,e){const t=$.c(9),s=n===void 0?60:n,{org:r}=ce();let i;t[0]!==r.id?(i=Q.orgFsRecent(r.id),t[0]=r.id,t[1]=i):i=t[1];const a=e?.enabled;let o;t[2]!==s||t[3]!==r.slug?(o=async()=>(await(await he(`/api/${encodeURIComponent(r.slug)}/fs/recent?limit=${s}`)).json()).entries,t[2]=s,t[3]=r.slug,t[4]=o):o=t[4];let c;return t[5]!==i||t[6]!==a||t[7]!==o?(c={queryKey:i,enabled:a,queryFn:o},t[5]=i,t[6]=a,t[7]=o,t[8]=c):c=t[8],ie(c)}function hl(n,e){const t=$.c(11),s=50,{org:r}=ce();let i;t[0]!==r.id||t[1]!==n?(i=Q.orgFsSearch(r.id,n),t[0]=r.id,t[1]=n,t[2]=i):i=t[2];const a=n.length>0;let o;t[3]!==s||t[4]!==r.slug||t[5]!==n?(o=async()=>(await(await he(`/api/${encodeURIComponent(r.slug)}/fs/search?q=${encodeURIComponent(n)}&limit=${s}`)).json()).entries,t[3]=s,t[4]=r.slug,t[5]=n,t[6]=o):o=t[6];let c;return t[7]!==i||t[8]!==a||t[9]!==o?(c={queryKey:i,enabled:a,placeholderData:kn,queryFn:o},t[7]=i,t[8]=a,t[9]=o,t[10]=c):c=t[10],ie(c)}function Da(n){const e=$.c(8),{org:t}=ce();let s;e[0]!==t.id?(s=Q.orgFsSkills(t.id),e[0]=t.id,e[1]=s):s=e[1];const r=n?.enabled;let i;e[2]!==t.slug?(i=async()=>{const o=await he(`/api/${encodeURIComponent(t.slug)}/fs/skills`),{skills:c}=await o.json();return c.map(ml)},e[2]=t.slug,e[3]=i):i=e[3];let a;return e[4]!==s||e[5]!==r||e[6]!==i?(a={queryKey:s,enabled:r,queryFn:i},e[4]=s,e[5]=r,e[6]=i,e[7]=a):a=e[7],ie(a)}function ml(n){return{volume:n.volume,path:n.path}}async function Ta(n){const e=await he(`/api/${encodeURIComponent(n)}/fs/skills`),{skills:t}=await e.json();return t}async function pl(n,e,t){return(await he(pe(n,e,"read",{path:t}))).text()}const xl=new Set(["md","mdx","markdown","txt","text"]),gl=25,bl=64*1024,yl=256*1024,vl=4;function wl(n){const e=n.lastIndexOf(".");return e===-1?!1:xl.has(n.slice(e+1).toLowerCase())}async function Fa(n,e,t){const s=t?`${t}/`:"",r=u=>u.startsWith(s)?u.slice(s.length):u,i=[],a=[],o=[{path:t,depth:0}];for(;o.length>0;){const u=o.shift();if(!u)break;let h;try{h=(await(await he(pe(n,e,"list",{path:u.path}))).json()).entries}catch{continue}for(const m of[...h].sort((p,g)=>p.path.localeCompare(g.path))){if(m.kind==="dir"){u.depth<vl&&o.push({path:m.path,depth:u.depth+1});continue}wl(m.path)&&m.size<=bl&&i.length<gl?i.push(m.path):a.push(r(m.path))}}const c=await Promise.all(i.map(u=>pl(n,e,u).catch(()=>null))),d=[];let f=0;return i.forEach((u,h)=>{const m=c[h];if(m==null||f+m.length>yl){a.push(r(u));return}f+=m.length,d.push({relPath:r(u),content:m})}),d.sort((u,h)=>u.relPath==="SKILL.md"?-1:h.relPath==="SKILL.md"?1:u.relPath.localeCompare(h.relPath)),a.sort(),{files:d,omittedPaths:a}}function Rn(){const n=$.c(7),{org:e}=ce();let t;n[0]!==e.id?(t=Q.orgFsPublicSets(e.id),n[0]=e.id,n[1]=t):t=n[1];let s;n[2]!==e.slug?(s=async()=>(await(await he(`/api/${encodeURIComponent(e.slug)}/fs/public-sets`)).json()).sets,n[2]=e.slug,n[3]=s):s=n[3];let r;return n[4]!==t||n[5]!==s?(r={queryKey:t,staleTime:3e5,queryFn:s},n[4]=t,n[5]=s,n[6]=r):r=n[6],ie(r)}function jl(n){const e=$.c(3),{org:t}=ce();let s;return e[0]!==t.slug||e[1]!==n?(s=r=>pe(t.slug,n,"read",{path:r}),e[0]=t.slug,e[1]=n,e[2]=s):s=e[2],s}function lt(){const n=$.c(2),{org:e}=ce();let t;return n[0]!==e.slug?(t=(s,r)=>pe(e.slug,s,"read",{path:r}),n[0]=e.slug,n[1]=t):t=n[1],t}function An(n){const e=$.c(3),{org:t}=ce();let s;return e[0]!==t||e[1]!==n?(s={mutationFn:async r=>(await(await he(pe(t.slug,n,"file",{path:r.path}),{method:"PUT",headers:{"content-type":r.contentType??"text/html; charset=utf-8"},body:r.body})).json()).entry},e[0]=t,e[1]=n,e[2]=s):s=e[2],We(s)}function kl(n){const e=$.c(18),{org:t}=ce(),s=Je();let r;e[0]!==t||e[1]!==n?(r=async d=>(await(await he(pe(t.slug,n,"public",{path:d.path}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:d.mode,password:d.password})})).json()).entry,e[0]=t,e[1]=n,e[2]=r):r=e[2];let i;e[3]!==t||e[4]!==s||e[5]!==n?(i=async d=>{const f=Q.orgFsStat(t.id,n,d.path);await s.cancelQueries({queryKey:f});const u=s.getQueryData(f),h=d.mode!=="private";return s.setQueryData(f,m=>m&&{...m,readPublic:h,effectivePublic:h,shareMode:d.mode}),{key:f,previous:u}},e[3]=t,e[4]=s,e[5]=n,e[6]=i):i=e[6];let a;e[7]!==s?(a=(d,f,u)=>{u&&s.setQueryData(u.key,u.previous)},e[7]=s,e[8]=a):a=e[8];let o;e[9]!==t||e[10]!==s||e[11]!==n?(o=(d,f,u)=>{s.invalidateQueries({queryKey:Q.orgFsStat(t.id,n,u.path)}),s.invalidateQueries({queryKey:Q.orgFsVolume(t.id,n)}),s.invalidateQueries({queryKey:Q.orgFsRecent(t.id)}),s.invalidateQueries({queryKey:Q.orgFsSearchRoot(t.id)})},e[9]=t,e[10]=s,e[11]=n,e[12]=o):o=e[12];let c;return e[13]!==r||e[14]!==i||e[15]!==a||e[16]!==o?(c={mutationFn:r,onMutate:i,onError:a,onSettled:o},e[13]=r,e[14]=i,e[15]=a,e[16]=o,e[17]=c):c=e[17],We(c)}function At(n){const e=$.c(26),{org:t}=ce(),s=Je();let r;e[0]!==t||e[1]!==s||e[2]!==n?(r=()=>{s.invalidateQueries({queryKey:Q.orgFsVolume(t.id,n)}),s.invalidateQueries({queryKey:Q.orgFsRecent(t.id)}),s.invalidateQueries({queryKey:Q.orgFsSearchRoot(t.id)})},e[0]=t,e[1]=s,e[2]=n,e[3]=r):r=e[3];const i=r;let a;e[4]!==t||e[5]!==n?(a=async b=>{for(const x of b.files){const y=b.dir?`${b.dir}/${x.name}`:x.name;await he(pe(t.slug,n,"file",{path:y}),{method:"PUT",headers:{"content-type":x.type||"application/octet-stream"},body:x})}},e[4]=t,e[5]=n,e[6]=a):a=e[6];let o;e[7]!==i||e[8]!==a?(o={mutationFn:a,onSettled:i},e[7]=i,e[8]=a,e[9]=o):o=e[9];const c=We(o);let d;e[10]!==t||e[11]!==n?(d=async b=>{await he(pe(t.slug,n,"dir",{path:b}),{method:"POST"})},e[10]=t,e[11]=n,e[12]=d):d=e[12];let f;e[13]!==i||e[14]!==d?(f={mutationFn:d,onSuccess:i},e[13]=i,e[14]=d,e[15]=f):f=e[15];const u=We(f);let h;e[16]!==t||e[17]!==n?(h=async b=>{await he(pe(t.slug,n,"file",{path:b}),{method:"DELETE"})},e[16]=t,e[17]=n,e[18]=h):h=e[18];let m;e[19]!==i||e[20]!==h?(m={mutationFn:h,onSuccess:i},e[19]=i,e[20]=h,e[21]=m):m=e[21];const p=We(m);let g;return e[22]!==u||e[23]!==p||e[24]!==c?(g={upload:c,mkdir:u,remove:p},e[22]=u,e[23]=p,e[24]=c,e[25]=g):g=e[25],g}const jt=k.createContext(null);jt.displayName="PanelGroupContext";const se={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"},Gt=10,Fe=k.useLayoutEffect,sn=Ss.useId,Sl=typeof sn=="function"?sn:()=>null;let Nl=0;function Vt(n=null){const e=Sl(),t=k.useRef(n||e||null);return t.current===null&&(t.current=""+Nl++),n??t.current}function _n({children:n,className:e="",collapsedSize:t,collapsible:s,defaultSize:r,forwardedRef:i,id:a,maxSize:o,minSize:c,onCollapse:d,onExpand:f,onResize:u,order:h,style:m,tagName:p="div",...g}){const b=k.useContext(jt);if(b===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:x,expandPanel:y,getPanelSize:j,getPanelStyle:N,groupId:z,isPanelCollapsed:C,reevaluatePanelConstraints:w,registerPanel:M,resizePanel:I,unregisterPanel:F}=b,v=Vt(a),P=k.useRef({callbacks:{onCollapse:d,onExpand:f,onResize:u},constraints:{collapsedSize:t,collapsible:s,defaultSize:r,maxSize:o,minSize:c},id:v,idIsFromProps:a!==void 0,order:h});k.useRef({didLogMissingDefaultSizeWarning:!1}),Fe(()=>{const{callbacks:A,constraints:_}=P.current,B={..._};P.current.id=v,P.current.idIsFromProps=a!==void 0,P.current.order=h,A.onCollapse=d,A.onExpand=f,A.onResize=u,_.collapsedSize=t,_.collapsible=s,_.defaultSize=r,_.maxSize=o,_.minSize=c,(B.collapsedSize!==_.collapsedSize||B.collapsible!==_.collapsible||B.maxSize!==_.maxSize||B.minSize!==_.minSize)&&w(P.current,B)}),Fe(()=>{const A=P.current;return M(A),()=>{F(A)}},[h,v,M,F]),k.useImperativeHandle(i,()=>({collapse:()=>{x(P.current)},expand:A=>{y(P.current,A)},getId(){return v},getSize(){return j(P.current)},isCollapsed(){return C(P.current)},isExpanded(){return!C(P.current)},resize:A=>{I(P.current,A)}}),[x,y,j,C,v,I]);const W=N(P.current,r);return k.createElement(p,{...g,children:n,className:e,id:v,style:{...W,...m},[se.groupId]:z,[se.panel]:"",[se.panelCollapsible]:s||void 0,[se.panelId]:v,[se.panelSize]:parseFloat(""+W.flexGrow).toFixed(1)})}const Un=k.forwardRef((n,e)=>k.createElement(_n,{...n,forwardedRef:e}));_n.displayName="Panel";Un.displayName="forwardRef(Panel)";let _t=null,ft=-1,Ce=null;function zl(n,e){if(e){const t=(e&Wn)!==0,s=(e&Gn)!==0,r=(e&Vn)!==0,i=(e&Xn)!==0;if(t)return r?"se-resize":i?"ne-resize":"e-resize";if(s)return r?"sw-resize":i?"nw-resize":"w-resize";if(r)return"s-resize";if(i)return"n-resize"}switch(n){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function Cl(){Ce!==null&&(document.head.removeChild(Ce),_t=null,Ce=null,ft=-1)}function Ft(n,e){var t,s;const r=zl(n,e);if(_t!==r){if(_t=r,Ce===null&&(Ce=document.createElement("style"),document.head.appendChild(Ce)),ft>=0){var i;(i=Ce.sheet)===null||i===void 0||i.removeRule(ft)}ft=(t=(s=Ce.sheet)===null||s===void 0?void 0:s.insertRule(`*{cursor: ${r} !important;}`))!==null&&t!==void 0?t:-1}}function Bn(n){return n.type==="keydown"}function Hn(n){return n.type.startsWith("pointer")}function qn(n){return n.type.startsWith("mouse")}function kt(n){if(Hn(n)){if(n.isPrimary)return{x:n.clientX,y:n.clientY}}else if(qn(n))return{x:n.clientX,y:n.clientY};return{x:1/0,y:1/0}}function $l(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function Pl(n,e,t){return n.x<e.x+e.width&&n.x+n.width>e.x&&n.y<e.y+e.height&&n.y+n.height>e.y}function El(n,e){if(n===e)throw new Error("Cannot compare node with itself");const t={a:an(n),b:an(e)};let s;for(;t.a.at(-1)===t.b.at(-1);)n=t.a.pop(),e=t.b.pop(),s=n;V(s,"Stacking order can only be calculated for elements with a common ancestor");const r={a:rn(ln(t.a)),b:rn(ln(t.b))};if(r.a===r.b){const i=s.childNodes,a={a:t.a.at(-1),b:t.b.at(-1)};let o=i.length;for(;o--;){const c=i[o];if(c===a.a)return 1;if(c===a.b)return-1}}return Math.sign(r.a-r.b)}const Dl=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Tl(n){var e;const t=getComputedStyle((e=Kn(n))!==null&&e!==void 0?e:n).display;return t==="flex"||t==="inline-flex"}function Fl(n){const e=getComputedStyle(n);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||Tl(n))||+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"||Dl.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function ln(n){let e=n.length;for(;e--;){const t=n[e];if(V(t,"Missing node"),Fl(t))return t}return null}function rn(n){return n&&Number(getComputedStyle(n).zIndex)||0}function an(n){const e=[];for(;n;)e.push(n),n=Kn(n);return e}function Kn(n){const{parentNode:e}=n;return e&&e instanceof ShadowRoot?e.host:e}const Wn=1,Gn=2,Vn=4,Xn=8,Ml=$l()==="coarse";let xe=[],_e=!1,Te=new Map,St=new Map;const Qe=new Set;function Il(n,e,t,s,r){var i;const{ownerDocument:a}=e,o={direction:t,element:e,hitAreaMargins:s,setResizeHandlerState:r},c=(i=Te.get(a))!==null&&i!==void 0?i:0;return Te.set(a,c+1),Qe.add(o),xt(),function(){var f;St.delete(n),Qe.delete(o);const u=(f=Te.get(a))!==null&&f!==void 0?f:1;if(Te.set(a,u-1),xt(),u===1&&Te.delete(a),xe.includes(o)){const h=xe.indexOf(o);h>=0&&xe.splice(h,1),Qt(),r("up",!0,null)}}}function Ll(n){const{target:e}=n,{x:t,y:s}=kt(n);_e=!0,Xt({target:e,x:t,y:s}),xt(),xe.length>0&&(gt("down",n),n.preventDefault(),Qn(e)||n.stopImmediatePropagation())}function Mt(n){const{x:e,y:t}=kt(n);if(_e&&n.buttons===0&&(_e=!1,gt("up",n)),!_e){const{target:s}=n;Xt({target:s,x:e,y:t})}gt("move",n),Qt(),xe.length>0&&n.preventDefault()}function It(n){const{target:e}=n,{x:t,y:s}=kt(n);St.clear(),_e=!1,xe.length>0&&(n.preventDefault(),Qn(e)||n.stopImmediatePropagation()),gt("up",n),Xt({target:e,x:t,y:s}),Qt(),xt()}function Qn(n){let e=n;for(;e;){if(e.hasAttribute(se.resizeHandle))return!0;e=e.parentElement}return!1}function Xt({target:n,x:e,y:t}){xe.splice(0);let s=null;(n instanceof HTMLElement||n instanceof SVGElement)&&(s=n),Qe.forEach(r=>{const{element:i,hitAreaMargins:a}=r,o=i.getBoundingClientRect(),{bottom:c,left:d,right:f,top:u}=o,h=Ml?a.coarse:a.fine;if(e>=d-h&&e<=f+h&&t>=u-h&&t<=c+h){if(s!==null&&document.contains(s)&&i!==s&&!i.contains(s)&&!s.contains(i)&&El(s,i)>0){let p=s,g=!1;for(;p&&!p.contains(i);){if(Pl(p.getBoundingClientRect(),o)){g=!0;break}p=p.parentElement}if(g)return}xe.push(r)}})}function Lt(n,e){St.set(n,e)}function Qt(){let n=!1,e=!1;xe.forEach(s=>{const{direction:r}=s;r==="horizontal"?n=!0:e=!0});let t=0;St.forEach(s=>{t|=s}),n&&e?Ft("intersection",t):n?Ft("horizontal",t):e?Ft("vertical",t):Cl()}let Ot=new AbortController;function xt(){Ot.abort(),Ot=new AbortController;const n={capture:!0,signal:Ot.signal};Qe.size&&(_e?(xe.length>0&&Te.forEach((e,t)=>{const{body:s}=t;e>0&&(s.addEventListener("contextmenu",It,n),s.addEventListener("pointerleave",Mt,n),s.addEventListener("pointermove",Mt,n))}),window.addEventListener("pointerup",It,n),window.addEventListener("pointercancel",It,n)):Te.forEach((e,t)=>{const{body:s}=t;e>0&&(s.addEventListener("pointerdown",Ll,n),s.addEventListener("pointermove",Mt,n))}))}function gt(n,e){Qe.forEach(t=>{const{setResizeHandlerState:s}=t,r=xe.includes(t);s(n,r,e)})}function Ol(){const[n,e]=k.useState(0);return k.useCallback(()=>e(t=>t+1),[])}function V(n,e){if(!n)throw console.error(e),Error(e)}function Me(n,e,t=Gt){return n.toFixed(t)===e.toFixed(t)?0:n>e?1:-1}function je(n,e,t=Gt){return Me(n,e,t)===0}function me(n,e,t){return Me(n,e,t)===0}function Rl(n,e,t){if(n.length!==e.length)return!1;for(let s=0;s<n.length;s++){const r=n[s],i=e[s];if(!me(r,i,t))return!1}return!0}function Ae({panelConstraints:n,panelIndex:e,size:t}){const s=n[e];V(s!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:r=0,collapsible:i,maxSize:a=100,minSize:o=0}=s;if(Me(t,o)<0)if(i){const c=(r+o)/2;Me(t,c)<0?t=r:t=o}else t=o;return t=Math.min(a,t),t=parseFloat(t.toFixed(Gt)),t}function He({delta:n,initialLayout:e,panelConstraints:t,pivotIndices:s,prevLayout:r,trigger:i}){if(me(n,0))return e;const a=[...e],[o,c]=s;V(o!=null,"Invalid first pivot index"),V(c!=null,"Invalid second pivot index");let d=0;if(i==="keyboard"){{const u=n<0?c:o,h=t[u];V(h,`Panel constraints not found for index ${u}`);const{collapsedSize:m=0,collapsible:p,minSize:g=0}=h;if(p){const b=e[u];if(V(b!=null,`Previous layout not found for panel index ${u}`),me(b,m)){const x=g-b;Me(x,Math.abs(n))>0&&(n=n<0?0-x:x)}}}{const u=n<0?o:c,h=t[u];V(h,`No panel constraints found for index ${u}`);const{collapsedSize:m=0,collapsible:p,minSize:g=0}=h;if(p){const b=e[u];if(V(b!=null,`Previous layout not found for panel index ${u}`),me(b,g)){const x=b-m;Me(x,Math.abs(n))>0&&(n=n<0?0-x:x)}}}}{const u=n<0?1:-1;let h=n<0?c:o,m=0;for(;;){const g=e[h];V(g!=null,`Previous layout not found for panel index ${h}`);const x=Ae({panelConstraints:t,panelIndex:h,size:100})-g;if(m+=x,h+=u,h<0||h>=t.length)break}const p=Math.min(Math.abs(n),Math.abs(m));n=n<0?0-p:p}{let h=n<0?o:c;for(;h>=0&&h<t.length;){const m=Math.abs(n)-Math.abs(d),p=e[h];V(p!=null,`Previous layout not found for panel index ${h}`);const g=p-m,b=Ae({panelConstraints:t,panelIndex:h,size:g});if(!me(p,b)&&(d+=p-b,a[h]=b,d.toPrecision(3).localeCompare(Math.abs(n).toPrecision(3),void 0,{numeric:!0})>=0))break;n<0?h--:h++}}if(Rl(r,a))return r;{const u=n<0?c:o,h=e[u];V(h!=null,`Previous layout not found for panel index ${u}`);const m=h+d,p=Ae({panelConstraints:t,panelIndex:u,size:m});if(a[u]=p,!me(p,m)){let g=m-p,x=n<0?c:o;for(;x>=0&&x<t.length;){const y=a[x];V(y!=null,`Previous layout not found for panel index ${x}`);const j=y+g,N=Ae({panelConstraints:t,panelIndex:x,size:j});if(me(y,N)||(g-=N-y,a[x]=N),me(g,0))break;n>0?x--:x++}}}const f=a.reduce((u,h)=>h+u,0);return me(f,100)?a:r}function Al({layout:n,panelsArray:e,pivotIndices:t}){let s=0,r=100,i=0,a=0;const o=t[0];V(o!=null,"No pivot index found"),e.forEach((u,h)=>{const{constraints:m}=u,{maxSize:p=100,minSize:g=0}=m;h===o?(s=g,r=p):(i+=g,a+=p)});const c=Math.min(r,100-i),d=Math.max(s,100-a),f=n[o];return{valueMax:c,valueMin:d,valueNow:f}}function Ye(n,e=document){return Array.from(e.querySelectorAll(`[${se.resizeHandleId}][data-panel-group-id="${n}"]`))}function Yn(n,e,t=document){const r=Ye(n,t).findIndex(i=>i.getAttribute(se.resizeHandleId)===e);return r??null}function Jn(n,e,t){const s=Yn(n,e,t);return s!=null?[s,s+1]:[-1,-1]}function Zn(n,e=document){var t;if(e instanceof HTMLElement&&(e==null||(t=e.dataset)===null||t===void 0?void 0:t.panelGroupId)==n)return e;const s=e.querySelector(`[data-panel-group][data-panel-group-id="${n}"]`);return s||null}function Nt(n,e=document){const t=e.querySelector(`[${se.resizeHandleId}="${n}"]`);return t||null}function _l(n,e,t,s=document){var r,i,a,o;const c=Nt(e,s),d=Ye(n,s),f=c?d.indexOf(c):-1,u=(r=(i=t[f])===null||i===void 0?void 0:i.id)!==null&&r!==void 0?r:null,h=(a=(o=t[f+1])===null||o===void 0?void 0:o.id)!==null&&a!==void 0?a:null;return[u,h]}function Ul({committedValuesRef:n,eagerValuesRef:e,groupId:t,layout:s,panelDataArray:r,panelGroupElement:i,setLayout:a}){k.useRef({didWarnAboutMissingResizeHandle:!1}),Fe(()=>{if(!i)return;const o=Ye(t,i);for(let c=0;c<r.length-1;c++){const{valueMax:d,valueMin:f,valueNow:u}=Al({layout:s,panelsArray:r,pivotIndices:[c,c+1]}),h=o[c];if(h!=null){const m=r[c];V(m,`No panel data found for index "${c}"`),h.setAttribute("aria-controls",m.id),h.setAttribute("aria-valuemax",""+Math.round(d)),h.setAttribute("aria-valuemin",""+Math.round(f)),h.setAttribute("aria-valuenow",u!=null?""+Math.round(u):"")}}return()=>{o.forEach((c,d)=>{c.removeAttribute("aria-controls"),c.removeAttribute("aria-valuemax"),c.removeAttribute("aria-valuemin"),c.removeAttribute("aria-valuenow")})}},[t,s,r,i]),k.useEffect(()=>{if(!i)return;const o=e.current;V(o,"Eager values not found");const{panelDataArray:c}=o,d=Zn(t,i);V(d!=null,`No group found for id "${t}"`);const f=Ye(t,i);V(f,`No resize handles found for group id "${t}"`);const u=f.map(h=>{const m=h.getAttribute(se.resizeHandleId);V(m,"Resize handle element has no handle id attribute");const[p,g]=_l(t,m,c,i);if(p==null||g==null)return()=>{};const b=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const y=c.findIndex(j=>j.id===p);if(y>=0){const j=c[y];V(j,`No panel data found for index ${y}`);const N=s[y],{collapsedSize:z=0,collapsible:C,minSize:w=0}=j.constraints;if(N!=null&&C){const M=He({delta:me(N,z)?w-z:z-N,initialLayout:s,panelConstraints:c.map(I=>I.constraints),pivotIndices:Jn(t,m,i),prevLayout:s,trigger:"keyboard"});s!==M&&a(M)}}break}}};return h.addEventListener("keydown",b),()=>{h.removeEventListener("keydown",b)}});return()=>{u.forEach(h=>h())}},[i,n,e,t,s,r,a])}function on(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}function es(n,e){const t=n==="horizontal",{x:s,y:r}=kt(e);return t?s:r}function Bl(n,e,t,s,r){const i=t==="horizontal",a=Nt(e,r);V(a,`No resize handle element found for id "${e}"`);const o=a.getAttribute(se.groupId);V(o,"Resize handle element has no group id attribute");let{initialCursorPosition:c}=s;const d=es(t,n),f=Zn(o,r);V(f,`No group element found for id "${o}"`);const u=f.getBoundingClientRect(),h=i?u.width:u.height;return(d-c)/h*100}function Hl(n,e,t,s,r,i){if(Bn(n)){const a=t==="horizontal";let o=0;n.shiftKey?o=100:r!=null?o=r:o=10;let c=0;switch(n.key){case"ArrowDown":c=a?0:o;break;case"ArrowLeft":c=a?-o:0;break;case"ArrowRight":c=a?o:0;break;case"ArrowUp":c=a?0:-o;break;case"End":c=100;break;case"Home":c=-100;break}return c}else return s==null?0:Bl(n,e,t,s,i)}function ql({panelDataArray:n}){const e=Array(n.length),t=n.map(i=>i.constraints);let s=0,r=100;for(let i=0;i<n.length;i++){const a=t[i];V(a,`Panel constraints not found for index ${i}`);const{defaultSize:o}=a;o!=null&&(s++,e[i]=o,r-=o)}for(let i=0;i<n.length;i++){const a=t[i];V(a,`Panel constraints not found for index ${i}`);const{defaultSize:o}=a;if(o!=null)continue;const c=n.length-s,d=r/c;s++,e[i]=d,r-=d}return e}function Ie(n,e,t){e.forEach((s,r)=>{const i=n[r];V(i,`Panel data not found for index ${r}`);const{callbacks:a,constraints:o,id:c}=i,{collapsedSize:d=0,collapsible:f}=o,u=t[c];if(u==null||s!==u){t[c]=s;const{onCollapse:h,onExpand:m,onResize:p}=a;p&&p(s,u),f&&(h||m)&&(m&&(u==null||je(u,d))&&!je(s,d)&&m(),h&&(u==null||!je(u,d))&&je(s,d)&&h())}})}function ut(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t])return!1;return!0}function Kl({defaultSize:n,dragState:e,layout:t,panelData:s,panelIndex:r,precision:i=3}){const a=t[r];let o;return a==null?o=n!=null?n.toPrecision(i):"1":s.length===1?o="1":o=a.toPrecision(i),{flexBasis:0,flexGrow:o,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function Wl(n,e=10){let t=null;return(...r)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{n(...r)},e)}}function cn(n){try{if(typeof localStorage<"u")n.getItem=e=>localStorage.getItem(e),n.setItem=(e,t)=>{localStorage.setItem(e,t)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),n.getItem=()=>null,n.setItem=()=>{}}}function ts(n){return`react-resizable-panels:${n}`}function ns(n){return n.map(e=>{const{constraints:t,id:s,idIsFromProps:r,order:i}=e;return r?s:i?`${i}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(",")}function ss(n,e){try{const t=ts(n),s=e.getItem(t);if(s){const r=JSON.parse(s);if(typeof r=="object"&&r!=null)return r}}catch{}return null}function Gl(n,e,t){var s,r;const i=(s=ss(n,t))!==null&&s!==void 0?s:{},a=ns(e);return(r=i[a])!==null&&r!==void 0?r:null}function Vl(n,e,t,s,r){var i;const a=ts(n),o=ns(e),c=(i=ss(n,r))!==null&&i!==void 0?i:{};c[o]={expandToSizes:Object.fromEntries(t.entries()),layout:s};try{r.setItem(a,JSON.stringify(c))}catch(d){console.error(d)}}function dn({layout:n,panelConstraints:e}){const t=[...n],s=t.reduce((i,a)=>i+a,0);if(t.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${t.map(i=>`${i}%`).join(", ")}`);if(!me(s,100)&&t.length>0)for(let i=0;i<e.length;i++){const a=t[i];V(a!=null,`No layout data found for index ${i}`);const o=100/s*a;t[i]=o}let r=0;for(let i=0;i<e.length;i++){const a=t[i];V(a!=null,`No layout data found for index ${i}`);const o=Ae({panelConstraints:e,panelIndex:i,size:a});a!=o&&(r+=a-o,t[i]=o)}if(!me(r,0))for(let i=0;i<e.length;i++){const a=t[i];V(a!=null,`No layout data found for index ${i}`);const o=a+r,c=Ae({panelConstraints:e,panelIndex:i,size:o});if(a!==c&&(r-=c-a,t[i]=c,me(r,0)))break}return t}const Xl=100,qe={getItem:n=>(cn(qe),qe.getItem(n)),setItem:(n,e)=>{cn(qe),qe.setItem(n,e)}},un={};function ls({autoSaveId:n=null,children:e,className:t="",direction:s,forwardedRef:r,id:i=null,onLayout:a=null,keyboardResizeBy:o=null,storage:c=qe,style:d,tagName:f="div",...u}){const h=Vt(i),m=k.useRef(null),[p,g]=k.useState(null),[b,x]=k.useState([]),y=Ol(),j=k.useRef({}),N=k.useRef(new Map),z=k.useRef(0),C=k.useRef({autoSaveId:n,direction:s,dragState:p,id:h,keyboardResizeBy:o,onLayout:a,storage:c}),w=k.useRef({layout:b,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:O}=C.current,{layout:R,panelDataArray:U}=w.current,T=dn({layout:S,panelConstraints:U.map(H=>H.constraints)});on(R,T)||(x(T),w.current.layout=T,O&&O(T),Ie(U,T,j.current))}}),[]),Fe(()=>{C.current.autoSaveId=n,C.current.direction=s,C.current.dragState=p,C.current.id=h,C.current.onLayout=a,C.current.storage=c}),Ul({committedValuesRef:C,eagerValuesRef:w,groupId:h,layout:b,panelDataArray:w.current.panelDataArray,setLayout:x,panelGroupElement:m.current}),k.useEffect(()=>{const{panelDataArray:S}=w.current;if(n){if(b.length===0||b.length!==S.length)return;let O=un[n];O==null&&(O=Wl(Vl,Xl),un[n]=O);const R=[...S],U=new Map(N.current);O(n,R,U,b,c)}},[n,b,c]),k.useEffect(()=>{});const M=k.useCallback(S=>{const{onLayout:O}=C.current,{layout:R,panelDataArray:U}=w.current;if(S.constraints.collapsible){const T=U.map(fe=>fe.constraints),{collapsedSize:H=0,panelSize:Y,pivotIndices:te}=De(U,S,R);if(V(Y!=null,`Panel size not found for panel "${S.id}"`),!je(Y,H)){N.current.set(S.id,Y);const E=Oe(U,S)===U.length-1?Y-H:H-Y,X=He({delta:E,initialLayout:R,panelConstraints:T,pivotIndices:te,prevLayout:R,trigger:"imperative-api"});ut(R,X)||(x(X),w.current.layout=X,O&&O(X),Ie(U,X,j.current))}}},[]),I=k.useCallback((S,O)=>{const{onLayout:R}=C.current,{layout:U,panelDataArray:T}=w.current;if(S.constraints.collapsible){const H=T.map(ne=>ne.constraints),{collapsedSize:Y=0,panelSize:te=0,minSize:fe=0,pivotIndices:E}=De(T,S,U),X=O??fe;if(je(te,Y)){const ne=N.current.get(S.id),ge=ne!=null&&ne>=X?ne:X,Pe=Oe(T,S)===T.length-1?te-ge:ge-te,ae=He({delta:Pe,initialLayout:U,panelConstraints:H,pivotIndices:E,prevLayout:U,trigger:"imperative-api"});ut(U,ae)||(x(ae),w.current.layout=ae,R&&R(ae),Ie(T,ae,j.current))}}},[]),F=k.useCallback(S=>{const{layout:O,panelDataArray:R}=w.current,{panelSize:U}=De(R,S,O);return V(U!=null,`Panel size not found for panel "${S.id}"`),U},[]),v=k.useCallback((S,O)=>{const{panelDataArray:R}=w.current,U=Oe(R,S);return Kl({defaultSize:O,dragState:p,layout:b,panelData:R,panelIndex:U})},[p,b]),P=k.useCallback(S=>{const{layout:O,panelDataArray:R}=w.current,{collapsedSize:U=0,collapsible:T,panelSize:H}=De(R,S,O);return V(H!=null,`Panel size not found for panel "${S.id}"`),T===!0&&je(H,U)},[]),W=k.useCallback(S=>{const{layout:O,panelDataArray:R}=w.current,{collapsedSize:U=0,collapsible:T,panelSize:H}=De(R,S,O);return V(H!=null,`Panel size not found for panel "${S.id}"`),!T||Me(H,U)>0},[]),A=k.useCallback(S=>{const{panelDataArray:O}=w.current;O.push(S),O.sort((R,U)=>{const T=R.order,H=U.order;return T==null&&H==null?0:T==null?-1:H==null?1:T-H}),w.current.panelDataArrayChanged=!0,y()},[y]);Fe(()=>{if(w.current.panelDataArrayChanged){w.current.panelDataArrayChanged=!1;const{autoSaveId:S,onLayout:O,storage:R}=C.current,{layout:U,panelDataArray:T}=w.current;let H=null;if(S){const te=Gl(S,T,R);te&&(N.current=new Map(Object.entries(te.expandToSizes)),H=te.layout)}H==null&&(H=ql({panelDataArray:T}));const Y=dn({layout:H,panelConstraints:T.map(te=>te.constraints)});on(U,Y)||(x(Y),w.current.layout=Y,O&&O(Y),Ie(T,Y,j.current))}}),Fe(()=>{const S=w.current;return()=>{S.layout=[]}},[]);const _=k.useCallback(S=>{let O=!1;const R=m.current;return R&&window.getComputedStyle(R,null).getPropertyValue("direction")==="rtl"&&(O=!0),function(T){T.preventDefault();const H=m.current;if(!H)return()=>null;const{direction:Y,dragState:te,id:fe,keyboardResizeBy:E,onLayout:X}=C.current,{layout:ne,panelDataArray:ge}=w.current,{initialLayout:Ne}=te??{},Pe=Jn(fe,S,H);let ae=Hl(T,S,Y,te,E,H);const ot=Y==="horizontal";ot&&O&&(ae=-ae);const Et=ge.map(Dt=>Dt.constraints),Ee=He({delta:ae,initialLayout:Ne??ne,panelConstraints:Et,pivotIndices:Pe,prevLayout:ne,trigger:Bn(T)?"keyboard":"mouse-or-touch"}),ct=!ut(ne,Ee);(Hn(T)||qn(T))&&z.current!=ae&&(z.current=ae,!ct&&ae!==0?ot?Lt(S,ae<0?Wn:Gn):Lt(S,ae<0?Vn:Xn):Lt(S,0)),ct&&(x(Ee),w.current.layout=Ee,X&&X(Ee),Ie(ge,Ee,j.current))}},[]),B=k.useCallback((S,O)=>{const{onLayout:R}=C.current,{layout:U,panelDataArray:T}=w.current,H=T.map(ne=>ne.constraints),{panelSize:Y,pivotIndices:te}=De(T,S,U);V(Y!=null,`Panel size not found for panel "${S.id}"`);const E=Oe(T,S)===T.length-1?Y-O:O-Y,X=He({delta:E,initialLayout:U,panelConstraints:H,pivotIndices:te,prevLayout:U,trigger:"imperative-api"});ut(U,X)||(x(X),w.current.layout=X,R&&R(X),Ie(T,X,j.current))},[]),G=k.useCallback((S,O)=>{const{layout:R,panelDataArray:U}=w.current,{collapsedSize:T=0,collapsible:H}=O,{collapsedSize:Y=0,collapsible:te,maxSize:fe=100,minSize:E=0}=S.constraints,{panelSize:X}=De(U,S,R);X!=null&&(H&&te&&je(X,T)?je(T,Y)||B(S,Y):X<E?B(S,E):X>fe&&B(S,fe))},[B]),q=k.useCallback((S,O)=>{const{direction:R}=C.current,{layout:U}=w.current;if(!m.current)return;const T=Nt(S,m.current);V(T,`Drag handle element not found for id "${S}"`);const H=es(R,O);g({dragHandleId:S,dragHandleRect:T.getBoundingClientRect(),initialCursorPosition:H,initialLayout:U})},[]),ee=k.useCallback(()=>{g(null)},[]),Z=k.useCallback(S=>{const{panelDataArray:O}=w.current,R=Oe(O,S);R>=0&&(O.splice(R,1),delete j.current[S.id],w.current.panelDataArrayChanged=!0,y())},[y]),L=k.useMemo(()=>({collapsePanel:M,direction:s,dragState:p,expandPanel:I,getPanelSize:F,getPanelStyle:v,groupId:h,isPanelCollapsed:P,isPanelExpanded:W,reevaluatePanelConstraints:G,registerPanel:A,registerResizeHandle:_,resizePanel:B,startDragging:q,stopDragging:ee,unregisterPanel:Z,panelGroupElement:m.current}),[M,p,s,I,F,v,h,P,W,G,A,_,B,q,ee,Z]),K={display:"flex",flexDirection:s==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return k.createElement(jt.Provider,{value:L},k.createElement(f,{...u,children:e,className:t,id:i,ref:m,style:{...K,...d},[se.group]:"",[se.groupDirection]:s,[se.groupId]:h}))}const rs=k.forwardRef((n,e)=>k.createElement(ls,{...n,forwardedRef:e}));ls.displayName="PanelGroup";rs.displayName="forwardRef(PanelGroup)";function Oe(n,e){return n.findIndex(t=>t===e||t.id===e.id)}function De(n,e,t){const s=Oe(n,e),i=s===n.length-1?[s-1,s]:[s,s+1],a=t[s];return{...e.constraints,panelSize:a,pivotIndices:i}}function Ql({disabled:n,handleId:e,resizeHandler:t,panelGroupElement:s}){k.useEffect(()=>{if(n||t==null||s==null)return;const r=Nt(e,s);if(r==null)return;const i=a=>{if(!a.defaultPrevented)switch(a.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{a.preventDefault(),t(a);break}case"F6":{a.preventDefault();const o=r.getAttribute(se.groupId);V(o,`No group element found for id "${o}"`);const c=Ye(o,s),d=Yn(o,e,s);V(d!==null,`No resize element found for id "${e}"`);const f=a.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)}},[s,n,e,t])}function is({children:n=null,className:e="",disabled:t=!1,hitAreaMargins:s,id:r,onBlur:i,onClick:a,onDragging:o,onFocus:c,onPointerDown:d,onPointerUp:f,style:u={},tabIndex:h=0,tagName:m="div",...p}){var g,b;const x=k.useRef(null),y=k.useRef({onClick:a,onDragging:o,onPointerDown:d,onPointerUp:f});k.useEffect(()=>{y.current.onClick=a,y.current.onDragging=o,y.current.onPointerDown=d,y.current.onPointerUp=f});const j=k.useContext(jt);if(j===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:N,groupId:z,registerResizeHandle:C,startDragging:w,stopDragging:M,panelGroupElement:I}=j,F=Vt(r),[v,P]=k.useState("inactive"),[W,A]=k.useState(!1),[_,B]=k.useState(null),G=k.useRef({state:v});Fe(()=>{G.current.state=v}),k.useEffect(()=>{if(t)B(null);else{const L=C(F);B(()=>L)}},[t,F,C]);const q=(g=s?.coarse)!==null&&g!==void 0?g:15,ee=(b=s?.fine)!==null&&b!==void 0?b:5;k.useEffect(()=>{if(t||_==null)return;const L=x.current;V(L,"Element ref not attached");let K=!1;return Il(F,L,N,{coarse:q,fine:ee},(O,R,U)=>{if(!R){P("inactive");return}switch(O){case"down":{P("drag"),K=!1,V(U,'Expected event to be defined for "down" action'),w(F,U);const{onDragging:T,onPointerDown:H}=y.current;T?.(!0),H?.();break}case"move":{const{state:T}=G.current;K=!0,T!=="drag"&&P("hover"),V(U,'Expected event to be defined for "move" action'),_(U);break}case"up":{P("hover"),M();const{onClick:T,onDragging:H,onPointerUp:Y}=y.current;H?.(!1),Y?.(),K||T?.();break}}})},[q,N,t,ee,C,F,_,w,M]),Ql({disabled:t,handleId:F,resizeHandler:_,panelGroupElement:I});const Z={touchAction:"none",userSelect:"none"};return k.createElement(m,{...p,children:n,className:e,id:r,onBlur:()=>{A(!1),i?.()},onFocus:()=>{A(!0),c?.()},ref:x,role:"separator",style:{...Z,...u},tabIndex:h,[se.groupDirection]:N,[se.groupId]:z,[se.resizeHandle]:"",[se.resizeHandleActive]:v==="drag"?"pointer":W?"keyboard":void 0,[se.resizeHandleEnabled]:!t,[se.resizeHandleId]:F,[se.resizeHandleState]:v})}is.displayName="PanelResizeHandle";function Yl(n){const e=$.c(10);let t,s,r;e[0]!==n?({className:t,ref:r,...s}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=r):(t=e[1],s=e[2],r=e[3]);let i;e[4]!==t?(i=de("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),e[4]=t,e[5]=i):i=e[5];let a;return e[6]!==s||e[7]!==r||e[8]!==i?(a=l.jsx(rs,{ref:r,"data-slot":"resizable-panel-group",className:i,...s}),e[6]=s,e[7]=r,e[8]=i,e[9]=a):a=e[9],a}function fn(n){const e=$.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let s;return e[2]!==t?(s=l.jsx(Un,{"data-slot":"resizable-panel",...t}),e[2]=t,e[3]=s):s=e[3],s}function Jl(n){const e=$.c(12);let t,s,r;e[0]!==n?({withHandle:r,className:t,...s}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=r):(t=e[1],s=e[2],r=e[3]);let i;e[4]!==t?(i=de("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",t),e[4]=t,e[5]=i):i=e[5];let a;e[6]!==r?(a=r&&l.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:l.jsx(Ds,{className:"size-2.5"})}),e[6]=r,e[7]=a):a=e[7];let o;return e[8]!==s||e[9]!==i||e[10]!==a?(o=l.jsx(is,{"data-slot":"resizable-handle",className:i,...s,children:a}),e[8]=s,e[9]=i,e[10]=a,e[11]=o):o=e[11],o}function Zl(n){if(!n||n.includes("\\")||n.includes("..")||n.includes("\0"))return!0;try{const e=decodeURIComponent(n);if(e.includes("\\")||e.includes("..")||e.includes("\0"))return!0;if(e!==n&&e.includes("/")){const t=(n.match(/\//g)??[]).length;if((e.match(/\//g)??[]).length>t)return!0}return!1}catch{return!0}}function er(n){if(Zl(n))throw new Error(`Invalid block key: ${n||"(empty)"}`)}function tr(n){try{return decodeURIComponent(n)}catch{return n}}function nr(n){return er(n),encodeURIComponent(n)}function sr(n){return`.deco/blocks/${nr(n)}.json`}function Ma(n){return`/${sr(n)}`}const Ia=1e4,lr=3;function Ut(n){return n.trim()?(n.startsWith("/")?n:`/${n}`).replace(/\/+/g,"/"):"/"}function Yt(n){return n.startsWith("/")?n.slice(1):n}function bt(n){return n.trim()?n.startsWith("/")?n:`/${n}`:"/"}function rr(n){const e=bt(n);if(e==="/")return"/";const t=e.split("/").filter(Boolean);return t.pop(),t.length===0?"/":`/${t.join("/")}`}function La(n,e){const t=e.replace(/^\/+|\/+$/g,"");return bt(t?`${n==="/"?"":n}/${t}`:n)}function Oa(n,e){return e==="directory"?n:rr(n)}function Ra(n){const e=n.trim();return e?e.includes("/")||e.includes("\\")||e.includes("..")||e.includes("\0")?"Name cannot contain /, \\, or ..":null:"Name is required"}function ir(n){const e=Yt(n);return e?e.split("/").filter(Boolean).length:0}function Aa(n,e,t,s=!1){return{files:[...new Set([...n,...t.files])],directories:[...new Set([...e,...t.directories??[]])],truncated:s||!!t.truncated}}function _a(n,e){return ir(n)>=lr&&!e.has(n)}function Ua(n,e,t=[]){const s=Yt(n);if(e.includes(s)||t.includes(s))return!0;if(!s)return!1;const r=`${s}/`;return e.some(i=>i.startsWith(r))||t.some(i=>i.startsWith(r))}function Ba(n){const e=Yt(n),t=".deco/blocks/";if(!e.startsWith(t)||!e.endsWith(".json"))return null;const s=e.slice(t.length,-5);return tr(s)}function ar(n){if(!n)return"plaintext";const e=n.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 Ha(n){const e=Ut(n).split("/").filter(Boolean),t=["/"];let s="";for(const r of e.slice(0,-1))s+=`/${r}`,t.push(s);return t}function qa(n,e=[]){const t={children:[]},s=i=>{const o=Ut(i).split("/").filter(Boolean);let c=t,d="";for(const f of o){d+=`/${f}`;let u=c.children.find(h=>h.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 n){const o=Ut(i).split("/").filter(Boolean);let c=t,d="";o.forEach((f,u)=>{d+=`/${f}`;const h=u===o.length-1;let m=c.children.find(p=>p.name===f);m||(m={name:f,path:d,kind:h?"file":"directory",children:[]},c.children.push(m)),c=m})}for(const i of e)s(bt(i));const r=i=>{i.sort((a,o)=>a.kind!==o.kind?a.kind==="directory"?-1:1:a.name.localeCompare(o.name));for(const a of i)a.children.length>0&&r(a.children)};return r(t.children),t.children}function or(n,e,t=0){const s=[];for(const r of n)r.name!==".gitkeep"&&(s.push({node:r,depth:t}),r.kind==="directory"&&r.children.length>0&&e.has(r.path)&&s.push(...or(r.children,e,t+1)));return s}function Ka(n){return n.split(`
1
+ import{c as $,a1 as ce,n as Je,d as We,K as Q,m as ie,aW as kn,r as k,am as Ss,l as de,j as l,a3 as Ns,i as zs,B as J,aJ as Sn,t as ue,aD as Cs,L as $s,e as Ps,b as Nn,u as zn,U as Tt}from"./index-CmqY5ba2.js";import{i as Es}from"./ChevronRight-YNJrw7T7.js";import{s as Cn}from"./Eye-CdLtH4sp.js";import{n as Ve,i as yt}from"./Globe01-ClkxCHYw.js";import{b as Ds,c as Ts,e as Fs,i as Ms,f as $n,a as Ht,g as Is,h as Ls,d as Os}from"./ZoomOut-BmrbNv1d.js";import{a as ht}from"./Palette-CeXkOlbG.js";import{s as Rs}from"./Plus-BI6RJ5xd.js";import{i as As}from"./SearchLg-Co2FsVdE.js";import{t as _s}from"./Stars01-C1j06l6D.js";import{i as mt}from"./Upload01-COBVtjLn.js";import{s as Pn}from"./XClose-Q-X-b3kB.js";import{i as qt}from"./Zap-DD3Nytx8.js";import{u as En}from"./use-mobile-BIz7TFn6.js";import{f as Us,a as Bs,b as Hs,c as qs,d as Ks,e as Ws,A as Gs,g as Vs}from"./alert-dialog-BxTpiDih.js";import{D as Dn,a as Ue,d as Ze,e as et,g as Tn,f as Xs,c as Qs}from"./dialog-DXBIUaRX.js";import{I as Xe}from"./input-Bs55eT5u.js";import{S as oe}from"./skeleton-Dq93TJh5.js";import{F as Se,M as Kt,d as Fn}from"./file-type-icon-x7TFcIF9.js";import{T as Ys}from"./toolbar-D-9bAdG-.js";import{u as Js}from"./use-debounced-value-CxSmoTdZ.js";import{i as vt}from"./DotsVertical-DPI55j50.js";import{i as Mn}from"./Key01-5zu6DjT3.js";import{s as wt}from"./Trash01-BVLzg5_A.js";import{D as tt,a as nt,c as st,d as be}from"./dropdown-menu-ByvoTU0t.js";import{T as Zs}from"./textarea-DmTl3XWA.js";import{t as el}from"./ChevronDown-UXwj6_DS.js";import{n as tl}from"./ChevronUp-CbEwrEJd.js";import{i as pt}from"./X-BNQfs1Pt.js";import{a as nl,P as sl,b as ll}from"./popover-BRFVNGaf.js";import{T as ye,a as ve,b as we}from"./tooltip-DjgnnJdf.js";import{i as rl}from"./Check-lZiXfst_.js";import{a as il}from"./Copy01-DusTW9YE.js";import{n as In}from"./LinkExternal01-CE1gy0KD.js";import{l as al,F as ol}from"./index-Cn-3DA8L.js";import{i as cl}from"./LayoutLeft-BT4hpymA.js";function Ln(n){return n.contentHash??`${n.size}-${n.updatedAt}`}function pe(n,e,t,s){const r=new URLSearchParams(s).toString();return`/api/${encodeURIComponent(n)}/fs/${encodeURIComponent(e)}/${t}${r?`?${r}`:""}`}async function he(n,e){const t=await fetch(n,e);if(!t.ok){let s="";try{s=(await t.json()).error??""}catch{}throw new Error(s||`HTTP ${t.status}`)}return t}function Wt(n,e){const t=$.c(11),{org:s}=ce();let r;t[0]!==s.id||t[1]!==e||t[2]!==n?(r=Q.orgFsList(s.id,n,e),t[0]=s.id,t[1]=e,t[2]=n,t[3]=r):r=t[3];let i;t[4]!==s.slug||t[5]!==e||t[6]!==n?(i=async()=>(await(await he(pe(s.slug,n,"list",{path:e}))).json()).entries.toSorted(dl),t[4]=s.slug,t[5]=e,t[6]=n,t[7]=i):i=t[7];let a;return t[8]!==r||t[9]!==i?(a={queryKey:r,placeholderData:kn,queryFn:i},t[8]=r,t[9]=i,t[10]=a):a=t[10],ie(a)}function dl(n,e){return n.kind!==e.kind?n.kind==="dir"?-1:1:n.path.localeCompare(e.path)}function On(n,e,t){const s=$.c(15),{org:r}=ce();let i;s[0]!==r.id||s[1]!==e||s[2]!==n?(i=Q.orgFsStat(r.id,n??"",e),s[0]=r.id,s[1]=e,s[2]=n,s[3]=i):i=s[3];const a=n!==null;let o;s[4]!==t?(o=t?.refetchIntervalWhenAbsent?f=>f.state.data?!1:t.refetchIntervalWhenAbsent??!1:void 0,s[4]=t,s[5]=o):o=s[5];let c;s[6]!==r.slug||s[7]!==e||s[8]!==n?(c=async()=>{const f=await fetch(pe(r.slug,n??"","stat",{path:e}));if(f.status===404)return null;if(!f.ok)throw new Error(`HTTP ${f.status}`);return(await f.json()).entry},s[6]=r.slug,s[7]=e,s[8]=n,s[9]=c):c=s[9];let d;return s[10]!==i||s[11]!==a||s[12]!==o||s[13]!==c?(d={queryKey:i,enabled:a,refetchInterval:o,queryFn:c},s[10]=i,s[11]=a,s[12]=o,s[13]=c,s[14]=d):d=s[14],ie(d)}function ul(n){const e=$.c(9),{org:t}=ce();let s;e[0]!==t.id||e[1]!==n?(s=Q.orgFsUsage(t.id,n),e[0]=t.id,e[1]=n,e[2]=s):s=e[2];let r;e[3]!==t.slug||e[4]!==n?(r=async()=>await(await he(pe(t.slug,n,"usage"))).json(),e[3]=t.slug,e[4]=n,e[5]=r):r=e[5];let i;return e[6]!==s||e[7]!==r?(i={queryKey:s,queryFn:r},e[6]=s,e[7]=r,e[8]=i):i=e[8],ie(i)}function fl(n,e){const t=$.c(9),s=n===void 0?60:n,{org:r}=ce();let i;t[0]!==r.id?(i=Q.orgFsRecent(r.id),t[0]=r.id,t[1]=i):i=t[1];const a=e?.enabled;let o;t[2]!==s||t[3]!==r.slug?(o=async()=>(await(await he(`/api/${encodeURIComponent(r.slug)}/fs/recent?limit=${s}`)).json()).entries,t[2]=s,t[3]=r.slug,t[4]=o):o=t[4];let c;return t[5]!==i||t[6]!==a||t[7]!==o?(c={queryKey:i,enabled:a,queryFn:o},t[5]=i,t[6]=a,t[7]=o,t[8]=c):c=t[8],ie(c)}function hl(n,e){const t=$.c(11),s=50,{org:r}=ce();let i;t[0]!==r.id||t[1]!==n?(i=Q.orgFsSearch(r.id,n),t[0]=r.id,t[1]=n,t[2]=i):i=t[2];const a=n.length>0;let o;t[3]!==s||t[4]!==r.slug||t[5]!==n?(o=async()=>(await(await he(`/api/${encodeURIComponent(r.slug)}/fs/search?q=${encodeURIComponent(n)}&limit=${s}`)).json()).entries,t[3]=s,t[4]=r.slug,t[5]=n,t[6]=o):o=t[6];let c;return t[7]!==i||t[8]!==a||t[9]!==o?(c={queryKey:i,enabled:a,placeholderData:kn,queryFn:o},t[7]=i,t[8]=a,t[9]=o,t[10]=c):c=t[10],ie(c)}function Da(n){const e=$.c(8),{org:t}=ce();let s;e[0]!==t.id?(s=Q.orgFsSkills(t.id),e[0]=t.id,e[1]=s):s=e[1];const r=n?.enabled;let i;e[2]!==t.slug?(i=async()=>{const o=await he(`/api/${encodeURIComponent(t.slug)}/fs/skills`),{skills:c}=await o.json();return c.map(ml)},e[2]=t.slug,e[3]=i):i=e[3];let a;return e[4]!==s||e[5]!==r||e[6]!==i?(a={queryKey:s,enabled:r,queryFn:i},e[4]=s,e[5]=r,e[6]=i,e[7]=a):a=e[7],ie(a)}function ml(n){return{volume:n.volume,path:n.path}}async function Ta(n){const e=await he(`/api/${encodeURIComponent(n)}/fs/skills`),{skills:t}=await e.json();return t}async function pl(n,e,t){return(await he(pe(n,e,"read",{path:t}))).text()}const xl=new Set(["md","mdx","markdown","txt","text"]),gl=25,bl=64*1024,yl=256*1024,vl=4;function wl(n){const e=n.lastIndexOf(".");return e===-1?!1:xl.has(n.slice(e+1).toLowerCase())}async function Fa(n,e,t){const s=t?`${t}/`:"",r=u=>u.startsWith(s)?u.slice(s.length):u,i=[],a=[],o=[{path:t,depth:0}];for(;o.length>0;){const u=o.shift();if(!u)break;let h;try{h=(await(await he(pe(n,e,"list",{path:u.path}))).json()).entries}catch{continue}for(const m of[...h].sort((p,g)=>p.path.localeCompare(g.path))){if(m.kind==="dir"){u.depth<vl&&o.push({path:m.path,depth:u.depth+1});continue}wl(m.path)&&m.size<=bl&&i.length<gl?i.push(m.path):a.push(r(m.path))}}const c=await Promise.all(i.map(u=>pl(n,e,u).catch(()=>null))),d=[];let f=0;return i.forEach((u,h)=>{const m=c[h];if(m==null||f+m.length>yl){a.push(r(u));return}f+=m.length,d.push({relPath:r(u),content:m})}),d.sort((u,h)=>u.relPath==="SKILL.md"?-1:h.relPath==="SKILL.md"?1:u.relPath.localeCompare(h.relPath)),a.sort(),{files:d,omittedPaths:a}}function Rn(){const n=$.c(7),{org:e}=ce();let t;n[0]!==e.id?(t=Q.orgFsPublicSets(e.id),n[0]=e.id,n[1]=t):t=n[1];let s;n[2]!==e.slug?(s=async()=>(await(await he(`/api/${encodeURIComponent(e.slug)}/fs/public-sets`)).json()).sets,n[2]=e.slug,n[3]=s):s=n[3];let r;return n[4]!==t||n[5]!==s?(r={queryKey:t,staleTime:3e5,queryFn:s},n[4]=t,n[5]=s,n[6]=r):r=n[6],ie(r)}function jl(n){const e=$.c(3),{org:t}=ce();let s;return e[0]!==t.slug||e[1]!==n?(s=r=>pe(t.slug,n,"read",{path:r}),e[0]=t.slug,e[1]=n,e[2]=s):s=e[2],s}function lt(){const n=$.c(2),{org:e}=ce();let t;return n[0]!==e.slug?(t=(s,r)=>pe(e.slug,s,"read",{path:r}),n[0]=e.slug,n[1]=t):t=n[1],t}function An(n){const e=$.c(3),{org:t}=ce();let s;return e[0]!==t||e[1]!==n?(s={mutationFn:async r=>(await(await he(pe(t.slug,n,"file",{path:r.path}),{method:"PUT",headers:{"content-type":r.contentType??"text/html; charset=utf-8"},body:r.body})).json()).entry},e[0]=t,e[1]=n,e[2]=s):s=e[2],We(s)}function kl(n){const e=$.c(18),{org:t}=ce(),s=Je();let r;e[0]!==t||e[1]!==n?(r=async d=>(await(await he(pe(t.slug,n,"public",{path:d.path}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:d.mode,password:d.password})})).json()).entry,e[0]=t,e[1]=n,e[2]=r):r=e[2];let i;e[3]!==t||e[4]!==s||e[5]!==n?(i=async d=>{const f=Q.orgFsStat(t.id,n,d.path);await s.cancelQueries({queryKey:f});const u=s.getQueryData(f),h=d.mode!=="private";return s.setQueryData(f,m=>m&&{...m,readPublic:h,effectivePublic:h,shareMode:d.mode}),{key:f,previous:u}},e[3]=t,e[4]=s,e[5]=n,e[6]=i):i=e[6];let a;e[7]!==s?(a=(d,f,u)=>{u&&s.setQueryData(u.key,u.previous)},e[7]=s,e[8]=a):a=e[8];let o;e[9]!==t||e[10]!==s||e[11]!==n?(o=(d,f,u)=>{s.invalidateQueries({queryKey:Q.orgFsStat(t.id,n,u.path)}),s.invalidateQueries({queryKey:Q.orgFsVolume(t.id,n)}),s.invalidateQueries({queryKey:Q.orgFsRecent(t.id)}),s.invalidateQueries({queryKey:Q.orgFsSearchRoot(t.id)})},e[9]=t,e[10]=s,e[11]=n,e[12]=o):o=e[12];let c;return e[13]!==r||e[14]!==i||e[15]!==a||e[16]!==o?(c={mutationFn:r,onMutate:i,onError:a,onSettled:o},e[13]=r,e[14]=i,e[15]=a,e[16]=o,e[17]=c):c=e[17],We(c)}function At(n){const e=$.c(26),{org:t}=ce(),s=Je();let r;e[0]!==t||e[1]!==s||e[2]!==n?(r=()=>{s.invalidateQueries({queryKey:Q.orgFsVolume(t.id,n)}),s.invalidateQueries({queryKey:Q.orgFsRecent(t.id)}),s.invalidateQueries({queryKey:Q.orgFsSearchRoot(t.id)})},e[0]=t,e[1]=s,e[2]=n,e[3]=r):r=e[3];const i=r;let a;e[4]!==t||e[5]!==n?(a=async b=>{for(const x of b.files){const y=b.dir?`${b.dir}/${x.name}`:x.name;await he(pe(t.slug,n,"file",{path:y}),{method:"PUT",headers:{"content-type":x.type||"application/octet-stream"},body:x})}},e[4]=t,e[5]=n,e[6]=a):a=e[6];let o;e[7]!==i||e[8]!==a?(o={mutationFn:a,onSettled:i},e[7]=i,e[8]=a,e[9]=o):o=e[9];const c=We(o);let d;e[10]!==t||e[11]!==n?(d=async b=>{await he(pe(t.slug,n,"dir",{path:b}),{method:"POST"})},e[10]=t,e[11]=n,e[12]=d):d=e[12];let f;e[13]!==i||e[14]!==d?(f={mutationFn:d,onSuccess:i},e[13]=i,e[14]=d,e[15]=f):f=e[15];const u=We(f);let h;e[16]!==t||e[17]!==n?(h=async b=>{await he(pe(t.slug,n,"file",{path:b}),{method:"DELETE"})},e[16]=t,e[17]=n,e[18]=h):h=e[18];let m;e[19]!==i||e[20]!==h?(m={mutationFn:h,onSuccess:i},e[19]=i,e[20]=h,e[21]=m):m=e[21];const p=We(m);let g;return e[22]!==u||e[23]!==p||e[24]!==c?(g={upload:c,mkdir:u,remove:p},e[22]=u,e[23]=p,e[24]=c,e[25]=g):g=e[25],g}const jt=k.createContext(null);jt.displayName="PanelGroupContext";const se={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"},Gt=10,Fe=k.useLayoutEffect,sn=Ss.useId,Sl=typeof sn=="function"?sn:()=>null;let Nl=0;function Vt(n=null){const e=Sl(),t=k.useRef(n||e||null);return t.current===null&&(t.current=""+Nl++),n??t.current}function _n({children:n,className:e="",collapsedSize:t,collapsible:s,defaultSize:r,forwardedRef:i,id:a,maxSize:o,minSize:c,onCollapse:d,onExpand:f,onResize:u,order:h,style:m,tagName:p="div",...g}){const b=k.useContext(jt);if(b===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:x,expandPanel:y,getPanelSize:j,getPanelStyle:N,groupId:z,isPanelCollapsed:C,reevaluatePanelConstraints:w,registerPanel:M,resizePanel:I,unregisterPanel:F}=b,v=Vt(a),P=k.useRef({callbacks:{onCollapse:d,onExpand:f,onResize:u},constraints:{collapsedSize:t,collapsible:s,defaultSize:r,maxSize:o,minSize:c},id:v,idIsFromProps:a!==void 0,order:h});k.useRef({didLogMissingDefaultSizeWarning:!1}),Fe(()=>{const{callbacks:A,constraints:_}=P.current,B={..._};P.current.id=v,P.current.idIsFromProps=a!==void 0,P.current.order=h,A.onCollapse=d,A.onExpand=f,A.onResize=u,_.collapsedSize=t,_.collapsible=s,_.defaultSize=r,_.maxSize=o,_.minSize=c,(B.collapsedSize!==_.collapsedSize||B.collapsible!==_.collapsible||B.maxSize!==_.maxSize||B.minSize!==_.minSize)&&w(P.current,B)}),Fe(()=>{const A=P.current;return M(A),()=>{F(A)}},[h,v,M,F]),k.useImperativeHandle(i,()=>({collapse:()=>{x(P.current)},expand:A=>{y(P.current,A)},getId(){return v},getSize(){return j(P.current)},isCollapsed(){return C(P.current)},isExpanded(){return!C(P.current)},resize:A=>{I(P.current,A)}}),[x,y,j,C,v,I]);const W=N(P.current,r);return k.createElement(p,{...g,children:n,className:e,id:v,style:{...W,...m},[se.groupId]:z,[se.panel]:"",[se.panelCollapsible]:s||void 0,[se.panelId]:v,[se.panelSize]:parseFloat(""+W.flexGrow).toFixed(1)})}const Un=k.forwardRef((n,e)=>k.createElement(_n,{...n,forwardedRef:e}));_n.displayName="Panel";Un.displayName="forwardRef(Panel)";let _t=null,ft=-1,Ce=null;function zl(n,e){if(e){const t=(e&Wn)!==0,s=(e&Gn)!==0,r=(e&Vn)!==0,i=(e&Xn)!==0;if(t)return r?"se-resize":i?"ne-resize":"e-resize";if(s)return r?"sw-resize":i?"nw-resize":"w-resize";if(r)return"s-resize";if(i)return"n-resize"}switch(n){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function Cl(){Ce!==null&&(document.head.removeChild(Ce),_t=null,Ce=null,ft=-1)}function Ft(n,e){var t,s;const r=zl(n,e);if(_t!==r){if(_t=r,Ce===null&&(Ce=document.createElement("style"),document.head.appendChild(Ce)),ft>=0){var i;(i=Ce.sheet)===null||i===void 0||i.removeRule(ft)}ft=(t=(s=Ce.sheet)===null||s===void 0?void 0:s.insertRule(`*{cursor: ${r} !important;}`))!==null&&t!==void 0?t:-1}}function Bn(n){return n.type==="keydown"}function Hn(n){return n.type.startsWith("pointer")}function qn(n){return n.type.startsWith("mouse")}function kt(n){if(Hn(n)){if(n.isPrimary)return{x:n.clientX,y:n.clientY}}else if(qn(n))return{x:n.clientX,y:n.clientY};return{x:1/0,y:1/0}}function $l(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function Pl(n,e,t){return n.x<e.x+e.width&&n.x+n.width>e.x&&n.y<e.y+e.height&&n.y+n.height>e.y}function El(n,e){if(n===e)throw new Error("Cannot compare node with itself");const t={a:an(n),b:an(e)};let s;for(;t.a.at(-1)===t.b.at(-1);)n=t.a.pop(),e=t.b.pop(),s=n;V(s,"Stacking order can only be calculated for elements with a common ancestor");const r={a:rn(ln(t.a)),b:rn(ln(t.b))};if(r.a===r.b){const i=s.childNodes,a={a:t.a.at(-1),b:t.b.at(-1)};let o=i.length;for(;o--;){const c=i[o];if(c===a.a)return 1;if(c===a.b)return-1}}return Math.sign(r.a-r.b)}const Dl=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Tl(n){var e;const t=getComputedStyle((e=Kn(n))!==null&&e!==void 0?e:n).display;return t==="flex"||t==="inline-flex"}function Fl(n){const e=getComputedStyle(n);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||Tl(n))||+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"||Dl.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function ln(n){let e=n.length;for(;e--;){const t=n[e];if(V(t,"Missing node"),Fl(t))return t}return null}function rn(n){return n&&Number(getComputedStyle(n).zIndex)||0}function an(n){const e=[];for(;n;)e.push(n),n=Kn(n);return e}function Kn(n){const{parentNode:e}=n;return e&&e instanceof ShadowRoot?e.host:e}const Wn=1,Gn=2,Vn=4,Xn=8,Ml=$l()==="coarse";let xe=[],_e=!1,Te=new Map,St=new Map;const Qe=new Set;function Il(n,e,t,s,r){var i;const{ownerDocument:a}=e,o={direction:t,element:e,hitAreaMargins:s,setResizeHandlerState:r},c=(i=Te.get(a))!==null&&i!==void 0?i:0;return Te.set(a,c+1),Qe.add(o),xt(),function(){var f;St.delete(n),Qe.delete(o);const u=(f=Te.get(a))!==null&&f!==void 0?f:1;if(Te.set(a,u-1),xt(),u===1&&Te.delete(a),xe.includes(o)){const h=xe.indexOf(o);h>=0&&xe.splice(h,1),Qt(),r("up",!0,null)}}}function Ll(n){const{target:e}=n,{x:t,y:s}=kt(n);_e=!0,Xt({target:e,x:t,y:s}),xt(),xe.length>0&&(gt("down",n),n.preventDefault(),Qn(e)||n.stopImmediatePropagation())}function Mt(n){const{x:e,y:t}=kt(n);if(_e&&n.buttons===0&&(_e=!1,gt("up",n)),!_e){const{target:s}=n;Xt({target:s,x:e,y:t})}gt("move",n),Qt(),xe.length>0&&n.preventDefault()}function It(n){const{target:e}=n,{x:t,y:s}=kt(n);St.clear(),_e=!1,xe.length>0&&(n.preventDefault(),Qn(e)||n.stopImmediatePropagation()),gt("up",n),Xt({target:e,x:t,y:s}),Qt(),xt()}function Qn(n){let e=n;for(;e;){if(e.hasAttribute(se.resizeHandle))return!0;e=e.parentElement}return!1}function Xt({target:n,x:e,y:t}){xe.splice(0);let s=null;(n instanceof HTMLElement||n instanceof SVGElement)&&(s=n),Qe.forEach(r=>{const{element:i,hitAreaMargins:a}=r,o=i.getBoundingClientRect(),{bottom:c,left:d,right:f,top:u}=o,h=Ml?a.coarse:a.fine;if(e>=d-h&&e<=f+h&&t>=u-h&&t<=c+h){if(s!==null&&document.contains(s)&&i!==s&&!i.contains(s)&&!s.contains(i)&&El(s,i)>0){let p=s,g=!1;for(;p&&!p.contains(i);){if(Pl(p.getBoundingClientRect(),o)){g=!0;break}p=p.parentElement}if(g)return}xe.push(r)}})}function Lt(n,e){St.set(n,e)}function Qt(){let n=!1,e=!1;xe.forEach(s=>{const{direction:r}=s;r==="horizontal"?n=!0:e=!0});let t=0;St.forEach(s=>{t|=s}),n&&e?Ft("intersection",t):n?Ft("horizontal",t):e?Ft("vertical",t):Cl()}let Ot=new AbortController;function xt(){Ot.abort(),Ot=new AbortController;const n={capture:!0,signal:Ot.signal};Qe.size&&(_e?(xe.length>0&&Te.forEach((e,t)=>{const{body:s}=t;e>0&&(s.addEventListener("contextmenu",It,n),s.addEventListener("pointerleave",Mt,n),s.addEventListener("pointermove",Mt,n))}),window.addEventListener("pointerup",It,n),window.addEventListener("pointercancel",It,n)):Te.forEach((e,t)=>{const{body:s}=t;e>0&&(s.addEventListener("pointerdown",Ll,n),s.addEventListener("pointermove",Mt,n))}))}function gt(n,e){Qe.forEach(t=>{const{setResizeHandlerState:s}=t,r=xe.includes(t);s(n,r,e)})}function Ol(){const[n,e]=k.useState(0);return k.useCallback(()=>e(t=>t+1),[])}function V(n,e){if(!n)throw console.error(e),Error(e)}function Me(n,e,t=Gt){return n.toFixed(t)===e.toFixed(t)?0:n>e?1:-1}function je(n,e,t=Gt){return Me(n,e,t)===0}function me(n,e,t){return Me(n,e,t)===0}function Rl(n,e,t){if(n.length!==e.length)return!1;for(let s=0;s<n.length;s++){const r=n[s],i=e[s];if(!me(r,i,t))return!1}return!0}function Ae({panelConstraints:n,panelIndex:e,size:t}){const s=n[e];V(s!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:r=0,collapsible:i,maxSize:a=100,minSize:o=0}=s;if(Me(t,o)<0)if(i){const c=(r+o)/2;Me(t,c)<0?t=r:t=o}else t=o;return t=Math.min(a,t),t=parseFloat(t.toFixed(Gt)),t}function He({delta:n,initialLayout:e,panelConstraints:t,pivotIndices:s,prevLayout:r,trigger:i}){if(me(n,0))return e;const a=[...e],[o,c]=s;V(o!=null,"Invalid first pivot index"),V(c!=null,"Invalid second pivot index");let d=0;if(i==="keyboard"){{const u=n<0?c:o,h=t[u];V(h,`Panel constraints not found for index ${u}`);const{collapsedSize:m=0,collapsible:p,minSize:g=0}=h;if(p){const b=e[u];if(V(b!=null,`Previous layout not found for panel index ${u}`),me(b,m)){const x=g-b;Me(x,Math.abs(n))>0&&(n=n<0?0-x:x)}}}{const u=n<0?o:c,h=t[u];V(h,`No panel constraints found for index ${u}`);const{collapsedSize:m=0,collapsible:p,minSize:g=0}=h;if(p){const b=e[u];if(V(b!=null,`Previous layout not found for panel index ${u}`),me(b,g)){const x=b-m;Me(x,Math.abs(n))>0&&(n=n<0?0-x:x)}}}}{const u=n<0?1:-1;let h=n<0?c:o,m=0;for(;;){const g=e[h];V(g!=null,`Previous layout not found for panel index ${h}`);const x=Ae({panelConstraints:t,panelIndex:h,size:100})-g;if(m+=x,h+=u,h<0||h>=t.length)break}const p=Math.min(Math.abs(n),Math.abs(m));n=n<0?0-p:p}{let h=n<0?o:c;for(;h>=0&&h<t.length;){const m=Math.abs(n)-Math.abs(d),p=e[h];V(p!=null,`Previous layout not found for panel index ${h}`);const g=p-m,b=Ae({panelConstraints:t,panelIndex:h,size:g});if(!me(p,b)&&(d+=p-b,a[h]=b,d.toPrecision(3).localeCompare(Math.abs(n).toPrecision(3),void 0,{numeric:!0})>=0))break;n<0?h--:h++}}if(Rl(r,a))return r;{const u=n<0?c:o,h=e[u];V(h!=null,`Previous layout not found for panel index ${u}`);const m=h+d,p=Ae({panelConstraints:t,panelIndex:u,size:m});if(a[u]=p,!me(p,m)){let g=m-p,x=n<0?c:o;for(;x>=0&&x<t.length;){const y=a[x];V(y!=null,`Previous layout not found for panel index ${x}`);const j=y+g,N=Ae({panelConstraints:t,panelIndex:x,size:j});if(me(y,N)||(g-=N-y,a[x]=N),me(g,0))break;n>0?x--:x++}}}const f=a.reduce((u,h)=>h+u,0);return me(f,100)?a:r}function Al({layout:n,panelsArray:e,pivotIndices:t}){let s=0,r=100,i=0,a=0;const o=t[0];V(o!=null,"No pivot index found"),e.forEach((u,h)=>{const{constraints:m}=u,{maxSize:p=100,minSize:g=0}=m;h===o?(s=g,r=p):(i+=g,a+=p)});const c=Math.min(r,100-i),d=Math.max(s,100-a),f=n[o];return{valueMax:c,valueMin:d,valueNow:f}}function Ye(n,e=document){return Array.from(e.querySelectorAll(`[${se.resizeHandleId}][data-panel-group-id="${n}"]`))}function Yn(n,e,t=document){const r=Ye(n,t).findIndex(i=>i.getAttribute(se.resizeHandleId)===e);return r??null}function Jn(n,e,t){const s=Yn(n,e,t);return s!=null?[s,s+1]:[-1,-1]}function Zn(n,e=document){var t;if(e instanceof HTMLElement&&(e==null||(t=e.dataset)===null||t===void 0?void 0:t.panelGroupId)==n)return e;const s=e.querySelector(`[data-panel-group][data-panel-group-id="${n}"]`);return s||null}function Nt(n,e=document){const t=e.querySelector(`[${se.resizeHandleId}="${n}"]`);return t||null}function _l(n,e,t,s=document){var r,i,a,o;const c=Nt(e,s),d=Ye(n,s),f=c?d.indexOf(c):-1,u=(r=(i=t[f])===null||i===void 0?void 0:i.id)!==null&&r!==void 0?r:null,h=(a=(o=t[f+1])===null||o===void 0?void 0:o.id)!==null&&a!==void 0?a:null;return[u,h]}function Ul({committedValuesRef:n,eagerValuesRef:e,groupId:t,layout:s,panelDataArray:r,panelGroupElement:i,setLayout:a}){k.useRef({didWarnAboutMissingResizeHandle:!1}),Fe(()=>{if(!i)return;const o=Ye(t,i);for(let c=0;c<r.length-1;c++){const{valueMax:d,valueMin:f,valueNow:u}=Al({layout:s,panelsArray:r,pivotIndices:[c,c+1]}),h=o[c];if(h!=null){const m=r[c];V(m,`No panel data found for index "${c}"`),h.setAttribute("aria-controls",m.id),h.setAttribute("aria-valuemax",""+Math.round(d)),h.setAttribute("aria-valuemin",""+Math.round(f)),h.setAttribute("aria-valuenow",u!=null?""+Math.round(u):"")}}return()=>{o.forEach((c,d)=>{c.removeAttribute("aria-controls"),c.removeAttribute("aria-valuemax"),c.removeAttribute("aria-valuemin"),c.removeAttribute("aria-valuenow")})}},[t,s,r,i]),k.useEffect(()=>{if(!i)return;const o=e.current;V(o,"Eager values not found");const{panelDataArray:c}=o,d=Zn(t,i);V(d!=null,`No group found for id "${t}"`);const f=Ye(t,i);V(f,`No resize handles found for group id "${t}"`);const u=f.map(h=>{const m=h.getAttribute(se.resizeHandleId);V(m,"Resize handle element has no handle id attribute");const[p,g]=_l(t,m,c,i);if(p==null||g==null)return()=>{};const b=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const y=c.findIndex(j=>j.id===p);if(y>=0){const j=c[y];V(j,`No panel data found for index ${y}`);const N=s[y],{collapsedSize:z=0,collapsible:C,minSize:w=0}=j.constraints;if(N!=null&&C){const M=He({delta:me(N,z)?w-z:z-N,initialLayout:s,panelConstraints:c.map(I=>I.constraints),pivotIndices:Jn(t,m,i),prevLayout:s,trigger:"keyboard"});s!==M&&a(M)}}break}}};return h.addEventListener("keydown",b),()=>{h.removeEventListener("keydown",b)}});return()=>{u.forEach(h=>h())}},[i,n,e,t,s,r,a])}function on(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}function es(n,e){const t=n==="horizontal",{x:s,y:r}=kt(e);return t?s:r}function Bl(n,e,t,s,r){const i=t==="horizontal",a=Nt(e,r);V(a,`No resize handle element found for id "${e}"`);const o=a.getAttribute(se.groupId);V(o,"Resize handle element has no group id attribute");let{initialCursorPosition:c}=s;const d=es(t,n),f=Zn(o,r);V(f,`No group element found for id "${o}"`);const u=f.getBoundingClientRect(),h=i?u.width:u.height;return(d-c)/h*100}function Hl(n,e,t,s,r,i){if(Bn(n)){const a=t==="horizontal";let o=0;n.shiftKey?o=100:r!=null?o=r:o=10;let c=0;switch(n.key){case"ArrowDown":c=a?0:o;break;case"ArrowLeft":c=a?-o:0;break;case"ArrowRight":c=a?o:0;break;case"ArrowUp":c=a?0:-o;break;case"End":c=100;break;case"Home":c=-100;break}return c}else return s==null?0:Bl(n,e,t,s,i)}function ql({panelDataArray:n}){const e=Array(n.length),t=n.map(i=>i.constraints);let s=0,r=100;for(let i=0;i<n.length;i++){const a=t[i];V(a,`Panel constraints not found for index ${i}`);const{defaultSize:o}=a;o!=null&&(s++,e[i]=o,r-=o)}for(let i=0;i<n.length;i++){const a=t[i];V(a,`Panel constraints not found for index ${i}`);const{defaultSize:o}=a;if(o!=null)continue;const c=n.length-s,d=r/c;s++,e[i]=d,r-=d}return e}function Ie(n,e,t){e.forEach((s,r)=>{const i=n[r];V(i,`Panel data not found for index ${r}`);const{callbacks:a,constraints:o,id:c}=i,{collapsedSize:d=0,collapsible:f}=o,u=t[c];if(u==null||s!==u){t[c]=s;const{onCollapse:h,onExpand:m,onResize:p}=a;p&&p(s,u),f&&(h||m)&&(m&&(u==null||je(u,d))&&!je(s,d)&&m(),h&&(u==null||!je(u,d))&&je(s,d)&&h())}})}function ut(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t])return!1;return!0}function Kl({defaultSize:n,dragState:e,layout:t,panelData:s,panelIndex:r,precision:i=3}){const a=t[r];let o;return a==null?o=n!=null?n.toPrecision(i):"1":s.length===1?o="1":o=a.toPrecision(i),{flexBasis:0,flexGrow:o,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function Wl(n,e=10){let t=null;return(...r)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{n(...r)},e)}}function cn(n){try{if(typeof localStorage<"u")n.getItem=e=>localStorage.getItem(e),n.setItem=(e,t)=>{localStorage.setItem(e,t)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),n.getItem=()=>null,n.setItem=()=>{}}}function ts(n){return`react-resizable-panels:${n}`}function ns(n){return n.map(e=>{const{constraints:t,id:s,idIsFromProps:r,order:i}=e;return r?s:i?`${i}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(",")}function ss(n,e){try{const t=ts(n),s=e.getItem(t);if(s){const r=JSON.parse(s);if(typeof r=="object"&&r!=null)return r}}catch{}return null}function Gl(n,e,t){var s,r;const i=(s=ss(n,t))!==null&&s!==void 0?s:{},a=ns(e);return(r=i[a])!==null&&r!==void 0?r:null}function Vl(n,e,t,s,r){var i;const a=ts(n),o=ns(e),c=(i=ss(n,r))!==null&&i!==void 0?i:{};c[o]={expandToSizes:Object.fromEntries(t.entries()),layout:s};try{r.setItem(a,JSON.stringify(c))}catch(d){console.error(d)}}function dn({layout:n,panelConstraints:e}){const t=[...n],s=t.reduce((i,a)=>i+a,0);if(t.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${t.map(i=>`${i}%`).join(", ")}`);if(!me(s,100)&&t.length>0)for(let i=0;i<e.length;i++){const a=t[i];V(a!=null,`No layout data found for index ${i}`);const o=100/s*a;t[i]=o}let r=0;for(let i=0;i<e.length;i++){const a=t[i];V(a!=null,`No layout data found for index ${i}`);const o=Ae({panelConstraints:e,panelIndex:i,size:a});a!=o&&(r+=a-o,t[i]=o)}if(!me(r,0))for(let i=0;i<e.length;i++){const a=t[i];V(a!=null,`No layout data found for index ${i}`);const o=a+r,c=Ae({panelConstraints:e,panelIndex:i,size:o});if(a!==c&&(r-=c-a,t[i]=c,me(r,0)))break}return t}const Xl=100,qe={getItem:n=>(cn(qe),qe.getItem(n)),setItem:(n,e)=>{cn(qe),qe.setItem(n,e)}},un={};function ls({autoSaveId:n=null,children:e,className:t="",direction:s,forwardedRef:r,id:i=null,onLayout:a=null,keyboardResizeBy:o=null,storage:c=qe,style:d,tagName:f="div",...u}){const h=Vt(i),m=k.useRef(null),[p,g]=k.useState(null),[b,x]=k.useState([]),y=Ol(),j=k.useRef({}),N=k.useRef(new Map),z=k.useRef(0),C=k.useRef({autoSaveId:n,direction:s,dragState:p,id:h,keyboardResizeBy:o,onLayout:a,storage:c}),w=k.useRef({layout:b,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:O}=C.current,{layout:R,panelDataArray:U}=w.current,T=dn({layout:S,panelConstraints:U.map(H=>H.constraints)});on(R,T)||(x(T),w.current.layout=T,O&&O(T),Ie(U,T,j.current))}}),[]),Fe(()=>{C.current.autoSaveId=n,C.current.direction=s,C.current.dragState=p,C.current.id=h,C.current.onLayout=a,C.current.storage=c}),Ul({committedValuesRef:C,eagerValuesRef:w,groupId:h,layout:b,panelDataArray:w.current.panelDataArray,setLayout:x,panelGroupElement:m.current}),k.useEffect(()=>{const{panelDataArray:S}=w.current;if(n){if(b.length===0||b.length!==S.length)return;let O=un[n];O==null&&(O=Wl(Vl,Xl),un[n]=O);const R=[...S],U=new Map(N.current);O(n,R,U,b,c)}},[n,b,c]),k.useEffect(()=>{});const M=k.useCallback(S=>{const{onLayout:O}=C.current,{layout:R,panelDataArray:U}=w.current;if(S.constraints.collapsible){const T=U.map(fe=>fe.constraints),{collapsedSize:H=0,panelSize:Y,pivotIndices:te}=De(U,S,R);if(V(Y!=null,`Panel size not found for panel "${S.id}"`),!je(Y,H)){N.current.set(S.id,Y);const E=Oe(U,S)===U.length-1?Y-H:H-Y,X=He({delta:E,initialLayout:R,panelConstraints:T,pivotIndices:te,prevLayout:R,trigger:"imperative-api"});ut(R,X)||(x(X),w.current.layout=X,O&&O(X),Ie(U,X,j.current))}}},[]),I=k.useCallback((S,O)=>{const{onLayout:R}=C.current,{layout:U,panelDataArray:T}=w.current;if(S.constraints.collapsible){const H=T.map(ne=>ne.constraints),{collapsedSize:Y=0,panelSize:te=0,minSize:fe=0,pivotIndices:E}=De(T,S,U),X=O??fe;if(je(te,Y)){const ne=N.current.get(S.id),ge=ne!=null&&ne>=X?ne:X,Pe=Oe(T,S)===T.length-1?te-ge:ge-te,ae=He({delta:Pe,initialLayout:U,panelConstraints:H,pivotIndices:E,prevLayout:U,trigger:"imperative-api"});ut(U,ae)||(x(ae),w.current.layout=ae,R&&R(ae),Ie(T,ae,j.current))}}},[]),F=k.useCallback(S=>{const{layout:O,panelDataArray:R}=w.current,{panelSize:U}=De(R,S,O);return V(U!=null,`Panel size not found for panel "${S.id}"`),U},[]),v=k.useCallback((S,O)=>{const{panelDataArray:R}=w.current,U=Oe(R,S);return Kl({defaultSize:O,dragState:p,layout:b,panelData:R,panelIndex:U})},[p,b]),P=k.useCallback(S=>{const{layout:O,panelDataArray:R}=w.current,{collapsedSize:U=0,collapsible:T,panelSize:H}=De(R,S,O);return V(H!=null,`Panel size not found for panel "${S.id}"`),T===!0&&je(H,U)},[]),W=k.useCallback(S=>{const{layout:O,panelDataArray:R}=w.current,{collapsedSize:U=0,collapsible:T,panelSize:H}=De(R,S,O);return V(H!=null,`Panel size not found for panel "${S.id}"`),!T||Me(H,U)>0},[]),A=k.useCallback(S=>{const{panelDataArray:O}=w.current;O.push(S),O.sort((R,U)=>{const T=R.order,H=U.order;return T==null&&H==null?0:T==null?-1:H==null?1:T-H}),w.current.panelDataArrayChanged=!0,y()},[y]);Fe(()=>{if(w.current.panelDataArrayChanged){w.current.panelDataArrayChanged=!1;const{autoSaveId:S,onLayout:O,storage:R}=C.current,{layout:U,panelDataArray:T}=w.current;let H=null;if(S){const te=Gl(S,T,R);te&&(N.current=new Map(Object.entries(te.expandToSizes)),H=te.layout)}H==null&&(H=ql({panelDataArray:T}));const Y=dn({layout:H,panelConstraints:T.map(te=>te.constraints)});on(U,Y)||(x(Y),w.current.layout=Y,O&&O(Y),Ie(T,Y,j.current))}}),Fe(()=>{const S=w.current;return()=>{S.layout=[]}},[]);const _=k.useCallback(S=>{let O=!1;const R=m.current;return R&&window.getComputedStyle(R,null).getPropertyValue("direction")==="rtl"&&(O=!0),function(T){T.preventDefault();const H=m.current;if(!H)return()=>null;const{direction:Y,dragState:te,id:fe,keyboardResizeBy:E,onLayout:X}=C.current,{layout:ne,panelDataArray:ge}=w.current,{initialLayout:Ne}=te??{},Pe=Jn(fe,S,H);let ae=Hl(T,S,Y,te,E,H);const ot=Y==="horizontal";ot&&O&&(ae=-ae);const Et=ge.map(Dt=>Dt.constraints),Ee=He({delta:ae,initialLayout:Ne??ne,panelConstraints:Et,pivotIndices:Pe,prevLayout:ne,trigger:Bn(T)?"keyboard":"mouse-or-touch"}),ct=!ut(ne,Ee);(Hn(T)||qn(T))&&z.current!=ae&&(z.current=ae,!ct&&ae!==0?ot?Lt(S,ae<0?Wn:Gn):Lt(S,ae<0?Vn:Xn):Lt(S,0)),ct&&(x(Ee),w.current.layout=Ee,X&&X(Ee),Ie(ge,Ee,j.current))}},[]),B=k.useCallback((S,O)=>{const{onLayout:R}=C.current,{layout:U,panelDataArray:T}=w.current,H=T.map(ne=>ne.constraints),{panelSize:Y,pivotIndices:te}=De(T,S,U);V(Y!=null,`Panel size not found for panel "${S.id}"`);const E=Oe(T,S)===T.length-1?Y-O:O-Y,X=He({delta:E,initialLayout:U,panelConstraints:H,pivotIndices:te,prevLayout:U,trigger:"imperative-api"});ut(U,X)||(x(X),w.current.layout=X,R&&R(X),Ie(T,X,j.current))},[]),G=k.useCallback((S,O)=>{const{layout:R,panelDataArray:U}=w.current,{collapsedSize:T=0,collapsible:H}=O,{collapsedSize:Y=0,collapsible:te,maxSize:fe=100,minSize:E=0}=S.constraints,{panelSize:X}=De(U,S,R);X!=null&&(H&&te&&je(X,T)?je(T,Y)||B(S,Y):X<E?B(S,E):X>fe&&B(S,fe))},[B]),q=k.useCallback((S,O)=>{const{direction:R}=C.current,{layout:U}=w.current;if(!m.current)return;const T=Nt(S,m.current);V(T,`Drag handle element not found for id "${S}"`);const H=es(R,O);g({dragHandleId:S,dragHandleRect:T.getBoundingClientRect(),initialCursorPosition:H,initialLayout:U})},[]),ee=k.useCallback(()=>{g(null)},[]),Z=k.useCallback(S=>{const{panelDataArray:O}=w.current,R=Oe(O,S);R>=0&&(O.splice(R,1),delete j.current[S.id],w.current.panelDataArrayChanged=!0,y())},[y]),L=k.useMemo(()=>({collapsePanel:M,direction:s,dragState:p,expandPanel:I,getPanelSize:F,getPanelStyle:v,groupId:h,isPanelCollapsed:P,isPanelExpanded:W,reevaluatePanelConstraints:G,registerPanel:A,registerResizeHandle:_,resizePanel:B,startDragging:q,stopDragging:ee,unregisterPanel:Z,panelGroupElement:m.current}),[M,p,s,I,F,v,h,P,W,G,A,_,B,q,ee,Z]),K={display:"flex",flexDirection:s==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return k.createElement(jt.Provider,{value:L},k.createElement(f,{...u,children:e,className:t,id:i,ref:m,style:{...K,...d},[se.group]:"",[se.groupDirection]:s,[se.groupId]:h}))}const rs=k.forwardRef((n,e)=>k.createElement(ls,{...n,forwardedRef:e}));ls.displayName="PanelGroup";rs.displayName="forwardRef(PanelGroup)";function Oe(n,e){return n.findIndex(t=>t===e||t.id===e.id)}function De(n,e,t){const s=Oe(n,e),i=s===n.length-1?[s-1,s]:[s,s+1],a=t[s];return{...e.constraints,panelSize:a,pivotIndices:i}}function Ql({disabled:n,handleId:e,resizeHandler:t,panelGroupElement:s}){k.useEffect(()=>{if(n||t==null||s==null)return;const r=Nt(e,s);if(r==null)return;const i=a=>{if(!a.defaultPrevented)switch(a.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{a.preventDefault(),t(a);break}case"F6":{a.preventDefault();const o=r.getAttribute(se.groupId);V(o,`No group element found for id "${o}"`);const c=Ye(o,s),d=Yn(o,e,s);V(d!==null,`No resize element found for id "${e}"`);const f=a.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)}},[s,n,e,t])}function is({children:n=null,className:e="",disabled:t=!1,hitAreaMargins:s,id:r,onBlur:i,onClick:a,onDragging:o,onFocus:c,onPointerDown:d,onPointerUp:f,style:u={},tabIndex:h=0,tagName:m="div",...p}){var g,b;const x=k.useRef(null),y=k.useRef({onClick:a,onDragging:o,onPointerDown:d,onPointerUp:f});k.useEffect(()=>{y.current.onClick=a,y.current.onDragging=o,y.current.onPointerDown=d,y.current.onPointerUp=f});const j=k.useContext(jt);if(j===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:N,groupId:z,registerResizeHandle:C,startDragging:w,stopDragging:M,panelGroupElement:I}=j,F=Vt(r),[v,P]=k.useState("inactive"),[W,A]=k.useState(!1),[_,B]=k.useState(null),G=k.useRef({state:v});Fe(()=>{G.current.state=v}),k.useEffect(()=>{if(t)B(null);else{const L=C(F);B(()=>L)}},[t,F,C]);const q=(g=s?.coarse)!==null&&g!==void 0?g:15,ee=(b=s?.fine)!==null&&b!==void 0?b:5;k.useEffect(()=>{if(t||_==null)return;const L=x.current;V(L,"Element ref not attached");let K=!1;return Il(F,L,N,{coarse:q,fine:ee},(O,R,U)=>{if(!R){P("inactive");return}switch(O){case"down":{P("drag"),K=!1,V(U,'Expected event to be defined for "down" action'),w(F,U);const{onDragging:T,onPointerDown:H}=y.current;T?.(!0),H?.();break}case"move":{const{state:T}=G.current;K=!0,T!=="drag"&&P("hover"),V(U,'Expected event to be defined for "move" action'),_(U);break}case"up":{P("hover"),M();const{onClick:T,onDragging:H,onPointerUp:Y}=y.current;H?.(!1),Y?.(),K||T?.();break}}})},[q,N,t,ee,C,F,_,w,M]),Ql({disabled:t,handleId:F,resizeHandler:_,panelGroupElement:I});const Z={touchAction:"none",userSelect:"none"};return k.createElement(m,{...p,children:n,className:e,id:r,onBlur:()=>{A(!1),i?.()},onFocus:()=>{A(!0),c?.()},ref:x,role:"separator",style:{...Z,...u},tabIndex:h,[se.groupDirection]:N,[se.groupId]:z,[se.resizeHandle]:"",[se.resizeHandleActive]:v==="drag"?"pointer":W?"keyboard":void 0,[se.resizeHandleEnabled]:!t,[se.resizeHandleId]:F,[se.resizeHandleState]:v})}is.displayName="PanelResizeHandle";function Yl(n){const e=$.c(10);let t,s,r;e[0]!==n?({className:t,ref:r,...s}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=r):(t=e[1],s=e[2],r=e[3]);let i;e[4]!==t?(i=de("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),e[4]=t,e[5]=i):i=e[5];let a;return e[6]!==s||e[7]!==r||e[8]!==i?(a=l.jsx(rs,{ref:r,"data-slot":"resizable-panel-group",className:i,...s}),e[6]=s,e[7]=r,e[8]=i,e[9]=a):a=e[9],a}function fn(n){const e=$.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let s;return e[2]!==t?(s=l.jsx(Un,{"data-slot":"resizable-panel",...t}),e[2]=t,e[3]=s):s=e[3],s}function Jl(n){const e=$.c(12);let t,s,r;e[0]!==n?({withHandle:r,className:t,...s}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=r):(t=e[1],s=e[2],r=e[3]);let i;e[4]!==t?(i=de("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",t),e[4]=t,e[5]=i):i=e[5];let a;e[6]!==r?(a=r&&l.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:l.jsx(Ds,{className:"size-2.5"})}),e[6]=r,e[7]=a):a=e[7];let o;return e[8]!==s||e[9]!==i||e[10]!==a?(o=l.jsx(is,{"data-slot":"resizable-handle",className:i,...s,children:a}),e[8]=s,e[9]=i,e[10]=a,e[11]=o):o=e[11],o}function Zl(n){if(!n||n.includes("\\")||n.includes("..")||n.includes("\0"))return!0;try{const e=decodeURIComponent(n);if(e.includes("\\")||e.includes("..")||e.includes("\0"))return!0;if(e!==n&&e.includes("/")){const t=(n.match(/\//g)??[]).length;if((e.match(/\//g)??[]).length>t)return!0}return!1}catch{return!0}}function er(n){if(Zl(n))throw new Error(`Invalid block key: ${n||"(empty)"}`)}function tr(n){try{return decodeURIComponent(n)}catch{return n}}function nr(n){return er(n),encodeURIComponent(n)}function sr(n){return`.deco/blocks/${nr(n)}.json`}function Ma(n){return`/${sr(n)}`}const Ia=1e4,lr=3;function Ut(n){return n.trim()?(n.startsWith("/")?n:`/${n}`).replace(/\/+/g,"/"):"/"}function Yt(n){return n.startsWith("/")?n.slice(1):n}function bt(n){return n.trim()?n.startsWith("/")?n:`/${n}`:"/"}function rr(n){const e=bt(n);if(e==="/")return"/";const t=e.split("/").filter(Boolean);return t.pop(),t.length===0?"/":`/${t.join("/")}`}function La(n,e){const t=e.replace(/^\/+|\/+$/g,"");return bt(t?`${n==="/"?"":n}/${t}`:n)}function Oa(n,e){return e==="directory"?n:rr(n)}function Ra(n){const e=n.trim();return e?e.includes("/")||e.includes("\\")||e.includes("..")||e.includes("\0")?"Name cannot contain /, \\, or ..":null:"Name is required"}function ir(n){const e=Yt(n);return e?e.split("/").filter(Boolean).length:0}function Aa(n,e,t,s=!1){return{files:[...new Set([...n,...t.files])],directories:[...new Set([...e,...t.directories??[]])],truncated:s||!!t.truncated}}function _a(n,e){return ir(n)>=lr&&!e.has(n)}function Ua(n,e,t=[]){const s=Yt(n);if(e.includes(s)||t.includes(s))return!0;if(!s)return!1;const r=`${s}/`;return e.some(i=>i.startsWith(r))||t.some(i=>i.startsWith(r))}function Ba(n){const e=Yt(n),t=".deco/blocks/";if(!e.startsWith(t)||!e.endsWith(".json"))return null;const s=e.slice(t.length,-5);return tr(s)}function ar(n){if(!n)return"plaintext";const e=n.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 Ha(n){const e=Ut(n).split("/").filter(Boolean),t=["/"];let s="";for(const r of e.slice(0,-1))s+=`/${r}`,t.push(s);return t}function qa(n,e=[]){const t={children:[]},s=i=>{const o=Ut(i).split("/").filter(Boolean);let c=t,d="";for(const f of o){d+=`/${f}`;let u=c.children.find(h=>h.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 n){const o=Ut(i).split("/").filter(Boolean);let c=t,d="";o.forEach((f,u)=>{d+=`/${f}`;const h=u===o.length-1;let m=c.children.find(p=>p.name===f);m||(m={name:f,path:d,kind:h?"file":"directory",children:[]},c.children.push(m)),c=m})}for(const i of e)s(bt(i));const r=i=>{i.sort((a,o)=>a.kind!==o.kind?a.kind==="directory"?-1:1:a.name.localeCompare(o.name));for(const a of i)a.children.length>0&&r(a.children)};return r(t.children),t.children}function or(n,e,t=0){const s=[];for(const r of n)r.name!==".gitkeep"&&(s.push({node:r,depth:t}),r.kind==="directory"&&r.children.length>0&&e.has(r.path)&&s.push(...or(r.children,e,t+1)));return s}function Ka(n){return n.split(`
2
2
  `).map(e=>{const t=e.match(/^\d+\t(.*)/);return t?t[1]:e}).join(`
3
3
  `)}al.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function cr(n){const e=$.c(11),{value:t,filename:s}=n,[r]=Ns(),i=r.theme==="dark"||r.theme==="system"&&typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;let a;e[0]!==s?(a=ar(s),e[0]=s,e[1]=a):a=e[1];const o=i?"vs-dark":"light";let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=l.jsx("div",{className:"flex h-full w-full items-center justify-center",children:l.jsx(zs,{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 h;return e[6]!==s||e[7]!==a||e[8]!==o||e[9]!==t?(h=l.jsx(ol,{path:s,language:a,value:t,theme:o,loading:c,options:u},s),e[6]=s,e[7]=a,e[8]=o,e[9]=t,e[10]=h):h=e[10],h}function as(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}const dr=new Set(["png","jpg","jpeg","gif","webp","svg","avif"]),ur=new Set(["txt","json","csv","tsv","log","yaml","yml","xml","toml","ts","tsx","js","jsx","py","rb","go","rs","java","sh","sql"]),hn=2*1024*1024;function fr(n,e){const t=n.split(".").pop()?.toLowerCase()??"";return dr.has(t)?"image":t==="pdf"?"pdf":t==="html"||t==="htm"?"html":t==="md"||t==="markdown"?e<=hn?"markdown":"download":ur.has(t)&&e<=hn?"text":"download"}function os(){const n=$.c(2);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx(oe,{className:"h-6 w-2/3"}),n[0]=e):e=n[0];let t;return n[1]===Symbol.for("react.memo_cache_sentinel")?(t=l.jsx("div",{className:"flex h-full w-full items-center justify-center",children:l.jsxs("div",{className:"flex w-3/4 max-w-md flex-col gap-3 p-6",children:[e,l.jsxs("div",{className:"flex flex-col gap-1.5",children:[l.jsx(oe,{className:"h-3 w-full"}),l.jsx(oe,{className:"h-3 w-5/6"}),l.jsx(oe,{className:"h-3 w-2/3"})]})]})}),n[1]=t):t=n[1],t}function cs(n){const e=$.c(20),{file:t,note:s}=n;let r;e[0]!==t.filename?(r=l.jsx(Se,{filename:t.filename,className:"h-12 w-10"}),e[0]=t.filename,e[1]=r):r=e[1];let i;e[2]!==t.filename?(i=l.jsx("span",{className:"text-sm font-medium text-foreground",children:t.filename}),e[2]=t.filename,e[3]=i):i=e[3];let a;e[4]!==t.size?(a=as(t.size),e[4]=t.size,e[5]=a):a=e[5];const o=s?` · ${s}`:"";let c;e[6]!==a||e[7]!==o?(c=l.jsxs("span",{className:"text-xs text-muted-foreground",children:[a,o]}),e[6]=a,e[7]=o,e[8]=c):c=e[8];let d;e[9]!==i||e[10]!==c?(d=l.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=l.jsx(Ve,{size:14}),e[12]=f):f=e[12];let u;e[13]!==t.downloadUrl||e[14]!==t.filename?(u=l.jsx(J,{asChild:!0,variant:"outline",size:"sm",children:l.jsxs("a",{href:t.downloadUrl,download:t.filename,children:[f,"Download"]})}),e[13]=t.downloadUrl,e[14]=t.filename,e[15]=u):u=e[15];let h;return e[16]!==r||e[17]!==d||e[18]!==u?(h=l.jsx("div",{className:"flex h-full w-full items-center justify-center",children:l.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]=h):h=e[19],h}function mn(n){const e=$.c(16),{file:t,markdown:s}=n;let r;e[0]!==t.downloadUrl?(r=Q.fileText(t.downloadUrl),e[0]=t.downloadUrl,e[1]=r):r=e[1];let i;e[2]!==t.downloadUrl?(i=async()=>{const u=await fetch(t.downloadUrl,{credentials:"include"});if(!u.ok)throw new Error(`fetch failed: ${u.status}`);return u.text()},e[2]=t.downloadUrl,e[3]=i):i=e[3];let a;e[4]!==r||e[5]!==i?(a={queryKey:r,queryFn:i,staleTime:6e4,retry:!1},e[4]=r,e[5]=i,e[6]=a):a=e[6];const{data:o,isPending:c,isError:d}=ie(a);if(c){let u;return e[7]===Symbol.for("react.memo_cache_sentinel")?(u=l.jsx(os,{}),e[7]=u):u=e[7],u}if(d||o===void 0){let u;return e[8]!==t?(u=l.jsx(cs,{file:t,note:"preview unavailable"}),e[8]=t,e[9]=u):u=e[9],u}if(s){const u=`file-preview-${t.key}`;let h;return e[10]!==o||e[11]!==u?(h=l.jsx("div",{className:"h-full overflow-y-auto",children:l.jsx("div",{className:"prose prose-sm dark:prose-invert mx-auto max-w-3xl px-6 py-6",children:l.jsx(Kt,{id:u,text:o})})}),e[10]=o,e[11]=u,e[12]=h):h=e[12],h}let f;return e[13]!==o||e[14]!==t.filename?(f=l.jsx(cr,{value:o,filename:t.filename}),e[13]=o,e[14]=t.filename,e[15]=f):f=e[15],f}function ds(n){const e=$.c(15),{file:t}=n;switch(fr(t.filename,t.size)){case"image":{let r;return e[0]!==t.downloadUrl||e[1]!==t.filename?(r=l.jsx("div",{className:"flex h-full w-full items-center justify-center overflow-auto bg-muted/30 p-4",children:l.jsx("img",{src:t.downloadUrl,alt:t.filename,className:"max-h-full max-w-full rounded-lg object-contain"})}),e[0]=t.downloadUrl,e[1]=t.filename,e[2]=r):r=e[2],r}case"pdf":{let r;return e[3]!==t.downloadUrl||e[4]!==t.filename?(r=l.jsx("iframe",{src:t.downloadUrl,title:t.filename,className:"block h-full w-full bg-white"}),e[3]=t.downloadUrl,e[4]=t.filename,e[5]=r):r=e[5],r}case"html":{let r;return e[6]!==t.downloadUrl||e[7]!==t.filename?(r=l.jsx("iframe",{src:t.downloadUrl,title:t.filename,sandbox:"allow-scripts",className:"block h-full w-full bg-white"}),e[6]=t.downloadUrl,e[7]=t.filename,e[8]=r):r=e[8],r}case"markdown":{let r;return e[9]!==t?(r=l.jsx(mn,{file:t,markdown:!0}),e[9]=t,e[10]=r):r=e[10],r}case"text":{let r;return e[11]!==t?(r=l.jsx(mn,{file:t,markdown:!1}),e[11]=t,e[12]=r):r=e[12],r}default:{let r;return e[13]!==t?(r=l.jsx(cs,{file:t}),e[13]=t,e[14]=r):r=e[14],r}}}function hr(n){const e=$.c(40),{readUrl:t,editor:s,downloadName:r,trailing:i}=n;let a;e[0]!==t?(a=new URL(t,window.location.origin).toString(),e[0]=t,e[1]=a):a=e[1];const o=a;let c;e[2]!==s?(c=s.deckDetected&&l.jsxs(ye,{children:[l.jsx(ve,{asChild:!0,children:l.jsx(J,{variant:s.railOpen?"secondary":"ghost",size:"icon","aria-label":s.railOpen?"Hide slide list":"Show slide list",onClick:()=>s.setRailOpen(!s.railOpen),children:l.jsx(cl,{size:14})})}),l.jsx(we,{side:"bottom",children:s.railOpen?"Hide slide list":"Show slide list"})]}),e[2]=s,e[3]=c):c=e[3];let d;e[4]!==o?(d=()=>window.open(o,"_blank","noopener"),e[4]=o,e[5]=d):d=e[5];let f;e[6]!==o?(f=l.jsx("span",{className:"truncate",children:o}),e[6]=o,e[7]=f):f=e[7];let u;e[8]!==o||e[9]!==d||e[10]!==f?(u=l.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:o,children:f}),e[8]=o,e[9]=d,e[10]=f,e[11]=u):u=e[11];let h;e[12]!==s.agentUpdated||e[13]!==s.reload?(h=s.agentUpdated&&l.jsxs(ye,{children:[l.jsx(ve,{asChild:!0,children:l.jsxs(J,{variant:"outline",size:"sm",className:"h-7 gap-1 text-xs",onClick:s.reload,children:[l.jsx(Sn,{size:12}),"Agent updated — reload"]})}),l.jsx(we,{side:"bottom",children:"The agent rewrote this deck while you were editing. Reloading discards unsaved differences."})]}),e[12]=s.agentUpdated,e[13]=s.reload,e[14]=h):h=e[14];let m;e[15]!==s.saving?(m=s.saving&&l.jsx("span",{className:"px-1 text-xs text-muted-foreground",children:"Saving…"}),e[15]=s.saving,e[16]=m):m=e[16];let p;e[17]!==s?(p=s.deckDetected&&s.writable&&l.jsxs(ye,{children:[l.jsx(ve,{asChild:!0,children:l.jsx(J,{variant:s.editMode?"secondary":"ghost",size:"icon","aria-label":s.editMode?"Done editing":"Edit inline",className:de(s.editMode&&"text-primary"),onClick:()=>s.setEditMode(!s.editMode),children:l.jsx(Ts,{size:14})})}),l.jsx(we,{side:"bottom",children:s.editMode?"Done editing":"Edit inline (text, reorder, delete)"})]}),e[17]=s,e[18]=p):p=e[18];let g;e[19]!==o||e[20]!==r||e[21]!==s.deckDetected?(g=s.deckDetected?l.jsxs(tt,{children:[l.jsx(nt,{asChild:!0,children:l.jsx(J,{variant:"ghost",size:"icon","aria-label":"Download",children:l.jsx(Ve,{size:14})})}),l.jsxs(st,{align:"end",children:[l.jsxs(be,{onClick:()=>window.open(`${o}#print`,"_blank","noopener"),children:[l.jsx(Fs,{size:14}),"Export as PDF"]}),l.jsx(be,{asChild:!0,children:l.jsxs("a",{href:o,download:r,children:[l.jsx(Ms,{size:14}),"Download HTML"]})})]})]}):l.jsxs(ye,{children:[l.jsx(ve,{asChild:!0,children:l.jsx(J,{variant:"ghost",size:"icon","aria-label":"Download",asChild:!0,children:l.jsx("a",{href:o,download:r,children:l.jsx(Ve,{size:14})})})}),l.jsx(we,{side:"bottom",children:"Download"})]}),e[19]=o,e[20]=r,e[21]=s.deckDetected,e[22]=g):g=e[22];let b;e[23]!==o?(b=()=>window.open(o,"_blank","noopener"),e[23]=o,e[24]=b):b=e[24];let x;e[25]===Symbol.for("react.memo_cache_sentinel")?(x=l.jsx(In,{size:14}),e[25]=x):x=e[25];let y;e[26]!==b?(y=l.jsx(ve,{asChild:!0,children:l.jsx(J,{variant:"ghost",size:"icon","aria-label":"Open in new tab",onClick:b,children:x})}),e[26]=b,e[27]=y):y=e[27];let j;e[28]===Symbol.for("react.memo_cache_sentinel")?(j=l.jsx(we,{side:"bottom",children:"Open in new tab"}),e[28]=j):j=e[28];let N;e[29]!==y?(N=l.jsxs(ye,{children:[y,j]}),e[29]=y,e[30]=N):N=e[30];let z;return e[31]!==N||e[32]!==c||e[33]!==u||e[34]!==h||e[35]!==m||e[36]!==p||e[37]!==g||e[38]!==i?(z=l.jsxs("div",{className:"flex h-9 shrink-0 items-center gap-1 border-b border-border/60 px-2",children:[c,u,h,m,p,g,N,i]}),e[31]=N,e[32]=c,e[33]=u,e[34]=h,e[35]=m,e[36]=p,e[37]=g,e[38]=i,e[39]=z):z=e[39],z}const Re=1;function mr(n){if(typeof n!="object"||n===null||n.v!==Re||n.source!=="deck-viewer")return null;const e=n;return e.type==="ready"||e.type==="state"||e.type==="op"&&typeof e.opId=="string"&&e.op?e:null}class ze extends Error{constructor(e,t){super(e),this.code=t,this.name="DeckOpError"}code}function us(n){return[...n.children].filter(e=>!/^(TEMPLATE|SCRIPT|STYLE)$/.test(e.tagName))}function pr(n){const t=new DOMParser().parseFromString(n,"text/html").querySelector("deck-viewer");return t?us(t).length:null}function xr(n,e){const t=new DOMParser().parseFromString(n,"text/html"),s=t.querySelector("deck-viewer");if(!s)throw new ze("no <deck-viewer> element in source","no-viewer");const r=us(s),i=e.kind==="move"?e.from:e.at,a=r[i];if(!a)throw new ze(`slide index ${i} out of range (${r.length})`,"stale-index");switch(e.kind){case"remove":{if(r.length<=1)throw new ze("cannot remove the last slide","bad-op");a.remove();break}case"duplicate":{const c=a.cloneNode(!0);c.removeAttribute("id");for(const d of c.querySelectorAll("[id]"))d.removeAttribute("id");a.after(c);break}case"move":{if(e.to<0||e.to>=r.length)throw new ze(`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;s.insertBefore(a,c)}break}case"set-attr":{if(!/^[a-zA-Z][\w-]*$/.test(e.name))throw new ze(`invalid attribute name: ${e.name}`,"bad-op");a.setAttribute(e.name,e.value);break}case"remove-attr":{a.removeAttribute(e.name);break}case"replace":{const d=new DOMParser().parseFromString(e.html,"text/html").body.firstElementChild;if(!d)throw new ze("replace html has no root element","bad-op");a.replaceWith(t.importNode(d,!0));break}default:throw new ze(`unknown op kind: ${e.kind}`,"bad-op")}return`${n.trimStart().toLowerCase().startsWith("<!doctype")?`<!DOCTYPE html>
4
4
  `:""}${t.documentElement.outerHTML}
@@ -170,4 +170,4 @@ import{c as $,a1 as ce,n as Je,d as We,K as Q,m as ie,aW as kn,r as k,am as Ss,l
170
170
  <p class="cta">slides-create --theme &hellip;</p>
171
171
  </section>`].join(`
172
172
 
173
- `);async function wn(n){const e=await fetch(n,{credentials:"include"});if(!e.ok)throw new Error(`fetch failed: ${e.status}`);return e.text()}function zi(n,e){const t=e?`<style>${e}</style>`:"";return n.replaceAll("{{{slides}}}",Ni).replaceAll("{{title}}",Si).replace(/(src=")(\/deck-runtime\/)/g,`$1${window.location.origin}$2`).replace("</head>",`${t}</head>`)}function Ci(n){const e=$.c(23),{readUrl:t,title:s,tokensUrl:r}=n;let i;e[0]!==t?(i=Q.fileText(t),e[0]=t,e[1]=i):i=e[1];let a;e[2]!==t?(a=()=>wn(t),e[2]=t,e[3]=a):a=e[3];let o;e[4]!==i||e[5]!==a?(o={queryKey:i,queryFn:a,staleTime:6e4,retry:!1},e[4]=i,e[5]=a,e[6]=o):o=e[6];const c=ie(o);let d;e[7]!==r?(d=Q.fileText(r??""),e[7]=r,e[8]=d):d=e[8];const f=!!r;let u;e[9]!==r?(u=()=>wn(r??""),e[9]=r,e[10]=u):u=e[10];let h;e[11]!==d||e[12]!==f||e[13]!==u?(h={queryKey:d,enabled:f,queryFn:u,staleTime:6e4,retry:!1},e[11]=d,e[12]=f,e[13]=u,e[14]=h):h=e[14];const m=ie(h);if(c.isPending||r&&m.isPending){let x;return e[15]===Symbol.for("react.memo_cache_sentinel")?(x=l.jsx("div",{className:"flex h-full w-full items-center justify-center p-6",children:l.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=l.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=m.data??null;let g;e[17]!==p||e[18]!==c.data?(g=zi(c.data,p),e[17]=p,e[18]=c.data,e[19]=g):g=e[19];let b;return e[20]!==g||e[21]!==s?(b=l.jsx("iframe",{title:s,srcDoc:g,sandbox:"allow-scripts",className:"block h-full w-full border-0 bg-white"}),e[20]=g,e[21]=s,e[22]=b):b=e[22],b}async function jn(n){const e=await fetch(n,{credentials:"include"});if(!e.ok)throw new Error(`fetch failed: ${e.status}`);return e.text()}function Ke(n){const e=$.c(2),{children:t}=n;let s;return e[0]!==t?(s=l.jsx("p",{className:"text-sm font-medium text-foreground",children:t}),e[0]=t,e[1]=s):s=e[1],s}function $i(n){const e=$.c(16),{family:t,tokens:s,editing:r,valueOf:i,onEdit:a}=n;let o;e[0]!==t?(o=l.jsx("span",{className:"text-xs text-muted-foreground",children:t}),e[0]=t,e[1]=o):o=e[1];let c;if(e[2]!==r||e[3]!==a||e[4]!==s||e[5]!==i){let u;e[7]!==r||e[8]!==a||e[9]!==i?(u=h=>{const m=i(h),p=`${h.name.replace(/^--brand-/,"")}: ${m}`;return r&&/^#/.test(m)?l.jsx("input",{type:"color","aria-label":h.name,title:p,value:Ur(m),onChange:g=>a(h.name,g.target.value),className:"size-7 cursor-pointer rounded-md border border-border/60 bg-transparent p-0.5"},h.name):l.jsx("span",{title:p,className:"size-7 rounded-md border border-border/60",style:{backgroundColor:m}},h.name)},e[7]=r,e[8]=a,e[9]=i,e[10]=u):u=e[10],c=s.map(u),e[2]=r,e[3]=a,e[4]=s,e[5]=i,e[6]=c}else c=e[6];let d;e[11]!==c?(d=l.jsx("div",{className:"flex flex-wrap gap-1",children:c}),e[11]=c,e[12]=d):d=e[12];let f;return e[13]!==o||e[14]!==d?(f=l.jsxs("div",{className:"flex flex-col gap-1.5",children:[o,d]}),e[13]=o,e[14]=d,e[15]=f):f=e[15],f}function Pi(n){const e=$.c(9),{token:t,value:s}=n;if(t.kind==="space"){let i;return e[0]!==s?(i=l.jsx("span",{className:"flex h-7 w-16 shrink-0 items-center",children:l.jsx("span",{className:"h-1.5 rounded-full bg-primary",style:{width:s,maxWidth:"100%"}})}),e[0]=s,e[1]=i):i=e[1],i}if(t.kind==="radius"){let i;return e[2]!==s?(i=l.jsx("span",{className:"size-7 shrink-0 border border-border bg-muted/50",style:{borderRadius:s}}),e[2]=s,e[3]=i):i=e[3],i}if(t.kind==="shadow"){let i;return e[4]!==s?(i=l.jsx("span",{className:"size-7 shrink-0 rounded-md bg-background",style:{boxShadow:s}}),e[4]=s,e[5]=i):i=e[5],i}if(t.kind==="type"&&/^--brand-text-/.test(t.name)){const i=`min(${s}, 22px)`;let a;return e[6]!==i?(a=l.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]=a):a=e[7],a}let r;return e[8]===Symbol.for("react.memo_cache_sentinel")?(r=l.jsx("span",{className:"size-7 shrink-0"}),e[8]=r):r=e[8],r}function ys(n){const e=$.c(17),{token:t,value:s,editing:r,onEdit:i}=n;let a;e[0]!==t||e[1]!==s?(a=l.jsx(Pi,{token:t,value:s}),e[0]=t,e[1]=s,e[2]=a):a=e[2];let o;if(e[3]!==t.name){let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=/^--brand-/,e[5]=u):u=e[5],o=t.name.replace(u,""),e[3]=t.name,e[4]=o}else o=e[4];let c;e[6]!==o?(c=l.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:o}),e[6]=o,e[7]=c):c=e[7];let d;e[8]!==r||e[9]!==i||e[10]!==t.name||e[11]!==s?(d=r?l.jsx(Xe,{value:s,onChange:u=>i(t.name,u.target.value),className:"h-8 w-40 font-mono text-xs"}):l.jsx("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:s}),e[8]=r,e[9]=i,e[10]=t.name,e[11]=s,e[12]=d):d=e[12];let f;return e[13]!==a||e[14]!==c||e[15]!==d?(f=l.jsxs("div",{className:"flex items-center gap-3",children:[a,c,d]}),e[13]=a,e[14]=c,e[15]=d,e[16]=f):f=e[16],f}function Be(n){const e=$.c(16),{label:t,tokens:s,editing:r,valueOf:i,onEdit:a}=n;if(s.length===0)return null;let o;e[0]!==t?(o=l.jsx(Ke,{children:t}),e[0]=t,e[1]=o):o=e[1];let c;if(e[2]!==r||e[3]!==a||e[4]!==s||e[5]!==i){let u;e[7]!==r||e[8]!==a||e[9]!==i?(u=h=>l.jsx(ys,{token:h,value:i(h),editing:r,onEdit:a},h.name),e[7]=r,e[8]=a,e[9]=i,e[10]=u):u=e[10],c=s.map(u),e[2]=r,e[3]=a,e[4]=s,e[5]=i,e[6]=c}else c=e[6];let d;e[11]!==c?(d=l.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]!==o||e[14]!==d?(f=l.jsxs("div",{className:"flex flex-col gap-3",children:[o,d]}),e[13]=o,e[14]=d,e[15]=f):f=e[15],f}function vs({brandPath:n,onClose:e,variant:t}){const{org:s}=ce(),r=zt(n),i=r.volume??"",a=r.dirPath,o=le(a),c=r.readOnly,d=Je(),f=lt(),u=An(i),{upload:h,remove:m}=At(i),p=k.useRef(null),g=Wt(i,a),b=g.data??[],x=D=>b.some(re=>re.kind==="file"&&le(re.path)===D),y=x("tokens.css"),j=x("brand.md"),N=x("slides-theme.html"),z=Kr(b),C=f(i,`${a}/tokens.css`),w=f(i,`${a}/brand.md`),M=f(i,`${a}/slides-theme.html`),I=ie({queryKey:Q.fileText(C),enabled:y,queryFn:()=>jn(C),staleTime:6e4,retry:!1}),F=ie({queryKey:Q.fileText(w),enabled:j,queryFn:()=>jn(w),staleTime:6e4,retry:!1}),[v,P]=k.useState(!1),[W,A]=k.useState({}),[_,B]=k.useState(null),[G,q]=k.useState(!1),[ee,Z]=k.useState(!1),[L,K]=k.useState("deck"),S=I.data?ps(I.data):[],O=D=>S.find(re=>re.name===D)?.value,R=D=>W[D.name]??D.value,U=Hr(S),T=S.filter(D=>D.kind==="font"),H=S.filter(D=>D.kind==="type"),Y=S.filter(D=>D.kind==="space"),te=S.filter(D=>D.kind==="radius"),fe=S.filter(D=>D.kind==="shadow"),E=S.filter(D=>D.kind==="motion"),X=S.filter(D=>D.kind==="other"),ne=(D,re)=>A(dt=>({...dt,[D]:re})),ge=N&&L==="deck",Ne=_??F.data??"",Pe=Object.entries(W).filter(([D,re])=>O(D)!==re),ae=_!==null&&_!==(F.data??""),ot=Pe.length>0||ae;function Et(){A({}),B(null),P(!1)}async function Ee(){q(!0);try{if(Pe.length>0){let D=I.data??"";for(const[re,dt]of Pe)D=qr(D,re,dt);await u.mutateAsync({path:`${a}/tokens.css`,body:D,contentType:"text/css; charset=utf-8"}),d.invalidateQueries({queryKey:Q.fileText(C)})}ae&&_!==null&&(await u.mutateAsync({path:`${a}/brand.md`,body:_,contentType:"text/markdown; charset=utf-8"}),d.invalidateQueries({queryKey:Q.fileText(w)})),d.invalidateQueries({queryKey:Q.orgFsVolume(s.id,i)}),d.invalidateQueries({queryKey:Q.orgFsRecent(s.id)}),A({}),B(null),P(!1),ue.success("Brand saved")}catch(D){ue.error(D instanceof Error?D.message:"Failed to save brand")}finally{q(!1)}}async function ct(D){const re=D?.[0];if(!re)return;const tn=`logo.${(re.name.split(".").pop()??"png").toLowerCase()}`;try{await h.mutateAsync({dir:a,files:[new File([re],tn,{type:re.type})]}),z&&le(z)!==tn&&await m.mutateAsync(z),ue.success("Logo updated")}catch(nn){ue.error(nn instanceof Error?nn.message:"Logo upload failed")}finally{p.current&&(p.current.value="")}}const Dt=!g.isPending&&!y&&!j&&!z;return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-3",children:[l.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:l.jsx(ht,{size:18})}),t==="dialog"?l.jsx(Ue,{className:"flex-1 truncate text-base font-medium text-foreground",children:o}):l.jsx("span",{className:"flex-1 truncate text-base font-medium text-foreground",children:o}),!c&&(v?l.jsxs(l.Fragment,{children:[l.jsx(J,{variant:"ghost",size:"sm",onClick:Et,disabled:G,children:"Cancel"}),l.jsx(J,{size:"sm",disabled:!ot||G,onClick:()=>{Ee()},children:G?"Saving…":"Save"})]}):l.jsxs(J,{variant:"outline",size:"sm",onClick:()=>P(!0),children:[l.jsx(Ls,{size:14}),"Edit"]})),t==="dialog"?l.jsx(Tn,{asChild:!0,children:l.jsx(J,{variant:"ghost",size:"icon",className:"size-8 shrink-0",children:l.jsx(pt,{size:16})})}):l.jsx(J,{variant:"ghost",size:"icon",className:"size-8 shrink-0",onClick:e,children:l.jsx(pt,{size:16})})]}),l.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:g.isPending?l.jsxs("div",{className:"flex flex-col gap-3 p-6",children:[l.jsx(oe,{className:"h-40 w-full rounded-xl"}),l.jsx(oe,{className:"h-4 w-1/3"}),l.jsx(oe,{className:"h-4 w-2/3"})]}):Dt?l.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"This brand is no longer available."}):l.jsxs(l.Fragment,{children:[(N||y)&&l.jsxs("div",{className:"shrink-0 border-b border-border",children:[l.jsxs("div",{role:"button",tabIndex:0,"aria-label":ee?"Show preview":"Hide preview",onClick:()=>Z(D=>!D),onKeyDown:D=>{(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),Z(re=>!re))},className:"flex cursor-pointer items-center justify-between gap-2 px-4 py-2.5 hover:bg-muted/40",children:[l.jsxs("div",{className:"flex gap-0.5 rounded-lg bg-muted p-0.5 text-xs font-medium",onClick:D=>D.stopPropagation(),children:[N&&l.jsx("button",{type:"button",onClick:()=>{K("deck"),Z(!1)},className:de("rounded-md px-2.5 py-1",ge?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Deck"}),l.jsx("button",{type:"button",onClick:()=>{K("components"),Z(!1)},className:de("rounded-md px-2.5 py-1",ge?"text-muted-foreground hover:text-foreground":"bg-background text-foreground shadow-sm"),children:"Components"})]}),ee?l.jsx(el,{size:16,className:"shrink-0 text-muted-foreground"}):l.jsx(tl,{size:16,className:"shrink-0 text-muted-foreground"})]}),!ee&&l.jsx("div",{className:"px-4 pb-4",children:l.jsx("div",{className:de("w-full overflow-hidden rounded-xl border border-border bg-muted/30",ge?"aspect-[16/9]":"h-96"),children:ge?l.jsx(Ci,{readUrl:M,title:`${o} deck theme`,tokensUrl:C}):l.jsx(ki,{tokensUrl:C})})})]}),l.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-8 overflow-y-auto p-6",children:[l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsx(Ke,{children:"Logo"}),l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx("div",{className:"flex size-24 items-center justify-center overflow-hidden rounded-xl border border-border bg-muted/30",children:z?l.jsx("img",{src:f(i,z),alt:`${o} logo`,className:"max-h-full max-w-full object-contain"}):l.jsx(ht,{size:28,className:"text-muted-foreground/50"})}),v&&l.jsxs("div",{children:[l.jsxs(J,{variant:"outline",size:"sm",disabled:h.isPending,onClick:()=>p.current?.click(),children:[l.jsx(mt,{size:14}),z?"Replace logo":"Add logo"]}),l.jsx("input",{ref:p,type:"file",accept:"image/*",className:"hidden",onChange:D=>{ct(D.target.files)}})]})]})]}),U.length>0&&l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsx(Ke,{children:"Colors"}),U.map(D=>l.jsx($i,{family:D.family,tokens:D.tokens,editing:v,valueOf:R,onEdit:ne},D.family))]}),(T.length>0||H.length>0)&&l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsx(Ke,{children:"Typography"}),T.map(D=>l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsx("span",{className:"text-xs text-muted-foreground",children:D.name.replace(/^--brand-font-?/,"")||"font"}),v?l.jsx(Xe,{value:R(D),onChange:re=>ne(D.name,re.target.value),className:"h-9"}):l.jsx("span",{className:"truncate text-lg text-foreground",style:{fontFamily:R(D)},children:R(D)})]},D.name)),H.map(D=>l.jsx(ys,{token:D,value:R(D),editing:v,onEdit:ne},D.name))]}),l.jsx(Be,{label:"Spacing",tokens:Y,editing:v,valueOf:R,onEdit:ne}),l.jsx(Be,{label:"Radius",tokens:te,editing:v,valueOf:R,onEdit:ne}),l.jsx(Be,{label:"Shadows",tokens:fe,editing:v,valueOf:R,onEdit:ne}),l.jsx(Be,{label:"Motion",tokens:E,editing:v,valueOf:R,onEdit:ne}),l.jsx(Be,{label:"Tokens",tokens:X,editing:v,valueOf:R,onEdit:ne}),l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsx(Ke,{children:"Voice & guidelines"}),v?l.jsx(Zs,{value:Ne,onChange:D=>B(D.target.value),placeholder:"Describe the brand voice, tone, do's and don'ts…",className:"min-h-48 font-mono text-sm"}):F.isPending&&j?l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx(oe,{className:"h-3 w-full"}),l.jsx(oe,{className:"h-3 w-5/6"})]}):Ne.trim()?l.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:l.jsx(Kt,{id:`brand-preview-${n}`,text:Ne})}):l.jsx("p",{className:"text-sm text-muted-foreground",children:"No brand voice written yet."})]})]})]})})]})}function Ei(n){const e=$.c(8),{brandPath:t,onClose:s}=n;let r;e[0]!==s?(r=o=>{o||s()},e[0]=s,e[1]=r):r=e[1];let i;e[2]!==t||e[3]!==s?(i=l.jsx(Ze,{className:"flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-2xl!",closeButtonClassName:"hidden",children:l.jsx(vs,{brandPath:t,onClose:s,variant:"dialog"})}),e[2]=t,e[3]=s,e[4]=i):i=e[4];let a;return e[5]!==r||e[6]!==i?(a=l.jsx(et,{open:!0,onOpenChange:r,children:i}),e[5]=r,e[6]=i,e[7]=a):a=e[7],a}function Di(n){const e=$.c(3),{brandPath:t,onClose:s}=n;let r;return e[0]!==t||e[1]!==s?(r=l.jsx("div",{className:"flex h-full w-full flex-col overflow-hidden bg-background",children:l.jsx(vs,{brandPath:t,onClose:s,variant:"panel"})}),e[0]=t,e[1]=s,e[2]=r):r=e[2],r}function Ti(n){const e=$.c(9),{previewPath:t,onClose:s,showSeeInLibrary:r}=n,i=r===void 0?!1:r;let a;e[0]!==s?(a=d=>{d||s()},e[0]=s,e[1]=a):a=e[1];let o;e[2]!==s||e[3]!==t||e[4]!==i?(o=l.jsx(Ze,{className:"flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-5xl!",children:l.jsx(hs,{previewPath:t,onClose:s,showSeeInLibrary:i,variant:"dialog"})}),e[2]=s,e[3]=t,e[4]=i,e[5]=o):o=e[5];let c;return e[6]!==a||e[7]!==o?(c=l.jsx(et,{open:!0,onOpenChange:a,children:o}),e[6]=a,e[7]=o,e[8]=c):c=e[8],c}function ws(n){const e=$.c(23),{skillPath:t,onClose:s,variant:r}=n,i=zt(t),{volume:a,dirPath:o}=i,c=lt(),d=c(a??"",`${o}/SKILL.md`),f=Q.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 h;e[2]!==f||e[3]!==u?(h={queryKey:f,queryFn:u,staleTime:6e4,retry:!1},e[2]=f,e[3]=u,e[4]=h):h=e[4];const m=ie(h),p=Wt(a??"",o);let g;e[5]!==o?(g=le(o),e[5]=o,e[6]=g):g=e[6];const b=g;let x;e[7]!==m.data?(x=m.data?xs(m.data):null,e[7]=m.data,e[8]=x):x=e[8];const y=x,j=Mi;let N;e[9]===Symbol.for("react.memo_cache_sentinel")?(N=(q,ee)=>j(q.path)?-1:j(ee.path)?1:le(q.path).localeCompare(le(ee.path)),e[9]=N):N=e[9];const z=(p.data??[]).filter(Fi).sort(N),[C,w]=k.useState(null),M=C===null?null:z.find(q=>q.path===C)??null,I=y?.name??b;let F;e[10]===Symbol.for("react.memo_cache_sentinel")?(F=l.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:l.jsx(qt,{size:18})}),e[10]=F):F=e[10];let v;e[11]!==I||e[12]!==r?(v=r==="dialog"?l.jsx(Ue,{className:"flex-1 truncate text-base font-medium text-foreground",children:I}):l.jsx("span",{className:"flex-1 truncate text-base font-medium text-foreground",children:I}),e[11]=I,e[12]=r,e[13]=v):v=e[13];let P;e[14]!==s||e[15]!==r?(P=r==="dialog"?l.jsx(Tn,{asChild:!0,children:l.jsx(J,{variant:"ghost",size:"icon",className:"size-8 shrink-0",children:l.jsx(pt,{size:16})})}):l.jsx(J,{variant:"ghost",size:"icon",className:"size-8 shrink-0",onClick:s,children:l.jsx(pt,{size:16})}),e[14]=s,e[15]=r,e[16]=P):P=e[16];let W;e[17]!==v||e[18]!==P?(W=l.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-3",children:[F,v,P]}),e[17]=v,e[18]=P,e[19]=W):W=e[19];let A;e[20]===Symbol.for("react.memo_cache_sentinel")?(A=l.jsx("p",{className:"px-2 py-1.5 text-sm font-medium text-foreground",children:"Files"}),e[20]=A):A=e[20];const _="relative flex min-w-0 flex-1 flex-col overflow-y-auto",B=M?l.jsx(ds,{file:{key:M.path,filename:le(M.path),size:M.size,downloadUrl:c(a??"",M.path)}}):m.isPending?l.jsxs("div",{className:"flex flex-col gap-2 p-6",children:[l.jsx(oe,{className:"h-4 w-1/3"}),l.jsx(oe,{className:"h-3 w-full"}),l.jsx(oe,{className:"h-3 w-5/6"}),l.jsx(oe,{className:"h-3 w-2/3"})]}):m.isError||!y?l.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"This skill is no longer available."}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex flex-col gap-4 border-b border-border p-6",children:[l.jsx("p",{className:"text-sm font-medium text-foreground",children:"Description"}),l.jsx("p",{className:"text-base text-muted-foreground",children:y.description??"Claude Code skill"})]}),l.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none p-6",children:l.jsx(Kt,{id:`skill-preview-${t}`,text:y.body})})]});let G;return e[21]!==B?(G=l.jsx("div",{className:_,children:B}),e[21]=B,e[22]=G):G=e[22],l.jsxs(l.Fragment,{children:[W,l.jsxs("div",{className:"flex min-h-0 flex-1",children:[l.jsxs("div",{className:"flex w-[220px] shrink-0 flex-col gap-1 overflow-y-auto border-r border-border bg-muted p-3",children:[A,p.isPending?l.jsx(oe,{className:"mx-2 h-4 w-24"}):z.map(q=>{const ee=j(q.path)?M===null:C===q.path;return l.jsxs("button",{type:"button",onClick:()=>w(j(q.path)?null:q.path),className:de("flex items-center gap-2.5 rounded-lg px-2 py-1.5 text-left",ee?"bg-background shadow-sm":"hover:bg-muted/60"),children:[l.jsx(Se,{filename:le(q.path),className:"h-6 w-5 shrink-0"}),l.jsx("span",{className:de("truncate text-sm",ee?"text-foreground":"text-muted-foreground"),children:le(q.path)})]},q.path)})]}),G]})]})}function Fi(n){return n.kind==="file"}function Mi(n){return le(n)==="SKILL.md"}function Ii(n){const e=$.c(8),{skillPath:t,onClose:s}=n;let r;e[0]!==s?(r=o=>{o||s()},e[0]=s,e[1]=r):r=e[1];let i;e[2]!==s||e[3]!==t?(i=l.jsx(Ze,{className:"flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-5xl!",closeButtonClassName:"hidden",children:l.jsx(ws,{skillPath:t,onClose:s,variant:"dialog"})}),e[2]=s,e[3]=t,e[4]=i):i=e[4];let a;return e[5]!==r||e[6]!==i?(a=l.jsx(et,{open:!0,onOpenChange:r,children:i}),e[5]=r,e[6]=i,e[7]=a):a=e[7],a}function Li(n){const e=$.c(3),{skillPath:t,onClose:s}=n;let r;return e[0]!==s||e[1]!==t?(r=l.jsx("div",{className:"flex h-full w-full flex-col overflow-hidden bg-background",children:l.jsx(ws,{skillPath:t,onClose:s,variant:"panel"})}),e[0]=s,e[1]=t,e[2]=r):r=e[2],r}function en(n){return`${window.location.origin}${n}`}function Ge(n){if(n.shareMode==="password")return"password";if(n.shareMode==="public"||n.readPublic)return"public";if(n.effectivePublic)return"inherited"}const js=[{id:"home",description:"Your organization's home folder",glyph:Os},{id:"uploads",description:"Files your team uploads",glyph:mt},{id:"outputs",description:"Agent run outputs",glyph:_s}],Oi=6;function ks(n,e,t){const s=e.includes("/")?e.slice(0,e.lastIndexOf("/")):"",r=Jt(n),i=r?`public/${r}`:n==="home"?ms(t):n;return s?`${i}/${s}`:i}function $e(n){const e=$.c(2),{children:t}=n;let s;return e[0]!==t?(s=l.jsx("p",{className:"text-[13px] text-foreground",children:t}),e[0]=t,e[1]=s):s=e[1],s}function ke(n){const e=$.c(2),{children:t}=n;let s;return e[0]!==t?(s=l.jsx("div",{className:"@container",children:l.jsx("div",{className:"grid grid-cols-1 gap-3 @[440px]:grid-cols-2 @[660px]:grid-cols-3",children:t})}),e[0]=t,e[1]=s):s=e[1],s}function $t(n){const e=$.c(2),{rows:t}=n,s=t===void 0?1:t;let r;return e[0]!==s?(r=l.jsx(ke,{children:Array.from({length:s*3},Ri)}),e[0]=s,e[1]=r):r=e[1],r}function Ri(n,e){return l.jsx(oe,{className:"h-16 rounded-2xl"},e)}function Pt(n){const e=$.c(2),{children:t}=n;let s;return e[0]!==t?(s=l.jsx("p",{className:"text-sm text-muted-foreground",children:t}),e[0]=t,e[1]=s):s=e[1],s}function Ai(n){const e=$.c(6),{volume:t,displayName:s,description:r,glyph:i,onOpen:a}=n,o=ul(t),c=s??t,d=o.data?`${o.data.files} files`:void 0;let f;return e[0]!==r||e[1]!==i||e[2]!==a||e[3]!==c||e[4]!==d?(f=l.jsx(Ct,{name:c,meta:d,subtitle:r,glyph:i,onOpen:a}),e[0]=r,e[1]=i,e[2]=a,e[3]=c,e[4]=d,e[5]=f):f=e[5],f}function _i(n){const e=$.c(8),{segments:t,onNavigate:s}=n;let r;e[0]!==s?(r=l.jsx("button",{type:"button",className:"text-muted-foreground hover:text-foreground hover:underline",onClick:()=>s(""),children:"Library"}),e[0]=s,e[1]=r):r=e[1];let i;e[2]!==s||e[3]!==t?(i=t.map((o,c)=>{const d=t.slice(0,c+1).join("/"),f=c===t.length-1;return l.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[l.jsx(Es,{size:12,className:"shrink-0 text-muted-foreground"}),f?l.jsx("span",{className:"truncate font-medium text-foreground",children:o}):l.jsx("button",{type:"button",className:"truncate text-muted-foreground hover:text-foreground hover:underline",onClick:()=>s(d),children:o})]},d)}),e[2]=s,e[3]=t,e[4]=i):i=e[4];let a;return e[5]!==r||e[6]!==i?(a=l.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]=a):a=e[7],a}function Ui(n){const e=$.c(32),{query:t,stale:s,onOpenFile:r,onShare:i,onDelete:a}=n,{org:o}=ce(),c=lt(),d=hl(t);let f;e[0]!==c||e[1]!==i?(f=z=>i({volume:z.volume,path:z.path,kind:"file",shareMode:z.shareMode??"private",effectivePublic:z.effectivePublic??!1,url:en(c(z.volume,z.path))}),e[0]=c,e[1]=i,e[2]=f):f=e[2];const u=f;if(d.isPending){let z;return e[3]===Symbol.for("react.memo_cache_sentinel")?(z=l.jsx($t,{rows:2}),e[3]=z):z=e[3],z}let h;e[4]!==d.data?(h=d.data??[],e[4]=d.data,e[5]=h):h=e[5];const m=h;if(m.length===0){let z;return e[6]!==t?(z=l.jsxs(Pt,{children:["No files match “",t,"”."]}),e[6]=t,e[7]=z):z=e[7],z}const p=(s||d.isPlaceholderData)&&"opacity-50";let g;e[8]!==p?(g=de("flex flex-col gap-3",p),e[8]=p,e[9]=g):g=e[9];const b=m.length===1?"result":"results";let x;e[10]!==m.length||e[11]!==b?(x=l.jsxs($e,{children:[m.length," ",b]}),e[10]=m.length,e[11]=b,e[12]=x):x=e[12];let y;if(e[13]!==c||e[14]!==a||e[15]!==r||e[16]!==o||e[17]!==m||e[18]!==u){let z;e[20]!==c||e[21]!==a||e[22]!==r||e[23]!==o||e[24]!==u?(z=C=>{const w=Jt(C.volume)!==null;return l.jsx(bs,{filename:le(C.path),updatedAt:C.updatedAt,downloadUrl:c(C.volume,C.path),subtitle:ks(C.volume,C.path,o.slug),publicState:Ge(C),onOpen:()=>r(Nr(C.volume,C.path)),onShare:w?void 0:()=>u(C),onDelete:w?void 0:()=>a({volume:C.volume,path:C.path,kind:"file"})},`${C.volume}/${C.path}`)},e[20]=c,e[21]=a,e[22]=r,e[23]=o,e[24]=u,e[25]=z):z=e[25],y=m.map(z),e[13]=c,e[14]=a,e[15]=r,e[16]=o,e[17]=m,e[18]=u,e[19]=y}else y=e[19];let j;e[26]!==y?(j=l.jsx(ke,{children:y}),e[26]=y,e[27]=j):j=e[27];let N;return e[28]!==g||e[29]!==x||e[30]!==j?(N=l.jsxs("div",{className:g,children:[x,j]}),e[28]=g,e[29]=x,e[30]=j,e[31]=N):N=e[31],N}function Bi(n){const e=$.c(24),{onOpenDir:t,onOpenFile:s,onShare:r,onDelete:i}=n,{org:a}=ce(),o=fl(),c=Rn(),d=lt();let f;e[0]!==d||e[1]!==r?(f=y=>r({volume:y.volume,path:y.path,kind:"file",shareMode:y.shareMode??"private",effectivePublic:y.effectivePublic??!1,url:en(d(y.volume,y.path))}),e[0]=d,e[1]=r,e[2]=f):f=e[2];const u=f;let h;if(e[3]!==d||e[4]!==i||e[5]!==s||e[6]!==a||e[7]!==o.data||e[8]!==o.isPending||e[9]!==u){const y=(o.data??[]).slice(0,Oi);h=o.isPending?l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsx($e,{children:"Recently added"}),l.jsx($t,{})]}):y.length>0?l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsx($e,{children:"Recently added"}),l.jsx(ke,{children:y.map(j=>l.jsx(bi,{filename:le(j.path),updatedAt:j.updatedAt,size:j.size,downloadUrl:d(j.volume,j.path),subtitle:ks(j.volume,j.path,a.slug),publicState:Ge(j),onOpen:()=>s(`${j.volume}/${j.path}`),onShare:()=>u(j),onDelete:()=>i({volume:j.volume,path:j.path,kind:"file"})},`${j.volume}/${j.path}`))})]}):l.jsx(Pt,{children:"No files yet — upload one, or ask an agent to produce something."}),e[3]=d,e[4]=i,e[5]=s,e[6]=a,e[7]=o.data,e[8]=o.isPending,e[9]=u,e[10]=h}else h=e[10];let m;e[11]===Symbol.for("react.memo_cache_sentinel")?(m=l.jsx($e,{children:"Folders"}),e[11]=m):m=e[11];let p;e[12]!==t||e[13]!==a?(p=js.map(y=>l.jsx(Ai,{volume:y.id,displayName:y.id==="home"?ms(a.slug):void 0,description:y.description,glyph:y.glyph,onOpen:()=>t(y.id)},y.id)),e[12]=t,e[13]=a,e[14]=p):p=e[14];let g;e[15]!==t||e[16]!==c.data?.length?(g=(c.data?.length??0)>0&&l.jsx(Ct,{name:"public",meta:`${c.data?.length} sets`,subtitle:"Curated skill sets — read-only",glyph:yt,readOnly:!0,onOpen:()=>t("public")}),e[15]=t,e[16]=c.data?.length,e[17]=g):g=e[17];let b;e[18]!==p||e[19]!==g?(b=l.jsxs("div",{className:"flex flex-col gap-3",children:[m,l.jsxs(ke,{children:[p,g]})]}),e[18]=p,e[19]=g,e[20]=b):b=e[20];let x;return e[21]!==h||e[22]!==b?(x=l.jsxs(l.Fragment,{children:[h,b]}),e[21]=h,e[22]=b,e[23]=x):x=e[23],x}function Hi(n){const e=$.c(11),{onOpenDir:t}=n,s=Rn();if(s.isPending){let c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(c=l.jsx($t,{}),e[0]=c):c=e[0],c}let r;e[1]!==s.data?(r=s.data??[],e[1]=s.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=l.jsx(Pt,{children:"No public skill sets are configured."}),e[3]=c):c=e[3],c}let a;if(e[4]!==t||e[5]!==i){let c;e[7]!==t?(c=d=>l.jsx(Ct,{name:d,subtitle:"Read-only",readOnly:!0,onOpen:()=>t(`public/${d}`)},d),e[7]=t,e[8]=c):c=e[8],a=i.map(c),e[4]=t,e[5]=i,e[6]=a}else a=e[6];let o;return e[9]!==a?(o=l.jsx(ke,{children:a}),e[9]=a,e[10]=o):o=e[10],o}function qi(n){const e=$.c(34),{location:t,onOpenDir:s,onOpenFile:r,onOpenSkill:i,onOpenBrand:a,onShare:o,onDelete:c}=n,d=t.volume??"",f=Wt(d,t.dirPath),u=lt();if(f.isPending){let y;return e[0]===Symbol.for("react.memo_cache_sentinel")?(y=l.jsx($t,{rows:2}),e[0]=y):y=e[0],y}if(f.isError){const y=f.error instanceof Error?f.error.message:"Failed to load";let j;return e[1]!==y?(j=l.jsx("p",{className:"text-sm text-destructive",children:y}),e[1]=y,e[2]=j):j=e[2],j}let h,m,p,g,b;if(e[3]!==u||e[4]!==f.data||e[5]!==t||e[6]!==c||e[7]!==a||e[8]!==s||e[9]!==r||e[10]!==i||e[11]!==o||e[12]!==d){b=Symbol.for("react.early_return_sentinel");e:{const y=f.data??[],j=y.filter(Vi),N=y.filter(Gi),z=y.filter(Wi),C=y.filter(Ki);if(y.length===0){const v=t.readOnly?"Empty — this read-only set syncs from its GitHub source.":"Empty folder — upload a file or create a folder to get started.";let P;e[18]!==v?(P=l.jsx(Pt,{children:v}),e[18]=v,e[19]=P):P=e[19],b=P;break e}let w;e[20]!==t.readOnly||e[21]!==c||e[22]!==d?(w=v=>t.readOnly?void 0:()=>c({volume:d,path:v.path,kind:v.kind}),e[20]=t.readOnly,e[21]=c,e[22]=d,e[23]=w):w=e[23];const M=w;let I;e[24]!==u||e[25]!==t.readOnly||e[26]!==o||e[27]!==d?(I=v=>t.readOnly?void 0:()=>o({volume:d,path:v.path,kind:v.kind,shareMode:v.shareMode??"private",effectivePublic:v.effectivePublic??!1,url:v.kind==="file"?en(u(d,v.path)):void 0}),e[24]=u,e[25]=t.readOnly,e[26]=o,e[27]=d,e[28]=I):I=e[28];const F=I;h=j.length>0&&l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsx($e,{children:"Skills"}),l.jsx(ke,{children:j.map(v=>l.jsx(li,{dirName:le(v.path),updatedAt:v.updatedAt,skillMdUrl:u(d,`${v.path}/SKILL.md`),publicState:Ge(v),onOpen:()=>i(Le(t,v.path)),onBrowse:()=>s(Le(t,v.path)),onShare:F(v),onDelete:M(v)},v.path))})]}),m=N.length>0&&l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsx($e,{children:"Brands"}),l.jsx(ke,{children:N.map(v=>l.jsx(ai,{dirName:le(v.path),updatedAt:v.updatedAt,tokensUrl:u(d,`${v.path}/tokens.css`),onOpen:()=>a(Le(t,v.path)),onBrowse:()=>s(Le(t,v.path)),onDelete:M(v)},v.path))})]}),p=z.length>0&&l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsx($e,{children:"Folders"}),l.jsx(ke,{children:z.map(v=>l.jsx(Ct,{name:le(v.path),meta:rt(v.updatedAt),readOnly:t.readOnly,publicState:Ge(v),onOpen:()=>s(Le(t,v.path)),onShare:F(v),onDelete:M(v)},v.path))})]}),g=C.length>0&&l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsx($e,{children:"Files"}),l.jsx(ke,{children:C.map(v=>l.jsx(bs,{filename:le(v.path),updatedAt:v.updatedAt,downloadUrl:u(d,v.path),publicState:Ge(v),onOpen:()=>r(Le(t,v.path)),onShare:F(v),onDelete:M(v)},v.path))})]})}e[3]=u,e[4]=f.data,e[5]=t,e[6]=c,e[7]=a,e[8]=s,e[9]=r,e[10]=i,e[11]=o,e[12]=d,e[13]=h,e[14]=m,e[15]=p,e[16]=g,e[17]=b}else h=e[13],m=e[14],p=e[15],g=e[16],b=e[17];if(b!==Symbol.for("react.early_return_sentinel"))return b;let x;return e[29]!==h||e[30]!==m||e[31]!==p||e[32]!==g?(x=l.jsxs(l.Fragment,{children:[h,m,p,g]}),e[29]=h,e[30]=m,e[31]=p,e[32]=g,e[33]=x):x=e[33],x}function Ki(n){return n.kind==="file"}function Wi(n){return n.kind==="dir"&&!n.hasSkill&&!n.hasBrand}function Gi(n){return n.kind==="dir"&&n.hasBrand&&!n.hasSkill}function Vi(n){return n.kind==="dir"&&n.hasSkill}function Bt({onOpenFile:n,onOpenSkill:e,onOpenBrand:t}={}){const{org:s}=ce(),r=Je(),i=Nn(),a=En(),o=zn({strict:!1}),c=o.path??"",d=zt(c),f=d.segments.length===0,u=(E,X)=>i({to:".",search:ne=>({...ne,[E]:X||void 0})}),h=E=>u("path",E),m=(E,X)=>i({to:".",search:ne=>({...ne,preview:void 0,skill:void 0,brand:void 0,[E]:X})}),p=n??(E=>m("preview",E)),g=e??(E=>m("skill",E)),b=t??(E=>m("brand",E)),[x,y]=k.useState(""),j=Js(x.trim(),300),[N,z]=k.useState(null),[C,w]=k.useState(null),[M,I]=k.useState(!1),[F,v]=k.useState(""),P=k.useRef(null),[W,A]=k.useState(!1),_=k.useRef(0),B=d.readOnly?null:d.volume??"uploads",G=d.volume?d.dirPath:"",{upload:q,mkdir:ee}=At(B??"uploads"),{remove:Z}=At(N?.volume??"uploads");async function L(E){if(!(!B||!E||E.length===0))try{await q.mutateAsync({dir:G,files:[...E]}),ue.success(E.length===1?`Uploaded ${E[0]?.name}`:`Uploaded ${E.length} files`)}catch(X){ue.error(X instanceof Error?X.message:"Upload failed")}finally{P.current&&(P.current.value="")}}const K=B!==null,S=f?"uploads":d.segments.at(-1)??"this folder";function O(E){return E.dataTransfer.types.includes("Files")}function R(E){!K||!O(E)||(E.preventDefault(),_.current+=1,A(!0))}function U(E){!K||!O(E)||E.preventDefault()}function T(){K&&(_.current=Math.max(0,_.current-1),_.current===0&&A(!1))}function H(E){K&&(E.preventDefault(),_.current=0,A(!1),E.dataTransfer.files.length>0&&L(E.dataTransfer.files))}async function Y(){const E=F.trim();if(!(!B||!E))try{await ee.mutateAsync(G?`${G}/${E}`:E),ue.success(`Folder "${E}" created`),I(!1),v("")}catch(X){ue.error(X instanceof Error?X.message:"Failed to create folder")}}async function te(){if(!N)return;const E=N;try{await Z.mutateAsync(E.path),ue.success(`Deleted ${le(E.path)}`)}catch(X){ue.error(X instanceof Error?X.message:"Delete failed")}finally{z(null)}}function fe(){for(const E of js)r.invalidateQueries({queryKey:Q.orgFsVolume(s.id,E.id)});d.volume&&r.invalidateQueries({queryKey:Q.orgFsVolume(s.id,d.volume)}),r.invalidateQueries({queryKey:Q.orgFsRecent(s.id)}),r.invalidateQueries({queryKey:Q.orgFsSearchRoot(s.id)}),r.invalidateQueries({queryKey:Q.orgFsPublicSets(s.id)})}return l.jsxs("div",{className:"relative h-full",onDragEnter:R,onDragOver:U,onDragLeave:T,onDrop:H,children:[W&&l.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:l.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:[l.jsx(mt,{size:28,className:"text-primary"}),l.jsxs("p",{className:"text-sm font-medium text-foreground",children:["Drop to upload to ",S]})]})}),l.jsx("div",{className:"h-full overflow-y-auto",children:l.jsxs("div",{className:"mx-auto flex w-full max-w-[900px] flex-col gap-10 px-6 py-10 lg:px-10",children:[l.jsxs("div",{className:"flex flex-col gap-2",children:[!f&&l.jsx(_i,{segments:d.segments,onNavigate:h}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("h1",{className:"min-w-0 flex-1 truncate text-xl font-medium text-foreground",children:f?"Library":d.segments.at(-1)??"Library"}),l.jsx(J,{variant:"ghost",size:"icon",onClick:fe,"aria-label":"Refresh",children:l.jsx(Sn,{size:14})}),!f&&B&&l.jsxs(J,{variant:"outline",size:"sm",onClick:()=>I(!0),children:[l.jsx(Rs,{size:14}),"New folder"]}),d.readOnly?l.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[l.jsx(Cn,{size:12}),"Read-only"]}):l.jsxs(J,{size:"sm",disabled:q.isPending,onClick:()=>P.current?.click(),children:[l.jsx(mt,{size:14}),q.isPending?"Uploading…":"Upload file"]}),l.jsx("input",{ref:P,type:"file",multiple:!0,className:"hidden",onChange:E=>{L(E.target.files)}})]})]}),l.jsxs("div",{className:"relative",children:[l.jsx(As,{size:16,className:"pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 text-muted-foreground"}),l.jsx(Xe,{value:x,onChange:E=>y(E.target.value),onKeyDown:E=>{E.key==="Escape"&&y("")},placeholder:"Search all files…",className:"h-10 rounded-xl pr-9 pl-9"}),x&&l.jsx(J,{variant:"ghost",size:"icon",className:"absolute top-1/2 right-1.5 size-7 -translate-y-1/2",onClick:()=>y(""),"aria-label":"Clear search",children:l.jsx(Pn,{size:14})})]}),j?l.jsx(Ui,{query:j,stale:x.trim()!==j,onOpenFile:p,onShare:w,onDelete:z}):f?l.jsx(Bi,{onOpenDir:h,onOpenFile:p,onShare:w,onDelete:z}):d.volume===null?l.jsx(Hi,{onOpenDir:h}):l.jsx(qi,{location:d,onOpenDir:h,onOpenFile:p,onOpenSkill:g,onOpenBrand:b,onShare:w,onDelete:z},d.volume)]})}),a&&(o.preview?l.jsx(Ti,{previewPath:o.preview,onClose:()=>u("preview",null)}):o.skill?l.jsx(Ii,{skillPath:o.skill,onClose:()=>u("skill",null)},o.skill):o.brand?l.jsx(Ei,{brandPath:o.brand,onClose:()=>u("brand",null)},o.brand):null),l.jsx(et,{open:M,onOpenChange:I,children:l.jsxs(Ze,{children:[l.jsxs(Dn,{children:[l.jsx(Ue,{children:"New folder"}),l.jsxs(Xs,{children:["Create a folder in ",c||"the library","."]})]}),l.jsx(Xe,{autoFocus:!0,placeholder:"folder-name",value:F,onChange:E=>v(E.target.value),onKeyDown:E=>{E.key==="Enter"&&Y()}}),l.jsxs(Qs,{children:[l.jsx(J,{variant:"outline",onClick:()=>I(!1),children:"Cancel"}),l.jsx(J,{disabled:!F.trim()||ee.isPending,onClick:()=>{Y()},children:"Create"})]})]})}),l.jsx(Sr,{target:C,onOpenChange:E=>{E||w(null)}}),l.jsx(Us,{open:N!==null,onOpenChange:E=>{E||z(null)},children:l.jsxs(Bs,{children:[l.jsxs(Hs,{children:[l.jsxs(qs,{children:["Delete ",N?le(N.path):"","?"]}),l.jsx(Ks,{children:N?.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."})]}),l.jsxs(Ws,{children:[l.jsx(Gs,{children:"Cancel"}),l.jsx(Vs,{onClick:()=>{te()},children:"Delete"})]})]})})]})}function Xi(){const n=$.c(12),e=En(),t=Nn();let s;n[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},n[0]=s):s=n[0];const r=zn(s);let i;n[1]!==t?(i=d=>t({to:".",search:f=>({...f,[d]:void 0})}),n[1]=t,n[2]=i):i=n[2];const a=i;let o,c;if(n[3]!==a||n[4]!==e||n[5]!==r.brand||n[6]!==r.preview||n[7]!==r.skill){c=Symbol.for("react.early_return_sentinel");e:{const d=r.preview?{key:"preview",path:r.preview,panel:l.jsx($r,{previewPath:r.preview,onClose:()=>a("preview")})}:r.skill?{key:"skill",path:r.skill,panel:l.jsx(Li,{skillPath:r.skill,onClose:()=>a("skill")},r.skill)}:r.brand?{key:"brand",path:r.brand,panel:l.jsx(Di,{brandPath:r.brand,onClose:()=>a("brand")},r.brand)}:null;if(e){let u;n[10]===Symbol.for("react.memo_cache_sentinel")?(u=l.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden bg-background",children:l.jsx(Tt,{children:l.jsx(Bt,{})})}),n[10]=u):u=n[10],c=u;break e}let f;n[11]===Symbol.for("react.memo_cache_sentinel")?(f=l.jsx(fn,{order:1,minSize:30,defaultSize:55,children:l.jsx("div",{className:"h-full p-0.5 pt-0.25",children:l.jsx("div",{className:"card-shadow flex h-full flex-col overflow-hidden rounded-[0.75rem] bg-background",children:l.jsx(Tt,{children:l.jsx(Bt,{})})})})}),n[11]=f):f=n[11],o=l.jsxs(Yl,{direction:"horizontal",className:"min-h-0 flex-1 pt-0 pr-1 pb-1 pl-0",children:[f,d&&l.jsxs(l.Fragment,{children:[l.jsx(Ys.Tabs,{children:l.jsx(Tr,{title:le(d.path),icon:{kind:"component",Component:u=>d.key==="preview"?l.jsx(Se,{filename:le(d.path),...u}):d.key==="skill"?l.jsx(qt,{...u}):l.jsx(ht,{...u})},active:!0,onClick:()=>a(d.key)})}),l.jsx(Jl,{className:"bg-sidebar"}),l.jsx(fn,{order:2,minSize:25,defaultSize:45,children:l.jsx("div",{className:"h-full p-0.5 pt-0.25",children:l.jsx("div",{className:"card-shadow flex h-full flex-col overflow-hidden rounded-[0.75rem] bg-background",children:l.jsx(Tt,{children:d.panel})})})})]})]})}n[3]=a,n[4]=e,n[5]=r.brand,n[6]=r.preview,n[7]=r.skill,n[8]=o,n[9]=c}else o=n[8],c=n[9];return c!==Symbol.for("react.early_return_sentinel")?c:o}const Wa=Object.freeze(Object.defineProperty({__proto__:null,LibraryPage:Bt,default:Xi},Symbol.toStringTag,{value:"Module"}));export{Yt as A,Ei as B,bt as C,_a as D,lr as E,os as F,Ka as G,wr as H,Ra as I,rr as J,La as K,$r as L,Ua as M,Ba as N,Aa as O,Wa as P,fn as R,Ii as S,Dr as T,Ta as a,lt as b,fl as c,Da as d,sr as e,Fa as f,ar as g,Ma as h,er as i,ds as j,as as k,On as l,jl as m,Ln as n,xn as o,Bt as p,Jl as q,Yl as r,Tr as s,Ti as t,At as u,Ia as v,Ha as w,qa as x,or as y,Oa as z};
173
+ `);async function wn(n){const e=await fetch(n,{credentials:"include"});if(!e.ok)throw new Error(`fetch failed: ${e.status}`);return e.text()}function zi(n,e){const t=e?`<style>${e}</style>`:"";return n.replaceAll("{{{slides}}}",Ni).replaceAll("{{title}}",Si).replace(/(src=")(\/deck-runtime\/)/g,`$1${window.location.origin}$2`).replace("</head>",`${t}</head>`)}function Ci(n){const e=$.c(23),{readUrl:t,title:s,tokensUrl:r}=n;let i;e[0]!==t?(i=Q.fileText(t),e[0]=t,e[1]=i):i=e[1];let a;e[2]!==t?(a=()=>wn(t),e[2]=t,e[3]=a):a=e[3];let o;e[4]!==i||e[5]!==a?(o={queryKey:i,queryFn:a,staleTime:6e4,retry:!1},e[4]=i,e[5]=a,e[6]=o):o=e[6];const c=ie(o);let d;e[7]!==r?(d=Q.fileText(r??""),e[7]=r,e[8]=d):d=e[8];const f=!!r;let u;e[9]!==r?(u=()=>wn(r??""),e[9]=r,e[10]=u):u=e[10];let h;e[11]!==d||e[12]!==f||e[13]!==u?(h={queryKey:d,enabled:f,queryFn:u,staleTime:6e4,retry:!1},e[11]=d,e[12]=f,e[13]=u,e[14]=h):h=e[14];const m=ie(h);if(c.isPending||r&&m.isPending){let x;return e[15]===Symbol.for("react.memo_cache_sentinel")?(x=l.jsx("div",{className:"flex h-full w-full items-center justify-center p-6",children:l.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=l.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=m.data??null;let g;e[17]!==p||e[18]!==c.data?(g=zi(c.data,p),e[17]=p,e[18]=c.data,e[19]=g):g=e[19];let b;return e[20]!==g||e[21]!==s?(b=l.jsx("iframe",{title:s,srcDoc:g,sandbox:"allow-scripts",className:"block h-full w-full border-0 bg-white"}),e[20]=g,e[21]=s,e[22]=b):b=e[22],b}async function jn(n){const e=await fetch(n,{credentials:"include"});if(!e.ok)throw new Error(`fetch failed: ${e.status}`);return e.text()}function Ke(n){const e=$.c(2),{children:t}=n;let s;return e[0]!==t?(s=l.jsx("p",{className:"text-sm font-medium text-foreground",children:t}),e[0]=t,e[1]=s):s=e[1],s}function $i(n){const e=$.c(16),{family:t,tokens:s,editing:r,valueOf:i,onEdit:a}=n;let o;e[0]!==t?(o=l.jsx("span",{className:"text-xs text-muted-foreground",children:t}),e[0]=t,e[1]=o):o=e[1];let c;if(e[2]!==r||e[3]!==a||e[4]!==s||e[5]!==i){let u;e[7]!==r||e[8]!==a||e[9]!==i?(u=h=>{const m=i(h),p=`${h.name.replace(/^--brand-/,"")}: ${m}`;return r&&/^#/.test(m)?l.jsx("input",{type:"color","aria-label":h.name,title:p,value:Ur(m),onChange:g=>a(h.name,g.target.value),className:"size-7 cursor-pointer rounded-md border border-border/60 bg-transparent p-0.5"},h.name):l.jsx("span",{title:p,className:"size-7 rounded-md border border-border/60",style:{backgroundColor:m}},h.name)},e[7]=r,e[8]=a,e[9]=i,e[10]=u):u=e[10],c=s.map(u),e[2]=r,e[3]=a,e[4]=s,e[5]=i,e[6]=c}else c=e[6];let d;e[11]!==c?(d=l.jsx("div",{className:"flex flex-wrap gap-1",children:c}),e[11]=c,e[12]=d):d=e[12];let f;return e[13]!==o||e[14]!==d?(f=l.jsxs("div",{className:"flex flex-col gap-1.5",children:[o,d]}),e[13]=o,e[14]=d,e[15]=f):f=e[15],f}function Pi(n){const e=$.c(9),{token:t,value:s}=n;if(t.kind==="space"){let i;return e[0]!==s?(i=l.jsx("span",{className:"flex h-7 w-16 shrink-0 items-center",children:l.jsx("span",{className:"h-1.5 rounded-full bg-primary",style:{width:s,maxWidth:"100%"}})}),e[0]=s,e[1]=i):i=e[1],i}if(t.kind==="radius"){let i;return e[2]!==s?(i=l.jsx("span",{className:"size-7 shrink-0 border border-border bg-muted/50",style:{borderRadius:s}}),e[2]=s,e[3]=i):i=e[3],i}if(t.kind==="shadow"){let i;return e[4]!==s?(i=l.jsx("span",{className:"size-7 shrink-0 rounded-md bg-background",style:{boxShadow:s}}),e[4]=s,e[5]=i):i=e[5],i}if(t.kind==="type"&&/^--brand-text-/.test(t.name)){const i=`min(${s}, 22px)`;let a;return e[6]!==i?(a=l.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]=a):a=e[7],a}let r;return e[8]===Symbol.for("react.memo_cache_sentinel")?(r=l.jsx("span",{className:"size-7 shrink-0"}),e[8]=r):r=e[8],r}function ys(n){const e=$.c(17),{token:t,value:s,editing:r,onEdit:i}=n;let a;e[0]!==t||e[1]!==s?(a=l.jsx(Pi,{token:t,value:s}),e[0]=t,e[1]=s,e[2]=a):a=e[2];let o;if(e[3]!==t.name){let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=/^--brand-/,e[5]=u):u=e[5],o=t.name.replace(u,""),e[3]=t.name,e[4]=o}else o=e[4];let c;e[6]!==o?(c=l.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:o}),e[6]=o,e[7]=c):c=e[7];let d;e[8]!==r||e[9]!==i||e[10]!==t.name||e[11]!==s?(d=r?l.jsx(Xe,{value:s,onChange:u=>i(t.name,u.target.value),className:"h-8 w-40 font-mono text-xs"}):l.jsx("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:s}),e[8]=r,e[9]=i,e[10]=t.name,e[11]=s,e[12]=d):d=e[12];let f;return e[13]!==a||e[14]!==c||e[15]!==d?(f=l.jsxs("div",{className:"flex items-center gap-3",children:[a,c,d]}),e[13]=a,e[14]=c,e[15]=d,e[16]=f):f=e[16],f}function Be(n){const e=$.c(16),{label:t,tokens:s,editing:r,valueOf:i,onEdit:a}=n;if(s.length===0)return null;let o;e[0]!==t?(o=l.jsx(Ke,{children:t}),e[0]=t,e[1]=o):o=e[1];let c;if(e[2]!==r||e[3]!==a||e[4]!==s||e[5]!==i){let u;e[7]!==r||e[8]!==a||e[9]!==i?(u=h=>l.jsx(ys,{token:h,value:i(h),editing:r,onEdit:a},h.name),e[7]=r,e[8]=a,e[9]=i,e[10]=u):u=e[10],c=s.map(u),e[2]=r,e[3]=a,e[4]=s,e[5]=i,e[6]=c}else c=e[6];let d;e[11]!==c?(d=l.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]!==o||e[14]!==d?(f=l.jsxs("div",{className:"flex flex-col gap-3",children:[o,d]}),e[13]=o,e[14]=d,e[15]=f):f=e[15],f}function vs({brandPath:n,onClose:e,variant:t}){const{org:s}=ce(),r=zt(n),i=r.volume??"",a=r.dirPath,o=le(a),c=r.readOnly,d=Je(),f=lt(),u=An(i),{upload:h,remove:m}=At(i),p=k.useRef(null),g=Wt(i,a),b=g.data??[],x=D=>b.some(re=>re.kind==="file"&&le(re.path)===D),y=x("tokens.css"),j=x("brand.md"),N=x("slides-theme.html"),z=Kr(b),C=f(i,`${a}/tokens.css`),w=f(i,`${a}/brand.md`),M=f(i,`${a}/slides-theme.html`),I=ie({queryKey:Q.fileText(C),enabled:y,queryFn:()=>jn(C),staleTime:6e4,retry:!1}),F=ie({queryKey:Q.fileText(w),enabled:j,queryFn:()=>jn(w),staleTime:6e4,retry:!1}),[v,P]=k.useState(!1),[W,A]=k.useState({}),[_,B]=k.useState(null),[G,q]=k.useState(!1),[ee,Z]=k.useState(!1),[L,K]=k.useState("deck"),S=I.data?ps(I.data):[],O=D=>S.find(re=>re.name===D)?.value,R=D=>W[D.name]??D.value,U=Hr(S),T=S.filter(D=>D.kind==="font"),H=S.filter(D=>D.kind==="type"),Y=S.filter(D=>D.kind==="space"),te=S.filter(D=>D.kind==="radius"),fe=S.filter(D=>D.kind==="shadow"),E=S.filter(D=>D.kind==="motion"),X=S.filter(D=>D.kind==="other"),ne=(D,re)=>A(dt=>({...dt,[D]:re})),ge=N&&L==="deck",Ne=_??F.data??"",Pe=Object.entries(W).filter(([D,re])=>O(D)!==re),ae=_!==null&&_!==(F.data??""),ot=Pe.length>0||ae;function Et(){A({}),B(null),P(!1)}async function Ee(){q(!0);try{if(Pe.length>0){let D=I.data??"";for(const[re,dt]of Pe)D=qr(D,re,dt);await u.mutateAsync({path:`${a}/tokens.css`,body:D,contentType:"text/css; charset=utf-8"}),d.invalidateQueries({queryKey:Q.fileText(C)})}ae&&_!==null&&(await u.mutateAsync({path:`${a}/brand.md`,body:_,contentType:"text/markdown; charset=utf-8"}),d.invalidateQueries({queryKey:Q.fileText(w)})),d.invalidateQueries({queryKey:Q.orgFsVolume(s.id,i)}),d.invalidateQueries({queryKey:Q.orgFsRecent(s.id)}),A({}),B(null),P(!1),ue.success("Brand saved")}catch(D){ue.error(D instanceof Error?D.message:"Failed to save brand")}finally{q(!1)}}async function ct(D){const re=D?.[0];if(!re)return;const tn=`logo.${(re.name.split(".").pop()??"png").toLowerCase()}`;try{await h.mutateAsync({dir:a,files:[new File([re],tn,{type:re.type})]}),z&&le(z)!==tn&&await m.mutateAsync(z),ue.success("Logo updated")}catch(nn){ue.error(nn instanceof Error?nn.message:"Logo upload failed")}finally{p.current&&(p.current.value="")}}const Dt=!g.isPending&&!y&&!j&&!z;return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-3",children:[l.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:l.jsx(ht,{size:18})}),t==="dialog"?l.jsx(Ue,{className:"flex-1 truncate text-base font-medium text-foreground",children:o}):l.jsx("span",{className:"flex-1 truncate text-base font-medium text-foreground",children:o}),!c&&(v?l.jsxs(l.Fragment,{children:[l.jsx(J,{variant:"ghost",size:"sm",onClick:Et,disabled:G,children:"Cancel"}),l.jsx(J,{size:"sm",disabled:!ot||G,onClick:()=>{Ee()},children:G?"Saving…":"Save"})]}):l.jsxs(J,{variant:"outline",size:"sm",onClick:()=>P(!0),children:[l.jsx(Ls,{size:14}),"Edit"]})),t==="dialog"?l.jsx(Tn,{asChild:!0,children:l.jsx(J,{variant:"ghost",size:"icon",className:"size-8 shrink-0",children:l.jsx(pt,{size:16})})}):l.jsx(J,{variant:"ghost",size:"icon",className:"size-8 shrink-0",onClick:e,children:l.jsx(pt,{size:16})})]}),l.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:g.isPending?l.jsxs("div",{className:"flex flex-col gap-3 p-6",children:[l.jsx(oe,{className:"h-40 w-full rounded-xl"}),l.jsx(oe,{className:"h-4 w-1/3"}),l.jsx(oe,{className:"h-4 w-2/3"})]}):Dt?l.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"This brand is no longer available."}):l.jsxs(l.Fragment,{children:[(N||y)&&l.jsxs("div",{className:"shrink-0 border-b border-border",children:[l.jsxs("div",{role:"button",tabIndex:0,"aria-label":ee?"Show preview":"Hide preview",onClick:()=>Z(D=>!D),onKeyDown:D=>{(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),Z(re=>!re))},className:"flex cursor-pointer items-center justify-between gap-2 px-4 py-2.5 hover:bg-muted/40",children:[l.jsxs("div",{className:"flex gap-0.5 rounded-lg bg-muted p-0.5 text-xs font-medium",onClick:D=>D.stopPropagation(),children:[N&&l.jsx("button",{type:"button",onClick:()=>{K("deck"),Z(!1)},className:de("rounded-md px-2.5 py-1",ge?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Deck"}),l.jsx("button",{type:"button",onClick:()=>{K("components"),Z(!1)},className:de("rounded-md px-2.5 py-1",ge?"text-muted-foreground hover:text-foreground":"bg-background text-foreground shadow-sm"),children:"Components"})]}),ee?l.jsx(el,{size:16,className:"shrink-0 text-muted-foreground"}):l.jsx(tl,{size:16,className:"shrink-0 text-muted-foreground"})]}),!ee&&l.jsx("div",{className:"px-4 pb-4",children:l.jsx("div",{className:de("w-full overflow-hidden rounded-xl border border-border bg-muted/30",ge?"aspect-[16/9]":"h-96"),children:ge?l.jsx(Ci,{readUrl:M,title:`${o} deck theme`,tokensUrl:C}):l.jsx(ki,{tokensUrl:C})})})]}),l.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-8 overflow-y-auto p-6",children:[l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsx(Ke,{children:"Logo"}),l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx("div",{className:"flex size-24 items-center justify-center overflow-hidden rounded-xl border border-border bg-muted/30",children:z?l.jsx("img",{src:f(i,z),alt:`${o} logo`,className:"max-h-full max-w-full object-contain"}):l.jsx(ht,{size:28,className:"text-muted-foreground/50"})}),v&&l.jsxs("div",{children:[l.jsxs(J,{variant:"outline",size:"sm",disabled:h.isPending,onClick:()=>p.current?.click(),children:[l.jsx(mt,{size:14}),z?"Replace logo":"Add logo"]}),l.jsx("input",{ref:p,type:"file",accept:"image/*",className:"hidden",onChange:D=>{ct(D.target.files)}})]})]})]}),U.length>0&&l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsx(Ke,{children:"Colors"}),U.map(D=>l.jsx($i,{family:D.family,tokens:D.tokens,editing:v,valueOf:R,onEdit:ne},D.family))]}),(T.length>0||H.length>0)&&l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsx(Ke,{children:"Typography"}),T.map(D=>l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsx("span",{className:"text-xs text-muted-foreground",children:D.name.replace(/^--brand-font-?/,"")||"font"}),v?l.jsx(Xe,{value:R(D),onChange:re=>ne(D.name,re.target.value),className:"h-9"}):l.jsx("span",{className:"truncate text-lg text-foreground",style:{fontFamily:R(D)},children:R(D)})]},D.name)),H.map(D=>l.jsx(ys,{token:D,value:R(D),editing:v,onEdit:ne},D.name))]}),l.jsx(Be,{label:"Spacing",tokens:Y,editing:v,valueOf:R,onEdit:ne}),l.jsx(Be,{label:"Radius",tokens:te,editing:v,valueOf:R,onEdit:ne}),l.jsx(Be,{label:"Shadows",tokens:fe,editing:v,valueOf:R,onEdit:ne}),l.jsx(Be,{label:"Motion",tokens:E,editing:v,valueOf:R,onEdit:ne}),l.jsx(Be,{label:"Tokens",tokens:X,editing:v,valueOf:R,onEdit:ne}),l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsx(Ke,{children:"Voice & guidelines"}),v?l.jsx(Zs,{value:Ne,onChange:D=>B(D.target.value),placeholder:"Describe the brand voice, tone, do's and don'ts…",className:"min-h-48 font-mono text-sm"}):F.isPending&&j?l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx(oe,{className:"h-3 w-full"}),l.jsx(oe,{className:"h-3 w-5/6"})]}):Ne.trim()?l.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:l.jsx(Kt,{id:`brand-preview-${n}`,text:Ne})}):l.jsx("p",{className:"text-sm text-muted-foreground",children:"No brand voice written yet."})]})]})]})})]})}function Ei(n){const e=$.c(8),{brandPath:t,onClose:s}=n;let r;e[0]!==s?(r=o=>{o||s()},e[0]=s,e[1]=r):r=e[1];let i;e[2]!==t||e[3]!==s?(i=l.jsx(Ze,{className:"flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-2xl!",closeButtonClassName:"hidden",children:l.jsx(vs,{brandPath:t,onClose:s,variant:"dialog"})}),e[2]=t,e[3]=s,e[4]=i):i=e[4];let a;return e[5]!==r||e[6]!==i?(a=l.jsx(et,{open:!0,onOpenChange:r,children:i}),e[5]=r,e[6]=i,e[7]=a):a=e[7],a}function Di(n){const e=$.c(3),{brandPath:t,onClose:s}=n;let r;return e[0]!==t||e[1]!==s?(r=l.jsx("div",{className:"flex h-full w-full flex-col overflow-hidden bg-background",children:l.jsx(vs,{brandPath:t,onClose:s,variant:"panel"})}),e[0]=t,e[1]=s,e[2]=r):r=e[2],r}function Ti(n){const e=$.c(9),{previewPath:t,onClose:s,showSeeInLibrary:r}=n,i=r===void 0?!1:r;let a;e[0]!==s?(a=d=>{d||s()},e[0]=s,e[1]=a):a=e[1];let o;e[2]!==s||e[3]!==t||e[4]!==i?(o=l.jsx(Ze,{className:"flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-5xl!",children:l.jsx(hs,{previewPath:t,onClose:s,showSeeInLibrary:i,variant:"dialog"})}),e[2]=s,e[3]=t,e[4]=i,e[5]=o):o=e[5];let c;return e[6]!==a||e[7]!==o?(c=l.jsx(et,{open:!0,onOpenChange:a,children:o}),e[6]=a,e[7]=o,e[8]=c):c=e[8],c}function ws(n){const e=$.c(23),{skillPath:t,onClose:s,variant:r}=n,i=zt(t),{volume:a,dirPath:o}=i,c=lt(),d=c(a??"",`${o}/SKILL.md`),f=Q.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 h;e[2]!==f||e[3]!==u?(h={queryKey:f,queryFn:u,staleTime:6e4,retry:!1},e[2]=f,e[3]=u,e[4]=h):h=e[4];const m=ie(h),p=Wt(a??"",o);let g;e[5]!==o?(g=le(o),e[5]=o,e[6]=g):g=e[6];const b=g;let x;e[7]!==m.data?(x=m.data?xs(m.data):null,e[7]=m.data,e[8]=x):x=e[8];const y=x,j=Mi;let N;e[9]===Symbol.for("react.memo_cache_sentinel")?(N=(q,ee)=>j(q.path)?-1:j(ee.path)?1:le(q.path).localeCompare(le(ee.path)),e[9]=N):N=e[9];const z=(p.data??[]).filter(Fi).sort(N),[C,w]=k.useState(null),M=C===null?null:z.find(q=>q.path===C)??null,I=y?.name??b;let F;e[10]===Symbol.for("react.memo_cache_sentinel")?(F=l.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:l.jsx(qt,{size:18})}),e[10]=F):F=e[10];let v;e[11]!==I||e[12]!==r?(v=r==="dialog"?l.jsx(Ue,{className:"flex-1 truncate text-base font-medium text-foreground",children:I}):l.jsx("span",{className:"flex-1 truncate text-base font-medium text-foreground",children:I}),e[11]=I,e[12]=r,e[13]=v):v=e[13];let P;e[14]!==s||e[15]!==r?(P=r==="dialog"?l.jsx(Tn,{asChild:!0,children:l.jsx(J,{variant:"ghost",size:"icon",className:"size-8 shrink-0",children:l.jsx(pt,{size:16})})}):l.jsx(J,{variant:"ghost",size:"icon",className:"size-8 shrink-0",onClick:s,children:l.jsx(pt,{size:16})}),e[14]=s,e[15]=r,e[16]=P):P=e[16];let W;e[17]!==v||e[18]!==P?(W=l.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-3",children:[F,v,P]}),e[17]=v,e[18]=P,e[19]=W):W=e[19];let A;e[20]===Symbol.for("react.memo_cache_sentinel")?(A=l.jsx("p",{className:"px-2 py-1.5 text-sm font-medium text-foreground",children:"Files"}),e[20]=A):A=e[20];const _="relative flex min-w-0 flex-1 flex-col overflow-y-auto",B=M?l.jsx(ds,{file:{key:M.path,filename:le(M.path),size:M.size,downloadUrl:c(a??"",M.path)}}):m.isPending?l.jsxs("div",{className:"flex flex-col gap-2 p-6",children:[l.jsx(oe,{className:"h-4 w-1/3"}),l.jsx(oe,{className:"h-3 w-full"}),l.jsx(oe,{className:"h-3 w-5/6"}),l.jsx(oe,{className:"h-3 w-2/3"})]}):m.isError||!y?l.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"This skill is no longer available."}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex flex-col gap-4 border-b border-border p-6",children:[l.jsx("p",{className:"text-sm font-medium text-foreground",children:"Description"}),l.jsx("p",{className:"text-base text-muted-foreground",children:y.description??"Claude Code skill"})]}),l.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none p-6",children:l.jsx(Kt,{id:`skill-preview-${t}`,text:y.body})})]});let G;return e[21]!==B?(G=l.jsx("div",{className:_,children:B}),e[21]=B,e[22]=G):G=e[22],l.jsxs(l.Fragment,{children:[W,l.jsxs("div",{className:"flex min-h-0 flex-1",children:[l.jsxs("div",{className:"flex w-[220px] shrink-0 flex-col gap-1 overflow-y-auto border-r border-border bg-muted p-3",children:[A,p.isPending?l.jsx(oe,{className:"mx-2 h-4 w-24"}):z.map(q=>{const ee=j(q.path)?M===null:C===q.path;return l.jsxs("button",{type:"button",onClick:()=>w(j(q.path)?null:q.path),className:de("flex items-center gap-2.5 rounded-lg px-2 py-1.5 text-left",ee?"bg-background shadow-sm":"hover:bg-muted/60"),children:[l.jsx(Se,{filename:le(q.path),className:"h-6 w-5 shrink-0"}),l.jsx("span",{className:de("truncate text-sm",ee?"text-foreground":"text-muted-foreground"),children:le(q.path)})]},q.path)})]}),G]})]})}function Fi(n){return n.kind==="file"}function Mi(n){return le(n)==="SKILL.md"}function Ii(n){const e=$.c(8),{skillPath:t,onClose:s}=n;let r;e[0]!==s?(r=o=>{o||s()},e[0]=s,e[1]=r):r=e[1];let i;e[2]!==s||e[3]!==t?(i=l.jsx(Ze,{className:"flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-5xl!",closeButtonClassName:"hidden",children:l.jsx(ws,{skillPath:t,onClose:s,variant:"dialog"})}),e[2]=s,e[3]=t,e[4]=i):i=e[4];let a;return e[5]!==r||e[6]!==i?(a=l.jsx(et,{open:!0,onOpenChange:r,children:i}),e[5]=r,e[6]=i,e[7]=a):a=e[7],a}function Li(n){const e=$.c(3),{skillPath:t,onClose:s}=n;let r;return e[0]!==s||e[1]!==t?(r=l.jsx("div",{className:"flex h-full w-full flex-col overflow-hidden bg-background",children:l.jsx(ws,{skillPath:t,onClose:s,variant:"panel"})}),e[0]=s,e[1]=t,e[2]=r):r=e[2],r}function en(n){return`${window.location.origin}${n}`}function Ge(n){if(n.shareMode==="password")return"password";if(n.shareMode==="public"||n.readPublic)return"public";if(n.effectivePublic)return"inherited"}const js=[{id:"home",description:"Your organization's home folder",glyph:Os},{id:"uploads",description:"Files your team uploads",glyph:mt},{id:"outputs",description:"Agent run outputs",glyph:_s}],Oi=6;function ks(n,e,t){const s=e.includes("/")?e.slice(0,e.lastIndexOf("/")):"",r=Jt(n),i=r?`public/${r}`:n==="home"?ms(t):n;return s?`${i}/${s}`:i}function $e(n){const e=$.c(2),{children:t}=n;let s;return e[0]!==t?(s=l.jsx("p",{className:"text-[13px] text-foreground",children:t}),e[0]=t,e[1]=s):s=e[1],s}function ke(n){const e=$.c(2),{children:t}=n;let s;return e[0]!==t?(s=l.jsx("div",{className:"@container",children:l.jsx("div",{className:"grid grid-cols-1 gap-3 @[440px]:grid-cols-2 @[660px]:grid-cols-3",children:t})}),e[0]=t,e[1]=s):s=e[1],s}function $t(n){const e=$.c(2),{rows:t}=n,s=t===void 0?1:t;let r;return e[0]!==s?(r=l.jsx(ke,{children:Array.from({length:s*3},Ri)}),e[0]=s,e[1]=r):r=e[1],r}function Ri(n,e){return l.jsx(oe,{className:"h-16 rounded-2xl"},e)}function Pt(n){const e=$.c(2),{children:t}=n;let s;return e[0]!==t?(s=l.jsx("p",{className:"text-sm text-muted-foreground",children:t}),e[0]=t,e[1]=s):s=e[1],s}function Ai(n){const e=$.c(6),{volume:t,displayName:s,description:r,glyph:i,onOpen:a}=n,o=ul(t),c=s??t,d=o.data?`${o.data.files} files`:void 0;let f;return e[0]!==r||e[1]!==i||e[2]!==a||e[3]!==c||e[4]!==d?(f=l.jsx(Ct,{name:c,meta:d,subtitle:r,glyph:i,onOpen:a}),e[0]=r,e[1]=i,e[2]=a,e[3]=c,e[4]=d,e[5]=f):f=e[5],f}function _i(n){const e=$.c(8),{segments:t,onNavigate:s}=n;let r;e[0]!==s?(r=l.jsx("button",{type:"button",className:"text-muted-foreground hover:text-foreground hover:underline",onClick:()=>s(""),children:"Library"}),e[0]=s,e[1]=r):r=e[1];let i;e[2]!==s||e[3]!==t?(i=t.map((o,c)=>{const d=t.slice(0,c+1).join("/"),f=c===t.length-1;return l.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[l.jsx(Es,{size:12,className:"shrink-0 text-muted-foreground"}),f?l.jsx("span",{className:"truncate font-medium text-foreground",children:o}):l.jsx("button",{type:"button",className:"truncate text-muted-foreground hover:text-foreground hover:underline",onClick:()=>s(d),children:o})]},d)}),e[2]=s,e[3]=t,e[4]=i):i=e[4];let a;return e[5]!==r||e[6]!==i?(a=l.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]=a):a=e[7],a}function Ui(n){const e=$.c(32),{query:t,stale:s,onOpenFile:r,onShare:i,onDelete:a}=n,{org:o}=ce(),c=lt(),d=hl(t);let f;e[0]!==c||e[1]!==i?(f=z=>i({volume:z.volume,path:z.path,kind:"file",shareMode:z.shareMode??"private",effectivePublic:z.effectivePublic??!1,url:en(c(z.volume,z.path))}),e[0]=c,e[1]=i,e[2]=f):f=e[2];const u=f;if(d.isPending){let z;return e[3]===Symbol.for("react.memo_cache_sentinel")?(z=l.jsx($t,{rows:2}),e[3]=z):z=e[3],z}let h;e[4]!==d.data?(h=d.data??[],e[4]=d.data,e[5]=h):h=e[5];const m=h;if(m.length===0){let z;return e[6]!==t?(z=l.jsxs(Pt,{children:["No files match “",t,"”."]}),e[6]=t,e[7]=z):z=e[7],z}const p=(s||d.isPlaceholderData)&&"opacity-50";let g;e[8]!==p?(g=de("flex flex-col gap-3",p),e[8]=p,e[9]=g):g=e[9];const b=m.length===1?"result":"results";let x;e[10]!==m.length||e[11]!==b?(x=l.jsxs($e,{children:[m.length," ",b]}),e[10]=m.length,e[11]=b,e[12]=x):x=e[12];let y;if(e[13]!==c||e[14]!==a||e[15]!==r||e[16]!==o||e[17]!==m||e[18]!==u){let z;e[20]!==c||e[21]!==a||e[22]!==r||e[23]!==o||e[24]!==u?(z=C=>{const w=Jt(C.volume)!==null;return l.jsx(bs,{filename:le(C.path),updatedAt:C.updatedAt,downloadUrl:c(C.volume,C.path),subtitle:ks(C.volume,C.path,o.slug),publicState:Ge(C),onOpen:()=>r(Nr(C.volume,C.path)),onShare:w?void 0:()=>u(C),onDelete:w?void 0:()=>a({volume:C.volume,path:C.path,kind:"file"})},`${C.volume}/${C.path}`)},e[20]=c,e[21]=a,e[22]=r,e[23]=o,e[24]=u,e[25]=z):z=e[25],y=m.map(z),e[13]=c,e[14]=a,e[15]=r,e[16]=o,e[17]=m,e[18]=u,e[19]=y}else y=e[19];let j;e[26]!==y?(j=l.jsx(ke,{children:y}),e[26]=y,e[27]=j):j=e[27];let N;return e[28]!==g||e[29]!==x||e[30]!==j?(N=l.jsxs("div",{className:g,children:[x,j]}),e[28]=g,e[29]=x,e[30]=j,e[31]=N):N=e[31],N}function Bi(n){const e=$.c(24),{onOpenDir:t,onOpenFile:s,onShare:r,onDelete:i}=n,{org:a}=ce(),o=fl(),c=Rn(),d=lt();let f;e[0]!==d||e[1]!==r?(f=y=>r({volume:y.volume,path:y.path,kind:"file",shareMode:y.shareMode??"private",effectivePublic:y.effectivePublic??!1,url:en(d(y.volume,y.path))}),e[0]=d,e[1]=r,e[2]=f):f=e[2];const u=f;let h;if(e[3]!==d||e[4]!==i||e[5]!==s||e[6]!==a||e[7]!==o.data||e[8]!==o.isPending||e[9]!==u){const y=(o.data??[]).slice(0,Oi);h=o.isPending?l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsx($e,{children:"Recently added"}),l.jsx($t,{})]}):y.length>0?l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsx($e,{children:"Recently added"}),l.jsx(ke,{children:y.map(j=>l.jsx(bi,{filename:le(j.path),updatedAt:j.updatedAt,size:j.size,downloadUrl:d(j.volume,j.path),subtitle:ks(j.volume,j.path,a.slug),publicState:Ge(j),onOpen:()=>s(`${j.volume}/${j.path}`),onShare:()=>u(j),onDelete:()=>i({volume:j.volume,path:j.path,kind:"file"})},`${j.volume}/${j.path}`))})]}):l.jsx(Pt,{children:"No files yet — upload one, or ask an agent to produce something."}),e[3]=d,e[4]=i,e[5]=s,e[6]=a,e[7]=o.data,e[8]=o.isPending,e[9]=u,e[10]=h}else h=e[10];let m;e[11]===Symbol.for("react.memo_cache_sentinel")?(m=l.jsx($e,{children:"Folders"}),e[11]=m):m=e[11];let p;e[12]!==t||e[13]!==a?(p=js.map(y=>l.jsx(Ai,{volume:y.id,displayName:y.id==="home"?ms(a.slug):void 0,description:y.description,glyph:y.glyph,onOpen:()=>t(y.id)},y.id)),e[12]=t,e[13]=a,e[14]=p):p=e[14];let g;e[15]!==t||e[16]!==c.data?.length?(g=(c.data?.length??0)>0&&l.jsx(Ct,{name:"public",meta:`${c.data?.length} sets`,subtitle:"Curated skill sets — read-only",glyph:yt,readOnly:!0,onOpen:()=>t("public")}),e[15]=t,e[16]=c.data?.length,e[17]=g):g=e[17];let b;e[18]!==p||e[19]!==g?(b=l.jsxs("div",{className:"flex flex-col gap-3",children:[m,l.jsxs(ke,{children:[p,g]})]}),e[18]=p,e[19]=g,e[20]=b):b=e[20];let x;return e[21]!==h||e[22]!==b?(x=l.jsxs(l.Fragment,{children:[h,b]}),e[21]=h,e[22]=b,e[23]=x):x=e[23],x}function Hi(n){const e=$.c(11),{onOpenDir:t}=n,s=Rn();if(s.isPending){let c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(c=l.jsx($t,{}),e[0]=c):c=e[0],c}let r;e[1]!==s.data?(r=s.data??[],e[1]=s.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=l.jsx(Pt,{children:"No public skill sets are configured."}),e[3]=c):c=e[3],c}let a;if(e[4]!==t||e[5]!==i){let c;e[7]!==t?(c=d=>l.jsx(Ct,{name:d,subtitle:"Read-only",readOnly:!0,onOpen:()=>t(`public/${d}`)},d),e[7]=t,e[8]=c):c=e[8],a=i.map(c),e[4]=t,e[5]=i,e[6]=a}else a=e[6];let o;return e[9]!==a?(o=l.jsx(ke,{children:a}),e[9]=a,e[10]=o):o=e[10],o}function qi(n){const e=$.c(34),{location:t,onOpenDir:s,onOpenFile:r,onOpenSkill:i,onOpenBrand:a,onShare:o,onDelete:c}=n,d=t.volume??"",f=Wt(d,t.dirPath),u=lt();if(f.isPending){let y;return e[0]===Symbol.for("react.memo_cache_sentinel")?(y=l.jsx($t,{rows:2}),e[0]=y):y=e[0],y}if(f.isError){const y=f.error instanceof Error?f.error.message:"Failed to load";let j;return e[1]!==y?(j=l.jsx("p",{className:"text-sm text-destructive",children:y}),e[1]=y,e[2]=j):j=e[2],j}let h,m,p,g,b;if(e[3]!==u||e[4]!==f.data||e[5]!==t||e[6]!==c||e[7]!==a||e[8]!==s||e[9]!==r||e[10]!==i||e[11]!==o||e[12]!==d){b=Symbol.for("react.early_return_sentinel");e:{const y=f.data??[],j=y.filter(Vi),N=y.filter(Gi),z=y.filter(Wi),C=y.filter(Ki);if(y.length===0){const v=t.readOnly?"Empty — this read-only set syncs from its GitHub source.":"Empty folder — upload a file or create a folder to get started.";let P;e[18]!==v?(P=l.jsx(Pt,{children:v}),e[18]=v,e[19]=P):P=e[19],b=P;break e}let w;e[20]!==t.readOnly||e[21]!==c||e[22]!==d?(w=v=>t.readOnly?void 0:()=>c({volume:d,path:v.path,kind:v.kind}),e[20]=t.readOnly,e[21]=c,e[22]=d,e[23]=w):w=e[23];const M=w;let I;e[24]!==u||e[25]!==t.readOnly||e[26]!==o||e[27]!==d?(I=v=>t.readOnly?void 0:()=>o({volume:d,path:v.path,kind:v.kind,shareMode:v.shareMode??"private",effectivePublic:v.effectivePublic??!1,url:v.kind==="file"?en(u(d,v.path)):void 0}),e[24]=u,e[25]=t.readOnly,e[26]=o,e[27]=d,e[28]=I):I=e[28];const F=I;h=j.length>0&&l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsx($e,{children:"Skills"}),l.jsx(ke,{children:j.map(v=>l.jsx(li,{dirName:le(v.path),updatedAt:v.updatedAt,skillMdUrl:u(d,`${v.path}/SKILL.md`),publicState:Ge(v),onOpen:()=>i(Le(t,v.path)),onBrowse:()=>s(Le(t,v.path)),onShare:F(v),onDelete:M(v)},v.path))})]}),m=N.length>0&&l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsx($e,{children:"Brands"}),l.jsx(ke,{children:N.map(v=>l.jsx(ai,{dirName:le(v.path),updatedAt:v.updatedAt,tokensUrl:u(d,`${v.path}/tokens.css`),onOpen:()=>a(Le(t,v.path)),onBrowse:()=>s(Le(t,v.path)),onDelete:M(v)},v.path))})]}),p=z.length>0&&l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsx($e,{children:"Folders"}),l.jsx(ke,{children:z.map(v=>l.jsx(Ct,{name:le(v.path),meta:rt(v.updatedAt),readOnly:t.readOnly,publicState:Ge(v),onOpen:()=>s(Le(t,v.path)),onShare:F(v),onDelete:M(v)},v.path))})]}),g=C.length>0&&l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsx($e,{children:"Files"}),l.jsx(ke,{children:C.map(v=>l.jsx(bs,{filename:le(v.path),updatedAt:v.updatedAt,downloadUrl:u(d,v.path),publicState:Ge(v),onOpen:()=>r(Le(t,v.path)),onShare:F(v),onDelete:M(v)},v.path))})]})}e[3]=u,e[4]=f.data,e[5]=t,e[6]=c,e[7]=a,e[8]=s,e[9]=r,e[10]=i,e[11]=o,e[12]=d,e[13]=h,e[14]=m,e[15]=p,e[16]=g,e[17]=b}else h=e[13],m=e[14],p=e[15],g=e[16],b=e[17];if(b!==Symbol.for("react.early_return_sentinel"))return b;let x;return e[29]!==h||e[30]!==m||e[31]!==p||e[32]!==g?(x=l.jsxs(l.Fragment,{children:[h,m,p,g]}),e[29]=h,e[30]=m,e[31]=p,e[32]=g,e[33]=x):x=e[33],x}function Ki(n){return n.kind==="file"}function Wi(n){return n.kind==="dir"&&!n.hasSkill&&!n.hasBrand}function Gi(n){return n.kind==="dir"&&n.hasBrand&&!n.hasSkill}function Vi(n){return n.kind==="dir"&&n.hasSkill}function Bt({onOpenFile:n,onOpenSkill:e,onOpenBrand:t}={}){const{org:s}=ce(),r=Je(),i=Nn(),a=En(),o=zn({strict:!1}),c=o.path??"",d=zt(c),f=d.segments.length===0,u=(E,X)=>i({to:".",search:ne=>({...ne,[E]:X||void 0})}),h=E=>u("path",E),m=(E,X)=>i({to:".",search:ne=>({...ne,preview:void 0,skill:void 0,brand:void 0,[E]:X})}),p=n??(E=>m("preview",E)),g=e??(E=>m("skill",E)),b=t??(E=>m("brand",E)),[x,y]=k.useState(""),j=Js(x.trim(),300),[N,z]=k.useState(null),[C,w]=k.useState(null),[M,I]=k.useState(!1),[F,v]=k.useState(""),P=k.useRef(null),[W,A]=k.useState(!1),_=k.useRef(0),B=d.readOnly?null:d.volume??"uploads",G=d.volume?d.dirPath:"",{upload:q,mkdir:ee}=At(B??"uploads"),{remove:Z}=At(N?.volume??"uploads");async function L(E){if(!(!B||!E||E.length===0))try{await q.mutateAsync({dir:G,files:[...E]}),ue.success(E.length===1?`Uploaded ${E[0]?.name}`:`Uploaded ${E.length} files`)}catch(X){ue.error(X instanceof Error?X.message:"Upload failed")}finally{P.current&&(P.current.value="")}}const K=B!==null,S=f?"uploads":d.segments.at(-1)??"this folder";function O(E){return E.dataTransfer.types.includes("Files")}function R(E){!K||!O(E)||(E.preventDefault(),_.current+=1,A(!0))}function U(E){!K||!O(E)||E.preventDefault()}function T(){K&&(_.current=Math.max(0,_.current-1),_.current===0&&A(!1))}function H(E){K&&(E.preventDefault(),_.current=0,A(!1),E.dataTransfer.files.length>0&&L(E.dataTransfer.files))}async function Y(){const E=F.trim();if(!(!B||!E))try{await ee.mutateAsync(G?`${G}/${E}`:E),ue.success(`Folder "${E}" created`),I(!1),v("")}catch(X){ue.error(X instanceof Error?X.message:"Failed to create folder")}}async function te(){if(!N)return;const E=N;try{await Z.mutateAsync(E.path),ue.success(`Deleted ${le(E.path)}`)}catch(X){ue.error(X instanceof Error?X.message:"Delete failed")}finally{z(null)}}function fe(){for(const E of js)r.invalidateQueries({queryKey:Q.orgFsVolume(s.id,E.id)});d.volume&&r.invalidateQueries({queryKey:Q.orgFsVolume(s.id,d.volume)}),r.invalidateQueries({queryKey:Q.orgFsRecent(s.id)}),r.invalidateQueries({queryKey:Q.orgFsSearchRoot(s.id)}),r.invalidateQueries({queryKey:Q.orgFsPublicSets(s.id)})}return l.jsxs("div",{className:"relative h-full",onDragEnter:R,onDragOver:U,onDragLeave:T,onDrop:H,children:[W&&l.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:l.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:[l.jsx(mt,{size:28,className:"text-primary"}),l.jsxs("p",{className:"text-sm font-medium text-foreground",children:["Drop to upload to ",S]})]})}),l.jsx("div",{className:"h-full overflow-y-auto",children:l.jsxs("div",{className:"mx-auto flex w-full max-w-[900px] flex-col gap-10 px-6 py-10 lg:px-10",children:[l.jsxs("div",{className:"flex flex-col gap-2",children:[!f&&l.jsx(_i,{segments:d.segments,onNavigate:h}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("h1",{className:"min-w-0 flex-1 truncate text-xl font-medium text-foreground",children:f?"Library":d.segments.at(-1)??"Library"}),l.jsx(J,{variant:"ghost",size:"icon",onClick:fe,"aria-label":"Refresh",children:l.jsx(Sn,{size:14})}),!f&&B&&l.jsxs(J,{variant:"outline",size:"sm",onClick:()=>I(!0),children:[l.jsx(Rs,{size:14}),"New folder"]}),d.readOnly?l.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[l.jsx(Cn,{size:12}),"Read-only"]}):l.jsxs(J,{size:"sm",disabled:q.isPending,onClick:()=>P.current?.click(),children:[l.jsx(mt,{size:14}),q.isPending?"Uploading…":"Upload file"]}),l.jsx("input",{ref:P,type:"file",multiple:!0,className:"hidden",onChange:E=>{L(E.target.files)}})]})]}),l.jsxs("div",{className:"relative",children:[l.jsx(As,{size:16,className:"pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 text-muted-foreground"}),l.jsx(Xe,{value:x,onChange:E=>y(E.target.value),onKeyDown:E=>{E.key==="Escape"&&y("")},placeholder:"Search all files…",className:"h-10 rounded-xl pr-9 pl-9"}),x&&l.jsx(J,{variant:"ghost",size:"icon",className:"absolute top-1/2 right-1.5 size-7 -translate-y-1/2",onClick:()=>y(""),"aria-label":"Clear search",children:l.jsx(Pn,{size:14})})]}),j?l.jsx(Ui,{query:j,stale:x.trim()!==j,onOpenFile:p,onShare:w,onDelete:z}):f?l.jsx(Bi,{onOpenDir:h,onOpenFile:p,onShare:w,onDelete:z}):d.volume===null?l.jsx(Hi,{onOpenDir:h}):l.jsx(qi,{location:d,onOpenDir:h,onOpenFile:p,onOpenSkill:g,onOpenBrand:b,onShare:w,onDelete:z},d.volume)]})}),a&&(o.preview?l.jsx(Ti,{previewPath:o.preview,onClose:()=>u("preview",null)}):o.skill?l.jsx(Ii,{skillPath:o.skill,onClose:()=>u("skill",null)},o.skill):o.brand?l.jsx(Ei,{brandPath:o.brand,onClose:()=>u("brand",null)},o.brand):null),l.jsx(et,{open:M,onOpenChange:I,children:l.jsxs(Ze,{children:[l.jsxs(Dn,{children:[l.jsx(Ue,{children:"New folder"}),l.jsxs(Xs,{children:["Create a folder in ",c||"the library","."]})]}),l.jsx(Xe,{autoFocus:!0,placeholder:"folder-name",value:F,onChange:E=>v(E.target.value),onKeyDown:E=>{E.key==="Enter"&&Y()}}),l.jsxs(Qs,{children:[l.jsx(J,{variant:"outline",onClick:()=>I(!1),children:"Cancel"}),l.jsx(J,{disabled:!F.trim()||ee.isPending,onClick:()=>{Y()},children:"Create"})]})]})}),l.jsx(Sr,{target:C,onOpenChange:E=>{E||w(null)}}),l.jsx(Us,{open:N!==null,onOpenChange:E=>{E||z(null)},children:l.jsxs(Bs,{children:[l.jsxs(Hs,{children:[l.jsxs(qs,{children:["Delete ",N?le(N.path):"","?"]}),l.jsx(Ks,{children:N?.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."})]}),l.jsxs(Ws,{children:[l.jsx(Gs,{children:"Cancel"}),l.jsx(Vs,{onClick:()=>{te()},children:"Delete"})]})]})})]})}function Xi(){const n=$.c(12),e=En(),t=Nn();let s;n[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},n[0]=s):s=n[0];const r=zn(s);let i;n[1]!==t?(i=d=>t({to:".",search:f=>({...f,[d]:void 0})}),n[1]=t,n[2]=i):i=n[2];const a=i;let o,c;if(n[3]!==a||n[4]!==e||n[5]!==r.brand||n[6]!==r.preview||n[7]!==r.skill){c=Symbol.for("react.early_return_sentinel");e:{const d=r.preview?{key:"preview",path:r.preview,panel:l.jsx($r,{previewPath:r.preview,onClose:()=>a("preview")})}:r.skill?{key:"skill",path:r.skill,panel:l.jsx(Li,{skillPath:r.skill,onClose:()=>a("skill")},r.skill)}:r.brand?{key:"brand",path:r.brand,panel:l.jsx(Di,{brandPath:r.brand,onClose:()=>a("brand")},r.brand)}:null;if(e){let u;n[10]===Symbol.for("react.memo_cache_sentinel")?(u=l.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden bg-background",children:l.jsx(Tt,{children:l.jsx(Bt,{})})}),n[10]=u):u=n[10],c=u;break e}let f;n[11]===Symbol.for("react.memo_cache_sentinel")?(f=l.jsx(fn,{order:1,minSize:30,defaultSize:55,children:l.jsx("div",{className:"h-full p-0.5 pt-0.25",children:l.jsx("div",{className:"card-shadow flex h-full flex-col overflow-hidden rounded-[0.75rem] bg-background",children:l.jsx(Tt,{children:l.jsx(Bt,{})})})})}),n[11]=f):f=n[11],o=l.jsxs(Yl,{direction:"horizontal",className:"min-h-0 flex-1 pt-0 pr-1 pb-1 pl-0",children:[f,d&&l.jsxs(l.Fragment,{children:[l.jsx(Ys.Tabs,{children:l.jsx(Tr,{title:le(d.path),icon:{kind:"component",Component:u=>d.key==="preview"?l.jsx(Se,{filename:le(d.path),...u}):d.key==="skill"?l.jsx(qt,{...u}):l.jsx(ht,{...u})},active:!0,onClick:()=>a(d.key)})}),l.jsx(Jl,{className:"bg-sidebar"}),l.jsx(fn,{order:2,minSize:25,defaultSize:45,children:l.jsx("div",{className:"h-full p-0.5 pt-0.25",children:l.jsx("div",{className:"card-shadow flex h-full flex-col overflow-hidden rounded-[0.75rem] bg-background",children:l.jsx(Tt,{children:d.panel})})})})]})]})}n[3]=a,n[4]=e,n[5]=r.brand,n[6]=r.preview,n[7]=r.skill,n[8]=o,n[9]=c}else o=n[8],c=n[9];return c!==Symbol.for("react.early_return_sentinel")?c:o}const Wa=Object.freeze(Object.defineProperty({__proto__:null,LibraryPage:Bt,default:Xi},Symbol.toStringTag,{value:"Module"}));export{Yt as A,Ei as B,bt as C,_a as D,lr as E,os as F,Ka as G,wr as H,Ra as I,rr as J,La as K,$r as L,Ua as M,Ba as N,Aa as O,Wa as P,Yl as R,Ii as S,Dr as T,Ta as a,lt as b,fl as c,Da as d,sr as e,Fa as f,ar as g,Ma as h,fn as i,Jl as j,er as k,ds as l,as as m,On as n,jl as o,Ln as p,xn as q,Bt as r,Tr as s,Ti as t,At as u,Ia as v,Ha as w,qa as x,or as y,Oa as z};
@@ -1 +1 @@
1
- import{r as h}from"./index-CJs4YG_y.js";var w=(o,i,l,s,c,t,m,d)=>{let r=document.documentElement,u=["light","dark"];function n(e){(Array.isArray(o)?o:[o]).forEach(a=>{let p=a==="class",S=p&&t?c.map(f=>t[f]||f):c;p?(r.classList.remove(...S),r.classList.add(t&&t[e]?t[e]:e)):r.setAttribute(a,e)}),y(e)}function y(e){d&&u.includes(e)&&(r.style.colorScheme=e)}function g(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(s)n(s);else try{let e=localStorage.getItem(i)||l,a=m&&e==="system"?g():e;n(a)}catch{}};h.createContext(void 0);h.memo(({forcedTheme:o,storageKey:i,attribute:l,enableSystem:s,enableColorScheme:c,defaultTheme:t,value:m,themes:d,nonce:r,scriptProps:u})=>{let n=JSON.stringify([l,i,t,o,d,m,s,c]).slice(1,-1);return h.createElement("script",{...u,suppressHydrationWarning:!0,nonce:typeof window>"u"?r:"",dangerouslySetInnerHTML:{__html:`(${w.toString()})(${n})`}})});
1
+ import{r as h}from"./index-CmqY5ba2.js";var w=(o,i,l,s,c,t,m,d)=>{let r=document.documentElement,u=["light","dark"];function n(e){(Array.isArray(o)?o:[o]).forEach(a=>{let p=a==="class",S=p&&t?c.map(f=>t[f]||f):c;p?(r.classList.remove(...S),r.classList.add(t&&t[e]?t[e]:e)):r.setAttribute(a,e)}),y(e)}function y(e){d&&u.includes(e)&&(r.style.colorScheme=e)}function g(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(s)n(s);else try{let e=localStorage.getItem(i)||l,a=m&&e==="system"?g():e;n(a)}catch{}};h.createContext(void 0);h.memo(({forcedTheme:o,storageKey:i,attribute:l,enableSystem:s,enableColorScheme:c,defaultTheme:t,value:m,themes:d,nonce:r,scriptProps:u})=>{let n=JSON.stringify([l,i,t,o,d,m,s,c]).slice(1,-1);return h.createElement("script",{...u,suppressHydrationWarning:!0,nonce:typeof window>"u"?r:"",dangerouslySetInnerHTML:{__html:`(${w.toString()})(${n})`}})});
@@ -1 +1 @@
1
- import{r as s,aR as L,aP as B,j as d,b6 as q,aM as x,aQ as E,b4 as K,aS as C,b5 as P,b7 as T,aO as _,bF as U,bE as V}from"./index-CJs4YG_y.js";var I="Radio",[z,w]=_(I),[H,Q]=z(I),k=s.forwardRef((a,c)=>{const{__scopeRadio:o,name:n,checked:e=!1,required:r,disabled:t,value:l="on",onCheck:f,form:R,...v}=a,[p,m]=s.useState(null),i=E(c,h=>m(h)),u=s.useRef(!1),b=p?R||!!p.closest("form"):!0;return d.jsxs(H,{scope:o,checked:e,disabled:t,children:[d.jsx(x.button,{type:"button",role:"radio","aria-checked":e,"data-state":A(e),"data-disabled":t?"":void 0,disabled:t,value:l,...v,ref:i,onClick:C(a.onClick,h=>{e||f?.(),b&&(u.current=h.isPropagationStopped(),u.current||h.stopPropagation())})}),b&&d.jsx(G,{control:p,bubbles:!u.current,name:n,value:l,checked:e,required:r,disabled:t,form:R,style:{transform:"translateX(-100%)"}})]})});k.displayName=I;var S="RadioIndicator",g=s.forwardRef((a,c)=>{const{__scopeRadio:o,forceMount:n,...e}=a,r=Q(S,o);return d.jsx(T,{present:n||r.checked,children:d.jsx(x.span,{"data-state":A(r.checked),"data-disabled":r.disabled?"":void 0,...e,ref:c})})});g.displayName=S;var W="RadioBubbleInput",G=s.forwardRef(({__scopeRadio:a,control:c,checked:o,bubbles:n=!0,...e},r)=>{const t=s.useRef(null),l=E(t,r),f=U(o),R=V(c);return s.useEffect(()=>{const v=t.current;if(!v)return;const p=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(p,"checked").set;if(f!==o&&i){const u=new Event("click",{bubbles:n});i.call(v,o),v.dispatchEvent(u)}},[f,o,n]),d.jsx(x.input,{type:"radio","aria-hidden":!0,defaultChecked:o,...e,tabIndex:-1,ref:l,style:{...e.style,...R,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});G.displayName=W;function A(a){return a?"checked":"unchecked"}var X=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],y="RadioGroup",[Y]=_(y,[P,w]),j=P(),N=w(),[J,Z]=Y(y),D=s.forwardRef((a,c)=>{const{__scopeRadioGroup:o,name:n,defaultValue:e,value:r,required:t=!1,disabled:l=!1,orientation:f,dir:R,loop:v=!0,onValueChange:p,...m}=a,i=j(o),u=L(R),[b,h]=B({prop:r,defaultProp:e??null,onChange:p,caller:y});return d.jsx(J,{scope:o,name:n,required:t,disabled:l,value:b,onValueChange:h,children:d.jsx(q,{asChild:!0,...i,orientation:f,dir:u,loop:v,children:d.jsx(x.div,{role:"radiogroup","aria-required":t,"aria-orientation":f,"data-disabled":l?"":void 0,dir:u,...m,ref:c})})})});D.displayName=y;var M="RadioGroupItem",O=s.forwardRef((a,c)=>{const{__scopeRadioGroup:o,disabled:n,...e}=a,r=Z(M,o),t=r.disabled||n,l=j(o),f=N(o),R=s.useRef(null),v=E(c,R),p=r.value===e.value,m=s.useRef(!1);return s.useEffect(()=>{const i=b=>{X.includes(b.key)&&(m.current=!0)},u=()=>m.current=!1;return document.addEventListener("keydown",i),document.addEventListener("keyup",u),()=>{document.removeEventListener("keydown",i),document.removeEventListener("keyup",u)}},[]),d.jsx(K,{asChild:!0,...l,focusable:!t,active:p,children:d.jsx(k,{disabled:t,required:r.required,checked:p,...f,...e,name:r.name,ref:v,onCheck:()=>r.onValueChange(e.value),onKeyDown:C(i=>{i.key==="Enter"&&i.preventDefault()}),onFocus:C(e.onFocus,()=>{m.current&&R.current?.click()})})})});O.displayName=M;var $="RadioGroupIndicator",F=s.forwardRef((a,c)=>{const{__scopeRadioGroup:o,...n}=a,e=N(o);return d.jsx(g,{...e,...n,ref:c})});F.displayName=$;var oe=D,re=O,ae=F;export{re as I,oe as R,ae as a};
1
+ import{r as s,aR as L,aP as B,j as d,b6 as q,aM as x,aQ as E,b4 as K,aS as C,b5 as P,b7 as T,aO as _,bF as U,bE as V}from"./index-CmqY5ba2.js";var I="Radio",[z,w]=_(I),[H,Q]=z(I),k=s.forwardRef((a,c)=>{const{__scopeRadio:o,name:n,checked:e=!1,required:r,disabled:t,value:l="on",onCheck:f,form:R,...v}=a,[p,m]=s.useState(null),i=E(c,h=>m(h)),u=s.useRef(!1),b=p?R||!!p.closest("form"):!0;return d.jsxs(H,{scope:o,checked:e,disabled:t,children:[d.jsx(x.button,{type:"button",role:"radio","aria-checked":e,"data-state":A(e),"data-disabled":t?"":void 0,disabled:t,value:l,...v,ref:i,onClick:C(a.onClick,h=>{e||f?.(),b&&(u.current=h.isPropagationStopped(),u.current||h.stopPropagation())})}),b&&d.jsx(G,{control:p,bubbles:!u.current,name:n,value:l,checked:e,required:r,disabled:t,form:R,style:{transform:"translateX(-100%)"}})]})});k.displayName=I;var S="RadioIndicator",g=s.forwardRef((a,c)=>{const{__scopeRadio:o,forceMount:n,...e}=a,r=Q(S,o);return d.jsx(T,{present:n||r.checked,children:d.jsx(x.span,{"data-state":A(r.checked),"data-disabled":r.disabled?"":void 0,...e,ref:c})})});g.displayName=S;var W="RadioBubbleInput",G=s.forwardRef(({__scopeRadio:a,control:c,checked:o,bubbles:n=!0,...e},r)=>{const t=s.useRef(null),l=E(t,r),f=U(o),R=V(c);return s.useEffect(()=>{const v=t.current;if(!v)return;const p=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(p,"checked").set;if(f!==o&&i){const u=new Event("click",{bubbles:n});i.call(v,o),v.dispatchEvent(u)}},[f,o,n]),d.jsx(x.input,{type:"radio","aria-hidden":!0,defaultChecked:o,...e,tabIndex:-1,ref:l,style:{...e.style,...R,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});G.displayName=W;function A(a){return a?"checked":"unchecked"}var X=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],y="RadioGroup",[Y]=_(y,[P,w]),j=P(),N=w(),[J,Z]=Y(y),D=s.forwardRef((a,c)=>{const{__scopeRadioGroup:o,name:n,defaultValue:e,value:r,required:t=!1,disabled:l=!1,orientation:f,dir:R,loop:v=!0,onValueChange:p,...m}=a,i=j(o),u=L(R),[b,h]=B({prop:r,defaultProp:e??null,onChange:p,caller:y});return d.jsx(J,{scope:o,name:n,required:t,disabled:l,value:b,onValueChange:h,children:d.jsx(q,{asChild:!0,...i,orientation:f,dir:u,loop:v,children:d.jsx(x.div,{role:"radiogroup","aria-required":t,"aria-orientation":f,"data-disabled":l?"":void 0,dir:u,...m,ref:c})})})});D.displayName=y;var M="RadioGroupItem",O=s.forwardRef((a,c)=>{const{__scopeRadioGroup:o,disabled:n,...e}=a,r=Z(M,o),t=r.disabled||n,l=j(o),f=N(o),R=s.useRef(null),v=E(c,R),p=r.value===e.value,m=s.useRef(!1);return s.useEffect(()=>{const i=b=>{X.includes(b.key)&&(m.current=!0)},u=()=>m.current=!1;return document.addEventListener("keydown",i),document.addEventListener("keyup",u),()=>{document.removeEventListener("keydown",i),document.removeEventListener("keyup",u)}},[]),d.jsx(K,{asChild:!0,...l,focusable:!t,active:p,children:d.jsx(k,{disabled:t,required:r.required,checked:p,...f,...e,name:r.name,ref:v,onCheck:()=>r.onValueChange(e.value),onKeyDown:C(i=>{i.key==="Enter"&&i.preventDefault()}),onFocus:C(e.onFocus,()=>{m.current&&R.current?.click()})})})});O.displayName=M;var $="RadioGroupIndicator",F=s.forwardRef((a,c)=>{const{__scopeRadioGroup:o,...n}=a,e=N(o);return d.jsx(g,{...e,...n,ref:c})});F.displayName=$;var oe=D,re=O,ae=F;export{re as I,oe as R,ae as a};
@@ -1 +1 @@
1
- import{c as g,a1 as x,a as h,r as j,j as l,N as c,a8 as I}from"./index-CJs4YG_y.js";import{a as R}from"./constants-B72Xmt_K.js";import{a as y}from"./hooks-BFJHOTt4.js";import{d as C}from"./use-organization-settings-DqYIIvrP.js";import{f as S}from"./reusable-new-chat-CouMjkYR.js";import"./use-mcp-client-BdcH2AAr.js";import"./auth-Bj2JBDn0.js";import"./decopilot-sse-pool-DSmv0lZi.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-C8sSWr27.js";function H(){const t=g.c(11),{org:s}=x(),m=C(),a=R(s.id).id,{data:u}=h.useSession(),{threads:p,status:d}=y(),[f]=j.useState(b);if(m){let e;return t[0]!==s.slug?(e=l.jsx(c,{to:"/commerce-onboarding",search:{org:s.slug},replace:!0}),t[0]=s.slug,t[1]=e):e=t[1],e}if(d.kind==="loading"){let e;return t[2]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx(I,{}),t[2]=e):e=t[2],e}const n=S(p,a,u?.user?.id)?.id??f;let o;t[3]!==s.slug||t[4]!==n?(o={org:s.slug,taskId:n},t[3]=s.slug,t[4]=n,t[5]=o):o=t[5];let r;t[6]!==a?(r={virtualmcpid:a},t[6]=a,t[7]=r):r=t[7];let i;return t[8]!==o||t[9]!==r?(i=l.jsx(c,{to:"/$org/$taskId",params:o,search:r,replace:!0}),t[8]=o,t[9]=r,t[10]=i):i=t[10],i}function b(){return crypto.randomUUID()}export{H as default};
1
+ import{c as g,a1 as x,a as h,r as j,j as l,N as c,a8 as I}from"./index-CmqY5ba2.js";import{a as R}from"./constants-B72Xmt_K.js";import{a as y}from"./hooks-CeE2zVuW.js";import{d as C}from"./use-organization-settings-CB_hb9xs.js";import{f as S}from"./reusable-new-chat-CouMjkYR.js";import"./use-mcp-client-DZ6pOmBc.js";import"./auth-D2uUzB0u.js";import"./decopilot-sse-pool-BYtWcKFG.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-vwEq0QCf.js";function H(){const t=g.c(11),{org:s}=x(),m=C(),a=R(s.id).id,{data:u}=h.useSession(),{threads:p,status:d}=y(),[f]=j.useState(b);if(m){let e;return t[0]!==s.slug?(e=l.jsx(c,{to:"/commerce-onboarding",search:{org:s.slug},replace:!0}),t[0]=s.slug,t[1]=e):e=t[1],e}if(d.kind==="loading"){let e;return t[2]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx(I,{}),t[2]=e):e=t[2],e}const n=S(p,a,u?.user?.id)?.id??f;let o;t[3]!==s.slug||t[4]!==n?(o={org:s.slug,taskId:n},t[3]=s.slug,t[4]=n,t[5]=o):o=t[5];let r;t[6]!==a?(r={virtualmcpid:a},t[6]=a,t[7]=r):r=t[7];let i;return t[8]!==o||t[9]!==r?(i=l.jsx(c,{to:"/$org/$taskId",params:o,search:r,replace:!0}),t[8]=o,t[9]=r,t[10]=i):i=t[10],i}function b(){return crypto.randomUUID()}export{H as default};