decocms 4.3.0 → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (249) hide show
  1. package/dist/client/assets/{AlertCircle-DC-zDzV-.js → AlertCircle-CM6D9elR.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-OJZisFPQ.js → ArrowUpRight-Kqa5fEjt.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-Cgnheu-R.js → CheckCircle-8DKF8Yx5.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-DyHvxYlc.js → ChevronDown-DGuR7uUZ.js} +1 -1
  5. package/dist/client/assets/{ChevronRight-Cpfh3gza.js → ChevronRight-BswIt99A.js} +1 -1
  6. package/dist/client/assets/{ChevronUp-DBpw6M-L.js → ChevronUp-DSdWQUoR.js} +1 -1
  7. package/dist/client/assets/{DotsVertical-5jSu3d1f.js → DotsVertical-DSosYpI1.js} +1 -1
  8. package/dist/client/assets/{Eye-bojNLUjA.js → Eye-Dn1AISrx.js} +1 -1
  9. package/dist/client/assets/{FilterLines-CFl65nng.js → FilterLines-CmWI-8pG.js} +1 -1
  10. package/dist/client/assets/{Globe01-CyfpzbeQ.js → Globe01-CcXDI4W7.js} +1 -1
  11. package/dist/client/assets/{Globe04-DFpdKSRI.js → Globe04-B9Btoycr.js} +1 -1
  12. package/dist/client/assets/{HardDrive-B1mtnaeA.js → HardDrive-BqXWgcmp.js} +1 -1
  13. package/dist/client/assets/{Key01-CwrJlZo0.js → Key01-F6-x7vNY.js} +1 -1
  14. package/dist/client/assets/{LayoutLeft-fsm0LcB8.js → LayoutLeft-DpqtgcH3.js} +1 -1
  15. package/dist/client/assets/{LinkExternal01-BHwVyDja.js → LinkExternal01-DOU6-C1w.js} +1 -1
  16. package/dist/client/assets/{Monitor01-ChA6ov2I.js → Monitor01-SkSQUhmT.js} +1 -1
  17. package/dist/client/assets/{Palette-DusYqL0W.js → Palette-CnoObDqZ.js} +1 -1
  18. package/dist/client/assets/{Play-CnXG8qqP.js → Play-DzGcMRv3.js} +1 -1
  19. package/dist/client/assets/{Plus-eGxBB1d8.js → Plus-DDlkoJBs.js} +1 -1
  20. package/dist/client/assets/{SearchLg-CDpA_lbT.js → SearchLg-CdT_y89m.js} +1 -1
  21. package/dist/client/assets/{SearchMd-ujiTPCmg.js → SearchMd-UY2xUREv.js} +1 -1
  22. package/dist/client/assets/{Settings02-BcAnTzm5.js → Settings02-QyYEyYyn.js} +1 -1
  23. package/dist/client/assets/{Shield01-ZxmFmrvL.js → Shield01-V8b5EFFL.js} +1 -1
  24. package/dist/client/assets/{Star01-DHEkWySe.js → Star01-GVe4t6O1.js} +1 -1
  25. package/dist/client/assets/{Stars01-BdCaKqhF.js → Stars01-BIVPeWqS.js} +1 -1
  26. package/dist/client/assets/{Stars02-qnq-_X9g.js → Stars02-DVZm69DV.js} +1 -1
  27. package/dist/client/assets/{Sun-lTiqxOzH.js → Sun-B2ndPBZP.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-DAZXInW8.js → SwitchHorizontal01-BL4xnvxO.js} +1 -1
  29. package/dist/client/assets/{Tool01-CvnpFI53.js → Tool01-Ci5EQ1tM.js} +1 -1
  30. package/dist/client/assets/{Trash01-ByxlxTiZ.js → Trash01-Cc007jho.js} +1 -1
  31. package/dist/client/assets/{Upload01-Z77n1bV8.js → Upload01-DB9meUjO.js} +1 -1
  32. package/dist/client/assets/{User01-COQtf360.js → User01-Dz-_mMMJ.js} +1 -1
  33. package/dist/client/assets/{Users01-wtRJYQKX.js → Users01-Ctg0iuAM.js} +1 -1
  34. package/dist/client/assets/{Users03-DknrDMtT.js → Users03-BazvU-rC.js} +1 -1
  35. package/dist/client/assets/{X-DrMVHLcw.js → X-_dGiBqSn.js} +1 -1
  36. package/dist/client/assets/{XCircle-Ct0eqqsw.js → XCircle-CmN6DNsv.js} +1 -1
  37. package/dist/client/assets/{XClose-BaZ908gw.js → XClose-BpreRuFP.js} +1 -1
  38. package/dist/client/assets/{Zap-wRIFSWIq.js → Zap-CWxLsQ6b.js} +1 -1
  39. package/dist/client/assets/{ZapSquare-PMiGcZpW.js → ZapSquare-D5x1wm0t.js} +1 -1
  40. package/dist/client/assets/{ZoomOut-6ix2H92j.js → ZoomOut-C0bVPfpC.js} +1 -1
  41. package/dist/client/assets/{access-gate-D6dGDGRI.js → access-gate-CpQ3bOMg.js} +1 -1
  42. package/dist/client/assets/{add-section-modal-DOhGqRCL.js → add-section-modal-D22Rp_ry.js} +1 -1
  43. package/dist/client/assets/agent-icon-BjxA8YR3.js +1 -0
  44. package/dist/client/assets/agents-list-C17XwfcN.js +1 -0
  45. package/dist/client/assets/{ai-providers-Crp7kidL.js → ai-providers-DNjwL7U0.js} +1 -1
  46. package/dist/client/assets/{alert-CKj_5smu.js → alert-CTzYtGwN.js} +1 -1
  47. package/dist/client/assets/{alert-dialog-CYizItFp.js → alert-dialog-DMWXmTGp.js} +2 -2
  48. package/dist/client/assets/app-editor-uAXMllzs.js +1 -0
  49. package/dist/client/assets/{auth-Bej0Tx2Y.js → auth-DraSXrC6.js} +1 -1
  50. package/dist/client/assets/{auth-catchall-CmNVpp-8.js → auth-catchall--3ZAEbBd.js} +1 -1
  51. package/dist/client/assets/{auth-entry-PwLVm-jX.js → auth-entry-DRJ-aW15.js} +1 -1
  52. package/dist/client/assets/{auth-split-layout-5YwPgbAb.js → auth-split-layout-B77S9w6i.js} +1 -1
  53. package/dist/client/assets/{authenticate-and-persist-oauth-DoPUB_Bh.js → authenticate-and-persist-oauth-HBteAcVm.js} +1 -1
  54. package/dist/client/assets/{automation-list-row-CsTyBm4M.js → automation-list-row-NZNZGrlr.js} +1 -1
  55. package/dist/client/assets/automation-runs-BoQeZ1gh.js +1 -0
  56. package/dist/client/assets/automations-bd5MK3eJ.js +1 -0
  57. package/dist/client/assets/{avatar-CJP1BOq4.js → avatar-COMRxqae.js} +1 -1
  58. package/dist/client/assets/{badge-DhpSM7g_.js → badge-B1dPfLuK.js} +1 -1
  59. package/dist/client/assets/{block-document-B2vhG8Ii.js → block-document-B6TgjyKW.js} +2 -2
  60. package/dist/client/assets/{brand-context-BRpHgxfT.js → brand-context-DGv078pp.js} +1 -1
  61. package/dist/client/assets/{buckets-DDR0G33f.js → buckets-LnyV7EWC.js} +1 -1
  62. package/dist/client/assets/bulk-category-panel-BP0Mtj3P.js +1 -0
  63. package/dist/client/assets/{capability-load-error-CCgNL5xi.js → capability-load-error-WTr85D-I.js} +1 -1
  64. package/dist/client/assets/{card-BFb5m83e.js → card-Bys-wDTW.js} +1 -1
  65. package/dist/client/assets/category-editor-Cm1sAVk_.js +1 -0
  66. package/dist/client/assets/{chat-context-n9syhvq-.js → chat-context-huSCeR82.js} +4 -4
  67. package/dist/client/assets/{checkbox-DmOzmKLP.js → checkbox-BIDlFz_0.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-BVPtMYcv.js → cli-auth-success-DJ5lbMQC.js} +1 -1
  69. package/dist/client/assets/collection-detail-UTQtN0-J.js +1 -0
  70. package/dist/client/assets/{collection-display-button-Bf9dlJRy.js → collection-display-button-Bnm_JutP.js} +1 -1
  71. package/dist/client/assets/{collection-search-8iNXnGlM.js → collection-search-CKMDHnku.js} +1 -1
  72. package/dist/client/assets/{collection-tabs-KA2be3wH.js → collection-tabs-CWrBkWhe.js} +1 -1
  73. package/dist/client/assets/{command-C34397s2.js → command-DrgMAh0a.js} +1 -1
  74. package/dist/client/assets/commerce-onboarding-B8pBrcvE.js +1 -0
  75. package/dist/client/assets/{connect-desktop-dialog-Brra3cMC.js → connect-desktop-dialog-CvuFk-NY.js} +1 -1
  76. package/dist/client/assets/{connection-card-C6NYo4Gp.js → connection-card-DIh-SIqT.js} +1 -1
  77. package/dist/client/assets/connection-detail-CWog7XFK.js +1 -0
  78. package/dist/client/assets/{connection-form-helpers-CwZx7WkC.js → connection-form-helpers-DV-bwjt7.js} +1 -1
  79. package/dist/client/assets/connections-BkvcH3F-.js +1 -0
  80. package/dist/client/assets/{context-menu-BW_OZBmV.js → context-menu-BPHfkJEs.js} +1 -1
  81. package/dist/client/assets/{decopilot-BItqS11w.js → decopilot-BxOK0Z8W.js} +1 -1
  82. package/dist/client/assets/{decopilot-sse-pool-CvYk1hkc.js → decopilot-sse-pool-Chmwc1_x.js} +1 -1
  83. package/dist/client/assets/{dialog-BAqFyO8a.js → dialog-o7scRbG9.js} +1 -1
  84. package/dist/client/assets/{domain-settings-r_E3rHsG.js → domain-settings-DIv14WFm.js} +1 -1
  85. package/dist/client/assets/{drawer-CFkqEC3w.js → drawer-B-Vy7tMY.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-C62KNjwK.js → dropdown-menu-D-VNET4I.js} +1 -1
  87. package/dist/client/assets/{empty-state-Sh_DuDcy.js → empty-state-1p_UpPHY.js} +1 -1
  88. package/dist/client/assets/{extract-connection-data-D6bQrejT.js → extract-connection-data-BVX9Eneo.js} +1 -1
  89. package/dist/client/assets/file-explorer-Bh9kp1sm.js +2 -0
  90. package/dist/client/assets/{file-type-icon-DPWxBpNL.js → file-type-icon-LHBbJJTG.js} +1 -1
  91. package/dist/client/assets/{files-B9ekmQa_.js → files-Bw3w16xX.js} +1 -1
  92. package/dist/client/assets/{form-DGE2mWLL.js → form-DX8cQ4SA.js} +1 -1
  93. package/dist/client/assets/{general-BMDKtyZB.js → general-DzJAxzRR.js} +1 -1
  94. package/dist/client/assets/{github-repo-picker-B5tZucJa.js → github-repo-picker-ZmfhFTO6.js} +1 -1
  95. package/dist/client/assets/{hooks-CUSV6Enf.js → hooks-BUt6AoQh.js} +6 -6
  96. package/dist/client/assets/{import-from-deco-dialog-M3CP3Gmn.js → import-from-deco-dialog-DZhtwoRn.js} +1 -1
  97. package/dist/client/assets/{index-Bb-tYGNK.js → index-BBTFoidO.js} +1 -1
  98. package/dist/client/assets/{index-CkTyYAY1.js → index-BPD9Iyv5.js} +1 -1
  99. package/dist/client/assets/index-BcXb7VeZ.css +1 -0
  100. package/dist/client/assets/index-CAV1BNai.js +173 -0
  101. package/dist/client/assets/{index-mEtg0zTM.js → index-CL3KBg-D.js} +1 -1
  102. package/dist/client/assets/{index-CFiyU0D9.js → index-CXy6rN6i.js} +3 -3
  103. package/dist/client/assets/{index-DGzNvPy2.js → index-CjKis1yy.js} +1 -1
  104. package/dist/client/assets/{index-jBUpmiBg.js → index-Cod7u1PQ.js} +1 -1
  105. package/dist/client/assets/{index-CRxAjd1d.js → index-CpgVJVWB.js} +27 -27
  106. package/dist/client/assets/{index-B6hcksS9.js → index-DCwPnlYH.js} +1 -1
  107. package/dist/client/assets/index-DKs6HTlj.js +1 -0
  108. package/dist/client/assets/{index-Dj7TxcSd.js → index-Db3cPjnW.js} +2 -2
  109. package/dist/client/assets/index-DvDkdoxH.js +1 -0
  110. package/dist/client/assets/{index-hmJjUPum.js → index-NJ9aYDVC.js} +1 -1
  111. package/dist/client/assets/{index-DIBoN36v.js → index-VkScKLdP.js} +1 -1
  112. package/dist/client/assets/{index-redirect-C9Kkmz45.js → index-redirect-B6MtHNAq.js} +1 -1
  113. package/dist/client/assets/{input-BwRH-Gsz.js → input-BlhkemhH.js} +1 -1
  114. package/dist/client/assets/{integration-icon-LQhkkaLl.js → integration-icon-BSHD1Ijr.js} +1 -1
  115. package/dist/client/assets/{label-CdBSUJpf.js → label-CL8Vh65B.js} +1 -1
  116. package/dist/client/assets/{login-d0UWtw9N.js → login-B4UwjrwL.js} +1 -1
  117. package/dist/client/assets/{mcp-oauth-IblqU9XT.js → mcp-oauth-CXj7zg3h.js} +1 -1
  118. package/dist/client/assets/{members-Bpdrl2e9.js → members-CZJJNFCT.js} +1 -1
  119. package/dist/client/assets/{monaco-editor-5JIc-lnc.js → monaco-editor-DBScTPL_.js} +2 -2
  120. package/dist/client/assets/{monitoring-stats-row-DPsQ-OAn.js → monitoring-stats-row-DS-oLjL7.js} +1 -1
  121. package/dist/client/assets/{oauth-callback-B1AvYYRn.js → oauth-callback-DmaJ1bda.js} +1 -1
  122. package/dist/client/assets/{oauth-callback-ai-provider-BtGHmjpp.js → oauth-callback-ai-provider-BQMnSXh3.js} +1 -1
  123. package/dist/client/assets/{onboarding-DfUmI7F5.js → onboarding-Byb6DxyK.js} +1 -1
  124. package/dist/client/assets/{org-install-CpJAFt1s.js → org-install-DE37K5KN.js} +1 -1
  125. package/dist/client/assets/{org-layout-BsuFzdH_.js → org-layout-des0Y5a9.js} +1 -1
  126. package/dist/client/assets/{organization-choice-DrxWffZp.js → organization-choice-COkZ5W_o.js} +1 -1
  127. package/dist/client/assets/{page-seo-form-BLqpZnj6.js → page-seo-form-BcrUATEU.js} +1 -1
  128. package/dist/client/assets/page-seo-sheet-D1Z6hzyV.js +1 -0
  129. package/dist/client/assets/popover-SD8gnUXm.js +1 -0
  130. package/dist/client/assets/post-editor-BDlfII0z.js +1 -0
  131. package/dist/client/assets/{primitives-BF1opf4F.js → primitives-CVsZF3ex.js} +1 -1
  132. package/dist/client/assets/{profile-C8meo3ry.js → profile-DBUkydtR.js} +1 -1
  133. package/dist/client/assets/project-app-view-Bk8oTYIF.js +1 -0
  134. package/dist/client/assets/record-editor-DL8IQ3xy.js +1 -0
  135. package/dist/client/assets/registry-Bd0JPSYO.js +2 -0
  136. package/dist/client/assets/{registry-layout-C4UMhzml.js → registry-layout-BL9jjFNp.js} +1 -1
  137. package/dist/client/assets/{require-capability--mIKExbX.js → require-capability-CLQ4GBGj.js} +1 -1
  138. package/dist/client/assets/{required-auth-layout-DDJmFi3U.js → required-auth-layout-BzYoSj-D.js} +1 -1
  139. package/dist/client/assets/{reset-password-CuNa1ife.js → reset-password-C3Zmx-Z-.js} +1 -1
  140. package/dist/client/assets/roles-RwbAlbhC.js +1 -0
  141. package/dist/client/assets/{scroll-area-BM-54tW1.js → scroll-area-DgIklajW.js} +54 -54
  142. package/dist/client/assets/{search-input-M7ubuBMG.js → search-input-BwHA7yOt.js} +1 -1
  143. package/dist/client/assets/{secrets-BN1JMG5V.js → secrets-Cu_Gp7gT.js} +1 -1
  144. package/dist/client/assets/{sections-editor-Buouhx1S.js → sections-editor-CaNl1tLu.js} +2 -2
  145. package/dist/client/assets/select-DM3pFFAV.js +1 -0
  146. package/dist/client/assets/{select-model-Cz9R_UN3.js → select-model-C1odlJ1X.js} +1 -1
  147. package/dist/client/assets/seo-editor-C28ZayGa.js +1 -0
  148. package/dist/client/assets/settings-layout-C_nc5y3_.js +1 -0
  149. package/dist/client/assets/{settings-section-MeT61nuY.js → settings-section-6b9w_VoZ.js} +1 -1
  150. package/dist/client/assets/{sheet-DyU03ddw.js → sheet-BJF6qruz.js} +1 -1
  151. package/dist/client/assets/shell-controls-C9tE75mS.js +1 -0
  152. package/dist/client/assets/{shell-layout-Nyz7GHu7.js → shell-layout-gi6XYvgE.js} +1 -1
  153. package/dist/client/assets/shell-route-loading-Agan4lHM.js +1 -0
  154. package/dist/client/assets/{sidebar-BNrafefE.js → sidebar-BD77ZDQ1.js} +1 -1
  155. package/dist/client/assets/{skeleton-B0I93PJP.js → skeleton-CuVDGSZE.js} +1 -1
  156. package/dist/client/assets/{sortable.esm-MymOIPKk.js → sortable.esm-DpWg8tde.js} +2 -2
  157. package/dist/client/assets/{sso-CfyYgWAs.js → sso-B9XBpXX9.js} +1 -1
  158. package/dist/client/assets/{store-T7GJ1SPI.js → store-Il1Qjdpz.js} +1 -1
  159. package/dist/client/assets/store-registry-BN4Ygwm2.js +2 -0
  160. package/dist/client/assets/{studio-tools-CNO5iCKk.js → studio-tools-C-Eel15b.js} +1 -1
  161. package/dist/client/assets/{switch-CCMIMmOF.js → switch-DWXEjjcR.js} +1 -1
  162. package/dist/client/assets/{tab-id-BptcWVWa.js → tab-id-AX1D_RMI.js} +1 -1
  163. package/dist/client/assets/{table-DeNuxLMl.js → table-sXVKQ5vt.js} +1 -1
  164. package/dist/client/assets/{tabs-Ca0vDJqc.js → tabs-BeXAqCdo.js} +1 -1
  165. package/dist/client/assets/{task-status-B3nPzwP7.js → task-status-CaQuE65s.js} +1 -1
  166. package/dist/client/assets/{textarea-BYT525JZ.js → textarea-C30KYfio.js} +1 -1
  167. package/dist/client/assets/{toggle-group-9TrYMc69.js → toggle-group-B6oTaI1f.js} +1 -1
  168. package/dist/client/assets/toolbar-DuZrnshW.js +1 -0
  169. package/dist/client/assets/toolbar-icon-button-CG8gWMNZ.js +1 -0
  170. package/dist/client/assets/{tools-list-uWC3Ij6C.js → tools-list-BSe55AC9.js} +1 -1
  171. package/dist/client/assets/tooltip-BRQCINXK.js +1 -0
  172. package/dist/client/assets/{types-C7syjwde.js → types-ywta9rZ4.js} +4 -4
  173. package/dist/client/assets/{use-ai-providers-C7KmiuqP.js → use-ai-providers-CpUPA2Pj.js} +1 -1
  174. package/dist/client/assets/{use-automations-RMjkwkxX.js → use-automations-BSn8_z4p.js} +1 -1
  175. package/dist/client/assets/{use-capability-C6Dwri-U.js → use-capability-AkUZCu97.js} +1 -1
  176. package/dist/client/assets/{use-clock-tick-BcxdOJLx.js → use-clock-tick-7J301cSN.js} +1 -1
  177. package/dist/client/assets/{use-collections-B4atckEK.js → use-collections-BhzLncHB.js} +1 -1
  178. package/dist/client/assets/{use-connection-Dz29RF9P.js → use-connection-CSQdDXlG.js} +1 -1
  179. package/dist/client/assets/{use-copy-Xy0buIqd.js → use-copy-3aLRhzTZ.js} +1 -1
  180. package/dist/client/assets/use-create-virtual-mcp-ClyuqzV0.js +1 -0
  181. package/dist/client/assets/{use-debounced-autosave-B4mbwJnu.js → use-debounced-autosave-DwyO4Yri.js} +1 -1
  182. package/dist/client/assets/{use-debounced-value-C6U3mliE.js → use-debounced-value-BGsbVLHA.js} +1 -1
  183. package/dist/client/assets/{use-decopilot-events-CpQNzv3e.js → use-decopilot-events-B8-U5_6h.js} +1 -1
  184. package/dist/client/assets/{use-delete-connection-CqeuxO_6.js → use-delete-connection-yP5RphYi.js} +1 -1
  185. package/dist/client/assets/{use-file-configs-CFCmr--W.js → use-file-configs-XF2AvMPs.js} +1 -1
  186. package/dist/client/assets/{use-infinite-scroll-BX1nHHVY.js → use-infinite-scroll-CkXtceVR.js} +1 -1
  187. package/dist/client/assets/{use-join-requests-j9WpmFq7.js → use-join-requests-mfteqXVe.js} +1 -1
  188. package/dist/client/assets/{use-mcp-client-xOK-OF8p.js → use-mcp-client-CRWIqSWI.js} +1 -1
  189. package/dist/client/assets/{use-mcp-prompts-Crr3H7P7.js → use-mcp-prompts-BV9cBymv.js} +1 -1
  190. package/dist/client/assets/{use-mcp-tools-C8tMWwG9.js → use-mcp-tools-Dgj65Z69.js} +1 -1
  191. package/dist/client/assets/{use-members-BMNjJExY.js → use-members-BZOJ4ncQ.js} +1 -1
  192. package/dist/client/assets/{use-mobile-NlF-3RoP.js → use-mobile-DgvzRDzB.js} +1 -1
  193. package/dist/client/assets/{use-navigate-to-agent-DZubxUSm.js → use-navigate-to-agent-DTqeD3lq.js} +1 -1
  194. package/dist/client/assets/{use-org-auth-client-C_UJ3Vg_.js → use-org-auth-client-Dx974y4u.js} +1 -1
  195. package/dist/client/assets/{use-org-fs-DyK8omii.js → use-org-fs-DI1Q1Ycz.js} +1 -1
  196. package/dist/client/assets/{use-org-sso-DkqH8Zpz.js → use-org-sso-kfQLtl8D.js} +1 -1
  197. package/dist/client/assets/{use-organization-roles-Cu69Rnex.js → use-organization-roles-B2GmBYYT.js} +1 -1
  198. package/dist/client/assets/{use-organization-settings-DksiQdGc.js → use-organization-settings-ClL7mSbK.js} +1 -1
  199. package/dist/client/assets/{use-registry-connections-BOZLpkM5.js → use-registry-connections-DzyhBLO8.js} +1 -1
  200. package/dist/client/assets/{use-secrets-CLmhH-Rb.js → use-secrets-BX0N_3N-.js} +1 -1
  201. package/dist/client/assets/{use-status-sounds-DxV7deix.js → use-status-sounds-BsVH7G2F.js} +1 -1
  202. package/dist/client/assets/{use-view-mode-C2dllj6L.js → use-view-mode-D4v-Vh_n.js} +1 -1
  203. package/dist/client/assets/{use-virtual-mcp-2U_MnYnK.js → use-virtual-mcp-7AWl-thI.js} +1 -1
  204. package/dist/client/assets/useInfiniteQuery-DbI8AV-k.js +1 -0
  205. package/dist/client/assets/useSuspenseInfiniteQuery-DT-JxV4F.js +1 -0
  206. package/dist/client/assets/{useSuspenseQueries-Cysvk68n.js → useSuspenseQueries-D4Gfj0Tf.js} +1 -1
  207. package/dist/client/assets/variant-calendar-C9mxKuI5.js +1 -0
  208. package/dist/client/assets/{view-mode-toggle-4CQodGfa.js → view-mode-toggle-Dcs21C2T.js} +1 -1
  209. package/dist/client/index.html +2 -2
  210. package/dist/server/cli.js +11 -2
  211. package/dist/server/server.js +1 -1
  212. package/package.json +1 -1
  213. package/dist/client/assets/ChevronLeft-dyRjFCmp.js +0 -1
  214. package/dist/client/assets/agent-icon-oDx9Z_Be.js +0 -1
  215. package/dist/client/assets/agents-list-BgSM_QG_.js +0 -1
  216. package/dist/client/assets/app-editor-Xoia35dq.js +0 -1
  217. package/dist/client/assets/automation-runs-B-dNDEWH.js +0 -1
  218. package/dist/client/assets/automations-D395202A.js +0 -1
  219. package/dist/client/assets/bulk-category-panel-CM1bMunr.js +0 -1
  220. package/dist/client/assets/category-editor-2T4Y_ABL.js +0 -1
  221. package/dist/client/assets/collection-detail-BQKV3UU7.js +0 -1
  222. package/dist/client/assets/commerce-onboarding-D2H83R0U.js +0 -1
  223. package/dist/client/assets/connection-detail-gJ5ITUXe.js +0 -1
  224. package/dist/client/assets/connections-CicrEJbU.js +0 -1
  225. package/dist/client/assets/file-explorer-C8pgfKCz.js +0 -2
  226. package/dist/client/assets/index-B2yJy2sB.js +0 -1
  227. package/dist/client/assets/index-BqKQnks_.css +0 -1
  228. package/dist/client/assets/index-DQnTjiix.js +0 -1
  229. package/dist/client/assets/index-D_S_Rq8A.js +0 -169
  230. package/dist/client/assets/page-seo-sheet-C7jjKuEW.js +0 -1
  231. package/dist/client/assets/popover-BXFiEQtN.js +0 -1
  232. package/dist/client/assets/post-editor-Tve7DmSa.js +0 -1
  233. package/dist/client/assets/preview-dialog-CQgf0QcR.js +0 -5
  234. package/dist/client/assets/project-app-view-BR2-hR46.js +0 -1
  235. package/dist/client/assets/record-editor-DbXO7U7E.js +0 -1
  236. package/dist/client/assets/registry-jjhvqeDq.js +0 -2
  237. package/dist/client/assets/roles-BMhGnq_F.js +0 -1
  238. package/dist/client/assets/select-C6v8Xcth.js +0 -1
  239. package/dist/client/assets/seo-editor-D9o3utSQ.js +0 -1
  240. package/dist/client/assets/settings-layout-CSaUQUXv.js +0 -1
  241. package/dist/client/assets/shell-controls-DtGb6E4l.js +0 -1
  242. package/dist/client/assets/shell-route-loading-BRcTX0VT.js +0 -1
  243. package/dist/client/assets/store-registry-B-YJeGRV.js +0 -2
  244. package/dist/client/assets/toolbar-p8VcpV1N.js +0 -1
  245. package/dist/client/assets/tooltip-DrpiSbRG.js +0 -1
  246. package/dist/client/assets/use-create-virtual-mcp-DVmI--_C.js +0 -1
  247. package/dist/client/assets/useInfiniteQuery-RUqqRph1.js +0 -1
  248. package/dist/client/assets/useSuspenseInfiniteQuery-fRYRtDkY.js +0 -1
  249. package/dist/client/assets/variant-calendar-mZn_D1Zo.js +0 -1
