decocms 4.51.2 → 4.52.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 (233) hide show
  1. package/dist/client/assets/{AlertCircle-D3-xinjs.js → AlertCircle-Ckjfi5CH.js} +1 -1
  2. package/dist/client/assets/{ArrowUp-BDUzeu95.js → ArrowUp-rkD_HZ8P.js} +1 -1
  3. package/dist/client/assets/{ArrowUpRight-C3_2cXeW.js → ArrowUpRight-BLtI0F49.js} +1 -1
  4. package/dist/client/assets/{Check-ocZ9qfNA.js → Check-BqPyZLQD.js} +1 -1
  5. package/dist/client/assets/{CheckCircle-C0j5UyGw.js → CheckCircle-CAJezFjV.js} +1 -1
  6. package/dist/client/assets/{ChevronDown-wJWuHepF.js → ChevronDown-CnwT1mzn.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-BjCnVhIo.js → ChevronRight-D1QQje8D.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-CJAHlnYn.js → ChevronUp-DyEeTUVg.js} +1 -1
  9. package/dist/client/assets/{Circle-BTXhFI7S.js → Circle-acrc1-5x.js} +1 -1
  10. package/dist/client/assets/{Copy01-jaaWVisn.js → Copy01-evFlatZI.js} +1 -1
  11. package/dist/client/assets/{DotsVertical-DtV5Fnad.js → DotsVertical-DH6RqqNz.js} +1 -1
  12. package/dist/client/assets/{Eye-wkJjtmH2.js → Eye-jSmQrVvy.js} +1 -1
  13. package/dist/client/assets/{FilterLines-DlRQ5-i5.js → FilterLines-CP0tWCPE.js} +1 -1
  14. package/dist/client/assets/{Globe01-BGRBT0T0.js → Globe01-z5xFpMbi.js} +1 -1
  15. package/dist/client/assets/{Globe04-DRckETTE.js → Globe04-DhVhlypi.js} +1 -1
  16. package/dist/client/assets/{HardDrive-B5qdyv_Y.js → HardDrive-Bs1M6Hvn.js} +1 -1
  17. package/dist/client/assets/{Key01-JqQROwH3.js → Key01-Cb_sZVe8.js} +1 -1
  18. package/dist/client/assets/{LayoutLeft-j7RNB7Kr.js → LayoutLeft-BXKFuGem.js} +1 -1
  19. package/dist/client/assets/{LinkExternal01-BOVv-eRf.js → LinkExternal01-DQeBBiDb.js} +1 -1
  20. package/dist/client/assets/{List-B14rXxdk.js → List-BxYpph4d.js} +1 -1
  21. package/dist/client/assets/{Loading02-pQoaBc8-.js → Loading02-sBz7BJ1q.js} +1 -1
  22. package/dist/client/assets/{Monitor01-p4fXdA6F.js → Monitor01-JTUoetfA.js} +1 -1
  23. package/dist/client/assets/{Palette-Ba4t1bDZ.js → Palette-Dhj0ki3L.js} +1 -1
  24. package/dist/client/assets/{Play-BRUiwJ0P.js → Play-DSn_fJ5I.js} +1 -1
  25. package/dist/client/assets/{Plus-CD0lb0Z8.js → Plus-CpRHfh-d.js} +1 -1
  26. package/dist/client/assets/{SearchLg-DomSsZ58.js → SearchLg-LmkvPKlo.js} +1 -1
  27. package/dist/client/assets/{SearchMd-BcwHGb7L.js → SearchMd-u399I-U8.js} +1 -1
  28. package/dist/client/assets/{Settings02-C124V1Xc.js → Settings02-FvY_WrCl.js} +1 -1
  29. package/dist/client/assets/{Shield01-xKRFJ51X.js → Shield01-Rg8a4xQi.js} +1 -1
  30. package/dist/client/assets/{Star01-8j7H5tvN.js → Star01-D4HIeFV4.js} +1 -1
  31. package/dist/client/assets/{Stars01-D-3hvZEh.js → Stars01-CzMXezZV.js} +1 -1
  32. package/dist/client/assets/{Stars02-Cb9neMzf.js → Stars02-DMehdEnh.js} +1 -1
  33. package/dist/client/assets/{Sun-f1oBLB5X.js → Sun-DzU87xA1.js} +1 -1
  34. package/dist/client/assets/{SwitchHorizontal01-DENI6_WB.js → SwitchHorizontal01-BMyKSURs.js} +1 -1
  35. package/dist/client/assets/{Tool01-DWMuD8TU.js → Tool01-afck1aOJ.js} +1 -1
  36. package/dist/client/assets/{Trash01-CWwPWzB6.js → Trash01-Cwa4v7Ml.js} +1 -1
  37. package/dist/client/assets/{Upload01-mS32ZgCv.js → Upload01-CkgWiY_F.js} +1 -1
  38. package/dist/client/assets/{User01-ByTCset0.js → User01-l1nuU6BZ.js} +1 -1
  39. package/dist/client/assets/{Users01-C_ia9S0h.js → Users01-8CrcPzGC.js} +1 -1
  40. package/dist/client/assets/{Users03-DgaczNXO.js → Users03-CKC5bCWK.js} +1 -1
  41. package/dist/client/assets/{X-Dntrg8W3.js → X-Cteb_roe.js} +1 -1
  42. package/dist/client/assets/{XCircle-Cc0xPE71.js → XCircle-wfHfVXUq.js} +1 -1
  43. package/dist/client/assets/{XClose-BKzJufOf.js → XClose-DlEEzpSj.js} +1 -1
  44. package/dist/client/assets/{Zap-B8LjXKlt.js → Zap-sfgXlWrU.js} +1 -1
  45. package/dist/client/assets/{ZapSquare-BaPWVQ37.js → ZapSquare-BkH7GX2j.js} +1 -1
  46. package/dist/client/assets/{ZoomOut-0JxM3Azv.js → ZoomOut-CdvzCj0T.js} +1 -1
  47. package/dist/client/assets/{access-gate-CuWTKtSI.js → access-gate-Bwfhmk-C.js} +1 -1
  48. package/dist/client/assets/add-section-modal-DexsffuH.js +1 -0
  49. package/dist/client/assets/{agent-capabilities-DSzooKp7.js → agent-capabilities-Bl8V-IcK.js} +1 -1
  50. package/dist/client/assets/{agent-icon-aq9fahDc.js → agent-icon-DzoFzJug.js} +1 -1
  51. package/dist/client/assets/{agents-list-CaUeXqG0.js → agents-list-DK6QZzyJ.js} +1 -1
  52. package/dist/client/assets/{ai-providers-CQLJ_8tO.js → ai-providers-BXgftXJ-.js} +1 -1
  53. package/dist/client/assets/{alert-fs5gPaUM.js → alert-BseR7lL7.js} +1 -1
  54. package/dist/client/assets/{alert-dialog-Ctmy7BUh.js → alert-dialog-k1jTn90-.js} +1 -1
  55. package/dist/client/assets/app-editor-COySOmxh.js +1 -0
  56. package/dist/client/assets/{auth-Bj2JBDn0.js → auth-Qjv7NhMS.js} +1 -1
  57. package/dist/client/assets/{auth-catchall-JbJLOIeZ.js → auth-catchall-ByT6IIRw.js} +1 -1
  58. package/dist/client/assets/{auth-entry-C1NUF8ZX.js → auth-entry-CjhmLnz0.js} +1 -1
  59. package/dist/client/assets/{auth-split-layout-CfwFLRNN.js → auth-split-layout-Dpf-nPNK.js} +1 -1
  60. package/dist/client/assets/{authenticate-and-persist-oauth-Dq14rQ5H.js → authenticate-and-persist-oauth-DpJjlm5V.js} +1 -1
  61. package/dist/client/assets/{automation-list-row-B4UVZ48v.js → automation-list-row-fxbcdSMq.js} +1 -1
  62. package/dist/client/assets/{automation-runs-COPPnkgJ.js → automation-runs-Dy1JESzQ.js} +1 -1
  63. package/dist/client/assets/{automations-k4gVYYGR.js → automations-DvN61x0o.js} +1 -1
  64. package/dist/client/assets/{autosend-DCYPaCYz.js → autosend-DX3Zzpl9.js} +1 -1
  65. package/dist/client/assets/{avatar-B58RA_6l.js → avatar-DGwxsQN2.js} +1 -1
  66. package/dist/client/assets/{badge-OQCPYGcq.js → badge-BQwEfJU4.js} +1 -1
  67. package/dist/client/assets/{block-document-LDG191Ua.js → block-document-BA-iUXEG.js} +3 -3
  68. package/dist/client/assets/{brand-context-D_AxwSWO.js → brand-context-CEEM_0kN.js} +1 -1
  69. package/dist/client/assets/{breadcrumb-BgOeMiKF.js → breadcrumb-BJWIHuqO.js} +1 -1
  70. package/dist/client/assets/{buckets-DucCPVYS.js → buckets-COiudA57.js} +1 -1
  71. package/dist/client/assets/{bulk-category-panel-oOfbKD4q.js → bulk-category-panel-Dfvm8E4y.js} +1 -1
  72. package/dist/client/assets/{calendar-DWypRNoG.js → calendar-D9HHKNhR.js} +1 -1
  73. package/dist/client/assets/{capability-load-error-C9fFHl6G.js → capability-load-error-B5enhri-.js} +1 -1
  74. package/dist/client/assets/{card-CFUuQQ1M.js → card-CaPUDQMR.js} +1 -1
  75. package/dist/client/assets/category-editor-DpiKu_mb.js +1 -0
  76. package/dist/client/assets/{chat-context-BDLg73HV.js → chat-context-D1agoSZr.js} +5 -5
  77. package/dist/client/assets/{checkbox-BN0UcVyB.js → checkbox-D5lnR8wp.js} +1 -1
  78. package/dist/client/assets/{cli-auth-success-0s8PkjYa.js → cli-auth-success-BRy-NxMn.js} +1 -1
  79. package/dist/client/assets/collection-detail-AgoVpHZK.js +1 -0
  80. package/dist/client/assets/{collection-display-button-BLiQdNGK.js → collection-display-button-DXVH8deL.js} +1 -1
  81. package/dist/client/assets/{collection-search-IN2QsdDZ.js → collection-search-BenYn43P.js} +1 -1
  82. package/dist/client/assets/{collection-table-wrapper-DjickeiC.js → collection-table-wrapper-C3H_A_xz.js} +1 -1
  83. package/dist/client/assets/{collection-tabs-DEEctqY7.js → collection-tabs-D1IpI5td.js} +1 -1
  84. package/dist/client/assets/{command-B-zA3-tK.js → command-DrWU6m5z.js} +1 -1
  85. package/dist/client/assets/{commerce-onboarding-CSQzdWRv.js → commerce-onboarding-BjeDrjZF.js} +1 -1
  86. package/dist/client/assets/{connect-desktop-dialog-DZCJkLGC.js → connect-desktop-dialog-DyDEdtY1.js} +1 -1
  87. package/dist/client/assets/{connection-card-CLhBW468.js → connection-card-DDlzd240.js} +1 -1
  88. package/dist/client/assets/{connection-detail-DWSgMsK8.js → connection-detail-BwuDYyyX.js} +1 -1
  89. package/dist/client/assets/{connection-form-helpers-CYnQot14.js → connection-form-helpers-JXDOtVIm.js} +1 -1
  90. package/dist/client/assets/{connections-BCohgvy9.js → connections-GBz8DR7k.js} +1 -1
  91. package/dist/client/assets/{decopilot-sse-pool-DSmv0lZi.js → decopilot-sse-pool-CWyHzlYU.js} +1 -1
  92. package/dist/client/assets/{dialog-CzN8avhL.js → dialog-PEI6UoxW.js} +1 -1
  93. package/dist/client/assets/{domain-settings-WMRLNbvN.js → domain-settings-B9jhB5je.js} +1 -1
  94. package/dist/client/assets/{drawer-HThdP5uB.js → drawer-CW08mroo.js} +1 -1
  95. package/dist/client/assets/{dropdown-menu-BK5FaV5k.js → dropdown-menu-3AB2tgYT.js} +1 -1
  96. package/dist/client/assets/{empty-state-CcJIYptY.js → empty-state-DKJCnKDH.js} +1 -1
  97. package/dist/client/assets/{extract-connection-data-DSL7Y8A3.js → extract-connection-data-CRLwd6e7.js} +1 -1
  98. package/dist/client/assets/file-explorer-B5xHPC0m.js +2 -0
  99. package/dist/client/assets/{file-type-icon-GpEKUsdD.js → file-type-icon-BpXPQv3v.js} +1 -1
  100. package/dist/client/assets/{files-CcROi9t6.js → files-CXE7GzEs.js} +1 -1
  101. package/dist/client/assets/{form-CGcaRTOA.js → form-C1rNn4k6.js} +1 -1
  102. package/dist/client/assets/{general-DF7PHO03.js → general-0SucHlcy.js} +1 -1
  103. package/dist/client/assets/{github-repo-picker-KQYx5bF_.js → github-repo-picker-CUgtUqyb.js} +1 -1
  104. package/dist/client/assets/{hooks-BFJHOTt4.js → hooks-C2D4zi1P.js} +1 -1
  105. package/dist/client/assets/{index-DjoZL3mB.js → index-BC7A-4eo.js} +1 -1
  106. package/dist/client/assets/{index-CJs4YG_y.js → index-BJwe5x7p.js} +10 -10
  107. package/dist/client/assets/{index-DyKFz-Wv.js → index-BorSr1F7.js} +1 -1
  108. package/dist/client/assets/{index-CZ4WVu9U.js → index-C1OKchwi.js} +27 -27
  109. package/dist/client/assets/{index-C7hMTAFR.js → index-C3-boS0g.js} +1 -1
  110. package/dist/client/assets/{index-CylmZ2ca.js → index-C5c1_CFi.js} +1 -1
  111. package/dist/client/assets/{index-C7WjeY76.js → index-CA97b24W.js} +1 -1
  112. package/dist/client/assets/{index-C2LXo0VC.js → index-CCvcVLlX.js} +1 -1
  113. package/dist/client/assets/{index-C_F4X9gQ.js → index-Cz2K9IhP.js} +1 -1
  114. package/dist/client/assets/{index-Cu4sMkIs.js → index-D5FSJZrv.js} +1 -1
  115. package/dist/client/assets/{index-CPqDQfOw.js → index-DRvJRGa6.js} +1 -1
  116. package/dist/client/assets/{index-DRgsUNzQ.js → index-DXJraMAU.js} +2 -2
  117. package/dist/client/assets/{index-CP4HAVaa.js → index-DXSiQMy7.js} +1 -1
  118. package/dist/client/assets/{index-BcE0UPe9.js → index-JAv4b7xn.js} +1 -1
  119. package/dist/client/assets/{index-redirect-DOgz12Hs.js → index-redirect-XAsgVCK7.js} +1 -1
  120. package/dist/client/assets/{input-B0aQnFKg.js → input-C3Rirubl.js} +1 -1
  121. package/dist/client/assets/{integration-icon-BrvrOk5H.js → integration-icon-CIzHynOH.js} +1 -1
  122. package/dist/client/assets/{invite-member-dialog-B0C0bNkM.js → invite-member-dialog-B_Ev4fOf.js} +1 -1
  123. package/dist/client/assets/{label-CAEQU6Kw.js → label-B_qG9hBJ.js} +1 -1
  124. package/dist/client/assets/{layout-CAQxuDfc.js → layout-DOGkXOpg.js} +1 -1
  125. package/dist/client/assets/{login-BNl3DyrG.js → login-DyHUQRlz.js} +1 -1
  126. package/dist/client/assets/{mcp-oauth-WkAErzUM.js → mcp-oauth-BQExdojx.js} +1 -1
  127. package/dist/client/assets/{members-CFAG47YG.js → members-BwJT85YH.js} +1 -1
  128. package/dist/client/assets/{monaco-editor-DTLtlpMl.js → monaco-editor-qEZd2OY7.js} +1 -1
  129. package/dist/client/assets/{monitoring-stats-row-Byzwo_hq.js → monitoring-stats-row-36QuOlXN.js} +1 -1
  130. package/dist/client/assets/{oauth-callback-ai-provider-DZWV38Z5.js → oauth-callback-ai-provider-Gt_5rwPH.js} +1 -1
  131. package/dist/client/assets/{oauth-callback-Dl7hbaaA.js → oauth-callback-bZWA-VvB.js} +1 -1
  132. package/dist/client/assets/{onboarding-BSMPev5P.js → onboarding-B3pVNKOu.js} +1 -1
  133. package/dist/client/assets/{org-install-ByQXqxL7.js → org-install-DdMsBGUJ.js} +1 -1
  134. package/dist/client/assets/{org-layout-CKgpdyFk.js → org-layout-CHPBFBts.js} +1 -1
  135. package/dist/client/assets/{organization-choice-B79IthHJ.js → organization-choice-MpYOALKm.js} +1 -1
  136. package/dist/client/assets/{orgs-BiSSAVq9.js → orgs-BUeLl6_Z.js} +1 -1
  137. package/dist/client/assets/page-seo-form-BAzywWad.js +1 -0
  138. package/dist/client/assets/page-seo-sheet-C-hDReVa.js +1 -0
  139. package/dist/client/assets/{popover-uE71epyh.js → popover-Dot0rTJL.js} +1 -1
  140. package/dist/client/assets/post-editor-BAXDbs3u.js +1 -0
  141. package/dist/client/assets/{primitives-CFiyHFxY.js → primitives-CnMZHkqC.js} +1 -1
  142. package/dist/client/assets/{profile-BSZd_-p5.js → profile-DLHF7ILW.js} +1 -1
  143. package/dist/client/assets/project-app-view-B9EkpDAX.js +1 -0
  144. package/dist/client/assets/record-editor-CY_ezMJK.js +1 -0
  145. package/dist/client/assets/registry-CYWFdNYv.js +2 -0
  146. package/dist/client/assets/{registry-layout-N861VHnw.js → registry-layout-ufjLBHjw.js} +1 -1
  147. package/dist/client/assets/{require-capability-XY6ZhzOS.js → require-capability-BhlwYJmb.js} +1 -1
  148. package/dist/client/assets/{required-auth-layout-Mghc_qb4.js → required-auth-layout-BC8u-kka.js} +1 -1
  149. package/dist/client/assets/{reset-password-Dsq-8-D_.js → reset-password-CldvJ8Wq.js} +1 -1
  150. package/dist/client/assets/{roles-Bh63EYOm.js → roles-C2KkgwN_.js} +1 -1
  151. package/dist/client/assets/{search-input-CfI7XQSB.js → search-input-BQq9o40f.js} +1 -1
  152. package/dist/client/assets/{secrets-Bqyd0QgI.js → secrets-c113z7Ow.js} +1 -1
  153. package/dist/client/assets/sections-editor-CqVnCcKd.js +2 -0
  154. package/dist/client/assets/{select-IQqkuyke.js → select-BAgGTsPs.js} +1 -1
  155. package/dist/client/assets/{select-model-_ueK9IUW.js → select-model-BWTLQCs1.js} +1 -1
  156. package/dist/client/assets/seo-editor-CXJZ6fSJ.js +1 -0
  157. package/dist/client/assets/{settings-layout-B_2KA4xq.js → settings-layout-BWtmqWri.js} +1 -1
  158. package/dist/client/assets/{settings-section-B4wKOM9N.js → settings-section-DRqGNV4u.js} +1 -1
  159. package/dist/client/assets/{shell-controls-CZKEytTQ.js → shell-controls-CNJcsxg1.js} +1 -1
  160. package/dist/client/assets/{shell-layout--i4S_y1a.js → shell-layout-BmmfEuxL.js} +1 -1
  161. package/dist/client/assets/{sidebar-ciphtA4J.js → sidebar-C_Os3PcH.js} +1 -1
  162. package/dist/client/assets/{skeleton-CtTBfwRk.js → skeleton-4HubKfur.js} +1 -1
  163. package/dist/client/assets/{sso-CTXCmsBb.js → sso-CE7J0MVA.js} +1 -1
  164. package/dist/client/assets/{store-CdG0vY93.js → store-CNLQyTjq.js} +1 -1
  165. package/dist/client/assets/store-registry-As-nKPZf.js +2 -0
  166. package/dist/client/assets/{studio-tools-C8sSWr27.js → studio-tools-BQ_BglCi.js} +1 -1
  167. package/dist/client/assets/{switch-WmIvORwZ.js → switch-tuaEWa67.js} +1 -1
  168. package/dist/client/assets/{table-BtAQhFli.js → table-BlwP8tRY.js} +1 -1
  169. package/dist/client/assets/{tabs-dnRCcMZW.js → tabs-H8L7nqeW.js} +1 -1
  170. package/dist/client/assets/{textarea-BWkJXpt-.js → textarea-DwT5RbAY.js} +1 -1
  171. package/dist/client/assets/{toggle-group-BWqkPPRz.js → toggle-group-9fFnAM5M.js} +1 -1
  172. package/dist/client/assets/{toolbar-CJcI1ONf.js → toolbar-CnJJ4eu5.js} +1 -1
  173. package/dist/client/assets/{toolbar-icon-button-cVkvjja9.js → toolbar-icon-button-B79y2ICd.js} +1 -1
  174. package/dist/client/assets/{tools-list-DEAw8kBy.js → tools-list-BkmrRVg0.js} +1 -1
  175. package/dist/client/assets/{tooltip-B3Xu0WsU.js → tooltip-BzvGoBJt.js} +1 -1
  176. package/dist/client/assets/{types-CDMEICfs.js → types-qR--dQ-D.js} +1 -1
  177. package/dist/client/assets/{use-ai-providers-Dy1XYekN.js → use-ai-providers-CozhHADu.js} +1 -1
  178. package/dist/client/assets/{use-automations-89YCo463.js → use-automations-D3QGnMVz.js} +1 -1
  179. package/dist/client/assets/{use-capability-vmeCrW9g.js → use-capability-CqwMtAEs.js} +1 -1
  180. package/dist/client/assets/{use-clock-tick-Dums0r6j.js → use-clock-tick-DNM9eBUk.js} +1 -1
  181. package/dist/client/assets/{use-collections-Q9vyVcYX.js → use-collections-BMd7toro.js} +1 -1
  182. package/dist/client/assets/{use-connection-M87KpiDN.js → use-connection-D_bvpL3s.js} +1 -1
  183. package/dist/client/assets/{use-copy-D3B6kIY8.js → use-copy-CfpTy51n.js} +1 -1
  184. package/dist/client/assets/{use-create-virtual-mcp-BqvwF4Bt.js → use-create-virtual-mcp-5bjE35Lp.js} +1 -1
  185. package/dist/client/assets/{use-debounced-autosave-Bt96Pub1.js → use-debounced-autosave-BwNSBrQD.js} +1 -1
  186. package/dist/client/assets/{use-debounced-value-KutXID4s.js → use-debounced-value-qjTBhtoV.js} +1 -1
  187. package/dist/client/assets/{use-decopilot-events-BCbLJTtF.js → use-decopilot-events-E3D17uZ3.js} +1 -1
  188. package/dist/client/assets/{use-delete-connection-DTuplEmy.js → use-delete-connection-D-tPxqKr.js} +1 -1
  189. package/dist/client/assets/{use-deployment-admin-7ATx6QPd.js → use-deployment-admin-BZ-iktfM.js} +1 -1
  190. package/dist/client/assets/{use-file-configs-BJxRx26Q.js → use-file-configs-BRfvb0LV.js} +1 -1
  191. package/dist/client/assets/{use-infinite-scroll-DJF4Bq88.js → use-infinite-scroll-CYW4X7JC.js} +1 -1
  192. package/dist/client/assets/{use-join-requests-D-cXu4uc.js → use-join-requests-Bb_vw0fo.js} +1 -1
  193. package/dist/client/assets/{use-mcp-client-BdcH2AAr.js → use-mcp-client-DGZ08Y8e.js} +1 -1
  194. package/dist/client/assets/{use-mcp-prompts-DUZPd05e.js → use-mcp-prompts-D74mkwg7.js} +1 -1
  195. package/dist/client/assets/{use-mcp-tools-BhZCZNca.js → use-mcp-tools-B5iTOnEw.js} +1 -1
  196. package/dist/client/assets/{use-members-D2ADy_SQ.js → use-members-qflA3E7c.js} +1 -1
  197. package/dist/client/assets/{use-mobile-CMaygZmb.js → use-mobile-By_u8ixw.js} +1 -1
  198. package/dist/client/assets/{use-navigate-to-agent-BFFz8mSO.js → use-navigate-to-agent-DUyGpjg4.js} +1 -1
  199. package/dist/client/assets/{use-org-auth-client-Mq6_dHl5.js → use-org-auth-client-BujSnFJy.js} +1 -1
  200. package/dist/client/assets/{use-org-sso-Br7EvSJS.js → use-org-sso-zk4R_q3_.js} +1 -1
  201. package/dist/client/assets/{use-organization-roles-vbXYDT1Q.js → use-organization-roles-sCZ_uTyg.js} +1 -1
  202. package/dist/client/assets/{use-organization-settings-DqYIIvrP.js → use-organization-settings-Dw2bNyak.js} +1 -1
  203. package/dist/client/assets/{use-registry-connections-BcjXByDN.js → use-registry-connections-qE_J2XZV.js} +1 -1
  204. package/dist/client/assets/{use-secrets-Bf4bTSxf.js → use-secrets-gKHHVo8w.js} +1 -1
  205. package/dist/client/assets/{use-status-sounds-VC5seyB1.js → use-status-sounds-BFVcHBqH.js} +1 -1
  206. package/dist/client/assets/{use-view-mode-sA-TbW6V.js → use-view-mode-BFldqFYa.js} +1 -1
  207. package/dist/client/assets/{use-virtual-mcp-C8ctxJhX.js → use-virtual-mcp-BO8V40gw.js} +1 -1
  208. package/dist/client/assets/useInfiniteQuery-C_ER8SDL.js +1 -0
  209. package/dist/client/assets/{useRouterState-BmwO-4b6.js → useRouterState-CpGQovi1.js} +1 -1
  210. package/dist/client/assets/useSuspenseInfiniteQuery-C4gxwWHA.js +1 -0
  211. package/dist/client/assets/{users-CBHdkzLg.js → users-B-Y5Y6VT.js} +1 -1
  212. package/dist/client/assets/{variant-calendar-8twey6VW.js → variant-calendar-soIe9CBE.js} +1 -1
  213. package/dist/client/assets/{view-mode-toggle-1IeTPrvb.js → view-mode-toggle-DjQW7OBV.js} +1 -1
  214. package/dist/client/index.html +1 -1
  215. package/dist/server/cli.js +2 -2
  216. package/dist/server/server.js +2 -2
  217. package/package.json +1 -1
  218. package/dist/client/assets/add-section-modal-NS1ZCez1.js +0 -1
  219. package/dist/client/assets/app-editor-9YM-GZC2.js +0 -1
  220. package/dist/client/assets/category-editor-ChglZmxt.js +0 -1
  221. package/dist/client/assets/collection-detail-UOi2wnnk.js +0 -1
  222. package/dist/client/assets/file-explorer-BvdpftwY.js +0 -2
  223. package/dist/client/assets/page-seo-sheet-CiZnYdHp.js +0 -1
  224. package/dist/client/assets/post-editor-BSDKdvDJ.js +0 -1
  225. package/dist/client/assets/project-app-view-DQB3cq3D.js +0 -1
  226. package/dist/client/assets/record-editor-D4XAQGuN.js +0 -1
  227. package/dist/client/assets/registry-OhtqP004.js +0 -2
  228. package/dist/client/assets/sections-editor-B8NpwMFb.js +0 -2
  229. package/dist/client/assets/seo-editor-DUryeA6Q.js +0 -1
  230. package/dist/client/assets/seo-save-FLLGxIUK.js +0 -1
  231. package/dist/client/assets/store-registry-DZliD663.js +0 -2
  232. package/dist/client/assets/useInfiniteQuery-GaTpQKsb.js +0 -1
  233. package/dist/client/assets/useSuspenseInfiniteQuery-BMdxCWpS.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "decocms",
3
- "version": "4.51.2",
3
+ "version": "4.52.1",
4
4
  "description": "Deco CMS — Self-hostable MCP Gateway for managing AI connections and tools",
5
5
  "author": "Deco team",
