decocms 4.125.5 → 4.126.1

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 (269) hide show
  1. package/dist/client/assets/{AlertCircle-1e3-NcEA.js → AlertCircle-Cpl_iMHY.js} +1 -1
  2. package/dist/client/assets/{AreaChart-CB1-fSKl.js → AreaChart-BqFUuFcm.js} +1 -1
  3. package/dist/client/assets/{ArrowRight-B-wHAJWT.js → ArrowRight-NqG0gPh-.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-DI1fyC1G.js → ArrowUp-DMJUikwr.js} +1 -1
  5. package/dist/client/assets/{ArrowUpRight-BWyzrLQV.js → ArrowUpRight-CtURRnV0.js} +1 -1
  6. package/dist/client/assets/{Check-LKA0FKR0.js → Check-dpauEaNI.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-Dh-3VdHB.js → CheckCircle-zW46MQTo.js} +1 -1
  8. package/dist/client/assets/{ChevronDown-B3fDqERa.js → ChevronDown-BQLnN9E6.js} +1 -1
  9. package/dist/client/assets/{ChevronRight-Dkp8mDOd.js → ChevronRight-CyiD6-MW.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-Cm7VcWLZ.js → ChevronUp-DQvrAigY.js} +1 -1
  11. package/dist/client/assets/{Copy01-uQh3Q5Fv.js → Copy01-DDeCwAgK.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-DKanPfz6.js → DotsVertical-Bj4PS0aF.js} +1 -1
  13. package/dist/client/assets/{Eye-SCLKEZSh.js → Eye-Dfg-461O.js} +1 -1
  14. package/dist/client/assets/{FilterLines-13dE_TWB.js → FilterLines-CxHovx4d.js} +1 -1
  15. package/dist/client/assets/{HardDrive-DViLU95V.js → HardDrive-C67jRlzv.js} +1 -1
  16. package/dist/client/assets/{Key01-CgioJ7nW.js → Key01-D7-mKS4d.js} +1 -1
  17. package/dist/client/assets/{LayoutLeft-Yz5NzG-w.js → LayoutLeft-Dnk9I__a.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-Di_tOfr7.js → LinkExternal01-DtG8qR-V.js} +1 -1
  19. package/dist/client/assets/{LogOut01-r12Fp93g.js → LogOut01-Bv49wu0L.js} +1 -1
  20. package/dist/client/assets/{Monitor01-C_dYkXdo.js → Monitor01-DEsYEg9j.js} +1 -1
  21. package/dist/client/assets/Palette-3AyXb_ds.js +1 -0
  22. package/dist/client/assets/{Play-CVGtm9ao.js → Play-C5qDNLgC.js} +1 -1
  23. package/dist/client/assets/{Plus-CLG5QKCr.js → Plus-C7p4TBsq.js} +1 -1
  24. package/dist/client/assets/{SearchLg-CkXJjhdf.js → SearchLg-BP6dxoOu.js} +1 -1
  25. package/dist/client/assets/{SearchMd-DBj7HhoW.js → SearchMd-CFZ8th88.js} +1 -1
  26. package/dist/client/assets/{Settings02-BIGi-T7s.js → Settings02-BRYke4o3.js} +1 -1
  27. package/dist/client/assets/{Shield01-ksb0VZpA.js → Shield01-DObW8vGC.js} +1 -1
  28. package/dist/client/assets/{Star01-lWHLfmir.js → Star01-b06OrJx9.js} +1 -1
  29. package/dist/client/assets/{Stars01-B3jznQQ4.js → Stars01-CwezkrCj.js} +1 -1
  30. package/dist/client/assets/{Stars02-DpsxkqJO.js → Stars02-CV1WX5s1.js} +1 -1
  31. package/dist/client/assets/{Sun-tOsjvEis.js → Sun-BYgqmEv8.js} +1 -1
  32. package/dist/client/assets/{SwitchHorizontal01-Dw_LQc0f.js → SwitchHorizontal01-D9GLmxcG.js} +1 -1
  33. package/dist/client/assets/Tool01-CbNqThfz.js +1 -0
  34. package/dist/client/assets/Tool02-BK6vOVj2.js +1 -0
  35. package/dist/client/assets/{Trash01-CWIa_mDx.js → Trash01-CZfSiRn_.js} +1 -1
  36. package/dist/client/assets/{TrendUp01-CYCVS1zr.js → TrendUp01-CbzGmSk7.js} +1 -1
  37. package/dist/client/assets/{Upload01-CPD95nN4.js → Upload01-OvmEXaXy.js} +1 -1
  38. package/dist/client/assets/{User01-NxrNjn_h.js → User01-mA16LPDW.js} +1 -1
  39. package/dist/client/assets/{Users01-DvtVVxdG.js → Users01-D3kMDHBl.js} +1 -1
  40. package/dist/client/assets/{Users03-3lwc9liE.js → Users03-CMTgzssO.js} +1 -1
  41. package/dist/client/assets/{X-BYXAQs6v.js → X-Ds6dL0ec.js} +1 -1
  42. package/dist/client/assets/{XCircle-B3aYrCCW.js → XCircle-Bw2f1-oB.js} +1 -1
  43. package/dist/client/assets/{XClose-CW0R6bEe.js → XClose-CggKQboo.js} +1 -1
  44. package/dist/client/assets/{Zap-CrMVm5NK.js → Zap-cm7wIsil.js} +1 -1
  45. package/dist/client/assets/{ZapSquare-DGe1cTc7.js → ZapSquare-CULLx7Oa.js} +1 -1
  46. package/dist/client/assets/{access-gate-D11_1kHO.js → access-gate-B5Uu6KI_.js} +1 -1
  47. package/dist/client/assets/{add-section-modal-NM4MqPkB.js → add-section-modal-C0j8sHqV.js} +1 -1
  48. package/dist/client/assets/agent-icon-ZuDh9-Hb.js +1 -0
  49. package/dist/client/assets/agents-list-BwHTZnDL.js +1 -0
  50. package/dist/client/assets/ai-providers-CUGZxUFM.js +1 -0
  51. package/dist/client/assets/{alert-BdtEy3y8.js → alert-DktlcBN9.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-DwnblylQ.js → alert-dialog-iJ0nuAo2.js} +2 -2
  53. package/dist/client/assets/app-editor-DKXC32M1.js +1 -0
  54. package/dist/client/assets/{auth-C4POVeVe.js → auth--O1w_iKV.js} +1 -1
  55. package/dist/client/assets/{auth-catchall-ZDYFC2A8.js → auth-catchall-C66NRByx.js} +1 -1
  56. package/dist/client/assets/{auth-entry-DoyULuRf.js → auth-entry-DKS3G1uz.js} +1 -1
  57. package/dist/client/assets/{auth-split-layout-C2XKKVOK.js → auth-split-layout-DcrydIAL.js} +1 -1
  58. package/dist/client/assets/{authenticate-and-persist-oauth-iHWUIj8u.js → authenticate-and-persist-oauth-BimYrVCh.js} +1 -1
  59. package/dist/client/assets/{automation-list-row-BDIVGPMe.js → automation-list-row-CB0Na4Io.js} +1 -1
  60. package/dist/client/assets/automation-runs-CjoeGDB3.js +180 -0
  61. package/dist/client/assets/automations-5W4kO3k8.js +1 -0
  62. package/dist/client/assets/{avatar-BQF1QGjq.js → avatar-BaVe5mnj.js} +1 -1
  63. package/dist/client/assets/{badge-BbmHyS30.js → badge-rSCRRNZZ.js} +1 -1
  64. package/dist/client/assets/{block-document-TZNj_QYY.js → block-document-BDVs9E35.js} +3 -3
  65. package/dist/client/assets/{brand-context-6vJcLMFN.js → brand-context-DXRoGovW.js} +1 -1
  66. package/dist/client/assets/{buckets-BhsiEut2.js → buckets-iue9Ud7d.js} +1 -1
  67. package/dist/client/assets/bulk-category-panel-DlUIZJ14.js +1 -0
  68. package/dist/client/assets/{calendar-DV0NS9xq.js → calendar-B4BM6mn9.js} +1 -1
  69. package/dist/client/assets/{capability-load-error-ObIFsfE9.js → capability-load-error-C19nQZEJ.js} +1 -1
  70. package/dist/client/assets/{card-DcA1Rwjs.js → card-CCT9DM3i.js} +1 -1
  71. package/dist/client/assets/category-editor-B0T-VrR6.js +1 -0
  72. package/dist/client/assets/chat-context-BBbr98oD.js +36 -0
  73. package/dist/client/assets/{checkbox-DsDzIgcJ.js → checkbox-Bq4_WPl3.js} +1 -1
  74. package/dist/client/assets/{cli-auth-success-CHUsfOPQ.js → cli-auth-success-CNtuqj7e.js} +1 -1
  75. package/dist/client/assets/collection-detail-DQNU4HiQ.js +1 -0
  76. package/dist/client/assets/{collection-display-button-Bs1t2pp4.js → collection-display-button-BXR6o3H2.js} +1 -1
  77. package/dist/client/assets/{collection-search-zQnUIpxo.js → collection-search-BtCuCV16.js} +1 -1
  78. package/dist/client/assets/{collection-table-wrapper-CXRyAsZ4.js → collection-table-wrapper-C_cazobp.js} +1 -1
  79. package/dist/client/assets/{collection-tabs-B-9Urj68.js → collection-tabs-0Qyek4_u.js} +1 -1
  80. package/dist/client/assets/{command-CaEk5uho.js → command-2wvo7x41.js} +1 -1
  81. package/dist/client/assets/commerce-onboarding-CL4fDsdf.js +1 -0
  82. package/dist/client/assets/{companions-core-Bua_v2zd.js → companions-core-D1MZ9B1U.js} +1 -1
  83. package/dist/client/assets/{connect-desktop-dialog-CxqDr22T.js → connect-desktop-dialog-BuM5aUqF.js} +1 -1
  84. package/dist/client/assets/{connect-BNr7HDJf.js → connect-gUMrTotC.js} +1 -1
  85. package/dist/client/assets/{connection-DPLpTOu5.js → connection-B0_6E7Mv.js} +1 -1
  86. package/dist/client/assets/{connection-card-CfMynI7E.js → connection-card-CD-x-wIk.js} +1 -1
  87. package/dist/client/assets/connection-detail-BuJnU9wM.js +1 -0
  88. package/dist/client/assets/{connection-form-helpers-BABNaeU1.js → connection-form-helpers-bxVBlV5J.js} +1 -1
  89. package/dist/client/assets/connections-HgZRNGX4.js +1 -0
  90. package/dist/client/assets/{decopilot-sse-pool-C_GcVLtN.js → decopilot-sse-pool-zU_w0iZh.js} +1 -1
  91. package/dist/client/assets/{dialog-CzDwjrNV.js → dialog-C1Qgh1pV.js} +1 -1
  92. package/dist/client/assets/{domain-settings-B_R_4nb3.js → domain-settings-Dr8-E0BO.js} +1 -1
  93. package/dist/client/assets/{drawer-CSHRJeTj.js → drawer-C-awTSYf.js} +1 -1
  94. package/dist/client/assets/{dropdown-menu-CSgtqrA3.js → dropdown-menu-DnVtnirM.js} +1 -1
  95. package/dist/client/assets/{empty-state-CwB9YNml.js → empty-state-t-xxj99b.js} +1 -1
  96. package/dist/client/assets/{extract-connection-data-ChU9AlhE.js → extract-connection-data-D2Q5eAdA.js} +1 -1
  97. package/dist/client/assets/file-explorer-YJoVbzpR.js +2 -0
  98. package/dist/client/assets/{form-CJlgALpE.js → form-Bcx3Dx5v.js} +1 -1
  99. package/dist/client/assets/{general-KzB4_6Wn.js → general-CTIKCAQW.js} +1 -1
  100. package/dist/client/assets/{github-repo-picker-DeAiQyIc.js → github-repo-picker-CfFhjmhR.js} +1 -1
  101. package/dist/client/assets/{hooks-CvwQxo-K.js → hooks-BRAlfwVg.js} +1 -1
  102. package/dist/client/assets/{index-D8ngUVkT.js → index-25tDLcHQ.js} +1 -1
  103. package/dist/client/assets/{index-CpW_ejWe.js → index-5tHCzznE.js} +1 -1
  104. package/dist/client/assets/index-75oUoREO.js +665 -0
  105. package/dist/client/assets/{index-CSZh49Ui.js → index-BFHC2rlf.js} +2 -2
  106. package/dist/client/assets/{index-DLEyNPFn.js → index-CRfJJjBr.js} +1 -1
  107. package/dist/client/assets/{index-DKhbAOZU.js → index-CTwgLDWF.js} +3 -3
  108. package/dist/client/assets/{index-DaeJeAuV.js → index-C_mT0QTy.js} +1 -1
  109. package/dist/client/assets/{index-Dk9RGAqb.js → index-D0GbPI_R.js} +31 -31
  110. package/dist/client/assets/index-DMXNbwjD.js +1 -0
  111. package/dist/client/assets/{index-BF9tZwJg.js → index-pNi6sXYH.js} +2 -2
  112. package/dist/client/assets/{index-Dm21RzCu.js → index-poTj2wxK.js} +1 -1
  113. package/dist/client/assets/{index-redirect-CiF0eU2o.js → index-redirect-D_UJBrMZ.js} +1 -1
  114. package/dist/client/assets/{input-C-gHIQip.js → input-Bb4p9_ik.js} +1 -1
  115. package/dist/client/assets/{integration-icon-DBUjxWMb.js → integration-icon-bG23TCVO.js} +1 -1
  116. package/dist/client/assets/{invite-member-dialog-CaK4ahsW.js → invite-member-dialog-BSPugAve.js} +1 -1
  117. package/dist/client/assets/{label-D9aEMZqo.js → label-5xpx6MdG.js} +1 -1
  118. package/dist/client/assets/{layout-BrB2JTzM.js → layout-q_JOMITt.js} +1 -1
  119. package/dist/client/assets/{login-Lw37QqB4.js → login-DWFYfzVD.js} +1 -1
  120. package/dist/client/assets/{mcp-oauth-Br5ozXBx.js → mcp-oauth-I-PLDGs0.js} +1 -1
  121. package/dist/client/assets/{members-CBNwHdHU.js → members-DAGQnraC.js} +1 -1
  122. package/dist/client/assets/monaco-editor-3ZmYAdL5.js +19 -0
  123. package/dist/client/assets/{monitoring-stats-row-B0nxijUM.js → monitoring-stats-row-D-FdpFBv.js} +1 -1
  124. package/dist/client/assets/{multi-select-DoaVr0FT.js → multi-select-CCg5PDqH.js} +1 -1
  125. package/dist/client/assets/{oauth-callback-BPUIN1-y.js → oauth-callback-D3gHvTLm.js} +1 -1
  126. package/dist/client/assets/{oauth-callback-ai-provider-DH8liZ11.js → oauth-callback-ai-provider-D0DSENaB.js} +1 -1
  127. package/dist/client/assets/onboarding-Bor5OprO.js +1 -0
  128. package/dist/client/assets/{org-install-DTLkzmIJ.js → org-install-B0gCH-Nk.js} +1 -1
  129. package/dist/client/assets/{org-layout-CFv53iXd.js → org-layout-BWKTyxWj.js} +1 -1
  130. package/dist/client/assets/{organization-choice-D1ddIq9q.js → organization-choice-DWfbtdFz.js} +1 -1
  131. package/dist/client/assets/{orgs-D8ijCQdC.js → orgs-BtRV84O-.js} +1 -1
  132. package/dist/client/assets/{page-seo-form-C7Dzevsc.js → page-seo-form-BFCjEKMU.js} +1 -1
  133. package/dist/client/assets/page-seo-sheet-CgVitSBt.js +1 -0
  134. package/dist/client/assets/{popover-C2fPnPJt.js → popover-BqPUB_i2.js} +1 -1
  135. package/dist/client/assets/post-editor-MaKq00sv.js +1 -0
  136. package/dist/client/assets/{primitives-FVRYsTWJ.js → primitives-DtK7id8m.js} +1 -1
  137. package/dist/client/assets/{profile-gw5qYABl.js → profile-CN9LLarl.js} +1 -1
  138. package/dist/client/assets/project-app-view-D-9tjTDx.js +1 -0
  139. package/dist/client/assets/record-editor-DoN02fjB.js +1 -0
  140. package/dist/client/assets/redirect-editor-D5Na_rRm.js +1 -0
  141. package/dist/client/assets/registry-BA7wbNAk.js +2 -0
  142. package/dist/client/assets/{registry-layout-Bp5nCSQt.js → registry-layout-XctP0_TB.js} +4 -4
  143. package/dist/client/assets/{reports-jd3NPFMI.js → reports-BBeGN80e.js} +2 -2
  144. package/dist/client/assets/{require-capability-L7H5SRt9.js → require-capability-2rozIXBv.js} +1 -1
  145. package/dist/client/assets/{required-auth-layout-BfZFGRtL.js → required-auth-layout-pINrUhAT.js} +1 -1
  146. package/dist/client/assets/{reset-password-HKWCKRZw.js → reset-password-sGF0Deja.js} +1 -1
  147. package/dist/client/assets/roles-CtVuRlNg.js +1 -0
  148. package/dist/client/assets/{search-input-BI1enB-b.js → search-input-DHMmvRu9.js} +1 -1
  149. package/dist/client/assets/{secrets-BfLNMBsl.js → secrets-Cek9nNDM.js} +1 -1
  150. package/dist/client/assets/sections-editor-KKjVHQIb.js +2 -0
  151. package/dist/client/assets/{select-Bd1WKGSJ.js → select-JTf4HMkB.js} +1 -1
  152. package/dist/client/assets/{select-model-BeSzDzZp.js → select-model-DeVAqDr8.js} +2 -2
  153. package/dist/client/assets/{self-tool-result-D85DyOHM.js → self-tool-result-JVOqtq7F.js} +1 -1
  154. package/dist/client/assets/seo-editor-BKn-yjw0.js +1 -0
  155. package/dist/client/assets/settings-layout-0HfTLbLa.js +1 -0
  156. package/dist/client/assets/{settings-section-Dh6zLap9.js → settings-section-Duse8CF5.js} +1 -1
  157. package/dist/client/assets/shell-controls-CjdX-cXs.js +1 -0
  158. package/dist/client/assets/shell-layout-BX_6t6Y4.js +1 -0
  159. package/dist/client/assets/{sidebar-DBzYJLC2.js → sidebar-JCplCzUs.js} +1 -1
  160. package/dist/client/assets/{skeleton-DoNQnm-q.js → skeleton-rG0lAer-.js} +1 -1
  161. package/dist/client/assets/{sso-TkJUyr_G.js → sso-DZif8bEF.js} +1 -1
  162. package/dist/client/assets/{store-DdPYyI-G.js → store-DSniQ8uA.js} +1 -1
  163. package/dist/client/assets/store-registry-7wOo-ziX.js +2 -0
  164. package/dist/client/assets/{studio-tools-CFgWeCBk.js → studio-tools-CVP_bYI3.js} +1 -1
  165. package/dist/client/assets/{switch-J9ypA9K4.js → switch-RfqMPlNx.js} +1 -1
  166. package/dist/client/assets/tab-id-6SxTM-85.js +1 -0
  167. package/dist/client/assets/{table-CIOCQP8H.js → table-CkAONPU-.js} +1 -1
  168. package/dist/client/assets/{tabs-BBm6nSot.js → tabs-C6CALd7M.js} +1 -1
  169. package/dist/client/assets/{textarea-CQzBh7SW.js → textarea-BDUOK9v4.js} +1 -1
  170. package/dist/client/assets/{toggle-group-DaeRkjf6.js → toggle-group-BJ3nTIOw.js} +1 -1
  171. package/dist/client/assets/toolbar-BbjlhC11.js +1 -0
  172. package/dist/client/assets/{tooltip-xp77jFs4.js → tooltip-CZxZ-Bns.js} +1 -1
  173. package/dist/client/assets/{use-ai-providers-Bujq_lmM.js → use-ai-providers-RLFjMIPM.js} +1 -1
  174. package/dist/client/assets/{use-api-keys-CLc8cxOV.js → use-api-keys-Yfc55xX1.js} +1 -1
  175. package/dist/client/assets/{use-automations-m1Zli3xa.js → use-automations-DMIHt0qx.js} +1 -1
  176. package/dist/client/assets/{use-autosave-BT7goSxj.js → use-autosave-CTaJVuYe.js} +1 -1
  177. package/dist/client/assets/{use-capability-DHlRnvUE.js → use-capability-C9LPdJIR.js} +1 -1
  178. package/dist/client/assets/{use-clock-tick-jphDPs9A.js → use-clock-tick-CF0pPFJP.js} +1 -1
  179. package/dist/client/assets/{use-connection-BsS-3rZB.js → use-connection-D67Pe6aW.js} +1 -1
  180. package/dist/client/assets/{use-copy-DmTk3Ltj.js → use-copy-3pbdZZcV.js} +1 -1
  181. package/dist/client/assets/{use-create-virtual-mcp-C2sWKZ2h.js → use-create-virtual-mcp-DOgSWB_T.js} +1 -1
  182. package/dist/client/assets/{use-debounced-autosave-C7P_JRA0.js → use-debounced-autosave-B7CCzcf-.js} +1 -1
  183. package/dist/client/assets/{use-debounced-value-D9jV_d1U.js → use-debounced-value-DSrcUzF-.js} +1 -1
  184. package/dist/client/assets/use-deco-credits-BEDSGMQk.js +1 -0
  185. package/dist/client/assets/{use-decopilot-events-B3KnAJRh.js → use-decopilot-events-DqMtcih3.js} +1 -1
  186. package/dist/client/assets/{use-delete-connection-DqznTHaH.js → use-delete-connection-CeKf58YN.js} +1 -1
  187. package/dist/client/assets/{use-deployment-admin-BFdTIDOz.js → use-deployment-admin-BAJ25R18.js} +1 -1
  188. package/dist/client/assets/{use-file-configs-D6Dg-9sN.js → use-file-configs-eEXpH4IT.js} +1 -1
  189. package/dist/client/assets/{use-infinite-scroll-CbSN3uty.js → use-infinite-scroll-CUTwghko.js} +1 -1
  190. package/dist/client/assets/{use-join-requests-avqI9CYZ.js → use-join-requests-DSCKcWR6.js} +1 -1
  191. package/dist/client/assets/{use-mcp-auth-status-UXgrVZIV.js → use-mcp-auth-status-GN_90IVc.js} +1 -1
  192. package/dist/client/assets/{use-mcp-client-Bzvvd0Df.js → use-mcp-client-2qqsLKMv.js} +1 -1
  193. package/dist/client/assets/{use-mcp-tools-IcUfyh43.js → use-mcp-tools-DYZgnU0f.js} +1 -1
  194. package/dist/client/assets/{use-members-Cf3JeQ7o.js → use-members-BBMl3rpc.js} +1 -1
  195. package/dist/client/assets/{use-mobile-DQ8jManM.js → use-mobile-orl9RI6e.js} +1 -1
  196. package/dist/client/assets/{use-navigate-to-agent-D_vSOLwA.js → use-navigate-to-agent-BL6ciQ9Y.js} +1 -1
  197. package/dist/client/assets/{use-org-auth-client-B1nrzsgv.js → use-org-auth-client-nWz-MFtZ.js} +1 -1
  198. package/dist/client/assets/{use-org-sso-w9j-Ok-z.js → use-org-sso-D-Dpc7wL.js} +1 -1
  199. package/dist/client/assets/{use-organization-roles-DPbFWCpb.js → use-organization-roles-DuvB4P7M.js} +1 -1
  200. package/dist/client/assets/{use-organization-settings-zX_T-3XG.js → use-organization-settings-DcpRbwzw.js} +1 -1
  201. package/dist/client/assets/{use-registry-app-DdwkqhPA.js → use-registry-app-CLQNyM7N.js} +1 -1
  202. package/dist/client/assets/{use-registry-connections-C529xEPn.js → use-registry-connections-BgFdJfUy.js} +1 -1
  203. package/dist/client/assets/{use-secrets-CTWWthzy.js → use-secrets-DuyNYvJ7.js} +1 -1
  204. package/dist/client/assets/{use-status-sounds-D-dtBAQ9.js → use-status-sounds-CO1cS1Qf.js} +1 -1
  205. package/dist/client/assets/{use-view-mode-CQpQIlsB.js → use-view-mode-Ck3q6mF-.js} +1 -1
  206. package/dist/client/assets/{use-virtual-mcp-BP-M67aZ.js → use-virtual-mcp-DYkiFIJC.js} +1 -1
  207. package/dist/client/assets/useInfiniteQuery-DwwDCJAw.js +1 -0
  208. package/dist/client/assets/{useQueries-b2s80Vy2.js → useQueries-DNJ2_DVv.js} +1 -1
  209. package/dist/client/assets/{useRouterState-BE3l9A_t.js → useRouterState-CSvDrQv7.js} +1 -1
  210. package/dist/client/assets/useSuspenseInfiniteQuery-DOVA9lC8.js +1 -0
  211. package/dist/client/assets/{users-BPFw8x87.js → users-NNxyxZtX.js} +1 -1
  212. package/dist/client/assets/variant-calendar-BotkXpCr.js +1 -0
  213. package/dist/client/assets/{view-mode-toggle-Dn7I7z16.js → view-mode-toggle-B0C9EwSq.js} +1 -1
  214. package/dist/client/index.html +1 -1
  215. package/dist/server/cli.js +1 -1
  216. package/dist/server/server.js +1 -1
  217. package/package.json +1 -1
  218. package/dist/client/assets/Globe01-CEh6-y49.js +0 -1
  219. package/dist/client/assets/Globe04-B4VpGXlx.js +0 -1
  220. package/dist/client/assets/Image01-CMEjSR3M.js +0 -1
  221. package/dist/client/assets/Package-R2sM0vCm.js +0 -1
  222. package/dist/client/assets/Palette-CsQxyyrG.js +0 -1
  223. package/dist/client/assets/Tool01-B0759esA.js +0 -1
  224. package/dist/client/assets/Tool02-DPXeBg9E.js +0 -1
  225. package/dist/client/assets/ZoomOut-B-F-8cp0.js +0 -1
  226. package/dist/client/assets/agent-icon-E6ioveGx.js +0 -1
  227. package/dist/client/assets/agents-list-Da5tnSPr.js +0 -1
  228. package/dist/client/assets/ai-providers-BWFFEYZL.js +0 -1
  229. package/dist/client/assets/app-editor-CdLxuu_H.js +0 -1
  230. package/dist/client/assets/automation-runs-CfKwQe7C.js +0 -87
  231. package/dist/client/assets/automations-BCQxf0NT.js +0 -1
  232. package/dist/client/assets/autosend-CMYVBxZV.js +0 -1
  233. package/dist/client/assets/bulk-category-panel-D5jThLH-.js +0 -1
  234. package/dist/client/assets/category-editor-Zpp2vnMR.js +0 -1
  235. package/dist/client/assets/chat-context-BF6sak7i.js +0 -36
  236. package/dist/client/assets/collection-detail-BNdX0SIB.js +0 -1
  237. package/dist/client/assets/commerce-onboarding-CiS9fZfY.js +0 -1
  238. package/dist/client/assets/connection-detail-B0e-9hXG.js +0 -1
  239. package/dist/client/assets/connections-Cy3k4Q8y.js +0 -1
  240. package/dist/client/assets/file-explorer-Brc8sEiI.js +0 -2
  241. package/dist/client/assets/file-type-icon-_JzjFo75.js +0 -94
  242. package/dist/client/assets/files-BVF6I-9K.js +0 -1
  243. package/dist/client/assets/index-CRECkoeT.js +0 -11
  244. package/dist/client/assets/index-CwhgWx3d.js +0 -492
  245. package/dist/client/assets/index-EFMlI3jy.js +0 -174
  246. package/dist/client/assets/index-LUmU4Q-i.js +0 -1
  247. package/dist/client/assets/location-BpLtHjTZ.js +0 -1
  248. package/dist/client/assets/monaco-editor-CIeX3g7j.js +0 -9
  249. package/dist/client/assets/onboarding-Dhh44q6X.js +0 -1
  250. package/dist/client/assets/page-seo-sheet-o_DqZuF2.js +0 -1
  251. package/dist/client/assets/post-editor-Bq8RGMDX.js +0 -1
  252. package/dist/client/assets/project-app-view-CKq51jV9.js +0 -1
  253. package/dist/client/assets/record-editor-aUwWcdAc.js +0 -1
  254. package/dist/client/assets/redirect-editor-CdIq7WyN.js +0 -1
  255. package/dist/client/assets/registry-CuS81odv.js +0 -2
  256. package/dist/client/assets/roles-BfuLXfWh.js +0 -1
  257. package/dist/client/assets/sections-editor-BEWC-c1n.js +0 -2
  258. package/dist/client/assets/seo-editor-Cr0IAZUG.js +0 -1
  259. package/dist/client/assets/settings-layout-nbprtkao.js +0 -1
  260. package/dist/client/assets/shell-controls-DmSPQaRT.js +0 -1
  261. package/dist/client/assets/shell-layout-DCFL_zE0.js +0 -1
  262. package/dist/client/assets/store-registry-B8K0dTh3.js +0 -2
  263. package/dist/client/assets/tab-id-BijBBRwE.js +0 -1
  264. package/dist/client/assets/toolbar-CoHzPWWi.js +0 -1
  265. package/dist/client/assets/toolbar-icon-button-BGQ8DzLo.js +0 -1
  266. package/dist/client/assets/use-deco-credits-BW-cf-qH.js +0 -1
  267. package/dist/client/assets/useInfiniteQuery-64uGdBMx.js +0 -1
  268. package/dist/client/assets/useSuspenseInfiniteQuery-DYsYorpe.js +0 -1
  269. package/dist/client/assets/variant-calendar-DNJKkwIK.js +0 -1
