decocms 4.574.0 → 4.574.2

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 (454) hide show
  1. package/dist/client/assets/{AlertCircle-Co3RPbIZ.js → AlertCircle-Dsv0Pm7s.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BvS2pAoE.js → AreaChart-95ER28GX.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-XBSBGQal.js → ArrowLeft-DC6oDquu.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-DLnkUu9S.js → ArrowUp-Bzd2Ao8X.js} +1 -1
  5. package/dist/client/assets/{CartesianChart-DOb1QHVF.js → CartesianChart-Di9WWG1m.js} +1 -1
  6. package/dist/client/assets/{CategoricalChart-BkeCXQf9.js → CategoricalChart-MTqEhHpE.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-kNwBDDVU.js → CheckCircle-KwhMDKnL.js} +1 -1
  8. package/dist/client/assets/{ChevronSelectorVertical-Gg7YcxlH.js → ChevronSelectorVertical-BLvA03ay.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-D1T3kSyr.js → ChevronUp-Y1FAoMvo.js} +1 -1
  10. package/dist/client/assets/{CreditCard01-D65BAIaV.js → CreditCard01-CQULtRjU.js} +1 -1
  11. package/dist/client/assets/{Globe04-D17A2x5l.js → Globe04-rzoBWb4k.js} +1 -1
  12. package/dist/client/assets/{Key01-awxHKnoL.js → Key01-Bb5nsuN9.js} +1 -1
  13. package/dist/client/assets/{LinkBroken01-loTkm0G5.js → LinkBroken01-BVPolLms.js} +1 -1
  14. package/dist/client/assets/{Minus-CYrsmoRb.js → Minus-D6gZIhdS.js} +1 -1
  15. package/dist/client/assets/{Monitor01-DalIAdj7.js → Monitor01-DZ-eNTiS.js} +1 -1
  16. package/dist/client/assets/{Play-C6Weq-wk.js → Play-_1vdxnt7.js} +1 -1
  17. package/dist/client/assets/{Plus-D7X8Q2-q.js → Plus-D2mU8Z2n.js} +1 -1
  18. package/dist/client/assets/ReferenceLine-BCQS5W1q.js +1 -0
  19. package/dist/client/assets/{SearchMd-e6xPeRPD.js → SearchMd-C9gFyKp3.js} +1 -1
  20. package/dist/client/assets/{ShoppingBag01-zloi0TDl.js → ShoppingBag01-B9vYetgm.js} +1 -1
  21. package/dist/client/assets/{Sun-C1lyqton.js → Sun-iCrIMYKz.js} +1 -1
  22. package/dist/client/assets/{SwitchHorizontal01-elXb4-4d.js → SwitchHorizontal01-DaQ0HYDj.js} +1 -1
  23. package/dist/client/assets/{Tool01-Bo2g-Ylw.js → Tool01-CccYPLip.js} +1 -1
  24. package/dist/client/assets/{Tooltip-C2g-R1Ae.js → Tooltip-CkoKLPSM.js} +1 -1
  25. package/dist/client/assets/{Trash01-C-PU5Hm-.js → Trash01-D_C1VqRW.js} +1 -1
  26. package/dist/client/assets/{Upload01-NPnXKs-J.js → Upload01-BZ-jVH9c.js} +1 -1
  27. package/dist/client/assets/{UserSquare-Qd-FKVqK.js → UserSquare-C9oDVw7K.js} +1 -1
  28. package/dist/client/assets/{Users01-CTNixqdX.js → Users01-OVHBqKY2.js} +1 -1
  29. package/dist/client/assets/{XClose-BuJ6u6eL.js → XClose-Da3uoLbc.js} +1 -1
  30. package/dist/client/assets/{Zap-pmN7zSOE.js → Zap-DiAA9TDt.js} +1 -1
  31. package/dist/client/assets/{access-gate-Bj4L1Bay.js → access-gate-CvU5rNDs.js} +1 -1
  32. package/dist/client/assets/{add-connection-dialog-BL3Uj9Py.js → add-connection-dialog-Bqm-kjDm.js} +1 -1
  33. package/dist/client/assets/agent-app-IUm2KpOg.js +1 -0
  34. package/dist/client/assets/agent-assets-Bmtr4HF2.js +1 -0
  35. package/dist/client/assets/{agent-automation-Bea1eB6T.js → agent-automation-C6civuP9.js} +3 -3
  36. package/dist/client/assets/agent-automations-C6CY4grg.js +1 -0
  37. package/dist/client/assets/agent-calendar-YxSaCaoL.js +1 -0
  38. package/dist/client/assets/{agent-capabilities-BGShibnD.js → agent-capabilities-C_Lwc_1S.js} +1 -1
  39. package/dist/client/assets/agent-connect-sources-1U261aQC.js +1 -0
  40. package/dist/client/assets/agent-deck-C-UqR39d.js +1 -0
  41. package/dist/client/assets/agent-e2e-Dql2lNy5.js +1 -0
  42. package/dist/client/assets/agent-experiments-BsakXkAT.js +1 -0
  43. package/dist/client/assets/agent-file-D77xFc1M.js +1 -0
  44. package/dist/client/assets/agent-hosting-DLt4n1PP.js +1 -0
  45. package/dist/client/assets/{agent-icon-CTbTFMnU.js → agent-icon-fpNscOF6.js} +1 -1
  46. package/dist/client/assets/agent-library-7De1njyb.js +1 -0
  47. package/dist/client/assets/agent-library-file-D1B9oEMJ.js +1 -0
  48. package/dist/client/assets/agent-overview-CDZkDDXd.js +1 -0
  49. package/dist/client/assets/agent-releases-CG7qGUka.js +2 -0
  50. package/dist/client/assets/agent-settings-CxavGzlw.js +1 -0
  51. package/dist/client/assets/{agent-site-editor-D_QBdAc9.js → agent-site-editor-CnI16zyl.js} +2 -2
  52. package/dist/client/assets/agent-site-editor-code-CWXYLbKh.js +2 -0
  53. package/dist/client/assets/agent-site-editor-content-Beagub1U.js +1 -0
  54. package/dist/client/assets/agent-site-editor-preview-BYJqSKvW.js +1 -0
  55. package/dist/client/assets/agent-view-CyHHS-97.js +1 -0
  56. package/dist/client/assets/{agent-view-guard-CL3qLzE2.js → agent-view-guard-BZmhkikC.js} +1 -1
  57. package/dist/client/assets/ai-providers-CLGdcvZQ.js +1 -0
  58. package/dist/client/assets/{alert-wYcDlQSf.js → alert-DAw-__lY.js} +1 -1
  59. package/dist/client/assets/{analytics-sections-BjzpdbBT.js → analytics-sections-DrzSo9a2.js} +1 -1
  60. package/dist/client/assets/{api-keys-am7hNPgd.js → api-keys-CfXSAJt6.js} +1 -1
  61. package/dist/client/assets/api-keys-DVRf3Hvj.js +1 -0
  62. package/dist/client/assets/app-editor-B1ZDazOl.js +1 -0
  63. package/dist/client/assets/{asset-utils-C5mv1eiH.js → asset-utils-B40iBSyV.js} +1 -1
  64. package/dist/client/assets/{auth-CQxDIkM-.js → auth-YdxCJvaF.js} +1 -1
  65. package/dist/client/assets/{auth-catchall-DX0dhfK_.js → auth-catchall-BtKIWVeb.js} +1 -1
  66. package/dist/client/assets/auth-entry-BWEVf3TW.js +1 -0
  67. package/dist/client/assets/{auth-split-layout-BRZioxOZ.js → auth-split-layout-zPoWOH18.js} +1 -1
  68. package/dist/client/assets/{authenticate-and-persist-oauth-o7XKLq_6.js → authenticate-and-persist-oauth-DfBwldFd.js} +1 -1
  69. package/dist/client/assets/{automation-list-row-knBDKeRb.js → automation-list-row-BRtY1m0_.js} +1 -1
  70. package/dist/client/assets/automation-runs-B5ZMOQnQ.js +1 -0
  71. package/dist/client/assets/automations-CVIWSKb4.js +1 -0
  72. package/dist/client/assets/{autosend-B0POegpm.js → autosend-DFTTUav1.js} +1 -1
  73. package/dist/client/assets/backoff-CrEUbyZT.js +1 -0
  74. package/dist/client/assets/{badge-BpzeYR5Z.js → badge-DVtxjBdD.js} +1 -1
  75. package/dist/client/assets/{block-document-DIhkVhEf.js → block-document-DP3zwvIZ.js} +1 -1
  76. package/dist/client/assets/{blocks-preview-workspace-context-BnkXYZX_.js → blocks-preview-workspace-context-CdC5NkHg.js} +1 -1
  77. package/dist/client/assets/blocks-tab-states-_rbufLt5.js +1 -0
  78. package/dist/client/assets/{blog-schema-BdMdKJFM.js → blog-schema-CPvfhGuY.js} +1 -1
  79. package/dist/client/assets/{buckets-C62arTZK.js → buckets-CCBSdGb8.js} +1 -1
  80. package/dist/client/assets/{build-improve-prompt-doc-DNVGwsoG.js → build-improve-prompt-doc-9_1xFJrp.js} +1 -1
  81. package/dist/client/assets/{calendar-SB5YBzj8.js → calendar-ke1Ak3Bz.js} +1 -1
  82. package/dist/client/assets/{capability-load-error-BkOUGX51.js → capability-load-error-DqZ2bjfY.js} +1 -1
  83. package/dist/client/assets/category-editor-CyGTDdXW.js +1 -0
  84. package/dist/client/assets/{chart-D-gatwT8.js → chart-Ds4Pjzvz.js} +1 -1
  85. package/dist/client/assets/{chat-context-PvP_Q1CV.js → chat-context-B2EDKfd0.js} +6 -6
  86. package/dist/client/assets/{chat-draft-C714j1Wd.js → chat-draft-Cnwq9hv5.js} +1 -1
  87. package/dist/client/assets/{checkbox-Bk98t4UK.js → checkbox-BhpA9Zt5.js} +1 -1
  88. package/dist/client/assets/{choose-editor-DmqmkbHo.js → choose-editor-B_GNzjsr.js} +1 -1
  89. package/dist/client/assets/{cli-auth-success-D4NODEkN.js → cli-auth-success-Q64N46VB.js} +1 -1
  90. package/dist/client/assets/{client-icons-WHlOXnmn.js → client-icons-CZasH4i0.js} +1 -1
  91. package/dist/client/assets/cms-settings-editor-CpYk69qY.js +1 -0
  92. package/dist/client/assets/cms-store-drafts-CzBlkLn7.js +1 -0
  93. package/dist/client/assets/{collapsible-C7N88_dp.js → collapsible-6K3nmqYF.js} +1 -1
  94. package/dist/client/assets/collection-detail-D6UJgDkz.js +1 -0
  95. package/dist/client/assets/{collection-display-button-Dl9vfdLR.js → collection-display-button-2dgErWqj.js} +1 -1
  96. package/dist/client/assets/{collection-search-Din8SB5Y.js → collection-search-0yFYtboh.js} +1 -1
  97. package/dist/client/assets/{collection-table-wrapper-BYDcFi4z.js → collection-table-wrapper-CfYO1W9r.js} +1 -1
  98. package/dist/client/assets/{collection-tabs-BJDa_4_F.js → collection-tabs-B_dqQpZz.js} +1 -1
  99. package/dist/client/assets/{combobox-CVchGkTE.js → combobox-DXIGIOUU.js} +1 -1
  100. package/dist/client/assets/{command-DA2t4jTW.js → command-Qn4l80Q0.js} +1 -1
  101. package/dist/client/assets/{companion-mcps-section-BKP3xr1j.js → companion-mcps-section-DlKI0NIv.js} +1 -1
  102. package/dist/client/assets/{config-B1mE6oOL.js → config-CCuT0uDx.js} +1 -1
  103. package/dist/client/assets/{connect-CAAYdS8d.js → connect-D-ehpKrE.js} +3 -3
  104. package/dist/client/assets/{connect-layout-DUesEwTl.js → connect-layout-BpafQvyr.js} +1 -1
  105. package/dist/client/assets/{connect-source-dialog-DQtWLoYH.js → connect-source-dialog-D-ZZcunb.js} +1 -1
  106. package/dist/client/assets/{connection-giFDA0-u.js → connection-MdFsEog3.js} +1 -1
  107. package/dist/client/assets/{connection-card-CPhS4jEh.js → connection-card-CqP5nP-l.js} +1 -1
  108. package/dist/client/assets/connection-detail-0H8YGOD_.js +1 -0
  109. package/dist/client/assets/{connection-form-helpers-CRMRmqMW.js → connection-form-helpers-D6t-A2OG.js} +1 -1
  110. package/dist/client/assets/{connection-slug-DTdYIX0A.js → connection-slug-CXZXa0Pm.js} +1 -1
  111. package/dist/client/assets/connections-CCgX0Mn1.js +1 -0
  112. package/dist/client/assets/content-tab-D-2gB1id.js +25 -0
  113. package/dist/client/assets/context-CX2ucy08.js +1 -0
  114. package/dist/client/assets/{context-menu-CsBFFEsr.js → context-menu-Chf64Vse.js} +1 -1
  115. package/dist/client/assets/{context-shell-l0daBgQ1.js → context-shell-DdzUU76d.js} +3 -3
  116. package/dist/client/assets/{core.esm-tIHbtjKb.js → core.esm-B8dY25VW.js} +1 -1
  117. package/dist/client/assets/{create-organization-dialog-Dy6I2vcX.js → create-organization-dialog-D0CBCM81.js} +1 -1
  118. package/dist/client/assets/{device-hint-DslC2w9a.js → device-hint-BS_JePIJ.js} +1 -1
  119. package/dist/client/assets/discover-Q3RTxZJc.js +1 -0
  120. package/dist/client/assets/{domain-settings-Dq_m7HYl.js → domain-settings-CEBgufdo.js} +1 -1
  121. package/dist/client/assets/{drawer-BYGTIOoj.js → drawer-ByMrQGCj.js} +1 -1
  122. package/dist/client/assets/{editor-x1lgFdfy.js → editor-DbiHNhC6.js} +1 -1
  123. package/dist/client/assets/{editor-classes-LFKjNX_0.js → editor-classes-BRpqmI9G.js} +1 -1
  124. package/dist/client/assets/{empty-state-CH3GYanB.js → empty-state-1M1xIReA.js} +1 -1
  125. package/dist/client/assets/{empty-state-CtwVPMDf.js → empty-state-B2Xx-qz8.js} +1 -1
  126. package/dist/client/assets/{experiments-tab-choice-DMVM7f3S.js → experiments-tab-choice-BfWXh4-6.js} +1 -1
  127. package/dist/client/assets/{extract-connection-data-hvaA6rrK.js → extract-connection-data-c-FfSGKP.js} +1 -1
  128. package/dist/client/assets/{feature-gate-ru6FBLZU.js → feature-gate-7QGuZ_p6.js} +1 -1
  129. package/dist/client/assets/{feature-paywall-eifo7eqe.js → feature-paywall-wC8Tk38N.js} +1 -1
  130. package/dist/client/assets/file-explorer-By8BSXLx.js +2 -0
  131. package/dist/client/assets/{file-preview-BzUEEwEK.js → file-preview-D07TFZkO.js} +1 -1
  132. package/dist/client/assets/{file-share-button-CFBrVPAQ.js → file-share-button-BdFb2LyH.js} +1 -1
  133. package/dist/client/assets/{file-type-icon-DM9o0Fkb.js → file-type-icon-CfqErjlt.js} +1 -1
  134. package/dist/client/assets/{folder-icon-DSGoR_x6.js → folder-icon-CnYX4FK9.js} +1 -1
  135. package/dist/client/assets/{form-gd_hA5VT.js → form-Bc9t1169.js} +1 -1
  136. package/dist/client/assets/{general-Cn8XvemK.js → general-BVPcfnq3.js} +1 -1
  137. package/dist/client/assets/{github-icon-BVy-v7gH.js → github-icon-BiTVYb1o.js} +1 -1
  138. package/dist/client/assets/home-eLi6OoUj.js +1 -0
  139. package/dist/client/assets/{home-overview-DZBjDQoG.js → home-overview-BUsdsaOd.js} +1 -1
  140. package/dist/client/assets/hosted-reconcile-BT0WLx4L.js +1 -0
  141. package/dist/client/assets/{icon-button-Ze0c1pwp.js → icon-button-CSoRzxTc.js} +1 -1
  142. package/dist/client/assets/{index-DkhsKOTp.js → index-B0d5IX7p.js} +1 -1
  143. package/dist/client/assets/{index-D5i1_B2b.js → index-B2ATqkba.js} +1 -1
  144. package/dist/client/assets/{index-CQQpem-0.js → index-B3GwxC-v.js} +1 -1
  145. package/dist/client/assets/{index-C3XZ4Hr3.js → index-BPidavr8.js} +2 -2
  146. package/dist/client/assets/index-BXwlvRia.js +1 -0
  147. package/dist/client/assets/{index-CnOVjrIG.js → index-CGixVPRT.js} +1 -1
  148. package/dist/client/assets/{index-D8y5KFA4.js → index-CO7mElbh.js} +1 -1
  149. package/dist/client/assets/{index-DsbWutG1.js → index-CQBW64pa.js} +1 -1
  150. package/dist/client/assets/{index-B-T__H4R.js → index-CqK_0oof.js} +1 -1
  151. package/dist/client/assets/index-CwOTOkx0.js +4 -0
  152. package/dist/client/assets/{index-Kbjjvu85.js → index-CyFvlIli.js} +1 -1
  153. package/dist/client/assets/{index-DYgzDE_k.js → index-D32ePzu5.js} +1 -1
  154. package/dist/client/assets/{index-Bgxp_wDH.js → index-DB_N5huE.js} +2 -2
  155. package/dist/client/assets/index-DZ-V47-f.js +1 -0
  156. package/dist/client/assets/{index-_l1iac4T.js → index-OfhDS9IV.js} +1 -1
  157. package/dist/client/assets/{index-DEZ1imMJ.js → index-TS-yYM5l.js} +60 -62
  158. package/dist/client/assets/{index-redirect-BbZ_bzp6.js → index-redirect-DjmOPNwc.js} +1 -1
  159. package/dist/client/assets/{infiniteQueryObserver-C0Gb02df.js → infiniteQueryObserver-WKs1x3sX.js} +1 -1
  160. package/dist/client/assets/{infra-billing-BCVZN9OG.js → infra-billing-CFNDWf4P.js} +1 -1
  161. package/dist/client/assets/{input-CxHdmxHa.js → input-CdXEPNdQ.js} +1 -1
  162. package/dist/client/assets/{input-Dla4T1vA.js → input-DyBvRhWH.js} +4 -4
  163. package/dist/client/assets/{integration-icon-CFHOt7sY.js → integration-icon-C1m4mYos.js} +1 -1
  164. package/dist/client/assets/{jira-icon-_AEc9Yhw.js → jira-icon-CMYyaK6V.js} +1 -1
  165. package/dist/client/assets/{label-BEWDSeNl.js → label-m0qEFNz_.js} +1 -1
  166. package/dist/client/assets/{layout--y8zVnrP.js → layout-BX8RFi7-.js} +1 -1
  167. package/dist/client/assets/{legacy-admin-welcome-dialog-B223MrIf.js → legacy-admin-welcome-dialog-DN17L0bp.js} +1 -1
  168. package/dist/client/assets/{legacy-agents-deep-PO1FuZ04.js → legacy-agents-deep-BcXalumx.js} +1 -1
  169. package/dist/client/assets/{legacy-main-redirect-CLP7AoCb.js → legacy-main-redirect-BCzdn0gq.js} +1 -1
  170. package/dist/client/assets/library-DcxuVcYO.js +1 -0
  171. package/dist/client/assets/{library-tab-CqMcp5u0.js → library-tab-BULbmul7.js} +3 -3
  172. package/dist/client/assets/login-DuBqEvlt.js +1 -0
  173. package/dist/client/assets/{markdown-Db8a3LUX.js → markdown-BhvgGYnB.js} +1 -1
  174. package/dist/client/assets/{mcp-app-renderer-C8G6NLBz.js → mcp-app-renderer-BqfGxyCp.js} +2 -2
  175. package/dist/client/assets/{mcp-oauth-BBT3ip6Z.js → mcp-oauth-CMSqwlrD.js} +1 -1
  176. package/dist/client/assets/{mcp-oauth-CHmbtYyN.js → mcp-oauth-e50-7TO3.js} +1 -1
  177. package/dist/client/assets/{members-CF1S2ayK.js → members-PID9JnSj.js} +1 -1
  178. package/dist/client/assets/{memory-Bk61fr1m.js → memory-DmcNjOPo.js} +2 -2
  179. package/dist/client/assets/{mock-board-CYJBKLD5.js → mock-board-B978Fi_L.js} +3 -3
  180. package/dist/client/assets/{monaco-editor-DTwBEUg_.js → monaco-editor-QEAl_YP0.js} +1 -1
  181. package/dist/client/assets/{monitoring-Cqe9DCsk.js → monitoring-CG9_f7tP.js} +2 -2
  182. package/dist/client/assets/{monitoring-stats-row-GkTmJnnE.js → monitoring-stats-row-DkmRJOMv.js} +1 -1
  183. package/dist/client/assets/{multi-select-GRYee_BH.js → multi-select-CCT7Bz1w.js} +1 -1
  184. package/dist/client/assets/mustache-BFCk1BQA.js +4 -0
  185. package/dist/client/assets/{named-rule-view-BNwXQD8T.js → named-rule-view-DVMS0joL.js} +1 -1
  186. package/dist/client/assets/{new-project-dialog-Dfe2Pik9.js → new-project-dialog-D_RX0j41.js} +1 -1
  187. package/dist/client/assets/{oauth-callback-C9LKZChW.js → oauth-callback-DbUe0i-L.js} +1 -1
  188. package/dist/client/assets/{oauth-callback-ai-provider-C7LWQiJX.js → oauth-callback-ai-provider-B2RZlSqp.js} +1 -1
  189. package/dist/client/assets/oauth-consent-YLARk84v.js +1 -0
  190. package/dist/client/assets/{onboarding-xP-6CuuS.js → onboarding-DPtycHlA.js} +1 -1
  191. package/dist/client/assets/openai-conversation-C_8JqtFQ.js +3 -0
  192. package/dist/client/assets/{optimistic-project-sidebar-views-BcV4r24I.js → optimistic-project-sidebar-views-CBY386aw.js} +1 -1
  193. package/dist/client/assets/{order-monitor-day-BrCrwZlv.js → order-monitor-day-Zfh7Djae.js} +1 -1
  194. package/dist/client/assets/{organization-choice-Bb3OozNa.js → organization-choice-BViy1VJZ.js} +1 -1
  195. package/dist/client/assets/{orgs-BwWx4Gpo.js → orgs-DgJWnYOv.js} +1 -1
  196. package/dist/client/assets/{own-accounts-section-CL57nUX5.js → own-accounts-section-PwhGIEcx.js} +1 -1
  197. package/dist/client/assets/{pair-D5JEvK2M.js → pair-CMFzBcLY.js} +7 -7
  198. package/dist/client/assets/parse-sections-QRK0oKJq.js +20 -0
  199. package/dist/client/assets/{plan-ladder-DdqVPKf9.js → plan-ladder-B6NZgvyc.js} +1 -1
  200. package/dist/client/assets/plan-mQ3ovGAw.js +1 -0
  201. package/dist/client/assets/{plan-usage-card-397aTXRB.js → plan-usage-card-DlHRL8yC.js} +2 -2
  202. package/dist/client/assets/{popover-DsvzKyw_.js → popover-C8mcckmD.js} +1 -1
  203. package/dist/client/assets/post-calendar-C3cuisYq.js +1 -0
  204. package/dist/client/assets/post-editor-uAKG4LOK.js +2 -0
  205. package/dist/client/assets/{preview-content-Bs_qZ8yA.js → preview-content-DRPWOt_Y.js} +1 -1
  206. package/dist/client/assets/{preview-dialog-Bn3JJkpc.js → preview-dialog-BMcYcLLg.js} +1 -1
  207. package/dist/client/assets/{preview-panel-CX3l3cru.js → preview-panel-CwmwTZP_.js} +1 -1
  208. package/dist/client/assets/preview-tab-BFBvaAOI.js +551 -0
  209. package/dist/client/assets/{product-picker-dialog-DRJETx9Q.js → product-picker-dialog-C9EfVu8K.js} +1 -1
  210. package/dist/client/assets/{profile-BlRaDfot.js → profile-fN54emCr.js} +1 -1
  211. package/dist/client/assets/project-app-view-CvgHwWqj.js +1 -0
  212. package/dist/client/assets/{project-apps-B_xWF85u.js → project-apps-DmwQAngc.js} +1 -1
  213. package/dist/client/assets/{project-icon-rrJh6PJx.js → project-icon-7Ukip0ow.js} +1 -1
  214. package/dist/client/assets/{project-index-CoA3rtsT.js → project-index-OpjM2-1A.js} +1 -1
  215. package/dist/client/assets/project-reports-S-u-m-ku.js +1 -0
  216. package/dist/client/assets/project-tasks-DGVgztix.js +1 -0
  217. package/dist/client/assets/projects-BAI422dC.js +1 -0
  218. package/dist/client/assets/{projects-empty-state-llpcLXG9.js → projects-empty-state-DF0H_C2x.js} +1 -1
  219. package/dist/client/assets/{prompts-B0OAMamK.js → prompts-DcHb5gpa.js} +1 -1
  220. package/dist/client/assets/record-editor-BeJ8zVUP.js +1 -0
  221. package/dist/client/assets/redirect-editor-CC7-nKfT.js +1 -0
  222. package/dist/client/assets/{reports-Rgui-AzR.js → reports-SBiZlPun.js} +2 -2
  223. package/dist/client/assets/reports-onboarding-D1I0HeLn.js +1 -0
  224. package/dist/client/assets/reports-rQeWRtoE.js +1 -0
  225. package/dist/client/assets/reports-tab-7FbE26yX.js +2 -0
  226. package/dist/client/assets/repositories-D2zAp7y8.js +1 -0
  227. package/dist/client/assets/{repositories-OwZ7bC1j.js → repositories-DDgRn0D8.js} +1 -1
  228. package/dist/client/assets/{repository-binding-C0msapZZ.js → repository-binding-CR1iQGNu.js} +1 -1
  229. package/dist/client/assets/{repository-picker-BYFeDBpn.js → repository-picker-JI0-E7UT.js} +1 -1
  230. package/dist/client/assets/{require-capability-cQiPB2TO.js → require-capability-BAmRubpC.js} +1 -1
  231. package/dist/client/assets/{required-auth-layout-DfUx9vzb.js → required-auth-layout-BbY_gAQy.js} +1 -1
  232. package/dist/client/assets/{reset-password-CwNbLDfo.js → reset-password-umkV6OxE.js} +1 -1
  233. package/dist/client/assets/{resizable-CHI5UJHW.js → resizable-2meo0Add.js} +1 -1
  234. package/dist/client/assets/{resolve-tab-icon-BWeUUKzK.js → resolve-tab-icon-BGKUhiW_.js} +1 -1
  235. package/dist/client/assets/review-settings-BdG8I4Qi.js +1 -0
  236. package/dist/client/assets/{role-color-DlPdNUQM.js → role-color-Dkb8qNks.js} +1 -1
  237. package/dist/client/assets/{roles-ChXNdo9W.js → roles-DD-esArE.js} +1 -1
  238. package/dist/client/assets/route-B8RNcjxF.js +1 -0
  239. package/dist/client/assets/route-BKPxA69M.js +1 -0
  240. package/dist/client/assets/route-elVtkb_Z.js +1 -0
  241. package/dist/client/assets/sandbox-lifecycle-context-SakLBaZg.js +1 -0
  242. package/dist/client/assets/{schema-BFmIytlm.js → schema-B2Ckyd85.js} +1 -1
  243. package/dist/client/assets/{schema-9jBUPMLq.js → schema-D-flJgcm.js} +1 -1
  244. package/dist/client/assets/{scroll-area-CQ_g6hBm.js → scroll-area-CrLKF3Ch.js} +1 -1
  245. package/dist/client/assets/{search-input-Co3g-t6C.js → search-input-DqhPHff2.js} +1 -1
  246. package/dist/client/assets/{search-toggle-CO5TN956.js → search-toggle-BBmFL4F1.js} +1 -1
  247. package/dist/client/assets/{secret-picker-VlsiGxPi.js → secret-picker-DBQ4JaQs.js} +1 -1
  248. package/dist/client/assets/{secrets-DJboETC0.js → secrets-DbRrxggV.js} +1 -1
  249. package/dist/client/assets/{section-array-field-CvmfLv3q.js → section-array-field-DzEUxPRk.js} +1 -1
  250. package/dist/client/assets/{sections-C_Jmzzpn.js → sections-D6lSA2Zp.js} +1 -1
  251. package/dist/client/assets/sections-editor-DInCqzkh.js +1 -0
  252. package/dist/client/assets/{select-BJaUvbIR.js → select-DGwP5KHQ.js} +1 -1
  253. package/dist/client/assets/{select-model-CftP-ks_.js → select-model-LsdEU85-.js} +1 -1
  254. package/dist/client/assets/seo-editor-5_XGXw95.js +1 -0
  255. package/dist/client/assets/{separator-BXKmXRi8.js → separator-2qO-0nZt.js} +1 -1
  256. package/dist/client/assets/settings-tab-CD2MUqmv.js +1 -0
  257. package/dist/client/assets/{sheet-D2hfPw7P.js → sheet-0biUdMLD.js} +1 -1
  258. package/dist/client/assets/{shell-layout-BLRNx2fV.js → shell-layout-C5K2Cgqa.js} +1 -1
  259. package/dist/client/assets/{site-draft-actions-5nXph2SS.js → site-draft-actions-B3gpIf2V.js} +1 -1
  260. package/dist/client/assets/site-draft-view-BWibSxun.js +1 -0
  261. package/dist/client/assets/site-editor-DLaMMu_L.js +1 -0
  262. package/dist/client/assets/site-editor-toast-DxR_7rv8.js +1 -0
  263. package/dist/client/assets/skills-BJ8hUTnS.js +1 -0
  264. package/dist/client/assets/{slider-C6h9g0cI.js → slider-0BqB-02T.js} +1 -1
  265. package/dist/client/assets/{sortable.esm-D2_ALuVf.js → sortable.esm-DfgMVOGD.js} +1 -1
  266. package/dist/client/assets/{sso-CtTl7KnN.js → sso-BzFw-dKc.js} +1 -1
  267. package/dist/client/assets/{suggestion-C8VoNVDk.js → suggestion-DwjoXezV.js} +2 -2
  268. package/dist/client/assets/{super-agent-icon-B-73GF60.js → super-agent-icon-z7OwHCEd.js} +1 -1
  269. package/dist/client/assets/{switch-C53DVv3y.js → switch-Vjviqk0W.js} +1 -1
  270. package/dist/client/assets/{synced-repos-Cqz-evGv.js → synced-repos-DbHVOBGV.js} +1 -1
  271. package/dist/client/assets/{tab-icon-glyph-I3aa1qRZ.js → tab-icon-glyph-XyhrgWLR.js} +1 -1
  272. package/dist/client/assets/{table-DjgVXWdP.js → table-D0Wi7PXW.js} +1 -1
  273. package/dist/client/assets/{tabs-DtOFAaIp.js → tabs-DQ-fyTC8.js} +1 -1
  274. package/dist/client/assets/{task-board-D3wT6_aG.js → task-board-wWkdzdVu.js} +1 -1
  275. package/dist/client/assets/{task-route-DngvTiyh.js → task-route-BtpV6Buo.js} +1 -1
  276. package/dist/client/assets/{task-status-BfFZ6nf8.js → task-status-Dn75e5kc.js} +1 -1
  277. package/dist/client/assets/taskboard-analytics-8JJwdVpJ.js +1 -0
  278. package/dist/client/assets/{tasks-BHa2qCWg.js → tasks-4GoWL_dW.js} +3 -3
  279. package/dist/client/assets/tasks-CZU6jCer.js +1 -0
  280. package/dist/client/assets/{textarea-_jcGqOvl.js → textarea-Bhjzhlg4.js} +1 -1
  281. package/dist/client/assets/thread-analytics-BAnm8m0s.js +1 -0
  282. package/dist/client/assets/{thread-intent-DuI80508.js → thread-intent-DTnB4CRZ.js} +4 -4
  283. package/dist/client/assets/thread-route-DwPTQCEG.js +1 -0
  284. package/dist/client/assets/{thread-route-B-uAlF3E.js → thread-route-DzALEmAD.js} +1 -1
  285. package/dist/client/assets/{thread-sheet-body-BiNfUUQ_.js → thread-sheet-body-Yz0im8t7.js} +1 -1
  286. package/dist/client/assets/{time-range-picker-F9SEOG2b.js → time-range-picker-aTlkPNIq.js} +1 -1
  287. package/dist/client/assets/{toggle-group-C6oiEKlf.js → toggle-group-B-3sGcOE.js} +1 -1
  288. package/dist/client/assets/{tool-namespace-DdU5nhii.js → tool-namespace-VH0Buyl6.js} +1 -1
  289. package/dist/client/assets/{tool-set-selector-2nfgy8us.js → tool-set-selector-DSVQWzPb.js} +1 -1
  290. package/dist/client/assets/{toolbar-icon-button-BmJKmAUK.js → toolbar-icon-button-ObvTZQXe.js} +1 -1
  291. package/dist/client/assets/{tooltip-Dam-ym8O.js → tooltip-DmKkpA5B.js} +1 -1
  292. package/dist/client/assets/{tooltipContext-PzKiic-J.js → tooltipContext-0-zN8M2u.js} +1 -1
  293. package/dist/client/assets/{track-Dj7QHX2C.js → track-CXbHCkc-.js} +1 -1
  294. package/dist/client/assets/{types-gyofjZHf.js → types-C0QCIIin.js} +6 -6
  295. package/dist/client/assets/{url-slug-BMHzx0XY.js → url-slug-CuKki8F5.js} +1 -1
  296. package/dist/client/assets/{usage-stats-C3KvQP9T.js → usage-stats-BLfmHFkq.js} +1 -1
  297. package/dist/client/assets/{use-ai-providers-DwpUgHpj.js → use-ai-providers-CRaK_JyK.js} +1 -1
  298. package/dist/client/assets/use-apply-named-rule-CtfpAmZq.js +1 -0
  299. package/dist/client/assets/use-ask-in-chat-Pb7sjY65.js +1 -0
  300. package/dist/client/assets/{use-automations-CyrAu8XA.js → use-automations-CEHifMG2.js} +1 -1
  301. package/dist/client/assets/{use-autosave-TV-hF63e.js → use-autosave-DlV5iCiV.js} +1 -1
  302. package/dist/client/assets/use-blocks-v8-project-CaFw5qe2.js +1 -0
  303. package/dist/client/assets/{use-chat-layout-state-BG2-xqQp.js → use-chat-layout-state-CMz9hnFO.js} +1 -1
  304. package/dist/client/assets/{use-cms-publish-actions-CmQuU9AY.js → use-cms-publish-actions-C9vJqM_c.js} +4 -4
  305. package/dist/client/assets/{use-connect-companion-CowVgnp9.js → use-connect-companion-eNuilyDe.js} +1 -1
  306. package/dist/client/assets/use-connection-Bn20mDtq.js +1 -0
  307. package/dist/client/assets/use-content-sync-CJa8ir96.js +1 -0
  308. package/dist/client/assets/{use-copy-o0P-kroy.js → use-copy-DKdhQNUM.js} +1 -1
  309. package/dist/client/assets/{use-date-fns-locale-bKU2Q73X.js → use-date-fns-locale-BDYV4XK1.js} +1 -1
  310. package/dist/client/assets/{use-debounced-autosave-BmvZzlB_.js → use-debounced-autosave-t5GiXTFe.js} +1 -1
  311. package/dist/client/assets/{use-debounced-value-yZdJ1f2K.js → use-debounced-value-DWZxrww8.js} +1 -1
  312. package/dist/client/assets/{use-deco-credits-Bjfx0bAt.js → use-deco-credits-Z-japzkY.js} +1 -1
  313. package/dist/client/assets/{use-decopilot-events-C_C16-Ln.js → use-decopilot-events-BYdNs8bH.js} +1 -1
  314. package/dist/client/assets/{use-delete-connection-B4rX1qgg.js → use-delete-connection-BQbnqJMz.js} +1 -1
  315. package/dist/client/assets/{use-deployment-admin-CS9K9Ea9.js → use-deployment-admin-BT6mljlI.js} +1 -1
  316. package/dist/client/assets/{use-entitlements-DidlVdLU.js → use-entitlements-DzFd30Kk.js} +1 -1
  317. package/dist/client/assets/use-fast-preview-draft-url-Dz36xQ9l.js +1 -0
  318. package/dist/client/assets/{use-file-configs-DhXDYO83.js → use-file-configs-C_HqsFXW.js} +1 -1
  319. package/dist/client/assets/{use-id-selection-BHXFVfAt.js → use-id-selection-BEG3_dI0.js} +1 -1
  320. package/dist/client/assets/{use-inbox-feed-CKkWXum7.js → use-inbox-feed-DLkSEGfn.js} +1 -1
  321. package/dist/client/assets/{use-infinite-scroll-CED9GMTE.js → use-infinite-scroll-Chl8X7E8.js} +1 -1
  322. package/dist/client/assets/{use-join-requests-DAuosANz.js → use-join-requests-BuQsiKHH.js} +1 -1
  323. package/dist/client/assets/use-main-panel-tabs-CC9AQiRW.js +1 -0
  324. package/dist/client/assets/{use-mcp-auth-status-Dls0bLQE.js → use-mcp-auth-status-CKOvUjsu.js} +1 -1
  325. package/dist/client/assets/{use-mcp-client-DJjkIlNp.js → use-mcp-client-WQDNFsc_.js} +1 -1
  326. package/dist/client/assets/{use-mcp-prompts-it9pO2QZ.js → use-mcp-prompts-LhMG3Pij.js} +1 -1
  327. package/dist/client/assets/{use-mcp-tools-wfurU0oX.js → use-mcp-tools-F4vSg6Cr.js} +1 -1
  328. package/dist/client/assets/{use-mobile-CJITN8uI.js → use-mobile-DVyEfslF.js} +1 -1
  329. package/dist/client/assets/use-move-blocks-C_vBd64S.js +1 -0
  330. package/dist/client/assets/{use-navigate-to-agent-MlXDIBYX.js → use-navigate-to-agent-BZizGtaP.js} +1 -1
  331. package/dist/client/assets/{use-org-fs-BH012Up0.js → use-org-fs-mR8sTNyP.js} +1 -1
  332. package/dist/client/assets/{use-org-repo-syncs-jV2kVf-q.js → use-org-repo-syncs-LYGPgfu7.js} +1 -1
  333. package/dist/client/assets/{use-org-sso-Bo72RJ5p.js → use-org-sso-B-Qul1Io.js} +1 -1
  334. package/dist/client/assets/{use-organization-settings-bWX185lw.js → use-organization-settings-CZhHULzA.js} +1 -1
  335. package/dist/client/assets/{use-project-native-view-presence-DhhbOsoh.js → use-project-native-view-presence-DbbXYpJY.js} +1 -1
  336. package/dist/client/assets/{use-project-scope-pwqcjGo8.js → use-project-scope-DTrxFs6w.js} +1 -1
  337. package/dist/client/assets/{use-recent-apps-Rr1jTj-T.js → use-recent-apps-BPKgIDRu.js} +1 -1
  338. package/dist/client/assets/{use-reports-diagnostic-0n4ScjpC.js → use-reports-diagnostic-B8YcWp1M.js} +1 -1
  339. package/dist/client/assets/use-sandbox-events-Cq2mfnM6.js +2 -0
  340. package/dist/client/assets/{use-secrets-Dim43C3b.js → use-secrets-BokO0-gN.js} +1 -1
  341. package/dist/client/assets/{use-section-preview-base-B6FS0lTt.js → use-section-preview-base-C3QCAjZQ.js} +1 -1
  342. package/dist/client/assets/{use-sidebar-collapsed-DcAIYhdp.js → use-sidebar-collapsed-DNtMGrde.js} +1 -1
  343. package/dist/client/assets/{use-tags-6ljf50Kl.js → use-tags-BZilAw5O.js} +1 -1
  344. package/dist/client/assets/{use-task-board-analytics-5XuzJjLw.js → use-task-board-analytics-CadDLlJH.js} +1 -1
  345. package/dist/client/assets/{use-task-board-events-DnEp5edD.js → use-task-board-events-BO-7EKNy.js} +1 -1
  346. package/dist/client/assets/{use-task-board-item-prs-CycVEDhs.js → use-task-board-item-prs-ER-6njOZ.js} +1 -1
  347. package/dist/client/assets/{use-task-board-items-pvi4Vcv1.js → use-task-board-items-CpAskmIM.js} +1 -1
  348. package/dist/client/assets/{use-task-board-prompts-CE5ytMaB.js → use-task-board-prompts-DQqx__yW.js} +1 -1
  349. package/dist/client/assets/{use-task-metadata-D4kXdUwO.js → use-task-metadata-DaTAtFWS.js} +1 -1
  350. package/dist/client/assets/{use-thread-outputs-BPYn8k3d.js → use-thread-outputs-DQ6xHxgF.js} +1 -1
  351. package/dist/client/assets/{use-voice-input-BKZpbbiI.js → use-voice-input-C19j6O14.js} +1 -1
  352. package/dist/client/assets/useInfiniteQuery-K_IsCntR.js +1 -0
  353. package/dist/client/assets/{useQueries-B3iHMIbL.js → useQueries-DvUG5EVg.js} +1 -1
  354. package/dist/client/assets/useSuspenseInfiniteQuery-BxxeKR03.js +1 -0
  355. package/dist/client/assets/{users-7Hqe-w13.js → users-BgTfExah.js} +1 -1
  356. package/dist/client/assets/{utils-BbEfYi1l.js → utils-ChC83HK9.js} +1 -1
  357. package/dist/client/assets/{variant-calendar-vayISj1w.js → variant-calendar-LRu1zblU.js} +1 -1
  358. package/dist/client/assets/{variant-matcher-override-ulDJ4YBu.js → variant-matcher-override-D1mQo9MQ.js} +1 -1
  359. package/dist/client/assets/{view-header-y27ISHbd.js → view-header-ConmBWWI.js} +1 -1
  360. package/dist/client/assets/{virtual-mcp-vRvxAZ15.js → virtual-mcp-BkTVgFTu.js} +1 -1
  361. package/dist/client/assets/watch-sse-pool-pETEkNEY.js +1 -0
  362. package/dist/client/index.html +1 -1
  363. package/dist/server/server.js +561 -561
  364. package/package.json +1 -1
  365. package/dist/client/assets/ReferenceLine-HGyXAqMo.js +0 -1
  366. package/dist/client/assets/agent-app-C3J9IT10.js +0 -1
  367. package/dist/client/assets/agent-assets-CvnH7aBA.js +0 -1
  368. package/dist/client/assets/agent-automations-R-Eaz2To.js +0 -1
  369. package/dist/client/assets/agent-calendar-Cd8km6Ln.js +0 -1
  370. package/dist/client/assets/agent-connect-sources-BrM4y83H.js +0 -1
  371. package/dist/client/assets/agent-deck-DRKoTD-S.js +0 -1
  372. package/dist/client/assets/agent-e2e-BuKHozb1.js +0 -1
  373. package/dist/client/assets/agent-experiments-CgtwbbvZ.js +0 -1
  374. package/dist/client/assets/agent-file-wlYMcv_9.js +0 -1
  375. package/dist/client/assets/agent-hosting-BaITgwKU.js +0 -1
  376. package/dist/client/assets/agent-library-CC7Sh_px.js +0 -1
  377. package/dist/client/assets/agent-library-file-DB9_i_YI.js +0 -1
  378. package/dist/client/assets/agent-overview-BkJ7Az2Q.js +0 -1
  379. package/dist/client/assets/agent-releases-Dh0xH2nd.js +0 -2
  380. package/dist/client/assets/agent-settings-B8F88lFa.js +0 -1
  381. package/dist/client/assets/agent-site-editor-code-TQZ-nnUV.js +0 -2
  382. package/dist/client/assets/agent-site-editor-content-CAE4z8AF.js +0 -1
  383. package/dist/client/assets/agent-site-editor-preview-gLgYeQTA.js +0 -1
  384. package/dist/client/assets/agent-view-mJs78en_.js +0 -1
  385. package/dist/client/assets/ai-providers-CKuZmBiu.js +0 -1
  386. package/dist/client/assets/api-keys-BtDMAyj2.js +0 -1
  387. package/dist/client/assets/app-editor-D88RxUP1.js +0 -1
  388. package/dist/client/assets/auth-entry-Bkznmv5L.js +0 -1
  389. package/dist/client/assets/automation-runs-CvC4BqLv.js +0 -1
  390. package/dist/client/assets/automations-Ajx2woko.js +0 -1
  391. package/dist/client/assets/blocks-tab-states-BRjgrPty.js +0 -1
  392. package/dist/client/assets/category-editor-CozNeVRI.js +0 -1
  393. package/dist/client/assets/cms-settings-editor-kiB9O6al.js +0 -1
  394. package/dist/client/assets/cms-store-drafts-DEGbfccc.js +0 -1
  395. package/dist/client/assets/collection-detail-a6oC0bB8.js +0 -1
  396. package/dist/client/assets/connection-detail-D0-sYPQS.js +0 -1
  397. package/dist/client/assets/connections-D-1tH9cf.js +0 -1
  398. package/dist/client/assets/content-tab-DH5bq_bz.js +0 -25
  399. package/dist/client/assets/context-DK_qXRQL.js +0 -1
  400. package/dist/client/assets/discover-DzzEIO43.js +0 -1
  401. package/dist/client/assets/file-explorer-Bgho9rLt.js +0 -2
  402. package/dist/client/assets/home-C9onXt5U.js +0 -1
  403. package/dist/client/assets/hosted-reconcile-DNkBVm-1.js +0 -1
  404. package/dist/client/assets/index-Bbmo8mh-.js +0 -1
  405. package/dist/client/assets/index-DB454549.js +0 -1
  406. package/dist/client/assets/index-i75UpmlW.js +0 -4
  407. package/dist/client/assets/library-Cx1S-GVi.js +0 -1
  408. package/dist/client/assets/login-BuRZE0OR.js +0 -1
  409. package/dist/client/assets/mustache-DtDLolVD.js +0 -4
  410. package/dist/client/assets/oauth-consent-Dm4zOEtc.js +0 -1
  411. package/dist/client/assets/openai-conversation-BH1GqT3q.js +0 -3
  412. package/dist/client/assets/parse-sections-Ca4qHQSq.js +0 -20
  413. package/dist/client/assets/plan-q4Vm_z4g.js +0 -1
  414. package/dist/client/assets/post-calendar-CvHtHQHg.js +0 -1
  415. package/dist/client/assets/post-editor-0bthmrQK.js +0 -2
  416. package/dist/client/assets/preview-tab-C506bsNP.js +0 -551
  417. package/dist/client/assets/project-app-view-CKUZlcwf.js +0 -1
  418. package/dist/client/assets/project-reports-bT7h-_SM.js +0 -1
  419. package/dist/client/assets/project-tasks-CqL0-1p3.js +0 -1
  420. package/dist/client/assets/projects-CM1tg94T.js +0 -1
  421. package/dist/client/assets/record-editor-fYL_geiT.js +0 -1
  422. package/dist/client/assets/redirect-editor-CqeB0Mu0.js +0 -1
  423. package/dist/client/assets/reports-CtLMPNBD.js +0 -1
  424. package/dist/client/assets/reports-onboarding-Bb3vI6W8.js +0 -1
  425. package/dist/client/assets/reports-tab-BaN84XaS.js +0 -2
  426. package/dist/client/assets/repositories-DR2_ORl-.js +0 -1
  427. package/dist/client/assets/review-settings-DUhDHWEg.js +0 -1
  428. package/dist/client/assets/route-8zXp8Zmg.js +0 -1
  429. package/dist/client/assets/route-DW6RzQLd.js +0 -1
  430. package/dist/client/assets/route-oGUs3Dt9.js +0 -1
  431. package/dist/client/assets/sandbox-lifecycle-context-WXIR2CMZ.js +0 -1
  432. package/dist/client/assets/sections-editor-D1U5_lZq.js +0 -1
  433. package/dist/client/assets/seo-editor-B6UrHPko.js +0 -1
  434. package/dist/client/assets/settings-tab-CHBeACws.js +0 -1
  435. package/dist/client/assets/site-draft-view-3CfqUHrV.js +0 -1
  436. package/dist/client/assets/site-editor-BqlLTFw0.js +0 -1
  437. package/dist/client/assets/site-editor-toast-Cgezu0A5.js +0 -1
  438. package/dist/client/assets/skills-B_05tfLr.js +0 -1
  439. package/dist/client/assets/taskboard-analytics-D-vAg9Px.js +0 -1
  440. package/dist/client/assets/tasks-adXvugV8.js +0 -1
  441. package/dist/client/assets/thread-analytics-DPDga_ap.js +0 -1
  442. package/dist/client/assets/thread-route-Ci8rIker.js +0 -1
  443. package/dist/client/assets/use-apply-named-rule-BnEs0jP7.js +0 -1
  444. package/dist/client/assets/use-ask-in-chat-BIANNd7Z.js +0 -1
  445. package/dist/client/assets/use-blocks-v8-project-4PZwWSEO.js +0 -1
  446. package/dist/client/assets/use-connection-BozgIoMu.js +0 -1
  447. package/dist/client/assets/use-content-sync-BBbOIir0.js +0 -1
  448. package/dist/client/assets/use-fast-preview-draft-url-KJzyk03O.js +0 -1
  449. package/dist/client/assets/use-main-panel-tabs-DfOwinBC.js +0 -1
  450. package/dist/client/assets/use-move-blocks-CC1C41-K.js +0 -1
  451. package/dist/client/assets/use-sandbox-events-D1_GHzsF.js +0 -2
  452. package/dist/client/assets/useInfiniteQuery-CtNfxLxq.js +0 -1
  453. package/dist/client/assets/useSuspenseInfiniteQuery-OzDVxqdl.js +0 -1
  454. package/dist/client/assets/watch-sse-pool-DhoYakYc.js +0 -1
