decocms 4.515.1 → 4.516.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (448) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-CHmxGMIj.js → ActiveShapeUtils-BviJ1RJ0.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-CUAx3A4b.js → AlertCircle-BzjzqqRa.js} +1 -1
  3. package/dist/client/assets/{AreaChart-CW0Iiw9b.js → AreaChart-DxdfvWkl.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-BWCsylYe.js → ArrowLeft-D9e74CxD.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-EL0FBv9C.js → ArrowUp-BbhuuuwV.js} +1 -1
  6. package/dist/client/assets/{BarChart-7G_lP-bc.js → BarChart-C6YMYkiP.js} +1 -1
  7. package/dist/client/assets/{Building02-PifDTlhb.js → Building02-C2flUGF-.js} +1 -1
  8. package/dist/client/assets/{CartesianChart-CQlacwEw.js → CartesianChart-CPZndNAT.js} +1 -1
  9. package/dist/client/assets/{CategoricalChart-QwBn7EzX.js → CategoricalChart-BjLODSSF.js} +3 -3
  10. package/dist/client/assets/{CheckCircle-CMGqXocs.js → CheckCircle-4gdTBGy6.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-BSRBjpBn.js → ChevronSelectorVertical-YTUkgDHg.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-x46FJEcD.js → ChevronUp-BnA2Nw_G.js} +1 -1
  13. package/dist/client/assets/{Copy01-OBSYmimV.js → Copy01-DK6eLr2i.js} +1 -1
  14. package/dist/client/assets/{CreditCard01-DWsSThAm.js → CreditCard01-CMqZSaqi.js} +1 -1
  15. package/dist/client/assets/{DotsVertical-jkvtcdek.js → DotsVertical-C4UAKneF.js} +1 -1
  16. package/dist/client/assets/{ErrorBarContext-MNRbBKZp.js → ErrorBarContext-bVCQsHLU.js} +1 -1
  17. package/dist/client/assets/{Globe04-blkS_Kfg.js → Globe04-DEY1e_cW.js} +1 -1
  18. package/dist/client/assets/{Image01-BCnLFq1D.js → Image01-DwBREChx.js} +1 -1
  19. package/dist/client/assets/{Key01-CG7Kua6O.js → Key01-MBTcw2W0.js} +1 -1
  20. package/dist/client/assets/{Link01-8aKNfNRw.js → Link01-CHLntxrX.js} +1 -1
  21. package/dist/client/assets/{LinkBroken01-DcsqjBuj.js → LinkBroken01-CTiL1Fp-.js} +1 -1
  22. package/dist/client/assets/{Minus-B38cW2ZC.js → Minus-BCeBycMD.js} +1 -1
  23. package/dist/client/assets/{Monitor01-DQEkUL3d.js → Monitor01-DtC0vfP6.js} +1 -1
  24. package/dist/client/assets/{Play-Ns9aRVTY.js → Play-DV5Ma4c6.js} +1 -1
  25. package/dist/client/assets/{Plus-vkM1FxVr.js → Plus-CxQiW556.js} +1 -1
  26. package/dist/client/assets/ReferenceLine-CyFWmCIf.js +1 -0
  27. package/dist/client/assets/{SearchMd-Cp6J-1Iu.js → SearchMd-CYuw_TlP.js} +1 -1
  28. package/dist/client/assets/{Sector-BeXkYaJv.js → Sector-7HoHBp31.js} +1 -1
  29. package/dist/client/assets/{ShoppingBag01-aJuRSlBz.js → ShoppingBag01-hqBb4euZ.js} +1 -1
  30. package/dist/client/assets/{Sun-k4hypx5Q.js → Sun-_7OyKm8q.js} +1 -1
  31. package/dist/client/assets/{SwitchHorizontal01-B5WFt7_0.js → SwitchHorizontal01-Ik-Wu8bp.js} +1 -1
  32. package/dist/client/assets/{Tool01-BsK9c3-e.js → Tool01-CEmvRWh7.js} +1 -1
  33. package/dist/client/assets/{Trash01-Z1ezoy3S.js → Trash01-7PWQCtvD.js} +1 -1
  34. package/dist/client/assets/{Upload01-B3-nlnKa.js → Upload01-d0p8GdRf.js} +1 -1
  35. package/dist/client/assets/{User01-C2Sw39bs.js → User01-CvsUVXiw.js} +1 -1
  36. package/dist/client/assets/{UserSquare-BBEl_BxL.js → UserSquare-CRvybnC2.js} +1 -1
  37. package/dist/client/assets/{Users01-DMFeioyM.js → Users01-BpDVBOEG.js} +1 -1
  38. package/dist/client/assets/{XClose-BdwIxxCT.js → XClose-CjXzVHwC.js} +1 -1
  39. package/dist/client/assets/{ZoomOut-DytgoG2i.js → ZoomOut-CLJKIGNa.js} +1 -1
  40. package/dist/client/assets/{access-gate-BUnHIPK_.js → access-gate-C_XxaZ28.js} +1 -1
  41. package/dist/client/assets/{add-connection-dialog-F6QQAEZv.js → add-connection-dialog-TX2J4mBu.js} +1 -1
  42. package/dist/client/assets/agent-analytics-CDwx4a2N.js +1 -0
  43. package/dist/client/assets/agent-app-G-hsYMQ8.js +1 -0
  44. package/dist/client/assets/agent-assets-DzeNVWVS.js +1 -0
  45. package/dist/client/assets/{agent-automation-CKRFKK95.js → agent-automation-fasQYxyE.js} +1 -1
  46. package/dist/client/assets/{agent-automations-CoXmwt9k.js → agent-automations-CFCWY442.js} +1 -1
  47. package/dist/client/assets/agent-calendar-DaZrWfix.js +1 -0
  48. package/dist/client/assets/{agent-connect-sources-B_bS144d.js → agent-connect-sources-CUS1mQBU.js} +1 -1
  49. package/dist/client/assets/agent-deck-CqPaTZAU.js +1 -0
  50. package/dist/client/assets/{agent-e2e-DC8ADnZZ.js → agent-e2e-JX70_ikL.js} +1 -1
  51. package/dist/client/assets/agent-experiments-Cvjx0r-V.js +1 -0
  52. package/dist/client/assets/agent-file-bVYB1cfC.js +1 -0
  53. package/dist/client/assets/{agent-hosting-Tr8uV5DY.js → agent-hosting-DXYhe_Ly.js} +1 -1
  54. package/dist/client/assets/{agent-icon--EtIPqub.js → agent-icon-DhApO92C.js} +1 -1
  55. package/dist/client/assets/agent-library-D15ABzqd.js +1 -0
  56. package/dist/client/assets/agent-library-file-B9iyqErA.js +1 -0
  57. package/dist/client/assets/agent-monitor-DGuiH3_O.js +1 -0
  58. package/dist/client/assets/agent-overview-DGX_nSiA.js +1 -0
  59. package/dist/client/assets/agent-releases-B4Wvo_4b.js +2 -0
  60. package/dist/client/assets/agent-settings-AZLE4kyB.js +1 -0
  61. package/dist/client/assets/{agent-site-editor-BML41A1E.js → agent-site-editor-CLwG7od-.js} +2 -2
  62. package/dist/client/assets/agent-site-editor-code-Dqh-CK3q.js +2 -0
  63. package/dist/client/assets/agent-site-editor-content-ZYGhs3a9.js +1 -0
  64. package/dist/client/assets/agent-site-editor-preview-DTKZdYCv.js +1 -0
  65. package/dist/client/assets/agent-view-D3mqLvwq.js +1 -0
  66. package/dist/client/assets/{agent-view-guard-BuPewEB-.js → agent-view-guard-wNwTHz77.js} +1 -1
  67. package/dist/client/assets/{agents-list-BxOpJ6GX.js → agents-list-Cikp_zRW.js} +1 -1
  68. package/dist/client/assets/{ai-providers-BgJW78yt.js → ai-providers-BSKNGjn3.js} +1 -1
  69. package/dist/client/assets/{alert-BDbwlXZm.js → alert-DK8EW5eY.js} +1 -1
  70. package/dist/client/assets/{alert-dialog-C-DaggA1.js → alert-dialog--q-PWeut.js} +1 -1
  71. package/dist/client/assets/{analytics-sections-i9-JccxC.js → analytics-sections-DMQ7rbtm.js} +1 -1
  72. package/dist/client/assets/analytics-tab-DBS1a1Hh.js +2 -0
  73. package/dist/client/assets/{api-keys-CsGvnzMj.js → api-keys-Dq1k7MiZ.js} +1 -1
  74. package/dist/client/assets/api-keys-J75u9n5h.js +1 -0
  75. package/dist/client/assets/app-editor-CrjU5dmy.js +1 -0
  76. package/dist/client/assets/{asset-utils-Cb8p2lKk.js → asset-utils-DobQJkEL.js} +1 -1
  77. package/dist/client/assets/{auth-C_nDagDA.js → auth-BCqAeFp3.js} +1 -1
  78. package/dist/client/assets/{auth-catchall-DLKOtnms.js → auth-catchall-BZEwAlpH.js} +1 -1
  79. package/dist/client/assets/{auth-entry-CGuqEb3C.js → auth-entry-Buz4HmC0.js} +1 -1
  80. package/dist/client/assets/{auth-split-layout-CA_lMCib.js → auth-split-layout-C7U-I3vQ.js} +1 -1
  81. package/dist/client/assets/{authenticate-and-persist-oauth-CpcQdSQ-.js → authenticate-and-persist-oauth-BAReQnW9.js} +1 -1
  82. package/dist/client/assets/{automation-list-row-B0U8Omed.js → automation-list-row-DYoDbKDa.js} +1 -1
  83. package/dist/client/assets/{automation-runs-CHS-S7AU.js → automation-runs-DS3JbQ2r.js} +1 -1
  84. package/dist/client/assets/{automations-BMiuIrti.js → automations-DnYOtmr4.js} +1 -1
  85. package/dist/client/assets/{autosend-xoWUmECR.js → autosend-CC_H9WVC.js} +1 -1
  86. package/dist/client/assets/{avatar-DHKJiyOX.js → avatar-BCxNXTas.js} +1 -1
  87. package/dist/client/assets/{badge-ux-RK1YK.js → badge-Ccv2yax2.js} +1 -1
  88. package/dist/client/assets/{block-document-C53UA67Y.js → block-document-pbAqRC0D.js} +3 -3
  89. package/dist/client/assets/{blocks-preview-workspace-context-CCLLqfhM.js → blocks-preview-workspace-context-CAntUw6y.js} +1 -1
  90. package/dist/client/assets/blocks-tab-states-B-gG8PUG.js +1 -0
  91. package/dist/client/assets/{blog-schema-CUXWCb3x.js → blog-schema-DP6BXJ_v.js} +1 -1
  92. package/dist/client/assets/{buckets-KXy-OHx-.js → buckets-YwJbmX1H.js} +1 -1
  93. package/dist/client/assets/{build-improve-prompt-doc-7EW1ZAui.js → build-improve-prompt-doc-yJWFG-Qh.js} +1 -1
  94. package/dist/client/assets/{calendar-qN6CeKGa.js → calendar-CWZHYNsm.js} +1 -1
  95. package/dist/client/assets/campaigns-view-BJ3dqrez.js +1 -0
  96. package/dist/client/assets/{capability-load-error-CoMXa4ni.js → capability-load-error-ClFcG_k7.js} +1 -1
  97. package/dist/client/assets/category-editor-BdRz9cOQ.js +1 -0
  98. package/dist/client/assets/{chart-86pPxb3F.js → chart-ecSSTZTh.js} +1 -1
  99. package/dist/client/assets/{chat-context-DXm8btNS.js → chat-context-BE5W0eRy.js} +2 -2
  100. package/dist/client/assets/{chat-draft-WGnppXw7.js → chat-draft-Bc38hokV.js} +1 -1
  101. package/dist/client/assets/{checkbox-vFQy8MvV.js → checkbox-BUQlb_zR.js} +1 -1
  102. package/dist/client/assets/{choose-editor-Bry8-aop.js → choose-editor-CTk7V5dU.js} +1 -1
  103. package/dist/client/assets/{cli-auth-success-BM0cUkz3.js → cli-auth-success-PigkRVuP.js} +1 -1
  104. package/dist/client/assets/{client-icons-M2pakr5u.js → client-icons-CfYl7gN_.js} +1 -1
  105. package/dist/client/assets/cms-settings-editor-B-g4hnK1.js +1 -0
  106. package/dist/client/assets/{collapsible-CnlVGt-G.js → collapsible-CUpe_nLN.js} +1 -1
  107. package/dist/client/assets/{collection-detail-B_r2Oxl1.js → collection-detail-DMeJtWOq.js} +1 -1
  108. package/dist/client/assets/{collection-display-button-ALXFDy_R.js → collection-display-button-BA8_qWgd.js} +1 -1
  109. package/dist/client/assets/{collection-search--9d0M5sc.js → collection-search-D3DfnNEj.js} +1 -1
  110. package/dist/client/assets/{collection-table-wrapper-DyQ4WIpY.js → collection-table-wrapper-BpHyZuIk.js} +1 -1
  111. package/dist/client/assets/{collection-tabs-BfpnVdlQ.js → collection-tabs-BeE9JyBt.js} +1 -1
  112. package/dist/client/assets/{column-rules-DgVqSNU2.js → column-rules-HrQ_91De.js} +1 -1
  113. package/dist/client/assets/{combobox-BMxhMbUn.js → combobox-pGuSce6D.js} +1 -1
  114. package/dist/client/assets/{command-BlBQgQPI.js → command-Due3aGE_.js} +1 -1
  115. package/dist/client/assets/{companion-mcps-section-B3EkkVtL.js → companion-mcps-section-B_r6DOQv.js} +1 -1
  116. package/dist/client/assets/{config-CE3I8pu5.js → config-4MxJL_Fy.js} +1 -1
  117. package/dist/client/assets/{connect-C4NhmEFJ.js → connect-BmT0JQ1F.js} +1 -1
  118. package/dist/client/assets/{connect-layout-DZGJCEON.js → connect-layout-2QgFH1-_.js} +1 -1
  119. package/dist/client/assets/connect-source-dialog-_wKkm_O5.js +1 -0
  120. package/dist/client/assets/{connection-card-DMfcnulT.js → connection-card-CawZtrlG.js} +1 -1
  121. package/dist/client/assets/{connection-detail-DxSeFIwH.js → connection-detail-Dm8uTSp4.js} +1 -1
  122. package/dist/client/assets/{connection-form-helpers-A3QfJozi.js → connection-form-helpers-_rP_t0oA.js} +1 -1
  123. package/dist/client/assets/{connection-Bo3v2rj5.js → connection-z8RZuoJq.js} +1 -1
  124. package/dist/client/assets/{connections-DzbvhEpV.js → connections-DY1nEMCe.js} +1 -1
  125. package/dist/client/assets/{content-tab-CaoAhPSw.js → content-tab-BMyhmLPO.js} +8 -8
  126. package/dist/client/assets/context-Br81mOVA.js +1 -0
  127. package/dist/client/assets/{context-menu-BD833dh0.js → context-menu-wXhD1da2.js} +1 -1
  128. package/dist/client/assets/{context-shell-D1uT0vY1.js → context-shell-CSyiGVu3.js} +3 -3
  129. package/dist/client/assets/{core.esm-DJ5llHMe.js → core.esm-C9O_xZ-F.js} +2 -2
  130. package/dist/client/assets/{create-organization-dialog-nhhaUNZK.js → create-organization-dialog-BULehCnN.js} +1 -1
  131. package/dist/client/assets/{daily-pulse-Cry9rVi8.js → daily-pulse-Biczsq5_.js} +1 -1
  132. package/dist/client/assets/{discover-C4Up8V0-.js → discover-DY6Qihlm.js} +1 -1
  133. package/dist/client/assets/{domain-settings-Bec9kB9d.js → domain-settings-D_mRu3Vm.js} +1 -1
  134. package/dist/client/assets/{drawer-0sYDH2mt.js → drawer-BXIYbAX4.js} +1 -1
  135. package/dist/client/assets/{editor-BctLuJLS.js → editor-DfNlEhGy.js} +1 -1
  136. package/dist/client/assets/{editor-classes-BnPaf--r.js → editor-classes-BgZFSVD_.js} +1 -1
  137. package/dist/client/assets/{empty-state-D6RWdvUz.js → empty-state-DHTpGmzV.js} +1 -1
  138. package/dist/client/assets/{empty-state-DeArX05X.js → empty-state-DK4d2ph4.js} +1 -1
  139. package/dist/client/assets/experiments-tab-Bxbw5NAx.js +1 -0
  140. package/dist/client/assets/{experiments-tab-choice-CMHPX5ZC.js → experiments-tab-choice-Du4Lvv_w.js} +1 -1
  141. package/dist/client/assets/{extract-connection-data-CBAyhzk-.js → extract-connection-data-9sczZwO0.js} +1 -1
  142. package/dist/client/assets/{feature-gate-DQ0ZaDj1.js → feature-gate-b0u-JPA_.js} +1 -1
  143. package/dist/client/assets/{feature-paywall-hsFyGLR_.js → feature-paywall-BarXN_Ju.js} +1 -1
  144. package/dist/client/assets/{file-explorer-GrzeifA-.js → file-explorer-DnOLSPWJ.js} +1 -1
  145. package/dist/client/assets/{file-preview-Bcawxb03.js → file-preview-Cak1nE11.js} +1 -1
  146. package/dist/client/assets/{file-share-button-LmGmSS33.js → file-share-button-kIwp5G-u.js} +1 -1
  147. package/dist/client/assets/{file-type-icon-DHFVwXjA.js → file-type-icon-6tQy_IZ-.js} +1 -1
  148. package/dist/client/assets/{folder-icon-BwmfzM1C.js → folder-icon-R5rTkj7V.js} +1 -1
  149. package/dist/client/assets/{form-D4PspedZ.js → form-DuWo7Npn.js} +1 -1
  150. package/dist/client/assets/{general-CXfgWejD.js → general-Cez86_jx.js} +1 -1
  151. package/dist/client/assets/home-3R5Jmd9M.js +1 -0
  152. package/dist/client/assets/hosted-publish-api-CReqocob.js +1 -0
  153. package/dist/client/assets/hosted-publish-feedback-BuFauPpC.js +1 -0
  154. package/dist/client/assets/{icon-button-HZwQKD3a.js → icon-button-DetNbpEP.js} +1 -1
  155. package/dist/client/assets/{index-BCHFFeZZ.js → index-B0KYQovx.js} +1 -1
  156. package/dist/client/assets/{index-D_6gfRTQ.js → index-BOTs238f.js} +1 -1
  157. package/dist/client/assets/{index-XzZeDzj0.js → index-BdhYTUJI.js} +1 -1
  158. package/dist/client/assets/{index-DgfcOEet.js → index-C9OicJ74.js} +1 -1
  159. package/dist/client/assets/{index-B32YFtAw.js → index-CRcEuXTH.js} +1 -1
  160. package/dist/client/assets/{index-BjrJaWD9.js → index-CU2v_61i.js} +1 -1
  161. package/dist/client/assets/{index-CgVQmSg0.js → index-CkQE3ies.js} +1 -1
  162. package/dist/client/assets/index-Cl9QwptG.js +1 -0
  163. package/dist/client/assets/{index-DNa7Epd0.js → index-DHWYq2vY.js} +1 -1
  164. package/dist/client/assets/{index-ifZGovK1.js → index-D_jzSCP9.js} +52 -52
  165. package/dist/client/assets/{index-Bxkd37dZ.js → index-DjG04H6F.js} +1 -1
  166. package/dist/client/assets/index-DjdMnw7p.css +1 -0
  167. package/dist/client/assets/{index-gqp4B5qj.js → index-DlAj9KxS.js} +1 -1
  168. package/dist/client/assets/{index-CafY8AgN.js → index-DppGNDNw.js} +1 -1
  169. package/dist/client/assets/{index-CvMuyNgv.js → index-DyvCBoQO.js} +1 -1
  170. package/dist/client/assets/{index-BeV3dEoK.js → index-Nkc_avaN.js} +2 -2
  171. package/dist/client/assets/{index-redirect-BKvfBlvA.js → index-redirect-ZRzjZAU7.js} +1 -1
  172. package/dist/client/assets/{infiniteQueryObserver-DvmMaiCa.js → infiniteQueryObserver-nO7Ij1Gh.js} +1 -1
  173. package/dist/client/assets/{infra-billing-WLIR9CQb.js → infra-billing-BzKPkpZz.js} +1 -1
  174. package/dist/client/assets/{input-BeDIlaby.js → input---GPY-WG.js} +1 -1
  175. package/dist/client/assets/input-BS1vg5HJ.js +17 -0
  176. package/dist/client/assets/{integration-icon-D1aQLe0v.js → integration-icon-BKkvrbiZ.js} +1 -1
  177. package/dist/client/assets/{jira-icon-Bs7EGbwb.js → jira-icon-CNOdA3T8.js} +1 -1
  178. package/dist/client/assets/{label-Dhoh3DcI.js → label-BHfVaXR7.js} +1 -1
  179. package/dist/client/assets/{layout-dz9-bhT2.js → layout-CDcVgS1C.js} +1 -1
  180. package/dist/client/assets/{legacy-agents-deep-DO-8kywe.js → legacy-agents-deep-DPDWZmqy.js} +1 -1
  181. package/dist/client/assets/{legacy-main-redirect-BMyuR4az.js → legacy-main-redirect-Cg_g45Jd.js} +1 -1
  182. package/dist/client/assets/library-DJVFXK7P.js +1 -0
  183. package/dist/client/assets/{login-DwOQDvQC.js → login-wOfUg9Nh.js} +1 -1
  184. package/dist/client/assets/{markdown-prFeEkT4.js → markdown-Cd88osrX.js} +1 -1
  185. package/dist/client/assets/{mcp-app-renderer-fHjuxWIZ.js → mcp-app-renderer-CFMsjvxz.js} +1 -1
  186. package/dist/client/assets/{mcp-oauth-CTJ5Iw4i.js → mcp-oauth-CReJrypj.js} +1 -1
  187. package/dist/client/assets/{mcp-oauth-CNKUkWMd.js → mcp-oauth-DQ_xwjzU.js} +1 -1
  188. package/dist/client/assets/{members-B9Wn7yAF.js → members-EL9Mc9m1.js} +1 -1
  189. package/dist/client/assets/{memory-BDb7_tyh.js → memory-BawNPVGj.js} +1 -1
  190. package/dist/client/assets/{mini-report-page-Bsjfan82.js → mini-report-page-BAVRLfhx.js} +1 -1
  191. package/dist/client/assets/{mock-board-BWfjyR2S.js → mock-board-CUvkl6Lq.js} +3 -3
  192. package/dist/client/assets/{monaco-editor-Wx_2qGOP.js → monaco-editor-q0K0FpZQ.js} +1 -1
  193. package/dist/client/assets/monitor-v8-CHgzPfyd.js +1 -0
  194. package/dist/client/assets/monitoring-CmUEkQAu.js +1 -0
  195. package/dist/client/assets/{monitoring-stats-row-THiAXYTp.js → monitoring-stats-row-BsUBQUMM.js} +1 -1
  196. package/dist/client/assets/{multi-select-DOxlfIKk.js → multi-select-Db_ThqMQ.js} +1 -1
  197. package/dist/client/assets/{mustache-BzHjgnm5.js → mustache-Pqeakuud.js} +1 -1
  198. package/dist/client/assets/named-rule-uses-CocrtMGd.js +1 -0
  199. package/dist/client/assets/named-rule-view-DI8em1Ln.js +1 -0
  200. package/dist/client/assets/{new-project-dialog-DFsG79bb.js → new-project-dialog-CP7YY3zi.js} +1 -1
  201. package/dist/client/assets/{oauth-callback-BekJkoCF.js → oauth-callback-C87YK0QM.js} +1 -1
  202. package/dist/client/assets/{oauth-callback-ai-provider-FtcHAH0j.js → oauth-callback-ai-provider-BiPEsxGS.js} +1 -1
  203. package/dist/client/assets/{onboarding-DNskGrdg.js → onboarding-BkgYJN30.js} +1 -1
  204. package/dist/client/assets/openai-conversation-CMtl-uGo.js +3 -0
  205. package/dist/client/assets/{optimistic-project-sidebar-views-CrYamEqL.js → optimistic-project-sidebar-views-Dfnv2eVq.js} +1 -1
  206. package/dist/client/assets/order-monitor-day-B8b4_NRG.js +1 -0
  207. package/dist/client/assets/{organization-choice-zGI39_sg.js → organization-choice-D2OqEnT1.js} +1 -1
  208. package/dist/client/assets/{orgs-BjIQy8J3.js → orgs-BT5DM-wr.js} +1 -1
  209. package/dist/client/assets/{page-seo-form-CrgZFHtq.js → page-seo-form-BZ5qz5Jc.js} +1 -1
  210. package/dist/client/assets/{pair-Ck7rgrik.js → pair-CbWxf18N.js} +7 -7
  211. package/dist/client/assets/parse-sections-C-MhwiHZ.js +1 -0
  212. package/dist/client/assets/plan-DZXfEuaN.js +1 -0
  213. package/dist/client/assets/{plan-ladder-BKLU8eo8.js → plan-ladder-jDYqtD5Q.js} +1 -1
  214. package/dist/client/assets/{popover-DaReiQzV.js → popover-BVmz1c3N.js} +1 -1
  215. package/dist/client/assets/post-calendar-B_8534k5.js +1 -0
  216. package/dist/client/assets/{post-editor-CRy0VAcT.js → post-editor-B2niN_j8.js} +2 -2
  217. package/dist/client/assets/{preview-content-DJOuEciL.js → preview-content-3uKit-hf.js} +1 -1
  218. package/dist/client/assets/{preview-dialog-CnlKftcv.js → preview-dialog-Du1qcsYi.js} +1 -1
  219. package/dist/client/assets/{preview-panel-C2Athpf5.js → preview-panel-BoHCLryt.js} +1 -1
  220. package/dist/client/assets/{preview-tab-CzS9kIxI.js → preview-tab-DYBrEyCh.js} +4 -4
  221. package/dist/client/assets/product-picker-dialog-DPPSOqIw.js +1 -0
  222. package/dist/client/assets/{profile-DAF3l5cg.js → profile-CkB0-zr4.js} +1 -1
  223. package/dist/client/assets/project-app-view-DXEcNYan.js +1 -0
  224. package/dist/client/assets/{project-apps-CG2eY1ZZ.js → project-apps-B5YazmD2.js} +1 -1
  225. package/dist/client/assets/{project-feed-K24c6-Xx.js → project-feed-DmjT3iA5.js} +1 -1
  226. package/dist/client/assets/{project-icon-ZadU5ZjL.js → project-icon-BsqqQ1nI.js} +1 -1
  227. package/dist/client/assets/project-reports-CFxmXR8C.js +1 -0
  228. package/dist/client/assets/project-tasks-DIAs0Pxy.js +1 -0
  229. package/dist/client/assets/{projects-BWrIdbSy.js → projects-Cwzu5Iqo.js} +1 -1
  230. package/dist/client/assets/{projects-empty-state-BWAilN1f.js → projects-empty-state-Br0wajyI.js} +1 -1
  231. package/dist/client/assets/{prompts-DKnoRB34.js → prompts-DIIjyoc9.js} +1 -1
  232. package/dist/client/assets/record-editor-C5o_Ofe0.js +1 -0
  233. package/dist/client/assets/redirect-editor-B4oKb1GO.js +1 -0
  234. package/dist/client/assets/releases-api-D9GDZds6.js +1 -0
  235. package/dist/client/assets/{reports-Bg1fi6kR.js → reports-BLHz2f-u.js} +1 -1
  236. package/dist/client/assets/reports-CmJOblfH.js +1 -0
  237. package/dist/client/assets/{reports-onboarding-acV5ZZpQ.js → reports-onboarding-8l7cEi9O.js} +1 -1
  238. package/dist/client/assets/reports-tab-0lUp3BwL.js +2 -0
  239. package/dist/client/assets/{repositories-CxdgYwWQ.js → repositories-BZY63VIV.js} +1 -1
  240. package/dist/client/assets/repositories-DIzNxooQ.js +1 -0
  241. package/dist/client/assets/{repository-binding-DtIeSvDY.js → repository-binding-Cl8gyVcv.js} +1 -1
  242. package/dist/client/assets/{repository-import-picker-C2sQ94O1.js → repository-import-picker-3obW4oiZ.js} +1 -1
  243. package/dist/client/assets/{repository-picker-BXaWFfDW.js → repository-picker-0eUSIZ5X.js} +1 -1
  244. package/dist/client/assets/{require-capability-DAfCGgHW.js → require-capability-NNP8AGk1.js} +1 -1
  245. package/dist/client/assets/{required-auth-layout-4jyUcmCy.js → required-auth-layout-D4sDIyJ3.js} +1 -1
  246. package/dist/client/assets/{reset-password-BGjvzv1z.js → reset-password-CXaP1BPU.js} +1 -1
  247. package/dist/client/assets/{resizable-CQyxQjcn.js → resizable-DVzR2wEK.js} +1 -1
  248. package/dist/client/assets/{resolve-tab-icon-56O81FJc.js → resolve-tab-icon-BdFEwYlo.js} +1 -1
  249. package/dist/client/assets/{review-settings-CWih3HF4.js → review-settings-CQ-ke_sY.js} +1 -1
  250. package/dist/client/assets/{roles-BRkp9ar3.js → roles-CSdPRDeD.js} +1 -1
  251. package/dist/client/assets/route-BuTkxBLT.js +1 -0
  252. package/dist/client/assets/route-CGCaN7RC.js +1 -0
  253. package/dist/client/assets/route-CN2nYP-k.js +1 -0
  254. package/dist/client/assets/{runnable-block-editor-CqYgijVY.js → runnable-block-editor-BCPCXDwB.js} +7 -7
  255. package/dist/client/assets/sandbox-lifecycle-context-D9f3Vvrq.js +1 -0
  256. package/dist/client/assets/{schema-Dvc5tPTN.js → schema-DIOdOlgE.js} +1 -1
  257. package/dist/client/assets/{schema-Cn4x5iT-.js → schema-JPrgW9NA.js} +1 -1
  258. package/dist/client/assets/{scroll-area-9wUBmncr.js → scroll-area-BzPxgY-4.js} +1 -1
  259. package/dist/client/assets/{search-input-1DLvCYgl.js → search-input-CAgDD0MP.js} +1 -1
  260. package/dist/client/assets/{search-toggle-BnK2KHqJ.js → search-toggle-DxyC7mO0.js} +1 -1
  261. package/dist/client/assets/secret-ciphertext-DIyWW8ea.js +1 -0
  262. package/dist/client/assets/{secret-picker-B4zI9e3W.js → secret-picker-BaxV5boV.js} +1 -1
  263. package/dist/client/assets/{secrets-C2PS9_a9.js → secrets-DSOCKy5q.js} +1 -1
  264. package/dist/client/assets/{sections-DX6pY_bs.js → sections-BsNG86P-.js} +1 -1
  265. package/dist/client/assets/sections-editor-Ba5HL_GU.js +4 -0
  266. package/dist/client/assets/{select-DUEGSJco.js → select-C1PBhx94.js} +1 -1
  267. package/dist/client/assets/{select-model-mFyCcf-O.js → select-model-B3qCPlEj.js} +1 -1
  268. package/dist/client/assets/seo-editor-CBXv1v_K.js +1 -0
  269. package/dist/client/assets/{separator-Bk_a4cod.js → separator-DI0EmK0i.js} +1 -1
  270. package/dist/client/assets/settings-tab-D7gwu_vw.js +1 -0
  271. package/dist/client/assets/{sheet-Dhe0uPV2.js → sheet-DaxppAym.js} +1 -1
  272. package/dist/client/assets/{shell-layout-U7D4A6nk.js → shell-layout-CKWLH4bq.js} +1 -1
  273. package/dist/client/assets/{site-draft-actions-Dpnw67Ug.js → site-draft-actions-Ck0Qp0lI.js} +6 -6
  274. package/dist/client/assets/site-draft-view-DwI6BUF-.js +2 -0
  275. package/dist/client/assets/site-editor-C14MF5hG.js +1 -0
  276. package/dist/client/assets/site-editor-toast-vUK6CnYX.js +1 -0
  277. package/dist/client/assets/{skills-DghKPwKw.js → skills-Conq58a1.js} +1 -1
  278. package/dist/client/assets/{slider-CLUaEqdg.js → slider-B4XFe7FF.js} +1 -1
  279. package/dist/client/assets/{sortable.esm-CkqHW6-y.js → sortable.esm-Mem55hqW.js} +1 -1
  280. package/dist/client/assets/{sso-DGFWPeza.js → sso-4h0pQdIc.js} +1 -1
  281. package/dist/client/assets/{suggestion-BNEVVm5c.js → suggestion-DXfrHDfU.js} +1 -1
  282. package/dist/client/assets/{switch-ByCU93P4.js → switch-BZ12Wlze.js} +1 -1
  283. package/dist/client/assets/{symbol-BQLM2_V8.js → symbol-NtdYAab7.js} +1 -1
  284. package/dist/client/assets/{synced-repos-CjPrTUpI.js → synced-repos-C66vtPZX.js} +1 -1
  285. package/dist/client/assets/{tab-icon-glyph-Cz_BoFAU.js → tab-icon-glyph-D8h09tlE.js} +1 -1
  286. package/dist/client/assets/{table-Tw2gCVXe.js → table-cd8TiUS7.js} +1 -1
  287. package/dist/client/assets/{tabs-C7f3nqQx.js → tabs-PlTfpfXH.js} +1 -1
  288. package/dist/client/assets/{task-assignee-avatar-BiPanmNM.js → task-assignee-avatar-CgqWAIyd.js} +1 -1
  289. package/dist/client/assets/{task-board-BrTYr-oE.js → task-board-DZKwU9_n.js} +1 -1
  290. package/dist/client/assets/{task-route-BLP-DBaS.js → task-route-CtG_ZySh.js} +1 -1
  291. package/dist/client/assets/{task-status-CVpsP3bD.js → task-status-DWzfRk3b.js} +1 -1
  292. package/dist/client/assets/{taskboard-analytics-CQMw4wzL.js → taskboard-analytics-CdVp5AM1.js} +1 -1
  293. package/dist/client/assets/tasks-4t3a03Q3.js +1 -0
  294. package/dist/client/assets/{tasks-CtPgnGlW.js → tasks-DME9mnR2.js} +1 -1
  295. package/dist/client/assets/{textarea-Bbbnnl4r.js → textarea-CbCQygtF.js} +1 -1
  296. package/dist/client/assets/{thread-analytics-CtQHMk9N.js → thread-analytics-D0HqEGEH.js} +1 -1
  297. package/dist/client/assets/{thread-intent-7GmQH5mt.js → thread-intent-DYTU11gs.js} +2 -2
  298. package/dist/client/assets/{thread-route-C7RSGMhP.js → thread-route-BrF-OvAm.js} +1 -1
  299. package/dist/client/assets/{thread-route-DpLeB4i0.js → thread-route-BwLT1XI-.js} +1 -1
  300. package/dist/client/assets/{thread-sheet-body-dWggSd-b.js → thread-sheet-body-BClkfRHz.js} +1 -1
  301. package/dist/client/assets/{time-range-picker-BVXe-Owx.js → time-range-picker-Dc0YWA3V.js} +1 -1
  302. package/dist/client/assets/{toggle-group-CXUKmPFr.js → toggle-group-CG3xZyLa.js} +1 -1
  303. package/dist/client/assets/{tool-namespace-DIE_8J9o.js → tool-namespace-BffmviW3.js} +1 -1
  304. package/dist/client/assets/{toolbar-icon-button-DzJeqLa2.js → toolbar-icon-button-Dvrbx_wP.js} +1 -1
  305. package/dist/client/assets/{tooltip-gMeEuHtO.js → tooltip-DZoMaiH-.js} +1 -1
  306. package/dist/client/assets/{tooltipContext-BQS7kWxi.js → tooltipContext-D6Gsaqky.js} +1 -1
  307. package/dist/client/assets/{track-DdeuRUoM.js → track-Cv2e7Jw0.js} +1 -1
  308. package/dist/client/assets/{types-CHFSNT7a.js → types-D8wZ_EZc.js} +1 -1
  309. package/dist/client/assets/{url-slug-D37s8EDd.js → url-slug-C8xJrS8o.js} +1 -1
  310. package/dist/client/assets/{usage-stats-BecGIkLk.js → usage-stats-B6igVHuP.js} +2 -2
  311. package/dist/client/assets/{use-ai-providers-CAt_9H4n.js → use-ai-providers-DgzZ7YKT.js} +1 -1
  312. package/dist/client/assets/use-apply-named-rule-BXu1w5Bp.js +1 -0
  313. package/dist/client/assets/{use-automations-C6LbyvJD.js → use-automations-DZTdfMuj.js} +1 -1
  314. package/dist/client/assets/{use-autosave-e9CI9oFB.js → use-autosave-C5yHGYj0.js} +1 -1
  315. package/dist/client/assets/{use-chat-layout-state-24wCHq_-.js → use-chat-layout-state-fUIATILp.js} +1 -1
  316. package/dist/client/assets/{use-clock-tick-DflKMAWl.js → use-clock-tick-DiijcghV.js} +1 -1
  317. package/dist/client/assets/{use-connect-companion-3OWtftC8.js → use-connect-companion-DvHSKAIT.js} +1 -1
  318. package/dist/client/assets/{use-connection-CBKH8IwL.js → use-connection-BZmon5tp.js} +1 -1
  319. package/dist/client/assets/use-content-sync-DQGv9jMR.js +1 -0
  320. package/dist/client/assets/{use-copy-Cn8Org7G.js → use-copy-Dl7HNmsM.js} +1 -1
  321. package/dist/client/assets/{use-create-virtual-mcp-jW1iVRi_.js → use-create-virtual-mcp-Y_WqPwQW.js} +1 -1
  322. package/dist/client/assets/{use-date-fns-locale-DTRxIyi4.js → use-date-fns-locale-C4tTGqdg.js} +1 -1
  323. package/dist/client/assets/{use-debounced-autosave-DDaoW-uw.js → use-debounced-autosave-iEzw6avK.js} +1 -1
  324. package/dist/client/assets/{use-debounced-value-c5JdkW89.js → use-debounced-value-DNoCsO37.js} +1 -1
  325. package/dist/client/assets/{use-deco-credits-D8w-JIDW.js → use-deco-credits-Bb3hLWha.js} +1 -1
  326. package/dist/client/assets/{use-decopilot-events-Cp8NaBPU.js → use-decopilot-events-Bfz-bAKi.js} +1 -1
  327. package/dist/client/assets/{use-delete-connection-BJIObh7l.js → use-delete-connection-DHMSyjey.js} +1 -1
  328. package/dist/client/assets/{use-deployment-admin-D7XKR1Dx.js → use-deployment-admin-CU8I3_7G.js} +1 -1
  329. package/dist/client/assets/use-fast-preview-draft-url-CBDC7qwh.js +1 -0
  330. package/dist/client/assets/{use-file-configs-DW0hmZjE.js → use-file-configs-BXF9rvXJ.js} +1 -1
  331. package/dist/client/assets/{use-inbox-feed-DOpe-XBh.js → use-inbox-feed-aT0WvD_J.js} +1 -1
  332. package/dist/client/assets/{use-infinite-scroll-Cuyf7850.js → use-infinite-scroll-ZRIHRcVb.js} +1 -1
  333. package/dist/client/assets/{use-join-requests-CBahVlKF.js → use-join-requests-p5BU3YYl.js} +1 -1
  334. package/dist/client/assets/use-main-panel-tabs-69xs0HVG.js +1 -0
  335. package/dist/client/assets/{use-mcp-auth-status-Cs8ZHHaN.js → use-mcp-auth-status-SoBS-b1c.js} +1 -1
  336. package/dist/client/assets/{use-mcp-client-D1kFCZ4v.js → use-mcp-client-DqYHf07G.js} +1 -1
  337. package/dist/client/assets/{use-mcp-prompts-wKDmQlGB.js → use-mcp-prompts-Cu6zSvAs.js} +1 -1
  338. package/dist/client/assets/{use-mcp-tools-I-kpM305.js → use-mcp-tools-CTx7o8Po.js} +1 -1
  339. package/dist/client/assets/{use-members-0ZBHc0S5.js → use-members-7fbiQ1L2.js} +1 -1
  340. package/dist/client/assets/{use-mobile-CKoO3XSk.js → use-mobile-Df_3y675.js} +1 -1
  341. package/dist/client/assets/use-move-blocks-2-4mcwFX.js +1 -0
  342. package/dist/client/assets/{use-navigate-to-agent-DLX1nkvn.js → use-navigate-to-agent-DOId9IHj.js} +1 -1
  343. package/dist/client/assets/{use-open-billing-url-C5lEsbaH.js → use-open-billing-url-_IkiYFNL.js} +1 -1
  344. package/dist/client/assets/{use-org-auth-client-t4l-TKT1.js → use-org-auth-client-D-Dp-TzJ.js} +1 -1
  345. package/dist/client/assets/{use-org-fs-49a1bhbu.js → use-org-fs-CLvO6ZX7.js} +1 -1
  346. package/dist/client/assets/{use-org-repo-syncs-BunA5GFg.js → use-org-repo-syncs-kBybWkDI.js} +1 -1
  347. package/dist/client/assets/{use-org-sso-B_zXOLDA.js → use-org-sso-DzwVU3EX.js} +1 -1
  348. package/dist/client/assets/{use-organization-roles-Bc45ILhm.js → use-organization-roles-LxJNrgl3.js} +1 -1
  349. package/dist/client/assets/{use-organization-settings-laAOR3Cm.js → use-organization-settings-BXo7nhZ3.js} +1 -1
  350. package/dist/client/assets/{use-panel-navigate-Bghh8kV3.js → use-panel-navigate-DGz4w4gD.js} +1 -1
  351. package/dist/client/assets/{use-project-native-view-presence-C3Vtd78t.js → use-project-native-view-presence-DVu_UG8f.js} +1 -1
  352. package/dist/client/assets/{use-project-scope-DH5nL_oD.js → use-project-scope-B2UHdHkf.js} +1 -1
  353. package/dist/client/assets/{use-recent-apps-D6yVH6-8.js → use-recent-apps-BOqc2cRg.js} +1 -1
  354. package/dist/client/assets/{use-releases-G0pirYfu.js → use-releases-Bvh7Pdaa.js} +1 -1
  355. package/dist/client/assets/{use-reports-diagnostic-BKJYEIJX.js → use-reports-diagnostic-Dct34RIh.js} +1 -1
  356. package/dist/client/assets/use-sandbox-events-DxcL_G2x.js +2 -0
  357. package/dist/client/assets/{use-secrets-DszBqpzD.js → use-secrets-Cgbmwf1E.js} +1 -1
  358. package/dist/client/assets/use-section-preview-base-CMHXbkVq.js +1 -0
  359. package/dist/client/assets/use-session-runtime-7d3qKI0U.js +1 -0
  360. package/dist/client/assets/{use-sidebar-collapsed-CuPY8XXm.js → use-sidebar-collapsed-CEbyuj9_.js} +1 -1
  361. package/dist/client/assets/{use-tags-BsXvHuTC.js → use-tags-DOizZBvn.js} +1 -1
  362. package/dist/client/assets/{use-task-board-analytics-BtNGPBbp.js → use-task-board-analytics-hmTm3Xr8.js} +1 -1
  363. package/dist/client/assets/{use-task-board-events-BARWSwfj.js → use-task-board-events-Sjn1d0ir.js} +1 -1
  364. package/dist/client/assets/{use-task-board-item-prs-BhAhDKGd.js → use-task-board-item-prs-BzC_DBWs.js} +1 -1
  365. package/dist/client/assets/{use-task-metadata-Dd-9Qkoq.js → use-task-metadata-CSxCj4yy.js} +1 -1
  366. package/dist/client/assets/{use-thread-analytics-B9Rm3t_E.js → use-thread-analytics-DfMbrXTf.js} +1 -1
  367. package/dist/client/assets/{use-thread-outputs-CoFWg3_v.js → use-thread-outputs-B3pyBOho.js} +1 -1
  368. package/dist/client/assets/useInfiniteQuery-BuR8X__X.js +1 -0
  369. package/dist/client/assets/{useQueries-_Urb_S-y.js → useQueries-uLX23MNk.js} +1 -1
  370. package/dist/client/assets/useSuspenseInfiniteQuery-B04nA0hC.js +1 -0
  371. package/dist/client/assets/{users-BXTFPRVd.js → users-Ib8R59dI.js} +1 -1
  372. package/dist/client/assets/{utils-CduIoZ0d.js → utils-LrUUDN57.js} +1 -1
  373. package/dist/client/assets/{variant-calendar-D0iLcmjF.js → variant-calendar-DOoqqIzr.js} +1 -1
  374. package/dist/client/assets/{variant-draft-pointer-HWAlFj6Z.js → variant-draft-pointer-DNyBkOr3.js} +1 -1
  375. package/dist/client/assets/{virtual-mcp-Xd6PvE5_.js → virtual-mcp-B7o88283.js} +1 -1
  376. package/dist/client/assets/{watch-sse-pool-BoG6Bqps.js → watch-sse-pool-DIAPPzx7.js} +1 -1
  377. package/dist/client/index.html +2 -2
  378. package/dist/server/server.js +321 -321
  379. package/package.json +1 -1
  380. package/dist/client/assets/ReferenceLine-CJq91vhq.js +0 -1
  381. package/dist/client/assets/agent-analytics-2BuaXhJ4.js +0 -2
  382. package/dist/client/assets/agent-app-DW_869sy.js +0 -1
  383. package/dist/client/assets/agent-assets-CPVwuId5.js +0 -1
  384. package/dist/client/assets/agent-calendar-CV9Ef0wP.js +0 -1
  385. package/dist/client/assets/agent-deck-OUciFfON.js +0 -1
  386. package/dist/client/assets/agent-experiments-BwjYQ0V4.js +0 -1
  387. package/dist/client/assets/agent-file-CStNgNPQ.js +0 -1
  388. package/dist/client/assets/agent-library-Bf2YaEvb.js +0 -1
  389. package/dist/client/assets/agent-library-file-DAttgEac.js +0 -1
  390. package/dist/client/assets/agent-monitor-DIe6BVqe.js +0 -1
  391. package/dist/client/assets/agent-overview-popLuSBk.js +0 -1
  392. package/dist/client/assets/agent-releases-CZVpd2dN.js +0 -2
  393. package/dist/client/assets/agent-settings-C6L22aS3.js +0 -1
  394. package/dist/client/assets/agent-site-editor-code-Dnn-bhoB.js +0 -2
  395. package/dist/client/assets/agent-site-editor-content-Bt6vrV5b.js +0 -1
  396. package/dist/client/assets/agent-site-editor-preview-q3wCu8-N.js +0 -1
  397. package/dist/client/assets/agent-view-B1o861lr.js +0 -1
  398. package/dist/client/assets/api-keys-DfU9uedt.js +0 -1
  399. package/dist/client/assets/app-editor-Cq-B0QFL.js +0 -1
  400. package/dist/client/assets/blocks-tab-states-Chq5j0oT.js +0 -1
  401. package/dist/client/assets/campaigns-view-CwEmfYeP.js +0 -1
  402. package/dist/client/assets/category-editor-C-13e8GC.js +0 -1
  403. package/dist/client/assets/cms-settings-editor-CHoKFct5.js +0 -1
  404. package/dist/client/assets/coming-soon-page-6F4aAL8E.js +0 -1
  405. package/dist/client/assets/context-0XuHSild.js +0 -1
  406. package/dist/client/assets/home-DkYJf0RN.js +0 -1
  407. package/dist/client/assets/hosted-publish-api-CK3ZnEoi.js +0 -1
  408. package/dist/client/assets/hosted-publish-feedback-BG4t8HgW.js +0 -1
  409. package/dist/client/assets/index-EoMx4WDO.css +0 -1
  410. package/dist/client/assets/index-j4NUsiRT.js +0 -2
  411. package/dist/client/assets/input-DIcILgWd.js +0 -17
  412. package/dist/client/assets/library-BQ9URfiH.js +0 -1
  413. package/dist/client/assets/monitoring-BmpcQtwP.js +0 -1
  414. package/dist/client/assets/named-rule-uses-Mu_Msc9v.js +0 -1
  415. package/dist/client/assets/named-rule-view-CN2yeHp5.js +0 -1
  416. package/dist/client/assets/openai-conversation-_LIGb37e.js +0 -3
  417. package/dist/client/assets/order-monitor-day-DLFR-weA.js +0 -1
  418. package/dist/client/assets/parse-sections-YhOUxu7l.js +0 -1
  419. package/dist/client/assets/plan-Iixr6Ywe.js +0 -1
  420. package/dist/client/assets/post-calendar--v0MjZPE.js +0 -1
  421. package/dist/client/assets/product-picker-dialog-oD9OPZfl.js +0 -1
  422. package/dist/client/assets/project-app-view-CZXBsQ0a.js +0 -1
  423. package/dist/client/assets/project-reports-Crv9B-vM.js +0 -1
  424. package/dist/client/assets/project-tasks-Cz-57jQh.js +0 -1
  425. package/dist/client/assets/record-editor-d52mwz1n.js +0 -1
  426. package/dist/client/assets/redirect-editor-C-WKtN9s.js +0 -1
  427. package/dist/client/assets/releases-api-q3AffL1J.js +0 -1
  428. package/dist/client/assets/reports-B3miutne.js +0 -1
  429. package/dist/client/assets/reports-tab-Clf7FxSU.js +0 -2
  430. package/dist/client/assets/repositories-D42Ai47E.js +0 -1
  431. package/dist/client/assets/route-4SgoFvu0.js +0 -1
  432. package/dist/client/assets/route-BEESJELS.js +0 -1
  433. package/dist/client/assets/route-D6eBZFy3.js +0 -1
  434. package/dist/client/assets/sandbox-lifecycle-context-DdMgF1Lv.js +0 -1
  435. package/dist/client/assets/sections-editor-DD9uWqQ8.js +0 -4
  436. package/dist/client/assets/seo-editor-Bf-sfYSP.js +0 -1
  437. package/dist/client/assets/settings-tab-DpQMA4J6.js +0 -1
  438. package/dist/client/assets/site-draft-view-Cho80MC6.js +0 -2
  439. package/dist/client/assets/site-editor-34XlqmyW.js +0 -1
  440. package/dist/client/assets/tasks-C_346UtB.js +0 -1
  441. package/dist/client/assets/use-apply-named-rule-B_CXDUdG.js +0 -1
  442. package/dist/client/assets/use-content-sync-D_qyLHCv.js +0 -1
  443. package/dist/client/assets/use-fast-preview-draft-url-CSz1rYUo.js +0 -1
  444. package/dist/client/assets/use-main-panel-tabs-CVsgtXg7.js +0 -1
  445. package/dist/client/assets/use-move-blocks-Dm4etxGk.js +0 -1
  446. package/dist/client/assets/use-section-preview-base-BASvFHv_.js +0 -1
  447. package/dist/client/assets/useInfiniteQuery-wCORGPw3.js +0 -1
  448. package/dist/client/assets/useSuspenseInfiniteQuery-JvpRoEFG.js +0 -1
@@ -1,4 +0,0 @@
1
- import{c as ct,b as Lt,r as R,l as me,j as o,b2 as la,B as Et,U as ln,ag as ca,X as ua,V as da,a as Ko,F as fa,K as Io,m as ma,o as pa,h as ha,t as ie}from"./index-ifZGovK1.js";import{u as ga}from"./chat-context-DXm8btNS.js";import{$ as va,H as Zn,a0 as ya,a1 as xa,a2 as ba,a3 as Sa,a4 as _a,a5 as wa,a6 as Xr,a7 as ja,a8 as ka,y as kt,a9 as Le,aa as Ea,z as Gn,w as Un,d as Ra,u as Aa,ab as Zr,i as Ca,ac as Na,k as Ta,h as Va,ad as Fo,ae as Pa,af as Ma,t as eo,ag as Da,ah as Ka,ai as Wn,aj as to,ak as no,al as so,am as vs,an as Ia,C as Fa,ao as Ba,x as Oa,ap as ro,aq as La,ar as oo,as as io,at as ao,M as $a,au as lo,a as za,av as cn,aw as Ha,ax as Wa,ay as jn,az as ys}from"./runnable-block-editor-CqYgijVY.js";import{c as qa}from"./repository-binding-DtIeSvDY.js";import{n as Ga,t as Ua}from"./ChevronUp-x46FJEcD.js";import{aa as Bo,b as Qn,ap as Ya,H as Ja,a4 as co,a0 as uo}from"./agent-icon--EtIPqub.js";import{S as un}from"./scroll-area-9wUBmncr.js";import{c as At,T as Ct,a as Nt}from"./tooltip-gMeEuHtO.js";import{an as Qa,a3 as fo,l as Xa,u as Za,m as el,C as tl,R as nl,A as sl,a1 as It,a2 as Ft,as as mo,K as rl,au as ol}from"./use-content-sync-D_qyLHCv.js";import{f as il,u as al,G as ll,t as xs,H as po,s as cl,m as ul,I as dl}from"./blocks-tab-states-Chq5j0oT.js";import{m as fl,u as ml,P as pl}from"./mustache-BzHjgnm5.js";import{bb as hl,b as Ks,bd as Oo,G as gl,be as ot,bf as Es,bg as Lo,au as Qt,af as Rs,bh as As,av as Ot,ag as dn,g as vl,k as yl,E as xl,t as qn,p as En,aI as bl,as as Jt,ai as bs,ar as St,aq as kn,bi as Sl,M as _l,aw as ho,ax as go,at as wl,bj as jl,bk as Bt,bl as kl,bm as El,bn as Rl,ap as vo,bo as Ss,bp as Al,bq as Cl,br as Nl,an as Tl,aY as Vl,a_ as Pl,aS as Ml,bs as Dl,bt as Kl,bu as Il,ah as yo,bv as Fl,am as Bl,bw as Ol}from"./parse-sections-YhOUxu7l.js";import{a as Ll}from"./Copy01-OBSYmimV.js";import{a as Cs,e as $o}from"./UserSquare-BBEl_BxL.js";import{i as xo}from"./Tool01-BsK9c3-e.js";import{s as bo}from"./Image01-BCnLFq1D.js";import{s as $l}from"./Plus-vkM1FxVr.js";import{s as zl}from"./Trash01-Z1ezoy3S.js";import{i as Ns}from"./ZoomOut-DytgoG2i.js";import{u as Hl,a as So,K as Wl,P as ql,b as Gl,C as Ul,D as Yl,c as Jl}from"./core.esm-DJ5llHMe.js";import{u as Ql,s as Xl,a as Yn,S as Zl,v as ec}from"./sortable.esm-CkqHW6-y.js";import{s as tc,g as nc,u as sc,A as rc}from"./use-section-preview-base-BASvFHv_.js";import{i as oc}from"./thread-intent-7GmQH5mt.js";import{A as _s}from"./avatar-DHKJiyOX.js";import{e as ic,d as _o,b as ac,A as lc,a as cc,f as uc}from"./alert-dialog-C-DaggA1.js";import{b as dc}from"./format-time-Cq80KKvY.js";import{d as fc}from"./shell-layout-U7D4A6nk.js";import{u as mc}from"./use-members-0ZBHc0S5.js";import{a as pc,P as wo,w as hc,b as gc}from"./page-seo-form-CrgZFHtq.js";import{u as vc}from"./use-apply-named-rule-B_CXDUdG.js";import{c as jo,d as ko,e as yc,f as xc,g as bc}from"./variant-draft-pointer-HWAlFj6Z.js";import"./use-panel-navigate-Bghh8kV3.js";import"./thread-route-C7RSGMhP.js";import"./use-project-scope-DH5nL_oD.js";import"./autosend-xoWUmECR.js";import"./use-mcp-client-D1kFCZ4v.js";import"./auth-C_nDagDA.js";import"./use-decopilot-events-Cp8NaBPU.js";import"./watch-sse-pool-BoG6Bqps.js";import"./task-board-BrTYr-oE.js";import"./schema-Cn4x5iT-.js";import"./backoff-CrEUbyZT.js";import"./use-ai-providers-CAt_9H4n.js";import"./location-V0VwTJTt.js";import"./use-organization-settings-laAOR3Cm.js";import"./utils-CduIoZ0d.js";import"./Play-Ns9aRVTY.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-Ck7rgrik.js";import"./LinkBroken01-DcsqjBuj.js";import"./collapsible-CnlVGt-G.js";import"./use-copy-Cn8Org7G.js";import"./usage-stats-BecGIkLk.js";import"./tool-namespace-DIE_8J9o.js";import"./form-D4PspedZ.js";import"./label-Dhoh3DcI.js";import"./utils-CVEq3hMx.js";import"./markdown-prFeEkT4.js";import"./use-mobile-CKoO3XSk.js";import"./use-clock-tick-DflKMAWl.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-fHjuxWIZ.js";import"./types-CHFSNT7a.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./AlertCircle-CUAx3A4b.js";import"./XClose-BdwIxxCT.js";import"./ShoppingBag01-aJuRSlBz.js";import"./SearchMd-Cp6J-1Iu.js";import"./sheet-Dhe0uPV2.js";import"./integration-icon-D1aQLe0v.js";import"./use-connection-CBKH8IwL.js";import"./use-navigate-to-agent-DLX1nkvn.js";import"./Link01-8aKNfNRw.js";import"./use-mcp-prompts-wKDmQlGB.js";import"./Monitor01-DQEkUL3d.js";import"./use-thread-outputs-CoFWg3_v.js";import"./file-type-icon-DHFVwXjA.js";import"./switch-ByCU93P4.js";import"./textarea-Bbbnnl4r.js";import"./ChevronSelectorVertical-BSRBjpBn.js";import"./command-BlBQgQPI.js";import"./index-BCHFFeZZ.js";import"./popover-DaReiQzV.js";import"./monaco-editor-Wx_2qGOP.js";import"./editor-BctLuJLS.js";import"./delay-CnY5UFtP.js";import"./calendar-qN6CeKGa.js";import"./SwitchHorizontal01-B5WFt7_0.js";import"./Minus-B38cW2ZC.js";import"./select-DUEGSJco.js";import"./index-BdQq_4o_.js";import"./index-DNa7Epd0.js";import"./editor-classes-BnPaf--r.js";import"./toggle-group-CXUKmPFr.js";import"./active-indicator-CCMhAsc_.js";import"./combobox-BMxhMbUn.js";import"./Upload01-B3-nlnKa.js";import"./DotsVertical-jkvtcdek.js";import"./search-input-1DLvCYgl.js";import"./tabs-C7f3nqQx.js";import"./use-debounced-value-c5JdkW89.js";import"./use-file-configs-DW0hmZjE.js";import"./asset-utils-Cb8p2lKk.js";import"./useInfiniteQuery-wCORGPw3.js";import"./infiniteQueryObserver-DvmMaiCa.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./input-DIcILgWd.js";import"./icon-button-HZwQKD3a.js";import"./chat-draft-WGnppXw7.js";import"./ArrowUp-EL0FBv9C.js";import"./ArrowLeft-BWCsylYe.js";import"./use-deco-credits-D8w-JIDW.js";import"./use-open-billing-url-C5lEsbaH.js";import"./index-B32YFtAw.js";import"./checkbox-vFQy8MvV.js";import"./Key01-CG7Kua6O.js";import"./ai-providers-logos-DD3qZ33J.js";import"./drawer-0sYDH2mt.js";import"./input-BeDIlaby.js";import"./suggestion-BNEVVm5c.js";import"./use-org-fs-49a1bhbu.js";import"./question-004-sINsf4GQ.js";import"./feature-paywall-hsFyGLR_.js";import"./plan-ladder-BKLU8eo8.js";import"./add-connection-dialog-F6QQAEZv.js";import"./collection-search--9d0M5sc.js";import"./extract-connection-data-CBAyhzk-.js";import"./metadata-D72DunRR.js";import"./connection-Bo3v2rj5.js";import"./url-slug-D37s8EDd.js";import"./connection-card-DMfcnulT.js";import"./connection-slug-CITJ0kGN.js";import"./slugify-CEUa2lfQ.js";import"./schema-Dvc5tPTN.js";import"./connection-form-helpers-A3QfJozi.js";import"./authenticate-and-persist-oauth-CpcQdSQ-.js";import"./mcp-oauth-CNKUkWMd.js";import"./mcp-oauth-CTJ5Iw4i.js";import"./collection-tabs-BfpnVdlQ.js";import"./badge-ux-RK1YK.js";import"./use-infinite-scroll-Cuyf7850.js";import"./useSuspenseInfiniteQuery-JvpRoEFG.js";import"./use-task-board-events-BARWSwfj.js";import"./use-chat-layout-state-24wCHq_-.js";import"./sandbox-git-api-CH_-QFpD.js";import"./sandbox-url-D3mC8qhT.js";import"./Building02-PifDTlhb.js";import"./CheckCircle-CMGqXocs.js";import"./CreditCard01-DWsSThAm.js";import"./Globe04-blkS_Kfg.js";import"./Sun-k4hypx5Q.js";import"./User01-C2Sw39bs.js";import"./Users01-DMFeioyM.js";import"./index-j4NUsiRT.js";import"./experiments-tab-choice-CMHPX5ZC.js";import"./slider-CLUaEqdg.js";import"./index-Bxkd37dZ.js";import"./tooltipContext-BQS7kWxi.js";import"./CategoricalChart-QwBn7EzX.js";import"./index-gqp4B5qj.js";import"./ActiveShapeUtils-CHmxGMIj.js";import"./Sector-BeXkYaJv.js";import"./symbol-BQLM2_V8.js";import"./empty-state-D6RWdvUz.js";import"./alert-BDbwlXZm.js";import"./section-preview-url-7zfngvgW.js";import"./differenceInSeconds-C3x8sHUj.js";import"./project-icon-ZadU5ZjL.js";import"./new-project-dialog-DFsG79bb.js";import"./repository-import-picker-C2sQ94O1.js";import"./repository-picker-BXaWFfDW.js";import"./required-auth-layout-4jyUcmCy.js";import"./use-org-sso-B_zXOLDA.js";import"./use-org-auth-client-t4l-TKT1.js";import"./use-move-blocks-Dm4etxGk.js";const Sc={escape:va};function _c(n,e){for(const r of tc(n,e)){const i=typeof r.title=="string"?r.title:void 0;if(i?.includes("{{"))return i}}function wc(n,e){if(!e)return;const r=hl(n,oc(e));if(r)try{const i=_c(r.resolveType,e);return i&&fl.render(i,r.data,{},Sc).trim()||void 0}catch{return}}function jc(n){const e=ct.c(13),{icon:r,label:i,className:l}=n;let u;e[0]!==l?(u=me("size-3.5",l),e[0]=l,e[1]=u):u=e[1];let y;e[2]!==r||e[3]!==u?(y=o.jsx(r,{className:u}),e[2]=r,e[3]=u,e[4]=y):y=e[4];let m;e[5]!==i||e[6]!==y?(m=o.jsx(Ct,{asChild:!0,children:o.jsx("span",{role:"img","aria-label":i,className:"shrink-0 cursor-help",children:y})}),e[5]=i,e[6]=y,e[7]=m):m=e[7];let b;e[8]!==i?(b=o.jsx(Nt,{className:"max-w-56",children:i}),e[8]=i,e[9]=b):b=e[9];let h;return e[10]!==m||e[11]!==b?(h=o.jsxs(At,{children:[m,b]}),e[10]=m,e[11]=b,e[12]=h):h=e[12],h}const kc="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 Eo(n){return Array.from({length:n},(e,r)=>({id:crypto.randomUUID(),index:r}))}function zo(n){return n.map((e,r)=>({...e,index:r}))}function Ec(n,e){if(e===n.length)return n;if(e<n.length)return zo(n.slice(0,e));const r=Array.from({length:e-n.length},(i,l)=>({id:crypto.randomUUID(),index:n.length+l}));return[...n,...r]}function Ho(n){const e=ct.c(44),{section:r,raw:i,meta:l,decofile:u}=n,y=Lt(),m=Zn(),b=r.isSavedBlock===!0,h=r.isMultivariate===!0;let k;e[0]!==l||e[1]!==i?(k=i&&l?nc(i,l):void 0,e[0]=l,e[1]=i,e[2]=k):k=e[2];const N=k;let L;e[3]!==l||e[4]!==h||e[5]!==i||e[6]!==b?(L=i&&l&&!b&&!h?wc(i,l):void 0,e[3]=l,e[4]=h,e[5]=i,e[6]=b,e[7]=L):L=e[7];const z=L;let H;e[8]!==u||e[9]!==l||e[10]!==i||e[11]!==r?(H=wa(i,r,u,l),e[8]=u,e[9]=l,e[10]=i,e[11]=r,e[12]=H):H=e[12];const B=H;let w;e[13]!==h||e[14]!==i?.__resolveType?(w=!h&&Ks(i?.__resolveType??""),e[13]=h,e[14]=i?.__resolveType,e[15]=w):w=e[15];const p=w,te=b?Qn:h?Bo:$o;let E;e[16]!==h||e[17]!==b?(E=b?{color:gl}:h?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=h,e[17]=b,e[18]=E):E=e[18];const W=E;let V;e[19]!==te||e[20]!==m?(V=m?o.jsxs("span",{className:"relative size-4 shrink-0",children:[o.jsx(te,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),o.jsx(ka,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):o.jsx(Ya,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=te,e[20]=m,e[21]=V):V=e[21];let J;e[22]!==N?(J=N&&o.jsx("img",{src:N,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=N,e[23]=J):J=e[23];let g;e[24]!==m||e[25]!==W?(g=!m&&o.jsx(Cs,{className:"h-4 w-4 shrink-0",style:W}),e[24]=m,e[25]=W,e[26]=g):g=e[26];const Q=m?"shrink":"flex-1",x=r.isHidden&&"line-through opacity-50";let Z;e[27]!==x||e[28]!==Q?(Z=me("min-w-0 truncate text-sm font-medium",Q,x),e[27]=x,e[28]=Q,e[29]=Z):Z=e[29];const q=z??r.label;let pe;e[30]!==Z||e[31]!==q?(pe=o.jsx("span",{className:Z,children:q}),e[30]=Z,e[31]=q,e[32]=pe):pe=e[32];let ye;e[33]!==p||e[34]!==m||e[35]!==B||e[36]!==y?(ye=m?o.jsxs(o.Fragment,{children:[p&&o.jsx(jc,{icon:Ns,label:y("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),B&&o.jsx(Xr,{}),o.jsx("span",{className:"min-w-0 flex-1"})]}):B&&o.jsx(Xr,{className:"absolute -right-0.5 -top-0.5"}),e[33]=p,e[34]=m,e[35]=B,e[36]=y,e[37]=ye):ye=e[37];let ue;return e[38]!==pe||e[39]!==ye||e[40]!==V||e[41]!==J||e[42]!==g?(ue=o.jsxs(o.Fragment,{children:[V,J,g,pe,ye]}),e[38]=pe,e[39]=ye,e[40]=V,e[41]=J,e[42]=g,e[43]=ue):ue=e[43],ue}const Rc="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Ac="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)]";function Wo(n,e,r){if(r)return ja({selected:e});const i=n.isSavedBlock===!0,l=n.isMultivariate===!0;return me("group relative flex select-none items-center gap-2 rounded-[var(--studio-control-radius,var(--radius-md))] px-2 py-2.5",e?"bg-accent text-accent-foreground":i?Rc:l?Ac:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function ws(n,e){return me("h-7 shrink-0 overflow-hidden",e?"w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]":n?"w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100":"w-0 -ml-2 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:ml-0 group-hover:w-7 group-hover:opacity-100 group-hover:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms] group-has-[:focus-visible]:ml-0 group-has-[:focus-visible]:w-7 group-has-[:focus-visible]:opacity-100 group-has-[:focus-visible]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]")}function Cc(n){const e=ct.c(90),{section:r,raw:i,meta:l,decofile:u,sortableId:y,selected:m,onSelect:b,onDelete:h,onDuplicate:k,onMakeReusable:N,onToggleHidden:L,onToggleLazy:z,onAddVariant:H,onDetach:B}=n,w=Lt(),p=Zn(),te=i?Ks(i.__resolveType??""):!1,E=r.isHidden===!0,W=te||E;let V;e[0]!==r?(V=Oo(r),e[0]=r,e[1]=V):V=e[1];const J=V,g=!!z&&!r.isMultivariate;let Q;e[2]!==y?(Q={id:y,animateLayoutChanges:Vc},e[2]=y,e[3]=Q):Q=e[3];const{attributes:x,listeners:Z,setNodeRef:q,transform:pe,isDragging:ye}=Ql(Q);let ue;e[4]!==pe?(ue=Ul.Transform.toString(pe?{...pe,x:0}:null),e[4]=pe,e[5]=ue):ue=e[5];const fe=ye?0:void 0;let Re;e[6]!==ue||e[7]!==fe?(Re={transform:ue,opacity:fe},e[6]=ue,e[7]=fe,e[8]=Re):Re=e[8];const j=Re;let re;e[9]!==r?(re=xa(r),e[9]=r,e[10]=re):re=e[10];const Ae=re,Ce="button",S=0;let K;e[11]!==b?(K=I=>{(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),b())},e[11]=b,e[12]=K):K=e[12];const he=ye?"cursor-grabbing":"cursor-pointer";let M;e[13]!==p||e[14]!==r||e[15]!==m||e[16]!==he?(M=me("touch-none transition-colors",he,Wo(r,m,p)),e[13]=p,e[14]=r,e[15]=m,e[16]=he,e[17]=M):M=e[17];let xe;e[18]!==u||e[19]!==l||e[20]!==i||e[21]!==r?(xe=o.jsx(Ho,{section:r,raw:i,meta:l,decofile:u}),e[18]=u,e[19]=l,e[20]=i,e[21]=r,e[22]=xe):xe=e[22];const O=!p&&g&&o.jsxs(At,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx(Et,{type:"button",variant:"ghost",size:"icon","aria-label":w(te?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:me(ws(W,te)),onClick:I=>{I.stopPropagation(),z?.()},onPointerDown:Tc,children:o.jsx(Ns,{className:me("h-3.5 w-3.5",te&&"text-warning")})})}),o.jsx(Nt,{side:"bottom",children:w(te?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),oe=p?o.jsx(ba,{label:w(E?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:E,onToggle:L,children:E?o.jsx(xo,{className:"h-3.5 w-3.5"}):o.jsx(bo,{className:"h-3.5 w-3.5"})}):o.jsxs(At,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx(Et,{type:"button",variant:"ghost",size:"icon","aria-label":w(E?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:me(ws(W,E)),onClick:I=>{I.stopPropagation(),L()},onPointerDown:Nc,children:E?o.jsx(xo,{className:"h-3.5 w-3.5"}):o.jsx(bo,{className:"h-3.5 w-3.5"})})}),o.jsx(Nt,{side:"bottom",children:w(E?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),G=ua,Ke=Sa;let ke;e[23]!==w?(ke=w("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=w,e[24]=ke):ke=e[24];const ut=me(ws(W,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let Ze;e[25]!==Ke||e[26]!==ke||e[27]!==ut?(Ze=o.jsx(Ke,{label:ke,classicClassName:ut}),e[25]=Ke,e[26]=ke,e[27]=ut,e[28]=Ze):Ze=e[28];let $e;e[29]!==p||e[30]!==g||e[31]!==te||e[32]!==z||e[33]!==w?($e=p&&g&&o.jsxs(o.Fragment,{children:[o.jsxs(ln,{onClick:I=>{I.stopPropagation(),z?.()},children:[o.jsx(Ns,{className:"h-4 w-4"}),w(te?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),o.jsx(ca,{})]}),e[29]=p,e[30]=g,e[31]=te,e[32]=z,e[33]=w,e[34]=$e):$e=e[34];let qe;e[35]!==k?(qe=I=>{I.stopPropagation(),k()},e[35]=k,e[36]=qe):qe=e[36];let it;e[37]===Symbol.for("react.memo_cache_sentinel")?(it=o.jsx(Ll,{className:"h-4 w-4"}),e[37]=it):it=e[37];let Ge;e[38]!==w?(Ge=w("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=w,e[39]=Ge):Ge=e[39];let Ue;e[40]!==qe||e[41]!==Ge?(Ue=o.jsxs(ln,{onClick:qe,children:[it,Ge]}),e[40]=qe,e[41]=Ge,e[42]=Ue):Ue=e[42];let Ye;e[43]!==p||e[44]!==J||e[45]!==H||e[46]!==w?(Ye=J&&o.jsxs(ln,{className:me(!p&&_a),onClick:I=>{I.stopPropagation(),H()},children:[o.jsx(Bo,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=p,e[44]=J,e[45]=H,e[46]=w,e[47]=Ye):Ye=e[47];let de;e[48]!==p||e[49]!==Ae||e[50]!==N||e[51]!==w?(de=Ae&&o.jsxs(ln,{className:me(!p&&kc),onClick:I=>{I.stopPropagation(),N()},children:[p?o.jsx(Qn,{className:"h-4 w-4"}):o.jsx(Cs,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=p,e[49]=Ae,e[50]=N,e[51]=w,e[52]=de):de=e[52];let ge;e[53]!==p||e[54]!==B||e[55]!==r.isMultivariate||e[56]!==r.isSavedBlock||e[57]!==w?(ge=r.isSavedBlock===!0&&!r.isMultivariate&&o.jsxs(ln,{onClick:I=>{I.stopPropagation(),B()},children:[p?o.jsx($o,{className:"h-4 w-4"}):o.jsx(Cs,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=p,e[54]=B,e[55]=r.isMultivariate,e[56]=r.isSavedBlock,e[57]=w,e[58]=ge):ge=e[58];let be;e[59]!==h?(be=I=>{I.stopPropagation(),h()},e[59]=h,e[60]=be):be=e[60];let ee;e[61]===Symbol.for("react.memo_cache_sentinel")?(ee=o.jsx(zl,{className:"h-4 w-4"}),e[61]=ee):ee=e[61];let F;e[62]!==w?(F=w("sectionsEditor.sectionList.deleteMenuItem"),e[62]=w,e[63]=F):F=e[63];let De;e[64]!==be||e[65]!==F?(De=o.jsxs(ln,{variant:"destructive",onClick:be,children:[ee,F]}),e[64]=be,e[65]=F,e[66]=De):De=e[66];let et;e[67]!==$e||e[68]!==Ue||e[69]!==Ye||e[70]!==de||e[71]!==ge||e[72]!==De?(et=o.jsxs(da,{align:"end",className:"w-44",children:[$e,Ue,Ye,de,ge,De]}),e[67]=$e,e[68]=Ue,e[69]=Ye,e[70]=de,e[71]=ge,e[72]=De,e[73]=et):et=e[73];let tt;e[74]!==G||e[75]!==Ze||e[76]!==et?(tt=o.jsxs(G,{children:[Ze,et]}),e[74]=G,e[75]=Ze,e[76]=et,e[77]=tt):tt=e[77];let st;return e[78]!==x||e[79]!==Z||e[80]!==b||e[81]!==q||e[82]!==j||e[83]!==M||e[84]!==xe||e[85]!==O||e[86]!==oe||e[87]!==tt||e[88]!==K?(st=o.jsxs("div",{ref:q,style:j,...x,...Z,role:Ce,tabIndex:S,onClick:b,onKeyDown:K,className:M,children:[xe,O,oe,tt]}),e[78]=x,e[79]=Z,e[80]=b,e[81]=q,e[82]=j,e[83]=M,e[84]=xe,e[85]=O,e[86]=oe,e[87]=tt,e[88]=K,e[89]=st):st=e[89],st}function Nc(n){return n.stopPropagation()}function Tc(n){return n.stopPropagation()}function Vc(){return!1}function Ts(n){const e=ct.c(11),{canAddSection:r,onAddSection:i,className:l,size:u}=n,y=Lt();let m;e[0]!==l?(m=me("w-full",l),e[0]=l,e[1]=m):m=e[1];const b=!r;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx($l,{size:14}),e[2]=h):h=e[2];let k;e[3]!==y?(k=y("sectionsEditor.sectionList.addSectionButton"),e[3]=y,e[4]=k):k=e[4];let N;return e[5]!==i||e[6]!==u||e[7]!==m||e[8]!==b||e[9]!==k?(N=o.jsxs(Et,{type:"button",variant:"outline",size:u,className:m,disabled:b,onClick:i,children:[h,k]}),e[5]=i,e[6]=u,e[7]=m,e[8]=b,e[9]=k,e[10]=N):N=e[10],N}function Pc(n){const e=ct.c(101),{listKey:r,rawSections:i,sections:l,meta:u,decofile:y,selectedIndex:m,onSelect:b,onReorder:h,onDelete:k,onDuplicate:N,onMakeReusable:L,onToggleHidden:z,onToggleLazy:H,onAddVariant:B,onDetach:w,onAddSection:p,canAddSection:te}=n,E=te===void 0?!0:te,W=Lt(),V=Zn();let J;e[0]!==l.length?(J=()=>Eo(l.length),e[0]=l.length,e[1]=J):J=e[1];const[g,Q]=R.useState(J),[x,Z]=R.useState(null),[q,pe]=R.useState(r),[ye,ue]=R.useState(l.length),fe=R.useRef(!1);q!==r?(pe(r),ue(l.length),Q(Eo(l.length))):ye!==l.length&&(ue(l.length),Q(Je=>Ec(Je,l.length)));let Re;e[2]===Symbol.for("react.memo_cache_sentinel")?(Re={activationConstraint:{distance:8}},e[2]=Re):Re=e[2];let j;e[3]===Symbol.for("react.memo_cache_sentinel")?(j={coordinateGetter:Xl},e[3]=j):j=e[3];const re=Hl(So(ql,Re),So(Wl,j));let Ae;e[4]!==g?(Ae=g.map(Mc),e[4]=g,e[5]=Ae):Ae=e[5];const Ce=Ae;let S;e[6]===Symbol.for("react.memo_cache_sentinel")?(S=Je=>{Z(String(Je.active.id))},e[6]=S):S=e[6];const K=S;let he;e[7]!==Ce||e[8]!==h?(he=Je=>{Z(null);const{active:ae,over:Ne}=Je;if(!Ne||ae.id===Ne.id)return;const ze=Ce.indexOf(String(ae.id)),rt=Ce.indexOf(String(Ne.id));ze===-1||rt===-1||(Q(at=>zo(Yn([...at],ze,rt))),fe.current=!0,requestAnimationFrame(()=>{fe.current=!1}),h?.(ze,rt))},e[7]=Ce,e[8]=h,e[9]=he):he=e[9];const M=he;let xe;e[10]===Symbol.for("react.memo_cache_sentinel")?(xe=()=>{Z(null)},e[10]=xe):xe=e[10];const O=xe;let oe,G,Ke,ke,ut,Ze,$e,qe,it,Ge,Ue,Ye,de,ge,be;if(e[11]!==x||e[12]!==E||e[13]!==V||e[14]!==y||e[15]!==g||e[16]!==Ce||e[17]!==M||e[18]!==u||e[19]!==p||e[20]!==B||e[21]!==k||e[22]!==w||e[23]!==N||e[24]!==L||e[25]!==b||e[26]!==z||e[27]!==H||e[28]!==i||e[29]!==l||e[30]!==m||e[31]!==re||e[32]!==W){ge=Symbol.for("react.early_return_sentinel");e:{const Je=ae=>{fe.current||b(ae)};if(e[48]!==x||e[49]!==E||e[50]!==V||e[51]!==g||e[52]!==p||e[53]!==i||e[54]!==l||e[55]!==W){const ae=x?g.find(Ne=>Ne.id===x):null;if(ke=ae!=null?l[ae.index]:null,Ke=ae!=null?i[ae.index]:void 0,g.length===0){let Ne;e[59]!==W?(Ne=W("sectionsEditor.sectionList.noSections"),e[59]=W,e[60]=Ne):Ne=e[60];let ze;e[61]!==Ne?(ze=o.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:Ne}),e[61]=Ne,e[62]=ze):ze=e[62];const rt=ze;let at;e[63]!==E||e[64]!==V||e[65]!==rt||e[66]!==p?(at=V?rt:o.jsxs("div",{className:"space-y-2",children:[rt,o.jsx(Ts,{canAddSection:E,onAddSection:p,size:"sm"})]}),e[63]=E,e[64]=V,e[65]=rt,e[66]=p,e[67]=at):at=e[67],ge=at;break e}de=me(ae&&"cursor-grabbing"),e[48]=x,e[49]=E,e[50]=V,e[51]=g,e[52]=p,e[53]=i,e[54]=l,e[55]=W,e[56]=Ke,e[57]=ke,e[58]=de}else Ke=e[56],ke=e[57],de=e[58];G=Yl,qe=re,it=Jl,Ge=K,Ue=M,Ye=O,oe=Zl,Ze=Ce,$e=ec,be="space-y-1",ut=g.map(ae=>{const Ne=l[ae.index];return Ne?o.jsx(Cc,{sortableId:ae.id,section:Ne,raw:i[ae.index],meta:u,decofile:y,selected:m===ae.index,onSelect:()=>Je(ae.index),onDelete:()=>k(ae.index),onDuplicate:()=>N(ae.index),onMakeReusable:()=>L(ae.index),onToggleHidden:()=>z(ae.index),onToggleLazy:H?()=>H(ae.index):void 0,onAddVariant:()=>B(ae.index),onDetach:()=>w(ae.index)},ae.id):null})}e[11]=x,e[12]=E,e[13]=V,e[14]=y,e[15]=g,e[16]=Ce,e[17]=M,e[18]=u,e[19]=p,e[20]=B,e[21]=k,e[22]=w,e[23]=N,e[24]=L,e[25]=b,e[26]=z,e[27]=H,e[28]=i,e[29]=l,e[30]=m,e[31]=re,e[32]=W,e[33]=oe,e[34]=G,e[35]=Ke,e[36]=ke,e[37]=ut,e[38]=Ze,e[39]=$e,e[40]=qe,e[41]=it,e[42]=Ge,e[43]=Ue,e[44]=Ye,e[45]=de,e[46]=ge,e[47]=be}else oe=e[33],G=e[34],Ke=e[35],ke=e[36],ut=e[37],Ze=e[38],$e=e[39],qe=e[40],it=e[41],Ge=e[42],Ue=e[43],Ye=e[44],de=e[45],ge=e[46],be=e[47];if(ge!==Symbol.for("react.early_return_sentinel"))return ge;let ee;e[68]!==ut||e[69]!==be?(ee=o.jsx("div",{className:be,children:ut}),e[68]=ut,e[69]=be,e[70]=ee):ee=e[70];let F;e[71]!==oe||e[72]!==Ze||e[73]!==$e||e[74]!==ee?(F=o.jsx(oe,{items:Ze,strategy:$e,children:ee}),e[71]=oe,e[72]=Ze,e[73]=$e,e[74]=ee,e[75]=F):F=e[75];let De;e[76]!==Ke||e[77]!==ke||e[78]!==V||e[79]!==y||e[80]!==u?(De=ke?o.jsx("div",{className:me("cursor-grabbing shadow-lift",Wo(ke,!1,V)),children:o.jsx(Ho,{section:ke,raw:Ke,meta:u,decofile:y})}):null,e[76]=Ke,e[77]=ke,e[78]=V,e[79]=y,e[80]=u,e[81]=De):De=e[81];let et;e[82]!==De?(et=la.createPortal(o.jsx(Gl,{dropAnimation:ya,children:De}),document.body),e[82]=De,e[83]=et):et=e[83];let tt;e[84]!==G||e[85]!==qe||e[86]!==it||e[87]!==Ge||e[88]!==Ue||e[89]!==Ye||e[90]!==F||e[91]!==et?(tt=o.jsxs(G,{sensors:qe,collisionDetection:it,onDragStart:Ge,onDragEnd:Ue,onDragCancel:Ye,children:[F,et]}),e[84]=G,e[85]=qe,e[86]=it,e[87]=Ge,e[88]=Ue,e[89]=Ye,e[90]=F,e[91]=et,e[92]=tt):tt=e[92];let st;e[93]!==E||e[94]!==V||e[95]!==p?(st=!V&&o.jsx(Ts,{canAddSection:E,onAddSection:p,size:"sm",className:"mt-2"}),e[93]=E,e[94]=V,e[95]=p,e[96]=st):st=e[96];let I;return e[97]!==de||e[98]!==tt||e[99]!==st?(I=o.jsxs("div",{className:de,children:[tt,st]}),e[97]=de,e[98]=tt,e[99]=st,e[100]=I):I=e[100],I}function Mc(n){return n.id}function js(n,e,r,i,l){if(!n||!e)return null;if(!e.isMultivariate)return kt(n,e,i,l)?.data??null;const u=ot(n,e),y=u?Es(u,il)[r]:void 0;return y?Lo(y.value,i)?.data??null:null}const Dc=50;function Kc(n,e){n.own.push(Le(e)),n.own.length>Dc&&n.own.shift()}function Ro(n,e){return n.own.includes(Le(e))}function Ic(n,e){const{sectionIndex:r,variantIndex:i,shown:l,next:u,sectionCount:y}=e;return n&&n.sectionIndex===r&&n.variantIndex===i&&n.emitted===l?(n.emitted=u,n):l?{sectionIndex:r,variantIndex:i,base:l,emitted:u,sectionCount:y,own:[Le(l)]}:null}function qo(n,e){return e!==null&&Le(n)!==Le(e)}function Go(n,e){return n.__resolveType!==e.__resolveType}function Fc(n,e,r,i){if(e.length===i)return"here";const l=Le(n),u=e.flatMap((y,m)=>m!==r&&y!==null&&Le(y)===l?[m]:[]);return u.length===1?u[0]:"unknown"}function Ao({formBase:n,rebased:e,versionOf:r}){let i=null;return{ifMatch:l=>{i=l,n&&(n.version===void 0||e)&&(n.version=r(l));const u=n?n.version:r(l);return u===void 0?void 0:{[l]:u}},onApplied:l=>{n&&i!==null&&Object.hasOwn(l,i)&&(n.version=l[i])},reloadOnConflict:!0}}function Bc({merged:n,tracked:e,current:r,saved:i}){return!!n&&!!e&&r===e&&e.emitted===i}function Co(n,e){return!!n&&!!e&&n.contains(e)}function Vs(n){const e=[],r=Ps("",n.ancestor,n.mine,n.theirs,e);return{...n,merged:r,pointers:e}}function Ps(n,e,r,i,l){const u=(y,m)=>Le(y)===Le(m);if(u(r,i)||u(e,i))return r;if(u(e,r))return i;if(ks(r)&&ks(i)){const y=ks(e)?e:{},m={},b=[...Object.keys(r),...Object.keys(i).filter(h=>!(h in r))];for(const h of b){const k=Ps(`${n}/${h.replaceAll("~","~0").replaceAll("/","~1")}`,y[h],r[h],i[h],l);k!==void 0&&(m[h]=k)}return m}return Array.isArray(e)&&Array.isArray(r)&&Array.isArray(i)&&r.length===e.length&&i.length===e.length?e.map((y,m)=>Ps(`${n}/${m}`,y,r[m],i[m],l)):(l.push(n),i)}function ks(n){return!!n&&typeof n=="object"&&!Array.isArray(n)}function Oc(n,e){let r=n.merged;for(const i of n.pointers)e[i]==="mine"&&(r=Hc(r,i,Xt(n.mine,i)));return r}function Lc(n,e){return Object.fromEntries(n.pointers.map(r=>[r,e]))}function Uo(n){return Lc(n,"mine")}function Ms(n,e,r){const i=Uo(r);for(const l of r.pointers){const u=e[l];if(!u||!n.pointers.includes(l))continue;["mine","theirs"].every(m=>Le(Xt(n[m],l))===Le(Xt(r[m],l)))&&(i[l]=u)}return i}function Yo(n,e,r={}){const i=e.pointers.filter(l=>!n.pointers.includes(l)||Le(Xt(n.theirs,l))!==Le(Xt(e.theirs,l)));return i.length===0?r:{...r,...Object.fromEntries(i.map(l=>[l,(r[l]??0)+1]))}}function $c(n,e,r){if(!e||Go(n.plan.ancestor,e)||!qo(n.plan.theirs,e)||r(e))return null;const i=Vs({...n.plan,theirs:e});return i.pointers.length===0?null:{plan:i,choices:Ms(n.plan,n.choices,i),fresh:Yo(n.plan,i,n.fresh)}}function zc(n,e){return n.pointers.map(r=>({pointer:r,label:Ea(r,e),mine:Xt(n.mine,r),theirs:Xt(n.theirs,r),schema:Wc(e??null,r)}))}function Is(n){return n.split("/").slice(1).map(e=>e.replaceAll("~1","/").replaceAll("~0","~"))}function Xt(n,e){let r=n;for(const i of Is(e))if(Array.isArray(r))r=r[Number(i)];else if(r&&typeof r=="object")r=r[i];else return;return r}function Hc(n,e,r){const i=Is(e),l=(u,y)=>{if(y===i.length)return r;const m=i[y];if(Array.isArray(u)){const k=[...u];return k[Number(m)]=l(u[Number(m)],y+1),k}const b=u&&typeof u=="object"?{...u}:{},h=l(b[m],y+1);return h===void 0?delete b[m]:b[m]=h,b};return l(n,0)}function Wc(n,e){let r=n;for(const i of Is(e)){if(!r)return null;r=/^\d+$/.test(i)&&!r.properties?.[i]?r.items:r.properties?.[i]}return r??null}const qc=/\.(png|jpe?g|gif|webp|avif|svg)(\?.*)?$/i,No=60,Gc=3;function Jo(n,e){return e?.format==="image-uri"?!0:n.startsWith("data:image/")||/^(https?:)?\/\//.test(n)&&qc.test(n)}function Ds(n,e){if(!(e?.format==="rich-text"||e?.format==="rich-text-inline"||e?.format==="html"||/<\/?[a-z][^>]*>/i.test(n)))return n;const i=n.replace(/<br\s*\/?>/gi,`
2
- `).replace(/<\/(p|div|li|h[1-6])>/gi,`
3
- `);return Yc(i).replace(/\u00a0/g," ").replace(/\n{2,}/g,`
4
- `).trim()}const Uc={"&nbsp;":" ","&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"};function Yc(n){if(typeof DOMParser<"u")return new DOMParser().parseFromString(n,"text/html").body.textContent??"";let e=n;for(let r="";r!==e;)r=e,e=e.replace(/<[^<>]*>/g,"");return e.replace(/<|>/g,"").replace(/&(nbsp|amp|lt|gt|quot|#39);/g,r=>Uc[r]??r)}function Jn(n){const e=n.replace(/\s+/g," ").trim();return e.length>No?`${e.slice(0,No-1)}…`:e}function Jc(n){if(n.startsWith("data:"))return"image";const e=n.split(/[?#]/)[0]??n;return decodeURIComponent(e.split("/").pop()||n)}function Xn(n,e){if(n==null||n==="")return{kind:"empty"};if(typeof n=="string")return Jo(n,e)?{kind:"image",src:n}:{kind:"text",text:Ds(n,e)};if(typeof n=="number"||typeof n=="bigint")return{kind:"text",text:String(n)};if(typeof n=="boolean")return{kind:"yesNo",value:n};if(Array.isArray(n)){const r=e?.items??null;return{kind:"list",count:n.length,items:n.slice(0,Gc).map(i=>Qc(i,r)??"")}}if(typeof n=="object"){const r=n;if("value"in r&&Object.keys(r).length<=2)return Xn(r.value,e?.properties?.value??e);const i=Object.entries(r).filter(([l,u])=>!l.startsWith("__")&&u!==void 0).flatMap(([l,u])=>{const y=e?.properties?.[l]??null,m=Xn(u,y);if(m.kind==="empty")return[];const b=m.kind==="text"?Jn(m.text):m.kind==="image"?Jc(m.src):m.kind==="yesNo"?m.value?"✓":"✗":m.kind==="list"?`${m.count}`:"…";return[{label:y?.title?.trim()||l,text:b}]}).slice(0,4);return i.length>0?{kind:"fields",entries:i}:{kind:"empty"}}return{kind:"text",text:String(n)}}function Qc(n,e){if(typeof n=="string")return Jn(Ds(n,e));if(!n||typeof n!="object"||Array.isArray(n))return null;const r=n,i=e?.titleBy,l=i?r[i]:void 0;if(typeof l=="string"&&l.trim())return Jn(l);for(const[u,y]of Object.entries(r))if(!(u.startsWith("__")||typeof y!="string"||!y.trim())&&!Jo(y,e?.properties?.[u]??null))return Jn(Ds(y,null));return null}const To=1500;function Xc(n,e){const r=n.split(/(\s+)/).filter(k=>k!==""),i=e.split(/(\s+)/).filter(k=>k!=="");if(r.length>To||i.length>To)return{mine:[{text:n,kind:"changed"}],theirs:[{text:e,kind:"changed"}]};const l=Array.from({length:r.length+1},()=>new Array(i.length+1).fill(0));for(let k=r.length-1;k>=0;k--)for(let N=i.length-1;N>=0;N--){const L=l[k];L[N]=r[k]===i[N]?l[k+1][N+1]+1:Math.max(l[k+1][N],L[N+1])}const u=[],y=[],m=(k,N,L)=>{const z=k.at(-1);z&&(z.kind===L||L==="same"&&!N.trim())?z.text+=N:k.push({text:N,kind:L})};let b=0,h=0;for(;b<r.length&&h<i.length;)r[b]===i[h]?(m(u,r[b],"same"),m(y,i[h],"same"),b++,h++):l[b+1][h]>=l[b][h+1]?(m(u,r[b],"changed"),b++):(m(y,i[h],"changed"),h++);for(;b<r.length;b++)m(u,r[b],"changed");for(;h<i.length;h++)m(y,i[h],"changed");return{mine:u,theirs:y}}function Zc(n){const e=ct.c(10);let r,i;e[0]!==n?({open:r,...i}=n,e[0]=n,e[1]=r,e[2]=i):(r=e[1],i=e[2]);const{data:l}=Ko.useSession();let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=me("max-h-[85vh] grid-rows-[auto_minmax(0,1fr)_auto] sm:max-w-lg"),e[3]=u):u=e[3];const y=l?.user??null;let m;e[4]!==i||e[5]!==y?(m=o.jsx(ic,{className:u,"data-testid":"form-conflict-dialog",onEscapeKeyDown:tu,children:o.jsx(au,{...i,viewer:y,heading:eu})}),e[4]=i,e[5]=y,e[6]=m):m=e[6];let b;return e[7]!==r||e[8]!==m?(b=o.jsx(uc,{open:r,children:m}),e[7]=r,e[8]=m,e[9]=b):b=e[9],b}function eu(n,e){return o.jsxs(ac,{className:"text-left",children:[o.jsx(lc,{children:n}),o.jsx(cc,{children:e})]})}function tu(n){return n.preventDefault()}const nu={},su=(n,e)=>o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("h2",{className:"text-lg font-semibold",children:n}),o.jsx("p",{className:"text-sm text-muted-foreground",children:e})]});function ru(n,e,r=0,i={},l=null){const u=e[Math.min(r,e.length-1)],y=l?.you?void 0:l?.name?.split(/\s+/)[0],m={field:u?iu(u.label):"",label:u?.label??"",name:y??""},b=(h,k,N)=>n(l?.you?N:y?k:h,m);return e.length<=1?{title:b("sectionsEditor.formConflict.titleOne","sectionsEditor.formConflict.titleOneNamed","sectionsEditor.formConflict.titleOneYou"),description:n("sectionsEditor.formConflict.descriptionOne")}:{title:b("sectionsEditor.formConflict.titleStep","sectionsEditor.formConflict.titleStepNamed","sectionsEditor.formConflict.titleStepYou"),description:r>=e.length-1?o.jsx(ou,{t:n,fields:e,choices:i,name:y}):n("sectionsEditor.formConflict.descriptionStep")}}function ou(n){const e=ct.c(11),{t:r,fields:i,choices:l,name:u}=n;let y;if(e[0]!==l||e[1]!==i||e[2]!==u||e[3]!==r){let b;e[5]!==l||e[6]!==u||e[7]!==r?(b=(h,k)=>o.jsxs(R.Fragment,{children:[k>0&&" · ",`${h.label}: `,o.jsx("span",{className:"font-medium text-foreground",children:r((l[h.pointer]??"mine")==="mine"?"sectionsEditor.formConflict.summaryYours":u?"sectionsEditor.formConflict.summaryTheirsNamed":"sectionsEditor.formConflict.summaryTheirs",{name:u??""})})]},h.pointer),e[5]=l,e[6]=u,e[7]=r,e[8]=b):b=e[8],y=i.map(b),e[0]=l,e[1]=i,e[2]=u,e[3]=r,e[4]=y}else y=e[4];let m;return e[9]!==y?(m=o.jsx("span",{"data-testid":"form-conflict-summary",children:y}),e[9]=y,e[10]=m):m=e[10],m}function iu(n){return/^[A-Z][a-z]/.test(n)&&!n.includes("›")?n.charAt(0).toLowerCase()+n.slice(1):n}function au(n){const e=ct.c(68),r=Lt(),{fields:i,choices:l,changedAgain:u,fresh:y,heading:m}=n,b=u===void 0?!1:u,h=y===void 0?nu:y,k=m===void 0?su:m,N=i.length>1,[L,z]=R.useState(0),[H,B]=R.useState(lu);let w;e[0]===Symbol.for("react.memo_cache_sentinel")?(w={},e[0]=w):w=e[0];const[p,te]=R.useState(w),E=Math.max(0,Math.min(L,i.length-1)),W=i[E],V=E===i.length-1;let J;e[1]!==E||e[2]!==i||e[3]!==h?(J=xe=>{const O=i[E],oe=i[xe];!O||!oe||xe===E||(B(G=>new Set(G).add(O.pointer)),te(G=>({...G,[O.pointer]:h[O.pointer]??0,[oe.pointer]:h[oe.pointer]??0})),z(xe))},e[1]=E,e[2]=i,e[3]=h,e[4]=J):J=e[4];const g=J;let Q;e[5]!==E||e[6]!==g?(Q=xe=>{if(!xe)return;const O=oe=>{const G={ArrowLeft:-1,ArrowRight:1}[oe.key];!G||oe.defaultPrevented||oe.altKey||oe.ctrlKey||oe.metaKey||oe.shiftKey||fc(oe.target)||(oe.preventDefault(),g(E+G))};return xe.ownerDocument.addEventListener("keydown",O),()=>xe.ownerDocument.removeEventListener("keydown",O)},e[5]=E,e[6]=g,e[7]=Q):Q=e[7];const x=Q;if(!W)return null;let Z,q,pe,ye,ue;if(e[8]!==H||e[9]!==E||e[10]!==l||e[11]!==i||e[12]!==h||e[13]!==g||e[14]!==k||e[15]!==x||e[16]!==N||e[17]!==n||e[18]!==p||e[19]!==r){const{title:xe,description:O}=ru(r,i,E,l,n.author??null);let oe;e[25]!==n?(oe=G=>{G.detail>1||n.onApply()},e[25]=n,e[26]=oe):oe=e[26],Z=oe,q=N?x:void 0,pe="flex min-w-0 flex-col gap-3",e[27]!==H||e[28]!==E||e[29]!==i||e[30]!==h||e[31]!==g||e[32]!==N||e[33]!==p||e[34]!==r?(ye=N&&o.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o.jsx("div",{role:"group","aria-label":r("sectionsEditor.formConflict.steps"),className:"-m-1 flex flex-wrap items-center",children:i.map((G,Ke)=>{const ke=Ke!==E&&(h[G.pointer]??0)>(p[G.pointer]??0);return o.jsx("button",{type:"button","aria-label":ke?r("sectionsEditor.formConflict.stepChangedAgain",{label:G.label}):G.label,"aria-current":Ke===E?"step":void 0,"data-answered":Ke!==E&&H.has(G.pointer)?"":void 0,"data-changed-again":ke?"":void 0,onClick:()=>g(Ke),className:"group cursor-pointer rounded-full p-1 focus-ring",children:o.jsx("span",{className:me("block h-2 w-2 rounded-full bg-border transition-[width,background-color,box-shadow] motion-reduce:transition-none","group-hover:bg-muted-foreground/60","group-data-[answered]:bg-foreground/45","group-aria-[current=step]:w-5 group-aria-[current=step]:bg-foreground","group-data-[changed-again]:ring-2 group-data-[changed-again]:ring-warning group-data-[changed-again]:ring-offset-1 group-data-[changed-again]:ring-offset-background")})},G.pointer)})}),o.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:r("sectionsEditor.formConflict.stepCount",{step:String(E+1),count:String(i.length)})})]}),e[27]=H,e[28]=E,e[29]=i,e[30]=h,e[31]=g,e[32]=N,e[33]=p,e[34]=r,e[35]=ye):ye=e[35],ue=k(xe,O),e[8]=H,e[9]=E,e[10]=l,e[11]=i,e[12]=h,e[13]=g,e[14]=k,e[15]=x,e[16]=N,e[17]=n,e[18]=p,e[19]=r,e[20]=Z,e[21]=q,e[22]=pe,e[23]=ye,e[24]=ue}else Z=e[20],q=e[21],pe=e[22],ye=e[23],ue=e[24];let fe;e[36]!==q||e[37]!==pe||e[38]!==ye||e[39]!==ue?(fe=o.jsxs("div",{ref:q,className:pe,children:[ye,ue]}),e[36]=q,e[37]=pe,e[38]=ye,e[39]=ue,e[40]=fe):fe=e[40];const Re=!b&&"sr-only";let j;e[41]!==Re?(j=me("text-sm text-muted-foreground",Re),e[41]=Re,e[42]=j):j=e[42];let re;e[43]!==b||e[44]!==N||e[45]!==r?(re=b?r(N?"sectionsEditor.formConflict.changedAgainSteps":"sectionsEditor.formConflict.changedAgain"):"",e[43]=b,e[44]=N,e[45]=r,e[46]=re):re=e[46];let Ae;e[47]!==j||e[48]!==re?(Ae=o.jsx("p",{role:"status",className:j,children:re}),e[47]=j,e[48]=re,e[49]=Ae):Ae=e[49];const Ce=N?"vertical":"all";let S;e[50]!==W||e[51]!==n||e[52]!==Ce?(S=o.jsx(fu,{field:W,...n,arrows:Ce}),e[50]=W,e[51]=n,e[52]=Ce,e[53]=S):S=e[53];let K;e[54]!==Ae||e[55]!==S?(K=o.jsxs("div",{className:"-mx-2 flex min-h-0 flex-col gap-3 overflow-y-auto px-2 py-1",children:[Ae,S]}),e[54]=Ae,e[55]=S,e[56]=K):K=e[56];let he;e[57]!==Z||e[58]!==E||e[59]!==g||e[60]!==V||e[61]!==N||e[62]!==r?(he=N?o.jsxs(_o,{className:"flex-row flex-wrap items-center justify-between gap-2 sm:justify-between",children:[o.jsx(Et,{type:"button",variant:"outline","aria-disabled":E===0,onClick:()=>g(E-1),className:"aria-disabled:cursor-default aria-disabled:opacity-45",children:r("sectionsEditor.formConflict.back")}),o.jsx(Et,{type:"button","data-testid":"form-conflict-primary",onClick:V?Z:()=>g(E+1),children:r(V?"sectionsEditor.formConflict.ok":"sectionsEditor.formConflict.next")})]}):o.jsx(_o,{className:"items-center gap-2",children:o.jsx(Et,{type:"button","data-testid":"form-conflict-primary",onClick:Z,children:r("sectionsEditor.formConflict.ok")})}),e[57]=Z,e[58]=E,e[59]=g,e[60]=V,e[61]=N,e[62]=r,e[63]=he):he=e[63];let M;return e[64]!==fe||e[65]!==K||e[66]!==he?(M=o.jsxs(o.Fragment,{children:[fe,K,he]}),e[64]=fe,e[65]=K,e[66]=he,e[67]=M):M=e[67],M}function lu(){return new Set}function cu(n){const e=Xn(n.mine,n.schema),r=Xn(n.theirs,n.schema),i=e.kind==="text"&&r.kind==="text"?Xc(e.text,r.text):null;return l=>i?o.jsx(pu,{parts:i[l]}):o.jsx(gu,{preview:l==="mine"?e:r})}const uu={all:{ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1},vertical:{ArrowDown:1,ArrowUp:-1}};function du(n,e){const r=uu[e][n.key];if(!r)return;const i=[...n.currentTarget.querySelectorAll('[role="radio"]')],l=i.indexOf(document.activeElement);if(l<0)return;n.preventDefault();const u=i[(l+r+i.length)%i.length];u?.focus(),u?.click()}function fu(n){const e=ct.c(65),{field:r,choices:i,viewer:l,author:u,onChoose:y,arrows:m}=n,b=u===void 0?null:u,h=Lt(),[k]=fa(),{language:N}=k;let L,z,H,B,w,p,te,E,W,V,J,g,Q,x;if(e[0]!==m||e[1]!==b||e[2]!==i||e[3]!==r||e[4]!==N||e[5]!==y||e[6]!==h||e[7]!==l?.image||e[8]!==l?.name){const pe=cu(r),ye=i[r.pointer]??"mine",ue=l?.image??void 0;let fe;e[23]!==h||e[24]!==l?.name?(fe=l?.name?.trim()||h("sectionsEditor.formConflict.you"),e[23]=h,e[24]=l?.name,e[25]=fe):fe=e[25];let Re;e[26]!==ue||e[27]!==fe?(Re=o.jsx(_s,{url:ue,fallback:fe,shape:"circle",size:"sm",className:"text-xs"}),e[26]=ue,e[27]=fe,e[28]=Re):Re=e[28];const j=Re;let re;e[29]!==b||e[30]!==j?(re=b?.you?j:b?.name?o.jsx(_s,{url:b.avatarUrl,fallback:b.name,shape:"circle",size:"sm",className:"text-xs"}):o.jsx(_s,{url:"icon://user",fallback:"",muted:!0,shape:"circle",size:"sm"}),e[29]=b,e[30]=j,e[31]=re):re=e[31];const Ae=re,Ce=b?new Date(b.at):null;H="radiogroup",B=r.label,w="flex flex-col gap-2",e[32]!==m?(p=M=>du(M,m),e[32]=m,e[33]=p):p=e[33];let S;e[34]!==r.pointer||e[35]!==y?(S=()=>y(r.pointer,"mine"),e[34]=r.pointer,e[35]=y,e[36]=S):S=e[36];let K;e[37]!==h?(K=h("sectionsEditor.formConflict.you"),e[37]=h,e[38]=K):K=e[38];let he;e[39]!==h?(he=h("sectionsEditor.formConflict.yourVersionNotSaved"),e[39]=h,e[40]=he):he=e[40],te=o.jsx(Vo,{side:"mine",checked:ye==="mine",onChoose:S,avatar:j,who:K,meta:he,children:pe("mine")}),L=Vo,E="theirs",W=ye==="theirs",e[41]!==r.pointer||e[42]!==y?(V=()=>y(r.pointer,"theirs"),e[41]=r.pointer,e[42]=y,e[43]=V):V=e[43],J=Ae,e[44]!==b?.name||e[45]!==b?.you||e[46]!==h?(g=b?.you?h("sectionsEditor.formConflict.youElsewhere"):b?.name||h("sectionsEditor.formConflict.someoneElse"),e[44]=b?.name,e[45]=b?.you,e[46]=h,e[47]=g):g=e[47],Q=Ce?h("sectionsEditor.formConflict.savedAt",{when:dc(Ce,N)}):h("sectionsEditor.formConflict.theirVersionSaved"),x=Ce?mu(Ce,N):void 0,z=pe("theirs"),e[0]=m,e[1]=b,e[2]=i,e[3]=r,e[4]=N,e[5]=y,e[6]=h,e[7]=l?.image,e[8]=l?.name,e[9]=L,e[10]=z,e[11]=H,e[12]=B,e[13]=w,e[14]=p,e[15]=te,e[16]=E,e[17]=W,e[18]=V,e[19]=J,e[20]=g,e[21]=Q,e[22]=x}else L=e[9],z=e[10],H=e[11],B=e[12],w=e[13],p=e[14],te=e[15],E=e[16],W=e[17],V=e[18],J=e[19],g=e[20],Q=e[21],x=e[22];let Z;e[48]!==L||e[49]!==z||e[50]!==E||e[51]!==W||e[52]!==V||e[53]!==J||e[54]!==g||e[55]!==Q||e[56]!==x?(Z=o.jsx(L,{side:E,checked:W,onChoose:V,avatar:J,who:g,meta:Q,metaTitle:x,children:z}),e[48]=L,e[49]=z,e[50]=E,e[51]=W,e[52]=V,e[53]=J,e[54]=g,e[55]=Q,e[56]=x,e[57]=Z):Z=e[57];let q;return e[58]!==H||e[59]!==B||e[60]!==w||e[61]!==p||e[62]!==te||e[63]!==Z?(q=o.jsxs("div",{role:H,"aria-label":B,className:w,onKeyDown:p,children:[te,Z]}),e[58]=H,e[59]=B,e[60]=w,e[61]=p,e[62]=te,e[63]=Z,e[64]=q):q=e[64],q}const mu=(n,e)=>n.toLocaleString(e,{dateStyle:"medium",timeStyle:"short"});function Vo(n){const e=ct.c(28),{side:r,checked:i,onChoose:l,avatar:u,who:y,meta:m,metaTitle:b,children:h}=n,k=R.useId(),N=`${k}-who`,L=`${k}-meta ${k}-value`,z=i?0:-1,H=i?"border-primary bg-primary/5 ring-1 ring-primary":"hover:bg-accent";let B;e[0]!==H?(B=me("grid w-full cursor-pointer grid-cols-[auto_minmax(0,1fr)] items-start gap-3 rounded-xl border bg-background p-3 text-left transition-[border-color,box-shadow,background-color] focus-ring",H),e[0]=H,e[1]=B):B=e[1];const w=`${k}-who`;let p;e[2]!==w||e[3]!==y?(p=o.jsx("span",{id:w,className:"text-sm font-medium text-foreground",children:y}),e[2]=w,e[3]=y,e[4]=p):p=e[4];const te=`${k}-meta`;let E;e[5]!==m||e[6]!==b||e[7]!==te?(E=o.jsx("span",{id:te,title:b,children:m}),e[5]=m,e[6]=b,e[7]=te,e[8]=E):E=e[8];let W;e[9]!==p||e[10]!==E?(W=o.jsxs("span",{className:"flex flex-wrap items-baseline gap-x-1.5 text-xs text-muted-foreground",children:[p,E]}),e[9]=p,e[10]=E,e[11]=W):W=e[11];const V=`${k}-value`,J=`conflict-${r}`;let g;e[12]!==h||e[13]!==V||e[14]!==J?(g=o.jsx("span",{id:V,"data-testid":J,className:"min-w-0 text-sm",children:h}),e[12]=h,e[13]=V,e[14]=J,e[15]=g):g=e[15];let Q;e[16]!==W||e[17]!==g?(Q=o.jsxs("span",{className:"flex min-w-0 flex-col gap-1",children:[W,g]}),e[16]=W,e[17]=g,e[18]=Q):Q=e[18];let x;return e[19]!==u||e[20]!==i||e[21]!==l||e[22]!==N||e[23]!==Q||e[24]!==L||e[25]!==z||e[26]!==B?(x=o.jsxs("button",{type:"button",role:"radio","aria-checked":i,"aria-labelledby":N,"aria-describedby":L,tabIndex:z,onClick:l,className:B,children:[u,Q]}),e[19]=u,e[20]=i,e[21]=l,e[22]=N,e[23]=Q,e[24]=L,e[25]=z,e[26]=B,e[27]=x):x=e[27],x}function pu(n){const e=ct.c(4),{parts:r}=n;let i;e[0]!==r?(i=r.map(hu),e[0]=r,e[1]=i):i=e[1];let l;return e[2]!==i?(l=o.jsx("span",{className:"whitespace-pre-wrap break-words",children:i}),e[2]=i,e[3]=l):l=e[3],l}function hu(n,e){return n.kind==="changed"?o.jsx("mark",{className:"rounded-sm bg-warning/20 px-0.5 text-foreground",children:n.text},e):o.jsx("span",{children:n.text},e)}function gu(n){const e=ct.c(29),{preview:r}=n,i=Lt();switch(r.kind){case"empty":{let l;e[0]!==i?(l=i("sectionsEditor.formConflict.empty"),e[0]=i,e[1]=l):l=e[1];let u;return e[2]!==l?(u=o.jsx("span",{className:"italic text-muted-foreground",children:l}),e[2]=l,e[3]=u):u=e[3],u}case"text":{let l;return e[4]!==r.text?(l=o.jsx("span",{className:"whitespace-pre-wrap break-words",children:r.text}),e[4]=r.text,e[5]=l):l=e[5],l}case"image":{let l;return e[6]!==r.src?(l=o.jsx("img",{src:r.src,alt:"",className:"max-h-24 max-w-full rounded border object-contain"}),e[6]=r.src,e[7]=l):l=e[7],l}case"yesNo":{const l=r.value?"sectionsEditor.formConflict.yes":"sectionsEditor.formConflict.no";let u;e[8]!==i||e[9]!==l?(u=i(l),e[8]=i,e[9]=l,e[10]=u):u=e[10];let y;return e[11]!==u?(y=o.jsx("span",{children:u}),e[11]=u,e[12]=y):y=e[12],y}case"list":{const l=r.count===1?"sectionsEditor.formConflict.oneItem":"sectionsEditor.formConflict.items",u=String(r.count);let y;e[13]!==i||e[14]!==l||e[15]!==u?(y=i(l,{count:u}),e[13]=i,e[14]=l,e[15]=u,e[16]=y):y=e[16];let m;e[17]!==y?(m=o.jsx("span",{className:"text-muted-foreground",children:y}),e[17]=y,e[18]=m):m=e[18];let b;e[19]!==r.count||e[20]!==r.items?(b=r.items.some(Boolean)&&o.jsxs("span",{className:"flex flex-col",children:[r.items.map(yu),r.count>r.items.length&&o.jsx("span",{children:"…"})]}),e[19]=r.count,e[20]=r.items,e[21]=b):b=e[21];let h;return e[22]!==m||e[23]!==b?(h=o.jsxs("span",{className:"flex flex-col gap-1",children:[m,b]}),e[22]=m,e[23]=b,e[24]=h):h=e[24],h}case"fields":{let l;e[25]!==r.entries?(l=r.entries.map(vu),e[25]=r.entries,e[26]=l):l=e[26];let u;return e[27]!==l?(u=o.jsx("dl",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-0.5",children:l}),e[27]=l,e[28]=u):u=e[28],u}}}function vu(n){return o.jsxs("div",{className:"contents",children:[o.jsx("dt",{className:"text-muted-foreground",children:n.label}),o.jsx("dd",{className:"truncate",children:n.text})]},n.label)}function yu(n,e){return o.jsx("span",{className:"truncate",children:`${e+1}. ${n||"…"}`},e)}function xu(n,e){return n.kind==="protocol"&&n.source==="github"?e:null}function bu(n,e){if(Object.hasOwn(n,e))return n[e]??null;const r=fo(e),i=Object.keys(n).find(l=>fo(l)===r);return i===void 0?null:n[i]??null}async function Su(n,e){try{const r=await fetch(`/api/${n.orgSlug}/decofile/${encodeURIComponent(n.virtualMcpId)}/${encodeURIComponent(n.branch)}`,{cache:"no-store",headers:Qa("v8")});if(!r.ok)return null;const i=await r.json().catch(()=>({})),l=bu(i.changedBy??{},e);return l&&typeof l.userId=="string"&&Number.isFinite(Date.parse(l.at))?l:null}catch{return null}}function _u(n,e,r){const i=e.find(y=>y.userId===n.userId),l=i?.user?.name?.trim(),u=i?.user?.image??void 0;return{...l?{name:l}:{},...u?{avatarUrl:u}:{},at:n.at,you:!!r&&n.userId===r}}function wu(n){let e=2166136261,r=0;for(let i=0;i<n.length;i++){const l=n.charCodeAt(i);e=Math.imul(e^l,16777619),r=Math.imul(r,31)+l|0}return`${(e>>>0).toString(36)}${(r>>>0).toString(36)}:${n.length}`}function ju(n,e,r){const i=ct.c(19),l=!!n&&!!e&&r!==null;let u;i[0]!==e||i[1]!==n||i[2]!==r?(u=Io.conflictAuthor(n?`${n.orgSlug}/${n.virtualMcpId}/${n.branch}`:"",e??"",r??""),i[0]=e,i[1]=n,i[2]=r,i[3]=u):u=i[3];let y;i[4]!==e||i[5]!==n?(y=()=>Su(n,e),i[4]=e,i[5]=n,i[6]=y):y=i[6];let m;i[7]!==l||i[8]!==u||i[9]!==y?(m={queryKey:u,queryFn:y,enabled:l,staleTime:Number.POSITIVE_INFINITY,gcTime:6e5,retry:!1,refetchOnWindowFocus:!1},i[7]=l,i[8]=u,i[9]=y,i[10]=m):m=i[10];const{data:b}=ma(m),h=l?b??null:null,k=!!h;let N;i[11]!==k?(N={enabled:k},i[11]=k,i[12]=N):N=i[12];const{data:L}=mc(N);let z;i[13]!==L?(z=L?.data?.members??[],i[13]=L,i[14]=z):z=i[14];const H=z,{data:B}=Ko.useSession();if(!h)return null;const w=B?.user?.id??null;let p;return i[15]!==h||i[16]!==H||i[17]!==w?(p=_u(h,H,w),i[15]=h,i[16]=H,i[17]=w,i[18]=p):p=i[18],p}function ku(n,e,r,i){if(!n||typeof n!="object")return{kind:"error",reason:"no-matcher-rule"};const l=e.trim();if(!l)return Qt(n,r,i)?{kind:"inline",blockKey:n.__resolveType??"",inlinedRule:Rs(n,r,i)}:{kind:"noop"};const u=As(n,r,i);if(!u)return{kind:"error",reason:"unreadable-rule"};if(u.blockKey)return{kind:"updateBlock",blockKey:u.blockKey,blockData:Ot(u.resolveType,u.data,l)};const y=Gn(l),m=Un(y,r);return m?{kind:"error",reason:"invalid-block-id",message:m}:{kind:"createBlock",blockId:y,blockData:Ot(u.resolveType,u.data,l),reference:dn(y)}}const Po="section-form-stale-save",Eu=3,Ru=1e3;function Mo(n,e,r){const i=e.global&&e.pageKey?[{label:"Default",sections:[{__resolveType:e.pageKey}]}]:Fo(e.pageKey?n[e.pageKey]?.sections:void 0,n,r),l=Math.max(0,Math.min(e.pageVariantIndex,i.length-1)),u=i[l]?.sections??[];return{pageVariants:i,variantIndex:l,rawSections:u,parsedSections:En(u,n,r)}}const Do=new WeakMap;let Au=0;function Cu(n){let e=Do.get(n);return e===void 0&&(e=++Au,Do.set(n,e)),e}function Gm({orgSlug:n,virtualMcpId:e,branch:r,previewReady:i=!0,previewUrl:l,currentPath:u,activePageBlockKey:y=null,activeGlobalBlockKey:m=null,externalSelection:b,onSaved:h,initialEditSeo:k=!1,onExitSeo:N,onSelectRoot:L,onViewJsonFile:z,onFocusedBlockChange:H,onVariantPreviewOverride:B,focusVariant:w}){const p=Lt(),te=ga(),E=te?.taskId??null,W=i?{orgSlug:n,virtualMcpId:e,branch:r,threadId:E,previewUrl:l}:null,[V,J]=R.useState([]),{data:g,isLoading:Q}=Xa(W,{pollWhile:V.length>0}),{data:x,isLoading:Z}=al(W),q=Zn(),pe=te?.virtualMcpId,ue=qa(pe===e?e:null)?.metadata?.siteSlug??null,fe=sc({virtualMcpId:e,branch:r,sandboxUrl:l}),Re=Za(e,r),j=el(Re),re=ul(j),Ae=!j,Ce=!!fe||j,[S,K]=R.useState(null),[he,M]=R.useState(null),[xe,O]=R.useState(null),[oe,G]=R.useState(0),[Ke,ke]=R.useState(void 0),[ut,Ze]=R.useState(null),[$e,qe]=R.useState(null);w&&w.seq!==ut&&(Ze(w.seq),qe(w));const[it,Ge]=R.useState(null),Ue={index:it,remember:Ge},[Ye,de]=R.useState(null),[ge,be]=R.useState(null),[ee,F]=R.useState([]),De=R.useRef(null),[et,tt]=R.useState(ee.length);et!==ee.length&&(tt(ee.length),requestAnimationFrame(()=>{De.current&&(De.current.scrollTop=0)}));const[st,I]=R.useState(0),[Je,ae]=R.useState(null),[Ne,ze]=R.useState(null),[rt,at]=R.useState(null),[Qo,Zt]=R.useState(!1),[Fs,es]=R.useState(!1),Rn=R.useRef(null),[An,Xo]=R.useState(!0),[en,Cn]=R.useState(!1),[$t,Nn]=R.useState(!1),[He,fn]=R.useState(k),[Bs,Os]=R.useState(k);k&&!Bs&&(Os(!0),fn(!0),K(null),M(null),O(null),F([])),!k&&Bs&&Os(!1);const[Zo,mn]=R.useState(null),[Ls,Tn]=R.useState(void 0),[$s,zt]=R.useState([]),[zs,tn]=R.useState(0),[Qe,dt]=R.useState(0),[ei,Xe]=R.useState(null),[nn,nt]=R.useState(null),[Hs,Ws]=R.useState(null),qs=pa(),Gs=tl({orgSlug:n,virtualMcpId:e,branch:r},{tunnel:!1}),pn=Ra({orgSlug:n,virtualMcpId:e,branch:r}),[ti,ni]=R.useState(u),[si,ri]=R.useState(y),[oi,ii]=R.useState(m);(ti!==u||si!==y||oi!==m)&&(queueMicrotask(()=>pn.flush()),ni(u),ri(y),ii(m),K(null),M(null),O(null),G(0),de(null),be(null),dt(0),Xe(null),nt(null),F([]),I(t=>t+1),fn(!1),mn(null),Tn(void 0),zt([]),tn(t=>t+1));const X=Aa({orgSlug:n,virtualMcpId:e,branch:r}),hn=za((t,s)=>{X.mutate({blockKey:t,data:s},{onSuccess:()=>h?.(),onError:X.reportError})}),Vn=ml({orgSlug:n,virtualMcpId:e,branch:r}),Us=vc({orgSlug:n,virtualMcpId:e,branch:r}),[sn,rn]=R.useState(!1),$=R.useRef(null),Tt=R.useRef(null),ht=R.useRef(null),gt=R.useRef(null),Pn=R.useRef({}),Ht=R.useRef(null),gn=R.useRef(!1),vn=R.useRef(!1),Ie=R.useRef(new Map),on=R.useRef(!1),_t=R.useRef([]),ts=R.useRef(new WeakSet);nl(n,e,t=>{const{activePageKey:s,rawSections:a,parsedSections:c,selectedSectionIndex:d}=Se.current,v=new Set;s&&v.add(s);for(const f of[Tt.current?.sectionIndex,d]){const _=f==null?void 0:a[f],D=f==null?void 0:c[f],A=_&&D?.isSavedBlock?ys(_,D):null;A&&v.add(A)}if([...v].some(f=>t.has(f))){for(const f of[$,ht,gt])f.current&&clearTimeout(f.current),f.current=null;Tt.current=null,Ie.current.clear(),s&&t.has(s)&&(Pn.current={})}});const Se=R.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[Ys,Js]=R.useState(0),[ai,li]=R.useState(0),ci=ju(xu(Re,{orgSlug:n,virtualMcpId:e,branch:r}),V[0]?.blockKey??null,V[0]?wu(Le(V[0].plan.theirs)):null),[ui,di]=R.useState(null),ns=sl(n,e).epoch,[fi,mi]=R.useState(ns);if(!i||Q||Z)return o.jsx("div",{className:"h-full w-full flex items-center justify-center",children:o.jsx(ha,{className:"size-5 text-muted-foreground"})});if(!g||!x)return o.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:p("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const pi=vl(g,x),ne=!!m,_e=ne?null:yl(pi,u,y),C=ne?m:_e?.key??null,Mn=ne&&m?g[m]:void 0,Qs=ne&&m&&Mn?xl(m,Mn):ne&&m?m:"",Wt=!ne&&C&&g[C]?g[C]:null,ss=He&&g&&x&&C&&_e?Zr(g,{kind:"page",pageKey:C,pageName:String(_e.name??""),path:String(_e.path??"")},x):null,hi=He?Wt?.seo:void 0,Dn=Ls!==void 0?Ls:hi,gi=He?Ca(Dn):void 0,Xs=ss?.seoTypeOptions??[],Zs=He&&x?Na(x):"",rs=Zo??gi??{},Kn=He&&ss?pc(rs,ss):null,er=He&&Kn&&Ta(Dn)?qn(Kn,x):null,tr=He?Va(g,x)?.seoData:void 0,Te=ne?[{label:"Default",sections:[{__resolveType:m}]}]:Fo(Wt?.sections,g??{},j),vt=Te.length>1,ve=Math.min(oe,Te.length-1),Fe=Te[ve],U=Fe?.sections??[],Ve=En(U,g,j),In=!ne&&bl(Wt?.sections,j);if(ne&&m&&Hs!==m){Ws(m);const t=U[0],s=Ve[0];if(t&&s){K(0),dt(0),F([]);const a=kt(t,s,g,j);a&&(M(a.data),O(a.resolveType),nt(null),Xe(null))}}!ne&&Hs!==null&&Ws(null),Se.current={rawSections:U,parsedSections:Ve,decofile:g??{},activePageKey:C,pageVariants:Te,variantIndex:ve,sectionVariantIndex:Qe,selectedSectionIndex:S};const vi=()=>({multivariate:In,index:ve,variants:Te.map(t=>({rule:t.rule})),lazyValues:j&&In&&Ml(Wt?.sections?.variants?.[ve]?.value)}),os=(t,s)=>{if(!B)return;if(!C||!In||t.length<=1){B(null);return}const a={multivariate:!0,index:s,variants:t},c=j?jo(C,a):ko(C,a,g,x);B(c.length>0?c:null)},is=B&&C&&In&&vt&&!Q&&!Z?C:null;if(is!==ui&&(di(is),is)){const t=Te.map(a=>({rule:a.rule})),s=ve;queueMicrotask(()=>os(t,s))}const qt=(t,s,a)=>{if(!B)return;if(!C){B(null);return}const c=vi(),d=j?jo(C,c):ko(C,c,g,x);if(!t||s<0){B(d.length>0?d:null);return}const v={pageKey:C,page:c,sectionIndex:s,sectionLazy:Ve[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:a},f=j?yc(v):xc({...v,decofile:g,meta:x}),_=j?bc(d,f):[...d,...f];B(_.length>0?_:null)},wt=(t,s,a,c=S??-1,d=!1)=>{const v=ot(t,s);if(!v){M(null),O(null),nt(null),Xe(null),d&&qt(null,c,a);return}const _=Es(v,re)[a];if(!_){M(null),O(null),nt(null),Xe(null),d&&qt(null,c,a);return}const D=Lo(_.value,g);M(D?.data??null),O(D?.resolveType??null);const{resolveType:A,formValue:T}=Jt(_.rule,g,x??void 0);nt(A),Xe(T),d&&qt(v,c,a)},yn=t=>{ze(null),G(t),K(null),M(null),O(null),F([]);const s=Te[t]?.rule,{resolveType:a,formValue:c}=Jt(s,g??{},x??void 0);be(a),de(c),os(Te.map(d=>({rule:d.rule})),t)},nr=(t,s)=>{const a=U[t],c=Ve[t];if(!a||!c)return!1;const d=c.isMultivariate?ot(a,c)?.variants?.length??0:0,v=s<d?s:0;if(K(t),dt(v),F([]),I(f=>f+1),c.isMultivariate)wt(a,c,v,t);else{const f=kt(a,c,g,j);f?(M(f.data),O(f.resolveType)):(M(null),O(null)),nt(null),Xe(null)}return!0},sr=b?.index;if(b!==void 0&&(b?.seq??null)!==Ke&&(ke(b?.seq??null),typeof sr=="number"&&nr(sr,0)),$e&&(ne?Mn:Wt)){const t=$e.pageVariant,s=!ne&&t!==void 0&&t<Te.length;if(s&&t!==ve)yn(t);else{qe(null);const{section:a,variant:c}=$e;if(ne)c!==void 0&&(Ge(c),F([]),I(d=>d+1));else if(a!==void 0&&nr(a,c??0)){const d=U[a],v=Ve[a],f=v.isMultivariate?ot(d,v):null;f&&c!==void 0&&queueMicrotask(()=>qt(f,a,c))}else s&&yn(t)}}if(ns!==fi){mi(ns);const t=$.current!==null||Ie.current.size>0||gt.current!==null||ht.current!==null||X.isPending||pn.isPending||V.length>0,s=S!==null&&Co(De.current,document.activeElement);if(!t&&s&&(on.current=!0),!t&&!s&&S!==null){const a=U[S],c=Ve[S];if(F([]),I(d=>d+1),!a||!c)K(null),M(null),O(null);else if(c.isMultivariate)wt(a,c,Qe,S);else{const d=kt(a,c,g,j);M(d?.data??null),O(d?.resolveType??null)}}!t&&He&&(mn(null),Tn(void 0),tn(a=>a+1))}if(Ys!==ai){li(Ys);const t=S!==null?U[S]:null,s=S!==null?Ve[S]:null;if(t&&s&&S!==null)if(F([]),I(a=>a+1),s.isMultivariate)wt(t,s,Qe,S);else{const a=kt(t,s,g,j);M(a?.data??null),O(a?.resolveType??null)}}const ft=V[0];if(ft){const{formBase:t,target:s}=ft,a=Mo(g,s,j),c=t.sectionIndex,d=a.rawSections.length===t.sectionCount?js(a.rawSections[c],a.parsedSections[c],s.sectionVariantIndex,g,j):null,v=$c(ft,d,f=>Ro(t,f));if(v){const _=[{...ft,...v,changedAgain:!0},...V.slice(1)];_t.current=_,J(_)}}const xn={orgSlug:n,virtualMcpId:e,branch:r,threadId:E,previewUrl:j?void 0:l??void 0,siteSlug:ue},Fn=xe&&x?qn(xe,x):null,mt=(t,s)=>{if(!C)return;$.current&&(clearTimeout($.current),$.current=null),Ie.current.clear(),gt.current&&(clearTimeout(gt.current),gt.current=null),ht.current&&(clearTimeout(ht.current),ht.current=null);const a=cn(g,C,t,ve,Te);X.mutate({blockKey:C,data:a},{onSuccess:()=>s?.onSuccess?.()??h?.(),onError:c=>{s?.onError?.(),X.reportError(c)}})},Gt=()=>{H?.(null),K(null),Nn(!1),M(null),O(null),dt(0),Xe(null),nt(null),F([]),I(t=>t+1)},rr=()=>Co(De.current,document.activeElement),as=(t=p("sectionsEditor.sectionsEditor.blockChangedElsewhere"))=>{if($.current&&(clearTimeout($.current),$.current=null),Ie.current.clear(),Tt.current=null,ie.error(t,{id:Po}),rr()){on.current=!0;return}Js(s=>s+1)},or=()=>{!on.current||rr()||_t.current.length>0||$.current!==null||gn.current||vn.current||Ie.current.size>0||(on.current=!1,Js(t=>t+1))},ir=()=>{on.current&&setTimeout(or,0)},ar=t=>ol(qs,Gs,t),lr=t=>{Ie.current.size!==0&&setTimeout(()=>{if(gn.current||vn.current)return;const s=[...Ie.current.values()];Ie.current.clear();for(const a of s)a()},t)},yi=t=>{const{activePageKey:s,variantIndex:a,sectionVariantIndex:c}=Se.current,d=Ht.current;return{formBase:d?.sectionIndex===t&&d.variantIndex===c?d:null,pageKey:s,global:ne,pageVariantIndex:a,sectionVariantIndex:c,schema:Fn}},bn=t=>{_t.current=t,J(t)},xi=t=>{const s=_t.current,a=s.findIndex(v=>v.formBase===t.formBase),c=a>=0?s[a]:void 0,d=c?s.with(a,{...t,choices:Ms(c.plan,c.choices,t.plan),fresh:Yo(c.plan,t.plan,c.fresh),changedAgain:c.changedAgain||Le(c.plan.theirs)!==Le(t.plan.theirs)}):[...s,{...t,changedAgain:ts.current.has(t.formBase)}];bn(d)},cr=(t,s)=>{const a=_t.current,c=a.findIndex(f=>f.formBase===t),d=a[c];if(!d)return!1;if(Le(d.plan.mine)===Le(s))return!0;const v=Vs({...d.plan,mine:s});if(v.pointers.length===0){const f=a.filter(_=>_!==d);return bn(f),!1}return bn(a.with(c,{...d,plan:v,choices:Ms(d.plan,d.choices,v)})),!0},bi=t=>{const s=Se.current;return s.selectedSectionIndex===t.formBase.sectionIndex&&s.activePageKey===t.target.pageKey&&s.variantIndex===t.target.pageVariantIndex&&s.sectionVariantIndex===t.target.sectionVariantIndex},Si=()=>{const t=_t.current[0];if(!t)return null;const{formBase:s,target:a}=t;$.current&&Tt.current?.sectionIndex===s.sectionIndex&&Tt.current.sectionVariantIndex===a.sectionVariantIndex&&(clearTimeout($.current),$.current=null,Tt.current=null),Ie.current.delete(`${a.pageKey}:${s.sectionIndex}:${a.sectionVariantIndex}`);const c=s.emitted;return c&&typeof c=="object"&&!cr(s,c)&&Sn(c,s.sectionIndex,0,a),_t.current[0]??null},_i=()=>{const t=_t.current[0],s=Si();if(!s||!t||s.formBase!==t.formBase||s.plan.pointers.some(v=>!t.plan.pointers.includes(v)))return;const a=Oc(s.plan,s.choices);bn(_t.current.slice(1));const{formBase:c,target:d}=s;c.base=s.plan.theirs,c.version=void 0,c.emitted=a,ts.current.add(c),(Ht.current===c||bi(s))&&(Ht.current=c,M(a),I(v=>v+1)),Sn(a,c.sectionIndex,0,d)},wi=t=>{const[s,...a]=_t.current;s&&bn([{...s,choices:t},...a])},Sn=(t,s,a=0,c)=>{const d=c??yi(s),v=d.sectionVariantIndex,f=d.formBase,_=Tt.current;$.current&&(clearTimeout($.current),$.current=null,_&&(_.sectionIndex!==s||_.sectionVariantIndex!==v)&&_.write());const D=`${d.pageKey}:${s}:${v}`,A=()=>{if(gn.current||vn.current){Ie.current.set(D,A);return}const T=typeof t=="function"?t():t;if(f&&cr(f,T))return;const P=Se.current.decofile,{rawSections:se,parsedSections:le,pageVariants:Be,variantIndex:we}=Mo(P,d,j),Pe=d.pageKey,Y=se[s];if(!Y)return;const ce=le[s];if(!ce)return;const Me=f?.base,We=js(Y,ce,v,P,j),xt=!!Me&&!!We&&qo(Me,We)&&!(f&&Ro(f,We));if(xt&&Me&&We){if(Go(Me,We)){as(p("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}const je=ce.isSavedBlock?"here":Fc(Me,se.map((Ee,Kt)=>js(Ee,le[Kt],v,P,j)),s,f?.sectionCount??se.length);if(je==="unknown"){as(p("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}if(typeof je=="number"&&f){f.sectionCount=se.length,f.sectionIndex=je,Ht.current===f&&K(je),Sn(T,je,a,d);return}}const lt=xt&&Me&&We?Vs({ancestor:Me,mine:T,theirs:We}):null;if(lt&&lt.pointers.length>0&&f){f.sectionCount=se.length,xi({plan:lt,formBase:f,target:d,sectionIndex:s,choices:Uo(lt),changedAgain:!1,blockKey:ce.isSavedBlock?ys(Y,ce):Pe,fresh:{}});return}const bt=lt?lt.merged:null,Dt=bt??T,Yr=Bc({merged:!!bt,tracked:f,current:Ht.current,saved:T});bt&&ie.info(p("sectionsEditor.sectionsEditor.blockMergedWithOthers"),{id:Po}),Yr&&f&&(f.emitted=bt,M(bt));const gs=Yr||!bt?Dt:T;f&&(f.base=gs,f.sectionCount=se.length,Kc(f,gs));const Jr={onSuccess:()=>{f&&ts.current.delete(f),h?.()},onError:je=>{if(f?.base===gs&&Me&&(f.base=Me),je instanceof rl){f&&(f.version=void 0),a<Eu?(Ie.current.delete(D),vn.current=!0,setTimeout(()=>{vn.current=!1,Sn(()=>{const Ee=f?.emitted;return Ee&&typeof Ee=="object"?Ee:T},s,a+1,d),Ie.current.delete(D),lr(jn)},Ru*2**a)):as();return}X.reportError(je)}},Qr=je=>{gn.current=!0;let Ee=!1;X.mutateAsync(je).then(()=>Jr.onSuccess(),Kt=>{Ee=!0,Jr.onError(Kt)}).finally(()=>{gn.current=!1,lr(Ee?jn:0),or()})};if(ce.isSavedBlock){const je=ys(Y,ce);if(!je)return;Qr({blockKey:je,data:Dt,...Me?{base:{value:bt?We:Me}}:{},rebaseOnConflict:!1,guard:Ao({formBase:f,rebased:!!bt,versionOf:ar})});return}if(!Pe)return;const Hn={...P[Pe]},Yt=[...se];if(ce.isMultivariate){const je=ot(Y,ce);if(!je||!Pe)return;const Ee=Il(je,v,Dt);Yt[s]=Bt(Y,ce,Ee)}else if(ce.isHidden){const je=Ks(Y.__resolveType),Ee=je?{...Y.section}:{...Y},Kt=Array.isArray(Ee.variants)?[...Ee.variants]:[];Kt[0]&&(Kt[0]=yo(Ee.__resolveType,Kt[0],Dt)),Ee.variants=Kt,je?Yt[s]={...Y,section:Ee}:Yt[s]=Ee}else ce.isLazy?Yt[s]={...Y,section:Dt}:Yt[s]=Dt;if(Be.length>1){const je=Hn.sections,Ee=[...je?.variants??[]];Ee[we]&&(Ee[we]=yo(je?.__resolveType,Ee[we],Yt)),Hn.sections={...je,variants:Ee}}else Hn.sections=Yt;Qr({blockKey:Pe,data:Hn,rebaseOnConflict:!1,guard:Ao({formBase:null,rebased:!1,versionOf:ar})})};Tt.current={sectionIndex:s,sectionVariantIndex:v,write:A},$.current=setTimeout(()=>{$.current=null,A()},jn)},ji=t=>{on.current=!1,K(t),dt(0),F([]),I(d=>d+1);const s=U[t],a=Ve[t];if(H?.(a?.isSavedBlock?a.resolveType??null:null),!s||!a)return;if(a.isMultivariate){wt(s,a,0,t);return}const c=kt(s,a,g,j);if(!c){M(null),O(null),nt(null),Xe(null),qt(null,t,0);return}M(c.data),O(c.resolveType),nt(null),Xe(null),qt(null,t,0)},ur=t=>{const s=t;S!==null&&(Ht.current=Ic(Ht.current,{sectionIndex:S,variantIndex:Se.current.sectionVariantIndex,shown:he,next:s,sectionCount:Se.current.rawSections.length})),M(s),S!==null&&Sn(s,S)},ls=t=>{if(!C||!g||!x||!_e)return;const s={kind:"page",pageKey:C,pageName:String(_e.name??""),path:String(_e.path??"")},a=Zr(g,s,x);a&&pn.save(C,()=>{const c=qs.getQueryData(Io.decofile(Gs))?.[C];if(!c||typeof c!="object"||c===null||Array.isArray(c))return null;const d={...c,...Pn.current};return Pn.current={},t?.raw!==void 0?hc(d,t.raw,x):t?.inner!==void 0?gc(s,a,d,t.inner):d})},dr=(t,s)=>{C&&(Pn.current[t]=s,ls())},ki=(t,s)=>{if(!C)return;const a=Yn([...U],t,s);S!==null&&(S===t?K(s):t<S&&s>=S?K(S-1):t>S&&s<=S&&K(S+1)),mt(a)},Ei=t=>{if(!C)return;const s=U.filter((a,c)=>c!==t);S===t?Gt():S!==null&&S>t&&K(S-1),mt(s)},Ri=t=>{if(!C)return;const s=U[t];if(!s)return;const a=[...U];a.splice(t+1,0,Ha(s)),S!==null&&S>t&&K(S+1),mt(a)},Ai=t=>{if(!C)return;const s=U[t],a=Ve[t];if(!s||!a)return;const c=a.isHidden?Cl(s,j):Nl(s,x);if(!c)return;const d=[...U];d[t]=c,S===t&&Gt(),mt(d)},Ci=t=>{if(!C)return;const s=U[t],a=Ve[t];if(!s||!a||a.isMultivariate)return;const c=Al(s);if(!c)return;const d=[...U];d[t]=c,S===t&&Gt(),mt(d)},Ni=t=>{if(!C)return;const s=U[t],a=Ve[t];if(!s||!a?.isSavedBlock)return;const c=kt(s,a,g,j);if(!c?.data)return;const{name:d,...v}=c.data,f=[...U];a.isLazy?f[t]={...s,section:v}:f[t]=v,S===t&&Gt(),mt(f)},Ti=t=>{if(!C)return;const s=[...U,{__resolveType:t.resolveType}],a=s.length-1;mt(s,{onError:()=>{Se.current.selectedSectionIndex===a&&Gt()}}),Zt(!1),K(a),dt(0),F([]),I(f=>f+1);const c=s[a],d=En(s,g,j)[a];if(!c||!d)return;if(d.isMultivariate){wt(c,d,0);return}const v=kt(c,d,g,j);if(!v){M(null),O(null),nt(null),Xe(null);return}M(v.data),O(v.resolveType),nt(null),Xe(null)},fr=t=>{Rn.current=t.append,Zt(!0)},Vi=t=>{const s=Rn.current;if(!s){Ti(t);return}s({__resolveType:t.resolveType}),Zt(!1),Rn.current=null},mr=t=>{if(S===null)return;const s=U[S],a=Ve[S];!s||!a?.isMultivariate||(dt(t),F([]),I(c=>c+1),wt(s,a,t,S,!0))},Pi=t=>{if(S===null||!C)return;const s=U[S],a=Ve[S];if(!s||!a?.isMultivariate)return;const c=ot(s,a);if(!c)return;const d=El(c,t);if(!d){ie.error(p("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const v=[...U];v[S]=Bt(s,a,d);const f=d.variants;let _=Qe;t===Qe?_=Math.min(t,f.length-1):t<Qe&&(_=Qe-1),dt(_),F([]),I(D=>D+1),wt(v[S],a,_),mt(v)},Mi=t=>{if(S===null||!C)return;const s=U[S],a=Ve[S];if(!s||!a?.isMultivariate)return;const c=ot(s,a);if(!c)return;const d=Rl(c,t,j),v=[...U];v[S]=Bt(s,a,d);const f=vo(c.variants??[],t,j);dt(f),F([]),I(_=>_+1),wt(v[S],a,f,S,j),mt(v)},Di=(t,s)=>{if(S===null||!C||t===s)return;const a=U[S],c=Ve[S];if(!a||!c?.isMultivariate)return;const d=ot(a,c);if(!d)return;const v=jl(d,t,s),f=[...U];f[S]=Bt(a,c,v);let _=Qe;Qe===t?_=s:t<Qe&&s>=Qe?_=Qe-1:t>Qe&&s<=Qe&&(_=Qe+1),dt(_),wt(f[S],c,_,S,j),mt(f)},_n=t=>{const s=t??S;if(s===null||!C)return;const a=U[s],c=Ve[s];if(!a||!c)return;const d=Sl(a,c,void 0,x,j);if(!d){ie.error(p("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const v=[...U];v[s]=d.section;const f=En(v,g,j)[s];if(!f?.isMultivariate){ie.error(p("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}K(s),dt(d.newVariantIndex),F([]),I(_=>_+1),wt(d.section,f,d.newVariantIndex,s,j),mt(v)},pr=()=>{if(S===null||!C)return;const t=U[S],s=Ve[S];if(!t||!s?.isMultivariate)return;const a=ot(t,s);if(!a)return;const c=kl(t,s,a);if(!c){ie.error(p("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const d=[...U];d[S]=c;const v=En(d,g,j)[S];if(!v)return;dt(0),nt(null),Xe(null),F([]),I(_=>_+1);const f=kt(c,v,g,j);f?(M(f.data),O(f.resolveType)):(M(null),O(null)),qt(null,S,0),mt(d)},Ki=async t=>{if(Je===null||!C)return;const s=Un(t,g,x);if(s){ie.error(s);return}const a=U[Je],c=Ve[Je];if(!a||!c)return;const d=kt(a,c,g,j);if(!d){ie.error(p("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const v={...d.data,name:t};try{await X.mutateAsync({blockKey:t,data:v});const f=[...U];f[Je]={__resolveType:t},await X.mutateAsync({blockKey:C,data:cn(g,C,f,ve,Te)}),S===Je&&Gt(),ae(null),ie.success(p("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),h?.()}catch(f){ie.error(p("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"),{description:It(p,Ft(f))})}},hr=Fe?.rule;if(vt&&S===null&&ge===null&&hr){const{resolveType:t,formValue:s}=Jt(hr,g??{},x??void 0);be(t),de(s)}const an=x?Pa(x):[],cs=x&&g?Ma(x,g):[],Ut=j&&x&&g?ll(x,g):[],us=(t,s)=>{if(Ut.length===0)return;const a=wl(t);return{kinds:Ut,selected:a,campaignPrefill:cl(t),onPick:s}},gr=!ne&&!!(Ce&&x&&g),vr=ge&&x?qn(ge,x):null,yt=()=>{ht.current&&(clearTimeout(ht.current),ht.current=null),gt.current&&(clearTimeout(gt.current),gt.current=null)},jt=async(t,s)=>{if(!(Kl(s,t,x)>0))try{await Vn.mutateAsync({blockKey:t})}catch(a){ie.error(p("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"),{description:It(p,Ft(a))})}},yr=t=>{ht.current&&clearTimeout(ht.current),ht.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:c}=Se.current;if(!s)return;const d={...a[s]},v={...d.sections},f=[...v.variants??[]],_=f[c],D=_?.rule;if(Qt(D,a,x)){const A=D?.__resolveType??"",T=a[A],P=typeof T?.name=="string"?T.name:A,{__resolveType:se,...le}=t;X.mutate({blockKey:A,data:Ot(se??"",le,P)},{onSuccess:()=>h?.(),onError:X.reportError});return}_&&(f[c]={..._,rule:t}),d.sections={...v,variants:f},X.mutate({blockKey:s,data:d},{onSuccess:()=>h?.(),onError:X.reportError})},jn)},xr=t=>{be(t);const s=t?ho(t,x):{__resolveType:go(x)};de(t?s:{}),yr(s)},br=t=>{const s=t;de(s);const a=ge?{__resolveType:ge,...s}:{...s};yr(a)},Bn=async(t,s,a)=>{const c=dl(s,t);if(!c.ok)return c.reason==="conflict"&&ie.info(t.kind==="experiments"?p("sectionsEditor.namedRulePicker.conflictTests"):p("sectionsEditor.namedRulePicker.conflictCampaigns"),mo),null;const d={};if(a){const v=a(c.rule);if(!v)return null;d[v.blockKey]=v.data}return c.blockWrite&&(d[c.blockWrite.blockKey]=c.blockWrite.block),Object.keys(d).length>0&&!(await Us.apply({writes:d})).ok?null:(c.blockWrite&&ie.success(t.kind==="experiments"?p("sectionsEditor.namedRulePicker.createdTest",{name:t.name.trim()}):p("sectionsEditor.namedRulePicker.createdCampaign",{name:t.name.trim()}),{...mo,description:p("sectionsEditor.namedRulePicker.createdHint")}),{rule:c.rule,projected:{...s,...d}})},Sr=Ut.length>0?{kinds:Ut,prepare:async t=>(await Bn(t,Se.current.decofile,void 0))?.rule??null,ensureBlock:async t=>{const s=Vl(Se.current.decofile,t);return s.kind==="saved"?!0:s.kind==="conflict"?!1:(await Us.apply({writes:{[Pl(t).blockKey]:s.block}})).ok}}:null,_r=async t=>{yt();const{activePageKey:s,decofile:a,variantIndex:c}=Se.current;if(!s)return;let d=null;const v=await Bn(t,a,D=>{const A=a[s],T=A?.sections;if(!T||typeof T!="object"||Array.isArray(T))return null;const P=T;if(!Array.isArray(P.variants))return null;const se=[...P.variants],le=se[c];return le?(d=St(le.rule,a,x),se[c]={...le,rule:D},{blockKey:s,data:{...A,sections:{...P,variants:se}}}):null});if(!v)return;const{resolveType:f,formValue:_}=Jt(v.rule,v.projected,x??void 0);be(f),de(_),d&&await jt(d,v.projected),h?.()},wr=async t=>{yt();const{activePageKey:s,decofile:a,variantIndex:c}=Se.current;if(!s)return;const d=a[s],v=d?.sections;if(!v||typeof v!="object"||Array.isArray(v))return;const f=v;if(!Array.isArray(f.variants))return;const _=[...f.variants],D=_[c];if(!D)return;const A=St(D.rule,a,x),T=dn(t);_[c]={...D,rule:T};const P={...a,[s]:{...d,sections:{...f,variants:_}}},{resolveType:se,formValue:le}=Jt(T,P,x??void 0);be(se),de(le);try{await X.mutateAsync({blockKey:s,data:P[s]}),A&&A!==t&&await jt(A,P),h?.()}catch(Be){ie.error(p("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:It(p,Ft(Be))})}},jr=t=>{gt.current&&clearTimeout(gt.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=Se.current;s!==null&&(gt.current=setTimeout(()=>{const{rawSections:c,parsedSections:d,decofile:v,activePageKey:f,pageVariants:_,variantIndex:D}=Se.current;if(!f)return;const A=c[s],T=d[s];if(!A||!T?.isMultivariate)return;const P=ot(A,T);if(!P)return;const le=(P.variants??[])[a]?.rule;if(Qt(le,v,x)){const Y=le?.__resolveType??"",ce=v[Y],Me=typeof ce?.name=="string"?ce.name:Y,{__resolveType:We,...xt}=t;X.mutate({blockKey:Y,data:Ot(We??"",xt,Me)},{onSuccess:()=>h?.(),onError:X.reportError});return}const Be=Ss(P,a,t),we=[...c];we[s]=Bt(A,T,Be);const Pe=cn(v,f,we,D,_);X.mutate({blockKey:f,data:Pe},{onSuccess:()=>h?.(),onError:X.reportError})},jn))},Ii=t=>{nt(t);const s=t?ho(t,x):{__resolveType:go(x)};Xe(t?s:{}),jr(s)},Fi=t=>{const s=t;Xe(s);const a=nn?{__resolveType:nn,...s}:{...s};jr(a)},Bi=async t=>{yt();const{selectedSectionIndex:s,sectionVariantIndex:a,rawSections:c,parsedSections:d,decofile:v,activePageKey:f,pageVariants:_,variantIndex:D}=Se.current;if(s===null||!f)return;let A=null;const T=await Bn(t,v,le=>{const Be=c[s],we=d[s];if(!Be||!we?.isMultivariate)return null;const Pe=ot(Be,we);if(!Pe)return null;const Y=Pe.variants??[];A=St(Y[a]?.rule,v,x);const ce=[...c];return ce[s]=Bt(Be,we,Ss(Pe,a,le)),{blockKey:f,data:cn(v,f,ce,D,_)}});if(!T)return;const{resolveType:P,formValue:se}=Jt(T.rule,T.projected,x??void 0);nt(P),Xe(se),A&&await jt(A,T.projected),h?.()},Oi=async t=>{yt();const{selectedSectionIndex:s,sectionVariantIndex:a,rawSections:c,parsedSections:d,decofile:v,activePageKey:f,pageVariants:_,variantIndex:D}=Se.current;if(s===null||!f)return;const A=c[s],T=d[s];if(!A||!T?.isMultivariate)return;const P=ot(A,T);if(!P)return;const se=P.variants??[],le=St(se[a]?.rule,v,x),Be=dn(t),we=Ss(P,a,Be),Pe=[...c];Pe[s]=Bt(A,T,we);const Y=cn(v,f,Pe,D,_),ce={...v,[f]:Y},{resolveType:Me,formValue:We}=Jt(Be,ce,x??void 0);nt(Me),Xe(We);try{await X.mutateAsync({blockKey:f,data:Y}),le&&le!==t&&await jt(le,ce),h?.()}catch(xt){ie.error(p("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:It(p,Ft(xt))})}};if(!ne&&!_e)return o.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:p("sectionsEditor.sectionsEditor.noPageFound",{currentPath:u})});if(ne&&!Mn)return o.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:p("sectionsEditor.sectionsEditor.globalBlockNotFound")});const Oe=S!==null?Ve[S]??null:null,kr=S!==null?U[S]:null,Er=kr&&Oe?.isMultivariate?ot(kr,Oe):null,Vt=Er?Es(Er,re):[],On=Math.min(Qe,Math.max(Vt.length-1,0)),Rt=Vt[On]??null,Pt=Oe?.isMultivariate===!0,ds=S!==null&&Oe!==null,Mt=ds&&(Pt||!!(Fn&&he)),Li=Mt&&!ne&&Oe?.isSavedBlock===!0,pt=ne||Li,Rr=ne?Qs:Oe?.label??"",$i=nn&&x?qn(nn,x):null,Ar=(t,s)=>s&&q?`${t} · ${s}`:t,Cr=Oe?Oe.variantOf??Oe.label:"",zi=(()=>{const t=Pt&&Rt?Rt.label:null;return t?q?[Ar(Cr,t)]:[Oe.label,t]:[Oe?.label??""]})(),fs=Ar(_e?.name??"",vt?Fe?.label:null),Ln=Mt&&(!ne||ee.length>0)?ne?[Qs,...ee]:[fs,...zi,...ee]:[],Nr=He&&_e?[_e.name,"SEO",...$s]:[],Tr=p("sectionsEditor.pageVariantTabs.variantsLabel"),Vr=en&&_e?[_e.name,Tr]:$t&&_e&&Oe?[fs,Cr,Tr]:[],$n=Vr.length>0?Vr:Nr.length>0?Nr:pt?Ln.length>0?Ln:[Rr]:Ln.length>0?Ln:[fs],Pr=ds&&!Pt&&!Oe?.isHidden&&!!C,Hi=pt||!ne&&vt&&!!Fe||Pr,Wi=ds&&!Pt&&!ne&&ee.length===0&&!!Oe&&Oo(Oe)&&!!C,qi=q&&Mt&&!$t&&Pt&&ee.length===0&&!!Rt,Mr=q&&ee.length>0?eo(ee[ee.length-1]):null,Gi=ee.length>1?eo(ee[ee.length-2]):null,Dr=pt?Rr:Mt?Oe?.label??"":_e?.name??"",Ui=en||$t?p("sectionsEditor.pageVariantTabs.variantsLabel"):He?p("sectionsEditor.panelSections.seo"):Mr??Dr,Kr=$t?Oe?.variantOf??Oe?.label??"":en||He?_e?.name??"":Mr?Gi??Dr:pt?p("sectionsEditor.sectionsEditor.globalSectionSubtitle"):Mt?_e?.name??"":_e?.path??"",ms=!en&&!$t&&!He&&!Mt&&!pt,Yi=!q&&!He&&!ne&&Pt&&ee.length===0,wn=()=>{if(!C)return;yt(),$.current&&(clearTimeout($.current),$.current=null),Ie.current.clear();const t=g[C],s=_l(t.sections,U,x,j);if(!s)return;const{sections:a,newVariantIndex:c}=s;X.mutate({blockKey:C,data:{...t,sections:a}},{onSuccess:()=>{G(c),K(null),M(null),O(null),F([]),de(null),be(null)},onError:X.reportError})},zn=(t,s,a)=>{if(!C)return;yt(),$.current&&(clearTimeout($.current),$.current=null),Ie.current.clear();const c=g[C],d=c.sections;if(!d||typeof d!="object"||Array.isArray(d))return;const v=d;if(!Array.isArray(v.variants))return;const f=t([...v.variants]);if(!f)return;const _=Dl(v,f),D={...g,[C]:{...c,sections:_}};X.mutate({blockKey:C,data:D[C]},{onSuccess:()=>{s?.();const A=typeof a=="string"?[a]:a??[];(async()=>{for(const T of A)await jt(T,D)})()},onError:X.reportError})},Ir=(t,s)=>{if(t===s)return;let a=ve;ve===t?a=s:t<ve&&s>=ve?a=ve-1:t>ve&&s<=ve&&(a=ve+1),G(a);const c=Yn(Te.map(d=>({rule:d.rule})),t,s);os(c,a),zn(d=>Yn(d,t,s))},Fr=t=>{const s=Te[t]?.rule,a=St(s,g??{},x??void 0);zn(c=>c.length<=1?null:(c.splice(t,1),c),()=>{Te.length-1===1?G(0):t<ve?G(ve-1):t===ve&&G(Math.max(0,t-1)),K(null),M(null),O(null),F([]),de(null),be(null)},a)},Ji=()=>{const t=Te.map((s,a)=>({variant:s,index:a})).filter(({variant:s})=>!Tl(s.rule)).map(({variant:s})=>St(s.rule,g??{},x??void 0)).filter(s=>!!s);zn(s=>{const a=Fl({variants:s}),c=s[a];return c?[{...c,rule:Bl(x)}]:null},()=>{G(0),K(null),M(null),O(null),F([]),de(null),be(null),Cn(!1)},t)},Br=t=>{let s=t+1;zn(a=>(s=vo(a,t,j),Ol(a,t,j)),()=>{G(s),K(null),M(null),O(null),F([]),de(null),be(null)})},Qi=async(t,s)=>{yt(),$.current&&(clearTimeout($.current),$.current=null),Ie.current.clear();const a=Se.current.activePageKey,c=Se.current.decofile;if(!a)return;const d=c[a],v=d.sections;if(!v||typeof v!="object"||Array.isArray(v))return;const f=v;if(!Array.isArray(f.variants))return;const _=[...f.variants],D=_[t];if(!D?.rule||typeof D.rule!="object"){ie.error(p("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const A=D.rule,T=s.trim();rn(!0);try{if(!T){if(!Qt(A,c,x)){ze(null);return}const Pe=A.__resolveType??"";_[t]={...D,rule:Rs(A,c,x)};const Y={...c,[a]:{...d,sections:{...f,variants:_}}};await X.mutateAsync({blockKey:a,data:Y[a]}),await jt(Pe,Y),ze(null),h?.();return}const P=As(A,c,x);if(!P){ie.error(p("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(P.blockKey){await X.mutateAsync({blockKey:P.blockKey,data:Ot(P.resolveType,P.data,T)}),ze(null),h?.();return}const se=Gn(T),le=Un(se,c,x);if(le){ie.error(le);return}const Be=Ot(P.resolveType,P.data,T);let we=null;try{await X.mutateAsync({blockKey:se,data:Be}),we=se,_[t]={...D,rule:dn(se)},await X.mutateAsync({blockKey:a,data:{...d,sections:{...f,variants:_}}}),we=null}catch(Pe){throw we&&await Vn.mutateAsync({blockKey:we}).catch(()=>{}),Pe}ze(null),ie.success(p("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:T})),h?.()}catch(P){ie.error(p("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:It(p,Ft(P))})}finally{rn(!1)}},Xi=async(t,s)=>{yt(),$.current&&(clearTimeout($.current),$.current=null),Ie.current.clear();const{selectedSectionIndex:a,rawSections:c,parsedSections:d,decofile:v,activePageKey:f,pageVariants:_,variantIndex:D}=Se.current;if(a===null||!f)return;const A=c[a],T=d[a];if(!A||!T?.isMultivariate)return;const P=ot(A,T);if(!P)return;const se=P.variants??[],le=se[t];if(!le?.rule||typeof le.rule!="object"){ie.error(p("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const Be=le.rule,we=s.trim();rn(!0);const Pe=async Y=>{const ce={...P,variants:Y},Me=[...c];Me[a]=Bt(A,T,ce);const We=cn(v,f,Me,D,_);return await X.mutateAsync({blockKey:f,data:We}),{...v,[f]:We}};try{if(!we){if(!Qt(Be,v,x)){at(null);return}const lt=Be.__resolveType??"",bt=[...se];bt[t]={...le,rule:Rs(Be,v,x)};const Dt=await Pe(bt);await jt(lt,Dt),at(null),h?.();return}const Y=As(Be,v,x);if(!Y){ie.error(p("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(Y.blockKey){await X.mutateAsync({blockKey:Y.blockKey,data:Ot(Y.resolveType,Y.data,we)}),at(null),h?.();return}const ce=Gn(we),Me=Un(ce,v,x);if(Me){ie.error(Me);return}const We=Ot(Y.resolveType,Y.data,we);let xt=null;try{await X.mutateAsync({blockKey:ce,data:We}),xt=ce;const lt=[...se];lt[t]={...le,rule:dn(ce)},await Pe(lt),xt=null}catch(lt){throw xt&&await Vn.mutateAsync({blockKey:xt}).catch(()=>{}),lt}at(null),ie.success(p("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:we})),h?.()}catch(Y){ie.error(p("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:It(p,Ft(Y))})}finally{rn(!1)}},Or=async(t,s,a)=>{M(a);try{await X.mutateAsync({blockKey:t,data:a})}catch(c){throw M(d=>d===a?s:d),c}},Zi={rename:async(t,s,a)=>{yt(),$.current&&(clearTimeout($.current),$.current=null),Ie.current.clear();const{activePageKey:c,decofile:d}=Se.current;if(!c)return;const v=Array.isArray(t.variants)?[...t.variants]:[],f=v[s],_=f?.rule&&typeof f.rule=="object"?f.rule:void 0,D=async T=>{const P={...t,variants:T};return await Or(c,t,P),{...d,[c]:P}},A=ku(_,a,d,x);if(A.kind!=="noop"){if(A.kind==="error"){ie.error(A.reason==="no-matcher-rule"?p("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):A.reason==="unreadable-rule"?p("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):A.message??p("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}rn(!0);try{if(A.kind==="inline"){const P=[...v];P[s]={...f,rule:A.inlinedRule};const se=await D(P);await jt(A.blockKey,se),h?.();return}if(A.kind==="updateBlock"){await X.mutateAsync({blockKey:A.blockKey,data:A.blockData}),h?.();return}let T=null;try{await X.mutateAsync({blockKey:A.blockId,data:A.blockData}),T=A.blockId;const P=[...v];P[s]={...f,rule:A.reference},await D(P),T=null}catch(P){throw T&&await Vn.mutateAsync({blockKey:T}).catch(()=>{}),P}ie.success(p("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:a.trim()})),h?.()}catch(T){ie.error(p("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:It(p,Ft(T))})}finally{rn(!1)}}},selectGlobal:async(t,s,a)=>{yt(),$.current&&(clearTimeout($.current),$.current=null),Ie.current.clear();const{activePageKey:c,decofile:d}=Se.current;if(!c)return;const v=Array.isArray(t.variants)?[...t.variants]:[],f=v[s];if(!f)return;const _=St(f.rule,d,x);v[s]={...f,rule:dn(a)};const D={...t,variants:v},A={...d,[c]:D};try{await Or(c,t,D),_&&_!==a&&await jt(_,A),h?.()}catch(T){ie.error(p("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:It(p,Ft(T))})}},selectNamedRule:async(t,s,a)=>{yt(),$.current&&(clearTimeout($.current),$.current=null),Ie.current.clear();const{activePageKey:c,decofile:d}=Se.current;if(!c)return;let v=null,f=null;const _=await Bn(a,d,D=>{const A=Array.isArray(t.variants)?[...t.variants]:[],T=A[s];return T?(v=St(T.rule,d,x),A[s]={...T,rule:D},f={...t,variants:A},{blockKey:c,data:f}):null});!_||!f||(M(f),v&&await jt(v,_.projected),h?.())}},Lr=()=>{Gt()},$r=t=>{mn(t),ls({inner:t})},zr=t=>{Tn(t),ls({raw:t})},Hr=()=>{mn(null),zt([])},Wr=()=>tn(t=>t+1),qr=()=>{pn.flush(),fn(!1),mn(null),Tn(void 0),zt([]),tn(t=>t+1),N?.()},ea=()=>{Cn(!1),Nn(!1),K(null),fn(!0)},ta=()=>{He&&qr(),K(null),Cn(!0)},na=()=>Nn(!0),ps=t=>{if(en&&t===0){Cn(!1);return}if($t&&t<2){Nn(!1),t===0&&K(null);return}if(He){if(t===0){qr();return}if(t===1){zt([]),tn(a=>a+1);return}zt($s.slice(0,t-1)),tn(a=>a+1);return}if(ne){F(ee.slice(0,t)),I(a=>a+1);return}if(t===0){Lr();return}if(t===1){F([]),I(a=>a+1);return}const s=!q&&Pt&&Rt?1:0;if(s===1&&t===2){F([]),I(a=>a+1);return}F(ee.slice(0,t-1-s))},hs=$n.length>1?o.jsx("button",{type:"button",onClick:()=>ps(Wa($n.length,{isMultivariateSectionTop:Yi})),title:p("sectionsEditor.sectionsEditor.back"),"aria-label":p("sectionsEditor.sectionsEditor.back"),className:me("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",pt?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:o.jsx(Ja,{className:"size-4"})}):null,sa=pt||Mt||He?Hi&&o.jsxs("div",{className:me("border-b px-3 py-2.5",pt&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!ne&&vt&&Fe&&o.jsxs("button",{type:"button",onClick:Lr,title:p("sectionsEditor.sectionsEditor.editingInVariant",{variant:Fe.label}),className:me("shrink-0 inline-flex items-center gap-1 rounded-lg h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",Ka),children:[o.jsx(Da,{rule:bs(Fe.rule,g??{},x??void 0),matchers:an}),o.jsx("span",{className:"max-w-[160px] truncate",children:Fe.label})]}),o.jsx("div",{className:"flex-1"}),pt&&o.jsxs(At,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx("span",{className:"shrink-0 cursor-help",children:o.jsx(Qn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),o.jsx(Nt,{side:"bottom",className:"max-w-[260px]",children:p("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Pr&&o.jsx(Wn,{onClick:()=>_n()})]}),pt&&o.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:p("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):o.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[o.jsx("div",{className:"flex-1 min-w-0",children:o.jsx(to,{pageKey:C,initialName:_e.name,initialPath:_e.path,onFieldChange:dr,variant:"header"})}),o.jsxs(At,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx(Et,{type:"button",variant:"ghost",size:"icon-sm","aria-label":p("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:()=>fn(!0),children:o.jsx(co,{size:14})})}),o.jsx(Nt,{side:"bottom",children:p("sectionsEditor.sectionsEditor.editSeo")})]}),o.jsxs(At,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx(Et,{type:"button",variant:"ghost",size:"icon-sm","aria-label":p("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>z&&C?z():es(!0),children:o.jsx(uo,{size:14})})}),o.jsx(Nt,{side:"bottom",children:p("sectionsEditor.sectionsEditor.viewJson")})]}),o.jsx(Wn,{onClick:wn})]}),ra=o.jsxs(o.Fragment,{children:[vt&&C&&o.jsx(no,{listKey:C,variants:Te,activeIndex:ve,decofile:g??{},meta:x,matchers:an,onSelect:yn,onReorder:Ir,onRename:ze,onDuplicate:Br,onDelete:Fr,onAdd:wn}),vt&&ge!==null&&o.jsx(so,{className:"mt-3",children:o.jsx("div",{className:me("space-y-3",sn&&"pointer-events-none opacity-50"),children:o.jsx(vs,{currentRt:ge,currentLabel:kn(Fe?.rule,g??{},re,x??void 0),currentGlobalKey:St(Fe?.rule,g??{},x??void 0)??void 0,matchers:an,globals:cs,onSelect:xr,onSelectGlobal:wr,named:us(Fe?.rule,_r),namedRow:xs(Fe?.rule,Ut),rule:Fe?.rule,schema:vr,formValue:Ye,onChange:br,formKey:`${ve}:${ge??""}`,formWrapperClassName:"space-y-3",meta:x??void 0,decofile:g,onSaveReferencedBlock:hn,sandbox:xn})})})]}),Gr=o.jsxs(o.Fragment,{children:[o.jsx(Ia,{listKey:`${C??""}:${S??""}`,variants:Vt.map((t,s)=>({index:s,label:t.label})),selectedIndex:On,onSelect:mr,onRename:at,onDuplicate:Mi,onDelete:Pi,onRemoveAll:pr,onReorder:Di,onAdd:()=>_n()}),o.jsx(so,{children:o.jsx(vs,{currentRt:nn??"",currentLabel:kn(Rt?.rule,g??{},re,x??void 0),currentGlobalKey:St(Rt?.rule,g??{},x??void 0)??void 0,matchers:an,globals:cs,onSelect:Ii,onSelectGlobal:Oi,named:us(Rt?.rule,Bi),namedRow:xs(Rt?.rule,Ut),rule:Rt?.rule,schema:$i,formValue:ei,onChange:Fi,formKey:`${S??"none"}:${On}:${nn??""}`,formWrapperClassName:"pt-1",meta:x??void 0,decofile:g,onSaveReferencedBlock:hn,sandbox:xn})})]}),Ur=o.jsx("div",{className:me(q?"px-2":"p-2 pt-3"),children:o.jsx(Pc,{listKey:`${C??""}-${ve}`,rawSections:U,sections:Ve,meta:x,decofile:g,selectedIndex:S,onSelect:ji,onReorder:ki,onDelete:Ei,onDuplicate:Ri,onMakeReusable:ae,onToggleHidden:Ai,onToggleLazy:Ae?Ci:void 0,onAddVariant:_n,onDetach:Ni,onAddSection:()=>Zt(!0),canAddSection:gr})}),oa=o.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[C&&_e&&o.jsx(to,{pageKey:C,initialName:_e.name,initialPath:_e.path,onFieldChange:dr}),Wt&&C?o.jsx(wo,{rawSeo:Dn,innerSeo:rs,defaultResolveType:Zs,seoTypesLoading:j&&!x,seoSchema:er,activeResolveType:Kn,seoTypeOptions:Xs,formResetKey:zs,siteDefaultSeo:tr,onBreadcrumbChange:zt,onPersistRaw:zr,onInnerChange:$r,onClearForm:Hr,onBumpFormKey:Wr,asyncRenderAvailable:Ae}):o.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:p("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),ia=o.jsx(un,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:o.jsx("div",{className:"mx-auto max-w-2xl",children:Wt&&C?o.jsx(wo,{rawSeo:Dn,innerSeo:rs,defaultResolveType:Zs,seoTypesLoading:j&&!x,seoSchema:er,activeResolveType:Kn,seoTypeOptions:Xs,formResetKey:zs,siteDefaultSeo:tr,onBreadcrumbChange:zt,onPersistRaw:zr,onInnerChange:$r,onClearForm:Hr,onBumpFormKey:Wr,asyncRenderAvailable:Ae}):o.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:p("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),aa=o.jsxs(un,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[vt&&C&&o.jsx(no,{listKey:C,variants:Te,activeIndex:ve,decofile:g??{},meta:x,matchers:an,onSelect:yn,onReorder:Ir,onRename:ze,onDuplicate:Br,onDelete:Fr,onAdd:wn}),vt&&ge!==null&&o.jsxs("div",{className:me("px-3 border-b",An?"pt-3 pb-5 space-y-3":"py-2"),children:[o.jsxs("button",{type:"button",onClick:()=>Xo(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-[var(--studio-control-radius,var(--radius-sm))] py-0.5 hover:bg-accent","aria-expanded":An,children:[o.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:p("sectionsEditor.sectionsEditor.variantRule")}),An?o.jsx(Ga,{className:"size-3.5 shrink-0 text-muted-foreground"}):o.jsx(Ua,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),An&&o.jsx("div",{className:me("space-y-3",sn&&"pointer-events-none opacity-50"),children:o.jsx(vs,{currentRt:ge,currentLabel:kn(Fe?.rule,g??{},re,x??void 0),currentGlobalKey:St(Fe?.rule,g??{},x??void 0)??void 0,matchers:an,globals:cs,onSelect:xr,onSelectGlobal:wr,named:us(Fe?.rule,_r),namedRow:xs(Fe?.rule,Ut),rule:Fe?.rule,schema:vr,formValue:Ye,onChange:br,formKey:`${ve}:${ge??""}`,formWrapperClassName:"space-y-3",meta:x??void 0,decofile:g,onSaveReferencedBlock:hn,sandbox:xn})})]}),Ur]},"editor-section-list");return o.jsx(Fa,{value:j,children:o.jsx(Ba,{children:o.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!q&&hs&&o.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:hs}),(q||$n.length>1)&&o.jsx(Oa,{crumbs:$n,onSelect:ps,onSelectRoot:()=>{pn.flush(),L?L():ps(0)}}),o.jsx("div",{className:"shrink-0",children:q?o.jsxs("div",{className:me("flex items-center gap-2 border-b px-3 py-2.5",pt&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[q&&hs,pt&&o.jsxs(At,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx("span",{className:"shrink-0 cursor-help",children:o.jsx(Qn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),o.jsx(Nt,{side:"bottom",className:"max-w-[260px]",children:p("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),o.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[o.jsx("span",{className:"truncate text-sm font-semibold",children:Ui}),Kr&&o.jsx("span",{className:"truncate text-xs text-muted-foreground",children:Kr})]}),ms&&vt&&Fe&&o.jsx(ro,{variants:Te,activeIndex:ve,onSelect:yn,onManage:ta,onRemoveAll:Ji}),qi&&o.jsx(ro,{variants:Vt,activeIndex:On,onSelect:mr,onManage:na,onRemoveAll:pr}),ms&&!vt&&o.jsx(Wn,{onClick:wn}),Wi&&o.jsx(Wn,{onClick:()=>_n()}),o.jsx(La,{}),ms&&o.jsxs(o.Fragment,{children:[o.jsxs(At,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx(Et,{type:"button",variant:"outline",size:"icon-sm","aria-label":p("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:ea,children:o.jsx(co,{size:14})})}),o.jsx(Nt,{side:"bottom",children:p("sectionsEditor.sectionsEditor.editSeo")})]}),!z&&o.jsxs(At,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx(Et,{type:"button",variant:"outline",size:"icon-sm","aria-label":p("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>es(!0),children:o.jsx(uo,{size:14})})}),o.jsx(Nt,{side:"bottom",children:p("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):sa}),ft&&o.jsx(Zc,{open:!0,fields:zc(ft.plan,ft.target.schema),choices:ft.choices,changedAgain:ft.changedAgain,author:ci,fresh:ft.fresh,onChoose:(t,s)=>wi({...ft.choices,[t]:s}),onApply:_i},Cu(ft.formBase)),$t?o.jsx(oo,{onAdd:()=>_n(),children:Gr},"editor-section-variants"):Mt?o.jsxs(un,{viewportRef:De,onBlur:ir,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!q&&Pt&&Vt.length>0&&ee.length===0&&Gr,o.jsx(po,{value:Sr,children:o.jsx(io,{value:ne&&j?Ue:null,children:o.jsx(ao,{activeSchema:Fn,formValue:he,formResetKey:st,onFormChange:ur,onBreadcrumbChange:F,breadcrumbPath:ee,emptyMessage:p("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:x,decofile:g,onSaveReferencedBlock:hn,sandbox:xn,previewBaseUrl:fe,onRequestAddSection:fr,onVariantMatcherOp:ne?Zi:void 0})})})]},"editor-section-form"):ne?o.jsx(un,{viewportRef:De,onBlur:ir,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx(po,{value:Sr,children:o.jsx(io,{value:ne&&j?Ue:null,children:o.jsx(ao,{activeSchema:Fn,formValue:he,formResetKey:st,onFormChange:ur,onBreadcrumbChange:F,breadcrumbPath:ee,emptyMessage:p("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:x,decofile:g,onSaveReferencedBlock:hn,sandbox:xn,previewBaseUrl:fe,onRequestAddSection:fr})})})},"editor-global-block"):He?q?o.jsx(un,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"p-3",children:oa})},"editor-seo"):ia:en?o.jsx(oo,{onAdd:wn,children:ra},"editor-variants"):q?o.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[o.jsx(un,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"py-2",children:Ur})}),o.jsx("div",{className:"shrink-0 border-t p-2",children:o.jsx(Ts,{canAddSection:gr,onAddSection:()=>Zt(!0)})})]},"editor-section-list"):aa,o.jsx($a,{open:Je!==null,onOpenChange:t=>{t||ae(null)},defaultBlockId:Je!==null?Gn(Ve[Je]?.label??""):"",isPending:X.isPending,onSubmit:Ki}),Ce&&o.jsx(rc,{open:Qo,onOpenChange:t=>{Zt(t),t||(Rn.current=null)},meta:x,decofile:g,previewBaseUrl:fe,onSelect:Vi}),Fs&&C&&g&&o.jsx(pl,{open:Fs,onOpenChange:es,pageKey:C,decofile:g}),Ne!==null&&o.jsx(lo,{open:!0,initialName:Qt(Te[Ne]?.rule,g??{},x??void 0)?kn(Te[Ne]?.rule,g??{},re,x??void 0):"",autoLabel:re(bs(Te[Ne]?.rule,g??{},x??void 0)),isPending:sn,onSubmit:async t=>{await Qi(Ne,t)},onOpenChange:t=>{!t&&!sn&&ze(null)}}),rt!==null&&o.jsx(lo,{open:!0,initialName:Qt(Vt[rt]?.rule,g??{},x??void 0)?kn(Vt[rt]?.rule,g??{},re,x??void 0):"",autoLabel:re(bs(Vt[rt]?.rule,g??{},x??void 0)),isPending:sn,onSubmit:async t=>{await Xi(rt,t)},onOpenChange:t=>{!t&&!sn&&at(null)}})]})})})}export{Gm as SectionsEditor};
@@ -1 +0,0 @@
1
- import{c as T,b as be,j as o,r as te,av as Ne,B as we,h as _e}from"./index-ifZGovK1.js";import{a4 as he}from"./agent-icon--EtIPqub.js";import{S as ve}from"./scroll-area-9wUBmncr.js";import{F as ye,ab as Ee,i as Pe,k as Te,ac as Fe,h as Re,aE as Ce}from"./runnable-block-editor-CqYgijVY.js";import{t as Ke}from"./parse-sections-YhOUxu7l.js";import{u as ze,a as De,P as $e}from"./page-seo-form-CrgZFHtq.js";import{a as je}from"./Image01-BCnLFq1D.js";import{u as Be,m as Ie}from"./use-content-sync-D_qyLHCv.js";import"./AlertCircle-CUAx3A4b.js";import"./Tool01-BsK9c3-e.js";import"./ArrowUp-EL0FBv9C.js";import"./ArrowLeft-BWCsylYe.js";import"./LinkBroken01-DcsqjBuj.js";import"./ShoppingBag01-aJuRSlBz.js";import"./ZoomOut-DytgoG2i.js";import"./Building02-PifDTlhb.js";import"./CheckCircle-CMGqXocs.js";import"./ChevronUp-x46FJEcD.js";import"./ChevronSelectorVertical-BSRBjpBn.js";import"./UserSquare-BBEl_BxL.js";import"./Copy01-OBSYmimV.js";import"./CreditCard01-DWsSThAm.js";import"./DotsVertical-jkvtcdek.js";import"./Globe04-blkS_Kfg.js";import"./SwitchHorizontal01-B5WFt7_0.js";import"./Key01-CG7Kua6O.js";import"./Link01-8aKNfNRw.js";import"./Minus-B38cW2ZC.js";import"./Monitor01-DQEkUL3d.js";import"./Sun-k4hypx5Q.js";import"./Play-Ns9aRVTY.js";import"./Plus-vkM1FxVr.js";import"./SearchMd-Cp6J-1Iu.js";import"./Trash01-Z1ezoy3S.js";import"./Upload01-B3-nlnKa.js";import"./User01-C2Sw39bs.js";import"./Users01-DMFeioyM.js";import"./XClose-BdwIxxCT.js";import"./index-BdQq_4o_.js";import"./utils-CduIoZ0d.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-Ck7rgrik.js";import"./format-time-Cq80KKvY.js";import"./differenceInSeconds-C3x8sHUj.js";import"./collapsible-CnlVGt-G.js";import"./use-copy-Cn8Org7G.js";import"./usage-stats-BecGIkLk.js";import"./tool-namespace-DIE_8J9o.js";import"./form-D4PspedZ.js";import"./label-Dhoh3DcI.js";import"./utils-CVEq3hMx.js";import"./markdown-prFeEkT4.js";import"./location-V0VwTJTt.js";import"./use-mobile-CKoO3XSk.js";import"./use-panel-navigate-Bghh8kV3.js";import"./thread-route-C7RSGMhP.js";import"./use-project-scope-DH5nL_oD.js";import"./repository-binding-DtIeSvDY.js";import"./use-mcp-client-D1kFCZ4v.js";import"./auth-C_nDagDA.js";import"./tooltip-gMeEuHtO.js";import"./index-DNa7Epd0.js";import"./use-decopilot-events-Cp8NaBPU.js";import"./thread-intent-7GmQH5mt.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-BoG6Bqps.js";import"./task-board-BrTYr-oE.js";import"./schema-Cn4x5iT-.js";import"./slugify-CEUa2lfQ.js";import"./chat-context-DXm8btNS.js";import"./autosend-xoWUmECR.js";import"./use-ai-providers-CAt_9H4n.js";import"./use-organization-settings-laAOR3Cm.js";import"./use-clock-tick-DflKMAWl.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-fHjuxWIZ.js";import"./types-CHFSNT7a.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./shell-layout-U7D4A6nk.js";import"./avatar-DHKJiyOX.js";import"./command-BlBQgQPI.js";import"./index-BCHFFeZZ.js";import"./integration-icon-D1aQLe0v.js";import"./project-icon-ZadU5ZjL.js";import"./new-project-dialog-DFsG79bb.js";import"./repository-import-picker-C2sQ94O1.js";import"./use-navigate-to-agent-DLX1nkvn.js";import"./repository-picker-BXaWFfDW.js";import"./useInfiniteQuery-wCORGPw3.js";import"./infiniteQueryObserver-DvmMaiCa.js";import"./collection-search--9d0M5sc.js";import"./use-debounced-value-c5JdkW89.js";import"./required-auth-layout-4jyUcmCy.js";import"./use-org-sso-B_zXOLDA.js";import"./sheet-Dhe0uPV2.js";import"./use-connection-CBKH8IwL.js";import"./use-mcp-prompts-wKDmQlGB.js";import"./use-thread-outputs-CoFWg3_v.js";import"./file-type-icon-DHFVwXjA.js";import"./switch-ByCU93P4.js";import"./textarea-Bbbnnl4r.js";import"./popover-DaReiQzV.js";import"./blocks-tab-states-Chq5j0oT.js";import"./slider-CLUaEqdg.js";import"./index-Bxkd37dZ.js";import"./tooltipContext-BQS7kWxi.js";import"./CategoricalChart-QwBn7EzX.js";import"./index-gqp4B5qj.js";import"./ActiveShapeUtils-CHmxGMIj.js";import"./Sector-BeXkYaJv.js";import"./symbol-BQLM2_V8.js";import"./input-DIcILgWd.js";import"./icon-button-HZwQKD3a.js";import"./chat-draft-WGnppXw7.js";import"./select-DUEGSJco.js";import"./tabs-C7f3nqQx.js";import"./active-indicator-CCMhAsc_.js";import"./use-deco-credits-D8w-JIDW.js";import"./toggle-group-CXUKmPFr.js";import"./use-open-billing-url-C5lEsbaH.js";import"./index-B32YFtAw.js";import"./checkbox-vFQy8MvV.js";import"./ai-providers-logos-DD3qZ33J.js";import"./drawer-0sYDH2mt.js";import"./input-BeDIlaby.js";import"./suggestion-BNEVVm5c.js";import"./use-org-fs-49a1bhbu.js";import"./question-004-sINsf4GQ.js";import"./use-members-0ZBHc0S5.js";import"./use-org-auth-client-t4l-TKT1.js";import"./feature-paywall-hsFyGLR_.js";import"./plan-ladder-BKLU8eo8.js";import"./add-connection-dialog-F6QQAEZv.js";import"./extract-connection-data-CBAyhzk-.js";import"./metadata-D72DunRR.js";import"./connection-Bo3v2rj5.js";import"./url-slug-D37s8EDd.js";import"./connection-card-DMfcnulT.js";import"./connection-slug-CITJ0kGN.js";import"./schema-Dvc5tPTN.js";import"./connection-form-helpers-A3QfJozi.js";import"./authenticate-and-persist-oauth-CpcQdSQ-.js";import"./mcp-oauth-CNKUkWMd.js";import"./mcp-oauth-CTJ5Iw4i.js";import"./collection-tabs-BfpnVdlQ.js";import"./badge-ux-RK1YK.js";import"./use-infinite-scroll-Cuyf7850.js";import"./useSuspenseInfiniteQuery-JvpRoEFG.js";import"./use-task-board-events-BARWSwfj.js";import"./use-chat-layout-state-24wCHq_-.js";import"./empty-state-D6RWdvUz.js";import"./monaco-editor-Wx_2qGOP.js";import"./editor-BctLuJLS.js";import"./calendar-qN6CeKGa.js";import"./editor-classes-BnPaf--r.js";import"./core.esm-DJ5llHMe.js";import"./sortable.esm-CkqHW6-y.js";import"./combobox-BMxhMbUn.js";import"./alert-dialog-C-DaggA1.js";import"./search-input-1DLvCYgl.js";import"./use-file-configs-DW0hmZjE.js";import"./asset-utils-Cb8p2lKk.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./sandbox-git-api-CH_-QFpD.js";import"./sandbox-url-D3mC8qhT.js";import"./alert-BDbwlXZm.js";import"./index-j4NUsiRT.js";import"./experiments-tab-choice-CMHPX5ZC.js";function M(d){return typeof d=="string"&&d.trim()?d:void 0}function ge(d,e){if(d){if(e)try{const t=new URL(d,e).href;return ye(t)}catch{return}return ye(d)}}function Le(d){if(!d)return{};const e=M(d.title),t=M(d.titleTemplate);return{title:e&&t?.includes("%s")?t.replace(/%s/g,e):e,description:M(d.description),image:M(d.image),favicon:M(d.favicon)}}function Oe(d){if(!d)return"example.com";try{return new URL(d).host}catch{return"example.com"}}const Ue=[{id:"google",labelKey:"sectionsEditor.seoPreview.platformGoogle",color:"#4285F4",layout:"search"},{id:"facebook",labelKey:"sectionsEditor.seoPreview.platformFacebook",color:"#1877F2",layout:"card"},{id:"twitter",labelKey:"sectionsEditor.seoPreview.platformTwitter",color:"#0f1419",layout:"card"},{id:"linkedin",labelKey:"sectionsEditor.seoPreview.platformLinkedin",color:"#0A66C2",layout:"card"},{id:"whatsapp",labelKey:"sectionsEditor.seoPreview.platformWhatsapp",color:"#25D366",layout:"chat"},{id:"telegram",labelKey:"sectionsEditor.seoPreview.platformTelegram",color:"#229ED9",layout:"chat"},{id:"slack",labelKey:"sectionsEditor.seoPreview.platformSlack",color:"#611f69",layout:"attachment"},{id:"discord",labelKey:"sectionsEditor.seoPreview.platformDiscord",color:"#5865F2",layout:"attachment"}];function ue(d){const e=T.c(10),{src:t,className:a,iconSize:y}=d,l=y===void 0?20:y;if(t){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={objectFit:"cover"},e[0]=m):m=e[0];let p;return e[1]!==a||e[2]!==t?(p=o.jsx("img",{src:t,alt:"",referrerPolicy:"no-referrer",className:a,style:m}),e[1]=a,e[2]=t,e[3]=p):p=e[3],p}let s;e[4]===Symbol.for("react.memo_cache_sentinel")?(s={display:"flex",alignItems:"center",justifyContent:"center",background:"#e5e7eb",color:"#9ca3af"},e[4]=s):s=e[4];let i;e[5]!==l?(i=o.jsx(je,{size:l}),e[5]=l,e[6]=i):i=e[6];let n;return e[7]!==a||e[8]!==i?(n=o.jsx("div",{className:a,style:s,children:i}),e[7]=a,e[8]=i,e[9]=n):n=e[9],n}function Ae(d){const e=T.c(33),{seo:t,host:a,path:y,t:l}=d;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={background:"#fff",border:"1px solid #dadce0"},e[0]=s):s=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={background:"#f1f3f4"},e[1]=i):i=e[1];let n;e[2]!==t.favicon?(n=o.jsx("div",{className:"flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-full",style:i,children:t.favicon?o.jsx("img",{src:t.favicon,alt:"",className:"size-full object-cover"}):o.jsx(je,{size:12,color:"#9aa0a6"})}),e[2]=t.favicon,e[3]=n):n=e[3];let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m={color:"#202124"},e[4]=m):m=e[4];let p;e[5]!==a?(p=o.jsx("div",{className:"truncate text-[13px] leading-tight",style:m,children:a}),e[5]=a,e[6]=p):p=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f={color:"#4d5156"},e[7]=f):f=e[7];let r;e[8]!==a||e[9]!==y?(r=o.jsxs("div",{className:"truncate text-[12px] leading-tight",style:f,children:[a,y]}),e[8]=a,e[9]=y,e[10]=r):r=e[10];let c;e[11]!==p||e[12]!==r?(c=o.jsxs("div",{className:"min-w-0",children:[p,r]}),e[11]=p,e[12]=r,e[13]=c):c=e[13];let x;e[14]!==n||e[15]!==c?(x=o.jsxs("div",{className:"flex items-center gap-2",children:[n,c]}),e[14]=n,e[15]=c,e[16]=x):x=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u={color:"#1a0dab"},e[17]=u):u=e[17];let h;e[18]!==t.title||e[19]!==l?(h=t.title??l("sectionsEditor.seoPreview.fallbackTitle"),e[18]=t.title,e[19]=l,e[20]=h):h=e[20];let v;e[21]!==h?(v=o.jsx("div",{className:"mt-1.5 truncate text-[18px] leading-snug",style:u,children:h}),e[21]=h,e[22]=v):v=e[22];let b;e[23]===Symbol.for("react.memo_cache_sentinel")?(b={color:"#4d5156"},e[23]=b):b=e[23];let S;e[24]!==t.description||e[25]!==l?(S=t.description??l("sectionsEditor.seoPreview.fallbackDescription"),e[24]=t.description,e[25]=l,e[26]=S):S=e[26];let j;e[27]!==S?(j=o.jsx("div",{className:"mt-0.5 line-clamp-2 text-[13px] leading-snug",style:b,children:S}),e[27]=S,e[28]=j):j=e[28];let k;return e[29]!==v||e[30]!==j||e[31]!==x?(k=o.jsxs("div",{className:"rounded-lg p-3 text-left",style:s,children:[x,v,j]}),e[29]=v,e[30]=j,e[31]=x,e[32]=k):k=e[32],k}function Me(d){const e=T.c(26),{seo:t,host:a,t:y}=d;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={background:"#fff",border:"1px solid #e2e8f0"},e[0]=l):l=e[0];let s;e[1]!==t.image?(s=o.jsx(ue,{src:t.image,className:"h-40 w-full"}),e[1]=t.image,e[2]=s):s=e[2];let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i={borderTop:"1px solid #e2e8f0"},e[3]=i):i=e[3];let n;e[4]===Symbol.for("react.memo_cache_sentinel")?(n={color:"#8a9099"},e[4]=n):n=e[4];let m;e[5]!==a?(m=o.jsx("div",{className:"truncate text-[11px]",style:n,children:a}),e[5]=a,e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#1c2024"},e[7]=p):p=e[7];let f;e[8]!==t.title||e[9]!==y?(f=t.title??y("sectionsEditor.seoPreview.fallbackTitle"),e[8]=t.title,e[9]=y,e[10]=f):f=e[10];let r;e[11]!==f?(r=o.jsx("div",{className:"line-clamp-1 text-[14px] font-semibold",style:p,children:f}),e[11]=f,e[12]=r):r=e[12];let c;e[13]===Symbol.for("react.memo_cache_sentinel")?(c={color:"#60666c"},e[13]=c):c=e[13];let x;e[14]!==t.description||e[15]!==y?(x=t.description??y("sectionsEditor.seoPreview.fallbackDescription"),e[14]=t.description,e[15]=y,e[16]=x):x=e[16];let u;e[17]!==x?(u=o.jsx("div",{className:"line-clamp-2 text-[12px]",style:c,children:x}),e[17]=x,e[18]=u):u=e[18];let h;e[19]!==u||e[20]!==m||e[21]!==r?(h=o.jsxs("div",{className:"px-3 py-2",style:i,children:[m,r,u]}),e[19]=u,e[20]=m,e[21]=r,e[22]=h):h=e[22];let v;return e[23]!==h||e[24]!==s?(v=o.jsxs("div",{className:"overflow-hidden rounded-lg text-left",style:l,children:[s,h]}),e[23]=h,e[24]=s,e[25]=v):v=e[25],v}function Ge(d){const e=T.c(36),{seo:t,host:a,accent:y,t:l}=d;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={background:"#f0f2f5"},e[0]=s):s=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={color:"#3b4045"},e[1]=i):i=e[1];let n;e[2]!==l?(n=l("sectionsEditor.seoPreview.chatCardHint"),e[2]=l,e[3]=n):n=e[3];let m;e[4]!==n?(m=o.jsx("p",{className:"px-1 pb-1.5 text-[12px]",style:i,children:n}),e[4]=n,e[5]=m):m=e[5];const p=`3px solid ${y}`;let f;e[6]!==p?(f={background:"#fff",borderLeft:p},e[6]=p,e[7]=f):f=e[7];let r;e[8]!==t.image?(r=o.jsx(ue,{src:t.image,className:"h-28 w-full",iconSize:18}),e[8]=t.image,e[9]=r):r=e[9];let c;e[10]===Symbol.for("react.memo_cache_sentinel")?(c={color:"#1c2024"},e[10]=c):c=e[10];let x;e[11]!==t.title||e[12]!==l?(x=t.title??l("sectionsEditor.seoPreview.fallbackTitle"),e[11]=t.title,e[12]=l,e[13]=x):x=e[13];let u;e[14]!==x?(u=o.jsx("div",{className:"line-clamp-1 text-[12px] font-semibold",style:c,children:x}),e[14]=x,e[15]=u):u=e[15];let h;e[16]===Symbol.for("react.memo_cache_sentinel")?(h={color:"#60666c"},e[16]=h):h=e[16];let v;e[17]!==t.description||e[18]!==l?(v=t.description??l("sectionsEditor.seoPreview.fallbackDescription"),e[17]=t.description,e[18]=l,e[19]=v):v=e[19];let b;e[20]!==v?(b=o.jsx("div",{className:"line-clamp-2 text-[11px]",style:h,children:v}),e[20]=v,e[21]=b):b=e[21];let S;e[22]===Symbol.for("react.memo_cache_sentinel")?(S={color:"#8a9099"},e[22]=S):S=e[22];let j;e[23]!==a?(j=o.jsx("div",{className:"mt-0.5 text-[10px]",style:S,children:a}),e[23]=a,e[24]=j):j=e[24];let k;e[25]!==u||e[26]!==b||e[27]!==j?(k=o.jsxs("div",{className:"px-2.5 py-1.5",children:[u,b,j]}),e[25]=u,e[26]=b,e[27]=j,e[28]=k):k=e[28];let g;e[29]!==k||e[30]!==f||e[31]!==r?(g=o.jsxs("div",{className:"overflow-hidden rounded-[var(--studio-surface-radius,var(--radius-md))]",style:f,children:[r,k]}),e[29]=k,e[30]=f,e[31]=r,e[32]=g):g=e[32];let N;return e[33]!==g||e[34]!==m?(N=o.jsxs("div",{className:"rounded-lg p-2 text-left",style:s,children:[m,g]}),e[33]=g,e[34]=m,e[35]=N):N=e[35],N}function He(d){const e=T.c(39),{seo:t,host:a,accent:y,dark:l,t:s}=d,i=l?"#2b2d31":"#fff",n=l?"#00a8fc":"#1264a3",m=l?"#dbdee1":"#3b4045",p=l?"#949ba4":"#8a9099",f=l?"none":"1px solid #e2e8f0";let r;e[0]!==i||e[1]!==f?(r={background:i,border:f},e[0]=i,e[1]=f,e[2]=r):r=e[2];const c=`3px solid ${y}`;let x;e[3]!==c?(x={borderLeft:c,borderRadius:2},e[3]=c,e[4]=x):x=e[4];let u;e[5]!==p?(u={color:p},e[5]=p,e[6]=u):u=e[6];let h;e[7]!==a||e[8]!==u?(h=o.jsx("div",{className:"text-[10px]",style:u,children:a}),e[7]=a,e[8]=u,e[9]=h):h=e[9];let v;e[10]!==n?(v={color:n},e[10]=n,e[11]=v):v=e[11];let b;e[12]!==t.title||e[13]!==s?(b=t.title??s("sectionsEditor.seoPreview.fallbackTitle"),e[12]=t.title,e[13]=s,e[14]=b):b=e[14];let S;e[15]!==v||e[16]!==b?(S=o.jsx("div",{className:"line-clamp-1 text-[13px] font-semibold",style:v,children:b}),e[15]=v,e[16]=b,e[17]=S):S=e[17];let j;e[18]!==m?(j={color:m},e[18]=m,e[19]=j):j=e[19];let k;e[20]!==t.description||e[21]!==s?(k=t.description??s("sectionsEditor.seoPreview.fallbackDescription"),e[20]=t.description,e[21]=s,e[22]=k):k=e[22];let g;e[23]!==j||e[24]!==k?(g=o.jsx("div",{className:"line-clamp-2 text-[12px]",style:j,children:k}),e[23]=j,e[24]=k,e[25]=g):g=e[25];let N;e[26]!==g||e[27]!==h||e[28]!==S?(N=o.jsxs("div",{className:"min-w-0 flex-1",children:[h,S,g]}),e[26]=g,e[27]=h,e[28]=S,e[29]=N):N=e[29];let w;e[30]!==t.image?(w=o.jsx(ue,{src:t.image,className:"size-14 shrink-0 rounded-[var(--studio-control-radius,var(--radius))]",iconSize:16}),e[30]=t.image,e[31]=w):w=e[31];let _;e[32]!==N||e[33]!==w||e[34]!==x?(_=o.jsxs("div",{className:"flex gap-2.5 pl-2.5",style:x,children:[N,w]}),e[32]=N,e[33]=w,e[34]=x,e[35]=_):_=e[35];let E;return e[36]!==_||e[37]!==r?(E=o.jsx("div",{className:"rounded-lg p-2.5 text-left",style:r,children:_}),e[36]=_,e[37]=r,e[38]=E):E=e[38],E}function Ve(d){const e=T.c(21),{platform:t,seo:a,host:y,path:l,t:s}=d;let i;e[0]!==y||e[1]!==l||e[2]!==t.color||e[3]!==t.id||e[4]!==t.layout||e[5]!==a||e[6]!==s?(i=t.layout==="search"?o.jsx(Ae,{seo:a,host:y,path:l,t:s}):t.layout==="card"?o.jsx(Me,{seo:a,host:y,path:l,t:s}):t.layout==="chat"?o.jsx(Ge,{seo:a,host:y,path:l,accent:t.color,t:s}):o.jsx(He,{seo:a,host:y,path:l,accent:t.color,dark:t.id==="discord",t:s}),e[0]=y,e[1]=l,e[2]=t.color,e[3]=t.id,e[4]=t.layout,e[5]=a,e[6]=s,e[7]=i):i=e[7];const n=i;let m;e[8]!==t.color?(m=o.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{background:t.color}}),e[8]=t.color,e[9]=m):m=e[9];let p;e[10]!==t.labelKey||e[11]!==s?(p=s(t.labelKey),e[10]=t.labelKey,e[11]=s,e[12]=p):p=e[12];let f;e[13]!==p?(f=o.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:p}),e[13]=p,e[14]=f):f=e[14];let r;e[15]!==m||e[16]!==f?(r=o.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5",children:[m,f]}),e[15]=m,e[16]=f,e[17]=r):r=e[17];let c;return e[18]!==n||e[19]!==r?(c=o.jsxs("div",{children:[r,n]}),e[18]=n,e[19]=r,e[20]=c):c=e[20],c}function We(d){const e=T.c(18),{seo:t,url:a,path:y}=d,l=y===void 0?"/":y,s=be();let i,n,m;if(e[0]!==t||e[1]!==a){const v=Le(t);i=v,n=ge(v.image,a),m=ge(v.favicon,a),e[0]=t,e[1]=a,e[2]=i,e[3]=n,e[4]=m}else i=e[2],n=e[3],m=e[4];let p;e[5]!==i||e[6]!==n||e[7]!==m?(p={...i,image:n,favicon:m},e[5]=i,e[6]=n,e[7]=m,e[8]=p):p=e[8];const f=p;let r;e[9]!==a?(r=Oe(a),e[9]=a,e[10]=r):r=e[10];const c=r,x=l==="/"?"":l;let u;e[11]!==x||e[12]!==c||e[13]!==s||e[14]!==f?(u=Ue.map(v=>o.jsx(Ve,{platform:v,seo:f,host:c,path:x,t:s},v.id)),e[11]=x,e[12]=c,e[13]=s,e[14]=f,e[15]=u):u=e[15];let h;return e[16]!==u?(h=o.jsx("div",{className:"grid grid-cols-1 gap-4 @2xl:grid-cols-2",children:u}),e[16]=u,e[17]=h):h=e[17],h}function ls(d){const e=T.c(73),{orgSlug:t,virtualMcpId:a,branch:y,decofile:l,meta:s,target:i,previewBaseUrl:n,onSaved:m,onEditDefaultSeo:p,onBack:f}=d,r=be(),c=Ee(l,i,s),x=Be(a,y);let u;e[0]!==x?(u=Ie(x),e[0]=x,e[1]=u):u=e[1];const h=!u,v=c?.seoData,b=i.kind==="site"?"site":i.pageKey,[S,j]=te.useState(b),[k,g]=te.useState(null),[N,w]=te.useState(0),[_,E]=te.useState(void 0);S!==b&&(j(b),g(null),E(void 0),w(Je));const{persistSeo:K,persistRawSeo:oe,flush:ie,isPending:se}=ze({orgSlug:t,virtualMcpId:a,branch:y,target:i,resolved:c,meta:s,onSaved:m}),G=i.kind==="page",Se=G?c?.rawSeoData:void 0,A=_!==void 0?_:Se,ke=G?Pe(A)??void 0:void 0,P=k??ke??v??{},F=c?De(P,c):null,z=F&&(!G||Te(A))?Ke(F,s):null;let H;e[2]!==s?(H=Fe(s),e[2]=s,e[3]=H):H=e[3];const re=H;let R,V;e[4]!==l||e[5]!==P||e[6]!==s||e[7]!==i.kind?(R=i.kind==="page"?Re(l,s)?.seoData??{}:{},V=i.kind==="page"?Xe(R,P):P,e[4]=l,e[5]=P,e[6]=s,e[7]=i.kind,e[8]=R,e[9]=V):(R=e[8],V=e[9]);const le=V;let W;e[10]!==K||e[11]!==c||e[12]!==g?(W=C=>{if(!c)return;const xe=C;g(xe),K(xe)},e[10]=K,e[11]=c,e[12]=g,e[13]=W):W=e[13];const ae=W;let q;e[14]!==g?(q=()=>g(null),e[14]=g,e[15]=q):q=e[15];const ce=q;let J;e[16]!==w?(J=()=>w(qe),e[16]=w,e[17]=J):J=e[17];const ne=J;let Q;e[18]!==ie||e[19]!==f?(Q=()=>{ie(),f?.()},e[18]=ie,e[19]=f,e[20]=Q):Q=e[20];const me=Q,D=i.kind==="page"?i.path:"/";let X;e[21]!==D||e[22]!==n||e[23]!==i.kind?(X=i.kind==="page"&&n?Qe(D,n):n??null,e[21]=D,e[22]=n,e[23]=i.kind,e[24]=X):X=e[24];const de=X;let Y;e[25]!==c||e[26]!==r||e[27]!==i.kind?(Y=i.kind==="site"?r("sectionsEditor.seoEditor.noSiteSeoBlock"):r(c?"sectionsEditor.seoEditor.noSeoSchema":"sectionsEditor.seoEditor.couldNotLoadSeo"),e[25]=c,e[26]=r,e[27]=i.kind,e[28]=Y):Y=e[28];const pe=Y,Z=G&&c,fe=i.kind==="site"&&c&&z;let $;e[29]!==me||e[30]!==r||e[31]!==i.kind||e[32]!==i.pageName?($=i.kind==="page"?o.jsxs("nav",{className:"flex min-w-0 items-center gap-1 text-sm",children:[o.jsx("button",{type:"button",onClick:me,title:i.pageName,className:"min-w-0 truncate rounded-[var(--studio-control-radius,var(--radius-md))] px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:i.pageName}),o.jsx(Ne,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("span",{className:"px-1 py-0.5 font-medium text-foreground",children:"SEO"})]}):o.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[o.jsx(he,{size:16,className:"shrink-0 text-muted-foreground"}),o.jsx("span",{className:"text-sm font-medium",children:r("sectionsEditor.seoEditor.defaultSeoLabel")}),o.jsxs("span",{className:"hidden truncate text-xs text-muted-foreground sm:inline",children:["· ",r("sectionsEditor.seoEditor.appliedToEveryPage")]})]}),e[29]=me,e[30]=r,e[31]=i.kind,e[32]=i.pageName,e[33]=$):$=e[33];let B;e[34]!==se?(B=se&&o.jsx(_e,{className:"size-3.5 text-muted-foreground"}),e[34]=se,e[35]=B):B=e[35];let I;e[36]!==p||e[37]!==r||e[38]!==i.kind?(I=i.kind==="page"&&p&&o.jsxs(we,{type:"button",variant:"outline",size:"sm",onClick:p,children:[o.jsx(he,{size:14}),r("sectionsEditor.seoEditor.editDefaultSeoButton")]}),e[36]=p,e[37]=r,e[38]=i.kind,e[39]=I):I=e[39];let L;e[40]!==B||e[41]!==I?(L=o.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[B,I]}),e[40]=B,e[41]=I,e[42]=L):L=e[42];let O;e[43]!==$||e[44]!==L?(O=o.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[$,L]}),e[43]=$,e[44]=L,e[45]=O):O=e[45];let U;e[46]!==F||e[47]!==h||e[48]!==ne||e[49]!==ce||e[50]!==re||e[51]!==A||e[52]!==P||e[53]!==pe||e[54]!==N||e[55]!==ae||e[56]!==D||e[57]!==oe||e[58]!==K||e[59]!==le||e[60]!==de||e[61]!==c||e[62]!==z||e[63]!==g||e[64]!==E||e[65]!==Z||e[66]!==fe||e[67]!==R||e[68]!==r?(U=!c||!Z&&!fe?o.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center text-sm text-muted-foreground",children:pe}):o.jsxs("div",{className:"flex min-h-0 flex-1",children:[o.jsx(ve,{className:"w-full max-w-md shrink-0 border-r [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-5 py-4",children:Z?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:r("sectionsEditor.seoEditor.emptyFieldsHint")}),o.jsx($e,{rawSeo:A,innerSeo:P,defaultResolveType:re,seoSchema:z,activeResolveType:F,seoTypeOptions:c.seoTypeOptions,formResetKey:N,siteDefaultSeo:R,onPersistRaw:C=>{E(C),oe(C)},onInnerChange:C=>{g(C),K(C)},onClearForm:ce,onBumpFormKey:ne,asyncRenderAvailable:h})]}):z&&F&&o.jsx(Ce,{schema:z,resolveType:F,value:P,formResetKey:N,onChange:ae})})}),o.jsx(ve,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"@container px-5 py-4",children:o.jsx(We,{seo:le,url:de,path:D})})})]}),e[46]=F,e[47]=h,e[48]=ne,e[49]=ce,e[50]=re,e[51]=A,e[52]=P,e[53]=pe,e[54]=N,e[55]=ae,e[56]=D,e[57]=oe,e[58]=K,e[59]=le,e[60]=de,e[61]=c,e[62]=z,e[63]=g,e[64]=E,e[65]=Z,e[66]=fe,e[67]=R,e[68]=r,e[69]=U):U=e[69];let ee;return e[70]!==O||e[71]!==U?(ee=o.jsxs("div",{className:"flex h-full w-full flex-col",children:[O,U]}),e[70]=O,e[71]=U,e[72]=ee):ee=e[72],ee}function qe(d){return d+1}function Je(d){return d+1}function Qe(d,e){try{return new URL(d,e).href}catch{return e}}function Xe(d,e){const t=e.__resolveType,a=d.__resolveType;if(typeof t=="string"&&typeof a=="string"&&t!==a)return{...e};const y={...d};for(const[l,s]of Object.entries(e))l!=="__resolveType"&&s!=null&&(typeof s=="string"&&s.trim()===""||(y[l]=s));return y}export{ls as SeoEditor};
@@ -1 +0,0 @@
1
- import{c as e,j as o}from"./index-ifZGovK1.js";import{V as a}from"./index-XzZeDzj0.js";function p(s){const t=e.c(2),{virtualMcpId:r}=s;let i;return t[0]!==r?(i=o.jsx(a,{virtualMcpId:r}),t[0]=r,t[1]=i):i=t[1],i}export{p as S};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/agent-site-editor-BML41A1E.js","assets/index-ifZGovK1.js","assets/index-EoMx4WDO.css","assets/chat-context-DXm8btNS.js","assets/use-panel-navigate-Bghh8kV3.js","assets/thread-route-C7RSGMhP.js","assets/use-project-scope-DH5nL_oD.js","assets/repository-binding-DtIeSvDY.js","assets/use-mcp-client-D1kFCZ4v.js","assets/auth-C_nDagDA.js","assets/autosend-xoWUmECR.js","assets/thread-intent-7GmQH5mt.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/watch-sse-pool-BoG6Bqps.js","assets/task-board-BrTYr-oE.js","assets/schema-Cn4x5iT-.js","assets/slugify-CEUa2lfQ.js","assets/use-decopilot-events-Cp8NaBPU.js","assets/use-ai-providers-CAt_9H4n.js","assets/location-V0VwTJTt.js","assets/use-organization-settings-laAOR3Cm.js","assets/site-draft-actions-Dpnw67Ug.js","assets/separator-Bk_a4cod.js","assets/use-content-sync-D_qyLHCv.js","assets/sandbox-url-D3mC8qhT.js","assets/index-j4NUsiRT.js","assets/ArrowUp-EL0FBv9C.js","assets/tool-namespace-DIE_8J9o.js","assets/tooltip-gMeEuHtO.js","assets/index-DNa7Epd0.js","assets/drawer-0sYDH2mt.js","assets/collection-search--9d0M5sc.js","assets/SearchMd-Cp6J-1Iu.js","assets/use-mobile-CKoO3XSk.js","assets/use-mcp-prompts-wKDmQlGB.js","assets/usage-stats-BecGIkLk.js","assets/form-D4PspedZ.js","assets/label-Dhoh3DcI.js","assets/utils-CVEq3hMx.js","assets/markdown-prFeEkT4.js","assets/use-copy-Cn8Org7G.js","assets/Copy01-OBSYmimV.js","assets/ZoomOut-DytgoG2i.js","assets/agent-icon--EtIPqub.js","assets/AlertCircle-CUAx3A4b.js","assets/Tool01-BsK9c3-e.js","assets/ArrowLeft-BWCsylYe.js","assets/LinkBroken01-DcsqjBuj.js","assets/ShoppingBag01-aJuRSlBz.js","assets/Building02-PifDTlhb.js","assets/CheckCircle-CMGqXocs.js","assets/ChevronUp-x46FJEcD.js","assets/ChevronSelectorVertical-BSRBjpBn.js","assets/UserSquare-BBEl_BxL.js","assets/CreditCard01-DWsSThAm.js","assets/DotsVertical-jkvtcdek.js","assets/Image01-BCnLFq1D.js","assets/Globe04-blkS_Kfg.js","assets/SwitchHorizontal01-B5WFt7_0.js","assets/Key01-CG7Kua6O.js","assets/Link01-8aKNfNRw.js","assets/Minus-B38cW2ZC.js","assets/Monitor01-DQEkUL3d.js","assets/Sun-k4hypx5Q.js","assets/Play-Ns9aRVTY.js","assets/Plus-vkM1FxVr.js","assets/Trash01-Z1ezoy3S.js","assets/Upload01-B3-nlnKa.js","assets/User01-C2Sw39bs.js","assets/Users01-DMFeioyM.js","assets/XClose-BdwIxxCT.js","assets/format-time-Cq80KKvY.js","assets/differenceInSeconds-C3x8sHUj.js","assets/input-DIcILgWd.js","assets/icon-button-HZwQKD3a.js","assets/file-type-icon-DHFVwXjA.js","assets/shell-layout-U7D4A6nk.js","assets/avatar-DHKJiyOX.js","assets/use-clock-tick-DflKMAWl.js","assets/command-BlBQgQPI.js","assets/index-BCHFFeZZ.js","assets/integration-icon-D1aQLe0v.js","assets/project-icon-ZadU5ZjL.js","assets/new-project-dialog-DFsG79bb.js","assets/repository-import-picker-C2sQ94O1.js","assets/use-navigate-to-agent-DLX1nkvn.js","assets/repository-picker-BXaWFfDW.js","assets/useInfiniteQuery-wCORGPw3.js","assets/infiniteQueryObserver-DvmMaiCa.js","assets/use-debounced-value-c5JdkW89.js","assets/required-auth-layout-4jyUcmCy.js","assets/use-org-sso-B_zXOLDA.js","assets/shell-layout-CE2Eihra.css","assets/chat-draft-WGnppXw7.js","assets/select-DUEGSJco.js","assets/index-BdQq_4o_.js","assets/tabs-C7f3nqQx.js","assets/active-indicator-CCMhAsc_.js","assets/use-deco-credits-D8w-JIDW.js","assets/toggle-group-CXUKmPFr.js","assets/use-open-billing-url-C5lEsbaH.js","assets/index-B32YFtAw.js","assets/checkbox-vFQy8MvV.js","assets/ai-providers-logos-DD3qZ33J.js","assets/popover-DaReiQzV.js","assets/input-BeDIlaby.js","assets/suggestion-BNEVVm5c.js","assets/use-org-fs-49a1bhbu.js","assets/question-004-sINsf4GQ.js","assets/use-members-0ZBHc0S5.js","assets/use-org-auth-client-t4l-TKT1.js","assets/feature-paywall-hsFyGLR_.js","assets/plan-ladder-BKLU8eo8.js","assets/add-connection-dialog-F6QQAEZv.js","assets/extract-connection-data-CBAyhzk-.js","assets/metadata-D72DunRR.js","assets/connection-Bo3v2rj5.js","assets/url-slug-D37s8EDd.js","assets/connection-card-DMfcnulT.js","assets/connection-slug-CITJ0kGN.js","assets/textarea-Bbbnnl4r.js","assets/use-connection-CBKH8IwL.js","assets/schema-Dvc5tPTN.js","assets/connection-form-helpers-A3QfJozi.js","assets/authenticate-and-persist-oauth-CpcQdSQ-.js","assets/mcp-oauth-CNKUkWMd.js","assets/mcp-oauth-CTJ5Iw4i.js","assets/collection-tabs-BfpnVdlQ.js","assets/badge-ux-RK1YK.js","assets/use-infinite-scroll-Cuyf7850.js","assets/useSuspenseInfiniteQuery-JvpRoEFG.js","assets/use-task-board-events-BARWSwfj.js","assets/use-chat-layout-state-24wCHq_-.js","assets/input-Bwd_JSM8.css","assets/pair-Ck7rgrik.js","assets/collapsible-CnlVGt-G.js","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-fHjuxWIZ.js","assets/types-CHFSNT7a.js","assets/omit-sandbox-map-jj4lCB2U.js","assets/sheet-Dhe0uPV2.js","assets/use-thread-outputs-CoFWg3_v.js","assets/experiments-tab-choice-CMHPX5ZC.js","assets/utils-CduIoZ0d.js","assets/sandbox-git-api-CH_-QFpD.js","assets/toolbar-icon-button-DzJeqLa2.js","assets/alert-dialog-C-DaggA1.js","assets/use-releases-G0pirYfu.js","assets/serial-task-queue-CGOeQgpr.js","assets/virtual-mcp-Xd6PvE5_.js","assets/use-fast-preview-draft-url-CSz1rYUo.js","assets/section-preview-url-7zfngvgW.js","assets/parse-sections-YhOUxu7l.js","assets/alert-BDbwlXZm.js","assets/named-rule-uses-Mu_Msc9v.js","assets/device-hint-SeLRi17j.js","assets/editor-BctLuJLS.js","assets/hosted-publish-api-CK3ZnEoi.js","assets/hosted-publish-feedback-BG4t8HgW.js","assets/save-changes-debug-nBi-n9eV.js","assets/sandbox-lifecycle-context-DdMgF1Lv.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/index-BjrJaWD9.js","assets/use-sidebar-collapsed-CuPY8XXm.js","assets/resizable-CQyxQjcn.js","assets/agent-site-editor-DDGTF8rc.css","assets/agent-site-editor-content-Bt6vrV5b.js","assets/agent-view-guard-BuPewEB-.js","assets/use-main-panel-tabs-CVsgtXg7.js","assets/use-mcp-tools-I-kpM305.js","assets/resolve-tab-icon-56O81FJc.js","assets/use-task-metadata-Dd-9Qkoq.js","assets/preview-source-BsRLGWUP.js","assets/use-project-native-view-presence-C3Vtd78t.js","assets/match-site-slug-config-D3fUJ6vX.js","assets/use-file-configs-DW0hmZjE.js","assets/site-slug-DebpOoQq.js","assets/feature-gate-DQ0ZaDj1.js","assets/content-tab-CaoAhPSw.js","assets/blocks-tab-states-Chq5j0oT.js","assets/slider-CLUaEqdg.js","assets/index-Bxkd37dZ.js","assets/tooltipContext-BQS7kWxi.js","assets/CategoricalChart-QwBn7EzX.js","assets/index-gqp4B5qj.js","assets/ActiveShapeUtils-CHmxGMIj.js","assets/Sector-BeXkYaJv.js","assets/symbol-BQLM2_V8.js","assets/empty-state-D6RWdvUz.js","assets/runnable-block-editor-CqYgijVY.js","assets/switch-ByCU93P4.js","assets/scroll-area-9wUBmncr.js","assets/monaco-editor-Wx_2qGOP.js","assets/calendar-qN6CeKGa.js","assets/editor-classes-BnPaf--r.js","assets/core.esm-DJ5llHMe.js","assets/sortable.esm-CkqHW6-y.js","assets/combobox-BMxhMbUn.js","assets/search-input-1DLvCYgl.js","assets/asset-utils-Cb8p2lKk.js","assets/mustache-BzHjgnm5.js","assets/date-utils-CrvIKg-s.js","assets/use-move-blocks-Dm4etxGk.js","assets/empty-state-DeArX05X.js"])))=>i.map(i=>d[i]);
2
- import{k as O,l as V,m as H}from"./named-rule-view-CN2yeHp5.js";import{h as N}from"./named-rule-uses-Mu_Msc9v.js";import{aY as A,b9 as L}from"./parse-sections-YhOUxu7l.js";import{aX as y,c as _,b as T,a2 as U,j as c,n as F}from"./index-ifZGovK1.js";import{E as B}from"./empty-state-DeArX05X.js";import{u as K}from"./chat-context-DXm8btNS.js";import{u as M,l as $}from"./use-content-sync-D_qyLHCv.js";import{i as q,u as Q,S as G}from"./blocks-tab-states-Chq5j0oT.js";import{a as X}from"./use-panel-navigate-Bghh8kV3.js";const P={running:0,everyone:1,off:2};function ae(s,e){const i=A(s,"experiments");if(i.kind==="conflict")return[];const o=e?.published??null;return Object.entries(i.values).map(([n,l],a)=>{const m=O(o,"experiments",n,l),x=m==="changed"?V(o,"experiments",n):void 0;return{order:a,row:{name:n,share:l,status:L(l),uses:e?N(e,"experiments",n):0,entryState:m,...x!==void 0?{publishedShare:x}:{}}}}).sort((n,l)=>P[n.row.status]-P[l.row.status]||n.order-l.order).map(n=>n.row)}function ce(s,e){return H(s,e?.published??null,"experiments")}function de(s){const e={contentPageVariant:s.focus?.pageVariant,contentSection:s.focus?.section,contentVariant:s.focus?.variant};return s.blockKind==="page"?{contentPageId:s.blockKey,contentCollection:void 0,contentItem:void 0,...e}:{contentPageId:void 0,contentCollection:"sections",contentItem:s.blockKey,...e}}let I=null;function Y(){return I??=Promise.all([y(()=>import("./agent-site-editor-BML41A1E.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166])),y(()=>import("./agent-site-editor-content-Bt6vrV5b.js"),__vite__mapDeps([167,1,2,168,169,133,5,4,6,7,8,9,11,12,13,14,15,16,17,44,45,46,27,47,48,49,43,50,51,52,53,54,42,55,56,57,58,59,60,61,62,63,64,65,66,33,67,68,69,70,71,122,170,139,39,143,26,3,10,18,19,20,21,25,28,29,30,31,32,34,35,36,37,38,40,41,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,123,124,125,126,127,128,129,130,131,132,134,135,136,137,138,140,141,142,171,172,173,174,175,176,177,150,178,179,180,181,182,183,184,185,186,187,188,153,154,24,144,145,189,190,162,191,192,193,157,194,195,196,197,198,147,199,200,201,161,202,203,204]))]).catch(s=>{throw I=null,s}),I}function z(s){return e=>{if(!e)return;const i=()=>{s().catch(()=>{})};if(typeof requestIdleCallback=="function"){const t=requestIdleCallback(i,{timeout:2e3});return()=>cancelIdleCallback(t)}const o=setTimeout(i,200);return()=>clearTimeout(o)}}const J=z(Y);function R(s){const e=_.c(7),{icon:i,title:o,description:t,action:n}=s;let l;e[0]!==n?(l=n?{children:n.label,onClick:n.onClick}:void 0,e[0]=n,e[1]=l):l=e[1];let a;return e[2]!==t||e[3]!==i||e[4]!==l||e[5]!==o?(a=c.jsx(F,{children:c.jsx(F.Content,{children:c.jsx(F.Container,{children:c.jsx(B,{icon:i,title:o,description:t,buttonProps:l})})})}),e[2]=t,e[3]=i,e[4]=l,e[5]=o,e[6]=a):a=e[6],a}function ue(s){const e=_.c(28),{virtualMcpId:i,icon:o,copy:t,skeleton:n,children:l}=s,a=T(),{org:m}=U(),x=K(),p=x?.currentBranch??null,g=M(i,p),{openPanel:k}=X();if(!p){const r=t.noDraftTitle,v=t.noDraftDesc;let d;e[0]!==a?(d=a("sectionsEditor.namedRules.openEditor"),e[0]=a,e[1]=d):d=e[1];let u;e[2]!==k?(u=()=>k("content"),e[2]=k,e[3]=u):u=e[3];let f;e[4]!==d||e[5]!==u?(f={label:d,onClick:u},e[4]=d,e[5]=u,e[6]=f):f=e[6];let b;return e[7]!==t.noDraftDesc||e[8]!==t.noDraftTitle||e[9]!==o||e[10]!==f?(b=c.jsx(R,{icon:o,title:r,description:v,action:f}),e[7]=t.noDraftDesc,e[8]=t.noDraftTitle,e[9]=o,e[10]=f,e[11]=b):b=e[11],b}if(q(g)){let r;return e[12]===Symbol.for("react.memo_cache_sentinel")?(r=c.jsx(G,{}),e[12]=r):r=e[12],r}if(g.kind==="pending"){let r;return e[13]!==n?(r=c.jsx(c.Fragment,{children:n}),e[13]=n,e[14]=r):r=e[14],r}if(g.kind!=="protocol"){let r;return e[15]!==t.loadFailed||e[16]!==t.loadFailedHint||e[17]!==o?(r=c.jsx(R,{icon:o,title:t.loadFailed,description:t.loadFailedHint}),e[15]=t.loadFailed,e[16]=t.loadFailedHint,e[17]=o,e[18]=r):r=e[18],r}const S=x?.taskId??null;let h;return e[19]!==p||e[20]!==l||e[21]!==t||e[22]!==o||e[23]!==m.slug||e[24]!==n||e[25]!==S||e[26]!==i?(h=c.jsx(W,{orgSlug:m.slug,virtualMcpId:i,branch:p,threadId:S,icon:o,copy:t,skeleton:n,children:l},p),e[19]=p,e[20]=l,e[21]=t,e[22]=o,e[23]=m.slug,e[24]=n,e[25]=S,e[26]=i,e[27]=h):h=e[27],h}function W(s){const e=_.c(30),{orgSlug:i,virtualMcpId:o,branch:t,threadId:n,icon:l,copy:a,skeleton:m,children:x}=s,p=T();let g;e[0]!==t||e[1]!==i||e[2]!==n||e[3]!==o?(g={orgSlug:i,virtualMcpId:o,branch:t,threadId:n,previewUrl:null},e[0]=t,e[1]=i,e[2]=n,e[3]=o,e[4]=g):g=e[4];const k=g,S=$(k),h=Q(k),r=S.data,v=h.data;if(!r||!v){if(S.isError||h.isError){const b=a.loadFailed,w=a.loadFailedHint;let E;e[5]!==p?(E=p("sectionsEditor.namedRules.tryAgain"),e[5]=p,e[6]=E):E=e[6];let C;e[7]!==S||e[8]!==h?(C=()=>{S.refetch(),h.refetch()},e[7]=S,e[8]=h,e[9]=C):C=e[9];let D;e[10]!==E||e[11]!==C?(D={label:E,onClick:C},e[10]=E,e[11]=C,e[12]=D):D=e[12];let j;return e[13]!==a.loadFailed||e[14]!==a.loadFailedHint||e[15]!==l||e[16]!==D?(j=c.jsx(R,{icon:l,title:b,description:w,action:D}),e[13]=a.loadFailed,e[14]=a.loadFailedHint,e[15]=l,e[16]=D,e[17]=j):j=e[17],j}let f;return e[18]!==m?(f=c.jsx(c.Fragment,{children:m}),e[18]=m,e[19]=f):f=e[19],f}let d;e[20]!==t||e[21]!==x||e[22]!==r||e[23]!==v||e[24]!==i||e[25]!==n||e[26]!==o?(d=x({orgSlug:i,virtualMcpId:o,branch:t,threadId:n,decofile:r,meta:v}),e[20]=t,e[21]=x,e[22]=r,e[23]=v,e[24]=i,e[25]=n,e[26]=o,e[27]=d):d=e[27];let u;return e[28]!==d?(u=c.jsx("div",{className:"contents",ref:J,children:d}),e[28]=d,e[29]=u):u=e[29],u}export{ue as S,R as a,de as c,ae as e,ce as r};
@@ -1 +0,0 @@
1
- import{c as u,r as g,j as n,F,Z as G,_ as H,a as E,k as P,b as O,n as y,L as M}from"./index-ifZGovK1.js";import{C as V}from"./chat-context-DXm8btNS.js";import{C as x}from"./index-BjrJaWD9.js";import{L}from"./index-DgfcOEet.js";import{B as K}from"./blocks-preview-workspace-context-CCLLqfhM.js";import{e as T,p as W,s as J,a as U,r as z,T as $,u as R,b as Z}from"./use-content-sync-D_qyLHCv.js";import{u as q,L as B,P as Q,S as X}from"./preview-tab-CzS9kIxI.js";import{C as Y}from"./content-tab-CaoAhPSw.js";import{T as tt}from"./tab-icon-glyph-Cz_BoFAU.js";import{r as et}from"./resolve-tab-icon-56O81FJc.js";import ot from"./agent-site-editor-BML41A1E.js";import"./use-panel-navigate-Bghh8kV3.js";import"./thread-route-C7RSGMhP.js";import"./use-project-scope-DH5nL_oD.js";import"./repository-binding-DtIeSvDY.js";import"./use-mcp-client-D1kFCZ4v.js";import"./auth-C_nDagDA.js";import"./autosend-xoWUmECR.js";import"./thread-intent-7GmQH5mt.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-BoG6Bqps.js";import"./task-board-BrTYr-oE.js";import"./schema-Cn4x5iT-.js";import"./slugify-CEUa2lfQ.js";import"./use-decopilot-events-Cp8NaBPU.js";import"./use-ai-providers-CAt_9H4n.js";import"./location-V0VwTJTt.js";import"./use-organization-settings-laAOR3Cm.js";import"./use-mobile-CKoO3XSk.js";import"./use-sidebar-collapsed-CuPY8XXm.js";import"./use-chat-layout-state-24wCHq_-.js";import"./agent-icon--EtIPqub.js";import"./AlertCircle-CUAx3A4b.js";import"./Tool01-BsK9c3-e.js";import"./ArrowUp-EL0FBv9C.js";import"./ArrowLeft-BWCsylYe.js";import"./LinkBroken01-DcsqjBuj.js";import"./ShoppingBag01-aJuRSlBz.js";import"./ZoomOut-DytgoG2i.js";import"./Building02-PifDTlhb.js";import"./CheckCircle-CMGqXocs.js";import"./ChevronUp-x46FJEcD.js";import"./ChevronSelectorVertical-BSRBjpBn.js";import"./UserSquare-BBEl_BxL.js";import"./Copy01-OBSYmimV.js";import"./CreditCard01-DWsSThAm.js";import"./DotsVertical-jkvtcdek.js";import"./Image01-BCnLFq1D.js";import"./Globe04-blkS_Kfg.js";import"./SwitchHorizontal01-B5WFt7_0.js";import"./Key01-CG7Kua6O.js";import"./Link01-8aKNfNRw.js";import"./Minus-B38cW2ZC.js";import"./Monitor01-DQEkUL3d.js";import"./Sun-k4hypx5Q.js";import"./Play-Ns9aRVTY.js";import"./Plus-vkM1FxVr.js";import"./SearchMd-Cp6J-1Iu.js";import"./Trash01-Z1ezoy3S.js";import"./Upload01-B3-nlnKa.js";import"./User01-C2Sw39bs.js";import"./Users01-DMFeioyM.js";import"./XClose-BdwIxxCT.js";import"./tooltip-gMeEuHtO.js";import"./index-DNa7Epd0.js";import"./toolbar-icon-button-DzJeqLa2.js";import"./shell-layout-U7D4A6nk.js";import"./avatar-DHKJiyOX.js";import"./use-clock-tick-DflKMAWl.js";import"./command-BlBQgQPI.js";import"./index-BCHFFeZZ.js";import"./integration-icon-D1aQLe0v.js";import"./project-icon-ZadU5ZjL.js";import"./new-project-dialog-DFsG79bb.js";import"./label-Dhoh3DcI.js";import"./repository-import-picker-C2sQ94O1.js";import"./use-navigate-to-agent-DLX1nkvn.js";import"./repository-picker-BXaWFfDW.js";import"./useInfiniteQuery-wCORGPw3.js";import"./infiniteQueryObserver-DvmMaiCa.js";import"./collection-search--9d0M5sc.js";import"./use-debounced-value-c5JdkW89.js";import"./required-auth-layout-4jyUcmCy.js";import"./use-org-sso-B_zXOLDA.js";import"./sheet-Dhe0uPV2.js";import"./resizable-CQyxQjcn.js";import"./core.esm-DJ5llHMe.js";import"./sortable.esm-CkqHW6-y.js";import"./context-menu-BD833dh0.js";import"./create-organization-dialog-nhhaUNZK.js";import"./alert-dialog-C-DaggA1.js";import"./form-D4PspedZ.js";import"./project-apps-CG2eY1ZZ.js";import"./use-recent-apps-D6yVH6-8.js";import"./sandbox-url-D3mC8qhT.js";import"./index-j4NUsiRT.js";import"./tool-namespace-DIE_8J9o.js";import"./drawer-0sYDH2mt.js";import"./use-mcp-prompts-wKDmQlGB.js";import"./usage-stats-BecGIkLk.js";import"./utils-CVEq3hMx.js";import"./markdown-prFeEkT4.js";import"./use-copy-Cn8Org7G.js";import"./format-time-Cq80KKvY.js";import"./differenceInSeconds-C3x8sHUj.js";import"./input-DIcILgWd.js";import"./icon-button-HZwQKD3a.js";import"./file-type-icon-DHFVwXjA.js";import"./chat-draft-WGnppXw7.js";import"./select-DUEGSJco.js";import"./index-BdQq_4o_.js";import"./tabs-C7f3nqQx.js";import"./active-indicator-CCMhAsc_.js";import"./use-deco-credits-D8w-JIDW.js";import"./toggle-group-CXUKmPFr.js";import"./use-open-billing-url-C5lEsbaH.js";import"./index-B32YFtAw.js";import"./checkbox-vFQy8MvV.js";import"./ai-providers-logos-DD3qZ33J.js";import"./popover-DaReiQzV.js";import"./input-BeDIlaby.js";import"./suggestion-BNEVVm5c.js";import"./use-org-fs-49a1bhbu.js";import"./question-004-sINsf4GQ.js";import"./use-members-0ZBHc0S5.js";import"./use-org-auth-client-t4l-TKT1.js";import"./feature-paywall-hsFyGLR_.js";import"./plan-ladder-BKLU8eo8.js";import"./add-connection-dialog-F6QQAEZv.js";import"./extract-connection-data-CBAyhzk-.js";import"./metadata-D72DunRR.js";import"./connection-Bo3v2rj5.js";import"./url-slug-D37s8EDd.js";import"./connection-card-DMfcnulT.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-Bbbnnl4r.js";import"./use-connection-CBKH8IwL.js";import"./schema-Dvc5tPTN.js";import"./connection-form-helpers-A3QfJozi.js";import"./authenticate-and-persist-oauth-CpcQdSQ-.js";import"./mcp-oauth-CNKUkWMd.js";import"./mcp-oauth-CTJ5Iw4i.js";import"./collection-tabs-BfpnVdlQ.js";import"./badge-ux-RK1YK.js";import"./use-infinite-scroll-Cuyf7850.js";import"./useSuspenseInfiniteQuery-JvpRoEFG.js";import"./use-task-board-events-BARWSwfj.js";import"./pair-Ck7rgrik.js";import"./collapsible-CnlVGt-G.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-fHjuxWIZ.js";import"./types-CHFSNT7a.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./use-thread-outputs-CoFWg3_v.js";import"./experiments-tab-choice-CMHPX5ZC.js";import"./utils-CduIoZ0d.js";import"./sandbox-git-api-CH_-QFpD.js";import"./runnable-block-editor-CqYgijVY.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./parse-sections-YhOUxu7l.js";import"./alert-BDbwlXZm.js";import"./switch-ByCU93P4.js";import"./blocks-tab-states-Chq5j0oT.js";import"./slider-CLUaEqdg.js";import"./index-Bxkd37dZ.js";import"./tooltipContext-BQS7kWxi.js";import"./CategoricalChart-QwBn7EzX.js";import"./index-gqp4B5qj.js";import"./ActiveShapeUtils-CHmxGMIj.js";import"./Sector-BeXkYaJv.js";import"./symbol-BQLM2_V8.js";import"./empty-state-D6RWdvUz.js";import"./scroll-area-9wUBmncr.js";import"./monaco-editor-Wx_2qGOP.js";import"./editor-BctLuJLS.js";import"./calendar-qN6CeKGa.js";import"./editor-classes-BnPaf--r.js";import"./combobox-BMxhMbUn.js";import"./search-input-1DLvCYgl.js";import"./use-file-configs-DW0hmZjE.js";import"./asset-utils-Cb8p2lKk.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./sandbox-lifecycle-context-DdMgF1Lv.js";import"./variant-draft-pointer-HWAlFj6Z.js";import"./section-preview-url-7zfngvgW.js";import"./use-fast-preview-draft-url-CSz1rYUo.js";import"./useQueries-_Urb_S-y.js";import"./device-hint-SeLRi17j.js";import"./releases-api-q3AffL1J.js";import"./hosted-publish-api-CK3ZnEoi.js";import"./virtual-mcp-Xd6PvE5_.js";import"./preview-source-BsRLGWUP.js";import"./use-task-metadata-Dd-9Qkoq.js";import"./mustache-BzHjgnm5.js";import"./date-utils-CrvIKg-s.js";import"./use-move-blocks-Dm4etxGk.js";import"./empty-state-DeArX05X.js";import"./site-draft-actions-Dpnw67Ug.js";import"./separator-Bk_a4cod.js";import"./use-releases-G0pirYfu.js";import"./serial-task-queue-CGOeQgpr.js";import"./named-rule-uses-Mu_Msc9v.js";import"./hosted-publish-feedback-BG4t8HgW.js";import"./save-changes-debug-nBi-n9eV.js";function I(e){return e.kind==="unavailable"&&e.source==="local"&&(e.problem?.reason??"not-answering")==="not-answering"}const it=e=>e;function rt(e){const t=u.c(10),{candidates:o,invalidLink:c,shell:m,editor:i}=e,r=c===void 0?!1:c,s=m===void 0?it:m,[p,l]=g.useState(null);if(p){let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>l(null),t[0]=f):f=t[0];let h;return t[1]!==p||t[2]!==i?(h=i(p,f),t[1]=p,t[2]=i,t[3]=h):h=t[3],h}let a;t[4]!==o||t[5]!==r?(a=n.jsx(nt,{candidates:o,invalidLink:r,onConnect:l}),t[4]=o,t[5]=r,t[6]=a):a=t[6];let d;return t[7]!==s||t[8]!==a?(d=s(a),t[7]=s,t[8]=a,t[9]=d):d=t[9],d}function nt(e){const t=u.c(17),{candidates:o,invalidLink:c,onConnect:m}=e,i=c===void 0?!1:c,[r]=F(),{language:s}=r;let p;t[0]!==m?(p=D=>m({endpoint:D}),t[0]=m,t[1]=p):p=t[1];let l;t[2]!==o||t[3]!==p?(l={candidates:o,onFound:p},t[2]=o,t[3]=p,t[4]=l):l=t[4];const a=q(l),{state:d,access:f,needsGesture:h}=a;let k;t[5]!==o||t[6]!==s?(k=new Intl.ListFormat(s,{style:"long",type:"conjunction"}).format(o.map(T)),t[5]=o,t[6]=s,t[7]=k):k=t[7];const C=k;let j;t[8]!==f||t[9]!==a.start||t[10]!==h||t[11]!==d?(j=f==="denied"?{kind:"denied"}:h?{kind:"needs-gesture",onStart:a.start}:d.problem?{kind:"problem",problem:d.problem,host:T(d.problem.endpoint)}:{kind:"looking",paused:d.status==="paused"},t[8]=f,t[9]=a.start,t[10]=h,t[11]=d,t[12]=j):j=t[12];const _=j;let S;return t[13]!==C||t[14]!==i||t[15]!==_?(S=n.jsx(B,{wait:_,hosts:C,invalidLink:i}),t[13]=C,t[14]=i,t[15]=_,t[16]=S):S=t[16],S}const v="deco-serve",w="working-tree",st={id:"",slug:"",name:"",logo:null},mt={id:v,slug:v},pt={virtualMcpId:v,taskId:null,openTask:()=>{},createTask:()=>"",createTaskWithMessage:()=>{},activeTask:null,isThreadLocked:!1,lockedHarness:null,lockedBranch:null,currentBranch:w,setCurrentTaskBranch:()=>{}};function at(){const e=window.location.hash,t=new URLSearchParams(e.replace(/^#/,"")).has("endpoint"),o=t?W(e):null;return t&&window.history.replaceState(null,"",window.location.pathname+window.location.search),o&&J(o),{candidates:U(o,z()),invalidLink:t&&!o}}const ct=[{id:"site-editor",to:"/site-editor",label:"preview"},{id:"content",to:"/site-editor/content",label:"content"}];function lt(){const e=u.c(6),t=O();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={select:dt},e[0]=o):o=e[0];const c=P(o);let m;e[1]!==t||e[2]!==c?(m=ct.map(r=>n.jsx(y.Tab,{asChild:!0,active:c==="content"==(r.id==="content"),children:n.jsxs(M,{to:r.to,activeOptions:{exact:!0},children:[n.jsx("span",{"aria-hidden":"true",className:"flex size-4 shrink-0 items-center justify-center",children:n.jsx(tt,{icon:et({tabId:r.id,kind:"system",connections:[]})})}),t(`common.mainPanelTabs.${r.label}`)]})},r.id)),e[1]=t,e[2]=c,e[3]=m):m=e[3];let i;return e[4]!==m?(i=n.jsx(y.Tabs,{children:m}),e[4]=m,e[5]=i):i=e[5],i}function dt(e){return e.matches.at(-1)?.staticData.siteEditorView}function N(e){const t=u.c(14),{children:o}=e,c=O(),{connection:m}=Z(v),i=R(v,w);let r,s;if(t[0]!==i||t[1]!==o||t[2]!==m||t[3]!==c){s=Symbol.for("react.early_return_sentinel");t:{if(r=m?T(m.endpoint):"",i.kind==="protocol"){s=o;break t}if(i.kind!=="unavailable"||I(i)){s=n.jsx(X,{headingLevel:2,waiting:!0,title:c("decoServe.connect.reaching",{host:r})});break t}}t[0]=i,t[1]=o,t[2]=m,t[3]=c,t[4]=r,t[5]=s}else r=t[4],s=t[5];if(s!==Symbol.for("react.early_return_sentinel"))return s;let p;t[6]!==i.problem?(p=i.problem??{reason:"not-answering"},t[6]=i.problem,t[7]=p):p=t[7];let l;t[8]!==r||t[9]!==p?(l={kind:"problem",problem:p,host:r},t[8]=r,t[9]=p,t[10]=l):l=t[10];let a;return t[11]!==r||t[12]!==l?(a=n.jsx(B,{wait:l,hosts:r}),t[11]=r,t[12]=l,t[13]=a):a=t[13],a}function ut(e){const t=u.c(6),{onLost:o}=e,c=R(v,w);let m;t[0]!==c?(m=I(c),t[0]=c,t[1]=m):m=t[1];const i=m;let r,s;return t[2]!==i||t[3]!==o?(r=()=>{i&&o()},s=[i,o],t[2]=i,t[3]=o,t[4]=r,t[5]=s):(r=t[4],s=t[5]),g.useEffect(r,s),null}const A={threadOpen:!1,contentOpen:!0,threadVisibilityExplicit:!1,toggleThread:()=>{},toggleContent:()=>{}};function ft(){const e=u.c(11),{data:t}=E.useSession();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={select:ht},e[0]=o):o=e[0];const c=P(o),m=!!t?.user;let i;e[1]!==m?(i={rail:m},e[1]=m,e[2]=i):i=e[2];const r=c??"preview";let s,p,l;e[3]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(lt,{}),p=n.jsx(x.Thread,{children:null}),l=n.jsx(ot,{}),e[3]=s,e[4]=p,e[5]=l):(s=e[3],p=e[4],l=e[5]);let a;e[6]!==r?(a=n.jsx(L.Content,{children:n.jsxs(x,{...A,threadless:!0,contentKey:r,contentNavigation:s,children:[p,l]})}),e[6]=r,e[7]=a):a=e[7];let d;return e[8]!==i||e[9]!==a?(d=n.jsx(L,{outsideOrg:i,children:a}),e[8]=i,e[9]=a,e[10]=d):d=e[10],d}function ht(e){return e.matches.at(-1)?.staticData.siteEditorView}function vt(e){const t=u.c(8),{children:o}=e,{data:c}=E.useSession(),m=!!c?.user;let i;t[0]!==m?(i={rail:m},t[0]=m,t[1]=i):i=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(x.Thread,{children:null}),t[2]=r):r=t[2];let s;t[3]!==o?(s=n.jsx(L.Content,{children:n.jsxs(x,{...A,threadless:!0,contentKey:"guide",children:[r,n.jsx(x.Content,{children:o})]})}),t[3]=o,t[4]=s):s=t[4];let p;return t[5]!==i||t[6]!==s?(p=n.jsx(L,{outsideOrg:i,children:s}),t[5]=i,t[6]=s,t[7]=p):p=t[7],p}const b=()=>{},xt={connection:null,set:b,clear:b};function cr(){const e=u.c(3),[t]=g.useState(at);let o;return e[0]!==t.candidates||e[1]!==t.invalidLink?(o=n.jsx(G,{value:!0,children:n.jsx(H,{org:st,project:mt,children:n.jsx(rt,{candidates:t.candidates,invalidLink:t.invalidLink,shell:jt,editor:kt})})}),e[0]=t.candidates,e[1]=t.invalidLink,e[2]=o):o=e[2],o}function kt(e,t){return n.jsxs($.Provider,{value:{connection:e,set:b,clear:b},children:[n.jsx(ut,{onLost:t}),n.jsx(V,{value:pt,children:n.jsx(K,{children:n.jsx(ft,{})})})]})}function jt(e){return n.jsx($.Provider,{value:xt,children:n.jsx(vt,{children:e})})}function lr(){const e=u.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(N,{children:n.jsx(Q,{virtualMcpId:v})}),e[0]=t):t=e[0],t}function dr(){const e=u.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(N,{children:n.jsx(Y,{virtualMcpId:v})}),e[0]=t):t=e[0],t}export{dr as SiteEditorContent,lr as SiteEditorPreview,cr as default};
@@ -1 +0,0 @@
1
- import{c as l,a2 as n,j as r,K as f}from"./index-ifZGovK1.js";import{C as d}from"./index-BjrJaWD9.js";import{m as u,P as x,T as h}from"./mock-board-BWfjyR2S.js";import{F as j}from"./feature-gate-DQ0ZaDj1.js";import"./use-mobile-CKoO3XSk.js";import"./use-sidebar-collapsed-CuPY8XXm.js";import"./use-chat-layout-state-24wCHq_-.js";import"./thread-route-C7RSGMhP.js";import"./use-panel-navigate-Bghh8kV3.js";import"./use-project-scope-DH5nL_oD.js";import"./repository-binding-DtIeSvDY.js";import"./use-mcp-client-D1kFCZ4v.js";import"./auth-C_nDagDA.js";import"./thread-intent-7GmQH5mt.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-BoG6Bqps.js";import"./task-board-BrTYr-oE.js";import"./schema-Cn4x5iT-.js";import"./slugify-CEUa2lfQ.js";import"./agent-icon--EtIPqub.js";import"./AlertCircle-CUAx3A4b.js";import"./Tool01-BsK9c3-e.js";import"./ArrowUp-EL0FBv9C.js";import"./ArrowLeft-BWCsylYe.js";import"./LinkBroken01-DcsqjBuj.js";import"./ShoppingBag01-aJuRSlBz.js";import"./ZoomOut-DytgoG2i.js";import"./Building02-PifDTlhb.js";import"./CheckCircle-CMGqXocs.js";import"./ChevronUp-x46FJEcD.js";import"./ChevronSelectorVertical-BSRBjpBn.js";import"./UserSquare-BBEl_BxL.js";import"./Copy01-OBSYmimV.js";import"./CreditCard01-DWsSThAm.js";import"./DotsVertical-jkvtcdek.js";import"./Image01-BCnLFq1D.js";import"./Globe04-blkS_Kfg.js";import"./SwitchHorizontal01-B5WFt7_0.js";import"./Key01-CG7Kua6O.js";import"./Link01-8aKNfNRw.js";import"./Minus-B38cW2ZC.js";import"./Monitor01-DQEkUL3d.js";import"./Sun-k4hypx5Q.js";import"./Play-Ns9aRVTY.js";import"./Plus-vkM1FxVr.js";import"./SearchMd-Cp6J-1Iu.js";import"./Trash01-Z1ezoy3S.js";import"./Upload01-B3-nlnKa.js";import"./User01-C2Sw39bs.js";import"./Users01-DMFeioyM.js";import"./XClose-BdwIxxCT.js";import"./tooltip-gMeEuHtO.js";import"./index-DNa7Epd0.js";import"./toolbar-icon-button-DzJeqLa2.js";import"./shell-layout-U7D4A6nk.js";import"./avatar-DHKJiyOX.js";import"./use-clock-tick-DflKMAWl.js";import"./command-BlBQgQPI.js";import"./index-BCHFFeZZ.js";import"./integration-icon-D1aQLe0v.js";import"./project-icon-ZadU5ZjL.js";import"./new-project-dialog-DFsG79bb.js";import"./label-Dhoh3DcI.js";import"./repository-import-picker-C2sQ94O1.js";import"./use-navigate-to-agent-DLX1nkvn.js";import"./repository-picker-BXaWFfDW.js";import"./useInfiniteQuery-wCORGPw3.js";import"./infiniteQueryObserver-DvmMaiCa.js";import"./collection-search--9d0M5sc.js";import"./use-debounced-value-c5JdkW89.js";import"./use-organization-settings-laAOR3Cm.js";import"./required-auth-layout-4jyUcmCy.js";import"./autosend-xoWUmECR.js";import"./use-org-sso-B_zXOLDA.js";import"./sheet-Dhe0uPV2.js";import"./resizable-CQyxQjcn.js";import"./core.esm-DJ5llHMe.js";import"./sortable.esm-CkqHW6-y.js";import"./use-task-board-analytics-BtNGPBbp.js";import"./combobox-BMxhMbUn.js";import"./popover-DaReiQzV.js";import"./usage-stats-BecGIkLk.js";import"./tool-namespace-DIE_8J9o.js";import"./form-D4PspedZ.js";import"./utils-CVEq3hMx.js";import"./markdown-prFeEkT4.js";import"./use-copy-Cn8Org7G.js";import"./location-V0VwTJTt.js";import"./format-time-Cq80KKvY.js";import"./differenceInSeconds-C3x8sHUj.js";import"./use-decopilot-events-Cp8NaBPU.js";import"./chat-context-DXm8btNS.js";import"./use-ai-providers-CAt_9H4n.js";import"./suggestion-BNEVVm5c.js";import"./column-rules-DgVqSNU2.js";import"./badge-ux-RK1YK.js";import"./icon-button-HZwQKD3a.js";import"./switch-ByCU93P4.js";import"./textarea-Bbbnnl4r.js";import"./use-org-fs-49a1bhbu.js";import"./use-automations-C6LbyvJD.js";import"./search-toggle-BnK2KHqJ.js";import"./daily-pulse-Cry9rVi8.js";import"./use-task-board-events-BARWSwfj.js";import"./config-CE3I8pu5.js";import"./use-members-0ZBHc0S5.js";import"./use-org-auth-client-t4l-TKT1.js";import"./select-DUEGSJco.js";import"./index-BdQq_4o_.js";import"./task-route-BLP-DBaS.js";import"./task-key-BCHdFiOO.js";import"./task-assignee-avatar-BiPanmNM.js";import"./use-tags-BsXvHuTC.js";import"./calendar-qN6CeKGa.js";import"./alert-BDbwlXZm.js";import"./collapsible-CnlVGt-G.js";import"./index-CafY8AgN.js";import"./editor-classes-BnPaf--r.js";import"./index-CvMuyNgv.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./use-task-board-item-prs-BhAhDKGd.js";import"./use-connection-CBKH8IwL.js";import"./github-repo-scope-ByTYKy_L.js";import"./thread-sheet-body-dWggSd-b.js";import"./useSuspenseInfiniteQuery-JvpRoEFG.js";import"./pair-Ck7rgrik.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-fHjuxWIZ.js";import"./types-CHFSNT7a.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./use-mcp-prompts-wKDmQlGB.js";import"./use-thread-outputs-CoFWg3_v.js";import"./file-type-icon-DHFVwXjA.js";import"./use-infinite-scroll-Cuyf7850.js";import"./task-status-CVpsP3bD.js";import"./use-open-billing-url-C5lEsbaH.js";import"./chat-draft-WGnppXw7.js";import"./separator-Bk_a4cod.js";import"./feature-paywall-hsFyGLR_.js";import"./plan-ladder-BKLU8eo8.js";function a(){const t=l.c(1);let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=r.jsx("div",{className:"flex h-full min-h-0 flex-col overflow-hidden",children:r.jsx(h,{})}),t[0]=o):o=t[0],o}function Xo(){const t=l.c(8),{locator:o}=n();let i;t[0]!==o?(i=c=>c.setQueryData(f.taskBoardItems(o),u()),t[0]=o,t[1]=i):i=t[1];let p;t[2]===Symbol.for("react.memo_cache_sentinel")?(p=r.jsx(a,{}),t[2]=p):p=t[2];let m;t[3]!==i?(m=r.jsx(x,{seed:i,children:p}),t[3]=i,t[4]=m):m=t[4];let e;t[5]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx(a,{}),t[5]=e):e=t[5];let s;return t[6]!==m?(s=r.jsx(d.Content,{children:r.jsx(j,{feature:"kanban",backdrop:m,children:e})}),t[6]=m,t[7]=s):s=t[7],s}export{Xo as default};
@@ -1 +0,0 @@
1
- import{c as W,b as _,o as z,e as G,K as I,t as j}from"./index-ifZGovK1.js";import{u as L,C as Y,F as $,G as J,M as U,N as X,as as H,L as Z,O as ee,at as te,au as ne}from"./use-content-sync-D_qyLHCv.js";import{a as se}from"./use-move-blocks-Dm4etxGk.js";import{Q as oe}from"./parse-sections-YhOUxu7l.js";function ae(p,e){const s=(p.deletes??[]).filter(t=>!Object.hasOwn(p.writes,t)),a=[...Object.keys(p.writes),...s],o={},n=[];for(const t of a){const g=e(t);g===void 0?n.push(t):o[t]=g}return n.length>0?{kind:"unread",blockKeys:n}:{kind:"apply",patch:{set:p.writes,...s.length>0?{delete:s}:{}},ifMatch:o}}function ue(p){const e=W.c(54),{orgSlug:s,virtualMcpId:a,branch:o}=p,n=_(),t=z(),g=L(a,o),r=g.kind==="protocol"?g:null;let E;e[0]!==o||e[1]!==s||e[2]!==a?(E={orgSlug:s,virtualMcpId:a,branch:o},e[0]=o,e[1]=s,e[2]=a,e[3]=E):E=e[3];const i=Y(E);let M;e[4]!==o||e[5]!==s||e[6]!==a?(M={orgSlug:s,virtualMcpId:a,branch:o},e[4]=o,e[5]=s,e[6]=a,e[7]=M):M=e[7];const l=M;let v;e[8]!==i?(v=I.decofile(i),e[8]=i,e[9]=v):v=e[9];const y=v;let h;e[10]!==o||e[11]!==s||e[12]!==a?(h=J(s,a,o),e[10]=o,e[11]=s,e[12]=a,e[13]=h):h=e[13];let m;e[14]!==o||e[15]!==s||e[16]!==a?(m=$(s,a,o),e[14]=o,e[15]=s,e[16]=a,e[17]=m):m=e[17];let k;e[18]!==i||e[19]!==l||e[20]!==r||e[21]!==t?(k=c=>U(t,r,l,i,c.patch,c.ifMatch),e[18]=i,e[19]=l,e[20]=r,e[21]=t,e[22]=k):k=e[22];let K;e[23]!==h||e[24]!==m||e[25]!==k?(K={mutationKey:h,scope:m,mutationFn:k},e[23]=h,e[24]=m,e[25]=k,e[26]=K):K=e[26];const b=G(K);let R;e[27]!==i||e[28]!==l||e[29]!==r||e[30]!==t||e[31]!==n?(R=async c=>{for(const d of c)await X(t,r,l,i,d);return j.info(n("sectionsEditor.namedRules.changedMeanwhile"),{...H,description:n("sectionsEditor.namedRules.changedMeanwhileHint")}),{ok:!1,reason:"changed"}},e[27]=i,e[28]=l,e[29]=r,e[30]=t,e[31]=n,e[32]=R):R=e[32];const S=R;let P;e[33]!==i||e[34]!==S||e[35]!==b||e[36]!==r||e[37]!==t||e[38]!==y||e[39]!==n?(P=async c=>{if(!r)return j.info(n("sectionsEditor.namedRules.unavailable"),{...H,description:n("sectionsEditor.namedRules.unavailableHint")}),{ok:!1,reason:"unavailable"};const d=oe(c.writes),f=ae({...c,writes:d},u=>ne(t,i,u));if(f.kind==="unread")return S(f.blockKeys);const B=[...Object.keys(d),...f.patch.delete??[]],F=t.getQueryData(y),N=new Map;for(const u of B)F&&Object.hasOwn(F,u)&&N.set(u,F[u]);t.setQueryData(y,u=>se(u,{writes:d,deletes:f.patch.delete??[]})),t.cancelQueries({queryKey:y});try{return await b.mutateAsync(f),{ok:!0}}catch(u){const A=u;return t.setQueryData(y,q=>{if(!q)return q;const V={...q};for(const D of B)N.has(D)?V[D]=N.get(D):delete V[D];return V}),Z(A)?S(B):(ee(n,A instanceof Error?A:new Error(String(A)),r.source),{ok:!1,reason:"failed"})}},e[33]=i,e[34]=S,e[35]=b,e[36]=r,e[37]=t,e[38]=y,e[39]=n,e[40]=P):P=e[40];const T=P;let O;e[41]!==i||e[42]!==l||e[43]!==r||e[44]!==t?(O=async()=>{if(!r)return null;try{return(await te(t,r,l,i)).blocks}catch{return null}},e[41]=i,e[42]=l,e[43]=r,e[44]=t,e[45]=O):O=e[45];const w=O;let C;e[46]!==w||e[47]!==n?(C=async c=>{const d=await w();if(!d)return j.info(n("sectionsEditor.namedRules.unavailable"),{...H,description:n("sectionsEditor.namedRules.unavailableHint")}),null;const f=c(d);return f||j.info(n("sectionsEditor.namedRules.changedMeanwhile"),{...H,description:n("sectionsEditor.namedRules.changedMeanwhileHint")}),f},e[46]=w,e[47]=n,e[48]=C):C=e[48];const x=C;let Q;return e[49]!==T||e[50]!==b.isPending||e[51]!==x||e[52]!==w?(Q={apply:T,reread:w,planStored:x,isPending:b.isPending},e[49]=T,e[50]=b.isPending,e[51]=x,e[52]=w,e[53]=Q):Q=e[53],Q}export{ue as u};
@@ -1 +0,0 @@
1
- import{c as P,o as K,m as F,K as m,dX as We,aF as Dt,aG as Rt,r as U,a as xt,aw as ce,a2 as Pt,au as At,dG as $t,t as X,j as V}from"./index-ifZGovK1.js";import{b as ne}from"./sandbox-url-D3mC8qhT.js";import{u as Lt}from"./chat-context-DXm8btNS.js";import{i as Ft,u as Ut}from"./index-j4NUsiRT.js";import{u as pe,b as Mt}from"./experiments-tab-choice-CMHPX5ZC.js";import{a as ze}from"./input-DIcILgWd.js";import{M as jt,j as Bt,i as le,s as Pe}from"./thread-intent-7GmQH5mt.js";import{s as Qt}from"./utils-CduIoZ0d.js";import{a as Vt}from"./repository-binding-DtIeSvDY.js";import{a as Ht}from"./sandbox-git-api-CH_-QFpD.js";import{e as Gt}from"./backoff-CrEUbyZT.js";const p={MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603,NotFound:-32001,Conflict:-32002,InvalidBlock:-32003,ReadOnly:-32005,Unsupported:-32006,LimitExceeded:-32007,Unavailable:-32008,Unauthorized:-32010};class T extends Error{code;data;constructor(t,n,o){super(n),this.name="ContentProtocolError",this.code=t,this.data=o}toJSON(){return this.data===void 0?{code:this.code,message:this.message}:{code:this.code,message:this.message,data:this.data}}static from(t){return new T(t.code,t.message,t.data)}}const q="deco-content",ue={major:1},Xe=1;async function Kt(e){let t=new Uint8Array(await e.arrayBuffer());if(t[0]===31&&t[1]===139){const n=new Blob([t]).stream().pipeThrough(new DecompressionStream("gzip"));t=new Uint8Array(await new Response(n).arrayBuffer())}return JSON.parse(new TextDecoder().decode(t))}const de={major:ue.major,minor:Xe},Ze=`the endpoint speaks an older ${q} than this client needs (${de.major}.${de.minor} or newer): update @decocms/blocks in the site (8.2.0 or newer) and start deco serve again`;function W(e,t,n){const o={reason:t,required:{...de}};if(n){o.actual={protocol:n.protocol,major:n.version?.major,minor:n.version?.minor};const r=n.server;typeof r?.name=="string"&&typeof r.version=="string"&&(o.server={name:r.name,version:r.version})}return new T(p.Unsupported,e,o)}function et(e){const t=e??{},{protocol:n,version:o}=t;if(n!==q)throw W(`the endpoint speaks ${JSON.stringify(n)}, not ${q}`,"protocol",t);if(o?.major!==ue.major)throw W(`the endpoint speaks ${q} ${String(o?.major)}.x; this client speaks ${ue.major}.x`,"major",t);if(typeof o.minor!="number"||o.minor<Xe)throw W(Ze,"outdated",t);return e}function Ae(e,t){return t.code===p.MethodNotFound&&e.startsWith("changes.")?W(Ze,"outdated"):T.from(t)}function ye(e){const t=e.fetch??(s=>fetch(s));let n=1;async function o(s){const i={"content-type":"application/json",accept:"application/json",...e.headers},a=await t(new Request(e.endpoint,{method:"POST",headers:i,body:JSON.stringify(s)}));let c;try{c=await Kt(a)}catch{throw new T(p.Unavailable,`the endpoint answered HTTP ${a.status} without a JSON-RPC body`)}if(!a.ok||!Array.isArray(c)&&c?.id===null){const l=c?.error;throw l?T.from(l):new T(p.Unavailable,`the endpoint answered HTTP ${a.status}`)}return c}const r=async(s,i)=>{const a=n++,c=await o({jsonrpc:"2.0",id:a,method:s,params:i??{}});if(c.error)throw Ae(s,c.error);return c.result};return{call:r,describe:async()=>et(await r("describe")),schemaGet:s=>r("schema.get",s),blocksList:s=>r("blocks.list",s),blocksApply:s=>r("blocks.apply",s),changesList:s=>r("changes.list",s),changesGet:s=>r("changes.get",s),changesDiscard:s=>r("changes.discard",s),async batch(s){const i=s.map(()=>n++),a=await o(s.map((l,u)=>({jsonrpc:"2.0",id:i[u],method:l.method,params:l.params??{}}))),c=new Map(a.map(l=>[l.id,l]));return i.map((l,u)=>{const d=c.get(l);return d?d.error?{ok:!1,error:Ae(s[u].method,d.error)}:{ok:!0,result:d.result}:{ok:!1,error:new T(p.InternalError,"no response for this call")}})}}}const fe=".json";[...Array.from({length:9},(e,t)=>`COM${t+1}`),...Array.from({length:9},(e,t)=>`LPT${t+1}`)];new TextEncoder;function qt(e){return`${encodeURIComponent(e)}${fe}`}function tt(e){return e.endsWith(fe)?e.slice(0,-fe.length):e}function ko(e){const t=tt(e);try{return decodeURIComponent(t)}catch{return t}}function Jt(e){let t=tt(e),n=0;for(;t.includes("%");){let o;try{o=decodeURIComponent(t)}catch{break}if(o===t)break;t=o,n++}return{name:t,passes:n}}function Co(e){return Jt(qt(e)).name}const $e=20,Le=5,Fe=500;function Se(e){return e instanceof T?e.code===p.MethodNotFound?!0:e.code===p.Unsupported&&e.data?.reason==="outdated":!1}function he(e,t){return t.notModified?e?{...e,base:t.base}:null:{revision:t.revision,base:t.base,changes:t.changes}}async function Yt(e,t,n){const o=m.contentChanges(n),r=e.getQueryData(o),s=await t.changesList(r?{ifNoneMatch:r.revision}:{}),i=he(r,s);if(i)return i;const a=await t.changesList({});return he(void 0,a)}async function Wt(e,t){const n=[];for(let s=0;s<t.length;s+=$e)n.push(t.slice(s,s+$e));const o=Object.create(null),r=[];for(let s=0;s<n.length;s+=Le){const i=await e.batch(n.slice(s,s+Le).map(a=>({method:"changes.get",params:{names:a}})));for(const a of i){if(!a.ok)throw a.error;const c=a.result;Object.assign(o,c.entries),r.push(...c.diagnostics)}}return{entries:o,diagnostics:r}}async function Io(e,t){let n={revision:"",versions:{}};for(let o=0;o<t.length;o+=Fe){const r=t.slice(o,o+Fe),s=await e.changesDiscard({names:r.map(i=>i.name),ifMatch:Object.fromEntries(r.map(i=>[i.name,i.version]))});n={revision:s.revision,versions:{...n.versions,...s.versions}}}return n}function Oo(e){return e instanceof T&&e.code===p.Conflict}function nt(e){return e?.kind==="protocol"?e:null}function To(e,t,n){const o=P.c(14);let r;o[0]!==n?(r={},o[0]=n,o[1]=r):r=o[1];const s=r,i=K();let a;o[2]!==e?(a=nt(e),o[2]=e,o[3]=a):a=o[3];const c=a,l=!!c&&!!t&&s.enabled!==!1;let u;o[4]!==t?(u=m.contentChanges(t??""),o[4]=t,o[5]=u):u=o[5];let d;o[6]!==t||o[7]!==l||o[8]!==c||o[9]!==i?(d=l?()=>Yt(i,c.client,t):We,o[6]=t,o[7]=l,o[8]=c,o[9]=i,o[10]=d):d=o[10];let h;return o[11]!==u||o[12]!==d?(h={queryKey:u,queryFn:d,staleTime:0},o[11]=u,o[12]=d,o[13]=h):h=o[13],F(h)}function _o(e,t,n){const o=P.c(14);let r;o[0]!==e?(r=nt(e),o[0]=e,o[1]=r):r=o[1];const s=r;let i;o[2]!==n?(i=n?Object.keys(n.changes):[],o[2]=n,o[3]=i):i=o[3];const a=i,c=!!s&&!!t&&!!n&&a.length>0;let l;o[4]!==t||o[5]!==n?.revision?(l=m.contentChangeSides(t??"",n?.revision??""),o[4]=t,o[5]=n?.revision,o[6]=l):l=o[6];let u;o[7]!==c||o[8]!==a||o[9]!==s?(u=c?()=>Wt(s.client,a):We,o[7]=c,o[8]=a,o[9]=s,o[10]=u):u=o[10];let d;return o[11]!==l||o[12]!==u?(d={queryKey:l,queryFn:u,staleTime:Number.POSITIVE_INFINITY},o[11]=l,o[12]=u,o[13]=d):d=o[13],F(d)}function ot(e){try{const t=new URL(e);if(t.protocol!=="http:"&&t.protocol!=="https:")return!1;const n=t.hostname.toLowerCase();return n==="127.0.0.1"||n==="[::1]"||n==="localhost"}catch{return!1}}function Z(e){try{const t=new URL(e);return(t.hostname==="127.0.0.1"||t.hostname==="[::1]")&&(t.hostname="localhost"),t.href}catch{return e}}const rt=Dt({endpoint:Rt().max(2048).refine(e=>ot(e)&&new URL(e).pathname==="/rpc").transform(Z)});function No(e){const t=new URLSearchParams(e.replace(/^#/,"")),n=rt.safeParse({endpoint:t.get("endpoint")??""});return n.success?n.data:null}function st(e){const t=rt.safeParse(e);return t.success?t.data:null}const it="studio:deco-serve-last";function Do(e){try{localStorage.setItem(it,JSON.stringify(e))}catch{}}function Ro(){try{const e=localStorage.getItem(it);return e?st(JSON.parse(e)):null}catch{return null}}function xo(e){try{return new URL(Z(e)).host}catch{return e}}function zt(e,t=1e4){return Math.min(1e3*2**Math.max(0,e-1),t)}const Xt="http://localhost:4545/rpc",Po="npx @decocms/blocks serve",Ao="npx @decocms/blocks schema";class Ee extends Error{constructor(t="the endpoint isn't deco serve"){super(t),this.name="NotDecoServeError"}}function Zt(e){if(e instanceof Ee)return{reason:"not-deco-serve"};if(!(e instanceof T))return{reason:"not-answering"};switch(e.code){case p.Unauthorized:case p.MethodNotFound:return{reason:"outdated"};case p.Unsupported:return Se(e)?{reason:"outdated"}:{reason:"version-mismatch"};case p.Unavailable:return/^the endpoint answered HTTP/.test(e.message)?{reason:"not-deco-serve"}:{reason:"error",detail:e.message};default:return{reason:"error",detail:e.message}}}function $o(e,t){if(e)return[Z(e.endpoint)];const n=[t?.endpoint,Xt].filter(o=>!!o).map(Z);return[...new Set(n)]}const at=U.createContext(null);function en(e){const t=P.c(27),n=U.useContext(at),o=pe(n?null:e),{data:r}=xt.useSession(),s=r?.user?.id??"",i=!!e&&!!s;let a;t[0]!==i||t[1]!==s||t[2]!==e?(a=i?ce.decoServeConnection(s,e):null,t[0]=i,t[1]=s,t[2]=e,t[3]=a):a=t[3];const[c,l]=Me(a);let u;t[4]!==i||t[5]!==s||t[6]!==e?(u=i?ce.decoServeEndpoint(s,e):null,t[4]=i,t[5]=s,t[6]=e,t[7]=u):u=t[7];const[d,h]=Me(u);if(n)return n;let b;t[8]!==c||t[9]!==i?(b=i?st(c):null,t[8]=c,t[9]=i,t[10]=b):b=t[10];const g=b,k=!!g;let C;t[11]!==o||t[12]!==k?(C=tn(o,k),t[11]=o,t[12]=k,t[13]=C):C=t[13];const{applies:R,undecided:_}=C,N=R?g:null,I=i&&o==="v8"&&typeof d=="string"?d:null;let O;t[14]!==h||t[15]!==l||t[16]!==i?(O=S=>{i&&(l(S),h(S.endpoint))},t[14]=h,t[15]=l,t[16]=i,t[17]=O):O=t[17];let w;t[18]!==l||t[19]!==i?(w=()=>{i&&l(null)},t[18]=l,t[19]=i,t[20]=w):w=t[20];let y;return t[21]!==N||t[22]!==I||t[23]!==O||t[24]!==w||t[25]!==_?(y={connection:N,undecided:_,lastEndpoint:I,set:O,clear:w},t[21]=N,t[22]=I,t[23]=O,t[24]=w,t[25]=_,t[26]=y):y=t[26],y}function tn(e,t){return t?e==="loading"?{applies:!1,undecided:!0}:{applies:e==="v8"||e==="error",undecided:!1}:{applies:!1,undecided:!1}}function Ue(e){try{const t=localStorage.getItem(e);return t===null?null:JSON.parse(t)}catch{return null}}function Me(e){const t=P.c(17),n=K(),o=e??"";let r;t[0]!==o?(r=["localStorage",o],t[0]=o,t[1]=r):r=t[1];const s=r;let i,a;t[2]!==e?(i=()=>e?Ue(e):null,a=()=>e?Ue(e):null,t[2]=e,t[3]=i,t[4]=a):(i=t[3],a=t[4]);const c=!!e;let l;t[5]!==s||t[6]!==i||t[7]!==a||t[8]!==c?(l={queryKey:s,queryFn:i,initialData:a,enabled:c,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[5]=s,t[6]=i,t[7]=a,t[8]=c,t[9]=l):l=t[9];const{data:u}=F(l);let d;t[10]!==e||t[11]!==n||t[12]!==s?(d=k=>{if(e){try{k===null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(k))}catch{}n.setQueryData(s,k)}},t[10]=e,t[11]=n,t[12]=s,t[13]=d):d=t[13];const h=d,b=e?u??null:null;let g;return t[14]!==h||t[15]!==b?(g=[b,h],t[14]=h,t[15]=b,t[16]=g):g=t[16],g}function Lo(e){return e.kind==="protocol"||e.kind==="unavailable"}function Fo(e){const t=e.hasOrg?e.orgFlag:!1,{backend:n}=e;return n==="protocol"||n==="unavailable"?!0:n==="pending"?t===!0?!0:void 0:t}function Uo(e,t,n){return t!=="github"||n!=="v8"?!1:e.kind==="pending"?!0:e.kind==="unavailable"&&e.siteNotOwned?!1:(e.kind==="protocol"||e.kind==="unavailable")&&e.source==="github"}function Mo(e){if(e.kind!=="protocol"||e.source!=="local")return null;const t=e.describe.preview?.url;return t&&ot(t)?t:null}function jo(e,t){return e.kind!=="protocol"||e.source!=="local"||!e.describe.assets||!t?null:new URL(t.endpoint).origin}function ct(e){return e.hasServeConnection?"local":e.runtime==="sandbox"?"sandbox":"github"}function nn(e){if(!e.hasProject)return"legacy";const t=ct(e);if(t==="local")return"protocol-local";if(e.serveConnectionUndecided)return"pending";if(t==="sandbox"){const o=e.sandboxSite;return o==="v8"?"protocol-sandbox":o==="v7"?"legacy":o==="error"?e.markedV8?"retrying-sandbox":"legacy":"pending"}if(e.mainSchema==="loading")return"pending";if(e.mainSchema==="error")return"retrying-github";if(e.mainSchema==="v7")return"legacy";const n=e.githubSite;return n==="v8"?"protocol-github":n==="not-owned"?"site-not-owned-github":n==="error"?"unavailable-github":n==="v7"?"legacy":"pending"}function on(e){return{github:e.mode==="github"&&e.mainSchema==="v8",sandbox:e.mode==="sandbox"&&e.workingTreeReady}}function je(e){return e.isError||e.errorUpdateCount>0}function rn(e,t,n){if(!t||n.size===0)return e;const o={...e};for(const r of n)Object.hasOwn(t,r)?o[r]=t[r]:delete o[r];return o}function sn(e){if(!e||typeof e!="object")return[];const t=e,n=[];return typeof t.blockKey=="string"&&n.push(t.blockKey),t.writes&&typeof t.writes=="object"&&n.push(...Object.keys(t.writes)),Array.isArray(t.deletes)&&n.push(...t.deletes.filter(o=>typeof o=="string")),n}function oe(e){return{[jt]:e}}class ke extends Error{status=409;constructor(){super("main's schema changed")}}async function Ce(e){return e.status!==409?!1:(await e.clone().json().catch(()=>null))?.code===Bt}function Ie(e,t,n){e.resetQueries({predicate:o=>{const r=o.queryKey;return r[1]!==t||r[2]!==n?!1:r[0]===m.mainSchemaV8(t,n)[0]||r[0]===m.contentBackend()[0]&&r[4]==="github"}})}function lt(e,t,n){return e.getQueryData(m.mainSchemaV8(t,n))}const ut="__noSchema";function an(){return{manifest:{blocks:{}},schema:{definitions:{},root:{}},[ut]:!0}}function Bo(e){return!!e&&e[ut]===!0}function dt(e){if(!e.ok)return e.error.code===p.NotFound;const t=e.result;return t.notModified===!1&&t.schema===null}function cn(e,t){return(typeof t.name=="string"?t.name.trim():"")||e}const ln=(e,t)=>e.label.localeCompare(t.label)||e.key.localeCompare(t.key);function Qo(e){const t=new Map;for(const[n,o]of Object.entries(e)){const r=o&&typeof o=="object"&&!Array.isArray(o)?o:{},s=typeof r.__resolveType=="string"?r.__resolveType:null,i=t.get(s)??[];i.push({key:n,label:cn(n,r)}),t.set(s,i)}return[...t.entries()].map(([n,o])=>({resolveType:n,blocks:o.sort(ln)})).sort((n,o)=>n.resolveType===null?1:o.resolveType===null?-1:Be(n.resolveType).localeCompare(Be(o.resolveType))||n.resolveType.localeCompare(o.resolveType))}function Be(e){return(e.split("/").filter(Boolean).at(-1)??e).replace(/\.(tsx?|jsx?)$/,"")||e}function Qe(e,t,n){if(t.length===0)return n;const[o,...r]=t;if(Array.isArray(e)&&typeof o=="number"){const s=e.slice();return s[o]=Qe(e[o],r,n),s}if(e&&typeof e=="object"&&typeof o=="string"){const s=e,i={};for(const a of Object.keys(s))i[a]=a===o?Qe(s[a],r,n):s[a];return i}return e}function Vo(e){if(e.trim()==="")return null;const t=Number(e);return Number.isFinite(t)?t:null}class Ve extends Error{}class He extends Error{}const ft="site-not-owned";async function un(e){return e.status!==409?!1:(await e.clone().json().catch(()=>null))?.code==="site_not_owned"}async function dn(e,t=r=>fetch(r),n,o){const r=ye({endpoint:e,fetch:async s=>{const i=new Request(s);for(const[c,l]of Object.entries(oe("v8")))i.headers.set(c,l);const a=await t(i);if(await un(a))throw new He;if(await Ce(a))throw n?.(),new ke;return a}});try{const s=await Te(r,le(o)?{schema:o}:void 0);return s.v8Schema?s:null}catch(s){if(s instanceof He)return ft;throw s}}const Oe=5e3;function fn(e){return new URL(`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}/rpc`,window.location.origin).href}function hn(e){return new URL(ne(e,"rpc"),window.location.origin).href}async function Te(e,t){const[n,o]=await e.batch(t?[{method:"describe"}]:[{method:"describe"},{method:"schema.get"}]);if(!n?.ok)throw n?.error??new Error("no describe");if(n.result?.protocol!==q)throw new Ee;const s=et(n.result);if(t)return{client:e,describe:s,hasSchema:t.schema!=null,v8Schema:le(t.schema)};if(!o)throw new Error("no schema.get");if(dt(o))return{client:e,describe:s,hasSchema:!1,v8Schema:!1};if(o.ok){const i=o.result;return{client:e,describe:s,hasSchema:!0,v8Schema:le(i?.schema)}}throw o.error}async function gn(e,t=n=>fetch(n)){const n=ye({endpoint:e,fetch:async o=>{const r=await t(o);if(r.status===404)throw new Ve;return r}});try{const o=await Te(n);return o.v8Schema?o:null}catch(o){if(o instanceof Ve)return null;throw o}}function _e(e,t){const n=P.c(53),{org:o}=Pt(),{connection:r,undecided:s}=en(e),{runtime:i}=ze(e),a=U.useContext(at),c=pe(a?null:e),l=Mt(e),u=ct({hasServeConnection:!!r,runtime:i}),d=Lt()?.taskId??null,h=Ft(Ut().lifecycle.phase),b=K(),g=on({mode:u,mainSchema:c,workingTreeReady:h}),k=g.github&&!!o.slug&&!!e&&!!t;let C;n[0]!==t||n[1]!==o.slug||n[2]!==b||n[3]!==e?(C=()=>dn(fn({orgSlug:o.slug,virtualMcpId:e,branch:t}),void 0,()=>Ie(b,o.slug,e),lt(b,o.slug,e)?.schema),n[0]=t,n[1]=o.slug,n[2]=b,n[3]=e,n[4]=C):C=n[4];const R=F({queryKey:m.contentBackend(o.slug,e??"",t??"","github"),queryFn:C,enabled:k,staleTime:Number.POSITIVE_INFINITY,...Ge}),_=g.sandbox&&!!o.slug&&!!e&&!!t;let N;n[5]!==t||n[6]!==o.slug||n[7]!==d||n[8]!==e?(N=async()=>gn(hn({orgSlug:o.slug,virtualMcpId:e,branch:t,threadId:d})),n[5]=t,n[6]=o.slug,n[7]=d,n[8]=e,n[9]=N):N=n[9];const I=F({queryKey:m.contentBackend(o.slug,e??"",t??"","sandbox",d??""),queryFn:N,enabled:_,staleTime:Number.POSITIVE_INFINITY,...Ge}),O=!!r;let w;n[10]!==r?.endpoint||n[11]!==o.slug||n[12]!==e?(w=m.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[10]=r?.endpoint,n[11]=o.slug,n[12]=e,n[13]=w):w=n[13];let y;n[14]!==r?(y=()=>Te(ye({endpoint:r.endpoint})),n[14]=r,n[15]=y):y=n[15];let S;n[16]!==O||n[17]!==w||n[18]!==y?(S={queryKey:w,queryFn:y,enabled:O,staleTime:Number.POSITIVE_INFINITY,retry:bn,retryDelay:vn,refetchInterval:mn},n[16]=O,n[17]=w,n[18]=y,n[19]=S):S=n[19];const v=F(S);let A;n[20]!==r?.endpoint||n[21]!==o.slug||n[22]!==e?(A=m.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[20]=r?.endpoint,n[21]=o.slug,n[22]=e,n[23]=A):A=n[23];const $=A;let E;n[24]!==r?.endpoint||n[25]!==o.slug||n[26]!==e?(E=m.contentBackend(o.slug,e??"","local-describe",r?.endpoint??""),n[24]=r?.endpoint,n[25]=o.slug,n[26]=e,n[27]=E):E=n[27];let D;n[28]!==v.data||n[29]!==$||n[30]!==b?(D=async()=>{try{return await v.data.client.describe()}catch(f){const G=f;throw b.invalidateQueries({queryKey:$,exact:!0},{cancelRefetch:!1}),G}},n[28]=v.data,n[29]=$,n[30]=b,n[31]=D):D=n[31];const x=!!v.data&&!a;let M;n[32]!==E||n[33]!==D||n[34]!==x?(M={queryKey:E,queryFn:D,enabled:x,refetchInterval:Oe,retry:!1},n[32]=E,n[33]=D,n[34]=x,n[35]=M):M=n[35];const Q=F(M).data??v.data?.describe,L=nn({hasProject:!!e,hasServeConnection:!!r,serveConnectionUndecided:s,runtime:i,mainSchema:c,githubSite:R.data===ft?"not-owned":R.data?"v8":R.data===null?"v7":je(R)?"error":"loading",sandboxSite:wn({data:I.data,isError:je(I),workingTreeReady:h}),markedV8:l});if(L==="pending"){let f;return n[36]===Symbol.for("react.memo_cache_sentinel")?(f={kind:"pending"},n[36]=f):f=n[36],f}if(L==="retrying-github"){let f;return n[37]===Symbol.for("react.memo_cache_sentinel")?(f={kind:"pending",retrying:"github"},n[37]=f):f=n[37],f}if(L==="retrying-sandbox"){let f;return n[38]===Symbol.for("react.memo_cache_sentinel")?(f={kind:"pending",retrying:"sandbox"},n[38]=f):f=n[38],f}if(L==="legacy"){let f;return n[39]===Symbol.for("react.memo_cache_sentinel")?(f={kind:"legacy"},n[39]=f):f=n[39],f}if(L==="protocol-github"){const f=R.data;let G;return n[40]!==f?(G=ge("github",f,""),n[40]=f,n[41]=G):G=n[41],G}if(L==="site-not-owned-github"){let f;return n[42]===Symbol.for("react.memo_cache_sentinel")?(f={kind:"unavailable",source:"github",siteNotOwned:!0},n[42]=f):f=n[42],f}if(L==="protocol-sandbox"){let f;return n[43]!==I.data?(f=ge("sandbox",I.data,":sandbox"),n[43]=I.data,n[44]=f):f=n[44],f}if(L==="unavailable-github"){let f;return n[45]===Symbol.for("react.memo_cache_sentinel")?(f={kind:"unavailable",source:"github"},n[45]=f):f=n[45],f}const ie=v.error??v.failureReason,ae=r?.endpoint??"";let Y;return n[46]!==Q||n[47]!==v.data||n[48]!==v.failureCount||n[49]!==v.isError||n[50]!==ie||n[51]!==ae?(Y=yn({probed:v.data,isError:v.isError,failureCount:v.failureCount,failure:ie,describe:Q,endpoint:ae}),n[46]=Q,n[47]=v.data,n[48]=v.failureCount,n[49]=v.isError,n[50]=ie,n[51]=ae,n[52]=Y):Y=n[52],Y}function mn(e){return e.state.status==="error"||e.state.data?.v8Schema===!1?Oe:!1}function vn(e){return zt(e+1)}function bn(e,t){return!(t instanceof T)&&!(t instanceof Ee)}function wn(e){return e.data!==void 0?e.data?"v8":"v7":e.workingTreeReady?e.isError?"error":"loading":"unavailable"}const pn=3;function yn(e){if(e.probed?.hasSchema&&!e.probed.v8Schema)return{kind:"unavailable",source:"local",problem:{reason:"not-v8"}};const t=e.probed?ge("local",{...e.probed,describe:e.describe??e.probed.describe},`:serve:${e.endpoint}`):null;return e.isError||e.failureCount>0?t?.kind==="protocol"&&!e.isError&&e.failureCount<pn?t:{kind:"unavailable",source:"local",problem:Zt(e.failure)}:t??{kind:"pending"}}const Ge={retry:2,refetchInterval:e=>e.state.status==="error"?Oe:!1};function ge(e,t,n){return{kind:"protocol",source:e,client:t.client,describe:t.describe,cacheKeySuffix:n,hasSchema:t.hasSchema}}function ht(e){const t=P.c(13);let n;t[0]!==e?(n=ce.localPreviewUrl(e??""),t[0]=e,t[1]=n):n=t[1];const o=n,[r,s]=At(o,null),i=pe(e);let a;if(t[2]!==i||t[3]!==r||t[4]!==e){const h=e?Pe(r):null;a=Sn({saved:h,main:i}),t[2]=i,t[3]=r,t[4]=e,t[5]=a}else a=t[5];const c=a;let l,u;t[6]!==s?(l=h=>s(Pe(h)),u=()=>s(null),t[6]=s,t[7]=l,t[8]=u):(l=t[7],u=t[8]);let d;return t[9]!==c||t[10]!==l||t[11]!==u?(d={...c,setUrl:l,clear:u},t[9]=c,t[10]=l,t[11]=u,t[12]=d):d=t[12],d}function Sn(e){return e.saved?e.main==="v7"?{url:e.saved,undecided:!1}:e.main==="v8"?{url:null,undecided:!1}:{url:null,undecided:!0}:{url:null,undecided:!1}}function En(e,t){const n=(e??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return n?`${n}/${t}`:t}function Ke(e){let t;try{t=JSON.parse(e)}catch{return null}return typeof t!="object"||t===null||Array.isArray(t)?null:t}class Ne extends Error{constructor(t,n,o=[]){super(n),this.blocks=t,this.fields=o,this.name="BlockConflictError"}blocks;fields}function De(e){return`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`}function re(e,t,n){return["decofile-write",e,t,n]}function kn(e,t,n){return{id:re(e,t,n).join(":")}}function Re(e){return`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`}async function Cn(e,t){const n=await e.json().catch(()=>({}));throw new Error(n.error??`${t} failed (${e.status})`)}function In(e,t,n){e.setQueryData(m.decofileDraft(De(t)),n)}function On(e,t){return e.getQueryData(m.decofileDraft(De(t)))??null}async function Tn(e,t){const n=await fetch(Re(e),{cache:"no-store",headers:{...oe("v7"),"if-none-match":`"${t}"`}}).catch(()=>null);return n?.status===200||n?.status===409}function Ho(e){const t=P.c(4);let n;t[0]!==e?(n=m.decofileDraft(e?De(e):""),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:_n,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=F(o);return r??null}async function _n(){throw new Error("decofileDraft is populated by reads/writes, not fetched")}async function Nn(e,t){const n=await fetch(Re(t),{cache:"no-store",headers:oe("v7")});if(await Ce(n))throw Ie(e,t.orgSlug,t.virtualMcpId),new ke;if(!n.ok){const r=new Error(`Failed to fetch decofile: ${n.status}`);throw r.status=n.status,r}const o=await n.json();return o.token&&In(e,t,{version:o.version,token:o.token,apiHost:o.apiHost??window.location.host}),o.decofile}async function Go(e,t){const n=await fetch(Re(e),{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(n.status===409){const r=await n.json().catch(()=>({}));throw r.code==="block-conflict"?new Ne(r.blocks??[],r.error??"Block changed"):new Error(r.error??`Save failed (${n.status})`)}if(!n.ok)return Cn(n,"Save");const o=await n.json();return{...o,apiHost:o.apiHost??window.location.host}}const gt=3e3,Dn=15e3,Rn=2*6e4,mt={now:()=>Date.now(),setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),hidden:()=>typeof document<"u"&&document.visibilityState==="hidden"};function xn(e){return e<Rn?gt:Dn}function Pn(e,t=mt){const n=t.now();let o=!1,r=!1,s=null;const i=()=>{o||(s=t.setTimeout(a,xn(t.now()-n)))},a=()=>{if(s=null,o)return;const{read:c,skip:l}=e();if(r||t.hidden()||l?.()){i();return}r=!0;let u;try{u=c()}catch{u=void 0}Promise.resolve(u).catch(()=>{}).finally(()=>{r=!1}),i()};return i(),()=>{o=!0,s!==null&&t.clearTimeout(s)}}const qe=()=>0;function An(e,t,n=mt){const o=U.useRef(t);o.current=t;const[r]=U.useState(()=>({polling:()=>Pn(()=>o.current,n),idle:()=>()=>{}}));U.useSyncExternalStore(e?r.polling:r.idle,qe,qe)}function vt(e,t){return ne(e,t)}function $n(e,t){return ne(e,"preview-fetch",{path:t})}function Ko(e){return vt(e,"preview-invoke")}function qo(e){return vt(e,"catalog-invoke")}function bt(e){try{const{hostname:t}=new URL(e);return t==="localhost"||t.endsWith(".localhost")||t==="127.0.0.1"||t==="::1"}catch{return!1}}function Ln(){if(typeof document>"u")return null;const e=Array.from(document.querySelectorAll("iframe"));for(const t of e){const n=t.getAttribute("src");if(n&&bt(n))return n}return null}function Fn(e,t){const n=e.previewUrl??e.getFallbackPreviewUrl?.()??Ln();return n&&bt(n)?new URL(t,n).toString():$n(e,t)}function Un(e){return Fn(e,"/.decofile")}function Mn(e){return e===400?"absent":e===404?"unavailable":e>=200&&e<300?"ok":"error"}function Je(e){return e.liveOk||e.committedAbsent?404:e.liveStatus??502}async function jn(e,t){const n=ne(e,"read"),o=await fetch(n,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:t,full:!0})}),r=Mn(o.status);if(r==="absent")return{kind:"absent"};if(r==="unavailable")return{kind:"unavailable"};if(r==="error"){const i=new Error(`Failed to read ${t}: ${o.status}`);throw i.status=o.status,i}const s=await o.json();return typeof s.content!="string"?{kind:"unavailable"}:{kind:"data",data:Qt(s.content)}}async function Bn(e,t){const n=await jn(e,t);if(n.kind!=="data")return n;try{return{kind:"data",data:JSON.parse(n.data)}}catch{return{kind:"unavailable"}}}async function Jo(e){const t=`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}/meta`,n=await fetch(t,{cache:"no-store"});if(n.status===404)return{kind:"absent"};if(!n.ok){const o=new Error(`Failed to read committed meta: ${n.status}`);throw o.status=n.status,o}try{return{kind:"data",data:await n.json()}}catch{return{kind:"unavailable"}}}function Qn(e){return Vt(e)?.metadata?.runtime?.path??null}class wt extends Error{constructor(t){super(t instanceof Error?t.message:String(t),{cause:t}),this.name="ServeLostError"}}function Yo(e){return e instanceof T&&e.code===p.Conflict}function pt(e){const t=e.data?.violations;return!Array.isArray(t)||t.length===0?e.message:t.slice(0,3).map(n=>n.message).join("; ")}function Vn(e,t,n){if(t instanceof Ne)return t.message;if(n==="local")return Gn(e,t);if(t instanceof T)switch(t.code){case p.Conflict:return e("siteEditor.save.conflict");case p.ReadOnly:return e("siteEditor.save.readOnly");case p.InvalidBlock:case p.InvalidParams:return e("siteEditor.save.invalid");case p.LimitExceeded:return e("siteEditor.save.tooLarge")}return e("siteEditor.save.failed")}function Hn(e,t){if(t==="local"||e instanceof Ne)return null;if(e instanceof T){const n=e.code===p.InvalidBlock||e.code===p.InvalidParams?pt(e):e.message;return n?`${e.code}: ${n}`:null}return e.message||null}function Gn(e,t){if(t instanceof wt)return e("decoServe.save.serverGone");if(t instanceof T)switch(t.code){case p.Conflict:return e("decoServe.save.conflict");case p.ReadOnly:return e("decoServe.save.readOnly");case p.InvalidBlock:case p.InvalidParams:return e("decoServe.save.invalid",{detail:pt(t)});case p.LimitExceeded:return e("decoServe.save.tooLarge")}return e("sectionsEditor.sectionsEditor.saveFailed",{error:t.message})}function Kn(e,t,n){return e===null?0:Math.max(0,n-Math.max(0,t-e))}function qn(e,t){const[n,o]=U.useState(e),r=U.useRef(null);return e&&!n&&o(!0),U.useEffect(()=>{if(e){r.current??=Date.now();return}if(!n)return;const s=()=>{r.current=null,o(!1)},i=Kn(r.current,Date.now(),t);if(i===0){s();return}const a=setTimeout(s,i);return()=>clearTimeout(a)},[e,n,t]),n}const yt={phase:"idle",inFlight:0,reload:{seq:0,navigates:!1},epoch:0},Jn=15e3,ee=new Map;function H(e,t){return`${e}/${t}`}function j(e){let t=ee.get(e);return t||(t={state:yt,listeners:new Set,previews:0,timer:null,discardListeners:new Set},ee.set(e,t)),t}function B(e,t){const n=j(e);n.state={...n.state,...t};for(const o of n.listeners)o()}function se(e){e.timer&&clearTimeout(e.timer),e.timer=null}function xe(e){return ee.get(e)?.state??yt}function Yn(e,t){const n=j(e);return n.listeners.add(t),()=>{n.listeners.delete(t)}}function Wo(e){const t=j(e);return t.previews++,()=>{t.previews--,t.previews===0&&t.state.phase==="reloading"&&(se(t),B(e,{phase:"idle"}))}}function zo(e){const t=ee.get(e);!t||t.state.phase!=="reloading"||(se(t),B(e,{phase:"idle"}))}function St(e){const t=j(e);se(t),B(e,{phase:"saving",inFlight:t.state.inFlight+1})}function me(e,t){const n=j(e),o=Math.max(0,n.state.inFlight-1);if(o>0){B(e,{inFlight:o});return}if(!t.ok||n.previews===0){B(e,{phase:"idle",inFlight:o});return}Et(e,t.navigates,o)}function Et(e,t,n=0){const o=j(e);se(o),o.timer=setTimeout(()=>{o.timer=null,o.state.phase==="reloading"&&B(e,{phase:"idle"})},Jn),B(e,{phase:"reloading",inFlight:n,reload:{seq:o.state.reload.seq+1,navigates:t}})}function Wn(e){return e?.kind==="protocol"&&e.source==="github"}async function ve(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s,backend:i,cacheKey:a}=e,c=t.kind==="publish"||t.kind==="reapply"?n.invalidateQueries({queryKey:m.hostedReleases(o,r)}):null;if(i?.kind!=="protocol")return await c,{navigates:!1};const l=s?m.protocolDraftRead(o,r,s):null,u=l?JSON.stringify(n.getQueryData(l)??null):null,d=c?[c]:[];if(a&&t.reread&&d.push(n.invalidateQueries({queryKey:m.decofile(a)})),a&&d.push(n.invalidateQueries({queryKey:m.contentChanges(a)})),s&&i.source==="sandbox"&&d.push(n.invalidateQueries({queryKey:Ht(o,r,s)})),Wn(i)&&l&&d.push(n.invalidateQueries({queryKey:l})),await Promise.all(d),t.kind!=="edit"){const g=H(o,r);B(g,{epoch:xe(g).epoch+1})}const h=l?JSON.stringify(n.getQueryData(l)??null):null,b=u!==h;return b&&await new Promise(g=>$t.schedule(g)),{navigates:b}}async function zn(e,t){return St(H(e.orgSlug,e.virtualMcpId)),kt(e,t)}async function kt(e,t){const n=H(e.orgSlug,e.virtualMcpId);let o;try{o=await t.write()}catch(s){throw me(n,{ok:!1,navigates:!1}),t.refreshOnError&&ve(e,{kind:t.kind,reread:!0}).catch(()=>{}),s}let r=!1;try{({navigates:r}=await ve(e,t))}catch{}finally{me(n,{ok:!0,navigates:r})}return o}function Xo(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s}=e,i=H(o,r),a=new Set(t.blockKeys);for(const u of[...j(i).discardListeners])u(a);St(i);let c=!1;const l=()=>(c=!0,kt(e,{kind:"discard",reread:!0,write:t.write}));return s?n.getMutationCache().build(n,{mutationKey:re(o,r,s),scope:kn(o,r,s),mutationFn:l}).execute(void 0).catch(u=>{throw c||me(i,{ok:!1,navigates:!1}),u}):l()}function Zo(e,t,n){const o=P.c(8);let r;o[0]!==e||o[1]!==t?(r=H(e,t),o[0]=e,o[1]=t,o[2]=r):r=o[2];const s=r;let i;o[3]!==n||o[4]!==s?(i=()=>{const c=j(s).discardListeners;return c.add(n),()=>{c.delete(n)}},o[3]=n,o[4]=s,o[5]=i):i=o[5];let a;o[6]!==s?(a=[s],o[6]=s,o[7]=a):a=o[7],U.useEffect(i,a)}function Xn(e){const t=H(e.orgSlug,e.virtualMcpId);xe(t).inFlight>0||ve(e,{kind:"external"}).then(({navigates:n})=>{const o=j(t);o.previews>0&&o.state.inFlight===0&&Et(t,n)}).catch(()=>{})}function Zn(e,t){const n=P.c(7);let o;n[0]!==e||n[1]!==t?(o=H(e,t),n[0]=e,n[1]=t,n[2]=o):o=n[2];const r=o;let s;n[3]!==r?(s=l=>Yn(r,l),n[3]=r,n[4]=s):s=n[4];const i=s;let a;n[5]!==r?(a=()=>xe(r),n[5]=r,n[6]=a):a=n[6];const c=a;return U.useSyncExternalStore(i,c,c)}const eo=500;function er(e,t){const{phase:n}=Zn(e,t);return qn(n!=="idle",eo)}function to(e){const t=new Error(`${e} unavailable (content server unreachable)`);return t.status=502,t}function no(e,t){return m.liveMeta(e.orgSlug,e.virtualMcpId,e.branch,`protocol${t.cacheKeySuffix}`,"")}function tr(e,t,n){const o=e.getQueryData(m.contentVersions(t));if(!o)return;if(Object.hasOwn(o,n))return o[n];const r=e.getQueryData(m.decofile(t));return r&&Object.hasOwn(r,n)?void 0:null}function Ct(e,t,n){e.setQueryData(m.contentVersions(t),o=>{const r={...o};for(const[s,i]of Object.entries(n))i===null?delete r[s]:r[s]=i;return r})}function oo(e,t){const n=e.getMutationCache().findAll({mutationKey:re(t.orgSlug,t.virtualMcpId,t.branch),status:"pending"});return new Set(n.flatMap(o=>sn(o.state.variables)))}function be(e,t){e.resetQueries({queryKey:m.contentBackend(t.orgSlug,t.virtualMcpId,"local")})}async function te(e,t,n,o){try{return await o()}catch(r){const s=!(r instanceof T);throw t.source==="local"&&s?(be(e,n),new wt(r)):(t.source==="local"&&Se(r)&&be(e,n),r)}}const z=new Map;function It(e,t,n,o){const r=z.get(o);if(r)return r;const s=Ot(e,t,n,o,!0);return z.set(o,s),s.finally(()=>z.delete(o))}async function nr(e,t,n,o){const r=z.get(o);return r&&await r.catch(()=>{}),It(e,t,n,o)}async function Ot(e,t,n,o,r){const s=m.decofile(o),i=no(n,t),a=m.contentRevision(o),c=e.getQueryData(s),l=e.getQueryData(i),u=e.getQueryData(a)??void 0,d=t.source==="github"&&!l?lt(e,n.orgSlug,n.virtualMcpId):void 0,h=d?.isV8&&d.schema&&d.version?d:void 0,b=l??h?.schema,g=h?{...u,schemaVersion:h.version}:u,k=r&&c?g?.revision:void 0,C=r&&b?g?.schemaVersion:void 0,R=m.contentChanges(o),_=e.getQueryData(R),[N,I,O]=await te(e,t,n,()=>t.client.batch([{method:"blocks.list",params:k?{ifNoneMatch:k}:{}},{method:"schema.get",params:C?{ifNoneMatch:C}:{}},{method:"changes.list",params:_?{ifNoneMatch:_.revision}:{}}]));if(O?.ok){const x=he(_,O.result);x&&e.setQueryData(R,x)}else O&&t.source==="local"&&Se(O.error)&&be(e,n);if(!N?.ok)throw N?.error??new Error("no blocks.list");if(!I)throw new Error("no schema.get");const w=N.result,y=dt(I),S=I.ok&&!y?I.result:null;if(w.notModified&&!c||S?.notModified&&!b)return Ot(e,t,n,o,!1);const v=w.notModified?new Set:oo(e,n),A=w.notModified?c:rn(w.blocks,c,v),$=y?an():S?S.notModified?b:S.schema:I.error,E=e.getQueryData(a)?.revision,D=E!==void 0&&E!==g?.revision;if(e.setQueryData(a,{revision:D?E:w.notModified?g?.revision:w.revision,schemaVersion:S?S.notModified?g?.schemaVersion:S.version??void 0:void 0}),e.setQueryData(s,A),!w.notModified){const x=m.contentVersions(o),M=e.getQueryData(x),J={...w.versions};for(const Q of v){const L=M?.[Q];L!==void 0?J[Q]=L:delete J[Q]}e.setQueryData(x,J)}return $ instanceof T||e.setQueryData(i,$),!D&&!w.notModified&&c&&g?.revision&&w.revision!==g.revision&&Xn({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o}),{blocks:A,meta:$}}async function or(e,t,n,o,r,s){return zn({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o},{kind:"edit",write:async()=>{const i=await te(e,t,n,()=>t.client.blocksApply({set:r.set,delete:r.delete,...s?{ifMatch:s}:{}}));e.setQueryData(m.contentRevision(o),c=>({...c,revision:i.revision}));const a=i.versions??{};return Ct(e,o,a),{revision:i.revision,versions:a}}})}async function rr(e,t,n,o,r){await e.invalidateQueries({queryKey:m.decofile(o)});let s;try{const a=(await te(e,t,n,()=>t.client.changesGet({names:[r]}))).entries[r];if(a&&a.after===null&&a.version!==null)return;s={value:a?.after??null,version:a?.version??null}}catch{const i=await te(e,t,n,()=>t.client.blocksList({}));if(i.notModified)return;s={value:i.blocks[r]??null,version:i.versions[r]??null}}e.setQueryData(m.decofile(o),i=>{const a={...i};return s.value===null?delete a[r]:a[r]=s.value,a}),Ct(e,o,{[r]:s.version})}function sr(e){const t=P.c(11),n=K();let o;t[0]!==e?.branch||t[1]!==e?.orgSlug||t[2]!==e?.virtualMcpId?(o=m.protocolDraftRead(e?.orgSlug??"",e?.virtualMcpId??"",e?.branch??""),t[0]=e?.branch,t[1]=e?.orgSlug,t[2]=e?.virtualMcpId,t[3]=o):o=t[3];let r;t[4]!==e||t[5]!==n?(r=async()=>{const c=await fetch(`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`,{cache:"no-store",headers:oe("v8")});if(await Ce(c))throw Ie(n,e.orgSlug,e.virtualMcpId),new ke;if(!c.ok)throw new Error(`draft pointer read failed: ${c.status}`);return await c.json()},t[4]=e,t[5]=n,t[6]=r):r=t[6];const s=!!e;let i;t[7]!==o||t[8]!==r||t[9]!==s?(i={queryKey:o,queryFn:r,enabled:s,staleTime:Number.POSITIVE_INFINITY},t[7]=o,t[8]=r,t[9]=s,t[10]=i):i=t[10];const{data:a}=F(i);return!e||!a?.draft||!a.version?null:`${a.draft}@${a.version}`}function ir(e){const t=P.c(4);let n;t[0]!==e?(n=m.contentRevision(e),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:ro,staleTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=F(o);return r?.revision}async function ro(){throw new Error("content revisions are set by reads and writes")}function Ye(e){const t=`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`;return e.protocolSuffix?`${t}${e.protocolSuffix}`:e.localPreviewUrl?`${t}:local:${e.localPreviewUrl}`:t}function Tt(e,t){const n=P.c(6),{url:o}=ht(e?.virtualMcpId),r=_e(e?.virtualMcpId,e?.branch);if(!e)return"";let s;return n[0]!==r.cacheKeySuffix||n[1]!==r.kind||n[2]!==o||n[3]!==t?.tunnel||n[4]!==e?(s=r.kind==="protocol"?Ye({...e,protocolSuffix:r.cacheKeySuffix}):Ye({...e,localPreviewUrl:t?.tunnel===!1?null:o}),n[0]=r.cacheKeySuffix,n[1]=r.kind,n[2]=o,n[3]=t?.tunnel,n[4]=e,n[5]=s):s=n[5],s}function ar(e,t){const n=P.c(39),{url:o,undecided:r}=ht(e?.virtualMcpId),s=!!o,i=_e(e?.virtualMcpId,e?.branch),a=i.kind==="protocol"?i:null,c=Tt(e),l=t?.fetchEnabled??!0,u=Qn(e?.virtualMcpId),d=ze(e?.virtualMcpId).runtime==="cms",h=K();let b;n[0]!==c?(b=m.decofile(c),n[0]=c,n[1]=b):b=n[1];const g=b;let k;n[2]!==e||n[3]!==h||n[4]!==g?(k=()=>{if(!e||h.isMutating({mutationKey:re(e.orgSlug,e.virtualMcpId,e.branch)})>0)return!0;const v=h.getQueryState(g);return v?.fetchStatus==="fetching"||Date.now()-(v?.dataUpdatedAt??0)<gt/2},n[2]=e,n[3]=h,n[4]=g,n[5]=k):k=n[5];let C;n[6]!==d||n[7]!==s||n[8]!==e||n[9]!==a||n[10]!==h||n[11]!==g?(C=async()=>{if(e){if(!a&&d&&!s){const v=On(h,e)?.version;if(v&&!await Tn(e,v))return}await h.refetchQueries({queryKey:g,exact:!0},{cancelRefetch:!1})}},n[6]=d,n[7]=s,n[8]=e,n[9]=a,n[10]=h,n[11]=g,n[12]=C):C=n[12];let R;n[13]!==k||n[14]!==C?(R={skip:k,read:C},n[13]=k,n[14]=C,n[15]=R):R=n[15],An(!!t?.pollWhile&&!!e,R);let _;n[16]!==i.kind||n[17]!==d||n[18]!==l||n[19]!==c||n[20]!==s||n[21]!==o||n[22]!==u||n[23]!==e||n[24]!==a||n[25]!==h?(_=async()=>{if(a)return(await It(h,a,e,c)).blocks;if(i.kind==="unavailable")throw to("decofile");if(s){const E=await fetch(new URL("/.decofile",o).toString(),{cache:"no-store"}).catch(ao),D=E?.ok?Ke(await E.text()):null;if(D)return D;const x=new Error("decofile unavailable (local tunnel unreachable)");throw x.status=502,x}if(d)return Nn(h,e);const v=()=>Bn(e,En(u,".deco/blocks.gen.json"));if(l){const E=await fetch(Un(e),{cache:"no-store"}).catch(io);if(E?.ok){const M=Ke(await E.text());if(M)return M}const D=await v();if(D.kind==="data")return D.data;const x=new Error(`Failed to fetch decofile: ${E?.status??"network error"}`);throw x.status=Je({liveOk:!!E?.ok,liveStatus:E?.status,committedAbsent:D.kind==="absent"}),x}const A=await v();if(A.kind==="data")return A.data;const $=new Error("decofile unavailable (preview down, no committed snapshot)");throw $.status=Je({liveOk:!1,committedAbsent:A.kind==="absent"}),$},n[16]=i.kind,n[17]=d,n[18]=l,n[19]=c,n[20]=s,n[21]=o,n[22]=u,n[23]=e,n[24]=a,n[25]=h,n[26]=_):_=n[26];const N=!!e&&i.kind!=="pending"&&!r,I=a?0:3e4,O=a?.describe.pollIntervalMs,w=a?"always":void 0;let y;n[27]!==d||n[28]!==s||n[29]!==a?(y=(v,A)=>{if(a||d||s)return v<3;const $=A.status;return $!==502&&$!==404&&v<2},n[27]=d,n[28]=s,n[29]=a,n[30]=y):y=n[30];let S;return n[31]!==g||n[32]!==_||n[33]!==N||n[34]!==I||n[35]!==O||n[36]!==w||n[37]!==y?(S={queryKey:g,queryFn:_,enabled:N,staleTime:I,refetchInterval:O,refetchIntervalInBackground:!1,refetchOnWindowFocus:w,retry:y,retryDelay:so},n[31]=g,n[32]=_,n[33]=N,n[34]=I,n[35]=O,n[36]=w,n[37]=y,n[38]=S):S=n[38],F(S)}function so(e){return Gt(5e3,1e3,e,2,0)}function io(){return null}function ao(){return null}const co="site-editor-save",lo={id:co,description:void 0,action:void 0,cancel:void 0},cr="site-editor-undo",we="site-editor-publish";function uo(e){const t=P.c(7),{label:n,detail:o}=e;let r;t[0]!==n?(r=V.jsx("summary",{className:"cursor-pointer select-none text-muted-foreground",children:n}),t[0]=n,t[1]=r):r=t[1];let s;t[2]!==o?(s=V.jsx("p",{className:"mt-1 whitespace-pre-wrap break-words font-mono text-muted-foreground",children:o}),t[2]=o,t[3]=s):s=t[3];let i;return t[4]!==r||t[5]!==s?(i=V.jsxs("details",{className:"mt-1 text-xs",children:[r,s]}),t[4]=r,t[5]=s,t[6]=i):i=t[6],i}function _t(e,t){return t?V.jsx(uo,{label:e("siteEditor.details"),detail:t}):void 0}function lr(e,t,n){X.error(Vn(e,t,n),{...lo,description:_t(e,Hn(t,n))})}const Nt={action:void 0,duration:void 0};function ur(e,t){X.success(t?e("siteEditor.publish.publishedOn",{host:t}):e("siteEditor.publish.published"),{...Nt,id:we,description:void 0})}function dr(e,{headline:t,body:n,detail:o,retry:r,pending:s,tone:i="error"}){const a=_t(e,o??null);X[i](t,{id:we,description:n&&a?V.jsxs(V.Fragment,{children:[V.jsx("p",{children:n}),a]}):n??a,action:r?{label:e("siteEditor.tryAgain"),onClick:c=>{c.preventDefault(),X.loading(s??e("thread.publishPopover.publishing"),{...Nt,id:we,description:void 0}),r()}}:void 0,duration:r?Number.POSITIVE_INFINITY:void 0})}function fr(e){return e instanceof Error?e.message||null:e==null?null:String(e)}function hr(e){const t=P.c(11),n=K(),{orgSlug:o,virtualMcpId:r,branch:s}=e,i=_e(r,s);let a;t[0]!==s||t[1]!==o||t[2]!==r?(a=s?{orgSlug:o,virtualMcpId:r,branch:s}:null,t[0]=s,t[1]=o,t[2]=r,t[3]=a):a=t[3];const l=Tt(a)||null;let u;return t[4]!==i||t[5]!==s||t[6]!==o||t[7]!==n||t[8]!==l||t[9]!==r?(u={queryClient:n,orgSlug:o,virtualMcpId:r,branch:s,backend:i,cacheKey:l},t[4]=i,t[5]=s,t[6]=o,t[7]=n,t[8]=l,t[9]=r,t[10]=u):u=t[10],u}export{jo as $,Zn as A,zo as B,Tt as C,ir as D,hr as E,kn as F,re as G,zn as H,jn as I,Cn as J,Ne as K,Yo as L,or as M,rr as N,lr as O,In as P,Go as Q,Zo as R,Po as S,at as T,Fo as U,Qo as V,Be as W,Qe as X,Vo as Y,Ao as Z,Fn as _,$o as a,Xt as a0,_t as a1,fr as a2,Co as a3,ko as a4,qt as a5,Ie as a6,ur as a7,Xo as a8,Io as a9,Oo as aa,Se as ab,_o as ac,no as ad,Yt as ae,uo as af,To as ag,It as ah,to as ai,Jo as aj,Bn as ak,Ho as al,sr as am,oe as an,dr as ao,we as ap,Nt as aq,cr as ar,lo as as,nr as at,tr as au,qo as av,en as b,ht as c,zt as d,xo as e,Zt as f,Te as g,ye as h,ot as i,Ko as j,$n as k,ar as l,Lo as m,Bo as n,Qn as o,No as p,En as q,Ro as r,Do as s,ct as t,_e as u,Mo as v,er as w,Uo as x,H as y,Wo as z};
@@ -1 +0,0 @@
1
- import{c as s}from"./index-ifZGovK1.js";import{c as v,w as d}from"./section-preview-url-7zfngvgW.js";import{u as h,al as w,am as P}from"./use-content-sync-D_qyLHCv.js";import{a as b}from"./input-DIcILgWd.js";function g(e){const t=s.c(3),i=b(e?.virtualMcpId).runtime==="cms",r=h(e?.virtualMcpId,e?.branch),n=r.kind==="protocol"&&r.source==="github",o=w(e),u=P(n?e:null);if(!e||!i)return null;if(n)return u;let l;return t[0]!==o||t[1]!==e?(l=o?v({...e,...o}):null,t[0]=o,t[1]=e,t[2]=l):l=t[2],l}function M(e){const t=s.c(11);let i;t[0]!==e?(i=e?{orgSlug:e.orgSlug,virtualMcpId:e.virtualMcpId,branch:e.branch}:null,t[0]=e,t[1]=i):i=t[1];const r=g(i),n=e?.previewServerUrl??null;let o=null;if(n)try{let f;t[2]!==n?(f=new URL(n),t[2]=n,t[3]=f):f=t[3],o=f.host}catch{o=null}let u;t[4]!==r||t[5]!==e||t[6]!==n?(u=e&&n&&r?d(new URL(e.path,n).toString(),r):null,t[4]=r,t[5]=e,t[6]=n,t[7]=u):u=t[7];const l=u;let c;return t[8]!==o||t[9]!==l?(c={url:l,host:o},t[8]=o,t[9]=l,t[10]=c):c=t[10],c}export{g as a,M as u};
@@ -1 +0,0 @@
1
- import{c as Ee,b as He,u as Le,a2 as Oe,fl as Be,fm as Ke,fn as le,fo as de,al as $e,aj as me,fp as qe,fq as Qe,r as Y,dU as We,M as pe,fr as _e,fs as ze}from"./index-ifZGovK1.js";import{a as Ge}from"./use-chat-layout-state-24wCHq_-.js";import{b as Je}from"./agent-icon--EtIPqub.js";import{i as Xe}from"./Monitor01-DQEkUL3d.js";import{u as Ye}from"./use-connection-CBKH8IwL.js";import{a as Ze}from"./use-mcp-client-D1kFCZ4v.js";import{u as et}from"./use-mcp-tools-I-kpM305.js";import{a as tt}from"./repository-binding-DtIeSvDY.js";import{g as at}from"./types-CHFSNT7a.js";import{t as ot}from"./utils-CVEq3hMx.js";import{u as nt,a as F}from"./experiments-tab-choice-CMHPX5ZC.js";import{u as st}from"./index-j4NUsiRT.js";import{F as ue}from"./file-type-icon-DHFVwXjA.js";import{a as it,u as ct}from"./use-panel-navigate-Bghh8kV3.js";import{r as Z}from"./resolve-tab-icon-56O81FJc.js";import{u as rt}from"./use-task-metadata-Dd-9Qkoq.js";import{r as lt}from"./preview-source-BsRLGWUP.js";import{i as dt,r as mt,s as pt}from"./shell-layout-U7D4A6nk.js";import{a as ut}from"./input-DIcILgWd.js";import{u as ft}from"./use-organization-settings-laAOR3Cm.js";import{u as bt}from"./use-project-scope-DH5nL_oD.js";import{b as Tt,u as It,c as vt,d as Pt,f as yt}from"./use-project-native-view-presence-C3Vtd78t.js";import{c as gt}from"./chat-context-DXm8btNS.js";import{r as kt}from"./virtual-mcp-Xd6PvE5_.js";function Xt(o){const e=Ee.c(35),d=He(),{openPanel:b,closePanel:U}=it();let T;e[0]===Symbol.for("react.memo_cache_sentinel")?(T={strict:!1},e[0]=T):T=e[0];const fe=Le(T),ee=ct(),te=Ge(),i=tt(o.virtualMcpId),I=rt(o.taskId),{org:n}=Oe(),{currentBranch:be,activeTask:v}=gt(),m=i?.metadata.ui?.layout??null,c=m?.tabs??[],r=i?.id?Be(i.id):null,P=I?.expanded_tools??[],y=ft(),{scopeId:Te,project:Ie}=bt(),g=Tt(Te,Ie,i),p=It(g.project);nt(g.project?.id);const ae=vt(g.resolvedScopeId,F(g.project?.metadata),p.presence);let k;e[1]===Symbol.for("react.memo_cache_sentinel")?(k={includeVirtual:!0},e[1]=k):k=e[1];const u=Ye(k),ve=st(),x=v?.branch??be;let w;e[2]!==v?.metadata||e[3]!==o.taskId||e[4]!==i?.metadata||e[5]!==I||e[6]!==x?(w=lt({threadId:o.taskId,sandboxBranch:x,agentHasRepo:F(i?.metadata),threadHasRepo:F(I)||F(v?.metadata)}),e[2]=v?.metadata,e[3]=o.taskId,e[4]=i?.metadata,e[5]=I,e[6]=x,e[7]=w):w=e[7];const Pe=w,E=ve.lifecycle.phase==="running",{runtime:ye,resolved:oe}=ut(o.virtualMcpId),H=!!r&&E;let h;e[8]!==H?(h={enabled:H},e[8]=H,e[9]=h):h=e[9];const ne=Ze({connectionId:r,orgId:n.id,orgSlug:n.slug},h),L=ne,O=!!ne&&E;let V;e[10]!==L||e[11]!==O?(V={client:L,enabled:O},e[10]=L,e[11]=O,e[12]=V):V=e[12];const{data:ge}=et(V),se=r&&E?(ge?.tools??[]).filter(Mt).map(t=>({connectionId:r,toolName:t.name,label:ot(t.name),icon:null})):[],B=se[0],ke=B?se:[],f=B&&r?{type:"ext-apps",id:r,toolName:B.toolName}:m?.defaultMainView??null,we=kt(m),ie={assets:p.assetsPending,siteAccess:p.siteAccessPending,releases:p.releasesPending,calendar:p.calendarPending},{activeTab:M,mainOpen:l}=Ke({panelTabId:ee,mainPanelParam:fe.mainpanel,routeDefaultMain:te,metadata:f||m?{defaultMainView:f,tabs:c.map(Vt)}:null}),he=f||m?{defaultMainView:f,tabs:c.map(ht)}:null,C=mt({hasSource:Pe==="repo"||y,runtime:ye,cmsMode:we}),Ve=C.includes("content"),Me=le(he),Ce=f?.type,ce=Pt(Ce,ae,ie,C,oe),K=ce?le(null):Me,Se=yt(M,ae,ie),Ne=!C.includes("code")&&oe&&de(M)!==null,a=!ee&&!te&&ce||M==="content"&&!Ve||Ne||Se?K:M,$=$e(a);let S;e[13]!==d?(S=t=>d(t==="site-editor"?"common.mainPanelTabs.preview":t==="content"?"common.mainPanelTabs.content":"common.mainPanelTabs.code"),e[13]=d,e[14]=S):S=e[14];const je=S,q=new Map;for(const t of P){const s=me(t.appId,t.toolName);q.set(s,{id:s,title:t.toolName,appId:t.appId,iconKey:t.toolName})}for(const t of ke){if(t.toolName==="fetch_assets")continue;const s=me(t.connectionId,t.toolName);q.set(s,{id:s,title:t.label||t.toolName,appId:t.connectionId,iconKey:t.toolName,iconUrl:t.icon??null})}const Q=qe(a),W=Q?Q.key.split("/").pop()??Q.key:null,Ae=W?[{id:a,title:W,kind:"file",icon:{kind:"component",Component:t=>Y.createElement(ue,{filename:W,...t})}}]:[],N=Qe(a),De=N?[{id:a,title:(N.path.split("/").pop()??N.path).replace(/\.html$/i,""),kind:"file",icon:{kind:"component",Component:t=>Y.createElement(N.path.startsWith("pages/")?Je:Xe,t)}}]:[],_=We(a),z=_?_.path.split("/").pop()??_.path:null,Re=z?[{id:a,title:z,kind:"file",icon:{kind:"component",Component:t=>Y.createElement(ue,{filename:z,...t})}}]:[],Fe=dt(a)?C.map(t=>({id:t==="code"&&de(a)?a:t,title:je(t),kind:"system",icon:Z({tabId:t,kind:"system",connections:u})})):[];let j;e[15]!==u?(j=t=>({id:_e(t.id),title:t.title,kind:"agent",icon:Z({tabId:t.id,kind:"agent",appId:t.view.appId,connections:u})}),e[15]=u,e[16]=j):j=e[16];const Ue=[...Fe,...Ae,...De,...Re,...c.map(j),...Array.from(q.values()).map(t=>({id:t.id,title:t.title,kind:"expanded",icon:Z({tabId:t.iconKey,kind:"expanded",appId:t.appId,iconUrl:t.iconUrl,connections:u})}))],re=new Set,G=Ue.filter(t=>re.has(t.id)?!1:(re.add(t.id),!0)),xe=o.virtualMcpId;let A;e[17]!==n.id?(A=pe(n.id),e[17]=n.id,e[18]=A):A=e[18];const J=xe===A;let D;e[19]!==a||e[20]!==U||e[21]!==l||e[22]!==J||e[23]!==b||e[24]!==n.id||e[25]!==y?(D=t=>{if(pt({reportsOnly:y,onReportAgent:J,tabId:t})){b(t,{virtualmcpid:pe(n.id),search:wt});return}const s=ze({clickedId:t,activeTab:a,mainOpen:l});"close"in s?U():b(s.tabId)},e[19]=a,e[20]=U,e[21]=l,e[22]=J,e[23]=b,e[24]=n.id,e[25]=y,e[26]=D):D=e[26];const X=D;let R;return e[27]!==a||e[28]!==$||e[29]!==P||e[30]!==c||e[31]!==l||e[32]!==X||e[33]!==G?(R={activeTab:a,mainOpen:l,setActiveTab:X,layoutTabs:c,expandedTools:P,automationTabParsed:$,tabs:G},e[27]=a,e[28]=$,e[29]=P,e[30]=c,e[31]=l,e[32]=X,e[33]=G,e[34]=R):R=e[34],R}function wt(o){return{...o,thread:void 0}}function ht(o){return{id:o.id}}function Vt(o){return{id:o.id}}function Mt(o){return!!at(o._meta)}export{Xt as u};
@@ -1 +0,0 @@
1
- import{c as I,o as N,e as U,K as R}from"./index-ifZGovK1.js";import{a as A}from"./input-DIcILgWd.js";import{o as G,c as L,u as z,C as H,F as Y,Q as $,P as V,q as T,J as W,G as X,M as Z,H as ee}from"./use-content-sync-D_qyLHCv.js";import{s as te}from"./sandbox-git-api-CH_-QFpD.js";import{u as oe}from"./chat-context-DXm8btNS.js";import{b as _}from"./sandbox-url-D3mC8qhT.js";import{d as B}from"./utils-CduIoZ0d.js";import{Q as se}from"./parse-sections-YhOUxu7l.js";function ye(O){const e=I.c(50),{orgSlug:s,virtualMcpId:t,branch:o}=O,r=N(),P=oe()?.taskId??null,g=G(t),E=A(t).runtime==="cms",{url:x}=L(t),k=z(t,o),w=k.kind==="protocol"?k:null;let b;e[0]!==o||e[1]!==s||e[2]!==t?(b={orgSlug:s,virtualMcpId:t,branch:o},e[0]=o,e[1]=s,e[2]=t,e[3]=b):b=e[3];const u=H(b);let v;e[4]!==u?(v=R.decofile(u),e[4]=u,e[5]=v):v=e[5];const d=v;let S;e[6]!==o||e[7]!==E||e[8]!==x||e[9]!==s||e[10]!==g||e[11]!==r||e[12]!==P||e[13]!==t?(S=async(c,f)=>{if(x)return{ok:!0};if(E){const n=await $({orgSlug:s,virtualMcpId:t,branch:o},{set:c,delete:f});return V(r,{orgSlug:s,virtualMcpId:t,branch:o},n),await r.invalidateQueries({queryKey:te({orgSlug:s,virtualMcpId:t,branch:o,threadId:P})}),n}const l={orgSlug:s,virtualMcpId:t,branch:o,threadId:P};for(const[n,i]of Object.entries(c)){const C=await fetch(_(l,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:T(g,B(n)),content:JSON.stringify(i,null,2)})});if(!C.ok)return W(C,"Write")}for(const n of f){const i=await fetch(_(l,"unlink"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:T(g,B(n))})});if(!i.ok)return W(i,"Delete")}return{ok:!0}},e[6]=o,e[7]=E,e[8]=x,e[9]=s,e[10]=g,e[11]=r,e[12]=P,e[13]=t,e[14]=S):S=e[14];const q=S;let y;e[15]!==o||e[16]!==s||e[17]!==t?(y=X(s,t,o),e[15]=o,e[16]=s,e[17]=t,e[18]=y):y=e[18];let p;e[19]!==o||e[20]!==s||e[21]!==t?(p=Y(s,t,o),e[19]=o,e[20]=s,e[21]=t,e[22]=p):p=e[22];let m;e[23]!==k||e[24]!==o||e[25]!==u||e[26]!==q||e[27]!==s||e[28]!==w||e[29]!==r||e[30]!==t?(m=async c=>{const{writes:f,deletes:l}=c,n=se(f);return w?Z(r,w,{orgSlug:s,virtualMcpId:t,branch:o},u,{set:n,delete:l.filter(i=>!(i in n))}):ee({queryClient:r,orgSlug:s,virtualMcpId:t,branch:o,backend:k,cacheKey:u},{kind:"edit",write:()=>q(n,l)})},e[23]=k,e[24]=o,e[25]=u,e[26]=q,e[27]=s,e[28]=w,e[29]=r,e[30]=t,e[31]=m):m=e[31];let h;e[32]!==o||e[33]!==s||e[34]!==r||e[35]!==t?(h=()=>{r.invalidateQueries({queryKey:R.liveMeta(s,t,o)})},e[32]=o,e[33]=s,e[34]=r,e[35]=t,e[36]=h):h=e[36];let K;e[37]!==y||e[38]!==p||e[39]!==m||e[40]!==h?(K={mutationKey:y,scope:p,mutationFn:m,onSuccess:h},e[37]=y,e[38]=p,e[39]=m,e[40]=h,e[41]=K):K=e[41];const a=U(K);let Q;e[42]!==a||e[43]!==r||e[44]!==d?(Q=async c=>{const f=[...Object.keys(c.writes),...c.deletes],l=r.getQueryData(d),n=new Map;for(const i of f)l&&i in l&&n.set(i,l[i]);r.setQueryData(d,i=>re(i,c)),r.cancelQueries({queryKey:d});try{return await a.mutateAsync(c)}catch(i){const C=i;throw r.setQueryData(d,F=>{if(!F)return F;const J={...F};for(const M of f)n.has(M)?J[M]=n.get(M):delete J[M];return J}),C}},e[42]=a,e[43]=r,e[44]=d,e[45]=Q):Q=e[45];const j=Q;let D;return e[46]!==j||e[47]!==a.isError||e[48]!==a.isPending?(D={move:j,isPending:a.isPending,isError:a.isError},e[46]=j,e[47]=a.isError,e[48]=a.isPending,e[49]=D):D=e[49],D}function re(O,{writes:e,deletes:s}){const t={...O??{},...e};for(const o of s)o in e||delete t[o];return t}export{re as a,ye as u};