@@ -1 +0,0 @@
1
- import{b as re,r as $,F as Be,K as me,n as Fe,j as s,m as W,k as je,B as ce,c as J,W as Xe,a1 as Ue,X as ae,a3 as Je,a4 as et,o as rt,Z as Ot,Y as jt,e as at,t as ve,p as Ke,y as ct,z as vt,E as Mt,d as Dt,u as yt}from"./index-Dk9RGAqb.js";import{u as Pt}from"./use-organization-roles-DPbFWCpb.js";import{u as $e}from"./use-org-auth-client-B1nrzsgv.js";import{g as dt,a as wt}from"./role-color-Dn2tXDDF.js";import{B as Me}from"./badge-BbmHyS30.js";import{A as mt,a as ut,c as ft,d as gt,b as ht,f as xt,g as pt,e as Tt}from"./alert-dialog-DwnblylQ.js";import{c as Lt,D as Gt,b as kt,a as Ut}from"./dropdown-menu-CSgtqrA3.js";import{a as Bt}from"./DotsVertical-DKanPfz6.js";import{s as Ye}from"./Plus-CLG5QKCr.js";import{s as Vt}from"./Trash01-CWIa_mDx.js";import{C as zt}from"./collection-table-wrapper-CXRyAsZ4.js";import{P as ie}from"./index-D8ngUVkT.js";import{E as tt}from"./empty-state-CwB9YNml.js";import{S as Qe}from"./search-input-BI1enB-b.js";import{P as Et,D as It}from"./ai-providers-logos-DD3qZ33J.js";import{I as Ze}from"./integration-icon-DBUjxWMb.js";import{u as Yt}from"./use-infinite-scroll-CbSN3uty.js";import{C as He}from"./checkbox-DsDzIgcJ.js";import{b as Ft}from"./Settings02-BIGi-T7s.js";import{u as Kt}from"./useSuspenseInfiniteQuery-DYsYorpe.js";import{u as $t,S as Qt}from"./use-mcp-client-Bzvvd0Df.js";import{C as Zt}from"./collection-search-zQnUIpxo.js";import{p as Ht}from"./connection-DPLpTOu5.js";import{u as _t}from"./use-members-Cf3JeQ7o.js";import{g as Rt}from"./get-initials-D-f_fDFw.js";import{u as qt}from"./use-connection-BsS-3rZB.js";import{u as Wt,c as Xt}from"./use-ai-providers-Bujq_lmM.js";import{A as St}from"./avatar-BQF1QGjq.js";import{S as De}from"./switch-J9ypA9K4.js";import{b as ye,c as Pe,T as we,a as Le}from"./tooltip-xp77jFs4.js";import{S as st,a as lt,b as ot}from"./settings-section-Dh6zLap9.js";import{t as Jt}from"./ChevronDown-B3fDqERa.js";import{i as es}from"./ChevronRight-Dkp8mDOd.js";import{i as nt}from"./X-BYXAQs6v.js";import{a as ts}from"./use-capability-DHlRnvUE.js";import{A as ss}from"./access-gate-D11_1kHO.js";import"./Check-LKA0FKR0.js";import"./table-CIOCQP8H.js";import"./ArrowUp-DI1fyC1G.js";import"./sidebar-DBzYJLC2.js";import"./LayoutLeft-Yz5NzG-w.js";import"./use-mobile-DQ8jManM.js";import"./SearchMd-DBj7HhoW.js";import"./Tool02-DPXeBg9E.js";import"./agent-icon-E6ioveGx.js";import"./AlertCircle-1e3-NcEA.js";import"./Tool01-B0759esA.js";import"./ArrowRight-B-wHAJWT.js";import"./ArrowUpRight-BWyzrLQV.js";import"./TrendUp01-CYCVS1zr.js";import"./ZapSquare-DGe1cTc7.js";import"./ZoomOut-B-F-8cp0.js";import"./Users03-3lwc9liE.js";import"./CheckCircle-Dh-3VdHB.js";import"./ChevronUp-Cm7VcWLZ.js";import"./Stars02-DpsxkqJO.js";import"./Copy01-uQh3Q5Fv.js";import"./Globe01-CEh6-y49.js";import"./Eye-SCLKEZSh.js";import"./FilterLines-13dE_TWB.js";import"./Star01-lWHLfmir.js";import"./Globe04-B4VpGXlx.js";import"./SwitchHorizontal01-Dw_LQc0f.js";import"./HardDrive-DViLU95V.js";import"./Image01-CMEjSR3M.js";import"./Key01-CgioJ7nW.js";import"./XCircle-B3aYrCCW.js";import"./LinkExternal01-Di_tOfr7.js";import"./LogOut01-r12Fp93g.js";import"./Monitor01-C_dYkXdo.js";import"./Sun-tOsjvEis.js";import"./Package-R2sM0vCm.js";import"./Palette-CsQxyyrG.js";import"./Play-CVGtm9ao.js";import"./SearchLg-CkXJjhdf.js";import"./Shield01-ksb0VZpA.js";import"./Stars01-B3jznQQ4.js";import"./Upload01-CPD95nN4.js";import"./User01-NxrNjn_h.js";import"./Users01-DvtVVxdG.js";import"./XClose-CW0R6bEe.js";import"./Zap-CrMVm5NK.js";import"./auth-C4POVeVe.js";import"./studio-tools-CFgWeCBk.js";import"./card-DcA1Rwjs.js";import"./capability-load-error-ObIFsfE9.js";const qe="basic-usage",We=[{id:qe,label:"Basic Usage",description:"Tools all org members can access by default",section:"Basic Usage",tools:["COLLECTION_CONNECTIONS_LIST","COLLECTION_CONNECTIONS_GET","CONNECTION_TEST","COLLECTION_VIRTUAL_MCP_LIST","COLLECTION_VIRTUAL_MCP_GET","VIRTUAL_MCP_PLUGIN_CONFIG_GET","VIRTUAL_MCP_LAST_USED_LIST","AUTOMATION_GET","AUTOMATION_LIST","AUTOMATION_RUN_STATS","AI_PROVIDERS_LIST","AI_PROVIDERS_LIST_MODELS","AI_PROVIDERS_ACTIVE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_CREDITS","AI_PROVIDER_TOPUP_URL","LIST_OBJECTS","GET_OBJECT_METADATA","GET_PRESIGNED_URL","PUT_PRESIGNED_URL","FILE_OBJECTS_LIST","SANDBOX_START","SANDBOX_DELETE","GLOBAL_SEARCH","ORGANIZATION_SETTINGS_GET","USER_GET","LINK_CURRENT_GET","LINK_DISCONNECT","BRAND_CONTEXT_LIST","COLLECTION_THREADS_CREATE","COLLECTION_THREADS_LIST","COLLECTION_THREADS_GET","COLLECTION_THREADS_UPDATE","COLLECTION_THREADS_DELETE","COLLECTION_THREAD_MESSAGES_LIST","THREAD_BACKGROUND_TOOL_START","THREAD_SUBTASK_DELIVER","TASK_BOARD_ITEM_CREATE","TASK_BOARD_ITEM_LIST","TASK_BOARD_ITEM_UPDATE","TASK_BOARD_ITEM_DELETE","TASK_BOARD_ITEM_PRS_GET"]},{id:"org:manage",label:"Manage organization",description:"Edit organization settings, brand context, and domain configuration",section:"Organization",tools:["ORGANIZATION_GET","ORGANIZATION_LIST","ORGANIZATION_UPDATE","ORGANIZATION_SETTINGS_GET","ORGANIZATION_SETTINGS_UPDATE","BRAND_CONTEXT_LIST","BRAND_CONTEXT_GET","BRAND_CONTEXT_CREATE","BRAND_CONTEXT_UPDATE","BRAND_CONTEXT_DELETE","BRAND_CONTEXT_EXTRACT","BRAND_GET","BRAND_LIST","ORGANIZATION_DOMAIN_LIST","ORGANIZATION_DOMAIN_ADD","ORGANIZATION_DOMAIN_UPDATE","ORGANIZATION_DOMAIN_VERIFY","ORGANIZATION_DOMAIN_REMOVE"]},{id:"members:manage",label:"Manage members",description:"Invite members, remove them, and change their roles",section:"Organization",tools:["ORGANIZATION_MEMBER_LIST","ORGANIZATION_MEMBER_ADD","ORGANIZATION_MEMBER_REMOVE","ORGANIZATION_MEMBER_UPDATE_ROLE","ORGANIZATION_SEATS_GET","ORGANIZATION_SEATS_SET","ORGANIZATION_BILLING_CHECKOUT_START","ORGANIZATION_SEATS_PREVIEW","ORGANIZATION_BILLING_PORTAL","ORGANIZATION_INCLUDED_REPORT_SET","ORGANIZATION_REPORT_RUN_PAID","ORGANIZATION_JOIN_REQUEST_LIST","ORGANIZATION_JOIN_REQUEST_APPROVE","ORGANIZATION_JOIN_REQUEST_DENY"],dangerous:!0},{id:"connections:manage",label:"Manage connections",description:"Create, update, and delete connections",section:"Connections & Agents",tools:["COLLECTION_CONNECTIONS_CREATE","COLLECTION_CONNECTIONS_UPDATE","COLLECTION_CONNECTIONS_DELETE","COMMERCE_DISCOVERY_SETUP","COMMERCE_DISCOVERY_RUN","COMMERCE_DISCOVERY_BIND","COMMERCE_DISCOVERY_CONNECTION_STATUS"],dangerous:!0},{id:"agents:manage",label:"Manage agents",description:"Create, configure, and delete agents",section:"Connections & Agents",tools:["COLLECTION_VIRTUAL_MCP_CREATE","COLLECTION_VIRTUAL_MCP_UPDATE","COLLECTION_VIRTUAL_MCP_DELETE","VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE","VIRTUAL_MCP_PINNED_VIEWS_UPDATE"],dangerous:!0},{id:"automations:manage",label:"Manage automations",description:"Create, update, run, and delete automations",section:"Automations",tools:["AUTOMATION_CREATE","AUTOMATION_UPDATE","AUTOMATION_DELETE","AUTOMATION_TRIGGER_ADD","AUTOMATION_TRIGGER_REMOVE","AUTOMATION_TRIGGER_ROTATE_TOKEN","AUTOMATION_RUN"],dangerous:!0},{id:"monitoring:view",label:"View monitoring",description:"Access logs and usage statistics",section:"Monitoring",tools:["MONITORING_LOG_GET","MONITORING_LOGS_LIST","MONITORING_STATS","MONITORING_THREAD_USAGE"]},{id:"secrets:manage",label:"Manage secrets",description:"Create and list secrets stored in the credential vault",section:"Organization",tools:["SECRET_CREATE","SECRET_LIST"]},{id:"file-configs:manage",label:"Manage file configs",description:"Create, list, update and delete S3 bucket configurations",section:"Organization",tools:["FILE_CONFIG_CREATE","FILE_CONFIG_LIST","FILE_CONFIG_UPDATE","FILE_CONFIG_DELETE","FILE_OBJECTS_LIST"]},{id:"ai-providers:manage",label:"Manage AI providers",description:"Add or remove API keys and provision provider credentials",section:"AI Providers",tools:["AI_PROVIDER_KEY_CREATE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_KEY_DELETE","AI_PROVIDER_KEY_UPDATE","AI_PROVIDER_KEY_PREVIEW","AI_PROVIDER_OAUTH_URL","AI_PROVIDER_OAUTH_EXCHANGE","AI_PROVIDER_PROVISION_KEY","AI_PROVIDER_TOPUP_URL","AI_PROVIDER_CREDITS"]},{id:"tags:manage",label:"Manage tags",description:"Create, assign, and delete organization tags",section:"Organization",tools:["TAGS_LIST","TAGS_CREATE","TAGS_DELETE","MEMBER_TAGS_GET","MEMBER_TAGS_SET"]},{id:"registry:manage",label:"Manage registry",description:"Browse, publish, and manage items in the registry",section:"Store & Registry",tools:["COLLECTION_REGISTRY_APP_LIST","COLLECTION_REGISTRY_APP_GET","COLLECTION_REGISTRY_APP_VERSIONS","COLLECTION_REGISTRY_APP_FILTERS","REGISTRY_ITEM_LIST","REGISTRY_ITEM_SEARCH","REGISTRY_ITEM_GET","REGISTRY_ITEM_VERSIONS","REGISTRY_ITEM_FILTERS","REGISTRY_DISCOVER_TOOLS","REGISTRY_ITEM_CREATE","REGISTRY_ITEM_BULK_CREATE","REGISTRY_ITEM_UPDATE","REGISTRY_ITEM_DELETE","REGISTRY_AI_GENERATE","REGISTRY_PUBLISH_REQUEST_LIST","REGISTRY_PUBLISH_REQUEST_REVIEW","REGISTRY_PUBLISH_REQUEST_COUNT","REGISTRY_PUBLISH_REQUEST_DELETE","REGISTRY_PUBLISH_API_KEY_GENERATE","REGISTRY_PUBLISH_API_KEY_LIST","REGISTRY_PUBLISH_API_KEY_REVOKE"],dangerous:!0},{id:"registry:monitor",label:"Monitor registry health",description:"Run health checks on registry connections and view results",section:"Store & Registry",tools:["REGISTRY_MONITOR_RUN_START","REGISTRY_MONITOR_RUN_LIST","REGISTRY_MONITOR_RUN_GET","REGISTRY_MONITOR_RUN_CANCEL","REGISTRY_MONITOR_RESULT_LIST","REGISTRY_MONITOR_CONNECTION_LIST","REGISTRY_MONITOR_CONNECTION_SYNC","REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH"]},{id:"api-keys:manage",label:"Manage API keys",description:"Create, update, and revoke API keys",section:"Developer",tools:["API_KEY_CREATE","API_KEY_LIST","API_KEY_UPDATE","API_KEY_DELETE"]},{id:"storage:delete",label:"Delete from storage",description:"Permanently delete files from object storage",section:"Developer",tools:["DELETE_OBJECT","DELETE_OBJECTS"],dangerous:!0},{id:"connections:sql",label:"Run SQL queries",description:"Execute raw SQL against connected databases",section:"Developer",tools:["DATABASES_RUN_SQL"],dangerous:!0}];[...We.find(t=>t.id===qe)?.tools??[]];const ls=["agents:manage","connections:manage"];new Set(We.filter(t=>ls.includes(t.id)).flatMap(t=>t.tools));function os(){const t=new Map;for(const e of We){if(e.id===qe)continue;const l=t.get(e.section)??[];l.push(e),t.set(e.section,l)}return Array.from(t.entries()).map(([e,l])=>({section:e,capabilities:l}))}function ns(t,e,l){return l?!0:t.tools.every(n=>e.includes(n))}function is(t,e,l){if(l){const i=new Set(e);for(const o of t.tools)i.add(o);return Array.from(i)}const n=new Set(e);for(const i of t.tools)n.delete(i);return Array.from(n)}function rs(t){const e=J.c(21),{connection:l,isSelected:n,hasToolsEnabled:i,activeToolsCount:o,totalToolsCount:c,onSelect:g,onToggle:h}=t,m=n?"bg-accent/50":"hover:bg-muted/50";let f;e[0]!==m?(f=W("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",m),e[0]=m,e[1]=f):f=e[1];let a;e[2]!==l.icon||e[3]!==l.title?(a=s.jsx(Ze,{icon:l.icon,name:l.title,size:"xs"}),e[2]=l.icon,e[3]=l.title,e[4]=a):a=e[4];let u;e[5]!==l.title?(u=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),e[5]=l.title,e[6]=u):u=e[6];let x;e[7]!==g||e[8]!==a||e[9]!==u?(x=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:g,children:[a,u]}),e[7]=g,e[8]=a,e[9]=u,e[10]=x):x=e[10];let d;e[11]!==o||e[12]!==l.tools||e[13]!==i||e[14]!==h||e[15]!==c?(d=l.tools&&l.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[o,"/",c]}),s.jsx(He,{checked:i,onCheckedChange:h,onClick:as})]}),e[11]=o,e[12]=l.tools,e[13]=i,e[14]=h,e[15]=c,e[16]=d):d=e[16];let p;return e[17]!==f||e[18]!==x||e[19]!==d?(p=s.jsxs("div",{className:f,children:[x,d]}),e[17]=f,e[18]=x,e[19]=d,e[20]=p):p=e[20],p}function as(t){return t.stopPropagation()}function cs(t){const e=J.c(18),{connectionId:l,tool:n,isSelected:i,onToggle:o}=t,c=`tool-${l}-${n.name}`,g=i?"text-foreground":"text-muted-foreground";let h;e[0]!==g?(h=W("text-sm font-medium",g),e[0]=g,e[1]=h):h=e[1];let m;e[2]!==h||e[3]!==n.name?(m=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:h,children:n.name})}),e[2]=h,e[3]=n.name,e[4]=m):m=e[4];let f;e[5]!==n.description?(f=n.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:n.description}),e[5]=n.description,e[6]=f):f=e[6];let a;e[7]!==m||e[8]!==f?(a=s.jsxs("div",{className:"flex-1 min-w-0",children:[m,f]}),e[7]=m,e[8]=f,e[9]=a):a=e[9];const u=`tool-${l}-${n.name}`;let x;e[10]!==i||e[11]!==o||e[12]!==u?(x=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(He,{id:u,checked:i,onCheckedChange:o,onClick:ds})}),e[10]=i,e[11]=o,e[12]=u,e[13]=x):x=e[13];let d;return e[14]!==c||e[15]!==a||e[16]!==x?(d=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:c,children:[a,x]}),e[14]=c,e[15]=a,e[16]=x,e[17]=d):d=e[17],d}function ds(t){return t.stopPropagation()}function ms({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:l,searchQuery:n}){const i=re(),[o,c]=$.useState(""),g=n!==void 0?n:o,h=$.useDeferredValue(g),[m,f]=$.useState("all"),[a,u]=$.useState(!1),x=$.useRef(new Set(Object.keys(t))),{org:d}=Be(),p=$t({connectionId:Qt,orgId:d.id,orgSlug:d.slug}),C=100,R=h.trim(),_=R?{operator:"or",conditions:[{field:["title"],operator:"contains",value:R},{field:["description"],operator:"contains",value:R}]}:void 0,A=!!l,N={..._&&{where:_},orderBy:[{field:["updated_at"],direction:"asc"}],limit:C,offset:0,...A&&{include_virtual:!0}},v=JSON.stringify(N),{data:S,fetchNextPage:O,hasNextPage:M,isFetchingNextPage:E}=Kt({queryKey:me.collectionListInfinite(p,d.id,"","CONNECTIONS",v),queryFn:async({pageParam:T=0})=>(await p.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{..._&&{where:_},orderBy:[{field:["updated_at"],direction:"asc"}],limit:C,offset:T,...A&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(T,G)=>{if(T?.hasMore)return G.reduce((Q,q)=>Q+(q?.items?.length??0),0)},staleTime:3e4}),b=S?.pages.flatMap(T=>T?.items??[])??[],D=Yt(O,M??!1,E),r=l?b.filter(T=>T.connection_type!=="VIRTUAL"?!0:Ht(T.connection_url)!==l):b,I=x.current,k=[...I.values()].map(T=>r.find(G=>G.id===T)).filter(T=>T!==void 0),L=r.filter(T=>!I.has(T.id)),z=[...k,...L],y=T=>{const G=t[T];return G!==void 0&&G.length>0},Y=z.filter(T=>{if(m==="all")return!0;const G=y(T.id);return m==="selected"?G:m==="unselected"?!G:!0}),[P,F]=$.useState(z[0]?.id??null),V=P?z.find(T=>T.id===P)??null:null,{data:U,isFetching:B}=Fe({queryKey:me.collectionItem(p,d.id,"","CONNECTIONS",P??""),queryFn:async()=>P?(await p.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:P}})).structuredContent?.item??null:null,enabled:!!P,staleTime:3e4}),Z=U?.tools??[],X=(T,G)=>t[T]?.includes(G)??!1,te=(T,G)=>{const Q=t[T]??[],q=Q.includes(G),ne={...t};if(q){const se=Q.filter(oe=>oe!==G);se.length===0?delete ne[T]:ne[T]=se}else ne[T]=[...Q,G];e(ne)},le=T=>{const G=T===P?Z:[];if(!G.length)return;const Q=t[T]??[],q=G.map(oe=>oe.name),ne=Q.length>0&&q.every(oe=>Q.includes(oe)),se={...t};ne?delete se[T]:(se[T]=q,F(T)),e(se)},K=T=>{F(T),u(!0)},H=()=>{u(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:W("w-full md:w-80 border-r border-border flex flex-col",a&&"hidden md:flex"),children:[n===void 0&&s.jsx(Zt,{value:o,onChange:c,placeholder:i("common.toolSetSelector.searchPlaceholder")}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>f("all"),className:W("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",m==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:i("common.toolSetSelector.filterAll")}),s.jsx("button",{onClick:()=>f("selected"),className:W("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",m==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:i("common.toolSetSelector.filterSelected")}),s.jsx("button",{onClick:()=>f("unselected"),className:W("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",m==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:i("common.toolSetSelector.filterUnselected")})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:Y.length===0?s.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:i(g?"common.toolSetSelector.noConnectionsFound":m==="selected"?"common.toolSetSelector.noServersSelected":m==="unselected"?"common.toolSetSelector.noUnselectedServers":"common.toolSetSelector.noConnectionsAvailable")}):s.jsxs("div",{className:"p-2 space-y-1",children:[Y.map(T=>{const G=P===T.id,Q=G?Z.length:0,q=t[T.id]?.length??0;return s.jsx(rs,{connection:{...T,tools:G?Z:T.tools},isSelected:G,hasToolsEnabled:y(T.id),activeToolsCount:q,totalToolsCount:Q,onSelect:()=>K(T.id),onToggle:()=>le(T.id)},T.id)}),s.jsx("div",{ref:D,className:"h-4"}),E&&s.jsx("div",{className:"flex justify-center py-3",children:s.jsx(je,{size:18,className:"animate-spin text-muted-foreground"})})]})})]}),s.jsx("div",{className:W("flex-1 flex-col",a?"flex":"hidden md:flex"),children:V?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[s.jsx(ce,{variant:"ghost",size:"sm",onClick:H,className:"h-8 w-8 p-0 shrink-0",children:s.jsx(Ft,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(Ze,{icon:V.icon,name:V.title,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:V.title}),V.description&&s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:V.description})]})]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-4",children:B?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(je,{size:18,className:"animate-spin text-muted-foreground"})}):Z.length===0?s.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:i("common.toolSetSelector.noToolsAvailable")}):s.jsx("div",{className:"space-y-2",children:Z.map(T=>s.jsx(cs,{connectionId:V.id,tool:T,isSelected:X(V.id,T.name),onToggle:()=>te(V.id,T.name)},T.name))})})]}):s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:i("common.toolSetSelector.selectConnection")})})})]})}const us=Xe({role:Xe({id:ae().optional(),slug:ae().optional(),label:ae()}),allowAllStaticPermissions:et(),staticPermissions:Ue(ae()),toolSet:Je(ae(),Ue(ae())),allowAllModels:et(),modelSet:Je(ae(),Ue(ae())),memberIds:Ue(ae())});function it(t,e,l,n){const i=s.jsx(De,{checked:e,disabled:l,onCheckedChange:n});return l?s.jsx(ye,{children:s.jsxs(Pe,{children:[s.jsx(we,{asChild:!0,children:s.jsx("div",{children:i})}),s.jsx(Le,{children:s.jsx("p",{children:t("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):i}function fs(t){const e=J.c(41),{allowAllStaticPermissions:l,staticPermissions:n,onAllowAllChange:i,onPermissionsChange:o,readOnly:c,searchQuery:g}=t,h=c===void 0?!1:c,m=re();let f;e[0]!==g?(f=g.trim().toLowerCase(),e[0]=g,e[1]=f):f=e[1];const a=$.useDeferredValue(f);let u;if(e[2]!==l||e[3]!==a||e[4]!==i||e[5]!==o||e[6]!==h||e[7]!==g||e[8]!==n||e[9]!==m){const x=os(),d=(E,b)=>{if(!h){if(l&&b){const D=x.flatMap(xs).flatMap(hs);i(!1),o(D.filter(r=>!E.tools.includes(r)));return}l||o(is(E,n,!b))}};let p;e[11]!==a?(p=E=>{const{section:b,capabilities:D}=E;return{section:b,capabilities:D.filter(r=>!a||r.label.toLowerCase().includes(a)||r.description.toLowerCase().includes(a))}},e[11]=a,e[12]=p):p=e[12];const C=x.map(p).filter(gs);let R;e[13]!==m?(R=m("settings.orgRoleDetail.general"),e[13]=m,e[14]=R):R=e[14];let _;e[15]!==m?(_=m("settings.orgRoleDetail.allOrgPermissions"),e[15]=m,e[16]=_):_=e[16];let A;e[17]!==m?(A=m("settings.orgRoleDetail.grantFullAccessToAllFeaturesBelow"),e[17]=m,e[18]=A):A=e[18];let N;e[19]!==l||e[20]!==i||e[21]!==o?(N=()=>{i(!l),o([])},e[19]=l,e[20]=i,e[21]=o,e[22]=N):N=e[22];let v;e[23]!==l||e[24]!==h||e[25]!==m||e[26]!==N?(v=it(m,l,h,N),e[23]=l,e[24]=h,e[25]=m,e[26]=N,e[27]=v):v=e[27];let S;e[28]!==l||e[29]!==i||e[30]!==o||e[31]!==h?(S=h?void 0:()=>{i(!l),o([])},e[28]=l,e[29]=i,e[30]=o,e[31]=h,e[32]=S):S=e[32];let O;e[33]!==S||e[34]!==_||e[35]!==A||e[36]!==v?(O=s.jsx(lt,{children:s.jsx(ot,{title:_,description:A,action:v,onClick:S})}),e[33]=S,e[34]=_,e[35]=A,e[36]=v,e[37]=O):O=e[37];let M;e[38]!==O||e[39]!==R?(M=s.jsx(st,{title:R,children:O}),e[38]=O,e[39]=R,e[40]=M):M=e[40],u=s.jsx("div",{children:s.jsxs("div",{className:"flex flex-col gap-10 py-4",children:[M,C.length===0&&a?s.jsx("p",{className:"text-sm text-muted-foreground py-4",children:m("settings.orgRoleDetail.noPermissionsMatch",{searchQuery:g})}):C.map(E=>{const{section:b,capabilities:D}=E;return s.jsx(st,{title:b,children:s.jsx(lt,{children:D.map(r=>{const I=ns(r,n,l);return s.jsx(ot,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[r.label,r.dangerous&&s.jsx(vt,{size:12,className:"text-warning shrink-0"})]}),description:r.description,action:it(m,I,h,()=>d(r,I)),onClick:h?void 0:()=>d(r,I)},r.id)})})},b)})]})}),e[2]=l,e[3]=a,e[4]=i,e[5]=o,e[6]=h,e[7]=g,e[8]=n,e[9]=m,e[10]=u}else u=e[10];return u}function gs(t){return t.capabilities.length>0}function hs(t){return t.tools}function xs(t){return t.capabilities}const Nt={anthropic:"Anthropic",openrouter:"OpenRouter"},ps={openai:"OpenAI",anthropic:"Anthropic",google:"Google","meta-llama":"Meta",mistralai:"Mistral","x-ai":"xAI",deepseek:"DeepSeek",qwen:"Qwen",moonshotai:"MoonshotAI",nvidia:"NVIDIA",perplexity:"Perplexity",cohere:"Cohere",amazon:"Amazon",microsoft:"Microsoft","z-ai":"Z.ai","ibm-granite":"IBM Granite",alibaba:"Alibaba",baidu:"Baidu",bytedance:"ByteDance",tencent:"Tencent",minimax:"MiniMax",nousresearch:"Nous Research",allenai:"Allen AI",inception:"Inception"};function Ts(t,e){const l=t.indexOf("/"),n=l>0?t.slice(0,l):e;return n.startsWith("~")?n.slice(1):n}function Es(t){return ps[t]??Nt[t]??t}function Is(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const bt=30;function _s(t){const e=J.c(40),{connectionId:l,subProviderId:n,subProviderName:i,groupLogo:o,models:c,allConnectionModelIds:g,selectedModels:h,allowAllModels:m,allConnectionModelsSelected:f,onToggleModel:a,onExitAllowAll:u,readOnly:x,defaultExpanded:d}=t,p=re(),[C,R]=$.useState(d),_=d||C,A=R,[N,v]=$.useState(bt);let S;e[0]!==f||e[1]!==m||e[2]!==h?(S=E=>m||f||h.includes("*")||h.includes(E),e[0]=f,e[1]=m,e[2]=h,e[3]=S):S=e[3];const O=S;let M;if(e[4]!==g||e[5]!==m||e[6]!==l||e[7]!==_||e[8]!==o||e[9]!==O||e[10]!==c||e[11]!==u||e[12]!==a||e[13]!==x||e[14]!==n||e[15]!==i||e[16]!==p||e[17]!==N){let E;e[19]!==O?(E=B=>O(B.id),e[19]=O,e[20]=E):E=e[20];const b=c.filter(E).length,D=c.slice(0,N),r=c.length>N;let I;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=()=>A(bs),e[21]=I):I=e[21];const k=o??Et[n]??It;let L;e[22]!==i||e[23]!==k?(L=s.jsx(Ze,{icon:k,name:i,size:"sm"}),e[22]=i,e[23]=k,e[24]=L):L=e[24];let z;e[25]!==i?(z=s.jsx("span",{className:"text-sm font-medium truncate",children:i}),e[25]=i,e[26]=z):z=e[26];let y;e[27]!==L||e[28]!==z?(y=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[L,z]}),e[27]=L,e[28]=z,e[29]=y):y=e[29];const Y=p("settings.orgRoleDetail.enabledCount",{enabledCount:b,total:c.length});let P;e[30]!==Y?(P=s.jsx(Me,{variant:"secondary",className:"text-xs text-muted-foreground",children:Y}),e[30]=Y,e[31]=P):P=e[31];let F;e[32]!==_?(F=_?s.jsx(Jt,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(es,{size:16,className:"text-muted-foreground shrink-0"}),e[32]=_,e[33]=F):F=e[33];let V;e[34]!==P||e[35]!==F?(V=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[P,F]}),e[34]=P,e[35]=F,e[36]=V):V=e[36];let U;e[37]!==V||e[38]!==y?(U=s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 hover:bg-muted/50 cursor-pointer",onClick:I,children:[y,V]}),e[37]=V,e[38]=y,e[39]=U):U=e[39],M=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[U,_&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[D.map(B=>{const Z=O(B.id),X=()=>{if(!x){if(m){u(l,g,B.id);return}a(l,B.id)}};return s.jsxs("div",{className:W("flex items-center justify-between gap-3 px-4 py-3 border-b border-border last:border-b-0",!x&&"hover:bg-muted/50 cursor-pointer"),onClick:X,children:[s.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:s.jsx("span",{className:"text-sm truncate",children:B.title})}),s.jsx("div",{onClick:Ns,children:x?s.jsx(ye,{children:s.jsxs(Pe,{children:[s.jsx(we,{asChild:!0,children:s.jsx("div",{children:s.jsx(De,{checked:Z,disabled:!0,onCheckedChange:Ss})})}),s.jsx(Le,{children:s.jsx("p",{children:p("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(De,{checked:Z,onCheckedChange:X})})]},B.id)}),r&&s.jsx("button",{type:"button",className:"w-full px-4 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",onClick:()=>v(Rs),children:p("settings.orgRoleDetail.showMore",{remaining:c.length-N})})]})]}),e[4]=g,e[5]=m,e[6]=l,e[7]=_,e[8]=o,e[9]=O,e[10]=c,e[11]=u,e[12]=a,e[13]=x,e[14]=n,e[15]=i,e[16]=p,e[17]=N,e[18]=M}else M=e[18];return M}function Rs(t){return t+bt}function Ss(){}function Ns(t){return t.stopPropagation()}function bs(t){return!t}function Cs(t){const e=J.c(33),{connection:l,selectedModels:n,allowAllModels:i,onToggleModel:o,onExitAllowAll:c,allConnectionModelsSelected:g,searchQuery:h,readOnly:m}=t,f=Xt(l.id);let a,u,x,d,p;if(e[0]!==g||e[1]!==i||e[2]!==l.id||e[3]!==l.label||e[4]!==l.providerId||e[5]!==c||e[6]!==o||e[7]!==f||e[8]!==m||e[9]!==h||e[10]!==n){p=Symbol.for("react.early_return_sentinel");e:{let _;e[16]!==l.label?(_=I=>({...I,id:I.modelId,provider:l.label}),e[16]=l.label,e[17]=_):_=e[17];const A=f.filter(vs).map(_),N=h.trim().toLowerCase(),v=N?A.filter(I=>I.title.toLowerCase().includes(N)||I.id.toLowerCase().includes(N)||I.provider?.toLowerCase().includes(N)):A;if(v.length===0){p=null;break e}const S=new Map;for(const I of v){const k=Ts(I.id,l.providerId),L=S.get(k)??{models:[],logo:null};L.models.push({id:I.id,title:Is(I.title),logo:I.logo}),!L.logo&&I.logo&&(L.logo=I.logo),S.set(k,L)}const O=Array.from(S.entries()).map(js).sort(Os),M=O.length===1||N.length>0;x="flex flex-col gap-3";const E=Et[l.providerId]??It;let b;e[18]!==l.providerId||e[19]!==E?(b=s.jsx("img",{src:E,alt:l.providerId,className:"w-4 h-4 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),e[18]=l.providerId,e[19]=E,e[20]=b):b=e[20];const D=Nt[l.providerId]??l.providerId;let r;e[21]!==D?(r=s.jsx("h4",{className:"text-sm font-medium",children:D}),e[21]=D,e[22]=r):r=e[22],e[23]!==r||e[24]!==b?(d=s.jsxs("div",{className:"flex items-center gap-2",children:[b,r]}),e[23]=r,e[24]=b,e[25]=d):d=e[25],a="flex flex-col gap-3",u=O.map(I=>s.jsx(_s,{connectionId:l.id,subProviderId:I.id,subProviderName:I.name,groupLogo:I.logo,models:I.models,allConnectionModelIds:A.map(As),selectedModels:n,allowAllModels:i,allConnectionModelsSelected:g,onToggleModel:o,onExitAllowAll:c,readOnly:m,defaultExpanded:M},I.id))}e[0]=g,e[1]=i,e[2]=l.id,e[3]=l.label,e[4]=l.providerId,e[5]=c,e[6]=o,e[7]=f,e[8]=m,e[9]=h,e[10]=n,e[11]=a,e[12]=u,e[13]=x,e[14]=d,e[15]=p}else a=e[11],u=e[12],x=e[13],d=e[14],p=e[15];if(p!==Symbol.for("react.early_return_sentinel"))return p;let C;e[26]!==a||e[27]!==u?(C=s.jsx("div",{className:a,children:u}),e[26]=a,e[27]=u,e[28]=C):C=e[28];let R;return e[29]!==x||e[30]!==d||e[31]!==C?(R=s.jsxs("div",{className:x,children:[d,C]}),e[29]=x,e[30]=d,e[31]=C,e[32]=R):R=e[32],R}function As(t){return t.id}function Os(t,e){return t.name.localeCompare(e.name)}function js(t){const[e,l]=t;return{id:e,name:Es(e),logo:l.logo,models:l.models}}function vs(t,e,l){return l.findIndex(n=>n.modelId===t.modelId)===e}function Ms(t){const e=J.c(41),{allowAllModels:l,modelSet:n,onAllowAllChange:i,onModelSetChange:o,readOnly:c,searchQuery:g}=t,h=c===void 0?!1:c,m=re(),f=$.useDeferredValue(g),a=Wt();let u;e[0]!==n||e[1]!==o?(u=(E,b)=>{const D=n[E]??[],r={...n};if(D.includes(b)){const I=D.filter(k=>k!==b);I.length===0?delete r[E]:r[E]=I}else r[E]=[...D,b];o(r)},e[0]=n,e[1]=o,e[2]=u):u=e[2];const x=u;let d;e[3]!==n||e[4]!==i||e[5]!==o?(d=(E,b,D)=>{i(!1),o({...n,[E]:b.filter(r=>r!==D)})},e[3]=n,e[4]=i,e[5]=o,e[6]=d):d=e[6];const p=d,C=!h&&"hover:bg-muted/50 cursor-pointer";let R;e[7]!==C?(R=W("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",C),e[7]=C,e[8]=R):R=e[8];let _;e[9]!==l||e[10]!==i||e[11]!==o||e[12]!==h?(_=()=>{if(h)return;const E=!l;i(E),E&&o({})},e[9]=l,e[10]=i,e[11]=o,e[12]=h,e[13]=_):_=e[13];let A;e[14]!==m?(A=m("settings.orgRoleDetail.allModels"),e[14]=m,e[15]=A):A=e[15];let N;e[16]!==A?(N=s.jsx("span",{className:"text-sm font-medium",children:A}),e[16]=A,e[17]=N):N=e[17];let v;e[18]!==l||e[19]!==i||e[20]!==o||e[21]!==h||e[22]!==m?(v=s.jsx("div",{onClick:ys,children:h?s.jsx(ye,{children:s.jsxs(Pe,{children:[s.jsx(we,{asChild:!0,children:s.jsx("div",{children:s.jsx(De,{checked:l,disabled:!0,onCheckedChange:Ds})})}),s.jsx(Le,{children:s.jsx("p",{children:m("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(De,{checked:l,onCheckedChange:E=>{i(E),E&&o({})}})}),e[18]=l,e[19]=i,e[20]=o,e[21]=h,e[22]=m,e[23]=v):v=e[23];let S;e[24]!==R||e[25]!==_||e[26]!==N||e[27]!==v?(S=s.jsxs("div",{className:R,onClick:_,children:[N,v]}),e[24]=R,e[25]=_,e[26]=N,e[27]=v,e[28]=S):S=e[28];let O;e[29]!==a||e[30]!==l||e[31]!==f||e[32]!==p||e[33]!==n||e[34]!==h||e[35]!==m||e[36]!==x?(O=a.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:m("settings.orgRoleDetail.noLlmConnectionsConfigured")}):a.map(E=>s.jsx($.Suspense,{fallback:s.jsxs("div",{className:"px-4 py-3 flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(je,{className:"size-4 animate-spin"}),m("settings.orgRoleDetail.loadingModels")]}),children:s.jsx(Cs,{connection:E,selectedModels:n[E.id]??[],allowAllModels:l,onToggleModel:x,onExitAllowAll:p,allConnectionModelsSelected:(n[E.id]??[]).includes("*"),searchQuery:f,readOnly:h})},E.id)),e[29]=a,e[30]=l,e[31]=f,e[32]=p,e[33]=n,e[34]=h,e[35]=m,e[36]=x,e[37]=O):O=e[37];let M;return e[38]!==S||e[39]!==O?(M=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[S,O]}),e[38]=S,e[39]=O,e[40]=M):M=e[40],M}function Ds(){}function ys(t){return t.stopPropagation()}function Ps(t){const e=J.c(75),{open:l,onOpenChange:n,selectedMemberIds:i,onAddMembers:o}=t,c=re(),[g,h]=$.useState(""),m=$.useDeferredValue(g);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=[],e[0]=f):f=e[0];const[a,u]=$.useState(f),{data:x}=_t();let d,p,C,R,_,A,N,v,S,O,M;if(e[1]!==x?.data?.members||e[2]!==m||e[3]!==o||e[4]!==n||e[5]!==l||e[6]!==a||e[7]!==g||e[8]!==i||e[9]!==c){const P=x?.data?.members??[];let F;e[21]!==m?(F=K=>{const H=m.toLowerCase();return K.user?.name?.toLowerCase().includes(H)||K.user?.email?.toLowerCase().includes(H)},e[21]=m,e[22]=F):F=e[22];const V=P.filter(F);let U;e[23]!==o||e[24]!==n||e[25]!==a?(U=()=>{o(a),u([]),n(!1)},e[23]=o,e[24]=n,e[25]=a,e[26]=U):U=e[26],C=U,p=mt,O=l,M=n,d=ut,v="sm:max-w-md p-0";let B;e[27]!==c?(B=c("settings.orgRoleDetail.addMembersToRole"),e[27]=c,e[28]=B):B=e[28];let Z;e[29]!==B?(Z=s.jsx(ft,{children:B}),e[29]=B,e[30]=Z):Z=e[30];let X;e[31]!==c?(X=c("settings.orgRoleDetail.selectMembersToAddToThisRole"),e[31]=c,e[32]=X):X=e[32];let te;e[33]!==X?(te=s.jsx(gt,{children:X}),e[33]=X,e[34]=te):te=e[34],e[35]!==Z||e[36]!==te?(S=s.jsxs(ht,{className:"px-6 pt-6",children:[Z,te]}),e[35]=Z,e[36]=te,e[37]=S):S=e[37],A="flex flex-col h-80";let le;e[38]!==c?(le=c("settings.orgRoleDetail.searchMembers"),e[38]=c,e[39]=le):le=e[39],e[40]!==g||e[41]!==le?(N=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx(Qe,{value:g,onChange:h,placeholder:le,className:"w-full"})}),e[40]=g,e[41]=le,e[42]=N):N=e[42],R="flex-1 overflow-auto",_=V.length===0?s.jsx("div",{className:"flex items-center justify-center h-full px-6",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:c(g?"settings.orgRoleDetail.noMembersFound":"settings.orgRoleDetail.noMembersAvailable")})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:V.map(K=>{const H=K.role!=="owner",T=i.includes(K.id),G=a.includes(K.id);return s.jsxs("label",{className:W("flex items-center gap-3 p-2 rounded-lg",!H||T?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(He,{checked:G||T,onCheckedChange:()=>{!H||T||u(Q=>Q.includes(K.id)?Q.filter(q=>q!==K.id):[...Q,K.id])},disabled:!H||T}),s.jsx(St,{url:K.user?.image??void 0,fallback:Rt(K.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:K.user?.name||c("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:K.user?.email})]}),!H&&s.jsx(Me,{variant:"secondary",className:"shrink-0",children:c("settings.orgRoleDetail.owner")}),T&&H&&s.jsx(Me,{variant:"outline",className:"shrink-0",children:c("settings.orgRoleDetail.added")})]},K.id)})}),e[1]=x?.data?.members,e[2]=m,e[3]=o,e[4]=n,e[5]=l,e[6]=a,e[7]=g,e[8]=i,e[9]=c,e[10]=d,e[11]=p,e[12]=C,e[13]=R,e[14]=_,e[15]=A,e[16]=N,e[17]=v,e[18]=S,e[19]=O,e[20]=M}else d=e[10],p=e[11],C=e[12],R=e[13],_=e[14],A=e[15],N=e[16],v=e[17],S=e[18],O=e[19],M=e[20];let E;e[43]!==R||e[44]!==_?(E=s.jsx("div",{className:R,children:_}),e[43]=R,e[44]=_,e[45]=E):E=e[45];let b;e[46]!==E||e[47]!==A||e[48]!==N?(b=s.jsxs("div",{className:A,children:[N,E]}),e[46]=E,e[47]=A,e[48]=N,e[49]=b):b=e[49];let D;e[50]!==c?(D=c("settings.orgRoleDetail.cancel"),e[50]=c,e[51]=D):D=e[51];let r;e[52]!==D?(r=s.jsx(xt,{children:D}),e[52]=D,e[53]=r):r=e[53];const I=a.length===0;let k;e[54]!==a.length||e[55]!==c?(k=c("settings.orgRoleDetail.addWithCount",{count:a.length}),e[54]=a.length,e[55]=c,e[56]=k):k=e[56];let L;e[57]!==C||e[58]!==I||e[59]!==k?(L=s.jsx(pt,{onClick:C,disabled:I,children:k}),e[57]=C,e[58]=I,e[59]=k,e[60]=L):L=e[60];let z;e[61]!==r||e[62]!==L?(z=s.jsxs(Tt,{className:"px-6 pb-6",children:[r,L]}),e[61]=r,e[62]=L,e[63]=z):z=e[63];let y;e[64]!==d||e[65]!==b||e[66]!==z||e[67]!==v||e[68]!==S?(y=s.jsxs(d,{className:v,children:[S,b,z]}),e[64]=d,e[65]=b,e[66]=z,e[67]=v,e[68]=S,e[69]=y):y=e[69];let Y;return e[70]!==p||e[71]!==y||e[72]!==O||e[73]!==M?(Y=s.jsx(p,{open:O,onOpenChange:M,children:y}),e[70]=p,e[71]=y,e[72]=O,e[73]=M,e[74]=Y):Y=e[74],Y}function ws(t){const e=J.c(33),{memberIds:l,onMemberIdsChange:n,readOnly:i,readOnlyMessage:o,searchQuery:c,addMemberDialogOpen:g,onAddMemberDialogOpenChange:h}=t,m=i===void 0?!1:i,f=o===void 0?void 0:o,a=re(),u=$.useDeferredValue(c),{data:x}=_t();let d,p,C;if(e[0]!==x?.data?.members||e[1]!==u||e[2]!==l||e[3]!==n||e[4]!==m||e[5]!==f||e[6]!==c||e[7]!==a){const v=x?.data?.members??[];let S;e[11]!==l?(S=r=>l.includes(r.id),e[11]=l,e[12]=S):S=e[12];const O=v.filter(S);let M;e[13]!==u?(M=r=>{const I=u.toLowerCase();return r.user?.name?.toLowerCase().includes(I)||r.user?.email?.toLowerCase().includes(I)},e[13]=u,e[14]=M):M=e[14];const E=O.filter(M);let b;e[15]!==f||e[16]!==a?(b=f??a("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[15]=f,e[16]=a,e[17]=b):b=e[17];const D=b;C="flex flex-col h-full",d="flex-1 overflow-auto",p=O.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h3",{className:"text-base font-medium mb-1",children:a("settings.orgRoleDetail.noMembers")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:a("settings.orgRoleDetail.addMembersToGrantPermissions")})]})}):E.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:a("settings.orgRoleDetail.noMembersMatch",{searchQuery:c})})}):s.jsx("div",{className:"p-4 space-y-2",children:E.map(r=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(St,{url:r.user?.image??void 0,fallback:Rt(r.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:r.user?.name||a("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:r.user?.email})]}),m?s.jsx(ye,{children:s.jsxs(Pe,{children:[s.jsx(we,{asChild:!0,children:s.jsx("div",{children:s.jsx(ce,{variant:"ghost",size:"sm",disabled:!0,"aria-label":a("settings.orgRoleDetail.removeMember",{name:r.user?.name||a("settings.orgRoleDetail.unknown")}),children:s.jsx(nt,{size:16})})})}),s.jsx(Le,{children:s.jsx("p",{children:D})})]})}):s.jsx(ce,{variant:"ghost",size:"sm","aria-label":a("settings.orgRoleDetail.removeMember",{name:r.user?.name||a("settings.orgRoleDetail.unknown")}),onClick:()=>n(l.filter(I=>I!==r.id)),children:s.jsx(nt,{size:16})})]},r.id))}),e[0]=x?.data?.members,e[1]=u,e[2]=l,e[3]=n,e[4]=m,e[5]=f,e[6]=c,e[7]=a,e[8]=d,e[9]=p,e[10]=C}else d=e[8],p=e[9],C=e[10];let R;e[18]!==d||e[19]!==p?(R=s.jsx("div",{className:d,children:p}),e[18]=d,e[19]=p,e[20]=R):R=e[20];let _;e[21]!==l||e[22]!==n?(_=v=>n([...l,...v]),e[21]=l,e[22]=n,e[23]=_):_=e[23];let A;e[24]!==g||e[25]!==l||e[26]!==h||e[27]!==_?(A=s.jsx(Ps,{open:g,onOpenChange:h,selectedMemberIds:l,onAddMembers:_}),e[24]=g,e[25]=l,e[26]=h,e[27]=_,e[28]=A):A=e[28];let N;return e[29]!==C||e[30]!==R||e[31]!==A?(N=s.jsxs("div",{className:C,children:[R,A]}),e[29]=C,e[30]=R,e[31]=A,e[32]=N):N=e[32],N}function Ls(t){const e=J.c(3);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(je,{size:24,className:"animate-spin text-muted-foreground"})}),e[0]=l):l=e[0];let n;return e[1]!==t?(n=s.jsx($.Suspense,{fallback:l,children:s.jsx(ws,{...t})}),e[1]=t,e[2]=n):n=e[2],n}const Gs={owner:[],admin:[],user:[]};function ks(t,e,l,n){const i=t==="owner"||t==="admin";return{role:{id:l?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:i,staticPermissions:Gs[t],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:e.filter(o=>o.role===t).map(o=>o.id)}}function Us(t,e,l){const n=t.permission||{},i=n.self||[],o=i.includes("*"),c=o?[]:i.filter(a=>a!=="*"),g={};for(const[a,u]of Object.entries(n))if(!(a==="self"||a==="models"))if(a==="*")for(const x of l)g[x.id]=u.includes("*")?x.tools?.map(d=>d.name)??[]:u;else{const x=l.find(d=>d.id===a);x&&(g[a]=u.includes("*")?x.tools?.map(d=>d.name)??[]:u)}const h=n.models||[],m=h.length===0||h.includes("*:*"),f={};if(!m)for(const a of h){const u=a.indexOf(":");if(u===-1)continue;const x=a.slice(0,u),d=a.slice(u+1);f[x]||(f[x]=[]),f[x].push(d)}return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:o,staticPermissions:c,toolSet:g,allowAllModels:m,modelSet:f,memberIds:e.filter(a=>a.role===t.role).map(a=>a.id)}}function Bs(t,e){const l={};t.allowAllStaticPermissions?l.self=["*"]:t.staticPermissions.length>0&&(l.self=t.staticPermissions);for(const[n,i]of Object.entries(t.toolSet))if(i.length>0){const c=e.find(g=>g.id===n)?.tools?.map(g=>g.name)??[];l[n]=c.length>0&&c.every(g=>i.includes(g))?["*"]:i}if(t.allowAllModels)l.models=["*:*"];else{const n=[];for(const[i,o]of Object.entries(t.modelSet))for(const c of o)n.push(`${i}:${c}`);n.length>0&&(l.models=n)}return l}function Vs(t,e,l){return t.kind==="builtin"?ks(t.role,e,void 0):t.kind==="custom"?Us(t.role,e,l):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:[]}}function zs(t){const e=J.c(19),{readOnly:l,readOnlyMessage:n,onOpen:i}=t,o=n===void 0?void 0:n,c=re();let g;e[0]!==o||e[1]!==c?(g=o??c("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[0]=o,e[1]=c,e[2]=g):g=e[2];const h=g;if(l){let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Ye,{size:16}),e[3]=u):u=e[3];let x;e[4]!==c?(x=c("settings.orgRoleDetail.addMember"),e[4]=c,e[5]=x):x=e[5];let d;e[6]!==x?(d=s.jsx(we,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ce,{variant:"outline",size:"sm",disabled:!0,children:[u,x]})})}),e[6]=x,e[7]=d):d=e[7];let p;e[8]!==h?(p=s.jsx(Le,{children:s.jsx("p",{children:h})}),e[8]=h,e[9]=p):p=e[9];let C;return e[10]!==d||e[11]!==p?(C=s.jsx(ye,{children:s.jsxs(Pe,{children:[d,p]})}),e[10]=d,e[11]=p,e[12]=C):C=e[12],C}let m;e[13]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Ye,{size:16}),e[13]=m):m=e[13];let f;e[14]!==c?(f=c("settings.orgRoleDetail.addMember"),e[14]=c,e[15]=f):f=e[15];let a;return e[16]!==i||e[17]!==f?(a=s.jsxs(ce,{variant:"outline",size:"sm",onClick:i,children:[m,f]}),e[16]=i,e[17]=f,e[18]=a):a=e[18],a}function Ys(t){const e=J.c(14),{locator:l}=Be(),n=$e(),i=qt();let o;e[0]!==l?(o=me.members(l),e[0]=l,e[1]=o):o=e[1];let c;e[2]!==n?(c=()=>n.organization.listMembers(),e[2]=n,e[3]=c):c=e[3];let g;e[4]!==o||e[5]!==c?(g={queryKey:o,queryFn:c},e[4]=o,e[5]=c,e[6]=g):g=e[6];const{data:h,isPending:m}=Fe(g);if(m||!i){let x;return e[7]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(ie,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(je,{size:32,className:"animate-spin text-muted-foreground"})})}),e[7]=x):x=e[7],x}let f;e[8]!==h?.data?.members?(f=h?.data?.members??[],e[8]=h?.data?.members,e[9]=f):f=e[9];const a=f;let u;return e[10]!==i||e[11]!==a||e[12]!==t?(u=s.jsx(Fs,{...t,members:a,connections:i}),e[10]=i,e[11]=a,e[12]=t,e[13]=u):u=e[13],u}function Fs({target:t,onBack:e,onSaved:l,members:n,connections:i}){const o=re(),{locator:c}=Be(),g=$e(),h=rt(),m=t.kind==="builtin",f=t.kind==="builtin"&&t.role==="owner",a=t.kind==="new",[u,x]=$.useState(m?"org":"mcp"),d=Ot({resolver:jt(us),defaultValues:Vs(t,n,i)}),p=d.formState.isValid,C=d.formState.isDirty,R=at({mutationFn:async r=>{const I=Bs(r,i),k=r.role.slug||r.role.label.toLowerCase().replace(/\s+/g,"-"),L=(r.role.slug==="owner"||r.role.slug==="admin"||r.role.slug==="user")&&!r.role.id,z=async(y,Y)=>{const P=n.filter(U=>U.role===(Y??y)).map(U=>U.id),F=r.memberIds.filter(U=>!P.includes(U)),V=P.filter(U=>!r.memberIds.includes(U));for(const U of F){const B=await g.organization.updateMemberRole({memberId:U,role:[y]});if(B?.error)throw new Error(B.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}for(const U of V){const B=await g.organization.updateMemberRole({memberId:U,role:["user"]});if(B?.error)throw new Error(B.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}};if(L)return await z(r.role.slug),r;if(r.role.id){const y=r.role.label.toLowerCase().replace(/\s+/g,"-"),Y=r.role.slug,P=y!==Y,F=await g.organization.updateRole({roleId:r.role.id,data:{permission:I,...P?{roleName:y}:{}}});if(F?.error)throw new Error(F.error.message??o("settings.orgRoleDetail.somethingWentWrong"));return await z(P?y:Y,P?Y:void 0),P?{...r,role:{...r.role,slug:y}}:r}else{const y=await g.organization.createRole({role:k,permission:I});if(y?.error)throw new Error(y.error.message??o("settings.orgRoleDetail.somethingWentWrong"));for(const Y of r.memberIds){const P=await g.organization.updateMemberRole({memberId:Y,role:[k]});if(P?.error)throw new Error(P.error.message)}return{...r,role:{...r.role,id:y.data?.roleData?.id,slug:k}}}},onSuccess:(r,I)=>{h.invalidateQueries({queryKey:me.members(c)}),h.invalidateQueries({queryKey:me.organizationRoles(c)});const k=!I.role.id&&!I.role.slug,L=I.role.slug==="owner"&&!I.role.id;Ke(L?"role_members_updated":k?"role_created":"role_updated",{role_slug:I.role.slug??null}),ve.success(o(L?"settings.orgRoleDetail.membersUpdatedSuccessfully":k?"settings.orgRoleDetail.roleCreatedSuccessfully":"settings.orgRoleDetail.roleUpdatedSuccessfully")),d.reset(r),l(r.role.id)},onError:r=>{ve.error(r instanceof Error?r.message:o("settings.orgRoleDetail.failedToSaveRole"))}}),_=d.handleSubmit(r=>{if(!r.role.label.trim()){ve.error(o("settings.orgRoleDetail.roleNameIsRequired")),d.setFocus("role.label");return}R.mutate(r)}),A=!f,N=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",v=[...f?[]:[{id:"mcp",label:o("settings.orgRoleDetail.mcpPermissions")}],{id:"org",label:o("settings.orgRoleDetail.organizationPermissions")},{id:"models",label:o("settings.orgRoleDetail.models")},{id:"members",label:o("settings.orgRoleDetail.members")}],[S,O]=$.useState(""),[M,E]=$.useState(!1),b=r=>{x(r),O("")},D={mcp:o("settings.orgRoleDetail.searchMcpServers"),org:o("settings.orgRoleDetail.searchPermissions"),models:o("settings.orgRoleDetail.searchModels"),members:o("settings.orgRoleDetail.searchMembers")};return s.jsx(ie,{children:s.jsxs(ie.Content,{className:W("flex flex-col",u!=="org"&&"overflow-hidden"),children:[s.jsx("div",{className:"shrink-0 mx-auto w-full max-w-[1200px] px-4 md:px-10 pt-8 md:pt-12 pb-4",children:s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(ie.Title,{actions:A&&s.jsxs(s.Fragment,{children:[s.jsx(ce,{variant:"outline",size:"sm",onClick:e,disabled:R.isPending,children:o("settings.orgRoleDetail.cancel")}),s.jsx(ce,{size:"sm",onClick:_,disabled:R.isPending||!p||!C,children:R.isPending?o("settings.orgRoleDetail.saving"):o(a?"settings.orgRoleDetail.createRole":"settings.orgRoleDetail.saveChanges")})]}),children:s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:W("size-2.5 rounded-full shrink-0",t.kind==="builtin"?dt(t.role,!0):wt(d.watch("role.label")))}),f&&s.jsx(ct,{size:16,className:"text-muted-foreground shrink-0"}),a||t.kind==="custom"?s.jsx("input",{...d.register("role.label"),placeholder:o("settings.orgRoleDetail.roleName"),className:"leading-tight text-foreground bg-transparent border-none outline-none px-1 -mx-1 rounded hover:bg-input/25 focus:bg-input/25 transition-colors w-64 placeholder:text-muted-foreground/50",autoFocus:a}):s.jsx("span",{className:"truncate",children:N})]})}),s.jsx("div",{className:"flex items-center gap-2",children:v.map(r=>s.jsx("button",{type:"button",onClick:()=>b(r.id),className:W("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex items-center",u===r.id?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:r.label},r.id))}),s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(Qe,{value:S,onChange:O,placeholder:D[u]??"Search...",className:"w-full md:w-[375px]"}),u==="members"&&s.jsx(zs,{readOnly:t.kind==="builtin"&&t.role==="owner",onOpen:()=>E(!0)})]})]})}),s.jsx("div",{className:W("mx-auto w-full max-w-[1200px] px-4 md:px-10 pb-6",u!=="org"&&"flex-1 min-h-0"),children:s.jsxs("div",{className:W(u!=="org"&&"h-full overflow-hidden",u!=="models"&&u!=="org"&&"border border-border rounded-xl bg-card"),children:[u==="mcp"&&!f&&s.jsx(ms,{toolSet:d.watch("toolSet"),onToolSetChange:r=>d.setValue("toolSet",r,{shouldDirty:!0}),searchQuery:S}),u==="org"&&s.jsx(fs,{allowAllStaticPermissions:d.watch("allowAllStaticPermissions"),staticPermissions:d.watch("staticPermissions"),onAllowAllChange:r=>d.setValue("allowAllStaticPermissions",r,{shouldDirty:!0}),onPermissionsChange:r=>d.setValue("staticPermissions",r,{shouldDirty:!0}),readOnly:f,searchQuery:S}),u==="models"&&s.jsx(Ms,{allowAllModels:d.watch("allowAllModels"),modelSet:d.watch("modelSet"),onAllowAllChange:r=>d.setValue("allowAllModels",r,{shouldDirty:!0}),onModelSetChange:r=>d.setValue("modelSet",r,{shouldDirty:!0}),readOnly:f,searchQuery:S}),u==="members"&&s.jsx(Ls,{memberIds:d.watch("memberIds"),onMemberIdsChange:r=>d.setValue("memberIds",r,{shouldDirty:!0}),readOnly:t.kind==="builtin"&&(t.role==="owner"||t.role==="user"),readOnlyMessage:t.kind==="builtin"&&t.role==="user"?o("settings.orgRoleDetail.userIsDefaultRoleMessage"):o("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),searchQuery:S,addMemberDialogOpen:M,onAddMemberDialogOpenChange:E})]})})]})})}function Ks(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}function $s(t){const e=J.c(6),{area:l,children:n}=t,{isPrivileged:i,loading:o,error:c}=ts();let g;return e[0]!==l||e[1]!==n||e[2]!==c||e[3]!==i||e[4]!==o?(g=s.jsx(ss,{granted:i,loading:o,error:c,area:l,children:n}),e[0]=l,e[1]=n,e[2]=c,e[3]=i,e[4]=o,e[5]=g):g=e[5],g}const Qs=[{role:"owner",labelKey:"settings.roles.roleOwner"},{role:"admin",labelKey:"settings.roles.roleAdmin"},{role:"user",labelKey:"settings.roles.roleUser"}];function Zs(){const t=J.c(135),e=re(),[l,n]=$.useState(""),[i,o]=$.useState(null),c=Dt();let g;t[0]===Symbol.for("react.memo_cache_sentinel")?(g={strict:!1},t[0]=g):g=t[0];const{role:h}=yt(g),{locator:m}=Be(),f=$e(),a=rt(),{customRoles:u,refetch:x}=Pt();let d;t[1]!==c?(d=j=>c({to:".",search:w=>({...w,role:j})}),t[1]=c,t[2]=d):d=t[2];const p=d;let C;e:{if(!h){C=null;break e}if(h==="new"){C={kind:"new"};break e}if(h.startsWith("builtin-")){C={kind:"builtin",role:h.slice(8)};break e}let j;t[3]!==h?(j=ee=>ee.id===h,t[3]=h,t[4]=j):j=t[4];const w=u.find(j);C=w?{kind:"custom",role:w}:null}const R=C;let _;t[5]!==m?(_=me.members(m),t[5]=m,t[6]=_):_=t[6];let A;t[7]!==f?(A=()=>f.organization.listMembers(),t[7]=f,t[8]=A):A=t[8];let N;t[9]!==_||t[10]!==A?(N={queryKey:_,queryFn:A},t[9]=_,t[10]=A,t[11]=N):N=t[11];const{data:v}=Fe(N);let S;t[12]!==v?.data?.members?(S=v?.data?.members??[],t[12]=v?.data?.members,t[13]=S):S=t[13];const O=S;let M;t[14]!==O?(M=j=>O.filter(w=>w.role===j).length,t[14]=O,t[15]=M):M=t[15];const E=M;let b;if(t[16]!==u||t[17]!==E||t[18]!==l||t[19]!==e){let j;t[21]!==E||t[22]!==e?(j=de=>({kind:"builtin",role:{...de,memberCount:E(de.role),label:e(de.labelKey)}}),t[21]=E,t[22]=e,t[23]=j):j=t[23];const w=Qs.map(j);let ee;t[24]!==E?(ee=de=>({kind:"custom",role:{...de,memberCount:E(de.role)}}),t[24]=E,t[25]=ee):ee=t[25];const Ct=u.map(ee);if(b=[...w,...Ct],l){const de=l.toLowerCase();b=b.filter(At=>At.role.label.toLowerCase().includes(de))}t[16]=u,t[17]=E,t[18]=l,t[19]=e,t[20]=b}else b=t[20];let D;t[26]!==f?(D=async j=>{const w=await f.organization.deleteRole({roleId:j});if(w?.error)throw new Error(w.error.message);return w?.data},t[26]=f,t[27]=D):D=t[27];const r=at({mutationFn:D,onSuccess:(j,w)=>{Ke("role_deleted",{role_id:w}),a.invalidateQueries({queryKey:me.members(m)}),a.invalidateQueries({queryKey:me.organizationRoles(m)}),ve.success(e("settings.roles.deletedSuccessfully")),x(),R?.kind==="custom"&&R.role.id===w&&p(void 0)},onError:Js});let I;t[28]!==e?(I=e("settings.roles.columnRole"),t[28]=e,t[29]=I):I=t[29];let k;t[30]!==I?(k={id:"role",header:I,render:Xs,cellClassName:"flex-1 min-w-0",sortable:!0},t[30]=I,t[31]=k):k=t[31];let L;t[32]!==e?(L=e("settings.roles.columnType"),t[32]=e,t[33]=L):L=t[33];let z;t[34]!==e?(z=j=>j.kind==="builtin"?s.jsx(Me,{variant:"secondary",className:"text-xs",children:e("settings.roles.builtIn")}):s.jsx(Me,{variant:"outline",className:"text-xs",children:e("settings.roles.custom")}),t[34]=e,t[35]=z):z=t[35];let y;t[36]!==L||t[37]!==z?(y={id:"type",header:L,render:z,cellClassName:"w-28 shrink-0"},t[36]=L,t[37]=z,t[38]=y):y=t[38];let Y;t[39]!==e?(Y=e("settings.roles.columnPermissions"),t[39]=e,t[40]=Y):Y=t[40];let P;t[41]!==e?(P=j=>{if(j.kind==="builtin")return j.role.role==="owner"||j.role.role==="admin"?s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.fullAccess")}):s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.basicAccess")});const w=j.role,ee=[];return w.allowsAllStaticPermissions?ee.push(e("settings.roles.fullOrgAccess")):w.staticPermissionCount&&w.staticPermissionCount>0&&ee.push(e("settings.roles.orgPermsCount",{count:w.staticPermissionCount})),w.allowsAllConnections?ee.push(e("settings.roles.allConnections")):w.connectionCount&&w.connectionCount>0&&ee.push(e("settings.roles.connectionCount",{count:w.connectionCount})),s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:ee.length>0?ee.join(", "):e("settings.roles.noPermissions")})},t[41]=e,t[42]=P):P=t[42];let F;t[43]!==Y||t[44]!==P?(F={id:"permissions",header:Y,render:P,cellClassName:"flex-1 min-w-0"},t[43]=Y,t[44]=P,t[45]=F):F=t[45];let V;t[46]!==e?(V=e("settings.roles.columnMembers"),t[46]=e,t[47]=V):V=t[47];let U;t[48]!==V?(U={id:"members",header:V,render:Ws,cellClassName:"w-24 shrink-0"},t[48]=V,t[49]=U):U=t[49];let B;t[50]!==e?(B={id:"actions",header:"",render:j=>j.kind==="builtin"?null:s.jsxs(Lt,{children:[s.jsx(Gt,{asChild:!0,children:s.jsx(ce,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:qs,children:s.jsx(Bt,{size:16})})}),s.jsx(kt,{align:"end",onClick:Hs,children:s.jsxs(Ut,{variant:"destructive",onClick:()=>{const w=j.role;w.id&&o({id:w.id,label:w.label})},children:[s.jsx(Vt,{size:16}),e("settings.roles.delete")]})})]}),cellClassName:"w-12 shrink-0"},t[50]=e,t[51]=B):B=t[51];let Z;t[52]!==k||t[53]!==y||t[54]!==F||t[55]!==U||t[56]!==B?(Z=[k,y,F,U,B],t[52]=k,t[53]=y,t[54]=F,t[55]=U,t[56]=B,t[57]=Z):Z=t[57];const X=Z;let te;t[58]!==p?(te=j=>{if(j.kind==="builtin")p(`builtin-${j.role.role}`);else{const w=j.role;p(w.id)}},t[58]=p,t[59]=te):te=t[59];const le=te;if(R){let j;t[60]!==p?(j=()=>p(void 0),t[60]=p,t[61]=j):j=t[61];let w;return t[62]!==x||t[63]!==p?(w=()=>{x(),p(void 0)},t[62]=x,t[63]=p,t[64]=w):w=t[64],s.jsx(Ys,{target:R,onBack:j,onSaved:w},Ks(R))}let K;t[65]!==e?(K=e("settings.roles.pageTitle"),t[65]=e,t[66]=K):K=t[66];let H;t[67]!==K?(H=s.jsx(ie.Title,{children:K}),t[67]=K,t[68]=H):H=t[68];let T;t[69]!==e?(T=e("settings.roles.searchPlaceholder"),t[69]=e,t[70]=T):T=t[70];let G;t[71]===Symbol.for("react.memo_cache_sentinel")?(G=j=>{j.key==="Escape"&&(n(""),j.target.blur())},t[71]=G):G=t[71];let Q;t[72]!==l||t[73]!==T?(Q=s.jsx(Qe,{value:l,onChange:n,placeholder:T,className:"w-full md:w-[375px]",onKeyDown:G}),t[72]=l,t[73]=T,t[74]=Q):Q=t[74];let q;t[75]!==p?(q=()=>p("new"),t[75]=p,t[76]=q):q=t[76];let ne;t[77]===Symbol.for("react.memo_cache_sentinel")?(ne=s.jsx(Ye,{size:16}),t[77]=ne):ne=t[77];let se;t[78]!==e?(se=e("settings.roles.createRole"),t[78]=e,t[79]=se):se=t[79];let oe;t[80]!==q||t[81]!==se?(oe=s.jsxs(ce,{onClick:q,children:[ne,se]}),t[80]=q,t[81]=se,t[82]=oe):oe=t[82];let ue;t[83]!==Q||t[84]!==oe?(ue=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[Q,oe]}),t[83]=Q,t[84]=oe,t[85]=ue):ue=t[85];let fe;t[86]!==l||t[87]!==e?(fe=l?s.jsx(tt,{title:e("settings.roles.noRolesFound"),description:e("settings.roles.noRolesMatchSearch",{search:l})}):s.jsx(tt,{title:e("settings.roles.noRoles"),description:e("settings.roles.createRoleGetStarted")}),t[86]=l,t[87]=e,t[88]=fe):fe=t[88];let ge;t[89]!==b||t[90]!==X||t[91]!==le||t[92]!==fe?(ge=s.jsx(zt,{columns:X,data:b,isLoading:!1,onRowClick:le,emptyState:fe}),t[89]=b,t[90]=X,t[91]=le,t[92]=fe,t[93]=ge):ge=t[93];let he;t[94]!==H||t[95]!==ue||t[96]!==ge?(he=s.jsx(ie.Content,{children:s.jsx(ie.Body,{children:s.jsxs("div",{className:"flex flex-col gap-6",children:[H,ue,ge]})})}),t[94]=H,t[95]=ue,t[96]=ge,t[97]=he):he=t[97];const Ve=i!==null;let Ge;t[98]===Symbol.for("react.memo_cache_sentinel")?(Ge=j=>!j&&o(null),t[98]=Ge):Ge=t[98];let xe;t[99]!==e?(xe=e("settings.roles.deleteRoleTitle"),t[99]=e,t[100]=xe):xe=t[100];let pe;t[101]!==xe?(pe=s.jsx(ft,{children:xe}),t[101]=xe,t[102]=pe):pe=t[102];const ze=i?.label??"";let Te;t[103]!==e||t[104]!==ze?(Te=e("settings.roles.deleteRoleConfirm",{role:ze}),t[103]=e,t[104]=ze,t[105]=Te):Te=t[105];let Ee;t[106]!==Te?(Ee=s.jsx(gt,{children:Te}),t[106]=Te,t[107]=Ee):Ee=t[107];let Ie;t[108]!==pe||t[109]!==Ee?(Ie=s.jsxs(ht,{children:[pe,Ee]}),t[108]=pe,t[109]=Ee,t[110]=Ie):Ie=t[110];let _e;t[111]!==e?(_e=e("settings.roles.cancel"),t[111]=e,t[112]=_e):_e=t[112];let Re;t[113]!==_e?(Re=s.jsx(xt,{children:_e}),t[113]=_e,t[114]=Re):Re=t[114];let Se;t[115]!==r||t[116]!==i?(Se=()=>{i?.id&&r.mutate(i.id),o(null)},t[115]=r,t[116]=i,t[117]=Se):Se=t[117];let Ne;t[118]!==e?(Ne=e("settings.roles.delete"),t[118]=e,t[119]=Ne):Ne=t[119];let be;t[120]!==Se||t[121]!==Ne?(be=s.jsx(pt,{onClick:Se,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ne}),t[120]=Se,t[121]=Ne,t[122]=be):be=t[122];let Ce;t[123]!==Re||t[124]!==be?(Ce=s.jsxs(Tt,{children:[Re,be]}),t[123]=Re,t[124]=be,t[125]=Ce):Ce=t[125];let Ae;t[126]!==Ie||t[127]!==Ce?(Ae=s.jsxs(ut,{children:[Ie,Ce]}),t[126]=Ie,t[127]=Ce,t[128]=Ae):Ae=t[128];let Oe;t[129]!==Ve||t[130]!==Ae?(Oe=s.jsx(mt,{open:Ve,onOpenChange:Ge,children:Ae}),t[129]=Ve,t[130]=Ae,t[131]=Oe):Oe=t[131];let ke;return t[132]!==he||t[133]!==Oe?(ke=s.jsxs(ie,{children:[he,Oe]}),t[132]=he,t[133]=Oe,t[134]=ke):ke=t[134],ke}function Hs(t){return t.stopPropagation()}function qs(t){return t.stopPropagation()}function Ws(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function Xs(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:W("size-2.5 rounded-full shrink-0",dt(t.role.role,t.kind==="builtin"))}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:t.role.label}),t.kind==="builtin"&&s.jsx(ct,{size:12,className:"text-muted-foreground shrink-0"})]})}function Js(t,e){Ke("role_delete_failed",{role_id:e,error:t instanceof Error?t.message:String(t)}),ve.error(t instanceof Error?t.message:"Failed to delete role")}function el(){const t=J.c(7),e=re();let l;t[0]!==e?(l=e("settings.roles.failedToLoad"),t[0]=e,t[1]=l):l=t[1];let n;t[2]!==l?(n=s.jsx(ie,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:l})})}),t[2]=l,t[3]=n):n=t[3];let i;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx($.Suspense,{fallback:s.jsx(ie,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(je,{size:32,className:"animate-spin text-muted-foreground"})})}),children:s.jsx(Zs,{})}),t[4]=i):i=t[4];let o;return t[5]!==n?(o=s.jsx(Mt,{fallback:n,children:i}),t[5]=n,t[6]=o):o=t[6],o}function Po(){const t=J.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx($s,{area:"roles",children:s.jsx(el,{})}),t[0]=e):e=t[0],e}export{Po as default};
@@ -1,2 +0,0 @@
1
- import{c as Ge,b as it,r as V,m as Oe,j as n,af as Gn,B as Je,k as Wn,o as _a,t as Q,K as ja}from"./index-Dk9RGAqb.js";import{a3 as Ea,a4 as ka,a5 as Ra,H as Un,J as Yt,a6 as qn,a7 as Jn,K as Yn,P as Qn,i as Xn,a8 as wa,V as Zn,W as es,a9 as Va,aa as Na,G as Da,L as ts,M as At,Q as ns,U as ss,N as as,_ as os,ab as Ta,ac as Mt,ad as Pa,S as rs,ae as rt,af as Ca,ag as Aa,ah as Ma,ai as Ka,e as La,k as Ba,aj as Fa,ak as Oa,al as Ia,am as $a,r as Gt,an as Wt,ao as za,ap as xt,aq as Tt,ar as Ha,as as Ga,at as Ze,au as Pn,av as Wa,aw as Pt,ax as Ut,ay as Ua,az as un,aA as qa,aB as wt,aC as Ja,aD as Ya,aE as Qa,aF as Xa,aG as Za,aH as bt,aI as eo,aJ as to,aK as no,m as so,aL as Cn,aM as Ct,aN as ao,aO as oo,aP as ro,aQ as io,aR as dn,aS as An,aT as Mn,aU as Vt,aV as qt,aW as Kn,aX as lo,aY as mn,aZ as co,a_ as uo,a$ as mo,b0 as Ln,b1 as fo,b2 as po}from"./index-CwhgWx3d.js";import{t as go}from"./ChevronDown-B3fDqERa.js";import{a0 as pn,V as is,G as ho,z as ls,a1 as vo,a2 as So}from"./agent-icon-E6ioveGx.js";import{i as cs}from"./ChevronRight-Dkp8mDOd.js";import{n as xo}from"./ChevronUp-Cm7VcWLZ.js";import{i as bo}from"./Globe01-CEh6-y49.js";import{m as Jt}from"./automation-runs-CfKwQe7C.js";import{c as yt,T as _t,a as jt}from"./tooltip-xp77jFs4.js";import{b as yo,h as _o,a as jo,c as Eo,d as ko,e as Ro}from"./dialog-CzDwjrNV.js";import{I as wo}from"./input-C-gHIQip.js";import{a as us}from"./Copy01-uQh3Q5Fv.js";import{c as Vo}from"./ZoomOut-B-F-8cp0.js";import{i as No}from"./Settings02-BIGi-T7s.js";import{s as Do}from"./Eye-SCLKEZSh.js";import{s as ds}from"./TrendUp01-CYCVS1zr.js";import{s as gn}from"./Plus-CLG5QKCr.js";import{s as ms}from"./Trash01-CWIa_mDx.js";import{i as To}from"./Zap-CrMVm5NK.js";import{a as vt,D as fs,b as ps,c as gs,i as Po}from"./dropdown-menu-CSgtqrA3.js";import{S as Co,r as Bn,a as Ao,d as Mo,b as Ko,i as Lo,f as Bo,P as Fo,c as Oo}from"./page-seo-form-C7Dzevsc.js";import{b as Io}from"./Tool01-B0759esA.js";import{A as $o}from"./add-section-modal-NM4MqPkB.js";import"./ArrowUp-DI1fyC1G.js";import"./chat-context-BF6sak7i.js";import"./autosend-CMYVBxZV.js";import"./hooks-CvwQxo-K.js";import"./use-mcp-client-Bzvvd0Df.js";import"./auth-C4POVeVe.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-C_GcVLtN.js";import"./studio-tools-CFgWeCBk.js";import"./use-virtual-mcp-BP-M67aZ.js";import"./use-ai-providers-Bujq_lmM.js";import"./location-BpLtHjTZ.js";import"./tab-id-BijBBRwE.js";import"./use-decopilot-events-B3KnAJRh.js";import"./use-organization-settings-zX_T-3XG.js";import"./drawer-CSHRJeTj.js";import"./collection-search-zQnUIpxo.js";import"./SearchMd-DBj7HhoW.js";import"./use-mobile-DQ8jManM.js";import"./AreaChart-CB1-fSKl.js";import"./index-DaeJeAuV.js";import"./calendar-DV0NS9xq.js";import"./X-BYXAQs6v.js";import"./shell-layout-DCFL_zE0.js";import"./avatar-BQF1QGjq.js";import"./User01-NxrNjn_h.js";import"./Users03-3lwc9liE.js";import"./SearchLg-CkXJjhdf.js";import"./Stars02-DpsxkqJO.js";import"./XClose-CW0R6bEe.js";import"./CheckCircle-Dh-3VdHB.js";import"./FilterLines-13dE_TWB.js";import"./required-auth-layout-BfZFGRtL.js";import"./use-org-sso-w9j-Ok-z.js";import"./index-DKhbAOZU.js";import"./get-initials-D-f_fDFw.js";import"./SwitchHorizontal01-Dw_LQc0f.js";import"./popover-C2fPnPJt.js";import"./use-registry-app-DdwkqhPA.js";import"./use-mcp-tools-IcUfyh43.js";import"./use-connection-BsS-3rZB.js";import"./github-repo-scope-DjMZbiKa.js";import"./authenticate-and-persist-oauth-iHWUIj8u.js";import"./mcp-oauth-Br5ozXBx.js";import"./extract-connection-data-ChU9AlhE.js";import"./metadata-dUsYcpuu.js";import"./use-members-Cf3JeQ7o.js";import"./use-org-auth-client-B1nrzsgv.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./AlertCircle-1e3-NcEA.js";import"./DotsVertical-DKanPfz6.js";import"./use-copy-DmTk3Ltj.js";import"./Check-LKA0FKR0.js";import"./LinkExternal01-Di_tOfr7.js";import"./command-CaEk5uho.js";import"./index-DLEyNPFn.js";import"./ArrowRight-B-wHAJWT.js";import"./companions-core-Bua_v2zd.js";import"./ZapSquare-DGe1cTc7.js";import"./Star01-lWHLfmir.js";import"./Image01-CMEjSR3M.js";import"./Upload01-CPD95nN4.js";import"./form-CJlgALpE.js";import"./label-D9aEMZqo.js";import"./select-Bd1WKGSJ.js";import"./tabs-BBm6nSot.js";import"./Tool02-DPXeBg9E.js";import"./toggle-group-DaeRkjf6.js";import"./use-deco-credits-BW-cf-qH.js";import"./sidebar-DBzYJLC2.js";import"./LayoutLeft-Yz5NzG-w.js";import"./alert-dialog-DwnblylQ.js";import"./toolbar-icon-button-BGQ8DzLo.js";import"./skeleton-DoNQnm-q.js";import"./github-repo-picker-DeAiQyIc.js";import"./use-debounced-value-D9jV_d1U.js";import"./use-navigate-to-agent-D_vSOLwA.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./connection-card-CfMynI7E.js";import"./use-registry-connections-C529xEPn.js";import"./useInfiniteQuery-64uGdBMx.js";import"./use-infinite-scroll-CbSN3uty.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-DcA1Rwjs.js";import"./integration-icon-DBUjxWMb.js";import"./textarea-CQzBh7SW.js";import"./connection-form-helpers-BABNaeU1.js";import"./collection-tabs-B-9Urj68.js";import"./badge-BbmHyS30.js";import"./useSuspenseInfiniteQuery-DYsYorpe.js";import"./Monitor01-C_dYkXdo.js";import"./connect-desktop-dialog-CxqDr22T.js";import"./select-model-BeSzDzZp.js";import"./checkbox-DsDzIgcJ.js";import"./Key01-CgioJ7nW.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-Dh6zLap9.js";import"./ArrowUpRight-BWyzrLQV.js";import"./Stars01-B3jznQQ4.js";import"./index-EFMlI3jy.js";import"./Palette-CsQxyyrG.js";import"./file-type-icon-_JzjFo75.js";import"./toolbar-CoHzPWWi.js";import"./Package-R2sM0vCm.js";import"./index-CRECkoeT.js";import"./XCircle-B3aYrCCW.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-D-dtBAQ9.js";import"./empty-state-CwB9YNml.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-DHlRnvUE.js";import"./pt-BR-CLy76QW2.js";import"./use-mcp-auth-status-UXgrVZIV.js";import"./Play-CVGtm9ao.js";import"./use-debounced-autosave-C7P_JRA0.js";import"./index-D8ngUVkT.js";import"./search-input-BI1enB-b.js";import"./switch-J9ypA9K4.js";import"./Users01-DvtVVxdG.js";import"./use-secrets-CTWWthzy.js";import"./useQueries-b2s80Vy2.js";import"./monaco-editor-CIeX3g7j.js";import"./use-file-configs-D6Dg-9sN.js";import"./use-automations-m1Zli3xa.js";import"./automation-list-row-BDIVGPMe.js";import"./Globe04-B4VpGXlx.js";import"./HardDrive-DViLU95V.js";import"./LogOut01-r12Fp93g.js";import"./Sun-tOsjvEis.js";import"./Shield01-ksb0VZpA.js";import"./table-CIOCQP8H.js";import"./use-clock-tick-jphDPs9A.js";function zo(g){return g.schema?.definitions??g.schema?.$defs??{}}function Ho(g,e){const o=zo(e),d=o[btoa(g)];if(!d)return;let f=typeof d.image=="string"?d.image:void 0;if(!f&&Array.isArray(d.allOf)){const x=d.allOf.find(b=>typeof b.$ref=="string")?.$ref;if(typeof x=="string"){const b=x.replace("#/definitions/",""),m=o[b];f=typeof m?.image=="string"?m.image:void 0}}if(f?.includes("{{{"))return f}function Go(g,e){if(!e)return;const o=Ea(g);if(!o)return;const d=Ho(o.resolveType,e);if(!d)return;const f=ka(d,o.data);if(f)return Ra(f)}const Wo="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Uo="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 Fn(g){return Array.from({length:g},(e,o)=>({id:crypto.randomUUID(),index:o}))}function hs(g){return g.map((e,o)=>({...e,index:o}))}function qo(g,e){if(e===g.length)return g;if(e<g.length)return hs(g.slice(0,e));const o=Array.from({length:e-g.length},(d,f)=>({id:crypto.randomUUID(),index:g.length+f}));return[...g,...o]}function vs(g){const e=Ge.c(20),{section:o,raw:d,meta:f}=g,x=o.isSavedBlock===!0,b=o.isMultivariate===!0;let m;e[0]!==f||e[1]!==d?(m=d&&f?Go(d,f):void 0,e[0]=f,e[1]=d,e[2]=m):m=e[2];const h=m;let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Vo,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=u):u=e[3];let y;e[4]!==h?(y=h&&n.jsx("img",{src:h,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=h,e[5]=y):y=e[5];let k;e[6]!==b||e[7]!==x?(k=x?{color:Da}:b?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=b,e[7]=x,e[8]=k):k=e[8];let D;e[9]!==k?(D=n.jsx(pn,{className:"h-4 w-4 shrink-0",style:k}),e[9]=k,e[10]=D):D=e[10];const E=o.isHidden&&"line-through opacity-50";let i;e[11]!==E?(i=Oe("min-w-0 flex-1 truncate text-sm font-medium",E),e[11]=E,e[12]=i):i=e[12];let p;e[13]!==o.label||e[14]!==i?(p=n.jsx("span",{className:i,children:o.label}),e[13]=o.label,e[14]=i,e[15]=p):p=e[15];let r;return e[16]!==y||e[17]!==D||e[18]!==p?(r=n.jsxs(n.Fragment,{children:[u,y,D,p]}),e[16]=y,e[17]=D,e[18]=p,e[19]=r):r=e[19],r}function Ss(g,e){const o=g.isSavedBlock===!0,d=g.isMultivariate===!0;return Oe("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":o?Wo:d?"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 Jo(g){const e=Ge.c(81),{section:o,raw:d,meta:f,sortableId:x,selected:b,onSelect:m,onDelete:h,onDuplicate:u,onMakeReusable:y,onToggleHidden:k,onToggleLazy:D,onAddVariant:E,onDetach:i}=g,p=it(),r=d?Xn(d.__resolveType??""):!1;let P;e[0]!==o?(P=wa(o),e[0]=o,e[1]=P):P=e[1];const l=P;let R;e[2]!==x?(R={id:x,animateLayoutChanges:er},e[2]=x,e[3]=R):R=e[3];const{attributes:A,listeners:z,setNodeRef:v,transform:C,isDragging:re}=Zn(R);let L;e[4]!==C?(L=es.Transform.toString(C?{...C,x:0}:null),e[4]=C,e[5]=L):L=e[5];const ue=re?0:void 0;let K;e[6]!==L||e[7]!==ue?(K={transform:L,opacity:ue},e[6]=L,e[7]=ue,e[8]=K):K=e[8];const ge=K;let B;e[9]!==o?(B=Va(o),e[9]=o,e[10]=B):B=e[10];const se=B,he="button",fe=0;let F;e[11]!==m?(F=G=>{(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),m())},e[11]=m,e[12]=F):F=e[12];const J=re?"cursor-grabbing":"cursor-pointer";let X;e[13]!==o||e[14]!==b||e[15]!==J?(X=Oe("touch-none transition-colors",J,Ss(o,b)),e[13]=o,e[14]=b,e[15]=J,e[16]=X):X=e[16];let ie;e[17]!==f||e[18]!==d||e[19]!==o?(ie=n.jsx(vs,{section:o,raw:d,meta:f}),e[17]=f,e[18]=d,e[19]=o,e[20]=ie):ie=e[20];const O=!o.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":p(r?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:Oe("h-7 w-7 shrink-0",r?"":"opacity-0 group-hover:opacity-100"),onClick:G=>{G.stopPropagation(),D()},onPointerDown:Zo,children:n.jsx(To,{className:Oe("h-3.5 w-3.5",r&&"text-yellow-500")})})}),n.jsx(jt,{side:"bottom",children:p(r?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]});let Le;e[21]!==k||e[22]!==o.isHidden||e[23]!==o.isMultivariate||e[24]!==p?(Le=!o.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":o.isHidden?p("sectionsEditor.sectionList.showSection"):p("sectionsEditor.sectionList.hideSection"),className:Oe("h-7 w-7 shrink-0",o.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:G=>{G.stopPropagation(),k()},onPointerDown:Xo,children:o.isHidden?n.jsx(No,{className:"h-3.5 w-3.5"}):n.jsx(Do,{className:"h-3.5 w-3.5"})})}),n.jsx(jt,{side:"bottom",children:o.isHidden?p("sectionsEditor.sectionList.showSection"):p("sectionsEditor.sectionList.hideSection")})]}),e[21]=k,e[22]=o.isHidden,e[23]=o.isMultivariate,e[24]=p,e[25]=Le):Le=e[25];let Z;e[26]!==p?(Z=p("sectionsEditor.sectionList.sectionActionsMenu"),e[26]=p,e[27]=Z):Z=e[27];let Be;e[28]===Symbol.for("react.memo_cache_sentinel")?(Be=n.jsx(is,{className:"h-3.5 w-3.5"}),e[28]=Be):Be=e[28];let ve;e[29]!==Z?(ve=n.jsx(fs,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":Z,className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:Qo,onPointerDown:Yo,children:Be})}),e[29]=Z,e[30]=ve):ve=e[30];let de;e[31]!==u?(de=G=>{G.stopPropagation(),u()},e[31]=u,e[32]=de):de=e[32];let oe;e[33]===Symbol.for("react.memo_cache_sentinel")?(oe=n.jsx(us,{className:"h-4 w-4"}),e[33]=oe):oe=e[33];let ee;e[34]!==p?(ee=p("sectionsEditor.sectionList.duplicateMenuItem"),e[34]=p,e[35]=ee):ee=e[35];let le;e[36]!==de||e[37]!==ee?(le=n.jsxs(vt,{onClick:de,children:[oe,ee]}),e[36]=de,e[37]=ee,e[38]=le):le=e[38];let pe;e[39]!==l||e[40]!==E||e[41]!==p?(pe=l&&n.jsxs(vt,{className:Na,onClick:G=>{G.stopPropagation(),E()},children:[n.jsx(ds,{className:"h-4 w-4"}),p("sectionsEditor.sectionList.addVariantMenuItem")]}),e[39]=l,e[40]=E,e[41]=p,e[42]=pe):pe=e[42];let ke;e[43]!==se||e[44]!==y||e[45]!==p?(ke=se&&n.jsxs(vt,{className:Uo,onClick:G=>{G.stopPropagation(),y()},children:[n.jsx(pn,{className:"h-4 w-4"}),p("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[43]=se,e[44]=y,e[45]=p,e[46]=ke):ke=e[46];let Re;e[47]!==i||e[48]!==o.isMultivariate||e[49]!==o.isSavedBlock||e[50]!==p?(Re=o.isSavedBlock===!0&&!o.isMultivariate&&n.jsxs(vt,{onClick:G=>{G.stopPropagation(),i()},children:[n.jsx(pn,{className:"h-4 w-4"}),p("sectionsEditor.sectionList.detachMenuItem")]}),e[47]=i,e[48]=o.isMultivariate,e[49]=o.isSavedBlock,e[50]=p,e[51]=Re):Re=e[51];let Se;e[52]!==h?(Se=G=>{G.stopPropagation(),h()},e[52]=h,e[53]=Se):Se=e[53];let De;e[54]===Symbol.for("react.memo_cache_sentinel")?(De=n.jsx(ms,{className:"h-4 w-4"}),e[54]=De):De=e[54];let _e;e[55]!==p?(_e=p("sectionsEditor.sectionList.deleteMenuItem"),e[55]=p,e[56]=_e):_e=e[56];let I;e[57]!==Se||e[58]!==_e?(I=n.jsxs(vt,{className:"text-destructive focus:text-destructive",onClick:Se,children:[De,_e]}),e[57]=Se,e[58]=_e,e[59]=I):I=e[59];let ce;e[60]!==le||e[61]!==pe||e[62]!==ke||e[63]!==Re||e[64]!==I?(ce=n.jsxs(ps,{align:"end",className:"w-44",children:[le,pe,ke,Re,I]}),e[60]=le,e[61]=pe,e[62]=ke,e[63]=Re,e[64]=I,e[65]=ce):ce=e[65];let je;e[66]!==ve||e[67]!==ce?(je=n.jsxs(gs,{children:[ve,ce]}),e[66]=ve,e[67]=ce,e[68]=je):je=e[68];let Te;return e[69]!==A||e[70]!==z||e[71]!==m||e[72]!==v||e[73]!==ge||e[74]!==X||e[75]!==ie||e[76]!==O||e[77]!==Le||e[78]!==je||e[79]!==F?(Te=n.jsxs("div",{ref:v,style:ge,...A,...z,role:he,tabIndex:fe,onClick:m,onKeyDown:F,className:X,children:[ie,O,Le,je]}),e[69]=A,e[70]=z,e[71]=m,e[72]=v,e[73]=ge,e[74]=X,e[75]=ie,e[76]=O,e[77]=Le,e[78]=je,e[79]=F,e[80]=Te):Te=e[80],Te}function Yo(g){return g.stopPropagation()}function Qo(g){return g.stopPropagation()}function Xo(g){return g.stopPropagation()}function Zo(g){return g.stopPropagation()}function er(){return!1}function tr(g){const e=Ge.c(104),{listKey:o,rawSections:d,sections:f,meta:x,selectedIndex:b,onSelect:m,onReorder:h,onDelete:u,onDuplicate:y,onMakeReusable:k,onToggleHidden:D,onToggleLazy:E,onAddVariant:i,onDetach:p,onAddSection:r,canAddSection:P}=g,l=P===void 0?!0:P,R=it();let A;e[0]!==f.length?(A=()=>Fn(f.length),e[0]=f.length,e[1]=A):A=e[1];const[z,v]=V.useState(A),[C,re]=V.useState(null),[L,ue]=V.useState(o),[K,ge]=V.useState(f.length),B=V.useRef(!1);L!==o?(ue(o),ge(f.length),v(Fn(f.length))):K!==f.length&&(ge(f.length),v($e=>qo($e,f.length)));let se;e[2]===Symbol.for("react.memo_cache_sentinel")?(se={activationConstraint:{distance:8}},e[2]=se):se=e[2];let he;e[3]===Symbol.for("react.memo_cache_sentinel")?(he={coordinateGetter:ts},e[3]=he):he=e[3];const fe=Un(Yt(Qn,se),Yt(Yn,he));let F;e[4]!==z?(F=z.map(nr),e[4]=z,e[5]=F):F=e[5];const J=F;let X;e[6]===Symbol.for("react.memo_cache_sentinel")?(X=$e=>{re(String($e.active.id))},e[6]=X):X=e[6];const ie=X;let O;e[7]!==J||e[8]!==h?(O=$e=>{re(null);const{active:N,over:ae}=$e;if(!ae||N.id===ae.id)return;const $=J.indexOf(String(N.id)),Xe=J.indexOf(String(ae.id));$===-1||Xe===-1||(v(et=>hs(At([...et],$,Xe))),B.current=!0,requestAnimationFrame(()=>{B.current=!1}),h?.($,Xe))},e[7]=J,e[8]=h,e[9]=O):O=e[9];const Le=O;let Z;e[10]===Symbol.for("react.memo_cache_sentinel")?(Z=()=>{re(null)},e[10]=Z):Z=e[10];const Be=Z;let ve,de,oe,ee,le,pe,ke,Re,Se,De,_e,I,ce,je,Te;if(e[11]!==C||e[12]!==l||e[13]!==z||e[14]!==J||e[15]!==Le||e[16]!==x||e[17]!==r||e[18]!==i||e[19]!==u||e[20]!==p||e[21]!==y||e[22]!==k||e[23]!==m||e[24]!==D||e[25]!==E||e[26]!==d||e[27]!==f||e[28]!==b||e[29]!==fe||e[30]!==R){je=Symbol.for("react.early_return_sentinel");e:{const $e=N=>{B.current||m(N)};if(e[46]!==C||e[47]!==l||e[48]!==z||e[49]!==r||e[50]!==d||e[51]!==f||e[52]!==R){const N=C?z.find(ae=>ae.id===C):null;if(ee=N!=null?f[N.index]:null,oe=N!=null?d[N.index]:void 0,z.length===0){let ae;e[56]!==R?(ae=R("sectionsEditor.sectionList.noSections"),e[56]=R,e[57]=ae):ae=e[57];let $;e[58]!==ae?($=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:ae}),e[58]=ae,e[59]=$):$=e[59];const Xe=!l;let et;e[60]===Symbol.for("react.memo_cache_sentinel")?(et=n.jsx(gn,{size:14}),e[60]=et):et=e[60];let lt;e[61]!==R?(lt=R("sectionsEditor.sectionList.addSectionButton"),e[61]=R,e[62]=lt):lt=e[62];let ct;e[63]!==r||e[64]!==Xe||e[65]!==lt?(ct=n.jsxs(Je,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Xe,onClick:r,children:[et,lt]}),e[63]=r,e[64]=Xe,e[65]=lt,e[66]=ct):ct=e[66];let ut;e[67]!==$||e[68]!==ct?(ut=n.jsxs("div",{className:"space-y-2",children:[$,ct]}),e[67]=$,e[68]=ct,e[69]=ut):ut=e[69],je=ut;break e}ce=Oe(N&&"cursor-grabbing"),e[46]=C,e[47]=l,e[48]=z,e[49]=r,e[50]=d,e[51]=f,e[52]=R,e[53]=oe,e[54]=ee,e[55]=ce}else oe=e[53],ee=e[54],ce=e[55];de=ns,Re=fe,Se=ss,De=ie,_e=Le,I=Be,ve=as,pe=J,ke=os,Te="space-y-1",le=z.map(N=>{const ae=f[N.index];return ae?n.jsx(Jo,{sortableId:N.id,section:ae,raw:d[N.index],meta:x,selected:b===N.index,onSelect:()=>$e(N.index),onDelete:()=>u(N.index),onDuplicate:()=>y(N.index),onMakeReusable:()=>k(N.index),onToggleHidden:()=>D(N.index),onToggleLazy:()=>E(N.index),onAddVariant:()=>i(N.index),onDetach:()=>p(N.index)},N.id):null})}e[11]=C,e[12]=l,e[13]=z,e[14]=J,e[15]=Le,e[16]=x,e[17]=r,e[18]=i,e[19]=u,e[20]=p,e[21]=y,e[22]=k,e[23]=m,e[24]=D,e[25]=E,e[26]=d,e[27]=f,e[28]=b,e[29]=fe,e[30]=R,e[31]=ve,e[32]=de,e[33]=oe,e[34]=ee,e[35]=le,e[36]=pe,e[37]=ke,e[38]=Re,e[39]=Se,e[40]=De,e[41]=_e,e[42]=I,e[43]=ce,e[44]=je,e[45]=Te}else ve=e[31],de=e[32],oe=e[33],ee=e[34],le=e[35],pe=e[36],ke=e[37],Re=e[38],Se=e[39],De=e[40],_e=e[41],I=e[42],ce=e[43],je=e[44],Te=e[45];if(je!==Symbol.for("react.early_return_sentinel"))return je;let G;e[70]!==le||e[71]!==Te?(G=n.jsx("div",{className:Te,children:le}),e[70]=le,e[71]=Te,e[72]=G):G=e[72];let Ae;e[73]!==ve||e[74]!==pe||e[75]!==ke||e[76]!==G?(Ae=n.jsx(ve,{items:pe,strategy:ke,children:G}),e[73]=ve,e[74]=pe,e[75]=ke,e[76]=G,e[77]=Ae):Ae=e[77];let Ie;e[78]!==oe||e[79]!==ee||e[80]!==x?(Ie=ee?n.jsx("div",{className:Oe("cursor-grabbing shadow-lg ring-1 ring-border/60",Ss(ee,!1)),children:n.jsx(vs,{section:ee,raw:oe,meta:x})}):null,e[78]=oe,e[79]=ee,e[80]=x,e[81]=Ie):Ie=e[81];let He;e[82]!==Ie?(He=Gn.createPortal(n.jsx(qn,{dropAnimation:Jn,children:Ie}),document.body),e[82]=Ie,e[83]=He):He=e[83];let Fe;e[84]!==de||e[85]!==Re||e[86]!==Se||e[87]!==De||e[88]!==_e||e[89]!==I||e[90]!==Ae||e[91]!==He?(Fe=n.jsxs(de,{sensors:Re,collisionDetection:Se,onDragStart:De,onDragEnd:_e,onDragCancel:I,children:[Ae,He]}),e[84]=de,e[85]=Re,e[86]=Se,e[87]=De,e[88]=_e,e[89]=I,e[90]=Ae,e[91]=He,e[92]=Fe):Fe=e[92];const xe=!l;let we;e[93]===Symbol.for("react.memo_cache_sentinel")?(we=n.jsx(gn,{size:14}),e[93]=we):we=e[93];let be;e[94]!==R?(be=R("sectionsEditor.sectionList.addSectionButton"),e[94]=R,e[95]=be):be=e[95];let te;e[96]!==r||e[97]!==xe||e[98]!==be?(te=n.jsxs(Je,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:xe,onClick:r,children:[we,be]}),e[96]=r,e[97]=xe,e[98]=be,e[99]=te):te=e[99];let me;return e[100]!==ce||e[101]!==Fe||e[102]!==te?(me=n.jsxs("div",{className:ce,children:[Fe,te]}),e[100]=ce,e[101]=Fe,e[102]=te,e[103]=me):me=e[103],me}function nr(g){return g.id}function On(g){const e=Ge.c(57),{open:o,initialName:d,autoLabel:f,isPending:x,onSubmit:b,onOpenChange:m}=g,h=x===void 0?!1:x,u=it(),[y,k]=V.useState(d),[D,E]=V.useState(o);o!==D&&(E(o),o&&k(d));let i;e[0]!==h||e[1]!==m?(i=ie=>{!ie&&!h&&m(!1)},e[0]=h,e[1]=m,e[2]=i):i=e[2];const p=i;let r;e[3]!==h||e[4]!==y||e[5]!==b?(r=async ie=>{ie.preventDefault(),!h&&await b(y.trim())},e[3]=h,e[4]=y,e[5]=b,e[6]=r):r=e[6];const P=r;let l;e[7]!==u?(l=u("sectionsEditor.variantRenameDialog.title"),e[7]=u,e[8]=l):l=e[8];let R;e[9]!==l?(R=n.jsx(yo,{children:l}),e[9]=l,e[10]=R):R=e[10];let A;e[11]!==f||e[12]!==u?(A=u("sectionsEditor.variantRenameDialog.description",{fallback:f||u("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=f,e[12]=u,e[13]=A):A=e[13];let z;e[14]!==A?(z=n.jsx(_o,{children:A}),e[14]=A,e[15]=z):z=e[15];let v;e[16]!==R||e[17]!==z?(v=n.jsxs(jo,{children:[R,z]}),e[16]=R,e[17]=z,e[18]=v):v=e[18];let C;e[19]!==u?(C=u("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=u,e[20]=C):C=e[20];let re;e[21]!==C?(re=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:C}),e[21]=C,e[22]=re):re=e[22];let L;e[23]===Symbol.for("react.memo_cache_sentinel")?(L=ie=>k(ie.target.value),e[23]=L):L=e[23];let ue;e[24]!==f||e[25]!==h||e[26]!==y?(ue=n.jsx(wo,{id:"variant-rename-name",value:y,onChange:L,placeholder:f,autoFocus:!0,disabled:h}),e[24]=f,e[25]=h,e[26]=y,e[27]=ue):ue=e[27];let K;e[28]!==re||e[29]!==ue?(K=n.jsxs("div",{className:"space-y-1.5 py-4",children:[re,ue]}),e[28]=re,e[29]=ue,e[30]=K):K=e[30];let ge;e[31]!==m?(ge=()=>m(!1),e[31]=m,e[32]=ge):ge=e[32];let B;e[33]!==u?(B=u("sectionsEditor.variantRenameDialog.cancel"),e[33]=u,e[34]=B):B=e[34];let se;e[35]!==h||e[36]!==ge||e[37]!==B?(se=n.jsx(Je,{type:"button",variant:"outline",onClick:ge,disabled:h,children:B}),e[35]=h,e[36]=ge,e[37]=B,e[38]=se):se=e[38];let he;e[39]!==h||e[40]!==u?(he=h?n.jsxs(n.Fragment,{children:[n.jsx(Wn,{size:14,className:"animate-spin"}),u("sectionsEditor.variantRenameDialog.saving")]}):u("sectionsEditor.variantRenameDialog.save"),e[39]=h,e[40]=u,e[41]=he):he=e[41];let fe;e[42]!==h||e[43]!==he?(fe=n.jsx(Je,{type:"submit",disabled:h,children:he}),e[42]=h,e[43]=he,e[44]=fe):fe=e[44];let F;e[45]!==se||e[46]!==fe?(F=n.jsxs(Eo,{children:[se,fe]}),e[45]=se,e[46]=fe,e[47]=F):F=e[47];let J;e[48]!==P||e[49]!==K||e[50]!==F||e[51]!==v?(J=n.jsx(ko,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:P,children:[v,K,F]})}),e[48]=P,e[49]=K,e[50]=F,e[51]=v,e[52]=J):J=e[52];let X;return e[53]!==p||e[54]!==o||e[55]!==J?(X=n.jsx(Ro,{open:o,onOpenChange:p,children:J}),e[53]=p,e[54]=o,e[55]=J,e[56]=X):X=e[56],X}const sr="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)]",xs="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 bs(g){const e=Ge.c(5),{rule:o,matchers:d}=g,f=o?.__resolveType??"";let x;if(e[0]!==d||e[1]!==f){const u=d.find(y=>y.resolveType===f)?.iconName??Ta(f);x=ho(u),e[0]=d,e[1]=f,e[2]=x}else x=e[2];const b=x;if(!b)return null;let m;return e[3]!==b?(m=n.jsx(b,{size:14,className:"shrink-0"}),e[3]=b,e[4]=m):m=e[4],m}function In(g){return g.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
2
- `)}function fn(g){return g.map((e,o)=>({id:crypto.randomUUID(),index:o,variant:e}))}function ar(g){return g.map((e,o)=>({...e,index:o}))}function ys(g){const e=Ge.c(17),{label:o,effectiveRule:d,matchers:f,canDelete:x,dragging:b,onRename:m,onDuplicate:h,onDelete:u}=g,y=it();let k;e[0]!==d||e[1]!==f?(k=n.jsx(bs,{rule:d,matchers:f}),e[0]=d,e[1]=f,e[2]=k):k=e[2];let D;e[3]!==o?(D=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:o}),e[3]=o,e[4]=D):D=e[4];let E;e[5]!==x||e[6]!==b||e[7]!==o||e[8]!==u||e[9]!==h||e[10]!==m||e[11]!==y?(E=!b&&n.jsxs(gs,{children:[n.jsx(fs,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":y("sectionsEditor.pageVariantTabs.actionsAriaLabel",{label:o}),className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:rr,onPointerDown:or,children:n.jsx(is,{size:14})})}),n.jsxs(ps,{align:"end",className:"w-36",children:[n.jsxs(vt,{onClick:p=>{p.stopPropagation(),m?.()},children:[n.jsx(Io,{size:14}),y("sectionsEditor.pageVariantTabs.renameAction")]}),n.jsxs(vt,{onClick:p=>{p.stopPropagation(),h?.()},children:[n.jsx(us,{size:14}),y("sectionsEditor.pageVariantTabs.duplicateAction")]}),n.jsx(Po,{}),n.jsxs(vt,{variant:"destructive",disabled:!x,onClick:p=>{p.stopPropagation(),u?.()},children:[n.jsx(ms,{size:14}),y("sectionsEditor.pageVariantTabs.deleteAction")]})]})]}),e[5]=x,e[6]=b,e[7]=o,e[8]=u,e[9]=h,e[10]=m,e[11]=y,e[12]=E):E=e[12];let i;return e[13]!==k||e[14]!==D||e[15]!==E?(i=n.jsxs(n.Fragment,{children:[k,D,E]}),e[13]=k,e[14]=D,e[15]=E,e[16]=i):i=e[16],i}function or(g){return g.stopPropagation()}function rr(g){return g.stopPropagation()}function ir(g){const e=Ge.c(33),{entry:o,sortableId:d,isActive:f,canDelete:x,decofile:b,meta:m,matchers:h,onSelect:u,onRename:y,onDuplicate:k,onDelete:D}=g;let E;e[0]!==d?(E={id:d,animateLayoutChanges:lr},e[0]=d,e[1]=E):E=e[1];const{attributes:i,listeners:p,setNodeRef:r,transform:P,isDragging:l}=Zn(E);let R;e[2]!==P?(R=es.Transform.toString(P?{...P,x:0}:null),e[2]=P,e[3]=R):R=e[3];const A=l?0:void 0;let z;e[4]!==R||e[5]!==A?(z={transform:R,opacity:A},e[4]=R,e[5]=A,e[6]=z):z=e[6];const v=z,C=m??void 0;let re;e[7]!==b||e[8]!==o.variant.rule||e[9]!==C?(re=Mt(o.variant.rule,b,C),e[7]=b,e[8]=o.variant.rule,e[9]=C,e[10]=re):re=e[10];const L=re;let ue;e[11]!==u?(ue=fe=>{fe.target===fe.currentTarget&&(fe.key==="Enter"||fe.key===" ")&&(fe.preventDefault(),u())},e[11]=u,e[12]=ue):ue=e[12];const K=l?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",ge=f?xs:sr;let B;e[13]!==K||e[14]!==ge?(B=Oe("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",K,ge),e[13]=K,e[14]=ge,e[15]=B):B=e[15];let se;e[16]!==x||e[17]!==L||e[18]!==o.variant.label||e[19]!==h||e[20]!==D||e[21]!==k||e[22]!==y?(se=n.jsx(ys,{label:o.variant.label,effectiveRule:L,matchers:h,canDelete:x,onRename:y,onDuplicate:k,onDelete:D}),e[16]=x,e[17]=L,e[18]=o.variant.label,e[19]=h,e[20]=D,e[21]=k,e[22]=y,e[23]=se):se=e[23];let he;return e[24]!==i||e[25]!==p||e[26]!==u||e[27]!==r||e[28]!==v||e[29]!==B||e[30]!==se||e[31]!==ue?(he=n.jsx("div",{ref:r,style:v,...i,...p,onClick:u,onKeyDown:ue,className:B,children:se}),e[24]=i,e[25]=p,e[26]=u,e[27]=r,e[28]=v,e[29]=B,e[30]=se,e[31]=ue,e[32]=he):he=e[32],he}function lr(){return!1}function cr(g){const e=Ge.c(9),{variant:o,decofile:d,meta:f,matchers:x}=g,b=f??void 0;let m;e[0]!==d||e[1]!==b||e[2]!==o.rule?(m=Mt(o.rule,d,b),e[0]=d,e[1]=b,e[2]=o.rule,e[3]=m):m=e[3];const h=m;let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=Oe("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",xs),e[4]=u):u=e[4];let y;return e[5]!==h||e[6]!==x||e[7]!==o.label?(y=n.jsx("div",{className:u,children:n.jsx(ys,{label:o.label,effectiveRule:h,matchers:x,canDelete:!1,dragging:!0})}),e[5]=h,e[6]=x,e[7]=o.label,e[8]=y):y=e[8],y}function ur(g){const e=Ge.c(91),{listKey:o,variants:d,activeIndex:f,decofile:x,meta:b,matchers:m,onSelect:h,onReorder:u,onRename:y,onDuplicate:k,onDelete:D,onAdd:E}=g,i=it();let p;e[0]!==d?(p=()=>fn(d),e[0]=d,e[1]=p):p=e[1];const[r,P]=V.useState(p),[l,R]=V.useState(null),[A,z]=V.useState(o),[v,C]=V.useState(d.length);let re;e[2]!==d?(re=()=>In(d),e[2]=d,e[3]=re):re=e[3];const[L,ue]=V.useState(re),K=V.useRef(!1),ge=In(d);A!==o?(z(o),C(d.length),ue(ge),P(fn(d))):v!==d.length?(C(d.length),ue(ge),P(fn(d))):L!==ge&&(ue(ge),P(Fe=>d.map((xe,we)=>({id:Fe[we]?.id??crypto.randomUUID(),index:we,variant:xe}))));let B;e[4]===Symbol.for("react.memo_cache_sentinel")?(B={activationConstraint:{distance:8}},e[4]=B):B=e[4];let se;e[5]===Symbol.for("react.memo_cache_sentinel")?(se={coordinateGetter:ts},e[5]=se):se=e[5];const he=Un(Yt(Qn,B),Yt(Yn,se));let fe;e[6]!==r?(fe=r.map(dr),e[6]=r,e[7]=fe):fe=e[7];const F=fe,J=d.length>1;let X;e[8]!==r?(X=Fe=>{const xe=String(Fe.active.id);R(r.find(we=>we.id===xe)??null)},e[8]=r,e[9]=X):X=e[9];const ie=X;let O;e[10]!==F||e[11]!==u?(O=Fe=>{R(null);const{active:xe,over:we}=Fe;if(!we||xe.id===we.id)return;const be=F.indexOf(String(xe.id)),te=F.indexOf(String(we.id));be===-1||te===-1||(P(me=>ar(At([...me],be,te))),K.current=!0,requestAnimationFrame(()=>{K.current=!1}),u(be,te))},e[10]=F,e[11]=u,e[12]=O):O=e[12];const Le=O;let Z;e[13]===Symbol.for("react.memo_cache_sentinel")?(Z=()=>{R(null)},e[13]=Z):Z=e[13];const Be=Z;let ve,de,oe,ee,le,pe,ke,Re,Se,De,_e,I,ce;if(e[14]!==f||e[15]!==J||e[16]!==x||e[17]!==r||e[18]!==F||e[19]!==Le||e[20]!==ie||e[21]!==m||e[22]!==b||e[23]!==E||e[24]!==D||e[25]!==k||e[26]!==y||e[27]!==h||e[28]!==he||e[29]!==i){const Fe=$=>{K.current||h($)};_e="space-y-1 border-b p-2";let xe;e[43]!==i?(xe=i("sectionsEditor.pageVariantTabs.variantsLabel"),e[43]=i,e[44]=xe):xe=e[44];let we;e[45]!==xe?(we=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:xe}),e[45]=xe,e[46]=we):we=e[46];let be;e[47]!==i?(be=i("sectionsEditor.pageVariantTabs.addVariantAriaLabel"),e[47]=i,e[48]=be):be=e[48];let te;e[49]===Symbol.for("react.memo_cache_sentinel")?(te=n.jsx(gn,{size:14}),e[49]=te):te=e[49];let me;e[50]!==E||e[51]!==be?(me=n.jsx(_t,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":be,className:"size-6",onClick:E,children:te})}),e[50]=E,e[51]=be,e[52]=me):me=e[52];let $e;e[53]!==i?($e=i("sectionsEditor.pageVariantTabs.addVariantTooltip"),e[53]=i,e[54]=$e):$e=e[54];let N;e[55]!==$e?(N=n.jsx(jt,{children:$e}),e[55]=$e,e[56]=N):N=e[56];let ae;e[57]!==me||e[58]!==N?(ae=n.jsxs(yt,{children:[me,N]}),e[57]=me,e[58]=N,e[59]=ae):ae=e[59],e[60]!==we||e[61]!==ae?(I=n.jsxs("div",{className:"flex items-center justify-between",children:[we,ae]}),e[60]=we,e[61]=ae,e[62]=I):I=e[62],de=ns,pe=he,ke=ss,Re=ie,Se=Le,De=Be,ve=as,ee=F,le=os,ce="space-y-0.5",oe=r.map($=>n.jsx(ir,{sortableId:$.id,entry:$,isActive:$.index===f,canDelete:J,decofile:x,meta:b,matchers:m,onSelect:()=>Fe($.index),onRename:()=>y($.index),onDuplicate:()=>k($.index),onDelete:()=>D($.index)},$.id)),e[14]=f,e[15]=J,e[16]=x,e[17]=r,e[18]=F,e[19]=Le,e[20]=ie,e[21]=m,e[22]=b,e[23]=E,e[24]=D,e[25]=k,e[26]=y,e[27]=h,e[28]=he,e[29]=i,e[30]=ve,e[31]=de,e[32]=oe,e[33]=ee,e[34]=le,e[35]=pe,e[36]=ke,e[37]=Re,e[38]=Se,e[39]=De,e[40]=_e,e[41]=I,e[42]=ce}else ve=e[30],de=e[31],oe=e[32],ee=e[33],le=e[34],pe=e[35],ke=e[36],Re=e[37],Se=e[38],De=e[39],_e=e[40],I=e[41],ce=e[42];let je;e[63]!==oe||e[64]!==ce?(je=n.jsx("div",{className:ce,children:oe}),e[63]=oe,e[64]=ce,e[65]=je):je=e[65];let Te;e[66]!==ve||e[67]!==ee||e[68]!==le||e[69]!==je?(Te=n.jsx(ve,{items:ee,strategy:le,children:je}),e[66]=ve,e[67]=ee,e[68]=le,e[69]=je,e[70]=Te):Te=e[70];let G;e[71]!==l||e[72]!==x||e[73]!==m||e[74]!==b?(G=l?n.jsx(cr,{variant:l.variant,decofile:x,meta:b,matchers:m}):null,e[71]=l,e[72]=x,e[73]=m,e[74]=b,e[75]=G):G=e[75];let Ae;e[76]!==G?(Ae=Gn.createPortal(n.jsx(qn,{dropAnimation:Jn,children:G}),document.body),e[76]=G,e[77]=Ae):Ae=e[77];let Ie;e[78]!==de||e[79]!==pe||e[80]!==ke||e[81]!==Re||e[82]!==Se||e[83]!==De||e[84]!==Te||e[85]!==Ae?(Ie=n.jsxs(de,{sensors:pe,collisionDetection:ke,onDragStart:Re,onDragEnd:Se,onDragCancel:De,children:[Te,Ae]}),e[78]=de,e[79]=pe,e[80]=ke,e[81]=Re,e[82]=Se,e[83]=De,e[84]=Te,e[85]=Ae,e[86]=Ie):Ie=e[86];let He;return e[87]!==_e||e[88]!==I||e[89]!==Ie?(He=n.jsxs("div",{className:_e,children:[I,Ie]}),e[87]=_e,e[88]=I,e[89]=Ie,e[90]=He):He=e[90],He}function dr(g){return g.id}function mr(g){const e=Ge.c(16),{schema:o,value:d,onChange:f,meta:x,decofile:b,onSaveReferencedBlock:m,sandbox:h}=g,u=it();let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=[],e[0]=y):y=e[0];const[k,D]=V.useState(y);let E;e[1]!==k||e[2]!==u?(E=k.length>0&&n.jsxs("nav",{"aria-label":u("sectionsEditor.sectionsEditorPanels.variantRuleBreadcrumb"),className:"flex min-w-0 items-center gap-1 overflow-hidden text-xs",children:[n.jsx("button",{type:"button",onClick:()=>D([]),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:u("sectionsEditor.sectionsEditorPanels.backToRule"),children:n.jsx(ls,{className:"size-3.5"})}),k.map((r,P)=>{const l=P===k.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[P>0&&n.jsx(cs,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>D(k.slice(0,P+1)),title:r,className:Oe("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:r})]},`${r}-${P}`)})]}),e[1]=k,e[2]=u,e[3]=E):E=e[3];let i;e[4]!==k||e[5]!==b||e[6]!==x||e[7]!==f||e[8]!==m||e[9]!==h||e[10]!==o||e[11]!==d?(i=n.jsx(rs,{schema:o,value:d,onChange:f,basePath:"",breadcrumbPath:k,onBreadcrumbChange:D,meta:x,decofile:b,onSaveReferencedBlock:m,sandbox:h}),e[4]=k,e[5]=b,e[6]=x,e[7]=f,e[8]=m,e[9]=h,e[10]=o,e[11]=d,e[12]=i):i=e[12];let p;return e[13]!==E||e[14]!==i?(p=n.jsxs("div",{className:"space-y-2",children:[E,i]}),e[13]=E,e[14]=i,e[15]=p):p=e[15],p}function $n(g){const e=Ge.c(21),{activeSchema:o,formValue:d,formResetKey:f,onFormChange:x,onBreadcrumbChange:b,breadcrumbPath:m,emptyMessage:h,beforeForm:u,seoResolveType:y,siteDefaultSeo:k,meta:D,decofile:E,onSaveReferencedBlock:i,sandbox:p}=g;let r;e[0]!==m?(r=m===void 0?[]:m,e[0]=m,e[1]=r):r=e[1];const P=r;let l;e[2]!==o||e[3]!==P||e[4]!==E||e[5]!==f||e[6]!==d||e[7]!==D||e[8]!==b||e[9]!==x||e[10]!==i||e[11]!==p||e[12]!==y||e[13]!==k?(l=o&&d?y?n.jsx(Co,{schema:o,resolveType:y,value:d,formResetKey:f,onChange:x,onBreadcrumbChange:b,siteDefaultSeo:k}):n.jsx(rs,{schema:o,value:d,onChange:x,basePath:"",breadcrumbPath:P,onBreadcrumbChange:b,meta:D,decofile:E,onSaveReferencedBlock:i,sandbox:p},f):null,e[2]=o,e[3]=P,e[4]=E,e[5]=f,e[6]=d,e[7]=D,e[8]=b,e[9]=x,e[10]=i,e[11]=p,e[12]=y,e[13]=k,e[14]=l):l=e[14];const R=l;let A;e[15]!==h||e[16]!==R?(A=R??n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:h}),e[15]=h,e[16]=R,e[17]=A):A=e[17];let z;return e[18]!==u||e[19]!==A?(z=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:[u,A]})}),e[18]=u,e[19]=A,e[20]=z):z=e[20],z}const fr="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 pr(g,e){return Pa(g,e,rt)}function gr(g){const e=Ge.c(19),{pageKey:o,initialName:d,initialPath:f,onFieldChange:x}=g,b=it(),[m,h]=V.useState(d),[u,y]=V.useState(f),[k,D]=V.useState(o);k!==o&&(D(o),h(d),y(f));let E;e[0]!==x?(E=A=>{h(A.target.value),x("name",A.target.value)},e[0]=x,e[1]=E):E=e[1];let i;e[2]!==b?(i=b("sectionsEditor.sectionsEditorPanels.pageNamePlaceholder"),e[2]=b,e[3]=i):i=e[3];let p;e[4]!==m||e[5]!==E||e[6]!==i?(p=n.jsx("input",{type:"text",value:m,onChange:E,className:"w-full bg-transparent text-sm font-semibold truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:i}),e[4]=m,e[5]=E,e[6]=i,e[7]=p):p=e[7];let r;e[8]!==x?(r=A=>{y(A.target.value),x("path",A.target.value)},e[8]=x,e[9]=r):r=e[9];let P;e[10]!==b?(P=b("sectionsEditor.sectionsEditorPanels.pathPlaceholder"),e[10]=b,e[11]=P):P=e[11];let l;e[12]!==u||e[13]!==r||e[14]!==P?(l=n.jsx("input",{type:"text",value:u,onChange:r,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:P}),e[12]=u,e[13]=r,e[14]=P,e[15]=l):l=e[15];let R;return e[16]!==p||e[17]!==l?(R=n.jsxs("div",{className:"space-y-1",children:[p,l]}),e[16]=p,e[17]=l,e[18]=R):R=e[18],R}function zn(g){const e=Ge.c(13),{onClick:o}=g,d=it();let f;e[0]!==d?(f=d("sectionsEditor.sectionsEditorPanels.addVariant"),e[0]=d,e[1]=f):f=e[1];let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(ds,{size:14}),e[2]=x):x=e[2];let b;e[3]!==o||e[4]!==f?(b=n.jsx(_t,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":f,className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:o,children:x})}),e[3]=o,e[4]=f,e[5]=b):b=e[5];let m;e[6]!==d?(m=d("sectionsEditor.sectionsEditorPanels.addVariant"),e[6]=d,e[7]=m):m=e[7];let h;e[8]!==m?(h=n.jsx(jt,{side:"bottom",children:m}),e[8]=m,e[9]=h):h=e[9];let u;return e[10]!==b||e[11]!==h?(u=n.jsxs(yt,{children:[b,h]}),e[10]=b,e[11]=h,e[12]=u):u=e[12],u}function Hn(g){const e=Ge.c(21),{currentRt:o,currentLabel:d,currentGlobalKey:f,matchers:x,globals:b,onSelect:m,onSelectGlobal:h,schema:u,formValue:y,onChange:k,formKey:D,formWrapperClassName:E,meta:i,decofile:p,onSaveReferencedBlock:r,sandbox:P}=g;let l;e[0]!==f||e[1]!==d||e[2]!==o||e[3]!==b||e[4]!==x||e[5]!==m||e[6]!==h?(l=n.jsx(Ca,{currentRt:o,currentLabel:d,currentGlobalKey:f,matchers:x,globals:b,onSelect:m,onSelectGlobal:h}),e[0]=f,e[1]=d,e[2]=o,e[3]=b,e[4]=x,e[5]=m,e[6]=h,e[7]=l):l=e[7];let R;e[8]!==p||e[9]!==D||e[10]!==y||e[11]!==E||e[12]!==i||e[13]!==k||e[14]!==r||e[15]!==P||e[16]!==u?(R=u&&y&&n.jsx("div",{className:E,children:n.jsx(mr,{schema:u,value:y,onChange:k,meta:i,decofile:p,onSaveReferencedBlock:r,sandbox:P},D)}),e[8]=p,e[9]=D,e[10]=y,e[11]=E,e[12]=i,e[13]=k,e[14]=r,e[15]=P,e[16]=u,e[17]=R):R=e[17];let A;return e[18]!==l||e[19]!==R?(A=n.jsxs(n.Fragment,{children:[l,R]}),e[18]=l,e[19]=R,e[20]=A):A=e[20],A}function fc({orgSlug:g,virtualMcpId:e,branch:o,previewReady:d=!0,previewUrl:f,currentPath:x,activePageBlockKey:b=null,activeGlobalBlockKey:m=null,externalSelectedIndex:h,onSaved:u,initialEditSeo:y=!1,onExitSeo:k,onViewJsonFile:D,onVariantPreviewOverride:E}){const i=it(),p=d?{orgSlug:g,virtualMcpId:e,branch:o,previewUrl:f}:null,{data:r,isLoading:P}=Aa(p),{data:l,isLoading:R}=Ma(p),A=Ka(),z=A?.entity?.id===e?A.entity.metadata?.siteSlug??null:null,[v,C]=V.useState(null),[re,L]=V.useState(null),[ue,K]=V.useState(null),[ge,B]=V.useState(0),[se,he]=V.useState(void 0),[fe,F]=V.useState(null),[J,X]=V.useState(null),[ie,O]=V.useState([]),[Le,Z]=V.useState(0),[Be,ve]=V.useState(null),[de,oe]=V.useState(null),[ee,le]=V.useState(null),[pe,ke]=V.useState(!0),[Re,Se]=V.useState(!1),[De,_e]=V.useState(!1),[I,ce]=V.useState(y),[je,Te]=V.useState(y);y&&!je&&(Te(!0),ce(!0),C(null),L(null),K(null),O([])),!y&&je&&Te(!1);const[G,Ae]=V.useState(null),[Ie,He]=V.useState(void 0),[Fe,xe]=V.useState([]),[we,be]=V.useState(0),[te,me]=V.useState(0),[$e,N]=V.useState(null),[ae,$]=V.useState(null),[Xe,et]=V.useState(null),lt=_a(),ct=`${g}/${e}/${o}`,ut=La({orgSlug:g,virtualMcpId:e,branch:o}),[_s,js]=V.useState(x),[Es,ks]=V.useState(b),[Rs,ws]=V.useState(m);(_s!==x||Es!==b||Rs!==m)&&(queueMicrotask(()=>ut.flush()),js(x),ks(b),ws(m),C(null),L(null),K(null),B(0),F(null),X(null),me(0),N(null),$(null),O([]),Z(t=>t+1),ce(!1),Ae(null),He(void 0),xe([]),be(t=>t+1));const Ve=Ba({orgSlug:g,virtualMcpId:e,branch:o}),Kt=so((t,s)=>{Ve.mutate({blockKey:t,data:s},{onSuccess:()=>u?.(),onError:a=>Q.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})}),Qt=Fa({orgSlug:g,virtualMcpId:e,branch:o}),[Nt,Lt]=V.useState(!1),Me=V.useRef(null),tt=V.useRef(null),nt=V.useRef(null),Xt=V.useRef({}),Ye=V.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!d||P||R)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(Wn,{size:20,className:"animate-spin text-muted-foreground"})});if(!r||!l)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:i("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const Vs=Oa(r),Ne=!!m,We=Ne?null:Ia(Vs,x,b),w=Ne?m:We?.key??null,Zt=Ne&&m?r[m]:void 0,hn=Ne&&m&&Zt?$a(m,Zt):Ne&&m?m:"",Bt=!Ne&&w&&r[w]?r[w]:null,en=I&&r&&l&&w&&We?Bn(r,{kind:"page",pageKey:w,pageName:String(We.name??""),path:String(We.path??"")},l):null,Ns=I?Bt?.seo:void 0,tn=Ie!==void 0?Ie:Ns,Ds=I?Ao(tn):void 0,Ts=en?.seoTypeOptions??[],Ps=I&&l?Mo(l):"",vn=G??Ds??{},nn=I&&en?Ko(vn,en):null,Cs=I&&nn&&Lo(tn)?Gt(nn,l):null,As=I?Bo(r,l)?.seoData:void 0,ze=Ne?[{label:"Default",sections:[{__resolveType:m}]}]:pr(Bt?.sections,r??{}),Ft=ze.length>1,Ce=Math.min(ge,ze.length-1),dt=ze[Ce],U=dt?.sections??[],Ke=Wt(U,r),Sn=!Ne&&za(Bt?.sections);if(Ne&&m&&Xe!==m){et(m);const t=U[0],s=Ke[0];if(t&&s){C(0),me(0),O([]);const a=xt(t,s,r);a&&(L(a.data),K(a.resolveType),$(null),N(null))}}!Ne&&Xe!==null&&et(null),Ye.current={rawSections:U,parsedSections:Ke,decofile:r??{},activePageKey:w,pageVariants:ze,variantIndex:Ce,sectionVariantIndex:te,selectedSectionIndex:v};const Ms=()=>({multivariate:Sn,index:Ce,variants:ze.map(t=>({rule:t.rule}))}),xn=(t,s)=>{if(!E)return;if(!w||!Sn||t.length<=1){E(null);return}const a=Kn(w,{multivariate:!0,index:s,variants:t},r,l);E(a.length>0?a:null)},Et=(t,s,a)=>{if(!E)return;if(!w){E(null);return}const c=Ms(),S=Kn(w,c,r,l);if(!t||s<0){E(S.length>0?S:null);return}const j=lo({pageKey:w,page:c,sectionIndex:s,sectionLazy:Ke[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:r,meta:l}),_=[...S,...j];E(_.length>0?_:null)},mt=(t,s,a,c=v??-1,S=!1)=>{const j=Ze(t,s);if(!j){L(null),K(null),$(null),N(null),S&&Et(null,c,a);return}const T=Pn(j,rt)[a];if(!T){L(null),K(null),$(null),N(null),S&&Et(null,c,a);return}const ne=Ja(T.value,r);L(ne?.data??null),K(ne?.resolveType??null);const{resolveType:M,formValue:H}=Tt(T.rule,r,l??void 0);$(M),N(H),S&&Et(j,c,a)};if(h!==void 0&&h!==se&&(he(h??null),typeof h=="number")){const t=U[h],s=Ke[h];if(t&&s)if(C(h),me(0),O([]),Z(a=>a+1),s.isMultivariate)mt(t,s,0,h);else{const a=xt(t,s,r);a?(L(a.data),K(a.resolveType)):(L(null),K(null)),$(null),N(null)}}const Ot={orgSlug:g,virtualMcpId:e,branch:o,previewUrl:f??void 0,siteSlug:z},sn=ue&&l?Gt(ue,l):null,Ue=(t,s)=>{if(!w)return;Me.current&&(clearTimeout(Me.current),Me.current=null),nt.current&&(clearTimeout(nt.current),nt.current=null),tt.current&&(clearTimeout(tt.current),tt.current=null);const a=Ct(r,w,t,Ce,ze);Ve.mutate({blockKey:w,data:a},{onSuccess:()=>s?.onSuccess?.()??u?.(),onError:c=>Q.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:c.message}))})},kt=()=>{C(null),L(null),K(null),me(0),N(null),$(null),O([]),Z(t=>t+1)},Ks=(t,s)=>{Me.current&&clearTimeout(Me.current);const a=Ye.current.sectionVariantIndex;Me.current=setTimeout(()=>{const{rawSections:c,parsedSections:S,decofile:j,activePageKey:_,pageVariants:T,variantIndex:ne}=Ye.current,M=c[s];if(!M)return;const H=S[s];if(!H)return;if(H.isSavedBlock){const q=H.isLazy?M.section?.__resolveType??M.__resolveType:M.__resolveType;Ve.mutate({blockKey:q,data:t},{onSuccess:()=>u?.(),onError:Y=>Q.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:Y.message}))});return}if(!_)return;const W={...j[_]},Ee=[...c];if(H.isMultivariate){const q=Ze(M,H);if(!q||!_)return;const Y=uo(q,a,t);Ee[s]=bt(M,H,Y)}else if(H.isHidden){const q=Xn(M.__resolveType),Y=q?{...M.section}:{...M},Pe=Array.isArray(Y.variants)?[...Y.variants]:[];Pe[0]&&(Pe[0]={...Pe[0],value:t}),Y.variants=Pe,q?Ee[s]={...M,section:Y}:Ee[s]=Y}else H.isLazy?Ee[s]={...M,section:t}:Ee[s]=t;if(T.length>1){const q=W.sections,Y=[...q?.variants??[]];Y[ne]&&(Y[ne]={...Y[ne],value:Ee}),W.sections={...q,variants:Y}}else W.sections=Ee;Ve.mutate({blockKey:_,data:W},{onSuccess:()=>u?.(),onError:q=>Q.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:q.message}))})},mn)},Ls=t=>{C(t),me(0),O([]),Z(S=>S+1);const s=U[t],a=Ke[t];if(!s||!a)return;if(a.isMultivariate){mt(s,a,0,t);return}const c=xt(s,a,r);if(!c){L(null),K(null),$(null),N(null),Et(null,t,0);return}L(c.data),K(c.resolveType),$(null),N(null),Et(null,t,0)},bn=t=>{const s=t;L(s),v!==null&&Ks(s,v)},an=t=>{if(!w||!r||!l||!We)return;const s={kind:"page",pageKey:w,pageName:String(We.name??""),path:String(We.path??"")},a=Bn(r,s,l);a&&ut.save(w,()=>{const c=lt.getQueryData(ja.decofile(ct))?.[w];if(!c||typeof c!="object"||c===null||Array.isArray(c))return null;const S={...c,...Xt.current};return Xt.current={},t?.raw!==void 0?{...S,seo:t.raw}:t?.inner!==void 0?Oo(s,a,S,t.inner):S})},Bs=(t,s)=>{w&&(Xt.current[t]=s,an())},Fs=(t,s)=>{if(!w)return;const a=At([...U],t,s);v!==null&&(v===t?C(s):t<v&&s>=v?C(v-1):t>v&&s<=v&&C(v+1)),Ue(a)},Os=t=>{if(!w)return;const s=U.filter((a,c)=>c!==t);v===t?kt():v!==null&&v>t&&C(v-1),Ue(s)},Is=t=>{if(!w)return;const s=U[t];if(!s)return;const a=[...U];a.splice(t+1,0,io(s)),v!==null&&v>t&&C(v+1),Ue(a)},$s=t=>{if(!w)return;const s=U[t],a=Ke[t];if(!s||!a||a.isMultivariate)return;const c=a.isHidden?oo(s):ro(s);if(!c)return;const S=[...U];S[t]=c,v===t&&kt(),Ue(S)},zs=t=>{if(!w)return;const s=U[t],a=Ke[t];if(!s||!a||a.isMultivariate)return;const c=ao(s);if(!c)return;const S=[...U];S[t]=c,v===t&&kt(),Ue(S)},Hs=t=>{if(!w)return;const s=U[t],a=Ke[t];if(!s||!a?.isSavedBlock)return;const c=xt(s,a,r);if(!c?.data)return;const{name:S,...j}=c.data,_=[...U];a.isLazy?_[t]={...s,section:j}:_[t]=j,v===t&&kt(),Ue(_)},Gs=t=>{if(!w)return;const s=[...U,{__resolveType:t.resolveType}],a=s.length-1;Ue(s,{onSuccess:()=>{Se(!1),C(a),me(0),O([]),Z(_=>_+1);const c=s[a],S=Wt(s,r)[a];if(!c||!S)return;if(S.isMultivariate){mt(c,S,0);return}const j=xt(c,S,r);if(!j){L(null),K(null),$(null),N(null);return}L(j.data),K(j.resolveType),$(null),N(null)}})},Ws=t=>{if(v===null)return;const s=U[v],a=Ke[v];!s||!a?.isMultivariate||(me(t),O([]),Z(c=>c+1),mt(s,a,t,v,!0))},Us=t=>{if(v===null||!w)return;const s=U[v],a=Ke[v];if(!s||!a?.isMultivariate)return;const c=Ze(s,a);if(!c)return;const S=to(c,t);if(!S){Q.error(i("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const j=[...U];j[v]=bt(s,a,S);const _=S.variants;let T=te;t===te?T=Math.min(t,_.length-1):t<te&&(T=te-1),me(T),O([]),Z(ne=>ne+1),mt(j[v],a,T),Ue(j)},qs=t=>{if(v===null||!w)return;const s=U[v],a=Ke[v];if(!s||!a?.isMultivariate)return;const c=Ze(s,a);if(!c)return;const S=no(c,t),j=[...U];j[v]=bt(s,a,S);const _=t+1;me(_),O([]),Z(T=>T+1),mt(j[v],a,_),Ue(j)},Js=(t,s)=>{if(v===null||!w||t===s)return;const a=U[v],c=Ke[v];if(!a||!c?.isMultivariate)return;const S=Ze(a,c);if(!S)return;const j=Za(S,t,s),_=[...U];_[v]=bt(a,c,j);let T=te;te===t?T=s:t<te&&s>=te?T=te-1:t>te&&s<=te&&(T=te+1),me(T),mt(_[v],c,T),Ue(_)},on=t=>{const s=t??v;if(s===null||!w)return;const a=U[s],c=Ke[s];if(!a||!c)return;const S=Ya(a,c);if(!S){Q.error(i("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const j=[...U];j[s]=S.section;const _=Wt(j,r)[s];if(!_?.isMultivariate){Q.error(i("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}C(s),me(S.newVariantIndex),O([]),Z(T=>T+1),mt(S.section,_,S.newVariantIndex,s),Ue(j)},Ys=()=>{if(v===null||!w)return;const t=U[v],s=Ke[v];if(!t||!s?.isMultivariate)return;const a=Ze(t,s);if(!a)return;const c=eo(t,s,a);if(!c){Q.error(i("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const S=[...U];S[v]=c;const j=Wt(S,r)[v];if(!j)return;me(0),$(null),N(null),O([]),Z(T=>T+1);const _=xt(c,j,r);_?(L(_.data),K(_.resolveType)):(L(null),K(null)),Et(null,v,0),Ue(S)},Qs=async t=>{if(Be===null||!w)return;const s=dn(t,r);if(s){Q.error(s);return}const a=U[Be],c=Ke[Be];if(!a||!c)return;const S=xt(a,c,r);if(!S){Q.error(i("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const j={...S.data,name:t};try{await Ve.mutateAsync({blockKey:t,data:j});const _=[...U];_[Be]={__resolveType:t},await Ve.mutateAsync({blockKey:w,data:Ct(r,w,_,Ce,ze)}),v===Be&&kt(),ve(null),Q.success(i("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),u?.()}catch(_){Q.error(_ instanceof Error?_.message:i("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},yn=dt?.rule;if(Ft&&v===null&&J===null&&yn){const{resolveType:t,formValue:s}=Tt(yn,r??{},l??void 0);X(t),F(s)}const It=l?Ha(l):[],_n=l&&r?Ga(l,r):[],Xs=!Ne&&!!(f&&l&&r),Zs=J&&l?Gt(J,l):null,Rt=()=>{tt.current&&(clearTimeout(tt.current),tt.current=null),nt.current&&(clearTimeout(nt.current),nt.current=null)},Dt=async(t,s)=>{if(!(co(s,t,l)>0))try{await Qt.mutateAsync({blockKey:t})}catch(a){Q.error(a instanceof Error?a.message:i("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},jn=t=>{tt.current&&clearTimeout(tt.current),tt.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:c}=Ye.current;if(!s)return;const S={...a[s]},j={...S.sections},_=[...j.variants??[]],T=_[c],ne=T?.rule;if(wt(ne,a,l)){const M=ne?.__resolveType??"",H=a[M],W=typeof H?.name=="string"?H.name:M,{__resolveType:Ee,...q}=t;Ve.mutate({blockKey:M,data:Vt(Ee??"",q,W)},{onSuccess:()=>u?.(),onError:Y=>Q.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:Y.message}))});return}T&&(_[c]={...T,rule:t}),S.sections={...j,variants:_},Ve.mutate({blockKey:s,data:S},{onSuccess:()=>u?.(),onError:M=>Q.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:M.message}))})},mn)},ea=t=>{X(t);const s=t?{__resolveType:t}:{__resolveType:Ln};F({}),jn(s)},ta=t=>{const s=t;F(s);const a=J?{__resolveType:J,...s}:{...s};jn(a)},na=async t=>{Rt();const{activePageKey:s,decofile:a,variantIndex:c}=Ye.current;if(!s)return;const S=a[s],j=S?.sections;if(!j||typeof j!="object"||Array.isArray(j))return;const _=j;if(!Array.isArray(_.variants))return;const T=[..._.variants],ne=T[c];if(!ne)return;const M=Pt(ne.rule,a,l),H=qt(t);T[c]={...ne,rule:H};const W={...a,[s]:{...S,sections:{..._,variants:T}}},{resolveType:Ee,formValue:q}=Tt(H,W,l??void 0);X(Ee),F(q);try{await Ve.mutateAsync({blockKey:s,data:W[s]}),M&&M!==t&&await Dt(M,W),u?.()}catch(Y){Q.error(Y instanceof Error?Y.message:i("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},En=t=>{nt.current&&clearTimeout(nt.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=Ye.current;s!==null&&(nt.current=setTimeout(()=>{const{rawSections:c,parsedSections:S,decofile:j,activePageKey:_,pageVariants:T,variantIndex:ne}=Ye.current;if(!_)return;const M=c[s],H=S[s];if(!M||!H?.isMultivariate)return;const W=Ze(M,H);if(!W)return;const q=(W.variants??[])[a]?.rule;if(wt(q,j,l)){const ye=q?.__resolveType??"",qe=j[ye],at=typeof qe?.name=="string"?qe.name:ye,{__resolveType:gt,...ot}=t;Ve.mutate({blockKey:ye,data:Vt(gt??"",ot,at)},{onSuccess:()=>u?.(),onError:ht=>Q.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:ht.message}))});return}const Y=Cn(W,a,t),Pe=[...c];Pe[s]=bt(M,H,Y);const Qe=Ct(j,_,Pe,ne,T);Ve.mutate({blockKey:_,data:Qe},{onSuccess:()=>u?.(),onError:ye=>Q.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:ye.message}))})},mn))},sa=t=>{$(t),N({}),En(t?{__resolveType:t}:{__resolveType:Ln})},aa=t=>{const s=t;N(s);const a=ae?{__resolveType:ae,...s}:{...s};En(a)},oa=async t=>{Rt();const{selectedSectionIndex:s,sectionVariantIndex:a,rawSections:c,parsedSections:S,decofile:j,activePageKey:_,pageVariants:T,variantIndex:ne}=Ye.current;if(s===null||!_)return;const M=c[s],H=S[s];if(!M||!H?.isMultivariate)return;const W=Ze(M,H);if(!W)return;const Ee=W.variants??[],q=Pt(Ee[a]?.rule,j,l),Y=qt(t),Pe=Cn(W,a,Y),Qe=[...c];Qe[s]=bt(M,H,Pe);const ye=Ct(j,_,Qe,ne,T),qe={...j,[_]:ye},{resolveType:at,formValue:gt}=Tt(Y,qe,l??void 0);$(at),N(gt);try{await Ve.mutateAsync({blockKey:_,data:ye}),q&&q!==t&&await Dt(q,qe),u?.()}catch(ot){Q.error(ot instanceof Error?ot.message:i("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Ne&&!We)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:i("sectionsEditor.sectionsEditor.noPageFound",{currentPath:x})});if(Ne&&!Zt)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:i("sectionsEditor.sectionsEditor.globalBlockNotFound")});const ft=v!==null?Ke[v]??null:null,kn=v!==null?U[v]:null,Rn=kn&&ft?.isMultivariate?Ze(kn,ft):null,St=Rn?Pn(Rn,rt):[],rn=Math.min(te,Math.max(St.length-1,0)),$t=St[rn]??null,pt=ft?.isMultivariate===!0,wn=v!==null&&ft!==null,zt=wn&&(pt||!!(sn&&re)),ra=zt&&!Ne&&ft?.isSavedBlock===!0,st=Ne||ra,ia=Ne?hn:ft?.label??"",la=ae&&l?Gt(ae,l):null,ln=zt&&(!Ne||ie.length>0)?Ne?[hn,...ie]:[We.name,ft.label,...pt&&$t?[$t.label]:[],...ie]:[],ca=I&&We?[We.name,"SEO",...Fe]:[],Ht=I?ca:st?ln.length>0?ln:[ia]:ln,ua=!I&&!Ne&&pt&&ie.length===0,Vn=()=>{if(!w)return;Rt(),Me.current&&(clearTimeout(Me.current),Me.current=null);const t=r[w],s=Qa(t.sections,U);if(!s)return;const a=Xa(s);Ve.mutate({blockKey:w,data:{...t,sections:s}},{onSuccess:()=>{B(a),C(null),L(null),K(null),O([]),F(null),X(null)},onError:c=>Q.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:c.message}))})},cn=(t,s,a)=>{if(!w)return;Rt(),Me.current&&(clearTimeout(Me.current),Me.current=null);const c=r[w],S=c.sections;if(!S||typeof S!="object"||Array.isArray(S))return;const j=S;if(!Array.isArray(j.variants))return;const _=t([...j.variants]);if(!_)return;const T=mo(j,_),ne={...r,[w]:{...c,sections:T}};Ve.mutate({blockKey:w,data:ne[w]},{onSuccess:()=>{s?.(),a&&Dt(a,ne)},onError:M=>Q.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:M.message}))})},da=t=>{oe(null),B(t),C(null),L(null),K(null),O([]);const s=ze[t]?.rule,{resolveType:a,formValue:c}=Tt(s,r??{},l??void 0);X(a),F(c),xn(ze.map(S=>({rule:S.rule})),t)},ma=(t,s)=>{if(t===s)return;let a=Ce;Ce===t?a=s:t<Ce&&s>=Ce?a=Ce-1:t>Ce&&s<=Ce&&(a=Ce+1),B(a);const c=At(ze.map(S=>({rule:S.rule})),t,s);xn(c,a),cn(S=>At(S,t,s))},fa=t=>{const s=ze[t]?.rule,a=Pt(s,r??{},l??void 0);cn(c=>c.length<=1?null:(c.splice(t,1),c),()=>{ze.length-1===1?B(0):t<Ce?B(Ce-1):t===Ce&&B(Math.max(0,t-1)),C(null),L(null),K(null),O([]),F(null),X(null)},a)},pa=t=>{cn(s=>fo(s,t),()=>{B(t+1),C(null),L(null),K(null),O([]),F(null),X(null)})},ga=async(t,s)=>{Rt(),Me.current&&(clearTimeout(Me.current),Me.current=null);const a=Ye.current.activePageKey,c=Ye.current.decofile;if(!a)return;const S=c[a],j=S.sections;if(!j||typeof j!="object"||Array.isArray(j))return;const _=j;if(!Array.isArray(_.variants))return;const T=[..._.variants],ne=T[t];if(!ne?.rule||typeof ne.rule!="object"){Q.error(i("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const M=ne.rule,H=s.trim();Lt(!0);try{if(!H){if(!wt(M,c,l)){oe(null);return}const Qe=M.__resolveType??"";T[t]={...ne,rule:An(M,c,l)};const ye={...c,[a]:{...S,sections:{..._,variants:T}}};await Ve.mutateAsync({blockKey:a,data:ye[a]}),await Dt(Qe,ye),oe(null),u?.();return}const W=Mn(M,c,l);if(!W){Q.error(i("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(W.blockKey){await Ve.mutateAsync({blockKey:W.blockKey,data:Vt(W.resolveType,W.data,H)}),oe(null),u?.();return}const Ee=un(H),q=dn(Ee,c);if(q){Q.error(q);return}const Y=Vt(W.resolveType,W.data,H);let Pe=null;try{await Ve.mutateAsync({blockKey:Ee,data:Y}),Pe=Ee,T[t]={...ne,rule:qt(Ee)},await Ve.mutateAsync({blockKey:a,data:{...S,sections:{..._,variants:T}}}),Pe=null}catch(Qe){throw Pe&&await Qt.mutateAsync({blockKey:Pe}).catch(()=>{}),Qe}oe(null),Q.success(i("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:H})),u?.()}catch(W){Q.error(W instanceof Error?W.message:i("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Lt(!1)}},ha=async(t,s)=>{Rt(),Me.current&&(clearTimeout(Me.current),Me.current=null);const{selectedSectionIndex:a,rawSections:c,parsedSections:S,decofile:j,activePageKey:_,pageVariants:T,variantIndex:ne}=Ye.current;if(a===null||!_)return;const M=c[a],H=S[a];if(!M||!H?.isMultivariate)return;const W=Ze(M,H);if(!W)return;const Ee=W.variants??[],q=Ee[t];if(!q?.rule||typeof q.rule!="object"){Q.error(i("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const Y=q.rule,Pe=s.trim();Lt(!0);const Qe=async ye=>{const qe={...W,variants:ye},at=[...c];at[a]=bt(M,H,qe);const gt=Ct(j,_,at,ne,T);return await Ve.mutateAsync({blockKey:_,data:gt}),{...j,[_]:gt}};try{if(!Pe){if(!wt(Y,j,l)){le(null);return}const ht=Y.__resolveType??"",Tn=[...Ee];Tn[t]={...q,rule:An(Y,j,l)};const ya=await Qe(Tn);await Dt(ht,ya),le(null),u?.();return}const ye=Mn(Y,j,l);if(!ye){Q.error(i("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(ye.blockKey){await Ve.mutateAsync({blockKey:ye.blockKey,data:Vt(ye.resolveType,ye.data,Pe)}),le(null),u?.();return}const qe=un(Pe),at=dn(qe,j);if(at){Q.error(at);return}const gt=Vt(ye.resolveType,ye.data,Pe);let ot=null;try{await Ve.mutateAsync({blockKey:qe,data:gt}),ot=qe;const ht=[...Ee];ht[t]={...q,rule:qt(qe)},await Qe(ht),ot=null}catch(ht){throw ot&&await Qt.mutateAsync({blockKey:ot}).catch(()=>{}),ht}le(null),Q.success(i("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:Pe})),u?.()}catch(ye){Q.error(ye instanceof Error?ye.message:i("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Lt(!1)}},Nn=()=>{kt()},va=t=>{Ae(t),an({inner:t})},Sa=t=>{He(t),an({raw:t})},xa=()=>{Ae(null),xe([])},ba=()=>be(t=>t+1),Dn=t=>{if(I){if(t===0){ut.flush(),ce(!1),Ae(null),He(void 0),xe([]),be(a=>a+1),k?.();return}if(t===1){xe([]),be(a=>a+1);return}xe(Fe.slice(0,t-1)),be(a=>a+1);return}if(Ne){O(ie.slice(0,t)),Z(a=>a+1);return}if(t===0){Nn();return}if(t===1){O([]),Z(a=>a+1);return}if(pt&&t===2){O([]),Z(a=>a+1);return}const s=pt?2:1;O(ie.slice(0,t-s))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:st||zt||I?n.jsxs("div",{className:Oe("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:[Ht.length>1&&n.jsx("button",{type:"button",onClick:()=>Dn(po(Ht.length,{isMultivariateSectionTop:ua})),title:i("sectionsEditor.sectionsEditor.back"),"aria-label":i("sectionsEditor.sectionsEditor.back"),className:Oe("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",st?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(ls,{className:"size-4"})}),!Ne&&Ft&&dt&&n.jsxs("button",{type:"button",onClick:Nn,title:i("sectionsEditor.sectionsEditor.editingInVariant",{variant:dt.label}),className:Oe("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",fr),children:[n.jsx(bs,{rule:Mt(dt.rule,r??{},l??void 0),matchers:It}),n.jsx("span",{className:"max-w-[160px] truncate",children:dt.label})]}),n.jsx("nav",{"aria-label":i("sectionsEditor.sectionsEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:Ht.map((t,s)=>{const a=s===Ht.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s>0&&n.jsx(cs,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Dn(s),title:t,className:Oe("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",a?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}-${s}`)})}),st&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(bo,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(jt,{side:"bottom",className:"max-w-[260px]",children:i("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),wn&&!pt&&!ft?.isHidden&&w&&n.jsx(zn,{onClick:()=>on()})]}),st&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:i("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):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(gr,{pageKey:w,initialName:We.name,initialPath:We.path,onFieldChange:Bs})}),n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":i("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>ce(!0),children:n.jsx(vo,{size:14})})}),n.jsx(jt,{side:"bottom",children:i("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Je,{type:"button",variant:"ghost",size:"icon","aria-label":i("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>D&&w?D(w):_e(!0),children:n.jsx(So,{size:14})})}),n.jsx(jt,{side:"bottom",children:i("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(zn,{onClick:Vn})]})}),I?n.jsx(Jt,{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:Bt&&w?n.jsx(Fo,{rawSeo:tn,innerSeo:vn,defaultResolveType:Ps,seoSchema:Cs,activeResolveType:nn,seoTypeOptions:Ts,formResetKey:we,siteDefaultSeo:As,onBreadcrumbChange:xe,onPersistRaw:Sa,onInnerChange:va,onClearForm:xa,onBumpFormKey:ba}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:i("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})}):zt?n.jsxs(Jt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[pt&&St.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Wa,{listKey:`${w??""}:${v??""}`,variants:St.map((t,s)=>({index:s,label:t.label})),selectedIndex:rn,onSelect:Ws,onRename:le,onDuplicate:qs,onDelete:Us,onRemoveAll:Ys,onReorder:Js,onAdd:()=>on()}),pt&&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:i("sectionsEditor.sectionsEditor.variantRule")}),n.jsx(Hn,{currentRt:ae??"",currentLabel:Ut($t?.rule,r??{},rt,l??void 0),currentGlobalKey:Pt($t?.rule,r??{},l??void 0)??void 0,matchers:It,globals:_n,onSelect:sa,onSelectGlobal:oa,schema:la,formValue:$e,onChange:aa,formKey:`${v??"none"}:${rn}:${ae??""}`,formWrapperClassName:"pt-1",meta:l??void 0,decofile:r,onSaveReferencedBlock:Kt,sandbox:Ot})]})]}),n.jsx($n,{activeSchema:sn,formValue:re,formResetKey:Le,onFormChange:bn,onBreadcrumbChange:O,breadcrumbPath:ie,emptyMessage:i("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:l,decofile:r,onSaveReferencedBlock:Kt,sandbox:Ot})]}):Ne?n.jsx(Jt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx($n,{activeSchema:sn,formValue:re,formResetKey:Le,onFormChange:bn,onBreadcrumbChange:O,breadcrumbPath:ie,emptyMessage:i("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:l,decofile:r,onSaveReferencedBlock:Kt,sandbox:Ot})}):n.jsxs(Jt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Ft&&w&&n.jsx(ur,{listKey:w,variants:ze,activeIndex:Ce,decofile:r??{},meta:l,matchers:It,onSelect:da,onReorder:ma,onRename:oe,onDuplicate:pa,onDelete:fa,onAdd:Vn}),Ft&&J!==null&&n.jsxs("div",{className:Oe("px-3 border-b",pe?"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":pe,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:i("sectionsEditor.sectionsEditor.variantRule")}),pe?n.jsx(xo,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(go,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),pe&&n.jsx("div",{className:Oe("space-y-3",Nt&&"pointer-events-none opacity-50"),children:n.jsx(Hn,{currentRt:J,currentLabel:Ut(dt?.rule,r??{},rt,l??void 0),currentGlobalKey:Pt(dt?.rule,r??{},l??void 0)??void 0,matchers:It,globals:_n,onSelect:ea,onSelectGlobal:na,schema:Zs,formValue:fe,onChange:ta,formKey:`${Ce}:${J??""}`,formWrapperClassName:"space-y-3",meta:l??void 0,decofile:r,onSaveReferencedBlock:Kt,sandbox:Ot})})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(tr,{listKey:`${w??""}-${Ce}`,rawSections:U,sections:Ke,meta:l,selectedIndex:v,onSelect:Ls,onReorder:Fs,onDelete:Os,onDuplicate:Is,onMakeReusable:ve,onToggleHidden:$s,onToggleLazy:zs,onAddVariant:on,onDetach:Hs,onAddSection:()=>Se(!0),canAddSection:Xs})})]}),n.jsx(Ua,{open:Be!==null,onOpenChange:t=>{t||ve(null)},defaultBlockId:Be!==null?un(Ke[Be]?.label??""):"",isPending:Ve.isPending,onSubmit:Qs}),f&&n.jsx($o,{open:Re,onOpenChange:Se,meta:l,decofile:r,previewBaseUrl:f,onSelect:Gs}),De&&w&&r&&n.jsx(qa,{open:De,onOpenChange:_e,pageKey:w,decofile:r}),de!==null&&n.jsx(On,{open:!0,initialName:wt(ze[de]?.rule,r??{},l??void 0)?Ut(ze[de]?.rule,r??{},rt,l??void 0):"",autoLabel:rt(Mt(ze[de]?.rule,r??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await ga(de,t)},onOpenChange:t=>{!t&&!Nt&&oe(null)}}),ee!==null&&n.jsx(On,{open:!0,initialName:wt(St[ee]?.rule,r??{},l??void 0)?Ut(St[ee]?.rule,r??{},rt,l??void 0):"",autoLabel:rt(Mt(St[ee]?.rule,r??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await ha(ee,t)},onOpenChange:t=>{!t&&!Nt&&le(null)}})]})}export{fc as SectionsEditor};
@@ -1 +0,0 @@
1
- import{c as T,b as ve,j as o,r as ee,B as je,k as Se}from"./index-Dk9RGAqb.js";import{i as ke}from"./ChevronRight-Dkp8mDOd.js";import{a1 as fe}from"./agent-icon-E6ioveGx.js";import{m as xe}from"./automation-runs-CfKwQe7C.js";import{r as Ne,u as we,a as _e,b as Ee,i as Pe,d as Te,f as Fe,P as Re,S as Ce}from"./page-seo-form-C7Dzevsc.js";import{a5 as ue,r as Ke}from"./index-CwhgWx3d.js";import{a as ye}from"./Image01-CMEjSR3M.js";import"./AlertCircle-1e3-NcEA.js";import"./Tool01-B0759esA.js";import"./ArrowUp-DI1fyC1G.js";import"./Settings02-BIGi-T7s.js";import"./Tool02-DPXeBg9E.js";import"./ArrowRight-B-wHAJWT.js";import"./ArrowUpRight-BWyzrLQV.js";import"./TrendUp01-CYCVS1zr.js";import"./ZapSquare-DGe1cTc7.js";import"./ZoomOut-B-F-8cp0.js";import"./Users03-3lwc9liE.js";import"./CheckCircle-Dh-3VdHB.js";import"./Check-LKA0FKR0.js";import"./ChevronDown-B3fDqERa.js";import"./ChevronUp-Cm7VcWLZ.js";import"./DotsVertical-DKanPfz6.js";import"./Stars02-DpsxkqJO.js";import"./Copy01-uQh3Q5Fv.js";import"./Globe01-CEh6-y49.js";import"./Eye-SCLKEZSh.js";import"./FilterLines-13dE_TWB.js";import"./Star01-lWHLfmir.js";import"./Globe04-B4VpGXlx.js";import"./SwitchHorizontal01-Dw_LQc0f.js";import"./HardDrive-DViLU95V.js";import"./Key01-CgioJ7nW.js";import"./LayoutLeft-Yz5NzG-w.js";import"./XCircle-B3aYrCCW.js";import"./LinkExternal01-Di_tOfr7.js";import"./LogOut01-r12Fp93g.js";import"./Monitor01-C_dYkXdo.js";import"./Sun-tOsjvEis.js";import"./Package-R2sM0vCm.js";import"./Palette-CsQxyyrG.js";import"./Play-CVGtm9ao.js";import"./Plus-CLG5QKCr.js";import"./SearchLg-CkXJjhdf.js";import"./SearchMd-DBj7HhoW.js";import"./Shield01-ksb0VZpA.js";import"./Stars01-B3jznQQ4.js";import"./Trash01-CWIa_mDx.js";import"./Upload01-CPD95nN4.js";import"./User01-NxrNjn_h.js";import"./Users01-DvtVVxdG.js";import"./XClose-CW0R6bEe.js";import"./X-BYXAQs6v.js";import"./Zap-CrMVm5NK.js";import"./select-Bd1WKGSJ.js";import"./tooltip-xp77jFs4.js";import"./useInfiniteQuery-64uGdBMx.js";import"./use-infinite-scroll-CbSN3uty.js";import"./use-connection-BsS-3rZB.js";import"./use-mcp-client-Bzvvd0Df.js";import"./auth-C4POVeVe.js";import"./use-virtual-mcp-BP-M67aZ.js";import"./card-DcA1Rwjs.js";import"./sidebar-DBzYJLC2.js";import"./use-mobile-DQ8jManM.js";import"./table-CIOCQP8H.js";import"./empty-state-CwB9YNml.js";import"./use-members-Cf3JeQ7o.js";import"./use-org-auth-client-B1nrzsgv.js";import"./use-clock-tick-jphDPs9A.js";import"./use-automations-m1Zli3xa.js";import"./studio-tools-CFgWeCBk.js";import"./useSuspenseInfiniteQuery-DYsYorpe.js";import"./avatar-BQF1QGjq.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DmTk3Ltj.js";import"./file-type-icon-_JzjFo75.js";import"./dialog-CzDwjrNV.js";import"./tab-id-BijBBRwE.js";import"./hooks-CvwQxo-K.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-C_GcVLtN.js";import"./chat-context-BF6sak7i.js";import"./autosend-CMYVBxZV.js";import"./use-ai-providers-Bujq_lmM.js";import"./location-BpLtHjTZ.js";import"./use-decopilot-events-B3KnAJRh.js";import"./use-organization-settings-zX_T-3XG.js";import"./monaco-editor-CIeX3g7j.js";import"./index-CRECkoeT.js";import"./index-DaeJeAuV.js";import"./calendar-DV0NS9xq.js";import"./shell-layout-DCFL_zE0.js";import"./required-auth-layout-BfZFGRtL.js";import"./use-org-sso-w9j-Ok-z.js";import"./integration-icon-DBUjxWMb.js";import"./use-navigate-to-agent-D_vSOLwA.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-CB1-fSKl.js";import"./form-CJlgALpE.js";import"./label-D9aEMZqo.js";import"./input-C-gHIQip.js";import"./switch-J9ypA9K4.js";import"./drawer-CSHRJeTj.js";import"./collection-search-zQnUIpxo.js";import"./index-DKhbAOZU.js";import"./get-initials-D-f_fDFw.js";import"./popover-C2fPnPJt.js";import"./use-registry-app-DdwkqhPA.js";import"./use-mcp-tools-IcUfyh43.js";import"./github-repo-scope-DjMZbiKa.js";import"./authenticate-and-persist-oauth-iHWUIj8u.js";import"./mcp-oauth-Br5ozXBx.js";import"./extract-connection-data-ChU9AlhE.js";import"./metadata-dUsYcpuu.js";import"./dropdown-menu-CSgtqrA3.js";import"./command-CaEk5uho.js";import"./index-DLEyNPFn.js";import"./companions-core-Bua_v2zd.js";import"./tabs-BBm6nSot.js";import"./toggle-group-DaeRkjf6.js";import"./use-deco-credits-BW-cf-qH.js";import"./alert-dialog-DwnblylQ.js";import"./toolbar-icon-button-BGQ8DzLo.js";import"./skeleton-DoNQnm-q.js";import"./github-repo-picker-DeAiQyIc.js";import"./use-debounced-value-D9jV_d1U.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./connection-card-CfMynI7E.js";import"./use-registry-connections-C529xEPn.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-CQzBh7SW.js";import"./connection-form-helpers-BABNaeU1.js";import"./collection-tabs-B-9Urj68.js";import"./badge-BbmHyS30.js";import"./connect-desktop-dialog-CxqDr22T.js";import"./select-model-BeSzDzZp.js";import"./checkbox-DsDzIgcJ.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-Dh6zLap9.js";import"./index-EFMlI3jy.js";import"./toolbar-CoHzPWWi.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-D-dtBAQ9.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-DHlRnvUE.js";import"./pt-BR-CLy76QW2.js";import"./use-mcp-auth-status-UXgrVZIV.js";import"./use-debounced-autosave-C7P_JRA0.js";import"./index-D8ngUVkT.js";import"./search-input-BI1enB-b.js";import"./use-secrets-CTWWthzy.js";import"./useQueries-b2s80Vy2.js";import"./use-file-configs-D6Dg-9sN.js";import"./automation-list-row-BDIVGPMe.js";function A(d){return typeof d=="string"&&d.trim()?d:void 0}function he(d,e){if(d){if(e)try{const t=new URL(d,e).href;return ue(t)}catch{return}return ue(d)}}function ze(d){if(!d)return{};const e=A(d.title),t=A(d.titleTemplate);return{title:e&&t?.includes("%s")?t.replace(/%s/g,e):e,description:A(d.description),image:A(d.image),favicon:A(d.favicon)}}function De(d){if(!d)return"example.com";try{return new URL(d).host}catch{return"example.com"}}const $e=[{id:"google",labelKey:"sectionsEditor.seoPreview.platformGoogle",color:"#4285F4",layout:"search"},{id:"facebook",labelKey:"sectionsEditor.seoPreview.platformFacebook",color:"#1877F2",layout:"card"},{id:"twitter",labelKey:"sectionsEditor.seoPreview.platformTwitter",color:"#0f1419",layout:"card"},{id:"linkedin",labelKey:"sectionsEditor.seoPreview.platformLinkedin",color:"#0A66C2",layout:"card"},{id:"whatsapp",labelKey:"sectionsEditor.seoPreview.platformWhatsapp",color:"#25D366",layout:"chat"},{id:"telegram",labelKey:"sectionsEditor.seoPreview.platformTelegram",color:"#229ED9",layout:"chat"},{id:"slack",labelKey:"sectionsEditor.seoPreview.platformSlack",color:"#611f69",layout:"attachment"},{id:"discord",labelKey:"sectionsEditor.seoPreview.platformDiscord",color:"#5865F2",layout:"attachment"}];function de(d){const e=T.c(10),{src:t,className:n,iconSize:v}=d,l=v===void 0?20:v;if(t){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={objectFit:"cover"},e[0]=m):m=e[0];let p;return e[1]!==n||e[2]!==t?(p=o.jsx("img",{src:t,alt:"",referrerPolicy:"no-referrer",className:n,style:m}),e[1]=n,e[2]=t,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 i;e[5]!==l?(i=o.jsx(ye,{size:l}),e[5]=l,e[6]=i):i=e[6];let a;return e[7]!==n||e[8]!==i?(a=o.jsx("div",{className:n,style:s,children:i}),e[7]=n,e[8]=i,e[9]=a):a=e[9],a}function Ie(d){const e=T.c(33),{seo:t,host:n,path:v,t:l}=d;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={background:"#fff",border:"1px solid #dadce0"},e[0]=s):s=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={background:"#f1f3f4"},e[1]=i):i=e[1];let a;e[2]!==t.favicon?(a=o.jsx("div",{className:"flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-full",style:i,children:t.favicon?o.jsx("img",{src:t.favicon,alt:"",className:"size-full object-cover"}):o.jsx(ye,{size:12,color:"#9aa0a6"})}),e[2]=t.favicon,e[3]=a):a=e[3];let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m={color:"#202124"},e[4]=m):m=e[4];let p;e[5]!==n?(p=o.jsx("div",{className:"truncate text-[13px] leading-tight",style:m,children:n}),e[5]=n,e[6]=p):p=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f={color:"#4d5156"},e[7]=f):f=e[7];let r;e[8]!==n||e[9]!==v?(r=o.jsxs("div",{className:"truncate text-[12px] leading-tight",style:f,children:[n,v]}),e[8]=n,e[9]=v,e[10]=r):r=e[10];let c;e[11]!==p||e[12]!==r?(c=o.jsxs("div",{className:"min-w-0",children:[p,r]}),e[11]=p,e[12]=r,e[13]=c):c=e[13];let h;e[14]!==a||e[15]!==c?(h=o.jsxs("div",{className:"flex items-center gap-2",children:[a,c]}),e[14]=a,e[15]=c,e[16]=h):h=e[16];let x;e[17]===Symbol.for("react.memo_cache_sentinel")?(x={color:"#1a0dab"},e[17]=x):x=e[17];let y;e[18]!==t.title||e[19]!==l?(y=t.title??l("sectionsEditor.seoPreview.fallbackTitle"),e[18]=t.title,e[19]=l,e[20]=y):y=e[20];let u;e[21]!==y?(u=o.jsx("div",{className:"mt-1.5 truncate text-[18px] leading-snug",style:x,children:y}),e[21]=y,e[22]=u):u=e[22];let S;e[23]===Symbol.for("react.memo_cache_sentinel")?(S={color:"#4d5156"},e[23]=S):S=e[23];let g;e[24]!==t.description||e[25]!==l?(g=t.description??l("sectionsEditor.seoPreview.fallbackDescription"),e[24]=t.description,e[25]=l,e[26]=g):g=e[26];let b;e[27]!==g?(b=o.jsx("div",{className:"mt-0.5 line-clamp-2 text-[13px] leading-snug",style:S,children:g}),e[27]=g,e[28]=b):b=e[28];let j;return e[29]!==u||e[30]!==b||e[31]!==h?(j=o.jsxs("div",{className:"rounded-lg p-3 text-left",style:s,children:[h,u,b]}),e[29]=u,e[30]=b,e[31]=h,e[32]=j):j=e[32],j}function Le(d){const e=T.c(26),{seo:t,host:n,t:v}=d;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={background:"#fff",border:"1px solid #e2e8f0"},e[0]=l):l=e[0];let s;e[1]!==t.image?(s=o.jsx(de,{src:t.image,className:"h-40 w-full"}),e[1]=t.image,e[2]=s):s=e[2];let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i={borderTop:"1px solid #e2e8f0"},e[3]=i):i=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a={color:"#8a9099"},e[4]=a):a=e[4];let m;e[5]!==n?(m=o.jsx("div",{className:"truncate text-[11px]",style:a,children:n}),e[5]=n,e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#1c2024"},e[7]=p):p=e[7];let f;e[8]!==t.title||e[9]!==v?(f=t.title??v("sectionsEditor.seoPreview.fallbackTitle"),e[8]=t.title,e[9]=v,e[10]=f):f=e[10];let r;e[11]!==f?(r=o.jsx("div",{className:"line-clamp-1 text-[14px] font-semibold",style:p,children:f}),e[11]=f,e[12]=r):r=e[12];let c;e[13]===Symbol.for("react.memo_cache_sentinel")?(c={color:"#60666c"},e[13]=c):c=e[13];let h;e[14]!==t.description||e[15]!==v?(h=t.description??v("sectionsEditor.seoPreview.fallbackDescription"),e[14]=t.description,e[15]=v,e[16]=h):h=e[16];let x;e[17]!==h?(x=o.jsx("div",{className:"line-clamp-2 text-[12px]",style:c,children:h}),e[17]=h,e[18]=x):x=e[18];let y;e[19]!==x||e[20]!==m||e[21]!==r?(y=o.jsxs("div",{className:"px-3 py-2",style:i,children:[m,r,x]}),e[19]=x,e[20]=m,e[21]=r,e[22]=y):y=e[22];let u;return e[23]!==y||e[24]!==s?(u=o.jsxs("div",{className:"overflow-hidden rounded-lg text-left",style:l,children:[s,y]}),e[23]=y,e[24]=s,e[25]=u):u=e[25],u}function Be(d){const e=T.c(36),{seo:t,host:n,accent:v,t:l}=d;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={background:"#f0f2f5"},e[0]=s):s=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={color:"#3b4045"},e[1]=i):i=e[1];let a;e[2]!==l?(a=l("sectionsEditor.seoPreview.chatCardHint"),e[2]=l,e[3]=a):a=e[3];let m;e[4]!==a?(m=o.jsx("p",{className:"px-1 pb-1.5 text-[12px]",style:i,children:a}),e[4]=a,e[5]=m):m=e[5];const p=`3px solid ${v}`;let f;e[6]!==p?(f={background:"#fff",borderLeft:p},e[6]=p,e[7]=f):f=e[7];let r;e[8]!==t.image?(r=o.jsx(de,{src:t.image,className:"h-28 w-full",iconSize:18}),e[8]=t.image,e[9]=r):r=e[9];let c;e[10]===Symbol.for("react.memo_cache_sentinel")?(c={color:"#1c2024"},e[10]=c):c=e[10];let h;e[11]!==t.title||e[12]!==l?(h=t.title??l("sectionsEditor.seoPreview.fallbackTitle"),e[11]=t.title,e[12]=l,e[13]=h):h=e[13];let x;e[14]!==h?(x=o.jsx("div",{className:"line-clamp-1 text-[12px] font-semibold",style:c,children:h}),e[14]=h,e[15]=x):x=e[15];let y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y={color:"#60666c"},e[16]=y):y=e[16];let u;e[17]!==t.description||e[18]!==l?(u=t.description??l("sectionsEditor.seoPreview.fallbackDescription"),e[17]=t.description,e[18]=l,e[19]=u):u=e[19];let S;e[20]!==u?(S=o.jsx("div",{className:"line-clamp-2 text-[11px]",style:y,children:u}),e[20]=u,e[21]=S):S=e[21];let g;e[22]===Symbol.for("react.memo_cache_sentinel")?(g={color:"#8a9099"},e[22]=g):g=e[22];let b;e[23]!==n?(b=o.jsx("div",{className:"mt-0.5 text-[10px]",style:g,children:n}),e[23]=n,e[24]=b):b=e[24];let j;e[25]!==x||e[26]!==S||e[27]!==b?(j=o.jsxs("div",{className:"px-2.5 py-1.5",children:[x,S,b]}),e[25]=x,e[26]=S,e[27]=b,e[28]=j):j=e[28];let k;e[29]!==j||e[30]!==f||e[31]!==r?(k=o.jsxs("div",{className:"overflow-hidden rounded-md",style:f,children:[r,j]}),e[29]=j,e[30]=f,e[31]=r,e[32]=k):k=e[32];let N;return e[33]!==k||e[34]!==m?(N=o.jsxs("div",{className:"rounded-lg p-2 text-left",style:s,children:[m,k]}),e[33]=k,e[34]=m,e[35]=N):N=e[35],N}function Oe(d){const e=T.c(39),{seo:t,host:n,accent:v,dark:l,t:s}=d,i=l?"#2b2d31":"#fff",a=l?"#00a8fc":"#1264a3",m=l?"#dbdee1":"#3b4045",p=l?"#949ba4":"#8a9099",f=l?"none":"1px solid #e2e8f0";let r;e[0]!==i||e[1]!==f?(r={background:i,border:f},e[0]=i,e[1]=f,e[2]=r):r=e[2];const c=`3px solid ${v}`;let h;e[3]!==c?(h={borderLeft:c,borderRadius:2},e[3]=c,e[4]=h):h=e[4];let x;e[5]!==p?(x={color:p},e[5]=p,e[6]=x):x=e[6];let y;e[7]!==n||e[8]!==x?(y=o.jsx("div",{className:"text-[10px]",style:x,children:n}),e[7]=n,e[8]=x,e[9]=y):y=e[9];let u;e[10]!==a?(u={color:a},e[10]=a,e[11]=u):u=e[11];let S;e[12]!==t.title||e[13]!==s?(S=t.title??s("sectionsEditor.seoPreview.fallbackTitle"),e[12]=t.title,e[13]=s,e[14]=S):S=e[14];let g;e[15]!==u||e[16]!==S?(g=o.jsx("div",{className:"line-clamp-1 text-[13px] font-semibold",style:u,children:S}),e[15]=u,e[16]=S,e[17]=g):g=e[17];let b;e[18]!==m?(b={color:m},e[18]=m,e[19]=b):b=e[19];let j;e[20]!==t.description||e[21]!==s?(j=t.description??s("sectionsEditor.seoPreview.fallbackDescription"),e[20]=t.description,e[21]=s,e[22]=j):j=e[22];let k;e[23]!==b||e[24]!==j?(k=o.jsx("div",{className:"line-clamp-2 text-[12px]",style:b,children:j}),e[23]=b,e[24]=j,e[25]=k):k=e[25];let N;e[26]!==k||e[27]!==y||e[28]!==g?(N=o.jsxs("div",{className:"min-w-0 flex-1",children:[y,g,k]}),e[26]=k,e[27]=y,e[28]=g,e[29]=N):N=e[29];let w;e[30]!==t.image?(w=o.jsx(de,{src:t.image,className:"size-14 shrink-0 rounded",iconSize:16}),e[30]=t.image,e[31]=w):w=e[31];let _;e[32]!==N||e[33]!==w||e[34]!==h?(_=o.jsxs("div",{className:"flex gap-2.5 pl-2.5",style:h,children:[N,w]}),e[32]=N,e[33]=w,e[34]=h,e[35]=_):_=e[35];let P;return e[36]!==_||e[37]!==r?(P=o.jsx("div",{className:"rounded-lg p-2.5 text-left",style:r,children:_}),e[36]=_,e[37]=r,e[38]=P):P=e[38],P}function Ue(d){const e=T.c(21),{platform:t,seo:n,host:v,path:l,t:s}=d;let i;e[0]!==v||e[1]!==l||e[2]!==t.color||e[3]!==t.id||e[4]!==t.layout||e[5]!==n||e[6]!==s?(i=t.layout==="search"?o.jsx(Ie,{seo:n,host:v,path:l,t:s}):t.layout==="card"?o.jsx(Le,{seo:n,host:v,path:l,t:s}):t.layout==="chat"?o.jsx(Be,{seo:n,host:v,path:l,accent:t.color,t:s}):o.jsx(Oe,{seo:n,host:v,path:l,accent:t.color,dark:t.id==="discord",t:s}),e[0]=v,e[1]=l,e[2]=t.color,e[3]=t.id,e[4]=t.layout,e[5]=n,e[6]=s,e[7]=i):i=e[7];const a=i;let m;e[8]!==t.color?(m=o.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{background:t.color}}),e[8]=t.color,e[9]=m):m=e[9];let p;e[10]!==t.labelKey||e[11]!==s?(p=s(t.labelKey),e[10]=t.labelKey,e[11]=s,e[12]=p):p=e[12];let f;e[13]!==p?(f=o.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:p}),e[13]=p,e[14]=f):f=e[14];let r;e[15]!==m||e[16]!==f?(r=o.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5",children:[m,f]}),e[15]=m,e[16]=f,e[17]=r):r=e[17];let c;return e[18]!==a||e[19]!==r?(c=o.jsxs("div",{children:[r,a]}),e[18]=a,e[19]=r,e[20]=c):c=e[20],c}function Ae(d){const e=T.c(18),{seo:t,url:n,path:v}=d,l=v===void 0?"/":v,s=ve();let i,a,m;if(e[0]!==t||e[1]!==n){const u=ze(t);i=u,a=he(u.image,n),m=he(u.favicon,n),e[0]=t,e[1]=n,e[2]=i,e[3]=a,e[4]=m}else i=e[2],a=e[3],m=e[4];let p;e[5]!==i||e[6]!==a||e[7]!==m?(p={...i,image:a,favicon:m},e[5]=i,e[6]=a,e[7]=m,e[8]=p):p=e[8];const f=p;let r;e[9]!==n?(r=De(n),e[9]=n,e[10]=r):r=e[10];const c=r,h=l==="/"?"":l;let x;e[11]!==h||e[12]!==c||e[13]!==s||e[14]!==f?(x=$e.map(u=>o.jsx(Ue,{platform:u,seo:f,host:c,path:h,t:s},u.id)),e[11]=h,e[12]=c,e[13]=s,e[14]=f,e[15]=x):x=e[15];let y;return e[16]!==x?(y=o.jsx("div",{className:"grid grid-cols-1 gap-4 @2xl:grid-cols-2",children:x}),e[16]=x,e[17]=y):y=e[17],y}function Gi(d){const e=T.c(70),{orgSlug:t,virtualMcpId:n,branch:v,decofile:l,meta:s,target:i,previewBaseUrl:a,onSaved:m,onEditDefaultSeo:p,onBack:f}=d,r=ve(),c=Ne(l,i,s),h=c?.seoData,x=i.kind==="site"?"site":i.pageKey,[y,u]=ee.useState(x),[S,g]=ee.useState(null),[b,j]=ee.useState(0),[k,N]=ee.useState(void 0);y!==x&&(u(x),g(null),N(void 0),j(Ge));const{persistSeo:w,persistRawSeo:_,flush:P,isPending:te}=we({orgSlug:t,virtualMcpId:n,branch:v,target:i,resolved:c,onSaved:m}),M=i.kind==="page",ge=M?c?.rawSeoData:void 0,U=k!==void 0?k:ge,be=M?_e(U)??void 0:void 0,E=S??be??h??{},F=c?Ee(E,c):null,K=F&&(!M||Pe(U))?Ke(F,s):null;let G;e[0]!==s?(G=Te(s),e[0]=s,e[1]=G):G=e[1];const oe=G;let R,H;e[2]!==l||e[3]!==E||e[4]!==s||e[5]!==i.kind?(R=i.kind==="page"?Fe(l,s)?.seoData??{}:{},H=i.kind==="page"?Ve(R,E):E,e[2]=l,e[3]=E,e[4]=s,e[5]=i.kind,e[6]=R,e[7]=H):(R=e[6],H=e[7]);const ie=H;let V;e[8]!==w||e[9]!==c||e[10]!==g?(V=C=>{if(!c)return;const pe=C;g(pe),w(pe)},e[8]=w,e[9]=c,e[10]=g,e[11]=V):V=e[11];const se=V;let W;e[12]!==g?(W=()=>g(null),e[12]=g,e[13]=W):W=e[13];const re=W;let q;e[14]!==j?(q=()=>j(Me),e[14]=j,e[15]=q):q=e[15];const le=q;let J;e[16]!==P||e[17]!==f?(J=()=>{P(),f?.()},e[16]=P,e[17]=f,e[18]=J):J=e[18];const ce=J,z=i.kind==="page"?i.path:"/";let Q;e[19]!==z||e[20]!==a||e[21]!==i.kind?(Q=i.kind==="page"&&a?He(z,a):a??null,e[19]=z,e[20]=a,e[21]=i.kind,e[22]=Q):Q=e[22];const ne=Q;let X;e[23]!==c||e[24]!==r||e[25]!==i.kind?(X=i.kind==="site"?r("sectionsEditor.seoEditor.noSiteSeoBlock"):r(c?"sectionsEditor.seoEditor.noSeoSchema":"sectionsEditor.seoEditor.couldNotLoadSeo"),e[23]=c,e[24]=r,e[25]=i.kind,e[26]=X):X=e[26];const ae=X,Y=M&&c,me=i.kind==="site"&&c&&K;let D;e[27]!==ce||e[28]!==r||e[29]!==i.kind||e[30]!==i.pageName?(D=i.kind==="page"?o.jsxs("nav",{className:"flex min-w-0 items-center gap-1 text-sm",children:[o.jsx("button",{type:"button",onClick:ce,title:i.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:i.pageName}),o.jsx(ke,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("span",{className:"px-1 py-0.5 font-medium text-foreground",children:"SEO"})]}):o.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[o.jsx(fe,{size:16,className:"shrink-0 text-muted-foreground"}),o.jsx("span",{className:"text-sm font-medium",children:r("sectionsEditor.seoEditor.defaultSeoLabel")}),o.jsxs("span",{className:"hidden truncate text-xs text-muted-foreground sm:inline",children:["· ",r("sectionsEditor.seoEditor.appliedToEveryPage")]})]}),e[27]=ce,e[28]=r,e[29]=i.kind,e[30]=i.pageName,e[31]=D):D=e[31];let $;e[32]!==te?($=te&&o.jsx(Se,{size:14,className:"animate-spin text-muted-foreground"}),e[32]=te,e[33]=$):$=e[33];let I;e[34]!==p||e[35]!==r||e[36]!==i.kind?(I=i.kind==="page"&&p&&o.jsxs(je,{type:"button",variant:"outline",size:"sm",onClick:p,children:[o.jsx(fe,{size:14}),r("sectionsEditor.seoEditor.editDefaultSeoButton")]}),e[34]=p,e[35]=r,e[36]=i.kind,e[37]=I):I=e[37];let L;e[38]!==$||e[39]!==I?(L=o.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[$,I]}),e[38]=$,e[39]=I,e[40]=L):L=e[40];let B;e[41]!==L||e[42]!==D?(B=o.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[D,L]}),e[41]=L,e[42]=D,e[43]=B):B=e[43];let O;e[44]!==F||e[45]!==le||e[46]!==re||e[47]!==oe||e[48]!==U||e[49]!==E||e[50]!==ae||e[51]!==b||e[52]!==se||e[53]!==z||e[54]!==_||e[55]!==w||e[56]!==ie||e[57]!==ne||e[58]!==c||e[59]!==K||e[60]!==g||e[61]!==N||e[62]!==Y||e[63]!==me||e[64]!==R||e[65]!==r?(O=!c||!Y&&!me?o.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center text-sm text-muted-foreground",children:ae}):o.jsxs("div",{className:"flex min-h-0 flex-1",children:[o.jsx(xe,{className:"w-full max-w-md shrink-0 border-r [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-5 py-4",children:Y?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:r("sectionsEditor.seoEditor.emptyFieldsHint")}),o.jsx(Re,{rawSeo:U,innerSeo:E,defaultResolveType:oe,seoSchema:K,activeResolveType:F,seoTypeOptions:c.seoTypeOptions,formResetKey:b,siteDefaultSeo:R,onPersistRaw:C=>{N(C),_(C)},onInnerChange:C=>{g(C),w(C)},onClearForm:re,onBumpFormKey:le})]}):K&&F&&o.jsx(Ce,{schema:K,resolveType:F,value:E,formResetKey:b,onChange:se})})}),o.jsx(xe,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"@container px-5 py-4",children:o.jsx(Ae,{seo:ie,url:ne,path:z})})})]}),e[44]=F,e[45]=le,e[46]=re,e[47]=oe,e[48]=U,e[49]=E,e[50]=ae,e[51]=b,e[52]=se,e[53]=z,e[54]=_,e[55]=w,e[56]=ie,e[57]=ne,e[58]=c,e[59]=K,e[60]=g,e[61]=N,e[62]=Y,e[63]=me,e[64]=R,e[65]=r,e[66]=O):O=e[66];let Z;return e[67]!==B||e[68]!==O?(Z=o.jsxs("div",{className:"flex h-full w-full flex-col",children:[B,O]}),e[67]=B,e[68]=O,e[69]=Z):Z=e[69],Z}function Me(d){return d+1}function Ge(d){return d+1}function He(d,e){try{return new URL(d,e).href}catch{return e}}function Ve(d,e){const t=e.__resolveType,n=d.__resolveType;if(typeof t=="string"&&typeof n=="string"&&t!==n)return{...e};const v={...d};for(const[l,s]of Object.entries(e))l!=="__resolveType"&&s!=null&&(typeof s=="string"&&s.trim()===""||(v[l]=s));return v}export{Gi as SeoEditor};
@@ -1 +0,0 @@
1
- import{c as j,b as q,j as t,f as D,F as K,m as z,y as U,L as T,p as E,P as G,a as B,k as V,r as X,O as Y}from"./index-Dk9RGAqb.js";import{u as Z}from"./useRouterState-BE3l9A_t.js";import{j as ee,k as se,l as te,S as M,a as O,b as L,d as I,c as R,g as ie,h as ne}from"./sidebar-DBzYJLC2.js";import{a as le}from"./index-D8ngUVkT.js";import{n as re,i as oe,a as ae,c as ce,b as me}from"./ZapSquare-DGe1cTc7.js";import{t as fe,a as A}from"./Users03-3lwc9liE.js";import{i as de}from"./HardDrive-DViLU95V.js";import{i as xe}from"./Key01-CgioJ7nW.js";import{n as be}from"./LinkExternal01-Di_tOfr7.js";import{i as F}from"./LogOut01-r12Fp93g.js";import{i as ue}from"./Shield01-ksb0VZpA.js";import{s as ge}from"./User01-NxrNjn_h.js";import{i as pe}from"./Zap-CrMVm5NK.js";import{a as he}from"./use-capability-DHlRnvUE.js";import{u as je}from"./use-join-requests-avqI9CYZ.js";import{u as H}from"./use-mobile-DQ8jManM.js";import{u as ye}from"./use-status-sounds-D-dtBAQ9.js";import{T as _}from"./toolbar-CoHzPWWi.js";import{S as _e,M as ve}from"./shell-controls-DmSPQaRT.js";import"./LayoutLeft-Yz5NzG-w.js";import"./X-BYXAQs6v.js";import"./tooltip-xp77jFs4.js";import"./studio-tools-CFgWeCBk.js";import"./question-004-sINsf4GQ.js";import"./use-decopilot-events-B3KnAJRh.js";import"./decopilot-sse-pool-C_GcVLtN.js";import"./backoff-CrEUbyZT.js";import"./toolbar-icon-button-BGQ8DzLo.js";function J(){const e=j.c(23),s=q(),{capabilities:o,isPrivileged:n,loading:i,error:l}=he(),a=je().length;let r,c;if(e[0]!==o||e[1]!==l||e[2]!==n||e[3]!==a||e[4]!==i||e[5]!==s){c=Symbol.for("react.early_return_sentinel");e:{let m;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(fe,{size:14}),e[8]=m):m=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(be,{size:14}),e[9]=f):f=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(re,{size:14}),e[10]=d):d=e[10];let x;e[11]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(oe,{size:14}),e[11]=x):x=e[11];let b;e[12]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(xe,{size:14}),e[12]=b):b=e[12];let g;e[13]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(de,{size:14}),e[13]=g):g=e[13];let p;e[14]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(ae,{size:14}),e[14]=p):p=e[14];let u;e[15]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(A,{size:14}),e[15]=u):u=e[15];let y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(pe,{size:14}),e[16]=y):y=e[16];let h;e[17]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(ce,{size:14}),e[17]=h):h=e[17];let v;e[18]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(me,{size:14}),e[18]=v):v=e[18];let S;e[19]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(A,{size:14}),e[19]=S):S=e[19];let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(ue,{size:14}),e[20]=k):k=e[20];let N;e[21]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(U,{size:14}),e[21]=N):N=e[21];let $;e[22]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(ge,{size:14}),e[22]=$):$=e[22];const w=[{key:"organization",label:s("settings.nav.organization"),items:[{key:"general",label:s("settings.nav.general"),icon:m,to:"/$org/settings/general",requires:"org:manage"},{key:"connect",label:"Connect to clients",icon:f,to:"/$org/settings/connect"},{key:"brand-context",label:s("settings.nav.brandContext"),icon:d,to:"/$org/settings/brand-context",requires:"org:manage"},{key:"ai-providers",label:s("settings.nav.aiProviders"),icon:x,to:"/$org/settings/ai-providers",requires:"ai-providers:manage"},{key:"secrets",label:s("settings.nav.secrets"),icon:b,to:"/$org/settings/secrets",requires:"secrets:manage"},{key:"buckets",label:s("settings.nav.buckets"),icon:g,to:"/$org/settings/buckets",requires:"file-configs:manage"}]},{key:"build",label:s("settings.nav.build"),items:[{key:"connections",label:s("settings.nav.connections"),icon:p,to:"/$org/settings/connections"},{key:"agents",label:s("settings.nav.agents"),icon:u,to:"/$org/settings/agents"},{key:"automations",label:s("settings.nav.automations"),icon:y,to:"/$org/settings/automations",requires:"automations:manage"},{key:"store",label:s("settings.nav.store"),icon:h,to:"/$org/settings/store",requires:"registry:manage"}]},{key:"manage",label:s("settings.nav.manage"),items:[{key:"monitor",label:s("settings.nav.monitor"),icon:v,to:"/$org/settings/monitor",requires:"monitoring:view"},{key:"members",label:s("settings.nav.members"),icon:S,to:"/$org/settings/members",requires:"members:manage",badge:a},{key:"roles",label:s("settings.nav.roles"),icon:k,to:"/$org/settings/roles",privilegedOnly:!0},{key:"sso",label:s("settings.nav.security"),icon:N,to:"/$org/settings/sso",requires:"org:manage"}]},{key:"account",label:s("settings.nav.account"),items:[{key:"profile",label:s("settings.nav.profile"),icon:$,to:"/$org/settings/profile"}]}];if(i||l){c=w;break e}r=w.map(P=>({...P,items:P.items.filter(C=>C.privilegedOnly?n:C.requires?n||o[C.requires]:!0)})).filter(Se)}e[0]=o,e[1]=l,e[2]=n,e[3]=a,e[4]=i,e[5]=s,e[6]=r,e[7]=c}else r=e[6],c=e[7];return c!==Symbol.for("react.early_return_sentinel")?c:r}function Se(e){return e.items.length>0}function Q(e){const s=j.c(5),{icon:o,badge:n}=e;let i;s[0]!==n?(i=n?t.jsx("span",{className:"absolute -right-1 -top-1 size-2 rounded-full bg-destructive pointer-events-none"}):null,s[0]=n,s[1]=i):i=s[1];let l;return s[2]!==o||s[3]!==i?(l=t.jsxs("span",{className:"relative shrink-0",children:[o,i]}),s[2]=o,s[3]=i,s[4]=l):l=s[4],l}function W(){const e=j.c(8);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org"},e[0]=s):s=e[0];const{org:o}=D(s);let n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n={select:ke},e[1]=n):n=e[1];const i=Z(n);let l;e[2]!==o||e[3]!==i?(l=c=>{const m=c.replace("$org",o);return i.startsWith(m)},e[2]=o,e[3]=i,e[4]=l):l=e[4];const a=l;let r;return e[5]!==a||e[6]!==o?(r={org:o,isActive:a},e[5]=a,e[6]=o,e[7]=r):r=e[7],r}function ke(e){return e.location.pathname}function Ne(){const e=j.c(19),s=q(),o=J(),{org:n,isActive:i}=W();let l;if(e[0]!==o||e[1]!==i||e[2]!==n){let b;e[4]!==i||e[5]!==n?(b=(g,p)=>t.jsxs(M,{className:"pt-0 pr-0 pb-0 pl-0",children:[g.label&&t.jsx("p",{className:z("px-2 pt-1.5 pb-0.5 text-xs font-medium text-muted-foreground/60",p>0&&"mt-3"),children:g.label}),t.jsx(O,{children:t.jsx(L,{className:"gap-0.5",children:g.items.map(u=>t.jsx(I,{children:t.jsx(R,{asChild:!0,isActive:i(u.to),children:t.jsxs(T,{to:u.to,params:{org:n},onClick:()=>E("settings_nav_clicked",{section_key:u.key,group_key:g.key}),className:"flex items-center gap-2.5 text-sm",children:[t.jsx(Q,{icon:u.icon,badge:u.badge}),t.jsx("span",{className:"truncate",children:u.label})]})})},u.key))})})]},g.key),e[4]=i,e[5]=n,e[6]=b):b=e[6],l=o.map(b),e[0]=o,e[1]=i,e[2]=n,e[3]=l}else l=e[3];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"mx-2 my-2 border-t border-border/50"}),e[7]=a):a=e[7];let r;e[8]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("span",{className:"shrink-0",children:t.jsx(F,{size:14})}),e[8]=r):r=e[8];let c;e[9]!==s?(c=s("settings.nav.signOut"),e[9]=s,e[10]=c):c=e[10];let m;e[11]!==c?(m=t.jsxs(M,{className:"pt-0 pr-0 pb-0 pl-0",children:[a,t.jsx(O,{children:t.jsx(L,{className:"gap-0.5",children:t.jsx(I,{children:t.jsxs(R,{onClick:$e,className:"flex items-center gap-2.5 text-sm",children:[r,t.jsx("span",{className:"truncate",children:c})]})})})})]}),e[11]=c,e[12]=m):m=e[12];let f;e[13]!==l||e[14]!==m?(f=t.jsxs(ie,{className:"flex flex-col flex-1 mt-2 px-2 pb-2 gap-0 overflow-y-auto",children:[l,m]}),e[13]=l,e[14]=m,e[15]=f):f=e[15];let d;e[16]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("div",{className:"mt-auto px-4 pb-1",children:t.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","4.125.5"]})}),e[16]=d):d=e[16];let x;return e[17]!==f?(x=t.jsxs(ne,{variant:"sidebar",children:[f,d]}),e[17]=f,e[18]=x):x=e[18],x}function $e(){E("signed_out",{source:"settings_sidebar"}),G(),B.signOut()}function ze(e){const s=j.c(21),{onClose:o}=e,n=q(),i=J(),{org:l,isActive:a}=W();let r;if(s[0]!==i||s[1]!==a||s[2]!==o||s[3]!==l){let p;s[5]!==a||s[6]!==o||s[7]!==l?(p=(u,y)=>t.jsxs("div",{className:"flex flex-col gap-0.5",children:[u.label&&t.jsx("p",{className:z("px-3 pt-1.5 pb-0.5 text-xs font-medium text-muted-foreground/60",y>0&&"mt-3"),children:u.label}),u.items.map(h=>t.jsxs(T,{to:h.to,params:{org:l},onClick:o,className:z("flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm",a(h.to)?"bg-sidebar-accent text-sidebar-accent-foreground font-medium":"text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground"),children:[t.jsx(Q,{icon:h.icon,badge:h.badge}),t.jsx("span",{className:"truncate",children:h.label})]},h.key))]},u.key),s[5]=a,s[6]=o,s[7]=l,s[8]=p):p=s[8],r=i.map(p),s[0]=i,s[1]=a,s[2]=o,s[3]=l,s[4]=r}else r=s[4];let c;s[9]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"h-px bg-border/50 my-2"}),s[9]=c):c=s[9];let m;s[10]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("span",{className:"shrink-0",children:t.jsx(F,{size:14})}),s[10]=m):m=s[10];let f;s[11]!==n?(f=n("settings.nav.signOut"),s[11]=n,s[12]=f):f=s[12];let d;s[13]!==f?(d=t.jsxs("div",{className:"flex flex-col gap-0.5",children:[c,t.jsxs("button",{type:"button",onClick:Ce,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:[m,t.jsx("span",{className:"truncate",children:f})]})]}),s[13]=f,s[14]=d):d=s[14];let x;s[15]!==r||s[16]!==d?(x=t.jsxs("div",{className:"flex flex-col flex-1 overflow-y-auto px-2 py-2 gap-0.5",children:[r,d]}),s[15]=r,s[16]=d,s[17]=x):x=s[17];let b;s[18]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{className:"px-4 pb-3 pt-1 border-t border-border/50",children:t.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","4.125.5"]})}),s[18]=b):b=s[18];let g;return s[19]!==x?(g=t.jsxs("div",{className:"flex flex-col h-full bg-sidebar",children:[x,b]}),s[19]=x,s[20]=g):g=s[20],g}function Ce(){G(),B.signOut()}function qe(){const e=j.c(4),s=H(),{org:o}=K();ye(o.slug);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(V,{size:20,className:"animate-spin text-muted-foreground"})}),e[0]=n):n=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(X.Suspense,{fallback:n,children:t.jsx("div",{className:"flex flex-1 items-center overflow-hidden rounded-[inherit]",children:t.jsx(le,{value:"p-0",children:t.jsx("div",{className:"flex-1 min-w-0 overflow-hidden h-full",children:t.jsx(Y,{})})})})}),e[1]=i):i=e[1];const l=i;if(s){let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"flex flex-col flex-1 bg-background min-h-0 overflow-hidden",children:l}),e[2]=r):r=e[2],r}let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex-1 min-h-0 p-1",children:t.jsx("div",{className:z("flex flex-col h-full min-h-0 bg-background overflow-hidden","card-shadow","rounded-[0.75rem]"),children:l})}),e[3]=a):a=e[3],a}function ls(){const e=j.c(21),s=H();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(_.LogoLink,{}),e[0]=o):o=e[0];let n;e[1]!==s?(n=s&&t.jsx(_e,{}),e[1]=s,e[2]=n):n=e[2];let i;e[3]!==n?(i=t.jsxs(_.LeftColumn,{children:[o,n]}),e[3]=n,e[4]=i):i=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(_.CenterSlot,{}),e[5]=l):l=e[5];let a;e[6]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(_.RightColumn,{children:t.jsx("span",{})}),e[6]=a):a=e[6];let r;e[7]!==i?(r=t.jsxs(_.Header,{children:[i,l,a]}),e[7]=i,e[8]=r):r=e[8];let c;e[9]===Symbol.for("react.memo_cache_sentinel")?(c={"--sidebar-width-icon":"3.125rem"},e[9]=c):c=e[9];let m;e[10]!==s?(m=!s&&t.jsx(Ne,{}),e[10]=s,e[11]=m):m=e[11];let f;e[12]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(ee,{className:"flex flex-col",style:{background:"transparent",containerType:"inline-size"},children:t.jsx(qe,{})}),e[12]=f):f=e[12];let d;e[13]!==m?(d=t.jsxs(se,{className:"flex-1 bg-sidebar min-h-0",style:c,children:[m,f]}),e[13]=m,e[14]=d):d=e[14];let x;e[15]!==s?(x=s&&t.jsx(ve,{renderSidebar:we}),e[15]=s,e[16]=x):x=e[16];let b;return e[17]!==x||e[18]!==r||e[19]!==d?(b=t.jsx(_.Provider,{children:t.jsx(te,{defaultOpen:!0,children:t.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[r,d,x]})})}),e[17]=x,e[18]=r,e[19]=d,e[20]=b):b=e[20],b}function we(e){const{onClose:s}=e;return t.jsx(ze,{onClose:s})}export{Ne as SettingsSidebar,ze as SettingsSidebarMobile,ls as default};
@@ -1 +0,0 @@
1
- import{c as p,b,j as m}from"./index-Dk9RGAqb.js";import{u as d,m as h,p as S,q as x}from"./sidebar-DBzYJLC2.js";import{i as g}from"./LayoutLeft-Yz5NzG-w.js";import{T as j}from"./toolbar-icon-button-BGQ8DzLo.js";function B(u){const e=p.c(7),{className:l}=u,n=b(),{toggleSidebar:i}=d();let t;e[0]!==n?(t=n("layouts.shellControls.toggleSidebar"),e[0]=n,e[1]=t):t=e[1];let s;e[2]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx(g,{size:16}),e[2]=s):s=e[2];let o;return e[3]!==l||e[4]!==t||e[5]!==i?(o=m.jsx(j,{onClick:i,"aria-label":t,className:l,children:s}),e[3]=l,e[4]=t,e[5]=i,e[6]=o):o=e[6],o}function N(u){const e=p.c(16),{renderSidebar:l}=u,n=b(),{openMobile:i,setOpenMobile:t}=d();let s;e[0]!==n?(s=n("layouts.shellControls.navigationTitle"),e[0]=n,e[1]=s):s=e[1];let o;e[2]!==s?(o=m.jsx(h,{className:"sr-only",children:s}),e[2]=s,e[3]=o):o=e[3];let r;e[4]!==t?(r=()=>t(!1),e[4]=t,e[5]=r):r=e[5];let a;e[6]!==l||e[7]!==r?(a=l({onClose:r}),e[6]=l,e[7]=r,e[8]=a):a=e[8];let c;e[9]!==o||e[10]!==a?(c=m.jsxs(S,{side:"left",hideCloseButton:!0,className:"w-screen max-w-none! p-0",children:[o,a]}),e[9]=o,e[10]=a,e[11]=c):c=e[11];let f;return e[12]!==i||e[13]!==t||e[14]!==c?(f=m.jsx(x,{open:i,onOpenChange:t,children:c}),e[12]=i,e[13]=t,e[14]=c,e[15]=f):f=e[15],f}export{N as M,B as S};
@@ -1 +0,0 @@
1
- import{c as L,b as F,e as ae,j as n,B as $,t as te,bP as ee,y as ke,a as Z,w as Fe,x as Ne,K as ce,bQ as Me,bR as Be,G as X,m as ge,r as M,n as re,av as he,v as Ue,bS as Je,p as pe,bT as He,bU as Ke,d as Ge,F as Ve,f as _e,u as We,J as Qe,aV as Ye,bV as Xe,bW as xe,bX as Ze,bY as et,S as tt,O as nt,bZ as st}from"./index-Dk9RGAqb.js";import{A as de}from"./avatar-BQF1QGjq.js";import{t as Te,a as ot}from"./Users03-3lwc9liE.js";import{i as it}from"./SearchLg-CkXJjhdf.js";import{i as at,s as rt,a as U,n as lt}from"./Stars02-DpsxkqJO.js";import{s as ct}from"./XClose-CW0R6bEe.js";import{i as K}from"./CheckCircle-Dh-3VdHB.js";import{i as ye}from"./FilterLines-13dE_TWB.js";import{i as Y}from"./Zap-CrMVm5NK.js";import{a as Ae,b as Oe,d as Ce,e as Pe,h as dt,c as ut}from"./dialog-CzDwjrNV.js";import{R as mt}from"./required-auth-layout-BfZFGRtL.js";import{A as ft}from"./autosend-CMYVBxZV.js";import{a as be,m as gt,S as ht}from"./use-mcp-client-Bzvvd0Df.js";import{c as pt}from"./hooks-CvwQxo-K.js";import{q as xt}from"./tab-id-BijBBRwE.js";import{d as yt}from"./use-organization-settings-zX_T-3XG.js";import{u as bt}from"./use-org-sso-w9j-Ok-z.js";function St(t){const e=L.c(49),{orgName:o,orgSlug:a,orgLogo:l,domain:s}=t,i=F();let r;e[0]!==a||e[1]!==i?(r=async()=>{const N=await fetch("/api/auth/custom/domain-join",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:a})}),O=await N.json();if(!N.ok||!O.success)throw new Error(O.error??i("common.autoDomainJoinScreen.joinError"));return O},e[0]=a,e[1]=i,e[2]=r):r=e[2];let d;e[3]!==a?(d=N=>{window.location.href=`/${N.slug??a}`},e[3]=a,e[4]=d):d=e[4];let g;e[5]!==i?(g=N=>{te.error(N instanceof Error?N.message:i("common.autoDomainJoinScreen.joinError"))},e[5]=i,e[6]=g):g=e[6];let w;e[7]!==r||e[8]!==d||e[9]!==g?(w={mutationFn:r,onSuccess:d,onError:g},e[7]=r,e[8]=d,e[9]=g,e[10]=w):w=e[10];const m=ae(w),p=wt;let c;e[11]!==l||e[12]!==o?(c=l?n.jsx(de,{url:l,fallback:o.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(Te,{className:"h-6 w-6 text-primary"})}),e[11]=l,e[12]=o,e[13]=c):c=e[13];let u;e[14]!==o||e[15]!==i?(u=i("common.autoDomainJoinScreen.joinPrompt",{orgName:o}),e[14]=o,e[15]=i,e[16]=u):u=e[16];let f;e[17]!==u?(f=n.jsx("h3",{className:"text-lg font-medium",children:u}),e[17]=u,e[18]=f):f=e[18];let h;e[19]!==s||e[20]!==i?(h=i("common.autoDomainJoinScreen.joinDescription",{domain:s}),e[19]=s,e[20]=i,e[21]=h):h=e[21];let x;e[22]!==h?(x=n.jsx("p",{className:"text-sm text-muted-foreground",children:h}),e[22]=h,e[23]=x):x=e[23];let y;e[24]!==f||e[25]!==x?(y=n.jsxs("div",{className:"space-y-2",children:[f,x]}),e[24]=f,e[25]=x,e[26]=y):y=e[26];let S;e[27]!==m?(S=()=>m.mutate(),e[27]=m,e[28]=S):S=e[28];let v;e[29]!==m.isPending||e[30]!==o||e[31]!==i?(v=m.isPending?i("common.autoDomainJoinScreen.joining"):i("common.autoDomainJoinScreen.enterOrg",{orgName:o}),e[29]=m.isPending,e[30]=o,e[31]=i,e[32]=v):v=e[32];let _;e[33]!==m.isPending||e[34]!==S||e[35]!==v?(_=n.jsx($,{onClick:S,disabled:m.isPending,children:v}),e[33]=m.isPending,e[34]=S,e[35]=v,e[36]=_):_=e[36];const k=m.isPending;let j;e[37]!==i?(j=i("common.autoDomainJoinScreen.goHome"),e[37]=i,e[38]=j):j=e[38];let b;e[39]!==m.isPending||e[40]!==j?(b=n.jsx($,{variant:"ghost",onClick:p,disabled:k,children:j}),e[39]=m.isPending,e[40]=j,e[41]=b):b=e[41];let T;e[42]!==_||e[43]!==b?(T=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[_,b]}),e[42]=_,e[43]=b,e[44]=T):T=e[44];let A;return e[45]!==y||e[46]!==T||e[47]!==c?(A=n.jsxs(ee,{children:[c,y,T]}),e[45]=y,e[46]=T,e[47]=c,e[48]=A):A=e[48],A}function wt(){window.location.href="/"}function Se(t){const e=L.c(25),{orgSlug:o,orgName:a,reason:l}=t,s=F(),i=vt,r=l==="not-found",d=r?it:ke;let g;e[0]!==r||e[1]!==s?(g=s(r?"common.noAccessScreen.organizationNotFound":"common.noAccessScreen.noAccess"),e[0]=r,e[1]=s,e[2]=g):g=e[2];const w=g;let m;e[3]!==r||e[4]!==a||e[5]!==o||e[6]!==s?(m=r?n.jsxs(n.Fragment,{children:[s("common.noAccessScreen.couldNotFind")," ",n.jsx("strong",{children:o}),"."]}):n.jsxs(n.Fragment,{children:[s("common.noAccessScreen.noAccessTo")," ",n.jsx("strong",{children:a??o}),".",n.jsx("br",{}),s("common.noAccessScreen.askAdminToInvite")]}),e[3]=r,e[4]=a,e[5]=o,e[6]=s,e[7]=m):m=e[7];const p=m;let c;e[8]!==d?(c=n.jsx("div",{className:"bg-muted p-3 rounded-full",children:n.jsx(d,{className:"h-6 w-6 text-muted-foreground"})}),e[8]=d,e[9]=c):c=e[9];let u;e[10]!==w?(u=n.jsx("h3",{className:"text-lg font-medium",children:w}),e[10]=w,e[11]=u):u=e[11];let f;e[12]!==p?(f=n.jsx("p",{className:"text-sm text-muted-foreground",children:p}),e[12]=p,e[13]=f):f=e[13];let h;e[14]!==u||e[15]!==f?(h=n.jsxs("div",{className:"space-y-2",children:[u,f]}),e[14]=u,e[15]=f,e[16]=h):h=e[16];let x;e[17]!==s?(x=s("common.noAccessScreen.goToHome"),e[17]=s,e[18]=x):x=e[18];let y;e[19]!==x?(y=n.jsx($,{onClick:i,children:x}),e[19]=x,e[20]=y):y=e[20];let S;return e[21]!==c||e[22]!==h||e[23]!==y?(S=n.jsxs(ee,{children:[c,h,y]}),e[21]=c,e[22]=h,e[23]=y,e[24]=S):S=e[24],S}function vt(){window.location.href="/"}function jt(t){const e=L.c(59),{invitationId:o,orgName:a,orgSlug:l,orgLogo:s}=t,i=F();let r;e[0]!==o?(r=async()=>{const P=await Z.organization.acceptInvitation({invitationId:o});if(P.error)throw new Error(P.error.message);return P.data},e[0]=o,e[1]=r):r=e[1];let d;e[2]!==l?(d=()=>{Fe(),window.location.href=`/${l}`},e[2]=l,e[3]=d):d=e[3];let g;e[4]!==i?(g=P=>{te.error(P instanceof Error?P.message:i("common.pendingInviteScreen.failedToAccept"))},e[4]=i,e[5]=g):g=e[5];let w;e[6]!==r||e[7]!==d||e[8]!==g?(w={mutationFn:r,onSuccess:d,onError:g},e[6]=r,e[7]=d,e[8]=g,e[9]=w):w=e[9];const m=ae(w);let p;e[10]!==o?(p=async()=>{const P=await Z.organization.rejectInvitation({invitationId:o});if(P.error)throw new Error(P.error.message);return P.data},e[10]=o,e[11]=p):p=e[11];let c,u;e[12]!==i?(c=()=>{te.success(i("common.pendingInviteScreen.invitationDeclined")),window.location.href="/"},u=P=>{te.error(P instanceof Error?P.message:i("common.pendingInviteScreen.failedToDecline"))},e[12]=i,e[13]=c,e[14]=u):(c=e[13],u=e[14]);let f;e[15]!==p||e[16]!==c||e[17]!==u?(f={mutationFn:p,onSuccess:c,onError:u},e[15]=p,e[16]=c,e[17]=u,e[18]=f):f=e[18];const h=ae(f),x=m.isPending||h.isPending;let y;e[19]!==s||e[20]!==a?(y=s?n.jsx(de,{url:s,fallback:a.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(at,{className:"h-6 w-6 text-primary"})}),e[19]=s,e[20]=a,e[21]=y):y=e[21];let S;e[22]!==a||e[23]!==i?(S=i("common.pendingInviteScreen.invitedTo",{orgName:a}),e[22]=a,e[23]=i,e[24]=S):S=e[24];let v;e[25]!==S?(v=n.jsx("h3",{className:"text-lg font-medium",children:S}),e[25]=S,e[26]=v):v=e[26];let _;e[27]!==i?(_=i("common.pendingInviteScreen.acceptDescription"),e[27]=i,e[28]=_):_=e[28];let k;e[29]!==_?(k=n.jsx("p",{className:"text-sm text-muted-foreground",children:_}),e[29]=_,e[30]=k):k=e[30];let j;e[31]!==v||e[32]!==k?(j=n.jsxs("div",{className:"space-y-2",children:[v,k]}),e[31]=v,e[32]=k,e[33]=j):j=e[33];let b;e[34]!==m?(b=()=>m.mutate(),e[34]=m,e[35]=b):b=e[35];let T;e[36]!==m.isPending||e[37]!==i?(T=m.isPending?i("common.pendingInviteScreen.acceptingButton"):i("common.pendingInviteScreen.acceptButton"),e[36]=m.isPending,e[37]=i,e[38]=T):T=e[38];let A;e[39]!==x||e[40]!==b||e[41]!==T?(A=n.jsx($,{onClick:b,disabled:x,children:T}),e[39]=x,e[40]=b,e[41]=T,e[42]=A):A=e[42];let N;e[43]!==h?(N=()=>h.mutate(),e[43]=h,e[44]=N):N=e[44];let O;e[45]!==h.isPending||e[46]!==i?(O=h.isPending?i("common.pendingInviteScreen.decliningButton"):i("common.pendingInviteScreen.declineButton"),e[45]=h.isPending,e[46]=i,e[47]=O):O=e[47];let I;e[48]!==x||e[49]!==N||e[50]!==O?(I=n.jsx($,{variant:"ghost",onClick:N,disabled:x,children:O}),e[48]=x,e[49]=N,e[50]=O,e[51]=I):I=e[51];let C;e[52]!==A||e[53]!==I?(C=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[A,I]}),e[52]=A,e[53]=I,e[54]=C):C=e[54];let D;return e[55]!==j||e[56]!==C||e[57]!==y?(D=n.jsxs(ee,{children:[y,j,C]}),e[55]=j,e[56]=C,e[57]=y,e[58]=D):D=e[58],D}function kt(t){const e=L.c(23),{orgName:o,orgLogo:a}=t,l=F();let s;e[0]!==a||e[1]!==o?(s=a?n.jsx(de,{url:a,fallback:o.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(rt,{className:"h-6 w-6 text-primary"})}),e[0]=a,e[1]=o,e[2]=s):s=e[2];let i;e[3]!==l?(i=l("common.requestPendingScreen.title"),e[3]=l,e[4]=i):i=e[4];let r;e[5]!==i?(r=n.jsx("h3",{className:"text-lg font-medium",children:i}),e[5]=i,e[6]=r):r=e[6];let d;e[7]!==o||e[8]!==l?(d=l("common.requestPendingScreen.description",{orgName:o}),e[7]=o,e[8]=l,e[9]=d):d=e[9];let g;e[10]!==d?(g=n.jsx("p",{className:"text-sm text-muted-foreground",children:d}),e[10]=d,e[11]=g):g=e[11];let w;e[12]!==r||e[13]!==g?(w=n.jsxs("div",{className:"space-y-2",children:[r,g]}),e[12]=r,e[13]=g,e[14]=w):w=e[14];let m;e[15]!==l?(m=l("common.requestPendingScreen.goHome"),e[15]=l,e[16]=m):m=e[16];let p;e[17]!==m?(p=n.jsx($,{variant:"ghost",onClick:Nt,children:m}),e[17]=m,e[18]=p):p=e[18];let c;return e[19]!==s||e[20]!==w||e[21]!==p?(c=n.jsxs(ee,{children:[s,w,p]}),e[19]=s,e[20]=w,e[21]=p,e[22]=c):c=e[22],c}function Nt(){window.location.href="/"}function _t(t){const e=L.c(45),{orgName:o,orgSlug:a,orgLogo:l,domain:s}=t,i=F();let r;e[0]!==a?(r=async()=>{const A=await fetch("/api/auth/custom/domain-request-join",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:a})}),N=await A.json();if(!A.ok||!N.success)throw new Error(N.error??"Failed to request access");return N},e[0]=a,e[1]=r):r=e[1];let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=At,e[2]=d):d=e[2];let g;e[3]!==i?(g=A=>{te.error(A instanceof Error?A.message:i("common.requestToJoinScreen.failedToRequest"))},e[3]=i,e[4]=g):g=e[4];let w;e[5]!==r||e[6]!==g?(w={mutationFn:r,onSuccess:d,onError:g},e[5]=r,e[6]=g,e[7]=w):w=e[7];const m=ae(w);let p;e[8]!==l||e[9]!==o?(p=l?n.jsx(de,{url:l,fallback:o.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(Te,{className:"h-6 w-6 text-primary"})}),e[8]=l,e[9]=o,e[10]=p):p=e[10];let c;e[11]!==o||e[12]!==i?(c=i("common.requestToJoinScreen.title",{orgName:o}),e[11]=o,e[12]=i,e[13]=c):c=e[13];let u;e[14]!==c?(u=n.jsx("h3",{className:"text-lg font-medium",children:c}),e[14]=c,e[15]=u):u=e[15];let f;e[16]!==s||e[17]!==i?(f=i("common.requestToJoinScreen.description",{domain:s}),e[16]=s,e[17]=i,e[18]=f):f=e[18];let h;e[19]!==f?(h=n.jsx("p",{className:"text-sm text-muted-foreground",children:f}),e[19]=f,e[20]=h):h=e[20];let x;e[21]!==u||e[22]!==h?(x=n.jsxs("div",{className:"space-y-2",children:[u,h]}),e[21]=u,e[22]=h,e[23]=x):x=e[23];let y;e[24]!==m?(y=()=>m.mutate(),e[24]=m,e[25]=y):y=e[25];let S;e[26]!==m.isPending||e[27]!==i?(S=m.isPending?i("common.requestToJoinScreen.requesting"):i("common.requestToJoinScreen.requestButton"),e[26]=m.isPending,e[27]=i,e[28]=S):S=e[28];let v;e[29]!==m.isPending||e[30]!==y||e[31]!==S?(v=n.jsx($,{onClick:y,disabled:m.isPending,children:S}),e[29]=m.isPending,e[30]=y,e[31]=S,e[32]=v):v=e[32];const _=m.isPending;let k;e[33]!==i?(k=i("common.requestToJoinScreen.goToHome"),e[33]=i,e[34]=k):k=e[34];let j;e[35]!==m.isPending||e[36]!==k?(j=n.jsx($,{variant:"ghost",onClick:Tt,disabled:_,children:k}),e[35]=m.isPending,e[36]=k,e[37]=j):j=e[37];let b;e[38]!==v||e[39]!==j?(b=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[v,j]}),e[38]=v,e[39]=j,e[40]=b):b=e[40];let T;return e[41]!==x||e[42]!==b||e[43]!==p?(T=n.jsxs(ee,{children:[p,x,b]}),e[41]=x,e[42]=b,e[43]=p,e[44]=T):T=e[44],T}function Tt(){window.location.href="/"}function At(t){if(t.alreadyMember&&t.slug){window.location.href=`/${t.slug}`;return}window.location.reload()}function Ot(t){const e=L.c(7);let o;e[0]!==t?(o=ce.orgAccessStatus(t),e[0]=t,e[1]=o):o=e[1];let a;e[2]!==t?(a=async()=>{const s=await fetch(`/api/auth/custom/org-access-status/${encodeURIComponent(t)}`,{credentials:"include"});if(!s.ok)throw new Error(`org-access-status failed (${s.status})`);return await s.json()},e[2]=t,e[3]=a):a=e[3];let l;return e[4]!==o||e[5]!==a?(l={queryKey:o,queryFn:a,refetchOnWindowFocus:!1},e[4]=o,e[5]=a,e[6]=l):l=e[6],Ne(l)}function Ct({orgSlug:t}){const{data:e}=Ot(t);if(e.status!=="member"){Me()?.org===t&&Be();const o=localStorage.getItem(X.lastOrgSlug())===t;if(o&&localStorage.removeItem(X.lastOrgSlug()),o&&(e.status==="not-found"||e.status==="no-access"))return window.location.href="/",null}return e.status==="not-found"?n.jsx(Se,{orgSlug:t,reason:"not-found"}):e.status==="pending-invite"?n.jsx(jt,{invitationId:e.invitation.id,orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo}):e.status==="auto-domain-join"?n.jsx(St,{orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo,domain:e.organization.domain??""}):e.status==="can-request"?n.jsx(_t,{orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo,domain:e.organization.domain??""}):e.status==="request-pending"?n.jsx(kt,{orgName:e.organization.name,orgLogo:e.organization.logo}):e.status==="member"?(window.location.reload(),null):n.jsx(Se,{orgSlug:t,orgName:e.organization.name,reason:"no-access"})}function Ee(t){const e=L.c(42),{ariaLabel:o,dismissLabel:a,eyebrow:l,title:s,description:i,icon:r,children:d,footerLeading:g,actions:w,onDismiss:m,tone:p}=t,c=p===void 0?"neutral":p,u=g||w;let f;e[0]!==c?(f=c==="system"&&n.jsx("div",{className:"h-0.5 bg-special"}),e[0]=c,e[1]=f):f=e[1];let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(ct,{size:14}),e[2]=h):h=e[2];let x;e[3]!==a||e[4]!==m?(x=n.jsx($,{size:"icon-sm",variant:"ghost","aria-label":a,className:"absolute right-2 top-2 z-10 text-muted-foreground",onClick:m,children:h}),e[3]=a,e[4]=m,e[5]=x):x=e[5];const y=r&&"flex items-start gap-3",S=d&&"pb-3";let v;e[6]!==y||e[7]!==S?(v=ge("p-4 pr-11",y,S),e[6]=y,e[7]=S,e[8]=v):v=e[8];let _;e[9]!==r?(_=r&&n.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-special/10 text-special",children:r}),e[9]=r,e[10]=_):_=e[10];let k;e[11]!==l?(k=l&&n.jsx("p",{className:"text-xs text-muted-foreground",children:l}),e[11]=l,e[12]=k):k=e[12];let j;e[13]!==s?(j=n.jsx("h3",{className:"text-base font-semibold text-foreground",children:s}),e[13]=s,e[14]=j):j=e[14];let b;e[15]!==i?(b=i&&n.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:i}),e[15]=i,e[16]=b):b=e[16];let T;e[17]!==j||e[18]!==b||e[19]!==k?(T=n.jsxs("div",{children:[k,j,b]}),e[17]=j,e[18]=b,e[19]=k,e[20]=T):T=e[20];let A;e[21]!==d?(A=d&&n.jsx("div",{className:"mt-3",children:d}),e[21]=d,e[22]=A):A=e[22];let N;e[23]!==T||e[24]!==A?(N=n.jsxs("div",{className:"min-w-0 flex-1",children:[T,A]}),e[23]=T,e[24]=A,e[25]=N):N=e[25];let O;e[26]!==N||e[27]!==v||e[28]!==_?(O=n.jsxs("div",{className:v,children:[_,N]}),e[26]=N,e[27]=v,e[28]=_,e[29]=O):O=e[29];let I;e[30]!==w||e[31]!==g||e[32]!==u||e[33]!==c?(I=u&&n.jsxs("div",{className:ge("flex items-center justify-between gap-3 px-4 py-2.5",c==="system"?"border-t border-border bg-muted/50":"pt-0"),children:[n.jsx("div",{className:"min-w-0 text-xs text-muted-foreground",children:g}),n.jsx("div",{className:"flex shrink-0 items-center gap-2",children:w})]}),e[30]=w,e[31]=g,e[32]=u,e[33]=c,e[34]=I):I=e[34];let C;return e[35]!==o||e[36]!==O||e[37]!==I||e[38]!==f||e[39]!==x||e[40]!==c?(C=n.jsxs("div",{role:"dialog","aria-label":o,"data-slot":"announcement-card","data-tone":c,className:"relative w-full overflow-hidden rounded-lg border border-border bg-background shadow-lg animate-in fade-in slide-in-from-bottom-2 duration-300",children:[f,x,O,I]}),e[35]=o,e[36]=O,e[37]=I,e[38]=f,e[39]=x,e[40]=c,e[41]=C):C=e[41],C}const Ie=[{id:"codex-gpt-5-6-defaults",date:"2026-07-13",eyebrow:"Now Available",title:"Codex defaults move to GPT-5.6",bullets:[{icon:U,title:"Sol leads Thinking",body:"Codex Thinking now defaults to `gpt-5.6-sol` for deeper coding and reasoning work."},{icon:K,title:"Terra balances Smart",body:"The Smart tier now uses `gpt-5.6-terra`, replacing GPT-5.4 as the default balanced Codex model."},{icon:Y,title:"Luna speeds up Fast",body:"The Fast tier and lightweight Codex title generation now use `gpt-5.6-luna`. Existing threads that reference older GPT-5.4 or GPT-5.5 model IDs remain supported."}]},{id:"claude-sonnet-5",date:"2026-06-30",eyebrow:"Now Available",title:"Claude Sonnet 5 powers the Smart tier",bullets:[{icon:U,title:"More agentic coding",body:"Sonnet 5 is Anthropic's strongest Sonnet model yet, with improved reasoning, tool use, coding, and knowledge work compared with Sonnet 4.6."},{icon:K,title:"Available in Claude Code",body:"The Claude Code harness now pins the Smart tier to the new `claude-sonnet-5` model id so new sessions use Sonnet 5 by default."},{icon:Y,title:"Nothing to change",body:"Existing Smart-tier chats and agents pick up Sonnet 5 automatically. Thinking remains on Opus 4.8 1M."}],learnMoreHref:"https://www.anthropic.com/news/claude-sonnet-5"},{id:"fable-5-suspension",date:"2026-06-13",eyebrow:"Important Update",title:"Fable 5 & Mythos 5 suspended — Opus 4.8 takes over",bullets:[{icon:K,title:"US government directive",body:"Anthropic received an export control directive requiring the suspension of Fable 5 and Mythos 5 access for all users, citing national security concerns. Anthropic is complying while it works to resolve the matter."},{icon:U,title:"Opus 4.8 steps in as the Thinking tier",body:"The Thinking tier now runs on Claude Opus 4.8, which remains fully operational. Performance on most tasks is comparable, and Anthropic reports more than 95% of sessions were unaffected by the Fable 5 classifiers anyway."},{icon:Y,title:"Nothing to change",body:"The switch is automatic — any chat or agent already using the Thinking tier is now served by Opus 4.8. Anthropic will share further details within 24 hours."}],learnMoreHref:"https://www.anthropic.com/news/fable-mythos-access"},{id:"claude-fable-5",date:"2026-06-09",eyebrow:"Now Available",title:"Claude Fable 5 leads the Thinking tier",bullets:[{icon:U,title:"State-of-the-art reasoning",body:"Fable 5 takes the Thinking tier, posting top scores across software engineering, knowledge work, and vision — and outperforming Opus 4.8 on nearly every benchmark Anthropic tested."},{icon:K,title:"Safety without the slowdown",body:"New classifiers route the small slice of high-risk requests (cybersecurity, bio/chem) back to Opus 4.8. Anthropic reports more than 95% of sessions never trigger a fallback."},{icon:Y,title:"Nothing to change",body:"Chats and agents pick up Fable 5 automatically wherever the Thinking tier is selected. Opus 4.8 stays available as the safety fallback."}],learnMoreHref:"https://www.anthropic.com/news/claude-fable-5-mythos-5"},{id:"claude-opus-4-8",date:"2026-05-28",eyebrow:"Now Available",title:"Claude Opus 4.8 is the new default",bullets:[{icon:U,title:"Smarter thinking, same price",body:"Opus 4.8 now leads the Thinking and Smarter tiers, outperforming Opus 4.7 on coding, reasoning, and agent tasks at the same cost."},{icon:K,title:"More honest answers",body:"It's about 4× less likely to let a code flaw slip through unflagged, and surfaces uncertainty instead of making unsupported claims."},{icon:Y,title:"Nothing to change",body:"Chats and agents pick up Opus 4.8 automatically wherever the Thinking or Smarter tier is selected."}],learnMoreHref:"https://www.anthropic.com/news/claude-opus-4-8"},{id:"enhanced-sidebar",date:"2026-05-28",eyebrow:"Now Available",title:"Enhanced sidebar",bullets:[{icon:U,title:"A clearer view of what's running",body:"See every task in your organization at a glance, with each agent and status group laid out so you can spot active work without hunting for it."},{icon:ye,title:"Browse one group at a time",body:"Expand the groups you care about and pull in more results on demand — no more endless scrolling to find an older conversation."},{icon:K,title:"Polished and steadier",body:"Several sidebar bugs are fixed, including empty agent groups showing the right action and status filters returning the right tasks."}]},{id:"smarter-task-delegation",date:"2026-05-27",eyebrow:"Now Available",title:"Smarter task delegation",bullets:[{icon:ot,title:"Real results from delegated agents",body:"When one agent hands work to another, you'll see the full report inline — no more empty replies hiding the work that was done."},{icon:Y,title:"Same powers, top to bottom",body:"Delegated agents now work with the same tools, context, and memory as the agent that called them, so complex multi-agent investigations finish on the first try."},{icon:K,title:"Clearer progress signals",body:"When a delegated task hits its limit or runs into a problem, you get a plain-language message instead of a silent stall."}]},{id:"sidebar-task-groups",date:"2026-05-27",eyebrow:"Now Available",title:"Redesigned sidebar",bullets:[{icon:U,title:"Group by agent or status",body:"Switch the task list between grouping by agent or by status — pick whichever matches how you're working right now."},{icon:ye,title:"Sharper filters",body:"Narrow the list to your tasks, manual chats, or automations from a compact filter row above the groups."}]},{id:"release-channel",date:"2026-05-26",eyebrow:"Now Available",title:"Release announcements",bullets:[{icon:U,title:"Heads-up when features ship",body:"New releases surface in a corner card the first time you see them, then stick around in your inbox."},{icon:lt,title:"Unified inbox",body:"Org invitations and product updates now share one chronological feed in the sidebar."}]}],le="studio.release-feed.v1",ue=new Set;let G="",V={},me=!1;function Pt(){if(me)return G||"{}";try{return localStorage.getItem(le)??"{}"}catch{return G||"{}"}}function Le(t){try{const e=JSON.parse(t);return e&&typeof e=="object"?e:{}}catch{return{}}}function we(){const t=Pt();return t!==G&&(G=t,V=Le(t)),V}function Et(t){ue.add(t);const e=o=>{if(!(o.key!==le&&o.key!==null)){try{const a=localStorage.getItem(le)??"{}",s={...Le(a),...V};V=s,G=JSON.stringify(s)}catch{}t()}};return window.addEventListener("storage",e),()=>{ue.delete(t),window.removeEventListener("storage",e)}}function It(t){V=t,G=JSON.stringify(t);try{localStorage.setItem(le,G),me=!1}catch{me=!0}ue.forEach(e=>e())}function Lt(){const t=L.c(7),e=M.useSyncExternalStore(Et,we,we);let o;t[0]!==e?(o=d=>!!e[d],t[0]=e,t[1]=o):o=t[1];const a=o,l=Dt;let s;t[2]!==e?(s=Ie.reduce((d,g)=>e[g.id]?d:d+1,0),t[2]=e,t[3]=s):s=t[3];const i=s;let r;return t[4]!==a||t[5]!==i?(r={isSeen:a,markSeen:l,unseenCount:i},t[4]=a,t[5]=i,t[6]=r):r=t[6],r}function Dt(t){V[t]||It({...V,[t]:{seenAt:new Date().toISOString()}})}const $t=720*60*60*1e3,zt=10080*60*1e3;function qt(t){const[e,o,a]=t.split("-").map(Number);return!e||!o||!a?new Date(t).getTime():new Date(e,o-1,a).getTime()}function Rt(t){const e=Ie[0];if(!e)return null;const o=qt(e.date),a=t-o;return a<0||a>$t?null:e}function Ft(t){if(t instanceof Date)return t.getTime();if(typeof t=="string"||typeof t=="number"){const e=new Date(t).getTime();return Number.isFinite(e)?e:null}return null}function Mt(t,e){const o=Ft(t);return o===null?!1:e-o>=zt}function Bt(){const t=L.c(34),e=F(),{data:o}=Z.useSession(),{isSeen:a,markSeen:l}=Lt();let s,i,r;if(t[0]!==a||t[1]!==o?.user?.createdAt){r=Symbol.for("react.early_return_sentinel");e:{const y=Date.now();if(s=Rt(y),!s){r=null;break e}if(!Mt(o?.user?.createdAt,y)){r=null;break e}i=a(s.id)}t[0]=a,t[1]=o?.user?.createdAt,t[2]=s,t[3]=i,t[4]=r}else s=t[2],i=t[3],r=t[4];if(r!==Symbol.for("react.early_return_sentinel"))return r;if(i)return null;let d;t[5]!==e?(d=e("announcements.release.ariaLabel"),t[5]=e,t[6]=d):d=t[6];let g;t[7]!==e?(g=e("announcements.release.dismiss"),t[7]=e,t[8]=g):g=t[8];const w=s.eyebrow,m=s.title;let p;t[9]!==s.id||t[10]!==l?(p=()=>l(s.id),t[9]=s.id,t[10]=l,t[11]=p):p=t[11];let c;t[12]!==s.id||t[13]!==s.learnMoreHref||t[14]!==l||t[15]!==e?(c=s.learnMoreHref?n.jsx("a",{href:s.learnMoreHref,target:"_blank",rel:"noreferrer",onClick:()=>l(s.id),className:"underline-offset-2 hover:text-foreground hover:underline",children:e("announcements.release.learnMore")}):null,t[12]=s.id,t[13]=s.learnMoreHref,t[14]=l,t[15]=e,t[16]=c):c=t[16];let u;t[17]!==s.cta||t[18]!==s.id||t[19]!==l?(u=s.cta?n.jsx($,{asChild:!0,size:"sm",onClick:()=>l(s.id),children:n.jsx("a",{href:s.cta.href,children:s.cta.label})}):null,t[17]=s.cta,t[18]=s.id,t[19]=l,t[20]=u):u=t[20];let f;t[21]!==s.bullets?(f=s.bullets.map(Ut),t[21]=s.bullets,t[22]=f):f=t[22];let h;t[23]!==f?(h=n.jsx("ul",{className:"flex flex-col gap-3",children:f}),t[23]=f,t[24]=h):h=t[24];let x;return t[25]!==s.eyebrow||t[26]!==s.title||t[27]!==h||t[28]!==d||t[29]!==g||t[30]!==p||t[31]!==c||t[32]!==u?(x=n.jsx(Ee,{ariaLabel:d,dismissLabel:g,eyebrow:w,title:m,onDismiss:p,footerLeading:c,actions:u,children:h}),t[25]=s.eyebrow,t[26]=s.title,t[27]=h,t[28]=d,t[29]=g,t[30]=p,t[31]=c,t[32]=u,t[33]=x):x=t[33],x}function Ut(t,e){return n.jsxs("li",{className:"flex items-start gap-3",children:[n.jsx(t.icon,{size:20,className:"mt-0.5 shrink-0 text-muted-foreground"}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("p",{className:"text-sm font-medium text-foreground",children:t.title}),n.jsx("p",{className:"text-xs text-muted-foreground",children:t.body})]})]},e)}const De=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform),J=De?"⌘":"Ctrl",q={keyboardShortcuts:{keys:[J,"K"],description:"Keyboard shortcuts"},back:{keys:[J,"["],description:"Back to previous"},focusChatInput:{keys:[J,"L"],description:"Focus chat input"},saveAndFormat:{keys:[J,"S"],description:"Save & format"},sendMessage:{keys:["Enter"],description:"Send message"},newLine:{keys:["Shift","Enter"],description:"New line"},selectOption:{keys:["1-9"],description:"Select option"},applyFilter:{keys:[J,"Enter"],description:"Apply filter"},togglePlanMode:{keys:[J,"Shift","L"],description:"Toggle plan mode"},newTask:{keys:["Shift",J,"S"],description:"New task"},toggleDaemon:{keys:[J,"D"],description:"Toggle daemon logs"}},Jt=[{label:"General",shortcuts:[q.keyboardShortcuts,q.back,q.newTask,q.toggleDaemon]},{label:"Editor",shortcuts:[q.saveAndFormat]},{label:"Chat",shortcuts:[q.focusChatInput,q.togglePlanMode,q.sendMessage,q.newLine]},{label:"Questions",shortcuts:[q.selectOption]},{label:"Monitoring",shortcuts:[q.applyFilter]}];function ve(t){return De?t.metaKey:t.ctrlKey}function Ht(t){const e=L.c(11),{open:o,onOpenChange:a}=t,l=F();let s;e[0]!==l?(s=l("common.keyboardShortcutsDialog.title"),e[0]=l,e[1]=s):s=e[1];let i;e[2]!==s?(i=n.jsx(Ae,{children:n.jsx(Oe,{children:s})}),e[2]=s,e[3]=i):i=e[3];let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx("div",{className:"flex flex-col gap-4",children:Jt.map(Kt)}),e[4]=r):r=e[4];let d;e[5]!==i?(d=n.jsxs(Ce,{className:"sm:max-w-md",children:[i,r]}),e[5]=i,e[6]=d):d=e[6];let g;return e[7]!==a||e[8]!==o||e[9]!==d?(g=n.jsx(Pe,{open:o,onOpenChange:a,children:d}),e[7]=a,e[8]=o,e[9]=d,e[10]=g):g=e[10],g}function Kt(t){return n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-2",children:t.label}),n.jsx("div",{className:"flex flex-col gap-1.5",children:t.shortcuts.map(Gt)})]},t.label)}function Gt(t){return n.jsxs("div",{className:"flex items-center justify-between py-1",children:[n.jsx("span",{className:"text-sm",children:t.description}),n.jsx("div",{className:"flex items-center gap-1",children:t.keys.map(Vt)})]},t.description)}function Vt(t){return n.jsx("kbd",{className:"inline-flex items-center justify-center min-w-6 h-6 px-1.5 rounded-sm border border-border bg-muted text-muted-foreground text-xs font-mono",children:t},t)}const Wt=300*1e3,Qt=2;function Yt(t,e,o){return!e||e===o?{version:null,count:0}:t.version===e?{version:e,count:t.count+1}:{version:e,count:1}}function Xt(t,e){return t.count>=Qt&&t.version!==null&&t.version!==e}function Zt(){const t=L.c(31),e=F();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={queryKey:ce.appVersionCheck(),queryFn:tn,refetchInterval:Wt,refetchIntervalInBackground:!0,staleTime:0},t[0]=o):o=t[0];const{data:a,dataUpdatedAt:l}=re(o),[s,i]=M.useState(0);let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r={version:null,count:0},t[1]=r):r=t[1];const[d,g]=M.useState(r);l!==s&&(i(l),g(b=>Yt(b,a,"4.125.5")));const[w,m]=M.useState(null);if(!Xt(d,w))return null;let p;t[2]!==e?(p=e("announcements.version.ariaLabel"),t[2]=e,t[3]=p):p=t[3];let c;t[4]!==e?(c=e("announcements.version.dismiss"),t[4]=e,t[5]=c):c=t[5];let u;t[6]!==e?(u=e("announcements.version.eyebrow"),t[6]=e,t[7]=u):u=t[7];let f;t[8]!==e?(f=e("announcements.version.title"),t[8]=e,t[9]=f):f=t[9];let h;t[10]!==e?(h=e("announcements.version.description"),t[10]=e,t[11]=h):h=t[11];let x;t[12]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(he,{size:16}),t[12]=x):x=t[12];let y;t[13]!==d.version?(y=()=>m(d.version),t[13]=d.version,t[14]=y):y=t[14];let S;t[15]!==e?(S=e("announcements.version.currentSession",{version:"4.125.5"}),t[15]=e,t[16]=S):S=t[16];let v;t[17]!==e?(v=e("announcements.version.refresh"),t[17]=e,t[18]=v):v=t[18];let _;t[19]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(he,{size:14}),t[19]=_):_=t[19];let k;t[20]!==v?(k=n.jsxs($,{size:"sm",onClick:en,children:[v,_]}),t[20]=v,t[21]=k):k=t[21];let j;return t[22]!==k||t[23]!==p||t[24]!==c||t[25]!==u||t[26]!==f||t[27]!==h||t[28]!==y||t[29]!==S?(j=n.jsx(Ee,{ariaLabel:p,dismissLabel:c,eyebrow:u,title:f,description:h,icon:x,tone:"system",onDismiss:y,footerLeading:S,actions:k}),t[22]=k,t[23]=p,t[24]=c,t[25]=u,t[26]=f,t[27]=h,t[28]=y,t[29]=S,t[30]=j):j=t[30],j}function en(){return window.location.reload()}async function tn(){const t=await fetch("/api/config",{cache:"no-store"}),{config:e}=await t.json();return e.version}function nn(t){return{has(){try{return localStorage.getItem(t)==="1"}catch{return!1}},mark(){try{localStorage.setItem(t,"1")}catch{}}}}const sn=Date.parse("2026-07-21T00:00:00Z"),je=t=>nn(X.ptBrAnnouncementSeen(t));function on(){const t=L.c(35),e=F(),[o,a]=Ue(),{data:l,isPending:s}=Z.useSession(),i=l?.user,r=i?.id,d=i?.createdAt,g=d!=null&&new Date(d).getTime()<sn,w=Je()==="pt-BR",m=!s&&!!r&&g&&w&&o.language==="en"&&!je(r).has(),[p,c]=M.useState(!1),[u,f]=M.useState(!1);!p&&!s&&(c(!0),m&&r&&(je(r).mark(),a(rn),f(!0),pe("pt_br_auto_switch_shown")));let h;t[0]===Symbol.for("react.memo_cache_sentinel")?(h=R=>{pe("pt_br_auto_switch_closed",{action:R}),f(!1)},t[0]=h):h=t[0];const x=h;let y;t[1]!==a?(y=()=>{a(an),x("switch-back")},t[1]=a,t[2]=y):y=t[2];const S=y;let v;t[3]===Symbol.for("react.memo_cache_sentinel")?(v=R=>!R&&x("dismiss"),t[3]=v):v=t[3];let _;t[4]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx("div",{className:"text-4xl","aria-hidden":"true",children:"🇧🇷"}),t[4]=_):_=t[4];let k;t[5]!==e?(k=e("announcements.ptBr.title"),t[5]=e,t[6]=k):k=t[6];let j;t[7]!==k?(j=n.jsx(Oe,{children:k}),t[7]=k,t[8]=j):j=t[8];let b;t[9]!==e?(b=e("announcements.ptBr.description"),t[9]=e,t[10]=b):b=t[10];let T;t[11]!==b?(T=n.jsx(dt,{children:b}),t[11]=b,t[12]=T):T=t[12];let A;t[13]!==j||t[14]!==T?(A=n.jsxs(Ae,{children:[j,T]}),t[13]=j,t[14]=T,t[15]=A):A=t[15];let N;t[16]!==e?(N=e("announcements.ptBr.switchBack"),t[16]=e,t[17]=N):N=t[17];let O;t[18]!==S||t[19]!==N?(O=n.jsx($,{variant:"outline",onClick:S,children:N}),t[18]=S,t[19]=N,t[20]=O):O=t[20];let I;t[21]===Symbol.for("react.memo_cache_sentinel")?(I=()=>x("ok"),t[21]=I):I=t[21];let C;t[22]!==e?(C=e("announcements.ptBr.ok"),t[22]=e,t[23]=C):C=t[23];let D;t[24]!==C?(D=n.jsx($,{onClick:I,children:C}),t[24]=C,t[25]=D):D=t[25];let P;t[26]!==O||t[27]!==D?(P=n.jsxs(ut,{children:[O,D]}),t[26]=O,t[27]=D,t[28]=P):P=t[28];let H;t[29]!==P||t[30]!==A?(H=n.jsxs(Ce,{className:"sm:max-w-md",children:[_,A,P]}),t[29]=P,t[30]=A,t[31]=H):H=t[31];let B;return t[32]!==u||t[33]!==H?(B=n.jsx(Pe,{open:u,onOpenChange:v,children:H}),t[32]=u,t[33]=H,t[34]=B):B=t[34],B}function an(t){return{...t,language:"en"}}function rn(t){return{...t,language:"pt-BR"}}function ln({activeOrg:t}){return t&&(He(t.id,{name:t.name??void 0,slug:t.slug??void 0}),Ke()),null}function cn(t){const{prev:e,virtualMcpId:o,decopilotId:a,savedLayout:l,opts:s,autosendValue:i}=t,r={};o?r.virtualmcpid=o:e.virtualmcpid&&(r.virtualmcpid=e.virtualmcpid);const d=typeof e.virtualmcpid=="string"?e.virtualmcpid:a,w=(o??d)!==d;let m="chat";if(s?.main)r.main=s.main;else if(l)l.main!==void 0&&(r.main=l.main),l.sidepanel!==void 0&&(m=l.sidepanel);else if(!w){const p=e.main;p&&typeof p=="string"&&!xt(p)&&(r.main=p)}return r.sidepanel=m,s?.autosend&&(r.autosend=i),r}const $e="studio:thread-layout:v1",dn=50;function ze(t){const e={};return(t.main===0||typeof t.main=="string")&&(e.main=t.main),(t.sidepanel===0||t.sidepanel==="chat")&&(e.sidepanel=t.sidepanel),e}function un(t,e,o,a=dn){const l=t.filter(([s])=>s!==e);for(l.push([e,ze(o)]);l.length>a;)l.shift();return l}function fe(){try{const t=sessionStorage.getItem($e);if(!t)return[];const e=JSON.parse(t);return Array.isArray(e)?e.filter(o=>Array.isArray(o)&&o.length===2&&typeof o[0]=="string"):[]}catch{return[]}}function qe(t){try{sessionStorage.setItem($e,JSON.stringify(t))}catch{}}function mn(t,e){t&&qe(un(fe(),t,e))}function fn(t){if(!t)return null;const e=fe().find(([o])=>o===t);return e?ze(e[1]):null}function qn(t){if(!t)return;const e=fe(),o=e.filter(([a])=>a!==t);o.length!==e.length&&qe(o)}function Re(t){return{queryKey:ce.homeNextActions(t),queryFn:async()=>{const e=await fetch(`/api/${t}/home-next-actions`,{cache:"no-store"});if(!e.ok)throw new Error("Failed to load home next actions");return await e.json()},staleTime:0,refetchOnWindowFocus:"always"}}function Rn(t){const e=L.c(10);let o;e[0]!==t?(o=Re(t),e[0]=t,e[1]=o):o=e[1];const a=re(o);let l;e[2]!==a.data?.prompts?(l=a.data?.prompts??[],e[2]=a.data?.prompts,e[3]=l):l=e[3];let s;e[4]!==a.data?.tiles?(s=a.data?.tiles??[],e[4]=a.data?.tiles,e[5]=s):s=e[5];let i;return e[6]!==a.isLoading||e[7]!==l||e[8]!==s?(i={isLoading:a.isLoading,prompts:l,tiles:s},e[6]=a.isLoading,e[7]=l,e[8]=s,e[9]=i):i=e[9],i}function gn(t){const e=L.c(31),{orgSlug:o,orgName:a,domain:l}=t,s=F();let i;e[0]!==o?(i=()=>{window.location.href=`/api/${encodeURIComponent(o)}/sso/authorize`},e[0]=o,e[1]=i):i=e[1];const r=i,d=hn;let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(ke,{className:"h-6 w-6 text-primary"})}),e[2]=g):g=e[2];let w;e[3]!==s?(w=s("common.ssoRequiredScreen.title"),e[3]=s,e[4]=w):w=e[4];let m;e[5]!==w?(m=n.jsx("h3",{className:"text-lg font-medium",children:w}),e[5]=w,e[6]=m):m=e[6];let p;e[7]!==l||e[8]!==a||e[9]!==s?(p=a?n.jsxs(n.Fragment,{children:[n.jsx("strong",{children:a})," ",s("common.ssoRequiredScreen.requiresSsoAuth"),l?` ${s("common.ssoRequiredScreen.via",{domain:l})}`:"","."]}):s("common.ssoRequiredScreen.orgRequiresSsoAuth"),e[7]=l,e[8]=a,e[9]=s,e[10]=p):p=e[10];let c;e[11]!==p?(c=n.jsx("p",{className:"text-sm text-muted-foreground",children:p}),e[11]=p,e[12]=c):c=e[12];let u;e[13]!==m||e[14]!==c?(u=n.jsxs("div",{className:"space-y-2",children:[m,c]}),e[13]=m,e[14]=c,e[15]=u):u=e[15];let f;e[16]!==s?(f=s("common.ssoRequiredScreen.signInWithSso"),e[16]=s,e[17]=f):f=e[17];let h;e[18]!==r||e[19]!==f?(h=n.jsx($,{onClick:r,children:f}),e[18]=r,e[19]=f,e[20]=h):h=e[20];let x;e[21]!==s?(x=s("common.ssoRequiredScreen.goBack"),e[21]=s,e[22]=x):x=e[22];let y;e[23]!==x?(y=n.jsx($,{variant:"ghost",onClick:d,children:x}),e[23]=x,e[24]=y):y=e[24];let S;e[25]!==y||e[26]!==h?(S=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[h,y]}),e[25]=y,e[26]=h,e[27]=S):S=e[27];let v;return e[28]!==S||e[29]!==u?(v=n.jsxs(ee,{children:[g,u,S]}),e[28]=S,e[29]=u,e[30]=v):v=e[30],v}function hn(){window.location.href="/"}function pn(t){const e=L.c(8),{org:o,children:a}=t,s=yt(o.id,o.slug)?.enabled_plugins??null;let i;e[0]!==o.id||e[1]!==o.name||e[2]!==s?(i={id:o.id,organizationId:o.id,slug:"_org",name:o.name,enabledPlugins:s,ui:null},e[0]=o.id,e[1]=o.name,e[2]=s,e[3]=i):i=e[3];const r=i;let d;return e[4]!==a||e[5]!==o||e[6]!==r?(d=n.jsx(st,{org:o,project:r,children:a}),e[4]=a,e[5]=o,e[6]=r,e[7]=d):d=e[7],d}function xn(){const t=Ge(),e=pt(),{org:o}=Ve(),a=_e({strict:!1}),l=We({strict:!1}),s=a.org??"",i=a.taskId??"",r=(c,u,f=!0)=>t({to:"/$org/$taskId",params:{org:s,taskId:c},search:u,replace:f}),d=(c,u=!0)=>r(i,c,u),g=c=>d(u=>({...u,sidepanel:c})),w=(c,u,f)=>{const h=!!i&&i===c;i&&!h&&mn(i,{main:l.main,sidepanel:l.sidepanel});const x=h?null:fn(c),y=be(o.id).id;return r(c,S=>cn({prev:S,virtualMcpId:u,decopilotId:y,savedLayout:x,opts:f,autosendValue:ft}),!1)};return{openSidePanel:g,setTaskId:w,createNewTask:async c=>{const u=crypto.randomUUID(),f=c??l.virtualmcpid??be(o.id).id;try{await e?.create({id:u,virtual_mcp_id:f})}catch{}w(u,f)},openTab:c=>r(i||crypto.randomUUID(),u=>({...u,main:c}))}}function yn(){const t=L.c(53);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org",shouldThrow:!1},t[0]=e):e=t[0];const a=Qe(e)?.params.org;let l;t[1]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},t[1]=l):l=t[1];const{taskId:s}=_e(l),[i,r]=M.useState(!1),d=Ye(),g=a??"";let w;t[2]!==g?(w=Re(g),t[2]=g,t[3]=w):w=t[3];const m=!!a&&!s;let p;t[4]!==w||t[5]!==m?(p={...w,enabled:m},t[4]=w,t[5]=m,t[6]=p):p=t[6],re(p);const{data:c}=Z.useSession(),u=c?.user?.id;let f;t[7]!==a||t[8]!==u?(f=a&&u?Xe(u,a):null,t[7]=a,t[8]=u,t[9]=f):f=t[9];const h=f;let x,y;t[10]!==d?(x=()=>{const E=z=>{if(ve(z)&&z.code==="KeyK"){z.preventDefault(),r(!0);return}ve(z)&&z.code==="BracketLeft"&&d.history.canGoBack()&&(z.preventDefault(),d.history.back())};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},y=[d],t[10]=d,t[11]=x,t[12]=y):(x=t[11],y=t[12]),M.useEffect(x,y);let S;t[13]!==a?(S=ce.activeOrganization(a),t[13]=a,t[14]=S):S=t[14];let v;t[15]!==a||t[16]!==u?(v=async()=>{if(!a)return null;performance.mark("mesh:active-org-fetch:start");const{data:E}=await Z.organization.getFullOrganization({query:{organizationSlug:a}}).finally(bn),z=xe(E);return E&&!z&&localStorage.setItem(X.lastOrgSlug(),a),u&&E&&et(u,a,E),E},t[15]=a,t[16]=u,t[17]=v):v=t[17];const _=h?h.data:void 0,k=h?.updatedAt;let j;t[18]!==v||t[19]!==_||t[20]!==k||t[21]!==S?(j={queryKey:S,queryFn:v,initialData:_,initialDataUpdatedAt:k,gcTime:1/0,refetchOnWindowFocus:!1},t[18]=v,t[19]=_,t[20]=k,t[21]=S,t[22]=j):j=t[22];const{data:b}=Ne(j),T=b?.id,A=b?.slug,{data:N}=bt(T,A),O=T??"",I=A??"";let C;t[23]!==O||t[24]!==I?(C=gt({connectionId:ht,orgId:O,orgSlug:I}),t[23]=O,t[24]=I,t[25]=C):C=t[25];const D=!!T&&!!A;let P;if(t[26]!==C||t[27]!==D?(P={...C,enabled:D},t[26]=C,t[27]=D,t[28]=P):P=t[28],re(P),!b){let E;t[29]===Symbol.for("react.memo_cache_sentinel")?(E=n.jsx(tt,{}),t[29]=E):E=t[29];let z;return t[30]!==a?(z=n.jsx(M.Suspense,{fallback:E,children:n.jsx(Ct,{orgSlug:a})}),t[30]=a,t[31]=z):z=t[31],z}if(xe(b)){localStorage.getItem(X.lastOrgSlug())===a&&localStorage.removeItem(X.lastOrgSlug());let E;return t[32]!==b.name?(E=n.jsx(Ze,{orgName:b.name}),t[32]=b.name,t[33]=E):E=t[33],E}if(N?.ssoRequired&&!N.authenticated){let E;return t[34]!==b.id||t[35]!==b.name||t[36]!==b.slug||t[37]!==N.domain?(E=n.jsx(gn,{orgId:b.id,orgSlug:b.slug,orgName:b.name,domain:N.domain}),t[34]=b.id,t[35]=b.name,t[36]=b.slug,t[37]=N.domain,t[38]=E):E=t[38],E}const B=b.logo??null;let R;t[39]!==b||t[40]!==B?(R={...b,logo:B},t[39]=b,t[40]=B,t[41]=R):R=t[41];let W;t[42]!==b?(W=n.jsx(ln,{activeOrg:b}),t[42]=b,t[43]=W):W=t[43];let ne;t[44]===Symbol.for("react.memo_cache_sentinel")?(ne=n.jsx(nt,{}),t[44]=ne):ne=t[44];let se;t[45]===Symbol.for("react.memo_cache_sentinel")?(se=n.jsxs("div",{className:"fixed bottom-6 right-6 z-50 flex w-[min(360px,calc(100vw-3rem))] flex-col gap-3",children:[n.jsx(Bt,{}),n.jsx(Zt,{})]}),t[45]=se):se=t[45];let Q;t[46]!==i?(Q=n.jsx(Ht,{open:i,onOpenChange:r}),t[46]=i,t[47]=Q):Q=t[47];let oe;t[48]===Symbol.for("react.memo_cache_sentinel")?(oe=n.jsx(on,{}),t[48]=oe):oe=t[48];let ie;return t[49]!==R||t[50]!==W||t[51]!==Q?(ie=n.jsxs(pn,{org:R,children:[W,ne,se,Q,oe]}),t[49]=R,t[50]=W,t[51]=Q,t[52]=ie):ie=t[52],ie}function bn(){performance.mark("mesh:active-org-fetch:end"),performance.measure("mesh:active-org-fetch","mesh:active-org-fetch:start","mesh:active-org-fetch:end")}function Sn(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(mt,{children:n.jsx(yn,{})}),t[0]=e):e=t[0],e}const Fn=Object.freeze(Object.defineProperty({__proto__:null,default:Sn,usePanelActions:xn},Symbol.toStringTag,{value:"Module"}));export{q as K,Rn as a,qn as f,ve as i,nn as m,Fn as s,xn as u};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-Bp5nCSQt.js","assets/index-Dk9RGAqb.js","assets/index-DBC4gRwz.css","assets/Tool02-DPXeBg9E.js","assets/CheckCircle-Dh-3VdHB.js","assets/Settings02-BIGi-T7s.js","assets/use-mcp-client-Bzvvd0Df.js","assets/auth-C4POVeVe.js","assets/useInfiniteQuery-64uGdBMx.js","assets/use-infinite-scroll-CbSN3uty.js","assets/studio-tools-CFgWeCBk.js","assets/badge-BbmHyS30.js","assets/input-C-gHIQip.js","assets/dropdown-menu-CSgtqrA3.js","assets/Check-LKA0FKR0.js","assets/ChevronRight-Dkp8mDOd.js","assets/DotsVertical-DKanPfz6.js","assets/table-CIOCQP8H.js","assets/toggle-group-DaeRkjf6.js","assets/use-view-mode-CQpQIlsB.js","assets/use-mobile-DQ8jManM.js","assets/FilterLines-13dE_TWB.js","assets/Globe01-CEh6-y49.js","assets/SearchMd-DBj7HhoW.js","assets/dialog-CzDwjrNV.js","assets/X-BYXAQs6v.js","assets/AlertCircle-1e3-NcEA.js","assets/Upload01-CPD95nN4.js","assets/metadata-dUsYcpuu.js","assets/alert-dialog-DwnblylQ.js","assets/card-DcA1Rwjs.js","assets/Trash01-CWIa_mDx.js","assets/label-D9aEMZqo.js","assets/select-Bd1WKGSJ.js","assets/tooltip-xp77jFs4.js","assets/ChevronDown-B3fDqERa.js","assets/ChevronUp-Cm7VcWLZ.js","assets/switch-J9ypA9K4.js","assets/textarea-CQzBh7SW.js","assets/ArrowRight-B-wHAJWT.js","assets/XCircle-B3aYrCCW.js","assets/checkbox-DsDzIgcJ.js","assets/Eye-SCLKEZSh.js","assets/LinkExternal01-Di_tOfr7.js","assets/use-copy-DmTk3Ltj.js","assets/Copy01-uQh3Q5Fv.js","assets/Key01-CgioJ7nW.js","assets/Plus-CLG5QKCr.js","assets/mcp-oauth-Br5ozXBx.js","assets/Play-CVGtm9ao.js"])))=>i.map(i=>d[i]);
2
- import{c as m,d as n,f as c,j as t,k as f,r as l,aF as p}from"./index-Dk9RGAqb.js";import{R as u}from"./require-capability-L7H5SRt9.js";import"./use-capability-DHlRnvUE.js";import"./access-gate-D11_1kHO.js";import"./capability-load-error-ObIFsfE9.js";const g=l.lazy(()=>p(()=>import("./registry-layout-Bp5nCSQt.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49])));function j(){const e=m.c(5),i=n();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org"},e[0]=s):s=e[0];const{org:o}=c(s);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"h-full flex items-center justify-center",children:t.jsx(f,{size:20,className:"animate-spin text-muted-foreground"})}),e[1]=r):r=e[1];let a;return e[2]!==i||e[3]!==o?(a=t.jsx(u,{capability:"registry:manage",area:"the registry",children:t.jsx(l.Suspense,{fallback:r,children:t.jsx(g,{onBack:()=>i({to:"/$org/settings/store",params:{org:o}})})})}),e[2]=i,e[3]=o,e[4]=a):a=e[4],a}export{j as default};
@@ -1 +0,0 @@
1
- function s(e){if(!e||!e.startsWith("automation:"))return null;const n=e.slice(11);return n?{id:n}:null}function o(e,n){return`app:${e}:${n}`}function f(e){if(!e||!e.startsWith("app:"))return null;const n=e.slice(4),t=n.indexOf(":");if(t<=0)return null;const r=n.slice(0,t),i=n.slice(t+1);return!r||!i?null:{connectionId:r,toolName:i}}function d(e){return`deck:${encodeURIComponent(e)}`}function p(e){if(!e||!e.startsWith("deck:"))return null;const n=e.slice(5);if(!n)return null;try{return{path:decodeURIComponent(n)}}catch{return null}}function m(e){return`file:${encodeURIComponent(e)}`}function T(e){if(!e||!e.startsWith("file:"))return null;const n=e.slice(5);if(!n)return null;try{return{key:decodeURIComponent(n)}}catch{return null}}function h(e){return`library-file:${encodeURIComponent(e)}`}function g(e){if(!e||!e.startsWith("library-file:"))return null;const n=e.slice(13);if(!n)return null;try{return{path:decodeURIComponent(n)}}catch{return null}}function v(e){return`code:${encodeURIComponent(e)}`}function y(e){if(!e)return null;if(e==="code")return{path:null};if(!e.startsWith("code:"))return null;const n=e.slice(5);if(!n)return null;try{return{path:decodeURIComponent(n)}}catch{return null}}const u=["overview","settings","automations","preview","code","content","git"],l=new Set(u),b=new Set(["board","files"]);function C(e){return e.startsWith("app:")||e.startsWith("automation:")||e.startsWith("file:")||e.startsWith("deck:")||e.startsWith("library-file:")||e.startsWith("code:")}const a=new Set(["instructions","connections","layout","settings"]);function S(e){return!!e&&a.has(e)}function c(e){const n=e?.defaultMainView??null;if(!n||a.has(n.type))return"settings";if(l.has(n.type))return n.type;if(n.type==="ext-app"||n.type==="ext-apps"){if(n.id&&n.toolName)return o(n.id,n.toolName);const t=e?.tabs?.map(r=>r.id)??[];return n.id&&t.includes(n.id)?n.id:t[0]??"settings"}return e?.tabs?.[0]?.id??"settings"}function k(e){const n=e.mainParam===0?"0":e.mainParam,t=c(e.metadata);if(n==="0")return{mainOpen:!1,activeTab:t};if(n===void 0){const r=e.metadata?.defaultMainView??null;return{mainOpen:!(r==null||r.type==="chat"),activeTab:t}}return a.has(n)?{mainOpen:!0,activeTab:"settings"}:{mainOpen:!0,activeTab:n}}function A(e){return e.mainOpen&&e.clickedId===e.activeTab?0:e.clickedId}function W(e){return e.mainOpen?e.activeTab==="automations"?!0:s(e.activeTab)!==null:!1}function O(e){return e.mainOpen&&e.activeTab==="automations"?0:"automations"}export{u as F,b as O,k as a,T as b,p as c,g as d,A as e,o as f,v as g,h,S as i,y as j,f as k,W as l,O as m,d as n,m as o,s as p,C as q,c as r};
@@ -1 +0,0 @@
1
- import{c as i,r as g,j as c,m as T,b as j,f as L,af as p,L as N,a9 as $,aY as y}from"./index-Dk9RGAqb.js";const S=g.createContext(null);function h(){const t=g.use(S);if(!t)throw new Error("Toolbar.* must be used inside <Toolbar>");return t}function E(t){const e=i.c(8),{children:s}=t,[l,o]=g.useState(null),[n,r]=g.useState(null),[a,f]=g.useState(null),[m,b]=g.useState(null);let d;e[0]!==a||e[1]!==m||e[2]!==n||e[3]!==l?(d={togglesEl:l,setTogglesEl:o,tabsEl:n,setTabsEl:r,centerEl:a,setCenterEl:f,rightEl:m,setRightEl:b},e[0]=a,e[1]=m,e[2]=n,e[3]=l,e[4]=d):d=e[4];let x;return e[5]!==s||e[6]!==d?(x=c.jsx(S,{value:d,children:s}),e[5]=s,e[6]=d,e[7]=x):x=e[7],x}function u(t){const e=i.c(2),{children:s}=t;let l;return e[0]!==s?(l=c.jsx(E,{children:c.jsx("div",{className:"flex flex-col h-full min-h-0",children:s})}),e[0]=s,e[1]=l):l=e[1],l}function C(t){const e=i.c(10);let s,l,o;e[0]!==t?({children:s,className:l,...o}=t,e[0]=t,e[1]=s,e[2]=l,e[3]=o):(s=e[1],l=e[2],o=e[3]);let n;e[4]!==l?(n=T("app-titlebar wco-drag relative z-10 shrink-0 grid grid-cols-3 items-center pl-1 pr-2 h-12 bg-sidebar",l),e[4]=l,e[5]=n):n=e[5];let r;return e[6]!==s||e[7]!==o||e[8]!==n?(r=c.jsx("div",{className:n,...o,children:s}),e[6]=s,e[7]=o,e[8]=n,e[9]=r):r=e[9],r}function v(t){const e=i.c(2),{children:s}=t;let l;return e[0]!==s?(l=c.jsx("div",{className:"flex items-center gap-0.5 min-w-0 justify-self-start",children:s}),e[0]=s,e[1]=l):l=e[1],l}function w(t){const e=i.c(2),{children:s}=t;let l;return e[0]!==s?(l=c.jsx("div",{className:"flex items-center justify-end gap-0.5 min-w-0 justify-self-end",children:s}),e[0]=s,e[1]=l):l=e[1],l}function R(){const t=i.c(13),e=j(),l=$().logo??y,o=typeof l=="string"?l:l.light,n=typeof l=="string"?l:l.dark;let r;t[0]!==e?(r=e("agentShellLayout.toolbar.logo"),t[0]=e,t[1]=r):r=t[1];let a;t[2]!==o||t[3]!==r?(a=c.jsx("img",{src:o,alt:r,className:"size-6 object-contain dark:hidden"}),t[2]=o,t[3]=r,t[4]=a):a=t[4];let f;t[5]!==e?(f=e("agentShellLayout.toolbar.logo"),t[5]=e,t[6]=f):f=t[6];let m;t[7]!==n||t[8]!==f?(m=c.jsx("img",{src:n,alt:f,className:"size-6 object-contain hidden dark:block"}),t[7]=n,t[8]=f,t[9]=m):m=t[9];let b;return t[10]!==a||t[11]!==m?(b=c.jsxs("span",{className:"wco-hide flex items-center shrink-0 px-2",children:[a,m]}),t[10]=a,t[11]=m,t[12]=b):b=t[12],b}function k(){const t=i.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx(g.Suspense,{fallback:c.jsx("span",{className:"wco-hide shrink-0 size-6 mx-2"}),children:c.jsx(R,{})}),t[0]=e):e=t[0],e}function _(){const t=i.c(12),e=j();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org"},t[0]=s):s=t[0];const{org:l}=L(s);let o;t[1]!==l?(o={org:l},t[1]=l,t[2]=o):o=t[2];let n;t[3]!==e?(n=e("agentShellLayout.toolbar.backToHome"),t[3]=e,t[4]=n):n=t[4];let r;t[5]!==e?(r=e("agentShellLayout.toolbar.backToHome"),t[5]=e,t[6]=r):r=t[6];let a;t[7]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(k,{}),t[7]=a):a=t[7];let f;return t[8]!==o||t[9]!==n||t[10]!==r?(f=c.jsx(N,{to:"/$org",params:o,"aria-label":n,title:r,className:"wco-no-drag flex items-center shrink-0 cursor-pointer pl-1",children:a}),t[8]=o,t[9]=n,t[10]=r,t[11]=f):f=t[11],f}function P(){const t=i.c(2),{setCenterEl:e}=h();let s;return t[0]!==e?(s=c.jsx("div",{ref:e,className:"min-w-0 flex items-center justify-center gap-2"}),t[0]=e,t[1]=s):s=t[1],s}function z(t){const e=i.c(3),{children:s}=t,{centerEl:l}=h();if(!l)return null;let o;return e[0]!==l||e[1]!==s?(o=p.createPortal(s,l),e[0]=l,e[1]=s,e[2]=o):o=e[2],o}function H(t){const e=i.c(5),{className:s}=t,{setTabsEl:l}=h();let o;e[0]!==s?(o=T("shrink-0 flex items-center",s),e[0]=s,e[1]=o):o=e[1];let n;return e[2]!==l||e[3]!==o?(n=c.jsx("div",{ref:l,className:o}),e[2]=l,e[3]=o,e[4]=n):n=e[4],n}function D(t){const e=i.c(3),{children:s}=t,{tabsEl:l}=h();if(!l)return null;let o;return e[0]!==s||e[1]!==l?(o=p.createPortal(s,l),e[0]=s,e[1]=l,e[2]=o):o=e[2],o}function I(t){const e=i.c(5),{className:s}=t,{setTogglesEl:l}=h();let o;e[0]!==s?(o=T("contents",s),e[0]=s,e[1]=o):o=e[1];let n;return e[2]!==l||e[3]!==o?(n=c.jsx("div",{ref:l,className:o}),e[2]=l,e[3]=o,e[4]=n):n=e[4],n}function O(){const t=i.c(2),{setRightEl:e}=h();let s;return t[0]!==e?(s=c.jsx("div",{ref:e,className:"flex items-center justify-end gap-0.5 shrink-0"}),t[0]=e,t[1]=s):s=t[1],s}u.Provider=E;u.Header=C;u.LeftColumn=v;u.RightColumn=w;u.Logo=k;u.LogoLink=_;u.CenterSlot=P;u.Center=z;u.TabsSlot=H;u.Tabs=D;u.TogglesSlot=I;u.RightSlot=O;export{u as T};
@@ -1 +0,0 @@
1
- import{c as d,m as f,j as b}from"./index-Dk9RGAqb.js";function x(l){const e=d.c(14);let n,t,s,o,r;e[0]!==l?({active:n,className:t,ref:o,type:r,...s}=l,e[0]=l,e[1]=n,e[2]=t,e[3]=s,e[4]=o,e[5]=r):(n=e[1],t=e[2],s=e[3],o=e[4],r=e[5]);const a=r===void 0?"button":r,u=n?"bg-sidebar-accent text-sidebar-foreground":"text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground";let i;e[6]!==t||e[7]!==u?(i=f("relative flex size-10 md:size-7 shrink-0 items-center justify-center rounded-md transition-colors","max-md:[&_svg]:size-5","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",u,t),e[6]=t,e[7]=u,e[8]=i):i=e[8];let c;return e[9]!==s||e[10]!==o||e[11]!==i||e[12]!==a?(c=b.jsx("button",{ref:o,type:a,className:i,...s}),e[9]=s,e[10]=o,e[11]=i,e[12]=a,e[13]=c):c=e[13],c}export{x as T};