@@ -1,551 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sections-editor-D1U5_lZq.js","assets/index-DEZ1imMJ.js","assets/index-BkJtJQz4.css","assets/chat-context-PvP_Q1CV.js","assets/autosend-B0POegpm.js","assets/thread-route-B-uAlF3E.js","assets/use-project-scope-pwqcjGo8.js","assets/repository-binding-C0msapZZ.js","assets/use-mcp-client-DJjkIlNp.js","assets/auth-CQxDIkM-.js","assets/thread-intent-DuI80508.js","assets/delay-CnY5UFtP.js","assets/watch-sse-pool-DhoYakYc.js","assets/task-board-D3wT6_aG.js","assets/schema-9jBUPMLq.js","assets/use-entitlements-DidlVdLU.js","assets/use-ai-providers-DwpUgHpj.js","assets/use-decopilot-events-C_C16-Ln.js","assets/use-organization-settings-bWX185lw.js","assets/parse-sections-Ca4qHQSq.js","assets/utils-BbEfYi1l.js","assets/agent-icon-CTbTFMnU.js","assets/AlertCircle-Co3RPbIZ.js","assets/Tool01-Bo2g-Ylw.js","assets/ArrowUp-DLnkUu9S.js","assets/ArrowLeft-XBSBGQal.js","assets/LinkBroken01-loTkm0G5.js","assets/ShoppingBag01-zloi0TDl.js","assets/Globe04-D17A2x5l.js","assets/CheckCircle-kNwBDDVU.js","assets/ChevronUp-D1T3kSyr.js","assets/ChevronSelectorVertical-Gg7YcxlH.js","assets/UserSquare-Qd-FKVqK.js","assets/CreditCard01-D65BAIaV.js","assets/SwitchHorizontal01-elXb4-4d.js","assets/Key01-awxHKnoL.js","assets/Minus-CYrsmoRb.js","assets/Monitor01-DalIAdj7.js","assets/Sun-C1lyqton.js","assets/Play-C6Weq-wk.js","assets/Plus-D7X8Q2-q.js","assets/SearchMd-e6xPeRPD.js","assets/Trash01-C-PU5Hm-.js","assets/Upload01-NPnXKs-J.js","assets/Users01-CTNixqdX.js","assets/XClose-BuJ6u6eL.js","assets/Zap-pmN7zSOE.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/pair-D5JEvK2M.js","assets/collapsible-C7N88_dp.js","assets/use-copy-o0P-kroy.js","assets/usage-stats-C3KvQP9T.js","assets/tool-namespace-DdU5nhii.js","assets/form-gd_hA5VT.js","assets/label-BEWDSeNl.js","assets/utils-CVEq3hMx.js","assets/markdown-Db8a3LUX.js","assets/use-mobile-CJITN8uI.js","assets/tooltip-Dam-ym8O.js","assets/index-DsbWutG1.js","assets/shell-layout-BLRNx2fV.js","assets/use-deployment-admin-CS9K9Ea9.js","assets/admin-fetch-BhTJlAsX.js","assets/command-DA2t4jTW.js","assets/index-DYgzDE_k.js","assets/integration-icon-CFHOt7sY.js","assets/project-icon-rrJh6PJx.js","assets/use-navigate-to-agent-MlXDIBYX.js","assets/use-debounced-value-yZdJ1f2K.js","assets/new-project-dialog-Dfe2Pik9.js","assets/repository-picker-BYFeDBpn.js","assets/github-icon-BVy-v7gH.js","assets/useInfiniteQuery-CtNfxLxq.js","assets/infiniteQueryObserver-C0Gb02df.js","assets/collection-search-Din8SB5Y.js","assets/legacy-admin-welcome-dialog-B223MrIf.js","assets/drawer-BYGTIOoj.js","assets/required-auth-layout-DfUx9vzb.js","assets/use-org-sso-Bo72RJ5p.js","assets/shell-layout-CE2Eihra.css","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-C8G6NLBz.js","assets/types-gyofjZHf.js","assets/omit-server-managed-metadata-L5IhjRZB.js","assets/sheet-D2hfPw7P.js","assets/use-connection-BozgIoMu.js","assets/use-mcp-prompts-it9pO2QZ.js","assets/use-thread-outputs-BPYn8k3d.js","assets/file-type-icon-DM9o0Fkb.js","assets/section-array-field-CvmfLv3q.js","assets/blocks-tab-states-BRjgrPty.js","assets/site-editor-toast-Cgezu0A5.js","assets/use-voice-input-BKZpbbiI.js","assets/popover-DsvzKyw_.js","assets/index-Bgxp_wDH.js","assets/checkbox-Bk98t4UK.js","assets/select-BJaUvbIR.js","assets/index-BdQq_4o_.js","assets/ai-providers-logos-DD3qZ33J.js","assets/openai-compatible-presets-BKGfVqEx.js","assets/use-blocks-v8-project-4PZwWSEO.js","assets/sandbox-url-D3mC8qhT.js","assets/use-sandbox-events-D1_GHzsF.js","assets/sandbox-git-api-DcqI6XE4.js","assets/empty-state-CtwVPMDf.js","assets/hosted-reconcile-DNkBVm-1.js","assets/slider-C6h9g0cI.js","assets/index-B-T__H4R.js","assets/tooltipContext-PzKiic-J.js","assets/CategoricalChart-BkeCXQf9.js","assets/index-D5i1_B2b.js","assets/switch-C53DVv3y.js","assets/textarea-_jcGqOvl.js","assets/scroll-area-CQ_g6hBm.js","assets/monaco-editor-DTwBEUg_.js","assets/editor-x1lgFdfy.js","assets/calendar-SB5YBzj8.js","assets/editor-classes-LFKjNX_0.js","assets/core.esm-tIHbtjKb.js","assets/sortable.esm-D2_ALuVf.js","assets/toggle-group-C6oiEKlf.js","assets/active-indicator-CCMhAsc_.js","assets/combobox-CVchGkTE.js","assets/search-input-Co3g-t6C.js","assets/tabs-DtOFAaIp.js","assets/use-file-configs-DhXDYO83.js","assets/asset-utils-C5mv1eiH.js","assets/match-site-slug-config-D3fUJ6vX.js","assets/mustache-DtDLolVD.js","assets/use-section-preview-base-B6FS0lTt.js","assets/seo-editor-B6UrHPko.js","assets/use-apply-named-rule-BnEs0jP7.js","assets/use-move-blocks-CC1C41-K.js","assets/variant-matcher-override-ulDJ4YBu.js"])))=>i.map(i=>d[i]);
2
- import{c as ue,j as r,r as E,m as Fe,b as Te,B as $e,a3 as ni,aF as cn,b4 as ct,aG as De,b5 as si,b6 as ri,b7 as ai,b8 as ii,v as Pr,D as jr,K as Gn,w as Er,x as Nr,e as oi,h as gt,I as Mn,y as li,b9 as ci,a5 as Jn,aZ as di,b2 as ui,i as Tr,ar as Un,at as In,a8 as Cr,P as zn,E as fi,t as dn,b3 as pi,q as mi}from"./index-DEZ1imMJ.js";import{u as Rr,g as hi,c as Gs,B as Rn,P as gi,r as vi,R as xi,a as bi,H as wi,b as Lr,S as yi,d as ki,l as Si,m as Pi,p as ji,e as Ei,f as Ln,N as Ni}from"./parse-sections-Ca4qHQSq.js";import{b as Ti,c as Mt,r as Ar,l as _r,f as Ci,g as Ri,w as Li}from"./chat-context-PvP_Q1CV.js";import{t as Ai}from"./ChevronUp-D1T3kSyr.js";import{P as _i,Q as Oi,K as Or,R as Di,S as Fi,b as $i,T as Bi,U as Dr,V as Mi,W as Fr,X as Js,Y as Ui}from"./agent-icon-CTbTFMnU.js";import{a as Ii,n as zi}from"./UserSquare-Qd-FKVqK.js";import{s as $r}from"./Plus-D7X8Q2-q.js";import{a as Br,b as Mr,P as Ur}from"./popover-DsvzKyw_.js";import{e as dt,b as ut,c as Ir,f as zr,a as Kr,C as Hr}from"./command-DA2t4jTW.js";import{b as Ki,c as Hi,u as Vi}from"./repository-binding-C0msapZZ.js";import{a as Ut}from"./sandbox-lifecycle-context-WXIR2CMZ.js";import{r as Wi}from"./thread-intent-DuI80508.js";import{u as Vr}from"./use-voice-input-BKZpbbiI.js";import{d as qi,f as Gi,i as Ji,g as Yi,h as Qi,j as Xi,k as Zi,u as fn,l as Yn,m as Xe,n as eo,o as Wr,q as to,t as no,v as so,w as qr,x as ro,c as Gr,b as Jr,y as ao,z as He,A as io,B as oo,C as lo,D as co,E as uo,F as fo,G as Ys,H as po,I as Qs,J as mo,K as ho,L as Xs,M as Zs,N as er,O as tr,P as nr,Q as An,R as go,S as vo,U as xo,V as bo,W as wo,e as yo}from"./site-editor-toast-Cgezu0A5.js";import{u as Yr}from"./use-mobile-CJITN8uI.js";import{T as pt,a as mt,c as ht}from"./tooltip-Dam-ym8O.js";import{T as Ze}from"./toolbar-icon-button-BmJKmAUK.js";import{w as nn,i as ko}from"./variant-matcher-override-ulDJ4YBu.js";import{s as Bt,n as Qn,a as Qr,f as Ve,v as Xr,u as Zr,h as So,i as Po,B as jo,S as Eo,C as No,b as To,e as Co,c as Ro,d as Lo,N as Ao,g as _o,r as Oo,j as Do,k as sr,p as Fo}from"./blocks-tab-states-BRjgrPty.js";import{u as $o}from"./use-fast-preview-draft-url-KJzyk03O.js";import{g as Bo}from"./section-array-field-CvmfLv3q.js";import{g as Mo,l as ea}from"./shell-layout-BLRNx2fV.js";import{u as Xn,b as Uo}from"./use-sandbox-events-D1_GHzsF.js";import{u as Kn}from"./useQueries-B3iHMIbL.js";import{i as Io}from"./LinkBroken01-loTkm0G5.js";import{u as ta}from"./blocks-preview-workspace-context-BnkXYZX_.js";import{MonacoCodeEditor as zo}from"./monaco-editor-DTwBEUg_.js";import{c as Ko,u as Ho,i as Vo,l as Wo,D as qo}from"./hosted-reconcile-DNkBVm-1.js";import{d as Go}from"./utils-BbEfYi1l.js";import{R as rr,a as sn,b as ar}from"./resizable-CHI5UJHW.js";import{u as Jo}from"./use-blocks-v8-project-4PZwWSEO.js";import{s as Yo,L as Qo,R as na,D as ir,w as Hn}from"./device-hint-DslC2w9a.js";import{L as Xo}from"./label-BEWDSeNl.js";import{a as Zo,T as or}from"./toggle-group-C6oiEKlf.js";import{b as el}from"./sandbox-url-D3mC8qhT.js";import{r as tl,R as nl}from"./virtual-mcp-vRvxAZ15.js";import{d as sl}from"./delay-CnY5UFtP.js";import{s as sa}from"./XClose-BuJ6u6eL.js";import{o as rl}from"./omit-server-managed-metadata-L5IhjRZB.js";import{a as _n,b as al,w as il,n as lr}from"./app-preview-url-9Od4s8Sz.js";import{a as ol}from"./use-organization-settings-bWX185lw.js";import{a as On}from"./agent-capabilities-BGShibnD.js";import{E as ll}from"./empty-state-CtwVPMDf.js";import{G as cr}from"./github-icon-BVy-v7gH.js";import{R as cl}from"./new-project-dialog-Dfe2Pik9.js";import{r as dl}from"./preview-source-BsRLGWUP.js";import{A as ul,a as fl,b as pl}from"./alert-wYcDlQSf.js";import{u as ml}from"./use-task-metadata-D4kXdUwO.js";function hl(t){const e=ue.c(10),{waiting:n}=t,s=n?"true":"false";let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:r.jsx(_i,{className:"size-5 sm:size-6"})}),e[0]=a):a=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=r.jsx("span",{className:"h-px w-full border-t border-dashed border-muted-foreground/40"}),e[1]=l):l=e[1];let u;e[2]!==n?(u=n&&r.jsx("span",{"data-testid":"connection-dot",className:"absolute top-0 size-2 animate-[connection-shuttle_1.8s_var(--ease-in-out-cubic)_infinite_alternate] rounded-full bg-foreground"}),e[2]=n,e[3]=u):u=e[3];let o;e[4]!==u?(o=r.jsxs("span",{className:"relative flex h-2 w-16 items-center sm:w-20",children:[l,u]}),e[4]=u,e[5]=o):o=e[5];let i;e[6]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:r.jsx(Oi,{className:"size-5 sm:size-6"})}),e[6]=i):i=e[6];let c;return e[7]!==s||e[8]!==o?(c=r.jsxs("div",{"aria-hidden":"true","data-testid":"connection-wire","data-waiting":s,className:"flex items-center gap-2",children:[a,o,i]}),e[7]=s,e[8]=o,e[9]=c):c=e[9],c}function gl(t){const e=ue.c(22),{index:n,numbered:s,step:a,heading:l}=t,u=E.useId();let o;e[0]!==n||e[1]!==s?(o=s&&r.jsx("span",{"aria-hidden":"true",className:"flex size-6 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-medium tabular-nums text-foreground",children:n}),e[0]=n,e[1]=s,e[2]=o):o=e[2];let i;e[3]!==l||e[4]!==u||e[5]!==a.title?(i=r.jsx(l,{id:u,className:"text-sm font-medium text-foreground",children:a.title}),e[3]=l,e[4]=u,e[5]=a.title,e[6]=i):i=e[6];let c;e[7]!==o||e[8]!==i?(c=r.jsxs("div",{className:"flex items-center gap-3",children:[o,i]}),e[7]=o,e[8]=i,e[9]=c):c=e[9];const m=s&&"sm:pl-9";let f;e[10]!==m?(f=Fe("flex min-w-0 flex-col gap-3",m),e[10]=m,e[11]=f):f=e[11];let p;e[12]!==a.body?(p=a.body&&r.jsx("p",{className:"text-sm text-muted-foreground",children:a.body}),e[12]=a.body,e[13]=p):p=e[13];let k;e[14]!==a.after||e[15]!==f||e[16]!==p?(k=r.jsxs("div",{className:f,children:[p,a.after]}),e[14]=a.after,e[15]=f,e[16]=p,e[17]=k):k=e[17];let g;return e[18]!==u||e[19]!==c||e[20]!==k?(g=r.jsxs("li",{"aria-labelledby":u,className:"surface flex flex-col gap-3 p-4 sm:p-5",children:[c,k]}),e[18]=u,e[19]=c,e[20]=k,e[21]=g):g=e[21],g}const vl=[];function un(t){const e=ue.c(20),{title:n,lead:s,waiting:a,alerts:l,steps:u,footer:o,headingLevel:i}=t,c=u===void 0?vl:u,m=i===void 0?1:i,f=m===1?"h1":"h2",p=a&&c.length===0?"status":void 0;let k;e[0]!==a?(k=r.jsx(hl,{waiting:a}),e[0]=a,e[1]=k):k=e[1];let g;e[2]!==f||e[3]!==n?(g=r.jsx(f,{tabIndex:-1,className:"text-balance text-lg font-medium text-foreground outline-none sm:text-xl",children:n}),e[2]=f,e[3]=n,e[4]=g):g=e[4];let v;e[5]!==s?(v=s&&r.jsx("p",{className:"text-pretty text-sm text-muted-foreground",children:s}),e[5]=s,e[6]=v):v=e[6];let h;e[7]!==p||e[8]!==k||e[9]!==g||e[10]!==v?(h=r.jsxs("header",{role:p,className:"flex flex-col items-center gap-3 text-center",children:[k,g,v]}),e[7]=p,e[8]=k,e[9]=g,e[10]=v,e[11]=h):h=e[11];let x;e[12]!==m||e[13]!==c?(x=c.length>0&&r.jsx("ol",{className:"flex flex-col gap-3",children:c.map((b,w)=>r.jsx(gl,{index:w+1,numbered:c.length>1,step:b,heading:m===1?"h2":"h3"},b.title))}),e[12]=m,e[13]=c,e[14]=x):x=e[14];let C;return e[15]!==l||e[16]!==o||e[17]!==h||e[18]!==x?(C=r.jsx("div",{className:"h-full w-full overflow-y-auto",children:r.jsxs("div",{className:"mx-auto flex min-h-full w-full max-w-xl flex-col justify-center gap-6 px-4 py-8 sm:py-12",children:[h,l,x,o]})}),e[15]=l,e[16]=o,e[17]=h,e[18]=x,e[19]=C):C=e[19],C}function xl(t){const e=ue.c(43),{wait:n,hosts:s,invalidLink:a}=t,l=a===void 0?!1:a,u=Te();let o;e[0]!==l||e[1]!==u?(o=l&&r.jsx(ul,{variant:"warning",children:r.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[r.jsx(fl,{className:"line-clamp-none text-foreground",children:u("decoServe.link.invalidTitle")}),r.jsx(pl,{children:u("decoServe.link.invalidBody")})]})}),e[0]=l,e[1]=u,e[2]=o):o=e[2];const i=o;if(n.kind==="problem"){let w;e[3]!==u||e[4]!==n.host||e[5]!==n.problem?(w=Yo(u,n.problem,n.host),e[3]=u,e[4]=n.host,e[5]=n.problem,e[6]=w):w=e[6];const{title:N,body:j}=w;let P;e[7]!==j?(P=r.jsx(na,{text:j}),e[7]=j,e[8]=P):P=e[8];let S;e[9]===Symbol.for("react.memo_cache_sentinel")?(S=r.jsx(ir,{className:"border-t border-border pt-4",links:["troubleshooting","serve"]}),e[9]=S):S=e[9];let R;return e[10]!==i||e[11]!==P||e[12]!==N?(R=r.jsx(un,{headingLevel:2,waiting:!1,title:N,lead:P,alerts:i,footer:S}),e[10]=i,e[11]=P,e[12]=N,e[13]=R):R=e[13],R}const c=n.kind==="looking",m=c&&!n.paused;let f;e[14]!==u?(f=u("decoServe.waiting.title"),e[14]=u,e[15]=f):f=e[15];let p;e[16]!==u?(p=u("decoServe.waiting.lead"),e[16]=u,e[17]=p):p=e[17];let k;e[18]!==i||e[19]!==n.kind?(k=(i||n.kind==="denied")&&r.jsxs(r.Fragment,{children:[i,n.kind==="denied"&&r.jsx(Qo,{})]}),e[18]=i,e[19]=n.kind,e[20]=k):k=e[20];let g;e[21]!==u?(g=u("decoServe.waiting.connect.title"),e[21]=u,e[22]=g):g=e[22];let v;e[23]!==u?(v=u("decoServe.waiting.connect.body"),e[23]=u,e[24]=v):v=e[24];let h;e[25]!==s||e[26]!==c||e[27]!==u||e[28]!==n.kind||e[29]!==n.onStart||e[30]!==n.paused?(h=n.kind==="needs-gesture"?r.jsx($e,{variant:"outline",className:"self-start",onClick:n.onStart,children:u("decoServe.guide.start")}):c&&r.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:n.paused?u("decoServe.guide.paused"):u("decoServe.guide.looking",{hosts:s})}),e[25]=s,e[26]=c,e[27]=u,e[28]=n.kind,e[29]=n.onStart,e[30]=n.paused,e[31]=h):h=e[31];let x;e[32]!==g||e[33]!==v||e[34]!==h?(x=[{title:g,body:v,after:h}],e[32]=g,e[33]=v,e[34]=h,e[35]=x):x=e[35];let C;e[36]===Symbol.for("react.memo_cache_sentinel")?(C=r.jsx(ir,{className:"border-t border-border pt-4",links:["siteEditor","serve","troubleshooting"]}),e[36]=C):C=e[36];let b;return e[37]!==x||e[38]!==m||e[39]!==f||e[40]!==p||e[41]!==k?(b=r.jsx(un,{headingLevel:2,waiting:m,title:f,lead:p,alerts:k,steps:x,footer:C}),e[37]=x,e[38]=m,e[39]=f,e[40]=p,e[41]=k,e[42]=b):b=e[42],b}function bl(t,e){switch(t.kind){case"needs-permission":return{kind:"denied"};case"problem":return{kind:"problem",problem:t.problem,host:e};default:return{kind:"looking"}}}const wl=15e3,yl=3e3;function kl(t){const{candidates:e,probe:n,onFound:s,onChange:a,doc:l=document,setTimer:u=(w,N)=>setTimeout(w,N),clearTimer:o=w=>clearTimeout(w),timeoutMs:i=yl}=t;let c={status:"searching",firstRoundDone:!1,problem:null},m=!1,f=!1,p=0,k=null,g=null;const v=()=>l.visibilityState==="hidden",h=w=>{c={...c,...w},a(c)},x=async w=>{g=new AbortController;const N=g,j=u(()=>N.abort(),i);try{return await n(w,N.signal),!0}catch(P){if(m)return!1;const S=Gi(P);return S.reason!=="not-answering"?h({problem:{...S,endpoint:w}}):c.problem?.endpoint===w&&h({problem:null}),!1}finally{o(j),g=null}},C=async()=>{if(k=null,!(m||f)){if(e.length===0){h({status:"stopped",firstRoundDone:!0});return}if(v()){h({status:"paused"});return}f=!0,c.status!=="searching"&&h({status:"searching"});for(const w of e){if(m)break;if(await x(w)){if(f=!1,m)return;m=!0,l.removeEventListener("visibilitychange",b),h({status:"found",firstRoundDone:!0}),s(w);return}}if(f=!1,!m){if(p+=1,c.firstRoundDone||h({firstRoundDone:!0}),v()){h({status:"paused"});return}k=u(()=>{C()},qi(p,wl))}}};function b(){if(!m){if(v()){k!==null&&(o(k),k=null),f||h({status:"paused"});return}k!==null&&o(k),p=0,C()}}return l.addEventListener("visibilitychange",b),a(c),C(),()=>{m=!0,k!==null&&o(k),g?.abort(),l.removeEventListener("visibilitychange",b)}}function Sl(t,e){return Yi(Qi({endpoint:t,fetch:n=>fetch(n,{signal:e})}))}const Pl=["loopback-network","local-network-access"];async function jl(){if(Ji(window.location.origin))return null;for(const t of Pl)try{return await navigator.permissions.query({name:t})}catch{}return null}let ra=null,dr=!1;const Dn=new Set;function El(t){if(Dn.add(t),!dr){dr=!0;const e=n=>{ra=n;for(const s of Dn)s()};jl().then(n=>{if(!n)return e("unsupported");e(n.state),n.addEventListener("change",()=>e(n.state))})}return()=>Dn.delete(t)}const Nl={status:"stopped",firstRoundDone:!1,problem:null},Fn=new Map;function Tl(t){const e=Fn.get(t);if(e)return e;let n={status:"searching",firstRoundDone:!1,problem:null};const s=new Set;let a=null;const l={onFound:()=>{},getSnapshot:()=>n,subscribe:u=>(s.add(u),a??=kl({candidates:t.split(" "),probe:Sl,onFound:o=>l.onFound(o),onChange:o=>{n=o;for(const i of s)i()}}),()=>{s.delete(u),!(s.size>0)&&(a?.(),a=null,Fn.delete(t))})};return Fn.set(t,l),l}function aa(){return E.useSyncExternalStore(El,fr,fr)}const Cl=()=>()=>{},ur=()=>Nl,fr=()=>ra;function Gu(t){const e=ue.c(9),{candidates:n,onFound:s}=t,[a,l]=E.useState(!1),u=aa(),i=(u==="granted"||u==="unsupported"||u==="prompt"&&a)&&n.length>0;let c;e[0]!==i||e[1]!==n||e[2]!==s?(c=i?Tl(n.join(" ")):null,c&&(c.onFound=s),e[0]=i,e[1]=n,e[2]=s,e[3]=c):c=e[3];const m=E.useSyncExternalStore(c?.subscribe??Cl,c?.getSnapshot??ur,c?.getSnapshot??ur),f=u==="prompt"&&!a;let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=()=>l(!0),e[4]=p):p=e[4];let k;return e[5]!==u||e[6]!==m||e[7]!==f?(k={state:m,access:u,needsGesture:f,start:p},e[5]=u,e[6]=m,e[7]=f,e[8]=k):k=e[8],k}const pr={mode:"none",iframeBase:null,showBlockingOverlay:!1,showWakingPill:!1};function Rl(t){const{previewState:e,progressStatus:n,fastPreviewActive:s=!1,fastPreviewReady:a=!1,codingSession:l=!1,hostedDraft:u=!1}=t,o=l?null:t.previewServerUrl;return t.localPreviewUrl?{mode:"sandbox",iframeBase:t.localPreviewUrl,showBlockingOverlay:!1,showWakingPill:!1}:e.kind==="suspended"||e.kind==="errored"?pr:u&&t.hostedPointerPending&&!a?{...pr,showDecidingLoader:!0}:s&&a&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:s&&u&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:!s&&e.kind==="iframe"&&n!=="doing"?{mode:"sandbox",iframeBase:e.previewUrl,showBlockingOverlay:!1,showWakingPill:!1}:o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!0}:{mode:"none",iframeBase:null,showBlockingOverlay:!0,showWakingPill:!1}}const Ll=1e4,Al=1e3,_l=3e4;function Ol({iframeRef:t,src:e,active:n}){const s=E.useRef(0),a=E.useRef(null),l=E.useRef(null),u=E.useRef(e),o=E.useRef(n);u.current=e,o.current=n;const i=()=>{a.current&&clearTimeout(a.current),l.current&&clearTimeout(l.current),a.current=null,l.current=null},c=()=>{a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{a.current=null,m()},Ll)},m=()=>{if(!o.current||!u.current)return;l.current&&clearTimeout(l.current);const k=ni(_l,Al,s.current,2,.5);s.current+=1,l.current=setTimeout(()=>{l.current=null;const g=t.current,v=u.current;!g||!v||!o.current||(g.src=v,c())},k)},f=()=>{s.current=0,i()},p=()=>{a.current&&(clearTimeout(a.current),a.current=null),m()};return E.useEffect(()=>{if(i(),s.current=0,!(!n||!e))return c(),i},[e,n]),{handleLoad:f,handleError:p}}const Dl=1500,Fl=500;function $l({iframe:t,reload:e,waitMs:n=Dl,confirmMs:s=Fl}){let a;const l=()=>{clearTimeout(u),a=setTimeout(e,s)};t.addEventListener("load",l,{once:!0});const u=setTimeout(()=>{t.removeEventListener("load",l),e()},n);return()=>{clearTimeout(u),clearTimeout(a),t.removeEventListener("load",l)}}const Bl=cn({tag:De(),id:De(),classes:De(),text:De(),html:De(),manifestKey:De().nullable(),componentName:De().nullable(),parents:De(),url:De(),path:De(),viewport:cn({width:ct(),height:ct()}),position:cn({x:ct(),y:ct()})}),Ml=`(function() {
3
- if (window.__visualEditorActive) return;
4
- window.__visualEditorActive = true;
5
-
6
- var cursorStyle = document.createElement("style");
7
- cursorStyle.textContent = "* { cursor: default !important; }";
8
- document.head.appendChild(cursorStyle);
9
-
10
- var highlight = document.createElement("div");
11
- highlight.style.cssText = "position:fixed;pointer-events:none;outline:2px solid #a855f7;background:rgba(168,85,247,0.08);border-radius:2px;z-index:2147483647;display:none;";
12
- document.body.appendChild(highlight);
13
-
14
- var badge = document.createElement("div");
15
- badge.style.cssText = "position:fixed;pointer-events:none;background:#a855f7;color:white;font:11px/1 monospace;padding:2px 6px;border-radius:2px;z-index:2147483647;display:none;white-space:nowrap;max-width:240px;overflow:hidden;text-overflow:ellipsis;";
16
- document.body.appendChild(badge);
17
-
18
- var lastTarget = null;
19
- var rafPending = false;
20
- var moveHandler = function(e) {
21
- if (rafPending) return;
22
- rafPending = true;
23
- var target = e.target;
24
- requestAnimationFrame(function() {
25
- rafPending = false;
26
- var el = target;
27
- if (!el || el === highlight || el === badge) return;
28
- if (el === lastTarget) return;
29
- lastTarget = el;
30
- var r = el.getBoundingClientRect();
31
- highlight.style.display = "block";
32
- highlight.style.top = r.top + "px";
33
- highlight.style.left = r.left + "px";
34
- highlight.style.width = r.width + "px";
35
- highlight.style.height = r.height + "px";
36
- var tag = el.tagName.toLowerCase();
37
- var id = el.id ? "#" + el.id : "";
38
- var cls = el.className && typeof el.className === "string"
39
- ? "." + el.className.trim().split(/\\s+/).slice(0, 2).join(".")
40
- : "";
41
- badge.textContent = tag + id + cls;
42
- badge.style.display = "block";
43
- badge.style.top = Math.max(0, r.top - 20) + "px";
44
- badge.style.left = r.left + "px";
45
- });
46
- };
47
- document.addEventListener("mousemove", moveHandler, true);
48
-
49
- var outHandler = function(e) {
50
- if (!e.relatedTarget || e.relatedTarget === document.documentElement) {
51
- highlight.style.display = "none";
52
- badge.style.display = "none";
53
- lastTarget = null;
54
- }
55
- };
56
- document.addEventListener("mouseout", outHandler, true);
57
-
58
- var clickHandler = function(e) {
59
- e.preventDefault();
60
- e.stopImmediatePropagation();
61
- var el = e.target;
62
- if (!el || el === highlight || el === badge) return;
63
-
64
- highlight.style.outline = "2px solid #a855f7";
65
- highlight.style.background = "rgba(168,85,247,0.15)";
66
- setTimeout(function() {
67
- highlight.style.outline = "2px solid #a855f7";
68
- highlight.style.background = "rgba(168,85,247,0.08)";
69
- }, 400);
70
-
71
- var tag = el.tagName.toLowerCase();
72
- var id = el.id || "";
73
- var classes = el.className && typeof el.className === "string" ? el.className.trim() : "";
74
- var text = (el.textContent || "").trim().slice(0, 200);
75
- var html = (el.outerHTML || "").slice(0, 800).replace(/\\svalue=("[^"]*"|'[^']*'|\\S+)/gi, "");
76
-
77
- var closestSection = el.closest("section[data-manifest-key]");
78
- var manifestKey = closestSection ? closestSection.getAttribute("data-manifest-key") : null;
79
-
80
- var ancestor = el;
81
- var componentName = null;
82
- for (var i = 0; i < 10 && ancestor; i++) {
83
- if (ancestor.dataset) componentName = ancestor.dataset.componentName || componentName;
84
- ancestor = ancestor.parentElement;
85
- }
86
-
87
- var parents = [];
88
- var p = el.parentElement;
89
- for (var j = 0; j < 4 && p && p !== document.body; j++) {
90
- var pTag = p.tagName ? p.tagName.toLowerCase() : "";
91
- var pId = p.id ? "#" + p.id : "";
92
- var pCls = p.className && typeof p.className === "string"
93
- ? "." + p.className.trim().split(/\\s+/)[0]
94
- : "";
95
- parents.unshift(pTag + pId + pCls);
96
- p = p.parentElement;
97
- }
98
-
99
- window.parent.postMessage({
100
- type: "visual-editor::element-clicked",
101
- payload: {
102
- tag: tag, id: id, classes: classes, text: text, html: html,
103
- manifestKey: manifestKey, componentName: componentName,
104
- parents: parents.join(" > "),
105
- url: window.location.href, path: window.location.pathname,
106
- viewport: { width: window.innerWidth, height: window.innerHeight },
107
- position: { x: Math.round(e.clientX), y: Math.round(e.clientY) }
108
- }
109
- }, "*");
110
- };
111
- document.addEventListener("click", clickHandler, true);
112
-
113
- window.addEventListener("message", function(e) {
114
- // Only Studio's own postMessage (source === this frame's parent) may drive the bridge — a nested/downstream frame's forged message can't deactivate the editor.
115
- if (e.source !== window.parent) return;
116
- // Parent-driven clear: the cross-origin iframe can't self-detect a frame exit.
117
- if (e.data && e.data.type === "visual-editor::clear-hover") {
118
- highlight.style.display = "none";
119
- badge.style.display = "none";
120
- lastTarget = null;
121
- return;
122
- }
123
- if (e.data && e.data.type === "visual-editor::deactivate") {
124
- highlight.remove();
125
- badge.remove();
126
- cursorStyle.remove();
127
- document.removeEventListener("mousemove", moveHandler, true);
128
- document.removeEventListener("mouseout", outHandler, true);
129
- document.removeEventListener("click", clickHandler, true);
130
- window.__visualEditorActive = false;
131
- }
132
- });
133
- })();`;function Ul(t,e){const n=t.map(()=>null),s=[];for(let v=0;v<t.length;v++)t[v]!==null&&s.push(v);const a=s.length,l=e.length;if(!a||!l)return n;const u=(v,h)=>{const x=t[s[v]??0];return!x||!x.length?1:x.indexOf(e[h]??"")>=0?2:0},o=[],i=[];for(let v=0;v<=a;v++)o.push(new Array(l+1).fill(0)),i.push(new Array(l+1).fill(2));for(let v=1;v<=a;v++){const h=o[v-1]??[],x=o[v]??[],C=i[v]??[];for(let b=1;b<=l;b++){let w=h[b]??0,N=2;const j=x[b-1]??0;j>w&&(w=j,N=0);const P=u(v-1,b-1),S=(h[b-1]??0)+P;P>0&&S>w&&(w=S,N=1),x[b]=w,C[b]=N}}let c=0,m=a,f=l;for(;m>0&&f>0;){const v=i[m]?.[f]??2;v===1?(n[s[m-1]??0]=f-1,c++,m--,f--):v===0?f--:m--}const p=new Array(l).fill(!1);for(const v of s){const h=n[v];h!=null&&(p[h]=!0)}const k=(v,h)=>{const x=t[v];return!!x&&x.length>0&&x.indexOf(e[h]??"")>=0},g=(v,h)=>{for(const x of s){const C=n[x];if(!(C==null||e[C]!==e[h])&&x<v!=C<h)return!1}return!0};for(const v of s)if(n[v]===null){for(let h=0;h<l;h++)if(!p[h]&&k(v,h)&&g(v,h)){n[v]=h,p[h]=!0,c++;break}}if(c===0&&l===a)for(let v=0;v<a;v++)n[s[v]??0]=v;return n}const Il=cn({sectionIndex:ct(),manifestKey:De(),clickSeq:ct()}),zl=`(function() {
134
- if (window.__cmsEditorActive) return;
135
- window.__cmsEditorActive = true;
136
-
137
- // Preserve scroll across variant-override navigations and save-reloads.
138
- // Selecting a variant rebuilds the iframe src (new x-deco-matchers-override)
139
- // or reloads it, which would otherwise jump to the top. We persist the scroll
140
- // offset to sessionStorage (survives reload, same-origin) keyed by pathname
141
- // (the override only changes the query, so the key is stable), then restore it
142
- // on the next load — retried for ~1s so it outlasts re-hydration and lazy
143
- // sections that grow the page after load. The recency guard avoids restoring a
144
- // stale offset on a genuinely fresh visit.
145
- var SCROLL_KEY = "__cms_preview_scroll:" + location.pathname;
146
- var saveScroll = function() {
147
- try {
148
- sessionStorage.setItem(SCROLL_KEY, JSON.stringify({
149
- x: window.scrollX, y: window.scrollY, t: Date.now()
150
- }));
151
- } catch (_) {}
152
- };
153
- var saveScrollPending = false;
154
- window.addEventListener("scroll", function() {
155
- if (saveScrollPending) return;
156
- saveScrollPending = true;
157
- requestAnimationFrame(function() { saveScrollPending = false; saveScroll(); });
158
- }, { passive: true });
159
- (function restoreScroll() {
160
- var raw = null;
161
- try { raw = sessionStorage.getItem(SCROLL_KEY); } catch (_) {}
162
- if (!raw) return;
163
- var saved = null;
164
- try { saved = JSON.parse(raw); } catch (_) { return; }
165
- if (!saved || (Date.now() - saved.t) > 10000) return;
166
- if (!saved.x && !saved.y) return;
167
- var attempts = 0;
168
- var apply = function() {
169
- attempts++;
170
- window.scrollTo(saved.x || 0, saved.y || 0);
171
- if (attempts < 8) setTimeout(apply, 120);
172
- };
173
- apply();
174
- })();
175
-
176
- var highlight = document.createElement("div");
177
- highlight.style.cssText = "position:absolute;pointer-events:none;outline:2px solid #06b6d4;background:rgba(6,182,212,0.06);border-radius:2px;z-index:2147483647;display:none;";
178
- document.body.appendChild(highlight);
179
-
180
- var badge = document.createElement("div");
181
- badge.style.cssText = "position:absolute;pointer-events:none;background:#06b6d4;color:white;font:11px/1 monospace;padding:2px 6px;border-radius:2px;z-index:2147483647;display:none;white-space:nowrap;max-width:240px;overflow:hidden;text-overflow:ellipsis;";
182
- document.body.appendChild(badge);
183
-
184
- var isTopLevelSection = function(el) {
185
- return el && el.parentElement
186
- ? !el.parentElement.closest("section[data-manifest-key]")
187
- : true;
188
- };
189
-
190
- // All top-level page sections in DOM order (deco renders page sections as
191
- // <section data-manifest-key>; nested islands/sections carry the attribute
192
- // too, hence the top-level filter). This is the full DOM run, framework
193
- // sections included — getAllSections() narrows it to the editable window.
194
- var topLevelSections = function() {
195
- return Array.from(document.querySelectorAll("section[data-manifest-key]"))
196
- .filter(isTopLevelSection);
197
- };
198
-
199
- // Acceptable DOM keys per section; [] = wildcard, null = renders nothing.
200
- var sectionCandidates = [];
201
-
202
- // Stringified from section-alignment.ts so both sides share one copy.
203
- var alignSections = ${Ul.toString()};
204
-
205
- // Indexed like the decofile array; unmapped entries stay null (not clickable).
206
- var computeAlignment = function(tops) {
207
- var domKeys = tops.map(function(s) { return s.getAttribute("data-manifest-key"); });
208
- return alignSections(sectionCandidates, domKeys).map(function(idx) {
209
- return idx === null ? null : tops[idx];
210
- });
211
- };
212
-
213
- // Editable sections, indexed to match the decofile array the panel uses.
214
- // Recomputed from the live DOM each call (cheap, rAF-throttled) so it
215
- // self-heals as client-rendered/lazy sections mount. Until the editor sends
216
- // candidates, fall back to the full top-level run.
217
- var getAllSections = function() {
218
- var tops = topLevelSections();
219
- return sectionCandidates.length ? computeAlignment(tops) : tops;
220
- };
221
-
222
- // Resolve to the OUTERMOST page-level section (clicking nested content still
223
- // maps to the top-level section the panel indexes); null if it isn't in the
224
- // aligned editable set (a framework section deco injected).
225
- var findSection = function(el, out) {
226
- var node = el;
227
- var found = null;
228
- while (node && node !== document.body) {
229
- if (node.tagName === "SECTION" && node.hasAttribute && node.hasAttribute("data-manifest-key")) {
230
- found = node;
231
- }
232
- node = node.parentElement;
233
- }
234
- if (!found) return null;
235
- var sections = getAllSections();
236
- if (out) out.sections = sections;
237
- return sections.indexOf(found) >= 0 ? found : null;
238
- };
239
-
240
- // A Lazy wrapper's key is just the loader — show the inner section's instead.
241
- var LAZY_KEYS = [
242
- "website/sections/Rendering/Lazy.tsx",
243
- "website/sections/Rendering/SingleDeferred.tsx"
244
- ];
245
- var isLazyKey = function(key) {
246
- return LAZY_KEYS.some(function(s) { return key.endsWith(s); });
247
- };
248
- var displayKey = function(section) {
249
- var key = section.getAttribute("data-manifest-key") || "section";
250
- if (isLazyKey(key)) {
251
- var inner = section.querySelector("section[data-manifest-key]");
252
- if (inner) return inner.getAttribute("data-manifest-key") || key;
253
- }
254
- return key;
255
- };
256
-
257
- // Per-section metadata sent by the editor, aligned by index with
258
- // getAllSections(). labels: names the DOM can't carry (a global section or a
259
- // global inside async rendering); kinds: section type that drives the color.
260
- var sectionLabels = [];
261
- var sectionKinds = [];
262
- var labelFor = function(section, sections) {
263
- var idx = (sections || getAllSections()).indexOf(section);
264
- if (idx >= 0 && sectionLabels[idx]) return sectionLabels[idx];
265
- return displayKey(section);
266
- };
267
- var kindFor = function(section, sections) {
268
- var idx = (sections || getAllSections()).indexOf(section);
269
- return (idx >= 0 && sectionKinds[idx]) || "normal";
270
- };
271
-
272
- // Highlight palette by section kind: global = light purple, variant = green,
273
- // normal = blue.
274
- var COLORS = {
275
- normal: { solid: "#06b6d4", bg: "rgba(6,182,212,0.06)", active: "rgba(6,182,212,0.18)" },
276
- global: { solid: "#c084fc", bg: "rgba(192,132,252,0.10)", active: "rgba(192,132,252,0.22)" },
277
- variant: { solid: "#22c55e", bg: "rgba(34,197,94,0.08)", active: "rgba(34,197,94,0.20)" }
278
- };
279
- var applyColor = function(kind) {
280
- var c = COLORS[kind] || COLORS.normal;
281
- highlight.style.outline = "2px solid " + c.solid;
282
- highlight.style.background = c.bg;
283
- badge.style.background = c.solid;
284
- };
285
-
286
- var lastSection = null;
287
- var lastLabel = "";
288
- var lastKind = "normal";
289
- var rafPending = false;
290
- // True while an in-place render fetch/swap is in flight; suppresses hover so it can't re-show the overlay right before the swap snapshots it.
291
- var renderPending = false;
292
-
293
- // Document-relative coordinates (rect + scroll) on absolutely-positioned
294
- // nodes, so the browser scrolls the highlight together with the page
295
- // natively — no per-frame JS repositioning, no scroll lag.
296
- var positionHighlight = function(section) {
297
- var r = section.getBoundingClientRect();
298
- var top = r.top + window.scrollY;
299
- var left = r.left + window.scrollX;
300
- highlight.style.display = "block";
301
- highlight.style.top = top + "px";
302
- highlight.style.left = left + "px";
303
- highlight.style.width = r.width + "px";
304
- highlight.style.height = r.height + "px";
305
- badge.textContent = lastLabel || displayKey(section);
306
- badge.style.display = "block";
307
- badge.style.top = Math.max(0, top - 20) + "px";
308
- badge.style.left = left + "px";
309
- };
310
-
311
- var moveHandler = function(e) {
312
- if (renderPending || rafPending) return;
313
- rafPending = true;
314
- var target = e.target;
315
- requestAnimationFrame(function() {
316
- rafPending = false;
317
- if (renderPending) return;
318
- if (!target || target === highlight || target === badge) return;
319
- var out = {};
320
- var section = findSection(target, out);
321
- if (section === lastSection) return;
322
- lastSection = section;
323
- if (!section) {
324
- highlight.style.display = "none";
325
- badge.style.display = "none";
326
- return;
327
- }
328
- lastLabel = labelFor(section, out.sections);
329
- lastKind = kindFor(section, out.sections);
330
- applyColor(lastKind);
331
- positionHighlight(section);
332
- });
333
- };
334
- document.addEventListener("mousemove", moveHandler, true);
335
-
336
- // Window scroll is handled natively by the absolute positioning above; this
337
- // only re-syncs on resize and on scrolls inside nested scroll containers
338
- // (capture=true catches those), where document coordinates do shift.
339
- var reposition = function() {
340
- if (!lastSection || highlight.style.display === "none") return;
341
- if (rafPending) return;
342
- rafPending = true;
343
- requestAnimationFrame(function() {
344
- rafPending = false;
345
- if (lastSection && highlight.style.display !== "none") positionHighlight(lastSection);
346
- });
347
- };
348
- window.addEventListener("scroll", reposition, { capture: true, passive: true });
349
- window.addEventListener("resize", reposition, { passive: true });
350
-
351
- var outHandler = function(e) {
352
- if (!e.relatedTarget || e.relatedTarget === document.documentElement) {
353
- highlight.style.display = "none";
354
- badge.style.display = "none";
355
- lastSection = null;
356
- }
357
- };
358
- document.addEventListener("mouseout", outHandler, true);
359
-
360
- var clickSeq = 0;
361
-
362
- // Blocks observes clicks to select sections in the side panel; it must not
363
- // cancel the iframe page's own handlers or native control behavior.
364
- var clickHandler = function(e) {
365
- var target = e.target;
366
- if (!target || target === highlight || target === badge) return;
367
- var out = {};
368
- var section = findSection(target, out);
369
- if (!section) return;
370
-
371
- var sectionIndex = out.sections.indexOf(section);
372
- var manifestKey = section.getAttribute("data-manifest-key") || "";
373
-
374
- var c = COLORS[lastKind] || COLORS.normal;
375
- highlight.style.outline = "2px solid " + c.solid;
376
- highlight.style.background = c.active;
377
- setTimeout(function() {
378
- highlight.style.background = c.bg;
379
- }, 400);
380
-
381
- clickSeq++;
382
- window.parent.postMessage({
383
- type: "cms-editor::section-clicked",
384
- payload: { sectionIndex: sectionIndex, manifestKey: manifestKey, clickSeq: clickSeq }
385
- }, "*");
386
- };
387
- document.addEventListener("click", clickHandler, true);
388
-
389
- /**
390
- * Navigation is disabled while editing: leaving the page would leave the
391
- * panel editing the previous page's sections. Only the default action of a
392
- * real navigation is cancelled, never propagation — in-page controls must
393
- * keep working (#5567).
394
- */
395
- var isNavigatingAnchor = function(a) {
396
- if (!a) return false;
397
- var href = a.getAttribute("href");
398
- if (!href) return false;
399
- var trimmed = href.trim();
400
- if (!trimmed || trimmed.charAt(0) === "#") return false;
401
- if (/^javascript:/i.test(trimmed)) return false;
402
- // Same document + fragment only scrolls.
403
- try {
404
- var url = new URL(a.href, location.href);
405
- if (url.href.split("#")[0] === location.href.split("#")[0]) return false;
406
- } catch (_) {}
407
- return true;
408
- };
409
- var navBlocker = function(e) {
410
- var el = e.target;
411
- var a = el && el.closest ? el.closest("a") : null;
412
- if (!isNavigatingAnchor(a)) return;
413
- e.preventDefault();
414
- };
415
- document.addEventListener("click", navBlocker, true);
416
-
417
- var submitBlocker = function(e) { e.preventDefault(); };
418
- document.addEventListener("submit", submitBlocker, true);
419
-
420
- // Fast Preview in-place render: POST merged decofile to /live/previews, swap the HTML in (document/window listeners survive; overlay nodes get re-attached).
421
- var renderCtrl = null;
422
- var renderQueue = Promise.resolve();
423
- var TRANSITION_TAG =
424
- "<style id=\\"deco-disable-transitions\\">* { transition: none !important; }</style></head>";
425
-
426
- // A skipped view transition rejects its promises with "AbortError:
427
- // Transition was skipped"; nobody else waits on them, so they are settled
428
- // here rather than left as uncaught errors in the page's console.
429
- var settleTransition = function(vt) {
430
- if (!vt) return;
431
- var ignore = function() {};
432
- if (vt.ready) vt.ready.catch(ignore);
433
- if (vt.updateCallbackDone) vt.updateCallbackDone.catch(ignore);
434
- if (vt.finished) vt.finished.catch(ignore);
435
- };
436
-
437
- // A site that opts into cross-document view transitions
438
- // (@view-transition { navigation: auto }) gets one on every reload a save
439
- // makes. When the next save navigates the frame before that transition
440
- // starts, the browser skips it and rejects the outgoing page's ready
441
- // promise, which only a pageswap listener can reach. Kept after deactivate:
442
- // settling changes nothing else, and the frame may still navigate.
443
- if (!window.__cmsEditorPageSwap) {
444
- window.__cmsEditorPageSwap = true;
445
- window.addEventListener("pageswap", function(e) {
446
- settleTransition(e.viewTransition);
447
- });
448
- }
449
-
450
- // A quick second save skips the running transition. Only finished says
451
- // when the swap is over, so the chain waits on it; the rest is settled.
452
- var runSwapTransition = function(swap) {
453
- if (typeof document.startViewTransition !== "function") {
454
- swap();
455
- return Promise.resolve();
456
- }
457
- var vt = document.startViewTransition(swap);
458
- settleTransition(vt);
459
- return vt.finished;
460
- };
461
- var renderInPlace = function(src, body) {
462
- if (renderCtrl) renderCtrl.abort();
463
- var ctrl = new AbortController();
464
- renderCtrl = ctrl;
465
- renderPending = true;
466
- highlight.style.display = "none";
467
- badge.style.display = "none";
468
- window.parent.postMessage({ type: "cms-editor::render-start" }, "*");
469
- renderQueue = renderQueue.then(function() {
470
- return fetch(src, {
471
- method: "POST",
472
- body: body,
473
- signal: ctrl.signal,
474
- headers: { accept: "text/html", "content-type": "application/json" }
475
- }).then(function(res) {
476
- if (!res.ok) throw new Error("render " + res.status);
477
- return res.text();
478
- }).then(function(html) {
479
- var swap = function() {
480
- document.documentElement.innerHTML = html.replace("</head>", TRANSITION_TAG);
481
- document.body.appendChild(highlight);
482
- document.body.appendChild(badge);
483
- // Old section is gone; hide the overlay until the next hover repositions it.
484
- highlight.style.display = "none";
485
- badge.style.display = "none";
486
- lastSection = null;
487
- };
488
- var headHtml = html.slice(html.indexOf("<head>"), html.indexOf("</head>") + 7);
489
- var doc = new DOMParser().parseFromString(headHtml, "text/html");
490
- var sheets = Array.prototype.map.call(
491
- doc.head.querySelectorAll("link[rel=\\"stylesheet\\"]"),
492
- function(el) { return el.href ? fetch(el.href).catch(function() {}) : null; }
493
- );
494
- return Promise.all(sheets).then(function() {
495
- return runSwapTransition(swap);
496
- });
497
- }).then(function() {
498
- var t = document.getElementById("deco-disable-transitions");
499
- if (t) t.remove();
500
- if (ctrl === renderCtrl) renderPending = false;
501
- window.parent.postMessage({ type: "cms-editor::render-end" }, "*");
502
- }).catch(function(err) {
503
- if (ctrl === renderCtrl) renderPending = false;
504
- if (err && err.name === "AbortError") return;
505
- window.parent.postMessage({ type: "cms-editor::render-error" }, "*");
506
- });
507
- });
508
- };
509
-
510
- window.addEventListener("message", function(e) {
511
- // Only Studio's own postMessage (source === this frame's parent) may drive the bridge — forged senders can't trigger the render fetch/swap.
512
- if (e.source !== window.parent) return;
513
- if (e.data && e.data.type === "cms-editor::render" && typeof e.data.src === "string") {
514
- renderInPlace(e.data.src, e.data.body);
515
- return;
516
- }
517
- if (e.data && e.data.type === "cms-editor::set-labels" && Array.isArray(e.data.labels)) {
518
- sectionLabels = e.data.labels;
519
- if (Array.isArray(e.data.kinds)) sectionKinds = e.data.kinds;
520
- if (Array.isArray(e.data.keys)) sectionCandidates = e.data.keys;
521
- if (lastSection) {
522
- lastLabel = labelFor(lastSection);
523
- lastKind = kindFor(lastSection);
524
- applyColor(lastKind);
525
- if (highlight.style.display !== "none") positionHighlight(lastSection);
526
- }
527
- return;
528
- }
529
- // Parent-driven clear: the cross-origin iframe can't self-detect a frame exit.
530
- if (e.data && e.data.type === "cms-editor::clear-hover") {
531
- highlight.style.display = "none";
532
- badge.style.display = "none";
533
- lastSection = null;
534
- return;
535
- }
536
- if (e.data && e.data.type === "cms-editor::deactivate") {
537
- highlight.remove();
538
- badge.remove();
539
- document.removeEventListener("mousemove", moveHandler, true);
540
- document.removeEventListener("mouseout", outHandler, true);
541
- document.removeEventListener("click", clickHandler, true);
542
- // Or the page stays unnavigable after leaving Blocks mode.
543
- document.removeEventListener("click", navBlocker, true);
544
- document.removeEventListener("submit", submitBlocker, true);
545
- window.removeEventListener("scroll", reposition, { capture: true });
546
- window.removeEventListener("resize", reposition);
547
- window.__cmsEditorActive = false;
548
- }
549
- });
550
- })();`,rn=Object.freeze({ready:"deco:ready",load:"deco:load",loaded:"deco:loaded",loadError:"deco:load-error"}),Kl="v1",Hl="/studio-modules",$n=["wireframe","html-swap"];function Vl(t,e,n){const s=new URL(`${Hl}/${Kl}/${e}.js`,t);return n&&s.searchParams.set("build",n),s.href}const Wl=2e3;class ql{constructor(e){this.options=e,this.urls=Object.fromEntries($n.map(n=>[n,Vl(e.studioOrigin,n,e.build)]))}options;origin=null;urls;loaded=new Set;swapId=0;pendingSwap=null;startTimer=null;has(e){return this.loaded.has(e)}handle(e){const n=this.options.frame();if(!n||e.source!==n)return!1;const s=e.data;if(!s||typeof s.type!="string")return!1;if(s.type===rn.ready)return Gl(e.origin)?(this.ready(e.origin),!0):!1;if(e.origin!==this.origin)return!1;const a=s;switch(a.type){case rn.loaded:{const l=this.nameOf(a.url);return l&&(this.loaded.add(l),this.options.onModulesChange?.(),l==="wireframe"&&this.options.onWireframeReady?.()),!0}case rn.loadError:{const l=this.nameOf(a.url);return l&&this.loaded.delete(l)&&this.options.onModulesChange?.(),l==="html-swap"&&this.failSwap(),!0}case"wireframe:hover":case"wireframe:select":return this.options.onWireframe?.(a),!0;case"html-swap:start":return this.pendingSwap?.id===a.id&&(this.pendingSwap.started=!0,this.clearStartTimer()),!0;case"html-swap:end":return this.pendingSwap?.id!==a.id||(this.pendingSwap=null,this.clearStartTimer(),this.options.onSwapEnd?.()),!0;case"html-swap:error":return this.pendingSwap?.id===a.id&&this.failSwap(),!0;default:return!1}}wireframe(e){return this.post("wireframe",e)}refresh(e){if(e!==void 0&&!this.isFrameOrigin(e))return!1;const n=++this.swapId,s=e?{type:"html-swap:refresh",id:n,url:e}:{type:"html-swap:refresh",id:n};return this.post("html-swap",s)?(this.pendingSwap={id:n,started:!1},this.clearStartTimer(),this.startTimer=setTimeout(()=>{this.startTimer=null,this.pendingSwap?.id===n&&!this.pendingSwap.started&&this.failSwap()},Wl),!0):!1}dispose(){this.clearStartTimer(),this.pendingSwap=null,this.loaded.clear(),this.origin=null}ready(e){this.origin=e,this.loaded.size&&(this.loaded.clear(),this.options.onModulesChange?.()),this.pendingSwap&&(this.pendingSwap=null,this.clearStartTimer(),this.options.onSwapEnd?.());const n=this.options.frame();for(const s of $n)n?.postMessage({type:rn.load,url:this.urls[s]},e)}post(e,n){const s=this.options.frame();return!s||!this.origin||!this.loaded.has(e)?!1:(s.postMessage(n,this.origin),!0)}isFrameOrigin(e){try{return new URL(e).origin===this.origin}catch{return!1}}nameOf(e){return $n.find(n=>this.urls[n]===e)??null}failSwap(){this.clearStartTimer(),this.pendingSwap&&(this.pendingSwap=null,this.options.onSwapFailed?.())}clearStartTimer(){this.startTimer&&clearTimeout(this.startTimer),this.startTimer=null}}function Gl(t){if(typeof t!="string"||t==="null")return!1;try{const e=new URL(t).origin;return e!=="null"&&e===t}catch{return!1}}function Vn(t,e,n=!1){let s=t,a=typeof s?.__resolveType=="string"?s.__resolveType:"";for(let l=0;a&&l<5;l++){const u=e[a];if(u&&typeof u=="object"&&"__resolveType"in u){const o=u.__resolveType;if(typeof o=="string"&&o&&o!==a){s=u,a=o;continue}}break}if(!a)return[];if(a.includes("flags/multivariate")||n&&si(a,n)){const l=Array.isArray(s.variants)?s.variants:[];if(l.length===0||l.every(i=>{const c=i?.rule;return ri(c?.__resolveType,n)}))return null;const o=[];for(const i of l){const c=ai(i,n);if(c&&typeof c=="object")for(const m of Vn(c,e,n)??[])o.includes(m)||o.push(m)}return o}if(ii(a)){const l=s.section&&typeof s.section=="object"?Vn(s.section,e,n):[];return l===null?null:l.length?[a,...l]:[a]}return[a]}function lt(t){return t.replace(/[`*_]/g,"\\$&")}function Jl(t,e){const n=[`The user selected an element on the live preview and asked: **"${lt(e.trim())}"**`,"","For text content changes, locate the correct source file and apply the change.","For code and CSS changes, understand which component the user is referring to and apply changes to the correct component.",""];t.manifestKey&&n.push(`**Section resolveType:** \`${lt(t.manifestKey)}\``,"","This is a Deco resolveType, not a literal file path. The leading segment is the app name, not a directory — the actual source file lives under a sections directory whose root varies by site (commonly `sections/`, `src/sections/`, or `site/sections/`). Locate the file by searching for the trailing path (e.g. the component filename), don't assume the resolveType is a valid path on disk.","");const s=`<${t.tag}${t.classes?` class="${lt(t.classes)}"`:""}>`;n.push(`**Clicked element:** \`${s}\``),t.parents&&n.push(`**DOM breadcrumb:** ${lt(t.parents)} > ${t.tag}`),t.text&&n.push(`**Text content:** "${lt(t.text)}"`),t.componentName&&n.push(`**Component name:** ${lt(t.componentName)}`);const a=t.html.replace(/```/g,"`` `");return n.push("","**HTML snippet:**","```html",a,"```"),n.push("","Please read the source file, locate the element, and apply the requested change."),n.join(`
551
- `)}function Yl(t,e,n=320,s=44,a=12){const{x:l,y:u}=t,{width:o,height:i}=e,c=Math.max(a,Math.min(l-n/2,o-n-a)),f=u/i>.68?Math.max(a,u-s-18):Math.min(u+18,i-s-a);return{leftPct:c/o*100,topPct:f/i*100}}function Ql(t){const e=ue.c(45),{element:n,onDismiss:s}=t,[a,l]=E.useState(""),u=E.useRef(null),{sendMessage:o}=Ti(),{openSidePanel:i}=Mo(),c=Te();let m;e[0]!==n||e[1]!==a||e[2]!==s||e[3]!==i||e[4]!==o?(m=()=>{if(!a.trim())return;const K=Jl(n,a);i(),o({parts:[{type:"text",text:K}]}),s()},e[0]=n,e[1]=a,e[2]=s,e[3]=i,e[4]=o,e[5]=m):m=e[5];const f=m;let p;e[6]!==n.position||e[7]!==n.viewport?(p=Yl(n.position,n.viewport),e[6]=n.position,e[7]=n.viewport,e[8]=p):p=e[8];const k=p,g=`${k.leftPct}%`,v=`${k.topPct}%`;let h;e[9]!==g||e[10]!==v?(h={left:g,top:v,width:"320px"},e[9]=g,e[10]=v,e[11]=h):h=e[11];let x;e[12]!==f?(x=K=>{K.preventDefault(),f()},e[12]=f,e[13]=x):x=e[13];let C;e[14]===Symbol.for("react.memo_cache_sentinel")?(C=K=>l(K.target.value),e[14]=C):C=e[14];let b;e[15]!==s?(b=K=>{K.key==="Escape"&&s()},e[15]=s,e[16]=b):b=e[16];let w;e[17]!==c?(w=c("sandbox.visualEditorPrompt.inputPlaceholder"),e[17]=c,e[18]=w):w=e[18];let N;e[19]!==a||e[20]!==b||e[21]!==w?(N=r.jsx("input",{ref:u,autoFocus:!0,type:"text",value:a,onChange:C,onKeyDown:b,placeholder:w,className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),e[19]=a,e[20]=b,e[21]=w,e[22]=N):N=e[22];let j;e[23]!==a?(j=a.trim(),e[23]=a,e[24]=j):j=e[24];const P=!j;let S;e[25]!==c?(S=c("sandbox.visualEditorPrompt.sendButton"),e[25]=c,e[26]=S):S=e[26];let R;e[27]!==c?(R=c("sandbox.visualEditorPrompt.sendButton"),e[27]=c,e[28]=R):R=e[28];let U;e[29]!==R?(U=r.jsx("title",{children:R}),e[29]=R,e[30]=U):U=e[30];let T;e[31]===Symbol.for("react.memo_cache_sentinel")?(T=r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e[31]=T):T=e[31];let A;e[32]!==U?(A=r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[U,T]}),e[32]=U,e[33]=A):A=e[33];let D;e[34]!==P||e[35]!==S||e[36]!==A?(D=r.jsx("button",{type:"submit",disabled:P,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-lg bg-foreground text-background transition-opacity disabled:opacity-30",title:S,children:A}),e[34]=P,e[35]=S,e[36]=A,e[37]=D):D=e[37];let O;e[38]!==N||e[39]!==D||e[40]!==x?(O=r.jsxs("form",{className:"pointer-events-auto flex w-full items-center gap-1.5 rounded-xl glass px-3 py-1.5",onSubmit:x,children:[N,D]}),e[38]=N,e[39]=D,e[40]=x,e[41]=O):O=e[41];let F;return e[42]!==O||e[43]!==h?(F=r.jsx("div",{className:"absolute z-30 pointer-events-none",style:h,children:O}),e[42]=O,e[43]=h,e[44]=F):F=e[44],F}const mr="site-links",Xl=/details?page|\bpdp\b/i,Zl=/listingpage|\bplp\b/i;function ec(t,e,n){const s=new Set;for(const o of n)Xl.test(o)&&s.add("product"),Zl.test(o)&&s.add("category");const a=Bt(Qn(t)),l=a[a.length-1],u=a[a.length-2];return l?.type==="text"&&l.text==="/p"&&u?.type==="param"&&u.name===e&&s.add("product"),e==="*"&&a.some(o=>o.type==="param"&&o.name==="*")&&s.add("category"),s}const tc=["rosa","preto","pink","black"];function an(t,e){const n=e.trim();return n?t(n):tc.flatMap(s=>t(s))}function nc(t,e){const n=e.trim(),s=[];/^\d+$/.test(n)&&s.push({resolveType:t,props:{ids:[n]}});const l=n.includes("-")&&!/\s/.test(n)?n.replace(/-+/g," "):n;return s.push({resolveType:t,props:{query:l,count:10}}),s}const ia=new Set(["vtex","shopify","shopify-mcp","magento","wake","linx","linx-impulse","nuvemshop","vnda","wap","salesforce"]);function Zn(t){return t.split("/")[0]??""}function sc(t){const e=new Set;for(const n of t){const s=Zn(n);ia.has(s)&&e.add(s)}return e}function rc(t,e){const n=Zn(t);return!ia.has(n)||e.size===0?!0:e.has(n)}const ac=[{kind:"product",test:t=>t==="vtex/loaders/intelligentSearch/productList.ts",clientFilter:!1,buildRequests:(t,e)=>an(n=>nc(t,n),e),optionsFromPayload:on},{kind:"product",test:t=>/magento\/.*products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>an(n=>[{resolveType:t,props:{props:{search:n,pageSize:10,currentPage:1}}}],e),optionsFromPayload:on},{kind:"product",test:t=>/algolia\/.*products?\/(list|suggestions)(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>an(n=>[{resolveType:t,props:{term:n,hitsPerPage:10}}],e),optionsFromPayload:on},{kind:"product",test:t=>/products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>an(n=>[{resolveType:t,props:{query:n,term:n,count:10,hitsPerPage:10}}],e),optionsFromPayload:on},{kind:"category",test:t=>t==="vtex/loaders/categories/tree.ts"||/categor(y|ies).*tree/i.test(t),clientFilter:!0,buildRequests:t=>[{resolveType:t,props:{}}],optionsFromPayload:fc}];function ic(t,e,n=new Set){const s=[...e],a=o=>{const i=[];for(const c of ac){if(c.kind!==o)continue;const m=s.find(f=>c.test(f)&&rc(f,n));m&&i.push({cand:c,resolveType:m})}return i.find(c=>n.has(Zn(c.resolveType)))??i[0]},l=(o,i,c)=>({kind:o.kind,id:`${o.kind}:${i}`,resolveType:i,clientFilter:o.clientFilter,isFallback:c,buildRequests:m=>o.buildRequests(i,m),optionsFromPayload:o.optionsFromPayload}),u=[];for(const o of["product","category"]){if(!t.has(o))continue;const i=a(o);i&&u.push(l(i.cand,i.resolveType,!1))}return t.size>0&&u.push(oc(t.has("category")?"category":"product")),u}function oc(t){return{kind:t,id:mr,resolveType:mr,clientFilter:!0,isFallback:!0,homepageLinks:!0,optionsFromPayload:(e,n)=>vc(e,n)}}function et(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function lc(t,e,n){const s=new Set,a=new Set,l=u=>{if(Array.isArray(u)){for(const c of u)l(c);return}const o=et(u);if(!o)return;const i=o.__resolveType;if(typeof i=="string"){if(n(i))s.add(i);else if(i in e&&!a.has(i)){a.add(i);const c=et(e[i])?.__resolveType;typeof c=="string"&&n(c)&&s.add(i),l(e[i])}}for(const c of Object.values(o))l(c)};return l(t),s}function oa(t){const e=new Set,n=[];for(const s of t)for(const a of s)e.has(a.value)||(e.add(a.value),n.push(a));return n}function la(t){try{return decodeURIComponent(t)}catch{return t}}function cc(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function dc(t){const e=[];let n="^";for(const s of t)s.type==="text"?n+=cc(s.text):(e.push(s.name),n+=s.name==="*"?"(.+)":"([^/]+)");return{pattern:new RegExp(`${n}$`),order:e}}function ca(t,e,n){if(typeof t!="string"||!t)return null;let s;try{s=new URL(t,"https://placeholder.invalid").pathname}catch{return null}s=s.replace(/\/+$/,"");const a=Bt(Qn(e)),{pattern:l,order:u}=dc(a),o=u.indexOf(n);if(o===-1)return null;const i=s.match(l);if(!i)return null;const c=i[o+1]?.replace(/^\/+|\/+$/g,"");return c?la(c):null}function on(t,e){const n=et(t),s=Array.isArray(t)?t:Array.isArray(n?.products)?n.products:Array.isArray(n?.list)?n.list:[],a=[],l=new Set;for(const u of s){const o=et(u);if(!o)continue;const i=ca(o.url,e.template,e.paramName);if(!i||l.has(i))continue;l.add(i);const c=et(o.isVariantOf),m=typeof c?.name=="string"&&c.name||typeof o.name=="string"&&o.name||i,f=Array.isArray(o.image)?et(o.image[0]):null,p=typeof f?.url=="string"?f.url:void 0;a.push({value:i,label:m,image:p})}return a}function uc(t){if(typeof t!="string"||!t)return null;let e;try{e=new URL(t,"https://placeholder.invalid").pathname}catch{return null}const n=e.replace(/^\/+|\/+$/g,"");return n?la(n):null}function fc(t){const e=[],n=new Set,s=(a,l)=>{const u=et(a);if(!u)return;const o=typeof u.name=="string"&&u.name?u.name:"",i=o?[...l,o]:l,c=uc(u.url);if(c&&!n.has(c)&&(n.add(c),e.push({value:c,label:i.join(" › ")||c})),Array.isArray(u.children))for(const m of u.children)s(m,i)};if(Array.isArray(t))for(const a of t)s(a,[]);return e}const pc=new Set(["login","logout","signin","sign-in","signup","sign-up","register","account","myaccount","my-account","minha-conta","conta","cart","carrinho","checkout","wishlist","favoritos","favorites","orders","pedidos","help","hc","sac","atendimento","contato","contact","institucional","newsletter","customer","sales","catalogsearch","search","busca","privacy-policy-cookie-restriction-mode"]);function mc(t){return(t.split("/").filter(Boolean).pop()??t).replace(/[-_]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,n=>n.toUpperCase())}function hc(t){if(typeof t!="string"||!t)return[];const e=[],n=/<a\b[^>]*?\bhref="([^"]+)"[^>]*>([\s\S]*?)<\/a>/gi;let s,a=0;for(;(s=n.exec(t))!==null&&a++<5e3;){const l=s[1]??"",u=(s[2]??"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();e.push({href:l,text:u})}return e}function gc(t){if(typeof t!="string"||!t)return[];const e=[],n=new Set,s=/"@type":"Product"[\s\S]{0,600}?(?:"url"|\burl):"([^"]+)"[\s\S]{0,300}?(?:"name"|\bname):"([^"]+)"/g,a=/(?:"image"|\bimage):\s*\[\s*\{[\s\S]{0,400}?(?:"url"|\burl):"([^"]+)"/;let l,u=0;for(;(l=s.exec(t))!==null&&u++<3e3;){const o=(l[1]??"").replace(/\\\//g,"/");if(!o||n.has(o))continue;n.add(o);const i=t.slice(l.index,l.index+900).match(a)?.[1]?.replace(/\\\//g,"/");e.push({url:o,name:l[2]??"",image:i||void 0})}return e}function vc(t,e){const n=[],s=new Set,a=(l,u,o,i)=>{if(n.length>=200)return;const c=ca(l,e.template,e.paramName);!c||s.has(c)||e.paramName==="*"&&/(^|\/)p$/.test(c)||o==="category"&&pc.has(c.split("/")[0]??"")||(s.add(c),n.push({value:c,label:u&&u.length<=80?u:mc(c),kind:o,image:i}))};for(const{url:l,name:u,image:o}of gc(t))a(l,u,"product",o);for(const{href:l,text:u}of hc(t))l.startsWith("/")&&!l.startsWith("//")&&a(l,u,"category");return n}function Dt(t,e,n=50){const s=e.trim().toLowerCase();return(s?t.filter(l=>l.label.toLowerCase().includes(s)||l.value.toLowerCase().includes(s)):t).slice(0,n)}const da=1e4;function xc(t){return{product:{noun:t("sandbox.pathParamPickerChip.kindProductNoun"),heading:t("sandbox.pathParamPickerChip.kindProductHeading")},category:{noun:t("sandbox.pathParamPickerChip.kindCategoryNoun"),heading:t("sandbox.pathParamPickerChip.kindCategoryHeading")}}}async function bc(t,{resolveType:e,props:n}){const s=await fetch(Xi(t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...n}),signal:AbortSignal.timeout(da)});if(!s.ok)throw new Error(`Failed to fetch options: ${s.status}`);return s.json()}async function hr(t,e){const n=await fetch(Zi(t,e),{signal:AbortSignal.timeout(da)});if(!n.ok)throw new Error(`Failed to fetch page: ${n.status}`);return n.text()}async function wc(t,e,n){const s=e.optionsFromPayload(await hr(t,"/"),n),a=s.find(u=>u.kind==="category");if(!a)return s;const l=Ve(n.template,{[n.paramName]:a.value});if(l==="/")return s;try{const u=e.optionsFromPayload(await hr(t,l),n).filter(o=>o.kind==="product");return oa([s,u])}catch{return s}}function yc(t,e,n){return Gn.sandboxInvoke(`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`,`path-param-${e.id}:${e.clientFilter?"":n}`)}async function kc(t,e,n,s){if(e.homepageLinks)return wc(t,e,s);const a=e.buildRequests?.(n)??[];if(a.length===0)return[];const l=await Promise.allSettled(a.map(o=>bc(t,o))),u=l.filter(o=>o.status==="fulfilled").map(o=>o.value);if(u.length===0){const o=l.find(i=>i.status==="rejected");throw o?o.reason:new Error("Failed to fetch options")}return oa(u.map(o=>e.optionsFromPayload(o,s)))}function Wn(t,e,n,s,a){return{queryKey:yc(t,e,n),queryFn:()=>kc(t,e,n,s),enabled:a,staleTime:6e4,retry:1}}function Ft(t){const e=ue.c(16),{heading:n,iconKind:s,options:a,template:l,paramName:u,keyPrefix:o,onSelect:i}=t;if(a.length===0)return null;let c;if(e[0]!==s||e[1]!==o||e[2]!==i||e[3]!==a||e[4]!==u||e[5]!==l){let f;e[7]!==s||e[8]!==o||e[9]!==i||e[10]!==u||e[11]!==l?(f=p=>r.jsxs(ut,{value:`${o}:${p.value}`,className:"gap-3 py-2",onSelect:()=>i(p.value),children:[s==="product"&&r.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:p.image?r.jsx("img",{src:p.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):r.jsx(Or,{size:14,className:"text-muted-foreground"})}),r.jsxs("span",{className:"min-w-0 flex-1",children:[r.jsx("span",{className:"block truncate text-sm",children:p.label}),r.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:Ve(l,{[u]:p.value})})]})]},`${o}:${p.value}`),e[7]=s,e[8]=o,e[9]=i,e[10]=u,e[11]=l,e[12]=f):f=e[12],c=a.map(f),e[0]=s,e[1]=o,e[2]=i,e[3]=a,e[4]=u,e[5]=l,e[6]=c}else c=e[6];let m;return e[13]!==n||e[14]!==c?(m=r.jsx(dt,{heading:n,children:c}),e[13]=n,e[14]=c,e[15]=m):m=e[15],m}function gr(t){const e=ue.c(2),{text:n}=t;let s;return e[0]!==n?(s=r.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:n}),e[0]=n,e[1]=s):s=e[1],s}function Sc(t){const e=ue.c(52),{sources:n,template:s,paramName:a,value:l,sandboxRef:u,onCommit:o}=t,i=Te(),[c,m]=E.useState(!1),[f,p]=E.useState(""),[k,g]=E.useState(""),v=E.useRef(null),h=a==="*"?i("sandbox.preview.catchAllParamLabel"):`:${a}`,x=xc(i),b=[...new Set(n.map(Z=>x[Z.kind].noun))].join(" or ");let w;e[0]!==i||e[1]!==b?(w=i("sandbox.pathParamPickerChip.searchPlaceholder",{options:b}),e[0]=i,e[1]=b,e[2]=w):w=e[2];const N=w,j={template:s,paramName:a};let P;e[3]!==f?(P=(Z,ce)=>({source:Z,query:ce,options:Z.clientFilter?Dt(ce.data??[],f):ce.data??[]}),e[3]=f,e[4]=P):P=e[4];const S=P,R=n.filter(Lc),U=n.filter(Rc),T=Kn({queries:R.map(Z=>Wn(u,Z,k,j,c))});let A;e[5]!==T||e[6]!==S?(A=(Z,ce)=>S(Z,T[ce]),e[5]=T,e[6]=S,e[7]=A):A=e[7];const D=R.map(A),O=D.length===0||D.every(Cc),F=Kn({queries:U.map(Z=>Wn(u,Z,k,j,c&&O))});let K;e[8]!==F||e[9]!==S?(K=(Z,ce)=>S(Z,F[ce]),e[8]=F,e[9]=S,e[10]=K):K=e[10];const ee=U.map(K),W=O?ee:D,G=W.length===1&&W[0]?.source.homepageLinks?W[0]:null,q=G&&!G.query.isLoading&&!G.query.isError?G?.query.data??[]:[],X=Dt(q.filter(Tc),f),Q=Dt(q.filter(Nc),f),H=X.length>0&&Q.length>0,L=Z=>{m(Z),v.current&&clearTimeout(v.current),p(Z?l:""),g(Z?l:"")};let B;e[11]===Symbol.for("react.memo_cache_sentinel")?(B=Z=>{p(Z),v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{g(Z)},300)},e[11]=B):B=e[11];const _=B,M=Z=>{o(Z),L(!1)},z=Qr(f),Y=Ve(s,{[a]:z}),ne=jr,se=Pr,I="flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[520px] sm:max-w-[560px]",re=Ec;let ae;e[12]!==h||e[13]!==i?(ae=i("sandbox.pathParamPickerChip.pickValueTitle",{paramLabel:h}),e[12]=h,e[13]=i,e[14]=ae):ae=e[14];let ie;e[15]!==ae?(ie=r.jsx(Er,{className:"sr-only",children:r.jsx(Nr,{children:ae})}),e[15]=ae,e[16]=ie):ie=e[16];let me;e[17]===Symbol.for("react.memo_cache_sentinel")?(me=r.jsx(Or,{size:16,className:"shrink-0 text-foreground"}),e[17]=me):me=e[17];let pe;e[18]!==i?(pe=i("sandbox.pathParamPickerChip.pickValueHeading"),e[18]=i,e[19]=pe):pe=e[19];let xe;e[20]!==h?(xe=r.jsx("span",{className:"rounded-sm bg-special/15 px-1 py-0.5 font-mono text-xs text-special",children:h}),e[20]=h,e[21]=xe):xe=e[21];let he;e[22]!==pe||e[23]!==xe?(he=r.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-3 border-b border-border px-4",children:[me,r.jsxs("span",{className:"text-sm font-medium text-foreground",children:[pe," ",xe]})]}),e[22]=pe,e[23]=xe,e[24]=he):he=e[24];const ve=zr,Se=!1,fe="min-h-0 flex-1";let le;e[25]!==N||e[26]!==f?(le=r.jsx(Kr,{autoFocus:!0,placeholder:N,value:f,onValueChange:_}),e[25]=N,e[26]=f,e[27]=le):le=e[27];const Re=Ir,Ue="flex max-h-none min-h-0 flex-1 flex-col overflow-hidden";let Ie;e[28]!==i?(Ie=i("sandbox.pathParamPickerChip.noResults"),e[28]=i,e[29]=Ie):Ie=e[29];let Be;e[30]!==Ie?(Be=r.jsx(Hr,{children:Ie}),e[30]=Ie,e[31]=Be):Be=e[31];const vt=z&&r.jsx(dt,{className:"shrink-0",children:r.jsxs(ut,{value:`__raw__:${z}`,className:"gap-3 py-2",onSelect:()=>M(z),children:[r.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md border border-dashed border-border bg-muted",children:r.jsx(Io,{size:14,className:"text-muted-foreground"})}),r.jsxs("span",{className:"min-w-0 flex-1",children:[r.jsx("span",{className:"block truncate text-sm",children:i("sandbox.pathParamPickerChip.useRawValue",{rawTerm:z,paramLabel:h})}),r.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:Y})]})]})}),ge=H?r.jsxs("div",{className:"flex min-h-0 flex-1",children:[r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto border-r border-border",children:r.jsx(Ft,{heading:x.category.heading,iconKind:"category",options:X,template:s,paramName:a,keyPrefix:`${G?.source.id}:cat`,onSelect:M})}),r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:r.jsx(Ft,{heading:x.product.heading,iconKind:"product",options:Q,template:s,paramName:a,keyPrefix:`${G?.source.id}:prod`,onSelect:M})})]}):r.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:W.map(Z=>{const{source:ce,query:We,options:xt}=Z,{noun:qe}=x[ce.kind];if(We.isLoading)return r.jsx(gr,{text:i("sandbox.pathParamPickerChip.loading",{noun:qe})},ce.id);if(We.isError)return r.jsx(gr,{text:i("sandbox.pathParamPickerChip.couldNotLoad")},ce.id);if(ce.homepageLinks){const It=We.data??[];return r.jsxs(E.Fragment,{children:[r.jsx(Ft,{heading:x.category.heading,iconKind:"category",options:Dt(It.filter(jc),f),template:s,paramName:a,keyPrefix:`${ce.id}:cat`,onSelect:M}),r.jsx(Ft,{heading:x.product.heading,iconKind:"product",options:Dt(It.filter(Pc),f),template:s,paramName:a,keyPrefix:`${ce.id}:prod`,onSelect:M})]},ce.id)}return r.jsx(Ft,{heading:W.length>1?x[ce.kind].heading:void 0,iconKind:ce.kind,options:xt,template:s,paramName:a,keyPrefix:ce.id,onSelect:M},ce.id)})});let _e;e[32]!==Re||e[33]!==Be||e[34]!==vt||e[35]!==ge?(_e=r.jsxs(Re,{className:Ue,children:[Be,vt,ge]}),e[32]=Re,e[33]=Be,e[34]=vt,e[35]=ge,e[36]=_e):_e=e[36];let be;e[37]!==ve||e[38]!==le||e[39]!==_e?(be=r.jsxs(ve,{shouldFilter:Se,className:fe,children:[le,_e]}),e[37]=ve,e[38]=le,e[39]=_e,e[40]=be):be=e[40];let ze;e[41]!==se||e[42]!==ie||e[43]!==he||e[44]!==be||e[45]!==re?(ze=r.jsxs(se,{className:I,onClick:re,children:[ie,he,be]}),e[41]=se,e[42]=ie,e[43]=he,e[44]=be,e[45]=re,e[46]=ze):ze=e[46];let Le;return e[47]!==ne||e[48]!==L||e[49]!==c||e[50]!==ze?(Le=r.jsx(ne,{open:c,onOpenChange:L,children:ze}),e[47]=ne,e[48]=L,e[49]=c,e[50]=ze,e[51]=Le):Le=e[51],r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",title:i("sandbox.pathParamPickerChip.buttonTitle",{paramLabel:h}),className:"max-w-64 shrink-0 cursor-pointer truncate rounded-lg bg-special/15 px-1 py-0.5 text-xs text-special hover:bg-special/25",onClick:Z=>{Z.stopPropagation(),L(!0)},children:l||h}),Le]})}function Pc(t){return t.kind==="product"}function jc(t){return t.kind!=="product"}function Ec(t){return t.stopPropagation()}function Nc(t){return t.kind==="product"}function Tc(t){return t.kind!=="product"}function Cc(t){return!t.query.isLoading&&(t.query.isError||t.options.length===0)}function Rc(t){return t.isFallback}function Lc(t){return!t.isFallback}function Ac(t){const e=ue.c(8),{sources:n,template:s,paramName:a,sandboxRef:l,onFill:u}=t;let o,i;if(e[0]!==a||e[1]!==l||e[2]!==n||e[3]!==s){const k={template:s,paramName:a},g=n.filter(_c);i=Kn,o=g.map(v=>Wn(l,v,"",k,!0)),e[0]=a,e[1]=l,e[2]=n,e[3]=s,e[4]=o,e[5]=i}else o=e[4],i=e[5];let c;e[6]!==o?(c={queries:o},e[6]=o,e[7]=c):c=e[7];const m=i(c),[f,p]=E.useState(!1);if(!f)for(const k of m){if(k.isLoading)break;const g=k.data?.[0];if(g){p(!0),queueMicrotask(()=>u(g.value));break}}return null}function _c(t){return!t.isFallback}function Oc(t){const e=ue.c(31),{name:n,value:s,onCommit:a}=t,l=Te(),[u,o]=E.useState(s),[i,c]=E.useState(!1),m=E.useRef(!1);let f;e[0]!==n||e[1]!==l?(f=n==="*"?l("sandbox.preview.catchAllParamLabel"):`:${n}`,e[0]=n,e[1]=l,e[2]=f):f=e[2];const p=f,k=u||p;let g;e[3]!==k?(g=r.jsx("span",{"aria-hidden":!0,className:"invisible whitespace-pre px-1 py-0.5 text-xs",children:k}),e[3]=k,e[4]=g):g=e[4];let v;e[5]!==p||e[6]!==l?(v=l("sandbox.preview.valueForParam",{label:p}),e[5]=p,e[6]=l,e[7]=v):v=e[7];let h,x;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=S=>o(S.target.value),x=()=>c(!0),e[8]=h,e[9]=x):(h=e[8],x=e[9]);let C;e[10]!==s?(C=S=>{S.key==="Enter"&&S.currentTarget.blur(),S.key==="Escape"&&(m.current=!0,o(s),S.currentTarget.blur())},e[10]=s,e[11]=C):C=e[11];let b;e[12]!==u||e[13]!==a||e[14]!==s?(b=()=>{if(c(!1),m.current){m.current=!1;return}const S=Qr(u);o(S),S!==s&&a(S)},e[12]=u,e[13]=a,e[14]=s,e[15]=b):b=e[15];let w;e[16]!==u||e[17]!==p||e[18]!==v||e[19]!==C||e[20]!==b?(w=r.jsx("input",{type:"text",value:u,placeholder:p,title:v,spellCheck:!1,className:"absolute inset-0 rounded-sm bg-special/15 px-1 text-xs text-special outline-none placeholder:text-special/60 focus:bg-special/25",onClick:Dc,onChange:h,onFocus:x,onKeyDown:C,onBlur:b}),e[16]=u,e[17]=p,e[18]=v,e[19]=C,e[20]=b,e[21]=w):w=e[21];let N;e[22]!==g||e[23]!==w?(N=r.jsxs("span",{className:"relative inline-flex max-w-64 shrink-0 items-center overflow-hidden",children:[g,w]}),e[22]=g,e[23]=w,e[24]=N):N=e[24];let j;e[25]!==i||e[26]!==l?(j=i&&r.jsxs("span",{className:"pointer-events-none ml-1.5 flex shrink-0 items-center gap-1 whitespace-nowrap rounded-sm border border-border bg-muted px-1 py-0.5 text-2xs text-muted-foreground",children:[r.jsx(Di,{size:10}),l("sandbox.preview.enterToGo")]}),e[25]=i,e[26]=l,e[27]=j):j=e[27];let P;return e[28]!==j||e[29]!==N?(P=r.jsxs(r.Fragment,{children:[N,j]}),e[28]=j,e[29]=N,e[30]=P):P=e[30],P}function Dc(t){return t.stopPropagation()}function Fc(t){if(t.activeGlobalSectionName)return t.activeGlobalSectionName;const e=t.iframeBase;if(!e)return t.noServerLabel;try{const n=new URL(e),s=t.resolvedPath==="/"?"":t.resolvedPath;return`${n.host}${s}`}catch{return e}}function $c(t){return t.previewSurfaceActive&&(t.daemonReady||t.production||!!t.servePreviewUrl)}function Bc(t){return t.showPreviewToolbar&&t.contentEditingEnabled}function Mc(t){return t.v8?null:t.production||t.localPreview?{type:"editor::inject",args:{script:t.script}}:{type:"visual-editor::activate",script:t.script}}function Uc(t){return t.v8?null:{type:"visual-editor::activate",script:t.script}}class ua extends Error{constructor(){super("The site's schema isn't loaded yet"),this.name="PageSchemaNotReadyError"}}async function Ic(t,e){if(t)return t;const n=await e?.().catch(()=>null);if(!n)throw new ua;return n}async function zc(t,e,n){return n?Gs(t,e,await Ic(n.meta,n.loadMeta)):Gs(t,e)}function Kc(t){const e=ue.c(5);let n;e[0]!==t?(n=t??{orgSlug:"",virtualMcpId:"",branch:""},e[0]=t,e[1]=n):n=e[1];const s=Rr(n);let a;return e[2]!==t||e[3]!==s?(a={mutationFn:async l=>{const{name:u,path:o,template:i,schema:c}=l;if(!t?.virtualMcpId||!t.branch)throw new Error("Sandbox not ready");const m=hi(u),f=i?{...i,name:u,path:o}:await zc(u,o,c);return await s.mutateAsync({blockKey:m,data:f}),{key:m,name:u,path:o}}},e[2]=t,e[3]=s,e[4]=a):a=e[4],oi(a)}function Hc(t){const e=ue.c(89),{open:n,onOpenChange:s,isPending:a,error:l,templates:u,onSubmit:o}=t,i=a===void 0?!1:a,c=Te();let m;e[0]!==c?(m=c("sectionsEditor.createPageModal.defaultPageName"),e[0]=c,e[1]=m):m=e[1];const[f,p]=E.useState(m);let k;e[2]!==c?(k=c("sectionsEditor.createPageModal.defaultPagePath"),e[2]=c,e[3]=k):k=e[3];const[g,v]=E.useState(k),[h,x]=E.useState(Rn),[C,b]=E.useState(null),[w,N]=E.useState(n);n!==w&&(N(n),n&&(p(c("sectionsEditor.createPageModal.defaultPageName")),v(c("sectionsEditor.createPageModal.defaultPagePath")),x(Rn),b(null)));const j=!!u?.length;let P;e[4]!==i||e[5]!==s?(P=pe=>{!pe&&!i&&(b(null),s(!1))},e[4]=i,e[5]=s,e[6]=P):P=e[6];const S=P;let R;e[7]!==i||e[8]!==f||e[9]!==o||e[10]!==g||e[11]!==j||e[12]!==h?(R=async pe=>{pe.preventDefault();const xe=f.trim(),he=g.trim();if(!xe||!he||i)return;const ve=Xr(he);if(ve){b(ve);return}b(null),await o({name:xe,path:he,templateKey:j&&h!==Rn?h:null})},e[7]=i,e[8]=f,e[9]=o,e[10]=g,e[11]=j,e[12]=h,e[13]=R):R=e[13];const U=R,T=C??l;let A;e[14]!==c?(A=c("sectionsEditor.createPageModal.title"),e[14]=c,e[15]=A):A=e[15];let D;e[16]!==A?(D=r.jsx(Er,{children:r.jsx(Nr,{children:A})}),e[16]=A,e[17]=D):D=e[17];let O;e[18]!==c?(O=c("sectionsEditor.createPageModal.nameLabel"),e[18]=c,e[19]=O):O=e[19];let F;e[20]!==O?(F=r.jsx("label",{htmlFor:"new-page-name",className:"text-xs font-medium text-muted-foreground",children:O}),e[20]=O,e[21]=F):F=e[21];let K;e[22]===Symbol.for("react.memo_cache_sentinel")?(K=pe=>p(pe.target.value),e[22]=K):K=e[22];let ee;e[23]!==c?(ee=c("sectionsEditor.createPageModal.namePlaceholder"),e[23]=c,e[24]=ee):ee=e[24];let W;e[25]!==i||e[26]!==f||e[27]!==ee?(W=r.jsx(Mn,{id:"new-page-name",value:f,onChange:K,placeholder:ee,autoFocus:!0,disabled:i}),e[25]=i,e[26]=f,e[27]=ee,e[28]=W):W=e[28];let G;e[29]!==W||e[30]!==F?(G=r.jsxs("div",{className:"space-y-1.5",children:[F,W]}),e[29]=W,e[30]=F,e[31]=G):G=e[31];let V;e[32]!==c?(V=c("sectionsEditor.createPageModal.pathLabel"),e[32]=c,e[33]=V):V=e[33];let q;e[34]!==V?(q=r.jsx("label",{htmlFor:"new-page-path",className:"text-xs font-medium text-muted-foreground",children:V}),e[34]=V,e[35]=q):q=e[35];let X;e[36]===Symbol.for("react.memo_cache_sentinel")?(X=pe=>v(pe.target.value),e[36]=X):X=e[36];let Q;e[37]!==c?(Q=c("sectionsEditor.createPageModal.pathPlaceholder"),e[37]=c,e[38]=Q):Q=e[38];let H;e[39]!==i||e[40]!==g||e[41]!==Q?(H=r.jsx(Mn,{id:"new-page-path",value:g,onChange:X,placeholder:Q,disabled:i}),e[39]=i,e[40]=g,e[41]=Q,e[42]=H):H=e[42];let L;e[43]!==q||e[44]!==H?(L=r.jsxs("div",{className:"space-y-1.5",children:[q,H]}),e[43]=q,e[44]=H,e[45]=L):L=e[45];let B;e[46]!==i||e[47]!==j||e[48]!==c||e[49]!==h||e[50]!==u?(B=j&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{htmlFor:"new-page-template",className:"text-xs font-medium text-muted-foreground",children:c("sectionsEditor.createPageModal.templateLabel")}),r.jsx(gi,{id:"new-page-template",value:h,onChange:x,templates:u??[],disabled:i})]}),e[46]=i,e[47]=j,e[48]=c,e[49]=h,e[50]=u,e[51]=B):B=e[51];let _;e[52]!==T?(_=T&&r.jsx("p",{className:"text-xs text-destructive",children:T}),e[52]=T,e[53]=_):_=e[53];let M;e[54]!==G||e[55]!==L||e[56]!==B||e[57]!==_?(M=r.jsxs("div",{className:"space-y-4 py-4",children:[G,L,B,_]}),e[54]=G,e[55]=L,e[56]=B,e[57]=_,e[58]=M):M=e[58];let z;e[59]!==s?(z=()=>s(!1),e[59]=s,e[60]=z):z=e[60];let Y;e[61]!==c?(Y=c("sectionsEditor.createPageModal.cancelButton"),e[61]=c,e[62]=Y):Y=e[62];let ne;e[63]!==i||e[64]!==z||e[65]!==Y?(ne=r.jsx($e,{type:"button",variant:"outline",onClick:z,disabled:i,children:Y}),e[63]=i,e[64]=z,e[65]=Y,e[66]=ne):ne=e[66];let se;e[67]!==i||e[68]!==f||e[69]!==g?(se=!f.trim()||!g.trim()||i,e[67]=i,e[68]=f,e[69]=g,e[70]=se):se=e[70];let I;e[71]!==i||e[72]!==c?(I=i?r.jsxs(r.Fragment,{children:[r.jsx(gt,{className:"size-3.5"}),c("sectionsEditor.createPageModal.creatingButton")]}):c("sectionsEditor.createPageModal.createButton"),e[71]=i,e[72]=c,e[73]=I):I=e[73];let re;e[74]!==se||e[75]!==I?(re=r.jsx($e,{type:"submit",disabled:se,children:I}),e[74]=se,e[75]=I,e[76]=re):re=e[76];let ae;e[77]!==ne||e[78]!==re?(ae=r.jsxs(li,{children:[ne,re]}),e[77]=ne,e[78]=re,e[79]=ae):ae=e[79];let ie;e[80]!==U||e[81]!==M||e[82]!==ae||e[83]!==D?(ie=r.jsx(Pr,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:U,children:[D,M,ae]})}),e[80]=U,e[81]=M,e[82]=ae,e[83]=D,e[84]=ie):ie=e[84];let me;return e[85]!==S||e[86]!==n||e[87]!==ie?(me=r.jsx(jr,{open:n,onOpenChange:S,children:ie}),e[85]=S,e[86]=n,e[87]=ie,e[88]=me):me=e[88],me}function Vc(t){const e=ue.c(36),{orgSlug:n,virtualMcpId:s,branch:a,previewUrl:l,meta:u,decofile:o,blockKey:i}=t,c=Te();let m;e[0]!==a||e[1]!==n||e[2]!==s?(m={orgSlug:n,virtualMcpId:s,branch:a},e[0]=a,e[1]=n,e[2]=s,e[3]=m):m=e[3];const f=Rr(m);let p;e[4]!==f?(p=bi((P,S)=>f.mutate({blockKey:P,data:S})),e[4]=f,e[5]=p):p=e[5];const k=p;let g;e[6]!==i||e[7]!==o?(g=vi(o,i),e[6]=i,e[7]=o,e[8]=g):g=e[8];const{resolveType:v,props:h,title:x}=g;if(!v){let P;e[9]!==c?(P=c("sandbox.preview.loaderNoLongerExists"),e[9]=c,e[10]=P):P=e[10];let S;return e[11]!==P?(S=r.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:P}),e[11]=P,e[12]=S):S=e[12],S}const C=`loader:${i}`,b=`loader:${i}`;let w;e[13]!==i||e[14]!==v||e[15]!==x?(w={mode:"saved",blockKey:i,resolveType:v,title:x},e[13]=i,e[14]=v,e[15]=x,e[16]=w):w=e[16];let N;e[17]!==a||e[18]!==o||e[19]!==u||e[20]!==n||e[21]!==l||e[22]!==h||e[23]!==f.isPending||e[24]!==k||e[25]!==b||e[26]!==w||e[27]!==s?(N=r.jsx(xi,{orgSlug:n,virtualMcpId:s,branch:a,previewUrl:l,meta:u,decofile:o,kind:"loaders",target:w,initialValue:h,isCreating:f.isPending,onCreate:Wc,onSaveReferencedBlock:k,showRun:!1},b),e[17]=a,e[18]=o,e[19]=u,e[20]=n,e[21]=l,e[22]=h,e[23]=f.isPending,e[24]=k,e[25]=b,e[26]=w,e[27]=s,e[28]=N):N=e[28];let j;return e[29]!==i||e[30]!==a||e[31]!==n||e[32]!==C||e[33]!==N||e[34]!==s?(j=r.jsx(wi,{orgSlug:n,virtualMcpId:s,branch:a,blockKey:i,present:void 0,children:N},C),e[29]=i,e[30]=a,e[31]=n,e[32]=C,e[33]=N,e[34]=s,e[35]=j):j=e[35],j}async function Wc(){}function qc(t){if(t instanceof Error&&"status"in t&&typeof t.status=="number")return t.status}function vr(t){return{status:t.status,hasData:t.data!==void 0,errorStatus:qc(t.error)}}function Gc(t){switch(t){case"clone-failed":case"install-failed":case"start-failed":return"terminal-error";case"idle":case"cloning":return"booting";case"checking-out":case"installing":case"starting":case"running":case"crashed":return"snapshot-readable"}}function Jc(t){if(t.fastPreviewActive)return t.decofile.status==="error"&&!t.decofile.hasData||t.meta.status==="error"&&!t.meta.hasData?{kind:"error",source:"data"}:!t.decofile.hasData||!t.meta.hasData?{kind:"loading"}:t.hasEditableContent?{kind:"content"}:{kind:"empty",reason:"no-content"};const e=Gc(t.lifecyclePhase);if(e==="terminal-error")return{kind:"error",source:"sandbox"};if(e==="booting")return{kind:"loading"};const n=t.decofile.status==="error"&&!t.decofile.hasData||t.meta.status==="error"&&!t.meta.hasData;return n&&t.lifecyclePhase==="checking-out"?{kind:"loading"}:[t.decofile,t.meta].some(a=>a.status==="error"&&!a.hasData&&a.errorStatus===404)?{kind:"empty",reason:"framework-missing"}:n?t.lifecyclePhase==="running"||t.lifecyclePhase==="crashed"?{kind:"error",source:"data"}:{kind:"loading"}:!t.decofile.hasData||!t.meta.hasData?{kind:"loading"}:t.hasEditableContent?{kind:"content"}:{kind:"empty",reason:"no-content"}}const Yc=E.lazy(()=>ci(()=>import("./sections-editor-D1U5_lZq.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])).then(t=>({default:t.SectionsEditor})));function xr(t){const e=ue.c(61),{virtualMcpId:n,externalSelection:s,onSectionPicked:a,onViewJsonFile:l}=t,u=s===void 0?null:s,{org:o}=Jn(),{currentBranch:i,taskId:c}=Mt(),m=Xn(),f=Ut(),p=ta(),k=m.lifecycle.phase==="running",g=f.previewUrl;let v;e[0]!==i||e[1]!==o||e[2]!==g||e[3]!==c||e[4]!==n?(v=i?{orgSlug:o.slug,virtualMcpId:n,branch:i,threadId:c??null,previewUrl:g}:null,e[0]=i,e[1]=o,e[2]=g,e[3]=c,e[4]=n,e[5]=v):v=e[5];const h=v,x=fn(n,i);let C;e[6]!==k?(C={fetchEnabled:k},e[6]=k,e[7]=C):C=e[7];const b=Yn(h,C);let w;e[8]!==k?(w={fetchEnabled:k},e[8]=k,e[9]=w):w=e[9];const N=Zr(h,w),j=Jc({lifecyclePhase:m.lifecycle.phase,decofile:vr(b),meta:vr(N),hasEditableContent:So(b.data,N.data),fastPreviewActive:Vr(n).runtime==="cms"||Xe(x)}),P=Lr()===void 0,S=Qc;if(Po(x)){let L;return e[10]===Symbol.for("react.memo_cache_sentinel")?(L=S(r.jsx(Eo,{})),e[10]=L):L=e[10],L}if(x.kind==="pending"&&x.retrying){let L;return e[11]!==x?(L=S(r.jsx(No,{backend:x})),e[11]=x,e[12]=L):L=e[12],L}if(j.kind==="loading"||P){let L;return e[13]===Symbol.for("react.memo_cache_sentinel")?(L=S(r.jsx(di,{})),e[13]=L):L=e[13],L}if(b.data&&eo(N.data)){const L=p.state.target,B=L?.kind==="page"||L?.kind==="section"?L.key:null,_=B??"",M=i??"";let z;return e[14]!==b.data||e[15]!==B||e[16]!==o.slug||e[17]!==_||e[18]!==M||e[19]!==n?(z=S(r.jsx(yi,{orgSlug:o.slug,virtualMcpId:n,branch:M,decofile:b.data,initialKey:B,compact:!0},_)),e[14]=b.data,e[15]=B,e[16]=o.slug,e[17]=_,e[18]=M,e[19]=n,e[20]=z):z=e[20],z}if(j.kind==="empty"){let L;return e[21]===Symbol.for("react.memo_cache_sentinel")?(L=S(r.jsx(To,{})),e[21]=L):L=e[21],L}if(j.kind==="error"){let L;e[22]!==b||e[23]!==f||e[24]!==N||e[25]!==j.source?(L=()=>{if(j.source==="sandbox"){f.retry();return}Promise.all([b.refetch(),N.refetch()])},e[22]=b,e[23]=f,e[24]=N,e[25]=j.source,e[26]=L):L=e[26];const B=L;let _;return e[27]!==B||e[28]!==j.source?(_=S(r.jsx(jo,{source:j.source,onRetry:B})),e[27]=B,e[28]=j.source,e[29]=_):_=e[29],_}let R;e[30]===Symbol.for("react.memo_cache_sentinel")?(R=L=>S(r.jsx("div",{className:"h-full min-h-0",children:L})),e[30]=R):R=e[30];const U=R,T=p.state.target;if(T?.kind==="loader"&&b.data&&N.data){const L=i??"",B=g??null;let _;return e[31]!==b.data||e[32]!==N.data||e[33]!==o.slug||e[34]!==L||e[35]!==B||e[36]!==T.key||e[37]!==n?(_=U(r.jsx(Vc,{orgSlug:o.slug,virtualMcpId:n,branch:L,previewUrl:B,meta:N.data,decofile:b.data,blockKey:T.key})),e[31]=b.data,e[32]=N.data,e[33]=o.slug,e[34]=L,e[35]=B,e[36]=T.key,e[37]=n,e[38]=_):_=e[38],_}let A;e[39]!==i||e[40]!==o.slug||e[41]!==T||e[42]!==n?(A=T||!i?null:Ar(_r(o.slug,n,i)),e[39]=i,e[40]=o.slug,e[41]=T,e[42]=n,e[43]=A):A=e[43];const D=A;let O="/",F=null,K=null;T?.kind==="page"?(O=T.path,F=T.key):T?.kind==="section"?K=T.key:D&&(O=D.path,F=D.pageKey);const ee=F?`page:${F}`:K?`section:${K}`:`path:${O}`;let W;e[44]===Symbol.for("react.memo_cache_sentinel")?(W=r.jsx("div",{className:"h-full flex items-center justify-center",children:r.jsx(gt,{className:"size-5 text-muted-foreground"})}),e[44]=W):W=e[44];const G=i??"",V=g??void 0,q=K?null:u,X=K?void 0:a,Q=!!F&&p.state.editSeoPageKey===F;let H;return e[45]!==K||e[46]!==F||e[47]!==O||e[48]!==ee||e[49]!==l||e[50]!==o.slug||e[51]!==q||e[52]!==X||e[53]!==Q||e[54]!==G||e[55]!==V||e[56]!==n||e[57]!==p.consumeEditSeo||e[58]!==p.setFocusedBlock||e[59]!==p.setVariantOverride?(H=U(r.jsx(E.Suspense,{fallback:W,children:r.jsx(Yc,{orgSlug:o.slug,virtualMcpId:n,branch:G,previewReady:!0,previewUrl:V,currentPath:O,activePageBlockKey:F,activeGlobalBlockKey:K,externalSelection:q,onSectionPicked:X,initialEditSeo:Q,onExitSeo:p.consumeEditSeo,onVariantPreviewOverride:p.setVariantOverride,onFocusedBlockChange:p.setFocusedBlock,onViewJsonFile:l},ee)})),e[45]=K,e[46]=F,e[47]=O,e[48]=ee,e[49]=l,e[50]=o.slug,e[51]=q,e[52]=X,e[53]=Q,e[54]=G,e[55]=V,e[56]=n,e[57]=p.consumeEditSeo,e[58]=p.setFocusedBlock,e[59]=p.setVariantOverride,e[60]=H):H=e[60],H}function Qc(t){return r.jsx("div",{"data-testid":"blocks-panel",className:"h-full min-h-0 overflow-hidden",children:t})}function br(t){const e=ue.c(51),{virtualMcpId:n,pageKey:s,onClose:a,ref:l}=t,u=Te(),o=Lr(),i=o===!0,c=Wr(n);let m;e[0]!==c||e[1]!==s?(m=to(c,Go(s)),e[0]=c,e[1]=s,e[2]=m):m=e[2];const f=m,{org:p}=Jn(),{currentBranch:k,taskId:g}=Mt(),h=Ut().previewUrl;let x;e[3]!==k||e[4]!==p.slug||e[5]!==h||e[6]!==g||e[7]!==n?(x=k?{orgSlug:p.slug,virtualMcpId:n,branch:k,threadId:g??null,previewUrl:h}:null,e[3]=k,e[4]=p.slug,e[5]=h,e[6]=g,e[7]=n,e[8]=x):x=e[8];const b=Yn(x),w=k??"";let N;e[9]!==p.slug||e[10]!==w||e[11]!==n?(N={orgSlug:p.slug,virtualMcpId:n,branch:w},e[9]=p.slug,e[10]=w,e[11]=n,e[12]=N):N=e[12];let j;e[13]===Symbol.for("react.memo_cache_sentinel")?(j={holdsCopy:!0},e[13]=j):j=e[13];const{save:P,flush:S,hold:R}=ki(N,j),U=k??"";let T;e[14]!==p.slug||e[15]!==U||e[16]!==n?(T=Ko({orgSlug:p.slug,virtualMcpId:n,branch:U}),e[14]=p.slug,e[15]=U,e[16]=n,e[17]=T):T=e[17];const A=Ho(T);let D;e[18]!==s||e[19]!==A?(D=A(s),e[18]=s,e[19]=A,e[20]=D):D=e[20];const O=D;let F;e[21]!==O||e[22]!==s?(F={pageKey:s,copyEpoch:O},e[21]=O,e[22]=s,e[23]=F):F=e[23];const[K,ee]=E.useState(F);(K.pageKey!==s||K.copyEpoch!==O)&&(ee({pageKey:s,copyEpoch:O}),R(s));const W=b.data?.[s],G=b.data===void 0&&b.isLoading||o===void 0,V=b.data!==void 0&&W===void 0,q=!k||V||G;let X;e[24]!==W?(X=W===void 0?"":JSON.stringify(W,null,2),e[24]=W,e[25]=X):X=e[25];const Q=X;let H;e[26]!==s||e[27]!==q||e[28]!==P?(H=Y=>{if(q)return;let ne;try{ne=JSON.parse(Y)}catch{return}ne===null||typeof ne!="object"||Array.isArray(ne)||P(s,ne)},e[26]=s,e[27]=q,e[28]=P,e[29]=H):H=e[29];const L=H;let B;e[30]!==S?(B=()=>({flush:S}),e[30]=S,e[31]=B):B=e[31],E.useImperativeHandle(l,B);let _;e[32]!==f||e[33]!==i||e[34]!==a||e[35]!==u?(_=i?r.jsx("div",{className:"flex shrink-0 items-center border-b px-3 py-2.5",children:r.jsx("span",{title:f,className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:f})}):r.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-3 py-2.5",children:[r.jsx("div",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:u("sectionsEditor.pageJsonDialog.titleShort")}),r.jsx($e,{variant:"ghost",size:"icon-sm",onClick:a,"aria-label":u("sectionsEditor.pageJsonDialog.close"),className:"shrink-0",children:r.jsx(ui,{size:14})})]}),e[32]=f,e[33]=i,e[34]=a,e[35]=u,e[36]=_):_=e[36];let M;e[37]!==O||e[38]!==b.data||e[39]!==S||e[40]!==Q||e[41]!==G||e[42]!==V||e[43]!==s||e[44]!==q||e[45]!==L||e[46]!==u?(M=G?r.jsx("div",{className:"flex flex-1 items-center justify-center",children:r.jsx(gt,{className:"size-5 text-muted-foreground"})}):V?r.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",u("sectionsEditor.pageJsonDialog.pageNotFound")]}):r.jsx("div",{className:"min-h-0 flex-1",children:r.jsx(zo,{code:Q,language:"json",readOnly:q,height:"100%",onChange:Y=>L(Y??""),onSave:Y=>{L(Y),S()}},`${s}:${b.data===void 0?"loading":"ready"}:${O}`)}),e[37]=O,e[38]=b.data,e[39]=S,e[40]=Q,e[41]=G,e[42]=V,e[43]=s,e[44]=q,e[45]=L,e[46]=u,e[47]=M):M=e[47];let z;return e[48]!==_||e[49]!==M?(z=r.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[_,M]}),e[48]=_,e[49]=M,e[50]=z):z=e[50],z}function fa(t){return t.contentEditingEnabled&&!t.isMobile}function Xc(t,e){return t!=="visual"?"visual":e?"blocks":"preview"}function Zc(t,e){return t==="blocks"?"preview":e?"blocks":t}function ed(t){return fa({contentEditingEnabled:ea(t.cmsMode),isMobile:t.isMobile})?"blocks":"preview"}function td(t){return t.editingMode==="blocks"&&!t.blocksEditingEnabled||t.editingMode==="visual"&&!t.sandboxDisplay?"preview":t.editingMode}function nd(t){const e=no(t),{display:n}=t;let s=null;if(n.mode==="production"&&n.iframeBase)try{s=new URL(t.path,n.iframeBase).href}catch{s=null}const a=so(s,e);return{value:e,frame:a?Hn(a,t.device):null,newTab:a}}function sd(t){const e=ue.c(94),{tests:n,load:s,onOpen:a,options:l,onChange:u,available:o}=t,i=Te();let c;e[0]!==l?(c=qr(l),e[0]=l,e[1]=c):c=e[1];const m=c;let f;e[2]!==l.tests?(f=l.tests??{},e[2]=l.tests,e[3]=f):f=e[3];const p=f;let k;e[4]!==u||e[5]!==l?(k=I=>{const re=I?Wo(I):null,{at:ae,...ie}=l;u(re?{...ie,at:re}:ie)},e[4]=u,e[5]=l,e[6]=k):k=e[6];const g=k;let v;e[7]!==p||e[8]!==u||e[9]!==l?(v=(I,re)=>{const ae={...p};re==="on"?ae[I]=!0:re==="off"?ae[I]=!1:delete ae[I];const{tests:ie,...me}=l;u(Object.keys(ae).length>0?{...me,tests:ae}:me)},e[7]=p,e[8]=u,e[9]=l,e[10]=v):v=e[10];const h=v;let x;e[11]!==a?(x=I=>{I&&a?.()},e[11]=a,e[12]=x):x=e[12];let C;e[13]!==i?(C=i("sandbox.previewAs.label"),e[13]=i,e[14]=C):C=e[14];let b;e[15]===Symbol.for("react.memo_cache_sentinel")?(b=r.jsx(Fi,{size:16}),e[15]=b):b=e[15];let w;e[16]!==m||e[17]!==C?(w=r.jsx(pt,{asChild:!0,children:r.jsx(Br,{asChild:!0,children:r.jsx(Ze,{"aria-label":C,active:m,"data-testid":"preview-as-trigger",children:b})})}),e[16]=m,e[17]=C,e[18]=w):w=e[18];let N;e[19]!==i?(N=i("sandbox.previewAs.label"),e[19]=i,e[20]=N):N=e[20];let j;e[21]!==N?(j=r.jsx(mt,{children:N}),e[21]=N,e[22]=j):j=e[22];let P;e[23]!==j||e[24]!==w?(P=r.jsxs(ht,{children:[w,j]}),e[23]=j,e[24]=w,e[25]=P):P=e[25];let S;e[26]!==i?(S=i("sandbox.previewAs.label"),e[26]=i,e[27]=S):S=e[27];let R;e[28]!==S?(R=r.jsx("h3",{className:"text-sm font-medium",children:S}),e[28]=S,e[29]=R):R=e[29];let U;e[30]!==o||e[31]!==i?(U=i(o?"sandbox.previewAs.intro":"sandbox.previewAs.unavailable"),e[30]=o,e[31]=i,e[32]=U):U=e[32];let T;e[33]!==U?(T=r.jsx("p",{className:"text-xs text-muted-foreground",children:U}),e[33]=U,e[34]=T):T=e[34];let A;e[35]!==R||e[36]!==T?(A=r.jsxs("div",{className:"flex flex-col gap-1",children:[R,T]}),e[35]=R,e[36]=T,e[37]=A):A=e[37];let D;e[38]!==i?(D=i("sandbox.previewAs.momentLabel"),e[38]=i,e[39]=D):D=e[39];let O;e[40]!==D?(O=r.jsx(Xo,{htmlFor:"preview-as-moment",children:D}),e[40]=D,e[41]=O):O=e[41];let F;e[42]!==l.at?(F=Vo(l.at),e[42]=l.at,e[43]=F):F=e[43];let K;e[44]!==g?(K=I=>g(I.target.value),e[44]=g,e[45]=K):K=e[45];let ee;e[46]!==F||e[47]!==K?(ee=r.jsx(Mn,{id:"preview-as-moment",type:"datetime-local",className:qo,value:F,onChange:K}),e[46]=F,e[47]=K,e[48]=ee):ee=e[48];const W=l.at===void 0;let G;e[49]!==g?(G=()=>g(""),e[49]=g,e[50]=G):G=e[50];let V;e[51]!==i?(V=i("sandbox.previewAs.now"),e[51]=i,e[52]=V):V=e[52];let q;e[53]!==W||e[54]!==G||e[55]!==V?(q=r.jsx($e,{type:"button",variant:"ghost",size:"sm",disabled:W,onClick:G,children:V}),e[53]=W,e[54]=G,e[55]=V,e[56]=q):q=e[56];let X;e[57]!==ee||e[58]!==q?(X=r.jsxs("div",{className:"flex items-center gap-2",children:[ee,q]}),e[57]=ee,e[58]=q,e[59]=X):X=e[59];let Q;e[60]!==i?(Q=i("sandbox.previewAs.momentHint"),e[60]=i,e[61]=Q):Q=e[61];let H;e[62]!==Q?(H=r.jsx("p",{className:"text-xs text-muted-foreground",children:Q}),e[62]=Q,e[63]=H):H=e[63];let L;e[64]!==O||e[65]!==X||e[66]!==H?(L=r.jsxs("div",{className:"flex flex-col gap-1.5",children:[O,X,H]}),e[64]=O,e[65]=X,e[66]=H,e[67]=L):L=e[67];let B;e[68]!==i?(B=i("sandbox.previewAs.testsLabel"),e[68]=i,e[69]=B):B=e[69];let _;e[70]!==B?(_=r.jsx("span",{className:"text-sm font-medium",children:B}),e[70]=B,e[71]=_):_=e[71];let M;e[72]!==p||e[73]!==s||e[74]!==h||e[75]!==i||e[76]!==n?(M=s&&!s.ready?s.failed?r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.previewAs.testsLoadFailed")}),r.jsx($e,{type:"button",variant:"outline",size:"sm",onClick:s.retry,children:i("sandbox.previewAs.tryAgain")})]}):r.jsx("div",{className:"flex justify-center py-2","data-testid":"preview-as-tests-loading",children:r.jsx(gt,{className:"size-4 text-muted-foreground"})}):n.length===0?r.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.previewAs.noTests")}):r.jsxs(r.Fragment,{children:[r.jsx("ul",{className:"flex flex-col gap-1.5",children:n.map(I=>r.jsxs("li",{className:"flex items-center justify-between gap-2","data-testid":"preview-as-test",children:[r.jsx("span",{className:"min-w-0 truncate text-sm",children:I}),r.jsxs(Zo,{type:"single",variant:"outline",size:"sm",value:p[I]===void 0?"":p[I]?"on":"off",onValueChange:re=>h(I,re),"aria-label":I,children:[r.jsx(or,{value:"off",children:i("sandbox.previewAs.off")}),r.jsx(or,{value:"on",children:i("sandbox.previewAs.on")})]})]},I))}),r.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.previewAs.testsHint")})]}),e[72]=p,e[73]=s,e[74]=h,e[75]=i,e[76]=n,e[77]=M):M=e[77];let z;e[78]!==_||e[79]!==M?(z=r.jsxs("div",{className:"flex flex-col gap-1.5",children:[_,M]}),e[78]=_,e[79]=M,e[80]=z):z=e[80];let Y;e[81]!==m||e[82]!==u||e[83]!==i?(Y=m&&r.jsx($e,{type:"button",variant:"outline",size:"sm",onClick:()=>u({}),children:i("sandbox.previewAs.reset")}),e[81]=m,e[82]=u,e[83]=i,e[84]=Y):Y=e[84];let ne;e[85]!==A||e[86]!==L||e[87]!==z||e[88]!==Y?(ne=r.jsxs(Mr,{className:"flex w-80 flex-col gap-4 p-4",align:"center",sideOffset:8,"data-testid":"preview-as",children:[A,L,z,Y]}),e[85]=A,e[86]=L,e[87]=z,e[88]=Y,e[89]=ne):ne=e[89];let se;return e[90]!==P||e[91]!==ne||e[92]!==x?(se=r.jsxs(Ur,{onOpenChange:x,children:[P,ne]}),e[90]=P,e[91]=ne,e[92]=x,e[93]=se):se=e[93],se}const rd=15e3;function ad(t,e,n){return n?t.src===e||t.loading?t:{src:e,loading:!0}:t.src===e&&!t.loading?t:{src:e,loading:!1}}function wr(t){return t.loading?{...t,loading:!1}:t}function id(t,e){try{const n=new URL(t),s=new URL(e);return n.origin===s.origin&&n.pathname===s.pathname}catch{return!1}}function od(t,{base:e,frameSrc:n,loadedSrc:s,wanted:a,canSwap:l}){const u=t?.base===e?t:null,o=u?.src??n,i=u?.shown??n;return!a||!o||!i?null:i===a?u:l&&s===o&&id(i,a)?{base:e,src:o,shown:a}:null}const ld=["next"],cd=["@tanstack/react-router","@tanstack/react-start","@tanstack/solid-router","@tanstack/solid-start"],pa=new Set(["tsx","ts","jsx","js","mdx"]),dd=new Set(["tsx","jsx"]),ud=new Set(["404","500"]);function fd(t){const e=new Set;if(!t||typeof t!="object")return e;const n=t;for(const s of["dependencies","devDependencies"]){const a=n[s];if(a&&typeof a=="object"&&!Array.isArray(a))for(const l of Object.keys(a))e.add(l)}return e}function pd(t){const e=fd(t);return ld.some(n=>e.has(n))?"next":cd.some(n=>e.has(n))?"tanstack":null}function ma(t,e){const n=(t??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return n?`${n}/${e}`:e}function md(t,e){const n=s=>ma(e,s);switch(t){case"next":return[{router:"next-pages",dir:n("pages"),pattern:"**/*"},{router:"next-pages",dir:n("src/pages"),pattern:"**/*"},{router:"next-app",dir:n("app"),pattern:"**/page.*"},{router:"next-app",dir:n("src/app"),pattern:"**/page.*"}];case"tanstack":return[{router:"tanstack",dir:n("src/routes"),pattern:"**/*"}];default:{const s=t;throw new Error(`Unknown framework: ${String(s)}`)}}}function es(t){const e=t.lastIndexOf(".");return e<=0?null:[t.slice(0,e),t.slice(e+1)]}function hd(t){const e=es(t.at(-1)??"");if(!e||!pa.has(e[1]))return null;const[n]=e;if(n.includes("."))return null;const s=[...t.slice(0,-1),n];return s[0]==="api"||s.length===1&&ud.has(n)||s.some(a=>a.startsWith("_")||a.includes("["))?null:(s.at(-1)==="index"&&s.pop(),`/${s.join("/")}`)}function gd(t){const e=es(t.at(-1)??"");if(!e||e[0]!=="page"||!pa.has(e[1]))return null;const n=[];for(const s of t.slice(0,-1)){if(s.startsWith("_")||s.startsWith("@")||/^\(\.{1,3}\)/.test(s)||s.includes("["))return null;s.startsWith("(")&&s.endsWith(")")||n.push(s)}return`/${n.join("/")}`}function vd(t){const e=[];let n="",s=!1;for(const a of t)a==="["?s=!0:a==="]"&&(s=!1),a==="."&&!s?(e.push(n),n=""):n+=a;return e.push(n),e}function xd(t){const e=es(t.at(-1)??"");if(!e||!dd.has(e[1]))return null;const n=[...t.slice(0,-1),...vd(e[0])].filter(Boolean);n.at(-1)==="lazy"&&n.pop();const s=n.at(-1);if(!s||s==="__root"||n.some(l=>l.startsWith("-"))||s.startsWith("_"))return null;(s==="index"||s==="route")&&n.pop();const a=[];for(const l of n){if(l.includes("$"))return null;if(l.startsWith("_")||l.startsWith("(")&&l.endsWith(")"))continue;const u=l.replace(/_$/,"").replace(/[[\]]/g,"");u&&a.push(u)}return`/${a.join("/")}`}function bd(t,e){const n=e.split("/").filter(Boolean);if(n.length===0)return null;switch(t){case"next-pages":return hd(n);case"next-app":return gd(n);case"tanstack":return xd(n);default:{const s=t;throw new Error(`Unknown router: ${String(s)}`)}}}function wd(t){const e=new Set;for(const{root:n,files:s}of t){const a=`${n.dir}/`;for(const l of s){if(!l.startsWith(a))continue;const u=bd(n.router,l.slice(a.length));u&&e.add(u)}}return[...e].sort((n,s)=>n==="/"?-1:s==="/"?1:n.localeCompare(s))}const yd=5e3,kd=6e4;async function Sd(t,e){const n=await fetch(el(t,"glob"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({pattern:e.pattern,path:e.dir,limit:yd})});if(!n.ok)throw new Error(`Failed to list ${e.dir}: ${n.status}`);const s=await n.json();return Array.isArray(s.files)?s.files.filter(a=>typeof a=="string"):[]}async function Pd(t,e){const n=await ro(t,ma(e,"package.json"));if(n.kind==="unavailable")throw new Error("package.json unavailable: sandbox not ready");const s=n.kind==="data"?pd(n.data):null;if(!s)return[];const a=md(s,e),l=await Promise.all(a.map(async u=>({root:u,files:await Sd(t,u)})));return wd(l)}function jd(t,e,n){const s=ue.c(12);let a;s[0]!==e||s[1]!==t?(a=t?Gn.frameworkRoutes(t.orgSlug,t.virtualMcpId,t.branch,t.threadId,e):["framework-routes","none"],s[0]=e,s[1]=t,s[2]=a):a=s[2];let l;s[3]!==e||s[4]!==t?(l=()=>t?Pd(t,e):[],s[3]=e,s[4]=t,s[5]=l):l=s[5];const u=n&&!!t;let o;s[6]!==a||s[7]!==l||s[8]!==u?(o={queryKey:a,queryFn:l,enabled:u,staleTime:kd},s[6]=a,s[7]=l,s[8]=u,s[9]=o):o=s[9];const i=Tr(o);let c;return s[10]!==i.data?(c=i.data??[],s[10]=i.data,s[11]=c):c=s[11],c}const Ed=500,Nd={mobile:{width:412,height:823},tablet:{width:1024,height:1366},desktop:{width:1280,height:800}},yr=1,ln=["desktop","mobile","tablet"],Td=["preview","visual","blocks"],kr={mobile:"sandbox.preview.deviceMobile",tablet:"sandbox.preview.deviceTablet",desktop:"sandbox.preview.deviceDesktop"};function Cd(t){if(!t)return null;try{const e=new URL(t,window.location.href);return e.searchParams.set("__decoFBT","0"),e.searchParams.set("__deco_ssr","1"),e.href}catch{return t}}function $t(t){if(!t)return null;try{return new URL(t,window.location.href).origin}catch{return null}}function Bn(t,e){try{return new URL(t,e).href}catch{return null}}function Rd(t,e){if(!e.inPlaceRenderActive)return{pin:e.draftPreviewUrl?{path:e.resolvedPath,url:e.draftPreviewUrl}:null,effective:e.draftPreviewUrl};if(e.draftPreviewUrl!==null&&t?.path!==e.resolvedPath){const n={path:e.resolvedPath,url:e.draftPreviewUrl};return{pin:n,effective:n.url}}return{pin:t,effective:t?.url??null}}function Ld(t,e){return!t||t.nav!==e.nav?!1:t.content!==e.content}function Ad(t,e,n){const s=t.toLowerCase(),a=e.toLowerCase(),l=a.split("/").filter(Boolean),u=i=>{if(i===n)return 100;const c=i.indexOf(n);if(c===-1)return 0;let m=40;return c===0?m+=30:/[\s/-]/.test(i[c-1]??"")&&(m+=20),m+=Math.round(n.length/i.length*20),m};let o=Math.max(u(s),u(a));return l.at(-1)===n?o=Math.max(o,95):l.includes(n)&&(o=Math.max(o,90)),o}function _d(t,e){try{t.contentWindow?.location.reload()}catch{e&&(t.src=e)}}function Od({virtualMcpId:t}){const e=Te(),n=Yr(),{currentBranch:s,taskId:a,virtualMcpId:l}=Mt(),u=!!Ci(),o=ta(),i=Ki(l===t?t:null),c=Vr(t),m=tl(i?.metadata?.ui?.layout??null),f=ea(m),p=fa({contentEditingEnabled:f,isMobile:n}),[k]=E.useState(()=>ed({cmsMode:m,isMobile:n})),[g,v]=Un(In.previewEditingMode(t),d=>d&&Td.includes(d)?d:null),h=g??k,[x,C]=Un(In.previewDeviceSize(t),d=>d&&ln.includes(d)?d:"desktop"),[b,w]=E.useState(null),[N,j]=E.useState(null),P=E.useRef(null),S=E.useRef(null),[R,U]=E.useState(!1),T=E.useRef(null),A=()=>{T.current?.flush(),U(!1)},D=()=>U(d=>(d&&T.current?.flush(),!d)),[O,F]=E.useState({width:0,height:0}),[K,ee]=E.useState(!1),[W,G]=E.useState({}),[V,q]=E.useState(""),X=E.useRef(null),[Q,H]=E.useState(!1),[L,B]=E.useState(),[_,M]=E.useState(null),[z,Y]=E.useState(null),[ne,se]=E.useState(null),[I,re]=E.useState(()=>o.state.target?.kind==="page"?o.state.target.path:"/"),[ae,ie]=E.useState(()=>o.state.target?.kind==="page"?o.state.target.key:null),[me,pe]=E.useState({}),[xe,he]=E.useState(!1),ve=E.useRef(null),Se=()=>{he(!0),ve.current&&clearTimeout(ve.current),ve.current=setTimeout(()=>he(!1),15e3)},fe=()=>{ve.current&&(clearTimeout(ve.current),ve.current=null),he(!1)},{org:le}=Jn(),Re=Xn(),Ue=Ut(),Ie=Ue.vmEntry,Be=Re.lifecycle.phase,{url:vt}=Gr(t),ge=fn(t,s),{connection:_e}=Jr(t),be=Jo(t),ze=ao({hasServeConnection:!!_e,runtime:c.runtime}),Le=!Xe(ge)&&ge.kind!=="pending",Z=He(ge)??vt,ce=Z??Ue.previewUrl,We=!!Z||Be==="running",xt=i?.id===t?Wi(i.metadata):null,qe=!Z&&i?.id===t&&c.runtime==="cms",It=c.projectDefault==="cms",bt=Le?io({sandboxUrl:ce,previewServerUrl:xt,fastPreviewActive:qe}):null,ts=t&&s?{orgSlug:le.slug,virtualMcpId:t,branch:s,threadId:a??null,previewUrl:ce}:null,ns=Yn(ts,{fetchEnabled:We}),pn=Zr(ts,{fetchEnabled:We}),de=ns.data,Pe=pn.data,Ge=de?Co(de,Pe).sort((d,y)=>d.name.localeCompare(y.name)):[],zt=t&&s?{orgSlug:le.slug,virtualMcpId:t,branch:s}:null,ss=Kc(zt),ha=oo(zt),mn=de&&Pe?Ro(de,Pe):[],rs=Le&&de&&Pe?Si(Pe,de,"loaders"):[],as=V?(()=>{const d=V.toLowerCase();return Ge.map(y=>({page:y,score:Ad(y.name,y.path,d)})).filter(({score:y})=>y>0).sort((y,$)=>$.score-y.score||y.page.path.length-$.page.path.length).map(({page:y})=>y)})():Ge,is=mn.filter(d=>{if(!V)return!0;const y=V.toLowerCase();return d.name.toLowerCase().includes(y)||d.key.toLowerCase().includes(y)||d.resolveType.toLowerCase().includes(y)}),os=p?rs:[],ls=os.filter(d=>{if(!V)return!0;const y=V.toLowerCase();return d.title.toLowerCase().includes(y)||d.key.toLowerCase().includes(y)||d.resolveType.toLowerCase().includes(y)}),Kt=z?rs.find(d=>d.key===z)??null:null,Ee=Qn,hn=_||z?null:Lo(Ge,I,ae),oe=hn?.key??null,tt=o.state.target?.kind==="section"?o.state.target.key:o.state.focusedBlockKey??oe,Ht=hn?.path??null,nt=(oe?me[oe]:void 0)??{},Ce=Ve(I,nt),gn={};if(Le&&We&&ce&&Pe&&de){const d=Pi(Pe,"loaders"),y=oe?de[oe]:void 0,$=lc(y,de,ye=>d.has(ye)),te=sc($);for(const ye of Bt(I)){if(ye.type!=="param")continue;const Ne=ec(I,ye.name,$),ot=ic(Ne,d,te);ot.length>0&&(gn[ye.name]=ot)}}const wt=t&&s?{orgSlug:le.slug,virtualMcpId:t,branch:s,threadId:a??null}:null,cs=de&&oe?Bo(de,oe,0):[],ds=Xe(ge),us=de?ji(cs,de,ds):[],yt=us.map(d=>d.isSavedBlock?d.label:""),kt=us.map(d=>d.isSavedBlock?"global":d.isMultivariate?"variant":"normal"),St=cs.map(d=>Vn(d,de??{},ds)),st=E.useRef(null),Oe=E.useRef(null),ga=Re.status.state==="paused",vn=Re.phase,fs=Ei({claimPhase:vn,lifecycle:Re.lifecycle}),Je=Ue.previewState,va=Ue.userStopped,xa=lo(le.slug,t??""),{url:Ke}=$o(qe&&t&&s?{orgSlug:le.slug,virtualMcpId:t,branch:s,previewServerUrl:xt??null,path:Ce}:null),ba=It&&c.runtime==="sandbox",Ae=co(ge,ze,be),ps=uo(Ae&&qe&&ge.kind==="protocol"&&t&&s?{orgSlug:le.slug,virtualMcpId:t,branch:s}:null),ms=Ae?ps.pointer:null,J=Rl({previewState:Je,progressStatus:fs.status,previewServerUrl:xt,fastPreviewActive:qe,fastPreviewReady:!!Ke,codingSession:ba,localPreviewUrl:Z,hostedDraft:Ae,hostedPointerPending:Ae&&(ge.kind==="pending"||ps.pending)}),hs=J.showWakingPill||Ae&&J.mode==="production"&&!ms,Pt=J.mode!=="none",wa=J.mode==="production"&&J.iframeBase?$t(J.iframeBase):null,rt=J.mode==="production"?wa:$t(ce),ya=i?.id===t&&i.metadata?.fastPreviewInPlace===!0,jt=Le?Z?J.mode==="sandbox"&&p&&h==="blocks":J.mode==="production"&&qe&&ya&&p&&h==="blocks":!1,gs=E.useRef(null),{pin:ka,effective:Sa}=Rd(gs.current,{inPlaceRenderActive:jt,draftPreviewUrl:Ke,resolvedPath:Ce});gs.current=ka;const vs=o.state.variantOverride??[],Vt=Le?vs:[],Et=Le?[]:vs,Wt=Xe(ge)&&Ao.some(d=>_o(Pe,d)==="available"),at=Wt?W:{},xs=qr(at),Pa=Wt&&de?Object.keys(Oo(de).experiments):[],[bs,ja]=E.useState(!1),ws=fo(zt,Wt&&bs?Do:[]),Ea={...ws,ready:!(ge.kind==="protocol"&&ge.hosted)||bs&&ws.ready},Ye=t?Ys(le.slug,t):null,Na=po(Ye),qt=Ae?nd({display:J,path:Ce,pointer:ms,heldRevision:Na,device:x,forcedVariants:Et,previewOptions:at}):null,ys=JSON.stringify([Et,at]);E.useEffect(()=>{if(!Ae||!Ye)return;const[d,y]=JSON.parse(ys);Qs(Ye,{forcedVariants:d,previewOptions:y})},[Ae,Ye,ys]),E.useEffect(()=>{if(!(!Ae||!Ye))return()=>Qs(Ye,null)},[Ae,Ye]);const xn=_e&&He(ge)?mo(_e.endpoint,Et,xs):null,Ta=_e&&He(ge)?xn?ho(xn,at):Xs:null,Qe=Cd(J.mode==="sandbox"?nn(Hn(Zs(ne??Bn(Ce,J.iframeBase)??J.iframeBase,Ta),x),Vt):J.mode==="production"&&qt?.frame?qt.frame:J.mode==="production"?nn(Hn(er(tr(Zs(ne??Sa??Bn(Ce,J.iframeBase)??J.iframeBase,hs?Xs:null),Et),at),x),Vt):null),ks=Ke??(J.iframeBase?Bn(Ce,J.iframeBase):null),Ss=J.mode==="production"&&qt?qt.newTab:J.mode==="production"?ks?nn(er(tr(ks,Et),at),Vt):null:Qe??J.iframeBase,Ca=()=>{const d=Ss;d&&window.open(d,"_blank","noopener")},Nt=t&&s?_r(le.slug,t,s):null,Tt=d=>{Nt&&Li(Nt,d)},ke=o.state.target;E.useEffect(()=>{if(!(!ke||!bt||!Pe))if(ke.kind==="page"){const d=me[ke.key]??{};Oe.current=Ve(ke.path,d),M(null),Y(null),se(null),ie(ke.key),re(ke.path),Tt({path:ke.path,pageKey:ke.key,params:d})}else if(ke.kind==="loader")Oe.current=null,M(null),Y(ke.key),se(null);else{const d=mn.find(y=>y.key===ke.key);if(d){Oe.current=null;const y=sr(Pe);Y(null),M(d),se(nr(bt,y,d.key))}}},[ke,bt,Pe,me]),E.useEffect(()=>{!oe||Ht===null||ke?.kind==="page"&&ke.key===oe&&ke.path===Ht||o.selectTarget({kind:"page",key:oe,path:Ht})},[oe,Ht,ke]);const[Ps,Ra]=E.useState(null);if(Je.kind==="iframe"&&Ps!==Je.previewUrl){const d=Ps!==null;Ra(Je.previewUrl);const y=Nt?Ar(Nt):null;if(y){if(Oe.current=Ve(y.path,y.params),re(y.path),ie(y.pageKey),se(null),M(null),Y(null),y.pageKey&&Object.keys(y.params).length>0){const $=y.pageKey;pe(te=>({...te,[$]:y.params}))}}else d&&(Oe.current=null,re("/"),se(null),ie(null),M(null),Y(null))}st.current=Qe;const La=J.mode==="production"&&!!Ke&&!Z,[Gt,bn]=E.useState({src:Qe??void 0,loading:!1}),[Aa,wn]=E.useState(!1),[_a,Oa]=E.useState(),[js,Es]=E.useState(null),je=od(js,{base:J.iframeBase??"",frameSrc:Gt.src,loadedSrc:_a,wanted:Qe??void 0,canSwap:be&&Aa&&!Gt.loading});je!==js&&Es(je);const Jt=ad(Gt,je?je.src:Qe??void 0,La);Jt!==Gt&&bn(Jt);const it=Jt.src,Ns=Jt.loading,Ts=Ol({iframeRef:P,src:J.mode==="sandbox"?Qe:null,active:J.mode==="sandbox"}),Cs=E.useRef(null);E.useEffect(()=>{const d=Ns?setTimeout(()=>bn(wr),rd):null,y=()=>{d&&clearTimeout(d)};if(!Ke||!it||Cs.current===Ke)return y;Cs.current=Ke;const $=P.current;return $&&$.getAttribute("src")!==it&&(Se(),$.src=it),y},[Ke,it,Ns]);const Rs=()=>{const d=P.current?.contentWindow,y=rt;if(!d||!y||!de||!oe)return;const $=de[oe];if(!$||typeof $!="object")return;const te=wo({previewBaseUrl:y,pageBlock:$,decofile:de,path:Ce,pathTemplate:I});if(!te)return;const ye=nn(te.src,ko(Vt,oe));d.postMessage({type:"cms-editor::render",src:ye,body:te.body},y)},yn=E.useRef(null);E.useEffect(()=>{if(!jt||_||z||!oe||!de){yn.current=null;return}const d={nav:JSON.stringify({page:oe,path:Ce,pathTemplate:I}),content:JSON.stringify(de)},y=Ld(yn.current,d);yn.current=d,y&&Rs()},[de,jt,_,z,oe,Ce,I]);const kn=E.useRef(null);E.useEffect(()=>{if(!jt||_||z||!oe||!de){kn.current=null;return}const d=JSON.stringify(o.state.variantOverride??null),y=kn.current;kn.current={page:oe,sig:d},!(!y||y.page!==oe||y.sig===d)&&Rs()},[o.state.variantOverride,jt,_,z,oe]);const Ls=!!t&&!!s&&!Re.notFound&&!va&&!ga&&(vn?.kind==="ready"||Be!=="idle"),As=!Xe(ge),Da=Wr(t??void 0),Fa=jd(wt,Da,As&&Ls),$a=new Set(Ge.map(d=>Ee(d.path))),Yt=As?Fa.filter(d=>!$a.has(Ee(d))):[],_s=V?Yt.filter(d=>d.toLowerCase().includes(V.toLowerCase())):Yt,we=td({editingMode:h,sandboxDisplay:J.mode==="sandbox",blocksEditingEnabled:p});E.useEffect(()=>{const d=rt;if(!d)return;const y=$=>{if($.origin===d)if($.data?.type==="visual-editor::element-clicked"){const te=Bl.safeParse($.data.payload);te.success&&w(te.data)}else if($.data?.type==="cms-editor::section-clicked"){const te=Il.safeParse($.data.payload);te.success&&j({index:te.data.sectionIndex,seq:te.data.clickSeq})}else $.data?.type==="cms-editor::render-start"?Se():$.data?.type==="cms-editor::render-end"?(fe(),P.current?.contentWindow?.postMessage({type:"cms-editor::set-labels",labels:yt,kinds:kt,keys:St},d)):$.data?.type==="cms-editor::render-error"&&fe()};return window.addEventListener("message",y),()=>window.removeEventListener("message",y)},[rt,yt,kt,St]);const Os=()=>{const d=P.current?.contentWindow,y=$t(ce),$=Uc({v8:be,script:Ml});!d||!y||!$||d.postMessage($,y)},Ba=()=>{if(be)return;const d=P.current?.contentWindow,y=$t(ce);!d||!y||d.postMessage({type:"visual-editor::deactivate"},y)},Ds=()=>{const d=Me.current;d?.has("wireframe")&&(d.wireframe({type:"wireframe:sections",labels:yt,kinds:kt,keys:St}),d.wireframe({type:we==="blocks"?"wireframe:activate":"wireframe:deactivate"}))},Sn=()=>{if(be){Ds();return}const d=P.current?.contentWindow,y=rt,$=Mc({v8:be,production:J.mode==="production",localPreview:!!Z,script:zl});!d||!y||!$||(d.postMessage($,y),d.postMessage({type:"cms-editor::set-labels",labels:yt,kinds:kt,keys:St},y))},Ma=()=>{if(be){Me.current?.wireframe({type:"wireframe:deactivate"});return}const d=P.current?.contentWindow,y=rt;!d||!y||d.postMessage({type:"cms-editor::deactivate"},y)},Fs=d=>{Me.current?.wireframe({type:"wireframe:scroll-to",sectionIndex:d})},Ua=()=>{if(Me.current?.wireframe({type:"wireframe:clear-hover"}),be)return;const d=P.current?.contentWindow,y=rt;!d||!y||(d.postMessage({type:"cms-editor::clear-hover"},y),d.postMessage({type:"visual-editor::clear-hover"},y))},Qt=d=>{if(d==="blocks"&&!p)return;const y=h;!n&&d!==y&&(d==="blocks"?S.current?.resize("30%"):S.current?.collapse()),v(d),w(null),j(null),d!=="blocks"&&Y(null),y==="visual"&&Ba(),d==="visual"&&Os(),y==="blocks"&&d!=="blocks"&&Ma(),d==="blocks"&&Sn()},Ia=()=>{Qt(Xc(h,p))},za=()=>{Qt(Zc(h,p))},Xt=()=>{const d=P.current;if(!d)return;Se();const y=document.activeElement,$=d.tabIndex;d.tabIndex=-1,d.style.pointerEvents="none",d.blur(),_d(d,st.current);let te;const ye=()=>{clearTimeout(te),d.tabIndex=$,d.style.pointerEvents="";const Ne=document.activeElement;(!Ne||Ne===document.body||Ne===d)&&y?.focus(),d.removeEventListener("load",ye)};d.addEventListener("load",ye),te=setTimeout(ye,3e3)};Uo(Xt);const Me=E.useRef(null),$s=E.useEffectEvent(Ds),Ka=E.useEffectEvent((d,y)=>{j({index:d,seq:y})}),Ha=E.useEffectEvent(()=>{fe(),je&&(Pn.current=je.shown),Rt&&An(Ct)}),Bs=E.useEffectEvent(()=>{if(wn(!1),je&&Es(null),je&&je.src!==st.current){Se();return}Xt()});E.useEffect(()=>{if(!be)return;const d=new ql({studioOrigin:window.location.origin,build:"4.574.0",frame:()=>P.current?.contentWindow??null,onWireframeReady:()=>$s(),onWireframe:$=>{$.type==="wireframe:select"&&Ka($.sectionIndex,$.clickSeq)},onModulesChange:()=>wn(d.has("html-swap")),onSwapEnd:()=>Ha(),onSwapFailed:()=>Bs()});Me.current=d;const y=$=>{d.handle($)};return window.addEventListener("message",y),()=>{window.removeEventListener("message",y),d.dispose(),wn(!1),Me.current===d&&(Me.current=null)}},[be,J.iframeBase]);const Ms=be?JSON.stringify([yt,kt,St,we]):"";E.useEffect(()=>{Ms&&$s()},[Ms]);const Us=E.useRef(null);E.useEffect(()=>{const d=Us.current;if(Us.current=je,je&&je!==d){Me.current?.refresh(je.shown)?Se():Bs();return}!je&&d&&d.shown!==d.src&&d.src===st.current&&Xt()},[je]);const Is=()=>{Me.current?.refresh()||Xt()},Ct=Ys(le.slug,t??""),Rt=Ae&&Pt&&!!t,Pn=E.useRef(null);E.useEffect(()=>{if(Rt)return go(Ct)},[Rt,Ct]);const{reload:Lt}=vo(le.slug,t??""),zs=E.useRef(Lt.seq);E.useEffect(()=>{if(zs.current!==Lt.seq&&(zs.current=Lt.seq,!!Rt&&Pn.current===st.current)){if(Lt.navigates){An(Ct);return}Is()}},[Lt.seq]);const Va=xo(zt),At=bo(He(ge)?Va:""),Ks=E.useRef(At);E.useEffect(()=>{const d=Ks.current;if(Ks.current=At,!d||!At||d===At)return;const y=P.current;if(y)return $l({iframe:y,reload:Is})},[At]);const Wa=()=>{const d=ln.indexOf(x);C(ln[(d+1)%ln.length])},jn=(d,y)=>{if(!oe)return;const $=oe,te={...nt,[d]:y};Oe.current=Ve(I,te),pe(ye=>({...ye,[$]:te})),Tt({path:I,pageKey:$,params:te})},qa=Fc({iframeBase:J.iframeBase,resolvedPath:Ce,activeGlobalSectionName:_?.name??null,noServerLabel:e("sandbox.preview.noServerRunning")}),En=d=>{const y=me[d.key]??{},$=Ve(d.path,y);(_||Ee($)!==Ee(Ce))&&Se(),Oe.current=$,M(null),Y(null),se(null),j(null),ie(d.key),re(d.path),Tt({path:d.path,pageKey:d.key,params:y}),o.selectTarget({kind:"page",key:d.key,path:d.path})},Hs=d=>{(_||Ee(d)!==Ee(Ce))&&Se(),Oe.current=d,M(null),Y(null),se(null),j(null),ie(null),re(d),Tt({path:d,pageKey:null,params:{}})};Ri(Nt,Hs);const Ga=d=>{if(Xe(ge)){const te=de?Fo(de,d.key,Pe):null;te?En(te):dn.info(e("sandbox.preview.blockOnNoPage"));return}if(!bt||!Pe){dn.error(e("sandbox.preview.previewMetadataNotReady"));return}Se(),Oe.current=null;const y=sr(Pe),$=nr(bt,y,d.key);M(d),Y(null),se($),j(null),o.selectTarget({kind:"section",key:d.key})},Ja=d=>{p&&(M(null),Y(d.key),se(null),Qt("blocks"),o.selectTarget({kind:"loader",key:d.key}))},Ya=async({name:d,path:y,templateKey:$})=>{if(!t||!s)return;const te=Xr(y);if(te){B(te);return}const ye=y.trim().startsWith("/")?y.trim():`/${y.trim()}`;if(Ge.some(Ne=>Ee(Ne.path)===Ee(ye))){B(e("sandbox.preview.pageAlreadyExists",{path:ye}));return}B(void 0);try{const Ne=$?await ha(de,$):void 0;if($&&!Ne){B(e("sandbox.preview.templateNoLongerExists"));return}const ot=await ss.mutateAsync({name:d,path:ye,template:Ne,schema:Xe(ge)?{meta:Pe,loadMeta:async()=>(await pn.refetch()).data}:void 0});H(!1),dn.success(e("sandbox.preview.pageCreated",{name:d})),await sl(Ed),En({key:ot.key,name:ot.name,path:ot.path}),Qt("blocks")}catch(Ne){B(Ne instanceof ua?e("sandbox.preview.pageSchemaNotReady"):Ne instanceof Error?Ne.message:e("sandbox.preview.failedToCreatePage"))}},Zt=$c({previewSurfaceActive:Pt,daemonReady:Ls,production:J.mode==="production",servePreviewUrl:He(ge)}),Qa=Bc({showPreviewToolbar:Zt,contentEditingEnabled:f}),_t=()=>{ee(!1),q("")},Nn=_?.name??Kt?.title??hn?.name,Tn=ns.isPending||pn.isPending,Cn=Tn?$t(J.iframeBase):Nn,Ot=_?`section:${_.key}`:z?`loader:${z}`:oe?`page:${oe}`:Yt.includes(Ee(I))?`route:${Ee(I)}`:void 0,Xa=Zt?Qa?r.jsxs(Ur,{open:K,onOpenChange:d=>{ee(d),d||q("")},children:[r.jsx(Br,{asChild:!0,children:r.jsx("button",{type:"button","aria-label":e("sandbox.preview.choosePage"),"data-testid":"preview-page-picker",title:Tn?Cn??void 0:_||Kt?Nn:[Nn,I].filter(Boolean).join(" · "),className:"group/page-picker flex h-7 w-fit min-w-[320px] items-stretch overflow-hidden whitespace-nowrap rounded-[var(--studio-button-radius,calc(var(--radius)*1.333))] border border-border/60 bg-background text-left text-xs text-muted-foreground transition-colors hover:border-border focus-ring",children:r.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-1.5 px-2 transition-colors group-hover/page-picker:bg-accent/50 group-data-[state=open]/page-picker:bg-accent/50",children:[_&&r.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-global-section/14 px-1.5 py-0.5 text-2xs font-medium text-global-section-fg dark:text-global-section-fg-dark",children:[r.jsx($i,{size:11}),e("sandbox.preview.globalBadge")]}),Kt&&r.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-2xs font-medium text-muted-foreground",children:[r.jsx(Bi,{size:11}),e("sandbox.preview.loaderBadge")]}),Cn&&r.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:Cn}),!Tn&&!_&&!Kt&&r.jsx("span",{"data-testid":"preview-page-path",className:"ml-auto min-w-0 truncate text-right font-mono text-muted-foreground",children:I}),r.jsx(Ai,{size:12,className:Fe("shrink-0 transition-transform",K&&"rotate-180")})]})})}),r.jsxs(Mr,{className:"w-112 max-w-[calc(100vw-2rem)] p-0",align:"center",sideOffset:8,children:[r.jsxs(zr,{shouldFilter:!1,defaultValue:Ot,children:[r.jsx(Kr,{value:V,onValueChange:d=>{q(d),X.current?.scrollTo({top:0})},placeholder:e("sandbox.preview.searchPagesAndComponents")}),r.jsxs(Ir,{ref:X,className:"max-h-80",children:[r.jsx(Hr,{children:Ge.length===0&&Yt.length===0&&mn.length===0&&os.length===0?e("sandbox.preview.noPagesFound"):e("sandbox.preview.noSearchResults")}),as.length>0&&r.jsx(dt,{children:as.map(d=>r.jsxs(ut,{value:`page:${d.key}`,"aria-current":Ot===`page:${d.key}`||void 0,title:`${d.name} · ${d.path}`,onSelect:()=>{_t(),En(d)},className:"gap-3 px-3 py-2.5 aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",children:[r.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:d.name}),r.jsx("span",{className:"min-w-0 max-w-1/2 truncate text-right font-mono text-xs text-muted-foreground",children:d.path})]},d.key))}),_s.length>0&&r.jsx(dt,{heading:e("sandbox.preview.siteRoutes"),children:_s.map(d=>r.jsx(ut,{value:`route:${d}`,"aria-current":Ot===`route:${d}`||void 0,title:d,onSelect:()=>{_t(),Hs(d)},className:"px-3 py-2.5 aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",children:r.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs",children:d})},d))}),is.length>0&&r.jsx(dt,{heading:e("sandbox.preview.globalComponents"),children:is.map(d=>r.jsx(ut,{value:`section:${d.key}`,"aria-current":Ot===`section:${d.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{_t(),Ga(d)},children:r.jsx("span",{className:"truncate",children:d.name})},d.key))}),ls.length>0&&r.jsx(dt,{heading:e("sandbox.preview.globalLoaders"),children:ls.map(d=>r.jsx(ut,{value:`loader:${d.key}`,"aria-current":Ot===`loader:${d.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{_t(),Ja(d)},children:r.jsx("span",{className:"truncate",children:d.title})},d.key))})]})]}),!_&&!z&&Bt(I).some(d=>d.type!=="text")&&r.jsx("div",{className:"flex flex-wrap items-center gap-1 border-t px-3 py-3 text-xs text-muted-foreground",children:Bt(I).map((d,y)=>{if(d.type==="text")return r.jsx("span",{children:d.text},`text-${y}`);const $=gn[d.name];return $&&wt?r.jsx(Sc,{sources:$,template:I,paramName:d.name,value:nt[d.name]??"",sandboxRef:wt,onCommit:te=>jn(d.name,te)},`${oe}:${d.name}`):r.jsx(Oc,{name:d.name,value:nt[d.name]??"",onCommit:te=>jn(d.name,te)},`${oe}:${d.name}`)})}),r.jsx("div",{className:"border-t p-1.5",children:r.jsxs($e,{variant:"ghost",className:"w-full justify-start",onClick:()=>{_t(),B(void 0),H(!0)},children:[r.jsx($r,{size:16}),e("sandbox.preview.createNewPage")]})})]})]}):r.jsx("span",{className:"min-w-0 truncate text-xs text-muted-foreground",children:qa}):null,Vs=Zt||f?r.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[r.jsxs(ht,{children:[r.jsx(pt,{asChild:!0,children:r.jsx(Ze,{onClick:Wa,"aria-label":e(kr[x]),children:x==="mobile"?r.jsx(Dr,{size:16}):x==="tablet"?r.jsx(Mi,{size:16}):r.jsx(Fr,{size:16})})}),r.jsx(mt,{children:e(kr[x])})]}),Xa,r.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[Wt&&r.jsx(sd,{tests:Pa,load:Ea,onOpen:()=>ja(!0),options:W,onChange:d=>{G(d),o.previewAsChanged()},available:!!xn||!hs||!xs}),r.jsx(Ze,{onClick:Ca,disabled:Ae&&!Ss,"aria-label":e("sandbox.preview.openInNewTab"),children:r.jsx(Cr,{size:16})})]})]}):null,Za=(Le||u)&&J.mode==="sandbox",en=Nd[x],tn=x==="desktop"&&(O.width===0||O.width>=en.width+2*yr),Ws=tn?1:Math.min(O.width>0?O.width/(en.width+2*yr):1,1),ei=tn?{width:"100%",height:"100%"}:{width:`${en.width}px`,height:O.height>0?`${O.height/Ws}px`:`${en.height}px`,transform:`scale(${Ws})`,transformOrigin:"top center"},qs=r.jsxs(r.Fragment,{children:[Za&&(Zt||f)&&r.jsx(Ze,{onClick:Ia,"aria-pressed":we==="visual","aria-label":e("sandbox.preview.visualEditor"),active:we==="visual",children:r.jsx(Js,{size:16})}),p&&r.jsxs(ht,{children:[r.jsx(pt,{asChild:!0,children:r.jsx(Ze,{onClick:za,"aria-pressed":we==="blocks","aria-label":e("sandbox.preview.blocksEditor"),active:we==="blocks",children:r.jsx(Ii,{size:16})})}),r.jsx(mt,{children:e("sandbox.preview.blocksEditor")})]}),tt&&r.jsxs(ht,{children:[r.jsx(pt,{asChild:!0,children:r.jsx(Ze,{onClick:D,"aria-pressed":R,"aria-label":e("sectionsEditor.sectionsEditor.viewJson"),active:R,children:r.jsx(Ui,{size:16})})}),r.jsx(mt,{children:e("sectionsEditor.sectionsEditor.viewJson")})]})]}),ti=!!z&&we==="blocks";return r.jsxs("div",{className:"flex flex-col w-full h-full",children:[wt&&Object.entries(gn).map(([d,y])=>(nt[d]??"")===""?r.jsx(Ac,{sources:y,template:I,paramName:d,sandboxRef:wt,onFill:$=>jn(d,$)},`${oe}:${d}`):null),r.jsxs(r.Fragment,{children:[r.jsx(zn.Toolbar.Center.Portal,{fallback:r.jsx("div",{className:"flex min-w-0 items-center justify-center border-b p-2",children:Vs}),children:Vs}),r.jsx(zn.Toolbar.Right.Portal,{fallback:qs,children:qs})]}),r.jsx("div",{className:"flex-1 overflow-hidden relative",children:ti?r.jsxs("div",{className:"relative h-full min-h-0 overflow-hidden",children:[r.jsx(xr,{virtualMcpId:t,externalSelection:N,onSectionPicked:Fs,onViewJsonFile:D}),R&&tt&&r.jsx("div",{className:"absolute inset-0 z-10",children:r.jsx(br,{ref:T,virtualMcpId:t,pageKey:tt,onClose:A})})]}):r.jsxs(rr,{orientation:"horizontal",disabled:we!=="blocks",className:"relative isolate",children:[r.jsx(sn,{ref:S,id:"preview-blocks-editor",defaultSize:we==="blocks"?"30%":"0%",minSize:"20%",collapsible:!0,collapsedSize:"0%",className:"min-w-0 overflow-hidden",children:we==="blocks"&&r.jsx(xr,{virtualMcpId:t,externalSelection:N,onSectionPicked:Fs,onViewJsonFile:D})}),we==="blocks"&&r.jsx(ar,{withHandle:!0}),r.jsx(sn,{id:"preview-canvas",defaultSize:we==="blocks"?"70%":"100%",minSize:"35%",className:"min-w-0 overflow-hidden relative z-0",children:r.jsxs(rr,{orientation:"horizontal",disabled:!(R&&tt),children:[r.jsx(sn,{id:"preview-canvas-inner",minSize:"30%",className:"min-w-0 overflow-hidden",children:r.jsxs("div",{ref:d=>{if(!d)return;const y=()=>F(te=>te.width===d.clientWidth&&te.height===d.clientHeight?te:{width:d.clientWidth,height:d.clientHeight});y();const $=new ResizeObserver(y);return $.observe(d),()=>$.disconnect()},className:Fe("h-full relative overflow-clip flex justify-center",Pt&&!tn&&"bg-muted/30"),children:[(xe||xa)&&Pt&&r.jsx("div",{className:"absolute inset-x-0 top-0 z-40 h-1 overflow-hidden",children:r.jsx("div",{className:"absolute inset-y-0 left-0 rounded-r-full bg-brand shadow-[0_0_6px] shadow-brand/60 animate-preview-ramp"})}),J.showDecidingLoader&&r.jsx("div",{"data-testid":"preview-deciding",className:"absolute inset-0 z-30 flex items-center justify-center",children:r.jsx(gt,{className:"size-5 text-muted-foreground"})}),J.showBlockingOverlay&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(Ln,{kind:"starting",progress:fs,claimPhase:vn})}),!Z&&Je.kind==="suspended"&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(Ln,{kind:"suspended",onResume:Ue.resume})}),!Z&&Je.kind==="errored"&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(Ln,{kind:"errored",error:Je.error,onRetry:Ue.retry,connectionsHref:`/${le.slug}/settings/connections`})}),J.showWakingPill&&r.jsxs("div",{className:"absolute top-4 left-1/2 z-20 flex max-w-md -translate-x-1/2 items-start gap-3 rounded-xl bg-muted px-4 py-3 shadow-soft pointer-events-none select-none",children:[r.jsx(gt,{className:"size-4.5 mt-0.5 shrink-0 text-muted-foreground"}),r.jsxs("div",{className:"flex flex-col gap-0.5",children:[r.jsx("span",{className:"text-sm font-medium text-foreground",children:e("sandbox.preview.startingPreview")}),r.jsx("span",{className:"text-xs text-muted-foreground",children:e("sandbox.preview.startingPreviewHint")})]})]}),we==="visual"&&!b&&r.jsxs("div",{className:"absolute top-2 left-1/2 -translate-x-1/2 z-20 flex items-center gap-1.5 rounded-full border border-special/40 bg-special/90 px-3 py-1 text-xs font-medium text-special-foreground shadow-soft backdrop-blur-sm pointer-events-none select-none",children:[r.jsx(Js,{size:12}),e("sandbox.preview.clickElementToAsk")]}),we==="visual"&&b&&r.jsx(Ql,{element:b,onDismiss:()=>w(null)}),Pt&&Qe&&r.jsx("div",{className:Fe("shrink-0",!tn&&"bg-background shadow-edge"),style:ei,onMouseLeave:Ua,children:r.jsx("iframe",{ref:P,src:it,className:"w-full h-full border-0",title:e("sandbox.preview.devServerPreviewTitle"),onError:Ts.handleError,onLoad:()=>{if(bn(wr),Oa(it),Ts.handleLoad(),fe(),Pn.current=st.current,Rt&&An(Ct),J.mode!=="sandbox"||Z){(J.mode==="production"&&!J.showWakingPill||Z)&&we==="blocks"&&Sn();return}if(fi("vm_preview_loaded",{view_mode:we,vm_id:Ie?.sandboxHandle??null}),!_)try{const d=P.current?.contentWindow?.location?.pathname;if(!d)return;const y=Oe.current;if(y!==null&&(Oe.current=null,Ee(d)!==Ee(y))||Ee(d)===Ee(Ce))return;re(d),Tt({path:d,pageKey:ae,params:nt})}catch{}we==="visual"&&Os(),we==="blocks"&&Sn()}},J.iframeBase)})]})}),R&&tt&&r.jsxs(r.Fragment,{children:[r.jsx(ar,{withHandle:!0}),r.jsx(sn,{id:"preview-json-editor",defaultSize:"43%",minSize:"20%",className:"min-w-0 overflow-hidden",children:r.jsx(br,{ref:T,virtualMcpId:t,pageKey:tt,onClose:A})})]})]})})]})}),r.jsx(Hc,{open:Q,onOpenChange:H,isPending:ss.isPending,error:L,templates:Ge,onSubmit:Ya})]})}const qn={app:null,split:!1};function Dd(t){const e=ue.c(24),{project:n,maxApps:s,children:a}=t,l=Te();let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u={silent:!0},e[0]=u):u=e[0];const o=Hi(u),i=Ut();let c;e[1]!==n.metadata.runtime?(c=n.metadata.runtime??{},e[1]=n.metadata.runtime,e[2]=c):c=e[2];const m=c;let f;e[3]!==m.apps?(f=m.apps??[],e[3]=m.apps,e[4]=f):f=e[4];const p=f;let k;e[5]!==o.update||e[6]!==i||e[7]!==n.id||e[8]!==n.metadata||e[9]!==m||e[10]!==l?(k=b=>o.update.mutate({id:n.id,data:{metadata:{...rl(n.metadata),runtime:{...m,apps:b.length?b:null}}}},{onSuccess:()=>i.start(),onError:()=>dn.error(l("sandbox.appTabs.saveError"))}),e[5]=o.update,e[6]=i,e[7]=n.id,e[8]=n.metadata,e[9]=m,e[10]=l,e[11]=k):k=e[11];const g=k,v=m.path??null;let h,x;e[12]!==p||e[13]!==g?(h=b=>g([...p,{path:b}]),x=b=>g(p.filter(w=>w.path!==b)),e[12]=p,e[13]=g,e[14]=h,e[15]=x):(h=e[14],x=e[15]);let C;return e[16]!==p||e[17]!==a||e[18]!==s||e[19]!==n.id||e[20]!==v||e[21]!==h||e[22]!==x?(C=r.jsx(Fd,{virtualMcpId:n.id,mainPath:v,apps:p,maxApps:s,onAddApp:h,onRemoveApp:x,children:a}),e[16]=p,e[17]=a,e[18]=s,e[19]=n.id,e[20]=v,e[21]=h,e[22]=x,e[23]=C):C=e[23],C}function Fd(t){const e=ue.c(102),{virtualMcpId:n,mainPath:s,apps:a,maxApps:l,onAddApp:u,onRemoveApp:o,children:i}=t,c=Te(),m=Yr(),{currentBranch:f}=Mt(),p=Ut(),k=Xn().lifecycle.phase,g=fn(n,f),{url:v}=Gr(n);let h;e[0]!==g||e[1]!==v?(h=He(g)??v,e[0]=g,e[1]=v,e[2]=h):h=e[2];const x=h,C=x??p.previewUrl,b=!!x||k==="running",w=!b&&p.status==="errored";let N;e[3]!==p.vmEntry?.startedWith?.apps?(N=p.vmEntry?.startedWith?.apps??[],e[3]=p.vmEntry?.startedWith?.apps,e[4]=N):N=e[4];const j=N;let P;e[5]!==n?(P=In.previewAppLayout(n),e[5]=n,e[6]=P):P=e[6];const[S,R]=Un(P,$d);let U;e[7]!==a||e[8]!==S?(U=a.some(fe=>fe.path===S.app)?S.app:null,e[7]=a,e[8]=S,e[9]=U):U=e[9];const T=U,A=T!==null&&S.split&&!m,D=T===null||A,O=T??a[0]?.path??null,[F,K]=E.useState(null),[ee,W]=E.useState(!1);let G;e[10]===Symbol.for("react.memo_cache_sentinel")?(G=()=>{K(null),W(!1)},e[10]=G):G=e[10];const V=G;let q;e[11]!==a||e[12]!==F||e[13]!==m||e[14]!==s||e[15]!==u||e[16]!==R?(q=()=>{if(F===null)return;const fe=lr(F);if(!fe){V();return}if(fe===lr(s??"")||a.some(le=>le.path===fe)){W(!0);return}u(fe),R({app:fe,split:!m}),V()},e[11]=a,e[12]=F,e[13]=m,e[14]=s,e[15]=u,e[16]=R,e[17]=q):q=e[17];const X=q;let Q;e[18]!==s||e[19]!==c?(Q=s?_n(s):c("sandbox.appTabs.root"),e[18]=s,e[19]=c,e[20]=Q):Q=e[20];const H=Q;let L;e[21]!==A||e[22]!==c?(L=c(A?"sandbox.appTabs.single":"sandbox.appTabs.split"),e[21]=A,e[22]=c,e[23]=L):L=e[23];const B=L;let _;e[24]!==c?(_=c("sandbox.appTabs.label"),e[24]=c,e[25]=_):_=e[25];let M;e[26]!==c?(M=c("sandbox.appTabs.main"),e[26]=c,e[27]=M):M=e[27];let z;e[28]!==c?(z=c("sandbox.appTabs.mainHint"),e[28]=c,e[29]=z):z=e[29];let Y;e[30]!==R?(Y=()=>R(qn),e[30]=R,e[31]=Y):Y=e[31];let ne;e[32]!==w||e[33]!==H||e[34]!==b||e[35]!==D||e[36]!==M||e[37]!==z||e[38]!==Y?(ne=r.jsx(Sr,{label:H,badge:M,hint:z,ready:b,failed:w,onScreen:D,onSelect:Y}),e[32]=w,e[33]=H,e[34]=b,e[35]=D,e[36]=M,e[37]=z,e[38]=Y,e[39]=ne):ne=e[39];let se;if(e[40]!==a||e[41]!==T||e[42]!==w||e[43]!==H||e[44]!==o||e[45]!==b||e[46]!==R||e[47]!==A||e[48]!==c){let fe;e[50]!==T||e[51]!==w||e[52]!==H||e[53]!==o||e[54]!==b||e[55]!==R||e[56]!==A||e[57]!==c?(fe=le=>{const Re=_n(le.path);return r.jsx(Sr,{label:Re,hint:c("sandbox.appTabs.extraHint",{app:H}),ready:b,failed:w,onScreen:le.path===T,onSelect:()=>R({app:le.path,split:A}),onRemove:()=>o(le.path),removeLabel:c("sandbox.appTabs.remove",{app:Re})},le.path)},e[50]=T,e[51]=w,e[52]=H,e[53]=o,e[54]=b,e[55]=R,e[56]=A,e[57]=c,e[58]=fe):fe=e[58],se=a.map(fe),e[40]=a,e[41]=T,e[42]=w,e[43]=H,e[44]=o,e[45]=b,e[46]=R,e[47]=A,e[48]=c,e[49]=se}else se=e[49];let I;e[59]!==ne||e[60]!==se||e[61]!==_?(I=r.jsxs("div",{role:"tablist","aria-label":_,className:"flex min-w-0 items-center gap-1 overflow-x-auto",children:[ne,se]}),e[59]=ne,e[60]=se,e[61]=_,e[62]=I):I=e[62];let re;e[63]!==a.length||e[64]!==X||e[65]!==F||e[66]!==ee||e[67]!==l||e[68]!==c?(re=F!==null?r.jsx("form",{className:"w-40 shrink-0",onSubmit:fe=>{fe.preventDefault(),X()},children:r.jsx("input",{autoFocus:!0,value:F,placeholder:"apps/checkout","aria-label":c("sandbox.appTabs.pathLabel"),"aria-invalid":ee,onChange:fe=>{K(fe.target.value),W(!1)},onBlur:V,onKeyDown:fe=>{fe.key==="Escape"&&V()},className:Fe("h-7 w-full rounded-md border bg-background px-2 font-mono text-xs outline-none",ee?"border-destructive":"border-border")})}):a.length<l&&r.jsx(ft,{label:c("sandbox.appTabs.add"),onClick:()=>K(""),children:r.jsx($r,{})}),e[63]=a.length,e[64]=X,e[65]=F,e[66]=ee,e[67]=l,e[68]=c,e[69]=re):re=e[69];let ae;e[70]!==m||e[71]!==R||e[72]!==A||e[73]!==B||e[74]!==O?(ae=!m&&O&&r.jsx(ft,{label:B,active:A,onClick:()=>R(A?qn:{app:O,split:!0}),children:r.jsx(zi,{})}),e[70]=m,e[71]=R,e[72]=A,e[73]=B,e[74]=O,e[75]=ae):ae=e[75];let ie;e[76]!==I||e[77]!==re||e[78]!==ae?(ie=r.jsxs(r.Fragment,{children:[I,re,ae]}),e[76]=I,e[77]=re,e[78]=ae,e[79]=ie):ie=e[79];const me=ie;let pe;e[80]!==me?(pe=r.jsx(zn.Topbar.Left.Portal,{fallback:r.jsx("div",{className:"flex h-10 shrink-0 items-center gap-1 border-b border-border px-2",children:me}),children:r.jsx("div",{className:"ml-1 flex min-w-0 items-center gap-1 border-l border-border/60 pl-2",children:me})}),e[80]=me,e[81]=pe):pe=e[81];let xe;e[82]!==i||e[83]!==D?(xe=D&&r.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:i}),e[82]=i,e[83]=D,e[84]=xe):xe=e[84];let he;e[85]!==T||e[86]!==w||e[87]!==p.start||e[88]!==x||e[89]!==H||e[90]!==C||e[91]!==b||e[92]!==R||e[93]!==A||e[94]!==j?(he=T!==null&&r.jsx(Bd,{name:_n(T),mainName:H,appUrl:C?al(C,T):null,ready:b,failed:w,notStarted:!x&&!j.includes(T),onStart:p.start,className:Fe(A&&"border-l border-border"),onClose:A?()=>R({app:T,split:!1}):void 0},T),e[85]=T,e[86]=w,e[87]=p.start,e[88]=x,e[89]=H,e[90]=C,e[91]=b,e[92]=R,e[93]=A,e[94]=j,e[95]=he):he=e[95];let ve;e[96]!==xe||e[97]!==he?(ve=r.jsxs("div",{className:"flex min-h-0 flex-1",children:[xe,he]}),e[96]=xe,e[97]=he,e[98]=ve):ve=e[98];let Se;return e[99]!==pe||e[100]!==ve?(Se=r.jsxs("div",{className:"flex h-full w-full min-h-0 flex-col",children:[pe,ve]}),e[99]=pe,e[100]=ve,e[101]=Se):Se=e[101],Se}function $d(t){return t??qn}function Sr(t){const e=ue.c(28),{label:n,badge:s,hint:a,ready:l,failed:u,onScreen:o,onSelect:i,onRemove:c,removeLabel:m}=t,f=o?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/60 hover:text-foreground";let p;e[0]!==f?(p=Fe("group/app-tab flex h-7 shrink-0 items-center rounded-md text-xs transition-colors",f),e[0]=f,e[1]=p):p=e[1];const k=l?"bg-success":u?"bg-destructive":"animate-pulse bg-warning";let g;e[2]!==k?(g=Fe("size-1.5 rounded-full",k),e[2]=k,e[3]=g):g=e[3];let v;e[4]!==g?(v=r.jsx("span",{"aria-hidden":!0,className:g}),e[4]=g,e[5]=v):v=e[5];let h;e[6]!==n?(h=r.jsx("span",{className:"max-w-40 truncate",children:n}),e[6]=n,e[7]=h):h=e[7];let x;e[8]!==s?(x=s&&r.jsx("span",{className:"text-[10px] text-muted-foreground",children:s}),e[8]=s,e[9]=x):x=e[9];let C;e[10]!==o||e[11]!==i||e[12]!==v||e[13]!==h||e[14]!==x?(C=r.jsx(pt,{asChild:!0,children:r.jsxs("button",{type:"button",role:"tab","aria-selected":o,onClick:i,className:"flex h-full items-center gap-1.5 rounded-md px-2.5 focus-ring",children:[v,h,x]})}),e[10]=o,e[11]=i,e[12]=v,e[13]=h,e[14]=x,e[15]=C):C=e[15];let b;e[16]!==a?(b=r.jsx(mt,{className:"max-w-64",children:a}),e[16]=a,e[17]=b):b=e[17];let w;e[18]!==C||e[19]!==b?(w=r.jsxs(ht,{children:[C,b]}),e[18]=C,e[19]=b,e[20]=w):w=e[20];let N;e[21]!==c||e[22]!==m?(N=c&&r.jsx("button",{type:"button","aria-label":m,onClick:c,className:"-ml-1 mr-1 flex size-5 items-center justify-center rounded opacity-0 hover:bg-sidebar-accent focus-ring focus-visible:opacity-100 group-hover/app-tab:opacity-100",children:r.jsx(sa,{className:"size-3"})}),e[21]=c,e[22]=m,e[23]=N):N=e[23];let j;return e[24]!==w||e[25]!==N||e[26]!==p?(j=r.jsxs("div",{className:p,children:[w,N]}),e[24]=w,e[25]=N,e[26]=p,e[27]=j):j=e[27],j}function Bd(t){const e=ue.c(71),{name:n,mainName:s,appUrl:a,ready:l,failed:u,notStarted:o,onStart:i,className:c,onClose:m}=t,f=Te(),[p,k]=E.useState("/"),[g,v]=E.useState("desktop"),[h,x]=E.useState(0),C=E.useRef(null);let b;e[0]!==a||e[1]!==p?(b=a?il(a,p):null,e[0]=a,e[1]=p,e[2]=b):b=e[2];const w=b;let N;e[3]!==c?(N=Fe("flex min-h-0 min-w-0 flex-1 flex-col",c),e[3]=c,e[4]=N):N=e[4];let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=z=>{z.preventDefault(),k(C.current?.value||"/")},e[5]=j):j=e[5];let P;e[6]!==n||e[7]!==f?(P=f("sandbox.appPane.path",{app:n}),e[6]=n,e[7]=f,e[8]=P):P=e[8];let S;e[9]!==p||e[10]!==P?(S=r.jsx("form",{className:"min-w-0 flex-1",onSubmit:j,children:r.jsx("input",{ref:C,defaultValue:p,"aria-label":P,className:"h-7 w-full rounded-md border border-border/60 bg-background px-2 font-mono text-xs text-muted-foreground outline-none hover:border-border focus:border-border focus:text-foreground"})}),e[9]=p,e[10]=P,e[11]=S):S=e[11];let R;e[12]!==g||e[13]!==f?(R=f(g==="desktop"?"sandbox.preview.deviceMobile":"sandbox.preview.deviceDesktop"),e[12]=g,e[13]=f,e[14]=R):R=e[14];let U;e[15]===Symbol.for("react.memo_cache_sentinel")?(U=()=>v(Ud),e[15]=U):U=e[15];let T;e[16]!==g?(T=g==="desktop"?r.jsx(Fr,{}):r.jsx(Dr,{}),e[16]=g,e[17]=T):T=e[17];let A;e[18]!==R||e[19]!==T?(A=r.jsx(ft,{label:R,onClick:U,children:T}),e[18]=R,e[19]=T,e[20]=A):A=e[20];let D;e[21]!==n||e[22]!==f?(D=f("sandbox.appPane.reload",{app:n}),e[21]=n,e[22]=f,e[23]=D):D=e[23];const O=!w||!l;let F,K;e[24]===Symbol.for("react.memo_cache_sentinel")?(F=()=>x(Md),K=r.jsx(pi,{}),e[24]=F,e[25]=K):(F=e[24],K=e[25]);let ee;e[26]!==D||e[27]!==O?(ee=r.jsx(ft,{label:D,disabled:O,onClick:F,children:K}),e[26]=D,e[27]=O,e[28]=ee):ee=e[28];let W;e[29]!==n||e[30]!==f?(W=f("sandbox.appPane.openInNewTab",{app:n}),e[29]=n,e[30]=f,e[31]=W):W=e[31];const G=!w||!l;let V;e[32]!==w?(V=()=>w&&window.open(w,"_blank","noopener"),e[32]=w,e[33]=V):V=e[33];let q;e[34]===Symbol.for("react.memo_cache_sentinel")?(q=r.jsx(Cr,{}),e[34]=q):q=e[34];let X;e[35]!==W||e[36]!==G||e[37]!==V?(X=r.jsx(ft,{label:W,disabled:G,onClick:V,children:q}),e[35]=W,e[36]=G,e[37]=V,e[38]=X):X=e[38];let Q;e[39]!==n||e[40]!==m||e[41]!==f?(Q=m&&r.jsx(ft,{label:f("sandbox.appPane.close",{app:n}),onClick:m,children:r.jsx(sa,{})}),e[39]=n,e[40]=m,e[41]=f,e[42]=Q):Q=e[42];let H;e[43]!==ee||e[44]!==X||e[45]!==Q||e[46]!==S||e[47]!==A?(H=r.jsxs("div",{className:"flex h-10 shrink-0 items-center gap-1 border-b border-border px-2",children:[S,A,ee,X,Q]}),e[43]=ee,e[44]=X,e[45]=Q,e[46]=S,e[47]=A,e[48]=H):H=e[48];let L;e[49]!==s||e[50]!==f?(L=f("sandbox.appPane.previewOnly",{app:s}),e[49]=s,e[50]=f,e[51]=L):L=e[51];let B;e[52]!==L?(B=r.jsx("p",{className:"shrink-0 truncate border-b border-border bg-muted/40 px-3 py-1.5 text-xs text-muted-foreground",children:L}),e[52]=L,e[53]=B):B=e[53];let _;e[54]!==g||e[55]!==u||e[56]!==s||e[57]!==n||e[58]!==o||e[59]!==i||e[60]!==l||e[61]!==h||e[62]!==w||e[63]!==f?(_=r.jsx("div",{className:"flex min-h-0 flex-1 justify-center overflow-auto bg-muted/40",children:l&&o?r.jsxs("div",{className:"flex flex-col items-center gap-3 self-center px-6 text-center",children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:f("sandbox.appPane.notStarted",{app:n})}),r.jsx($e,{size:"sm",variant:"outline",onClick:i,children:f("sandbox.appPane.start",{app:n})})]}):!l||!w?r.jsx("p",{className:"self-center px-6 text-center text-sm text-muted-foreground",children:l?f("sandbox.appPane.noUrl"):u?f("sandbox.appPane.failed",{app:s}):f("sandbox.appPane.waiting")}):r.jsx("iframe",{src:w,title:n,className:Fe("h-full bg-background",g==="mobile"?"w-[412px] max-w-full border-x border-border":"w-full")},`${w}#${h}`)}),e[54]=g,e[55]=u,e[56]=s,e[57]=n,e[58]=o,e[59]=i,e[60]=l,e[61]=h,e[62]=w,e[63]=f,e[64]=_):_=e[64];let M;return e[65]!==n||e[66]!==N||e[67]!==H||e[68]!==B||e[69]!==_?(M=r.jsxs("section",{"aria-label":n,className:N,children:[H,B,_]}),e[65]=n,e[66]=N,e[67]=H,e[68]=B,e[69]=_,e[70]=M):M=e[70],M}function Md(t){return t+1}function Ud(t){return t==="desktop"?"mobile":"desktop"}function ft(t){const e=ue.c(11),{label:n,children:s,active:a,disabled:l,onClick:u}=t;let o;e[0]!==a||e[1]!==s||e[2]!==l||e[3]!==n||e[4]!==u?(o=r.jsx(pt,{asChild:!0,children:r.jsx(Ze,{"aria-label":n,"aria-pressed":a,active:a,disabled:l,onClick:u,children:s})}),e[0]=a,e[1]=s,e[2]=l,e[3]=n,e[4]=u,e[5]=o):o=e[5];let i;e[6]!==n?(i=r.jsx(mt,{children:n}),e[6]=n,e[7]=i):i=e[7];let c;return e[8]!==o||e[9]!==i?(c=r.jsxs(ht,{children:[o,i]}),e[8]=o,e[9]=i,e[10]=c):c=e[10],c}const Id=async(t,e)=>{try{return await fetch(t,{method:"HEAD",mode:"no-cors",cache:"no-store",credentials:"omit",signal:e}),!0}catch{return!1}},zd=1e4,Kd=1e4,Hd=5e3,Vd=2;function Wd(t,e){return t&&e===0?Kd:Math.min(1e3*2**Math.max(0,e-1),Hd)}function qd(t,e,n){return e?!0:t===!0&&n<Vd}function Gd(t,e){const n=ue.c(11),s=Id,a=mi();let l;n[0]!==t?(l=Gn.localAppReachable(t??""),n[0]=t,n[1]=l):l=n[1];const u=l;let o;n[2]!==s||n[3]!==a||n[4]!==u||n[5]!==t?(o=async f=>{const{signal:p}=f,k=new AbortController,g=()=>k.abort();p.addEventListener("abort",g);const v=setTimeout(g,zd),h=await s(t,k.signal).catch(Yd);clearTimeout(v),p.removeEventListener("abort",g);const x=a.getQueryData(u),C=h?0:(x?.failures??0)+1;return{up:qd(x?.up??null,h,C),failures:C}},n[2]=s,n[3]=a,n[4]=u,n[5]=t,n[6]=o):o=n[6];const i=!!t;let c;n[7]!==u||n[8]!==o||n[9]!==i?(c={queryKey:u,queryFn:o,enabled:i,retry:!1,staleTime:0,gcTime:0,refetchInterval:Jd},n[7]=u,n[8]=o,n[9]=i,n[10]=c):c=n[10];const{data:m}=Tr(c);return t?m?.up??null:null}function Jd(t){return t.state.data?Wd(t.state.data.up,t.state.data.failures):!1}function Yd(){return!1}function Qd(t){const{backend:e}=t;if(e.kind==="protocol"&&e.source==="local")return{kind:"connected"};if(e.kind==="unavailable"&&e.source==="local"){const n=e.problem;return!n||n.reason==="not-answering"?t.access==="denied"?{kind:"needs-permission"}:{kind:"not-running"}:{kind:"problem",problem:n}}return{kind:"connecting"}}function Ju(t){const e=ue.c(53),{virtualMcpId:n}=t,s=Te(),a=Vi(n),{connection:l}=Jr(n),{activeTask:u,taskId:o,currentBranch:i}=Mt(),c=ml(o),[m,f]=E.useState(!1),p=fn(n,i);let k;e[0]!==p||e[1]!==l?(k=l?He(p):null,e[0]=p,e[1]=l,e[2]=k):k=e[2];const g=k,v=Gd(g),h=aa(),x=ol("multi_app_preview");if(dl({threadId:o,sandboxBranch:u?.branch??i,agentHasRepo:On(a?.metadata),threadHasRepo:On(c)||On(u?.metadata)})==="none"&&!l){let j;e[3]===Symbol.for("react.memo_cache_sentinel")?(j=r.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:r.jsx(cr,{className:"size-7 text-foreground"})}),e[3]=j):j=e[3];let P;e[4]!==s?(P=s("mainPanelTabs.previewTab.noSourceToPreview"),e[4]=s,e[5]=P):P=e[5];let S;e[6]!==s?(S=s("mainPanelTabs.previewTab.connectGithubDescription"),e[6]=s,e[7]=S):S=e[7];let R,U;e[8]===Symbol.for("react.memo_cache_sentinel")?(R=()=>f(!0),U=r.jsx(cr,{className:"size-4"}),e[8]=R,e[9]=U):(R=e[8],U=e[9]);let T;e[10]!==s?(T=s("mainPanelTabs.previewTab.connectGithub"),e[10]=s,e[11]=T):T=e[11];let A;e[12]!==T?(A=r.jsxs($e,{onClick:R,children:[U,T]}),e[12]=T,e[13]=A):A=e[13];let D;e[14]!==P||e[15]!==S||e[16]!==A?(D=r.jsx(ll,{className:"h-full",image:j,title:P,description:S,actions:A}),e[14]=P,e[15]=S,e[16]=A,e[17]=D):D=e[17];let O;e[18]!==m?(O=r.jsx(cl,{open:m,onOpenChange:f,mode:"agent"}),e[18]=m,e[19]=O):O=e[19];let F;return e[20]!==O||e[21]!==D?(F=r.jsxs(r.Fragment,{children:[D,O]}),e[20]=O,e[21]=D,e[22]=F):F=e[22],F}if(l&&a&&!He(p)){let j;e[23]!==h||e[24]!==p?(j=Qd({backend:p,access:h}),e[23]=h,e[24]=p,e[25]=j):j=e[25];let P;e[26]!==l.endpoint?(P=yo(l.endpoint),e[26]=l.endpoint,e[27]=P):P=e[27];let S;return e[28]!==j||e[29]!==P?(S=r.jsx(Zd,{status:j,host:P}),e[28]=j,e[29]=P,e[30]=S):S=e[30],S}if(g&&v!==!0){let j;e[31]!==s?(j=s("mainPanelTabs.previewTab.localAppWaiting.title"),e[31]=s,e[32]=j):j=e[32];let P;e[33]!==g||e[34]!==s?(P=s("mainPanelTabs.previewTab.localAppWaiting.body",{host:Xd(g)}),e[33]=g,e[34]=s,e[35]=P):P=e[35];let S;e[36]!==P?(S=r.jsx(na,{text:P}),e[36]=P,e[37]=S):S=e[37];let R;e[38]!==s?(R=s("mainPanelTabs.previewTab.localAppWaiting.hint"),e[38]=s,e[39]=R):R=e[39];let U;e[40]!==R?(U=r.jsx("p",{role:"status",className:"text-center text-sm text-muted-foreground",children:R}),e[40]=R,e[41]=U):U=e[41];let T;return e[42]!==j||e[43]!==S||e[44]!==U?(T=r.jsx(un,{headingLevel:2,waiting:!0,title:j,lead:S,footer:U}),e[42]=j,e[43]=S,e[44]=U,e[45]=T):T=e[45],T}let b;e[46]!==n?(b=r.jsx(Od,{virtualMcpId:n}),e[46]=n,e[47]=b):b=e[47];const w=b;let N;return e[48]!==a||e[49]!==x||e[50]!==w||e[51]!==l?(N=r.jsx(Ni,{children:x&&a&&!l?r.jsx(Dd,{project:a,maxApps:nl,children:w}):w}),e[48]=a,e[49]=x,e[50]=w,e[51]=l,e[52]=N):N=e[52],N}function Xd(t){try{return new URL(t).host}catch{return t}}function Zd(t){const e=ue.c(13),{status:n,host:s}=t,a=Te();if(n.kind==="connected"){let o;e[0]!==a?(o=a("mainPanelTabs.previewTab.localhostNoPreview.title"),e[0]=a,e[1]=o):o=e[1];let i;e[2]!==a?(i=a("mainPanelTabs.previewTab.localhostNoPreview.body"),e[2]=a,e[3]=i):i=e[3];let c;return e[4]!==o||e[5]!==i?(c=r.jsx(un,{headingLevel:2,waiting:!1,title:o,lead:i}),e[4]=o,e[5]=i,e[6]=c):c=e[6],c}let l;e[7]!==s||e[8]!==n?(l=bl(n,s),e[7]=s,e[8]=n,e[9]=l):l=e[9];let u;return e[10]!==s||e[11]!==l?(u=r.jsx(xl,{wait:l,hosts:s}),e[10]=s,e[11]=l,e[12]=u):u=e[12],u}export{xl as L,Ju as P,un as S,Gu as u};