@@ -1 +1 @@
1
- import{c as b,l as w,j as a,i as j}from"./index-CFiyU0D9.js";import{i as N}from"./SearchMd-ujiTPCmg.js";function S(f){const e=b.c(17),{value:l,onChange:c,placeholder:g,onKeyDown:d,className:u,isSearching:p,disabled:i}=f,m=g===void 0?"Search...":g,x=i&&"pointer-events-none opacity-50";let t;e[0]!==u||e[1]!==x?(t=w("flex items-center gap-4 rounded-lg bg-background dark:bg-input/30 px-3 h-8 card-shadow","focus-within:border-ring focus-within:ring-ring/20 focus-within:ring-[2px]","transition-[color,box-shadow]",x,u),e[0]=u,e[1]=x,e[2]=t):t=e[2];let n;e[3]!==p?(n=p?a.jsx(j,{size:16,className:"animate-spin text-muted-foreground/75 shrink-0"}):a.jsx(N,{size:16,className:"text-muted-foreground/75 shrink-0"}),e[3]=p,e[4]=n):n=e[4];let s;e[5]!==c?(s=h=>c(h.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==i||e[8]!==d||e[9]!==m||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:d,placeholder:m,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=i,e[8]=d,e[9]=m,e[10]=s,e[11]=l,e[12]=o):o=e[12];let r;return e[13]!==t||e[14]!==n||e[15]!==o?(r=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=r):r=e[16],r}export{S};
1
+ import{c as b,l as w,j as a,i as j}from"./index-CXy6rN6i.js";import{i as N}from"./SearchMd-UY2xUREv.js";function S(f){const e=b.c(17),{value:l,onChange:c,placeholder:g,onKeyDown:d,className:u,isSearching:p,disabled:i}=f,m=g===void 0?"Search...":g,x=i&&"pointer-events-none opacity-50";let t;e[0]!==u||e[1]!==x?(t=w("flex items-center gap-4 rounded-lg bg-background dark:bg-input/30 px-3 h-8 card-shadow","focus-within:border-ring focus-within:ring-ring/20 focus-within:ring-[2px]","transition-[color,box-shadow]",x,u),e[0]=u,e[1]=x,e[2]=t):t=e[2];let n;e[3]!==p?(n=p?a.jsx(j,{size:16,className:"animate-spin text-muted-foreground/75 shrink-0"}):a.jsx(N,{size:16,className:"text-muted-foreground/75 shrink-0"}),e[3]=p,e[4]=n):n=e[4];let s;e[5]!==c?(s=h=>c(h.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==i||e[8]!==d||e[9]!==m||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:d,placeholder:m,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=i,e[8]=d,e[9]=m,e[10]=s,e[11]=l,e[12]=o):o=e[12];let r;return e[13]!==t||e[14]!==n||e[15]!==o?(r=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=r):r=e[16],r}export{S};
@@ -1 +1 @@
1
- import{c as p,j as t,E as P,r as j,ag as w,B as S,t as y}from"./index-CFiyU0D9.js";import{i as k}from"./AlertCircle-DC-zDzV-.js";import{s as z}from"./Plus-eGxBB1d8.js";import{s as E}from"./User01-COQtf360.js";import{t as F}from"./Users01-wtRJYQKX.js";import{e as $,d as I,c as O,a as A,b as R,D as T}from"./dialog-BAqFyO8a.js";import{I as N}from"./input-BwRH-Gsz.js";import{L as g}from"./label-CdBSUJpf.js";import{d as B,b as V,c as L,S as q,a as C}from"./select-C6v8Xcth.js";import{S as H}from"./skeleton-B0I93PJP.js";import{T as K}from"./textarea-BYT525JZ.js";import{P as b}from"./index-Bb-tYGNK.js";import{c as W}from"./settings-section-MeT61nuY.js";import{u as Y,a as G}from"./use-secrets-CLmhH-Rb.js";import{R as J}from"./require-capability--mIKExbX.js";import"./X-DrMVHLcw.js";import"./tooltip-DrpiSbRG.js";import"./ChevronUp-DBpw6M-L.js";import"./ChevronDown-DyHvxYlc.js";import"./sidebar-BNrafefE.js";import"./LayoutLeft-fsm0LcB8.js";import"./use-mobile-NlF-3RoP.js";import"./sheet-DyU03ddw.js";import"./card-BFb5m83e.js";import"./ArrowUpRight-OJZisFPQ.js";import"./studio-tools-CNO5iCKk.js";import"./use-capability-C6Dwri-U.js";import"./access-gate-D6dGDGRI.js";import"./capability-load-error-CCgNL5xi.js";function M(s){const e=p.c(3),{error:r}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(k,{size:16}),e[0]=c):c=e[0];let n;return e[1]!==r.message?(n=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,t.jsxs("span",{className:"text-sm font-medium",children:["Failed to load secrets: ",r.message]})]}),e[1]=r.message,e[2]=n):n=e[2],n}function Q(s){const e=p.c(5),{scope:r}=s,c=r==="user"?E:F,n=r==="user"?"Private":"Organization";let i;e[0]!==c?(i=t.jsx(c,{size:12}),e[0]=c,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=t.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[i,n]}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function D(s){const e=p.c(20),{secret:r}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(w,{size:16,className:"text-muted-foreground"})}),e[0]=c):c=e[0];let n;e[1]!==r.name?(n=t.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=n):n=e[2];let i;e[3]!==r.scope?(i=t.jsx(Q,{scope:r.scope}),e[3]=r.scope,e[4]=i):i=e[4];let a;e[5]!==n||e[6]!==i?(a=t.jsxs("div",{className:"flex items-center gap-2",children:[n,i]}),e[5]=n,e[6]=i,e[7]=a):a=e[7];let d;e[8]!==r.description?(d=r.description?t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=d):d=e[9];let u;e[10]!==a||e[11]!==d?(u=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[c,t.jsxs("div",{className:"min-w-0",children:[a,d]})]}),e[10]=a,e[11]=d,e[12]=u):u=e[12];let l;e[13]!==r.createdAt?(l=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=l):l=e[14];let o;e[15]!==l?(o=t.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:l}),e[15]=l,e[16]=o):o=e[16];let x;return e[17]!==u||e[18]!==o?(x=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[u,o]}),e[17]=u,e[18]=o,e[19]=x):x=e[19],x}function U(s){const e=p.c(5),{onCreate:r}=s;let c,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(w,{size:20,className:"text-muted-foreground"})}),n=t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-sm",children:"No secrets yet"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Store API keys, tokens, and other sensitive values. Values are encrypted at rest and never returned over the API."})]}),e[0]=c,e[1]=n):(c=e[0],n=e[1]);let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(z,{size:14}),e[2]=i):i=e[2];let a;return e[3]!==r?(a=t.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,n,t.jsxs(S,{onClick:r,size:"sm",className:"mt-2",children:[i,"New secret"]})]}),e[3]=r,e[4]=a):a=e[4],a}function _({open:s,onOpenChange:e}){const[r,c]=j.useState("organization"),[n,i]=j.useState(""),[a,d]=j.useState(""),[u,l]=j.useState(""),o=G();function x(){c("organization"),i(""),d(""),l("")}function f(){x(),e(!1)}async function h(m){if(m.preventDefault(),!(!n.trim()||!a))try{await o.mutateAsync({scope:r,name:n.trim(),value:a,description:u.trim()||void 0}),y.success(`Secret "${n.trim()}" created`),f()}catch(v){y.error(v instanceof Error?v.message:"Failed to create secret")}}return t.jsx($,{open:s,onOpenChange:m=>{m?e(m):f()},children:t.jsxs(I,{className:"sm:max-w-lg",children:[t.jsxs(O,{children:[t.jsx(A,{children:"New secret"}),t.jsx(R,{children:"Stored encrypted in the credential vault. Choose who can read it."})]}),t.jsxs("form",{onSubmit:h,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-scope",children:"Scope"}),t.jsxs(B,{value:r,onValueChange:m=>c(m),children:[t.jsx(V,{id:"secret-scope",children:t.jsx(L,{})}),t.jsxs(q,{children:[t.jsx(C,{value:"organization",children:"Organization — visible to all members"}),t.jsx(C,{value:"user",children:"Private — only visible to me"})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-name",children:"Name"}),t.jsx(N,{id:"secret-name",value:n,onChange:m=>i(m.target.value),placeholder:"STRIPE_API_KEY",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Letters, digits, underscore, dot, hyphen. Case-insensitive within its scope."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-value",children:"Value"}),t.jsx(N,{id:"secret-value",type:"password",value:a,onChange:m=>d(m.target.value),autoComplete:"new-password",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-description",children:"Description (optional)"}),t.jsx(K,{id:"secret-description",value:u,onChange:m=>l(m.target.value),rows:2,placeholder:"What is this secret used for?"})]}),t.jsxs(T,{children:[t.jsx(S,{type:"button",variant:"outline",onClick:f,disabled:o.isPending,children:"Cancel"}),t.jsx(S,{type:"submit",disabled:o.isPending||!n.trim()||!a,children:o.isPending?"Creating…":"Create secret"})]})]})]})})}function X(){const s=p.c(21),e=Y(),[r,c]=j.useState(!1);if(e.length===0){let l;s[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(U,{onCreate:()=>c(!0)}),s[0]=l):l=s[0];let o;return s[1]!==r?(o=t.jsxs(t.Fragment,{children:[l,t.jsx(_,{open:r,onOpenChange:c})]}),s[1]=r,s[2]=o):o=s[2],o}let n,i,a;if(s[3]!==e){const l=e.filter(se),o=e.filter(te),x=e.length===1?"":"s";let f;s[7]!==e.length||s[8]!==x?(f=t.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length," secret",x," stored"]}),s[7]=e.length,s[8]=x,s[9]=f):f=s[9];let h;s[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>c(!0),s[10]=h):h=s[10];let m;s[11]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs(S,{onClick:h,size:"sm",children:[t.jsx(z,{size:14}),"New secret"]}),s[11]=m):m=s[11],s[12]!==f?(n=t.jsxs("div",{className:"flex items-center justify-between",children:[f,m]}),s[12]=f,s[13]=n):n=s[13],i=l.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Organization"}),t.jsx("div",{children:l.map(ee)})]}):null,a=o.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Private to me"}),t.jsx("div",{children:o.map(Z)})]}):null,s[3]=e,s[4]=n,s[5]=i,s[6]=a}else n=s[4],i=s[5],a=s[6];let d;s[14]!==r?(d=t.jsx(_,{open:r,onOpenChange:c}),s[14]=r,s[15]=d):d=s[15];let u;return s[16]!==n||s[17]!==i||s[18]!==a||s[19]!==d?(u=t.jsxs(t.Fragment,{children:[n,i,a,d]}),s[16]=n,s[17]=i,s[18]=a,s[19]=d,s[20]=u):u=s[20],u}function Z(s){return t.jsx(D,{secret:s},s.id)}function ee(s){return t.jsx(D,{secret:s},s.id)}function te(s){return s.scope==="user"}function se(s){return s.scope==="organization"}function re(){const s=p.c(2);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(b.Title,{children:"Secrets"}),s[0]=e):e=s[0];let r;return s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(b,{children:t.jsx(b.Content,{children:t.jsx(b.Body,{children:t.jsxs(W,{children:[e,t.jsx(P,{fallback:ne,children:t.jsx(j.Suspense,{fallback:t.jsx(H,{className:"h-32 w-full"}),children:t.jsx(X,{})})})]})})})}),s[1]=r):r=s[1],r}function ne(s){const{error:e}=s;return t.jsx(M,{error:e??new Error("Failed to load secrets")})}function Ie(){const s=p.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(J,{capability:"secrets:manage",area:"secrets",children:t.jsx(re,{})}),s[0]=e):e=s[0],e}export{Ie as default};
1
+ import{c as p,j as t,E as P,r as j,ae as w,B as S,t as y}from"./index-CXy6rN6i.js";import{i as k}from"./AlertCircle-CM6D9elR.js";import{s as z}from"./Plus-DDlkoJBs.js";import{s as E}from"./User01-Dz-_mMMJ.js";import{t as F}from"./Users01-Ctg0iuAM.js";import{e as $,d as I,c as O,a as A,b as R,D as T}from"./dialog-o7scRbG9.js";import{I as N}from"./input-BlhkemhH.js";import{L as g}from"./label-CL8Vh65B.js";import{S as B,a as V,b as L,c as q,d as C}from"./select-DM3pFFAV.js";import{S as H}from"./skeleton-CuVDGSZE.js";import{T as K}from"./textarea-C30KYfio.js";import{P as b}from"./index-BBTFoidO.js";import{c as W}from"./settings-section-6b9w_VoZ.js";import{u as Y,a as G}from"./use-secrets-BX0N_3N-.js";import{R as J}from"./require-capability-CLQ4GBGj.js";import"./X-_dGiBqSn.js";import"./tooltip-BRQCINXK.js";import"./ChevronUp-DSdWQUoR.js";import"./ChevronDown-DGuR7uUZ.js";import"./sidebar-BD77ZDQ1.js";import"./LayoutLeft-DpqtgcH3.js";import"./use-mobile-DgvzRDzB.js";import"./sheet-BJF6qruz.js";import"./card-Bys-wDTW.js";import"./ArrowUpRight-Kqa5fEjt.js";import"./studio-tools-C-Eel15b.js";import"./use-capability-AkUZCu97.js";import"./access-gate-CpQ3bOMg.js";import"./capability-load-error-WTr85D-I.js";function M(s){const e=p.c(3),{error:r}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(k,{size:16}),e[0]=c):c=e[0];let n;return e[1]!==r.message?(n=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,t.jsxs("span",{className:"text-sm font-medium",children:["Failed to load secrets: ",r.message]})]}),e[1]=r.message,e[2]=n):n=e[2],n}function Q(s){const e=p.c(5),{scope:r}=s,c=r==="user"?E:F,n=r==="user"?"Private":"Organization";let i;e[0]!==c?(i=t.jsx(c,{size:12}),e[0]=c,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=t.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[i,n]}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function D(s){const e=p.c(20),{secret:r}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(w,{size:16,className:"text-muted-foreground"})}),e[0]=c):c=e[0];let n;e[1]!==r.name?(n=t.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=n):n=e[2];let i;e[3]!==r.scope?(i=t.jsx(Q,{scope:r.scope}),e[3]=r.scope,e[4]=i):i=e[4];let a;e[5]!==n||e[6]!==i?(a=t.jsxs("div",{className:"flex items-center gap-2",children:[n,i]}),e[5]=n,e[6]=i,e[7]=a):a=e[7];let d;e[8]!==r.description?(d=r.description?t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=d):d=e[9];let u;e[10]!==a||e[11]!==d?(u=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[c,t.jsxs("div",{className:"min-w-0",children:[a,d]})]}),e[10]=a,e[11]=d,e[12]=u):u=e[12];let l;e[13]!==r.createdAt?(l=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=l):l=e[14];let o;e[15]!==l?(o=t.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:l}),e[15]=l,e[16]=o):o=e[16];let x;return e[17]!==u||e[18]!==o?(x=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[u,o]}),e[17]=u,e[18]=o,e[19]=x):x=e[19],x}function U(s){const e=p.c(5),{onCreate:r}=s;let c,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(w,{size:20,className:"text-muted-foreground"})}),n=t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-sm",children:"No secrets yet"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Store API keys, tokens, and other sensitive values. Values are encrypted at rest and never returned over the API."})]}),e[0]=c,e[1]=n):(c=e[0],n=e[1]);let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(z,{size:14}),e[2]=i):i=e[2];let a;return e[3]!==r?(a=t.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,n,t.jsxs(S,{onClick:r,size:"sm",className:"mt-2",children:[i,"New secret"]})]}),e[3]=r,e[4]=a):a=e[4],a}function _({open:s,onOpenChange:e}){const[r,c]=j.useState("organization"),[n,i]=j.useState(""),[a,d]=j.useState(""),[u,l]=j.useState(""),o=G();function x(){c("organization"),i(""),d(""),l("")}function f(){x(),e(!1)}async function h(m){if(m.preventDefault(),!(!n.trim()||!a))try{await o.mutateAsync({scope:r,name:n.trim(),value:a,description:u.trim()||void 0}),y.success(`Secret "${n.trim()}" created`),f()}catch(v){y.error(v instanceof Error?v.message:"Failed to create secret")}}return t.jsx($,{open:s,onOpenChange:m=>{m?e(m):f()},children:t.jsxs(I,{className:"sm:max-w-lg",children:[t.jsxs(O,{children:[t.jsx(A,{children:"New secret"}),t.jsx(R,{children:"Stored encrypted in the credential vault. Choose who can read it."})]}),t.jsxs("form",{onSubmit:h,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-scope",children:"Scope"}),t.jsxs(B,{value:r,onValueChange:m=>c(m),children:[t.jsx(V,{id:"secret-scope",children:t.jsx(L,{})}),t.jsxs(q,{children:[t.jsx(C,{value:"organization",children:"Organization — visible to all members"}),t.jsx(C,{value:"user",children:"Private — only visible to me"})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-name",children:"Name"}),t.jsx(N,{id:"secret-name",value:n,onChange:m=>i(m.target.value),placeholder:"STRIPE_API_KEY",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Letters, digits, underscore, dot, hyphen. Case-insensitive within its scope."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-value",children:"Value"}),t.jsx(N,{id:"secret-value",type:"password",value:a,onChange:m=>d(m.target.value),autoComplete:"new-password",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-description",children:"Description (optional)"}),t.jsx(K,{id:"secret-description",value:u,onChange:m=>l(m.target.value),rows:2,placeholder:"What is this secret used for?"})]}),t.jsxs(T,{children:[t.jsx(S,{type:"button",variant:"outline",onClick:f,disabled:o.isPending,children:"Cancel"}),t.jsx(S,{type:"submit",disabled:o.isPending||!n.trim()||!a,children:o.isPending?"Creating…":"Create secret"})]})]})]})})}function X(){const s=p.c(21),e=Y(),[r,c]=j.useState(!1);if(e.length===0){let l;s[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(U,{onCreate:()=>c(!0)}),s[0]=l):l=s[0];let o;return s[1]!==r?(o=t.jsxs(t.Fragment,{children:[l,t.jsx(_,{open:r,onOpenChange:c})]}),s[1]=r,s[2]=o):o=s[2],o}let n,i,a;if(s[3]!==e){const l=e.filter(se),o=e.filter(te),x=e.length===1?"":"s";let f;s[7]!==e.length||s[8]!==x?(f=t.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length," secret",x," stored"]}),s[7]=e.length,s[8]=x,s[9]=f):f=s[9];let h;s[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>c(!0),s[10]=h):h=s[10];let m;s[11]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs(S,{onClick:h,size:"sm",children:[t.jsx(z,{size:14}),"New secret"]}),s[11]=m):m=s[11],s[12]!==f?(n=t.jsxs("div",{className:"flex items-center justify-between",children:[f,m]}),s[12]=f,s[13]=n):n=s[13],i=l.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Organization"}),t.jsx("div",{children:l.map(ee)})]}):null,a=o.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Private to me"}),t.jsx("div",{children:o.map(Z)})]}):null,s[3]=e,s[4]=n,s[5]=i,s[6]=a}else n=s[4],i=s[5],a=s[6];let d;s[14]!==r?(d=t.jsx(_,{open:r,onOpenChange:c}),s[14]=r,s[15]=d):d=s[15];let u;return s[16]!==n||s[17]!==i||s[18]!==a||s[19]!==d?(u=t.jsxs(t.Fragment,{children:[n,i,a,d]}),s[16]=n,s[17]=i,s[18]=a,s[19]=d,s[20]=u):u=s[20],u}function Z(s){return t.jsx(D,{secret:s},s.id)}function ee(s){return t.jsx(D,{secret:s},s.id)}function te(s){return s.scope==="user"}function se(s){return s.scope==="organization"}function re(){const s=p.c(2);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(b.Title,{children:"Secrets"}),s[0]=e):e=s[0];let r;return s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(b,{children:t.jsx(b.Content,{children:t.jsx(b.Body,{children:t.jsxs(W,{children:[e,t.jsx(P,{fallback:ne,children:t.jsx(j.Suspense,{fallback:t.jsx(H,{className:"h-32 w-full"}),children:t.jsx(X,{})})})]})})})}),s[1]=r):r=s[1],r}function ne(s){const{error:e}=s;return t.jsx(M,{error:e??new Error("Failed to load secrets")})}function Ie(){const s=p.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(J,{capability:"secrets:manage",area:"secrets",children:t.jsx(re,{})}),s[0]=e):e=s[0],e}export{Ie as default};
@@ -1,2 +1,2 @@
1
- import{c as He,r as w,l as Be,j as n,B as Ge,i as zn,m as vs,t as W,K as Ss}from"./index-CFiyU0D9.js";import{r as xs,a as ys,s as bs,i as Hn,c as _s,b as js,G as ks,V as ws,d as Rs,e as Rt,f as Ds,g as Ns,h as Vs,j as Cs,k as Ps,l as Ts,m as As,n as Ms,o as Es,p as $t,q as Ot,t as Ks,v as ut,w as jt,x as $s,y as Os,z as Je,A as Vn,S as Bs,M as Cn,B as kt,C as Bt,D as Ls,E as an,P as Fs,F as et,H as xt,I as Is,J as zs,K as Hs,L as Us,N as Ws,O as Gs,Q as dt,R as Ys,T as qs,U as Js,W as Pn,X as wt,Y as Qs,Z as Xs,_ as Zs,$ as er,a0 as tr,a1 as sn,a2 as Tn,a3 as An,a4 as yt,a5 as Lt,a6 as Mn,a7 as nr,a8 as ar,a9 as rn,aa as sr,ab as rr,ac as Un,ad as En,ae as or}from"./index-CRxAjd1d.js";import{t as ir}from"./ChevronDown-DyHvxYlc.js";import{n as lr}from"./ChevronLeft-dyRjFCmp.js";import{i as Wn}from"./ChevronRight-Cpfh3gza.js";import{n as cr}from"./ChevronUp-DBpw6M-L.js";import{H as ln,E as Gn,Y as Yn,l as ur,I as dr,J as mr}from"./agent-icon-oDx9Z_Be.js";import{i as fr}from"./Globe01-CyfpzbeQ.js";import{S as Ft}from"./scroll-area-BM-54tW1.js";import{T as mt,a as ft,b as pt}from"./tooltip-DrpiSbRG.js";import{a as pr,c as hr,b as gr,D as vr,d as Sr,e as xr}from"./dialog-BAqFyO8a.js";import{I as yr}from"./input-BwRH-Gsz.js";import{s as br,a as qn}from"./Eye-bojNLUjA.js";import{c as _r}from"./ZoomOut-6ix2H92j.js";import{i as jr}from"./Settings02-BcAnTzm5.js";import{s as cn}from"./Plus-eGxBB1d8.js";import{s as Jn}from"./Trash01-ByxlxTiZ.js";import{i as kr}from"./Zap-wRIFSWIq.js";import{c as it,a as Qn,D as Xn,b as Zn,g as wr}from"./dropdown-menu-C62KNjwK.js";import{b as ea,c as It,K as ta,P as na,e as aa,C as sa,s as ra,l as Dt,D as oa,d as ia,S as la,v as ca,k as ua}from"./sortable.esm-MymOIPKk.js";import{r as Kn,u as Rr,d as Dr,a as Nr,i as Vr,f as Cr,P as Pr,b as Tr,S as Ar}from"./page-seo-form-BLqpZnj6.js";import{b as Mr}from"./Tool01-CvnpFI53.js";import{A as Er}from"./add-section-modal-DOhGqRCL.js";import"./index-mEtg0zTM.js";import"./SwitchHorizontal01-DAZXInW8.js";import"./chat-context-n9syhvq-.js";import"./hooks-CUSV6Enf.js";import"./use-mcp-client-xOK-OF8p.js";import"./auth-Bej0Tx2Y.js";import"./decopilot-sse-pool-CvYk1hkc.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-2U_MnYnK.js";import"./use-collections-B4atckEK.js";import"./use-ai-providers-C7KmiuqP.js";import"./studio-tools-CNO5iCKk.js";import"./use-decopilot-events-CpQNzv3e.js";import"./tab-id-BptcWVWa.js";import"./use-organization-settings-DksiQdGc.js";import"./drawer-CFkqEC3w.js";import"./collection-search-8iNXnGlM.js";import"./SearchMd-ujiTPCmg.js";import"./use-mobile-NlF-3RoP.js";import"./use-mcp-prompts-Crr3H7P7.js";import"./X-DrMVHLcw.js";import"./shell-layout-Nyz7GHu7.js";import"./avatar-CJP1BOq4.js";import"./User01-COQtf360.js";import"./Users03-DknrDMtT.js";import"./SearchLg-CDpA_lbT.js";import"./Stars02-qnq-_X9g.js";import"./XClose-BaZ908gw.js";import"./CheckCircle-Cgnheu-R.js";import"./FilterLines-CFl65nng.js";import"./required-auth-layout-DDJmFi3U.js";import"./use-org-sso-DkqH8Zpz.js";import"./ZapSquare-PMiGcZpW.js";import"./Star01-DHEkWySe.js";import"./Upload01-Z77n1bV8.js";import"./AlertCircle-DC-zDzV-.js";import"./form-DGE2mWLL.js";import"./label-CdBSUJpf.js";import"./select-C6v8Xcth.js";import"./XCircle-Ct0eqqsw.js";import"./tabs-Ca0vDJqc.js";import"./toggle-group-9TrYMc69.js";import"./Monitor01-ChA6ov2I.js";import"./connect-desktop-dialog-Brra3cMC.js";import"./decopilot-BItqS11w.js";import"./checkbox-DmOzmKLP.js";import"./skeleton-B0I93PJP.js";import"./Key01-CwrJlZo0.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-MeT61nuY.js";import"./card-BFb5m83e.js";import"./ArrowUpRight-OJZisFPQ.js";import"./Stars01-BdCaKqhF.js";import"./popover-BXFiEQtN.js";import"./command-C34397s2.js";import"./index-jBUpmiBg.js";import"./useInfiniteQuery-RUqqRph1.js";import"./use-infinite-scroll-BX1nHHVY.js";import"./use-org-fs-DyK8omii.js";import"./question-004-sINsf4GQ.js";import"./integration-icon-LQhkkaLl.js";import"./use-status-sounds-DxV7deix.js";import"./empty-state-Sh_DuDcy.js";import"./toolbar-p8VcpV1N.js";import"./preview-dialog-CQgf0QcR.js";import"./LinkExternal01-BHwVyDja.js";import"./index-B6hcksS9.js";import"./file-type-icon-DPWxBpNL.js";import"./LayoutLeft-fsm0LcB8.js";import"./use-connection-Dz29RF9P.js";import"./use-mcp-tools-C8tMWwG9.js";import"./types-C7syjwde.js";import"./use-capability-C6Dwri-U.js";import"./textarea-BYT525JZ.js";import"./shell-route-loading-BRcTX0VT.js";import"./extract-connection-data-D6bQrejT.js";import"./tools-list-uWC3Ij6C.js";import"./mcp-oauth-IblqU9XT.js";import"./badge-DhpSM7g_.js";import"./connection-slug-eyAPH6o3.js";import"./alert-dialog-CYizItFp.js";import"./switch-CCMIMmOF.js";import"./Play-CnXG8qqP.js";import"./use-debounced-autosave-B4mbwJnu.js";import"./index-Bb-tYGNK.js";import"./sidebar-BNrafefE.js";import"./sheet-DyU03ddw.js";import"./search-input-M7ubuBMG.js";import"./collection-tabs-KA2be3wH.js";import"./github-repo-picker-B5tZucJa.js";import"./use-debounced-value-C6U3mliE.js";import"./authenticate-and-persist-oauth-DoPUB_Bh.js";import"./use-navigate-to-agent-DZubxUSm.js";import"./github-installations-DzN1UQ4x.js";import"./Users01-wtRJYQKX.js";import"./use-secrets-CLmhH-Rb.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./automation-runs-B-dNDEWH.js";import"./table-DeNuxLMl.js";import"./use-members-BMNjJExY.js";import"./use-org-auth-client-C_UJ3Vg_.js";import"./task-status-B3nPzwP7.js";import"./DotsVertical-5jSu3d1f.js";import"./use-automations-RMjkwkxX.js";import"./useSuspenseInfiniteQuery-fRYRtDkY.js";import"./use-file-configs-CFCmr--W.js";import"./monaco-editor-5JIc-lnc.js";import"./select-model-Cz9R_UN3.js";import"./automation-list-row-CsTyBm4M.js";import"./Globe04-DFpdKSRI.js";import"./HardDrive-B1mtnaeA.js";import"./Sun-lTiqxOzH.js";import"./Palette-DusYqL0W.js";import"./Shield01-ZxmFmrvL.js";import"./use-clock-tick-BcxdOJLx.js";import"./use-copy-Xy0buIqd.js";import"./content-blocks-o63cs2vh.js";import"./connection-card-C6NYo4Gp.js";import"./use-registry-connections-BOZLpkM5.js";import"./connection-form-helpers-CwZx7WkC.js";function Kr(m){return m.schema?.definitions??m.schema?.$defs??{}}function $r(m,e){const r=Kr(e),c=r[btoa(m)];if(!c)return;let d=typeof c.image=="string"?c.image:void 0;if(!d&&Array.isArray(c.allOf)){const h=c.allOf.find(S=>typeof S.$ref=="string")?.$ref;if(typeof h=="string"){const S=h.replace("#/definitions/",""),p=r[S];d=typeof p?.image=="string"?p.image:void 0}}if(d?.includes("{{{"))return d}function Or(m,e){if(!e)return;const r=xs(m);if(!r)return;const c=$r(r.resolveType,e);if(!c)return;const d=ys(c,r.data);if(d)return bs(d)}const Br="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Lr="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function $n(m){return Array.from({length:m},(e,r)=>({id:crypto.randomUUID(),index:r}))}function da(m){return m.map((e,r)=>({...e,index:r}))}function Fr(m,e){if(e===m.length)return m;if(e<m.length)return da(m.slice(0,e));const r=Array.from({length:e-m.length},(c,d)=>({id:crypto.randomUUID(),index:m.length+d}));return[...m,...r]}function ma(m){const e=He.c(20),{section:r,raw:c,meta:d}=m,h=r.isSavedBlock===!0,S=r.isMultivariate===!0;let p;e[0]!==d||e[1]!==c?(p=c&&d?Or(c,d):void 0,e[0]=d,e[1]=c,e[2]=p):p=e[2];const v=p;let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(_r,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=g):g=e[3];let b;e[4]!==v?(b=v&&n.jsx("img",{src:v,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=v,e[5]=b):b=e[5];let C;e[6]!==S||e[7]!==h?(C=h?{color:ks}:S?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=S,e[7]=h,e[8]=C):C=e[8];let R;e[9]!==C?(R=n.jsx(ln,{className:"h-4 w-4 shrink-0",style:C}),e[9]=C,e[10]=R):R=e[10];const _=r.isHidden&&"line-through opacity-50";let k;e[11]!==_?(k=Be("min-w-0 flex-1 truncate text-sm font-medium",_),e[11]=_,e[12]=k):k=e[12];let o;e[13]!==r.label||e[14]!==k?(o=n.jsx("span",{className:k,children:r.label}),e[13]=r.label,e[14]=k,e[15]=o):o=e[15];let D;return e[16]!==b||e[17]!==R||e[18]!==o?(D=n.jsxs(n.Fragment,{children:[g,b,R,o]}),e[16]=b,e[17]=R,e[18]=o,e[19]=D):D=e[19],D}function fa(m,e){const r=m.isSavedBlock===!0,c=m.isMultivariate===!0;return Be("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":r?Br:c?"text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]":"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Ir(m){const e=He.c(64),{section:r,raw:c,meta:d,sortableId:h,selected:S,onSelect:p,onDelete:v,onDuplicate:g,onMakeReusable:b,onToggleHidden:C,onToggleLazy:R,onAddVariant:_,onDetach:k}=m,o=c?Hn(c.__resolveType??""):!1;let D;e[0]!==r?(D=_s(r),e[0]=r,e[1]=D):D=e[1];const l=D;let J;e[2]!==h?(J={id:h,animateLayoutChanges:Gr},e[2]=h,e[3]=J):J=e[3];const{attributes:H,listeners:K,setNodeRef:u,transform:P,isDragging:se}=aa(J);let T;e[4]!==P?(T=sa.Transform.toString(P?{...P,x:0}:null),e[4]=P,e[5]=T):T=e[5];const pe=se?0:void 0;let N;e[6]!==T||e[7]!==pe?(N={transform:T,opacity:pe},e[6]=T,e[7]=pe,e[8]=N):N=e[8];const ce=N;let B;e[9]!==r?(B=js(r),e[9]=r,e[10]=B):B=e[10];const te=B,oe="button",Ce=0;let E;e[11]!==p?(E=$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),p())},e[11]=p,e[12]=E):E=e[12];const ue=se?"cursor-grabbing":"cursor-pointer";let ie;e[13]!==r||e[14]!==S||e[15]!==ue?(ie=Be("touch-none transition-colors",ue,fa(r,S)),e[13]=r,e[14]=S,e[15]=ue,e[16]=ie):ie=e[16];let je;e[17]!==d||e[18]!==c||e[19]!==r?(je=n.jsx(ma,{section:r,raw:c,meta:d}),e[17]=d,e[18]=c,e[19]=r,e[20]=je):je=e[20];const M=!r.isMultivariate&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":o?"Disable async render":"Enable async render",className:Be("h-7 w-7 shrink-0",o?"":"opacity-0 group-hover:opacity-100"),onClick:$=>{$.stopPropagation(),R()},onPointerDown:Wr,children:n.jsx(kr,{className:Be("h-3.5 w-3.5",o&&"text-yellow-500")})})}),n.jsx(pt,{side:"bottom",children:o?"Disable async render":"Enable async render"})]});let Ae;e[21]!==C||e[22]!==r.isHidden||e[23]!==r.isMultivariate?(Ae=!r.isMultivariate&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":r.isHidden?"Show section":"Hide section",className:Be("h-7 w-7 shrink-0",r.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:$=>{$.stopPropagation(),C()},onPointerDown:Ur,children:r.isHidden?n.jsx(jr,{className:"h-3.5 w-3.5"}):n.jsx(br,{className:"h-3.5 w-3.5"})})}),n.jsx(pt,{side:"bottom",children:r.isHidden?"Show section":"Hide section"})]}),e[21]=C,e[22]=r.isHidden,e[23]=r.isMultivariate,e[24]=Ae):Ae=e[24];let X;e[25]===Symbol.for("react.memo_cache_sentinel")?(X=n.jsx(Qn,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Section actions",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:Hr,onPointerDown:zr,children:n.jsx(Gn,{className:"h-3.5 w-3.5"})})}),e[25]=X):X=e[25];let Ne;e[26]!==g?(Ne=$=>{$.stopPropagation(),g()},e[26]=g,e[27]=Ne):Ne=e[27];let ve;e[28]===Symbol.for("react.memo_cache_sentinel")?(ve=n.jsx(qn,{className:"h-4 w-4"}),e[28]=ve):ve=e[28];let re;e[29]!==Ne?(re=n.jsxs(it,{onClick:Ne,children:[ve,"Duplicate"]}),e[29]=Ne,e[30]=re):re=e[30];let G;e[31]!==l||e[32]!==_?(G=l&&n.jsxs(it,{className:ws,onClick:$=>{$.stopPropagation(),_()},children:[n.jsx(Yn,{className:"h-4 w-4"}),"Add variant"]}),e[31]=l,e[32]=_,e[33]=G):G=e[33];let Y;e[34]!==te||e[35]!==b?(Y=te&&n.jsxs(it,{className:Lr,onClick:$=>{$.stopPropagation(),b()},children:[n.jsx(ln,{className:"h-4 w-4"}),"Make reusable"]}),e[34]=te,e[35]=b,e[36]=Y):Y=e[36];let ne;e[37]!==k||e[38]!==r.isMultivariate||e[39]!==r.isSavedBlock?(ne=r.isSavedBlock===!0&&!r.isMultivariate&&n.jsxs(it,{onClick:$=>{$.stopPropagation(),k()},children:[n.jsx(ln,{className:"h-4 w-4"}),"Detach"]}),e[37]=k,e[38]=r.isMultivariate,e[39]=r.isSavedBlock,e[40]=ne):ne=e[40];let le;e[41]!==v?(le=$=>{$.stopPropagation(),v()},e[41]=v,e[42]=le):le=e[42];let ke;e[43]===Symbol.for("react.memo_cache_sentinel")?(ke=n.jsx(Jn,{className:"h-4 w-4"}),e[43]=ke):ke=e[43];let Se;e[44]!==le?(Se=n.jsxs(it,{className:"text-destructive focus:text-destructive",onClick:le,children:[ke,"Delete"]}),e[44]=le,e[45]=Se):Se=e[45];let de;e[46]!==re||e[47]!==G||e[48]!==Y||e[49]!==ne||e[50]!==Se?(de=n.jsxs(Xn,{children:[X,n.jsxs(Zn,{align:"end",className:"w-44",children:[re,G,Y,ne,Se]})]}),e[46]=re,e[47]=G,e[48]=Y,e[49]=ne,e[50]=Se,e[51]=de):de=e[51];let be;return e[52]!==H||e[53]!==K||e[54]!==p||e[55]!==u||e[56]!==ce||e[57]!==ie||e[58]!==je||e[59]!==M||e[60]!==Ae||e[61]!==de||e[62]!==E?(be=n.jsxs("div",{ref:u,style:ce,...H,...K,role:oe,tabIndex:Ce,onClick:p,onKeyDown:E,className:ie,children:[je,M,Ae,de]}),e[52]=H,e[53]=K,e[54]=p,e[55]=u,e[56]=ce,e[57]=ie,e[58]=je,e[59]=M,e[60]=Ae,e[61]=de,e[62]=E,e[63]=be):be=e[63],be}function zr(m){return m.stopPropagation()}function Hr(m){return m.stopPropagation()}function Ur(m){return m.stopPropagation()}function Wr(m){return m.stopPropagation()}function Gr(){return!1}function Yr(m){const e=He.c(90),{listKey:r,rawSections:c,sections:d,meta:h,selectedIndex:S,onSelect:p,onReorder:v,onDelete:g,onDuplicate:b,onMakeReusable:C,onToggleHidden:R,onToggleLazy:_,onAddVariant:k,onDetach:o,onAddSection:D,canAddSection:l}=m,J=l===void 0?!0:l;let H;e[0]!==d.length?(H=()=>$n(d.length),e[0]=d.length,e[1]=H):H=e[1];const[K,u]=w.useState(H),[P,se]=w.useState(null),[T,pe]=w.useState(r),[N,ce]=w.useState(d.length),B=w.useRef(!1);T!==r?(pe(r),ce(d.length),u($n(d.length))):N!==d.length&&(ce(d.length),u(L=>Fr(L,d.length)));let te;e[2]===Symbol.for("react.memo_cache_sentinel")?(te={activationConstraint:{distance:8}},e[2]=te):te=e[2];let oe;e[3]===Symbol.for("react.memo_cache_sentinel")?(oe={coordinateGetter:ra},e[3]=oe):oe=e[3];const Ce=ea(It(na,te),It(ta,oe));let E;e[4]!==K?(E=K.map(qr),e[4]=K,e[5]=E):E=e[5];const ue=E;let ie;e[6]===Symbol.for("react.memo_cache_sentinel")?(ie=L=>{se(String(L.active.id))},e[6]=ie):ie=e[6];const je=ie;let M;e[7]!==ue||e[8]!==v?(M=L=>{se(null);const{active:ae,over:Q}=L;if(!Q||ae.id===Q.id)return;const Ie=ue.indexOf(String(ae.id)),he=ue.indexOf(String(Q.id));Ie===-1||he===-1||(u(Qe=>da(Dt([...Qe],Ie,he))),B.current=!0,requestAnimationFrame(()=>{B.current=!1}),v?.(Ie,he))},e[7]=ue,e[8]=v,e[9]=M):M=e[9];const Ae=M;let X;e[10]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{se(null)},e[10]=X):X=e[10];const Ne=X;let ve,re,G,Y,ne,le,ke,Se,de,be,$,Z,we,Ee,Ke;if(e[11]!==P||e[12]!==J||e[13]!==K||e[14]!==ue||e[15]!==Ae||e[16]!==h||e[17]!==D||e[18]!==k||e[19]!==g||e[20]!==o||e[21]!==b||e[22]!==C||e[23]!==p||e[24]!==R||e[25]!==_||e[26]!==c||e[27]!==d||e[28]!==S||e[29]!==Ce){Ee=Symbol.for("react.early_return_sentinel");e:{const L=ae=>{B.current||p(ae)};if(e[45]!==P||e[46]!==J||e[47]!==K||e[48]!==D||e[49]!==c||e[50]!==d){const ae=P?K.find(Q=>Q.id===P):null;if(Y=ae!=null?d[ae.index]:null,G=ae!=null?c[ae.index]:void 0,K.length===0){let Q;e[54]===Symbol.for("react.memo_cache_sentinel")?(Q=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No sections in this page."}),e[54]=Q):Q=e[54];const Ie=!J;let he;e[55]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx(cn,{size:14}),e[55]=he):he=e[55];let Qe;e[56]!==D||e[57]!==Ie?(Qe=n.jsxs("div",{className:"space-y-2",children:[Q,n.jsxs(Ge,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Ie,onClick:D,children:[he,"Add section"]})]}),e[56]=D,e[57]=Ie,e[58]=Qe):Qe=e[58],Ee=Qe;break e}we=Be(ae&&"cursor-grabbing"),e[45]=P,e[46]=J,e[47]=K,e[48]=D,e[49]=c,e[50]=d,e[51]=G,e[52]=Y,e[53]=we}else G=e[51],Y=e[52],we=e[53];re=oa,Se=Ce,de=ia,be=je,$=Ae,Z=Ne,ve=la,le=ue,ke=ca,Ke="space-y-1",ne=K.map(ae=>{const Q=d[ae.index];return Q?n.jsx(Ir,{sortableId:ae.id,section:Q,raw:c[ae.index],meta:h,selected:S===ae.index,onSelect:()=>L(ae.index),onDelete:()=>g(ae.index),onDuplicate:()=>b(ae.index),onMakeReusable:()=>C(ae.index),onToggleHidden:()=>R(ae.index),onToggleLazy:()=>_(ae.index),onAddVariant:()=>k(ae.index),onDetach:()=>o(ae.index)},ae.id):null})}e[11]=P,e[12]=J,e[13]=K,e[14]=ue,e[15]=Ae,e[16]=h,e[17]=D,e[18]=k,e[19]=g,e[20]=o,e[21]=b,e[22]=C,e[23]=p,e[24]=R,e[25]=_,e[26]=c,e[27]=d,e[28]=S,e[29]=Ce,e[30]=ve,e[31]=re,e[32]=G,e[33]=Y,e[34]=ne,e[35]=le,e[36]=ke,e[37]=Se,e[38]=de,e[39]=be,e[40]=$,e[41]=Z,e[42]=we,e[43]=Ee,e[44]=Ke}else ve=e[30],re=e[31],G=e[32],Y=e[33],ne=e[34],le=e[35],ke=e[36],Se=e[37],de=e[38],be=e[39],$=e[40],Z=e[41],we=e[42],Ee=e[43],Ke=e[44];if(Ee!==Symbol.for("react.early_return_sentinel"))return Ee;let Le;e[59]!==ne||e[60]!==Ke?(Le=n.jsx("div",{className:Ke,children:ne}),e[59]=ne,e[60]=Ke,e[61]=Le):Le=e[61];let Pe;e[62]!==ve||e[63]!==le||e[64]!==ke||e[65]!==Le?(Pe=n.jsx(ve,{items:le,strategy:ke,children:Le}),e[62]=ve,e[63]=le,e[64]=ke,e[65]=Le,e[66]=Pe):Pe=e[66];let $e;e[67]!==G||e[68]!==Y||e[69]!==h?($e=Y?n.jsx("div",{className:Be("cursor-grabbing shadow-lg ring-1 ring-border/60",fa(Y,!1)),children:n.jsx(ma,{section:Y,raw:G,meta:h})}):null,e[67]=G,e[68]=Y,e[69]=h,e[70]=$e):$e=e[70];let Fe;e[71]!==$e?(Fe=n.jsx(ua,{dropAnimation:null,children:$e}),e[71]=$e,e[72]=Fe):Fe=e[72];let Me;e[73]!==re||e[74]!==Se||e[75]!==de||e[76]!==be||e[77]!==$||e[78]!==Z||e[79]!==Pe||e[80]!==Fe?(Me=n.jsxs(re,{sensors:Se,collisionDetection:de,onDragStart:be,onDragEnd:$,onDragCancel:Z,children:[Pe,Fe]}),e[73]=re,e[74]=Se,e[75]=de,e[76]=be,e[77]=$,e[78]=Z,e[79]=Pe,e[80]=Fe,e[81]=Me):Me=e[81];const xe=!J;let Re;e[82]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(cn,{size:14}),e[82]=Re):Re=e[82];let me;e[83]!==D||e[84]!==xe?(me=n.jsxs(Ge,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:xe,onClick:D,children:[Re,"Add section"]}),e[83]=D,e[84]=xe,e[85]=me):me=e[85];let ee;return e[86]!==we||e[87]!==Me||e[88]!==me?(ee=n.jsxs("div",{className:we,children:[Me,me]}),e[86]=we,e[87]=Me,e[88]=me,e[89]=ee):ee=e[89],ee}function qr(m){return m.id}function On(m){const e=He.c(38),{open:r,initialName:c,autoLabel:d,isPending:h,onSubmit:S,onOpenChange:p}=m,v=h===void 0?!1:h,[g,b]=w.useState(c),[C,R]=w.useState(r);r!==C&&(R(r),r&&b(c));let _;e[0]!==v||e[1]!==p?(_=oe=>{!oe&&!v&&p(!1)},e[0]=v,e[1]=p,e[2]=_):_=e[2];const k=_;let o;e[3]!==v||e[4]!==g||e[5]!==S?(o=async oe=>{oe.preventDefault(),!v&&await S(g.trim())},e[3]=v,e[4]=g,e[5]=S,e[6]=o):o=e[6];const D=o;let l;e[7]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(pr,{children:"Rename variant"}),e[7]=l):l=e[7];const J=d||"the rule";let H;e[8]!==J?(H=n.jsxs(hr,{children:[l,n.jsxs(gr,{children:["Save this matcher as a global block with a custom label. Leave empty to inline the matcher again and fall back to"," ",n.jsx("span",{className:"font-medium",children:J}),"."]})]}),e[8]=J,e[9]=H):H=e[9];let K;e[10]===Symbol.for("react.memo_cache_sentinel")?(K=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[10]=K):K=e[10];let u;e[11]===Symbol.for("react.memo_cache_sentinel")?(u=oe=>b(oe.target.value),e[11]=u):u=e[11];let P;e[12]!==d||e[13]!==v||e[14]!==g?(P=n.jsxs("div",{className:"space-y-1.5 py-4",children:[K,n.jsx(yr,{id:"variant-rename-name",value:g,onChange:u,placeholder:d,autoFocus:!0,disabled:v})]}),e[12]=d,e[13]=v,e[14]=g,e[15]=P):P=e[15];let se;e[16]!==p?(se=()=>p(!1),e[16]=p,e[17]=se):se=e[17];let T;e[18]!==v||e[19]!==se?(T=n.jsx(Ge,{type:"button",variant:"outline",onClick:se,disabled:v,children:"Cancel"}),e[18]=v,e[19]=se,e[20]=T):T=e[20];let pe;e[21]!==v?(pe=v?n.jsxs(n.Fragment,{children:[n.jsx(zn,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=v,e[22]=pe):pe=e[22];let N;e[23]!==v||e[24]!==pe?(N=n.jsx(Ge,{type:"submit",disabled:v,children:pe}),e[23]=v,e[24]=pe,e[25]=N):N=e[25];let ce;e[26]!==T||e[27]!==N?(ce=n.jsxs(vr,{children:[T,N]}),e[26]=T,e[27]=N,e[28]=ce):ce=e[28];let B;e[29]!==D||e[30]!==ce||e[31]!==H||e[32]!==P?(B=n.jsx(Sr,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:D,children:[H,P,ce]})}),e[29]=D,e[30]=ce,e[31]=H,e[32]=P,e[33]=B):B=e[33];let te;return e[34]!==k||e[35]!==r||e[36]!==B?(te=n.jsx(xr,{open:r,onOpenChange:k,children:B}),e[34]=k,e[35]=r,e[36]=B,e[37]=te):te=e[37],te}const Jr="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]",pa="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.2)]";function ha(m){const e=He.c(5),{rule:r,matchers:c}=m,d=r?.__resolveType??"";let h;if(e[0]!==c||e[1]!==d){const g=c.find(b=>b.resolveType===d)?.iconName??Rs(d);h=ur(g),e[0]=c,e[1]=d,e[2]=h}else h=e[2];const S=h;if(!S)return null;let p;return e[3]!==S?(p=n.jsx(S,{size:14,className:"shrink-0"}),e[3]=S,e[4]=p):p=e[4],p}function Bn(m){return m.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
2
- `)}function on(m){return m.map((e,r)=>({id:crypto.randomUUID(),index:r,variant:e}))}function Qr(m){return m.map((e,r)=>({...e,index:r}))}function ga(m){const e=He.c(16),{label:r,effectiveRule:c,matchers:d,canDelete:h,dragging:S,onRename:p,onDuplicate:v,onDelete:g}=m;let b;e[0]!==c||e[1]!==d?(b=n.jsx(ha,{rule:c,matchers:d}),e[0]=c,e[1]=d,e[2]=b):b=e[2];let C;e[3]!==r?(C=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:r}),e[3]=r,e[4]=C):C=e[4];let R;e[5]!==h||e[6]!==S||e[7]!==r||e[8]!==g||e[9]!==v||e[10]!==p?(R=!S&&n.jsxs(Xn,{children:[n.jsx(Qn,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":`Actions for ${r}`,className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:Zr,onPointerDown:Xr,children:n.jsx(Gn,{size:14})})}),n.jsxs(Zn,{align:"end",className:"w-36",children:[n.jsxs(it,{onClick:k=>{k.stopPropagation(),p?.()},children:[n.jsx(Mr,{size:14}),"Rename"]}),n.jsxs(it,{onClick:k=>{k.stopPropagation(),v?.()},children:[n.jsx(qn,{size:14}),"Duplicate"]}),n.jsx(wr,{}),n.jsxs(it,{variant:"destructive",disabled:!h,onClick:k=>{k.stopPropagation(),g?.()},children:[n.jsx(Jn,{size:14}),"Delete"]})]})]}),e[5]=h,e[6]=S,e[7]=r,e[8]=g,e[9]=v,e[10]=p,e[11]=R):R=e[11];let _;return e[12]!==b||e[13]!==C||e[14]!==R?(_=n.jsxs(n.Fragment,{children:[b,C,R]}),e[12]=b,e[13]=C,e[14]=R,e[15]=_):_=e[15],_}function Xr(m){return m.stopPropagation()}function Zr(m){return m.stopPropagation()}function eo(m){const e=He.c(33),{entry:r,sortableId:c,isActive:d,canDelete:h,decofile:S,meta:p,matchers:v,onSelect:g,onRename:b,onDuplicate:C,onDelete:R}=m;let _;e[0]!==c?(_={id:c,animateLayoutChanges:to},e[0]=c,e[1]=_):_=e[1];const{attributes:k,listeners:o,setNodeRef:D,transform:l,isDragging:J}=aa(_);let H;e[2]!==l?(H=sa.Transform.toString(l?{...l,x:0}:null),e[2]=l,e[3]=H):H=e[3];const K=J?0:void 0;let u;e[4]!==H||e[5]!==K?(u={transform:H,opacity:K},e[4]=H,e[5]=K,e[6]=u):u=e[6];const P=u,se=p??void 0;let T;e[7]!==S||e[8]!==r.variant.rule||e[9]!==se?(T=Rt(r.variant.rule,S,se),e[7]=S,e[8]=r.variant.rule,e[9]=se,e[10]=T):T=e[10];const pe=T;let N;e[11]!==g?(N=E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),g())},e[11]=g,e[12]=N):N=e[12];const ce=J?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",B=d?pa:Jr;let te;e[13]!==ce||e[14]!==B?(te=Be("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",ce,B),e[13]=ce,e[14]=B,e[15]=te):te=e[15];let oe;e[16]!==h||e[17]!==pe||e[18]!==r.variant.label||e[19]!==v||e[20]!==R||e[21]!==C||e[22]!==b?(oe=n.jsx(ga,{label:r.variant.label,effectiveRule:pe,matchers:v,canDelete:h,onRename:b,onDuplicate:C,onDelete:R}),e[16]=h,e[17]=pe,e[18]=r.variant.label,e[19]=v,e[20]=R,e[21]=C,e[22]=b,e[23]=oe):oe=e[23];let Ce;return e[24]!==k||e[25]!==o||e[26]!==g||e[27]!==D||e[28]!==P||e[29]!==te||e[30]!==oe||e[31]!==N?(Ce=n.jsx("div",{ref:D,style:P,...k,...o,onClick:g,onKeyDown:N,className:te,children:oe}),e[24]=k,e[25]=o,e[26]=g,e[27]=D,e[28]=P,e[29]=te,e[30]=oe,e[31]=N,e[32]=Ce):Ce=e[32],Ce}function to(){return!1}function no(m){const e=He.c(9),{variant:r,decofile:c,meta:d,matchers:h}=m,S=d??void 0;let p;e[0]!==c||e[1]!==S||e[2]!==r.rule?(p=Rt(r.rule,c,S),e[0]=c,e[1]=S,e[2]=r.rule,e[3]=p):p=e[3];const v=p;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=Be("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",pa),e[4]=g):g=e[4];let b;return e[5]!==v||e[6]!==h||e[7]!==r.label?(b=n.jsx("div",{className:g,children:n.jsx(ga,{label:r.label,effectiveRule:v,matchers:h,canDelete:!1,dragging:!0})}),e[5]=v,e[6]=h,e[7]=r.label,e[8]=b):b=e[8],b}function ao(m){const e=He.c(77),{listKey:r,variants:c,activeIndex:d,decofile:h,meta:S,matchers:p,onSelect:v,onReorder:g,onRename:b,onDuplicate:C,onDelete:R,onAdd:_}=m;let k;e[0]!==c?(k=()=>on(c),e[0]=c,e[1]=k):k=e[1];const[o,D]=w.useState(k),[l,J]=w.useState(null),[H,K]=w.useState(r),[u,P]=w.useState(c.length);let se;e[2]!==c?(se=()=>Bn(c),e[2]=c,e[3]=se):se=e[3];const[T,pe]=w.useState(se),N=w.useRef(!1),ce=Bn(c);H!==r?(K(r),P(c.length),pe(ce),D(on(c))):u!==c.length?(P(c.length),pe(ce),D(on(c))):T!==ce&&(pe(ce),D(Me=>c.map((xe,Re)=>({id:Me[Re]?.id??crypto.randomUUID(),index:Re,variant:xe}))));let B;e[4]===Symbol.for("react.memo_cache_sentinel")?(B={activationConstraint:{distance:8}},e[4]=B):B=e[4];let te;e[5]===Symbol.for("react.memo_cache_sentinel")?(te={coordinateGetter:ra},e[5]=te):te=e[5];const oe=ea(It(na,B),It(ta,te));let Ce;e[6]!==o?(Ce=o.map(so),e[6]=o,e[7]=Ce):Ce=e[7];const E=Ce,ue=c.length>1;let ie;e[8]!==o?(ie=Me=>{const xe=String(Me.active.id);J(o.find(Re=>Re.id===xe)??null)},e[8]=o,e[9]=ie):ie=e[9];const je=ie;let M;e[10]!==E||e[11]!==g?(M=Me=>{J(null);const{active:xe,over:Re}=Me;if(!Re||xe.id===Re.id)return;const me=E.indexOf(String(xe.id)),ee=E.indexOf(String(Re.id));me===-1||ee===-1||(D(L=>Qr(Dt([...L],me,ee))),N.current=!0,requestAnimationFrame(()=>{N.current=!1}),g(me,ee))},e[10]=E,e[11]=g,e[12]=M):M=e[12];const Ae=M;let X;e[13]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{J(null)},e[13]=X):X=e[13];const Ne=X;let ve,re,G,Y,ne,le,ke,Se,de,be,$,Z,we;if(e[14]!==d||e[15]!==ue||e[16]!==h||e[17]!==o||e[18]!==E||e[19]!==Ae||e[20]!==je||e[21]!==p||e[22]!==S||e[23]!==_||e[24]!==R||e[25]!==C||e[26]!==b||e[27]!==v||e[28]!==oe){const Me=L=>{N.current||v(L)};$="space-y-1 border-b p-2";let xe;e[42]===Symbol.for("react.memo_cache_sentinel")?(xe=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variants"}),e[42]=xe):xe=e[42];let Re;e[43]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(cn,{size:14}),e[43]=Re):Re=e[43];let me;e[44]!==_?(me=n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-6",onClick:_,children:Re})}),e[44]=_,e[45]=me):me=e[45];let ee;e[46]===Symbol.for("react.memo_cache_sentinel")?(ee=n.jsx(pt,{children:"Add variant"}),e[46]=ee):ee=e[46],e[47]!==me?(Z=n.jsxs("div",{className:"flex items-center justify-between",children:[xe,n.jsxs(mt,{children:[me,ee]})]}),e[47]=me,e[48]=Z):Z=e[48],re=oa,le=oe,ke=ia,Se=je,de=Ae,be=Ne,ve=la,Y=E,ne=ca,we="space-y-0.5",G=o.map(L=>n.jsx(eo,{sortableId:L.id,entry:L,isActive:L.index===d,canDelete:ue,decofile:h,meta:S,matchers:p,onSelect:()=>Me(L.index),onRename:()=>b(L.index),onDuplicate:()=>C(L.index),onDelete:()=>R(L.index)},L.id)),e[14]=d,e[15]=ue,e[16]=h,e[17]=o,e[18]=E,e[19]=Ae,e[20]=je,e[21]=p,e[22]=S,e[23]=_,e[24]=R,e[25]=C,e[26]=b,e[27]=v,e[28]=oe,e[29]=ve,e[30]=re,e[31]=G,e[32]=Y,e[33]=ne,e[34]=le,e[35]=ke,e[36]=Se,e[37]=de,e[38]=be,e[39]=$,e[40]=Z,e[41]=we}else ve=e[29],re=e[30],G=e[31],Y=e[32],ne=e[33],le=e[34],ke=e[35],Se=e[36],de=e[37],be=e[38],$=e[39],Z=e[40],we=e[41];let Ee;e[49]!==G||e[50]!==we?(Ee=n.jsx("div",{className:we,children:G}),e[49]=G,e[50]=we,e[51]=Ee):Ee=e[51];let Ke;e[52]!==ve||e[53]!==Y||e[54]!==ne||e[55]!==Ee?(Ke=n.jsx(ve,{items:Y,strategy:ne,children:Ee}),e[52]=ve,e[53]=Y,e[54]=ne,e[55]=Ee,e[56]=Ke):Ke=e[56];let Le;e[57]!==l||e[58]!==h||e[59]!==p||e[60]!==S?(Le=l?n.jsx(no,{variant:l.variant,decofile:h,meta:S,matchers:p}):null,e[57]=l,e[58]=h,e[59]=p,e[60]=S,e[61]=Le):Le=e[61];let Pe;e[62]!==Le?(Pe=n.jsx(ua,{dropAnimation:null,children:Le}),e[62]=Le,e[63]=Pe):Pe=e[63];let $e;e[64]!==re||e[65]!==le||e[66]!==ke||e[67]!==Se||e[68]!==de||e[69]!==be||e[70]!==Ke||e[71]!==Pe?($e=n.jsxs(re,{sensors:le,collisionDetection:ke,onDragStart:Se,onDragEnd:de,onDragCancel:be,children:[Ke,Pe]}),e[64]=re,e[65]=le,e[66]=ke,e[67]=Se,e[68]=de,e[69]=be,e[70]=Ke,e[71]=Pe,e[72]=$e):$e=e[72];let Fe;return e[73]!==$||e[74]!==Z||e[75]!==$e?(Fe=n.jsxs("div",{className:$,children:[Z,$e]}),e[73]=$,e[74]=Z,e[75]=$e,e[76]=Fe):Fe=e[76],Fe}function so(m){return m.id}function Ln(m){const e=He.c(15),{schema:r,value:c,onChange:d,meta:h,decofile:S,onSaveReferencedBlock:p,sandbox:v}=m;let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];const[b,C]=w.useState(g);let R;e[1]!==b?(R=b.length>0&&n.jsxs("nav",{"aria-label":"Variant rule breadcrumb",className:"flex min-w-0 items-center gap-1 overflow-hidden text-xs",children:[n.jsx("button",{type:"button",onClick:()=>C([]),className:"flex shrink-0 items-center gap-0.5 rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",title:"Back to rule",children:n.jsx(lr,{className:"size-3.5"})}),b.map((o,D)=>{const l=D===b.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[D>0&&n.jsx(Wn,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>C(b.slice(0,D+1)),title:o,className:Be("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",l?"font-medium text-foreground":"text-muted-foreground"),children:o})]},`${o}-${D}`)})]}),e[1]=b,e[2]=R):R=e[2];let _;e[3]!==b||e[4]!==S||e[5]!==h||e[6]!==d||e[7]!==p||e[8]!==v||e[9]!==r||e[10]!==c?(_=n.jsx(Un,{schema:r,value:c,onChange:d,basePath:"",breadcrumbPath:b,onBreadcrumbChange:C,meta:h,decofile:S,onSaveReferencedBlock:p,sandbox:v}),e[3]=b,e[4]=S,e[5]=h,e[6]=d,e[7]=p,e[8]=v,e[9]=r,e[10]=c,e[11]=_):_=e[11];let k;return e[12]!==R||e[13]!==_?(k=n.jsxs("div",{className:"space-y-2",children:[R,_]}),e[12]=R,e[13]=_,e[14]=k):k=e[14],k}function Fn(m){const e=He.c(21),{activeSchema:r,formValue:c,formResetKey:d,onFormChange:h,onBreadcrumbChange:S,breadcrumbPath:p,emptyMessage:v,beforeForm:g,seoResolveType:b,siteDefaultSeo:C,meta:R,decofile:_,onSaveReferencedBlock:k,sandbox:o}=m;let D;e[0]!==p?(D=p===void 0?[]:p,e[0]=p,e[1]=D):D=e[1];const l=D;let J;e[2]!==r||e[3]!==l||e[4]!==_||e[5]!==d||e[6]!==c||e[7]!==R||e[8]!==S||e[9]!==h||e[10]!==k||e[11]!==o||e[12]!==b||e[13]!==C?(J=r&&c?b?n.jsx(Ar,{schema:r,resolveType:b,value:c,formResetKey:d,onChange:h,onBreadcrumbChange:S,siteDefaultSeo:C}):n.jsx(Un,{schema:r,value:c,onChange:h,basePath:"",breadcrumbPath:l,onBreadcrumbChange:S,meta:R,decofile:_,onSaveReferencedBlock:k,sandbox:o},d):null,e[2]=r,e[3]=l,e[4]=_,e[5]=d,e[6]=c,e[7]=R,e[8]=S,e[9]=h,e[10]=k,e[11]=o,e[12]=b,e[13]=C,e[14]=J):J=e[14];const H=J;let K;e[15]!==v||e[16]!==H?(K=H??n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:v}),e[15]=v,e[16]=H,e[17]=K):K=e[17];let u;return e[18]!==g||e[19]!==K?(u=n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsxs("div",{className:"mx-auto max-w-2xl",children:[g,K]})}),e[18]=g,e[19]=K,e[20]=u):u=e[20],u}const ro="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.22)]";function oo(m,e){return Is(m,e,et)}function io(m){const e=He.c(13),{pageKey:r,initialName:c,initialPath:d,onFieldChange:h}=m,[S,p]=w.useState(c),[v,g]=w.useState(d),[b,C]=w.useState(r);b!==r&&(C(r),p(c),g(d));let R;e[0]!==h?(R=l=>{p(l.target.value),h("name",l.target.value)},e[0]=h,e[1]=R):R=e[1];let _;e[2]!==S||e[3]!==R?(_=n.jsx("input",{type:"text",value:S,onChange:R,className:"w-full bg-transparent text-sm font-semibold truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"Page name"}),e[2]=S,e[3]=R,e[4]=_):_=e[4];let k;e[5]!==h?(k=l=>{g(l.target.value),h("path",l.target.value)},e[5]=h,e[6]=k):k=e[6];let o;e[7]!==v||e[8]!==k?(o=n.jsx("input",{type:"text",value:v,onChange:k,className:"w-full bg-transparent text-xs text-muted-foreground truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"/path"}),e[7]=v,e[8]=k,e[9]=o):o=e[9];let D;return e[10]!==_||e[11]!==o?(D=n.jsxs("div",{className:"space-y-1",children:[_,o]}),e[10]=_,e[11]=o,e[12]=D):D=e[12],D}function In(m){const e=He.c(6),{onClick:r}=m;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(Yn,{size:14}),e[0]=c):c=e[0];let d;e[1]!==r?(d=n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:r,children:c})}),e[1]=r,e[2]=d):d=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(pt,{side:"bottom",children:"Add variant"}),e[3]=h):h=e[3];let S;return e[4]!==d?(S=n.jsxs(mt,{children:[d,h]}),e[4]=d,e[5]=S):S=e[5],S}function Wl({orgSlug:m,virtualMcpId:e,branch:r,previewReady:c=!0,previewUrl:d,currentPath:h,activePageBlockKey:S=null,activeGlobalBlockKey:p=null,externalSelectedIndex:v,onSaved:g,initialEditSeo:b=!1,onExitSeo:C,onViewJsonFile:R,onVariantPreviewOverride:_}){const k=c?{orgSlug:m,virtualMcpId:e,branch:r,previewUrl:d}:null,{data:o,isLoading:D}=Ds(k),{data:l,isLoading:J}=Ns(k),H=Vs(),K=H?.entity?.id===e?H.entity.metadata?.siteSlug??null:null,[u,P]=w.useState(null),[se,T]=w.useState(null),[pe,N]=w.useState(null),[ce,B]=w.useState(0),[te,oe]=w.useState(void 0),[Ce,E]=w.useState(null),[ue,ie]=w.useState(null),[je,M]=w.useState([]),[Ae,X]=w.useState(0),[Ne,ve]=w.useState(null),[re,G]=w.useState(null),[Y,ne]=w.useState(null),[le,ke]=w.useState(!0),[Se,de]=w.useState(!1),[be,$]=w.useState(!1),[Z,we]=w.useState(b),[Ee,Ke]=w.useState(b);b&&!Ee&&(Ke(!0),we(!0),P(null),T(null),N(null),M([])),!b&&Ee&&Ke(!1);const[Le,Pe]=w.useState(null),[$e,Fe]=w.useState(void 0),[Me,xe]=w.useState([]),[Re,me]=w.useState(0),[ee,L]=w.useState(0),[ae,Q]=w.useState(null),[Ie,he]=w.useState(null),[Qe,un]=w.useState(null),va=vs(),Sa=`${m}/${e}/${r}`,zt=Cs({orgSlug:m,virtualMcpId:e,branch:r}),[xa,ya]=w.useState(h),[ba,_a]=w.useState(S),[ja,ka]=w.useState(p);(xa!==h||ba!==S||ja!==p)&&(queueMicrotask(()=>zt.flush()),ya(h),_a(S),ka(p),P(null),T(null),N(null),B(0),E(null),ie(null),L(0),Q(null),he(null),M([]),X(t=>t+1),we(!1),Pe(null),Fe(void 0),xe([]),me(t=>t+1));const ye=Ps({orgSlug:m,virtualMcpId:e,branch:r}),Nt=Qs((t,a)=>{ye.mutate({blockKey:t,data:a},{onSuccess:()=>g?.(),onError:s=>W.error(`Save failed: ${s.message}`)})}),Ht=Ts({orgSlug:m,virtualMcpId:e,branch:r}),[bt,Vt]=w.useState(!1),Ut=w.useRef(null),ht=w.useRef(null),gt=w.useRef(null),Wt=w.useRef({}),Ye=w.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!c||D||J)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(zn,{size:20,className:"animate-spin text-muted-foreground"})});if(!o||!l)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Could not load site data."});const wa=As(o),_e=!!p,ze=_e?null:Ms(wa,h,S),j=_e?p:ze?.key??null,Gt=_e&&p?o[p]:void 0,dn=_e&&p&&Gt?Es(p,Gt):_e&&p?p:"",Ct=!_e&&j&&o[j]?o[j]:null,Yt=Z&&o&&l&&j&&ze?Kn(o,{kind:"page",pageKey:j,pageName:String(ze.name??""),path:String(ze.path??"")},l):null,Ra=Z?Ct?.seo:void 0,qt=$e!==void 0?$e:Ra,Da=Z?Rr(qt):void 0,Na=Yt?.seoTypeOptions??[],Va=Z&&l?Dr(l):"",mn=Le??Da??{},Jt=Z&&Yt?Nr(mn,Yt):null,Ca=Z&&Jt&&Vr(qt)?$t(Jt,l):null,Pa=Z?Cr(o,l)?.seoData:void 0,Oe=_e?[{label:"Default",sections:[{__resolveType:p}]}]:oo(Ct?.sections,o??{}),Pt=Oe.length>1,Ve=Math.min(ce,Oe.length-1),tt=Oe[Ve],I=tt?.sections??[],Te=Ot(I,o),fn=!_e&&Ks(Ct?.sections);if(_e&&p&&Qe!==p){un(p);const t=I[0],a=Te[0];if(t&&a){P(0),L(0),M([]);const s=ut(t,a,o);s&&(T(s.data),N(s.resolveType),he(null),Q(null))}}!_e&&Qe!==null&&un(null),Ye.current={rawSections:I,parsedSections:Te,decofile:o??{},activePageKey:j,pageVariants:Oe,variantIndex:Ve,sectionVariantIndex:ee,selectedSectionIndex:u};const Ta=()=>({multivariate:fn,index:Ve,variants:Oe.map(t=>({rule:t.rule}))}),pn=(t,a)=>{if(!_)return;if(!j||!fn||t.length<=1){_(null);return}const s=Mn(j,{multivariate:!0,index:a,variants:t},o,l);_(s.length>0?s:null)},vt=(t,a,s)=>{if(!_)return;if(!j){_(null);return}const i=Ta(),f=Mn(j,i,o,l);if(!t||a<0){_(f.length>0?f:null);return}const y=nr({pageKey:j,page:i,sectionIndex:a,sectionLazy:Te[a]?.isLazy??!1,mvObj:t,selectedVariantIndex:s,decofile:o,meta:l}),x=[...f,...y];_(x.length>0?x:null)},nt=(t,a,s,i=u??-1,f=!1)=>{const y=Je(t,a);if(!y){T(null),N(null),he(null),Q(null),f&&vt(null,i,s);return}const V=Vn(y,et)[s];if(!V){T(null),N(null),he(null),Q(null),f&&vt(null,i,s);return}const q=zs(V.value,o);T(q?.data??null),N(q?.resolveType??null);const{resolveType:A,formValue:O}=jt(V.rule,o,l??void 0);he(A),Q(O),f&&vt(y,i,s)};if(v!==void 0&&v!==te&&(oe(v??null),typeof v=="number")){const t=I[v],a=Te[v];if(t&&a)if(P(v),L(0),M([]),X(s=>s+1),a.isMultivariate)nt(t,a,0,v);else{const s=ut(t,a,o);s?(T(s.data),N(s.resolveType)):(T(null),N(null)),he(null),Q(null)}}const Tt={orgSlug:m,virtualMcpId:e,branch:r,previewUrl:d??void 0,siteSlug:K},Qt=pe&&l?$t(pe,l):null,Ue=(t,a)=>{if(!j)return;const s=wt(o,j,t,Ve,Oe);ye.mutate({blockKey:j,data:s},{onSuccess:()=>a?.onSuccess?.()??g?.(),onError:i=>W.error(`Save failed: ${i.message}`)})},St=()=>{P(null),T(null),N(null),L(0),Q(null),he(null),M([]),X(t=>t+1)},Aa=(t,a)=>{Ut.current&&clearTimeout(Ut.current);const s=Ye.current.sectionVariantIndex;Ut.current=setTimeout(()=>{const{rawSections:i,parsedSections:f,decofile:y,activePageKey:x,pageVariants:V,variantIndex:q}=Ye.current,A=i[a];if(!A)return;const O=f[a];if(!O)return;if(O.isSavedBlock){const z=O.isLazy?A.section?.__resolveType??A.__resolveType:A.__resolveType;ye.mutate({blockKey:z,data:t},{onSuccess:()=>g?.(),onError:U=>W.error(`Save failed: ${U.message}`)});return}if(!x)return;const F={...y[x]},ge=[...i];if(O.isMultivariate){const z=Je(A,O);if(!z||!x)return;const U=sr(z,s,t);ge[a]=dt(A,O,U)}else if(O.isHidden){const z=Hn(A.__resolveType),U=z?{...A.section}:{...A},De=Array.isArray(U.variants)?[...U.variants]:[];De[0]&&(De[0]={...De[0],value:t}),U.variants=De,z?ge[a]={...A,section:U}:ge[a]=U}else O.isLazy?ge[a]={...A,section:t}:ge[a]=t;if(V.length>1){const z=F.sections,U=[...z?.variants??[]];U[q]&&(U[q]={...U[q],value:ge}),F.sections={...z,variants:U}}else F.sections=ge;ye.mutate({blockKey:x,data:F},{onSuccess:()=>g?.(),onError:z=>W.error(`Save failed: ${z.message}`)})},rn)},Ma=t=>{P(t),L(0),M([]),X(f=>f+1);const a=I[t],s=Te[t];if(!a||!s)return;if(s.isMultivariate){nt(a,s,0,t);return}const i=ut(a,s,o);if(!i){T(null),N(null),he(null),Q(null),vt(null,t,0);return}T(i.data),N(i.resolveType),he(null),Q(null),vt(null,t,0)},hn=t=>{const a=t;T(a),u!==null&&Aa(a,u)},Xt=t=>{if(!j||!o||!l||!ze)return;const a={kind:"page",pageKey:j,pageName:String(ze.name??""),path:String(ze.path??"")},s=Kn(o,a,l);s&&zt.save(j,()=>{const i=va.getQueryData(Ss.decofile(Sa))?.[j];if(!i||typeof i!="object"||i===null||Array.isArray(i))return null;const f={...i,...Wt.current};return Wt.current={},t?.raw!==void 0?{...f,seo:t.raw}:t?.inner!==void 0?Tr(a,s,f,t.inner):f})},Ea=(t,a)=>{j&&(Wt.current[t]=a,Xt())},Ka=(t,a)=>{if(!j)return;const s=Dt([...I],t,a);u!==null&&(u===t?P(a):t<u&&a>=u?P(u-1):t>u&&a<=u&&P(u+1)),Ue(s)},$a=t=>{if(!j)return;const a=I.filter((s,i)=>i!==t);u===t?St():u!==null&&u>t&&P(u-1),Ue(a)},Oa=t=>{if(!j)return;const a=I[t];if(!a)return;const s=[...I];s.splice(t+1,0,tr(a)),u!==null&&u>t&&P(u+1),Ue(s)},Ba=t=>{if(!j)return;const a=I[t],s=Te[t];if(!a||!s||s.isMultivariate)return;const i=s.isHidden?Zs(a):er(a);if(!i)return;const f=[...I];f[t]=i,u===t&&St(),Ue(f)},La=t=>{if(!j)return;const a=I[t],s=Te[t];if(!a||!s||s.isMultivariate)return;const i=Xs(a);if(!i)return;const f=[...I];f[t]=i,u===t&&St(),Ue(f)},Fa=t=>{if(!j)return;const a=I[t],s=Te[t];if(!a||!s?.isSavedBlock)return;const i=ut(a,s,o);if(!i?.data)return;const{name:f,...y}=i.data,x=[...I];s.isLazy?x[t]={...a,section:y}:x[t]=y,u===t&&St(),Ue(x)},Ia=t=>{if(!j)return;const a=[...I,{__resolveType:t.resolveType}],s=a.length-1;Ue(a,{onSuccess:()=>{de(!1),P(s),L(0),M([]),X(x=>x+1);const i=a[s],f=Ot(a,o)[s];if(!i||!f)return;if(f.isMultivariate){nt(i,f,0);return}const y=ut(i,f,o);if(!y){T(null),N(null),he(null),Q(null);return}T(y.data),N(y.resolveType),he(null),Q(null)}})},za=t=>{if(u===null)return;const a=I[u],s=Te[u];!a||!s?.isMultivariate||(L(t),M([]),X(i=>i+1),nt(a,s,t,u,!0))},Ha=t=>{if(u===null||!j)return;const a=I[u],s=Te[u];if(!a||!s?.isMultivariate)return;const i=Je(a,s);if(!i)return;const f=qs(i,t);if(!f){W.error("Cannot delete the only variant.");return}const y=[...I];y[u]=dt(a,s,f);const x=f.variants;let V=ee;t===ee?V=Math.min(t,x.length-1):t<ee&&(V=ee-1),L(V),M([]),X(q=>q+1),nt(y[u],s,V),Ue(y)},Ua=t=>{if(u===null||!j)return;const a=I[u],s=Te[u];if(!a||!s?.isMultivariate)return;const i=Je(a,s);if(!i)return;const f=Js(i,t),y=[...I];y[u]=dt(a,s,f);const x=t+1;L(x),M([]),X(V=>V+1),nt(y[u],s,x),Ue(y)},Wa=(t,a)=>{if(u===null||!j||t===a)return;const s=I[u],i=Te[u];if(!s||!i?.isMultivariate)return;const f=Je(s,i);if(!f)return;const y=Gs(f,t,a),x=[...I];x[u]=dt(s,i,y);let V=ee;ee===t?V=a:t<ee&&a>=ee?V=ee-1:t>ee&&a<=ee&&(V=ee+1),L(V),nt(x[u],i,V),Ue(x)},Zt=t=>{const a=t??u;if(a===null||!j)return;const s=I[a],i=Te[a];if(!s||!i)return;const f=Hs(s,i);if(!f){W.error("This section cannot have variants.");return}const y=[...I];y[a]=f.section;const x=Ot(y,o)[a];if(!x?.isMultivariate){W.error("Could not add variant.");return}P(a),L(f.newVariantIndex),M([]),X(V=>V+1),nt(f.section,x,f.newVariantIndex,a),Ue(y)},Ga=()=>{if(u===null||!j)return;const t=I[u],a=Te[u];if(!t||!a?.isMultivariate)return;const s=Je(t,a);if(!s)return;const i=Ys(t,a,s);if(!i){W.error("Could not remove variants.");return}const f=[...I];f[u]=i;const y=Ot(f,o)[u];if(!y)return;L(0),he(null),Q(null),M([]),X(V=>V+1);const x=ut(i,y,o);x?(T(x.data),N(x.resolveType)):(T(null),N(null)),vt(null,u,0),Ue(f)},Ya=async t=>{if(Ne===null||!j)return;const a=sn(t,o);if(a){W.error(a);return}const s=I[Ne],i=Te[Ne];if(!s||!i)return;const f=ut(s,i,o);if(!f){W.error("This section cannot be saved as global.");return}const y={...f.data,name:t};try{await ye.mutateAsync({blockKey:t,data:y});const x=[...I];x[Ne]={__resolveType:t},await ye.mutateAsync({blockKey:j,data:wt(o,j,x,Ve,Oe)}),u===Ne&&St(),ve(null),W.success(`Saved global block "${t}"`),g?.()}catch(x){W.error(x instanceof Error?x.message:"Failed to save global block")}},gn=tt?.rule;if(Pt&&u===null&&ue===null&&gn){const{resolveType:t,formValue:a}=jt(gn,o??{},l??void 0);ie(t),E(a)}const At=l?$s(l):[],vn=l&&o?Os(l,o):[],qa=!_e&&!!(d&&l&&o),Sn=ue&&l?$t(ue,l):null,Mt=()=>{ht.current&&(clearTimeout(ht.current),ht.current=null),gt.current&&(clearTimeout(gt.current),gt.current=null)},_t=async(t,a)=>{if(!(ar(a,t,l)>0))try{await Ht.mutateAsync({blockKey:t})}catch(s){W.error(s instanceof Error?s.message:"Could not delete matcher block")}},xn=t=>{ht.current&&clearTimeout(ht.current),ht.current=setTimeout(()=>{const{activePageKey:a,decofile:s,variantIndex:i}=Ye.current;if(!a)return;const f={...s[a]},y={...f.sections},x=[...y.variants??[]],V=x[i],q=V?.rule;if(xt(q,s,l)){const A=q?.__resolveType??"",O=s[A],F=typeof O?.name=="string"?O.name:A,{__resolveType:ge,...z}=t;ye.mutate({blockKey:A,data:yt(ge??"",z,F)},{onSuccess:()=>g?.(),onError:U=>W.error(`Save failed: ${U.message}`)});return}V&&(x[i]={...V,rule:t}),f.sections={...y,variants:x},ye.mutate({blockKey:a,data:f},{onSuccess:()=>g?.(),onError:A=>W.error(`Save failed: ${A.message}`)})},rn)},Ja=t=>{ie(t);const a=t?{__resolveType:t}:{__resolveType:En};E({}),xn(a)},Qa=t=>{const a=t;E(a);const s=ue?{__resolveType:ue,...a}:{...a};xn(s)},Xa=async t=>{Mt();const{activePageKey:a,decofile:s,variantIndex:i}=Ye.current;if(!a)return;const f=s[a],y=f?.sections;if(!y||typeof y!="object"||Array.isArray(y))return;const x=y;if(!Array.isArray(x.variants))return;const V=[...x.variants],q=V[i];if(!q)return;const A=kt(q.rule,s,l),O=Lt(t);V[i]={...q,rule:O};const F={...s,[a]:{...f,sections:{...x,variants:V}}},{resolveType:ge,formValue:z}=jt(O,F,l??void 0);ie(ge),E(z);try{await ye.mutateAsync({blockKey:a,data:F[a]}),A&&A!==t&&await _t(A,F),g?.()}catch(U){W.error(U instanceof Error?U.message:"Could not apply saved rule")}},yn=t=>{gt.current&&clearTimeout(gt.current);const{selectedSectionIndex:a,sectionVariantIndex:s}=Ye.current;a!==null&&(gt.current=setTimeout(()=>{const{rawSections:i,parsedSections:f,decofile:y,activePageKey:x,pageVariants:V,variantIndex:q}=Ye.current;if(!x)return;const A=i[a],O=f[a];if(!A||!O?.isMultivariate)return;const F=Je(A,O);if(!F)return;const z=(F.variants??[])[s]?.rule;if(xt(z,y,l)){const fe=z?.__resolveType??"",We=y[fe],Xe=typeof We?.name=="string"?We.name:fe,{__resolveType:rt,...Ze}=t;ye.mutate({blockKey:fe,data:yt(rt??"",Ze,Xe)},{onSuccess:()=>g?.(),onError:ot=>W.error(`Save failed: ${ot.message}`)});return}const U=Pn(F,s,t),De=[...i];De[a]=dt(A,O,U);const qe=wt(y,x,De,q,V);ye.mutate({blockKey:x,data:qe},{onSuccess:()=>g?.(),onError:fe=>W.error(`Save failed: ${fe.message}`)})},rn))},Za=t=>{he(t),Q({}),yn(t?{__resolveType:t}:{__resolveType:En})},es=t=>{const a=t;Q(a);const s=Ie?{__resolveType:Ie,...a}:{...a};yn(s)},ts=async t=>{Mt();const{selectedSectionIndex:a,sectionVariantIndex:s,rawSections:i,parsedSections:f,decofile:y,activePageKey:x,pageVariants:V,variantIndex:q}=Ye.current;if(a===null||!x)return;const A=i[a],O=f[a];if(!A||!O?.isMultivariate)return;const F=Je(A,O);if(!F)return;const ge=F.variants??[],z=kt(ge[s]?.rule,y,l),U=Lt(t),De=Pn(F,s,U),qe=[...i];qe[a]=dt(A,O,De);const fe=wt(y,x,qe,q,V),We={...y,[x]:fe},{resolveType:Xe,formValue:rt}=jt(U,We,l??void 0);he(Xe),Q(rt);try{await ye.mutateAsync({blockKey:x,data:fe}),z&&z!==t&&await _t(z,We),g?.()}catch(Ze){W.error(Ze instanceof Error?Ze.message:"Could not apply saved rule")}};if(!_e&&!ze)return n.jsxs("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:["No page found for ",h]});if(_e&&!Gt)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Global block not found"});const at=u!==null?Te[u]??null:null,bn=u!==null?I[u]:null,_n=bn&&at?.isMultivariate?Je(bn,at):null,lt=_n?Vn(_n,et):[],en=Math.min(ee,Math.max(lt.length-1,0)),Et=lt[en]??null,ct=at?.isMultivariate===!0,jn=u!==null&&at!==null,Kt=jn&&(ct||!!(Qt&&se)),ns=Kt&&!_e&&at?.isSavedBlock===!0,st=_e||ns,as=_e?dn:at?.label??"",kn=Ie&&l?$t(Ie,l):null,tn=Kt&&(!_e||je.length>0)?_e?[dn,...je]:[ze.name,at.label,...ct&&Et?[Et.label]:[],...je]:[],ss=Z&&ze?[ze.name,"SEO",...Me]:[],wn=Z?ss:st?tn.length>0?tn:[as]:tn,Rn=()=>{if(!j)return;const t=o[j],a=Us(t.sections,I);if(!a)return;const s=Ws(a);ye.mutate({blockKey:j,data:{...t,sections:a}},{onSuccess:()=>{B(s),P(null),T(null),N(null),M([]),E(null),ie(null)},onError:i=>W.error(`Save failed: ${i.message}`)})},nn=(t,a,s)=>{if(!j)return;const i=o[j],f=i.sections;if(!f||typeof f!="object"||Array.isArray(f))return;const y=f;if(!Array.isArray(y.variants))return;const x=t([...y.variants]);if(!x)return;const V=rr(y,x),q={...o,[j]:{...i,sections:V}};ye.mutate({blockKey:j,data:q[j]},{onSuccess:()=>{a?.(),s&&_t(s,q)},onError:A=>W.error(`Save failed: ${A.message}`)})},rs=t=>{G(null),B(t),P(null),T(null),N(null),M([]);const a=Oe[t]?.rule,{resolveType:s,formValue:i}=jt(a,o??{},l??void 0);ie(s),E(i),pn(Oe.map(f=>({rule:f.rule})),t)},os=(t,a)=>{if(t===a)return;let s=Ve;Ve===t?s=a:t<Ve&&a>=Ve?s=Ve-1:t>Ve&&a<=Ve&&(s=Ve+1),B(s);const i=Dt(Oe.map(f=>({rule:f.rule})),t,a);pn(i,s),nn(f=>Dt(f,t,a))},is=t=>{const a=Oe[t]?.rule,s=kt(a,o??{},l??void 0);nn(i=>i.length<=1?null:(i.splice(t,1),i),()=>{Oe.length-1===1?B(0):t<Ve?B(Ve-1):t===Ve&&B(Math.max(0,t-1)),P(null),T(null),N(null),M([]),E(null),ie(null)},s)},ls=t=>{nn(a=>or(a,t),()=>{B(t+1),P(null),T(null),N(null),M([]),E(null),ie(null)})},cs=async(t,a)=>{Mt();const s=Ye.current.activePageKey,i=Ye.current.decofile;if(!s)return;const f=i[s],y=f.sections;if(!y||typeof y!="object"||Array.isArray(y))return;const x=y;if(!Array.isArray(x.variants))return;const V=[...x.variants],q=V[t];if(!q?.rule||typeof q.rule!="object"){W.error("This variant has no matcher rule to rename.");return}const A=q.rule,O=a.trim();Vt(!0);try{if(!O){if(!xt(A,i,l)){G(null);return}const qe=A.__resolveType??"";V[t]={...q,rule:Tn(A,i,l)};const fe={...i,[s]:{...f,sections:{...x,variants:V}}};await ye.mutateAsync({blockKey:s,data:fe[s]}),await _t(qe,fe),G(null),g?.();return}const F=An(A,i,l);if(!F){W.error("Could not read this variant's matcher rule.");return}if(F.blockKey){await ye.mutateAsync({blockKey:F.blockKey,data:yt(F.resolveType,F.data,O)}),G(null),g?.();return}const ge=an(O),z=sn(ge,i);if(z){W.error(z);return}const U=yt(F.resolveType,F.data,O);let De=null;try{await ye.mutateAsync({blockKey:ge,data:U}),De=ge,V[t]={...q,rule:Lt(ge)},await ye.mutateAsync({blockKey:s,data:{...f,sections:{...x,variants:V}}}),De=null}catch(qe){throw De&&await Ht.mutateAsync({blockKey:De}).catch(()=>{}),qe}G(null),W.success(`Saved matcher as global block "${O}"`),g?.()}catch(F){W.error(F instanceof Error?F.message:"Failed to rename variant")}finally{Vt(!1)}},us=async(t,a)=>{Mt();const{selectedSectionIndex:s,rawSections:i,parsedSections:f,decofile:y,activePageKey:x,pageVariants:V,variantIndex:q}=Ye.current;if(s===null||!x)return;const A=i[s],O=f[s];if(!A||!O?.isMultivariate)return;const F=Je(A,O);if(!F)return;const ge=F.variants??[],z=ge[t];if(!z?.rule||typeof z.rule!="object"){W.error("This variant has no matcher rule to rename.");return}const U=z.rule,De=a.trim();Vt(!0);const qe=async fe=>{const We={...F,variants:fe},Xe=[...i];Xe[s]=dt(A,O,We);const rt=wt(y,x,Xe,q,V);return await ye.mutateAsync({blockKey:x,data:rt}),{...y,[x]:rt}};try{if(!De){if(!xt(U,y,l)){ne(null);return}const ot=U.__resolveType??"",Nn=[...ge];Nn[t]={...z,rule:Tn(U,y,l)};const gs=await qe(Nn);await _t(ot,gs),ne(null),g?.();return}const fe=An(U,y,l);if(!fe){W.error("Could not read this variant's matcher rule.");return}if(fe.blockKey){await ye.mutateAsync({blockKey:fe.blockKey,data:yt(fe.resolveType,fe.data,De)}),ne(null),g?.();return}const We=an(De),Xe=sn(We,y);if(Xe){W.error(Xe);return}const rt=yt(fe.resolveType,fe.data,De);let Ze=null;try{await ye.mutateAsync({blockKey:We,data:rt}),Ze=We;const ot=[...ge];ot[t]={...z,rule:Lt(We)},await qe(ot),Ze=null}catch(ot){throw Ze&&await Ht.mutateAsync({blockKey:Ze}).catch(()=>{}),ot}ne(null),W.success(`Saved matcher as global block "${De}"`),g?.()}catch(fe){W.error(fe instanceof Error?fe.message:"Failed to rename variant")}finally{Vt(!1)}},Dn=()=>{St()},ds=t=>{Pe(t),Xt({inner:t})},ms=t=>{Fe(t),Xt({raw:t})},fs=()=>{Pe(null),xe([])},ps=()=>me(t=>t+1),hs=t=>{if(Z){if(t===0){zt.flush(),we(!1),Pe(null),Fe(void 0),xe([]),me(s=>s+1),C?.();return}if(t===1){xe([]),me(s=>s+1);return}xe(Me.slice(0,t-1)),me(s=>s+1);return}if(_e){M(je.slice(0,t)),X(s=>s+1);return}if(t===0){Dn();return}if(t===1){M([]),X(s=>s+1);return}if(ct&&t===2){M([]),X(s=>s+1);return}const a=ct?2:1;M(je.slice(0,t-a))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:st||Kt||Z?n.jsxs("div",{className:Be("border-b px-3 py-2.5",st&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!_e&&Pt&&tt&&n.jsxs("button",{type:"button",onClick:Dn,title:`Editing in variant: ${tt.label}`,className:Be("shrink-0 inline-flex items-center gap-1 rounded-md h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",ro),children:[n.jsx(ha,{rule:Rt(tt.rule,o??{},l??void 0),matchers:At}),n.jsx("span",{className:"max-w-[160px] truncate",children:tt.label})]}),n.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:wn.map((t,a)=>{const s=a===wn.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[a>0&&n.jsx(Wn,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>hs(a),title:t,className:Be("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",s?st?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":st?"text-foreground/80":"text-muted-foreground",st?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${a}`)})}),st&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(fr,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(pt,{side:"bottom",className:"max-w-[260px]",children:"A global section is a reusable block shared across your site. Editing it here updates it everywhere it's used."})]}),jn&&!ct&&!at?.isHidden&&j&&n.jsx(In,{onClick:()=>Zt()})]}),st&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:"This is a global section. Changes apply everywhere this section is used across your site."})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(io,{pageKey:j,initialName:ze.name,initialPath:ze.path,onFieldChange:Ea})}),n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Edit SEO",className:"size-7 shrink-0",onClick:()=>we(!0),children:n.jsx(dr,{size:14})})}),n.jsx(pt,{side:"bottom",children:"Edit SEO"})]}),n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"View JSON",className:"size-7 shrink-0",onClick:()=>R&&j?R(j):$(!0),children:n.jsx(mr,{size:14})})}),n.jsx(pt,{side:"bottom",children:"View JSON"})]}),n.jsx(In,{onClick:Rn})]})}),Z?n.jsx(Ft,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Ct&&j?n.jsx(Pr,{rawSeo:qt,innerSeo:mn,defaultResolveType:Va,seoSchema:Ca,activeResolveType:Jt,seoTypeOptions:Na,formResetKey:Re,siteDefaultSeo:Pa,onBreadcrumbChange:xe,onPersistRaw:ms,onInnerChange:ds,onClearForm:fs,onBumpFormKey:ps}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"SEO schema not found for this site."})})})}):Kt?n.jsxs(Ft,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ct&&lt.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Bs,{listKey:`${j??""}:${u??""}`,variants:lt.map((t,a)=>({index:a,label:t.label})),selectedIndex:en,onSelect:za,onRename:ne,onDuplicate:Ua,onDelete:Ha,onRemoveAll:Ga,onReorder:Wa,onAdd:()=>Zt()}),ct&&n.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),n.jsx(Cn,{currentRt:Ie??"",currentLabel:Bt(Et?.rule,o??{},et,l??void 0),currentGlobalKey:kt(Et?.rule,o??{},l??void 0)??void 0,matchers:At,globals:vn,onSelect:Za,onSelectGlobal:ts}),kn&&ae&&n.jsx("div",{className:"pt-1",children:n.jsx(Ln,{schema:kn,value:ae,onChange:es,meta:l??void 0,decofile:o,onSaveReferencedBlock:Nt,sandbox:Tt},`${u??"none"}:${en}:${Ie??""}`)})]})]}),n.jsx(Fn,{activeSchema:Qt,formValue:se,formResetKey:Ae,onFormChange:hn,onBreadcrumbChange:M,breadcrumbPath:je,emptyMessage:"No editable fields for this variant.",meta:l,decofile:o,onSaveReferencedBlock:Nt,sandbox:Tt})]}):_e?n.jsx(Ft,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Fn,{activeSchema:Qt,formValue:se,formResetKey:Ae,onFormChange:hn,onBreadcrumbChange:M,breadcrumbPath:je,emptyMessage:"No editable fields for this global block.",meta:l,decofile:o,onSaveReferencedBlock:Nt,sandbox:Tt})}):n.jsxs(Ft,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Pt&&j&&n.jsx(ao,{listKey:j,variants:Oe,activeIndex:Ve,decofile:o??{},meta:l,matchers:At,onSelect:rs,onReorder:os,onRename:G,onDuplicate:ls,onDelete:is,onAdd:Rn}),Pt&&ue!==null&&n.jsxs("div",{className:Be("px-3 border-b",le?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>ke(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-sm py-0.5 hover:bg-muted/40","aria-expanded":le,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),le?n.jsx(cr,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(ir,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),le&&n.jsxs("div",{className:Be("space-y-3",bt&&"pointer-events-none opacity-50"),children:[n.jsx(Cn,{currentRt:ue,currentLabel:Bt(tt?.rule,o??{},et,l??void 0),currentGlobalKey:kt(tt?.rule,o??{},l??void 0)??void 0,matchers:At,globals:vn,onSelect:Ja,onSelectGlobal:Xa}),Sn&&Ce&&n.jsx("div",{className:"space-y-3",children:n.jsx(Ln,{schema:Sn,value:Ce,onChange:Qa,meta:l??void 0,decofile:o,onSaveReferencedBlock:Nt,sandbox:Tt},`${Ve}:${ue??""}`)})]})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(Yr,{listKey:`${j??""}-${Ve}`,rawSections:I,sections:Te,meta:l,selectedIndex:u,onSelect:Ma,onReorder:Ka,onDelete:$a,onDuplicate:Oa,onMakeReusable:ve,onToggleHidden:Ba,onToggleLazy:La,onAddVariant:Zt,onDetach:Fa,onAddSection:()=>de(!0),canAddSection:qa})})]}),n.jsx(Ls,{open:Ne!==null,onOpenChange:t=>{t||ve(null)},defaultBlockId:Ne!==null?an(Te[Ne]?.label??""):"",isPending:ye.isPending,onSubmit:Ya}),d&&n.jsx(Er,{open:Se,onOpenChange:de,meta:l,decofile:o,previewBaseUrl:d,onSelect:Ia}),be&&j&&o&&n.jsx(Fs,{open:be,onOpenChange:$,pageKey:j,decofile:o}),re!==null&&n.jsx(On,{open:!0,initialName:xt(Oe[re]?.rule,o??{},l??void 0)?Bt(Oe[re]?.rule,o??{},et,l??void 0):"",autoLabel:et(Rt(Oe[re]?.rule,o??{},l??void 0)),isPending:bt,onSubmit:async t=>{await cs(re,t)},onOpenChange:t=>{!t&&!bt&&G(null)}}),Y!==null&&n.jsx(On,{open:!0,initialName:xt(lt[Y]?.rule,o??{},l??void 0)?Bt(lt[Y]?.rule,o??{},et,l??void 0):"",autoLabel:et(Rt(lt[Y]?.rule,o??{},l??void 0)),isPending:bt,onSubmit:async t=>{await us(Y,t)},onOpenChange:t=>{!t&&!bt&&ne(null)}})]})}export{Wl as SectionsEditor};
1
+ import{c as He,r as w,l as Be,j as n,B as Ge,i as zn,m as vs,t as W,K as Ss}from"./index-CXy6rN6i.js";import{r as xs,a as ys,s as bs,i as Hn,c as _s,b as js,G as ks,V as ws,d as Rs,e as Rt,f as Ds,g as Ns,h as Vs,j as Cs,k as Ps,l as Ts,m as As,n as Ms,o as Es,p as $t,q as Ot,t as Ks,v as ut,w as jt,x as $s,y as Os,z as Ye,A as Vn,S as Bs,M as Cn,B as kt,C as Bt,D as Ls,E as an,P as Fs,F as et,H as xt,I as Is,J as zs,K as Hs,L as Us,N as Ws,O as Gs,Q as dt,R as qs,T as Js,U as Ys,W as Pn,X as wt,Y as Qs,Z as Xs,_ as Zs,$ as er,a0 as tr,a1 as sn,a2 as Tn,a3 as An,a4 as yt,a5 as Lt,a6 as Mn,a7 as nr,a8 as ar,a9 as rn,aa as sr,ab as rr,ac as Un,ad as En,ae as or}from"./index-CpgVJVWB.js";import{t as ir}from"./ChevronDown-DGuR7uUZ.js";import{J as ln,F as Wn,_ as Gn,k as lr,K as cr,L as ur,n as dr}from"./agent-icon-BjxA8YR3.js";import{i as qn}from"./ChevronRight-BswIt99A.js";import{n as mr}from"./ChevronUp-DSdWQUoR.js";import{i as fr}from"./Globe01-CcXDI4W7.js";import{S as Ft}from"./scroll-area-DgIklajW.js";import{T as mt,a as ft,b as pt}from"./tooltip-BRQCINXK.js";import{a as pr,c as hr,b as gr,D as vr,d as Sr,e as xr}from"./dialog-o7scRbG9.js";import{I as yr}from"./input-BlhkemhH.js";import{s as br,a as Jn}from"./Eye-Dn1AISrx.js";import{b as _r}from"./ZoomOut-C0bVPfpC.js";import{i as jr}from"./Settings02-QyYEyYyn.js";import{s as cn}from"./Plus-DDlkoJBs.js";import{s as Yn}from"./Trash01-Cc007jho.js";import{i as kr}from"./Zap-CWxLsQ6b.js";import{c as it,a as Qn,D as Xn,b as Zn,g as wr}from"./dropdown-menu-D-VNET4I.js";import{a as ea,b as It,K as ta,P as na,d as aa,C as sa,s as ra,l as Dt,D as oa,c as ia,S as la,v as ca,k as ua}from"./sortable.esm-DpWg8tde.js";import{r as Kn,u as Rr,d as Dr,a as Nr,i as Vr,f as Cr,P as Pr,b as Tr,S as Ar}from"./page-seo-form-BcrUATEU.js";import{b as Mr}from"./Tool01-Ci5EQ1tM.js";import{A as Er}from"./add-section-modal-D22Rp_ry.js";import"./index-CL3KBg-D.js";import"./SwitchHorizontal01-BL4xnvxO.js";import"./chat-context-huSCeR82.js";import"./hooks-BUt6AoQh.js";import"./use-mcp-client-CRWIqSWI.js";import"./auth-DraSXrC6.js";import"./decopilot-sse-pool-Chmwc1_x.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-7AWl-thI.js";import"./use-collections-BhzLncHB.js";import"./use-ai-providers-CpUPA2Pj.js";import"./studio-tools-C-Eel15b.js";import"./use-decopilot-events-B8-U5_6h.js";import"./tab-id-AX1D_RMI.js";import"./use-organization-settings-ClL7mSbK.js";import"./drawer-B-Vy7tMY.js";import"./collection-search-CKMDHnku.js";import"./SearchMd-UY2xUREv.js";import"./use-mobile-DgvzRDzB.js";import"./use-mcp-prompts-BV9cBymv.js";import"./X-_dGiBqSn.js";import"./shell-layout-gi6XYvgE.js";import"./avatar-COMRxqae.js";import"./User01-Dz-_mMMJ.js";import"./Users03-BazvU-rC.js";import"./SearchLg-CdT_y89m.js";import"./Stars02-DVZm69DV.js";import"./XClose-BpreRuFP.js";import"./CheckCircle-8DKF8Yx5.js";import"./FilterLines-CmWI-8pG.js";import"./required-auth-layout-BzYoSj-D.js";import"./use-org-sso-kfQLtl8D.js";import"./ZapSquare-D5x1wm0t.js";import"./Star01-GVe4t6O1.js";import"./Upload01-DB9meUjO.js";import"./AlertCircle-CM6D9elR.js";import"./form-DX8cQ4SA.js";import"./label-CL8Vh65B.js";import"./select-DM3pFFAV.js";import"./XCircle-CmN6DNsv.js";import"./tabs-BeXAqCdo.js";import"./toggle-group-B6oTaI1f.js";import"./Monitor01-SkSQUhmT.js";import"./connect-desktop-dialog-CvuFk-NY.js";import"./decopilot-BxOK0Z8W.js";import"./checkbox-BIDlFz_0.js";import"./skeleton-CuVDGSZE.js";import"./Key01-F6-x7vNY.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-6b9w_VoZ.js";import"./card-Bys-wDTW.js";import"./ArrowUpRight-Kqa5fEjt.js";import"./Stars01-BIVPeWqS.js";import"./popover-SD8gnUXm.js";import"./command-DrgMAh0a.js";import"./index-Cod7u1PQ.js";import"./useInfiniteQuery-DbI8AV-k.js";import"./use-infinite-scroll-CkXtceVR.js";import"./use-org-fs-DI1Q1Ycz.js";import"./question-004-sINsf4GQ.js";import"./integration-icon-BSHD1Ijr.js";import"./shell-route-loading-Agan4lHM.js";import"./task-status-CaQuE65s.js";import"./DotsVertical-DSosYpI1.js";import"./use-clock-tick-7J301cSN.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-status-sounds-BsVH7G2F.js";import"./empty-state-1p_UpPHY.js";import"./toolbar-DuZrnshW.js";import"./index-CAV1BNai.js";import"./Palette-CnoObDqZ.js";import"./alert-dialog-DMWXmTGp.js";import"./file-type-icon-LHBbJJTG.js";import"./use-debounced-value-BGsbVLHA.js";import"./textarea-C30KYfio.js";import"./LinkExternal01-DOU6-C1w.js";import"./index-DCwPnlYH.js";import"./LayoutLeft-DpqtgcH3.js";import"./toolbar-icon-button-CG8gWMNZ.js";import"./use-connection-CSQdDXlG.js";import"./use-mcp-tools-Dgj65Z69.js";import"./types-ywta9rZ4.js";import"./use-capability-AkUZCu97.js";import"./extract-connection-data-BVX9Eneo.js";import"./tools-list-BSe55AC9.js";import"./mcp-oauth-CXj7zg3h.js";import"./badge-B1dPfLuK.js";import"./connection-slug-eyAPH6o3.js";import"./switch-DWXEjjcR.js";import"./Play-DzGcMRv3.js";import"./use-debounced-autosave-DwyO4Yri.js";import"./index-BBTFoidO.js";import"./sidebar-BD77ZDQ1.js";import"./sheet-BJF6qruz.js";import"./search-input-BwHA7yOt.js";import"./collection-tabs-CWrBkWhe.js";import"./github-repo-picker-ZmfhFTO6.js";import"./authenticate-and-persist-oauth-HBteAcVm.js";import"./use-navigate-to-agent-DTqeD3lq.js";import"./github-installations-DzN1UQ4x.js";import"./Users01-Ctg0iuAM.js";import"./use-secrets-BX0N_3N-.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./automation-runs-BoQeZ1gh.js";import"./table-sXVKQ5vt.js";import"./use-members-BZOJ4ncQ.js";import"./use-org-auth-client-Dx974y4u.js";import"./use-automations-BSn8_z4p.js";import"./useSuspenseInfiniteQuery-DT-JxV4F.js";import"./use-file-configs-XF2AvMPs.js";import"./monaco-editor-DBScTPL_.js";import"./select-model-C1odlJ1X.js";import"./automation-list-row-NZNZGrlr.js";import"./Globe04-B9Btoycr.js";import"./HardDrive-BqXWgcmp.js";import"./Sun-B2ndPBZP.js";import"./Shield01-V8b5EFFL.js";import"./use-copy-3aLRhzTZ.js";import"./content-blocks-o63cs2vh.js";import"./connection-card-DIh-SIqT.js";import"./use-registry-connections-DzyhBLO8.js";import"./connection-form-helpers-DV-bwjt7.js";function Kr(m){return m.schema?.definitions??m.schema?.$defs??{}}function $r(m,e){const r=Kr(e),c=r[btoa(m)];if(!c)return;let d=typeof c.image=="string"?c.image:void 0;if(!d&&Array.isArray(c.allOf)){const h=c.allOf.find(S=>typeof S.$ref=="string")?.$ref;if(typeof h=="string"){const S=h.replace("#/definitions/",""),p=r[S];d=typeof p?.image=="string"?p.image:void 0}}if(d?.includes("{{{"))return d}function Or(m,e){if(!e)return;const r=xs(m);if(!r)return;const c=$r(r.resolveType,e);if(!c)return;const d=ys(c,r.data);if(d)return bs(d)}const Br="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Lr="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function $n(m){return Array.from({length:m},(e,r)=>({id:crypto.randomUUID(),index:r}))}function da(m){return m.map((e,r)=>({...e,index:r}))}function Fr(m,e){if(e===m.length)return m;if(e<m.length)return da(m.slice(0,e));const r=Array.from({length:e-m.length},(c,d)=>({id:crypto.randomUUID(),index:m.length+d}));return[...m,...r]}function ma(m){const e=He.c(20),{section:r,raw:c,meta:d}=m,h=r.isSavedBlock===!0,S=r.isMultivariate===!0;let p;e[0]!==d||e[1]!==c?(p=c&&d?Or(c,d):void 0,e[0]=d,e[1]=c,e[2]=p):p=e[2];const v=p;let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(_r,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=g):g=e[3];let b;e[4]!==v?(b=v&&n.jsx("img",{src:v,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=v,e[5]=b):b=e[5];let C;e[6]!==S||e[7]!==h?(C=h?{color:ks}:S?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=S,e[7]=h,e[8]=C):C=e[8];let R;e[9]!==C?(R=n.jsx(ln,{className:"h-4 w-4 shrink-0",style:C}),e[9]=C,e[10]=R):R=e[10];const _=r.isHidden&&"line-through opacity-50";let k;e[11]!==_?(k=Be("min-w-0 flex-1 truncate text-sm font-medium",_),e[11]=_,e[12]=k):k=e[12];let o;e[13]!==r.label||e[14]!==k?(o=n.jsx("span",{className:k,children:r.label}),e[13]=r.label,e[14]=k,e[15]=o):o=e[15];let D;return e[16]!==b||e[17]!==R||e[18]!==o?(D=n.jsxs(n.Fragment,{children:[g,b,R,o]}),e[16]=b,e[17]=R,e[18]=o,e[19]=D):D=e[19],D}function fa(m,e){const r=m.isSavedBlock===!0,c=m.isMultivariate===!0;return Be("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":r?Br:c?"text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]":"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Ir(m){const e=He.c(64),{section:r,raw:c,meta:d,sortableId:h,selected:S,onSelect:p,onDelete:v,onDuplicate:g,onMakeReusable:b,onToggleHidden:C,onToggleLazy:R,onAddVariant:_,onDetach:k}=m,o=c?Hn(c.__resolveType??""):!1;let D;e[0]!==r?(D=_s(r),e[0]=r,e[1]=D):D=e[1];const l=D;let Y;e[2]!==h?(Y={id:h,animateLayoutChanges:Gr},e[2]=h,e[3]=Y):Y=e[3];const{attributes:H,listeners:K,setNodeRef:u,transform:P,isDragging:se}=aa(Y);let T;e[4]!==P?(T=sa.Transform.toString(P?{...P,x:0}:null),e[4]=P,e[5]=T):T=e[5];const pe=se?0:void 0;let N;e[6]!==T||e[7]!==pe?(N={transform:T,opacity:pe},e[6]=T,e[7]=pe,e[8]=N):N=e[8];const ce=N;let B;e[9]!==r?(B=js(r),e[9]=r,e[10]=B):B=e[10];const te=B,oe="button",Ce=0;let E;e[11]!==p?(E=$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),p())},e[11]=p,e[12]=E):E=e[12];const ue=se?"cursor-grabbing":"cursor-pointer";let ie;e[13]!==r||e[14]!==S||e[15]!==ue?(ie=Be("touch-none transition-colors",ue,fa(r,S)),e[13]=r,e[14]=S,e[15]=ue,e[16]=ie):ie=e[16];let je;e[17]!==d||e[18]!==c||e[19]!==r?(je=n.jsx(ma,{section:r,raw:c,meta:d}),e[17]=d,e[18]=c,e[19]=r,e[20]=je):je=e[20];const M=!r.isMultivariate&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":o?"Disable async render":"Enable async render",className:Be("h-7 w-7 shrink-0",o?"":"opacity-0 group-hover:opacity-100"),onClick:$=>{$.stopPropagation(),R()},onPointerDown:Wr,children:n.jsx(kr,{className:Be("h-3.5 w-3.5",o&&"text-yellow-500")})})}),n.jsx(pt,{side:"bottom",children:o?"Disable async render":"Enable async render"})]});let Ae;e[21]!==C||e[22]!==r.isHidden||e[23]!==r.isMultivariate?(Ae=!r.isMultivariate&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":r.isHidden?"Show section":"Hide section",className:Be("h-7 w-7 shrink-0",r.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:$=>{$.stopPropagation(),C()},onPointerDown:Ur,children:r.isHidden?n.jsx(jr,{className:"h-3.5 w-3.5"}):n.jsx(br,{className:"h-3.5 w-3.5"})})}),n.jsx(pt,{side:"bottom",children:r.isHidden?"Show section":"Hide section"})]}),e[21]=C,e[22]=r.isHidden,e[23]=r.isMultivariate,e[24]=Ae):Ae=e[24];let X;e[25]===Symbol.for("react.memo_cache_sentinel")?(X=n.jsx(Qn,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Section actions",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:Hr,onPointerDown:zr,children:n.jsx(Wn,{className:"h-3.5 w-3.5"})})}),e[25]=X):X=e[25];let Ne;e[26]!==g?(Ne=$=>{$.stopPropagation(),g()},e[26]=g,e[27]=Ne):Ne=e[27];let ve;e[28]===Symbol.for("react.memo_cache_sentinel")?(ve=n.jsx(Jn,{className:"h-4 w-4"}),e[28]=ve):ve=e[28];let re;e[29]!==Ne?(re=n.jsxs(it,{onClick:Ne,children:[ve,"Duplicate"]}),e[29]=Ne,e[30]=re):re=e[30];let G;e[31]!==l||e[32]!==_?(G=l&&n.jsxs(it,{className:ws,onClick:$=>{$.stopPropagation(),_()},children:[n.jsx(Gn,{className:"h-4 w-4"}),"Add variant"]}),e[31]=l,e[32]=_,e[33]=G):G=e[33];let q;e[34]!==te||e[35]!==b?(q=te&&n.jsxs(it,{className:Lr,onClick:$=>{$.stopPropagation(),b()},children:[n.jsx(ln,{className:"h-4 w-4"}),"Make reusable"]}),e[34]=te,e[35]=b,e[36]=q):q=e[36];let ne;e[37]!==k||e[38]!==r.isMultivariate||e[39]!==r.isSavedBlock?(ne=r.isSavedBlock===!0&&!r.isMultivariate&&n.jsxs(it,{onClick:$=>{$.stopPropagation(),k()},children:[n.jsx(ln,{className:"h-4 w-4"}),"Detach"]}),e[37]=k,e[38]=r.isMultivariate,e[39]=r.isSavedBlock,e[40]=ne):ne=e[40];let le;e[41]!==v?(le=$=>{$.stopPropagation(),v()},e[41]=v,e[42]=le):le=e[42];let ke;e[43]===Symbol.for("react.memo_cache_sentinel")?(ke=n.jsx(Yn,{className:"h-4 w-4"}),e[43]=ke):ke=e[43];let Se;e[44]!==le?(Se=n.jsxs(it,{className:"text-destructive focus:text-destructive",onClick:le,children:[ke,"Delete"]}),e[44]=le,e[45]=Se):Se=e[45];let de;e[46]!==re||e[47]!==G||e[48]!==q||e[49]!==ne||e[50]!==Se?(de=n.jsxs(Xn,{children:[X,n.jsxs(Zn,{align:"end",className:"w-44",children:[re,G,q,ne,Se]})]}),e[46]=re,e[47]=G,e[48]=q,e[49]=ne,e[50]=Se,e[51]=de):de=e[51];let be;return e[52]!==H||e[53]!==K||e[54]!==p||e[55]!==u||e[56]!==ce||e[57]!==ie||e[58]!==je||e[59]!==M||e[60]!==Ae||e[61]!==de||e[62]!==E?(be=n.jsxs("div",{ref:u,style:ce,...H,...K,role:oe,tabIndex:Ce,onClick:p,onKeyDown:E,className:ie,children:[je,M,Ae,de]}),e[52]=H,e[53]=K,e[54]=p,e[55]=u,e[56]=ce,e[57]=ie,e[58]=je,e[59]=M,e[60]=Ae,e[61]=de,e[62]=E,e[63]=be):be=e[63],be}function zr(m){return m.stopPropagation()}function Hr(m){return m.stopPropagation()}function Ur(m){return m.stopPropagation()}function Wr(m){return m.stopPropagation()}function Gr(){return!1}function qr(m){const e=He.c(90),{listKey:r,rawSections:c,sections:d,meta:h,selectedIndex:S,onSelect:p,onReorder:v,onDelete:g,onDuplicate:b,onMakeReusable:C,onToggleHidden:R,onToggleLazy:_,onAddVariant:k,onDetach:o,onAddSection:D,canAddSection:l}=m,Y=l===void 0?!0:l;let H;e[0]!==d.length?(H=()=>$n(d.length),e[0]=d.length,e[1]=H):H=e[1];const[K,u]=w.useState(H),[P,se]=w.useState(null),[T,pe]=w.useState(r),[N,ce]=w.useState(d.length),B=w.useRef(!1);T!==r?(pe(r),ce(d.length),u($n(d.length))):N!==d.length&&(ce(d.length),u(L=>Fr(L,d.length)));let te;e[2]===Symbol.for("react.memo_cache_sentinel")?(te={activationConstraint:{distance:8}},e[2]=te):te=e[2];let oe;e[3]===Symbol.for("react.memo_cache_sentinel")?(oe={coordinateGetter:ra},e[3]=oe):oe=e[3];const Ce=ea(It(na,te),It(ta,oe));let E;e[4]!==K?(E=K.map(Jr),e[4]=K,e[5]=E):E=e[5];const ue=E;let ie;e[6]===Symbol.for("react.memo_cache_sentinel")?(ie=L=>{se(String(L.active.id))},e[6]=ie):ie=e[6];const je=ie;let M;e[7]!==ue||e[8]!==v?(M=L=>{se(null);const{active:ae,over:Q}=L;if(!Q||ae.id===Q.id)return;const Ie=ue.indexOf(String(ae.id)),he=ue.indexOf(String(Q.id));Ie===-1||he===-1||(u(Qe=>da(Dt([...Qe],Ie,he))),B.current=!0,requestAnimationFrame(()=>{B.current=!1}),v?.(Ie,he))},e[7]=ue,e[8]=v,e[9]=M):M=e[9];const Ae=M;let X;e[10]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{se(null)},e[10]=X):X=e[10];const Ne=X;let ve,re,G,q,ne,le,ke,Se,de,be,$,Z,we,Ee,Ke;if(e[11]!==P||e[12]!==Y||e[13]!==K||e[14]!==ue||e[15]!==Ae||e[16]!==h||e[17]!==D||e[18]!==k||e[19]!==g||e[20]!==o||e[21]!==b||e[22]!==C||e[23]!==p||e[24]!==R||e[25]!==_||e[26]!==c||e[27]!==d||e[28]!==S||e[29]!==Ce){Ee=Symbol.for("react.early_return_sentinel");e:{const L=ae=>{B.current||p(ae)};if(e[45]!==P||e[46]!==Y||e[47]!==K||e[48]!==D||e[49]!==c||e[50]!==d){const ae=P?K.find(Q=>Q.id===P):null;if(q=ae!=null?d[ae.index]:null,G=ae!=null?c[ae.index]:void 0,K.length===0){let Q;e[54]===Symbol.for("react.memo_cache_sentinel")?(Q=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No sections in this page."}),e[54]=Q):Q=e[54];const Ie=!Y;let he;e[55]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx(cn,{size:14}),e[55]=he):he=e[55];let Qe;e[56]!==D||e[57]!==Ie?(Qe=n.jsxs("div",{className:"space-y-2",children:[Q,n.jsxs(Ge,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Ie,onClick:D,children:[he,"Add section"]})]}),e[56]=D,e[57]=Ie,e[58]=Qe):Qe=e[58],Ee=Qe;break e}we=Be(ae&&"cursor-grabbing"),e[45]=P,e[46]=Y,e[47]=K,e[48]=D,e[49]=c,e[50]=d,e[51]=G,e[52]=q,e[53]=we}else G=e[51],q=e[52],we=e[53];re=oa,Se=Ce,de=ia,be=je,$=Ae,Z=Ne,ve=la,le=ue,ke=ca,Ke="space-y-1",ne=K.map(ae=>{const Q=d[ae.index];return Q?n.jsx(Ir,{sortableId:ae.id,section:Q,raw:c[ae.index],meta:h,selected:S===ae.index,onSelect:()=>L(ae.index),onDelete:()=>g(ae.index),onDuplicate:()=>b(ae.index),onMakeReusable:()=>C(ae.index),onToggleHidden:()=>R(ae.index),onToggleLazy:()=>_(ae.index),onAddVariant:()=>k(ae.index),onDetach:()=>o(ae.index)},ae.id):null})}e[11]=P,e[12]=Y,e[13]=K,e[14]=ue,e[15]=Ae,e[16]=h,e[17]=D,e[18]=k,e[19]=g,e[20]=o,e[21]=b,e[22]=C,e[23]=p,e[24]=R,e[25]=_,e[26]=c,e[27]=d,e[28]=S,e[29]=Ce,e[30]=ve,e[31]=re,e[32]=G,e[33]=q,e[34]=ne,e[35]=le,e[36]=ke,e[37]=Se,e[38]=de,e[39]=be,e[40]=$,e[41]=Z,e[42]=we,e[43]=Ee,e[44]=Ke}else ve=e[30],re=e[31],G=e[32],q=e[33],ne=e[34],le=e[35],ke=e[36],Se=e[37],de=e[38],be=e[39],$=e[40],Z=e[41],we=e[42],Ee=e[43],Ke=e[44];if(Ee!==Symbol.for("react.early_return_sentinel"))return Ee;let Le;e[59]!==ne||e[60]!==Ke?(Le=n.jsx("div",{className:Ke,children:ne}),e[59]=ne,e[60]=Ke,e[61]=Le):Le=e[61];let Pe;e[62]!==ve||e[63]!==le||e[64]!==ke||e[65]!==Le?(Pe=n.jsx(ve,{items:le,strategy:ke,children:Le}),e[62]=ve,e[63]=le,e[64]=ke,e[65]=Le,e[66]=Pe):Pe=e[66];let $e;e[67]!==G||e[68]!==q||e[69]!==h?($e=q?n.jsx("div",{className:Be("cursor-grabbing shadow-lg ring-1 ring-border/60",fa(q,!1)),children:n.jsx(ma,{section:q,raw:G,meta:h})}):null,e[67]=G,e[68]=q,e[69]=h,e[70]=$e):$e=e[70];let Fe;e[71]!==$e?(Fe=n.jsx(ua,{dropAnimation:null,children:$e}),e[71]=$e,e[72]=Fe):Fe=e[72];let Me;e[73]!==re||e[74]!==Se||e[75]!==de||e[76]!==be||e[77]!==$||e[78]!==Z||e[79]!==Pe||e[80]!==Fe?(Me=n.jsxs(re,{sensors:Se,collisionDetection:de,onDragStart:be,onDragEnd:$,onDragCancel:Z,children:[Pe,Fe]}),e[73]=re,e[74]=Se,e[75]=de,e[76]=be,e[77]=$,e[78]=Z,e[79]=Pe,e[80]=Fe,e[81]=Me):Me=e[81];const xe=!Y;let Re;e[82]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(cn,{size:14}),e[82]=Re):Re=e[82];let me;e[83]!==D||e[84]!==xe?(me=n.jsxs(Ge,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:xe,onClick:D,children:[Re,"Add section"]}),e[83]=D,e[84]=xe,e[85]=me):me=e[85];let ee;return e[86]!==we||e[87]!==Me||e[88]!==me?(ee=n.jsxs("div",{className:we,children:[Me,me]}),e[86]=we,e[87]=Me,e[88]=me,e[89]=ee):ee=e[89],ee}function Jr(m){return m.id}function On(m){const e=He.c(38),{open:r,initialName:c,autoLabel:d,isPending:h,onSubmit:S,onOpenChange:p}=m,v=h===void 0?!1:h,[g,b]=w.useState(c),[C,R]=w.useState(r);r!==C&&(R(r),r&&b(c));let _;e[0]!==v||e[1]!==p?(_=oe=>{!oe&&!v&&p(!1)},e[0]=v,e[1]=p,e[2]=_):_=e[2];const k=_;let o;e[3]!==v||e[4]!==g||e[5]!==S?(o=async oe=>{oe.preventDefault(),!v&&await S(g.trim())},e[3]=v,e[4]=g,e[5]=S,e[6]=o):o=e[6];const D=o;let l;e[7]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(pr,{children:"Rename variant"}),e[7]=l):l=e[7];const Y=d||"the rule";let H;e[8]!==Y?(H=n.jsxs(hr,{children:[l,n.jsxs(gr,{children:["Save this matcher as a global block with a custom label. Leave empty to inline the matcher again and fall back to"," ",n.jsx("span",{className:"font-medium",children:Y}),"."]})]}),e[8]=Y,e[9]=H):H=e[9];let K;e[10]===Symbol.for("react.memo_cache_sentinel")?(K=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[10]=K):K=e[10];let u;e[11]===Symbol.for("react.memo_cache_sentinel")?(u=oe=>b(oe.target.value),e[11]=u):u=e[11];let P;e[12]!==d||e[13]!==v||e[14]!==g?(P=n.jsxs("div",{className:"space-y-1.5 py-4",children:[K,n.jsx(yr,{id:"variant-rename-name",value:g,onChange:u,placeholder:d,autoFocus:!0,disabled:v})]}),e[12]=d,e[13]=v,e[14]=g,e[15]=P):P=e[15];let se;e[16]!==p?(se=()=>p(!1),e[16]=p,e[17]=se):se=e[17];let T;e[18]!==v||e[19]!==se?(T=n.jsx(Ge,{type:"button",variant:"outline",onClick:se,disabled:v,children:"Cancel"}),e[18]=v,e[19]=se,e[20]=T):T=e[20];let pe;e[21]!==v?(pe=v?n.jsxs(n.Fragment,{children:[n.jsx(zn,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=v,e[22]=pe):pe=e[22];let N;e[23]!==v||e[24]!==pe?(N=n.jsx(Ge,{type:"submit",disabled:v,children:pe}),e[23]=v,e[24]=pe,e[25]=N):N=e[25];let ce;e[26]!==T||e[27]!==N?(ce=n.jsxs(vr,{children:[T,N]}),e[26]=T,e[27]=N,e[28]=ce):ce=e[28];let B;e[29]!==D||e[30]!==ce||e[31]!==H||e[32]!==P?(B=n.jsx(Sr,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:D,children:[H,P,ce]})}),e[29]=D,e[30]=ce,e[31]=H,e[32]=P,e[33]=B):B=e[33];let te;return e[34]!==k||e[35]!==r||e[36]!==B?(te=n.jsx(xr,{open:r,onOpenChange:k,children:B}),e[34]=k,e[35]=r,e[36]=B,e[37]=te):te=e[37],te}const Yr="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]",pa="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.2)]";function ha(m){const e=He.c(5),{rule:r,matchers:c}=m,d=r?.__resolveType??"";let h;if(e[0]!==c||e[1]!==d){const g=c.find(b=>b.resolveType===d)?.iconName??Rs(d);h=lr(g),e[0]=c,e[1]=d,e[2]=h}else h=e[2];const S=h;if(!S)return null;let p;return e[3]!==S?(p=n.jsx(S,{size:14,className:"shrink-0"}),e[3]=S,e[4]=p):p=e[4],p}function Bn(m){return m.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
2
+ `)}function on(m){return m.map((e,r)=>({id:crypto.randomUUID(),index:r,variant:e}))}function Qr(m){return m.map((e,r)=>({...e,index:r}))}function ga(m){const e=He.c(16),{label:r,effectiveRule:c,matchers:d,canDelete:h,dragging:S,onRename:p,onDuplicate:v,onDelete:g}=m;let b;e[0]!==c||e[1]!==d?(b=n.jsx(ha,{rule:c,matchers:d}),e[0]=c,e[1]=d,e[2]=b):b=e[2];let C;e[3]!==r?(C=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:r}),e[3]=r,e[4]=C):C=e[4];let R;e[5]!==h||e[6]!==S||e[7]!==r||e[8]!==g||e[9]!==v||e[10]!==p?(R=!S&&n.jsxs(Xn,{children:[n.jsx(Qn,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":`Actions for ${r}`,className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:Zr,onPointerDown:Xr,children:n.jsx(Wn,{size:14})})}),n.jsxs(Zn,{align:"end",className:"w-36",children:[n.jsxs(it,{onClick:k=>{k.stopPropagation(),p?.()},children:[n.jsx(Mr,{size:14}),"Rename"]}),n.jsxs(it,{onClick:k=>{k.stopPropagation(),v?.()},children:[n.jsx(Jn,{size:14}),"Duplicate"]}),n.jsx(wr,{}),n.jsxs(it,{variant:"destructive",disabled:!h,onClick:k=>{k.stopPropagation(),g?.()},children:[n.jsx(Yn,{size:14}),"Delete"]})]})]}),e[5]=h,e[6]=S,e[7]=r,e[8]=g,e[9]=v,e[10]=p,e[11]=R):R=e[11];let _;return e[12]!==b||e[13]!==C||e[14]!==R?(_=n.jsxs(n.Fragment,{children:[b,C,R]}),e[12]=b,e[13]=C,e[14]=R,e[15]=_):_=e[15],_}function Xr(m){return m.stopPropagation()}function Zr(m){return m.stopPropagation()}function eo(m){const e=He.c(33),{entry:r,sortableId:c,isActive:d,canDelete:h,decofile:S,meta:p,matchers:v,onSelect:g,onRename:b,onDuplicate:C,onDelete:R}=m;let _;e[0]!==c?(_={id:c,animateLayoutChanges:to},e[0]=c,e[1]=_):_=e[1];const{attributes:k,listeners:o,setNodeRef:D,transform:l,isDragging:Y}=aa(_);let H;e[2]!==l?(H=sa.Transform.toString(l?{...l,x:0}:null),e[2]=l,e[3]=H):H=e[3];const K=Y?0:void 0;let u;e[4]!==H||e[5]!==K?(u={transform:H,opacity:K},e[4]=H,e[5]=K,e[6]=u):u=e[6];const P=u,se=p??void 0;let T;e[7]!==S||e[8]!==r.variant.rule||e[9]!==se?(T=Rt(r.variant.rule,S,se),e[7]=S,e[8]=r.variant.rule,e[9]=se,e[10]=T):T=e[10];const pe=T;let N;e[11]!==g?(N=E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),g())},e[11]=g,e[12]=N):N=e[12];const ce=Y?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",B=d?pa:Yr;let te;e[13]!==ce||e[14]!==B?(te=Be("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",ce,B),e[13]=ce,e[14]=B,e[15]=te):te=e[15];let oe;e[16]!==h||e[17]!==pe||e[18]!==r.variant.label||e[19]!==v||e[20]!==R||e[21]!==C||e[22]!==b?(oe=n.jsx(ga,{label:r.variant.label,effectiveRule:pe,matchers:v,canDelete:h,onRename:b,onDuplicate:C,onDelete:R}),e[16]=h,e[17]=pe,e[18]=r.variant.label,e[19]=v,e[20]=R,e[21]=C,e[22]=b,e[23]=oe):oe=e[23];let Ce;return e[24]!==k||e[25]!==o||e[26]!==g||e[27]!==D||e[28]!==P||e[29]!==te||e[30]!==oe||e[31]!==N?(Ce=n.jsx("div",{ref:D,style:P,...k,...o,onClick:g,onKeyDown:N,className:te,children:oe}),e[24]=k,e[25]=o,e[26]=g,e[27]=D,e[28]=P,e[29]=te,e[30]=oe,e[31]=N,e[32]=Ce):Ce=e[32],Ce}function to(){return!1}function no(m){const e=He.c(9),{variant:r,decofile:c,meta:d,matchers:h}=m,S=d??void 0;let p;e[0]!==c||e[1]!==S||e[2]!==r.rule?(p=Rt(r.rule,c,S),e[0]=c,e[1]=S,e[2]=r.rule,e[3]=p):p=e[3];const v=p;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=Be("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",pa),e[4]=g):g=e[4];let b;return e[5]!==v||e[6]!==h||e[7]!==r.label?(b=n.jsx("div",{className:g,children:n.jsx(ga,{label:r.label,effectiveRule:v,matchers:h,canDelete:!1,dragging:!0})}),e[5]=v,e[6]=h,e[7]=r.label,e[8]=b):b=e[8],b}function ao(m){const e=He.c(77),{listKey:r,variants:c,activeIndex:d,decofile:h,meta:S,matchers:p,onSelect:v,onReorder:g,onRename:b,onDuplicate:C,onDelete:R,onAdd:_}=m;let k;e[0]!==c?(k=()=>on(c),e[0]=c,e[1]=k):k=e[1];const[o,D]=w.useState(k),[l,Y]=w.useState(null),[H,K]=w.useState(r),[u,P]=w.useState(c.length);let se;e[2]!==c?(se=()=>Bn(c),e[2]=c,e[3]=se):se=e[3];const[T,pe]=w.useState(se),N=w.useRef(!1),ce=Bn(c);H!==r?(K(r),P(c.length),pe(ce),D(on(c))):u!==c.length?(P(c.length),pe(ce),D(on(c))):T!==ce&&(pe(ce),D(Me=>c.map((xe,Re)=>({id:Me[Re]?.id??crypto.randomUUID(),index:Re,variant:xe}))));let B;e[4]===Symbol.for("react.memo_cache_sentinel")?(B={activationConstraint:{distance:8}},e[4]=B):B=e[4];let te;e[5]===Symbol.for("react.memo_cache_sentinel")?(te={coordinateGetter:ra},e[5]=te):te=e[5];const oe=ea(It(na,B),It(ta,te));let Ce;e[6]!==o?(Ce=o.map(so),e[6]=o,e[7]=Ce):Ce=e[7];const E=Ce,ue=c.length>1;let ie;e[8]!==o?(ie=Me=>{const xe=String(Me.active.id);Y(o.find(Re=>Re.id===xe)??null)},e[8]=o,e[9]=ie):ie=e[9];const je=ie;let M;e[10]!==E||e[11]!==g?(M=Me=>{Y(null);const{active:xe,over:Re}=Me;if(!Re||xe.id===Re.id)return;const me=E.indexOf(String(xe.id)),ee=E.indexOf(String(Re.id));me===-1||ee===-1||(D(L=>Qr(Dt([...L],me,ee))),N.current=!0,requestAnimationFrame(()=>{N.current=!1}),g(me,ee))},e[10]=E,e[11]=g,e[12]=M):M=e[12];const Ae=M;let X;e[13]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{Y(null)},e[13]=X):X=e[13];const Ne=X;let ve,re,G,q,ne,le,ke,Se,de,be,$,Z,we;if(e[14]!==d||e[15]!==ue||e[16]!==h||e[17]!==o||e[18]!==E||e[19]!==Ae||e[20]!==je||e[21]!==p||e[22]!==S||e[23]!==_||e[24]!==R||e[25]!==C||e[26]!==b||e[27]!==v||e[28]!==oe){const Me=L=>{N.current||v(L)};$="space-y-1 border-b p-2";let xe;e[42]===Symbol.for("react.memo_cache_sentinel")?(xe=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variants"}),e[42]=xe):xe=e[42];let Re;e[43]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(cn,{size:14}),e[43]=Re):Re=e[43];let me;e[44]!==_?(me=n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-6",onClick:_,children:Re})}),e[44]=_,e[45]=me):me=e[45];let ee;e[46]===Symbol.for("react.memo_cache_sentinel")?(ee=n.jsx(pt,{children:"Add variant"}),e[46]=ee):ee=e[46],e[47]!==me?(Z=n.jsxs("div",{className:"flex items-center justify-between",children:[xe,n.jsxs(mt,{children:[me,ee]})]}),e[47]=me,e[48]=Z):Z=e[48],re=oa,le=oe,ke=ia,Se=je,de=Ae,be=Ne,ve=la,q=E,ne=ca,we="space-y-0.5",G=o.map(L=>n.jsx(eo,{sortableId:L.id,entry:L,isActive:L.index===d,canDelete:ue,decofile:h,meta:S,matchers:p,onSelect:()=>Me(L.index),onRename:()=>b(L.index),onDuplicate:()=>C(L.index),onDelete:()=>R(L.index)},L.id)),e[14]=d,e[15]=ue,e[16]=h,e[17]=o,e[18]=E,e[19]=Ae,e[20]=je,e[21]=p,e[22]=S,e[23]=_,e[24]=R,e[25]=C,e[26]=b,e[27]=v,e[28]=oe,e[29]=ve,e[30]=re,e[31]=G,e[32]=q,e[33]=ne,e[34]=le,e[35]=ke,e[36]=Se,e[37]=de,e[38]=be,e[39]=$,e[40]=Z,e[41]=we}else ve=e[29],re=e[30],G=e[31],q=e[32],ne=e[33],le=e[34],ke=e[35],Se=e[36],de=e[37],be=e[38],$=e[39],Z=e[40],we=e[41];let Ee;e[49]!==G||e[50]!==we?(Ee=n.jsx("div",{className:we,children:G}),e[49]=G,e[50]=we,e[51]=Ee):Ee=e[51];let Ke;e[52]!==ve||e[53]!==q||e[54]!==ne||e[55]!==Ee?(Ke=n.jsx(ve,{items:q,strategy:ne,children:Ee}),e[52]=ve,e[53]=q,e[54]=ne,e[55]=Ee,e[56]=Ke):Ke=e[56];let Le;e[57]!==l||e[58]!==h||e[59]!==p||e[60]!==S?(Le=l?n.jsx(no,{variant:l.variant,decofile:h,meta:S,matchers:p}):null,e[57]=l,e[58]=h,e[59]=p,e[60]=S,e[61]=Le):Le=e[61];let Pe;e[62]!==Le?(Pe=n.jsx(ua,{dropAnimation:null,children:Le}),e[62]=Le,e[63]=Pe):Pe=e[63];let $e;e[64]!==re||e[65]!==le||e[66]!==ke||e[67]!==Se||e[68]!==de||e[69]!==be||e[70]!==Ke||e[71]!==Pe?($e=n.jsxs(re,{sensors:le,collisionDetection:ke,onDragStart:Se,onDragEnd:de,onDragCancel:be,children:[Ke,Pe]}),e[64]=re,e[65]=le,e[66]=ke,e[67]=Se,e[68]=de,e[69]=be,e[70]=Ke,e[71]=Pe,e[72]=$e):$e=e[72];let Fe;return e[73]!==$||e[74]!==Z||e[75]!==$e?(Fe=n.jsxs("div",{className:$,children:[Z,$e]}),e[73]=$,e[74]=Z,e[75]=$e,e[76]=Fe):Fe=e[76],Fe}function so(m){return m.id}function Ln(m){const e=He.c(15),{schema:r,value:c,onChange:d,meta:h,decofile:S,onSaveReferencedBlock:p,sandbox:v}=m;let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];const[b,C]=w.useState(g);let R;e[1]!==b?(R=b.length>0&&n.jsxs("nav",{"aria-label":"Variant rule breadcrumb",className:"flex min-w-0 items-center gap-1 overflow-hidden text-xs",children:[n.jsx("button",{type:"button",onClick:()=>C([]),className:"flex shrink-0 items-center gap-0.5 rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",title:"Back to rule",children:n.jsx(dr,{className:"size-3.5"})}),b.map((o,D)=>{const l=D===b.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[D>0&&n.jsx(qn,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>C(b.slice(0,D+1)),title:o,className:Be("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",l?"font-medium text-foreground":"text-muted-foreground"),children:o})]},`${o}-${D}`)})]}),e[1]=b,e[2]=R):R=e[2];let _;e[3]!==b||e[4]!==S||e[5]!==h||e[6]!==d||e[7]!==p||e[8]!==v||e[9]!==r||e[10]!==c?(_=n.jsx(Un,{schema:r,value:c,onChange:d,basePath:"",breadcrumbPath:b,onBreadcrumbChange:C,meta:h,decofile:S,onSaveReferencedBlock:p,sandbox:v}),e[3]=b,e[4]=S,e[5]=h,e[6]=d,e[7]=p,e[8]=v,e[9]=r,e[10]=c,e[11]=_):_=e[11];let k;return e[12]!==R||e[13]!==_?(k=n.jsxs("div",{className:"space-y-2",children:[R,_]}),e[12]=R,e[13]=_,e[14]=k):k=e[14],k}function Fn(m){const e=He.c(21),{activeSchema:r,formValue:c,formResetKey:d,onFormChange:h,onBreadcrumbChange:S,breadcrumbPath:p,emptyMessage:v,beforeForm:g,seoResolveType:b,siteDefaultSeo:C,meta:R,decofile:_,onSaveReferencedBlock:k,sandbox:o}=m;let D;e[0]!==p?(D=p===void 0?[]:p,e[0]=p,e[1]=D):D=e[1];const l=D;let Y;e[2]!==r||e[3]!==l||e[4]!==_||e[5]!==d||e[6]!==c||e[7]!==R||e[8]!==S||e[9]!==h||e[10]!==k||e[11]!==o||e[12]!==b||e[13]!==C?(Y=r&&c?b?n.jsx(Ar,{schema:r,resolveType:b,value:c,formResetKey:d,onChange:h,onBreadcrumbChange:S,siteDefaultSeo:C}):n.jsx(Un,{schema:r,value:c,onChange:h,basePath:"",breadcrumbPath:l,onBreadcrumbChange:S,meta:R,decofile:_,onSaveReferencedBlock:k,sandbox:o},d):null,e[2]=r,e[3]=l,e[4]=_,e[5]=d,e[6]=c,e[7]=R,e[8]=S,e[9]=h,e[10]=k,e[11]=o,e[12]=b,e[13]=C,e[14]=Y):Y=e[14];const H=Y;let K;e[15]!==v||e[16]!==H?(K=H??n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:v}),e[15]=v,e[16]=H,e[17]=K):K=e[17];let u;return e[18]!==g||e[19]!==K?(u=n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsxs("div",{className:"mx-auto max-w-2xl",children:[g,K]})}),e[18]=g,e[19]=K,e[20]=u):u=e[20],u}const ro="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.22)]";function oo(m,e){return Is(m,e,et)}function io(m){const e=He.c(13),{pageKey:r,initialName:c,initialPath:d,onFieldChange:h}=m,[S,p]=w.useState(c),[v,g]=w.useState(d),[b,C]=w.useState(r);b!==r&&(C(r),p(c),g(d));let R;e[0]!==h?(R=l=>{p(l.target.value),h("name",l.target.value)},e[0]=h,e[1]=R):R=e[1];let _;e[2]!==S||e[3]!==R?(_=n.jsx("input",{type:"text",value:S,onChange:R,className:"w-full bg-transparent text-sm font-semibold truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"Page name"}),e[2]=S,e[3]=R,e[4]=_):_=e[4];let k;e[5]!==h?(k=l=>{g(l.target.value),h("path",l.target.value)},e[5]=h,e[6]=k):k=e[6];let o;e[7]!==v||e[8]!==k?(o=n.jsx("input",{type:"text",value:v,onChange:k,className:"w-full bg-transparent text-xs text-muted-foreground truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"/path"}),e[7]=v,e[8]=k,e[9]=o):o=e[9];let D;return e[10]!==_||e[11]!==o?(D=n.jsxs("div",{className:"space-y-1",children:[_,o]}),e[10]=_,e[11]=o,e[12]=D):D=e[12],D}function In(m){const e=He.c(6),{onClick:r}=m;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(Gn,{size:14}),e[0]=c):c=e[0];let d;e[1]!==r?(d=n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:r,children:c})}),e[1]=r,e[2]=d):d=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(pt,{side:"bottom",children:"Add variant"}),e[3]=h):h=e[3];let S;return e[4]!==d?(S=n.jsxs(mt,{children:[d,h]}),e[4]=d,e[5]=S):S=e[5],S}function Wl({orgSlug:m,virtualMcpId:e,branch:r,previewReady:c=!0,previewUrl:d,currentPath:h,activePageBlockKey:S=null,activeGlobalBlockKey:p=null,externalSelectedIndex:v,onSaved:g,initialEditSeo:b=!1,onExitSeo:C,onViewJsonFile:R,onVariantPreviewOverride:_}){const k=c?{orgSlug:m,virtualMcpId:e,branch:r,previewUrl:d}:null,{data:o,isLoading:D}=Ds(k),{data:l,isLoading:Y}=Ns(k),H=Vs(),K=H?.entity?.id===e?H.entity.metadata?.siteSlug??null:null,[u,P]=w.useState(null),[se,T]=w.useState(null),[pe,N]=w.useState(null),[ce,B]=w.useState(0),[te,oe]=w.useState(void 0),[Ce,E]=w.useState(null),[ue,ie]=w.useState(null),[je,M]=w.useState([]),[Ae,X]=w.useState(0),[Ne,ve]=w.useState(null),[re,G]=w.useState(null),[q,ne]=w.useState(null),[le,ke]=w.useState(!0),[Se,de]=w.useState(!1),[be,$]=w.useState(!1),[Z,we]=w.useState(b),[Ee,Ke]=w.useState(b);b&&!Ee&&(Ke(!0),we(!0),P(null),T(null),N(null),M([])),!b&&Ee&&Ke(!1);const[Le,Pe]=w.useState(null),[$e,Fe]=w.useState(void 0),[Me,xe]=w.useState([]),[Re,me]=w.useState(0),[ee,L]=w.useState(0),[ae,Q]=w.useState(null),[Ie,he]=w.useState(null),[Qe,un]=w.useState(null),va=vs(),Sa=`${m}/${e}/${r}`,zt=Cs({orgSlug:m,virtualMcpId:e,branch:r}),[xa,ya]=w.useState(h),[ba,_a]=w.useState(S),[ja,ka]=w.useState(p);(xa!==h||ba!==S||ja!==p)&&(queueMicrotask(()=>zt.flush()),ya(h),_a(S),ka(p),P(null),T(null),N(null),B(0),E(null),ie(null),L(0),Q(null),he(null),M([]),X(t=>t+1),we(!1),Pe(null),Fe(void 0),xe([]),me(t=>t+1));const ye=Ps({orgSlug:m,virtualMcpId:e,branch:r}),Nt=Qs((t,a)=>{ye.mutate({blockKey:t,data:a},{onSuccess:()=>g?.(),onError:s=>W.error(`Save failed: ${s.message}`)})}),Ht=Ts({orgSlug:m,virtualMcpId:e,branch:r}),[bt,Vt]=w.useState(!1),Ut=w.useRef(null),ht=w.useRef(null),gt=w.useRef(null),Wt=w.useRef({}),qe=w.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!c||D||Y)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(zn,{size:20,className:"animate-spin text-muted-foreground"})});if(!o||!l)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Could not load site data."});const wa=As(o),_e=!!p,ze=_e?null:Ms(wa,h,S),j=_e?p:ze?.key??null,Gt=_e&&p?o[p]:void 0,dn=_e&&p&&Gt?Es(p,Gt):_e&&p?p:"",Ct=!_e&&j&&o[j]?o[j]:null,qt=Z&&o&&l&&j&&ze?Kn(o,{kind:"page",pageKey:j,pageName:String(ze.name??""),path:String(ze.path??"")},l):null,Ra=Z?Ct?.seo:void 0,Jt=$e!==void 0?$e:Ra,Da=Z?Rr(Jt):void 0,Na=qt?.seoTypeOptions??[],Va=Z&&l?Dr(l):"",mn=Le??Da??{},Yt=Z&&qt?Nr(mn,qt):null,Ca=Z&&Yt&&Vr(Jt)?$t(Yt,l):null,Pa=Z?Cr(o,l)?.seoData:void 0,Oe=_e?[{label:"Default",sections:[{__resolveType:p}]}]:oo(Ct?.sections,o??{}),Pt=Oe.length>1,Ve=Math.min(ce,Oe.length-1),tt=Oe[Ve],I=tt?.sections??[],Te=Ot(I,o),fn=!_e&&Ks(Ct?.sections);if(_e&&p&&Qe!==p){un(p);const t=I[0],a=Te[0];if(t&&a){P(0),L(0),M([]);const s=ut(t,a,o);s&&(T(s.data),N(s.resolveType),he(null),Q(null))}}!_e&&Qe!==null&&un(null),qe.current={rawSections:I,parsedSections:Te,decofile:o??{},activePageKey:j,pageVariants:Oe,variantIndex:Ve,sectionVariantIndex:ee,selectedSectionIndex:u};const Ta=()=>({multivariate:fn,index:Ve,variants:Oe.map(t=>({rule:t.rule}))}),pn=(t,a)=>{if(!_)return;if(!j||!fn||t.length<=1){_(null);return}const s=Mn(j,{multivariate:!0,index:a,variants:t},o,l);_(s.length>0?s:null)},vt=(t,a,s)=>{if(!_)return;if(!j){_(null);return}const i=Ta(),f=Mn(j,i,o,l);if(!t||a<0){_(f.length>0?f:null);return}const y=nr({pageKey:j,page:i,sectionIndex:a,sectionLazy:Te[a]?.isLazy??!1,mvObj:t,selectedVariantIndex:s,decofile:o,meta:l}),x=[...f,...y];_(x.length>0?x:null)},nt=(t,a,s,i=u??-1,f=!1)=>{const y=Ye(t,a);if(!y){T(null),N(null),he(null),Q(null),f&&vt(null,i,s);return}const V=Vn(y,et)[s];if(!V){T(null),N(null),he(null),Q(null),f&&vt(null,i,s);return}const J=zs(V.value,o);T(J?.data??null),N(J?.resolveType??null);const{resolveType:A,formValue:O}=jt(V.rule,o,l??void 0);he(A),Q(O),f&&vt(y,i,s)};if(v!==void 0&&v!==te&&(oe(v??null),typeof v=="number")){const t=I[v],a=Te[v];if(t&&a)if(P(v),L(0),M([]),X(s=>s+1),a.isMultivariate)nt(t,a,0,v);else{const s=ut(t,a,o);s?(T(s.data),N(s.resolveType)):(T(null),N(null)),he(null),Q(null)}}const Tt={orgSlug:m,virtualMcpId:e,branch:r,previewUrl:d??void 0,siteSlug:K},Qt=pe&&l?$t(pe,l):null,Ue=(t,a)=>{if(!j)return;const s=wt(o,j,t,Ve,Oe);ye.mutate({blockKey:j,data:s},{onSuccess:()=>a?.onSuccess?.()??g?.(),onError:i=>W.error(`Save failed: ${i.message}`)})},St=()=>{P(null),T(null),N(null),L(0),Q(null),he(null),M([]),X(t=>t+1)},Aa=(t,a)=>{Ut.current&&clearTimeout(Ut.current);const s=qe.current.sectionVariantIndex;Ut.current=setTimeout(()=>{const{rawSections:i,parsedSections:f,decofile:y,activePageKey:x,pageVariants:V,variantIndex:J}=qe.current,A=i[a];if(!A)return;const O=f[a];if(!O)return;if(O.isSavedBlock){const z=O.isLazy?A.section?.__resolveType??A.__resolveType:A.__resolveType;ye.mutate({blockKey:z,data:t},{onSuccess:()=>g?.(),onError:U=>W.error(`Save failed: ${U.message}`)});return}if(!x)return;const F={...y[x]},ge=[...i];if(O.isMultivariate){const z=Ye(A,O);if(!z||!x)return;const U=sr(z,s,t);ge[a]=dt(A,O,U)}else if(O.isHidden){const z=Hn(A.__resolveType),U=z?{...A.section}:{...A},De=Array.isArray(U.variants)?[...U.variants]:[];De[0]&&(De[0]={...De[0],value:t}),U.variants=De,z?ge[a]={...A,section:U}:ge[a]=U}else O.isLazy?ge[a]={...A,section:t}:ge[a]=t;if(V.length>1){const z=F.sections,U=[...z?.variants??[]];U[J]&&(U[J]={...U[J],value:ge}),F.sections={...z,variants:U}}else F.sections=ge;ye.mutate({blockKey:x,data:F},{onSuccess:()=>g?.(),onError:z=>W.error(`Save failed: ${z.message}`)})},rn)},Ma=t=>{P(t),L(0),M([]),X(f=>f+1);const a=I[t],s=Te[t];if(!a||!s)return;if(s.isMultivariate){nt(a,s,0,t);return}const i=ut(a,s,o);if(!i){T(null),N(null),he(null),Q(null),vt(null,t,0);return}T(i.data),N(i.resolveType),he(null),Q(null),vt(null,t,0)},hn=t=>{const a=t;T(a),u!==null&&Aa(a,u)},Xt=t=>{if(!j||!o||!l||!ze)return;const a={kind:"page",pageKey:j,pageName:String(ze.name??""),path:String(ze.path??"")},s=Kn(o,a,l);s&&zt.save(j,()=>{const i=va.getQueryData(Ss.decofile(Sa))?.[j];if(!i||typeof i!="object"||i===null||Array.isArray(i))return null;const f={...i,...Wt.current};return Wt.current={},t?.raw!==void 0?{...f,seo:t.raw}:t?.inner!==void 0?Tr(a,s,f,t.inner):f})},Ea=(t,a)=>{j&&(Wt.current[t]=a,Xt())},Ka=(t,a)=>{if(!j)return;const s=Dt([...I],t,a);u!==null&&(u===t?P(a):t<u&&a>=u?P(u-1):t>u&&a<=u&&P(u+1)),Ue(s)},$a=t=>{if(!j)return;const a=I.filter((s,i)=>i!==t);u===t?St():u!==null&&u>t&&P(u-1),Ue(a)},Oa=t=>{if(!j)return;const a=I[t];if(!a)return;const s=[...I];s.splice(t+1,0,tr(a)),u!==null&&u>t&&P(u+1),Ue(s)},Ba=t=>{if(!j)return;const a=I[t],s=Te[t];if(!a||!s||s.isMultivariate)return;const i=s.isHidden?Zs(a):er(a);if(!i)return;const f=[...I];f[t]=i,u===t&&St(),Ue(f)},La=t=>{if(!j)return;const a=I[t],s=Te[t];if(!a||!s||s.isMultivariate)return;const i=Xs(a);if(!i)return;const f=[...I];f[t]=i,u===t&&St(),Ue(f)},Fa=t=>{if(!j)return;const a=I[t],s=Te[t];if(!a||!s?.isSavedBlock)return;const i=ut(a,s,o);if(!i?.data)return;const{name:f,...y}=i.data,x=[...I];s.isLazy?x[t]={...a,section:y}:x[t]=y,u===t&&St(),Ue(x)},Ia=t=>{if(!j)return;const a=[...I,{__resolveType:t.resolveType}],s=a.length-1;Ue(a,{onSuccess:()=>{de(!1),P(s),L(0),M([]),X(x=>x+1);const i=a[s],f=Ot(a,o)[s];if(!i||!f)return;if(f.isMultivariate){nt(i,f,0);return}const y=ut(i,f,o);if(!y){T(null),N(null),he(null),Q(null);return}T(y.data),N(y.resolveType),he(null),Q(null)}})},za=t=>{if(u===null)return;const a=I[u],s=Te[u];!a||!s?.isMultivariate||(L(t),M([]),X(i=>i+1),nt(a,s,t,u,!0))},Ha=t=>{if(u===null||!j)return;const a=I[u],s=Te[u];if(!a||!s?.isMultivariate)return;const i=Ye(a,s);if(!i)return;const f=Js(i,t);if(!f){W.error("Cannot delete the only variant.");return}const y=[...I];y[u]=dt(a,s,f);const x=f.variants;let V=ee;t===ee?V=Math.min(t,x.length-1):t<ee&&(V=ee-1),L(V),M([]),X(J=>J+1),nt(y[u],s,V),Ue(y)},Ua=t=>{if(u===null||!j)return;const a=I[u],s=Te[u];if(!a||!s?.isMultivariate)return;const i=Ye(a,s);if(!i)return;const f=Ys(i,t),y=[...I];y[u]=dt(a,s,f);const x=t+1;L(x),M([]),X(V=>V+1),nt(y[u],s,x),Ue(y)},Wa=(t,a)=>{if(u===null||!j||t===a)return;const s=I[u],i=Te[u];if(!s||!i?.isMultivariate)return;const f=Ye(s,i);if(!f)return;const y=Gs(f,t,a),x=[...I];x[u]=dt(s,i,y);let V=ee;ee===t?V=a:t<ee&&a>=ee?V=ee-1:t>ee&&a<=ee&&(V=ee+1),L(V),nt(x[u],i,V),Ue(x)},Zt=t=>{const a=t??u;if(a===null||!j)return;const s=I[a],i=Te[a];if(!s||!i)return;const f=Hs(s,i);if(!f){W.error("This section cannot have variants.");return}const y=[...I];y[a]=f.section;const x=Ot(y,o)[a];if(!x?.isMultivariate){W.error("Could not add variant.");return}P(a),L(f.newVariantIndex),M([]),X(V=>V+1),nt(f.section,x,f.newVariantIndex,a),Ue(y)},Ga=()=>{if(u===null||!j)return;const t=I[u],a=Te[u];if(!t||!a?.isMultivariate)return;const s=Ye(t,a);if(!s)return;const i=qs(t,a,s);if(!i){W.error("Could not remove variants.");return}const f=[...I];f[u]=i;const y=Ot(f,o)[u];if(!y)return;L(0),he(null),Q(null),M([]),X(V=>V+1);const x=ut(i,y,o);x?(T(x.data),N(x.resolveType)):(T(null),N(null)),vt(null,u,0),Ue(f)},qa=async t=>{if(Ne===null||!j)return;const a=sn(t,o);if(a){W.error(a);return}const s=I[Ne],i=Te[Ne];if(!s||!i)return;const f=ut(s,i,o);if(!f){W.error("This section cannot be saved as global.");return}const y={...f.data,name:t};try{await ye.mutateAsync({blockKey:t,data:y});const x=[...I];x[Ne]={__resolveType:t},await ye.mutateAsync({blockKey:j,data:wt(o,j,x,Ve,Oe)}),u===Ne&&St(),ve(null),W.success(`Saved global block "${t}"`),g?.()}catch(x){W.error(x instanceof Error?x.message:"Failed to save global block")}},gn=tt?.rule;if(Pt&&u===null&&ue===null&&gn){const{resolveType:t,formValue:a}=jt(gn,o??{},l??void 0);ie(t),E(a)}const At=l?$s(l):[],vn=l&&o?Os(l,o):[],Ja=!_e&&!!(d&&l&&o),Sn=ue&&l?$t(ue,l):null,Mt=()=>{ht.current&&(clearTimeout(ht.current),ht.current=null),gt.current&&(clearTimeout(gt.current),gt.current=null)},_t=async(t,a)=>{if(!(ar(a,t,l)>0))try{await Ht.mutateAsync({blockKey:t})}catch(s){W.error(s instanceof Error?s.message:"Could not delete matcher block")}},xn=t=>{ht.current&&clearTimeout(ht.current),ht.current=setTimeout(()=>{const{activePageKey:a,decofile:s,variantIndex:i}=qe.current;if(!a)return;const f={...s[a]},y={...f.sections},x=[...y.variants??[]],V=x[i],J=V?.rule;if(xt(J,s,l)){const A=J?.__resolveType??"",O=s[A],F=typeof O?.name=="string"?O.name:A,{__resolveType:ge,...z}=t;ye.mutate({blockKey:A,data:yt(ge??"",z,F)},{onSuccess:()=>g?.(),onError:U=>W.error(`Save failed: ${U.message}`)});return}V&&(x[i]={...V,rule:t}),f.sections={...y,variants:x},ye.mutate({blockKey:a,data:f},{onSuccess:()=>g?.(),onError:A=>W.error(`Save failed: ${A.message}`)})},rn)},Ya=t=>{ie(t);const a=t?{__resolveType:t}:{__resolveType:En};E({}),xn(a)},Qa=t=>{const a=t;E(a);const s=ue?{__resolveType:ue,...a}:{...a};xn(s)},Xa=async t=>{Mt();const{activePageKey:a,decofile:s,variantIndex:i}=qe.current;if(!a)return;const f=s[a],y=f?.sections;if(!y||typeof y!="object"||Array.isArray(y))return;const x=y;if(!Array.isArray(x.variants))return;const V=[...x.variants],J=V[i];if(!J)return;const A=kt(J.rule,s,l),O=Lt(t);V[i]={...J,rule:O};const F={...s,[a]:{...f,sections:{...x,variants:V}}},{resolveType:ge,formValue:z}=jt(O,F,l??void 0);ie(ge),E(z);try{await ye.mutateAsync({blockKey:a,data:F[a]}),A&&A!==t&&await _t(A,F),g?.()}catch(U){W.error(U instanceof Error?U.message:"Could not apply saved rule")}},yn=t=>{gt.current&&clearTimeout(gt.current);const{selectedSectionIndex:a,sectionVariantIndex:s}=qe.current;a!==null&&(gt.current=setTimeout(()=>{const{rawSections:i,parsedSections:f,decofile:y,activePageKey:x,pageVariants:V,variantIndex:J}=qe.current;if(!x)return;const A=i[a],O=f[a];if(!A||!O?.isMultivariate)return;const F=Ye(A,O);if(!F)return;const z=(F.variants??[])[s]?.rule;if(xt(z,y,l)){const fe=z?.__resolveType??"",We=y[fe],Xe=typeof We?.name=="string"?We.name:fe,{__resolveType:rt,...Ze}=t;ye.mutate({blockKey:fe,data:yt(rt??"",Ze,Xe)},{onSuccess:()=>g?.(),onError:ot=>W.error(`Save failed: ${ot.message}`)});return}const U=Pn(F,s,t),De=[...i];De[a]=dt(A,O,U);const Je=wt(y,x,De,J,V);ye.mutate({blockKey:x,data:Je},{onSuccess:()=>g?.(),onError:fe=>W.error(`Save failed: ${fe.message}`)})},rn))},Za=t=>{he(t),Q({}),yn(t?{__resolveType:t}:{__resolveType:En})},es=t=>{const a=t;Q(a);const s=Ie?{__resolveType:Ie,...a}:{...a};yn(s)},ts=async t=>{Mt();const{selectedSectionIndex:a,sectionVariantIndex:s,rawSections:i,parsedSections:f,decofile:y,activePageKey:x,pageVariants:V,variantIndex:J}=qe.current;if(a===null||!x)return;const A=i[a],O=f[a];if(!A||!O?.isMultivariate)return;const F=Ye(A,O);if(!F)return;const ge=F.variants??[],z=kt(ge[s]?.rule,y,l),U=Lt(t),De=Pn(F,s,U),Je=[...i];Je[a]=dt(A,O,De);const fe=wt(y,x,Je,J,V),We={...y,[x]:fe},{resolveType:Xe,formValue:rt}=jt(U,We,l??void 0);he(Xe),Q(rt);try{await ye.mutateAsync({blockKey:x,data:fe}),z&&z!==t&&await _t(z,We),g?.()}catch(Ze){W.error(Ze instanceof Error?Ze.message:"Could not apply saved rule")}};if(!_e&&!ze)return n.jsxs("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:["No page found for ",h]});if(_e&&!Gt)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Global block not found"});const at=u!==null?Te[u]??null:null,bn=u!==null?I[u]:null,_n=bn&&at?.isMultivariate?Ye(bn,at):null,lt=_n?Vn(_n,et):[],en=Math.min(ee,Math.max(lt.length-1,0)),Et=lt[en]??null,ct=at?.isMultivariate===!0,jn=u!==null&&at!==null,Kt=jn&&(ct||!!(Qt&&se)),ns=Kt&&!_e&&at?.isSavedBlock===!0,st=_e||ns,as=_e?dn:at?.label??"",kn=Ie&&l?$t(Ie,l):null,tn=Kt&&(!_e||je.length>0)?_e?[dn,...je]:[ze.name,at.label,...ct&&Et?[Et.label]:[],...je]:[],ss=Z&&ze?[ze.name,"SEO",...Me]:[],wn=Z?ss:st?tn.length>0?tn:[as]:tn,Rn=()=>{if(!j)return;const t=o[j],a=Us(t.sections,I);if(!a)return;const s=Ws(a);ye.mutate({blockKey:j,data:{...t,sections:a}},{onSuccess:()=>{B(s),P(null),T(null),N(null),M([]),E(null),ie(null)},onError:i=>W.error(`Save failed: ${i.message}`)})},nn=(t,a,s)=>{if(!j)return;const i=o[j],f=i.sections;if(!f||typeof f!="object"||Array.isArray(f))return;const y=f;if(!Array.isArray(y.variants))return;const x=t([...y.variants]);if(!x)return;const V=rr(y,x),J={...o,[j]:{...i,sections:V}};ye.mutate({blockKey:j,data:J[j]},{onSuccess:()=>{a?.(),s&&_t(s,J)},onError:A=>W.error(`Save failed: ${A.message}`)})},rs=t=>{G(null),B(t),P(null),T(null),N(null),M([]);const a=Oe[t]?.rule,{resolveType:s,formValue:i}=jt(a,o??{},l??void 0);ie(s),E(i),pn(Oe.map(f=>({rule:f.rule})),t)},os=(t,a)=>{if(t===a)return;let s=Ve;Ve===t?s=a:t<Ve&&a>=Ve?s=Ve-1:t>Ve&&a<=Ve&&(s=Ve+1),B(s);const i=Dt(Oe.map(f=>({rule:f.rule})),t,a);pn(i,s),nn(f=>Dt(f,t,a))},is=t=>{const a=Oe[t]?.rule,s=kt(a,o??{},l??void 0);nn(i=>i.length<=1?null:(i.splice(t,1),i),()=>{Oe.length-1===1?B(0):t<Ve?B(Ve-1):t===Ve&&B(Math.max(0,t-1)),P(null),T(null),N(null),M([]),E(null),ie(null)},s)},ls=t=>{nn(a=>or(a,t),()=>{B(t+1),P(null),T(null),N(null),M([]),E(null),ie(null)})},cs=async(t,a)=>{Mt();const s=qe.current.activePageKey,i=qe.current.decofile;if(!s)return;const f=i[s],y=f.sections;if(!y||typeof y!="object"||Array.isArray(y))return;const x=y;if(!Array.isArray(x.variants))return;const V=[...x.variants],J=V[t];if(!J?.rule||typeof J.rule!="object"){W.error("This variant has no matcher rule to rename.");return}const A=J.rule,O=a.trim();Vt(!0);try{if(!O){if(!xt(A,i,l)){G(null);return}const Je=A.__resolveType??"";V[t]={...J,rule:Tn(A,i,l)};const fe={...i,[s]:{...f,sections:{...x,variants:V}}};await ye.mutateAsync({blockKey:s,data:fe[s]}),await _t(Je,fe),G(null),g?.();return}const F=An(A,i,l);if(!F){W.error("Could not read this variant's matcher rule.");return}if(F.blockKey){await ye.mutateAsync({blockKey:F.blockKey,data:yt(F.resolveType,F.data,O)}),G(null),g?.();return}const ge=an(O),z=sn(ge,i);if(z){W.error(z);return}const U=yt(F.resolveType,F.data,O);let De=null;try{await ye.mutateAsync({blockKey:ge,data:U}),De=ge,V[t]={...J,rule:Lt(ge)},await ye.mutateAsync({blockKey:s,data:{...f,sections:{...x,variants:V}}}),De=null}catch(Je){throw De&&await Ht.mutateAsync({blockKey:De}).catch(()=>{}),Je}G(null),W.success(`Saved matcher as global block "${O}"`),g?.()}catch(F){W.error(F instanceof Error?F.message:"Failed to rename variant")}finally{Vt(!1)}},us=async(t,a)=>{Mt();const{selectedSectionIndex:s,rawSections:i,parsedSections:f,decofile:y,activePageKey:x,pageVariants:V,variantIndex:J}=qe.current;if(s===null||!x)return;const A=i[s],O=f[s];if(!A||!O?.isMultivariate)return;const F=Ye(A,O);if(!F)return;const ge=F.variants??[],z=ge[t];if(!z?.rule||typeof z.rule!="object"){W.error("This variant has no matcher rule to rename.");return}const U=z.rule,De=a.trim();Vt(!0);const Je=async fe=>{const We={...F,variants:fe},Xe=[...i];Xe[s]=dt(A,O,We);const rt=wt(y,x,Xe,J,V);return await ye.mutateAsync({blockKey:x,data:rt}),{...y,[x]:rt}};try{if(!De){if(!xt(U,y,l)){ne(null);return}const ot=U.__resolveType??"",Nn=[...ge];Nn[t]={...z,rule:Tn(U,y,l)};const gs=await Je(Nn);await _t(ot,gs),ne(null),g?.();return}const fe=An(U,y,l);if(!fe){W.error("Could not read this variant's matcher rule.");return}if(fe.blockKey){await ye.mutateAsync({blockKey:fe.blockKey,data:yt(fe.resolveType,fe.data,De)}),ne(null),g?.();return}const We=an(De),Xe=sn(We,y);if(Xe){W.error(Xe);return}const rt=yt(fe.resolveType,fe.data,De);let Ze=null;try{await ye.mutateAsync({blockKey:We,data:rt}),Ze=We;const ot=[...ge];ot[t]={...z,rule:Lt(We)},await Je(ot),Ze=null}catch(ot){throw Ze&&await Ht.mutateAsync({blockKey:Ze}).catch(()=>{}),ot}ne(null),W.success(`Saved matcher as global block "${De}"`),g?.()}catch(fe){W.error(fe instanceof Error?fe.message:"Failed to rename variant")}finally{Vt(!1)}},Dn=()=>{St()},ds=t=>{Pe(t),Xt({inner:t})},ms=t=>{Fe(t),Xt({raw:t})},fs=()=>{Pe(null),xe([])},ps=()=>me(t=>t+1),hs=t=>{if(Z){if(t===0){zt.flush(),we(!1),Pe(null),Fe(void 0),xe([]),me(s=>s+1),C?.();return}if(t===1){xe([]),me(s=>s+1);return}xe(Me.slice(0,t-1)),me(s=>s+1);return}if(_e){M(je.slice(0,t)),X(s=>s+1);return}if(t===0){Dn();return}if(t===1){M([]),X(s=>s+1);return}if(ct&&t===2){M([]),X(s=>s+1);return}const a=ct?2:1;M(je.slice(0,t-a))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:st||Kt||Z?n.jsxs("div",{className:Be("border-b px-3 py-2.5",st&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!_e&&Pt&&tt&&n.jsxs("button",{type:"button",onClick:Dn,title:`Editing in variant: ${tt.label}`,className:Be("shrink-0 inline-flex items-center gap-1 rounded-md h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",ro),children:[n.jsx(ha,{rule:Rt(tt.rule,o??{},l??void 0),matchers:At}),n.jsx("span",{className:"max-w-[160px] truncate",children:tt.label})]}),n.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:wn.map((t,a)=>{const s=a===wn.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[a>0&&n.jsx(qn,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>hs(a),title:t,className:Be("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",s?st?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":st?"text-foreground/80":"text-muted-foreground",st?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${a}`)})}),st&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(fr,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(pt,{side:"bottom",className:"max-w-[260px]",children:"A global section is a reusable block shared across your site. Editing it here updates it everywhere it's used."})]}),jn&&!ct&&!at?.isHidden&&j&&n.jsx(In,{onClick:()=>Zt()})]}),st&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:"This is a global section. Changes apply everywhere this section is used across your site."})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(io,{pageKey:j,initialName:ze.name,initialPath:ze.path,onFieldChange:Ea})}),n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Edit SEO",className:"size-7 shrink-0",onClick:()=>we(!0),children:n.jsx(cr,{size:14})})}),n.jsx(pt,{side:"bottom",children:"Edit SEO"})]}),n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"View JSON",className:"size-7 shrink-0",onClick:()=>R&&j?R(j):$(!0),children:n.jsx(ur,{size:14})})}),n.jsx(pt,{side:"bottom",children:"View JSON"})]}),n.jsx(In,{onClick:Rn})]})}),Z?n.jsx(Ft,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Ct&&j?n.jsx(Pr,{rawSeo:Jt,innerSeo:mn,defaultResolveType:Va,seoSchema:Ca,activeResolveType:Yt,seoTypeOptions:Na,formResetKey:Re,siteDefaultSeo:Pa,onBreadcrumbChange:xe,onPersistRaw:ms,onInnerChange:ds,onClearForm:fs,onBumpFormKey:ps}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"SEO schema not found for this site."})})})}):Kt?n.jsxs(Ft,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ct&&lt.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Bs,{listKey:`${j??""}:${u??""}`,variants:lt.map((t,a)=>({index:a,label:t.label})),selectedIndex:en,onSelect:za,onRename:ne,onDuplicate:Ua,onDelete:Ha,onRemoveAll:Ga,onReorder:Wa,onAdd:()=>Zt()}),ct&&n.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),n.jsx(Cn,{currentRt:Ie??"",currentLabel:Bt(Et?.rule,o??{},et,l??void 0),currentGlobalKey:kt(Et?.rule,o??{},l??void 0)??void 0,matchers:At,globals:vn,onSelect:Za,onSelectGlobal:ts}),kn&&ae&&n.jsx("div",{className:"pt-1",children:n.jsx(Ln,{schema:kn,value:ae,onChange:es,meta:l??void 0,decofile:o,onSaveReferencedBlock:Nt,sandbox:Tt},`${u??"none"}:${en}:${Ie??""}`)})]})]}),n.jsx(Fn,{activeSchema:Qt,formValue:se,formResetKey:Ae,onFormChange:hn,onBreadcrumbChange:M,breadcrumbPath:je,emptyMessage:"No editable fields for this variant.",meta:l,decofile:o,onSaveReferencedBlock:Nt,sandbox:Tt})]}):_e?n.jsx(Ft,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Fn,{activeSchema:Qt,formValue:se,formResetKey:Ae,onFormChange:hn,onBreadcrumbChange:M,breadcrumbPath:je,emptyMessage:"No editable fields for this global block.",meta:l,decofile:o,onSaveReferencedBlock:Nt,sandbox:Tt})}):n.jsxs(Ft,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Pt&&j&&n.jsx(ao,{listKey:j,variants:Oe,activeIndex:Ve,decofile:o??{},meta:l,matchers:At,onSelect:rs,onReorder:os,onRename:G,onDuplicate:ls,onDelete:is,onAdd:Rn}),Pt&&ue!==null&&n.jsxs("div",{className:Be("px-3 border-b",le?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>ke(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-sm py-0.5 hover:bg-muted/40","aria-expanded":le,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),le?n.jsx(mr,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(ir,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),le&&n.jsxs("div",{className:Be("space-y-3",bt&&"pointer-events-none opacity-50"),children:[n.jsx(Cn,{currentRt:ue,currentLabel:Bt(tt?.rule,o??{},et,l??void 0),currentGlobalKey:kt(tt?.rule,o??{},l??void 0)??void 0,matchers:At,globals:vn,onSelect:Ya,onSelectGlobal:Xa}),Sn&&Ce&&n.jsx("div",{className:"space-y-3",children:n.jsx(Ln,{schema:Sn,value:Ce,onChange:Qa,meta:l??void 0,decofile:o,onSaveReferencedBlock:Nt,sandbox:Tt},`${Ve}:${ue??""}`)})]})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(qr,{listKey:`${j??""}-${Ve}`,rawSections:I,sections:Te,meta:l,selectedIndex:u,onSelect:Ma,onReorder:Ka,onDelete:$a,onDuplicate:Oa,onMakeReusable:ve,onToggleHidden:Ba,onToggleLazy:La,onAddVariant:Zt,onDetach:Fa,onAddSection:()=>de(!0),canAddSection:Ja})})]}),n.jsx(Ls,{open:Ne!==null,onOpenChange:t=>{t||ve(null)},defaultBlockId:Ne!==null?an(Te[Ne]?.label??""):"",isPending:ye.isPending,onSubmit:qa}),d&&n.jsx(Er,{open:Se,onOpenChange:de,meta:l,decofile:o,previewBaseUrl:d,onSelect:Ia}),be&&j&&o&&n.jsx(Fs,{open:be,onOpenChange:$,pageKey:j,decofile:o}),re!==null&&n.jsx(On,{open:!0,initialName:xt(Oe[re]?.rule,o??{},l??void 0)?Bt(Oe[re]?.rule,o??{},et,l??void 0):"",autoLabel:et(Rt(Oe[re]?.rule,o??{},l??void 0)),isPending:bt,onSubmit:async t=>{await cs(re,t)},onOpenChange:t=>{!t&&!bt&&G(null)}}),q!==null&&n.jsx(On,{open:!0,initialName:xt(lt[q]?.rule,o??{},l??void 0)?Bt(lt[q]?.rule,o??{},et,l??void 0):"",autoLabel:et(Rt(lt[q]?.rule,o??{},l??void 0)),isPending:bt,onSubmit:async t=>{await us(q,t)},onOpenChange:t=>{!t&&!bt&&ne(null)}})]})}export{Wl as SectionsEditor};
@@ -0,0 +1 @@
1
+ import{r as c,ah as nt,a2 as Pe,j as d,a3 as rt,ai as be,Z as k,T as st,U as j,V as _,bP as $,a1 as lt,al as Ne,W as Ee,ag as at,bK as it,bR as ct,dz as dt,dC as ut,dA as pt,dD as ft,_ as mt,X as ht,dB as gt,$ as vt,a0 as xt,c as ee,l as oe}from"./index-CXy6rN6i.js";import{V as St}from"./tooltip-BRQCINXK.js";import{i as wt,n as Ct}from"./ChevronUp-DSdWQUoR.js";import{t as Re}from"./ChevronDown-DGuR7uUZ.js";function _e(r,[e,t]){return Math.min(t,Math.max(e,r))}var yt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,bt]=at(J),[ne]=ht(J,[bt,Ee]),pe=Ee(),[Tt,G]=ne(J),[Pt,_t]=ne(J),je=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:i,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:v,disabled:b,required:w,form:S}=r,p=pe(e),[g,C]=c.useState(null),[m,x]=c.useState(null),[U,M]=c.useState(!1),re=nt(u),[N,O]=Pe({prop:o,defaultProp:n??!1,onChange:i,caller:J}),[F,q]=Pe({prop:s,defaultProp:l,onChange:a,caller:J}),L=c.useRef(null),B=g?S||!!g.closest("form"):!0,[W,V]=c.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(rt,{...p,children:d.jsxs(Tt,{required:w,scope:e,trigger:g,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:U,onValueNodeHasChildrenChange:M,contentId:be(),value:F,onValueChange:q,open:N,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:b,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Pt,{scope:r.__scopeSelect,onNativeOptionAdd:c.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:c.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?d.jsxs(Qe,{"aria-hidden":!0,required:w,tabIndex:-1,name:h,autoComplete:v,value:F,onChange:E=>q(E.target.value),disabled:b,form:S,children:[F===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=J;var Me="SelectTrigger",Ae=c.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,i=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=c.useRef("touch"),[v,b,w]=tt(p=>{const g=u().filter(x=>!x.disabled),C=g.find(x=>x.value===s.value),m=ot(g,p,C);m!==void 0&&s.onValueChange(m.value)}),S=p=>{l||(s.onOpenChange(!0),w()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(st,{asChild:!0,...i,children:d.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...n,ref:a,onClick:_(n.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:_(n.onPointerDown,p=>{h.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:_(n.onKeyDown,p=>{const g=v.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&b(p.key),!(g&&p.key===" ")&&yt.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=c.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:i,placeholder:s="",...l}=r,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=i!==void 0,v=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:v,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):i})});De.displayName=Oe;var Nt="SelectIcon",ke=c.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return d.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});ke.displayName=Nt;var Et="SelectPortal",Le=r=>d.jsx(lt,{asChild:!0,...r});Le.displayName=Et;var Q="SelectContent",Be=c.forwardRef((r,e)=>{const t=G(Q,r.__scopeSelect),[o,n]=c.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const i=o;return i?Ne.createPortal(d.jsx(Ve,{scope:r.__scopeSelect,children:d.jsx(de.Slot,{scope:r.__scopeSelect,children:d.jsx("div",{children:r.children})})}),i):null}return d.jsx(He,{...r,ref:e})});Be.displayName=Q;var A=10,[Ve,Y]=ne(Q),Rt="SelectContentImpl",jt=gt("SelectContent.RemoveScroll"),He=c.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:v,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:g,...C}=r,m=G(Q,t),[x,U]=c.useState(null),[M,re]=c.useState(null),N=k(e,f=>U(f)),[O,F]=c.useState(null),[q,L]=c.useState(null),B=ue(t),[W,V]=c.useState(!1),H=c.useRef(!1);c.useEffect(()=>{if(x)return dt(x)},[x]),ut();const E=c.useCallback(f=>{const[T,...R]=B().map(P=>P.ref.current),[y]=R.slice(-1),I=document.activeElement;for(const P of f)if(P===I||(P?.scrollIntoView({block:"nearest"}),P===T&&M&&(M.scrollTop=0),P===y&&M&&(M.scrollTop=M.scrollHeight),P?.focus(),document.activeElement!==I))return},[B,M]),D=c.useCallback(()=>E([O,x]),[E,O,x]);c.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;c.useEffect(()=>{if(x){let f={x:0,y:0};const T=y=>{f={x:Math.abs(Math.round(y.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(y.pageY)-(K.current?.y??0))}},R=y=>{f.x<=10&&f.y<=10?y.preventDefault():x.contains(y.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),c.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=tt(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),y=ot(T,f,R);y&&setTimeout(()=>y.ref.current.focus())}),me=c.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&(F(f),y&&(H.current=!0))},[m.value]),he=c.useCallback(()=>x?.focus(),[x]),te=c.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&L(f)},[m.value]),ie=o==="popper"?Se:ze,se=ie===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:v,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:g}:{};return d.jsx(Ve,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:d.jsx(pt,{as:jt,allowPinchZoom:!0,children:d.jsx(ft,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:_(n,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(mt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ie,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:_(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let y=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(y=y.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,P=y.indexOf(I);y=y.slice(P+1)}setTimeout(()=>E(y)),f.preventDefault()}})})})})})})});He.displayName=Rt;var Mt="SelectItemAlignedPosition",ze=c.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,i=G(Q,t),s=Y(Q,t),[l,a]=c.useState(null),[u,h]=c.useState(null),v=k(e,N=>h(N)),b=ue(t),w=c.useRef(!1),S=c.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:C,focusSelectedItem:m}=s,x=c.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&u&&p&&g&&C){const N=i.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),F=i.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(i.dir!=="rtl"){const I=q.left-O.left,P=F.left-I,X=N.left-P,Z=N.width+X,ge=Math.max(Z,O.width),ve=window.innerWidth-A,xe=_e(P,[A,Math.max(A,ve-ge)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,P=window.innerWidth-F.right-I,X=window.innerWidth-N.right-P,Z=N.width+X,ge=Math.max(Z,O.width),ve=window.innerWidth-A,xe=_e(P,[A,Math.max(A,ve-ge)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=b(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(g.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=N.top+N.height/2-A,ie=B-te,se=g.offsetHeight/2,f=g.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&g===L[L.length-1].ref.current;l.style.bottom="0px";const P=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ie,se+(I?he:0)+P+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&g===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>w.current=!0)}},[b,i.trigger,i.valueNode,l,u,p,g,C,i.dir,o]);$(()=>x(),[x]);const[U,M]=c.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=c.useCallback(N=>{N&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(Ot,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:w,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:U},children:d.jsx(j.div,{...n,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=c.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...i}=r,s=pe(t);return d.jsx(vt,{...s,...i,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=At;var[Ot,Te]=ne(Q,{}),we="SelectViewport",Ue=c.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,i=Y(we,t),s=Te(we,t),l=k(e,i.onViewportChange),a=c.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:_(n.onScroll,u=>{const h=u.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:b}=s;if(b?.current&&v){const w=Math.abs(a.current-h.scrollTop);if(w>0){const S=window.innerHeight-A*2,p=parseFloat(v.style.minHeight),g=parseFloat(v.style.height),C=Math.max(p,g);if(C<S){const m=C+w,x=Math.min(S,m),U=m-x;v.style.height=x+"px",v.style.bottom==="0px"&&(h.scrollTop=U>0?U:0,v.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Ue.displayName=we;var Fe="SelectGroup",[Dt,kt]=ne(Fe),Lt=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=be();return d.jsx(Dt,{scope:t,id:n,children:d.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Lt.displayName=Fe;var We="SelectLabel",Bt=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=kt(We,t);return d.jsx(j.div,{id:n.id,...o,ref:e})});Bt.displayName=We;var ce="SelectItem",[Vt,Ke]=ne(ce),$e=c.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:i,...s}=r,l=G(ce,t),a=Y(ce,t),u=l.value===o,[h,v]=c.useState(i??""),[b,w]=c.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,n)),p=be(),g=c.useRef("touch"),C=()=>{n||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(Vt,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:c.useCallback(m=>{v(x=>x||(m?.textContent??"").trim())},[]),children:d.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:h,children:d.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":b?"":void 0,"aria-selected":u&&b,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:_(s.onFocus,()=>w(!0)),onBlur:_(s.onBlur,()=>w(!1)),onClick:_(s.onClick,()=>{g.current!=="mouse"&&C()}),onPointerUp:_(s.onPointerUp,()=>{g.current==="mouse"&&C()}),onPointerDown:_(s.onPointerDown,m=>{g.current=m.pointerType}),onPointerMove:_(s.onPointerMove,m=>{g.current=m.pointerType,n?a.onItemLeave?.():g.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:_(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(It.includes(m.key)&&C(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ce;var le="SelectItemText",Ge=c.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...i}=r,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=_t(le,t),[h,v]=c.useState(null),b=k(e,C=>v(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),w=h?.textContent,S=c.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:w},a.value),[a.disabled,a.value,w]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=u;return $(()=>(p(S),()=>g(S)),[p,g,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...i,ref:b}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ne.createPortal(i.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});qe.displayName=Ye;var Ce="SelectScrollUpButton",Xe=c.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;i(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});Xe.displayName=Ce;var ye="SelectScrollDownButton",Ze=c.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;i(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=ye;var Je=c.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,i=Y("SelectScrollButton",t),s=c.useRef(null),l=ue(t),a=c.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return c.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:_(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:_(n.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:_(n.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});zt.displayName=Ht;var Ie="SelectArrow",Ut=c.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),i=G(Ie,t),s=Y(Ie,t);return i.open&&s.position==="popper"?d.jsx(xt,{...n,...o,ref:e}):null});Ut.displayName=Ie;var Ft="SelectBubbleInput",Qe=c.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=c.useRef(null),i=k(o,n),s=it(e);return c.useEffect(()=>{const l=n.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const v=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(v)}},[s,e]),d.jsx(j.select,{...t,style:{...St,...t.style},ref:i,defaultValue:e})});Qe.displayName=Ft;function et(r){return r===""||r===void 0}function tt(r){const e=ct(r),t=c.useRef(""),o=c.useRef(0),n=c.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),i=c.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return c.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,i]}function ot(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=t?r.indexOf(t):-1;let s=Wt(r,Math.max(i,0));n.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return a!==t?a:void 0}function Wt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var Kt=je,$t=Ae,Gt=De,Yt=ke,qt=Le,Xt=Be,Zt=Ue,Jt=$e,Qt=Ge,eo=qe,to=Xe,oo=Ze;function co(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Kt,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Gt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(13);let t,o,n,i;e[0]!==r?({className:o,size:i,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=i):(t=e[1],o=e[2],n=e[3],i=e[4]);const s=i===void 0?"default":i;let l;e[5]!==o?(l=oe("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg bg-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=xs]:h-6 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Yt,{asChild:!0,children:d.jsx(Re,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==s||e[11]!==l?(u=d.jsxs($t,{"data-slot":"select-trigger","data-size":s,className:l,...n,children:[t,a]}),e[8]=t,e[9]=n,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function fo(r){const e=ee.c(25);let t,o,n,i,s;e[0]!==r?({className:o,children:t,position:i,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=i,e[5]=s):(t=e[1],o=e[2],n=e[3],i=e[4],s=e[5]);const l=i===void 0?"popper":i,a=s===void 0?!1:s,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let h;e[6]!==o||e[7]!==u?(h=oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=h):h=e[8];let v;e[9]!==a?(v=!a&&d.jsx(no,{}),e[9]=a,e[10]=v):v=e[10];const b=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let w;e[11]!==b?(w=oe("p-1",b),e[11]=b,e[12]=w):w=e[12];let S;e[13]!==t||e[14]!==w?(S=d.jsx(Zt,{className:w,children:t}),e[13]=t,e[14]=w,e[15]=S):S=e[15];let p;e[16]!==a?(p=!a&&d.jsx(ro,{}),e[16]=a,e[17]=p):p=e[17];let g;return e[18]!==l||e[19]!==n||e[20]!==h||e[21]!==v||e[22]!==S||e[23]!==p?(g=d.jsx(qt,{children:d.jsxs(Xt,{"data-slot":"select-content",className:h,position:l,...n,children:[v,S,p]})}),e[18]=l,e[19]=n,e[20]=h,e[21]=v,e[22]=S,e[23]=p,e[24]=g):g=e[24],g}function mo(r){const e=ee.c(16);let t,o,n,i;e[0]!==r?({className:o,children:t,hideCheck:i,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=i):(t=e[1],o=e[2],n=e[3],i=e[4]);const s=i===void 0?!1:i;let l;e[5]!==o?(l=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(eo,{children:d.jsx(wt,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Qt,{children:t}),e[9]=t,e[10]=u):u=e[10];let h;return e[11]!==n||e[12]!==l||e[13]!==a||e[14]!==u?(h=d.jsxs(Jt,{"data-slot":"select-item",className:l,...n,children:[a,u]}),e[11]=n,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(Ct,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:i}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(Re,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:i}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{co as S,po as a,uo as b,fo as c,mo as d,_e as e};
@@ -1 +1 @@
1
- import{c as D,j as o,l as R,r as $,B as H}from"./index-CFiyU0D9.js";import{i as Q,a as W,d as J,e as K}from"./dialog-BAqFyO8a.js";import{g as V,b as Y,a as Z,D as ee}from"./drawer-CFkqEC3w.js";import{u as oe}from"./use-mobile-NlF-3RoP.js";import{b as A}from"./chat-context-n9syhvq-.js";import{D as te,b as le,S as U,M as se}from"./decopilot-BItqS11w.js";import{a as G,b as z}from"./connect-desktop-dialog-Brra3cMC.js";const ie=[{tier:"fast",description:"Quicker responses"},{tier:"smart",description:"Balanced quality"},{tier:"thinking",description:"Deeper reasoning"}];function X(r){const e=D.c(10),{modelSet:t,selectedModelId:s,onSelect:i}=r;let l,c;if(e[0]!==t.logo||e[1]!==t.models||e[2]!==t.tiers||e[3]!==i||e[4]!==s){const a=Object.fromEntries(t.models.map(ne));l="flex flex-col p-2 w-[320px]",c=ie.map(d=>{const{tier:p,description:m}=d,u=t.tiers[p];if(!u.modelId)return null;const x=a[u.modelId];if(!x)return null;const f=s===u.modelId;return o.jsxs("button",{type:"button",onClick:()=>i(x),className:R("flex items-center gap-3 px-3 py-2.5 rounded-lg text-left hover:bg-accent",f&&"bg-accent/50"),children:[o.jsx("img",{src:t.logo,alt:u.label,className:"size-5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),o.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[o.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:u.label}),o.jsx("span",{className:"text-xs text-muted-foreground leading-tight",children:m})]})]},p)}),e[0]=t.logo,e[1]=t.models,e[2]=t.tiers,e[3]=i,e[4]=s,e[5]=l,e[6]=c}else l=e[5],c=e[6];let n;return e[7]!==l||e[8]!==c?(n=o.jsx("div",{className:l,children:c}),e[7]=l,e[8]=c,e[9]=n):n=e[9],n}function ne(r){return[r.modelId,r]}const de=[{providerId:"claude-code",modelId:"claude-code:haiku",title:"Claude Code Haiku",description:"Fast and lightweight",capabilities:["text"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:sonnet",title:"Claude Code Sonnet 5",description:"Balanced performance",capabilities:["text","reasoning"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:opus",title:"Claude Code Opus",description:"Most capable",capabilities:["text","reasoning"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:opus-1m",title:"Claude Code Opus 4.8 1M",description:"Most capable, 1M context window",capabilities:["text","reasoning"],limits:{contextWindow:1e6,maxOutputTokens:null},costs:null}],L="https://assets.decocache.com/decocms/6ac44f1c-c0cf-4480-84b5-2ae6fe742d0b/codex-app.png.png",ce=[{providerId:"codex",modelId:"codex:gpt-5.5",title:"GPT-5.5",description:"Frontier model for complex coding, research, and real-world work",capabilities:["text","reasoning"],logo:L,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.4",title:"GPT-5.4",description:"Strong model for everyday coding",capabilities:["text","reasoning"],logo:L,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.4-mini",title:"GPT-5.4 Mini",description:"Small, fast, and cost-efficient model for simpler coding tasks",capabilities:["text","reasoning"],logo:L,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.3-codex-spark",title:"GPT-5.3 Codex Spark",description:"Ultra-fast coding model",capabilities:["text","reasoning"],logo:L,limits:null,costs:null}],re="https://decoims.com/decocms/93e4059c-e598-412b-87eb-54d72a946ec8/claude-stroke-rounded.svg",ae="https://decoims.com/decocms/9170ffd4-b9cc-4661-ad8f-ae2eea019e00/codex.svg",me={fast:{modelId:"claude-code:haiku",label:"Haiku 4.5",description:"Quicker responses",iconNode:o.jsx(G,{size:16})},smart:{modelId:"claude-code:sonnet",label:"Sonnet 5",description:"Balanced quality",iconNode:o.jsx(G,{size:16})},thinking:{modelId:"claude-code:opus-1m",label:"Opus 4.8 1M",description:"Deeper reasoning",iconNode:o.jsx(G,{size:16})}},pe={fast:{modelId:"codex:gpt-5.4-mini",label:"GPT-5.4 Mini",description:"Quicker responses",iconNode:o.jsx(z,{size:16})},smart:{modelId:"codex:gpt-5.4",label:"GPT-5.4",description:"Balanced quality",iconNode:o.jsx(z,{size:16})},thinking:{modelId:"codex:gpt-5.5",label:"GPT-5.5",description:"Deeper reasoning",iconNode:o.jsx(z,{size:16})}};function q(r){return r==="claude-code"?{logo:re,tiers:me,models:de}:r==="codex"?{logo:ae,tiers:pe,models:ce}:null}function ue(r){const e=D.c(11),{onClose:t,agent:s}=r,i=A(),l=s??i.pendingHarnessId??"decopilot";let c;e[0]!==l?(c=q(l),e[0]=l,e[1]=c):c=e[1];const n=c;if(!n){let m;return e[2]!==t?(m=o.jsx(le,{onClose:t}),e[2]=t,e[3]=m):m=e[3],m}const a=i.selectedModel?.modelId??n.tiers[i.simpleModeTier].modelId;let d;e[4]!==t||e[5]!==i?(d=m=>{i.setModel({...m,keyId:void 0}),t()},e[4]=t,e[5]=i,e[6]=d):d=e[6];let p;return e[7]!==n||e[8]!==a||e[9]!==d?(p=o.jsx(X,{modelSet:n,selectedModelId:a,onSelect:d}),e[7]=n,e[8]=a,e[9]=d,e[10]=p):p=e[10],p}function fe(r){const e=D.c(13);let t,s;e[0]!==r?({agent:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=t?q(t):null,e[3]=t,e[4]=i):i=e[4];const l=i;if(!l){let d;return e[5]!==s?(d=o.jsx(te,{...s}),e[5]=s,e[6]=d):d=e[6],d}const c=s.selectedModel?.modelId??l.tiers.smart.modelId;let n;e[7]!==s?(n=d=>{s.onModelChange(d),s.onClose()},e[7]=s,e[8]=n):n=e[8];let a;return e[9]!==l||e[10]!==c||e[11]!==n?(a=o.jsx(X,{modelSet:l,selectedModelId:c,onSelect:n}),e[9]=l,e[10]=c,e[11]=n,e[12]=a):a=e[12],a}function ve(r){const e=D.c(39),{variant:t,className:s,placeholder:i,model:l,isLoading:c,credentialId:n,onCredentialChange:a,onModelChange:d,filterModels:p,agent:m}=r,u=t===void 0?"borderless":t,x=i===void 0?"Select model":i,[f,k]=$.useState(!1),g=d!==void 0,F=oe(),B=u==="borderless"?"ghost":"outline",P=u==="borderless"&&"md:border-none";let h;e[0]!==s||e[1]!==P?(h=R("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 shrink justify-start overflow-hidden",P,s),e[0]=s,e[1]=P,e[2]=h):h=e[2];let b;e[3]!==c||e[4]!==l||e[5]!==x||e[6]!==g?(b=g?o.jsx(U,{model:l??null,placeholder:x,isLoading:c}):o.jsx(ge,{placeholder:x}),e[3]=c,e[4]=l,e[5]=x,e[6]=g,e[7]=b):b=e[7];let O;e[8]!==B||e[9]!==h||e[10]!==b?(O=o.jsx(H,{variant:B,size:"sm",className:h,children:b}),e[8]=B,e[9]=h,e[10]=b,e[11]=O):O=e[11];const C=O;let w;e[12]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(se,{}),e[12]=w):w=e[12];let y;e[13]!==m||e[14]!==n||e[15]!==p||e[16]!==l||e[17]!==a||e[18]!==d||e[19]!==g?(y=o.jsx($.Suspense,{fallback:w,children:g?o.jsx(fe,{onClose:()=>k(!1),agent:m,credentialId:n??null,onCredentialChange:a??xe,selectedModel:l??null,onModelChange:d,filterModels:p}):o.jsx(ue,{onClose:()=>k(!1),agent:m})}),e[13]=m,e[14]=n,e[15]=p,e[16]=l,e[17]=a,e[18]=d,e[19]=g,e[20]=y):y=e[20];const I=y;if(F){let M;e[21]!==C?(M=o.jsx(V,{asChild:!0,children:C}),e[21]=C,e[22]=M):M=e[22];let _;e[23]===Symbol.for("react.memo_cache_sentinel")?(_=o.jsx(Y,{className:"sr-only",children:"Select model"}),e[23]=_):_=e[23];let v;e[24]!==I?(v=o.jsxs(Z,{className:"p-0 flex flex-col max-h-[95vh]",children:[_,o.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:I})]}),e[24]=I,e[25]=v):v=e[25];let T;return e[26]!==f||e[27]!==M||e[28]!==v?(T=o.jsxs(ee,{open:f,onOpenChange:k,children:[M,v]}),e[26]=f,e[27]=M,e[28]=v,e[29]=T):T=e[29],T}let S;e[30]!==C?(S=o.jsx(Q,{asChild:!0,children:C}),e[30]=C,e[31]=S):S=e[31];let N;e[32]===Symbol.for("react.memo_cache_sentinel")?(N=o.jsx(W,{className:"sr-only",children:"Select model"}),e[32]=N):N=e[32];let j;e[33]!==I?(j=o.jsxs(J,{className:"p-0 gap-0 sm:max-w-fit overflow-hidden h-[100dvh] sm:h-auto max-h-[100dvh] sm:max-h-[85vh] w-full max-w-full sm:max-w-fit rounded-none sm:rounded-xl border-0 sm:border",closeButtonClassName:"top-3.5 right-3.5 z-20",children:[N,I]}),e[33]=I,e[34]=j):j=e[34];let E;return e[35]!==f||e[36]!==S||e[37]!==j?(E=o.jsxs(K,{open:f,onOpenChange:k,children:[S,j]}),e[35]=f,e[36]=S,e[37]=j,e[38]=E):E=e[38],E}function xe(){}function ge(r){const e=D.c(4),{placeholder:t}=r,{selectedModel:s,isModelsLoading:i}=A();let l;return e[0]!==i||e[1]!==s||e[2]!==t?(l=o.jsx(U,{model:s,placeholder:t,isLoading:i}),e[0]=i,e[1]=s,e[2]=t,e[3]=l):l=e[3],l}export{ve as M};
1
+ import{c as D,j as o,l as R,r as $,B as H}from"./index-CXy6rN6i.js";import{i as Q,a as W,d as J,e as K}from"./dialog-o7scRbG9.js";import{g as V,b as Y,a as Z,D as ee}from"./drawer-B-Vy7tMY.js";import{u as oe}from"./use-mobile-DgvzRDzB.js";import{b as A}from"./chat-context-huSCeR82.js";import{D as te,b as le,S as U,M as se}from"./decopilot-BxOK0Z8W.js";import{a as G,b as z}from"./connect-desktop-dialog-CvuFk-NY.js";const ie=[{tier:"fast",description:"Quicker responses"},{tier:"smart",description:"Balanced quality"},{tier:"thinking",description:"Deeper reasoning"}];function X(r){const e=D.c(10),{modelSet:t,selectedModelId:s,onSelect:i}=r;let l,c;if(e[0]!==t.logo||e[1]!==t.models||e[2]!==t.tiers||e[3]!==i||e[4]!==s){const a=Object.fromEntries(t.models.map(ne));l="flex flex-col p-2 w-[320px]",c=ie.map(d=>{const{tier:p,description:m}=d,u=t.tiers[p];if(!u.modelId)return null;const x=a[u.modelId];if(!x)return null;const f=s===u.modelId;return o.jsxs("button",{type:"button",onClick:()=>i(x),className:R("flex items-center gap-3 px-3 py-2.5 rounded-lg text-left hover:bg-accent",f&&"bg-accent/50"),children:[o.jsx("img",{src:t.logo,alt:u.label,className:"size-5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),o.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[o.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:u.label}),o.jsx("span",{className:"text-xs text-muted-foreground leading-tight",children:m})]})]},p)}),e[0]=t.logo,e[1]=t.models,e[2]=t.tiers,e[3]=i,e[4]=s,e[5]=l,e[6]=c}else l=e[5],c=e[6];let n;return e[7]!==l||e[8]!==c?(n=o.jsx("div",{className:l,children:c}),e[7]=l,e[8]=c,e[9]=n):n=e[9],n}function ne(r){return[r.modelId,r]}const de=[{providerId:"claude-code",modelId:"claude-code:haiku",title:"Claude Code Haiku",description:"Fast and lightweight",capabilities:["text"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:sonnet",title:"Claude Code Sonnet 5",description:"Balanced performance",capabilities:["text","reasoning"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:opus",title:"Claude Code Opus",description:"Most capable",capabilities:["text","reasoning"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:opus-1m",title:"Claude Code Opus 4.8 1M",description:"Most capable, 1M context window",capabilities:["text","reasoning"],limits:{contextWindow:1e6,maxOutputTokens:null},costs:null}],L="https://assets.decocache.com/decocms/6ac44f1c-c0cf-4480-84b5-2ae6fe742d0b/codex-app.png.png",ce=[{providerId:"codex",modelId:"codex:gpt-5.5",title:"GPT-5.5",description:"Frontier model for complex coding, research, and real-world work",capabilities:["text","reasoning"],logo:L,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.4",title:"GPT-5.4",description:"Strong model for everyday coding",capabilities:["text","reasoning"],logo:L,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.4-mini",title:"GPT-5.4 Mini",description:"Small, fast, and cost-efficient model for simpler coding tasks",capabilities:["text","reasoning"],logo:L,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.3-codex-spark",title:"GPT-5.3 Codex Spark",description:"Ultra-fast coding model",capabilities:["text","reasoning"],logo:L,limits:null,costs:null}],re="https://decoims.com/decocms/93e4059c-e598-412b-87eb-54d72a946ec8/claude-stroke-rounded.svg",ae="https://decoims.com/decocms/9170ffd4-b9cc-4661-ad8f-ae2eea019e00/codex.svg",me={fast:{modelId:"claude-code:haiku",label:"Haiku 4.5",description:"Quicker responses",iconNode:o.jsx(G,{size:16})},smart:{modelId:"claude-code:sonnet",label:"Sonnet 5",description:"Balanced quality",iconNode:o.jsx(G,{size:16})},thinking:{modelId:"claude-code:opus-1m",label:"Opus 4.8 1M",description:"Deeper reasoning",iconNode:o.jsx(G,{size:16})}},pe={fast:{modelId:"codex:gpt-5.4-mini",label:"GPT-5.4 Mini",description:"Quicker responses",iconNode:o.jsx(z,{size:16})},smart:{modelId:"codex:gpt-5.4",label:"GPT-5.4",description:"Balanced quality",iconNode:o.jsx(z,{size:16})},thinking:{modelId:"codex:gpt-5.5",label:"GPT-5.5",description:"Deeper reasoning",iconNode:o.jsx(z,{size:16})}};function q(r){return r==="claude-code"?{logo:re,tiers:me,models:de}:r==="codex"?{logo:ae,tiers:pe,models:ce}:null}function ue(r){const e=D.c(11),{onClose:t,agent:s}=r,i=A(),l=s??i.pendingHarnessId??"decopilot";let c;e[0]!==l?(c=q(l),e[0]=l,e[1]=c):c=e[1];const n=c;if(!n){let m;return e[2]!==t?(m=o.jsx(le,{onClose:t}),e[2]=t,e[3]=m):m=e[3],m}const a=i.selectedModel?.modelId??n.tiers[i.simpleModeTier].modelId;let d;e[4]!==t||e[5]!==i?(d=m=>{i.setModel({...m,keyId:void 0}),t()},e[4]=t,e[5]=i,e[6]=d):d=e[6];let p;return e[7]!==n||e[8]!==a||e[9]!==d?(p=o.jsx(X,{modelSet:n,selectedModelId:a,onSelect:d}),e[7]=n,e[8]=a,e[9]=d,e[10]=p):p=e[10],p}function fe(r){const e=D.c(13);let t,s;e[0]!==r?({agent:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=t?q(t):null,e[3]=t,e[4]=i):i=e[4];const l=i;if(!l){let d;return e[5]!==s?(d=o.jsx(te,{...s}),e[5]=s,e[6]=d):d=e[6],d}const c=s.selectedModel?.modelId??l.tiers.smart.modelId;let n;e[7]!==s?(n=d=>{s.onModelChange(d),s.onClose()},e[7]=s,e[8]=n):n=e[8];let a;return e[9]!==l||e[10]!==c||e[11]!==n?(a=o.jsx(X,{modelSet:l,selectedModelId:c,onSelect:n}),e[9]=l,e[10]=c,e[11]=n,e[12]=a):a=e[12],a}function ve(r){const e=D.c(39),{variant:t,className:s,placeholder:i,model:l,isLoading:c,credentialId:n,onCredentialChange:a,onModelChange:d,filterModels:p,agent:m}=r,u=t===void 0?"borderless":t,x=i===void 0?"Select model":i,[f,k]=$.useState(!1),g=d!==void 0,F=oe(),B=u==="borderless"?"ghost":"outline",P=u==="borderless"&&"md:border-none";let h;e[0]!==s||e[1]!==P?(h=R("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 shrink justify-start overflow-hidden",P,s),e[0]=s,e[1]=P,e[2]=h):h=e[2];let b;e[3]!==c||e[4]!==l||e[5]!==x||e[6]!==g?(b=g?o.jsx(U,{model:l??null,placeholder:x,isLoading:c}):o.jsx(ge,{placeholder:x}),e[3]=c,e[4]=l,e[5]=x,e[6]=g,e[7]=b):b=e[7];let O;e[8]!==B||e[9]!==h||e[10]!==b?(O=o.jsx(H,{variant:B,size:"sm",className:h,children:b}),e[8]=B,e[9]=h,e[10]=b,e[11]=O):O=e[11];const C=O;let w;e[12]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(se,{}),e[12]=w):w=e[12];let y;e[13]!==m||e[14]!==n||e[15]!==p||e[16]!==l||e[17]!==a||e[18]!==d||e[19]!==g?(y=o.jsx($.Suspense,{fallback:w,children:g?o.jsx(fe,{onClose:()=>k(!1),agent:m,credentialId:n??null,onCredentialChange:a??xe,selectedModel:l??null,onModelChange:d,filterModels:p}):o.jsx(ue,{onClose:()=>k(!1),agent:m})}),e[13]=m,e[14]=n,e[15]=p,e[16]=l,e[17]=a,e[18]=d,e[19]=g,e[20]=y):y=e[20];const I=y;if(F){let M;e[21]!==C?(M=o.jsx(V,{asChild:!0,children:C}),e[21]=C,e[22]=M):M=e[22];let _;e[23]===Symbol.for("react.memo_cache_sentinel")?(_=o.jsx(Y,{className:"sr-only",children:"Select model"}),e[23]=_):_=e[23];let v;e[24]!==I?(v=o.jsxs(Z,{className:"p-0 flex flex-col max-h-[95vh]",children:[_,o.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:I})]}),e[24]=I,e[25]=v):v=e[25];let T;return e[26]!==f||e[27]!==M||e[28]!==v?(T=o.jsxs(ee,{open:f,onOpenChange:k,children:[M,v]}),e[26]=f,e[27]=M,e[28]=v,e[29]=T):T=e[29],T}let S;e[30]!==C?(S=o.jsx(Q,{asChild:!0,children:C}),e[30]=C,e[31]=S):S=e[31];let N;e[32]===Symbol.for("react.memo_cache_sentinel")?(N=o.jsx(W,{className:"sr-only",children:"Select model"}),e[32]=N):N=e[32];let j;e[33]!==I?(j=o.jsxs(J,{className:"p-0 gap-0 sm:max-w-fit overflow-hidden h-[100dvh] sm:h-auto max-h-[100dvh] sm:max-h-[85vh] w-full max-w-full sm:max-w-fit rounded-none sm:rounded-xl border-0 sm:border",closeButtonClassName:"top-3.5 right-3.5 z-20",children:[N,I]}),e[33]=I,e[34]=j):j=e[34];let E;return e[35]!==f||e[36]!==S||e[37]!==j?(E=o.jsxs(K,{open:f,onOpenChange:k,children:[S,j]}),e[35]=f,e[36]=S,e[37]=j,e[38]=E):E=e[38],E}function xe(){}function ge(r){const e=D.c(4),{placeholder:t}=r,{selectedModel:s,isModelsLoading:i}=A();let l;return e[0]!==i||e[1]!==s||e[2]!==t?(l=o.jsx(U,{model:s,placeholder:t,isLoading:i}),e[0]=i,e[1]=s,e[2]=t,e[3]=l):l=e[3],l}export{ve as M};
@@ -0,0 +1 @@
1
+ import{c as T,j as t,r as Q,B as je,i as Se}from"./index-CXy6rN6i.js";import{i as be}from"./ChevronRight-BswIt99A.js";import{K as fe}from"./agent-icon-BjxA8YR3.js";import{S as ue}from"./scroll-area-DgIklajW.js";import{r as Ne,c as ke,u as _e,a as we,i as Ce,d as Te,f as Fe,P as Re,S as Ee}from"./page-seo-form-BcrUATEU.js";import{s as xe,p as ze}from"./index-CpgVJVWB.js";import{a as ge}from"./Tool01-Ci5EQ1tM.js";import"./AlertCircle-CM6D9elR.js";import"./SwitchHorizontal01-BL4xnvxO.js";import"./Settings02-QyYEyYyn.js";import"./XCircle-CmN6DNsv.js";import"./ArrowUpRight-Kqa5fEjt.js";import"./ZapSquare-D5x1wm0t.js";import"./Users03-BazvU-rC.js";import"./CheckCircle-8DKF8Yx5.js";import"./ChevronUp-DSdWQUoR.js";import"./ChevronDown-DGuR7uUZ.js";import"./DotsVertical-DSosYpI1.js";import"./Stars02-DVZm69DV.js";import"./Eye-Dn1AISrx.js";import"./ZoomOut-C0bVPfpC.js";import"./Globe01-CcXDI4W7.js";import"./FilterLines-CmWI-8pG.js";import"./Star01-GVe4t6O1.js";import"./Globe04-B9Btoycr.js";import"./HardDrive-BqXWgcmp.js";import"./Key01-F6-x7vNY.js";import"./LayoutLeft-DpqtgcH3.js";import"./LinkExternal01-DOU6-C1w.js";import"./Monitor01-SkSQUhmT.js";import"./Sun-B2ndPBZP.js";import"./Palette-CnoObDqZ.js";import"./Play-DzGcMRv3.js";import"./Plus-DDlkoJBs.js";import"./SearchLg-CdT_y89m.js";import"./SearchMd-UY2xUREv.js";import"./Shield01-V8b5EFFL.js";import"./Stars01-BIVPeWqS.js";import"./Trash01-Cc007jho.js";import"./Upload01-DB9meUjO.js";import"./User01-Dz-_mMMJ.js";import"./Users01-Ctg0iuAM.js";import"./XClose-BpreRuFP.js";import"./X-_dGiBqSn.js";import"./Zap-CWxLsQ6b.js";import"./use-clock-tick-7J301cSN.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-3aLRhzTZ.js";import"./tooltip-BRQCINXK.js";import"./file-type-icon-LHBbJJTG.js";import"./dialog-o7scRbG9.js";import"./use-mobile-DgvzRDzB.js";import"./tab-id-AX1D_RMI.js";import"./content-blocks-o63cs2vh.js";import"./types-ywta9rZ4.js";import"./use-mcp-client-CRWIqSWI.js";import"./auth-DraSXrC6.js";import"./chat-context-huSCeR82.js";import"./hooks-BUt6AoQh.js";import"./decopilot-sse-pool-Chmwc1_x.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-7AWl-thI.js";import"./use-collections-BhzLncHB.js";import"./use-ai-providers-CpUPA2Pj.js";import"./studio-tools-C-Eel15b.js";import"./use-decopilot-events-B8-U5_6h.js";import"./use-organization-settings-ClL7mSbK.js";import"./shell-layout-gi6XYvgE.js";import"./avatar-COMRxqae.js";import"./required-auth-layout-BzYoSj-D.js";import"./use-org-sso-kfQLtl8D.js";import"./sheet-BJF6qruz.js";import"./integration-icon-BSHD1Ijr.js";import"./use-navigate-to-agent-DTqeD3lq.js";import"./use-connection-CSQdDXlG.js";import"./use-mcp-prompts-BV9cBymv.js";import"./form-DX8cQ4SA.js";import"./label-CL8Vh65B.js";import"./input-BlhkemhH.js";import"./select-DM3pFFAV.js";import"./switch-DWXEjjcR.js";import"./index-CL3KBg-D.js";import"./drawer-B-Vy7tMY.js";import"./collection-search-CKMDHnku.js";import"./tabs-BeXAqCdo.js";import"./toggle-group-B6oTaI1f.js";import"./sortable.esm-DpWg8tde.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DIh-SIqT.js";import"./use-registry-connections-DzyhBLO8.js";import"./useInfiniteQuery-DbI8AV-k.js";import"./use-infinite-scroll-CkXtceVR.js";import"./extract-connection-data-BVX9Eneo.js";import"./card-Bys-wDTW.js";import"./collection-tabs-CWrBkWhe.js";import"./badge-B1dPfLuK.js";import"./textarea-C30KYfio.js";import"./connection-form-helpers-DV-bwjt7.js";import"./authenticate-and-persist-oauth-HBteAcVm.js";import"./mcp-oauth-CXj7zg3h.js";import"./useSuspenseInfiniteQuery-DT-JxV4F.js";import"./connect-desktop-dialog-CvuFk-NY.js";import"./decopilot-BxOK0Z8W.js";import"./checkbox-BIDlFz_0.js";import"./skeleton-CuVDGSZE.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-6b9w_VoZ.js";import"./popover-SD8gnUXm.js";import"./command-DrgMAh0a.js";import"./index-Cod7u1PQ.js";import"./use-org-fs-DI1Q1Ycz.js";import"./dropdown-menu-D-VNET4I.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-Agan4lHM.js";import"./task-status-CaQuE65s.js";import"./use-status-sounds-BsVH7G2F.js";import"./empty-state-1p_UpPHY.js";import"./toolbar-DuZrnshW.js";import"./index-CAV1BNai.js";import"./alert-dialog-DMWXmTGp.js";import"./use-debounced-value-BGsbVLHA.js";import"./index-DCwPnlYH.js";import"./toolbar-icon-button-CG8gWMNZ.js";import"./use-mcp-tools-Dgj65Z69.js";import"./use-capability-AkUZCu97.js";import"./tools-list-BSe55AC9.js";import"./use-debounced-autosave-DwyO4Yri.js";import"./index-BBTFoidO.js";import"./sidebar-BD77ZDQ1.js";import"./search-input-BwHA7yOt.js";import"./github-repo-picker-ZmfhFTO6.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-BX0N_3N-.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./automation-runs-BoQeZ1gh.js";import"./table-sXVKQ5vt.js";import"./use-members-BZOJ4ncQ.js";import"./use-org-auth-client-Dx974y4u.js";import"./use-automations-BSn8_z4p.js";import"./use-file-configs-XF2AvMPs.js";import"./monaco-editor-DBScTPL_.js";import"./select-model-C1odlJ1X.js";import"./automation-list-row-NZNZGrlr.js";function K(n){return typeof n=="string"&&n.trim()?n:void 0}function he(n,e){if(n){if(e)try{const i=new URL(n,e).href;return xe(i)}catch{return}return xe(n)}}function Pe(n){if(!n)return{};const e=K(n.title),i=K(n.titleTemplate);return{title:e&&i?.includes("%s")?i.replace(/%s/g,e):e,description:K(n.description),image:K(n.image),favicon:K(n.favicon)}}function Oe(n){if(!n)return"example.com";try{return new URL(n).host}catch{return"example.com"}}const Z="Your page title",ee="Your meta description will appear here.",Le=[{id:"google",label:"Google",color:"#4285F4",layout:"search"},{id:"facebook",label:"Facebook",color:"#1877F2",layout:"card"},{id:"twitter",label:"X (Twitter)",color:"#0f1419",layout:"card"},{id:"linkedin",label:"LinkedIn",color:"#0A66C2",layout:"card"},{id:"whatsapp",label:"WhatsApp",color:"#25D366",layout:"chat"},{id:"telegram",label:"Telegram",color:"#229ED9",layout:"chat"},{id:"slack",label:"Slack",color:"#611f69",layout:"attachment"},{id:"discord",label:"Discord",color:"#5865F2",layout:"attachment"}];function pe(n){const e=T.c(10),{src:i,className:r,iconSize:h}=n,a=h===void 0?20:h;if(i){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={objectFit:"cover"},e[0]=m):m=e[0];let p;return e[1]!==r||e[2]!==i?(p=t.jsx("img",{src:i,alt:"",referrerPolicy:"no-referrer",className:r,style:m}),e[1]=r,e[2]=i,e[3]=p):p=e[3],p}let s;e[4]===Symbol.for("react.memo_cache_sentinel")?(s={display:"flex",alignItems:"center",justifyContent:"center",background:"#e5e7eb",color:"#9ca3af"},e[4]=s):s=e[4];let o;e[5]!==a?(o=t.jsx(ge,{size:a}),e[5]=a,e[6]=o):o=e[6];let l;return e[7]!==r||e[8]!==o?(l=t.jsx("div",{className:r,style:s,children:o}),e[7]=r,e[8]=o,e[9]=l):l=e[9],l}function $e(n){const e=T.c(27),{seo:i,host:r,path:h}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={background:"#fff",border:"1px solid #dadce0"},e[0]=a):a=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s={background:"#f1f3f4"},e[1]=s):s=e[1];let o;e[2]!==i.favicon?(o=t.jsx("div",{className:"flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-full",style:s,children:i.favicon?t.jsx("img",{src:i.favicon,alt:"",className:"size-full object-cover"}):t.jsx(ge,{size:12,color:"#9aa0a6"})}),e[2]=i.favicon,e[3]=o):o=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l={color:"#202124"},e[4]=l):l=e[4];let m;e[5]!==r?(m=t.jsx("div",{className:"truncate text-[13px] leading-tight",style:l,children:r}),e[5]=r,e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#4d5156"},e[7]=p):p=e[7];let d;e[8]!==r||e[9]!==h?(d=t.jsxs("div",{className:"truncate text-[12px] leading-tight",style:p,children:[r,h]}),e[8]=r,e[9]=h,e[10]=d):d=e[10];let c;e[11]!==m||e[12]!==d?(c=t.jsxs("div",{className:"min-w-0",children:[m,d]}),e[11]=m,e[12]=d,e[13]=c):c=e[13];let g;e[14]!==o||e[15]!==c?(g=t.jsxs("div",{className:"flex items-center gap-2",children:[o,c]}),e[14]=o,e[15]=c,e[16]=g):g=e[16];let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f={color:"#1a0dab"},e[17]=f):f=e[17];const x=i.title??Z;let u;e[18]!==x?(u=t.jsx("div",{className:"mt-1.5 truncate text-[18px] leading-snug",style:f,children:x}),e[18]=x,e[19]=u):u=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j={color:"#4d5156"},e[20]=j):j=e[20];const v=i.description??ee;let y;e[21]!==v?(y=t.jsx("div",{className:"mt-0.5 line-clamp-2 text-[13px] leading-snug",style:j,children:v}),e[21]=v,e[22]=y):y=e[22];let S;return e[23]!==u||e[24]!==y||e[25]!==g?(S=t.jsxs("div",{className:"rounded-lg p-3 text-left",style:a,children:[g,u,y]}),e[23]=u,e[24]=y,e[25]=g,e[26]=S):S=e[26],S}function De(n){const e=T.c(20),{seo:i,host:r}=n;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={background:"#fff",border:"1px solid #e2e8f0"},e[0]=h):h=e[0];let a;e[1]!==i.image?(a=t.jsx(pe,{src:i.image,className:"h-40 w-full"}),e[1]=i.image,e[2]=a):a=e[2];let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s={borderTop:"1px solid #e2e8f0"},e[3]=s):s=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o={color:"#8a9099"},e[4]=o):o=e[4];let l;e[5]!==r?(l=t.jsx("div",{className:"truncate text-[11px]",style:o,children:r}),e[5]=r,e[6]=l):l=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m={color:"#1c2024"},e[7]=m):m=e[7];const p=i.title??Z;let d;e[8]!==p?(d=t.jsx("div",{className:"line-clamp-1 text-[14px] font-semibold",style:m,children:p}),e[8]=p,e[9]=d):d=e[9];let c;e[10]===Symbol.for("react.memo_cache_sentinel")?(c={color:"#60666c"},e[10]=c):c=e[10];const g=i.description??ee;let f;e[11]!==g?(f=t.jsx("div",{className:"line-clamp-2 text-[12px]",style:c,children:g}),e[11]=g,e[12]=f):f=e[12];let x;e[13]!==f||e[14]!==l||e[15]!==d?(x=t.jsxs("div",{className:"px-3 py-2",style:s,children:[l,d,f]}),e[13]=f,e[14]=l,e[15]=d,e[16]=x):x=e[16];let u;return e[17]!==x||e[18]!==a?(u=t.jsxs("div",{className:"overflow-hidden rounded-lg text-left",style:h,children:[a,x]}),e[17]=x,e[18]=a,e[19]=u):u=e[19],u}function Ie(n){const e=T.c(23),{seo:i,host:r,accent:h}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={background:"#f0f2f5"},e[0]=a):a=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("p",{className:"px-1 pb-1.5 text-[12px]",style:{color:"#3b4045"},children:"Here's a post you might write with the link of your website:"}),e[1]=s):s=e[1];const o=`3px solid ${h}`;let l;e[2]!==o?(l={background:"#fff",borderLeft:o},e[2]=o,e[3]=l):l=e[3];let m;e[4]!==i.image?(m=t.jsx(pe,{src:i.image,className:"h-28 w-full",iconSize:18}),e[4]=i.image,e[5]=m):m=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#1c2024"},e[6]=p):p=e[6];const d=i.title??Z;let c;e[7]!==d?(c=t.jsx("div",{className:"line-clamp-1 text-[12px] font-semibold",style:p,children:d}),e[7]=d,e[8]=c):c=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g={color:"#60666c"},e[9]=g):g=e[9];const f=i.description??ee;let x;e[10]!==f?(x=t.jsx("div",{className:"line-clamp-2 text-[11px]",style:g,children:f}),e[10]=f,e[11]=x):x=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u={color:"#8a9099"},e[12]=u):u=e[12];let j;e[13]!==r?(j=t.jsx("div",{className:"mt-0.5 text-[10px]",style:u,children:r}),e[13]=r,e[14]=j):j=e[14];let v;e[15]!==x||e[16]!==j||e[17]!==c?(v=t.jsxs("div",{className:"px-2.5 py-1.5",children:[c,x,j]}),e[15]=x,e[16]=j,e[17]=c,e[18]=v):v=e[18];let y;return e[19]!==v||e[20]!==l||e[21]!==m?(y=t.jsxs("div",{className:"rounded-lg p-2 text-left",style:a,children:[s,t.jsxs("div",{className:"overflow-hidden rounded-md",style:l,children:[m,v]})]}),e[19]=v,e[20]=l,e[21]=m,e[22]=y):y=e[22],y}function Ae(n){const e=T.c(33),{seo:i,host:r,accent:h,dark:a}=n,s=a?"#2b2d31":"#fff",o=a?"#00a8fc":"#1264a3",l=a?"#dbdee1":"#3b4045",m=a?"#949ba4":"#8a9099",p=a?"none":"1px solid #e2e8f0";let d;e[0]!==s||e[1]!==p?(d={background:s,border:p},e[0]=s,e[1]=p,e[2]=d):d=e[2];const c=`3px solid ${h}`;let g;e[3]!==c?(g={borderLeft:c,borderRadius:2},e[3]=c,e[4]=g):g=e[4];let f;e[5]!==m?(f={color:m},e[5]=m,e[6]=f):f=e[6];let x;e[7]!==r||e[8]!==f?(x=t.jsx("div",{className:"text-[10px]",style:f,children:r}),e[7]=r,e[8]=f,e[9]=x):x=e[9];let u;e[10]!==o?(u={color:o},e[10]=o,e[11]=u):u=e[11];const j=i.title??Z;let v;e[12]!==u||e[13]!==j?(v=t.jsx("div",{className:"line-clamp-1 text-[13px] font-semibold",style:u,children:j}),e[12]=u,e[13]=j,e[14]=v):v=e[14];let y;e[15]!==l?(y={color:l},e[15]=l,e[16]=y):y=e[16];const S=i.description??ee;let _;e[17]!==y||e[18]!==S?(_=t.jsx("div",{className:"line-clamp-2 text-[12px]",style:y,children:S}),e[17]=y,e[18]=S,e[19]=_):_=e[19];let N;e[20]!==_||e[21]!==x||e[22]!==v?(N=t.jsxs("div",{className:"min-w-0 flex-1",children:[x,v,_]}),e[20]=_,e[21]=x,e[22]=v,e[23]=N):N=e[23];let b;e[24]!==i.image?(b=t.jsx(pe,{src:i.image,className:"size-14 shrink-0 rounded",iconSize:16}),e[24]=i.image,e[25]=b):b=e[25];let k;e[26]!==N||e[27]!==b||e[28]!==g?(k=t.jsxs("div",{className:"flex gap-2.5 pl-2.5",style:g,children:[N,b]}),e[26]=N,e[27]=b,e[28]=g,e[29]=k):k=e[29];let C;return e[30]!==k||e[31]!==d?(C=t.jsx("div",{className:"rounded-lg p-2.5 text-left",style:d,children:k}),e[30]=k,e[31]=d,e[32]=C):C=e[32],C}function Be(n){const e=T.c(17),{platform:i,seo:r,host:h,path:a}=n;let s;e[0]!==h||e[1]!==a||e[2]!==i.color||e[3]!==i.id||e[4]!==i.layout||e[5]!==r?(s=i.layout==="search"?t.jsx($e,{seo:r,host:h,path:a}):i.layout==="card"?t.jsx(De,{seo:r,host:h,path:a}):i.layout==="chat"?t.jsx(Ie,{seo:r,host:h,path:a,accent:i.color}):t.jsx(Ae,{seo:r,host:h,path:a,accent:i.color,dark:i.id==="discord"}),e[0]=h,e[1]=a,e[2]=i.color,e[3]=i.id,e[4]=i.layout,e[5]=r,e[6]=s):s=e[6];const o=s;let l;e[7]!==i.color?(l=t.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{background:i.color}}),e[7]=i.color,e[8]=l):l=e[8];let m;e[9]!==i.label?(m=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:i.label}),e[9]=i.label,e[10]=m):m=e[10];let p;e[11]!==l||e[12]!==m?(p=t.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5",children:[l,m]}),e[11]=l,e[12]=m,e[13]=p):p=e[13];let d;return e[14]!==o||e[15]!==p?(d=t.jsxs("div",{children:[p,o]}),e[14]=o,e[15]=p,e[16]=d):d=e[16],d}function Ke(n){const e=T.c(17),{seo:i,url:r,path:h}=n,a=h===void 0?"/":h;let s,o,l;if(e[0]!==i||e[1]!==r){const u=Pe(i);s=u,o=he(u.image,r),l=he(u.favicon,r),e[0]=i,e[1]=r,e[2]=s,e[3]=o,e[4]=l}else s=e[2],o=e[3],l=e[4];let m;e[5]!==s||e[6]!==o||e[7]!==l?(m={...s,image:o,favicon:l},e[5]=s,e[6]=o,e[7]=l,e[8]=m):m=e[8];const p=m;let d;e[9]!==r?(d=Oe(r),e[9]=r,e[10]=d):d=e[10];const c=d,g=a==="/"?"":a;let f;e[11]!==g||e[12]!==c||e[13]!==p?(f=Le.map(u=>t.jsx(Be,{platform:u,seo:p,host:c,path:g},u.id)),e[11]=g,e[12]=c,e[13]=p,e[14]=f):f=e[14];let x;return e[15]!==f?(x=t.jsx("div",{className:"grid grid-cols-1 gap-4 @2xl:grid-cols-2",children:f}),e[15]=f,e[16]=x):x=e[16],x}function Fi(n){const e=T.c(63),{orgSlug:i,virtualMcpId:r,branch:h,decofile:a,meta:s,target:o,previewBaseUrl:l,onSaved:m,onEditDefaultSeo:p,onBack:d}=n,c=Ne(a,o,s),g=c?.seoData,f=o.kind==="site"?"site":o.pageKey,[x,u]=Q.useState(f),[j,v]=Q.useState(null),[y,S]=Q.useState(0),[_,N]=Q.useState(void 0);x!==f&&(u(f),v(null),N(void 0),S(Me));const{persistSeo:b,persistRawSeo:k,flush:C,isPending:te}=ke({orgSlug:i,virtualMcpId:r,branch:h,target:o,resolved:c,onSaved:m}),U=o.kind==="page",ve=U?c?.rawSeoData:void 0,B=_!==void 0?_:ve,ye=U?_e(B)??void 0:void 0,w=j??ye??g??{},F=c?we(w,c):null,z=F&&(!U||Ce(B))?ze(F,s):null;let M;e[0]!==s?(M=Te(s),e[0]=s,e[1]=M):M=e[1];const oe=M;let R,G;e[2]!==a||e[3]!==w||e[4]!==s||e[5]!==o.kind?(R=o.kind==="page"?Fe(a,s)?.seoData??{}:{},G=o.kind==="page"?Ve(R,w):w,e[2]=a,e[3]=w,e[4]=s,e[5]=o.kind,e[6]=R,e[7]=G):(R=e[6],G=e[7]);const ie=G;let V;e[8]!==b||e[9]!==c||e[10]!==v?(V=E=>{if(!c)return;const de=E;v(de),b(de)},e[8]=b,e[9]=c,e[10]=v,e[11]=V):V=e[11];const se=V;let Y;e[12]!==v?(Y=()=>v(null),e[12]=v,e[13]=Y):Y=e[13];const le=Y;let H;e[14]!==S?(H=()=>S(Ue),e[14]=S,e[15]=H):H=e[15];const re=H;let W;e[16]!==C||e[17]!==d?(W=()=>{C(),d?.()},e[16]=C,e[17]=d,e[18]=W):W=e[18];const ae=W,P=o.kind==="page"?o.path:"/";let X;e[19]!==P||e[20]!==l||e[21]!==o.kind?(X=o.kind==="page"&&l?Ge(P,l):l??null,e[19]=P,e[20]=l,e[21]=o.kind,e[22]=X):X=e[22];const ne=X,ce=o.kind==="site"?"No site-level SEO block found.":c?"SEO schema not found for this page.":"Could not load page SEO.",q=U&&c,me=o.kind==="site"&&c&&z;let O;e[23]!==ae||e[24]!==o.kind||e[25]!==o.pageName?(O=o.kind==="page"?t.jsxs("nav",{className:"flex min-w-0 items-center gap-1 text-sm",children:[t.jsx("button",{type:"button",onClick:ae,title:o.pageName,className:"min-w-0 truncate rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:o.pageName}),t.jsx(be,{className:"size-3 shrink-0 text-muted-foreground/60"}),t.jsx("span",{className:"px-1 py-0.5 font-medium text-foreground",children:"SEO"})]}):t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(fe,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("span",{className:"text-sm font-medium",children:"Default SEO"}),t.jsx("span",{className:"hidden truncate text-xs text-muted-foreground sm:inline",children:"· applied to every page unless overridden"})]}),e[23]=ae,e[24]=o.kind,e[25]=o.pageName,e[26]=O):O=e[26];let L;e[27]!==te?(L=te&&t.jsx(Se,{size:14,className:"animate-spin text-muted-foreground"}),e[27]=te,e[28]=L):L=e[28];let $;e[29]!==p||e[30]!==o.kind?($=o.kind==="page"&&p&&t.jsxs(je,{type:"button",variant:"outline",size:"sm",onClick:p,children:[t.jsx(fe,{size:14}),"Edit default SEO"]}),e[29]=p,e[30]=o.kind,e[31]=$):$=e[31];let D;e[32]!==$||e[33]!==L?(D=t.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[L,$]}),e[32]=$,e[33]=L,e[34]=D):D=e[34];let I;e[35]!==D||e[36]!==O?(I=t.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[O,D]}),e[35]=D,e[36]=O,e[37]=I):I=e[37];let A;e[38]!==F||e[39]!==re||e[40]!==le||e[41]!==oe||e[42]!==B||e[43]!==w||e[44]!==ce||e[45]!==y||e[46]!==se||e[47]!==P||e[48]!==k||e[49]!==b||e[50]!==ie||e[51]!==ne||e[52]!==c||e[53]!==z||e[54]!==v||e[55]!==N||e[56]!==q||e[57]!==me||e[58]!==R?(A=!c||!q&&!me?t.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center text-sm text-muted-foreground",children:ce}):t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsx(ue,{className:"w-full max-w-md shrink-0 border-r [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"px-5 py-4",children:q?t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:"Empty fields inherit the default SEO. The preview shows the resolved result."}),t.jsx(Re,{rawSeo:B,innerSeo:w,defaultResolveType:oe,seoSchema:z,activeResolveType:F,seoTypeOptions:c.seoTypeOptions,formResetKey:y,siteDefaultSeo:R,onPersistRaw:E=>{N(E),k(E)},onInnerChange:E=>{v(E),b(E)},onClearForm:le,onBumpFormKey:re})]}):z&&F&&t.jsx(Ee,{schema:z,resolveType:F,value:w,formResetKey:y,onChange:se})})}),t.jsx(ue,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"@container px-5 py-4",children:t.jsx(Ke,{seo:ie,url:ne,path:P})})})]}),e[38]=F,e[39]=re,e[40]=le,e[41]=oe,e[42]=B,e[43]=w,e[44]=ce,e[45]=y,e[46]=se,e[47]=P,e[48]=k,e[49]=b,e[50]=ie,e[51]=ne,e[52]=c,e[53]=z,e[54]=v,e[55]=N,e[56]=q,e[57]=me,e[58]=R,e[59]=A):A=e[59];let J;return e[60]!==I||e[61]!==A?(J=t.jsxs("div",{className:"flex h-full w-full flex-col",children:[I,A]}),e[60]=I,e[61]=A,e[62]=J):J=e[62],J}function Ue(n){return n+1}function Me(n){return n+1}function Ge(n,e){try{return new URL(n,e).href}catch{return e}}function Ve(n,e){const i=e.__resolveType,r=n.__resolveType;if(typeof i=="string"&&typeof r=="string"&&i!==r)return{...e};const h={...n};for(const[a,s]of Object.entries(e))a!=="__resolveType"&&s!=null&&(typeof s=="string"&&s.trim()===""||(h[a]=s));return h}export{Fi as SeoEditor};
@@ -0,0 +1 @@
1
+ import{c as S,e as R,j as s,D as H,l as k,ae as J,G as L,v as B,P as G,a as I,i as Q,r as F,O as K}from"./index-CXy6rN6i.js";import{u as T,S as U,M as V}from"./shell-controls-C9tE75mS.js";import{j as X,k as Y,l as Z,b as q,c as w,d as P,S as M,a as O,f as ee,g as se}from"./sidebar-BD77ZDQ1.js";import{a as te}from"./index-BBTFoidO.js";import{n as le,b as re,a as ie,c as oe,d as ne,i as E}from"./ZapSquare-D5x1wm0t.js";import{t as ae,a as A}from"./Users03-BazvU-rC.js";import{i as ce}from"./HardDrive-BqXWgcmp.js";import{i as me}from"./Key01-F6-x7vNY.js";import{i as fe}from"./Shield01-V8b5EFFL.js";import{s as de}from"./User01-Dz-_mMMJ.js";import{i as xe}from"./Zap-CWxLsQ6b.js";import{a as be}from"./use-capability-AkUZCu97.js";import{a as ue}from"./use-join-requests-mfteqXVe.js";import{u as W}from"./use-mobile-DgvzRDzB.js";import{u as he}from"./use-status-sounds-BsVH7G2F.js";import{T as y}from"./toolbar-DuZrnshW.js";import"./sheet-BJF6qruz.js";import"./X-_dGiBqSn.js";import"./LayoutLeft-DpqtgcH3.js";import"./toolbar-icon-button-CG8gWMNZ.js";import"./tooltip-BRQCINXK.js";import"./studio-tools-C-Eel15b.js";import"./question-004-sINsf4GQ.js";import"./use-decopilot-events-B8-U5_6h.js";import"./decopilot-sse-pool-Chmwc1_x.js";import"./backoff-CrEUbyZT.js";function D(){const e=S.c(21),{capabilities:t,isPrivileged:m,loading:l,error:i}=be(),o=ue().length;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ae,{size:14}),e[0]=n):n=e[0];let r,a;if(e[1]!==t||e[2]!==i||e[3]!==m||e[4]!==o||e[5]!==l){a=Symbol.for("react.early_return_sentinel");e:{let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(le,{size:14}),e[8]=f):f=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(re,{size:14}),e[9]=d):d=e[9];let c;e[10]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(me,{size:14}),e[10]=c):c=e[10];let x;e[11]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(ce,{size:14}),e[11]=x):x=e[11];let b;e[12]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(ie,{size:14}),e[12]=b):b=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(A,{size:14}),e[13]=p):p=e[13];let h;e[14]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(xe,{size:14}),e[14]=h):h=e[14];let g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(oe,{size:14}),e[15]=g):g=e[15];let u;e[16]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(ne,{size:14}),e[16]=u):u=e[16];let _;e[17]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(A,{size:14}),e[17]=_):_=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(fe,{size:14}),e[18]=j):j=e[18];let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(J,{size:14}),e[19]=v):v=e[19];let N;e[20]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(de,{size:14}),e[20]=N):N=e[20];const z=[{label:"Organization",items:[{key:"general",label:"General",icon:n,to:"/$org/settings/general",requires:"org:manage"},{key:"brand-context",label:"Brand Context",icon:f,to:"/$org/settings/brand-context",requires:"org:manage"},{key:"ai-providers",label:"AI Providers",icon:d,to:"/$org/settings/ai-providers",requires:"ai-providers:manage"},{key:"secrets",label:"Secrets",icon:c,to:"/$org/settings/secrets",requires:"secrets:manage"},{key:"buckets",label:"Buckets",icon:x,to:"/$org/settings/buckets",requires:"file-configs:manage"}]},{label:"Build",items:[{key:"connections",label:"Connections",icon:b,to:"/$org/settings/connections"},{key:"agents",label:"Agents",icon:p,to:"/$org/settings/agents"},{key:"automations",label:"Automations",icon:h,to:"/$org/settings/automations",requires:"automations:manage"},{key:"store",label:"Store",icon:g,to:"/$org/settings/store",requires:"registry:manage"}]},{label:"Manage",items:[{key:"monitor",label:"Monitor",icon:u,to:"/$org/settings/monitor",requires:"monitoring:view"},{key:"members",label:"Members",icon:_,to:"/$org/settings/members",requires:"members:manage",badge:o},{key:"roles",label:"Roles",icon:j,to:"/$org/settings/roles",privilegedOnly:!0},{key:"sso",label:"Security",icon:v,to:"/$org/settings/sso",requires:"org:manage"}]},{label:"Account",items:[{key:"profile",label:"Profile & Preferences",icon:N,to:"/$org/settings/profile"}]}];if(l||i){a=z;break e}r=z.map(C=>({...C,items:C.items.filter($=>$.privilegedOnly?m:$.requires?m||t[$.requires]:!0)})).filter(pe)}e[1]=t,e[2]=i,e[3]=m,e[4]=o,e[5]=l,e[6]=r,e[7]=a}else r=e[6],a=e[7];return a!==Symbol.for("react.early_return_sentinel")?a:r}function pe(e){return e.items.length>0}function ge(){const e=S.c(19),t=D();let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={from:"/shell/$org"},e[0]=m):m=e[0];const{org:l}=R(m);let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={select:_e},e[1]=i):i=e[1];const o=T(i);let n;e[2]!==l||e[3]!==o?(n=p=>{const h=p.replace("$org",l);return o.startsWith(h)},e[2]=l,e[3]=o,e[4]=n):n=e[4];const r=n;let a;if(e[5]!==t||e[6]!==r||e[7]!==l){let p;e[9]!==r||e[10]!==l?(p=(h,g)=>s.jsxs(q,{className:"pt-0 pr-0 pb-0 pl-0",children:[h.label&&s.jsx("p",{className:k("px-2 pt-1.5 pb-0.5 text-xs font-medium text-muted-foreground/60",g>0&&"mt-3"),children:h.label}),s.jsx(w,{children:s.jsx(P,{className:"gap-0.5",children:h.items.map(u=>s.jsx(M,{children:s.jsx(O,{asChild:!0,isActive:r(u.to),children:s.jsxs(L,{to:u.to,params:{org:l},onClick:()=>B("settings_nav_clicked",{section_key:u.key,section_label:u.label,group_label:h.label||"main"}),className:"flex items-center gap-2.5 text-sm",children:[s.jsxs("span",{className:"relative shrink-0",children:[u.icon,u.badge?s.jsx("span",{className:"absolute -right-1 -top-1 size-2 rounded-full bg-red-500 pointer-events-none"}):null]}),s.jsx("span",{className:"truncate",children:u.label})]})})},u.key))})})]},`${h.label}-${g}`),e[9]=r,e[10]=l,e[11]=p):p=e[11],a=t.map(p),e[5]=t,e[6]=r,e[7]=l,e[8]=a}else a=e[8];let f;e[12]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"mx-2 my-2 border-t border-border/50"}),e[12]=f):f=e[12];let d;e[13]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs(q,{className:"pt-0 pr-0 pb-0 pl-0",children:[f,s.jsx(w,{children:s.jsx(P,{className:"gap-0.5",children:s.jsx(M,{children:s.jsxs(O,{onClick:je,className:"flex items-center gap-2.5 text-sm",children:[s.jsx("span",{className:"shrink-0",children:s.jsx(E,{size:14})}),s.jsx("span",{className:"truncate",children:"Sign Out"})]})})})})]}),e[13]=d):d=e[13];let c;e[14]!==a?(c=s.jsxs(ee,{className:"flex flex-col flex-1 mt-2 px-2 pb-2 gap-0 overflow-y-auto",children:[a,d]}),e[14]=a,e[15]=c):c=e[15];let x;e[16]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("div",{className:"mt-auto px-4 pb-1",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","4.4.0"]})}),e[16]=x):x=e[16];let b;return e[17]!==c?(b=s.jsxs(se,{variant:"sidebar",children:[c,x]}),e[17]=c,e[18]=b):b=e[18],b}function je(){B("signed_out",{source:"settings_sidebar"}),G(),I.signOut()}function _e(e){return e.location.pathname}function ye(e){const t=S.c(21),{onClose:m}=e,l=D();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org"},t[0]=i):i=t[0];const{org:o}=R(i);let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n={select:ve},t[1]=n):n=t[1];const r=T(n);let a;t[2]!==o||t[3]!==r?(a=g=>{const u=g.replace("$org",o);return r.startsWith(u)},t[2]=o,t[3]=r,t[4]=a):a=t[4];const f=a;let d;if(t[5]!==l||t[6]!==f||t[7]!==m||t[8]!==o){let g;t[10]!==f||t[11]!==m||t[12]!==o?(g=(u,_)=>s.jsxs("div",{className:"flex flex-col gap-0.5",children:[u.label&&s.jsx("p",{className:k("px-3 pt-1.5 pb-0.5 text-xs font-medium text-muted-foreground/60",_>0&&"mt-3"),children:u.label}),u.items.map(j=>s.jsxs(L,{to:j.to,params:{org:o},onClick:m,className:k("flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm",f(j.to)?"bg-sidebar-accent text-sidebar-accent-foreground font-medium":"text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground"),children:[s.jsxs("span",{className:"relative shrink-0",children:[j.icon,j.badge?s.jsx("span",{className:"absolute -right-1 -top-1 size-2 rounded-full bg-red-500 pointer-events-none"}):null]}),s.jsx("span",{className:"truncate",children:j.label})]},j.key))]},`${u.label}-${_}`),t[10]=f,t[11]=m,t[12]=o,t[13]=g):g=t[13],d=l.map(g),t[5]=l,t[6]=f,t[7]=m,t[8]=o,t[9]=d}else d=t[9];let c;t[14]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"h-px bg-border/50 my-2"}),t[14]=c):c=t[14];let x;t[15]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[c,s.jsxs("button",{type:"button",onClick:Se,className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx("span",{className:"shrink-0",children:s.jsx(E,{size:14})}),s.jsx("span",{className:"truncate",children:"Sign Out"})]})]}),t[15]=x):x=t[15];let b;t[16]!==d?(b=s.jsxs("div",{className:"flex flex-col flex-1 overflow-y-auto px-2 py-2 gap-0.5",children:[d,x]}),t[16]=d,t[17]=b):b=t[17];let p;t[18]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("div",{className:"px-4 pb-3 pt-1 border-t border-border/50",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","4.4.0"]})}),t[18]=p):p=t[18];let h;return t[19]!==b?(h=s.jsxs("div",{className:"flex flex-col h-full bg-sidebar",children:[b,p]}),t[19]=b,t[20]=h):h=t[20],h}function Se(){G(),I.signOut()}function ve(e){return e.location.pathname}function Ne(){const e=S.c(4),t=W(),{org:m}=H();he(m.slug);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx(Q,{size:20,className:"animate-spin text-muted-foreground"})}),e[0]=l):l=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(F.Suspense,{fallback:l,children:s.jsx("div",{className:"flex flex-1 items-center overflow-hidden rounded-[inherit]",children:s.jsx(te,{value:"p-0",children:s.jsx("div",{className:"flex-1 min-w-0 overflow-hidden h-full",children:s.jsx(K,{})})})})}),e[1]=i):i=e[1];const o=i;if(t){let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex flex-col flex-1 bg-background min-h-0 overflow-hidden",children:o}),e[2]=r):r=e[2],r}let n;return e[3]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"flex-1 min-h-0 p-1",children:s.jsx("div",{className:k("flex flex-col h-full min-h-0 bg-background overflow-hidden","card-shadow","rounded-[0.75rem]"),children:o})}),e[3]=n):n=e[3],n}function Ye(){const e=S.c(21),t=W();let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(y.LogoLink,{}),e[0]=m):m=e[0];let l;e[1]!==t?(l=t&&s.jsx(U,{}),e[1]=t,e[2]=l):l=e[2];let i;e[3]!==l?(i=s.jsxs(y.LeftColumn,{children:[m,l]}),e[3]=l,e[4]=i):i=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(y.CenterSlot,{}),e[5]=o):o=e[5];let n;e[6]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(y.RightColumn,{children:s.jsx("span",{})}),e[6]=n):n=e[6];let r;e[7]!==i?(r=s.jsxs(y.Header,{children:[i,o,n]}),e[7]=i,e[8]=r):r=e[8];let a;e[9]===Symbol.for("react.memo_cache_sentinel")?(a={"--sidebar-width-icon":"3.5rem"},e[9]=a):a=e[9];let f;e[10]!==t?(f=!t&&s.jsx(ge,{}),e[10]=t,e[11]=f):f=e[11];let d;e[12]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(X,{className:"flex flex-col",style:{background:"transparent",containerType:"inline-size"},children:s.jsx(Ne,{})}),e[12]=d):d=e[12];let c;e[13]!==f?(c=s.jsxs(Y,{className:"flex-1 bg-sidebar min-h-0",style:a,children:[f,d]}),e[13]=f,e[14]=c):c=e[14];let x;e[15]!==t?(x=t&&s.jsx(V,{renderSidebar:ke}),e[15]=t,e[16]=x):x=e[16];let b;return e[17]!==x||e[18]!==r||e[19]!==c?(b=s.jsx(y.Provider,{children:s.jsx(Z,{defaultOpen:!0,children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[r,c,x]})})}),e[17]=x,e[18]=r,e[19]=c,e[20]=b):b=e[20],b}function ke(e){const{onClose:t}=e;return s.jsx(ye,{onClose:t})}export{ge as SettingsSidebar,ye as SettingsSidebarMobile,Ye as default};