6
6
  "repository": {
@@ -1 +0,0 @@
1
- import{c as $,r as g,j as r,l as H}from"./index-CJs4YG_y.js";import{U as _}from"./agent-icon-aq9fahDc.js";import{i as V}from"./SearchMd-BcwHGb7L.js";import{e as X,d as J,a as K,D as Q}from"./dialog-CzN8avhL.js";import{I as Y}from"./input-B0aQnFKg.js";import{aw as Z,as as ee,ax as te,ay as G,G as re}from"./index-CZ4WVu9U.js";const se=12,U=new Set,D=new Set;function le(){for(const i of D)i()}function oe(i){return U.has(i)?!0:U.size>=se?!1:(U.add(i),!0)}function F(i){U.delete(i)&&le()}function ie(i){return D.add(i),()=>{D.delete(i)}}function ne(i,e){const t=g.useRef(!1),[v,c]=g.useState(!1),n=g.useRef(null),a=g.useRef(null),l=g.useRef(null),s=g.useRef(i);s.current=i;const[x]=g.useState(()=>{const o=()=>{l.current?.(),l.current=null},f=()=>t.current?!0:oe(e)?(t.current=!0,c(!0),o(),!0):!1;return d=>{if(a.current=d,n.current&&(n.current.disconnect(),n.current=null),o(),!d){t.current&&(F(e),t.current=!1,c(!1));return}queueMicrotask(()=>{if(a.current!==d)return;const u=new IntersectionObserver(m=>{if(m[0]?.isIntersecting??!1){!f()&&!l.current&&(l.current=ie(()=>{a.current===d&&f()}));return}o(),t.current&&(F(e),t.current=!1,c(!1))},{root:s.current.current,rootMargin:"160px 0px"});u.observe(d),n.current=u})}});return{ref:x,iframeActive:v}}function ce(i){const e=$.c(8),{previewUrl:t,title:v,scrollRootRef:c,slotId:n}=i,{ref:a,iframeActive:l}=ne(c,n),[s,x]=g.useState(!1);let o;e[0]!==l||e[1]!==s||e[2]!==t||e[3]!==v?(o=l?r.jsxs(r.Fragment,{children:[!s&&r.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-muted/40",children:r.jsx(_,{className:"h-8 w-8 animate-pulse text-muted-foreground/40"})}),r.jsx("iframe",{src:t,title:`Preview ${v}`,sandbox:"allow-scripts allow-same-origin",referrerPolicy:"no-referrer",className:"pointer-events-none h-[200%] w-[200%] origin-top-left scale-50 border-0 bg-white",tabIndex:-1,onLoad:()=>x(!0)})]}):r.jsx("div",{className:"flex h-full items-center justify-center",children:r.jsx(_,{className:"h-8 w-8 text-muted-foreground/30"})}),e[0]=l,e[1]=s,e[2]=t,e[3]=v,e[4]=o):o=e[4];let f;return e[5]!==a||e[6]!==o?(f=r.jsx("div",{ref:a,className:"relative aspect-[16/10] w-full overflow-hidden bg-muted/40",children:o}),e[5]=a,e[6]=o,e[7]=f):f=e[7],f}function ae(i){const e=$.c(26),{entry:t,previewUrl:v,scrollRootRef:c,onSelect:n}=i,a=t.isSavedBlock&&"border-global-section/35 hover:bg-global-section/8";let l;e[0]!==a?(l=H("group flex flex-col overflow-hidden rounded-lg border bg-card text-left transition-colors","hover:border-primary/40 hover:bg-accent/30",a),e[0]=a,e[1]=l):l=e[1];let s;e[2]!==t.resolveType||e[3]!==t.title||e[4]!==v||e[5]!==c?(s=r.jsx(ce,{previewUrl:v,title:t.title,scrollRootRef:c,slotId:t.resolveType}),e[2]=t.resolveType,e[3]=t.title,e[4]=v,e[5]=c,e[6]=s):s=e[6];let x;e[7]!==t.isSavedBlock?(x=t.isSavedBlock?{color:re}:void 0,e[7]=t.isSavedBlock,e[8]=x):x=e[8];let o;e[9]!==x?(o=r.jsx(_,{className:"h-4 w-4 shrink-0",style:x}),e[9]=x,e[10]=o):o=e[10];let f;e[11]!==t.title?(f=r.jsx("p",{className:"truncate text-sm font-medium",children:t.title}),e[11]=t.title,e[12]=f):f=e[12];let d;e[13]!==t.description?(d=t.description&&r.jsx("p",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[13]=t.description,e[14]=d):d=e[14];let u;e[15]!==f||e[16]!==d?(u=r.jsxs("div",{className:"min-w-0 flex-1",children:[f,d]}),e[15]=f,e[16]=d,e[17]=u):u=e[17];let m;e[18]!==o||e[19]!==u?(m=r.jsxs("div",{className:"flex items-center gap-2 border-t px-3 py-2.5",children:[o,u]}),e[18]=o,e[19]=u,e[20]=m):m=e[20];let h;return e[21]!==n||e[22]!==l||e[23]!==s||e[24]!==m?(h=r.jsxs("button",{type:"button",onClick:n,className:l,children:[s,m]}),e[21]=n,e[22]=l,e[23]=s,e[24]=m,e[25]=h):h=e[25],h}function xe(i){const e=$.c(41),{open:t,onOpenChange:v,meta:c,decofile:n,previewBaseUrl:a,onSelect:l}=i,[s,x]=g.useState(""),[o,f]=g.useState(t),d=g.useRef(null);t!==o&&(f(t),t&&x(""));let u,m,h,S,b,j,y,N,w,R,C;if(e[0]!==n||e[1]!==c||e[2]!==v||e[3]!==l||e[4]!==t||e[5]!==a||e[6]!==s){const E=t&&c&&n?Z(c,n):[],M=c?ee(c):"",z=n?te(n):void 0,W=new Map;if(t&&M)for(const p of E)W.set(p.resolveType,G(a,M,p.previewBlock,z));const P=s.trim().toLowerCase(),q=P?E.filter(p=>p.title.toLowerCase().includes(P)||p.resolveType.toLowerCase().includes(P)||p.description?.toLowerCase().includes(P)):E;m=X,R=t,C=v,u=J,y="top-3 right-3",N="flex h-[90vh] max-h-[90vh] w-[96vw] max-w-[96vw] sm:max-w-[96vw] flex-col gap-0 overflow-hidden p-0";let O;e[18]===Symbol.for("react.memo_cache_sentinel")?(O=r.jsx(K,{children:"Add section"}),e[18]=O):O=e[18];let k;e[19]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(V,{size:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[19]=k):k=e[19];let B;e[20]===Symbol.for("react.memo_cache_sentinel")?(B=p=>x(p.target.value),e[20]=B):B=e[20],e[21]!==s?(w=r.jsxs(Q,{className:"shrink-0 border-b px-4 py-3 text-left",children:[O,r.jsxs("div",{className:"relative pt-2",children:[k,r.jsx(Y,{value:s,onChange:B,placeholder:"Search sections...",className:"h-9 pl-8"})]})]}),e[21]=s,e[22]=w):w=e[22],b=d,j="min-h-0 flex-1 overflow-y-auto",h="p-4",S=q.length===0?r.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:"No sections found."}):r.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:q.map(p=>r.jsx(ae,{entry:p,scrollRootRef:d,previewUrl:W.get(p.resolveType)??G(a,M,p.previewBlock,z),onSelect:()=>l(p)},p.resolveType))}),e[0]=n,e[1]=c,e[2]=v,e[3]=l,e[4]=t,e[5]=a,e[6]=s,e[7]=u,e[8]=m,e[9]=h,e[10]=S,e[11]=b,e[12]=j,e[13]=y,e[14]=N,e[15]=w,e[16]=R,e[17]=C}else u=e[7],m=e[8],h=e[9],S=e[10],b=e[11],j=e[12],y=e[13],N=e[14],w=e[15],R=e[16],C=e[17];let T;e[23]!==h||e[24]!==S?(T=r.jsx("div",{className:h,children:S}),e[23]=h,e[24]=S,e[25]=T):T=e[25];let I;e[26]!==T||e[27]!==b||e[28]!==j?(I=r.jsx("div",{ref:b,className:j,children:T}),e[26]=T,e[27]=b,e[28]=j,e[29]=I):I=e[29];let L;e[30]!==u||e[31]!==I||e[32]!==y||e[33]!==N||e[34]!==w?(L=r.jsxs(u,{closeButtonClassName:y,className:N,children:[w,I]}),e[30]=u,e[31]=I,e[32]=y,e[33]=N,e[34]=w,e[35]=L):L=e[35];let A;return e[36]!==m||e[37]!==L||e[38]!==R||e[39]!==C?(A=r.jsx(m,{open:R,onOpenChange:C,children:L}),e[36]=m,e[37]=L,e[38]=R,e[39]=C,e[40]=A):A=e[40],A}export{xe as A};
@@ -1 +0,0 @@
1
- import{c as gt,r as w,j as o,l as yt,t as ut,i as St}from"./index-CJs4YG_y.js";import{i as _t}from"./ChevronRight-BjCnVhIo.js";import{A as jt}from"./automation-runs-COPPnkgJ.js";import{A as kt}from"./add-section-modal-NS1ZCez1.js";import{aC as Bt,aD as wt,aE as At,q as Nt,t as Ct,aF as Rt,a9 as Et,aG as Kt,ap as Ft}from"./index-CZ4WVu9U.js";import"./select-IQqkuyke.js";import"./tooltip-B3Xu0WsU.js";import"./Check-ocZ9qfNA.js";import"./ChevronDown-wJWuHepF.js";import"./ChevronUp-CJAHlnYn.js";import"./useInfiniteQuery-GaTpQKsb.js";import"./use-infinite-scroll-DJF4Bq88.js";import"./use-connection-M87KpiDN.js";import"./use-collections-Q9vyVcYX.js";import"./use-mcp-client-BdcH2AAr.js";import"./constants-B72Xmt_K.js";import"./auth-Bj2JBDn0.js";import"./use-virtual-mcp-C8ctxJhX.js";import"./card-CFUuQQ1M.js";import"./sidebar-ciphtA4J.js";import"./LayoutLeft-j7RNB7Kr.js";import"./use-mobile-CMaygZmb.js";import"./X-Dntrg8W3.js";import"./table-BtAQhFli.js";import"./empty-state-CcJIYptY.js";import"./use-members-D2ADy_SQ.js";import"./use-org-auth-client-Mq6_dHl5.js";import"./use-clock-tick-Dums0r6j.js";import"./AlertCircle-D3-xinjs.js";import"./CheckCircle-C0j5UyGw.js";import"./Circle-BTXhFI7S.js";import"./agent-icon-aq9fahDc.js";import"./Tool01-DWMuD8TU.js";import"./ArrowUp-BDUzeu95.js";import"./Settings02-C124V1Xc.js";import"./XCircle-Cc0xPE71.js";import"./ArrowUpRight-C3_2cXeW.js";import"./ZapSquare-BaPWVQ37.js";import"./Users03-DgaczNXO.js";import"./Loading02-pQoaBc8-.js";import"./Stars02-Cb9neMzf.js";import"./Copy01-jaaWVisn.js";import"./ZoomOut-0JxM3Azv.js";import"./DotsVertical-DtV5Fnad.js";import"./Globe01-BGRBT0T0.js";import"./Eye-wkJjtmH2.js";import"./FilterLines-DlRQ5-i5.js";import"./Star01-8j7H5tvN.js";import"./Globe04-DRckETTE.js";import"./SwitchHorizontal01-DENI6_WB.js";import"./HardDrive-B5qdyv_Y.js";import"./Key01-JqQROwH3.js";import"./LinkExternal01-BOVv-eRf.js";import"./List-B14rXxdk.js";import"./Monitor01-p4fXdA6F.js";import"./Sun-f1oBLB5X.js";import"./Palette-Ba4t1bDZ.js";import"./Play-BRUiwJ0P.js";import"./Plus-CD0lb0Z8.js";import"./SearchLg-DomSsZ58.js";import"./SearchMd-BcwHGb7L.js";import"./Shield01-xKRFJ51X.js";import"./Stars01-D-3hvZEh.js";import"./Trash01-CWwPWzB6.js";import"./Upload01-mS32ZgCv.js";import"./User01-ByTCset0.js";import"./Users01-C_ia9S0h.js";import"./XClose-BKzJufOf.js";import"./Zap-B8LjXKlt.js";import"./use-automations-89YCo463.js";import"./studio-tools-C8sSWr27.js";import"./useSuspenseInfiniteQuery-BMdxCWpS.js";import"./badge-OQCPYGcq.js";import"./checkbox-BN0UcVyB.js";import"./command-B-zA3-tK.js";import"./index-C2LXo0VC.js";import"./dialog-CzN8avhL.js";import"./popover-uE71epyh.js";import"./avatar-B58RA_6l.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-D3B6kIY8.js";import"./file-type-icon-GpEKUsdD.js";import"./tab-id-bb-jjgGv.js";import"./monaco-editor-DTLtlpMl.js";import"./index-C7hMTAFR.js";import"./chat-context-BDLg73HV.js";import"./autosend-DCYPaCYz.js";import"./hooks-BFJHOTt4.js";import"./decopilot-sse-pool-DSmv0lZi.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-Dy1XYekN.js";import"./use-decopilot-events-BCbLJTtF.js";import"./use-organization-settings-DqYIIvrP.js";import"./types-CDMEICfs.js";import"./shell-layout--i4S_y1a.js";import"./alert-dialog-Ctmy7BUh.js";import"./required-auth-layout-Mghc_qb4.js";import"./use-org-sso-Br7EvSJS.js";import"./integration-icon-BrvrOk5H.js";import"./use-navigate-to-agent-BFFz8mSO.js";import"./reusable-new-chat-CouMjkYR.js";import"./use-mcp-prompts-DUZPd05e.js";import"./form-CGcaRTOA.js";import"./label-CAEQU6Kw.js";import"./input-B0aQnFKg.js";import"./drawer-HThdP5uB.js";import"./collection-search-IN2QsdDZ.js";import"./tabs-dnRCcMZW.js";import"./toggle-group-BWqkPPRz.js";import"./agent-capabilities-DSzooKp7.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CLhBW468.js";import"./use-registry-connections-BcjXByDN.js";import"./extract-connection-data-DSL7Y8A3.js";import"./collection-tabs-DEEctqY7.js";import"./textarea-BWkJXpt-.js";import"./connection-form-helpers-CYnQot14.js";import"./authenticate-and-persist-oauth-Dq14rQ5H.js";import"./mcp-oauth-WkAErzUM.js";import"./connect-desktop-dialog-DZCJkLGC.js";import"./select-model-_ueK9IUW.js";import"./skeleton-CtTBfwRk.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-B4wKOM9N.js";import"./dropdown-menu-BK5FaV5k.js";import"./index-DRgsUNzQ.js";import"./toolbar-CJcI1ONf.js";import"./use-debounced-value-KutXID4s.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-VC5seyB1.js";import"./use-mcp-tools-BhZCZNca.js";import"./use-capability-vmeCrW9g.js";import"./tools-list-DEAw8kBy.js";import"./switch-WmIvORwZ.js";import"./use-debounced-autosave-Bt96Pub1.js";import"./index-C7WjeY76.js";import"./search-input-CfI7XQSB.js";import"./github-repo-picker-KQYx5bF_.js";import"./github-installations-D2vHSx02.js";import"./use-secrets-Bf4bTSxf.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./index-CylmZ2ca.js";import"./get-initials-D-f_fDFw.js";import"./calendar-DWypRNoG.js";import"./toolbar-icon-button-cVkvjja9.js";import"./use-file-configs-BJxRx26Q.js";import"./automation-list-row-B4UVZ48v.js";function Tt(l,t){const s=(l.title||l.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),f=/^[A-Za-z]/.test(s)&&s.length>0?s:"Section",a=Bt(t,f);return{blockKey:a,data:{__resolveType:l.resolveType,name:a}}}function Br(l){const t=gt.c(77),{orgSlug:s,virtualMcpId:f,branch:a,blockKey:i,block:n,meta:m,decofile:c,title:Z,excludeFields:G,schemaPending:at,previewBaseUrl:nt}=l,H=at===void 0?!1:at,u=nt===void 0?null:nt,x=typeof n?.__resolveType=="string"?n.__resolveType:"";let C;t[0]!==G||t[1]!==m||t[2]!==x?(C=wt(x,m,G),t[0]=G,t[1]=m,t[2]=x,t[3]=C):C=t[3];const h=C;let R;t[4]!==h?(R=!!h&&Object.keys(h.properties??{}).length>0,t[4]=h,t[5]=R):R=t[5];const J=R;let E;t[6]!==n||t[7]!==i||t[8]!==m||t[9]!==Z?(E=Z??(n?At(i,n,m):i),t[6]=n,t[7]=i,t[8]=m,t[9]=Z,t[10]=E):E=t[10];const v=E;let K;t[11]!==a||t[12]!==s||t[13]!==f?(K={orgSlug:s,virtualMcpId:f,branch:a},t[11]=a,t[12]=s,t[13]=f,t[14]=K):K=t[14];const{save:b,flush:Q,isPending:W}=Nt(K);let F;t[15]!==a||t[16]!==s||t[17]!==f?(F={orgSlug:s,virtualMcpId:f,branch:a},t[15]=a,t[16]=s,t[17]=f,t[18]=F):F=t[18];const X=Ct(F);let T;t[19]!==b?(T=Et((e,r)=>b(e,r)),t[19]=b,t[20]=T):T=t[20];const Y=T,[ht,xt]=w.useState(i),[tt,ct]=w.useState(null),[et,dt]=w.useState(0);let $;t[21]===Symbol.for("react.memo_cache_sentinel")?($=[],t[21]=$):$=t[21];const[p,ft]=w.useState($),[ot,rt]=w.useState(!1),P=w.useRef(null);ht!==i&&(xt(i),ct(null),dt(Pt),ft([]));let O;t[22]!==n?(O=n??{},t[22]=n,t[23]=O):O=t[23];const it=O;let g;t[24]!==tt?(g=tt??{},t[24]=tt,t[25]=g):g=t[25];let q;t[26]!==it||t[27]!==g?(q={...it,...g},t[26]=it,t[27]=g,t[28]=q):q=t[28];const mt=q;let z;t[29]!==i||t[30]!==x||t[31]!==b?(z=e=>{const r=e;ct(r),b(i,{...r,__resolveType:x})},t[29]=i,t[30]=x,t[31]=b,t[32]=z):z=t[32];const st=z;let L;t[33]===Symbol.for("react.memo_cache_sentinel")?(L=e=>{ft(e)},t[33]=L):L=t[33];const pt=L;let V;t[34]!==c||t[35]!==Q||t[36]!==X?(V=async(e,r)=>{try{const{blockKey:d,data:N}=Tt(e,c);await X.mutateAsync({blockKey:d,data:N}),ut.success(`Created section "${d}"`),r({__resolveType:d}),Q()}catch(d){const N=d,bt=N instanceof Error?N.message:"Could not add section";throw ut.error(bt),N}},t[34]=c,t[35]=Q,t[36]=X,t[37]=V):V=t[37];const y=V;let I;t[38]===Symbol.for("react.memo_cache_sentinel")?(I=e=>{P.current=e.append,rt(!0)},t[38]=I):I=t[38];const vt=I;let U;t[39]!==y?(U=async e=>{const r=P.current;if(r)try{await y(e,d=>{r(d),rt(!1),P.current=null})}catch{}},t[39]=y,t[40]=U):U=t[40];const lt=U;let D;t[41]!==p||t[42]!==v?(D=p.length>0?[v,...p]:[],t[41]=p,t[42]=v,t[43]=D):D=t[43];const A=D;let S;t[44]!==p||t[45]!==A||t[46]!==v?(S=A.length>0?o.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:A.map((e,r)=>{const d=r===A.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(_t,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{pt(r===0?[]:Rt(p,r)),dt($t)},title:e,className:yt("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",d?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:e})]},`${e}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:v}),t[44]=p,t[45]=A,t[46]=v,t[47]=S):S=t[47];let _;t[48]!==W?(_=o.jsx(Kt,{isPending:W,isError:!1}),t[48]=W,t[49]=_):_=t[49];let j;t[50]!==S||t[51]!==_?(j=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[S,_]}),t[50]=S,t[51]=_,t[52]=j):j=t[52];let k;t[53]!==i||t[54]!==p||t[55]!==c||t[56]!==mt||t[57]!==et||t[58]!==y||t[59]!==st||t[60]!==J||t[61]!==m||t[62]!==u||t[63]!==Y||t[64]!==h||t[65]!==H?(k=o.jsx(jt,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:J?o.jsx(Ft,{schema:h,value:mt,onChange:st,basePath:"",breadcrumbPath:p,onBreadcrumbChange:pt,decofile:c,meta:m,onSaveReferencedBlock:Y,previewBaseUrl:u,onAddSectionItem:y,onRequestAddSection:vt},`${i}:${et}`):H?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(St,{size:16,className:"animate-spin"}),"Loading app schema…"]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"No editable schema found for this app."})})})}),t[53]=i,t[54]=p,t[55]=c,t[56]=mt,t[57]=et,t[58]=y,t[59]=st,t[60]=J,t[61]=m,t[62]=u,t[63]=Y,t[64]=h,t[65]=H,t[66]=k):k=t[66];let B;t[67]!==ot||t[68]!==c||t[69]!==lt||t[70]!==m||t[71]!==u?(B=u&&o.jsx(kt,{open:ot,onOpenChange:e=>{rt(e),e||(P.current=null)},meta:m,decofile:c,previewBaseUrl:u,onSelect:e=>{lt(e)}}),t[67]=ot,t[68]=c,t[69]=lt,t[70]=m,t[71]=u,t[72]=B):B=t[72];let M;return t[73]!==j||t[74]!==k||t[75]!==B?(M=o.jsxs("div",{className:"flex h-full flex-col",children:[j,k,B]}),t[73]=j,t[74]=k,t[75]=B,t[76]=M):M=t[76],M}function $t(l){return l+1}function Pt(l){return l+1}export{Br as AppEditor};
@@ -1 +0,0 @@
1
- import{c as q,r as S,l as Q,j as t,B as I,i as V,t as U}from"./index-CJs4YG_y.js";import{i as X}from"./XCircle-Cc0xPE71.js";import{aI as Y,a9 as T}from"./agent-icon-aq9fahDc.js";import{n as Z}from"./LinkExternal01-BOVv-eRf.js";import{f as K,a as _,b as tt,c as et,d as ot,e as rt,A as it,g as st}from"./alert-dialog-Ctmy7BUh.js";import{I as L}from"./input-B0aQnFKg.js";import{L as H}from"./label-CAEQU6Kw.js";import{aH as at,aI as mt,aR as nt,aG as lt,aJ as B,aL as pt,aS as ct}from"./index-CZ4WVu9U.js";import{c as dt,B as ut,a as gt}from"./block-document-LDG191Ua.js";import{u as xt,s as v,E as ft}from"./primitives-CFiyHFxY.js";import{t as ht}from"./ChevronDown-wJWuHepF.js";import{J as jt,K as yt,I as vt}from"./automation-runs-COPPnkgJ.js";import"./AlertCircle-D3-xinjs.js";import"./Tool01-DWMuD8TU.js";import"./ArrowUp-BDUzeu95.js";import"./Settings02-C124V1Xc.js";import"./ArrowUpRight-C3_2cXeW.js";import"./ZapSquare-BaPWVQ37.js";import"./Users03-DgaczNXO.js";import"./Loading02-pQoaBc8-.js";import"./CheckCircle-C0j5UyGw.js";import"./Check-ocZ9qfNA.js";import"./ChevronRight-BjCnVhIo.js";import"./ChevronUp-CJAHlnYn.js";import"./Circle-BTXhFI7S.js";import"./Stars02-Cb9neMzf.js";import"./Copy01-jaaWVisn.js";import"./ZoomOut-0JxM3Azv.js";import"./DotsVertical-DtV5Fnad.js";import"./Globe01-BGRBT0T0.js";import"./Eye-wkJjtmH2.js";import"./FilterLines-DlRQ5-i5.js";import"./Star01-8j7H5tvN.js";import"./Globe04-DRckETTE.js";import"./SwitchHorizontal01-DENI6_WB.js";import"./HardDrive-B5qdyv_Y.js";import"./Key01-JqQROwH3.js";import"./LayoutLeft-j7RNB7Kr.js";import"./List-B14rXxdk.js";import"./Monitor01-p4fXdA6F.js";import"./Sun-f1oBLB5X.js";import"./Palette-Ba4t1bDZ.js";import"./Play-BRUiwJ0P.js";import"./Plus-CD0lb0Z8.js";import"./SearchLg-DomSsZ58.js";import"./SearchMd-BcwHGb7L.js";import"./Shield01-xKRFJ51X.js";import"./Stars01-D-3hvZEh.js";import"./Trash01-CWwPWzB6.js";import"./Upload01-mS32ZgCv.js";import"./User01-ByTCset0.js";import"./Users01-C_ia9S0h.js";import"./XClose-BKzJufOf.js";import"./X-Dntrg8W3.js";import"./Zap-B8LjXKlt.js";import"./chat-context-BDLg73HV.js";import"./autosend-DCYPaCYz.js";import"./hooks-BFJHOTt4.js";import"./use-mcp-client-BdcH2AAr.js";import"./constants-B72Xmt_K.js";import"./auth-Bj2JBDn0.js";import"./decopilot-sse-pool-DSmv0lZi.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-C8ctxJhX.js";import"./use-collections-Q9vyVcYX.js";import"./use-ai-providers-Dy1XYekN.js";import"./studio-tools-C8sSWr27.js";import"./use-decopilot-events-BCbLJTtF.js";import"./tab-id-bb-jjgGv.js";import"./use-organization-settings-DqYIIvrP.js";import"./tooltip-B3Xu0WsU.js";import"./dialog-CzN8avhL.js";import"./drawer-HThdP5uB.js";import"./collection-search-IN2QsdDZ.js";import"./use-mobile-CMaygZmb.js";import"./use-mcp-prompts-DUZPd05e.js";import"./shell-layout--i4S_y1a.js";import"./avatar-B58RA_6l.js";import"./required-auth-layout-Mghc_qb4.js";import"./use-org-sso-Br7EvSJS.js";import"./form-CGcaRTOA.js";import"./select-IQqkuyke.js";import"./tabs-dnRCcMZW.js";import"./toggle-group-BWqkPPRz.js";import"./agent-capabilities-DSzooKp7.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CLhBW468.js";import"./use-registry-connections-BcjXByDN.js";import"./use-connection-M87KpiDN.js";import"./useInfiniteQuery-GaTpQKsb.js";import"./use-infinite-scroll-DJF4Bq88.js";import"./extract-connection-data-DSL7Y8A3.js";import"./card-CFUuQQ1M.js";import"./integration-icon-BrvrOk5H.js";import"./collection-tabs-DEEctqY7.js";import"./badge-OQCPYGcq.js";import"./textarea-BWkJXpt-.js";import"./connection-form-helpers-CYnQot14.js";import"./authenticate-and-persist-oauth-Dq14rQ5H.js";import"./mcp-oauth-WkAErzUM.js";import"./useSuspenseInfiniteQuery-BMdxCWpS.js";import"./connect-desktop-dialog-DZCJkLGC.js";import"./select-model-_ueK9IUW.js";import"./checkbox-BN0UcVyB.js";import"./skeleton-CtTBfwRk.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-B4wKOM9N.js";import"./command-B-zA3-tK.js";import"./index-C2LXo0VC.js";import"./popover-uE71epyh.js";import"./dropdown-menu-BK5FaV5k.js";import"./index-DRgsUNzQ.js";import"./file-type-icon-GpEKUsdD.js";import"./toolbar-CJcI1ONf.js";import"./use-debounced-value-KutXID4s.js";import"./index-C7hMTAFR.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-VC5seyB1.js";import"./empty-state-CcJIYptY.js";import"./use-mcp-tools-BhZCZNca.js";import"./types-CDMEICfs.js";import"./use-capability-vmeCrW9g.js";import"./tools-list-DEAw8kBy.js";import"./switch-WmIvORwZ.js";import"./use-debounced-autosave-Bt96Pub1.js";import"./index-C7WjeY76.js";import"./sidebar-ciphtA4J.js";import"./search-input-CfI7XQSB.js";import"./github-repo-picker-KQYx5bF_.js";import"./use-navigate-to-agent-BFFz8mSO.js";import"./reusable-new-chat-CouMjkYR.js";import"./github-installations-D2vHSx02.js";import"./use-secrets-Bf4bTSxf.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-members-D2ADy_SQ.js";import"./use-org-auth-client-Mq6_dHl5.js";import"./index-CylmZ2ca.js";import"./get-initials-D-f_fDFw.js";import"./format-time-BnbuEtat.js";import"./calendar-DWypRNoG.js";import"./toolbar-icon-button-cVkvjja9.js";import"./use-file-configs-BJxRx26Q.js";import"./monaco-editor-DTLtlpMl.js";import"./use-automations-89YCo463.js";import"./automation-list-row-B4UVZ48v.js";import"./table-BtAQhFli.js";import"./use-clock-tick-Dums0r6j.js";import"./use-copy-D3B6kIY8.js";function bt(k){const e=q.c(18),{icon:f,title:n,defaultOpen:b,children:d}=k,D=b===void 0?!1:b,[x,A]=S.useState(D);let l;e[0]!==f?(l=t.jsx(f,{size:15}),e[0]=f,e[1]=l):l=e[1];let i;e[2]!==n?(i=t.jsx("span",{className:"flex-1 text-left",children:n}),e[2]=n,e[3]=i):i=e[3];const h=x&&"rotate-180";let r;e[4]!==h?(r=Q("transition-transform",h),e[4]=h,e[5]=r):r=e[5];let p;e[6]!==r?(p=t.jsx(ht,{size:15,className:r}),e[6]=r,e[7]=p):p=e[7];let c;e[8]!==l||e[9]!==i||e[10]!==p?(c=t.jsx(jt,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[l,i,p]})}),e[8]=l,e[9]=i,e[10]=p,e[11]=c):c=e[11];let s;e[12]!==d?(s=t.jsx(yt,{className:"px-2 pt-4",children:d}),e[12]=d,e[13]=s):s=e[13];let u;return e[14]!==x||e[15]!==c||e[16]!==s?(u=t.jsxs(vt,{open:x,onOpenChange:A,className:"mt-4",children:[c,s]}),e[14]=x,e[15]=c,e[16]=s,e[17]=u):u=e[17],u}function cr({orgSlug:k,virtualMcpId:e,branch:f,blockKey:n,block:b,decofile:d,meta:D,onManagePosts:x,onOpenPost:A,previewBaseUrl:l}){const i=at({orgSlug:k,virtualMcpId:e,branch:f}),h=mt(b,"categories"),[r,p,c]=xt(h,o=>{i.mutate({blockKey:n,data:B(n,"categories",o)})}),s=(o,w)=>p({...r,[o]:w}),u=dt({decofile:d,category:r,previewBaseUrl:l}),a=v(r.slug),[R,j]=S.useState(a),[m,C]=S.useState(null),[N,$]=S.useState(!1),z=a?nt(d).filter(o=>o.categorySlugs.includes(a)):[],y=z.length,J=o=>s("slug",o),M=async(o,w)=>{const W=v(r.name);$(!0);try{let g=0;for(const{key:P,payload:O}of pt(d,"posts")){const F=ct(O,o,{name:W,slug:w});F!==O&&(await i.mutateAsync({blockKey:P,data:B(P,"posts",F)}),g+=1)}const E={...r,slug:w};await i.mutateAsync({blockKey:n,data:B(n,"categories",E)}),c(E),U.success(g>0?`Renamed slug and updated ${g} ${g===1?"post":"posts"}`:"Renamed slug"),C(null)}catch(g){j(o),C(null),U.error(g instanceof Error?g.message:"Rename failed")}finally{$(!1)}},G=()=>{const o=R.trim();if(o===a){R!==o&&j(o);return}if(!o){j(a);return}if(y===0){J(o);return}C({oldSlug:a,newSlug:o,count:y})};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[t.jsx("span",{className:"truncate text-sm font-medium",children:v(r.name)||"Untitled category"}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx(lt,{isPending:i.isPending,isError:i.isError}),u&&t.jsxs(I,{type:"button",variant:"outline",size:"sm",title:"Open the category preview in a new tab",onClick:()=>window.open(u,"_blank","noopener,noreferrer"),children:[t.jsx(Z,{size:14}),"See category preview"]})]})]}),t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[t.jsx(ft,{value:v(r.name),onChange:o=>s("name",o),placeholder:"Category name",className:"py-1 text-3xl font-bold text-foreground"}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(H,{htmlFor:"category-slug",children:"Slug"}),t.jsx(L,{id:"category-slug",value:R,onChange:o=>j(o.target.value),onBlur:G,placeholder:"my-category",className:"h-10"})]}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(H,{htmlFor:"category-description",children:"Description"}),t.jsx(L,{id:"category-description",value:v(r.description),onChange:o=>s("description",o.target.value),placeholder:"Short description for this category",className:"h-10"})]}),t.jsx(bt,{icon:Y,title:"Content",defaultOpen:!0,children:t.jsx(ut,{value:gt(r.sections),onChange:o=>s("sections",o),meta:D,emptyMessage:"This category has no content yet. Use ⊕ to add your first block."})}),t.jsxs("div",{className:"mt-6 overflow-hidden rounded-lg border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(T,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"text-sm",children:[y," ",y===1?"post":"posts"," in this category"]})]}),t.jsxs(I,{type:"button",variant:"outline",size:"sm",disabled:!a,title:a?"Pick posts to add to this category":"Set a slug to add posts to this category",onClick:()=>x(a),children:["Add posts",t.jsx(X,{size:14})]})]}),y>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:z.map(o=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>A(o.key),className:"flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[t.jsx(T,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:o.title||"Untitled post"}),o.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:o.slug})]})]})},o.key))})]})]})})]}),t.jsx(K,{open:!!m,onOpenChange:o=>{o||N||(j(a),C(null))},children:t.jsxs(_,{children:[t.jsxs(tt,{children:[t.jsx(et,{children:"Rename category slug?"}),t.jsx(ot,{children:m?`Changing the slug from "${m.oldSlug}" to "${m.newSlug}" will update ${m.count} ${m.count===1?"post":"posts"} that reference this category.`:null})]}),t.jsxs(rt,{children:[t.jsx(it,{disabled:N,children:"Cancel"}),t.jsx(st,{onClick:o=>{o.preventDefault(),m&&M(m.oldSlug,m.newSlug)},disabled:N,children:N?t.jsxs(t.Fragment,{children:[t.jsx(V,{size:14,className:"animate-spin"}),"Renaming…"]}):"Rename & update posts"})]})]})})]})}export{cr as CategoryEditor};
@@ -1 +0,0 @@
1
- import{c as O,j as t,B as F,i as X,H as Ge,I as te,U as Pe,r as $,a1 as re,M as Qe,u as Xe,L as K,t as Ye,l as je,e as le,aX as ke}from"./index-CJs4YG_y.js";import{E as Ae}from"./empty-state-CcJIYptY.js";import{u as Ze,a as Ee}from"./use-collections-Q9vyVcYX.js";import{u as ae}from"./use-mcp-client-BdcH2AAr.js";import{F as se,a as et,b as ce,d as de}from"./form-CGcaRTOA.js";import{I as me}from"./input-B0aQnFKg.js";import{T as ie}from"./textarea-BWkJXpt-.js";import{a as tt,b as st,V as ue,O as nt,M as ot}from"./index-DyKFz-Wv.js";import{as as it,L as rt,am as lt,an as at,ad as ct,at as dt,W as be}from"./agent-icon-aq9fahDc.js";import{g as mt,M as ut,a as Ne}from"./types-CDMEICfs.js";import{A as xt,a as pt,b as ft}from"./alert-fs5gPaUM.js";import{S as ve,a as Se,b as ye,c as we,d as ne}from"./select-IQqkuyke.js";import{c as ht,T as Ce,a as Ie,b as $e}from"./tooltip-B3Xu0WsU.js";import{i as gt}from"./AlertCircle-D3-xinjs.js";import{s as jt}from"./Stars02-Cb9neMzf.js";import{a as bt}from"./Copy01-jaaWVisn.js";import{i as Nt}from"./Play-BRUiwJ0P.js";import{a as Oe,b as Re,B as J,c as G,d as Q,e as _e}from"./breadcrumb-BgOeMiKF.js";import{g as vt}from"./connection-slug-eyAPH6o3.js";import{u as St,T as yt}from"./tools-list-DEAw8kBy.js";import{a as Me,u as De}from"./use-connection-M87KpiDN.js";import{a as wt}from"./use-mcp-tools-BhZCZNca.js";import{M as Ct,c as It}from"./monaco-editor-DTLtlpMl.js";import{I as Te}from"./integration-icon-BrvrOk5H.js";import{g as $t,l as Tt}from"./chat-context-BDLg73HV.js";import{u as Pt}from"./shell-layout--i4S_y1a.js";import{n as kt}from"./XCircle-Cc0xPE71.js";import"./constants-B72Xmt_K.js";import"./auth-Bj2JBDn0.js";import"./label-CAEQU6Kw.js";import"./index-C7WjeY76.js";import"./sidebar-ciphtA4J.js";import"./LayoutLeft-j7RNB7Kr.js";import"./use-mobile-CMaygZmb.js";import"./X-Dntrg8W3.js";import"./ZoomOut-0JxM3Azv.js";import"./Key01-JqQROwH3.js";import"./extract-connection-data-DSL7Y8A3.js";import"./use-registry-connections-BcjXByDN.js";import"./use-organization-settings-DqYIIvrP.js";import"./studio-tools-C8sSWr27.js";import"./Plus-CD0lb0Z8.js";import"./index-Cu4sMkIs.js";import"./index-DjoZL3mB.js";import"./index-C2LXo0VC.js";import"./popover-uE71epyh.js";import"./use-virtual-mcp-C8ctxJhX.js";import"./Check-ocZ9qfNA.js";import"./SearchMd-BcwHGb7L.js";import"./Users03-DgaczNXO.js";import"./use-create-virtual-mcp-BqvwF4Bt.js";import"./use-navigate-to-agent-BFFz8mSO.js";import"./hooks-BFJHOTt4.js";import"./decopilot-sse-pool-DSmv0lZi.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./Tool01-DWMuD8TU.js";import"./ArrowUp-BDUzeu95.js";import"./Settings02-C124V1Xc.js";import"./ArrowUpRight-C3_2cXeW.js";import"./ZapSquare-BaPWVQ37.js";import"./Loading02-pQoaBc8-.js";import"./CheckCircle-C0j5UyGw.js";import"./ChevronDown-wJWuHepF.js";import"./ChevronRight-BjCnVhIo.js";import"./ChevronUp-CJAHlnYn.js";import"./Circle-BTXhFI7S.js";import"./DotsVertical-DtV5Fnad.js";import"./Globe01-BGRBT0T0.js";import"./Eye-wkJjtmH2.js";import"./FilterLines-DlRQ5-i5.js";import"./Star01-8j7H5tvN.js";import"./Globe04-DRckETTE.js";import"./SwitchHorizontal01-DENI6_WB.js";import"./HardDrive-B5qdyv_Y.js";import"./LinkExternal01-BOVv-eRf.js";import"./List-B14rXxdk.js";import"./Monitor01-p4fXdA6F.js";import"./Sun-f1oBLB5X.js";import"./Palette-Ba4t1bDZ.js";import"./SearchLg-DomSsZ58.js";import"./Shield01-xKRFJ51X.js";import"./Stars01-D-3hvZEh.js";import"./Trash01-CWwPWzB6.js";import"./Upload01-mS32ZgCv.js";import"./User01-ByTCset0.js";import"./Users01-C_ia9S0h.js";import"./XClose-BKzJufOf.js";import"./Zap-B8LjXKlt.js";import"./mcp-oauth-WkAErzUM.js";import"./badge-OQCPYGcq.js";import"./index-C7hMTAFR.js";import"./autosend-DCYPaCYz.js";import"./use-ai-providers-Dy1XYekN.js";import"./use-decopilot-events-BCbLJTtF.js";import"./tab-id-bb-jjgGv.js";import"./avatar-B58RA_6l.js";import"./dialog-CzN8avhL.js";import"./alert-dialog-Ctmy7BUh.js";import"./required-auth-layout-Mghc_qb4.js";import"./use-org-sso-Br7EvSJS.js";function At(s){const e=O.c(15),{onSave:r,onUndo:o,isDirty:l,isSaving:i,saveLabel:c,undoLabel:d}=s,n=c===void 0?"Save":c,u=d===void 0?"Undo":d;if(!l)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(it,{size:14}),e[0]=x):x=e[0];let m;e[1]!==i||e[2]!==o||e[3]!==u?(m=t.jsxs(F,{variant:"outline",size:"sm",onClick:o,disabled:i,"aria-label":u,children:[x,u]}),e[1]=i,e[2]=o,e[3]=u,e[4]=m):m=e[4];let p;e[5]!==i?(p=i?t.jsx(X,{size:14,className:"animate-spin"}):t.jsx(rt,{size:14}),e[5]=i,e[6]=p):p=e[6];let f;e[7]!==i||e[8]!==r||e[9]!==n||e[10]!==p?(f=t.jsxs(F,{variant:"default",size:"sm",onClick:r,disabled:i,"aria-label":n,children:[p,n]}),e[7]=i,e[8]=r,e[9]=n,e[10]=p,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Ge({title:te().min(1),description:te().nullable(),body:te()});function oe(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Et(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(o=>o==="mcps"),r=e>=0?s[e+1]:void 0;return r?decodeURIComponent(r):void 0}function Ot(s){const e=O.c(13),{form:r}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=o):o=e[0];let l;e[1]!==r.control?(l=t.jsxs("div",{className:"flex flex-col gap-4",children:[o,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(se,{control:r.control,name:"title",render:Mt}),t.jsx(se,{control:r.control,name:"description",render:_t})]})]}),e[1]=r.control,e[2]=l):l=e[2];let i,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),c=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=i,e[4]=c):(i=e[3],c=e[4]);let d;e[5]!==r.control?(d=t.jsxs("div",{className:"flex flex-col gap-2",children:[i,c,t.jsx(se,{control:r.control,name:"body",render:Rt})]}),e[5]=r.control,e[6]=d):d=e[6];let n;e[7]!==l||e[8]!==d?(n=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[l,d]}),e[7]=l,e[8]=d,e[9]=n):n=e[9];let u;return e[10]!==r||e[11]!==n?(u=t.jsx(et,{...r,children:n}),e[10]=r,e[11]=n,e[12]=u):u=e[12],u}function Rt(s){const{field:e}=s;return t.jsx(ce,{children:t.jsx(de,{children:t.jsx(ie,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function _t(s){const{field:e}=s;return t.jsxs(ce,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(de,{children:t.jsx(me,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Mt(s){const{field:e}=s;return t.jsxs(ce,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(de,{children:t.jsx(me,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Dt(s){const e=O.c(36),{providerId:r,promptId:o}=s,{org:l}=re(),i=r||null;let c;e[0]!==l.id||e[1]!==l.slug||e[2]!==i?(c={connectionId:i,orgId:l.id,orgSlug:l.slug},e[0]=l.id,e[1]=l.slug,e[2]=i,e[3]=c):c=e[3];const d=ae(c),n=Ze(r,"PROMPT",o,d),u=Ee(r,"PROMPT",d),x=u.update.isPending;let m;e[4]!==n?(m=n?{title:n.title,description:n.description??null,body:oe(n)}:void 0,e[4]=n,e[5]=m):m=e[5];let p;e[6]!==m?(p={values:m},e[6]=m,e[7]=p):p=e[7];const f=Qe(p);let g;e[8]!==f||e[9]!==n?(g=()=>{n&&f.reset({title:n.title,description:n.description??null,body:oe(n)})},e[8]=f,e[9]=n,e[10]=g):g=e[10];const S=g;let C;e[11]!==u.update||e[12]!==f||e[13]!==o?(C=f.handleSubmit(async N=>{const A=await u.update.mutateAsync({id:o,data:{title:N.title,description:N.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:N.body}}]}});f.reset({title:A.title,description:A.description??null,body:oe(A)})}),e[11]=u.update,e[12]=f,e[13]=o,e[14]=C):C=e[14];const R=C;if(!n){let N;return e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ae,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=N):N=e[15],N}let I;e[16]!==n.title?(I=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[16]=n.title,e[17]=I):I=e[17];let k;e[18]!==n.description?(k=n.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:n.description})]}):null,e[18]=n.description,e[19]=k):k=e[19];let T;e[20]!==I||e[21]!==k?(T=t.jsx(st,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[I,k]})}),e[20]=I,e[21]=k,e[22]=T):T=e[22];let b;e[23]!==R?(b=()=>{R()},e[23]=R,e[24]=b):b=e[24];let y;e[25]!==f.formState.isDirty||e[26]!==x||e[27]!==S||e[28]!==b?(y=t.jsx(tt,{children:t.jsx(At,{onSave:b,onUndo:S,isDirty:f.formState.isDirty,isSaving:x})}),e[25]=f.formState.isDirty,e[26]=x,e[27]=S,e[28]=b,e[29]=y):y=e[29];let w;e[30]!==f?(w=t.jsx("div",{className:"h-full",children:t.jsx(Ot,{form:f})}),e[30]=f,e[31]=w):w=e[31];let P;return e[32]!==y||e[33]!==w||e[34]!==T?(P=t.jsxs(ue,{children:[T,y,w]}),e[32]=y,e[33]=w,e[34]=T,e[35]=P):P=e[35],P}function Lt(s){const e=O.c(4),{itemId:r}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=Et(),e[0]=o):o=e[0];const l=o;if(!l){let c;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ae,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=c):c=e[1],c}let i;return e[2]!==r?(i=t.jsx(Pe,{children:t.jsx($.Suspense,{fallback:null,children:t.jsx(Dt,{providerId:l,promptId:r})})}),e[2]=r,e[3]=i):i=e[3],i}const zt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ut(s){const e=O.c(11),{toolName:r,connectionId:o,siblings:l,onSelectInstance:i,onBack:c}=s;let d;e[0]!==o?(d={connectionId:o},e[0]=o,e[1]=d):d=e[1];const n=St(d);if(!n.isAuthenticated){let m;return e[2]!==n.supportsOAuth||e[3]!==c?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:n.supportsOAuth?t.jsx(nt,{onAuthenticate:()=>c(),buttonText:"Go back to authenticate"}):t.jsx(ot,{hasReadme:!1})}),e[2]=n.supportsOAuth,e[3]=c,e[4]=m):m=e[4],m}const u=`${o}:${r}`;let x;return e[5]!==o||e[6]!==i||e[7]!==l||e[8]!==u||e[9]!==r?(x=t.jsx(Bt,{toolName:r,connectionId:o,siblings:l,onSelectInstance:i},u),e[5]=o,e[6]=i,e[7]=l,e[8]=u,e[9]=r,e[10]=x):x=e[10],x}function Bt({toolName:s,connectionId:e,siblings:r,onSelectInstance:o}){const{replayId:l}=Xe({strict:!1}),i=(()=>{if(!l)return null;const a=`replay-${l}`,h=sessionStorage.getItem(a);if(!h)return null;sessionStorage.removeItem(a);try{return JSON.parse(h)}catch{return null}})(),c=(()=>{if(!i)return null;const a={};for(const[h,v]of Object.entries(i))v!==null&&typeof v=="object"?a[h]=JSON.stringify(v,null,2):a[h]=v;return a})(),[d,n]=$.useState(c??{}),[u,x]=$.useState(i?JSON.stringify(i,null,2):"{}"),[m,p]=$.useState(null),[f,g]=$.useState(null),[S,C]=$.useState(null),[R,I]=$.useState(null),[k,T]=$.useState(!1),[b,y]=$.useState(null),{org:w}=re(),P=Me(e),N=$t(),A=Tt(),{openSidePanel:U}=Pt(),L=`${e}:${s}`,_=ae({connectionId:e,orgId:w.id,orgSlug:w.slug}),z=wt({client:_}),j=z.data?.tools?.find(a=>a.name===s),E=mt(j?._meta),V=a=>{if(!N)return;const h=It(a.content);h.content.length>0&&(U("chat"),N.sendMessage({tiptapDoc:h}))},[M,Y]=$.useState("json"),[Le,ze]=$.useState(!1);E&&!Le&&(Y("ui"),ze(!0));const xe=j?.inputSchema?.properties,pe=xe?Object.keys(xe):[],q=pe.length>0,H={};if(q&&j?.inputSchema?.properties)for(const a of pe)H[a]=j.inputSchema.required?.includes(a)?"":void 0;const Z=a=>Object.prototype.hasOwnProperty.call(d,a),Ue=async()=>{T(!0),I(null),p(null),g(null),C(null),y(null);const a=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=q?{...H,...d}:(()=>{const D=u.trim();if(!D)return{};const B=JSON.parse(D);if(B&&typeof B=="object")return B;throw new Error("Raw JSON input must be an object.")})();q&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([D,B])=>{if((B.type==="object"||B.type==="array")&&typeof h[D]=="string")try{h[D]=JSON.parse(h[D])}catch{}else if((B.type==="number"||B.type==="integer")&&typeof h[D]=="string"&&h[D]!==""){const ge=Number(h[D]);Number.isNaN(ge)||(h[D]=ge)}});const v=await _.callTool({name:s,arguments:h}),W=v.structuredContent??v,He=performance.now(),We=Math.round(He-a);p(W),g(v),C(h);const Ke=JSON.stringify(W),he=new TextEncoder().encode(Ke).length;y({duration:`${We}ms`,bytes:`${he} bytes`,tokens:`~${Math.ceil(he/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);I(v||"Unknown error occurred");const W=performance.now();y({duration:`${Math.round(W-a)}ms`})}finally{T(!1)}},ee=(a,h)=>{n(v=>({...v,[a]:h}))},Be=()=>{p(null),g(null),C(null),I(null),y(null)},Fe=j?.name??zt(s),Ve=t.jsx(Oe,{children:t.jsxs(Re,{children:[t.jsx(J,{children:t.jsx(G,{asChild:!0,children:t.jsx(K,{to:"/$org/settings/connections",params:{org:w.slug},children:"Connections"})})}),t.jsx(Q,{}),P&&t.jsxs(t.Fragment,{children:[t.jsx(J,{children:t.jsx(G,{asChild:!0,children:t.jsx(K,{to:"/$org/settings/connections/$appSlug",params:{org:w.slug,appSlug:vt(P)},search:{tab:"tools"},children:P.title})})}),t.jsx(Q,{})]}),t.jsx(J,{children:t.jsx(_e,{children:Fe})})]})}),fe=r.length>1&&t.jsxs(ve,{value:e,onValueChange:o,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:r.map(a=>t.jsx(ne,{value:a.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:a.icon,name:a.title,size:"xs",className:"shrink-0"}),a.title]})},a.id))})]}),Je=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:q&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([a,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[a,j.inputSchema?.required?.includes(a)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(ie,{className:"font-mono text-xs",value:Z(a)?d[a]??"":H[a]??"",onChange:v=>ee(a,v.target.value),placeholder:`Enter ${a} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:Z(a)?String(d[a]??""):"",onValueChange:v=>ee(a,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(ne,{value:"true",children:"true"}),t.jsx(ne,{value:"false",children:"false"})]})]}):t.jsx(me,{value:Z(a)?d[a]??"":H[a]??"",onChange:v=>ee(a,v.target.value),placeholder:`Enter ${a}...`})]},a)):j?.inputSchema&&!q?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(ie,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:a=>x(a.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:k?t.jsxs(F,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Be,children:[t.jsx(lt,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(F,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(Nt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(jt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(at,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),E&&t.jsx(ht,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:M==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Y("ui"),children:t.jsx(dt,{size:14})})}),t.jsx($e,{children:"Interactive view"})]}),t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:M==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Y("json"),children:t.jsx(be,{size:14})})}),t.jsx($e,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(xt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(gt,{className:"h-4 w-4"}),t.jsx(pt,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(ft,{className:"text-xs text-destructive",children:R})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:E&&M==="ui"&&_?t.jsx($.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(ut,{resourceURI:E,toolInfo:j?{tool:j}:void 0,toolInput:S??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:Ne.view.minHeight,maxHeight:Ne.view.maxHeight,client:_,onMessage:V,onUpdateModelContext:a=>A?.setAppContext(L,a),onTeardown:()=>A?.clearAppContext(L),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(Ct,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(F,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Ye.success("Copied to clipboard")},children:t.jsx(bt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(ue,{breadcrumb:Ve,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{icon:P?.icon||null,name:P?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[z.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):z.isLoading?t.jsx(X,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:z.isSuccess?"ready":z.isLoading?"connecting":"error"})]}),t.jsx(yt,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:fe})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),r.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),fe]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Je}),qe]})})]})})}function Ft(s){const e=O.c(10),{itemId:r,siblings:o,onBack:l}=s,[i,c]=$.useState(o[0]?.id??"");let d;e[0]!==i||e[1]!==o?(d=o.find(p=>p.id===i)?.id??o[0]?.id??"",e[0]=i,e[1]=o,e[2]=d):d=e[2];const n=d;if(!Me(n||void 0)||!n){let p;return e[3]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=p):p=e[3],p}let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=x):x=e[4];let m;return e[5]!==n||e[6]!==l||e[7]!==o||e[8]!==r?(m=t.jsx($.Suspense,{fallback:x,children:t.jsx(Ut,{toolName:r,connectionId:n,siblings:o,onSelectInstance:c,onBack:l})}),e[5]=n,e[6]=l,e[7]=o,e[8]=r,e[9]=m):m=e[9],m}function Vt(s){const e=O.c(21),{icon:r,illustration:o,title:l,description:i,buttonProps:c,buttonComponent:d,className:n,children:u}=s;let x;e[0]!==n?(x=je("flex flex-col items-center justify-center py-16 text-center",n),e[0]=n,e[1]=x):x=e[1];let m;e[2]!==r||e[3]!==o?(m=o?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:o}):r?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:r}):null,e[2]=r,e[3]=o,e[4]=m):m=e[4];let p;e[5]!==l?(p=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:l}),e[5]=l,e[6]=p):p=e[6];let f;e[7]!==i?(f=i&&t.jsx("div",{className:"text-sm text-muted-foreground",children:i}),e[7]=i,e[8]=f):f=e[8];let g;e[9]!==p||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[p,f]}),e[9]=p,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==d||e[13]!==c?(S=(d??c)&&t.jsx("div",{className:"mt-4",children:d??(c&&t.jsx(F,{size:"sm",className:je(c?.className),...c}))}),e[12]=d,e[13]=c,e[14]=S):S=e[14];let C;return e[15]!==u||e[16]!==x||e[17]!==m||e[18]!==g||e[19]!==S?(C=t.jsxs("div",{className:x,children:[m,g,S,u]}),e[15]=u,e[16]=x,e[17]=m,e[18]=g,e[19]=S,e[20]=C):C=e[20],C}const Jt={prompt:Lt};function qt(){const s=O.c(9),e=ke();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=r):r=s[0];const o=le(r),l=decodeURIComponent(o.itemId);let i;s[1]!==o.appSlug?(i={slug:o.appSlug},s[1]=o.appSlug,s[2]=i):i=s[2];const c=De(i);let d;s[3]!==e.history?(d=()=>{e.history.back()},s[3]=e.history,s[4]=d):d=s[4];const n=d,u=Ht;let x;return s[5]!==n||s[6]!==l||s[7]!==c?(x=t.jsx(Ft,{itemId:l,siblings:c,onBack:n,onUpdate:u}),s[5]=n,s[6]=l,s[7]=c,s[8]=x):x=s[8],x}async function Ht(s){return Promise.resolve()}function Wt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Kt(){const s=O.c(41),e=ke();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=r):r=s[0];const o=le(r),l=decodeURIComponent(o.collectionName),i=decodeURIComponent(o.itemId);let c;s[1]!==e.history?(c=()=>{e.history.back()},s[1]=e.history,s[2]=c):c=s[2];const d=c,{org:n}=re();let u;s[3]!==o.appSlug?(u={slug:o.appSlug},s[3]=o.appSlug,s[4]=u):u=s[4];const m=De(u)[0]??null,p=m?.id??"",f=p||"no-connection",g=p??null;let S;s[5]!==n.id||s[6]!==n.slug||s[7]!==g?(S={connectionId:g,orgId:n.id,orgSlug:n.slug},s[5]=n.id,s[6]=n.slug,s[7]=g,s[8]=S):S=s[8];const C=ae(S),R=Ee(f,l,C);let I;s[9]!==R||s[10]!==i?(I=async M=>{i&&await R.update.mutateAsync({id:i,data:M})},s[9]=R,s[10]=i,s[11]=I):I=s[11];const k=I;let T;s[12]!==l?(T=l?.toLowerCase(),s[12]=l,s[13]=T):T=s[13];const b=T,y=b&&Jt[b];let w;s[14]!==l?(w=Wt(l),s[14]=l,s[15]=w):w=s[15];const P=w;let N;s[16]!==n.slug?(N=t.jsx(J,{children:t.jsx(G,{asChild:!0,children:t.jsx(K,{to:"/$org/settings/connections",params:{org:n.slug},children:"Connections"})})}),s[16]=n.slug,s[17]=N):N=s[17];let A;s[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Q,{}),s[18]=A):A=s[18];let U;s[19]!==l||s[20]!==m||s[21]!==n.slug||s[22]!==o.appSlug?(U=m&&t.jsxs(t.Fragment,{children:[t.jsx(J,{children:t.jsx(G,{asChild:!0,children:t.jsx(K,{to:"/$org/settings/connections/$appSlug",params:{org:n.slug,appSlug:o.appSlug},search:{tab:l},children:m.title})})}),t.jsx(Q,{})]}),s[19]=l,s[20]=m,s[21]=n.slug,s[22]=o.appSlug,s[23]=U):U=s[23];let L;s[24]!==P?(L=t.jsx(J,{children:t.jsx(_e,{children:P})}),s[24]=P,s[25]=L):L=s[25];let _;s[26]!==U||s[27]!==L||s[28]!==N?(_=t.jsx(Oe,{children:t.jsxs(Re,{children:[N,A,U,L]})}),s[26]=U,s[27]=L,s[28]=N,s[29]=_):_=s[29];const z=_;if(y){let M;return s[30]!==y||s[31]!==d||s[32]!==k||s[33]!==i?(M=t.jsx(y,{itemId:i,onBack:d,onUpdate:k}),s[30]=y,s[31]=d,s[32]=k,s[33]=i,s[34]=M):M=s[34],M}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(kt,{size:36,className:"text-muted-foreground"}),s[35]=j):j=s[35];let E;s[36]!==d?(E=t.jsx(Vt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:d,children:"Go back"}}),s[36]=d,s[37]=E):E=s[37];let V;return s[38]!==z||s[39]!==E?(V=t.jsx(ue,{breadcrumb:z,children:E}),s[38]=z,s[39]=E,s[40]=V):V=s[40],V}function Gt(){const s=O.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const r=le(e);if(decodeURIComponent(r.collectionName)==="tools"){let c;return s[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(qt,{}),s[1]=c):c=s[1],c}let i;return s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Kt,{}),s[2]=i):i=s[2],i}function qn(){const s=O.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx($.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Gt,{})})}),s[0]=e):e=s[0],e}export{qn as default};
@@ -1,2 +0,0 @@
1
- import{c as Z,r as u,j as r,i as se,B as he,dZ as Mt,aM as Dt,aS as ie,d_ as Rt,d$ as Pt,e0 as Et,e1 as kt,bL as Tt,e2 as Ot,e3 as qe,aO as At,e4 as Lt,e5 as Ft,e6 as It,e7 as $t,e8 as _t,e9 as zt,ea as Wt,eb as Gt,ec as Kt,l as ae,n as Bt,t as W,K as $e}from"./index-CJs4YG_y.js";import{F as Vt,l as Ut}from"./index-C7hMTAFR.js";import{i as qt,aE as Ht,aF as Qt,aG as ue,aH as Xt,a9 as _e}from"./agent-icon-aq9fahDc.js";import{a as Jt}from"./Tool01-DWMuD8TU.js";import{s as Yt}from"./XClose-BKzJufOf.js";import{A as Zt}from"./automation-runs-COPPnkgJ.js";import{T as ze,a as We,b as Ge}from"./tooltip-B3Xu0WsU.js";import{f as en,a as tn,b as nn,c as rn,d as on,e as sn,A as an,g as ln}from"./alert-dialog-Ctmy7BUh.js";import{a as cn}from"./chat-context-BDLg73HV.js";import{u as dn}from"./shell-layout--i4S_y1a.js";import{az as fe,aA as Ke,aB as un}from"./index-CZ4WVu9U.js";import{a as fn,f as mn,D as pn,c as xn,d as hn,e as gn}from"./dialog-CzN8avhL.js";import{I as Be}from"./input-B0aQnFKg.js";import{t as vn}from"./ChevronDown-wJWuHepF.js";import{i as yn}from"./ChevronRight-BjCnVhIo.js";import{a as wn}from"./ZoomOut-0JxM3Azv.js";import{E as Cn,v as Ve,w as we,x as bn,y as jn,z as Nn,A as V,C as me,g as Ce,D as be,G as Sn,I as Mn,J as je,K as pe,M as Ne,N as Dn,O as Rn}from"./index-DRgsUNzQ.js";import"./AlertCircle-D3-xinjs.js";import"./ArrowUp-BDUzeu95.js";import"./Settings02-C124V1Xc.js";import"./XCircle-Cc0xPE71.js";import"./ArrowUpRight-C3_2cXeW.js";import"./ZapSquare-BaPWVQ37.js";import"./Users03-DgaczNXO.js";import"./Loading02-pQoaBc8-.js";import"./CheckCircle-C0j5UyGw.js";import"./Check-ocZ9qfNA.js";import"./ChevronUp-CJAHlnYn.js";import"./Circle-BTXhFI7S.js";import"./Stars02-Cb9neMzf.js";import"./Copy01-jaaWVisn.js";import"./DotsVertical-DtV5Fnad.js";import"./Globe01-BGRBT0T0.js";import"./Eye-wkJjtmH2.js";import"./FilterLines-DlRQ5-i5.js";import"./Star01-8j7H5tvN.js";import"./Globe04-DRckETTE.js";import"./SwitchHorizontal01-DENI6_WB.js";import"./HardDrive-B5qdyv_Y.js";import"./Key01-JqQROwH3.js";import"./LayoutLeft-j7RNB7Kr.js";import"./LinkExternal01-BOVv-eRf.js";import"./List-B14rXxdk.js";import"./Monitor01-p4fXdA6F.js";import"./Sun-f1oBLB5X.js";import"./Palette-Ba4t1bDZ.js";import"./Play-BRUiwJ0P.js";import"./Plus-CD0lb0Z8.js";import"./SearchLg-DomSsZ58.js";import"./SearchMd-BcwHGb7L.js";import"./Shield01-xKRFJ51X.js";import"./Stars01-D-3hvZEh.js";import"./Trash01-CWwPWzB6.js";import"./Upload01-mS32ZgCv.js";import"./User01-ByTCset0.js";import"./Users01-C_ia9S0h.js";import"./X-Dntrg8W3.js";import"./Zap-B8LjXKlt.js";import"./select-IQqkuyke.js";import"./useInfiniteQuery-GaTpQKsb.js";import"./use-infinite-scroll-DJF4Bq88.js";import"./use-connection-M87KpiDN.js";import"./use-collections-Q9vyVcYX.js";import"./use-mcp-client-BdcH2AAr.js";import"./constants-B72Xmt_K.js";import"./auth-Bj2JBDn0.js";import"./use-virtual-mcp-C8ctxJhX.js";import"./card-CFUuQQ1M.js";import"./sidebar-ciphtA4J.js";import"./use-mobile-CMaygZmb.js";import"./table-BtAQhFli.js";import"./empty-state-CcJIYptY.js";import"./use-members-D2ADy_SQ.js";import"./use-org-auth-client-Mq6_dHl5.js";import"./use-clock-tick-Dums0r6j.js";import"./use-automations-89YCo463.js";import"./studio-tools-C8sSWr27.js";import"./useSuspenseInfiniteQuery-BMdxCWpS.js";import"./badge-OQCPYGcq.js";import"./checkbox-BN0UcVyB.js";import"./command-B-zA3-tK.js";import"./index-C2LXo0VC.js";import"./popover-uE71epyh.js";import"./avatar-B58RA_6l.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-D3B6kIY8.js";import"./file-type-icon-GpEKUsdD.js";import"./tab-id-bb-jjgGv.js";import"./monaco-editor-DTLtlpMl.js";import"./delay-CnY5UFtP.js";import"./types-CDMEICfs.js";import"./hooks-BFJHOTt4.js";import"./decopilot-sse-pool-DSmv0lZi.js";import"./backoff-CrEUbyZT.js";import"./integration-icon-BrvrOk5H.js";import"./use-navigate-to-agent-BFFz8mSO.js";import"./reusable-new-chat-CouMjkYR.js";import"./use-mcp-prompts-DUZPd05e.js";import"./form-CGcaRTOA.js";import"./label-CAEQU6Kw.js";import"./autosend-DCYPaCYz.js";import"./use-ai-providers-Dy1XYekN.js";import"./use-decopilot-events-BCbLJTtF.js";import"./use-organization-settings-DqYIIvrP.js";import"./required-auth-layout-Mghc_qb4.js";import"./use-org-sso-Br7EvSJS.js";import"./drawer-HThdP5uB.js";import"./collection-search-IN2QsdDZ.js";import"./tabs-dnRCcMZW.js";import"./toggle-group-BWqkPPRz.js";import"./agent-capabilities-DSzooKp7.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CLhBW468.js";import"./use-registry-connections-BcjXByDN.js";import"./extract-connection-data-DSL7Y8A3.js";import"./collection-tabs-DEEctqY7.js";import"./textarea-BWkJXpt-.js";import"./connection-form-helpers-CYnQot14.js";import"./authenticate-and-persist-oauth-Dq14rQ5H.js";import"./mcp-oauth-WkAErzUM.js";import"./connect-desktop-dialog-DZCJkLGC.js";import"./select-model-_ueK9IUW.js";import"./skeleton-CtTBfwRk.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-B4wKOM9N.js";import"./dropdown-menu-BK5FaV5k.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-VC5seyB1.js";import"./toolbar-CJcI1ONf.js";import"./use-mcp-tools-BhZCZNca.js";import"./use-capability-vmeCrW9g.js";import"./tools-list-DEAw8kBy.js";import"./switch-WmIvORwZ.js";import"./use-debounced-autosave-Bt96Pub1.js";import"./index-C7WjeY76.js";import"./search-input-CfI7XQSB.js";import"./github-repo-picker-KQYx5bF_.js";import"./use-debounced-value-KutXID4s.js";import"./github-installations-D2vHSx02.js";import"./use-secrets-Bf4bTSxf.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./index-CylmZ2ca.js";import"./get-initials-D-f_fDFw.js";import"./calendar-DWypRNoG.js";import"./toolbar-icon-button-cVkvjja9.js";import"./use-file-configs-BJxRx26Q.js";import"./automation-list-row-B4UVZ48v.js";const Pn={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function En(s){const e=Z.c(51),{open:i,mode:a,initialName:c,parentLabel:m,isPending:x,onSubmit:p,onOpenChange:g}=s,M=c===void 0?"":c,d=x===void 0?!1:x,[h,y]=u.useState(M),[B,U]=u.useState(i),w=Pn[a];i!==B&&(U(i),i&&y(M));let I;e[0]!==d||e[1]!==g?(I=_=>{!_&&!d&&g(!1)},e[0]=d,e[1]=g,e[2]=I):I=e[2];const Q=I;let q;e[3]!==d||e[4]!==h||e[5]!==p?(q=async _=>{_.preventDefault();const K=h.trim();!K||d||await p(K)},e[3]=d,e[4]=h,e[5]=p,e[6]=q):q=e[6];const H=q;let $;e[7]!==w.title?($=r.jsx(fn,{children:w.title}),e[7]=w.title,e[8]=$):$=e[8];let T;e[9]!==w.description?(T=r.jsx(mn,{children:w.description}),e[9]=w.description,e[10]=T):T=e[10];let G;e[11]!==$||e[12]!==T?(G=r.jsxs(pn,{children:[$,T]}),e[11]=$,e[12]=T,e[13]=G):G=e[13];let O;e[14]!==m?(O=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),r.jsx(Be,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=m,e[15]=O):O=e[15];let A;e[16]===Symbol.for("react.memo_cache_sentinel")?(A=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=A):A=e[16];let R;e[17]===Symbol.for("react.memo_cache_sentinel")?(R=_=>y(_.target.value),e[17]=R):R=e[17];let P;e[18]!==w.placeholder||e[19]!==d||e[20]!==h?(P=r.jsxs("div",{className:"space-y-1.5",children:[A,r.jsx(Be,{id:"file-explorer-name",value:h,onChange:R,placeholder:w.placeholder,autoFocus:!0,disabled:d})]}),e[18]=w.placeholder,e[19]=d,e[20]=h,e[21]=P):P=e[21];let j;e[22]!==P||e[23]!==O?(j=r.jsxs("div",{className:"space-y-4 py-4",children:[O,P]}),e[22]=P,e[23]=O,e[24]=j):j=e[24];let N;e[25]!==g?(N=()=>g(!1),e[25]=g,e[26]=N):N=e[26];let E;e[27]!==d||e[28]!==N?(E=r.jsx(he,{type:"button",variant:"outline",onClick:N,disabled:d,children:"Cancel"}),e[27]=d,e[28]=N,e[29]=E):E=e[29];let k;e[30]!==d||e[31]!==h?(k=!h.trim()||d,e[30]=d,e[31]=h,e[32]=k):k=e[32];let C;e[33]!==w.submit||e[34]!==d?(C=d?r.jsxs(r.Fragment,{children:[r.jsx(se,{size:14,className:"animate-spin"}),"Saving…"]}):w.submit,e[33]=w.submit,e[34]=d,e[35]=C):C=e[35];let L;e[36]!==k||e[37]!==C?(L=r.jsx(he,{type:"submit",disabled:k,children:C}),e[36]=k,e[37]=C,e[38]=L):L=e[38];let b;e[39]!==E||e[40]!==L?(b=r.jsxs(xn,{children:[E,L]}),e[39]=E,e[40]=L,e[41]=b):b=e[41];let S;e[42]!==H||e[43]!==j||e[44]!==b||e[45]!==G?(S=r.jsx(hn,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:H,children:[G,j,b]})}),e[42]=H,e[43]=j,e[44]=b,e[45]=G,e[46]=S):S=e[46];let z;return e[47]!==Q||e[48]!==i||e[49]!==S?(z=r.jsx(gn,{open:i,onOpenChange:Q,children:S}),e[47]=Q,e[48]=i,e[49]=S,e[50]=z):z=e[50],z}var Me="ContextMenu",[kn]=At(Me,[qe]),F=qe(),[Tn,He]=kn(Me),Qe=s=>{const{__scopeContextMenu:e,children:i,onOpenChange:a,dir:c,modal:m=!0}=s,[x,p]=u.useState(!1),g=F(e),M=Tt(a),d=u.useCallback(h=>{p(h),M(h)},[M]);return r.jsx(Tn,{scope:e,open:x,onOpenChange:d,modal:m,children:r.jsx(Ot,{...g,dir:c,open:x,onOpenChange:d,modal:m,children:i})})};Qe.displayName=Me;var Xe="ContextMenuTrigger",Je=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,disabled:a=!1,...c}=s,m=He(Xe,i),x=F(i),p=u.useRef({x:0,y:0}),g=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...p.current})}),M=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(M.current),[]),h=y=>{p.current={x:y.clientX,y:y.clientY},m.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{a&&d()},[a,d]),r.jsxs(r.Fragment,{children:[r.jsx(Mt,{...x,virtualRef:g}),r.jsx(Dt.span,{"data-state":m.open?"open":"closed","data-disabled":a?"":void 0,...c,ref:e,style:{WebkitTouchCallout:"none",...s.style},onContextMenu:a?s.onContextMenu:ie(s.onContextMenu,y=>{d(),h(y),y.preventDefault()}),onPointerDown:a?s.onPointerDown:ie(s.onPointerDown,xe(y=>{d(),M.current=window.setTimeout(()=>h(y),700)})),onPointerMove:a?s.onPointerMove:ie(s.onPointerMove,xe(d)),onPointerCancel:a?s.onPointerCancel:ie(s.onPointerCancel,xe(d)),onPointerUp:a?s.onPointerUp:ie(s.onPointerUp,xe(d))})]})});Je.displayName=Xe;var On="ContextMenuPortal",Ye=s=>{const{__scopeContextMenu:e,...i}=s,a=F(e);return r.jsx(Et,{...a,...i})};Ye.displayName=On;var Ze="ContextMenuContent",et=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=He(Ze,i),m=F(i),x=u.useRef(!1);return r.jsx(kt,{...m,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:p=>{s.onCloseAutoFocus?.(p),!p.defaultPrevented&&x.current&&p.preventDefault(),x.current=!1},onInteractOutside:p=>{s.onInteractOutside?.(p),!p.defaultPrevented&&!c.modal&&(x.current=!0)},style:{...s.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});et.displayName=Ze;var An="ContextMenuGroup",Ln=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Lt,{...c,...a,ref:e})});Ln.displayName=An;var Fn="ContextMenuLabel",In=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Ft,{...c,...a,ref:e})});In.displayName=Fn;var $n="ContextMenuItem",tt=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Rt,{...c,...a,ref:e})});tt.displayName=$n;var _n="ContextMenuCheckboxItem",zn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(It,{...c,...a,ref:e})});zn.displayName=_n;var Wn="ContextMenuRadioGroup",Gn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx($t,{...c,...a,ref:e})});Gn.displayName=Wn;var Kn="ContextMenuRadioItem",Bn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(_t,{...c,...a,ref:e})});Bn.displayName=Kn;var Vn="ContextMenuItemIndicator",Un=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(zt,{...c,...a,ref:e})});Un.displayName=Vn;var qn="ContextMenuSeparator",nt=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Pt,{...c,...a,ref:e})});nt.displayName=qn;var Hn="ContextMenuArrow",Qn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Wt,{...c,...a,ref:e})});Qn.displayName=Hn;var Xn="ContextMenuSubTrigger",Jn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Gt,{...c,...a,ref:e})});Jn.displayName=Xn;var Yn="ContextMenuSubContent",Zn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Kt,{...c,...a,ref:e,style:{...s.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Zn.displayName=Yn;function xe(s){return e=>e.pointerType!=="mouse"?s(e):void 0}var er=Qe,tr=Je,nr=Ye,rr=et,or=tt,ir=nt;function sr(s){const e=Z.c(4);let i;e[0]!==s?({...i}=s,e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==i?(a=r.jsx(er,{"data-slot":"context-menu",...i}),e[2]=i,e[3]=a):a=e[3],a}function ar(s){const e=Z.c(4);let i;e[0]!==s?({...i}=s,e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==i?(a=r.jsx(tr,{"data-slot":"context-menu-trigger",...i}),e[2]=i,e[3]=a):a=e[3],a}function lr(s){const e=Z.c(8);let i,a;e[0]!==s?({className:i,...a}=s,e[0]=s,e[1]=i,e[2]=a):(i=e[1],a=e[2]);let c;e[3]!==i?(c=ae("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",i),e[3]=i,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(nr,{children:r.jsx(rr,{"data-slot":"context-menu-content",className:c,...a})}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}function te(s){const e=Z.c(12);let i,a,c,m;e[0]!==s?({className:i,inset:a,variant:m,...c}=s,e[0]=s,e[1]=i,e[2]=a,e[3]=c,e[4]=m):(i=e[1],a=e[2],c=e[3],m=e[4]);const x=m===void 0?"default":m;let p;e[5]!==i?(p=ae("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",i),e[5]=i,e[6]=p):p=e[6];let g;return e[7]!==a||e[8]!==c||e[9]!==p||e[10]!==x?(g=r.jsx(or,{"data-slot":"context-menu-item","data-inset":a,"data-variant":x,className:p,...c}),e[7]=a,e[8]=c,e[9]=p,e[10]=x,e[11]=g):g=e[11],g}function Ue(s){const e=Z.c(8);let i,a;e[0]!==s?({className:i,...a}=s,e[0]=s,e[1]=i,e[2]=a):(i=e[1],a=e[2]);let c;e[3]!==i?(c=ae("bg-border -mx-1 my-1 h-px",i),e[3]=i,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(ir,{"data-slot":"context-menu-separator",className:c,...a}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}const cr="#d9a441";function dr(s){const e=Z.c(45),{node:i,depth:a,isExpanded:c,isSelected:m,isLoading:x,fileVisual:p,onOpen:g,onSelect:M,onNewFile:d,onNewFolder:h,onCopyPath:y,onCopyRelativePath:B,onRename:U,onDelete:w}=s,I=x===void 0?!1:x,Q=i.kind==="directory",{Icon:q,color:H}=p,$=m&&"bg-accent";let T;e[0]!==$?(T=ae("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",$),e[0]=$,e[1]=T):T=e[1];const G=`${a*14+8}px`;let O;e[2]!==G?(O={paddingLeft:G},e[2]=G,e[3]=O):O=e[3];let A;e[4]!==g||e[5]!==M?(A=()=>{M(),g()},e[4]=g,e[5]=M,e[6]=A):A=e[6];let R;e[7]!==q||e[8]!==H||e[9]!==Q||e[10]!==c||e[11]!==I?(R=Q?r.jsxs(r.Fragment,{children:[I?r.jsx(se,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):c?r.jsx(vn,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(yn,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(wn,{size:16,className:"shrink-0",style:{color:cr}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(q,{size:16,className:"shrink-0",style:{color:H}})]}),e[7]=q,e[8]=H,e[9]=Q,e[10]=c,e[11]=I,e[12]=R):R=e[12];let P;e[13]!==i.name?(P=r.jsx("span",{className:"truncate",children:i.name}),e[13]=i.name,e[14]=P):P=e[14];let j;e[15]!==T||e[16]!==O||e[17]!==A||e[18]!==R||e[19]!==P?(j=r.jsx(ar,{asChild:!0,children:r.jsxs("button",{type:"button",className:T,style:O,onClick:A,children:[R,P]})}),e[15]=T,e[16]=O,e[17]=A,e[18]=R,e[19]=P,e[20]=j):j=e[20];let N;e[21]!==d?(N=r.jsx(te,{onSelect:d,children:"New File"}),e[21]=d,e[22]=N):N=e[22];let E;e[23]!==h?(E=r.jsx(te,{onSelect:h,children:"New Folder"}),e[23]=h,e[24]=E):E=e[24];let k;e[25]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Ue,{}),e[25]=k):k=e[25];let C;e[26]!==y?(C=r.jsx(te,{onSelect:y,children:"Copy Path"}),e[26]=y,e[27]=C):C=e[27];let L;e[28]!==B?(L=r.jsx(te,{onSelect:B,children:"Copy Relative Path"}),e[28]=B,e[29]=L):L=e[29];let b;e[30]===Symbol.for("react.memo_cache_sentinel")?(b=r.jsx(Ue,{}),e[30]=b):b=e[30];let S;e[31]!==U?(S=r.jsx(te,{onSelect:U,children:"Rename"}),e[31]=U,e[32]=S):S=e[32];let z;e[33]!==w?(z=r.jsx(te,{variant:"destructive",onSelect:w,children:"Delete"}),e[33]=w,e[34]=z):z=e[34];let _;e[35]!==N||e[36]!==E||e[37]!==C||e[38]!==L||e[39]!==S||e[40]!==z?(_=r.jsxs(lr,{className:"w-52",children:[N,E,k,C,L,b,S,z]}),e[35]=N,e[36]=E,e[37]=C,e[38]=L,e[39]=S,e[40]=z,e[41]=_):_=e[41];let K;return e[42]!==_||e[43]!==j?(K=r.jsxs(sr,{children:[j,_]}),e[42]=_,e[43]=j,e[44]=K):K=e[44],K}Ut.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function Se(s,e,i,a){return`/api/${s}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(i)}/${a}`}function ur(s){const e=V(s);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}const fr="#94a3b8";function mr(s){const e=s.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:ue,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:ue,color:"#d9a441"}:e.endsWith(".json")?{Icon:Xt,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:ue,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:ue,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:Jt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:_e,color:"#64748b"}:{Icon:_e,color:fr}}function ts({orgSlug:s,virtualMcpId:e,branch:i,openPath:a}){const[c,m]=u.useState({files:[],directories:[],truncated:!1}),{files:x,directories:p}=c,[g,M]=u.useState(new Set),[d,h]=u.useState(null),[y,B]=u.useState(null),[U,w]=u.useState([]),[I,Q]=u.useState(""),[q,H]=u.useState(!1),[$,T]=u.useState(!1),[,G]=u.useState(new Set),[O,A]=u.useState(new Set),R=u.useRef(0),P=u.useRef(null),j=u.useRef(new Set),N=u.useRef(new Map);function E(t){G(n=>{const o=typeof t=="function"?t(n):t;return j.current=o,o})}const[k,C]=u.useState(new Map),L=u.useRef(null),[b,S]=u.useState(null),{sendMessage:z}=cn(),{openSidePanel:_}=dn(),K=Bt(),[D,X]=u.useState(null),[J,ge]=u.useState(null),[ne,le]=u.useState(!1);async function re(t,n){const o=await fetch(Se(s,e,i,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const l=await o.json().catch(()=>({}));throw new Error(l.error??`Request failed (${o.status})`)}return o.json()}async function ce(){K.invalidateQueries({queryKey:Ke(s,e,i)})}function De(t,n){navigator.clipboard.writeText(n).then(()=>W.success(`${t} copied`),()=>W.error(`Failed to copy ${t.toLowerCase()}`))}function rt(t){const n=Dn(t);if(!n)return;const o=`${s}/${e}/${i}`;K.setQueryData($e.decofile(o),l=>{if(!l)return l;const{[n]:f,...v}=l;return v}),K.invalidateQueries({queryKey:$e.liveMeta(o)})}function ot(t){const n=t.kind==="file"?[t.path]:x.filter(o=>o.startsWith(".deco/blocks/")).map(o=>me(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)rt(o)}function it(t){const n=me(t);return U.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const l=k.get(o);return!!(l?.loaded&&l.editorValue!==l.savedContent)})}function Re(t){w(n=>n.map(o=>t(o)).filter(o=>o!==null)),h(n=>n&&t(n)),C(n=>{const o=new Map;for(const[l,f]of n){const v=t(l);v&&o.set(v,f)}return o}),B(n=>{if(!n)return n;const o=t(n.path);return o?o===n.path?n:{...n,path:o,name:o.split("/").pop()??o}:null})}function st(t){const n=me(t);B(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Re(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function at(t){if(!D)return;const n=pe(D.parentDir,t);if(Ne(n,x,p))throw new Error(`"${t}" already exists`);await re("write",{path:V(n),content:""}),await oe(),await ce(),X(null),ve(n)}async function lt(t){if(!D)return;const n=pe(D.parentDir,t);if(Ne(n,x,p))throw new Error(`"${t}" already exists`);const o=V(n);await re("mkdir",{path:o}),m(l=>({...l,directories:l.directories.includes(o)?l.directories:[...l.directories,o]})),await oe(),await ce(),X(null),M(l=>{const f=new Set(l);for(const v of we(n))f.add(v);return f.add(n),f}),B({name:t,path:n,kind:"directory",children:[]})}async function ct(t){if(!D)return;const n=D.node.path,o=je(n),l=pe(o,t);if(l===n){X(null);return}if(Ne(l,x,p))throw new Error(`"${t}" already exists`);await re("rename",{from:V(n),to:V(l)}),Re(f=>f===n?l:f.startsWith(`${n}/`)?pe(l,f.slice(n.length+1)):f),await oe(),await ce(),X(null)}async function dt(t){le(!0);try{await re("unlink",{path:V(t.path),recursive:t.kind==="directory"}),ot(t),st(t.path),await oe(),await ce(),ge(null),W.success(`Deleted "${t.name}"`)}catch(n){W.error(n instanceof Error?n.message:"Delete failed")}finally{le(!1)}}async function ut(t){const n=Mn(t);if(n){W.error(n);return}le(!0);try{D?.mode==="new-file"?(await at(t),W.success(`Created "${t}"`)):D?.mode==="new-folder"?(await lt(t),W.success(`Created folder "${t}"`)):D?.mode==="rename"&&(await ct(t),W.success(`Renamed to "${t}"`))}catch(o){W.error(o instanceof Error?o.message:"Operation failed")}finally{le(!1)}}const Pe=u.useRef(!1);Pe.current||(Pe.current=!0,P.current=oe());const[ft,mt]=u.useState(null);if(a&&a!==ft){mt(a);const t=a;queueMicrotask(()=>{ur(t)&&ve(t).catch(n=>{W.error(n instanceof Error?n.message:"Failed to open file")})})}async function Ee(t){const n=await re("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function ke(t,n,o){if(o!==R.current)return!1;let l=!1;return m(f=>{const v=n?Rn(f.files,f.directories,t,f.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return l=!!v.truncated,{files:v.files,directories:v.directories,truncated:l}}),l&&W.warning("File list truncated — some files may be hidden"),l}async function pt(t){const n=N.current.get(t);if(n)return n;const o=R.current,l=(async()=>{const f=await Ee({pattern:"**/*",path:V(t),limit:Ve}),v=ke(f,!0,o);return!v&&o===R.current&&E(Y=>{const de=new Set(Y);return de.add(t),de}),v})();N.current.set(t,l);try{return await l}finally{N.current.delete(t)}}async function Te(t){if(!be(t,j.current))return!1;A(n=>new Set(n).add(t));try{return await pt(t)}finally{A(n=>{const o=new Set(n);return o.delete(t),o})}}async function xt(t){const n=new Set(j.current);for(const o of we(t)){if(!be(o,n))continue;if(await Te(o))throw new Error("Folder listing truncated — expand again to load more");n.add(o)}}async function oe(){const t=++R.current;N.current.clear(),H(!0),E(new Set),M(new Set),A(new Set);try{const n=await Ee({pattern:"**/*",limit:Ve,maxDepth:Cn});ke(n,!1,t),T(!0)}catch{$&&W.error("Failed to refresh file tree")}finally{H(!1)}}async function Oe(t){if(!k.get(t)?.loaded){C(o=>{const l=new Map(o);return l.set(t,{savedContent:"",editorValue:"",loaded:!1}),l});try{const o=await fetch(Se(s,e,i,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:V(t),full:!0})});if(!o.ok)return;const l=await o.json(),f=Sn(l.content??"");C(v=>{const Y=new Map(v);return Y.set(t,{savedContent:f,editorValue:f,loaded:!0}),Y})}catch{}}}async function ht(t,n){try{const o=await fetch(Se(s,e,i,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:V(t),content:n})});if(!o.ok){fe("file save failed",{path:t,status:o.status});return}fe("file saved via sandbox /write",{path:t}),K.invalidateQueries({queryKey:Ke(s,e,i)});try{const l=await un(s,e,i);fe("git status after save",l)}catch(l){fe("git status after save failed",{path:t,error:l instanceof Error?l.message:String(l)})}C(l=>{const f=new Map(l),v=f.get(t);return v&&f.set(t,{...v,savedContent:n}),f})}catch{}}function gt(t){h(t),B({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),S(null),U.includes(t)||w(n=>[...n,t]),Oe(t)}function vt(t){w(n=>{const o=n.filter(l=>l!==t);return d===t&&h(o[o.length-1]??null),o}),C(n=>{const o=new Map(n);return o.delete(t),o})}function Ae(t){M(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function yt(t){if(be(t,j.current))try{if(await Te(t))return}catch(n){W.error(n instanceof Error?n.message:"Failed to load folder");return}Ae(t)}async function wt(t,n){if(n){Ae(t);return}await yt(t)}async function ve(t){await P.current,await xt(t);const n=we(t);M(o=>{const l=new Set(o);for(const f of n)l.add(f);return l}),gt(t)}function Ct(){return y?.kind==="directory"?y.path:y?.kind==="file"?je(y.path):d?je(d):"/"}function Le(t){const n=Ct();X({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const bt=bn(x,p),Fe=jn(bt,g),Ie=I?Fe.filter(t=>t.node.name.toLowerCase().includes(I.toLowerCase())):Fe,ee=d?k.get(d):null,jt=ee?.loaded&&ee.editorValue!==ee.savedContent,ye=J?it(J.path):[],Nt=(t,n)=>{L.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await ht(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),l=t.getModel();if(!o||!l||!d)return;const f=l.getValueInRange(o);S({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:f})})};function St(t){if(!b)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${b.filePath}\``,`**Lines:** ${b.lineStart}–${b.lineEnd}`];if(b.selectedCode){const o=Ce(b.filePath),l=b.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,l,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),_("chat"),z({parts:[{type:"text",text:n.join(`
2
- `)}]}),S(null)}return q&&!$?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(se,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[r.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[r.jsxs("div",{className:"relative min-w-0 flex-1",children:[r.jsx(qt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",value:I,onChange:t=>Q(t.target.value),placeholder:"Search files...","aria-label":"Search files",className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]}),r.jsxs(ze,{children:[r.jsx(We,{asChild:!0,children:r.jsx(he,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New file",onClick:()=>Le("new-file"),children:r.jsx(Ht,{size:14})})}),r.jsx(Ge,{side:"bottom",children:"New file"})]}),r.jsxs(ze,{children:[r.jsx(We,{asChild:!0,children:r.jsx(he,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New folder",onClick:()=>Le("new-folder"),children:r.jsx(Qt,{size:14})})}),r.jsx(Ge,{side:"bottom",children:"New folder"})]})]}),r.jsx(Zt,{className:"flex-1",children:r.jsxs("div",{className:"py-1",children:[Ie.map(t=>{const{node:n,depth:o}=t,l=n.kind==="directory",f=g.has(n.path),v=y?.path===n.path,Y=Nn(n.path,n.kind),de=l&&O.has(n.path);return r.jsx(dr,{node:n,depth:o,isExpanded:f,isSelected:v,isLoading:de,fileVisual:mr(n.name),onSelect:()=>B(n),onOpen:()=>{l?wt(n.path,f):ve(n.path)},onNewFile:()=>X({mode:"new-file",node:n,parentDir:Y}),onNewFolder:()=>X({mode:"new-folder",node:n,parentDir:Y}),onCopyPath:()=>De("Path",me(n.path)),onCopyRelativePath:()=>De("Relative path",V(n.path)),onRename:()=>X({mode:"rename",node:n,parentDir:Y}),onDelete:()=>ge(n)},n.path)}),$&&Ie.length===0&&r.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:I?`No files match "${I}"`:"No files found"})]})})]}),r.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[U.length>0&&r.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:U.map(t=>{const n=k.get(t),o=n?.loaded&&n.editorValue!==n.savedContent,l=d===t,f=t.split("/").pop()??t;return r.jsxs("div",{className:ae("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",l?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{h(t),Oe(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":l,children:[r.jsx("span",{className:"truncate max-w-32",children:f}),o&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),r.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:v=>{v.stopPropagation(),vt(t)},children:r.jsx(Yt,{size:12})})]},t)})}),b&&r.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:r.jsxs("form",{className:"flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:t=>{t.preventDefault();const o=t.currentTarget.elements.namedItem("askAiInput");o.value.trim()&&St(o.value)},children:[r.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:"Ask the AI...",className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&S(null)}}),r.jsx("button",{type:"submit",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity",title:"Send",children:r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[r.jsx("title",{children:"Send"}),r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),r.jsx("div",{className:"flex-1 overflow-hidden",children:d&&ee?.loaded?r.jsx(Vt,{language:Ce(d),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:ee.editorValue,path:d,onChange:t=>{const n=d;n&&C(o=>{const l=new Map(o),f=l.get(n);return f&&l.set(n,{...f,editorValue:t??""}),l})},onMount:Nt,loading:r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(se,{size:20,className:"animate-spin text-muted-foreground"})}),options:{fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,wordWrap:"on",minimap:{enabled:!1},padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}}},d):d&&!ee?.loaded?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(se,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:"Select a file to edit"})}),d&&r.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[r.jsx("span",{className:"truncate",children:d}),r.jsxs("span",{children:[jt?"Modified":"Saved"," ·"," ",Ce(d)]})]})]}),r.jsx(En,{open:D!==null,mode:D?.mode??"new-file",initialName:D?.mode==="rename"?D.node.name:"",parentLabel:D&&D.mode!=="rename"?D.parentDir==="/"?"/":V(D.parentDir):void 0,isPending:ne,onSubmit:ut,onOpenChange:t=>{!t&&!ne&&X(null)}}),r.jsx(en,{open:J!==null,onOpenChange:t=>{!t&&!ne&&ge(null)},children:r.jsxs(tn,{children:[r.jsxs(nn,{children:[r.jsxs(rn,{children:["Delete ",J?.kind==="directory"?"folder":"file","?"]}),r.jsxs(on,{children:["This will permanently delete"," ",r.jsx("span",{className:"font-mono",children:J?.name}),J?.kind==="directory"?" and everything inside it.":".",ye.length>0&&r.jsxs(r.Fragment,{children:[" ",ye.length===1?"One open file has unsaved changes that will be lost.":`${ye.length} open files have unsaved changes that will be lost.`]})]})]}),r.jsxs(sn,{children:[r.jsx(an,{disabled:ne,children:"Cancel"}),r.jsx(ln,{disabled:ne||!J,onClick:t=>{t.preventDefault(),J&&dt(J)},children:"Delete"})]})]})})]})}export{ts as FileExplorer};
@@ -1 +0,0 @@
1
- import{c as it,r as b,j as e,i as rt}from"./index-CJs4YG_y.js";import{m as mt,o as pt,p as st,q as at}from"./sidebar-ciphtA4J.js";import{A as nt}from"./automation-runs-COPPnkgJ.js";import{r as lt,c as ct,u as dt,a as St,i as ft,f as ut,d as vt,P as ht,S as gt}from"./seo-save-FLLGxIUK.js";import{A as xt}from"./index-CZ4WVu9U.js";import"./LayoutLeft-j7RNB7Kr.js";import"./use-mobile-CMaygZmb.js";import"./X-Dntrg8W3.js";import"./tooltip-B3Xu0WsU.js";import"./select-IQqkuyke.js";import"./Check-ocZ9qfNA.js";import"./ChevronDown-wJWuHepF.js";import"./ChevronUp-CJAHlnYn.js";import"./useInfiniteQuery-GaTpQKsb.js";import"./use-infinite-scroll-DJF4Bq88.js";import"./use-connection-M87KpiDN.js";import"./use-collections-Q9vyVcYX.js";import"./use-mcp-client-BdcH2AAr.js";import"./constants-B72Xmt_K.js";import"./auth-Bj2JBDn0.js";import"./use-virtual-mcp-C8ctxJhX.js";import"./card-CFUuQQ1M.js";import"./table-BtAQhFli.js";import"./empty-state-CcJIYptY.js";import"./use-members-D2ADy_SQ.js";import"./use-org-auth-client-Mq6_dHl5.js";import"./use-clock-tick-Dums0r6j.js";import"./AlertCircle-D3-xinjs.js";import"./CheckCircle-C0j5UyGw.js";import"./Circle-BTXhFI7S.js";import"./agent-icon-aq9fahDc.js";import"./Tool01-DWMuD8TU.js";import"./ArrowUp-BDUzeu95.js";import"./Settings02-C124V1Xc.js";import"./XCircle-Cc0xPE71.js";import"./ArrowUpRight-C3_2cXeW.js";import"./ZapSquare-BaPWVQ37.js";import"./Users03-DgaczNXO.js";import"./Loading02-pQoaBc8-.js";import"./ChevronRight-BjCnVhIo.js";import"./Stars02-Cb9neMzf.js";import"./Copy01-jaaWVisn.js";import"./ZoomOut-0JxM3Azv.js";import"./DotsVertical-DtV5Fnad.js";import"./Globe01-BGRBT0T0.js";import"./Eye-wkJjtmH2.js";import"./FilterLines-DlRQ5-i5.js";import"./Star01-8j7H5tvN.js";import"./Globe04-DRckETTE.js";import"./SwitchHorizontal01-DENI6_WB.js";import"./HardDrive-B5qdyv_Y.js";import"./Key01-JqQROwH3.js";import"./LinkExternal01-BOVv-eRf.js";import"./List-B14rXxdk.js";import"./Monitor01-p4fXdA6F.js";import"./Sun-f1oBLB5X.js";import"./Palette-Ba4t1bDZ.js";import"./Play-BRUiwJ0P.js";import"./Plus-CD0lb0Z8.js";import"./SearchLg-DomSsZ58.js";import"./SearchMd-BcwHGb7L.js";import"./Shield01-xKRFJ51X.js";import"./Stars01-D-3hvZEh.js";import"./Trash01-CWwPWzB6.js";import"./Upload01-mS32ZgCv.js";import"./User01-ByTCset0.js";import"./Users01-C_ia9S0h.js";import"./XClose-BKzJufOf.js";import"./Zap-B8LjXKlt.js";import"./use-automations-89YCo463.js";import"./studio-tools-C8sSWr27.js";import"./useSuspenseInfiniteQuery-BMdxCWpS.js";import"./badge-OQCPYGcq.js";import"./checkbox-BN0UcVyB.js";import"./command-B-zA3-tK.js";import"./index-C2LXo0VC.js";import"./dialog-CzN8avhL.js";import"./popover-uE71epyh.js";import"./avatar-B58RA_6l.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-D3B6kIY8.js";import"./file-type-icon-GpEKUsdD.js";import"./tab-id-bb-jjgGv.js";import"./monaco-editor-DTLtlpMl.js";import"./index-C7hMTAFR.js";import"./chat-context-BDLg73HV.js";import"./autosend-DCYPaCYz.js";import"./hooks-BFJHOTt4.js";import"./decopilot-sse-pool-DSmv0lZi.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-Dy1XYekN.js";import"./use-decopilot-events-BCbLJTtF.js";import"./use-organization-settings-DqYIIvrP.js";import"./types-CDMEICfs.js";import"./shell-layout--i4S_y1a.js";import"./alert-dialog-Ctmy7BUh.js";import"./required-auth-layout-Mghc_qb4.js";import"./use-org-sso-Br7EvSJS.js";import"./integration-icon-BrvrOk5H.js";import"./use-navigate-to-agent-BFFz8mSO.js";import"./reusable-new-chat-CouMjkYR.js";import"./use-mcp-prompts-DUZPd05e.js";import"./form-CGcaRTOA.js";import"./label-CAEQU6Kw.js";import"./input-B0aQnFKg.js";import"./switch-WmIvORwZ.js";import"./drawer-HThdP5uB.js";import"./collection-search-IN2QsdDZ.js";import"./tabs-dnRCcMZW.js";import"./toggle-group-BWqkPPRz.js";import"./agent-capabilities-DSzooKp7.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CLhBW468.js";import"./use-registry-connections-BcjXByDN.js";import"./extract-connection-data-DSL7Y8A3.js";import"./collection-tabs-DEEctqY7.js";import"./textarea-BWkJXpt-.js";import"./connection-form-helpers-CYnQot14.js";import"./authenticate-and-persist-oauth-Dq14rQ5H.js";import"./mcp-oauth-WkAErzUM.js";import"./connect-desktop-dialog-DZCJkLGC.js";import"./select-model-_ueK9IUW.js";import"./skeleton-CtTBfwRk.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-B4wKOM9N.js";import"./dropdown-menu-BK5FaV5k.js";import"./index-DRgsUNzQ.js";import"./toolbar-CJcI1ONf.js";import"./use-debounced-value-KutXID4s.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-VC5seyB1.js";import"./use-mcp-tools-BhZCZNca.js";import"./use-capability-vmeCrW9g.js";import"./tools-list-DEAw8kBy.js";import"./use-debounced-autosave-Bt96Pub1.js";import"./index-C7WjeY76.js";import"./search-input-CfI7XQSB.js";import"./github-repo-picker-KQYx5bF_.js";import"./github-installations-D2vHSx02.js";import"./use-secrets-Bf4bTSxf.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./index-CylmZ2ca.js";import"./get-initials-D-f_fDFw.js";import"./calendar-DWypRNoG.js";import"./toolbar-icon-button-cVkvjja9.js";import"./use-file-configs-BJxRx26Q.js";import"./automation-list-row-B4UVZ48v.js";function li(u){const t=it.c(46),{open:N,onOpenChange:P,orgSlug:Q,virtualMcpId:U,branch:W,decofile:G,meta:s,target:m,onSaved:X}=u,o=lt(G,m,s),k=m.kind==="site"?"site":m.pageKey,[Y,Z]=b.useState(k),[tt,i]=b.useState(null),[J,g]=b.useState(void 0),[x,y]=b.useState(0);Y!==k&&(Z(k),i(null),g(void 0),y(wt));const{persistSeo:a,persistRawSeo:I,flush:K,isPending:D}=ct({orgSlug:Q,virtualMcpId:U,branch:W,target:m,resolved:o,onSaved:X}),w=m.kind==="page",ot=w?o?.rawSeoData:void 0,v=J!==void 0?J:ot,et=w?dt(v)??void 0:void 0,h=tt??et??o?.seoData??{},p=o?St(h,o):null,n=p&&(!w||ft(v))?xt(p,s):null,A=m.kind==="page"?ut(G,s)?.seoData??void 0:void 0;let j;t[0]!==s?(j=vt(s),t[0]=s,t[1]=j):j=t[1];const _=j;let R;t[2]!==a||t[3]!==o||t[4]!==i?(R=r=>{if(!o)return;const L=r;i(L),a(L)},t[2]=a,t[3]=o,t[4]=i,t[5]=R):R=t[5];const M=R;let F;t[6]!==K||t[7]!==P?(F=r=>{r||K(),P(r)},t[6]=K,t[7]=P,t[8]=F):F=t[8];const V=F,q=m.kind==="site"?"Site SEO":"Page SEO",T=w&&o,z=m.kind==="site"&&o&&n,B=m.kind==="site"?"No site-level SEO block found.":o?"SEO schema not found for this page.":"Could not load page SEO.";let C;t[9]!==i?(C=()=>i(null),t[9]=i,t[10]=C):C=t[10];const H=C;let O;t[11]!==y?(O=()=>y(yt),t[11]=y,t[12]=O):O=t[12];const $=O;let l;t[13]!==q?(l=e.jsx(mt,{className:"text-sm font-semibold",children:q}),t[13]=q,t[14]=l):l=t[14];let c;t[15]!==D?(c=D&&e.jsx(rt,{size:14,className:"animate-spin text-muted-foreground"}),t[15]=D,t[16]=c):c=t[16];let d;t[17]!==l||t[18]!==c?(d=e.jsxs(pt,{className:"px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[l,c]}),t[17]=l,t[18]=c,t[19]=d):d=t[19];let S;t[20]!==p||t[21]!==$||t[22]!==H||t[23]!==_||t[24]!==v||t[25]!==h||t[26]!==B||t[27]!==x||t[28]!==M||t[29]!==I||t[30]!==a||t[31]!==o||t[32]!==n||t[33]!==i||t[34]!==g||t[35]!==T||t[36]!==z||t[37]!==A?(S=!o||!T&&!z?e.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:B}):e.jsx(nt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:e.jsx("div",{className:"px-6 py-4",children:e.jsx("div",{className:"mx-auto max-w-sm",children:T?e.jsx(ht,{rawSeo:v,innerSeo:h,defaultResolveType:_,seoSchema:n,activeResolveType:p,seoTypeOptions:o.seoTypeOptions,formResetKey:x,siteDefaultSeo:A,onPersistRaw:r=>{g(r),I(r)},onInnerChange:r=>{i(r),a(r)},onClearForm:H,onBumpFormKey:$}):n&&p&&e.jsx(gt,{schema:n,resolveType:p,value:h,formResetKey:x,onChange:M})})})}),t[20]=p,t[21]=$,t[22]=H,t[23]=_,t[24]=v,t[25]=h,t[26]=B,t[27]=x,t[28]=M,t[29]=I,t[30]=a,t[31]=o,t[32]=n,t[33]=i,t[34]=g,t[35]=T,t[36]=z,t[37]=A,t[38]=S):S=t[38];let f;t[39]!==d||t[40]!==S?(f=e.jsxs(st,{side:"right",className:"w-[400px] sm:max-w-[440px] p-0 gap-0",children:[d,S]}),t[39]=d,t[40]=S,t[41]=f):f=t[41];let E;return t[42]!==V||t[43]!==N||t[44]!==f?(E=e.jsx(at,{open:N,onOpenChange:V,children:f}),t[42]=V,t[43]=N,t[44]=f,t[45]=E):E=t[45],E}function yt(u){return u+1}function wt(u){return u+1}export{li as SeoSheet};
@@ -1 +0,0 @@
1
- import{c as J,j as t,B as Z}from"./index-CJs4YG_y.js";import{n as ee}from"./LinkExternal01-BOVv-eRf.js";import{aI as te,a as oe}from"./agent-icon-aq9fahDc.js";import{I as q}from"./input-B0aQnFKg.js";import{L as H}from"./label-CAEQU6Kw.js";import{a1 as ie}from"./automation-runs-COPPnkgJ.js";import{b as Q,c as se,T as W,a as le}from"./tabs-dnRCcMZW.js";import{T as re}from"./textarea-BWkJXpt-.js";import{aH as ae,aI as me,aG as pe,aJ as ne,aK as ce,aL as de,aM as fe}from"./index-CZ4WVu9U.js";import{b as ue,a as xe,B as he}from"./block-document-LDG191Ua.js";import{u as ge,s as F,E as ve,R as ye,A as je}from"./primitives-CFiyHFxY.js";import"./AlertCircle-D3-xinjs.js";import"./Tool01-DWMuD8TU.js";import"./ArrowUp-BDUzeu95.js";import"./Settings02-C124V1Xc.js";import"./XCircle-Cc0xPE71.js";import"./ArrowUpRight-C3_2cXeW.js";import"./ZapSquare-BaPWVQ37.js";import"./Users03-DgaczNXO.js";import"./Loading02-pQoaBc8-.js";import"./CheckCircle-C0j5UyGw.js";import"./Check-ocZ9qfNA.js";import"./ChevronDown-wJWuHepF.js";import"./ChevronRight-BjCnVhIo.js";import"./ChevronUp-CJAHlnYn.js";import"./Circle-BTXhFI7S.js";import"./Stars02-Cb9neMzf.js";import"./Copy01-jaaWVisn.js";import"./ZoomOut-0JxM3Azv.js";import"./DotsVertical-DtV5Fnad.js";import"./Globe01-BGRBT0T0.js";import"./Eye-wkJjtmH2.js";import"./FilterLines-DlRQ5-i5.js";import"./Star01-8j7H5tvN.js";import"./Globe04-DRckETTE.js";import"./SwitchHorizontal01-DENI6_WB.js";import"./HardDrive-B5qdyv_Y.js";import"./Key01-JqQROwH3.js";import"./LayoutLeft-j7RNB7Kr.js";import"./List-B14rXxdk.js";import"./Monitor01-p4fXdA6F.js";import"./Sun-f1oBLB5X.js";import"./Palette-Ba4t1bDZ.js";import"./Play-BRUiwJ0P.js";import"./Plus-CD0lb0Z8.js";import"./SearchLg-DomSsZ58.js";import"./SearchMd-BcwHGb7L.js";import"./Shield01-xKRFJ51X.js";import"./Stars01-D-3hvZEh.js";import"./Trash01-CWwPWzB6.js";import"./Upload01-mS32ZgCv.js";import"./User01-ByTCset0.js";import"./Users01-C_ia9S0h.js";import"./XClose-BKzJufOf.js";import"./X-Dntrg8W3.js";import"./Zap-B8LjXKlt.js";import"./select-IQqkuyke.js";import"./tooltip-B3Xu0WsU.js";import"./useInfiniteQuery-GaTpQKsb.js";import"./use-infinite-scroll-DJF4Bq88.js";import"./use-connection-M87KpiDN.js";import"./use-collections-Q9vyVcYX.js";import"./use-mcp-client-BdcH2AAr.js";import"./constants-B72Xmt_K.js";import"./auth-Bj2JBDn0.js";import"./use-virtual-mcp-C8ctxJhX.js";import"./card-CFUuQQ1M.js";import"./sidebar-ciphtA4J.js";import"./use-mobile-CMaygZmb.js";import"./table-BtAQhFli.js";import"./empty-state-CcJIYptY.js";import"./use-members-D2ADy_SQ.js";import"./use-org-auth-client-Mq6_dHl5.js";import"./use-clock-tick-Dums0r6j.js";import"./use-automations-89YCo463.js";import"./studio-tools-C8sSWr27.js";import"./useSuspenseInfiniteQuery-BMdxCWpS.js";import"./badge-OQCPYGcq.js";import"./checkbox-BN0UcVyB.js";import"./command-B-zA3-tK.js";import"./index-C2LXo0VC.js";import"./dialog-CzN8avhL.js";import"./popover-uE71epyh.js";import"./avatar-B58RA_6l.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-D3B6kIY8.js";import"./file-type-icon-GpEKUsdD.js";import"./tab-id-bb-jjgGv.js";import"./monaco-editor-DTLtlpMl.js";import"./index-C7hMTAFR.js";import"./chat-context-BDLg73HV.js";import"./autosend-DCYPaCYz.js";import"./hooks-BFJHOTt4.js";import"./decopilot-sse-pool-DSmv0lZi.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-Dy1XYekN.js";import"./use-decopilot-events-BCbLJTtF.js";import"./use-organization-settings-DqYIIvrP.js";import"./types-CDMEICfs.js";import"./shell-layout--i4S_y1a.js";import"./alert-dialog-Ctmy7BUh.js";import"./required-auth-layout-Mghc_qb4.js";import"./use-org-sso-Br7EvSJS.js";import"./integration-icon-BrvrOk5H.js";import"./use-navigate-to-agent-BFFz8mSO.js";import"./reusable-new-chat-CouMjkYR.js";import"./use-mcp-prompts-DUZPd05e.js";import"./form-CGcaRTOA.js";import"./drawer-HThdP5uB.js";import"./collection-search-IN2QsdDZ.js";import"./toggle-group-BWqkPPRz.js";import"./agent-capabilities-DSzooKp7.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CLhBW468.js";import"./use-registry-connections-BcjXByDN.js";import"./extract-connection-data-DSL7Y8A3.js";import"./collection-tabs-DEEctqY7.js";import"./connection-form-helpers-CYnQot14.js";import"./authenticate-and-persist-oauth-Dq14rQ5H.js";import"./mcp-oauth-WkAErzUM.js";import"./connect-desktop-dialog-DZCJkLGC.js";import"./select-model-_ueK9IUW.js";import"./skeleton-CtTBfwRk.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-B4wKOM9N.js";import"./dropdown-menu-BK5FaV5k.js";import"./index-DRgsUNzQ.js";import"./toolbar-CJcI1ONf.js";import"./use-debounced-value-KutXID4s.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-VC5seyB1.js";import"./use-mcp-tools-BhZCZNca.js";import"./use-capability-vmeCrW9g.js";import"./tools-list-DEAw8kBy.js";import"./switch-WmIvORwZ.js";import"./use-debounced-autosave-Bt96Pub1.js";import"./index-C7WjeY76.js";import"./search-input-CfI7XQSB.js";import"./github-repo-picker-KQYx5bF_.js";import"./github-installations-D2vHSx02.js";import"./use-secrets-Bf4bTSxf.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./index-CylmZ2ca.js";import"./get-initials-D-f_fDFw.js";import"./calendar-DWypRNoG.js";import"./toolbar-icon-button-cVkvjja9.js";import"./use-file-configs-BJxRx26Q.js";import"./automation-list-row-B4UVZ48v.js";function be(A){return Array.isArray(A)?A.map(e=>({key:F(e?.key),value:F(e?.value)})):[]}function fi(A){const e=J.c(66),{orgSlug:i,virtualMcpId:d,branch:o,blockKey:l,block:p,decofile:m,meta:u,previewBaseUrl:x}=A;let y;e[0]!==o||e[1]!==i||e[2]!==d?(y={orgSlug:i,virtualMcpId:d,branch:o},e[0]=o,e[1]=i,e[2]=d,e[3]=y):y=e[3];const s=ae(y);let n;e[4]!==p?(n=me(p,"posts"),e[4]=p,e[5]=n):n=e[5];const j=n;let b;e[6]!==l||e[7]!==s?(b=T=>{s.mutate({blockKey:l,data:ne(l,"posts",T)})},e[6]=l,e[7]=s,e[8]=b):b=e[8];const[r,_]=ge(j,b);let C;e[9]!==r||e[10]!==_?(C=(T,Y)=>_({...r,[T]:Y}),e[9]=r,e[10]=_,e[11]=C):C=e[11];const h=C;let S;e[12]!==m||e[13]!==r||e[14]!==x?(S=ue({decofile:m,post:r,previewBaseUrl:x}),e[12]=m,e[13]=r,e[14]=x,e[15]=S):S=e[15];const f=S;let a;e[16]!==r.title?(a=F(r.title)||"Untitled post",e[16]=r.title,e[17]=a):a=e[17];let c;e[18]!==a?(c=t.jsx("span",{className:"truncate text-sm font-medium",children:a}),e[18]=a,e[19]=c):c=e[19];let g;e[20]!==s.isError||e[21]!==s.isPending?(g=t.jsx(pe,{isPending:s.isPending,isError:s.isError}),e[20]=s.isError,e[21]=s.isPending,e[22]=g):g=e[22];const k=!f,P=f?"Open the post preview in a new tab":"Set the post slug (and its category) plus the blog app's pageSlug to preview";let N;e[23]!==f?(N=()=>{f&&window.open(f,"_blank","noopener,noreferrer")},e[23]=f,e[24]=N):N=e[24];let B;e[25]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx(ee,{size:14}),e[25]=B):B=e[25];let w;e[26]!==P||e[27]!==N||e[28]!==k?(w=t.jsxs(Z,{type:"button",variant:"outline",size:"sm",disabled:k,title:P,onClick:N,children:[B,"See preview"]}),e[26]=P,e[27]=N,e[28]=k,e[29]=w):w=e[29];let E;e[30]!==w||e[31]!==g?(E=t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[g,w]}),e[30]=w,e[31]=g,e[32]=E):E=e[32];let v;e[33]!==E||e[34]!==c?(v=t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[c,E]}),e[33]=E,e[34]=c,e[35]=v):v=e[35];let L;e[36]!==r.title?(L=F(r.title),e[36]=r.title,e[37]=L):L=e[37];let I;e[38]!==h?(I=T=>h("title",T),e[38]=h,e[39]=I):I=e[39];let R;e[40]!==L||e[41]!==I?(R=t.jsx(ve,{value:L,onChange:I,placeholder:"Post title",className:"py-1 text-4xl font-bold text-foreground"}),e[40]=L,e[41]=I,e[42]=R):R=e[42];let K;e[43]===Symbol.for("react.memo_cache_sentinel")?(K=t.jsxs(Q,{value:"content",children:[t.jsx(te,{}),"Content"]}),e[43]=K):K=e[43];let O;e[44]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs(se,{children:[K,t.jsxs(Q,{value:"settings",children:[t.jsx(oe,{}),"Settings"]})]}),e[44]=O):O=e[44];let U;e[45]!==r.sections?(U=xe(r.sections),e[45]=r.sections,e[46]=U):U=e[46];let $;e[47]!==h?($=T=>h("sections",T),e[47]=h,e[48]=$):$=e[48];let M;e[49]!==u||e[50]!==U||e[51]!==$?(M=t.jsx(W,{value:"content",children:t.jsx("div",{className:"rounded-xl border bg-card p-8 shadow-sm",children:t.jsx(he,{value:U,onChange:$,meta:u,emptyMessage:"This post has no content yet. Use ⊕ to add your first block."})})}),e[49]=u,e[50]=U,e[51]=$,e[52]=M):M=e[52];let D;e[53]!==m||e[54]!==r||e[55]!==h?(D=t.jsx(W,{value:"settings",children:t.jsx("div",{className:"rounded-xl border bg-card p-6 shadow-sm",children:t.jsx(Ce,{post:r,decofile:m,onChange:h})})}),e[53]=m,e[54]=r,e[55]=h,e[56]=D):D=e[56];let V;e[57]!==M||e[58]!==D?(V=t.jsxs(le,{defaultValue:"content",className:"mt-6 gap-4",children:[O,M,D]}),e[57]=M,e[58]=D,e[59]=V):V=e[59];let z;e[60]!==R||e[61]!==V?(z=t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[R,V]})}),e[60]=R,e[61]=V,e[62]=z):z=e[62];let G;return e[63]!==v||e[64]!==z?(G=t.jsxs("div",{className:"flex h-full flex-col",children:[v,z]}),e[63]=v,e[64]=z,e[65]=G):G=e[65],G}function Ce(A){const e=J.c(59),{post:i,decofile:d,onChange:o}=A;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(H,{htmlFor:"post-excerpt",children:"Excerpt"}),e[0]=l):l=e[0];let p;e[1]!==i.excerpt?(p=F(i.excerpt),e[1]=i.excerpt,e[2]=p):p=e[2];let m;e[3]!==o?(m=v=>o("excerpt",v.target.value),e[3]=o,e[4]=m):m=e[4];let u;e[5]!==p||e[6]!==m?(u=t.jsxs("div",{className:"space-y-2",children:[l,t.jsx(re,{id:"post-excerpt",value:p,onChange:m,rows:2})]}),e[5]=p,e[6]=m,e[7]=u):u=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(H,{htmlFor:"post-slug",children:"Slug"}),e[8]=x):x=e[8];let y;e[9]!==i.slug?(y=F(i.slug),e[9]=i.slug,e[10]=y):y=e[10];let s;e[11]!==o?(s=v=>o("slug",v.target.value),e[11]=o,e[12]=s):s=e[12];let n;e[13]!==y||e[14]!==s?(n=t.jsxs("div",{className:"space-y-2",children:[x,t.jsx(q,{id:"post-slug",value:y,onChange:s,placeholder:"my-post",className:"h-10"})]}),e[13]=y,e[14]=s,e[15]=n):n=e[15];let j;e[16]===Symbol.for("react.memo_cache_sentinel")?(j={type:"string",format:"date",title:"Date"},e[16]=j):j=e[16];let b;e[17]!==i.date?(b=F(i.date),e[17]=i.date,e[18]=b):b=e[18];let r;e[19]!==o?(r=v=>o("date",v),e[19]=o,e[20]=r):r=e[20];let _;e[21]!==b||e[22]!==r?(_=t.jsx(fe,{schema:j,value:b,onChange:r,path:"post-date",label:"Date"}),e[21]=b,e[22]=r,e[23]=_):_=e[23];let C;e[24]!==_||e[25]!==n?(C=t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n,_]}),e[24]=_,e[25]=n,e[26]=C):C=e[26];let h;e[27]===Symbol.for("react.memo_cache_sentinel")?(h={type:"string",format:"image-uri",title:"Cover image"},e[27]=h):h=e[27];let S;e[28]!==o?(S=v=>o("image",v),e[28]=o,e[29]=S):S=e[29];let f;e[30]!==i.image||e[31]!==S?(f=t.jsx(ce,{schema:h,value:i.image,onChange:S,path:"post-image",label:"Cover image"}),e[30]=i.image,e[31]=S,e[32]=f):f=e[32];let a;e[33]===Symbol.for("react.memo_cache_sentinel")?(a=["email"],e[33]=a):a=e[33];let c;e[34]!==o?(c=v=>o("authors",v),e[34]=o,e[35]=c):c=e[35];let g;e[36]!==d||e[37]!==i.authors||e[38]!==c?(g=t.jsx(X,{label:"Authors",decofile:d,kind:"authors",valueField:"email",extraFields:a,selected:i.authors,onChange:c}),e[36]=d,e[37]=i.authors,e[38]=c,e[39]=g):g=e[39];let k;e[40]===Symbol.for("react.memo_cache_sentinel")?(k=["slug"],e[40]=k):k=e[40];let P;e[41]!==o?(P=v=>o("categories",v),e[41]=o,e[42]=P):P=e[42];let N;e[43]!==d||e[44]!==i.categories||e[45]!==P?(N=t.jsx(X,{label:"Categories",decofile:d,kind:"categories",valueField:"slug",extraFields:k,selected:i.categories,onChange:P}),e[43]=d,e[44]=i.categories,e[45]=P,e[46]=N):N=e[46];let B;e[47]!==o?(B=v=>o("extraProps",v),e[47]=o,e[48]=B):B=e[48];let w;e[49]!==i.extraProps||e[50]!==B?(w=t.jsx(ke,{value:i.extraProps,onChange:B}),e[49]=i.extraProps,e[50]=B,e[51]=w):w=e[51];let E;return e[52]!==C||e[53]!==f||e[54]!==g||e[55]!==N||e[56]!==w||e[57]!==u?(E=t.jsxs("div",{className:"space-y-5",children:[u,C,f,g,N,w]}),e[52]=C,e[53]=f,e[54]=g,e[55]=N,e[56]=w,e[57]=u,e[58]=E):E=e[58],E}function ke(A){const e=J.c(15),{value:i,onChange:d}=A;let o,l,p,m;if(e[0]!==d||e[1]!==i){o=be(i);const y=(s,n)=>d(o.map((j,b)=>b===s?{...j,...n}:j));l="space-y-2",e[6]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(H,{children:"Extra props"}),e[6]=p):p=e[6],m=o.length>0&&t.jsx("ul",{className:"space-y-2",children:o.map((s,n)=>t.jsxs("li",{className:"group/item flex items-center gap-2",children:[t.jsx(q,{value:s.key,onChange:j=>y(n,{key:j.target.value}),placeholder:"key",className:"h-9 flex-1"}),t.jsx(q,{value:s.value,onChange:j=>y(n,{value:j.target.value}),placeholder:"value",className:"h-9 flex-1"}),t.jsx(ye,{label:"Remove prop",onClick:()=>d(o.filter((j,b)=>b!==n))})]},n))}),e[0]=d,e[1]=i,e[2]=o,e[3]=l,e[4]=p,e[5]=m}else o=e[2],l=e[3],p=e[4],m=e[5];let u;e[7]!==o||e[8]!==d?(u=t.jsx(je,{label:"Add prop",onClick:()=>d([...o,{key:"",value:""}])}),e[7]=o,e[8]=d,e[9]=u):u=e[9];let x;return e[10]!==l||e[11]!==p||e[12]!==m||e[13]!==u?(x=t.jsxs("div",{className:l,children:[p,m,u]}),e[10]=l,e[11]=p,e[12]=m,e[13]=u,e[14]=x):x=e[14],x}function X(A){const e=J.c(31),{label:i,decofile:d,kind:o,valueField:l,extraFields:p,selected:m,onChange:u}=A;let x,y,s;if(e[0]!==d||e[1]!==o||e[2]!==l){x=de(d,o);let f;e[6]!==l?(f=(c,g)=>F(c[l])||g,e[6]=l,e[7]=f):f=e[7],s=f;let a;e[8]!==s?(a=c=>{const{key:g,payload:k}=c;return{value:s(k,g),label:F(k.name)||s(k,g)}},e[8]=s,e[9]=a):a=e[9],y=x.map(a),e[0]=d,e[1]=o,e[2]=l,e[3]=x,e[4]=y,e[5]=s}else x=e[3],y=e[4],s=e[5];const n=y;let j;if(e[10]!==m||e[11]!==l){const f=Array.isArray(m)?m:[];let a;e[13]!==l?(a=c=>F(c[l]),e[13]=l,e[14]=a):a=e[14],j=f.map(a).filter(Boolean),e[10]=m,e[11]=l,e[12]=j}else j=e[12];const b=j;let r;e[15]!==p||e[16]!==u||e[17]!==x||e[18]!==l||e[19]!==s?(r=f=>{u(f.map(a=>{const c=x.find(k=>{const{key:P,payload:N}=k;return s(N,P)===a});if(!c)return{name:a,[l]:a};const g={name:F(c.payload.name)};for(const k of p)g[k]=c.payload[k]??a;return g}))},e[15]=p,e[16]=u,e[17]=x,e[18]=l,e[19]=s,e[20]=r):r=e[20];const _=r;let C;e[21]!==i?(C=t.jsx(H,{children:i}),e[21]=i,e[22]=C):C=e[22];let h;e[23]!==b||e[24]!==_||e[25]!==i||e[26]!==n?(h=n.length===0?t.jsxs("p",{className:"text-xs text-muted-foreground",children:["No ",i.toLowerCase()," yet — create some in the"," ",i.toLowerCase()," collection."]}):t.jsx(ie,{options:n,defaultValue:b,onValueChange:_,placeholder:`Select ${i.toLowerCase()}`,maxCount:4}),e[23]=b,e[24]=_,e[25]=i,e[26]=n,e[27]=h):h=e[27];let S;return e[28]!==C||e[29]!==h?(S=t.jsxs("div",{className:"space-y-2",children:[C,h]}),e[28]=C,e[29]=h,e[30]=S):S=e[30],S}export{fi as PostEditor};
@@ -1 +0,0 @@
1
- import{c as $,a1 as H,j as v}from"./index-CJs4YG_y.js";import{a as L,g as E,s as b}from"./automation-runs-COPPnkgJ.js";import{u as O}from"./use-mcp-client-BdcH2AAr.js";import{p as k}from"./constants-B72Xmt_K.js";import{b as q,c as B}from"./use-mcp-tools-BhZCZNca.js";import{u as Y}from"./index-CZ4WVu9U.js";import{c as G}from"./monaco-editor-DTLtlpMl.js";import{g as K,M as V,a as w}from"./types-CDMEICfs.js";import{a as z,u as F}from"./chat-context-BDLg73HV.js";import{u as J}from"./shell-layout--i4S_y1a.js";import"./select-IQqkuyke.js";import"./tooltip-B3Xu0WsU.js";import"./Check-ocZ9qfNA.js";import"./ChevronDown-wJWuHepF.js";import"./ChevronUp-CJAHlnYn.js";import"./useInfiniteQuery-GaTpQKsb.js";import"./use-infinite-scroll-DJF4Bq88.js";import"./use-connection-M87KpiDN.js";import"./use-collections-Q9vyVcYX.js";import"./use-virtual-mcp-C8ctxJhX.js";import"./card-CFUuQQ1M.js";import"./sidebar-ciphtA4J.js";import"./LayoutLeft-j7RNB7Kr.js";import"./use-mobile-CMaygZmb.js";import"./X-Dntrg8W3.js";import"./table-BtAQhFli.js";import"./empty-state-CcJIYptY.js";import"./use-members-D2ADy_SQ.js";import"./use-org-auth-client-Mq6_dHl5.js";import"./use-clock-tick-Dums0r6j.js";import"./AlertCircle-D3-xinjs.js";import"./CheckCircle-C0j5UyGw.js";import"./Circle-BTXhFI7S.js";import"./agent-icon-aq9fahDc.js";import"./Tool01-DWMuD8TU.js";import"./ArrowUp-BDUzeu95.js";import"./Settings02-C124V1Xc.js";import"./XCircle-Cc0xPE71.js";import"./ArrowUpRight-C3_2cXeW.js";import"./ZapSquare-BaPWVQ37.js";import"./Users03-DgaczNXO.js";import"./Loading02-pQoaBc8-.js";import"./ChevronRight-BjCnVhIo.js";import"./Stars02-Cb9neMzf.js";import"./Copy01-jaaWVisn.js";import"./ZoomOut-0JxM3Azv.js";import"./DotsVertical-DtV5Fnad.js";import"./Globe01-BGRBT0T0.js";import"./Eye-wkJjtmH2.js";import"./FilterLines-DlRQ5-i5.js";import"./Star01-8j7H5tvN.js";import"./Globe04-DRckETTE.js";import"./SwitchHorizontal01-DENI6_WB.js";import"./HardDrive-B5qdyv_Y.js";import"./Key01-JqQROwH3.js";import"./LinkExternal01-BOVv-eRf.js";import"./List-B14rXxdk.js";import"./Monitor01-p4fXdA6F.js";import"./Sun-f1oBLB5X.js";import"./Palette-Ba4t1bDZ.js";import"./Play-BRUiwJ0P.js";import"./Plus-CD0lb0Z8.js";import"./SearchLg-DomSsZ58.js";import"./SearchMd-BcwHGb7L.js";import"./Shield01-xKRFJ51X.js";import"./Stars01-D-3hvZEh.js";import"./Trash01-CWwPWzB6.js";import"./Upload01-mS32ZgCv.js";import"./User01-ByTCset0.js";import"./Users01-C_ia9S0h.js";import"./XClose-BKzJufOf.js";import"./Zap-B8LjXKlt.js";import"./use-automations-89YCo463.js";import"./studio-tools-C8sSWr27.js";import"./useSuspenseInfiniteQuery-BMdxCWpS.js";import"./badge-OQCPYGcq.js";import"./checkbox-BN0UcVyB.js";import"./command-B-zA3-tK.js";import"./index-C2LXo0VC.js";import"./dialog-CzN8avhL.js";import"./popover-uE71epyh.js";import"./avatar-B58RA_6l.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-D3B6kIY8.js";import"./file-type-icon-GpEKUsdD.js";import"./tab-id-bb-jjgGv.js";import"./hooks-BFJHOTt4.js";import"./decopilot-sse-pool-DSmv0lZi.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./integration-icon-BrvrOk5H.js";import"./use-navigate-to-agent-BFFz8mSO.js";import"./reusable-new-chat-CouMjkYR.js";import"./use-mcp-prompts-DUZPd05e.js";import"./form-CGcaRTOA.js";import"./label-CAEQU6Kw.js";import"./input-B0aQnFKg.js";import"./auth-Bj2JBDn0.js";import"./drawer-HThdP5uB.js";import"./collection-search-IN2QsdDZ.js";import"./autosend-DCYPaCYz.js";import"./tabs-dnRCcMZW.js";import"./toggle-group-BWqkPPRz.js";import"./agent-capabilities-DSzooKp7.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CLhBW468.js";import"./use-registry-connections-BcjXByDN.js";import"./use-organization-settings-DqYIIvrP.js";import"./extract-connection-data-DSL7Y8A3.js";import"./collection-tabs-DEEctqY7.js";import"./textarea-BWkJXpt-.js";import"./connection-form-helpers-CYnQot14.js";import"./authenticate-and-persist-oauth-Dq14rQ5H.js";import"./mcp-oauth-WkAErzUM.js";import"./use-ai-providers-Dy1XYekN.js";import"./connect-desktop-dialog-DZCJkLGC.js";import"./select-model-_ueK9IUW.js";import"./skeleton-CtTBfwRk.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-B4wKOM9N.js";import"./dropdown-menu-BK5FaV5k.js";import"./index-DRgsUNzQ.js";import"./alert-dialog-Ctmy7BUh.js";import"./toolbar-CJcI1ONf.js";import"./use-debounced-value-KutXID4s.js";import"./index-C7hMTAFR.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-VC5seyB1.js";import"./use-decopilot-events-BCbLJTtF.js";import"./use-capability-vmeCrW9g.js";import"./tools-list-DEAw8kBy.js";import"./switch-WmIvORwZ.js";import"./use-debounced-autosave-Bt96Pub1.js";import"./index-C7WjeY76.js";import"./search-input-CfI7XQSB.js";import"./github-repo-picker-KQYx5bF_.js";import"./github-installations-D2vHSx02.js";import"./use-secrets-Bf4bTSxf.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./index-CylmZ2ca.js";import"./get-initials-D-f_fDFw.js";import"./calendar-DWypRNoG.js";import"./toolbar-icon-button-cVkvjja9.js";import"./use-file-configs-BJxRx26Q.js";import"./automation-list-row-B4UVZ48v.js";import"./required-auth-layout-Mghc_qb4.js";import"./use-org-sso-Br7EvSJS.js";const Q={};function W(A){const t=$.c(37),{client:i,resourceURI:h,tool:o,connectionId:p,orgId:l,args:M}=A,{sendMessage:I}=z(),{setAppContext:u,clearAppContext:n}=F(),{openSidePanel:f,openTab:g}=J(),r=`${p}:${o.name}`;let a;t[0]!==g?(a=C=>C==="inline"?(g("0"),"inline"):"fullscreen",t[0]=g,t[1]=a):a=t[1];const m=a,s=M??Q;let c;t[2]!==i||t[3]!==o.name||t[4]!==s?(c={client:i,toolName:o.name,toolArguments:s},t[2]=i,t[3]=o.name,t[4]=s,t[5]=c):c=t[5];const{data:e}=B(c);let x;if(t[6]!==o._meta||t[7]!==o.name){const C=E(o._meta);x=b(o.name,C),t[6]=o._meta,t[7]=o.name,t[8]=x}else x=t[8];const U=x;let d;t[9]!==o.inputSchema?(d=o.inputSchema??{type:"object"},t[9]=o.inputSchema,t[10]=d):d=t[10];let N;t[11]!==U||t[12]!==d||t[13]!==o?(N={...o,name:U,inputSchema:d},t[11]=U,t[12]=d,t[13]=o,t[14]=N):N=t[14];const j=N;let S;t[15]!==f||t[16]!==I?(S=C=>{const D=G(C.content);D.content.length>0&&(f("chat"),I({tiptapDoc:D}))},t[15]=f,t[16]=I,t[17]=S):S=t[17];const y=S;let P;t[18]!==j?(P={tool:j},t[18]=j,t[19]=P):P=t[19];let T;t[20]!==u||t[21]!==r?(T=C=>u(r,C),t[20]=u,t[21]=r,t[22]=T):T=t[22];let R;t[23]!==n||t[24]!==r?(R=()=>n(r),t[23]=n,t[24]=r,t[25]=R):R=t[25];let _;return t[26]!==i||t[27]!==y||t[28]!==m||t[29]!==l||t[30]!==h||t[31]!==P||t[32]!==T||t[33]!==R||t[34]!==s||t[35]!==e?(_=v.jsx(V,{resourceURI:h,orgId:l,toolInfo:P,toolInput:s,toolResult:e,displayMode:"fullscreen",minHeight:w.fullscreen.minHeight,maxHeight:w.fullscreen.maxHeight,client:i,onMessage:y,onUpdateModelContext:T,onTeardown:R,onRequestDisplayMode:m,className:"h-full"}),t[26]=i,t[27]=y,t[28]=m,t[29]=l,t[30]=h,t[31]=P,t[32]=T,t[33]=R,t[34]=s,t[35]=e,t[36]=_):_=t[36],_}function Or(A){const t=$.c(24),{connectionId:i,toolName:h,args:o}=A,{org:p}=H(),l=Y();let M;t[0]!==i||t[1]!==l?(M=k(i)&&l.vmEntry?.sandboxProviderKind==="user-desktop"&&l.previewUrl?`${l.previewUrl.replace(/\/+$/,"")}/api/mcp`:void 0,t[0]=i,t[1]=l,t[2]=M):M=t[2];const I=M;let u;t[3]!==i||t[4]!==I||t[5]!==p.id||t[6]!==p.slug?(u={connectionId:i,orgId:p.id,orgSlug:p.slug,mcpUrl:I},t[3]=i,t[4]=I,t[5]=p.id,t[6]=p.slug,t[7]=u):u=t[7];const n=O(u);let f;t[8]!==n?(f={client:n},t[8]=n,t[9]=f):f=t[9];const{data:g}=q(f);let r,a,m;t[10]!==h||t[11]!==g.tools?(r=L(decodeURIComponent(h)),m=g.tools.find(e=>e.name===r)??g.tools.find(e=>{const x=E(e._meta);if(!x)return!1;if(b(e.name,x)===r)return!0;const d=b(r,x);return d!==r&&e.name===d}),a=m?._meta?K(m._meta):void 0,t[10]=h,t[11]=g.tools,t[12]=r,t[13]=a,t[14]=m):(r=t[12],a=t[13],m=t[14]);const s=a;if(!m||!s){let e;return t[15]!==r?(e=v.jsx("div",{className:"flex items-center justify-center h-full w-full",children:v.jsxs("p",{className:"text-sm text-muted-foreground",children:['Tool "',r,'" not found or has no UI']})}),t[15]=r,t[16]=e):e=t[16],e}let c;return t[17]!==o||t[18]!==n||t[19]!==i||t[20]!==p.id||t[21]!==s||t[22]!==m?(c=v.jsx(W,{client:n,resourceURI:s,tool:m,connectionId:i,orgId:p.id,args:o}),t[17]=o,t[18]=n,t[19]=i,t[20]=p.id,t[21]=s,t[22]=m,t[23]=c):c=t[23],c}export{Or as AppViewContent};
@@ -1 +0,0 @@
1
- import{c as S,j as r}from"./index-CJs4YG_y.js";import{I as T}from"./input-B0aQnFKg.js";import{L as C}from"./label-CAEQU6Kw.js";import{T as L}from"./textarea-BWkJXpt-.js";import{aH as A,aI as R,aG as J,aJ as K,aK as D}from"./index-CZ4WVu9U.js";import{u as G,s as P}from"./primitives-CFiyHFxY.js";import"./ArrowUp-BDUzeu95.js";import"./chat-context-BDLg73HV.js";import"./autosend-DCYPaCYz.js";import"./hooks-BFJHOTt4.js";import"./use-mcp-client-BdcH2AAr.js";import"./constants-B72Xmt_K.js";import"./auth-Bj2JBDn0.js";import"./decopilot-sse-pool-DSmv0lZi.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-C8ctxJhX.js";import"./use-collections-Q9vyVcYX.js";import"./use-ai-providers-Dy1XYekN.js";import"./studio-tools-C8sSWr27.js";import"./use-decopilot-events-BCbLJTtF.js";import"./tab-id-bb-jjgGv.js";import"./use-organization-settings-DqYIIvrP.js";import"./automation-runs-COPPnkgJ.js";import"./select-IQqkuyke.js";import"./tooltip-B3Xu0WsU.js";import"./Check-ocZ9qfNA.js";import"./ChevronDown-wJWuHepF.js";import"./ChevronUp-CJAHlnYn.js";import"./useInfiniteQuery-GaTpQKsb.js";import"./use-infinite-scroll-DJF4Bq88.js";import"./use-connection-M87KpiDN.js";import"./card-CFUuQQ1M.js";import"./sidebar-ciphtA4J.js";import"./LayoutLeft-j7RNB7Kr.js";import"./use-mobile-CMaygZmb.js";import"./X-Dntrg8W3.js";import"./table-BtAQhFli.js";import"./empty-state-CcJIYptY.js";import"./use-members-D2ADy_SQ.js";import"./use-org-auth-client-Mq6_dHl5.js";import"./use-clock-tick-Dums0r6j.js";import"./AlertCircle-D3-xinjs.js";import"./CheckCircle-C0j5UyGw.js";import"./Circle-BTXhFI7S.js";import"./agent-icon-aq9fahDc.js";import"./Tool01-DWMuD8TU.js";import"./Settings02-C124V1Xc.js";import"./XCircle-Cc0xPE71.js";import"./ArrowUpRight-C3_2cXeW.js";import"./ZapSquare-BaPWVQ37.js";import"./Users03-DgaczNXO.js";import"./Loading02-pQoaBc8-.js";import"./ChevronRight-BjCnVhIo.js";import"./Stars02-Cb9neMzf.js";import"./Copy01-jaaWVisn.js";import"./ZoomOut-0JxM3Azv.js";import"./DotsVertical-DtV5Fnad.js";import"./Globe01-BGRBT0T0.js";import"./Eye-wkJjtmH2.js";import"./FilterLines-DlRQ5-i5.js";import"./Star01-8j7H5tvN.js";import"./Globe04-DRckETTE.js";import"./SwitchHorizontal01-DENI6_WB.js";import"./HardDrive-B5qdyv_Y.js";import"./Key01-JqQROwH3.js";import"./LinkExternal01-BOVv-eRf.js";import"./List-B14rXxdk.js";import"./Monitor01-p4fXdA6F.js";import"./Sun-f1oBLB5X.js";import"./Palette-Ba4t1bDZ.js";import"./Play-BRUiwJ0P.js";import"./Plus-CD0lb0Z8.js";import"./SearchLg-DomSsZ58.js";import"./SearchMd-BcwHGb7L.js";import"./Shield01-xKRFJ51X.js";import"./Stars01-D-3hvZEh.js";import"./Trash01-CWwPWzB6.js";import"./Upload01-mS32ZgCv.js";import"./User01-ByTCset0.js";import"./Users01-C_ia9S0h.js";import"./XClose-BKzJufOf.js";import"./Zap-B8LjXKlt.js";import"./use-automations-89YCo463.js";import"./useSuspenseInfiniteQuery-BMdxCWpS.js";import"./badge-OQCPYGcq.js";import"./checkbox-BN0UcVyB.js";import"./command-B-zA3-tK.js";import"./index-C2LXo0VC.js";import"./dialog-CzN8avhL.js";import"./popover-uE71epyh.js";import"./avatar-B58RA_6l.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-D3B6kIY8.js";import"./file-type-icon-GpEKUsdD.js";import"./monaco-editor-DTLtlpMl.js";import"./index-C7hMTAFR.js";import"./types-CDMEICfs.js";import"./shell-layout--i4S_y1a.js";import"./alert-dialog-Ctmy7BUh.js";import"./required-auth-layout-Mghc_qb4.js";import"./use-org-sso-Br7EvSJS.js";import"./integration-icon-BrvrOk5H.js";import"./use-navigate-to-agent-BFFz8mSO.js";import"./reusable-new-chat-CouMjkYR.js";import"./use-mcp-prompts-DUZPd05e.js";import"./form-CGcaRTOA.js";import"./drawer-HThdP5uB.js";import"./collection-search-IN2QsdDZ.js";import"./tabs-dnRCcMZW.js";import"./toggle-group-BWqkPPRz.js";import"./agent-capabilities-DSzooKp7.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CLhBW468.js";import"./use-registry-connections-BcjXByDN.js";import"./extract-connection-data-DSL7Y8A3.js";import"./collection-tabs-DEEctqY7.js";import"./connection-form-helpers-CYnQot14.js";import"./authenticate-and-persist-oauth-Dq14rQ5H.js";import"./mcp-oauth-WkAErzUM.js";import"./connect-desktop-dialog-DZCJkLGC.js";import"./select-model-_ueK9IUW.js";import"./skeleton-CtTBfwRk.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-B4wKOM9N.js";import"./dropdown-menu-BK5FaV5k.js";import"./index-DRgsUNzQ.js";import"./toolbar-CJcI1ONf.js";import"./use-debounced-value-KutXID4s.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-VC5seyB1.js";import"./use-mcp-tools-BhZCZNca.js";import"./use-capability-vmeCrW9g.js";import"./tools-list-DEAw8kBy.js";import"./switch-WmIvORwZ.js";import"./use-debounced-autosave-Bt96Pub1.js";import"./index-C7WjeY76.js";import"./search-input-CfI7XQSB.js";import"./github-repo-picker-KQYx5bF_.js";import"./github-installations-D2vHSx02.js";import"./use-secrets-Bf4bTSxf.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./index-CylmZ2ca.js";import"./get-initials-D-f_fDFw.js";import"./calendar-DWypRNoG.js";import"./toolbar-icon-button-cVkvjja9.js";import"./use-file-configs-BJxRx26Q.js";import"./automation-list-row-B4UVZ48v.js";const H={authors:[{key:"name",label:"Name",widget:"text"},{key:"email",label:"Email",widget:"text",placeholder:"author@example.com"},{key:"jobTitle",label:"Job title",widget:"text"},{key:"company",label:"Company",widget:"text"},{key:"avatar",label:"Avatar",widget:"image"}]},M={authors:"Author"};function Sr(B){const t=S.c(34),{orgSlug:v,virtualMcpId:j,branch:w,kind:p,blockKey:g,block:f}=B;let y;t[0]!==w||t[1]!==v||t[2]!==j?(y={orgSlug:v,virtualMcpId:j,branch:w},t[0]=w,t[1]=v,t[2]=j,t[3]=y):y=t[3];const m=A(y);let d;t[4]!==f||t[5]!==p?(d=R(f,p),t[4]=f,t[5]=p,t[6]=d):d=t[6];const F=d;let h;t[7]!==g||t[8]!==p||t[9]!==m?(h=e=>{m.mutate({blockKey:g,data:K(g,p,e)})},t[7]=g,t[8]=p,t[9]=m,t[10]=h):h=t[10];const[i,E]=G(F,h);let k;t[11]!==i||t[12]!==E?(k=(e,o)=>E({...i,[e]:o}),t[11]=i,t[12]=E,t[13]=k):k=t[13];const a=k,N=M[p];let s;t[14]!==N?(s=r.jsx("span",{className:"text-sm font-medium",children:N}),t[14]=N,t[15]=s):s=t[15];let l;t[16]!==m.isError||t[17]!==m.isPending?(l=r.jsx(J,{isPending:m.isPending,isError:m.isError}),t[16]=m.isError,t[17]=m.isPending,t[18]=l):l=t[18];let n;t[19]!==s||t[20]!==l?(n=r.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[s,l]}),t[19]=s,t[20]=l,t[21]=n):n=t[21];const I=H[p];let c;if(t[22]!==i||t[23]!==a||t[24]!==I){let e;t[26]!==i||t[27]!==a?(e=o=>r.jsx("div",{className:"space-y-2",children:o.widget==="image"?r.jsx(D,{schema:{type:"string",format:"image-uri",title:o.label},value:i[o.key],onChange:u=>a(o.key,u),path:o.key,label:o.label}):r.jsxs(r.Fragment,{children:[r.jsx(C,{htmlFor:o.key,children:o.label}),o.widget==="textarea"?r.jsx(L,{id:o.key,value:P(i[o.key]),onChange:u=>a(o.key,u.target.value),rows:3}):r.jsx(T,{id:o.key,value:P(i[o.key]),placeholder:o.placeholder,onChange:u=>a(o.key,u.target.value),className:"h-10"})]})},o.key),t[26]=i,t[27]=a,t[28]=e):e=t[28],c=I.map(e),t[22]=i,t[23]=a,t[24]=I,t[25]=c}else c=t[25];let x;t[29]!==c?(x=r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto px-6 py-6",children:r.jsx("div",{className:"mx-auto max-w-xl space-y-6",children:c})}),t[29]=c,t[30]=x):x=t[30];let b;return t[31]!==x||t[32]!==n?(b=r.jsxs("div",{className:"flex h-full flex-col",children:[n,x]}),t[31]=x,t[32]=n,t[33]=b):b=t[33],b}export{Sr as RecordEditor};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-N861VHnw.js","assets/index-CJs4YG_y.js","assets/index-ZbSNKPKh.css","assets/XCircle-Cc0xPE71.js","assets/CheckCircle-C0j5UyGw.js","assets/Settings02-C124V1Xc.js","assets/use-mcp-client-BdcH2AAr.js","assets/constants-B72Xmt_K.js","assets/auth-Bj2JBDn0.js","assets/useInfiniteQuery-GaTpQKsb.js","assets/use-infinite-scroll-DJF4Bq88.js","assets/studio-tools-C8sSWr27.js","assets/badge-OQCPYGcq.js","assets/input-B0aQnFKg.js","assets/dropdown-menu-BK5FaV5k.js","assets/Check-ocZ9qfNA.js","assets/ChevronRight-BjCnVhIo.js","assets/Circle-BTXhFI7S.js","assets/table-BtAQhFli.js","assets/toggle-group-BWqkPPRz.js","assets/use-view-mode-sA-TbW6V.js","assets/use-mobile-CMaygZmb.js","assets/DotsVertical-DtV5Fnad.js","assets/FilterLines-DlRQ5-i5.js","assets/Globe01-BGRBT0T0.js","assets/SearchMd-BcwHGb7L.js","assets/dialog-CzN8avhL.js","assets/X-Dntrg8W3.js","assets/AlertCircle-D3-xinjs.js","assets/Upload01-mS32ZgCv.js","assets/alert-dialog-Ctmy7BUh.js","assets/card-CFUuQQ1M.js","assets/Trash01-CWwPWzB6.js","assets/label-CAEQU6Kw.js","assets/select-IQqkuyke.js","assets/tooltip-B3Xu0WsU.js","assets/ChevronDown-wJWuHepF.js","assets/ChevronUp-CJAHlnYn.js","assets/switch-WmIvORwZ.js","assets/textarea-BWkJXpt-.js","assets/checkbox-BN0UcVyB.js","assets/Eye-wkJjtmH2.js","assets/LinkExternal01-BOVv-eRf.js","assets/use-copy-D3B6kIY8.js","assets/Copy01-jaaWVisn.js","assets/Key01-JqQROwH3.js","assets/Plus-CD0lb0Z8.js","assets/mcp-oauth-WkAErzUM.js","assets/Play-BRUiwJ0P.js"])))=>i.map(i=>d[i]);
2
- import{c as s,j as e,r as i,i as a,aV as o}from"./index-CJs4YG_y.js";import{R as m}from"./require-capability-XY6ZhzOS.js";import"./use-capability-vmeCrW9g.js";import"./access-gate-CuWTKtSI.js";import"./capability-load-error-C9fFHl6G.js";const n=i.lazy(()=>o(()=>import("./registry-layout-N861VHnw.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])));function f(){const r=s.c(1);let t;return r[0]===Symbol.for("react.memo_cache_sentinel")?(t=e.jsx(m,{capability:"registry:manage",area:"the registry",children:e.jsx(i.Suspense,{fallback:e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx(a,{size:20,className:"animate-spin text-muted-foreground"})}),children:e.jsx(n,{})})}),r[0]=t):t=r[0],t}export{f as default};
@@ -1,2 +0,0 @@
1
- import{c as He,r as w,l as Ee,j as n,B as Ge,i as Hn,n as Ss,t as W,K as xs}from"./index-CJs4YG_y.js";import{r as bs,a as ys,s as _s,b as Un,c as zt,K as Wn,P as Gn,i as qn,d as js,e as Yn,C as Jn,f as ks,G as ws,V as Rs,g as Qn,h as Rt,D as Xn,j as Zn,S as ea,v as ta,k as na,l as Ds,m as Dt,n as Ns,o as Vs,p as Cs,q as Ps,t as Ts,w as As,x as Ms,y as Es,z as Ks,A as Ot,B as Bt,E as $s,F as ut,H as jt,I as Os,J as Bs,L as Je,M as Cn,N as Ls,O as Pn,Q as kt,R as Lt,T as Fs,U as sn,W as Is,X as tt,Y as xt,Z as zs,_ as Hs,$ as Us,a0 as Ws,a1 as Gs,a2 as qs,a3 as dt,a4 as Ys,a5 as Js,a6 as Qs,a7 as Tn,a8 as wt,a9 as Xs,aa as Zs,ab as er,ac as tr,ad as nr,ae as rn,af as An,ag as Mn,ah as bt,ai as Ft,aj as En,ak as ar,al as sr,am as on,an as rr,ao as or,ap as aa,aq as Kn,ar as ir}from"./index-CZ4WVu9U.js";import{t as lr}from"./ChevronDown-wJWuHepF.js";import{n as sa}from"./Loading02-pQoaBc8-.js";import{i as ra}from"./ChevronRight-BjCnVhIo.js";import{n as cr}from"./ChevronUp-CJAHlnYn.js";import{U as cn,P as oa,ab as ia,C as ur,V as dr,W as mr}from"./agent-icon-aq9fahDc.js";import{i as fr}from"./Globe01-BGRBT0T0.js";import{A as It}from"./automation-runs-COPPnkgJ.js";import{T as mt,a as ft,b as pt}from"./tooltip-B3Xu0WsU.js";import{a as pr,D as hr,f as gr,c as vr,d as Sr,e as xr}from"./dialog-CzN8avhL.js";import{I as br}from"./input-B0aQnFKg.js";import{a as la}from"./Copy01-jaaWVisn.js";import{b as yr}from"./ZoomOut-0JxM3Azv.js";import{i as _r}from"./Settings02-C124V1Xc.js";import{s as jr}from"./Eye-wkJjtmH2.js";import{s as un}from"./Plus-CD0lb0Z8.js";import{s as ca}from"./Trash01-CWwPWzB6.js";import{i as kr}from"./Zap-B8LjXKlt.js";import{d as it,a as ua,D as da,c as ma,j as wr}from"./dropdown-menu-BK5FaV5k.js";import{r as $n,u as Rr,d as Dr,a as Nr,i as Vr,f as Cr,P as Pr,b as Tr,S as Ar}from"./seo-save-FLLGxIUK.js";import{c as Mr}from"./Tool01-DWMuD8TU.js";import{A as Er}from"./add-section-modal-NS1ZCez1.js";import"./ArrowUp-BDUzeu95.js";import"./chat-context-BDLg73HV.js";import"./autosend-DCYPaCYz.js";import"./hooks-BFJHOTt4.js";import"./use-mcp-client-BdcH2AAr.js";import"./constants-B72Xmt_K.js";import"./auth-Bj2JBDn0.js";import"./decopilot-sse-pool-DSmv0lZi.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-C8ctxJhX.js";import"./use-collections-Q9vyVcYX.js";import"./use-ai-providers-Dy1XYekN.js";import"./studio-tools-C8sSWr27.js";import"./use-decopilot-events-BCbLJTtF.js";import"./tab-id-bb-jjgGv.js";import"./use-organization-settings-DqYIIvrP.js";import"./drawer-HThdP5uB.js";import"./collection-search-IN2QsdDZ.js";import"./SearchMd-BcwHGb7L.js";import"./use-mobile-CMaygZmb.js";import"./use-mcp-prompts-DUZPd05e.js";import"./X-Dntrg8W3.js";import"./shell-layout--i4S_y1a.js";import"./avatar-B58RA_6l.js";import"./User01-ByTCset0.js";import"./Users03-DgaczNXO.js";import"./SearchLg-DomSsZ58.js";import"./Stars02-Cb9neMzf.js";import"./XClose-BKzJufOf.js";import"./CheckCircle-C0j5UyGw.js";import"./FilterLines-DlRQ5-i5.js";import"./alert-dialog-Ctmy7BUh.js";import"./required-auth-layout-Mghc_qb4.js";import"./use-org-sso-Br7EvSJS.js";import"./ZapSquare-BaPWVQ37.js";import"./Check-ocZ9qfNA.js";import"./Star01-8j7H5tvN.js";import"./Upload01-mS32ZgCv.js";import"./AlertCircle-D3-xinjs.js";import"./form-CGcaRTOA.js";import"./label-CAEQU6Kw.js";import"./select-IQqkuyke.js";import"./XCircle-Cc0xPE71.js";import"./tabs-dnRCcMZW.js";import"./toggle-group-BWqkPPRz.js";import"./agent-capabilities-DSzooKp7.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CLhBW468.js";import"./use-registry-connections-BcjXByDN.js";import"./use-connection-M87KpiDN.js";import"./useInfiniteQuery-GaTpQKsb.js";import"./use-infinite-scroll-DJF4Bq88.js";import"./extract-connection-data-DSL7Y8A3.js";import"./card-CFUuQQ1M.js";import"./integration-icon-BrvrOk5H.js";import"./collection-tabs-DEEctqY7.js";import"./badge-OQCPYGcq.js";import"./textarea-BWkJXpt-.js";import"./connection-form-helpers-CYnQot14.js";import"./authenticate-and-persist-oauth-Dq14rQ5H.js";import"./mcp-oauth-WkAErzUM.js";import"./useSuspenseInfiniteQuery-BMdxCWpS.js";import"./Monitor01-p4fXdA6F.js";import"./connect-desktop-dialog-DZCJkLGC.js";import"./select-model-_ueK9IUW.js";import"./checkbox-BN0UcVyB.js";import"./skeleton-CtTBfwRk.js";import"./Key01-JqQROwH3.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-B4wKOM9N.js";import"./ArrowUpRight-C3_2cXeW.js";import"./Stars01-D-3hvZEh.js";import"./command-B-zA3-tK.js";import"./index-C2LXo0VC.js";import"./popover-uE71epyh.js";import"./index-DRgsUNzQ.js";import"./Palette-Ba4t1bDZ.js";import"./file-type-icon-GpEKUsdD.js";import"./toolbar-CJcI1ONf.js";import"./use-debounced-value-KutXID4s.js";import"./DotsVertical-DtV5Fnad.js";import"./LinkExternal01-BOVv-eRf.js";import"./index-C7hMTAFR.js";import"./LayoutLeft-j7RNB7Kr.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-VC5seyB1.js";import"./empty-state-CcJIYptY.js";import"./use-mcp-tools-BhZCZNca.js";import"./types-CDMEICfs.js";import"./use-capability-vmeCrW9g.js";import"./tools-list-DEAw8kBy.js";import"./switch-WmIvORwZ.js";import"./Play-BRUiwJ0P.js";import"./use-debounced-autosave-Bt96Pub1.js";import"./index-C7WjeY76.js";import"./sidebar-ciphtA4J.js";import"./search-input-CfI7XQSB.js";import"./github-repo-picker-KQYx5bF_.js";import"./use-navigate-to-agent-BFFz8mSO.js";import"./reusable-new-chat-CouMjkYR.js";import"./github-installations-D2vHSx02.js";import"./Users01-C_ia9S0h.js";import"./use-secrets-Bf4bTSxf.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-members-D2ADy_SQ.js";import"./use-org-auth-client-Mq6_dHl5.js";import"./index-CylmZ2ca.js";import"./get-initials-D-f_fDFw.js";import"./List-B14rXxdk.js";import"./format-time-BnbuEtat.js";import"./Circle-BTXhFI7S.js";import"./calendar-DWypRNoG.js";import"./toolbar-icon-button-cVkvjja9.js";import"./SwitchHorizontal01-DENI6_WB.js";import"./use-file-configs-BJxRx26Q.js";import"./monaco-editor-DTLtlpMl.js";import"./use-automations-89YCo463.js";import"./automation-list-row-B4UVZ48v.js";import"./Globe04-DRckETTE.js";import"./HardDrive-B5qdyv_Y.js";import"./Sun-f1oBLB5X.js";import"./Shield01-xKRFJ51X.js";import"./table-BtAQhFli.js";import"./use-clock-tick-Dums0r6j.js";import"./use-copy-D3B6kIY8.js";function Kr(m){return m.schema?.definitions??m.schema?.$defs??{}}function $r(m,e){const r=Kr(e),c=r[btoa(m)];if(!c)return;let d=typeof c.image=="string"?c.image:void 0;if(!d&&Array.isArray(c.allOf)){const h=c.allOf.find(S=>typeof S.$ref=="string")?.$ref;if(typeof h=="string"){const S=h.replace("#/definitions/",""),p=r[S];d=typeof p?.image=="string"?p.image:void 0}}if(d?.includes("{{{"))return d}function Or(m,e){if(!e)return;const r=bs(m);if(!r)return;const c=$r(r.resolveType,e);if(!c)return;const d=ys(c,r.data);if(d)return _s(d)}const Br="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Lr="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function On(m){return Array.from({length:m},(e,r)=>({id:crypto.randomUUID(),index:r}))}function fa(m){return m.map((e,r)=>({...e,index:r}))}function Fr(m,e){if(e===m.length)return m;if(e<m.length)return fa(m.slice(0,e));const r=Array.from({length:e-m.length},(c,d)=>({id:crypto.randomUUID(),index:m.length+d}));return[...m,...r]}function pa(m){const e=He.c(20),{section:r,raw:c,meta:d}=m,h=r.isSavedBlock===!0,S=r.isMultivariate===!0;let p;e[0]!==d||e[1]!==c?(p=c&&d?Or(c,d):void 0,e[0]=d,e[1]=c,e[2]=p):p=e[2];const v=p;let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(yr,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=g):g=e[3];let y;e[4]!==v?(y=v&&n.jsx("img",{src:v,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=v,e[5]=y):y=e[5];let C;e[6]!==S||e[7]!==h?(C=h?{color:ws}:S?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=S,e[7]=h,e[8]=C):C=e[8];let R;e[9]!==C?(R=n.jsx(cn,{className:"h-4 w-4 shrink-0",style:C}),e[9]=C,e[10]=R):R=e[10];const _=r.isHidden&&"line-through opacity-50";let k;e[11]!==_?(k=Ee("min-w-0 flex-1 truncate text-sm font-medium",_),e[11]=_,e[12]=k):k=e[12];let o;e[13]!==r.label||e[14]!==k?(o=n.jsx("span",{className:k,children:r.label}),e[13]=r.label,e[14]=k,e[15]=o):o=e[15];let D;return e[16]!==y||e[17]!==R||e[18]!==o?(D=n.jsxs(n.Fragment,{children:[g,y,R,o]}),e[16]=y,e[17]=R,e[18]=o,e[19]=D):D=e[19],D}function ha(m,e){const r=m.isSavedBlock===!0,c=m.isMultivariate===!0;return Ee("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":r?Br:c?"text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]":"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Ir(m){const e=He.c(64),{section:r,raw:c,meta:d,sortableId:h,selected:S,onSelect:p,onDelete:v,onDuplicate:g,onMakeReusable:y,onToggleHidden:C,onToggleLazy:R,onAddVariant:_,onDetach:k}=m,o=c?qn(c.__resolveType??""):!1;let D;e[0]!==r?(D=js(r),e[0]=r,e[1]=D):D=e[1];const l=D;let J;e[2]!==h?(J={id:h,animateLayoutChanges:Gr},e[2]=h,e[3]=J):J=e[3];const{attributes:H,listeners:K,setNodeRef:u,transform:P,isDragging:se}=Yn(J);let T;e[4]!==P?(T=Jn.Transform.toString(P?{...P,x:0}:null),e[4]=P,e[5]=T):T=e[5];const pe=se?0:void 0;let N;e[6]!==T||e[7]!==pe?(N={transform:T,opacity:pe},e[6]=T,e[7]=pe,e[8]=N):N=e[8];const ce=N;let B;e[9]!==r?(B=ks(r),e[9]=r,e[10]=B):B=e[10];const te=B,oe="button",Ce=0;let E;e[11]!==p?(E=$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),p())},e[11]=p,e[12]=E):E=e[12];const ue=se?"cursor-grabbing":"cursor-pointer";let ie;e[13]!==r||e[14]!==S||e[15]!==ue?(ie=Ee("touch-none transition-colors",ue,ha(r,S)),e[13]=r,e[14]=S,e[15]=ue,e[16]=ie):ie=e[16];let je;e[17]!==d||e[18]!==c||e[19]!==r?(je=n.jsx(pa,{section:r,raw:c,meta:d}),e[17]=d,e[18]=c,e[19]=r,e[20]=je):je=e[20];const M=!r.isMultivariate&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":o?"Disable async render":"Enable async render",className:Ee("h-7 w-7 shrink-0",o?"":"opacity-0 group-hover:opacity-100"),onClick:$=>{$.stopPropagation(),R()},onPointerDown:Wr,children:n.jsx(kr,{className:Ee("h-3.5 w-3.5",o&&"text-yellow-500")})})}),n.jsx(pt,{side:"bottom",children:o?"Disable async render":"Enable async render"})]});let Ae;e[21]!==C||e[22]!==r.isHidden||e[23]!==r.isMultivariate?(Ae=!r.isMultivariate&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":r.isHidden?"Show section":"Hide section",className:Ee("h-7 w-7 shrink-0",r.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:$=>{$.stopPropagation(),C()},onPointerDown:Ur,children:r.isHidden?n.jsx(_r,{className:"h-3.5 w-3.5"}):n.jsx(jr,{className:"h-3.5 w-3.5"})})}),n.jsx(pt,{side:"bottom",children:r.isHidden?"Show section":"Hide section"})]}),e[21]=C,e[22]=r.isHidden,e[23]=r.isMultivariate,e[24]=Ae):Ae=e[24];let X;e[25]===Symbol.for("react.memo_cache_sentinel")?(X=n.jsx(ua,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Section actions",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:Hr,onPointerDown:zr,children:n.jsx(oa,{className:"h-3.5 w-3.5"})})}),e[25]=X):X=e[25];let Ne;e[26]!==g?(Ne=$=>{$.stopPropagation(),g()},e[26]=g,e[27]=Ne):Ne=e[27];let ve;e[28]===Symbol.for("react.memo_cache_sentinel")?(ve=n.jsx(la,{className:"h-4 w-4"}),e[28]=ve):ve=e[28];let re;e[29]!==Ne?(re=n.jsxs(it,{onClick:Ne,children:[ve,"Duplicate"]}),e[29]=Ne,e[30]=re):re=e[30];let G;e[31]!==l||e[32]!==_?(G=l&&n.jsxs(it,{className:Rs,onClick:$=>{$.stopPropagation(),_()},children:[n.jsx(ia,{className:"h-4 w-4"}),"Add variant"]}),e[31]=l,e[32]=_,e[33]=G):G=e[33];let q;e[34]!==te||e[35]!==y?(q=te&&n.jsxs(it,{className:Lr,onClick:$=>{$.stopPropagation(),y()},children:[n.jsx(cn,{className:"h-4 w-4"}),"Make reusable"]}),e[34]=te,e[35]=y,e[36]=q):q=e[36];let ne;e[37]!==k||e[38]!==r.isMultivariate||e[39]!==r.isSavedBlock?(ne=r.isSavedBlock===!0&&!r.isMultivariate&&n.jsxs(it,{onClick:$=>{$.stopPropagation(),k()},children:[n.jsx(cn,{className:"h-4 w-4"}),"Detach"]}),e[37]=k,e[38]=r.isMultivariate,e[39]=r.isSavedBlock,e[40]=ne):ne=e[40];let le;e[41]!==v?(le=$=>{$.stopPropagation(),v()},e[41]=v,e[42]=le):le=e[42];let ke;e[43]===Symbol.for("react.memo_cache_sentinel")?(ke=n.jsx(ca,{className:"h-4 w-4"}),e[43]=ke):ke=e[43];let Se;e[44]!==le?(Se=n.jsxs(it,{className:"text-destructive focus:text-destructive",onClick:le,children:[ke,"Delete"]}),e[44]=le,e[45]=Se):Se=e[45];let de;e[46]!==re||e[47]!==G||e[48]!==q||e[49]!==ne||e[50]!==Se?(de=n.jsxs(da,{children:[X,n.jsxs(ma,{align:"end",className:"w-44",children:[re,G,q,ne,Se]})]}),e[46]=re,e[47]=G,e[48]=q,e[49]=ne,e[50]=Se,e[51]=de):de=e[51];let ye;return e[52]!==H||e[53]!==K||e[54]!==p||e[55]!==u||e[56]!==ce||e[57]!==ie||e[58]!==je||e[59]!==M||e[60]!==Ae||e[61]!==de||e[62]!==E?(ye=n.jsxs("div",{ref:u,style:ce,...H,...K,role:oe,tabIndex:Ce,onClick:p,onKeyDown:E,className:ie,children:[je,M,Ae,de]}),e[52]=H,e[53]=K,e[54]=p,e[55]=u,e[56]=ce,e[57]=ie,e[58]=je,e[59]=M,e[60]=Ae,e[61]=de,e[62]=E,e[63]=ye):ye=e[63],ye}function zr(m){return m.stopPropagation()}function Hr(m){return m.stopPropagation()}function Ur(m){return m.stopPropagation()}function Wr(m){return m.stopPropagation()}function Gr(){return!1}function qr(m){const e=He.c(90),{listKey:r,rawSections:c,sections:d,meta:h,selectedIndex:S,onSelect:p,onReorder:v,onDelete:g,onDuplicate:y,onMakeReusable:C,onToggleHidden:R,onToggleLazy:_,onAddVariant:k,onDetach:o,onAddSection:D,canAddSection:l}=m,J=l===void 0?!0:l;let H;e[0]!==d.length?(H=()=>On(d.length),e[0]=d.length,e[1]=H):H=e[1];const[K,u]=w.useState(H),[P,se]=w.useState(null),[T,pe]=w.useState(r),[N,ce]=w.useState(d.length),B=w.useRef(!1);T!==r?(pe(r),ce(d.length),u(On(d.length))):N!==d.length&&(ce(d.length),u(L=>Fr(L,d.length)));let te;e[2]===Symbol.for("react.memo_cache_sentinel")?(te={activationConstraint:{distance:8}},e[2]=te):te=e[2];let oe;e[3]===Symbol.for("react.memo_cache_sentinel")?(oe={coordinateGetter:Qn},e[3]=oe):oe=e[3];const Ce=Un(zt(Gn,te),zt(Wn,oe));let E;e[4]!==K?(E=K.map(Yr),e[4]=K,e[5]=E):E=e[5];const ue=E;let ie;e[6]===Symbol.for("react.memo_cache_sentinel")?(ie=L=>{se(String(L.active.id))},e[6]=ie):ie=e[6];const je=ie;let M;e[7]!==ue||e[8]!==v?(M=L=>{se(null);const{active:ae,over:Q}=L;if(!Q||ae.id===Q.id)return;const Ie=ue.indexOf(String(ae.id)),he=ue.indexOf(String(Q.id));Ie===-1||he===-1||(u(Qe=>fa(Rt([...Qe],Ie,he))),B.current=!0,requestAnimationFrame(()=>{B.current=!1}),v?.(Ie,he))},e[7]=ue,e[8]=v,e[9]=M):M=e[9];const Ae=M;let X;e[10]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{se(null)},e[10]=X):X=e[10];const Ne=X;let ve,re,G,q,ne,le,ke,Se,de,ye,$,Z,we,Ke,$e;if(e[11]!==P||e[12]!==J||e[13]!==K||e[14]!==ue||e[15]!==Ae||e[16]!==h||e[17]!==D||e[18]!==k||e[19]!==g||e[20]!==o||e[21]!==y||e[22]!==C||e[23]!==p||e[24]!==R||e[25]!==_||e[26]!==c||e[27]!==d||e[28]!==S||e[29]!==Ce){Ke=Symbol.for("react.early_return_sentinel");e:{const L=ae=>{B.current||p(ae)};if(e[45]!==P||e[46]!==J||e[47]!==K||e[48]!==D||e[49]!==c||e[50]!==d){const ae=P?K.find(Q=>Q.id===P):null;if(q=ae!=null?d[ae.index]:null,G=ae!=null?c[ae.index]:void 0,K.length===0){let Q;e[54]===Symbol.for("react.memo_cache_sentinel")?(Q=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No sections in this page."}),e[54]=Q):Q=e[54];const Ie=!J;let he;e[55]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx(un,{size:14}),e[55]=he):he=e[55];let Qe;e[56]!==D||e[57]!==Ie?(Qe=n.jsxs("div",{className:"space-y-2",children:[Q,n.jsxs(Ge,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Ie,onClick:D,children:[he,"Add section"]})]}),e[56]=D,e[57]=Ie,e[58]=Qe):Qe=e[58],Ke=Qe;break e}we=Ee(ae&&"cursor-grabbing"),e[45]=P,e[46]=J,e[47]=K,e[48]=D,e[49]=c,e[50]=d,e[51]=G,e[52]=q,e[53]=we}else G=e[51],q=e[52],we=e[53];re=Xn,Se=Ce,de=Zn,ye=je,$=Ae,Z=Ne,ve=ea,le=ue,ke=ta,$e="space-y-1",ne=K.map(ae=>{const Q=d[ae.index];return Q?n.jsx(Ir,{sortableId:ae.id,section:Q,raw:c[ae.index],meta:h,selected:S===ae.index,onSelect:()=>L(ae.index),onDelete:()=>g(ae.index),onDuplicate:()=>y(ae.index),onMakeReusable:()=>C(ae.index),onToggleHidden:()=>R(ae.index),onToggleLazy:()=>_(ae.index),onAddVariant:()=>k(ae.index),onDetach:()=>o(ae.index)},ae.id):null})}e[11]=P,e[12]=J,e[13]=K,e[14]=ue,e[15]=Ae,e[16]=h,e[17]=D,e[18]=k,e[19]=g,e[20]=o,e[21]=y,e[22]=C,e[23]=p,e[24]=R,e[25]=_,e[26]=c,e[27]=d,e[28]=S,e[29]=Ce,e[30]=ve,e[31]=re,e[32]=G,e[33]=q,e[34]=ne,e[35]=le,e[36]=ke,e[37]=Se,e[38]=de,e[39]=ye,e[40]=$,e[41]=Z,e[42]=we,e[43]=Ke,e[44]=$e}else ve=e[30],re=e[31],G=e[32],q=e[33],ne=e[34],le=e[35],ke=e[36],Se=e[37],de=e[38],ye=e[39],$=e[40],Z=e[41],we=e[42],Ke=e[43],$e=e[44];if(Ke!==Symbol.for("react.early_return_sentinel"))return Ke;let Le;e[59]!==ne||e[60]!==$e?(Le=n.jsx("div",{className:$e,children:ne}),e[59]=ne,e[60]=$e,e[61]=Le):Le=e[61];let Pe;e[62]!==ve||e[63]!==le||e[64]!==ke||e[65]!==Le?(Pe=n.jsx(ve,{items:le,strategy:ke,children:Le}),e[62]=ve,e[63]=le,e[64]=ke,e[65]=Le,e[66]=Pe):Pe=e[66];let Oe;e[67]!==G||e[68]!==q||e[69]!==h?(Oe=q?n.jsx("div",{className:Ee("cursor-grabbing shadow-lg ring-1 ring-border/60",ha(q,!1)),children:n.jsx(pa,{section:q,raw:G,meta:h})}):null,e[67]=G,e[68]=q,e[69]=h,e[70]=Oe):Oe=e[70];let Fe;e[71]!==Oe?(Fe=n.jsx(na,{dropAnimation:null,children:Oe}),e[71]=Oe,e[72]=Fe):Fe=e[72];let Me;e[73]!==re||e[74]!==Se||e[75]!==de||e[76]!==ye||e[77]!==$||e[78]!==Z||e[79]!==Pe||e[80]!==Fe?(Me=n.jsxs(re,{sensors:Se,collisionDetection:de,onDragStart:ye,onDragEnd:$,onDragCancel:Z,children:[Pe,Fe]}),e[73]=re,e[74]=Se,e[75]=de,e[76]=ye,e[77]=$,e[78]=Z,e[79]=Pe,e[80]=Fe,e[81]=Me):Me=e[81];const xe=!J;let Re;e[82]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(un,{size:14}),e[82]=Re):Re=e[82];let me;e[83]!==D||e[84]!==xe?(me=n.jsxs(Ge,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:xe,onClick:D,children:[Re,"Add section"]}),e[83]=D,e[84]=xe,e[85]=me):me=e[85];let ee;return e[86]!==we||e[87]!==Me||e[88]!==me?(ee=n.jsxs("div",{className:we,children:[Me,me]}),e[86]=we,e[87]=Me,e[88]=me,e[89]=ee):ee=e[89],ee}function Yr(m){return m.id}function Bn(m){const e=He.c(38),{open:r,initialName:c,autoLabel:d,isPending:h,onSubmit:S,onOpenChange:p}=m,v=h===void 0?!1:h,[g,y]=w.useState(c),[C,R]=w.useState(r);r!==C&&(R(r),r&&y(c));let _;e[0]!==v||e[1]!==p?(_=oe=>{!oe&&!v&&p(!1)},e[0]=v,e[1]=p,e[2]=_):_=e[2];const k=_;let o;e[3]!==v||e[4]!==g||e[5]!==S?(o=async oe=>{oe.preventDefault(),!v&&await S(g.trim())},e[3]=v,e[4]=g,e[5]=S,e[6]=o):o=e[6];const D=o;let l;e[7]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(pr,{children:"Rename variant"}),e[7]=l):l=e[7];const J=d||"the rule";let H;e[8]!==J?(H=n.jsxs(hr,{children:[l,n.jsxs(gr,{children:["Save this matcher as a global block with a custom label. Leave empty to inline the matcher again and fall back to"," ",n.jsx("span",{className:"font-medium",children:J}),"."]})]}),e[8]=J,e[9]=H):H=e[9];let K;e[10]===Symbol.for("react.memo_cache_sentinel")?(K=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[10]=K):K=e[10];let u;e[11]===Symbol.for("react.memo_cache_sentinel")?(u=oe=>y(oe.target.value),e[11]=u):u=e[11];let P;e[12]!==d||e[13]!==v||e[14]!==g?(P=n.jsxs("div",{className:"space-y-1.5 py-4",children:[K,n.jsx(br,{id:"variant-rename-name",value:g,onChange:u,placeholder:d,autoFocus:!0,disabled:v})]}),e[12]=d,e[13]=v,e[14]=g,e[15]=P):P=e[15];let se;e[16]!==p?(se=()=>p(!1),e[16]=p,e[17]=se):se=e[17];let T;e[18]!==v||e[19]!==se?(T=n.jsx(Ge,{type:"button",variant:"outline",onClick:se,disabled:v,children:"Cancel"}),e[18]=v,e[19]=se,e[20]=T):T=e[20];let pe;e[21]!==v?(pe=v?n.jsxs(n.Fragment,{children:[n.jsx(Hn,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=v,e[22]=pe):pe=e[22];let N;e[23]!==v||e[24]!==pe?(N=n.jsx(Ge,{type:"submit",disabled:v,children:pe}),e[23]=v,e[24]=pe,e[25]=N):N=e[25];let ce;e[26]!==T||e[27]!==N?(ce=n.jsxs(vr,{children:[T,N]}),e[26]=T,e[27]=N,e[28]=ce):ce=e[28];let B;e[29]!==D||e[30]!==ce||e[31]!==H||e[32]!==P?(B=n.jsx(Sr,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:D,children:[H,P,ce]})}),e[29]=D,e[30]=ce,e[31]=H,e[32]=P,e[33]=B):B=e[33];let te;return e[34]!==k||e[35]!==r||e[36]!==B?(te=n.jsx(xr,{open:r,onOpenChange:k,children:B}),e[34]=k,e[35]=r,e[36]=B,e[37]=te):te=e[37],te}const Jr="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]",ga="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 va(m){const e=He.c(5),{rule:r,matchers:c}=m,d=r?.__resolveType??"";let h;if(e[0]!==c||e[1]!==d){const g=c.find(y=>y.resolveType===d)?.iconName??Ds(d);h=ur(g),e[0]=c,e[1]=d,e[2]=h}else h=e[2];const S=h;if(!S)return null;let p;return e[3]!==S?(p=n.jsx(S,{size:14,className:"shrink-0"}),e[3]=S,e[4]=p):p=e[4],p}function Ln(m){return m.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
2
- `)}function ln(m){return m.map((e,r)=>({id:crypto.randomUUID(),index:r,variant:e}))}function Qr(m){return m.map((e,r)=>({...e,index:r}))}function Sa(m){const e=He.c(16),{label:r,effectiveRule:c,matchers:d,canDelete:h,dragging:S,onRename:p,onDuplicate:v,onDelete:g}=m;let y;e[0]!==c||e[1]!==d?(y=n.jsx(va,{rule:c,matchers:d}),e[0]=c,e[1]=d,e[2]=y):y=e[2];let C;e[3]!==r?(C=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:r}),e[3]=r,e[4]=C):C=e[4];let R;e[5]!==h||e[6]!==S||e[7]!==r||e[8]!==g||e[9]!==v||e[10]!==p?(R=!S&&n.jsxs(da,{children:[n.jsx(ua,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":`Actions for ${r}`,className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:Zr,onPointerDown:Xr,children:n.jsx(oa,{size:14})})}),n.jsxs(ma,{align:"end",className:"w-36",children:[n.jsxs(it,{onClick:k=>{k.stopPropagation(),p?.()},children:[n.jsx(Mr,{size:14}),"Rename"]}),n.jsxs(it,{onClick:k=>{k.stopPropagation(),v?.()},children:[n.jsx(la,{size:14}),"Duplicate"]}),n.jsx(wr,{}),n.jsxs(it,{variant:"destructive",disabled:!h,onClick:k=>{k.stopPropagation(),g?.()},children:[n.jsx(ca,{size:14}),"Delete"]})]})]}),e[5]=h,e[6]=S,e[7]=r,e[8]=g,e[9]=v,e[10]=p,e[11]=R):R=e[11];let _;return e[12]!==y||e[13]!==C||e[14]!==R?(_=n.jsxs(n.Fragment,{children:[y,C,R]}),e[12]=y,e[13]=C,e[14]=R,e[15]=_):_=e[15],_}function Xr(m){return m.stopPropagation()}function Zr(m){return m.stopPropagation()}function eo(m){const e=He.c(33),{entry:r,sortableId:c,isActive:d,canDelete:h,decofile:S,meta:p,matchers:v,onSelect:g,onRename:y,onDuplicate:C,onDelete:R}=m;let _;e[0]!==c?(_={id:c,animateLayoutChanges:to},e[0]=c,e[1]=_):_=e[1];const{attributes:k,listeners:o,setNodeRef:D,transform:l,isDragging:J}=Yn(_);let H;e[2]!==l?(H=Jn.Transform.toString(l?{...l,x:0}:null),e[2]=l,e[3]=H):H=e[3];const K=J?0:void 0;let u;e[4]!==H||e[5]!==K?(u={transform:H,opacity:K},e[4]=H,e[5]=K,e[6]=u):u=e[6];const P=u,se=p??void 0;let T;e[7]!==S||e[8]!==r.variant.rule||e[9]!==se?(T=Dt(r.variant.rule,S,se),e[7]=S,e[8]=r.variant.rule,e[9]=se,e[10]=T):T=e[10];const pe=T;let N;e[11]!==g?(N=E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),g())},e[11]=g,e[12]=N):N=e[12];const ce=J?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",B=d?ga:Jr;let te;e[13]!==ce||e[14]!==B?(te=Ee("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",ce,B),e[13]=ce,e[14]=B,e[15]=te):te=e[15];let oe;e[16]!==h||e[17]!==pe||e[18]!==r.variant.label||e[19]!==v||e[20]!==R||e[21]!==C||e[22]!==y?(oe=n.jsx(Sa,{label:r.variant.label,effectiveRule:pe,matchers:v,canDelete:h,onRename:y,onDuplicate:C,onDelete:R}),e[16]=h,e[17]=pe,e[18]=r.variant.label,e[19]=v,e[20]=R,e[21]=C,e[22]=y,e[23]=oe):oe=e[23];let Ce;return e[24]!==k||e[25]!==o||e[26]!==g||e[27]!==D||e[28]!==P||e[29]!==te||e[30]!==oe||e[31]!==N?(Ce=n.jsx("div",{ref:D,style:P,...k,...o,onClick:g,onKeyDown:N,className:te,children:oe}),e[24]=k,e[25]=o,e[26]=g,e[27]=D,e[28]=P,e[29]=te,e[30]=oe,e[31]=N,e[32]=Ce):Ce=e[32],Ce}function to(){return!1}function no(m){const e=He.c(9),{variant:r,decofile:c,meta:d,matchers:h}=m,S=d??void 0;let p;e[0]!==c||e[1]!==S||e[2]!==r.rule?(p=Dt(r.rule,c,S),e[0]=c,e[1]=S,e[2]=r.rule,e[3]=p):p=e[3];const v=p;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=Ee("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",ga),e[4]=g):g=e[4];let y;return e[5]!==v||e[6]!==h||e[7]!==r.label?(y=n.jsx("div",{className:g,children:n.jsx(Sa,{label:r.label,effectiveRule:v,matchers:h,canDelete:!1,dragging:!0})}),e[5]=v,e[6]=h,e[7]=r.label,e[8]=y):y=e[8],y}function ao(m){const e=He.c(77),{listKey:r,variants:c,activeIndex:d,decofile:h,meta:S,matchers:p,onSelect:v,onReorder:g,onRename:y,onDuplicate:C,onDelete:R,onAdd:_}=m;let k;e[0]!==c?(k=()=>ln(c),e[0]=c,e[1]=k):k=e[1];const[o,D]=w.useState(k),[l,J]=w.useState(null),[H,K]=w.useState(r),[u,P]=w.useState(c.length);let se;e[2]!==c?(se=()=>Ln(c),e[2]=c,e[3]=se):se=e[3];const[T,pe]=w.useState(se),N=w.useRef(!1),ce=Ln(c);H!==r?(K(r),P(c.length),pe(ce),D(ln(c))):u!==c.length?(P(c.length),pe(ce),D(ln(c))):T!==ce&&(pe(ce),D(Me=>c.map((xe,Re)=>({id:Me[Re]?.id??crypto.randomUUID(),index:Re,variant:xe}))));let B;e[4]===Symbol.for("react.memo_cache_sentinel")?(B={activationConstraint:{distance:8}},e[4]=B):B=e[4];let te;e[5]===Symbol.for("react.memo_cache_sentinel")?(te={coordinateGetter:Qn},e[5]=te):te=e[5];const oe=Un(zt(Gn,B),zt(Wn,te));let Ce;e[6]!==o?(Ce=o.map(so),e[6]=o,e[7]=Ce):Ce=e[7];const E=Ce,ue=c.length>1;let ie;e[8]!==o?(ie=Me=>{const xe=String(Me.active.id);J(o.find(Re=>Re.id===xe)??null)},e[8]=o,e[9]=ie):ie=e[9];const je=ie;let M;e[10]!==E||e[11]!==g?(M=Me=>{J(null);const{active:xe,over:Re}=Me;if(!Re||xe.id===Re.id)return;const me=E.indexOf(String(xe.id)),ee=E.indexOf(String(Re.id));me===-1||ee===-1||(D(L=>Qr(Rt([...L],me,ee))),N.current=!0,requestAnimationFrame(()=>{N.current=!1}),g(me,ee))},e[10]=E,e[11]=g,e[12]=M):M=e[12];const Ae=M;let X;e[13]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{J(null)},e[13]=X):X=e[13];const Ne=X;let ve,re,G,q,ne,le,ke,Se,de,ye,$,Z,we;if(e[14]!==d||e[15]!==ue||e[16]!==h||e[17]!==o||e[18]!==E||e[19]!==Ae||e[20]!==je||e[21]!==p||e[22]!==S||e[23]!==_||e[24]!==R||e[25]!==C||e[26]!==y||e[27]!==v||e[28]!==oe){const Me=L=>{N.current||v(L)};$="space-y-1 border-b p-2";let xe;e[42]===Symbol.for("react.memo_cache_sentinel")?(xe=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variants"}),e[42]=xe):xe=e[42];let Re;e[43]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(un,{size:14}),e[43]=Re):Re=e[43];let me;e[44]!==_?(me=n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-6",onClick:_,children:Re})}),e[44]=_,e[45]=me):me=e[45];let ee;e[46]===Symbol.for("react.memo_cache_sentinel")?(ee=n.jsx(pt,{children:"Add variant"}),e[46]=ee):ee=e[46],e[47]!==me?(Z=n.jsxs("div",{className:"flex items-center justify-between",children:[xe,n.jsxs(mt,{children:[me,ee]})]}),e[47]=me,e[48]=Z):Z=e[48],re=Xn,le=oe,ke=Zn,Se=je,de=Ae,ye=Ne,ve=ea,q=E,ne=ta,we="space-y-0.5",G=o.map(L=>n.jsx(eo,{sortableId:L.id,entry:L,isActive:L.index===d,canDelete:ue,decofile:h,meta:S,matchers:p,onSelect:()=>Me(L.index),onRename:()=>y(L.index),onDuplicate:()=>C(L.index),onDelete:()=>R(L.index)},L.id)),e[14]=d,e[15]=ue,e[16]=h,e[17]=o,e[18]=E,e[19]=Ae,e[20]=je,e[21]=p,e[22]=S,e[23]=_,e[24]=R,e[25]=C,e[26]=y,e[27]=v,e[28]=oe,e[29]=ve,e[30]=re,e[31]=G,e[32]=q,e[33]=ne,e[34]=le,e[35]=ke,e[36]=Se,e[37]=de,e[38]=ye,e[39]=$,e[40]=Z,e[41]=we}else ve=e[29],re=e[30],G=e[31],q=e[32],ne=e[33],le=e[34],ke=e[35],Se=e[36],de=e[37],ye=e[38],$=e[39],Z=e[40],we=e[41];let Ke;e[49]!==G||e[50]!==we?(Ke=n.jsx("div",{className:we,children:G}),e[49]=G,e[50]=we,e[51]=Ke):Ke=e[51];let $e;e[52]!==ve||e[53]!==q||e[54]!==ne||e[55]!==Ke?($e=n.jsx(ve,{items:q,strategy:ne,children:Ke}),e[52]=ve,e[53]=q,e[54]=ne,e[55]=Ke,e[56]=$e):$e=e[56];let Le;e[57]!==l||e[58]!==h||e[59]!==p||e[60]!==S?(Le=l?n.jsx(no,{variant:l.variant,decofile:h,meta:S,matchers:p}):null,e[57]=l,e[58]=h,e[59]=p,e[60]=S,e[61]=Le):Le=e[61];let Pe;e[62]!==Le?(Pe=n.jsx(na,{dropAnimation:null,children:Le}),e[62]=Le,e[63]=Pe):Pe=e[63];let Oe;e[64]!==re||e[65]!==le||e[66]!==ke||e[67]!==Se||e[68]!==de||e[69]!==ye||e[70]!==$e||e[71]!==Pe?(Oe=n.jsxs(re,{sensors:le,collisionDetection:ke,onDragStart:Se,onDragEnd:de,onDragCancel:ye,children:[$e,Pe]}),e[64]=re,e[65]=le,e[66]=ke,e[67]=Se,e[68]=de,e[69]=ye,e[70]=$e,e[71]=Pe,e[72]=Oe):Oe=e[72];let Fe;return e[73]!==$||e[74]!==Z||e[75]!==Oe?(Fe=n.jsxs("div",{className:$,children:[Z,Oe]}),e[73]=$,e[74]=Z,e[75]=Oe,e[76]=Fe):Fe=e[76],Fe}function so(m){return m.id}function Fn(m){const e=He.c(15),{schema:r,value:c,onChange:d,meta:h,decofile:S,onSaveReferencedBlock:p,sandbox:v}=m;let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];const[y,C]=w.useState(g);let R;e[1]!==y?(R=y.length>0&&n.jsxs("nav",{"aria-label":"Variant rule breadcrumb",className:"flex min-w-0 items-center gap-1 overflow-hidden text-xs",children:[n.jsx("button",{type:"button",onClick:()=>C([]),className:"flex shrink-0 items-center gap-0.5 rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",title:"Back to rule",children:n.jsx(sa,{className:"size-3.5"})}),y.map((o,D)=>{const l=D===y.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[D>0&&n.jsx(ra,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>C(y.slice(0,D+1)),title:o,className:Ee("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",l?"font-medium text-foreground":"text-muted-foreground"),children:o})]},`${o}-${D}`)})]}),e[1]=y,e[2]=R):R=e[2];let _;e[3]!==y||e[4]!==S||e[5]!==h||e[6]!==d||e[7]!==p||e[8]!==v||e[9]!==r||e[10]!==c?(_=n.jsx(aa,{schema:r,value:c,onChange:d,basePath:"",breadcrumbPath:y,onBreadcrumbChange:C,meta:h,decofile:S,onSaveReferencedBlock:p,sandbox:v}),e[3]=y,e[4]=S,e[5]=h,e[6]=d,e[7]=p,e[8]=v,e[9]=r,e[10]=c,e[11]=_):_=e[11];let k;return e[12]!==R||e[13]!==_?(k=n.jsxs("div",{className:"space-y-2",children:[R,_]}),e[12]=R,e[13]=_,e[14]=k):k=e[14],k}function In(m){const e=He.c(21),{activeSchema:r,formValue:c,formResetKey:d,onFormChange:h,onBreadcrumbChange:S,breadcrumbPath:p,emptyMessage:v,beforeForm:g,seoResolveType:y,siteDefaultSeo:C,meta:R,decofile:_,onSaveReferencedBlock:k,sandbox:o}=m;let D;e[0]!==p?(D=p===void 0?[]:p,e[0]=p,e[1]=D):D=e[1];const l=D;let J;e[2]!==r||e[3]!==l||e[4]!==_||e[5]!==d||e[6]!==c||e[7]!==R||e[8]!==S||e[9]!==h||e[10]!==k||e[11]!==o||e[12]!==y||e[13]!==C?(J=r&&c?y?n.jsx(Ar,{schema:r,resolveType:y,value:c,formResetKey:d,onChange:h,onBreadcrumbChange:S,siteDefaultSeo:C}):n.jsx(aa,{schema:r,value:c,onChange:h,basePath:"",breadcrumbPath:l,onBreadcrumbChange:S,meta:R,decofile:_,onSaveReferencedBlock:k,sandbox:o},d):null,e[2]=r,e[3]=l,e[4]=_,e[5]=d,e[6]=c,e[7]=R,e[8]=S,e[9]=h,e[10]=k,e[11]=o,e[12]=y,e[13]=C,e[14]=J):J=e[14];const H=J;let K;e[15]!==v||e[16]!==H?(K=H??n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:v}),e[15]=v,e[16]=H,e[17]=K):K=e[17];let u;return e[18]!==g||e[19]!==K?(u=n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsxs("div",{className:"mx-auto max-w-2xl",children:[g,K]})}),e[18]=g,e[19]=K,e[20]=u):u=e[20],u}const ro="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.22)]";function oo(m,e){return zs(m,e,tt)}function io(m){const e=He.c(13),{pageKey:r,initialName:c,initialPath:d,onFieldChange:h}=m,[S,p]=w.useState(c),[v,g]=w.useState(d),[y,C]=w.useState(r);y!==r&&(C(r),p(c),g(d));let R;e[0]!==h?(R=l=>{p(l.target.value),h("name",l.target.value)},e[0]=h,e[1]=R):R=e[1];let _;e[2]!==S||e[3]!==R?(_=n.jsx("input",{type:"text",value:S,onChange:R,className:"w-full bg-transparent text-sm font-semibold truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"Page name"}),e[2]=S,e[3]=R,e[4]=_):_=e[4];let k;e[5]!==h?(k=l=>{g(l.target.value),h("path",l.target.value)},e[5]=h,e[6]=k):k=e[6];let o;e[7]!==v||e[8]!==k?(o=n.jsx("input",{type:"text",value:v,onChange:k,className:"w-full bg-transparent text-xs text-muted-foreground truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"/path"}),e[7]=v,e[8]=k,e[9]=o):o=e[9];let D;return e[10]!==_||e[11]!==o?(D=n.jsxs("div",{className:"space-y-1",children:[_,o]}),e[10]=_,e[11]=o,e[12]=D):D=e[12],D}function zn(m){const e=He.c(6),{onClick:r}=m;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(ia,{size:14}),e[0]=c):c=e[0];let d;e[1]!==r?(d=n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:r,children:c})}),e[1]=r,e[2]=d):d=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(pt,{side:"bottom",children:"Add variant"}),e[3]=h):h=e[3];let S;return e[4]!==d?(S=n.jsxs(mt,{children:[d,h]}),e[4]=d,e[5]=S):S=e[5],S}function Ql({orgSlug:m,virtualMcpId:e,branch:r,previewReady:c=!0,previewUrl:d,currentPath:h,activePageBlockKey:S=null,activeGlobalBlockKey:p=null,externalSelectedIndex:v,onSaved:g,initialEditSeo:y=!1,onExitSeo:C,onViewJsonFile:R,onVariantPreviewOverride:_}){const k=c?{orgSlug:m,virtualMcpId:e,branch:r,previewUrl:d}:null,{data:o,isLoading:D}=Ns(k),{data:l,isLoading:J}=Vs(k),H=Cs(),K=H?.entity?.id===e?H.entity.metadata?.siteSlug??null:null,[u,P]=w.useState(null),[se,T]=w.useState(null),[pe,N]=w.useState(null),[ce,B]=w.useState(0),[te,oe]=w.useState(void 0),[Ce,E]=w.useState(null),[ue,ie]=w.useState(null),[je,M]=w.useState([]),[Ae,X]=w.useState(0),[Ne,ve]=w.useState(null),[re,G]=w.useState(null),[q,ne]=w.useState(null),[le,ke]=w.useState(!0),[Se,de]=w.useState(!1),[ye,$]=w.useState(!1),[Z,we]=w.useState(y),[Ke,$e]=w.useState(y);y&&!Ke&&($e(!0),we(!0),P(null),T(null),N(null),M([])),!y&&Ke&&$e(!1);const[Le,Pe]=w.useState(null),[Oe,Fe]=w.useState(void 0),[Me,xe]=w.useState([]),[Re,me]=w.useState(0),[ee,L]=w.useState(0),[ae,Q]=w.useState(null),[Ie,he]=w.useState(null),[Qe,dn]=w.useState(null),xa=Ss(),ba=`${m}/${e}/${r}`,Ht=Ps({orgSlug:m,virtualMcpId:e,branch:r}),[ya,_a]=w.useState(h),[ja,ka]=w.useState(S),[wa,Ra]=w.useState(p);(ya!==h||ja!==S||wa!==p)&&(queueMicrotask(()=>Ht.flush()),_a(h),ka(S),Ra(p),P(null),T(null),N(null),B(0),E(null),ie(null),L(0),Q(null),he(null),M([]),X(t=>t+1),we(!1),Pe(null),Fe(void 0),xe([]),me(t=>t+1));const be=Ts({orgSlug:m,virtualMcpId:e,branch:r}),Nt=Xs((t,a)=>{be.mutate({blockKey:t,data:a},{onSuccess:()=>g?.(),onError:s=>W.error(`Save failed: ${s.message}`)})}),Ut=As({orgSlug:m,virtualMcpId:e,branch:r}),[yt,Vt]=w.useState(!1),Wt=w.useRef(null),ht=w.useRef(null),gt=w.useRef(null),Gt=w.useRef({}),qe=w.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!c||D||J)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(Hn,{size:20,className:"animate-spin text-muted-foreground"})});if(!o||!l)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Could not load site data."});const Da=Ms(o),_e=!!p,ze=_e?null:Es(Da,h,S),j=_e?p:ze?.key??null,qt=_e&&p?o[p]:void 0,mn=_e&&p&&qt?Ks(p,qt):_e&&p?p:"",Ct=!_e&&j&&o[j]?o[j]:null,Yt=Z&&o&&l&&j&&ze?$n(o,{kind:"page",pageKey:j,pageName:String(ze.name??""),path:String(ze.path??"")},l):null,Na=Z?Ct?.seo:void 0,Jt=Oe!==void 0?Oe:Na,Va=Z?Rr(Jt):void 0,Ca=Yt?.seoTypeOptions??[],Pa=Z&&l?Dr(l):"",fn=Le??Va??{},Qt=Z&&Yt?Nr(fn,Yt):null,Ta=Z&&Qt&&Vr(Jt)?Ot(Qt,l):null,Aa=Z?Cr(o,l)?.seoData:void 0,Be=_e?[{label:"Default",sections:[{__resolveType:p}]}]:oo(Ct?.sections,o??{}),Pt=Be.length>1,Ve=Math.min(ce,Be.length-1),nt=Be[Ve],I=nt?.sections??[],Te=Bt(I,o),pn=!_e&&$s(Ct?.sections);if(_e&&p&&Qe!==p){dn(p);const t=I[0],a=Te[0];if(t&&a){P(0),L(0),M([]);const s=ut(t,a,o);s&&(T(s.data),N(s.resolveType),he(null),Q(null))}}!_e&&Qe!==null&&dn(null),qe.current={rawSections:I,parsedSections:Te,decofile:o??{},activePageKey:j,pageVariants:Be,variantIndex:Ve,sectionVariantIndex:ee,selectedSectionIndex:u};const Ma=()=>({multivariate:pn,index:Ve,variants:Be.map(t=>({rule:t.rule}))}),hn=(t,a)=>{if(!_)return;if(!j||!pn||t.length<=1){_(null);return}const s=En(j,{multivariate:!0,index:a,variants:t},o,l);_(s.length>0?s:null)},vt=(t,a,s)=>{if(!_)return;if(!j){_(null);return}const i=Ma(),f=En(j,i,o,l);if(!t||a<0){_(f.length>0?f:null);return}const b=ar({pageKey:j,page:i,sectionIndex:a,sectionLazy:Te[a]?.isLazy??!1,mvObj:t,selectedVariantIndex:s,decofile:o,meta:l}),x=[...f,...b];_(x.length>0?x:null)},at=(t,a,s,i=u??-1,f=!1)=>{const b=Je(t,a);if(!b){T(null),N(null),he(null),Q(null),f&&vt(null,i,s);return}const V=Cn(b,tt)[s];if(!V){T(null),N(null),he(null),Q(null),f&&vt(null,i,s);return}const Y=Hs(V.value,o);T(Y?.data??null),N(Y?.resolveType??null);const{resolveType:A,formValue:O}=jt(V.rule,o,l??void 0);he(A),Q(O),f&&vt(b,i,s)};if(v!==void 0&&v!==te&&(oe(v??null),typeof v=="number")){const t=I[v],a=Te[v];if(t&&a)if(P(v),L(0),M([]),X(s=>s+1),a.isMultivariate)at(t,a,0,v);else{const s=ut(t,a,o);s?(T(s.data),N(s.resolveType)):(T(null),N(null)),he(null),Q(null)}}const Tt={orgSlug:m,virtualMcpId:e,branch:r,previewUrl:d??void 0,siteSlug:K},Xt=pe&&l?Ot(pe,l):null,Ue=(t,a)=>{if(!j)return;const s=wt(o,j,t,Ve,Be);be.mutate({blockKey:j,data:s},{onSuccess:()=>a?.onSuccess?.()??g?.(),onError:i=>W.error(`Save failed: ${i.message}`)})},St=()=>{P(null),T(null),N(null),L(0),Q(null),he(null),M([]),X(t=>t+1)},Ea=(t,a)=>{Wt.current&&clearTimeout(Wt.current);const s=qe.current.sectionVariantIndex;Wt.current=setTimeout(()=>{const{rawSections:i,parsedSections:f,decofile:b,activePageKey:x,pageVariants:V,variantIndex:Y}=qe.current,A=i[a];if(!A)return;const O=f[a];if(!O)return;if(O.isSavedBlock){const z=O.isLazy?A.section?.__resolveType??A.__resolveType:A.__resolveType;be.mutate({blockKey:z,data:t},{onSuccess:()=>g?.(),onError:U=>W.error(`Save failed: ${U.message}`)});return}if(!x)return;const F={...b[x]},ge=[...i];if(O.isMultivariate){const z=Je(A,O);if(!z||!x)return;const U=rr(z,s,t);ge[a]=dt(A,O,U)}else if(O.isHidden){const z=qn(A.__resolveType),U=z?{...A.section}:{...A},De=Array.isArray(U.variants)?[...U.variants]:[];De[0]&&(De[0]={...De[0],value:t}),U.variants=De,z?ge[a]={...A,section:U}:ge[a]=U}else O.isLazy?ge[a]={...A,section:t}:ge[a]=t;if(V.length>1){const z=F.sections,U=[...z?.variants??[]];U[Y]&&(U[Y]={...U[Y],value:ge}),F.sections={...z,variants:U}}else F.sections=ge;be.mutate({blockKey:x,data:F},{onSuccess:()=>g?.(),onError:z=>W.error(`Save failed: ${z.message}`)})},on)},Ka=t=>{P(t),L(0),M([]),X(f=>f+1);const a=I[t],s=Te[t];if(!a||!s)return;if(s.isMultivariate){at(a,s,0,t);return}const i=ut(a,s,o);if(!i){T(null),N(null),he(null),Q(null),vt(null,t,0);return}T(i.data),N(i.resolveType),he(null),Q(null),vt(null,t,0)},gn=t=>{const a=t;T(a),u!==null&&Ea(a,u)},Zt=t=>{if(!j||!o||!l||!ze)return;const a={kind:"page",pageKey:j,pageName:String(ze.name??""),path:String(ze.path??"")},s=$n(o,a,l);s&&Ht.save(j,()=>{const i=xa.getQueryData(xs.decofile(ba))?.[j];if(!i||typeof i!="object"||i===null||Array.isArray(i))return null;const f={...i,...Gt.current};return Gt.current={},t?.raw!==void 0?{...f,seo:t.raw}:t?.inner!==void 0?Tr(a,s,f,t.inner):f})},$a=(t,a)=>{j&&(Gt.current[t]=a,Zt())},Oa=(t,a)=>{if(!j)return;const s=Rt([...I],t,a);u!==null&&(u===t?P(a):t<u&&a>=u?P(u-1):t>u&&a<=u&&P(u+1)),Ue(s)},Ba=t=>{if(!j)return;const a=I.filter((s,i)=>i!==t);u===t?St():u!==null&&u>t&&P(u-1),Ue(a)},La=t=>{if(!j)return;const a=I[t];if(!a)return;const s=[...I];s.splice(t+1,0,nr(a)),u!==null&&u>t&&P(u+1),Ue(s)},Fa=t=>{if(!j)return;const a=I[t],s=Te[t];if(!a||!s||s.isMultivariate)return;const i=s.isHidden?er(a):tr(a);if(!i)return;const f=[...I];f[t]=i,u===t&&St(),Ue(f)},Ia=t=>{if(!j)return;const a=I[t],s=Te[t];if(!a||!s||s.isMultivariate)return;const i=Zs(a);if(!i)return;const f=[...I];f[t]=i,u===t&&St(),Ue(f)},za=t=>{if(!j)return;const a=I[t],s=Te[t];if(!a||!s?.isSavedBlock)return;const i=ut(a,s,o);if(!i?.data)return;const{name:f,...b}=i.data,x=[...I];s.isLazy?x[t]={...a,section:b}:x[t]=b,u===t&&St(),Ue(x)},Ha=t=>{if(!j)return;const a=[...I,{__resolveType:t.resolveType}],s=a.length-1;Ue(a,{onSuccess:()=>{de(!1),P(s),L(0),M([]),X(x=>x+1);const i=a[s],f=Bt(a,o)[s];if(!i||!f)return;if(f.isMultivariate){at(i,f,0);return}const b=ut(i,f,o);if(!b){T(null),N(null),he(null),Q(null);return}T(b.data),N(b.resolveType),he(null),Q(null)}})},Ua=t=>{if(u===null)return;const a=I[u],s=Te[u];!a||!s?.isMultivariate||(L(t),M([]),X(i=>i+1),at(a,s,t,u,!0))},Wa=t=>{if(u===null||!j)return;const a=I[u],s=Te[u];if(!a||!s?.isMultivariate)return;const i=Je(a,s);if(!i)return;const f=Js(i,t);if(!f){W.error("Cannot delete the only variant.");return}const b=[...I];b[u]=dt(a,s,f);const x=f.variants;let V=ee;t===ee?V=Math.min(t,x.length-1):t<ee&&(V=ee-1),L(V),M([]),X(Y=>Y+1),at(b[u],s,V),Ue(b)},Ga=t=>{if(u===null||!j)return;const a=I[u],s=Te[u];if(!a||!s?.isMultivariate)return;const i=Je(a,s);if(!i)return;const f=Qs(i,t),b=[...I];b[u]=dt(a,s,f);const x=t+1;L(x),M([]),X(V=>V+1),at(b[u],s,x),Ue(b)},qa=(t,a)=>{if(u===null||!j||t===a)return;const s=I[u],i=Te[u];if(!s||!i?.isMultivariate)return;const f=Je(s,i);if(!f)return;const b=qs(f,t,a),x=[...I];x[u]=dt(s,i,b);let V=ee;ee===t?V=a:t<ee&&a>=ee?V=ee-1:t>ee&&a<=ee&&(V=ee+1),L(V),at(x[u],i,V),Ue(x)},en=t=>{const a=t??u;if(a===null||!j)return;const s=I[a],i=Te[a];if(!s||!i)return;const f=Us(s,i);if(!f){W.error("This section cannot have variants.");return}const b=[...I];b[a]=f.section;const x=Bt(b,o)[a];if(!x?.isMultivariate){W.error("Could not add variant.");return}P(a),L(f.newVariantIndex),M([]),X(V=>V+1),at(f.section,x,f.newVariantIndex,a),Ue(b)},Ya=()=>{if(u===null||!j)return;const t=I[u],a=Te[u];if(!t||!a?.isMultivariate)return;const s=Je(t,a);if(!s)return;const i=Ys(t,a,s);if(!i){W.error("Could not remove variants.");return}const f=[...I];f[u]=i;const b=Bt(f,o)[u];if(!b)return;L(0),he(null),Q(null),M([]),X(V=>V+1);const x=ut(i,b,o);x?(T(x.data),N(x.resolveType)):(T(null),N(null)),vt(null,u,0),Ue(f)},Ja=async t=>{if(Ne===null||!j)return;const a=rn(t,o);if(a){W.error(a);return}const s=I[Ne],i=Te[Ne];if(!s||!i)return;const f=ut(s,i,o);if(!f){W.error("This section cannot be saved as global.");return}const b={...f.data,name:t};try{await be.mutateAsync({blockKey:t,data:b});const x=[...I];x[Ne]={__resolveType:t},await be.mutateAsync({blockKey:j,data:wt(o,j,x,Ve,Be)}),u===Ne&&St(),ve(null),W.success(`Saved global block "${t}"`),g?.()}catch(x){W.error(x instanceof Error?x.message:"Failed to save global block")}},vn=nt?.rule;if(Pt&&u===null&&ue===null&&vn){const{resolveType:t,formValue:a}=jt(vn,o??{},l??void 0);ie(t),E(a)}const At=l?Os(l):[],Sn=l&&o?Bs(l,o):[],Qa=!_e&&!!(d&&l&&o),xn=ue&&l?Ot(ue,l):null,Mt=()=>{ht.current&&(clearTimeout(ht.current),ht.current=null),gt.current&&(clearTimeout(gt.current),gt.current=null)},_t=async(t,a)=>{if(!(sr(a,t,l)>0))try{await Ut.mutateAsync({blockKey:t})}catch(s){W.error(s instanceof Error?s.message:"Could not delete matcher block")}},bn=t=>{ht.current&&clearTimeout(ht.current),ht.current=setTimeout(()=>{const{activePageKey:a,decofile:s,variantIndex:i}=qe.current;if(!a)return;const f={...s[a]},b={...f.sections},x=[...b.variants??[]],V=x[i],Y=V?.rule;if(xt(Y,s,l)){const A=Y?.__resolveType??"",O=s[A],F=typeof O?.name=="string"?O.name:A,{__resolveType:ge,...z}=t;be.mutate({blockKey:A,data:bt(ge??"",z,F)},{onSuccess:()=>g?.(),onError:U=>W.error(`Save failed: ${U.message}`)});return}V&&(x[i]={...V,rule:t}),f.sections={...b,variants:x},be.mutate({blockKey:a,data:f},{onSuccess:()=>g?.(),onError:A=>W.error(`Save failed: ${A.message}`)})},on)},Xa=t=>{ie(t);const a=t?{__resolveType:t}:{__resolveType:Kn};E({}),bn(a)},Za=t=>{const a=t;E(a);const s=ue?{__resolveType:ue,...a}:{...a};bn(s)},es=async t=>{Mt();const{activePageKey:a,decofile:s,variantIndex:i}=qe.current;if(!a)return;const f=s[a],b=f?.sections;if(!b||typeof b!="object"||Array.isArray(b))return;const x=b;if(!Array.isArray(x.variants))return;const V=[...x.variants],Y=V[i];if(!Y)return;const A=kt(Y.rule,s,l),O=Ft(t);V[i]={...Y,rule:O};const F={...s,[a]:{...f,sections:{...x,variants:V}}},{resolveType:ge,formValue:z}=jt(O,F,l??void 0);ie(ge),E(z);try{await be.mutateAsync({blockKey:a,data:F[a]}),A&&A!==t&&await _t(A,F),g?.()}catch(U){W.error(U instanceof Error?U.message:"Could not apply saved rule")}},yn=t=>{gt.current&&clearTimeout(gt.current);const{selectedSectionIndex:a,sectionVariantIndex:s}=qe.current;a!==null&&(gt.current=setTimeout(()=>{const{rawSections:i,parsedSections:f,decofile:b,activePageKey:x,pageVariants:V,variantIndex:Y}=qe.current;if(!x)return;const A=i[a],O=f[a];if(!A||!O?.isMultivariate)return;const F=Je(A,O);if(!F)return;const z=(F.variants??[])[s]?.rule;if(xt(z,b,l)){const fe=z?.__resolveType??"",We=b[fe],Ze=typeof We?.name=="string"?We.name:fe,{__resolveType:rt,...et}=t;be.mutate({blockKey:fe,data:bt(rt??"",et,Ze)},{onSuccess:()=>g?.(),onError:ot=>W.error(`Save failed: ${ot.message}`)});return}const U=Tn(F,s,t),De=[...i];De[a]=dt(A,O,U);const Ye=wt(b,x,De,Y,V);be.mutate({blockKey:x,data:Ye},{onSuccess:()=>g?.(),onError:fe=>W.error(`Save failed: ${fe.message}`)})},on))},ts=t=>{he(t),Q({}),yn(t?{__resolveType:t}:{__resolveType:Kn})},ns=t=>{const a=t;Q(a);const s=Ie?{__resolveType:Ie,...a}:{...a};yn(s)},as=async t=>{Mt();const{selectedSectionIndex:a,sectionVariantIndex:s,rawSections:i,parsedSections:f,decofile:b,activePageKey:x,pageVariants:V,variantIndex:Y}=qe.current;if(a===null||!x)return;const A=i[a],O=f[a];if(!A||!O?.isMultivariate)return;const F=Je(A,O);if(!F)return;const ge=F.variants??[],z=kt(ge[s]?.rule,b,l),U=Ft(t),De=Tn(F,s,U),Ye=[...i];Ye[a]=dt(A,O,De);const fe=wt(b,x,Ye,Y,V),We={...b,[x]:fe},{resolveType:Ze,formValue:rt}=jt(U,We,l??void 0);he(Ze),Q(rt);try{await be.mutateAsync({blockKey:x,data:fe}),z&&z!==t&&await _t(z,We),g?.()}catch(et){W.error(et instanceof Error?et.message:"Could not apply saved rule")}};if(!_e&&!ze)return n.jsxs("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:["No page found for ",h]});if(_e&&!qt)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Global block not found"});const st=u!==null?Te[u]??null:null,_n=u!==null?I[u]:null,jn=_n&&st?.isMultivariate?Je(_n,st):null,lt=jn?Cn(jn,tt):[],tn=Math.min(ee,Math.max(lt.length-1,0)),Et=lt[tn]??null,ct=st?.isMultivariate===!0,kn=u!==null&&st!==null,Kt=kn&&(ct||!!(Xt&&se)),ss=Kt&&!_e&&st?.isSavedBlock===!0,Xe=_e||ss,rs=_e?mn:st?.label??"",wn=Ie&&l?Ot(Ie,l):null,nn=Kt&&(!_e||je.length>0)?_e?[mn,...je]:[ze.name,st.label,...ct&&Et?[Et.label]:[],...je]:[],os=Z&&ze?[ze.name,"SEO",...Me]:[],$t=Z?os:Xe?nn.length>0?nn:[rs]:nn,Rn=()=>{if(!j)return;const t=o[j],a=Ws(t.sections,I);if(!a)return;const s=Gs(a);be.mutate({blockKey:j,data:{...t,sections:a}},{onSuccess:()=>{B(s),P(null),T(null),N(null),M([]),E(null),ie(null)},onError:i=>W.error(`Save failed: ${i.message}`)})},an=(t,a,s)=>{if(!j)return;const i=o[j],f=i.sections;if(!f||typeof f!="object"||Array.isArray(f))return;const b=f;if(!Array.isArray(b.variants))return;const x=t([...b.variants]);if(!x)return;const V=or(b,x),Y={...o,[j]:{...i,sections:V}};be.mutate({blockKey:j,data:Y[j]},{onSuccess:()=>{a?.(),s&&_t(s,Y)},onError:A=>W.error(`Save failed: ${A.message}`)})},is=t=>{G(null),B(t),P(null),T(null),N(null),M([]);const a=Be[t]?.rule,{resolveType:s,formValue:i}=jt(a,o??{},l??void 0);ie(s),E(i),hn(Be.map(f=>({rule:f.rule})),t)},ls=(t,a)=>{if(t===a)return;let s=Ve;Ve===t?s=a:t<Ve&&a>=Ve?s=Ve-1:t>Ve&&a<=Ve&&(s=Ve+1),B(s);const i=Rt(Be.map(f=>({rule:f.rule})),t,a);hn(i,s),an(f=>Rt(f,t,a))},cs=t=>{const a=Be[t]?.rule,s=kt(a,o??{},l??void 0);an(i=>i.length<=1?null:(i.splice(t,1),i),()=>{Be.length-1===1?B(0):t<Ve?B(Ve-1):t===Ve&&B(Math.max(0,t-1)),P(null),T(null),N(null),M([]),E(null),ie(null)},s)},us=t=>{an(a=>ir(a,t),()=>{B(t+1),P(null),T(null),N(null),M([]),E(null),ie(null)})},ds=async(t,a)=>{Mt();const s=qe.current.activePageKey,i=qe.current.decofile;if(!s)return;const f=i[s],b=f.sections;if(!b||typeof b!="object"||Array.isArray(b))return;const x=b;if(!Array.isArray(x.variants))return;const V=[...x.variants],Y=V[t];if(!Y?.rule||typeof Y.rule!="object"){W.error("This variant has no matcher rule to rename.");return}const A=Y.rule,O=a.trim();Vt(!0);try{if(!O){if(!xt(A,i,l)){G(null);return}const Ye=A.__resolveType??"";V[t]={...Y,rule:An(A,i,l)};const fe={...i,[s]:{...f,sections:{...x,variants:V}}};await be.mutateAsync({blockKey:s,data:fe[s]}),await _t(Ye,fe),G(null),g?.();return}const F=Mn(A,i,l);if(!F){W.error("Could not read this variant's matcher rule.");return}if(F.blockKey){await be.mutateAsync({blockKey:F.blockKey,data:bt(F.resolveType,F.data,O)}),G(null),g?.();return}const ge=sn(O),z=rn(ge,i);if(z){W.error(z);return}const U=bt(F.resolveType,F.data,O);let De=null;try{await be.mutateAsync({blockKey:ge,data:U}),De=ge,V[t]={...Y,rule:Ft(ge)},await be.mutateAsync({blockKey:s,data:{...f,sections:{...x,variants:V}}}),De=null}catch(Ye){throw De&&await Ut.mutateAsync({blockKey:De}).catch(()=>{}),Ye}G(null),W.success(`Saved matcher as global block "${O}"`),g?.()}catch(F){W.error(F instanceof Error?F.message:"Failed to rename variant")}finally{Vt(!1)}},ms=async(t,a)=>{Mt();const{selectedSectionIndex:s,rawSections:i,parsedSections:f,decofile:b,activePageKey:x,pageVariants:V,variantIndex:Y}=qe.current;if(s===null||!x)return;const A=i[s],O=f[s];if(!A||!O?.isMultivariate)return;const F=Je(A,O);if(!F)return;const ge=F.variants??[],z=ge[t];if(!z?.rule||typeof z.rule!="object"){W.error("This variant has no matcher rule to rename.");return}const U=z.rule,De=a.trim();Vt(!0);const Ye=async fe=>{const We={...F,variants:fe},Ze=[...i];Ze[s]=dt(A,O,We);const rt=wt(b,x,Ze,Y,V);return await be.mutateAsync({blockKey:x,data:rt}),{...b,[x]:rt}};try{if(!De){if(!xt(U,b,l)){ne(null);return}const ot=U.__resolveType??"",Vn=[...ge];Vn[t]={...z,rule:An(U,b,l)};const vs=await Ye(Vn);await _t(ot,vs),ne(null),g?.();return}const fe=Mn(U,b,l);if(!fe){W.error("Could not read this variant's matcher rule.");return}if(fe.blockKey){await be.mutateAsync({blockKey:fe.blockKey,data:bt(fe.resolveType,fe.data,De)}),ne(null),g?.();return}const We=sn(De),Ze=rn(We,b);if(Ze){W.error(Ze);return}const rt=bt(fe.resolveType,fe.data,De);let et=null;try{await be.mutateAsync({blockKey:We,data:rt}),et=We;const ot=[...ge];ot[t]={...z,rule:Ft(We)},await Ye(ot),et=null}catch(ot){throw et&&await Ut.mutateAsync({blockKey:et}).catch(()=>{}),ot}ne(null),W.success(`Saved matcher as global block "${De}"`),g?.()}catch(fe){W.error(fe instanceof Error?fe.message:"Failed to rename variant")}finally{Vt(!1)}},Dn=()=>{St()},fs=t=>{Pe(t),Zt({inner:t})},ps=t=>{Fe(t),Zt({raw:t})},hs=()=>{Pe(null),xe([])},gs=()=>me(t=>t+1),Nn=t=>{if(Z){if(t===0){Ht.flush(),we(!1),Pe(null),Fe(void 0),xe([]),me(s=>s+1),C?.();return}if(t===1){xe([]),me(s=>s+1);return}xe(Me.slice(0,t-1)),me(s=>s+1);return}if(_e){M(je.slice(0,t)),X(s=>s+1);return}if(t===0){Dn();return}if(t===1){M([]),X(s=>s+1);return}if(ct&&t===2){M([]),X(s=>s+1);return}const a=ct?2:1;M(je.slice(0,t-a))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:Xe||Kt||Z?n.jsxs("div",{className:Ee("border-b px-3 py-2.5",Xe&&"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:[$t.length>1&&n.jsx("button",{type:"button",onClick:()=>Nn($t.length-2),title:"Back","aria-label":"Back",className:Ee("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",Xe?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(sa,{className:"size-4"})}),!_e&&Pt&&nt&&n.jsxs("button",{type:"button",onClick:Dn,title:`Editing in variant: ${nt.label}`,className:Ee("shrink-0 inline-flex items-center gap-1 rounded-md h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",ro),children:[n.jsx(va,{rule:Dt(nt.rule,o??{},l??void 0),matchers:At}),n.jsx("span",{className:"max-w-[160px] truncate",children:nt.label})]}),n.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:$t.map((t,a)=>{const s=a===$t.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[a>0&&n.jsx(ra,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Nn(a),title:t,className:Ee("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",s?Xe?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":Xe?"text-foreground/80":"text-muted-foreground",Xe?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${a}`)})}),Xe&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(fr,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(pt,{side:"bottom",className:"max-w-[260px]",children:"A global section is a reusable block shared across your site. Editing it here updates it everywhere it's used."})]}),kn&&!ct&&!st?.isHidden&&j&&n.jsx(zn,{onClick:()=>en()})]}),Xe&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:"This is a global section. Changes apply everywhere this section is used across your site."})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(io,{pageKey:j,initialName:ze.name,initialPath:ze.path,onFieldChange:$a})}),n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"Edit SEO",className:"size-7 shrink-0",onClick:()=>we(!0),children:n.jsx(dr,{size:14})})}),n.jsx(pt,{side:"bottom",children:"Edit SEO"})]}),n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(Ge,{type:"button",variant:"ghost",size:"icon","aria-label":"View JSON",className:"size-7 shrink-0",onClick:()=>R&&j?R(j):$(!0),children:n.jsx(mr,{size:14})})}),n.jsx(pt,{side:"bottom",children:"View JSON"})]}),n.jsx(zn,{onClick:Rn})]})}),Z?n.jsx(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Ct&&j?n.jsx(Pr,{rawSeo:Jt,innerSeo:fn,defaultResolveType:Pa,seoSchema:Ta,activeResolveType:Qt,seoTypeOptions:Ca,formResetKey:Re,siteDefaultSeo:Aa,onBreadcrumbChange:xe,onPersistRaw:ps,onInnerChange:fs,onClearForm:hs,onBumpFormKey:gs}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"SEO schema not found for this site."})})})}):Kt?n.jsxs(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ct&&lt.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Ls,{listKey:`${j??""}:${u??""}`,variants:lt.map((t,a)=>({index:a,label:t.label})),selectedIndex:tn,onSelect:Ua,onRename:ne,onDuplicate:Ga,onDelete:Wa,onRemoveAll:Ya,onReorder:qa,onAdd:()=>en()}),ct&&n.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),n.jsx(Pn,{currentRt:Ie??"",currentLabel:Lt(Et?.rule,o??{},tt,l??void 0),currentGlobalKey:kt(Et?.rule,o??{},l??void 0)??void 0,matchers:At,globals:Sn,onSelect:ts,onSelectGlobal:as}),wn&&ae&&n.jsx("div",{className:"pt-1",children:n.jsx(Fn,{schema:wn,value:ae,onChange:ns,meta:l??void 0,decofile:o,onSaveReferencedBlock:Nt,sandbox:Tt},`${u??"none"}:${tn}:${Ie??""}`)})]})]}),n.jsx(In,{activeSchema:Xt,formValue:se,formResetKey:Ae,onFormChange:gn,onBreadcrumbChange:M,breadcrumbPath:je,emptyMessage:"No editable fields for this variant.",meta:l,decofile:o,onSaveReferencedBlock:Nt,sandbox:Tt})]}):_e?n.jsx(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(In,{activeSchema:Xt,formValue:se,formResetKey:Ae,onFormChange:gn,onBreadcrumbChange:M,breadcrumbPath:je,emptyMessage:"No editable fields for this global block.",meta:l,decofile:o,onSaveReferencedBlock:Nt,sandbox:Tt})}):n.jsxs(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Pt&&j&&n.jsx(ao,{listKey:j,variants:Be,activeIndex:Ve,decofile:o??{},meta:l,matchers:At,onSelect:is,onReorder:ls,onRename:G,onDuplicate:us,onDelete:cs,onAdd:Rn}),Pt&&ue!==null&&n.jsxs("div",{className:Ee("px-3 border-b",le?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>ke(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-sm py-0.5 hover:bg-muted/40","aria-expanded":le,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),le?n.jsx(cr,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(lr,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),le&&n.jsxs("div",{className:Ee("space-y-3",yt&&"pointer-events-none opacity-50"),children:[n.jsx(Pn,{currentRt:ue,currentLabel:Lt(nt?.rule,o??{},tt,l??void 0),currentGlobalKey:kt(nt?.rule,o??{},l??void 0)??void 0,matchers:At,globals:Sn,onSelect:Xa,onSelectGlobal:es}),xn&&Ce&&n.jsx("div",{className:"space-y-3",children:n.jsx(Fn,{schema:xn,value:Ce,onChange:Za,meta:l??void 0,decofile:o,onSaveReferencedBlock:Nt,sandbox:Tt},`${Ve}:${ue??""}`)})]})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(qr,{listKey:`${j??""}-${Ve}`,rawSections:I,sections:Te,meta:l,selectedIndex:u,onSelect:Ka,onReorder:Oa,onDelete:Ba,onDuplicate:La,onMakeReusable:ve,onToggleHidden:Fa,onToggleLazy:Ia,onAddVariant:en,onDetach:za,onAddSection:()=>de(!0),canAddSection:Qa})})]}),n.jsx(Fs,{open:Ne!==null,onOpenChange:t=>{t||ve(null)},defaultBlockId:Ne!==null?sn(Te[Ne]?.label??""):"",isPending:be.isPending,onSubmit:Ja}),d&&n.jsx(Er,{open:Se,onOpenChange:de,meta:l,decofile:o,previewBaseUrl:d,onSelect:Ha}),ye&&j&&o&&n.jsx(Is,{open:ye,onOpenChange:$,pageKey:j,decofile:o}),re!==null&&n.jsx(Bn,{open:!0,initialName:xt(Be[re]?.rule,o??{},l??void 0)?Lt(Be[re]?.rule,o??{},tt,l??void 0):"",autoLabel:tt(Dt(Be[re]?.rule,o??{},l??void 0)),isPending:yt,onSubmit:async t=>{await ds(re,t)},onOpenChange:t=>{!t&&!yt&&G(null)}}),q!==null&&n.jsx(Bn,{open:!0,initialName:xt(lt[q]?.rule,o??{},l??void 0)?Lt(lt[q]?.rule,o??{},tt,l??void 0):"",autoLabel:tt(Dt(lt[q]?.rule,o??{},l??void 0)),isPending:yt,onSubmit:async t=>{await ms(q,t)},onOpenChange:t=>{!t&&!yt&&ne(null)}})]})}export{Ql as SectionsEditor};