decocms 4.584.1 → 4.584.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 (428) hide show
  1. package/dist/client/assets/{AlertCircle-DQxZei1M.js → AlertCircle-DkHwL8J1.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BpPDw3S2.js → AreaChart-CqQJ_jHe.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-BXhTMhZ6.js → ArrowLeft-DUdD3O1h.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-BrCDap4m.js → ArrowRight-C-96aap_.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-DqYXEiS6.js → ArrowUp-M0Oty0ad.js} +1 -1
  6. package/dist/client/assets/{BookOpen01-BJOsJKWt.js → BookOpen01-CFfDgspV.js} +1 -1
  7. package/dist/client/assets/{CartesianChart-DovdkEKF.js → CartesianChart-CQVkEISE.js} +1 -1
  8. package/dist/client/assets/{CategoricalChart-g0ZOgFoY.js → CategoricalChart-BYqeYqCM.js} +1 -1
  9. package/dist/client/assets/{CheckCircle-BupieyS2.js → CheckCircle-BoW3-tYB.js} +1 -1
  10. package/dist/client/assets/{ChevronDown-rYBqLYZM.js → ChevronDown-Cgrp93vj.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-BRPtW72N.js → ChevronSelectorVertical-BQ5yoEQJ.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-DH1sZis7.js → ChevronUp-CY-2sTeM.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-jTESoJyl.js → CreditCard01-DQY5YZS3.js} +1 -1
  14. package/dist/client/assets/{Eye-CHPIJQjl.js → Eye-C0T4ax0j.js} +1 -1
  15. package/dist/client/assets/{File02-DTSJu4_M.js → File02-CqfeuTRH.js} +1 -1
  16. package/dist/client/assets/{Globe04-BBhKUFMP.js → Globe04-BxdmxA7w.js} +1 -1
  17. package/dist/client/assets/{Image01-DhuPGc9J.js → Image01-8Cd3kLQA.js} +1 -1
  18. package/dist/client/assets/{Key01-Cy6U3PPJ.js → Key01-Cn65SmhA.js} +1 -1
  19. package/dist/client/assets/{LayoutLeft-CQYXrSFJ.js → LayoutLeft-g2-0PX2O.js} +1 -1
  20. package/dist/client/assets/{LinkBroken01-C0qz4eZM.js → LinkBroken01-wvS8U8Go.js} +1 -1
  21. package/dist/client/assets/{Minimize01-B-w6jPRM.js → Minimize01-DHYXtZEK.js} +1 -1
  22. package/dist/client/assets/{Minus-CuVl5Nk4.js → Minus-B73boC9K.js} +1 -1
  23. package/dist/client/assets/{Monitor01-Du9j9yAH.js → Monitor01-DZG9Dy8l.js} +1 -1
  24. package/dist/client/assets/{Play-5POBzwun.js → Play-BWxPQkCn.js} +1 -1
  25. package/dist/client/assets/{Plus-BuHEMQHj.js → Plus-D0hw0S8O.js} +1 -1
  26. package/dist/client/assets/{ReferenceLine-CD2YCNYN.js → ReferenceLine-j-5fLGQ1.js} +1 -1
  27. package/dist/client/assets/{SearchMd-BvADjx7u.js → SearchMd-JJeVcqnt.js} +1 -1
  28. package/dist/client/assets/{ShoppingBag01-BX-lvdE7.js → ShoppingBag01-B7Xw3TZM.js} +1 -1
  29. package/dist/client/assets/{Sun-rTc-uCbQ.js → Sun-Jpz2VUT7.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-CSYGFkCN.js → SwitchHorizontal01-B2d4sXSY.js} +1 -1
  31. package/dist/client/assets/{Tool01-e3-ebizX.js → Tool01-D-8rHPmt.js} +1 -1
  32. package/dist/client/assets/{Tooltip-DZsuCEaj.js → Tooltip-C6uaV9hI.js} +1 -1
  33. package/dist/client/assets/{Trash01-C4Y4RaH9.js → Trash01-L3G-m7_u.js} +1 -1
  34. package/dist/client/assets/{TrendUp01-BTeMqD6U.js → TrendUp01-xQ_Lovhx.js} +1 -1
  35. package/dist/client/assets/{Upload01-BwW7JFsg.js → Upload01-BlCadmu3.js} +1 -1
  36. package/dist/client/assets/{UserCheck01-BaEElAkP.js → UserCheck01-D2EW_Elf.js} +1 -1
  37. package/dist/client/assets/{UserSquare-Dyyof09V.js → UserSquare-CMsUnOC-.js} +1 -1
  38. package/dist/client/assets/{Users01-BnstW7gr.js → Users01-DwGImjV5.js} +1 -1
  39. package/dist/client/assets/{XClose-CtKN8GLR.js → XClose-CWYJ8AbV.js} +1 -1
  40. package/dist/client/assets/{Zap-DsBnYwKs.js → Zap-C155p2bP.js} +1 -1
  41. package/dist/client/assets/{access-gate-BntOlgl7.js → access-gate-BNP8OtH0.js} +1 -1
  42. package/dist/client/assets/{add-connection-dialog-59sWEK5_.js → add-connection-dialog-Cwmrq3R3.js} +1 -1
  43. package/dist/client/assets/agent-app-BxJH02hF.js +1 -0
  44. package/dist/client/assets/{agent-assets-CSBU0hid.js → agent-assets-DjNdZo4_.js} +1 -1
  45. package/dist/client/assets/{agent-automation-CxWAwCKQ.js → agent-automation-Dcq6n7G3.js} +1 -1
  46. package/dist/client/assets/{agent-automations-BiFwrTja.js → agent-automations-DVZbbOTO.js} +1 -1
  47. package/dist/client/assets/{agent-blog-CvqVSDQe.js → agent-blog-LLXH24Uv.js} +2 -2
  48. package/dist/client/assets/{agent-blog-post-CNmT-Bw1.js → agent-blog-post-n6g0XZqO.js} +2 -2
  49. package/dist/client/assets/{agent-calendar-Df2E5iU7.js → agent-calendar-DCdRbBWp.js} +1 -1
  50. package/dist/client/assets/{agent-capabilities-DL0Et1pz.js → agent-capabilities-CnmIubfU.js} +1 -1
  51. package/dist/client/assets/{agent-connect-sources-DjO3ELqr.js → agent-connect-sources-CXJtCmcY.js} +1 -1
  52. package/dist/client/assets/agent-deck-CFxj1PRZ.js +1 -0
  53. package/dist/client/assets/{agent-e2e-DPsBEkPw.js → agent-e2e-CBmY7TQM.js} +1 -1
  54. package/dist/client/assets/agent-experiments-BMArc9T_.js +1 -0
  55. package/dist/client/assets/agent-file-l_gDVK5w.js +1 -0
  56. package/dist/client/assets/{agent-hosting-N1yvJFNT.js → agent-hosting-CXUwAtCi.js} +1 -1
  57. package/dist/client/assets/{agent-icon-DKmZvJgZ.js → agent-icon-lbRSQKRr.js} +1 -1
  58. package/dist/client/assets/agent-library-CzDyRFxC.js +1 -0
  59. package/dist/client/assets/agent-library-file-BFgS5tYK.js +1 -0
  60. package/dist/client/assets/agent-overview-CxfXbzjD.js +1 -0
  61. package/dist/client/assets/{agent-releases-CTHfLMQR.js → agent-releases-CCRvBzEc.js} +1 -1
  62. package/dist/client/assets/agent-settings-Bj6cb1Jx.js +1 -0
  63. package/dist/client/assets/agent-site-editor-code-C3R-NyjY.js +2 -0
  64. package/dist/client/assets/agent-site-editor-content-AQyserB2.js +1 -0
  65. package/dist/client/assets/agent-site-editor-preview-Bh42CzpT.js +1 -0
  66. package/dist/client/assets/{agent-site-editor-cTApO8_e.js → agent-site-editor-yd71XZG2.js} +1 -1
  67. package/dist/client/assets/agent-view-DBr8QkSV.js +1 -0
  68. package/dist/client/assets/{agent-view-guard-BhYsk1BZ.js → agent-view-guard-Bf6REgtC.js} +1 -1
  69. package/dist/client/assets/{ai-providers-Do3U2ueK.js → ai-providers-D_Uo1RgZ.js} +1 -1
  70. package/dist/client/assets/{alert-1FQypqKU.js → alert-PofKmjfr.js} +1 -1
  71. package/dist/client/assets/{analytics-sections-6shIIY_9.js → analytics-sections-BU55AVXg.js} +1 -1
  72. package/dist/client/assets/api-keys-C1h4ufxJ.js +1 -0
  73. package/dist/client/assets/{api-keys-CLle76fE.js → api-keys-v_05m9r5.js} +1 -1
  74. package/dist/client/assets/{app-editor-LFvS-D7P.js → app-editor-BYqt23l3.js} +1 -1
  75. package/dist/client/assets/{asset-utils-C17ggG12.js → asset-utils-X6F2xGVM.js} +1 -1
  76. package/dist/client/assets/{auth-DM_x_MzR.js → auth-DXP0BI6D.js} +1 -1
  77. package/dist/client/assets/{auth-catchall-BPafoRCP.js → auth-catchall-_wrDu745.js} +1 -1
  78. package/dist/client/assets/{auth-entry-DpZohCSe.js → auth-entry-Cqoib9bi.js} +1 -1
  79. package/dist/client/assets/{auth-split-layout-TV_ZF3vV.js → auth-split-layout-DV86NPs6.js} +1 -1
  80. package/dist/client/assets/{authenticate-and-persist-oauth-BB_emyV8.js → authenticate-and-persist-oauth-BwpowUw2.js} +1 -1
  81. package/dist/client/assets/{automation-list-row-CSZy0P8y.js → automation-list-row-C5ZCWUST.js} +1 -1
  82. package/dist/client/assets/{automation-runs-Dwd63wnZ.js → automation-runs-DVTf5GuI.js} +1 -1
  83. package/dist/client/assets/{automations-BneDlBwJ.js → automations-Bk7_NxA3.js} +1 -1
  84. package/dist/client/assets/{badge-C4UVwcna.js → badge-DrzcoZwC.js} +1 -1
  85. package/dist/client/assets/{block-document--vYZqLkK.js → block-document-B3KEauhh.js} +1 -1
  86. package/dist/client/assets/{blocks-preview-workspace-context-CICZXJZV.js → blocks-preview-workspace-context-CEfS8u2W.js} +1 -1
  87. package/dist/client/assets/{blocks-tab-states-Cd3JWT_-.js → blocks-tab-states-eAnMaZy5.js} +1 -1
  88. package/dist/client/assets/{blog-preview-url-Ba2xc55V.js → blog-preview-url-Cb_fruiT.js} +1 -1
  89. package/dist/client/assets/{blog-schema-B4mnHHT1.js → blog-schema-BsEJHIA-.js} +1 -1
  90. package/dist/client/assets/{blog-source-gate-CJ7ECLCv.js → blog-source-gate-BfuFZRkH.js} +1 -1
  91. package/dist/client/assets/{blog-view-gate-8-5UD9Vy.js → blog-view-gate-CSnZq3JQ.js} +1 -1
  92. package/dist/client/assets/{buckets-Cbg1Gz3J.js → buckets-CK4KzNcr.js} +1 -1
  93. package/dist/client/assets/{build-improve-prompt-doc-C11pf2M8.js → build-improve-prompt-doc-DWAA6feU.js} +1 -1
  94. package/dist/client/assets/{calendar-CJeS1cU0.js → calendar-BuJZ_OpN.js} +1 -1
  95. package/dist/client/assets/{capability-load-error-DJnu-VAt.js → capability-load-error-CaAhbUrk.js} +1 -1
  96. package/dist/client/assets/{category-editor-DYKgEga_.js → category-editor-D6LhDDkP.js} +1 -1
  97. package/dist/client/assets/{category-tree-DMad1kgd.js → category-tree-DnC5Xza2.js} +1 -1
  98. package/dist/client/assets/{chart-DFW5rTOU.js → chart-D_ubEwrG.js} +1 -1
  99. package/dist/client/assets/{chat-context-BNZ_9-8I.js → chat-context-BZCgTb_I.js} +1 -1
  100. package/dist/client/assets/{chat-draft-D-mbDU5V.js → chat-draft-CJFLb9Mj.js} +1 -1
  101. package/dist/client/assets/{checkbox-BhkoX8Ty.js → checkbox-Cd8xyzDb.js} +1 -1
  102. package/dist/client/assets/{choose-editor-PSR-AhBm.js → choose-editor-FunavWxL.js} +1 -1
  103. package/dist/client/assets/{cli-auth-success-iqwwPoIK.js → cli-auth-success-wg0sDdwR.js} +1 -1
  104. package/dist/client/assets/{cms-settings-editor-CODxJGge.js → cms-settings-editor-ftnCzt6n.js} +1 -1
  105. package/dist/client/assets/{cms-store-drafts-DbB0rL_p.js → cms-store-drafts-BMv0dQxC.js} +1 -1
  106. package/dist/client/assets/{collapsible-2JPp4iG8.js → collapsible-BZgS4z1I.js} +1 -1
  107. package/dist/client/assets/{collection-detail-DDg39GUv.js → collection-detail-DBgOOn_S.js} +1 -1
  108. package/dist/client/assets/{collection-display-button-a-kxAH9S.js → collection-display-button-D7jl1-Xf.js} +1 -1
  109. package/dist/client/assets/{collection-search-BKN9EjWI.js → collection-search-B817v3tJ.js} +1 -1
  110. package/dist/client/assets/{collection-table-wrapper-BTsJY-2Y.js → collection-table-wrapper-DsuqOatw.js} +1 -1
  111. package/dist/client/assets/{collection-tabs-BByE0AF2.js → collection-tabs-DdHkmkp2.js} +1 -1
  112. package/dist/client/assets/{combobox-D-AE0za3.js → combobox-CJZiIB2Z.js} +1 -1
  113. package/dist/client/assets/{command-1rGUkJU6.js → command-CYNVyZbO.js} +1 -1
  114. package/dist/client/assets/{companion-mcps-section-C0SBN__q.js → companion-mcps-section-Bt6WfeHQ.js} +1 -1
  115. package/dist/client/assets/{config-ySNx5jY7.js → config-C8wUMmyi.js} +1 -1
  116. package/dist/client/assets/{connect-dcudJGkR.js → connect-BAVqbq1G.js} +1 -1
  117. package/dist/client/assets/{connect-key-BdMAsXh0.js → connect-key-CIVlEro2.js} +1 -1
  118. package/dist/client/assets/{connect-layout-DzBvWaNS.js → connect-layout-auJRtfdC.js} +1 -1
  119. package/dist/client/assets/{connect-source-dialog-BxAaaWS9.js → connect-source-dialog-KSJGh1Sl.js} +1 -1
  120. package/dist/client/assets/{connection-B1w9XeEb.js → connection-DKL8hGZk.js} +1 -1
  121. package/dist/client/assets/{connection-card-ozwXxBsz.js → connection-card-CgkIR0Yz.js} +1 -1
  122. package/dist/client/assets/{connection-detail-C4zRa_cO.js → connection-detail-BeGUIlFK.js} +1 -1
  123. package/dist/client/assets/{connection-form-helpers-B6__xS0A.js → connection-form-helpers-DglXKsDe.js} +1 -1
  124. package/dist/client/assets/{connection-slug-C95YanvL.js → connection-slug-DgbcRUso.js} +1 -1
  125. package/dist/client/assets/{connections-NomfYn_t.js → connections-BM3Vx6MT.js} +1 -1
  126. package/dist/client/assets/{content-tab-BvcDl2gQ.js → content-tab-BFFdA5v6.js} +3 -3
  127. package/dist/client/assets/{context-Cvc8fgay.js → context-DBfBTDUj.js} +1 -1
  128. package/dist/client/assets/{context-menu-DBCh223t.js → context-menu-r8q6W3Vd.js} +1 -1
  129. package/dist/client/assets/{context-shell-CAxUAqQN.js → context-shell-C5Sv2Vfh.js} +3 -3
  130. package/dist/client/assets/{create-organization-dialog-WzOR16k9.js → create-organization-dialog-DeDVxi2S.js} +1 -1
  131. package/dist/client/assets/{daily-pulse-9WDMhYxD.js → daily-pulse-Bnk3FMPf.js} +1 -1
  132. package/dist/client/assets/{delete-copy-B4_SCbWy.js → delete-copy-BG2c9FAH.js} +1 -1
  133. package/dist/client/assets/{device-hint-B8guedWJ.js → device-hint-FTmZTvjb.js} +1 -1
  134. package/dist/client/assets/{discover-CBb9-mOO.js → discover-BjFcb1Nd.js} +1 -1
  135. package/dist/client/assets/{domain-settings-8msdYCkg.js → domain-settings-gzHiimD8.js} +1 -1
  136. package/dist/client/assets/{drawer-CN3NEJqY.js → drawer-DEXSNHC1.js} +1 -1
  137. package/dist/client/assets/{editor-BIhlI60e.js → editor-C42px5GX.js} +1 -1
  138. package/dist/client/assets/{editor-classes-CPgVKg5X.js → editor-classes-CH0-XTN2.js} +1 -1
  139. package/dist/client/assets/{empty-message-CTz0j9ie.js → empty-message-DR5P4mUA.js} +1 -1
  140. package/dist/client/assets/{empty-state-3xiekdCM.js → empty-state-DWlXCulm.js} +1 -1
  141. package/dist/client/assets/{empty-state-myFrB_Ip.js → empty-state-QEbc1xkD.js} +1 -1
  142. package/dist/client/assets/{experiments-tab-choice-2CS-Zgr0.js → experiments-tab-choice-CDYr4cN0.js} +1 -1
  143. package/dist/client/assets/{extract-connection-data-BPRLQOFh.js → extract-connection-data-Dn38BGyb.js} +1 -1
  144. package/dist/client/assets/{feature-gate-BuF8FtOJ.js → feature-gate-B3RdVNU6.js} +1 -1
  145. package/dist/client/assets/{feature-paywall-DYmmeBz6.js → feature-paywall-C6kx3CwL.js} +1 -1
  146. package/dist/client/assets/{file-explorer-o1fJE87z.js → file-explorer-BVdrWVar.js} +1 -1
  147. package/dist/client/assets/{file-preview-BxRBK5s6.js → file-preview-C9hbZ2X-.js} +1 -1
  148. package/dist/client/assets/{file-share-button-C8YeuQFC.js → file-share-button-BAAEwJkT.js} +1 -1
  149. package/dist/client/assets/{file-type-icon-DO8X7oBj.js → file-type-icon-DuPf-PNe.js} +1 -1
  150. package/dist/client/assets/{folder-icon-BER7BhBb.js → folder-icon-5ZBzBjm2.js} +1 -1
  151. package/dist/client/assets/{form-CdBjJq5W.js → form-14ZcPjXe.js} +1 -1
  152. package/dist/client/assets/{frame-navigation-D3UfnhDI.js → frame-navigation-D_WZF0Hs.js} +1 -1
  153. package/dist/client/assets/{gateway-client-CqrPq2Zk.js → gateway-client-DdE8Hgae.js} +1 -1
  154. package/dist/client/assets/{general-DubsWx1F.js → general-B5q5w2vv.js} +1 -1
  155. package/dist/client/assets/{github-icon-BzIHSx26.js → github-icon-CyiD2Iik.js} +1 -1
  156. package/dist/client/assets/{held-block-view-CyRccyrh.js → held-block-view-BdCI62ev.js} +1 -1
  157. package/dist/client/assets/{home-kU7uY0wN.js → home-BxH-WIVf.js} +1 -1
  158. package/dist/client/assets/{home-overview-CVeVpH2f.js → home-overview-eWJ4ScQm.js} +1 -1
  159. package/dist/client/assets/{hosted-reconcile-CfjfxtVx.js → hosted-reconcile-G96-wVBG.js} +1 -1
  160. package/dist/client/assets/{icon-button-ue-T-dgY.js → icon-button-BcSeIlmN.js} +1 -1
  161. package/dist/client/assets/{index-DLuam-oO.js → index-7zGhlT8r.js} +3 -3
  162. package/dist/client/assets/{index-DFWNckdo.js → index-B--5J1r2.js} +1 -1
  163. package/dist/client/assets/{index-DBvbzGen.js → index-B7KfGe6i.js} +1 -1
  164. package/dist/client/assets/{index-MxDefvFp.js → index-B9KgggsM.js} +1 -1
  165. package/dist/client/assets/{index-CJfrwB-R.js → index-BWsIL1KW.js} +1 -1
  166. package/dist/client/assets/{index-CV1w3jjI.js → index-BkSYM2mK.js} +1 -1
  167. package/dist/client/assets/{index-CKb3YsIm.js → index-C8R3c8YZ.js} +1 -1
  168. package/dist/client/assets/{index-DVG3DDnP.js → index-CEjnpfFV.js} +1 -1
  169. package/dist/client/assets/{index-DuLSpVbY.js → index-CM55ixAR.js} +1 -1
  170. package/dist/client/assets/{index-CTrggIhe.js → index-CZAKlZBr.js} +1 -1
  171. package/dist/client/assets/{index-DK0mPK-c.js → index-Cg0U1XrX.js} +1 -1
  172. package/dist/client/assets/{index-DSnXPPOf.js → index-CsRgsybh.js} +1 -1
  173. package/dist/client/assets/{index-BAOf8r3P.js → index-D7wefbkZ.js} +1 -1
  174. package/dist/client/assets/{index-BpLMoHof.js → index-DO569FOD.js} +1 -1
  175. package/dist/client/assets/{index-DKfNWn49.js → index-Dpa0nN_7.js} +1 -1
  176. package/dist/client/assets/{index-BqtN0tVI.js → index-Ffi6YsHl.js} +1 -1
  177. package/dist/client/assets/{index-redirect-DjZ-Sa8w.js → index-redirect-SWoSlMJB.js} +1 -1
  178. package/dist/client/assets/{index-D0nLrq64.js → index-y_pWAPzu.js} +1 -1
  179. package/dist/client/assets/{infiniteQueryObserver-DmwMo8IW.js → infiniteQueryObserver-CEKfthGG.js} +1 -1
  180. package/dist/client/assets/{infra-billing-tL7M-OYS.js → infra-billing-CpYIBFZs.js} +1 -1
  181. package/dist/client/assets/{input-CleFKoms.js → input-DqVQ7h1O.js} +1 -1
  182. package/dist/client/assets/{input-BmLmPqN8.js → input-Dqol4hii.js} +3 -3
  183. package/dist/client/assets/{integration-icon-DNMl6-J4.js → integration-icon-DFIVBhS2.js} +1 -1
  184. package/dist/client/assets/{item-actions-Dx1AQzgR.js → item-actions-Cp7fOSBk.js} +1 -1
  185. package/dist/client/assets/{jira-icon-Daus-Qh_.js → jira-icon-C-_-8N-R.js} +1 -1
  186. package/dist/client/assets/{label-B40B-mb1.js → label-6adXwSZa.js} +1 -1
  187. package/dist/client/assets/{layout-BdcpXWG7.js → layout-CHn337bp.js} +1 -1
  188. package/dist/client/assets/{legacy-admin-welcome-dialog-Dty139TN.js → legacy-admin-welcome-dialog-B_q7kUN3.js} +1 -1
  189. package/dist/client/assets/{legacy-agents-deep-Dzc7RIdK.js → legacy-agents-deep-D67b0iWR.js} +1 -1
  190. package/dist/client/assets/{legacy-main-redirect-0mpfN8mn.js → legacy-main-redirect-DDTJLl9s.js} +1 -1
  191. package/dist/client/assets/library-pWEfrpRp.js +1 -0
  192. package/dist/client/assets/{library-tab-BQGS1hg4.js → library-tab-BcgSCSjV.js} +1 -1
  193. package/dist/client/assets/{login-fewT-eGQ.js → login-DBTnYQPw.js} +1 -1
  194. package/dist/client/assets/{markdown-DIZTLySz.js → markdown-CTL4sdx2.js} +1 -1
  195. package/dist/client/assets/{mcp-app-renderer-BxY6mRCw.js → mcp-app-renderer-C6Co8dzn.js} +1 -1
  196. package/dist/client/assets/{mcp-oauth-DPpUVCIn.js → mcp-oauth-B53WQBO5.js} +1 -1
  197. package/dist/client/assets/{mcp-oauth-CYwT_ghl.js → mcp-oauth-B_3SxbLi.js} +1 -1
  198. package/dist/client/assets/{members-B50nL28U.js → members-D7AvGTKs.js} +1 -1
  199. package/dist/client/assets/{memory-DFivCTx1.js → memory-BRgCdcRl.js} +1 -1
  200. package/dist/client/assets/{mock-board-DSINFAen.js → mock-board-CDET5jsd.js} +3 -3
  201. package/dist/client/assets/{monaco-editor-UA1YjU4h.js → monaco-editor-B2XLiorm.js} +1 -1
  202. package/dist/client/assets/{monitoring-BK7wCv-P.js → monitoring-A51RIdP9.js} +2 -2
  203. package/dist/client/assets/{monitoring-stats-row-Brhc7V-D.js → monitoring-stats-row-14JdR3ss.js} +1 -1
  204. package/dist/client/assets/{multi-select-BIcoAJyN.js → multi-select-gxfwFoFX.js} +1 -1
  205. package/dist/client/assets/{mustache-CiKDfLgV.js → mustache-D95ItWPR.js} +1 -1
  206. package/dist/client/assets/{named-rule-step-5FH6L5dL.js → named-rule-step-DCPjI8tu.js} +1 -1
  207. package/dist/client/assets/{named-rule-view-DngGXZwe.js → named-rule-view-OvRHWdFm.js} +1 -1
  208. package/dist/client/assets/{new-project-dialog-CJFHxf5_.js → new-project-dialog-Cf-zLQZ_.js} +1 -1
  209. package/dist/client/assets/{new-project-store-BXbDjmer.js → new-project-store-bT4UmoJb.js} +1 -1
  210. package/dist/client/assets/{oauth-callback-jqZo425q.js → oauth-callback-UBNLncxp.js} +1 -1
  211. package/dist/client/assets/{oauth-callback-ai-provider-U5G79VLu.js → oauth-callback-ai-provider-Doja709C.js} +1 -1
  212. package/dist/client/assets/{oauth-consent-39y0iaMU.js → oauth-consent-BSYJT7RI.js} +1 -1
  213. package/dist/client/assets/{onboarding-DWLBD5ut.js → onboarding-Bylk5E9x.js} +1 -1
  214. package/dist/client/assets/{openai-conversation-DpZUzyhJ.js → openai-conversation-DGzSKPwh.js} +1 -1
  215. package/dist/client/assets/{optimistic-project-sidebar-views-CTVuJVPD.js → optimistic-project-sidebar-views-CstvPoAW.js} +1 -1
  216. package/dist/client/assets/{order-monitor-day-dpkjc8ij.js → order-monitor-day-DLxiI7BZ.js} +1 -1
  217. package/dist/client/assets/{organization-choice-D5AXEApQ.js → organization-choice-EOwWGeA5.js} +1 -1
  218. package/dist/client/assets/{orgs-loxqaAZ4.js → orgs-gbmKxRt6.js} +1 -1
  219. package/dist/client/assets/{own-accounts-section-BheLkLhk.js → own-accounts-section-DZFYn2_4.js} +1 -1
  220. package/dist/client/assets/{pair-Cd9OPgUF.js → pair-Dj9jprhR.js} +1 -1
  221. package/dist/client/assets/{parse-sections-Ddd3WX1b.js → parse-sections-C3LoVE7G.js} +2 -2
  222. package/dist/client/assets/{plan-057NyNVI.js → plan-IHm2Xano.js} +1 -1
  223. package/dist/client/assets/{plan-ladder-Dtd21Pl6.js → plan-ladder-8e0e7xt0.js} +1 -1
  224. package/dist/client/assets/{plan-usage-card-jrtY0QJl.js → plan-usage-card-FehD9CYa.js} +1 -1
  225. package/dist/client/assets/{popover-DWDvG2sJ.js → popover-Cn8F-2id.js} +1 -1
  226. package/dist/client/assets/{post-calendar-Bu09DnPi.js → post-calendar-l3sKcyyr.js} +1 -1
  227. package/dist/client/assets/{post-editor-BDNaaN9x.js → post-editor-UFLVvSpG.js} +1 -1
  228. package/dist/client/assets/{preview-content-CtnZUPEs.js → preview-content-mIztqkm_.js} +1 -1
  229. package/dist/client/assets/{preview-dialog-DdxdDV82.js → preview-dialog-Dmbc5qqb.js} +1 -1
  230. package/dist/client/assets/{preview-panel-ixPYwT5r.js → preview-panel-BAoMc-SU.js} +1 -1
  231. package/dist/client/assets/{preview-tab-Cm_klhH-.js → preview-tab-Cw-sa1Lc.js} +3 -3
  232. package/dist/client/assets/{product-picker-dialog-BAGp-pzM.js → product-picker-dialog-CWtZ08kV.js} +1 -1
  233. package/dist/client/assets/{profile-BPxHpR5D.js → profile-C5WzRSSb.js} +1 -1
  234. package/dist/client/assets/{project-app-view-CdRO1n9x.js → project-app-view-D1zpDl5r.js} +1 -1
  235. package/dist/client/assets/{project-apps-DjfXES5v.js → project-apps-AoKulVqs.js} +1 -1
  236. package/dist/client/assets/{project-icon-CySwwEU9.js → project-icon-DXEYPK6k.js} +1 -1
  237. package/dist/client/assets/{project-index-1ZydFeWl.js → project-index-Dth0KuML.js} +1 -1
  238. package/dist/client/assets/project-reports-v9_oHSWV.js +1 -0
  239. package/dist/client/assets/project-tasks-1jDLeAkv.js +1 -0
  240. package/dist/client/assets/{projects-He1mlmS7.js → projects-B2kmIr27.js} +1 -1
  241. package/dist/client/assets/{projects-empty-state-ADXUwUj7.js → projects-empty-state-DUiQECfr.js} +1 -1
  242. package/dist/client/assets/{prompts-DK1e5czf.js → prompts-BXrutyeC.js} +1 -1
  243. package/dist/client/assets/record-editor-SD1slkhf.js +1 -0
  244. package/dist/client/assets/{redirect-editor-IDqQ8xFk.js → redirect-editor-qF81S-3t.js} +1 -1
  245. package/dist/client/assets/{reports-lYJ13Oyh.js → reports-C2tqIi3r.js} +1 -1
  246. package/dist/client/assets/reports-CJBF-Cx9.js +1 -0
  247. package/dist/client/assets/{reports-onboarding-DaousQwr.js → reports-onboarding-CemSxMxL.js} +1 -1
  248. package/dist/client/assets/{reports-tab-by1j2nl6.js → reports-tab-CnjX4JEm.js} +2 -2
  249. package/dist/client/assets/repositories-C2V_QKg8.js +1 -0
  250. package/dist/client/assets/{repositories-BrfAbLdn.js → repositories-CivRTT2C.js} +1 -1
  251. package/dist/client/assets/{repository-binding-BnP0NJWu.js → repository-binding-djJO-C6X.js} +1 -1
  252. package/dist/client/assets/{repository-picker-vBJtxDaP.js → repository-picker-BsD4BAF1.js} +1 -1
  253. package/dist/client/assets/{require-capability-Cr8WvkbM.js → require-capability-BVAL35yg.js} +1 -1
  254. package/dist/client/assets/{required-auth-layout-DEnKlG9k.js → required-auth-layout-B9DPc7yf.js} +1 -1
  255. package/dist/client/assets/{reset-password-G1XaV8Dd.js → reset-password-8RJoIK4l.js} +1 -1
  256. package/dist/client/assets/{resizable-D8QP7rfi.js → resizable-CB2m-mU0.js} +1 -1
  257. package/dist/client/assets/{resolve-tab-icon-DcSz8B7S.js → resolve-tab-icon-DVzuN81G.js} +1 -1
  258. package/dist/client/assets/{review-settings-CgzfxoaC.js → review-settings-B1Qs05Wf.js} +1 -1
  259. package/dist/client/assets/{role-color-C69WmCOL.js → role-color-BAVNr0ON.js} +1 -1
  260. package/dist/client/assets/{roles-BGI2Y25_.js → roles-BNJbGE6C.js} +1 -1
  261. package/dist/client/assets/{route-BjSwEarg.js → route-BJ2Mac_y.js} +1 -1
  262. package/dist/client/assets/route-ECZ9GGKn.js +1 -0
  263. package/dist/client/assets/{route-B4TcTxp_.js → route-a-CZUgop.js} +1 -1
  264. package/dist/client/assets/{route-page-header-D5mciaLz.js → route-page-header-H5YK34EZ.js} +1 -1
  265. package/dist/client/assets/{sandbox-git-api-BsZqakhs.js → sandbox-git-api-BvrXQqNA.js} +1 -1
  266. package/dist/client/assets/{sandbox-lifecycle-context-CabivZ0G.js → sandbox-lifecycle-context-DVuPgDFg.js} +1 -1
  267. package/dist/client/assets/{save-status-Bt5jCay9.js → save-status-DAxhQuZS.js} +1 -1
  268. package/dist/client/assets/{schema-3tzQDCWP.js → schema-BLHIxDld.js} +1 -1
  269. package/dist/client/assets/{schema-BM6o7q66.js → schema-hiyr_sLU.js} +1 -1
  270. package/dist/client/assets/{scroll-area-CltAMX3V.js → scroll-area-DbM-AL9l.js} +1 -1
  271. package/dist/client/assets/{search-input-CyDCJavO.js → search-input-6mfg7ug5.js} +1 -1
  272. package/dist/client/assets/{search-toggle-uNgvu336.js → search-toggle-DJr8IQ4N.js} +1 -1
  273. package/dist/client/assets/{secret-picker-C8eTSOuG.js → secret-picker-TJh1jmxx.js} +1 -1
  274. package/dist/client/assets/{secrets-Bj8129eI.js → secrets-BaauDIpm.js} +1 -1
  275. package/dist/client/assets/{section-array-field-CbwaMhTt.js → section-array-field-CkVoRheS.js} +1 -1
  276. package/dist/client/assets/{sections-BW9uhCQa.js → sections-BXQUxCNo.js} +1 -1
  277. package/dist/client/assets/{sections-editor-DMAnP9ts.js → sections-editor-BABMOqMu.js} +1 -1
  278. package/dist/client/assets/{select-IOXOk3Ja.js → select-B8N58NFv.js} +1 -1
  279. package/dist/client/assets/{select-model-DSJLMb4j.js → select-model-Dhr_ZL06.js} +1 -1
  280. package/dist/client/assets/{seo-editor-CBuQjDAN.js → seo-editor-BqLHV65p.js} +1 -1
  281. package/dist/client/assets/{separator-CKPY3Jny.js → separator-CfUu5XHI.js} +1 -1
  282. package/dist/client/assets/{session-runtime-AXnCtlIf.js → session-runtime-C1YpKp6Z.js} +1 -1
  283. package/dist/client/assets/settings-tab-DCpadV5R.js +1 -0
  284. package/dist/client/assets/{sheet-C7jRkpDc.js → sheet-BiTxH0Dd.js} +1 -1
  285. package/dist/client/assets/{shell-layout-MV3x6XdO.js → shell-layout-Duq0Xa8U.js} +1 -1
  286. package/dist/client/assets/{site-draft-actions-Cs2K4nbV.js → site-draft-actions-Dt1nmoC7.js} +1 -1
  287. package/dist/client/assets/{site-draft-view-BORE1dgv.js → site-draft-view-D_fSWwLE.js} +1 -1
  288. package/dist/client/assets/site-editor-DIWbyMzv.js +1 -0
  289. package/dist/client/assets/{site-editor-toast-Btsx5baB.js → site-editor-toast-DgVI2k0O.js} +1 -1
  290. package/dist/client/assets/{skills-Gl5GY5F7.js → skills-Cy2k48AC.js} +1 -1
  291. package/dist/client/assets/{slider-Z3uc-J_e.js → slider-BISXtABo.js} +1 -1
  292. package/dist/client/assets/{sortable.esm-BsRtZMdI.js → sortable.esm-DdNzXeUL.js} +1 -1
  293. package/dist/client/assets/{sso-CBda3voX.js → sso-DGW3qNdu.js} +1 -1
  294. package/dist/client/assets/{suggestion-DOa2is9l.js → suggestion-CG3s6_aY.js} +1 -1
  295. package/dist/client/assets/{super-agent-icon-BQSqMktN.js → super-agent-icon-16dgZUQ6.js} +1 -1
  296. package/dist/client/assets/{switch-DSmB9qdd.js → switch-BzXoCpZ5.js} +1 -1
  297. package/dist/client/assets/{synced-repos-uAwFax5M.js → synced-repos-65XJJcE_.js} +1 -1
  298. package/dist/client/assets/{tab-icon-glyph-DrbVFRqR.js → tab-icon-glyph-CUaZezyN.js} +1 -1
  299. package/dist/client/assets/{table-CulA5cEm.js → table-D3uwpvCo.js} +1 -1
  300. package/dist/client/assets/{tabs-Bl2CDwVl.js → tabs-cyjxgUUN.js} +1 -1
  301. package/dist/client/assets/{task-board-BgNefmZ8.js → task-board-DzRumLNt.js} +1 -1
  302. package/dist/client/assets/{task-key-BTXsrkSp.js → task-key-Bxtvsh0V.js} +1 -1
  303. package/dist/client/assets/{task-route-DF_PNMho.js → task-route-BhRoqmHY.js} +1 -1
  304. package/dist/client/assets/{task-status-B0c9osDw.js → task-status-BbljIvbf.js} +1 -1
  305. package/dist/client/assets/{taskboard-analytics-BxKSmses.js → taskboard-analytics-BUO3f4M0.js} +1 -1
  306. package/dist/client/assets/{tasks-f3FLHitr.js → tasks-DupamzYt.js} +1 -1
  307. package/dist/client/assets/tasks-g9n99WNk.js +1 -0
  308. package/dist/client/assets/{textarea-C4626nq7.js → textarea-BG9F8tOD.js} +1 -1
  309. package/dist/client/assets/{thread-analytics-BKF7OuH8.js → thread-analytics-CilZLnJD.js} +1 -1
  310. package/dist/client/assets/{thread-button-B9KUEqWE.js → thread-button-BCIujk1d.js} +1 -1
  311. package/dist/client/assets/{thread-intent-CMXI4-Qn.js → thread-intent-Bb4U5yQQ.js} +1 -1
  312. package/dist/client/assets/{thread-route-CJ7vAn39.js → thread-route-C55w1baF.js} +1 -1
  313. package/dist/client/assets/{thread-route-BF3m0AEN.js → thread-route-JxTLM2rp.js} +1 -1
  314. package/dist/client/assets/{thread-sheet-body-BH7bDMNO.js → thread-sheet-body-C-_jljH_.js} +1 -1
  315. package/dist/client/assets/{time-range-picker-TDPR9tPD.js → time-range-picker-CFXafk3N.js} +1 -1
  316. package/dist/client/assets/{toggle-group-PrSAkfEN.js → toggle-group-YpdNMPPd.js} +1 -1
  317. package/dist/client/assets/{tool-set-selector-UU50iLeq.js → tool-set-selector-VdmqTpl9.js} +1 -1
  318. package/dist/client/assets/{toolbar-icon-button-D16G27u4.js → toolbar-icon-button-CzSz4v_E.js} +1 -1
  319. package/dist/client/assets/{tooltip-CDlpUz6Q.js → tooltip-BfPZsPnN.js} +1 -1
  320. package/dist/client/assets/{tooltipContext-jGLnEmc0.js → tooltipContext-B2N57NJF.js} +1 -1
  321. package/dist/client/assets/{track-C9ncInZ1.js → track-DZKSO5QB.js} +1 -1
  322. package/dist/client/assets/{types-NGYefc4q.js → types-WxQSc-9D.js} +1 -1
  323. package/dist/client/assets/{url-slug-D4QdPt75.js → url-slug-38rmcKZy.js} +1 -1
  324. package/dist/client/assets/{usage-stats-BoGlEdlD.js → usage-stats-NRcbm3e5.js} +1 -1
  325. package/dist/client/assets/{use-ai-providers-BR6hIwAY.js → use-ai-providers-wkmM0nDR.js} +1 -1
  326. package/dist/client/assets/{use-api-keys-BswXTYVi.js → use-api-keys-CZ1rjtWp.js} +1 -1
  327. package/dist/client/assets/{use-apply-named-rule-Bs9HuiLY.js → use-apply-named-rule-DGa6vp8G.js} +1 -1
  328. package/dist/client/assets/use-ask-in-chat-BujQyStK.js +1 -0
  329. package/dist/client/assets/{use-automations-kWiY5yEx.js → use-automations-BJeGx_lB.js} +1 -1
  330. package/dist/client/assets/{use-autosave-DWxLArrt.js → use-autosave-C_PE2ads.js} +1 -1
  331. package/dist/client/assets/use-blocks-v8-project-CGr__fvY.js +1 -0
  332. package/dist/client/assets/use-blog-view-Du5CuuHc.js +1 -0
  333. package/dist/client/assets/{use-chat-layout-state-Rd9RKrqE.js → use-chat-layout-state-Cq5Tmm_K.js} +1 -1
  334. package/dist/client/assets/{use-cms-publish-actions-BURhmTo2.js → use-cms-publish-actions-Db9gbmph.js} +1 -1
  335. package/dist/client/assets/{use-connect-companion-C7oXoVon.js → use-connect-companion-C8pnTEHb.js} +1 -1
  336. package/dist/client/assets/{use-connection-stybxl69.js → use-connection-BkSWGbNf.js} +1 -1
  337. package/dist/client/assets/{use-content-sync-DOJ-d6ui.js → use-content-sync-CzsTDfef.js} +1 -1
  338. package/dist/client/assets/{use-copy-DyvoSaWK.js → use-copy-D029JLSS.js} +1 -1
  339. package/dist/client/assets/{use-current-view-DYsOXIAq.js → use-current-view-BfodK9gG.js} +1 -1
  340. package/dist/client/assets/{use-date-fns-locale-Lfy9W6k7.js → use-date-fns-locale-DycfSwk3.js} +1 -1
  341. package/dist/client/assets/{use-debounced-autosave-D-vOeZW7.js → use-debounced-autosave-Dy8jra8N.js} +1 -1
  342. package/dist/client/assets/{use-debounced-value-nMm2S7EZ.js → use-debounced-value-DZc1zf0Z.js} +1 -1
  343. package/dist/client/assets/{use-deco-credits-DBi73j00.js → use-deco-credits-ChK5XwL3.js} +1 -1
  344. package/dist/client/assets/{use-decopilot-events-Eq5Di3tt.js → use-decopilot-events-Co2HuPK6.js} +1 -1
  345. package/dist/client/assets/{use-delete-block-CQsMvlR4.js → use-delete-block-DjHkDeDL.js} +1 -1
  346. package/dist/client/assets/{use-delete-connection-DX3VcYoy.js → use-delete-connection-C2zKLW69.js} +1 -1
  347. package/dist/client/assets/{use-deployment-admin-B8eJaq0l.js → use-deployment-admin-DiCadhp3.js} +1 -1
  348. package/dist/client/assets/{use-entitlements-q1JiSGnY.js → use-entitlements-D64xTxJC.js} +1 -1
  349. package/dist/client/assets/{use-fast-preview-draft-url-CZJSDWBz.js → use-fast-preview-draft-url-BCCy37Z0.js} +1 -1
  350. package/dist/client/assets/{use-file-configs-BwDtz-SL.js → use-file-configs-MD9huX3e.js} +1 -1
  351. package/dist/client/assets/{use-id-selection-B5uuKs_6.js → use-id-selection-BInUXf7W.js} +1 -1
  352. package/dist/client/assets/{use-in-settings-B7PmXEGx.js → use-in-settings-BXZ1flBO.js} +1 -1
  353. package/dist/client/assets/{use-inbox-feed-DAFI3RXk.js → use-inbox-feed-BgghU6zv.js} +1 -1
  354. package/dist/client/assets/{use-infinite-scroll-DIo4dLVO.js → use-infinite-scroll-a-was_wV.js} +1 -1
  355. package/dist/client/assets/{use-join-requests-Cije4ISI.js → use-join-requests-Dew340iZ.js} +1 -1
  356. package/dist/client/assets/{use-main-panel-tabs-QBCK4CGm.js → use-main-panel-tabs-CofVomMF.js} +1 -1
  357. package/dist/client/assets/{use-mcp-auth-status-Ht1UiyQD.js → use-mcp-auth-status-sM1WMIXj.js} +1 -1
  358. package/dist/client/assets/{use-mcp-client-oQNpcxdA.js → use-mcp-client-CnD6rmUP.js} +1 -1
  359. package/dist/client/assets/{use-mcp-prompts-DJDMRBKo.js → use-mcp-prompts-CJDEOIrf.js} +1 -1
  360. package/dist/client/assets/{use-mcp-tools-B3lfSeU8.js → use-mcp-tools-hcCDzOu2.js} +1 -1
  361. package/dist/client/assets/{use-mobile-B6Glooki.js → use-mobile-2AsEzLf2.js} +1 -1
  362. package/dist/client/assets/{use-move-blocks-DgoYqSh3.js → use-move-blocks-D1ddI4qu.js} +1 -1
  363. package/dist/client/assets/{use-navigate-to-agent-DHcX_wvC.js → use-navigate-to-agent-qbUEQ7kJ.js} +1 -1
  364. package/dist/client/assets/{use-never-published-DIs5T7vx.js → use-never-published-CJ050mxC.js} +1 -1
  365. package/dist/client/assets/{use-org-fs-D6go1e07.js → use-org-fs-DEtGZ0OX.js} +1 -1
  366. package/dist/client/assets/{use-org-notice-MJYmvNw3.js → use-org-notice-M_I53CvQ.js} +1 -1
  367. package/dist/client/assets/{use-org-repo-syncs-CTYF72h2.js → use-org-repo-syncs-XoO3xbdG.js} +1 -1
  368. package/dist/client/assets/{use-org-sso-DQr7OjOZ.js → use-org-sso-D7bMsLHv.js} +1 -1
  369. package/dist/client/assets/{use-organization-settings-1p7-uoSE.js → use-organization-settings-DEI-2Mdu.js} +1 -1
  370. package/dist/client/assets/{use-panel-navigate-CX_YerR_.js → use-panel-navigate-Cgc8QZvG.js} +1 -1
  371. package/dist/client/assets/{use-project-native-view-presence-C1CJqaSZ.js → use-project-native-view-presence-D9-wJ1O7.js} +1 -1
  372. package/dist/client/assets/{use-project-scope-CUICChkO.js → use-project-scope-5o2m3916.js} +1 -1
  373. package/dist/client/assets/{use-recent-apps-jf9rGSSR.js → use-recent-apps-BvDORfSg.js} +1 -1
  374. package/dist/client/assets/{use-reports-diagnostic-CzsUPfAR.js → use-reports-diagnostic-DK-p83Vg.js} +1 -1
  375. package/dist/client/assets/{use-sandbox-events-CZaUevSl.js → use-sandbox-events-CF8Zmwcz.js} +1 -1
  376. package/dist/client/assets/{use-secrets-YqO4Pj-K.js → use-secrets-oap3Sfgj.js} +1 -1
  377. package/dist/client/assets/{use-section-preview-base-B_DOEyxF.js → use-section-preview-base-DCX8RbPA.js} +1 -1
  378. package/dist/client/assets/{use-sidebar-collapsed-DPsCe0op.js → use-sidebar-collapsed-C1RRRqbD.js} +1 -1
  379. package/dist/client/assets/{use-tags-Bipp2IYl.js → use-tags-BV4877fv.js} +1 -1
  380. package/dist/client/assets/{use-task-board-analytics-SrK71r3z.js → use-task-board-analytics-mp50qmPG.js} +1 -1
  381. package/dist/client/assets/{use-task-board-item-prs-Bt3VjLjz.js → use-task-board-item-prs-CwaffMkz.js} +1 -1
  382. package/dist/client/assets/{use-task-board-items-CbhYR4S7.js → use-task-board-items-BjJdOASU.js} +1 -1
  383. package/dist/client/assets/{use-task-board-prompts-CywXKY9x.js → use-task-board-prompts-DV_ruK00.js} +1 -1
  384. package/dist/client/assets/{use-task-metadata-ZmaeCO2k.js → use-task-metadata-gPlEiLJx.js} +1 -1
  385. package/dist/client/assets/{use-thread-outputs-CFLu8mMl.js → use-thread-outputs-D_ZJGfwp.js} +1 -1
  386. package/dist/client/assets/{use-view-draft-kind-CEwc6BMY.js → use-view-draft-kind-W96Ds4Zi.js} +1 -1
  387. package/dist/client/assets/{use-voice-input-CoHzgJEF.js → use-voice-input-CIq4Y88-.js} +1 -1
  388. package/dist/client/assets/useInfiniteQuery-CRAxl7DP.js +1 -0
  389. package/dist/client/assets/{useQueries-BRIu-KH4.js → useQueries-Dq9jPrZd.js} +1 -1
  390. package/dist/client/assets/useSuspenseInfiniteQuery-Ciw8KzoC.js +1 -0
  391. package/dist/client/assets/{users-BHbfDVzi.js → users-BvIsgN5c.js} +1 -1
  392. package/dist/client/assets/{utils-BLkb241y.js → utils-DyMUXWM4.js} +1 -1
  393. package/dist/client/assets/{variant-calendar-t-_VXUP5.js → variant-calendar-Bw8cYqTS.js} +1 -1
  394. package/dist/client/assets/{variant-matcher-override-CorWpPMf.js → variant-matcher-override-C7dpNQoG.js} +1 -1
  395. package/dist/client/assets/{view-header-BOHwmkNu.js → view-header-D6SIA1tU.js} +1 -1
  396. package/dist/client/assets/{virtual-mcp-DkZfQiia.js → virtual-mcp-BwWPUYJI.js} +1 -1
  397. package/dist/client/assets/{watch-sse-pool-fx4VSRmD.js → watch-sse-pool-ZsYyhYfT.js} +1 -1
  398. package/dist/client/index.html +1 -1
  399. package/dist/server/server.js +1 -1
  400. package/package.json +1 -1
  401. package/dist/client/assets/agent-app-DAyp6W1I.js +0 -1
  402. package/dist/client/assets/agent-deck-DKfZyTG1.js +0 -1
  403. package/dist/client/assets/agent-experiments-CGsGxxo6.js +0 -1
  404. package/dist/client/assets/agent-file-CPOrYbU2.js +0 -1
  405. package/dist/client/assets/agent-library-BkV0iVdr.js +0 -1
  406. package/dist/client/assets/agent-library-file-2kVH1dmS.js +0 -1
  407. package/dist/client/assets/agent-overview-BwQW84d6.js +0 -1
  408. package/dist/client/assets/agent-settings-iJ--LXZN.js +0 -1
  409. package/dist/client/assets/agent-site-editor-code-C9qZvHAo.js +0 -2
  410. package/dist/client/assets/agent-site-editor-content-MtSfvdcm.js +0 -1
  411. package/dist/client/assets/agent-site-editor-preview-bCH5xSAf.js +0 -1
  412. package/dist/client/assets/agent-view-DkyKhs8z.js +0 -1
  413. package/dist/client/assets/api-keys-tRTG3oS8.js +0 -1
  414. package/dist/client/assets/library-BrEeR06C.js +0 -1
  415. package/dist/client/assets/project-reports-DqV8Bd24.js +0 -1
  416. package/dist/client/assets/project-tasks-qTU5720S.js +0 -1
  417. package/dist/client/assets/record-editor-DCJNlw5O.js +0 -1
  418. package/dist/client/assets/reports-B6ii5CDi.js +0 -1
  419. package/dist/client/assets/repositories-CSXIjdlZ.js +0 -1
  420. package/dist/client/assets/route-BqTOx7z7.js +0 -1
  421. package/dist/client/assets/settings-tab-wW6TWR10.js +0 -1
  422. package/dist/client/assets/site-editor-CeDcKfa-.js +0 -1
  423. package/dist/client/assets/tasks-CcFMDLuk.js +0 -1
  424. package/dist/client/assets/use-ask-in-chat-DQ7NDNSO.js +0 -1
  425. package/dist/client/assets/use-blocks-v8-project-Dr2j7xAG.js +0 -1
  426. package/dist/client/assets/use-blog-view-C9Shh8Sd.js +0 -1
  427. package/dist/client/assets/useInfiniteQuery-U8sFHKjc.js +0 -1
  428. package/dist/client/assets/useSuspenseInfiniteQuery-B3Zlqz10.js +0 -1
@@ -1 +1 @@
1
- import{i8 as ei,bp as ti,c as wn,b as jn,r as b,m as le,j as r,c8 as ni,bm as Cs,i9 as Mo,B as It,Y as on,au as si,_ as ri,bo as oi,Z as ai,q as ii,hF as li,ia as ci,ib as ui,h as di,bq as wt,ic as Jr,id as bs,ie as fi,ig as pt,ih as Qr,ii as mi,fQ as pi,ij as hi,ik as Yr,il as gi,t as H,fu as Zr,im as vi,io as Bt,ip as yi,iq as Si,ir as bi,fi as Xr,is as xs,it as xi,iu as _i,iv as ki,ff as wi,fR as ji,iw as Ri,ix as Ei,ft as Vi,K as Ti,iy as eo,eM as Ai,fJ as Hn,fO as to,iz as no,iA as Ni,iB as Ci,iC as Pi,iD as _s,iE as Bi,iF as Ki,iG as Mi,iH as so,iI as Di,iJ as Fi,fh as ro,iK as Ii,iL as Li,fL as oo,iM as Oi,fd as zi}from"./index-DLuam-oO.js";import{u as $i}from"./chat-context-BNZ_9-8I.js";import{a as Xn,M as ao}from"./save-status-Bt5jCay9.js";import{p as kn,f as Wi,n as Hi}from"./parse-sections-Ddd3WX1b.js";import{a as qi}from"./repository-binding-BnP0NJWu.js";import{t as Gi}from"./ChevronDown-rYBqLYZM.js";import{d as Do,b as Ui}from"./UserCheck01-BaEElAkP.js";import{n as Ji}from"./ChevronUp-DH1sZis7.js";import{b as Zn,e as Qi,P as io,K as lo}from"./agent-icon-DKmZvJgZ.js";import{S as an}from"./scroll-area-CltAMX3V.js";import{c as jt,T as Rt,a as Et}from"./tooltip-CDlpUz6Q.js";import{h as Yi,i as Zi,j as Xi,E as el,k as tl,V as nl,l as sl,m as rl,G as ol,s as Jn,v as Qn,p as Fo,n as al,o as il,a as co,q as ll,u as cl,A as qn,P as uo,w as fo,x as mo,y as ks,z as ul,B as dl,D as po,F as fl,J as ho,K as go,L as vo,M as ml,Q as yo,c as pl,T as ln,U as hl,W as gl}from"./held-block-view-CyRccyrh.js";import{j as vl,u as yl,i as Sl,v as bl,aD as xl,U as _l,k as So,aU as bo,a9 as Kt,aa as Mt,aq as kl,aV as wl,aW as jl,aO as xo,at as Rl,aA as El}from"./site-editor-toast-Btsx5baB.js";import{u as Vl,ao as _o,e as ko,j as Tl,z as Al,y as Gn,ad as Nl,ae as Cl,aj as Pl}from"./blocks-tab-states-Cd3JWT_-.js";import{u as Bl}from"./use-delete-block-CQsMvlR4.js";import{b as Kl,u as Ml,k as Un,e as xn}from"./use-never-published-DIs5T7vx.js";import{a as Es,e as Io}from"./UserSquare-Dyyof09V.js";import{c as Dl}from"./Minimize01-B-w6jPRM.js";import{i as wo}from"./Tool01-e3-ebizX.js";import{s as jo}from"./Eye-CHPIJQjl.js";import{s as Fl}from"./Plus-BuHEMQHj.js";import{s as Il}from"./Trash01-C4Y4RaH9.js";import{i as Vs}from"./Zap-DsBnYwKs.js";import{u as Ll,a as Ro,n as Ol,P as zl,o as $l,C as Wl,D as Hl,c as ql}from"./task-key-BTXsrkSp.js";import{u as Gl,s as Ul,a as Yn,S as Jl,v as Ql}from"./sortable.esm-BsRtZMdI.js";import{s as Yl,g as Zl,u as Xl,A as ec}from"./use-section-preview-base-B_DOEyxF.js";import{m as tc,P as nc}from"./mustache-CiKDfLgV.js";import{r as Eo,u as sc,a as rc,i as oc,f as ac,B as ic}from"./empty-message-CTz0j9ie.js";import{u as lc,a as cc,P as Vo,w as uc,b as dc}from"./seo-editor-CBuQjDAN.js";import{v as fc,k as ws,x as To,j as mc,y as pc}from"./named-rule-step-5FH6L5dL.js";import{u as hc}from"./use-apply-named-rule-Bs9HuiLY.js";import{o as Jt,f as Ts,y as As,q as Ft,h as cn,u as gc,n as Ut,r as js,m as Dt,k as _n,b as vc,s as Ao,z as yc,A as Sc,B as bc}from"./section-array-field-CbwaMhTt.js";import{b as No,a as xc}from"./variant-matcher-override-CorWpPMf.js";import"./use-panel-navigate-CX_YerR_.js";import"./thread-route-CJ7vAn39.js";import"./use-project-scope-CUICChkO.js";import"./use-view-draft-kind-CEwc6BMY.js";import"./use-blog-view-C9Shh8Sd.js";import"./use-organization-settings-1p7-uoSE.js";import"./schema-BM6o7q66.js";import"./task-board-BgNefmZ8.js";import"./thread-intent-CMXI4-Qn.js";import"./use-mcp-client-oQNpcxdA.js";import"./auth-DM_x_MzR.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-fx4VSRmD.js";import"./session-runtime-AXnCtlIf.js";import"./use-entitlements-q1JiSGnY.js";import"./use-ai-providers-BR6hIwAY.js";import"./use-current-view-DYsOXIAq.js";import"./use-in-settings-B7PmXEGx.js";import"./use-decopilot-events-Eq5Di3tt.js";import"./Image01-DhuPGc9J.js";import"./Upload01-BwW7JFsg.js";import"./label-B40B-mb1.js";import"./SwitchHorizontal01-CSYGFkCN.js";import"./popover-DWDvG2sJ.js";import"./switch-DSmB9qdd.js";import"./toggle-group-PrSAkfEN.js";import"./active-indicator-CCMhAsc_.js";import"./match-site-slug-config-B47_xZCi.js";import"./use-file-configs-BwDtz-SL.js";import"./asset-utils-C17ggG12.js";import"./useInfiniteQuery-U8sFHKjc.js";import"./infiniteQueryObserver-DmwMo8IW.js";import"./AlertCircle-DQxZei1M.js";import"./hosted-reconcile-CfjfxtVx.js";import"./SearchMd-BvADjx7u.js";import"./textarea-C4626nq7.js";import"./use-copy-DyvoSaWK.js";import"./ChevronSelectorVertical-BRPtW72N.js";import"./command-1rGUkJU6.js";import"./index-DVG3DDnP.js";import"./Play-5POBzwun.js";import"./monaco-editor-UA1YjU4h.js";import"./editor-BIhlI60e.js";import"./ArrowUp-DqYXEiS6.js";import"./ArrowLeft-BXhTMhZ6.js";import"./ArrowRight-BrCDap4m.js";import"./BookOpen01-BJOsJKWt.js";import"./Globe04-BBhKUFMP.js";import"./CheckCircle-BupieyS2.js";import"./TrendUp01-BTeMqD6U.js";import"./LinkBroken01-C0qz4eZM.js";import"./CreditCard01-jTESoJyl.js";import"./File02-DTSJu4_M.js";import"./Key01-Cy6U3PPJ.js";import"./LayoutLeft-CQYXrSFJ.js";import"./Minus-CuVl5Nk4.js";import"./Monitor01-Du9j9yAH.js";import"./Sun-rTc-uCbQ.js";import"./ShoppingBag01-BX-lvdE7.js";import"./Users01-BnstW7gr.js";import"./XClose-CtKN8GLR.js";import"./index-BdQq_4o_.js";import"./index-DKfNWn49.js";import"./utils-BLkb241y.js";import"./calendar-CJeS1cU0.js";import"./usage-stats-BoGlEdlD.js";import"./utils-CVEq3hMx.js";import"./markdown-DIZTLySz.js";import"./use-mobile-B6Glooki.js";import"./gateway-client-CqrPq2Zk.js";import"./form-CdBjJq5W.js";import"./select-IOXOk3Ja.js";import"./editor-classes-CPgVKg5X.js";import"./combobox-D-AE0za3.js";import"./use-sandbox-events-CZaUevSl.js";import"./sandbox-url-D3mC8qhT.js";import"./use-blocks-v8-project-Dr2j7xAG.js";import"./use-voice-input-CoHzgJEF.js";import"./drawer-CN3NEJqY.js";import"./index-CV1w3jjI.js";import"./checkbox-BhkoX8Ty.js";import"./ai-providers-logos-DD3qZ33J.js";import"./openai-compatible-presets-BKGfVqEx.js";import"./sandbox-git-api-BsZqakhs.js";import"./empty-state-myFrB_Ip.js";import"./search-input-CyDCJavO.js";import"./tabs-Bl2CDwVl.js";import"./use-debounced-value-nMm2S7EZ.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-Cd9OPgUF.js";import"./collapsible-2JPp4iG8.js";import"./use-task-board-items-CbhYR4S7.js";import"./config-ySNx5jY7.js";import"./task-route-DF_PNMho.js";import"./project-index-1ZydFeWl.js";import"./shell-layout-MV3x6XdO.js";import"./use-deployment-admin-B8eJaq0l.js";import"./admin-fetch-BhTJlAsX.js";import"./use-org-notice-MJYmvNw3.js";import"./integration-icon-DNMl6-J4.js";import"./project-icon-CySwwEU9.js";import"./use-navigate-to-agent-DHcX_wvC.js";import"./new-project-dialog-CJFHxf5_.js";import"./repository-picker-vBJtxDaP.js";import"./github-icon-BzIHSx26.js";import"./collection-search-BKN9EjWI.js";import"./new-project-store-BXbDjmer.js";import"./legacy-admin-welcome-dialog-Dty139TN.js";import"./required-auth-layout-DEnKlG9k.js";import"./use-org-sso-DQr7OjOZ.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-BxY6mRCw.js";import"./types-NGYefc4q.js";import"./omit-server-managed-metadata-L5IhjRZB.js";import"./sheet-C7jRkpDc.js";import"./use-connection-stybxl69.js";import"./use-mcp-prompts-DJDMRBKo.js";import"./use-thread-outputs-CFLu8mMl.js";import"./file-type-icon-DO8X7oBj.js";import"./slider-Z3uc-J_e.js";import"./index-BpLMoHof.js";import"./tooltipContext-jGLnEmc0.js";import"./CategoricalChart-g0ZOgFoY.js";import"./index-DK0mPK-c.js";import"./use-move-blocks-DgoYqSh3.js";const _c={escape:Yi};function kc(v,e){for(const p of Yl(v,e)){const S=typeof p.title=="string"?p.title:void 0;if(S?.includes("{{"))return S}}function wc(v,e){if(!e)return;const p=ei(v,ti(e));if(p)try{const S=kc(p.resolveType,e);return S&&tc.render(S,p.data,{},_c).trim()||void 0}catch{return}}function jc(v){const e=wn.c(13),{icon:p,label:S,className:x}=v;let V;e[0]!==x?(V=le("size-3.5",x),e[0]=x,e[1]=V):V=e[1];let C;e[2]!==p||e[3]!==V?(C=r.jsx(p,{className:V}),e[2]=p,e[3]=V,e[4]=C):C=e[4];let _;e[5]!==S||e[6]!==C?(_=r.jsx(Rt,{asChild:!0,children:r.jsx("span",{role:"img","aria-label":S,className:"shrink-0 cursor-help",children:C})}),e[5]=S,e[6]=C,e[7]=_):_=e[7];let P;e[8]!==S?(P=r.jsx(Et,{className:"max-w-56",children:S}),e[8]=S,e[9]=P):P=e[9];let k;return e[10]!==_||e[11]!==P?(k=r.jsxs(jt,{children:[_,P]}),e[10]=_,e[11]=P,e[12]=k):k=e[12],k}const Rc="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function Co(v){return Array.from({length:v},(e,p)=>({id:crypto.randomUUID(),index:p}))}function Lo(v){return v.map((e,p)=>({...e,index:p}))}function Ec(v,e){if(e===v.length)return v;if(e<v.length)return Lo(v.slice(0,e));const p=Array.from({length:e-v.length},(S,x)=>({id:crypto.randomUUID(),index:v.length+x}));return[...v,...p]}function Oo(v){const e=wn.c(44),{section:p,raw:S,meta:x,decofile:V}=v,C=jn(),_=Xn(),P=p.isSavedBlock===!0,k=p.isMultivariate===!0;let Z;e[0]!==x||e[1]!==S?(Z=S&&x?Zl(S,x):void 0,e[0]=x,e[1]=S,e[2]=Z):Z=e[2];const ge=Z;let Ue;e[3]!==x||e[4]!==k||e[5]!==S||e[6]!==P?(Ue=S&&x&&!P&&!k?wc(S,x):void 0,e[3]=x,e[4]=k,e[5]=S,e[6]=P,e[7]=Ue):Ue=e[7];const Le=Ue;let Ce;e[8]!==V||e[9]!==x||e[10]!==S||e[11]!==p?(Ce=sl(S,p,V,x),e[8]=V,e[9]=x,e[10]=S,e[11]=p,e[12]=Ce):Ce=e[12];const Je=Ce;let w;e[13]!==k||e[14]!==S?.__resolveType?(w=!k&&Cs(S?.__resolveType??""),e[13]=k,e[14]=S?.__resolveType,e[15]=w):w=e[15];const c=w,xe=P?Zn:k?Do:Io;let G;e[16]!==k||e[17]!==P?(G=P?{color:oi}:k?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=k,e[17]=P,e[18]=G):G=e[18];const _e=G;let I;e[19]!==xe||e[20]!==_?(I=_?r.jsxs("span",{className:"relative size-4 shrink-0",children:[r.jsx(xe,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),r.jsx(ol,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):r.jsx(Dl,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=xe,e[20]=_,e[21]=I):I=e[21];let ke;e[22]!==ge?(ke=ge&&r.jsx("img",{src:ge,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=ge,e[23]=ke):ke=e[23];let d;e[24]!==_||e[25]!==_e?(d=!_&&r.jsx(Es,{className:"h-4 w-4 shrink-0",style:_e}),e[24]=_,e[25]=_e,e[26]=d):d=e[26];const Oe=_?"shrink":"flex-1",u=p.isHidden&&"line-through opacity-50";let Ee;e[27]!==u||e[28]!==Oe?(Ee=le("min-w-0 truncate text-sm font-medium",Oe,u),e[27]=u,e[28]=Oe,e[29]=Ee):Ee=e[29];const X=Le??p.label;let ze;e[30]!==Ee||e[31]!==X?(ze=r.jsx("span",{className:Ee,children:X}),e[30]=Ee,e[31]=X,e[32]=ze):ze=e[32];let nt;e[33]!==c||e[34]!==_||e[35]!==Je||e[36]!==C?(nt=_?r.jsxs(r.Fragment,{children:[c&&r.jsx(jc,{icon:Vs,label:C("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),Je&&r.jsx(ao,{}),r.jsx("span",{className:"min-w-0 flex-1"})]}):Je&&r.jsx(ao,{className:"absolute -right-0.5 -top-0.5"}),e[33]=c,e[34]=_,e[35]=Je,e[36]=C,e[37]=nt):nt=e[37];let Pe;return e[38]!==ze||e[39]!==nt||e[40]!==I||e[41]!==ke||e[42]!==d?(Pe=r.jsxs(r.Fragment,{children:[I,ke,d,ze,nt]}),e[38]=ze,e[39]=nt,e[40]=I,e[41]=ke,e[42]=d,e[43]=Pe):Pe=e[43],Pe}const Vc="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Tc="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]";function zo(v,e,p){if(p)return rl({selected:e});const S=v.isSavedBlock===!0,x=v.isMultivariate===!0;return le("group relative flex select-none items-center gap-2 rounded-[var(--studio-control-radius,var(--radius-md))] px-2 py-2.5",e?"bg-accent text-accent-foreground":S?Vc:x?Tc:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Rs(v,e){return le("h-7 shrink-0 overflow-hidden",e?"w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]":v?"w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100":"w-0 -ml-2 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:ml-0 group-hover:w-7 group-hover:opacity-100 group-hover:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms] group-has-[:focus-visible]:ml-0 group-has-[:focus-visible]:w-7 group-has-[:focus-visible]:opacity-100 group-has-[:focus-visible]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]")}function Ac(v){const e=wn.c(90),{section:p,raw:S,meta:x,decofile:V,sortableId:C,selected:_,onSelect:P,onDelete:k,onDuplicate:Z,onMakeReusable:ge,onToggleHidden:Ue,onToggleLazy:Le,onAddVariant:Ce,onDetach:Je}=v,w=jn(),c=Xn(),xe=S?Cs(S.__resolveType??""):!1,G=p.isHidden===!0,_e=xe||G;let I;e[0]!==p?(I=Mo(p),e[0]=p,e[1]=I):I=e[1];const ke=I,d=!!Le&&!p.isMultivariate;let Oe;e[2]!==C?(Oe={id:C,animateLayoutChanges:Pc},e[2]=C,e[3]=Oe):Oe=e[3];const{attributes:u,listeners:Ee,setNodeRef:X,transform:ze,isDragging:nt}=Gl(Oe);let Pe;e[4]!==ze?(Pe=Wl.Transform.toString(ze?{...ze,x:0}:null),e[4]=ze,e[5]=Pe):Pe=e[5];const st=nt?0:void 0;let de;e[6]!==Pe||e[7]!==st?(de={transform:Pe,opacity:st},e[6]=Pe,e[7]=st,e[8]=de):de=e[8];const g=de;let we;e[9]!==p?(we=Xi(p),e[9]=p,e[10]=we):we=e[10];const rt=we,ot="button",m=0;let L;e[11]!==P?(L=F=>{(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),P())},e[11]=P,e[12]=L):L=e[12];const Xe=nt?"cursor-grabbing":"cursor-pointer";let A;e[13]!==c||e[14]!==p||e[15]!==_||e[16]!==Xe?(A=le("touch-none transition-colors",Xe,zo(p,_,c)),e[13]=c,e[14]=p,e[15]=_,e[16]=Xe,e[17]=A):A=e[17];let Qe;e[18]!==V||e[19]!==x||e[20]!==S||e[21]!==p?(Qe=r.jsx(Oo,{section:p,raw:S,meta:x,decofile:V}),e[18]=V,e[19]=x,e[20]=S,e[21]=p,e[22]=Qe):Qe=e[22];const W=!c&&d&&r.jsxs(jt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon","aria-label":w(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:le(Rs(_e,xe)),onClick:F=>{F.stopPropagation(),Le?.()},onPointerDown:Cc,children:r.jsx(Vs,{className:le("h-3.5 w-3.5",xe&&"text-warning")})})}),r.jsx(Et,{side:"bottom",children:w(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),at=c?r.jsx(el,{label:w(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:G,onToggle:Ue,children:G?r.jsx(wo,{className:"h-3.5 w-3.5"}):r.jsx(jo,{className:"h-3.5 w-3.5"})}):r.jsxs(jt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon","aria-label":w(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:le(Rs(_e,G)),onClick:F=>{F.stopPropagation(),Ue()},onPointerDown:Nc,children:G?r.jsx(wo,{className:"h-3.5 w-3.5"}):r.jsx(jo,{className:"h-3.5 w-3.5"})})}),r.jsx(Et,{side:"bottom",children:w(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),fe=ri,Ye=tl;let ve;e[23]!==w?(ve=w("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=w,e[24]=ve):ve=e[24];const it=le(Rs(_e,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let $e;e[25]!==Ye||e[26]!==ve||e[27]!==it?($e=r.jsx(Ye,{label:ve,classicClassName:it}),e[25]=Ye,e[26]=ve,e[27]=it,e[28]=$e):$e=e[28];let Be;e[29]!==c||e[30]!==d||e[31]!==xe||e[32]!==Le||e[33]!==w?(Be=c&&d&&r.jsxs(r.Fragment,{children:[r.jsxs(on,{onClick:F=>{F.stopPropagation(),Le?.()},children:[r.jsx(Vs,{className:"h-4 w-4"}),w(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),r.jsx(si,{})]}),e[29]=c,e[30]=d,e[31]=xe,e[32]=Le,e[33]=w,e[34]=Be):Be=e[34];let Ke;e[35]!==Z?(Ke=F=>{F.stopPropagation(),Z()},e[35]=Z,e[36]=Ke):Ke=e[36];let se;e[37]===Symbol.for("react.memo_cache_sentinel")?(se=r.jsx(Qi,{className:"h-4 w-4"}),e[37]=se):se=e[37];let Y;e[38]!==w?(Y=w("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=w,e[39]=Y):Y=e[39];let ee;e[40]!==Ke||e[41]!==Y?(ee=r.jsxs(on,{onClick:Ke,children:[se,Y]}),e[40]=Ke,e[41]=Y,e[42]=ee):ee=e[42];let D;e[43]!==c||e[44]!==ke||e[45]!==Ce||e[46]!==w?(D=ke&&r.jsxs(on,{className:le(!c&&nl),onClick:F=>{F.stopPropagation(),Ce()},children:[r.jsx(Do,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=c,e[44]=ke,e[45]=Ce,e[46]=w,e[47]=D):D=e[47];let T;e[48]!==c||e[49]!==rt||e[50]!==ge||e[51]!==w?(T=rt&&r.jsxs(on,{className:le(!c&&Rc),onClick:F=>{F.stopPropagation(),ge()},children:[c?r.jsx(Zn,{className:"h-4 w-4"}):r.jsx(Es,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=c,e[49]=rt,e[50]=ge,e[51]=w,e[52]=T):T=e[52];let me;e[53]!==c||e[54]!==Je||e[55]!==p.isMultivariate||e[56]!==p.isSavedBlock||e[57]!==w?(me=p.isSavedBlock===!0&&!p.isMultivariate&&r.jsxs(on,{onClick:F=>{F.stopPropagation(),Je()},children:[c?r.jsx(Io,{className:"h-4 w-4"}):r.jsx(Es,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=c,e[54]=Je,e[55]=p.isMultivariate,e[56]=p.isSavedBlock,e[57]=w,e[58]=me):me=e[58];let We;e[59]!==k?(We=F=>{F.stopPropagation(),k()},e[59]=k,e[60]=We):We=e[60];let et;e[61]===Symbol.for("react.memo_cache_sentinel")?(et=r.jsx(Il,{className:"h-4 w-4"}),e[61]=et):et=e[61];let Me;e[62]!==w?(Me=w("sectionsEditor.sectionList.deleteMenuItem"),e[62]=w,e[63]=Me):Me=e[63];let $;e[64]!==We||e[65]!==Me?($=r.jsxs(on,{variant:"destructive",onClick:We,children:[et,Me]}),e[64]=We,e[65]=Me,e[66]=$):$=e[66];let ie;e[67]!==Be||e[68]!==ee||e[69]!==D||e[70]!==T||e[71]!==me||e[72]!==$?(ie=r.jsxs(ai,{align:"end",className:"w-44",children:[Be,ee,D,T,me,$]}),e[67]=Be,e[68]=ee,e[69]=D,e[70]=T,e[71]=me,e[72]=$,e[73]=ie):ie=e[73];let Ve;e[74]!==fe||e[75]!==$e||e[76]!==ie?(Ve=r.jsxs(fe,{children:[$e,ie]}),e[74]=fe,e[75]=$e,e[76]=ie,e[77]=Ve):Ve=e[77];let Te;return e[78]!==u||e[79]!==Ee||e[80]!==P||e[81]!==X||e[82]!==g||e[83]!==A||e[84]!==Qe||e[85]!==W||e[86]!==at||e[87]!==Ve||e[88]!==L?(Te=r.jsxs("div",{ref:X,style:g,...u,...Ee,role:ot,tabIndex:m,onClick:P,onKeyDown:L,className:A,children:[Qe,W,at,Ve]}),e[78]=u,e[79]=Ee,e[80]=P,e[81]=X,e[82]=g,e[83]=A,e[84]=Qe,e[85]=W,e[86]=at,e[87]=Ve,e[88]=L,e[89]=Te):Te=e[89],Te}function Nc(v){return v.stopPropagation()}function Cc(v){return v.stopPropagation()}function Pc(){return!1}function Ns(v){const e=wn.c(11),{canAddSection:p,onAddSection:S,className:x,size:V}=v,C=jn();let _;e[0]!==x?(_=le("w-full",x),e[0]=x,e[1]=_):_=e[1];const P=!p;let k;e[2]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Fl,{size:14}),e[2]=k):k=e[2];let Z;e[3]!==C?(Z=C("sectionsEditor.sectionList.addSectionButton"),e[3]=C,e[4]=Z):Z=e[4];let ge;return e[5]!==S||e[6]!==V||e[7]!==_||e[8]!==P||e[9]!==Z?(ge=r.jsxs(It,{type:"button",variant:"outline",size:V,className:_,disabled:P,onClick:S,children:[k,Z]}),e[5]=S,e[6]=V,e[7]=_,e[8]=P,e[9]=Z,e[10]=ge):ge=e[10],ge}function Bc(v){const e=wn.c(101),{listKey:p,rawSections:S,sections:x,meta:V,decofile:C,selectedIndex:_,onSelect:P,onReorder:k,onDelete:Z,onDuplicate:ge,onMakeReusable:Ue,onToggleHidden:Le,onToggleLazy:Ce,onAddVariant:Je,onDetach:w,onAddSection:c,canAddSection:xe}=v,G=xe===void 0?!0:xe,_e=jn(),I=Xn();let ke;e[0]!==x.length?(ke=()=>Co(x.length),e[0]=x.length,e[1]=ke):ke=e[1];const[d,Oe]=b.useState(ke),[u,Ee]=b.useState(null),[X,ze]=b.useState(p),[nt,Pe]=b.useState(x.length),st=b.useRef(!1);X!==p?(ze(p),Pe(x.length),Oe(Co(x.length))):nt!==x.length&&(Pe(x.length),Oe(tt=>Ec(tt,x.length)));let de;e[2]===Symbol.for("react.memo_cache_sentinel")?(de={activationConstraint:{distance:8}},e[2]=de):de=e[2];let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g={coordinateGetter:Ul},e[3]=g):g=e[3];const we=Ll(Ro(zl,de),Ro(Ol,g));let rt;e[4]!==d?(rt=d.map(Kc),e[4]=d,e[5]=rt):rt=e[5];const ot=rt;let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=tt=>{Ee(String(tt.active.id))},e[6]=m):m=e[6];const L=m;let Xe;e[7]!==ot||e[8]!==k?(Xe=tt=>{Ee(null);const{active:O,over:Ae}=tt;if(!Ae||O.id===Ae.id)return;const He=ot.indexOf(String(O.id)),ht=ot.indexOf(String(Ae.id));He===-1||ht===-1||(Oe(bt=>Lo(Yn([...bt],He,ht))),st.current=!0,requestAnimationFrame(()=>{st.current=!1}),k?.(He,ht))},e[7]=ot,e[8]=k,e[9]=Xe):Xe=e[9];const A=Xe;let Qe;e[10]===Symbol.for("react.memo_cache_sentinel")?(Qe=()=>{Ee(null)},e[10]=Qe):Qe=e[10];const W=Qe;let at,fe,Ye,ve,it,$e,Be,Ke,se,Y,ee,D,T,me,We;if(e[11]!==u||e[12]!==G||e[13]!==I||e[14]!==C||e[15]!==d||e[16]!==ot||e[17]!==A||e[18]!==V||e[19]!==c||e[20]!==Je||e[21]!==Z||e[22]!==w||e[23]!==ge||e[24]!==Ue||e[25]!==P||e[26]!==Le||e[27]!==Ce||e[28]!==S||e[29]!==x||e[30]!==_||e[31]!==we||e[32]!==_e){me=Symbol.for("react.early_return_sentinel");e:{const tt=O=>{st.current||P(O)};if(e[48]!==u||e[49]!==G||e[50]!==I||e[51]!==d||e[52]!==c||e[53]!==S||e[54]!==x||e[55]!==_e){const O=u?d.find(Ae=>Ae.id===u):null;if(ve=O!=null?x[O.index]:null,Ye=O!=null?S[O.index]:void 0,d.length===0){let Ae;e[59]!==_e?(Ae=_e("sectionsEditor.sectionList.noSections"),e[59]=_e,e[60]=Ae):Ae=e[60];let He;e[61]!==Ae?(He=r.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:Ae}),e[61]=Ae,e[62]=He):He=e[62];const ht=He;let bt;e[63]!==G||e[64]!==I||e[65]!==ht||e[66]!==c?(bt=I?ht:r.jsxs("div",{className:"space-y-2",children:[ht,r.jsx(Ns,{canAddSection:G,onAddSection:c,size:"sm"})]}),e[63]=G,e[64]=I,e[65]=ht,e[66]=c,e[67]=bt):bt=e[67],me=bt;break e}T=le(O&&"cursor-grabbing"),e[48]=u,e[49]=G,e[50]=I,e[51]=d,e[52]=c,e[53]=S,e[54]=x,e[55]=_e,e[56]=Ye,e[57]=ve,e[58]=T}else Ye=e[56],ve=e[57],T=e[58];fe=Hl,Ke=we,se=ql,Y=L,ee=A,D=W,at=Jl,$e=ot,Be=Ql,We="space-y-1",it=d.map(O=>{const Ae=x[O.index];return Ae?r.jsx(Ac,{sortableId:O.id,section:Ae,raw:S[O.index],meta:V,decofile:C,selected:_===O.index,onSelect:()=>tt(O.index),onDelete:()=>Z(O.index),onDuplicate:()=>ge(O.index),onMakeReusable:()=>Ue(O.index),onToggleHidden:()=>Le(O.index),onToggleLazy:Ce?()=>Ce(O.index):void 0,onAddVariant:()=>Je(O.index),onDetach:()=>w(O.index)},O.id):null})}e[11]=u,e[12]=G,e[13]=I,e[14]=C,e[15]=d,e[16]=ot,e[17]=A,e[18]=V,e[19]=c,e[20]=Je,e[21]=Z,e[22]=w,e[23]=ge,e[24]=Ue,e[25]=P,e[26]=Le,e[27]=Ce,e[28]=S,e[29]=x,e[30]=_,e[31]=we,e[32]=_e,e[33]=at,e[34]=fe,e[35]=Ye,e[36]=ve,e[37]=it,e[38]=$e,e[39]=Be,e[40]=Ke,e[41]=se,e[42]=Y,e[43]=ee,e[44]=D,e[45]=T,e[46]=me,e[47]=We}else at=e[33],fe=e[34],Ye=e[35],ve=e[36],it=e[37],$e=e[38],Be=e[39],Ke=e[40],se=e[41],Y=e[42],ee=e[43],D=e[44],T=e[45],me=e[46],We=e[47];if(me!==Symbol.for("react.early_return_sentinel"))return me;let et;e[68]!==it||e[69]!==We?(et=r.jsx("div",{className:We,children:it}),e[68]=it,e[69]=We,e[70]=et):et=e[70];let Me;e[71]!==at||e[72]!==$e||e[73]!==Be||e[74]!==et?(Me=r.jsx(at,{items:$e,strategy:Be,children:et}),e[71]=at,e[72]=$e,e[73]=Be,e[74]=et,e[75]=Me):Me=e[75];let $;e[76]!==Ye||e[77]!==ve||e[78]!==I||e[79]!==C||e[80]!==V?($=ve?r.jsx("div",{className:le("cursor-grabbing shadow-lift",zo(ve,!1,I)),children:r.jsx(Oo,{section:ve,raw:Ye,meta:V,decofile:C})}):null,e[76]=Ye,e[77]=ve,e[78]=I,e[79]=C,e[80]=V,e[81]=$):$=e[81];let ie;e[82]!==$?(ie=ni.createPortal(r.jsx($l,{dropAnimation:Zi,children:$}),document.body),e[82]=$,e[83]=ie):ie=e[83];let Ve;e[84]!==fe||e[85]!==Ke||e[86]!==se||e[87]!==Y||e[88]!==ee||e[89]!==D||e[90]!==Me||e[91]!==ie?(Ve=r.jsxs(fe,{sensors:Ke,collisionDetection:se,onDragStart:Y,onDragEnd:ee,onDragCancel:D,children:[Me,ie]}),e[84]=fe,e[85]=Ke,e[86]=se,e[87]=Y,e[88]=ee,e[89]=D,e[90]=Me,e[91]=ie,e[92]=Ve):Ve=e[92];let Te;e[93]!==G||e[94]!==I||e[95]!==c?(Te=!I&&r.jsx(Ns,{canAddSection:G,onAddSection:c,size:"sm",className:"mt-2"}),e[93]=G,e[94]=I,e[95]=c,e[96]=Te):Te=e[96];let F;return e[97]!==T||e[98]!==Ve||e[99]!==Te?(F=r.jsxs("div",{className:T,children:[Ve,Te]}),e[97]=T,e[98]=Ve,e[99]=Te,e[100]=F):F=e[100],F}function Kc(v){return v.id}function Mc(v,e,p,S){if(!v||typeof v!="object")return{kind:"error",reason:"no-matcher-rule"};const x=e.trim();if(!x)return Jt(v,p,S)?{kind:"inline",blockKey:v.__resolveType??"",inlinedRule:Ts(v,p,S)}:{kind:"noop"};const V=As(v,p,S);if(!V)return{kind:"error",reason:"unreadable-rule"};if(V.blockKey)return{kind:"updateBlock",blockKey:V.blockKey,blockData:Ft(V.resolveType,V.data,x)};const C=Jn(x),_=Qn(C,p);return _?{kind:"error",reason:"invalid-block-id",message:_}:{kind:"createBlock",blockId:C,blockData:Ft(V.resolveType,V.data,x),reference:cn(C)}}const Po="section-form-stale-save",Dc=3;function Bo(v,e,p){const S=e.global&&e.pageKey?[{label:"Default",sections:[{__resolveType:e.pageKey}]}]:Fo(e.pageKey?v[e.pageKey]?.sections:void 0,v,p),x=Math.max(0,Math.min(e.pageVariantIndex,S.length-1)),V=S[x]?.sections??[];return{pageVariants:S,variantIndex:x,rawSections:V,parsedSections:kn(V,v,p)}}const Ko=new WeakMap;let Fc=0;function Ic(v){let e=Ko.get(v);return e===void 0&&(e=++Fc,Ko.set(v,e)),e}function Of({orgSlug:v,virtualMcpId:e,branch:p,previewReady:S=!0,previewUrl:x,currentPath:V,activePageBlockKey:C=null,activeGlobalBlockKey:_=null,externalSelection:P,onSaved:k,initialEditSeo:Z=!1,onExitSeo:ge,onSelectRoot:Ue,onViewJsonFile:Le,onFocusedBlockChange:Ce,onSectionPicked:Je,onVariantPreviewOverride:w}){const c=jn(),xe=$i(),G=xe?.taskId??null,_e=S?{orgSlug:v,virtualMcpId:e,branch:p,threadId:G,previewUrl:x}:null,[I,ke]=b.useState([]),{data:d,isLoading:Oe}=vl(_e,{pollWhile:I.length>0}),{data:u,isLoading:Ee}=Vl(_e),X=Xn(),ze=xe?.virtualMcpId,Pe=qi(ze===e?e:null)?.metadata?.siteSlug??null,st=Xl({virtualMcpId:e,branch:p,sandboxUrl:x}),de=yl(e,p),g=Sl(de),we=Vi(g),rt=!g,ot=!!st||g,[m,L]=b.useState(null),[Xe,A]=b.useState(null),[Qe,W]=b.useState(null),[at,fe]=b.useState(0),[Ye,ve]=b.useState(void 0),[it,$e]=b.useState(null),Be={index:it,remember:$e},[Ke,se]=b.useState(null),[Y,ee]=b.useState(null),[D,T]=b.useState([]),me=b.useRef(null),[We,et]=b.useState(D.length);We!==D.length&&(et(D.length),requestAnimationFrame(()=>{me.current&&(me.current.scrollTop=0)}));const[Me,$]=b.useState(0),[ie,Ve]=b.useState(null),[Te,F]=b.useState(null),[tt,O]=b.useState(null),[Ae,He]=b.useState(!1),[ht,bt]=b.useState(!1),Rn=b.useRef(null),[En,$o]=b.useState(!0),[Qt,Vn]=b.useState(!1),[Lt,Tn]=b.useState(!1),[je,un]=b.useState(Z),[Ps,Bs]=b.useState(Z);Z&&!Ps&&(Bs(!0),un(!0),L(null),A(null),W(null),T([])),!Z&&Ps&&Bs(!1);const[Wo,dn]=b.useState(null),[Ks,An]=b.useState(void 0),[Ms,Ot]=b.useState([]),[Ds,Yt]=b.useState(0),[De,lt]=b.useState(0),[Ho,Fe]=b.useState(null),[Zt,qe]=b.useState(null),[Fs,Is]=b.useState(null),Nn=ii(),Cn=bl({orgSlug:v,virtualMcpId:e,branch:p},{tunnel:!1}),fn=Kl({orgSlug:v,virtualMcpId:e,branch:p}),[qo,Go]=b.useState(V),[Uo,Jo]=b.useState(C),[Qo,Yo]=b.useState(_);(qo!==V||Uo!==C||Qo!==_)&&(queueMicrotask(()=>fn.flush()),Go(V),Jo(C),Yo(_),L(null),A(null),W(null),fe(0),se(null),ee(null),lt(0),Fe(null),qe(null),T([]),$(t=>t+1),un(!1),dn(null),An(void 0),Ot([]),Yt(t=>t+1));const B=Ml({orgSlug:v,virtualMcpId:e,branch:p}),mn=pl(t=>{B.mutate(t,{onSuccess:()=>k?.(),onError:B.reportError})},d??{},B.v8),Pn=Bl({orgSlug:v,virtualMcpId:e,branch:p}),Ls=hc({orgSlug:v,virtualMcpId:e,branch:p}),[Xt,en]=b.useState(!1),N=b.useRef(null),_t=b.useRef(null),gt=b.useRef(null),vt=b.useRef(null),Bn=b.useRef({}),zt=b.useRef(null),pn=b.useRef(!1),hn=b.useRef(!1),ye=b.useRef(new Map),tn=b.useRef(!1),ct=b.useRef([]),es=b.useRef(new WeakSet);xl(v,e,t=>{const{activePageKey:n,rawSections:s,parsedSections:o,selectedSectionIndex:a}=re.current,i=new Set;n&&i.add(n);for(const l of[_t.current?.sectionIndex,a]){const f=l==null?void 0:s[l],R=l==null?void 0:o[l],h=f&&R?.isSavedBlock?_s(f,R):null;h&&i.add(h)}if([...i].some(l=>t.has(l))){for(const l of[N,gt,vt])l.current&&clearTimeout(l.current),l.current=null;_t.current=null,ye.current.clear(),n&&t.has(n)&&(Bn.current={})}});const re=b.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[Os,zs]=b.useState(0),[Zo,Xo]=b.useState(0),$s=li(de,{orgSlug:v,virtualMcpId:e,branch:p}),Ws=ci($s,I[0]?.blockKey??null,ui(d,I[0]?.blockKey??null)),[ea,ta]=b.useState(null),ts=_l(v,e).epoch,[na,sa]=b.useState(ts);lc(je?{orgSlug:v,virtualMcpId:e,branch:p}:null,d??void 0,u??void 0);const Hs=_??(d&&u?_o(ko(d,u),V,C)?.key??null:null),ns=So({orgSlug:v,virtualMcpId:e,branch:p},Hs?[Hs]:[],{withRefs:!0}),[qs,ra]=b.useState(!1),ss=So({orgSlug:v,virtualMcpId:e,branch:p},qs?Tl:[]),Gs={ready:!(de.kind==="protocol"&&de.hosted)||qs&&ss.ready,failed:ss.failed,retry:ss.retry,request:()=>ra(!0)};if(ns.failed)return r.jsxs("div",{className:"h-full w-full flex flex-col items-center justify-center gap-3 p-6 text-center text-sm text-muted-foreground",children:[r.jsx("p",{children:c("sectionsEditor.hosted.blockLoadFailed")}),r.jsx("p",{children:c("sectionsEditor.hosted.blockLoadFailedHint")}),r.jsx(It,{variant:"outline",size:"sm",onClick:ns.retry,children:c("sectionsEditor.namedRules.tryAgain")})]});if(!S||Oe||Ee||!ns.ready)return r.jsx("div",{className:"h-full w-full flex items-center justify-center",children:r.jsx(di,{className:"size-5 text-muted-foreground"})});if(!d||!u)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const oa=ko(d,u),q=!!_,oe=q?null:_o(oa,V,C),y=q?_:oe?.key??null,rs=q&&_?d[_]:void 0,Us=q&&_&&rs?Al(_,rs):q&&_?_:"",nn=!q&&y&&d[y]?d[y]:null,os=je&&d&&u&&y&&oe?Eo(d,{kind:"page",pageKey:y,pageName:String(oe.name??""),path:String(oe.path??"")},u):null,aa=je?nn?.seo:void 0,Kn=Ks!==void 0?Ks:aa,ia=je?sc(Kn):void 0,Js=os?.seoTypeOptions??[],Qs=je&&u?rc(u):"",as=Wo??ia??{},Mn=je&&os?cc(as,os):null,Ys=je&&Mn&&oc(Kn)?Gn(Mn,u):null,Zs=je?ac(d,u)?.seoData:void 0,pe=q?[{label:"Default",sections:[{__resolveType:_}]}]:Fo(nn?.sections,d??{},g),yt=pe.length>1,te=Math.min(at,pe.length-1),Se=pe[te],K=Se?.sections??[],ce=kn(K,d,g),Dn=!q&&gc(nn?.sections,g);if(q&&_&&Fs!==_){Is(_);const t=K[0],n=ce[0];if(t&&n){L(0),lt(0),T([]);const s=wt(t,n,d,g);s&&(A(s.data),W(s.resolveType),qe(null),Fe(null))}}!q&&Fs!==null&&Is(null),re.current={rawSections:K,parsedSections:ce,decofile:d??{},activePageKey:y,pageVariants:pe,variantIndex:te,sectionVariantIndex:De,selectedSectionIndex:m};const la=()=>({multivariate:Dn,index:te,variants:pe.map(t=>({rule:t.rule})),lazyValues:g&&Dn&&Ai(nn?.sections?.variants?.[te]?.value)}),is=(t,n)=>{if(!w)return;if(!y||!Dn||t.length<=1){w(null);return}const s={multivariate:!0,index:n,variants:t},o=g?bo(y,s):No(y,s,d,u);w(o.length>0?o:null)},ls=w&&y&&Dn&&yt&&!Oe&&!Ee?y:null;if(ls!==ea&&(ta(ls),ls)){const t=pe.map(s=>({rule:s.rule})),n=te;queueMicrotask(()=>is(t,n))}const $t=(t,n,s)=>{if(!w)return;if(!y){w(null);return}const o=la(),a=g?bo(y,o):No(y,o,d,u);if(!t||n<0){w(a.length>0?a:null);return}const i={pageKey:y,page:o,sectionIndex:n,sectionLazy:ce[n]?.isLazy??!1,mvObj:t,selectedVariantIndex:s},l=g?wl(i):xc({...i,decofile:d,meta:u}),f=g?jl(a,l):[...a,...l];w(f.length>0?f:null)},xt=(t,n,s,o=m??-1,a=!1)=>{const i=pt(t,n);if(!i){A(null),W(null),qe(null),Fe(null),a&&$t(null,o,s);return}const f=Qr(i,we)[s];if(!f){A(null),W(null),qe(null),Fe(null),a&&$t(null,o,s);return}const R=hi(f.value,d);A(R?.data??null),W(R?.resolveType??null);const{resolveType:h,formValue:j}=Ut(f.rule,d,u??void 0);qe(h),Fe(j),a&&$t(i,o,s)},cs=t=>{F(null),fe(t),L(null),A(null),W(null),T([]);const n=pe[t]?.rule,{resolveType:s,formValue:o}=Ut(n,d??{},u??void 0);ee(s),se(o),is(pe.map(a=>({rule:a.rule})),t)},ca=(t,n)=>{const s=K[t],o=ce[t];if(!s||!o)return!1;const a=o.isMultivariate?pt(s,o)?.variants?.length??0:0,i=n<a?n:0;if(L(t),lt(i),T([]),$(l=>l+1),o.isMultivariate)xt(s,o,i,t);else{const l=wt(s,o,d,g);l?(A(l.data),W(l.resolveType)):(A(null),W(null)),qe(null),Fe(null)}return!0},Xs=P?.index;if(P!==void 0&&(P?.seq??null)!==Ye&&(ve(P?.seq??null),typeof Xs=="number"&&ca(Xs,0)),ts!==na){sa(ts);const t=N.current!==null||ye.current.size>0||vt.current!==null||gt.current!==null||B.isPending||fn.isPending||I.length>0,n=m!==null&&Jr(me.current,document.activeElement);if(!t&&n&&(tn.current=!0),!t&&!n&&m!==null){const s=K[m],o=ce[m];if(T([]),$(a=>a+1),!s||!o)L(null),A(null),W(null);else if(o.isMultivariate)xt(s,o,De,m);else{const a=wt(s,o,d,g);A(a?.data??null),W(a?.resolveType??null)}}!t&&je&&(dn(null),An(void 0),Yt(s=>s+1))}if(Os!==Zo){Xo(Os);const t=m!==null?K[m]:null,n=m!==null?ce[m]:null;if(t&&n&&m!==null)if(T([]),$(s=>s+1),n.isMultivariate)xt(t,n,De,m);else{const s=wt(t,n,d,g);A(s?.data??null),W(s?.resolveType??null)}}const ut=I[0];if(ut){const{formBase:t,target:n}=ut,s=Bo(d,n,g),o=t.sectionIndex,a=s.rawSections.length===t.sectionCount?bs(s.rawSections[o],s.parsedSections[o],n.sectionVariantIndex,d,g):null,i=fi(ut,a,l=>Yr(t,l));if(i){const f=[{...ut,...i,changedAgain:!0},...I.slice(1)];ct.current=f,ke(f)}}const gn={orgSlug:v,virtualMcpId:e,branch:p,threadId:G,previewUrl:g?void 0:x??void 0,siteSlug:Pe},Fn=Qe&&u?Gn(Qe,u):null,dt=(t,n)=>{if(!y)return;N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear(),vt.current&&(clearTimeout(vt.current),vt.current=null),gt.current&&(clearTimeout(gt.current),gt.current=null);const s=ln(d,y,t,te,pe);B.mutate({blockKey:y,data:s},{onSuccess:()=>n?.onSuccess?.()??k?.(),onError:o=>{n?.onError?.(),B.reportError(o)}})},Wt=()=>{Ce?.(null),L(null),Tn(!1),A(null),W(null),lt(0),Fe(null),qe(null),T([]),$(t=>t+1)},er=()=>Jr(me.current,document.activeElement),us=(t=c("sectionsEditor.sectionsEditor.blockChangedElsewhere"))=>{if(N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear(),_t.current=null,H.error(t,{id:Po}),er()){tn.current=!0;return}zs(n=>n+1)},tr=()=>{!tn.current||er()||ct.current.length>0||N.current!==null||pn.current||hn.current||ye.current.size>0||(tn.current=!1,zs(t=>t+1))},nr=()=>{tn.current&&setTimeout(tr,0)},sr=de.kind==="protocol"&&de.source==="github",rr=t=>El(Nn,Cn,t,de.kind==="protocol"?de:null),or=t=>{ye.current.size!==0&&setTimeout(()=>{if(pn.current||hn.current)return;const n=[...ye.current.values()];ye.current.clear();for(const s of n)s()},t)},ua=t=>{const{activePageKey:n,variantIndex:s,sectionVariantIndex:o}=re.current,a=zt.current;return{formBase:a?.sectionIndex===t&&a.variantIndex===o?a:null,pageKey:n,global:q,pageVariantIndex:s,sectionVariantIndex:o,schema:Fn}},vn=t=>{ct.current=t,ke(t)},da=t=>{const n=ct.current,s=n.findIndex(i=>i.formBase===t.formBase),o=s>=0?n[s]:void 0,a=o?n.with(s,{...t,choices:no(o.plan,o.choices,t.plan),fresh:Ii(o.plan,t.plan,o.fresh),changedAgain:o.changedAgain||Hn(o.plan.theirs)!==Hn(t.plan.theirs)}):[...n,{...t,changedAgain:es.current.has(t.formBase)}];vn(a)},ar=(t,n)=>{const s=ct.current,o=s.findIndex(l=>l.formBase===t),a=s[o];if(!a)return!1;if(Hn(a.plan.mine)===Hn(n))return!0;const i=to({...a.plan,mine:n});if(i.pointers.length===0){const l=s.filter(f=>f!==a);return vn(l),!1}return vn(s.with(o,{...a,plan:i,choices:no(a.plan,a.choices,i)})),!0},fa=t=>{const n=re.current;return n.selectedSectionIndex===t.formBase.sectionIndex&&n.activePageKey===t.target.pageKey&&n.variantIndex===t.target.pageVariantIndex&&n.sectionVariantIndex===t.target.sectionVariantIndex},ma=()=>{const t=ct.current[0];if(!t)return null;const{formBase:n,target:s}=t;N.current&&_t.current?.sectionIndex===n.sectionIndex&&_t.current.sectionVariantIndex===s.sectionVariantIndex&&(clearTimeout(N.current),N.current=null,_t.current=null),ye.current.delete(`${s.pageKey}:${n.sectionIndex}:${s.sectionVariantIndex}`);const o=n.emitted;return o&&typeof o=="object"&&!ar(n,o)&&yn(o,n.sectionIndex,0,s),ct.current[0]??null},pa=()=>{const t=ct.current[0],n=ma();if(!n||!t||n.formBase!==t.formBase||n.plan.pointers.some(i=>!t.plan.pointers.includes(i)))return;const s=ji(n.plan,n.choices);de.kind==="protocol"&&de.source==="github"&&Ri(n.plan,n.choices)&&kl(c,!1),vn(ct.current.slice(1));const{formBase:o,target:a}=n;o.base=n.plan.theirs,o.version=void 0,o.emitted=s,es.current.add(o),(zt.current===o||fa(n))&&(zt.current=o,A(s),$(i=>i+1)),yn(s,o.sectionIndex,0,a)},ha=t=>{const[n,...s]=ct.current;n&&vn([{...n,choices:t},...s])},yn=(t,n,s=0,o,a=!1)=>{const i=o??ua(n),l=i.sectionVariantIndex,f=i.formBase,R=a||eo(ct.current,f,i,n,g).runNow,h=_t.current;N.current&&(clearTimeout(N.current),N.current=null,h&&(h.sectionIndex!==n||h.sectionVariantIndex!==l)&&h.write());const j=`${i.pageKey}:${n}:${l}`,E=()=>{if(pn.current||hn.current){ye.current.set(j,E);return}const M=typeof t=="function"?t():t,z=eo(ct.current,f,i,n,g).base;if(z&&ar(z,M))return;const ne=re.current.decofile,{rawSections:J,parsedSections:Ne,pageVariants:Q,variantIndex:be}=Bo(ne,i,g),Ie=i.pageKey,he=J[n];if(!he)return;const ue=Ne[n];if(!ue)return;const Ge=f?.base,Ze=bs(he,ue,l,ne,g),Nt=!!Ge&&!!Ze&&Ni(Ge,Ze)&&!(f&&Yr(f,Ze));if(Nt&&Ge&&Ze){if(Ci(Ge,Ze)){us(c("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}const U=ue.isSavedBlock?"here":Pi(Ge,J.map((ae,mt)=>bs(ae,Ne[mt],l,ne,g)),n,f?.sectionCount??J.length);if(U==="unknown"){us(c("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}if(typeof U=="number"&&f){f.sectionCount=J.length,f.sectionIndex=U,zt.current===f&&L(U),yn(M,U,s,i);return}}const Ct=Nt&&Ge&&Ze?to({ancestor:Ge,mine:M,theirs:Ze}):null;if(Ct&&Ct.pointers.length>0&&f){f.sectionCount=J.length,da({plan:Ct,formBase:f,target:i,sectionIndex:n,choices:Bi(Ct),changedAgain:!1,blockKey:ue.isSavedBlock?_s(he,ue):Ie,fresh:{}});return}const Pt=Ct?Ct.merged:null,rn=Pt??M,qr=Ki({merged:!!Pt,tracked:f,current:zt.current,saved:M});Pt&&H.info(c("sectionsEditor.sectionsEditor.blockMergedWithOthers"),{id:Po}),qr&&f&&(f.emitted=Pt,A(Pt));const Ss=qr||!Pt?rn:M;f&&(f.base=Ss,f.sectionCount=J.length,Mi(f,Ss));const Gr={onSuccess:()=>{f&&es.current.delete(f),k?.()},onError:U=>{if(f?.base===Ss&&Ge&&(f.base=Ge),U instanceof Rl){if(f&&(f.version=void 0),s<Dc){ye.current.delete(j),hn.current=!0;const ae=Li(s,U.carriedStored);setTimeout(()=>{hn.current=!1,yn(()=>{const mt=f?.emitted;return mt&&typeof mt=="object"?mt:M},n,s+1,i,ae.immediate),ye.current.delete(j),or(xn(g))},ae.delay)}else us();return}B.reportError(U)}},Ur=U=>{pn.current=!0;let ae=!1;B.mutateAsync(U).then(()=>Gr.onSuccess(),mt=>{ae=!0,Gr.onError(mt)}).finally(()=>{pn.current=!1,or(ae?xn(g):0),tr()})};if(ue.isSavedBlock){const U=_s(he,ue);if(!U)return;Ur({blockKey:U,data:rn,...Ge?{base:{value:Di({startedFrom:Ge,stored:Ze,rebased:!!Pt,refused:s>0})}}:{},rebaseOnConflict:!1,guard:so({formBase:f,rebased:!!Pt,versionOf:rr,productionVersionOf:ae=>oo(Nn,Cn,ae),...sr?{copy:{value:ne[U]}}:{}})});return}if(!Ie)return;const Wn={...ne[Ie]},Gt=[...J];if(ue.isMultivariate){const U=pt(he,ue);if(!U||!Ie)return;const ae=Fi(U,l,rn);Gt[n]=Bt(he,ue,ae)}else if(ue.isHidden){const U=Cs(he.__resolveType),ae=U?{...he.section}:{...he},mt=Array.isArray(ae.variants)?[...ae.variants]:[];mt[0]&&(mt[0]=ro(ae.__resolveType,mt[0],rn)),ae.variants=mt,U?Gt[n]={...he,section:ae}:Gt[n]=ae}else ue.isLazy?Gt[n]={...he,section:rn}:Gt[n]=rn;if(Q.length>1){const U=Wn.sections,ae=[...U?.variants??[]];ae[be]&&(ae[be]=ro(U?.__resolveType,ae[be],Gt)),Wn.sections={...U,variants:ae}}else Wn.sections=Gt;Ur({blockKey:Ie,data:Wn,rebaseOnConflict:!1,guard:so({formBase:null,rebased:!1,versionOf:rr,productionVersionOf:U=>oo(Nn,Cn,U),...sr?{copy:{value:ne[Ie]}}:{}})})};if(_t.current={sectionIndex:n,sectionVariantIndex:l,write:E},R){_t.current=null,E();return}N.current=setTimeout(()=>{N.current=null,E()},xn(g))},ga=t=>{tn.current=!1,L(t),lt(0),T([]),$(a=>a+1);const n=K[t],s=ce[t];if(Ce?.(s?.isSavedBlock?s.resolveType??null:null),!n||!s)return;if(s.isMultivariate){xt(n,s,0,t);return}const o=wt(n,s,d,g);if(!o){A(null),W(null),qe(null),Fe(null),$t(null,t,0);return}A(o.data),W(o.resolveType),qe(null),Fe(null),$t(null,t,0)},ir=t=>{const n=t;m!==null&&(zt.current=Ei(zt.current,{sectionIndex:m,variantIndex:re.current.sectionVariantIndex,shown:Xe,next:n,sectionCount:re.current.rawSections.length})),A(n),m!==null&&yn(n,m)},ds=t=>{if(!y||!d||!u||!oe)return;const n={kind:"page",pageKey:y,pageName:String(oe.name??""),path:String(oe.path??"")},s=Eo(d,n,u);s&&fn.save(y,()=>{const o=Nn.getQueryData(Ti.decofile(Cn))?.[y];if(!o||typeof o!="object"||o===null||Array.isArray(o))return null;const a={...o,...Bn.current};return Bn.current={},t?.raw!==void 0?uc(a,t.raw,u):t?.inner!==void 0?dc(n,s,a,t.inner):a})},lr=(t,n)=>{y&&(Bn.current[t]=n,ds())},va=(t,n)=>{if(!y)return;const s=Yn([...K],t,n);m!==null&&(m===t?L(n):t<m&&n>=m?L(m-1):t>m&&n<=m&&L(m+1)),dt(s)},ya=t=>{if(!y)return;const n=K.filter((s,o)=>o!==t);m===t?Wt():m!==null&&m>t&&L(m-1),dt(n)},Sa=t=>{if(!y)return;const n=K[t];if(!n)return;const s=[...K];s.splice(t+1,0,hl(n)),m!==null&&m>t&&L(m+1),dt(s)},ba=t=>{if(!y)return;const n=K[t],s=ce[t];if(!n||!s)return;const o=s.isHidden?_i(n,g):ki(n,u);if(!o)return;const a=[...K];a[t]=o,m===t&&Wt(),dt(a)},xa=t=>{if(!y)return;const n=K[t],s=ce[t];if(!n||!s||s.isMultivariate)return;const o=xi(n);if(!o)return;const a=[...K];a[t]=o,m===t&&Wt(),dt(a)},_a=t=>{if(!y)return;const n=K[t],s=ce[t];if(!n||!s?.isSavedBlock)return;const o=wt(n,s,d,g);if(!o?.data)return;const{name:a,...i}=o.data,l=[...K];s.isLazy?l[t]={...n,section:i}:l[t]=i,m===t&&Wt(),dt(l)},ka=t=>{if(!y)return;const n=Hi(ce),s=[...K.slice(0,n),{__resolveType:t.resolveType},...K.slice(n)];dt(s,{onError:()=>{re.current.selectedSectionIndex===n&&Wt()}}),He(!1),L(n),lt(0),T([]),$(l=>l+1);const o=s[n],a=kn(s,d,g)[n];if(!o||!a)return;if(a.isMultivariate){xt(o,a,0);return}const i=wt(o,a,d,g);if(!i){A(null),W(null),qe(null),Fe(null);return}A(i.data),W(i.resolveType),qe(null),Fe(null)},cr=t=>{Rn.current=t.append,He(!0)},wa=t=>{const n=Rn.current;if(!n){ka(t);return}n({__resolveType:t.resolveType}),He(!1),Rn.current=null},ur=t=>{if(m===null)return;const n=K[m],s=ce[m];!n||!s?.isMultivariate||(lt(t),T([]),$(o=>o+1),xt(n,s,t,m,!0))},ja=t=>{if(m===null||!y)return;const n=K[m],s=ce[m];if(!n||!s?.isMultivariate)return;const o=pt(n,s);if(!o)return;const a=Si(o,t);if(!a){H.error(c("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const i=[...K];i[m]=Bt(n,s,a);const l=a.variants;let f=De;t===De?f=Math.min(t,l.length-1):t<De&&(f=De-1),lt(f),T([]),$(R=>R+1),xt(i[m],s,f),dt(i)},Ra=t=>{if(m===null||!y)return;const n=K[m],s=ce[m];if(!n||!s?.isMultivariate)return;const o=pt(n,s);if(!o)return;const a=bi(o,t,g),i=[...K];i[m]=Bt(n,s,a);const l=Xr(o.variants??[],t,g);lt(l),T([]),$(f=>f+1),xt(i[m],s,l,m,g),dt(i)},Ea=(t,n)=>{if(m===null||!y||t===n)return;const s=K[m],o=ce[m];if(!s||!o?.isMultivariate)return;const a=pt(s,o);if(!a)return;const i=vi(a,t,n),l=[...K];l[m]=Bt(s,o,i);let f=De;De===t?f=n:t<De&&n>=De?f=De-1:t>De&&n<=De&&(f=De+1),lt(f),xt(l[m],o,f,m,g),dt(l)},Sn=t=>{const n=t??m;if(n===null||!y)return;const s=K[n],o=ce[n];if(!s||!o)return;const a=gi(s,o,void 0,u,g);if(!a){H.error(c("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const i=[...K];i[n]=a.section;const l=kn(i,d,g)[n];if(!l?.isMultivariate){H.error(c("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}L(n),lt(a.newVariantIndex),T([]),$(f=>f+1),xt(a.section,l,a.newVariantIndex,n,g),dt(i)},dr=()=>{if(m===null||!y)return;const t=K[m],n=ce[m];if(!t||!n?.isMultivariate)return;const s=pt(t,n);if(!s)return;const o=yi(t,n,s);if(!o){H.error(c("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const a=[...K];a[m]=o;const i=kn(a,d,g)[m];if(!i)return;lt(0),qe(null),Fe(null),T([]),$(f=>f+1);const l=wt(o,i,d,g);l?(A(l.data),W(l.resolveType)):(A(null),W(null)),$t(null,m,0),dt(a)},Va=async t=>{if(ie===null||!y)return;const n=Qn(t,d,u);if(n){H.error(n);return}const s=K[ie],o=ce[ie];if(!s||!o)return;const a=wt(s,o,d,g);if(!a){H.error(c("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const i={...a.data,name:t};try{const l=await B.mutateAsync({blockKey:t,data:i,create:!0}),f=[...K];f[ie]={__resolveType:t},await B.mutateAsync({blockKey:y,data:ln(d,y,f,te,pe)}),m===ie&&Wt(),Ve(null),Un(l)||H.success(c("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),k?.()}catch(l){H.error(c("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"),{description:Kt(c,Mt(l))})}},fr=Se?.rule;if(yt&&m===null&&Y===null&&fr){const{resolveType:t,formValue:n}=Ut(fr,d??{},u??void 0);ee(t),se(n)}const sn=u?al(u):[],fs=u&&d?il(u,d):[],Ht=g&&u&&d?fc(u,d):[],ms=(t,n)=>{if(Ht.length===0)return;const s=Nl(t);return{kinds:Ht,selected:s,campaignPrefill:mc(t),onPick:n,load:Gs}},mr=!q&&!!(ot&&u&&d),pr=Y&&u?Gn(Y,u):null,St=()=>{gt.current&&(clearTimeout(gt.current),gt.current=null),vt.current&&(clearTimeout(vt.current),vt.current=null)},qt=async(t,n)=>{if(Sc(n,t,u,g))try{await Pn.mutateAsync({blockKey:t})}catch(s){H.error(c("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"),{description:Kt(c,Mt(s))})}},hr=t=>{gt.current&&clearTimeout(gt.current),gt.current=setTimeout(()=>{const{activePageKey:n,decofile:s,variantIndex:o}=re.current;if(!n)return;const a={...s[n]},i={...a.sections},l=[...i.variants??[]],f=l[o],R=f?.rule;if(Jt(R,s,u)){const h=R?.__resolveType??"",j=s[h],E=typeof j?.name=="string"?j.name:h,{__resolveType:M,...z}=t;B.mutate({blockKey:h,data:Ft(M??"",z,E)},{onSuccess:()=>k?.(),onError:B.reportError});return}f&&(l[o]={...f,rule:t}),a.sections={...i,variants:l},B.mutate({blockKey:n,data:a},{onSuccess:()=>k?.(),onError:B.reportError})},xn(g))},gr=t=>{ee(t);const n=t?Ao(t,u):{__resolveType:Zr(u)};se(t?n:{}),hr(n)},vr=t=>{const n=t;se(n);const s=Y?{__resolveType:Y,...n}:{...n};hr(s)},In=async(t,n,s)=>{const o=pc(n,t);if(!o.ok)return o.reason==="conflict"&&H.info(t.kind==="experiments"?c("sectionsEditor.namedRulePicker.conflictTests"):c("sectionsEditor.namedRulePicker.conflictCampaigns"),xo),null;const a={};if(s){const i=s(o.rule);if(!i)return null;a[i.blockKey]=i.data}return o.blockWrite&&(a[o.blockWrite.blockKey]=o.blockWrite.block),Object.keys(a).length>0&&!(await Ls.apply({writes:a})).ok?null:(o.blockWrite&&H.success(t.kind==="experiments"?c("sectionsEditor.namedRulePicker.createdTest",{name:t.name.trim()}):c("sectionsEditor.namedRulePicker.createdCampaign",{name:t.name.trim()}),{...xo,description:c("sectionsEditor.namedRulePicker.createdHint")}),{rule:o.rule,projected:{...n,...a}})},yr=Ht.length>0?{kinds:Ht,load:Gs,prepare:async t=>(await In(t,re.current.decofile,void 0))?.rule??null,ensureBlock:async t=>{const n=Cl(re.current.decofile,t);return n.kind==="saved"?!0:n.kind==="conflict"?!1:(await Ls.apply({writes:{[Pl(t).blockKey]:n.block}})).ok}}:null,Sr=async t=>{St();const{activePageKey:n,decofile:s,variantIndex:o}=re.current;if(!n)return;const a=await In(t,s,f=>{const R=s[n],h=R?.sections;if(!h||typeof h!="object"||Array.isArray(h))return null;const j=h;if(!Array.isArray(j.variants))return null;const E=[...j.variants],M=E[o];return M?(E[o]={...M,rule:f},{blockKey:n,data:{...R,sections:{...j,variants:E}}}):null});if(!a)return;const{resolveType:i,formValue:l}=Ut(a.rule,a.projected,u??void 0);ee(i),se(l),k?.()},br=async t=>{St();const{activePageKey:n,decofile:s,variantIndex:o}=re.current;if(!n)return;const a=s[n],i=a?.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const l=i;if(!Array.isArray(l.variants))return;const f=[...l.variants],R=f[o];if(!R)return;const h=Dt(R.rule,s,u),j=cn(t);f[o]={...R,rule:j};const E={...s,[n]:{...a,sections:{...l,variants:f}}},{resolveType:M,formValue:z}=Ut(j,E,u??void 0);ee(M),se(z);try{await B.mutateAsync({blockKey:n,data:E[n]}),h&&h!==t&&await qt(h,E),k?.()}catch(ne){H.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Kt(c,Mt(ne))})}},xr=t=>{vt.current&&clearTimeout(vt.current);const{selectedSectionIndex:n,sectionVariantIndex:s}=re.current;n!==null&&(vt.current=setTimeout(()=>{const{rawSections:o,parsedSections:a,decofile:i,activePageKey:l,pageVariants:f,variantIndex:R}=re.current;if(!l)return;const h=o[n],j=a[n];if(!h||!j?.isMultivariate)return;const E=pt(h,j);if(!E)return;const z=(E.variants??[])[s]?.rule;if(Jt(z,i,u)){const Q=z?.__resolveType??"",be=i[Q],Ie=typeof be?.name=="string"?be.name:Q,{__resolveType:he,...ue}=t;B.mutate({blockKey:Q,data:Ft(he??"",ue,Ie)},{onSuccess:()=>k?.(),onError:B.reportError});return}const ne=xs(E,s,t),J=[...o];J[n]=Bt(h,j,ne);const Ne=ln(i,l,J,R,f);B.mutate({blockKey:l,data:Ne},{onSuccess:()=>k?.(),onError:B.reportError})},xn(g)))},Ta=t=>{qe(t);const n=t?Ao(t,u):{__resolveType:Zr(u)};Fe(t?n:{}),xr(n)},Aa=t=>{const n=t;Fe(n);const s=Zt?{__resolveType:Zt,...n}:{...n};xr(s)},Na=async t=>{St();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:o,parsedSections:a,decofile:i,activePageKey:l,pageVariants:f,variantIndex:R}=re.current;if(n===null||!l)return;const h=await In(t,i,M=>{const z=o[n],ne=a[n];if(!z||!ne?.isMultivariate)return null;const J=pt(z,ne);if(!J)return null;const Ne=[...o];return Ne[n]=Bt(z,ne,xs(J,s,M)),{blockKey:l,data:ln(i,l,Ne,R,f)}});if(!h)return;const{resolveType:j,formValue:E}=Ut(h.rule,h.projected,u??void 0);qe(j),Fe(E),k?.()},Ca=async t=>{St();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:o,parsedSections:a,decofile:i,activePageKey:l,pageVariants:f,variantIndex:R}=re.current;if(n===null||!l)return;const h=o[n],j=a[n];if(!h||!j?.isMultivariate)return;const E=pt(h,j);if(!E)return;const M=E.variants??[],z=Dt(M[s]?.rule,i,u),ne=cn(t),J=xs(E,s,ne),Ne=[...o];Ne[n]=Bt(h,j,J);const Q=ln(i,l,Ne,R,f),be={...i,[l]:Q},{resolveType:Ie,formValue:he}=Ut(ne,be,u??void 0);qe(Ie),Fe(he);try{await B.mutateAsync({blockKey:l,data:Q}),z&&z!==t&&await qt(z,be),k?.()}catch(ue){H.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Kt(c,Mt(ue))})}};if(!q&&!oe)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.noPageFound",{currentPath:V})});if(q&&!rs)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.globalBlockNotFound")});const Re=m!==null?ce[m]??null:null,_r=m!==null?K[m]:null,kr=_r&&Re?.isMultivariate?pt(_r,Re):null,Vt=kr?Qr(kr,we,g):[],Ln=Math.min(De,Math.max(Vt.length-1,0)),kt=Vt[Ln]??null,Tt=Re?.isMultivariate===!0,ps=m!==null&&Re!==null,At=ps&&(Tt||!!(Fn&&Xe)),Pa=At&&!q&&Re?.isSavedBlock===!0,ft=q||Pa,wr=q?Us:Re?.label??"",Ba=Zt&&u?Gn(Zt,u):null,jr=(t,n)=>n&&X?`${t} · ${n}`:t,Rr=Re?Re.variantOf??Re.label:"",Ka=(()=>{const t=Tt&&kt?kt.label:null;return t?X?[jr(Rr,t)]:[Re.label,t]:[Re?.label??""]})(),hs=jr(oe?.name??"",yt?Se?.label:null),On=At&&(!q||D.length>0)?q?[Us,...D]:[hs,...Ka,...D]:[],Er=je&&oe?[oe.name,"SEO",...Ms]:[],Vr=c("sectionsEditor.pageVariantTabs.variantsLabel"),Tr=Qt&&oe?[oe.name,Vr]:Lt&&oe&&Re?[hs,Rr,Vr]:[],zn=Tr.length>0?Tr:Er.length>0?Er:ft?On.length>0?On:[wr]:On.length>0?On:[hs],Ar=ps&&!Tt&&!Re?.isHidden&&!!y,Ma=ft||!q&&yt&&!!Se||Ar,Da=ps&&!Tt&&!q&&D.length===0&&!!Re&&Mo(Re)&&!!y,Fa=X&&At&&!Lt&&Tt&&D.length===0&&!!kt,Nr=X&&D.length>0?co(D[D.length-1]):null,Ia=D.length>1?co(D[D.length-2]):null,Cr=ft?wr:At?Re?.label??"":oe?.name??"",La=Qt||Lt?c("sectionsEditor.pageVariantTabs.variantsLabel"):je?c("sectionsEditor.panelSections.seo"):Nr??Cr,Pr=Lt?Re?.variantOf??Re?.label??"":Qt||je?oe?.name??"":Nr?Ia??Cr:ft?c("sectionsEditor.sectionsEditor.globalSectionSubtitle"):At?oe?.name??"":oe?.path??"",gs=!Qt&&!Lt&&!je&&!At&&!ft,Oa=!X&&!je&&!q&&Tt&&D.length===0,bn=()=>{if(!y)return;St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const t=d[y],n=vc(t.sections,K,u,g);if(!n)return;const{sections:s,newVariantIndex:o}=n;B.mutate({blockKey:y,data:{...t,sections:s}},{onSuccess:()=>{fe(o),L(null),A(null),W(null),T([]),se(null),ee(null)},onError:B.reportError})},$n=(t,n,s)=>{if(!y)return;St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const o=d[y],a=o.sections;if(!a||typeof a!="object"||Array.isArray(a))return;const i=a;if(!Array.isArray(i.variants))return;const l=t([...i.variants]);if(!l)return;const f=yc(i,l),R={...d,[y]:{...o,sections:f}};B.mutate({blockKey:y,data:R[y]},{onSuccess:()=>{n?.();const h=typeof s=="string"?[s]:s??[];(async()=>{for(const j of h)await qt(j,R)})()},onError:B.reportError})},Br=(t,n)=>{if(t===n)return;let s=te;te===t?s=n:t<te&&n>=te?s=te-1:t>te&&n<=te&&(s=te+1),fe(s);const o=Yn(pe.map(a=>({rule:a.rule})),t,n);is(o,s),$n(a=>Yn(a,t,n))},Kr=t=>{const n=pe[t]?.rule,s=Dt(n,d??{},u??void 0);$n(o=>o.length<=1?null:(o.splice(t,1),o),()=>{pe.length-1===1?fe(0):t<te?fe(te-1):t===te&&fe(Math.max(0,t-1)),L(null),A(null),W(null),T([]),se(null),ee(null)},s)},za=()=>{const t=pe.map((n,s)=>({variant:n,index:s})).filter(({variant:n})=>!wi(n.rule)).map(({variant:n})=>Dt(n.rule,d??{},u??void 0)).filter(n=>!!n);$n(n=>{const s=Oi({variants:n}),o=n[s];return o?[{...o,rule:zi(u)}]:null},()=>{fe(0),L(null),A(null),W(null),T([]),se(null),ee(null),Vn(!1)},t)},Mr=t=>{let n=t+1;$n(s=>(n=Xr(s,t,g),bc(s,t,g)),()=>{fe(n),L(null),A(null),W(null),T([]),se(null),ee(null)})},$a=async(t,n)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const s=re.current.activePageKey,o=re.current.decofile;if(!s)return;const a=o[s],i=a.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const l=i;if(!Array.isArray(l.variants))return;const f=[...l.variants],R=f[t];if(!R?.rule||typeof R.rule!="object"){H.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const h=R.rule,j=n.trim();en(!0);try{if(!j){if(!Jt(h,o,u)){F(null);return}const Q=h.__resolveType??"";f[t]={...R,rule:Ts(h,o,u)};const be={...o,[s]:{...a,sections:{...l,variants:f}}};await B.mutateAsync({blockKey:s,data:be[s]}),await qt(Q,be),F(null),k?.();return}const E=As(h,o,u);if(!E){H.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(E.blockKey){await B.mutateAsync({blockKey:E.blockKey,data:Ft(E.resolveType,E.data,j)}),F(null),k?.();return}const M=Jn(j),z=Qn(M,o,u);if(z){H.error(z);return}const ne=Ft(E.resolveType,E.data,j);let J=null,Ne=!1;try{const Q=await B.mutateAsync({blockKey:M,data:ne,create:!0});Ne=Un(Q),J=Ne?null:M,f[t]={...R,rule:cn(M)},await B.mutateAsync({blockKey:s,data:{...a,sections:{...l,variants:f}}}),J=null}catch(Q){throw J&&await Pn.mutateAsync({blockKey:J}).catch(()=>{}),Q}F(null),Ne||H.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:j})),k?.()}catch(E){H.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Kt(c,Mt(E))})}finally{en(!1)}},Wa=async(t,n)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{selectedSectionIndex:s,rawSections:o,parsedSections:a,decofile:i,activePageKey:l,pageVariants:f,variantIndex:R}=re.current;if(s===null||!l)return;const h=o[s],j=a[s];if(!h||!j?.isMultivariate)return;const E=pt(h,j);if(!E)return;const M=E.variants??[],z=M[t];if(!z?.rule||typeof z.rule!="object"){H.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const ne=z.rule,J=n.trim();en(!0);const Ne=async Q=>{const be={...E,variants:Q},Ie=[...o];Ie[s]=Bt(h,j,be);const he=ln(i,l,Ie,R,f);return await B.mutateAsync({blockKey:l,data:he}),{...i,[l]:he}};try{if(!J){if(!Jt(ne,i,u)){O(null);return}const Ze=ne.__resolveType??"",Nt=[...M];Nt[t]={...z,rule:Ts(ne,i,u)};const Ct=await Ne(Nt);await qt(Ze,Ct),O(null),k?.();return}const Q=As(ne,i,u);if(!Q){H.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(Q.blockKey){await B.mutateAsync({blockKey:Q.blockKey,data:Ft(Q.resolveType,Q.data,J)}),O(null),k?.();return}const be=Jn(J),Ie=Qn(be,i,u);if(Ie){H.error(Ie);return}const he=Ft(Q.resolveType,Q.data,J);let ue=null,Ge=!1;try{const Ze=await B.mutateAsync({blockKey:be,data:he,create:!0});Ge=Un(Ze),ue=Ge?null:be;const Nt=[...M];Nt[t]={...z,rule:cn(be)},await Ne(Nt),ue=null}catch(Ze){throw ue&&await Pn.mutateAsync({blockKey:ue}).catch(()=>{}),Ze}O(null),Ge||H.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:J})),k?.()}catch(Q){H.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Kt(c,Mt(Q))})}finally{en(!1)}},Dr=async(t,n,s)=>{A(s);try{await B.mutateAsync({blockKey:t,data:s})}catch(o){throw A(a=>a===s?n:a),o}},Ha={rename:async(t,n,s)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{activePageKey:o,decofile:a}=re.current;if(!o)return;const i=Array.isArray(t.variants)?[...t.variants]:[],l=i[n],f=l?.rule&&typeof l.rule=="object"?l.rule:void 0,R=async j=>{const E={...t,variants:j};return await Dr(o,t,E),{...a,[o]:E}},h=Mc(f,s,a,u);if(h.kind!=="noop"){if(h.kind==="error"){H.error(h.reason==="no-matcher-rule"?c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):h.reason==="unreadable-rule"?c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):h.message??c("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}en(!0);try{if(h.kind==="inline"){const M=[...i];M[n]={...l,rule:h.inlinedRule};const z=await R(M);await qt(h.blockKey,z),k?.();return}if(h.kind==="updateBlock"){await B.mutateAsync({blockKey:h.blockKey,data:h.blockData}),k?.();return}let j=null,E=!1;try{const M=await B.mutateAsync({blockKey:h.blockId,data:h.blockData,create:!0});E=Un(M),j=E?null:h.blockId;const z=[...i];z[n]={...l,rule:h.reference},await R(z),j=null}catch(M){throw j&&await Pn.mutateAsync({blockKey:j}).catch(()=>{}),M}E||H.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:s.trim()})),k?.()}catch(j){H.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Kt(c,Mt(j))})}finally{en(!1)}}},selectGlobal:async(t,n,s)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{activePageKey:o,decofile:a}=re.current;if(!o)return;const i=Array.isArray(t.variants)?[...t.variants]:[],l=i[n];if(!l)return;const f=Dt(l.rule,a,u);i[n]={...l,rule:cn(s)};const R={...t,variants:i},h={...a,[o]:R};try{await Dr(o,t,R),f&&f!==s&&await qt(f,h),k?.()}catch(j){H.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Kt(c,Mt(j))})}},selectNamedRule:async(t,n,s)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{activePageKey:o,decofile:a}=re.current;if(!o)return;let i=null;!await In(s,a,f=>{const R=Array.isArray(t.variants)?[...t.variants]:[],h=R[n];return h?(R[n]={...h,rule:f},i={...t,variants:R},{blockKey:o,data:i}):null})||!i||(A(i),k?.())}},Fr=()=>{Wt(),g&&$t(null,-1,0)},Ir=t=>{dn(t),ds({inner:t})},Lr=t=>{An(t),ds({raw:t})},Or=()=>{dn(null),Ot([])},zr=()=>Yt(t=>t+1),$r=()=>{fn.flush(),un(!1),dn(null),An(void 0),Ot([]),Yt(t=>t+1),ge?.()},qa=()=>{Vn(!1),Tn(!1),L(null),un(!0)},Ga=()=>{je&&$r(),L(null),Vn(!0)},Ua=()=>Tn(!0),vs=t=>{if(Qt&&t===0){Vn(!1);return}if(Lt&&t<2){Tn(!1),t===0&&L(null);return}if(je){if(t===0){$r();return}if(t===1){Ot([]),Yt(s=>s+1);return}Ot(Ms.slice(0,t-1)),Yt(s=>s+1);return}if(q){T(D.slice(0,t)),$(s=>s+1);return}if(t===0){Fr();return}if(t===1){T([]),$(s=>s+1);return}const n=!X&&Tt&&kt?1:0;if(n===1&&t===2){T([]),$(s=>s+1);return}T(D.slice(0,t-1-n))},ys=zn.length>1?r.jsx("button",{type:"button",onClick:()=>vs(gl(zn.length,{isMultivariateSectionTop:Oa})),title:c("sectionsEditor.sectionsEditor.back"),"aria-label":c("sectionsEditor.sectionsEditor.back"),className:le("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",ft?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:r.jsx(Ui,{className:"size-4"})}):null,Ja=ft||At||je?Ma&&r.jsxs("div",{className:le("border-b px-3 py-2.5",ft&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[r.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!q&&yt&&Se&&r.jsxs("button",{type:"button",onClick:Fr,title:c("sectionsEditor.sectionsEditor.editingInVariant",{variant:Se.label}),className:le("shrink-0 inline-flex items-center gap-1 rounded-lg h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",cl),children:[r.jsx(ll,{rule:js(Se.rule,d??{},u??void 0),matchers:sn}),r.jsx("span",{className:"max-w-[160px] truncate",children:Se.label})]}),r.jsx("div",{className:"flex-1"}),ft&&r.jsxs(jt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Zn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(Et,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Ar&&r.jsx(qn,{onClick:()=>Sn()})]}),ft&&r.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:c("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):r.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[r.jsx("div",{className:"flex-1 min-w-0",children:r.jsx(uo,{pageKey:y,initialName:oe.name,initialPath:oe.path,onFieldChange:lr,variant:"header"})}),r.jsxs(jt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:()=>un(!0),children:r.jsx(io,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),r.jsxs(jt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>Le&&y?Le():bt(!0),children:r.jsx(lo,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]}),r.jsx(qn,{onClick:bn})]}),Qa=r.jsxs(r.Fragment,{children:[yt&&y&&r.jsx(fo,{listKey:y,variants:pe,activeIndex:te,decofile:d??{},meta:u,matchers:sn,onSelect:cs,onReorder:Br,onRename:F,onDuplicate:Mr,onDelete:Kr,onAdd:bn}),yt&&Y!==null&&r.jsx(mo,{className:"mt-3",children:r.jsx("div",{className:le("space-y-3",Xt&&"pointer-events-none opacity-50"),children:r.jsx(ks,{currentRt:Y,currentLabel:_n(Se?.rule,d??{},we,u??void 0),currentGlobalKey:Dt(Se?.rule,d??{},u??void 0)??void 0,matchers:sn,globals:fs,onSelect:gr,onSelectGlobal:br,named:ms(Se?.rule,Sr),namedRow:ws(Se?.rule,Ht),rule:Se?.rule,schema:pr,formValue:Ke,onChange:vr,formKey:`${te}:${Y??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:d,onSaveReferencedBlock:mn,sandbox:gn})})})]}),Wr=r.jsxs(r.Fragment,{children:[r.jsx(ul,{listKey:`${y??""}:${m??""}`,variants:Vt.map((t,n)=>({index:n,label:t.label})),selectedIndex:Ln,onSelect:ur,onRename:O,onDuplicate:Ra,onDelete:ja,onRemoveAll:dr,onReorder:Ea,onAdd:()=>Sn()}),r.jsx(mo,{children:r.jsx(ks,{currentRt:Zt??"",currentLabel:_n(kt?.rule,d??{},we,u??void 0),currentGlobalKey:Dt(kt?.rule,d??{},u??void 0)??void 0,matchers:sn,globals:fs,onSelect:Ta,onSelectGlobal:Ca,named:ms(kt?.rule,Na),namedRow:ws(kt?.rule,Ht),rule:kt?.rule,schema:Ba,formValue:Ho,onChange:Aa,formKey:`${m??"none"}:${Ln}:${Zt??""}`,formWrapperClassName:"pt-1",meta:u??void 0,decofile:d,onSaveReferencedBlock:mn,sandbox:gn})})]}),Hr=r.jsx("div",{className:le(X?"px-2":"p-2 pt-3"),children:r.jsx(Bc,{listKey:`${y??""}-${te}`,rawSections:K,sections:ce,meta:u,decofile:d,selectedIndex:m,onSelect:t=>{ga(t),Je?.(t)},onReorder:va,onDelete:ya,onDuplicate:Sa,onMakeReusable:Ve,onToggleHidden:ba,onToggleLazy:rt?xa:void 0,onAddVariant:Sn,onDetach:_a,onAddSection:()=>He(!0),canAddSection:mr})}),Ya=r.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[y&&oe&&r.jsx(uo,{pageKey:y,initialName:oe.name,initialPath:oe.path,onFieldChange:lr}),nn&&y?r.jsx(Vo,{rawSeo:Kn,innerSeo:as,defaultResolveType:Qs,seoTypesLoading:g&&!u,seoSchema:Ys,activeResolveType:Mn,seoTypeOptions:Js,formResetKey:Ds,siteDefaultSeo:Zs,onBreadcrumbChange:Ot,onPersistRaw:Lr,onInnerChange:Ir,onClearForm:Or,onBumpFormKey:zr,asyncRenderAvailable:rt}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),Za=r.jsx(an,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:r.jsx("div",{className:"mx-auto max-w-2xl",children:nn&&y?r.jsx(Vo,{rawSeo:Kn,innerSeo:as,defaultResolveType:Qs,seoTypesLoading:g&&!u,seoSchema:Ys,activeResolveType:Mn,seoTypeOptions:Js,formResetKey:Ds,siteDefaultSeo:Zs,onBreadcrumbChange:Ot,onPersistRaw:Lr,onInnerChange:Ir,onClearForm:Or,onBumpFormKey:zr,asyncRenderAvailable:rt}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),Xa=r.jsxs(an,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[yt&&y&&r.jsx(fo,{listKey:y,variants:pe,activeIndex:te,decofile:d??{},meta:u,matchers:sn,onSelect:cs,onReorder:Br,onRename:F,onDuplicate:Mr,onDelete:Kr,onAdd:bn}),yt&&Y!==null&&r.jsxs("div",{className:le("px-3 border-b",En?"pt-3 pb-5 space-y-3":"py-2"),children:[r.jsxs("button",{type:"button",onClick:()=>$o(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-[var(--studio-control-radius,var(--radius-sm))] py-0.5 hover:bg-accent","aria-expanded":En,children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c("sectionsEditor.sectionsEditor.variantRule")}),En?r.jsx(Ji,{className:"size-3.5 shrink-0 text-muted-foreground"}):r.jsx(Gi,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),En&&r.jsx("div",{className:le("space-y-3",Xt&&"pointer-events-none opacity-50"),children:r.jsx(ks,{currentRt:Y,currentLabel:_n(Se?.rule,d??{},we,u??void 0),currentGlobalKey:Dt(Se?.rule,d??{},u??void 0)??void 0,matchers:sn,globals:fs,onSelect:gr,onSelectGlobal:br,named:ms(Se?.rule,Sr),namedRow:ws(Se?.rule,Ht),rule:Se?.rule,schema:pr,formValue:Ke,onChange:vr,formKey:`${te}:${Y??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:d,onSaveReferencedBlock:mn,sandbox:gn})})]}),Hr]},"editor-section-list");return r.jsx(ic,{value:g,children:r.jsx(dl,{children:r.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!X&&ys&&r.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:ys}),(X||zn.length>1)&&r.jsx(Wi,{crumbs:zn,onSelect:vs,onSelectRoot:()=>{fn.flush(),Ue?Ue():vs(0)}}),r.jsx("div",{className:"shrink-0",children:X?r.jsxs("div",{className:le("flex items-center gap-2 border-b px-3 py-2.5",ft&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[X&&ys,ft&&r.jsxs(jt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Zn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(Et,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),r.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[r.jsx("span",{className:"truncate text-sm font-semibold",children:La}),Pr&&r.jsx("span",{className:"truncate text-xs text-muted-foreground",children:Pr})]}),gs&&yt&&Se&&r.jsx(po,{variants:pe,activeIndex:te,onSelect:cs,onManage:Ga,onRemoveAll:za}),Fa&&r.jsx(po,{variants:Vt,activeIndex:Ln,onSelect:ur,onManage:Ua,onRemoveAll:dr}),gs&&!yt&&r.jsx(qn,{onClick:bn}),Da&&r.jsx(qn,{onClick:()=>Sn()}),r.jsx(fl,{}),gs&&r.jsxs(r.Fragment,{children:[r.jsxs(jt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"outline",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:qa,children:r.jsx(io,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),!Le&&r.jsxs(jt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"outline",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>bt(!0),children:r.jsx(lo,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):Ja}),ut&&r.jsx(mi,{open:!0,fields:pi(ut.plan,ut.target.schema),choices:ut.choices,changedAgain:ut.changedAgain,author:Ws??null,authorPending:Ws===void 0,fieldsAsLabeled:$s!==null,fresh:ut.fresh,keepTyping:g,onChoose:(t,n)=>ha({...ut.choices,[t]:n}),onApply:pa},Ic(ut.formBase)),Lt?r.jsx(ho,{onAdd:()=>Sn(),children:Wr},"editor-section-variants"):At?r.jsxs(an,{viewportRef:me,onBlur:nr,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!X&&Tt&&Vt.length>0&&D.length===0&&Wr,r.jsx(To,{value:yr,children:r.jsx(go,{value:q&&g?Be:null,children:r.jsx(vo,{activeSchema:Fn,formValue:Xe,formResetKey:Me,onFormChange:ir,onBreadcrumbChange:T,breadcrumbPath:D,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:u,decofile:d,onSaveReferencedBlock:mn,sandbox:gn,previewBaseUrl:st,onRequestAddSection:cr,onVariantMatcherOp:q?Ha:void 0})})})]},"editor-section-form"):q?r.jsx(an,{viewportRef:me,onBlur:nr,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx(To,{value:yr,children:r.jsx(go,{value:q&&g?Be:null,children:r.jsx(vo,{activeSchema:Fn,formValue:Xe,formResetKey:Me,onFormChange:ir,onBreadcrumbChange:T,breadcrumbPath:D,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:u,decofile:d,onSaveReferencedBlock:mn,sandbox:gn,previewBaseUrl:st,onRequestAddSection:cr})})})},"editor-global-block"):je?X?r.jsx(an,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"p-3",children:Ya})},"editor-seo"):Za:Qt?r.jsx(ho,{onAdd:bn,children:Qa},"editor-variants"):X?r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[r.jsx(an,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"py-2",children:Hr})}),r.jsx("div",{className:"shrink-0 border-t p-2",children:r.jsx(Ns,{canAddSection:mr,onAddSection:()=>He(!0)})})]},"editor-section-list"):Xa,r.jsx(ml,{open:ie!==null,onOpenChange:t=>{t||Ve(null)},defaultBlockId:ie!==null?Jn(ce[ie]?.label??""):"",isPending:B.isPending,onSubmit:Va}),ot&&r.jsx(ec,{open:Ae,onOpenChange:t=>{He(t),t||(Rn.current=null)},meta:u,decofile:d,previewBaseUrl:st,onSelect:wa}),ht&&y&&d&&r.jsx(nc,{open:ht,onOpenChange:bt,pageKey:y,decofile:d}),Te!==null&&r.jsx(yo,{open:!0,initialName:Jt(pe[Te]?.rule,d??{},u??void 0)?_n(pe[Te]?.rule,d??{},we,u??void 0):"",autoLabel:we(js(pe[Te]?.rule,d??{},u??void 0)),isPending:Xt,onSubmit:async t=>{await $a(Te,t)},onOpenChange:t=>{!t&&!Xt&&F(null)}}),tt!==null&&r.jsx(yo,{open:!0,initialName:Jt(Vt[tt]?.rule,d??{},u??void 0)?_n(Vt[tt]?.rule,d??{},we,u??void 0):"",autoLabel:we(js(Vt[tt]?.rule,d??{},u??void 0)),isPending:Xt,onSubmit:async t=>{await Wa(tt,t)},onOpenChange:t=>{!t&&!Xt&&O(null)}})]})})})}export{Of as SectionsEditor};
1
+ import{i8 as ei,bp as ti,c as wn,b as jn,r as b,m as le,j as r,c8 as ni,bm as Cs,i9 as Mo,B as It,Y as on,au as si,_ as ri,bo as oi,Z as ai,q as ii,hF as li,ia as ci,ib as ui,h as di,bq as wt,ic as Jr,id as bs,ie as fi,ig as pt,ih as Qr,ii as mi,fQ as pi,ij as hi,ik as Yr,il as gi,t as H,fu as Zr,im as vi,io as Bt,ip as yi,iq as Si,ir as bi,fi as Xr,is as xs,it as xi,iu as _i,iv as ki,ff as wi,fR as ji,iw as Ri,ix as Ei,ft as Vi,K as Ti,iy as eo,eM as Ai,fJ as Hn,fO as to,iz as no,iA as Ni,iB as Ci,iC as Pi,iD as _s,iE as Bi,iF as Ki,iG as Mi,iH as so,iI as Di,iJ as Fi,fh as ro,iK as Ii,iL as Li,fL as oo,iM as Oi,fd as zi}from"./index-7zGhlT8r.js";import{u as $i}from"./chat-context-BZCgTb_I.js";import{a as Xn,M as ao}from"./save-status-DAxhQuZS.js";import{p as kn,f as Wi,n as Hi}from"./parse-sections-C3LoVE7G.js";import{a as qi}from"./repository-binding-djJO-C6X.js";import{t as Gi}from"./ChevronDown-Cgrp93vj.js";import{d as Do,b as Ui}from"./UserCheck01-D2EW_Elf.js";import{n as Ji}from"./ChevronUp-CY-2sTeM.js";import{b as Zn,e as Qi,P as io,K as lo}from"./agent-icon-lbRSQKRr.js";import{S as an}from"./scroll-area-DbM-AL9l.js";import{c as jt,T as Rt,a as Et}from"./tooltip-BfPZsPnN.js";import{h as Yi,i as Zi,j as Xi,E as el,k as tl,V as nl,l as sl,m as rl,G as ol,s as Jn,v as Qn,p as Fo,n as al,o as il,a as co,q as ll,u as cl,A as qn,P as uo,w as fo,x as mo,y as ks,z as ul,B as dl,D as po,F as fl,J as ho,K as go,L as vo,M as ml,Q as yo,c as pl,T as ln,U as hl,W as gl}from"./held-block-view-BdCI62ev.js";import{j as vl,u as yl,i as Sl,v as bl,aD as xl,U as _l,k as So,aU as bo,a9 as Kt,aa as Mt,aq as kl,aV as wl,aW as jl,aO as xo,at as Rl,aA as El}from"./site-editor-toast-DgVI2k0O.js";import{u as Vl,ao as _o,e as ko,j as Tl,z as Al,y as Gn,ad as Nl,ae as Cl,aj as Pl}from"./blocks-tab-states-eAnMaZy5.js";import{u as Bl}from"./use-delete-block-DjHkDeDL.js";import{b as Kl,u as Ml,k as Un,e as xn}from"./use-never-published-CJ050mxC.js";import{a as Es,e as Io}from"./UserSquare-CMsUnOC-.js";import{c as Dl}from"./Minimize01-DHYXtZEK.js";import{i as wo}from"./Tool01-D-8rHPmt.js";import{s as jo}from"./Eye-C0T4ax0j.js";import{s as Fl}from"./Plus-D0hw0S8O.js";import{s as Il}from"./Trash01-L3G-m7_u.js";import{i as Vs}from"./Zap-C155p2bP.js";import{u as Ll,a as Ro,n as Ol,P as zl,o as $l,C as Wl,D as Hl,c as ql}from"./task-key-Bxtvsh0V.js";import{u as Gl,s as Ul,a as Yn,S as Jl,v as Ql}from"./sortable.esm-DdNzXeUL.js";import{s as Yl,g as Zl,u as Xl,A as ec}from"./use-section-preview-base-DCX8RbPA.js";import{m as tc,P as nc}from"./mustache-D95ItWPR.js";import{r as Eo,u as sc,a as rc,i as oc,f as ac,B as ic}from"./empty-message-DR5P4mUA.js";import{u as lc,a as cc,P as Vo,w as uc,b as dc}from"./seo-editor-BqLHV65p.js";import{v as fc,k as ws,x as To,j as mc,y as pc}from"./named-rule-step-DCPjI8tu.js";import{u as hc}from"./use-apply-named-rule-DGa6vp8G.js";import{o as Jt,f as Ts,y as As,q as Ft,h as cn,u as gc,n as Ut,r as js,m as Dt,k as _n,b as vc,s as Ao,z as yc,A as Sc,B as bc}from"./section-array-field-CkVoRheS.js";import{b as No,a as xc}from"./variant-matcher-override-C7dpNQoG.js";import"./use-panel-navigate-Cgc8QZvG.js";import"./thread-route-C55w1baF.js";import"./use-project-scope-5o2m3916.js";import"./use-view-draft-kind-W96Ds4Zi.js";import"./use-blog-view-Du5CuuHc.js";import"./use-organization-settings-DEI-2Mdu.js";import"./schema-hiyr_sLU.js";import"./task-board-DzRumLNt.js";import"./thread-intent-Bb4U5yQQ.js";import"./use-mcp-client-CnD6rmUP.js";import"./auth-DXP0BI6D.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-ZsYyhYfT.js";import"./session-runtime-C1YpKp6Z.js";import"./use-entitlements-D64xTxJC.js";import"./use-ai-providers-wkmM0nDR.js";import"./use-current-view-BfodK9gG.js";import"./use-in-settings-BXZ1flBO.js";import"./use-decopilot-events-Co2HuPK6.js";import"./Image01-8Cd3kLQA.js";import"./Upload01-BlCadmu3.js";import"./label-6adXwSZa.js";import"./SwitchHorizontal01-B2d4sXSY.js";import"./popover-Cn8F-2id.js";import"./switch-BzXoCpZ5.js";import"./toggle-group-YpdNMPPd.js";import"./active-indicator-CCMhAsc_.js";import"./match-site-slug-config-B47_xZCi.js";import"./use-file-configs-MD9huX3e.js";import"./asset-utils-X6F2xGVM.js";import"./useInfiniteQuery-CRAxl7DP.js";import"./infiniteQueryObserver-CEKfthGG.js";import"./AlertCircle-DkHwL8J1.js";import"./hosted-reconcile-G96-wVBG.js";import"./SearchMd-JJeVcqnt.js";import"./textarea-BG9F8tOD.js";import"./use-copy-D029JLSS.js";import"./ChevronSelectorVertical-BQ5yoEQJ.js";import"./command-CYNVyZbO.js";import"./index-CEjnpfFV.js";import"./Play-BWxPQkCn.js";import"./monaco-editor-B2XLiorm.js";import"./editor-C42px5GX.js";import"./ArrowUp-M0Oty0ad.js";import"./ArrowLeft-DUdD3O1h.js";import"./ArrowRight-C-96aap_.js";import"./BookOpen01-CFfDgspV.js";import"./Globe04-BxdmxA7w.js";import"./CheckCircle-BoW3-tYB.js";import"./TrendUp01-xQ_Lovhx.js";import"./LinkBroken01-wvS8U8Go.js";import"./CreditCard01-DQY5YZS3.js";import"./File02-CqfeuTRH.js";import"./Key01-Cn65SmhA.js";import"./LayoutLeft-g2-0PX2O.js";import"./Minus-B73boC9K.js";import"./Monitor01-DZG9Dy8l.js";import"./Sun-Jpz2VUT7.js";import"./ShoppingBag01-B7Xw3TZM.js";import"./Users01-DwGImjV5.js";import"./XClose-CWYJ8AbV.js";import"./index-BdQq_4o_.js";import"./index-Dpa0nN_7.js";import"./utils-DyMUXWM4.js";import"./calendar-BuJZ_OpN.js";import"./usage-stats-NRcbm3e5.js";import"./utils-CVEq3hMx.js";import"./markdown-CTL4sdx2.js";import"./use-mobile-2AsEzLf2.js";import"./gateway-client-DdE8Hgae.js";import"./form-14ZcPjXe.js";import"./select-B8N58NFv.js";import"./editor-classes-CH0-XTN2.js";import"./combobox-CJZiIB2Z.js";import"./use-sandbox-events-CF8Zmwcz.js";import"./sandbox-url-D3mC8qhT.js";import"./use-blocks-v8-project-CGr__fvY.js";import"./use-voice-input-CIq4Y88-.js";import"./drawer-DEXSNHC1.js";import"./index-BkSYM2mK.js";import"./checkbox-Cd8xyzDb.js";import"./ai-providers-logos-DD3qZ33J.js";import"./openai-compatible-presets-BKGfVqEx.js";import"./sandbox-git-api-BvrXQqNA.js";import"./empty-state-QEbc1xkD.js";import"./search-input-6mfg7ug5.js";import"./tabs-cyjxgUUN.js";import"./use-debounced-value-DZc1zf0Z.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-Dj9jprhR.js";import"./collapsible-BZgS4z1I.js";import"./use-task-board-items-BjJdOASU.js";import"./config-C8wUMmyi.js";import"./task-route-BhRoqmHY.js";import"./project-index-Dth0KuML.js";import"./shell-layout-Duq0Xa8U.js";import"./use-deployment-admin-DiCadhp3.js";import"./admin-fetch-BhTJlAsX.js";import"./use-org-notice-M_I53CvQ.js";import"./integration-icon-DFIVBhS2.js";import"./project-icon-DXEYPK6k.js";import"./use-navigate-to-agent-qbUEQ7kJ.js";import"./new-project-dialog-Cf-zLQZ_.js";import"./repository-picker-BsD4BAF1.js";import"./github-icon-CyiD2Iik.js";import"./collection-search-B817v3tJ.js";import"./new-project-store-bT4UmoJb.js";import"./legacy-admin-welcome-dialog-B_q7kUN3.js";import"./required-auth-layout-B9DPc7yf.js";import"./use-org-sso-D7bMsLHv.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-C6Co8dzn.js";import"./types-WxQSc-9D.js";import"./omit-server-managed-metadata-L5IhjRZB.js";import"./sheet-BiTxH0Dd.js";import"./use-connection-BkSWGbNf.js";import"./use-mcp-prompts-CJDEOIrf.js";import"./use-thread-outputs-D_ZJGfwp.js";import"./file-type-icon-DuPf-PNe.js";import"./slider-BISXtABo.js";import"./index-DO569FOD.js";import"./tooltipContext-B2N57NJF.js";import"./CategoricalChart-BYqeYqCM.js";import"./index-Cg0U1XrX.js";import"./use-move-blocks-D1ddI4qu.js";const _c={escape:Yi};function kc(v,e){for(const p of Yl(v,e)){const S=typeof p.title=="string"?p.title:void 0;if(S?.includes("{{"))return S}}function wc(v,e){if(!e)return;const p=ei(v,ti(e));if(p)try{const S=kc(p.resolveType,e);return S&&tc.render(S,p.data,{},_c).trim()||void 0}catch{return}}function jc(v){const e=wn.c(13),{icon:p,label:S,className:x}=v;let V;e[0]!==x?(V=le("size-3.5",x),e[0]=x,e[1]=V):V=e[1];let C;e[2]!==p||e[3]!==V?(C=r.jsx(p,{className:V}),e[2]=p,e[3]=V,e[4]=C):C=e[4];let _;e[5]!==S||e[6]!==C?(_=r.jsx(Rt,{asChild:!0,children:r.jsx("span",{role:"img","aria-label":S,className:"shrink-0 cursor-help",children:C})}),e[5]=S,e[6]=C,e[7]=_):_=e[7];let P;e[8]!==S?(P=r.jsx(Et,{className:"max-w-56",children:S}),e[8]=S,e[9]=P):P=e[9];let k;return e[10]!==_||e[11]!==P?(k=r.jsxs(jt,{children:[_,P]}),e[10]=_,e[11]=P,e[12]=k):k=e[12],k}const Rc="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function Co(v){return Array.from({length:v},(e,p)=>({id:crypto.randomUUID(),index:p}))}function Lo(v){return v.map((e,p)=>({...e,index:p}))}function Ec(v,e){if(e===v.length)return v;if(e<v.length)return Lo(v.slice(0,e));const p=Array.from({length:e-v.length},(S,x)=>({id:crypto.randomUUID(),index:v.length+x}));return[...v,...p]}function Oo(v){const e=wn.c(44),{section:p,raw:S,meta:x,decofile:V}=v,C=jn(),_=Xn(),P=p.isSavedBlock===!0,k=p.isMultivariate===!0;let Z;e[0]!==x||e[1]!==S?(Z=S&&x?Zl(S,x):void 0,e[0]=x,e[1]=S,e[2]=Z):Z=e[2];const ge=Z;let Ue;e[3]!==x||e[4]!==k||e[5]!==S||e[6]!==P?(Ue=S&&x&&!P&&!k?wc(S,x):void 0,e[3]=x,e[4]=k,e[5]=S,e[6]=P,e[7]=Ue):Ue=e[7];const Le=Ue;let Ce;e[8]!==V||e[9]!==x||e[10]!==S||e[11]!==p?(Ce=sl(S,p,V,x),e[8]=V,e[9]=x,e[10]=S,e[11]=p,e[12]=Ce):Ce=e[12];const Je=Ce;let w;e[13]!==k||e[14]!==S?.__resolveType?(w=!k&&Cs(S?.__resolveType??""),e[13]=k,e[14]=S?.__resolveType,e[15]=w):w=e[15];const c=w,xe=P?Zn:k?Do:Io;let G;e[16]!==k||e[17]!==P?(G=P?{color:oi}:k?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=k,e[17]=P,e[18]=G):G=e[18];const _e=G;let I;e[19]!==xe||e[20]!==_?(I=_?r.jsxs("span",{className:"relative size-4 shrink-0",children:[r.jsx(xe,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),r.jsx(ol,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):r.jsx(Dl,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=xe,e[20]=_,e[21]=I):I=e[21];let ke;e[22]!==ge?(ke=ge&&r.jsx("img",{src:ge,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=ge,e[23]=ke):ke=e[23];let d;e[24]!==_||e[25]!==_e?(d=!_&&r.jsx(Es,{className:"h-4 w-4 shrink-0",style:_e}),e[24]=_,e[25]=_e,e[26]=d):d=e[26];const Oe=_?"shrink":"flex-1",u=p.isHidden&&"line-through opacity-50";let Ee;e[27]!==u||e[28]!==Oe?(Ee=le("min-w-0 truncate text-sm font-medium",Oe,u),e[27]=u,e[28]=Oe,e[29]=Ee):Ee=e[29];const X=Le??p.label;let ze;e[30]!==Ee||e[31]!==X?(ze=r.jsx("span",{className:Ee,children:X}),e[30]=Ee,e[31]=X,e[32]=ze):ze=e[32];let nt;e[33]!==c||e[34]!==_||e[35]!==Je||e[36]!==C?(nt=_?r.jsxs(r.Fragment,{children:[c&&r.jsx(jc,{icon:Vs,label:C("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),Je&&r.jsx(ao,{}),r.jsx("span",{className:"min-w-0 flex-1"})]}):Je&&r.jsx(ao,{className:"absolute -right-0.5 -top-0.5"}),e[33]=c,e[34]=_,e[35]=Je,e[36]=C,e[37]=nt):nt=e[37];let Pe;return e[38]!==ze||e[39]!==nt||e[40]!==I||e[41]!==ke||e[42]!==d?(Pe=r.jsxs(r.Fragment,{children:[I,ke,d,ze,nt]}),e[38]=ze,e[39]=nt,e[40]=I,e[41]=ke,e[42]=d,e[43]=Pe):Pe=e[43],Pe}const Vc="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Tc="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]";function zo(v,e,p){if(p)return rl({selected:e});const S=v.isSavedBlock===!0,x=v.isMultivariate===!0;return le("group relative flex select-none items-center gap-2 rounded-[var(--studio-control-radius,var(--radius-md))] px-2 py-2.5",e?"bg-accent text-accent-foreground":S?Vc:x?Tc:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Rs(v,e){return le("h-7 shrink-0 overflow-hidden",e?"w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]":v?"w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100":"w-0 -ml-2 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:ml-0 group-hover:w-7 group-hover:opacity-100 group-hover:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms] group-has-[:focus-visible]:ml-0 group-has-[:focus-visible]:w-7 group-has-[:focus-visible]:opacity-100 group-has-[:focus-visible]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]")}function Ac(v){const e=wn.c(90),{section:p,raw:S,meta:x,decofile:V,sortableId:C,selected:_,onSelect:P,onDelete:k,onDuplicate:Z,onMakeReusable:ge,onToggleHidden:Ue,onToggleLazy:Le,onAddVariant:Ce,onDetach:Je}=v,w=jn(),c=Xn(),xe=S?Cs(S.__resolveType??""):!1,G=p.isHidden===!0,_e=xe||G;let I;e[0]!==p?(I=Mo(p),e[0]=p,e[1]=I):I=e[1];const ke=I,d=!!Le&&!p.isMultivariate;let Oe;e[2]!==C?(Oe={id:C,animateLayoutChanges:Pc},e[2]=C,e[3]=Oe):Oe=e[3];const{attributes:u,listeners:Ee,setNodeRef:X,transform:ze,isDragging:nt}=Gl(Oe);let Pe;e[4]!==ze?(Pe=Wl.Transform.toString(ze?{...ze,x:0}:null),e[4]=ze,e[5]=Pe):Pe=e[5];const st=nt?0:void 0;let de;e[6]!==Pe||e[7]!==st?(de={transform:Pe,opacity:st},e[6]=Pe,e[7]=st,e[8]=de):de=e[8];const g=de;let we;e[9]!==p?(we=Xi(p),e[9]=p,e[10]=we):we=e[10];const rt=we,ot="button",m=0;let L;e[11]!==P?(L=F=>{(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),P())},e[11]=P,e[12]=L):L=e[12];const Xe=nt?"cursor-grabbing":"cursor-pointer";let A;e[13]!==c||e[14]!==p||e[15]!==_||e[16]!==Xe?(A=le("touch-none transition-colors",Xe,zo(p,_,c)),e[13]=c,e[14]=p,e[15]=_,e[16]=Xe,e[17]=A):A=e[17];let Qe;e[18]!==V||e[19]!==x||e[20]!==S||e[21]!==p?(Qe=r.jsx(Oo,{section:p,raw:S,meta:x,decofile:V}),e[18]=V,e[19]=x,e[20]=S,e[21]=p,e[22]=Qe):Qe=e[22];const W=!c&&d&&r.jsxs(jt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon","aria-label":w(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:le(Rs(_e,xe)),onClick:F=>{F.stopPropagation(),Le?.()},onPointerDown:Cc,children:r.jsx(Vs,{className:le("h-3.5 w-3.5",xe&&"text-warning")})})}),r.jsx(Et,{side:"bottom",children:w(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),at=c?r.jsx(el,{label:w(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:G,onToggle:Ue,children:G?r.jsx(wo,{className:"h-3.5 w-3.5"}):r.jsx(jo,{className:"h-3.5 w-3.5"})}):r.jsxs(jt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon","aria-label":w(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:le(Rs(_e,G)),onClick:F=>{F.stopPropagation(),Ue()},onPointerDown:Nc,children:G?r.jsx(wo,{className:"h-3.5 w-3.5"}):r.jsx(jo,{className:"h-3.5 w-3.5"})})}),r.jsx(Et,{side:"bottom",children:w(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),fe=ri,Ye=tl;let ve;e[23]!==w?(ve=w("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=w,e[24]=ve):ve=e[24];const it=le(Rs(_e,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let $e;e[25]!==Ye||e[26]!==ve||e[27]!==it?($e=r.jsx(Ye,{label:ve,classicClassName:it}),e[25]=Ye,e[26]=ve,e[27]=it,e[28]=$e):$e=e[28];let Be;e[29]!==c||e[30]!==d||e[31]!==xe||e[32]!==Le||e[33]!==w?(Be=c&&d&&r.jsxs(r.Fragment,{children:[r.jsxs(on,{onClick:F=>{F.stopPropagation(),Le?.()},children:[r.jsx(Vs,{className:"h-4 w-4"}),w(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),r.jsx(si,{})]}),e[29]=c,e[30]=d,e[31]=xe,e[32]=Le,e[33]=w,e[34]=Be):Be=e[34];let Ke;e[35]!==Z?(Ke=F=>{F.stopPropagation(),Z()},e[35]=Z,e[36]=Ke):Ke=e[36];let se;e[37]===Symbol.for("react.memo_cache_sentinel")?(se=r.jsx(Qi,{className:"h-4 w-4"}),e[37]=se):se=e[37];let Y;e[38]!==w?(Y=w("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=w,e[39]=Y):Y=e[39];let ee;e[40]!==Ke||e[41]!==Y?(ee=r.jsxs(on,{onClick:Ke,children:[se,Y]}),e[40]=Ke,e[41]=Y,e[42]=ee):ee=e[42];let D;e[43]!==c||e[44]!==ke||e[45]!==Ce||e[46]!==w?(D=ke&&r.jsxs(on,{className:le(!c&&nl),onClick:F=>{F.stopPropagation(),Ce()},children:[r.jsx(Do,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=c,e[44]=ke,e[45]=Ce,e[46]=w,e[47]=D):D=e[47];let T;e[48]!==c||e[49]!==rt||e[50]!==ge||e[51]!==w?(T=rt&&r.jsxs(on,{className:le(!c&&Rc),onClick:F=>{F.stopPropagation(),ge()},children:[c?r.jsx(Zn,{className:"h-4 w-4"}):r.jsx(Es,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=c,e[49]=rt,e[50]=ge,e[51]=w,e[52]=T):T=e[52];let me;e[53]!==c||e[54]!==Je||e[55]!==p.isMultivariate||e[56]!==p.isSavedBlock||e[57]!==w?(me=p.isSavedBlock===!0&&!p.isMultivariate&&r.jsxs(on,{onClick:F=>{F.stopPropagation(),Je()},children:[c?r.jsx(Io,{className:"h-4 w-4"}):r.jsx(Es,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=c,e[54]=Je,e[55]=p.isMultivariate,e[56]=p.isSavedBlock,e[57]=w,e[58]=me):me=e[58];let We;e[59]!==k?(We=F=>{F.stopPropagation(),k()},e[59]=k,e[60]=We):We=e[60];let et;e[61]===Symbol.for("react.memo_cache_sentinel")?(et=r.jsx(Il,{className:"h-4 w-4"}),e[61]=et):et=e[61];let Me;e[62]!==w?(Me=w("sectionsEditor.sectionList.deleteMenuItem"),e[62]=w,e[63]=Me):Me=e[63];let $;e[64]!==We||e[65]!==Me?($=r.jsxs(on,{variant:"destructive",onClick:We,children:[et,Me]}),e[64]=We,e[65]=Me,e[66]=$):$=e[66];let ie;e[67]!==Be||e[68]!==ee||e[69]!==D||e[70]!==T||e[71]!==me||e[72]!==$?(ie=r.jsxs(ai,{align:"end",className:"w-44",children:[Be,ee,D,T,me,$]}),e[67]=Be,e[68]=ee,e[69]=D,e[70]=T,e[71]=me,e[72]=$,e[73]=ie):ie=e[73];let Ve;e[74]!==fe||e[75]!==$e||e[76]!==ie?(Ve=r.jsxs(fe,{children:[$e,ie]}),e[74]=fe,e[75]=$e,e[76]=ie,e[77]=Ve):Ve=e[77];let Te;return e[78]!==u||e[79]!==Ee||e[80]!==P||e[81]!==X||e[82]!==g||e[83]!==A||e[84]!==Qe||e[85]!==W||e[86]!==at||e[87]!==Ve||e[88]!==L?(Te=r.jsxs("div",{ref:X,style:g,...u,...Ee,role:ot,tabIndex:m,onClick:P,onKeyDown:L,className:A,children:[Qe,W,at,Ve]}),e[78]=u,e[79]=Ee,e[80]=P,e[81]=X,e[82]=g,e[83]=A,e[84]=Qe,e[85]=W,e[86]=at,e[87]=Ve,e[88]=L,e[89]=Te):Te=e[89],Te}function Nc(v){return v.stopPropagation()}function Cc(v){return v.stopPropagation()}function Pc(){return!1}function Ns(v){const e=wn.c(11),{canAddSection:p,onAddSection:S,className:x,size:V}=v,C=jn();let _;e[0]!==x?(_=le("w-full",x),e[0]=x,e[1]=_):_=e[1];const P=!p;let k;e[2]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Fl,{size:14}),e[2]=k):k=e[2];let Z;e[3]!==C?(Z=C("sectionsEditor.sectionList.addSectionButton"),e[3]=C,e[4]=Z):Z=e[4];let ge;return e[5]!==S||e[6]!==V||e[7]!==_||e[8]!==P||e[9]!==Z?(ge=r.jsxs(It,{type:"button",variant:"outline",size:V,className:_,disabled:P,onClick:S,children:[k,Z]}),e[5]=S,e[6]=V,e[7]=_,e[8]=P,e[9]=Z,e[10]=ge):ge=e[10],ge}function Bc(v){const e=wn.c(101),{listKey:p,rawSections:S,sections:x,meta:V,decofile:C,selectedIndex:_,onSelect:P,onReorder:k,onDelete:Z,onDuplicate:ge,onMakeReusable:Ue,onToggleHidden:Le,onToggleLazy:Ce,onAddVariant:Je,onDetach:w,onAddSection:c,canAddSection:xe}=v,G=xe===void 0?!0:xe,_e=jn(),I=Xn();let ke;e[0]!==x.length?(ke=()=>Co(x.length),e[0]=x.length,e[1]=ke):ke=e[1];const[d,Oe]=b.useState(ke),[u,Ee]=b.useState(null),[X,ze]=b.useState(p),[nt,Pe]=b.useState(x.length),st=b.useRef(!1);X!==p?(ze(p),Pe(x.length),Oe(Co(x.length))):nt!==x.length&&(Pe(x.length),Oe(tt=>Ec(tt,x.length)));let de;e[2]===Symbol.for("react.memo_cache_sentinel")?(de={activationConstraint:{distance:8}},e[2]=de):de=e[2];let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g={coordinateGetter:Ul},e[3]=g):g=e[3];const we=Ll(Ro(zl,de),Ro(Ol,g));let rt;e[4]!==d?(rt=d.map(Kc),e[4]=d,e[5]=rt):rt=e[5];const ot=rt;let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=tt=>{Ee(String(tt.active.id))},e[6]=m):m=e[6];const L=m;let Xe;e[7]!==ot||e[8]!==k?(Xe=tt=>{Ee(null);const{active:O,over:Ae}=tt;if(!Ae||O.id===Ae.id)return;const He=ot.indexOf(String(O.id)),ht=ot.indexOf(String(Ae.id));He===-1||ht===-1||(Oe(bt=>Lo(Yn([...bt],He,ht))),st.current=!0,requestAnimationFrame(()=>{st.current=!1}),k?.(He,ht))},e[7]=ot,e[8]=k,e[9]=Xe):Xe=e[9];const A=Xe;let Qe;e[10]===Symbol.for("react.memo_cache_sentinel")?(Qe=()=>{Ee(null)},e[10]=Qe):Qe=e[10];const W=Qe;let at,fe,Ye,ve,it,$e,Be,Ke,se,Y,ee,D,T,me,We;if(e[11]!==u||e[12]!==G||e[13]!==I||e[14]!==C||e[15]!==d||e[16]!==ot||e[17]!==A||e[18]!==V||e[19]!==c||e[20]!==Je||e[21]!==Z||e[22]!==w||e[23]!==ge||e[24]!==Ue||e[25]!==P||e[26]!==Le||e[27]!==Ce||e[28]!==S||e[29]!==x||e[30]!==_||e[31]!==we||e[32]!==_e){me=Symbol.for("react.early_return_sentinel");e:{const tt=O=>{st.current||P(O)};if(e[48]!==u||e[49]!==G||e[50]!==I||e[51]!==d||e[52]!==c||e[53]!==S||e[54]!==x||e[55]!==_e){const O=u?d.find(Ae=>Ae.id===u):null;if(ve=O!=null?x[O.index]:null,Ye=O!=null?S[O.index]:void 0,d.length===0){let Ae;e[59]!==_e?(Ae=_e("sectionsEditor.sectionList.noSections"),e[59]=_e,e[60]=Ae):Ae=e[60];let He;e[61]!==Ae?(He=r.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:Ae}),e[61]=Ae,e[62]=He):He=e[62];const ht=He;let bt;e[63]!==G||e[64]!==I||e[65]!==ht||e[66]!==c?(bt=I?ht:r.jsxs("div",{className:"space-y-2",children:[ht,r.jsx(Ns,{canAddSection:G,onAddSection:c,size:"sm"})]}),e[63]=G,e[64]=I,e[65]=ht,e[66]=c,e[67]=bt):bt=e[67],me=bt;break e}T=le(O&&"cursor-grabbing"),e[48]=u,e[49]=G,e[50]=I,e[51]=d,e[52]=c,e[53]=S,e[54]=x,e[55]=_e,e[56]=Ye,e[57]=ve,e[58]=T}else Ye=e[56],ve=e[57],T=e[58];fe=Hl,Ke=we,se=ql,Y=L,ee=A,D=W,at=Jl,$e=ot,Be=Ql,We="space-y-1",it=d.map(O=>{const Ae=x[O.index];return Ae?r.jsx(Ac,{sortableId:O.id,section:Ae,raw:S[O.index],meta:V,decofile:C,selected:_===O.index,onSelect:()=>tt(O.index),onDelete:()=>Z(O.index),onDuplicate:()=>ge(O.index),onMakeReusable:()=>Ue(O.index),onToggleHidden:()=>Le(O.index),onToggleLazy:Ce?()=>Ce(O.index):void 0,onAddVariant:()=>Je(O.index),onDetach:()=>w(O.index)},O.id):null})}e[11]=u,e[12]=G,e[13]=I,e[14]=C,e[15]=d,e[16]=ot,e[17]=A,e[18]=V,e[19]=c,e[20]=Je,e[21]=Z,e[22]=w,e[23]=ge,e[24]=Ue,e[25]=P,e[26]=Le,e[27]=Ce,e[28]=S,e[29]=x,e[30]=_,e[31]=we,e[32]=_e,e[33]=at,e[34]=fe,e[35]=Ye,e[36]=ve,e[37]=it,e[38]=$e,e[39]=Be,e[40]=Ke,e[41]=se,e[42]=Y,e[43]=ee,e[44]=D,e[45]=T,e[46]=me,e[47]=We}else at=e[33],fe=e[34],Ye=e[35],ve=e[36],it=e[37],$e=e[38],Be=e[39],Ke=e[40],se=e[41],Y=e[42],ee=e[43],D=e[44],T=e[45],me=e[46],We=e[47];if(me!==Symbol.for("react.early_return_sentinel"))return me;let et;e[68]!==it||e[69]!==We?(et=r.jsx("div",{className:We,children:it}),e[68]=it,e[69]=We,e[70]=et):et=e[70];let Me;e[71]!==at||e[72]!==$e||e[73]!==Be||e[74]!==et?(Me=r.jsx(at,{items:$e,strategy:Be,children:et}),e[71]=at,e[72]=$e,e[73]=Be,e[74]=et,e[75]=Me):Me=e[75];let $;e[76]!==Ye||e[77]!==ve||e[78]!==I||e[79]!==C||e[80]!==V?($=ve?r.jsx("div",{className:le("cursor-grabbing shadow-lift",zo(ve,!1,I)),children:r.jsx(Oo,{section:ve,raw:Ye,meta:V,decofile:C})}):null,e[76]=Ye,e[77]=ve,e[78]=I,e[79]=C,e[80]=V,e[81]=$):$=e[81];let ie;e[82]!==$?(ie=ni.createPortal(r.jsx($l,{dropAnimation:Zi,children:$}),document.body),e[82]=$,e[83]=ie):ie=e[83];let Ve;e[84]!==fe||e[85]!==Ke||e[86]!==se||e[87]!==Y||e[88]!==ee||e[89]!==D||e[90]!==Me||e[91]!==ie?(Ve=r.jsxs(fe,{sensors:Ke,collisionDetection:se,onDragStart:Y,onDragEnd:ee,onDragCancel:D,children:[Me,ie]}),e[84]=fe,e[85]=Ke,e[86]=se,e[87]=Y,e[88]=ee,e[89]=D,e[90]=Me,e[91]=ie,e[92]=Ve):Ve=e[92];let Te;e[93]!==G||e[94]!==I||e[95]!==c?(Te=!I&&r.jsx(Ns,{canAddSection:G,onAddSection:c,size:"sm",className:"mt-2"}),e[93]=G,e[94]=I,e[95]=c,e[96]=Te):Te=e[96];let F;return e[97]!==T||e[98]!==Ve||e[99]!==Te?(F=r.jsxs("div",{className:T,children:[Ve,Te]}),e[97]=T,e[98]=Ve,e[99]=Te,e[100]=F):F=e[100],F}function Kc(v){return v.id}function Mc(v,e,p,S){if(!v||typeof v!="object")return{kind:"error",reason:"no-matcher-rule"};const x=e.trim();if(!x)return Jt(v,p,S)?{kind:"inline",blockKey:v.__resolveType??"",inlinedRule:Ts(v,p,S)}:{kind:"noop"};const V=As(v,p,S);if(!V)return{kind:"error",reason:"unreadable-rule"};if(V.blockKey)return{kind:"updateBlock",blockKey:V.blockKey,blockData:Ft(V.resolveType,V.data,x)};const C=Jn(x),_=Qn(C,p);return _?{kind:"error",reason:"invalid-block-id",message:_}:{kind:"createBlock",blockId:C,blockData:Ft(V.resolveType,V.data,x),reference:cn(C)}}const Po="section-form-stale-save",Dc=3;function Bo(v,e,p){const S=e.global&&e.pageKey?[{label:"Default",sections:[{__resolveType:e.pageKey}]}]:Fo(e.pageKey?v[e.pageKey]?.sections:void 0,v,p),x=Math.max(0,Math.min(e.pageVariantIndex,S.length-1)),V=S[x]?.sections??[];return{pageVariants:S,variantIndex:x,rawSections:V,parsedSections:kn(V,v,p)}}const Ko=new WeakMap;let Fc=0;function Ic(v){let e=Ko.get(v);return e===void 0&&(e=++Fc,Ko.set(v,e)),e}function Of({orgSlug:v,virtualMcpId:e,branch:p,previewReady:S=!0,previewUrl:x,currentPath:V,activePageBlockKey:C=null,activeGlobalBlockKey:_=null,externalSelection:P,onSaved:k,initialEditSeo:Z=!1,onExitSeo:ge,onSelectRoot:Ue,onViewJsonFile:Le,onFocusedBlockChange:Ce,onSectionPicked:Je,onVariantPreviewOverride:w}){const c=jn(),xe=$i(),G=xe?.taskId??null,_e=S?{orgSlug:v,virtualMcpId:e,branch:p,threadId:G,previewUrl:x}:null,[I,ke]=b.useState([]),{data:d,isLoading:Oe}=vl(_e,{pollWhile:I.length>0}),{data:u,isLoading:Ee}=Vl(_e),X=Xn(),ze=xe?.virtualMcpId,Pe=qi(ze===e?e:null)?.metadata?.siteSlug??null,st=Xl({virtualMcpId:e,branch:p,sandboxUrl:x}),de=yl(e,p),g=Sl(de),we=Vi(g),rt=!g,ot=!!st||g,[m,L]=b.useState(null),[Xe,A]=b.useState(null),[Qe,W]=b.useState(null),[at,fe]=b.useState(0),[Ye,ve]=b.useState(void 0),[it,$e]=b.useState(null),Be={index:it,remember:$e},[Ke,se]=b.useState(null),[Y,ee]=b.useState(null),[D,T]=b.useState([]),me=b.useRef(null),[We,et]=b.useState(D.length);We!==D.length&&(et(D.length),requestAnimationFrame(()=>{me.current&&(me.current.scrollTop=0)}));const[Me,$]=b.useState(0),[ie,Ve]=b.useState(null),[Te,F]=b.useState(null),[tt,O]=b.useState(null),[Ae,He]=b.useState(!1),[ht,bt]=b.useState(!1),Rn=b.useRef(null),[En,$o]=b.useState(!0),[Qt,Vn]=b.useState(!1),[Lt,Tn]=b.useState(!1),[je,un]=b.useState(Z),[Ps,Bs]=b.useState(Z);Z&&!Ps&&(Bs(!0),un(!0),L(null),A(null),W(null),T([])),!Z&&Ps&&Bs(!1);const[Wo,dn]=b.useState(null),[Ks,An]=b.useState(void 0),[Ms,Ot]=b.useState([]),[Ds,Yt]=b.useState(0),[De,lt]=b.useState(0),[Ho,Fe]=b.useState(null),[Zt,qe]=b.useState(null),[Fs,Is]=b.useState(null),Nn=ii(),Cn=bl({orgSlug:v,virtualMcpId:e,branch:p},{tunnel:!1}),fn=Kl({orgSlug:v,virtualMcpId:e,branch:p}),[qo,Go]=b.useState(V),[Uo,Jo]=b.useState(C),[Qo,Yo]=b.useState(_);(qo!==V||Uo!==C||Qo!==_)&&(queueMicrotask(()=>fn.flush()),Go(V),Jo(C),Yo(_),L(null),A(null),W(null),fe(0),se(null),ee(null),lt(0),Fe(null),qe(null),T([]),$(t=>t+1),un(!1),dn(null),An(void 0),Ot([]),Yt(t=>t+1));const B=Ml({orgSlug:v,virtualMcpId:e,branch:p}),mn=pl(t=>{B.mutate(t,{onSuccess:()=>k?.(),onError:B.reportError})},d??{},B.v8),Pn=Bl({orgSlug:v,virtualMcpId:e,branch:p}),Ls=hc({orgSlug:v,virtualMcpId:e,branch:p}),[Xt,en]=b.useState(!1),N=b.useRef(null),_t=b.useRef(null),gt=b.useRef(null),vt=b.useRef(null),Bn=b.useRef({}),zt=b.useRef(null),pn=b.useRef(!1),hn=b.useRef(!1),ye=b.useRef(new Map),tn=b.useRef(!1),ct=b.useRef([]),es=b.useRef(new WeakSet);xl(v,e,t=>{const{activePageKey:n,rawSections:s,parsedSections:o,selectedSectionIndex:a}=re.current,i=new Set;n&&i.add(n);for(const l of[_t.current?.sectionIndex,a]){const f=l==null?void 0:s[l],R=l==null?void 0:o[l],h=f&&R?.isSavedBlock?_s(f,R):null;h&&i.add(h)}if([...i].some(l=>t.has(l))){for(const l of[N,gt,vt])l.current&&clearTimeout(l.current),l.current=null;_t.current=null,ye.current.clear(),n&&t.has(n)&&(Bn.current={})}});const re=b.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[Os,zs]=b.useState(0),[Zo,Xo]=b.useState(0),$s=li(de,{orgSlug:v,virtualMcpId:e,branch:p}),Ws=ci($s,I[0]?.blockKey??null,ui(d,I[0]?.blockKey??null)),[ea,ta]=b.useState(null),ts=_l(v,e).epoch,[na,sa]=b.useState(ts);lc(je?{orgSlug:v,virtualMcpId:e,branch:p}:null,d??void 0,u??void 0);const Hs=_??(d&&u?_o(ko(d,u),V,C)?.key??null:null),ns=So({orgSlug:v,virtualMcpId:e,branch:p},Hs?[Hs]:[],{withRefs:!0}),[qs,ra]=b.useState(!1),ss=So({orgSlug:v,virtualMcpId:e,branch:p},qs?Tl:[]),Gs={ready:!(de.kind==="protocol"&&de.hosted)||qs&&ss.ready,failed:ss.failed,retry:ss.retry,request:()=>ra(!0)};if(ns.failed)return r.jsxs("div",{className:"h-full w-full flex flex-col items-center justify-center gap-3 p-6 text-center text-sm text-muted-foreground",children:[r.jsx("p",{children:c("sectionsEditor.hosted.blockLoadFailed")}),r.jsx("p",{children:c("sectionsEditor.hosted.blockLoadFailedHint")}),r.jsx(It,{variant:"outline",size:"sm",onClick:ns.retry,children:c("sectionsEditor.namedRules.tryAgain")})]});if(!S||Oe||Ee||!ns.ready)return r.jsx("div",{className:"h-full w-full flex items-center justify-center",children:r.jsx(di,{className:"size-5 text-muted-foreground"})});if(!d||!u)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const oa=ko(d,u),q=!!_,oe=q?null:_o(oa,V,C),y=q?_:oe?.key??null,rs=q&&_?d[_]:void 0,Us=q&&_&&rs?Al(_,rs):q&&_?_:"",nn=!q&&y&&d[y]?d[y]:null,os=je&&d&&u&&y&&oe?Eo(d,{kind:"page",pageKey:y,pageName:String(oe.name??""),path:String(oe.path??"")},u):null,aa=je?nn?.seo:void 0,Kn=Ks!==void 0?Ks:aa,ia=je?sc(Kn):void 0,Js=os?.seoTypeOptions??[],Qs=je&&u?rc(u):"",as=Wo??ia??{},Mn=je&&os?cc(as,os):null,Ys=je&&Mn&&oc(Kn)?Gn(Mn,u):null,Zs=je?ac(d,u)?.seoData:void 0,pe=q?[{label:"Default",sections:[{__resolveType:_}]}]:Fo(nn?.sections,d??{},g),yt=pe.length>1,te=Math.min(at,pe.length-1),Se=pe[te],K=Se?.sections??[],ce=kn(K,d,g),Dn=!q&&gc(nn?.sections,g);if(q&&_&&Fs!==_){Is(_);const t=K[0],n=ce[0];if(t&&n){L(0),lt(0),T([]);const s=wt(t,n,d,g);s&&(A(s.data),W(s.resolveType),qe(null),Fe(null))}}!q&&Fs!==null&&Is(null),re.current={rawSections:K,parsedSections:ce,decofile:d??{},activePageKey:y,pageVariants:pe,variantIndex:te,sectionVariantIndex:De,selectedSectionIndex:m};const la=()=>({multivariate:Dn,index:te,variants:pe.map(t=>({rule:t.rule})),lazyValues:g&&Dn&&Ai(nn?.sections?.variants?.[te]?.value)}),is=(t,n)=>{if(!w)return;if(!y||!Dn||t.length<=1){w(null);return}const s={multivariate:!0,index:n,variants:t},o=g?bo(y,s):No(y,s,d,u);w(o.length>0?o:null)},ls=w&&y&&Dn&&yt&&!Oe&&!Ee?y:null;if(ls!==ea&&(ta(ls),ls)){const t=pe.map(s=>({rule:s.rule})),n=te;queueMicrotask(()=>is(t,n))}const $t=(t,n,s)=>{if(!w)return;if(!y){w(null);return}const o=la(),a=g?bo(y,o):No(y,o,d,u);if(!t||n<0){w(a.length>0?a:null);return}const i={pageKey:y,page:o,sectionIndex:n,sectionLazy:ce[n]?.isLazy??!1,mvObj:t,selectedVariantIndex:s},l=g?wl(i):xc({...i,decofile:d,meta:u}),f=g?jl(a,l):[...a,...l];w(f.length>0?f:null)},xt=(t,n,s,o=m??-1,a=!1)=>{const i=pt(t,n);if(!i){A(null),W(null),qe(null),Fe(null),a&&$t(null,o,s);return}const f=Qr(i,we)[s];if(!f){A(null),W(null),qe(null),Fe(null),a&&$t(null,o,s);return}const R=hi(f.value,d);A(R?.data??null),W(R?.resolveType??null);const{resolveType:h,formValue:j}=Ut(f.rule,d,u??void 0);qe(h),Fe(j),a&&$t(i,o,s)},cs=t=>{F(null),fe(t),L(null),A(null),W(null),T([]);const n=pe[t]?.rule,{resolveType:s,formValue:o}=Ut(n,d??{},u??void 0);ee(s),se(o),is(pe.map(a=>({rule:a.rule})),t)},ca=(t,n)=>{const s=K[t],o=ce[t];if(!s||!o)return!1;const a=o.isMultivariate?pt(s,o)?.variants?.length??0:0,i=n<a?n:0;if(L(t),lt(i),T([]),$(l=>l+1),o.isMultivariate)xt(s,o,i,t);else{const l=wt(s,o,d,g);l?(A(l.data),W(l.resolveType)):(A(null),W(null)),qe(null),Fe(null)}return!0},Xs=P?.index;if(P!==void 0&&(P?.seq??null)!==Ye&&(ve(P?.seq??null),typeof Xs=="number"&&ca(Xs,0)),ts!==na){sa(ts);const t=N.current!==null||ye.current.size>0||vt.current!==null||gt.current!==null||B.isPending||fn.isPending||I.length>0,n=m!==null&&Jr(me.current,document.activeElement);if(!t&&n&&(tn.current=!0),!t&&!n&&m!==null){const s=K[m],o=ce[m];if(T([]),$(a=>a+1),!s||!o)L(null),A(null),W(null);else if(o.isMultivariate)xt(s,o,De,m);else{const a=wt(s,o,d,g);A(a?.data??null),W(a?.resolveType??null)}}!t&&je&&(dn(null),An(void 0),Yt(s=>s+1))}if(Os!==Zo){Xo(Os);const t=m!==null?K[m]:null,n=m!==null?ce[m]:null;if(t&&n&&m!==null)if(T([]),$(s=>s+1),n.isMultivariate)xt(t,n,De,m);else{const s=wt(t,n,d,g);A(s?.data??null),W(s?.resolveType??null)}}const ut=I[0];if(ut){const{formBase:t,target:n}=ut,s=Bo(d,n,g),o=t.sectionIndex,a=s.rawSections.length===t.sectionCount?bs(s.rawSections[o],s.parsedSections[o],n.sectionVariantIndex,d,g):null,i=fi(ut,a,l=>Yr(t,l));if(i){const f=[{...ut,...i,changedAgain:!0},...I.slice(1)];ct.current=f,ke(f)}}const gn={orgSlug:v,virtualMcpId:e,branch:p,threadId:G,previewUrl:g?void 0:x??void 0,siteSlug:Pe},Fn=Qe&&u?Gn(Qe,u):null,dt=(t,n)=>{if(!y)return;N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear(),vt.current&&(clearTimeout(vt.current),vt.current=null),gt.current&&(clearTimeout(gt.current),gt.current=null);const s=ln(d,y,t,te,pe);B.mutate({blockKey:y,data:s},{onSuccess:()=>n?.onSuccess?.()??k?.(),onError:o=>{n?.onError?.(),B.reportError(o)}})},Wt=()=>{Ce?.(null),L(null),Tn(!1),A(null),W(null),lt(0),Fe(null),qe(null),T([]),$(t=>t+1)},er=()=>Jr(me.current,document.activeElement),us=(t=c("sectionsEditor.sectionsEditor.blockChangedElsewhere"))=>{if(N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear(),_t.current=null,H.error(t,{id:Po}),er()){tn.current=!0;return}zs(n=>n+1)},tr=()=>{!tn.current||er()||ct.current.length>0||N.current!==null||pn.current||hn.current||ye.current.size>0||(tn.current=!1,zs(t=>t+1))},nr=()=>{tn.current&&setTimeout(tr,0)},sr=de.kind==="protocol"&&de.source==="github",rr=t=>El(Nn,Cn,t,de.kind==="protocol"?de:null),or=t=>{ye.current.size!==0&&setTimeout(()=>{if(pn.current||hn.current)return;const n=[...ye.current.values()];ye.current.clear();for(const s of n)s()},t)},ua=t=>{const{activePageKey:n,variantIndex:s,sectionVariantIndex:o}=re.current,a=zt.current;return{formBase:a?.sectionIndex===t&&a.variantIndex===o?a:null,pageKey:n,global:q,pageVariantIndex:s,sectionVariantIndex:o,schema:Fn}},vn=t=>{ct.current=t,ke(t)},da=t=>{const n=ct.current,s=n.findIndex(i=>i.formBase===t.formBase),o=s>=0?n[s]:void 0,a=o?n.with(s,{...t,choices:no(o.plan,o.choices,t.plan),fresh:Ii(o.plan,t.plan,o.fresh),changedAgain:o.changedAgain||Hn(o.plan.theirs)!==Hn(t.plan.theirs)}):[...n,{...t,changedAgain:es.current.has(t.formBase)}];vn(a)},ar=(t,n)=>{const s=ct.current,o=s.findIndex(l=>l.formBase===t),a=s[o];if(!a)return!1;if(Hn(a.plan.mine)===Hn(n))return!0;const i=to({...a.plan,mine:n});if(i.pointers.length===0){const l=s.filter(f=>f!==a);return vn(l),!1}return vn(s.with(o,{...a,plan:i,choices:no(a.plan,a.choices,i)})),!0},fa=t=>{const n=re.current;return n.selectedSectionIndex===t.formBase.sectionIndex&&n.activePageKey===t.target.pageKey&&n.variantIndex===t.target.pageVariantIndex&&n.sectionVariantIndex===t.target.sectionVariantIndex},ma=()=>{const t=ct.current[0];if(!t)return null;const{formBase:n,target:s}=t;N.current&&_t.current?.sectionIndex===n.sectionIndex&&_t.current.sectionVariantIndex===s.sectionVariantIndex&&(clearTimeout(N.current),N.current=null,_t.current=null),ye.current.delete(`${s.pageKey}:${n.sectionIndex}:${s.sectionVariantIndex}`);const o=n.emitted;return o&&typeof o=="object"&&!ar(n,o)&&yn(o,n.sectionIndex,0,s),ct.current[0]??null},pa=()=>{const t=ct.current[0],n=ma();if(!n||!t||n.formBase!==t.formBase||n.plan.pointers.some(i=>!t.plan.pointers.includes(i)))return;const s=ji(n.plan,n.choices);de.kind==="protocol"&&de.source==="github"&&Ri(n.plan,n.choices)&&kl(c,!1),vn(ct.current.slice(1));const{formBase:o,target:a}=n;o.base=n.plan.theirs,o.version=void 0,o.emitted=s,es.current.add(o),(zt.current===o||fa(n))&&(zt.current=o,A(s),$(i=>i+1)),yn(s,o.sectionIndex,0,a)},ha=t=>{const[n,...s]=ct.current;n&&vn([{...n,choices:t},...s])},yn=(t,n,s=0,o,a=!1)=>{const i=o??ua(n),l=i.sectionVariantIndex,f=i.formBase,R=a||eo(ct.current,f,i,n,g).runNow,h=_t.current;N.current&&(clearTimeout(N.current),N.current=null,h&&(h.sectionIndex!==n||h.sectionVariantIndex!==l)&&h.write());const j=`${i.pageKey}:${n}:${l}`,E=()=>{if(pn.current||hn.current){ye.current.set(j,E);return}const M=typeof t=="function"?t():t,z=eo(ct.current,f,i,n,g).base;if(z&&ar(z,M))return;const ne=re.current.decofile,{rawSections:J,parsedSections:Ne,pageVariants:Q,variantIndex:be}=Bo(ne,i,g),Ie=i.pageKey,he=J[n];if(!he)return;const ue=Ne[n];if(!ue)return;const Ge=f?.base,Ze=bs(he,ue,l,ne,g),Nt=!!Ge&&!!Ze&&Ni(Ge,Ze)&&!(f&&Yr(f,Ze));if(Nt&&Ge&&Ze){if(Ci(Ge,Ze)){us(c("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}const U=ue.isSavedBlock?"here":Pi(Ge,J.map((ae,mt)=>bs(ae,Ne[mt],l,ne,g)),n,f?.sectionCount??J.length);if(U==="unknown"){us(c("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}if(typeof U=="number"&&f){f.sectionCount=J.length,f.sectionIndex=U,zt.current===f&&L(U),yn(M,U,s,i);return}}const Ct=Nt&&Ge&&Ze?to({ancestor:Ge,mine:M,theirs:Ze}):null;if(Ct&&Ct.pointers.length>0&&f){f.sectionCount=J.length,da({plan:Ct,formBase:f,target:i,sectionIndex:n,choices:Bi(Ct),changedAgain:!1,blockKey:ue.isSavedBlock?_s(he,ue):Ie,fresh:{}});return}const Pt=Ct?Ct.merged:null,rn=Pt??M,qr=Ki({merged:!!Pt,tracked:f,current:zt.current,saved:M});Pt&&H.info(c("sectionsEditor.sectionsEditor.blockMergedWithOthers"),{id:Po}),qr&&f&&(f.emitted=Pt,A(Pt));const Ss=qr||!Pt?rn:M;f&&(f.base=Ss,f.sectionCount=J.length,Mi(f,Ss));const Gr={onSuccess:()=>{f&&es.current.delete(f),k?.()},onError:U=>{if(f?.base===Ss&&Ge&&(f.base=Ge),U instanceof Rl){if(f&&(f.version=void 0),s<Dc){ye.current.delete(j),hn.current=!0;const ae=Li(s,U.carriedStored);setTimeout(()=>{hn.current=!1,yn(()=>{const mt=f?.emitted;return mt&&typeof mt=="object"?mt:M},n,s+1,i,ae.immediate),ye.current.delete(j),or(xn(g))},ae.delay)}else us();return}B.reportError(U)}},Ur=U=>{pn.current=!0;let ae=!1;B.mutateAsync(U).then(()=>Gr.onSuccess(),mt=>{ae=!0,Gr.onError(mt)}).finally(()=>{pn.current=!1,or(ae?xn(g):0),tr()})};if(ue.isSavedBlock){const U=_s(he,ue);if(!U)return;Ur({blockKey:U,data:rn,...Ge?{base:{value:Di({startedFrom:Ge,stored:Ze,rebased:!!Pt,refused:s>0})}}:{},rebaseOnConflict:!1,guard:so({formBase:f,rebased:!!Pt,versionOf:rr,productionVersionOf:ae=>oo(Nn,Cn,ae),...sr?{copy:{value:ne[U]}}:{}})});return}if(!Ie)return;const Wn={...ne[Ie]},Gt=[...J];if(ue.isMultivariate){const U=pt(he,ue);if(!U||!Ie)return;const ae=Fi(U,l,rn);Gt[n]=Bt(he,ue,ae)}else if(ue.isHidden){const U=Cs(he.__resolveType),ae=U?{...he.section}:{...he},mt=Array.isArray(ae.variants)?[...ae.variants]:[];mt[0]&&(mt[0]=ro(ae.__resolveType,mt[0],rn)),ae.variants=mt,U?Gt[n]={...he,section:ae}:Gt[n]=ae}else ue.isLazy?Gt[n]={...he,section:rn}:Gt[n]=rn;if(Q.length>1){const U=Wn.sections,ae=[...U?.variants??[]];ae[be]&&(ae[be]=ro(U?.__resolveType,ae[be],Gt)),Wn.sections={...U,variants:ae}}else Wn.sections=Gt;Ur({blockKey:Ie,data:Wn,rebaseOnConflict:!1,guard:so({formBase:null,rebased:!1,versionOf:rr,productionVersionOf:U=>oo(Nn,Cn,U),...sr?{copy:{value:ne[Ie]}}:{}})})};if(_t.current={sectionIndex:n,sectionVariantIndex:l,write:E},R){_t.current=null,E();return}N.current=setTimeout(()=>{N.current=null,E()},xn(g))},ga=t=>{tn.current=!1,L(t),lt(0),T([]),$(a=>a+1);const n=K[t],s=ce[t];if(Ce?.(s?.isSavedBlock?s.resolveType??null:null),!n||!s)return;if(s.isMultivariate){xt(n,s,0,t);return}const o=wt(n,s,d,g);if(!o){A(null),W(null),qe(null),Fe(null),$t(null,t,0);return}A(o.data),W(o.resolveType),qe(null),Fe(null),$t(null,t,0)},ir=t=>{const n=t;m!==null&&(zt.current=Ei(zt.current,{sectionIndex:m,variantIndex:re.current.sectionVariantIndex,shown:Xe,next:n,sectionCount:re.current.rawSections.length})),A(n),m!==null&&yn(n,m)},ds=t=>{if(!y||!d||!u||!oe)return;const n={kind:"page",pageKey:y,pageName:String(oe.name??""),path:String(oe.path??"")},s=Eo(d,n,u);s&&fn.save(y,()=>{const o=Nn.getQueryData(Ti.decofile(Cn))?.[y];if(!o||typeof o!="object"||o===null||Array.isArray(o))return null;const a={...o,...Bn.current};return Bn.current={},t?.raw!==void 0?uc(a,t.raw,u):t?.inner!==void 0?dc(n,s,a,t.inner):a})},lr=(t,n)=>{y&&(Bn.current[t]=n,ds())},va=(t,n)=>{if(!y)return;const s=Yn([...K],t,n);m!==null&&(m===t?L(n):t<m&&n>=m?L(m-1):t>m&&n<=m&&L(m+1)),dt(s)},ya=t=>{if(!y)return;const n=K.filter((s,o)=>o!==t);m===t?Wt():m!==null&&m>t&&L(m-1),dt(n)},Sa=t=>{if(!y)return;const n=K[t];if(!n)return;const s=[...K];s.splice(t+1,0,hl(n)),m!==null&&m>t&&L(m+1),dt(s)},ba=t=>{if(!y)return;const n=K[t],s=ce[t];if(!n||!s)return;const o=s.isHidden?_i(n,g):ki(n,u);if(!o)return;const a=[...K];a[t]=o,m===t&&Wt(),dt(a)},xa=t=>{if(!y)return;const n=K[t],s=ce[t];if(!n||!s||s.isMultivariate)return;const o=xi(n);if(!o)return;const a=[...K];a[t]=o,m===t&&Wt(),dt(a)},_a=t=>{if(!y)return;const n=K[t],s=ce[t];if(!n||!s?.isSavedBlock)return;const o=wt(n,s,d,g);if(!o?.data)return;const{name:a,...i}=o.data,l=[...K];s.isLazy?l[t]={...n,section:i}:l[t]=i,m===t&&Wt(),dt(l)},ka=t=>{if(!y)return;const n=Hi(ce),s=[...K.slice(0,n),{__resolveType:t.resolveType},...K.slice(n)];dt(s,{onError:()=>{re.current.selectedSectionIndex===n&&Wt()}}),He(!1),L(n),lt(0),T([]),$(l=>l+1);const o=s[n],a=kn(s,d,g)[n];if(!o||!a)return;if(a.isMultivariate){xt(o,a,0);return}const i=wt(o,a,d,g);if(!i){A(null),W(null),qe(null),Fe(null);return}A(i.data),W(i.resolveType),qe(null),Fe(null)},cr=t=>{Rn.current=t.append,He(!0)},wa=t=>{const n=Rn.current;if(!n){ka(t);return}n({__resolveType:t.resolveType}),He(!1),Rn.current=null},ur=t=>{if(m===null)return;const n=K[m],s=ce[m];!n||!s?.isMultivariate||(lt(t),T([]),$(o=>o+1),xt(n,s,t,m,!0))},ja=t=>{if(m===null||!y)return;const n=K[m],s=ce[m];if(!n||!s?.isMultivariate)return;const o=pt(n,s);if(!o)return;const a=Si(o,t);if(!a){H.error(c("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const i=[...K];i[m]=Bt(n,s,a);const l=a.variants;let f=De;t===De?f=Math.min(t,l.length-1):t<De&&(f=De-1),lt(f),T([]),$(R=>R+1),xt(i[m],s,f),dt(i)},Ra=t=>{if(m===null||!y)return;const n=K[m],s=ce[m];if(!n||!s?.isMultivariate)return;const o=pt(n,s);if(!o)return;const a=bi(o,t,g),i=[...K];i[m]=Bt(n,s,a);const l=Xr(o.variants??[],t,g);lt(l),T([]),$(f=>f+1),xt(i[m],s,l,m,g),dt(i)},Ea=(t,n)=>{if(m===null||!y||t===n)return;const s=K[m],o=ce[m];if(!s||!o?.isMultivariate)return;const a=pt(s,o);if(!a)return;const i=vi(a,t,n),l=[...K];l[m]=Bt(s,o,i);let f=De;De===t?f=n:t<De&&n>=De?f=De-1:t>De&&n<=De&&(f=De+1),lt(f),xt(l[m],o,f,m,g),dt(l)},Sn=t=>{const n=t??m;if(n===null||!y)return;const s=K[n],o=ce[n];if(!s||!o)return;const a=gi(s,o,void 0,u,g);if(!a){H.error(c("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const i=[...K];i[n]=a.section;const l=kn(i,d,g)[n];if(!l?.isMultivariate){H.error(c("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}L(n),lt(a.newVariantIndex),T([]),$(f=>f+1),xt(a.section,l,a.newVariantIndex,n,g),dt(i)},dr=()=>{if(m===null||!y)return;const t=K[m],n=ce[m];if(!t||!n?.isMultivariate)return;const s=pt(t,n);if(!s)return;const o=yi(t,n,s);if(!o){H.error(c("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const a=[...K];a[m]=o;const i=kn(a,d,g)[m];if(!i)return;lt(0),qe(null),Fe(null),T([]),$(f=>f+1);const l=wt(o,i,d,g);l?(A(l.data),W(l.resolveType)):(A(null),W(null)),$t(null,m,0),dt(a)},Va=async t=>{if(ie===null||!y)return;const n=Qn(t,d,u);if(n){H.error(n);return}const s=K[ie],o=ce[ie];if(!s||!o)return;const a=wt(s,o,d,g);if(!a){H.error(c("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const i={...a.data,name:t};try{const l=await B.mutateAsync({blockKey:t,data:i,create:!0}),f=[...K];f[ie]={__resolveType:t},await B.mutateAsync({blockKey:y,data:ln(d,y,f,te,pe)}),m===ie&&Wt(),Ve(null),Un(l)||H.success(c("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),k?.()}catch(l){H.error(c("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"),{description:Kt(c,Mt(l))})}},fr=Se?.rule;if(yt&&m===null&&Y===null&&fr){const{resolveType:t,formValue:n}=Ut(fr,d??{},u??void 0);ee(t),se(n)}const sn=u?al(u):[],fs=u&&d?il(u,d):[],Ht=g&&u&&d?fc(u,d):[],ms=(t,n)=>{if(Ht.length===0)return;const s=Nl(t);return{kinds:Ht,selected:s,campaignPrefill:mc(t),onPick:n,load:Gs}},mr=!q&&!!(ot&&u&&d),pr=Y&&u?Gn(Y,u):null,St=()=>{gt.current&&(clearTimeout(gt.current),gt.current=null),vt.current&&(clearTimeout(vt.current),vt.current=null)},qt=async(t,n)=>{if(Sc(n,t,u,g))try{await Pn.mutateAsync({blockKey:t})}catch(s){H.error(c("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"),{description:Kt(c,Mt(s))})}},hr=t=>{gt.current&&clearTimeout(gt.current),gt.current=setTimeout(()=>{const{activePageKey:n,decofile:s,variantIndex:o}=re.current;if(!n)return;const a={...s[n]},i={...a.sections},l=[...i.variants??[]],f=l[o],R=f?.rule;if(Jt(R,s,u)){const h=R?.__resolveType??"",j=s[h],E=typeof j?.name=="string"?j.name:h,{__resolveType:M,...z}=t;B.mutate({blockKey:h,data:Ft(M??"",z,E)},{onSuccess:()=>k?.(),onError:B.reportError});return}f&&(l[o]={...f,rule:t}),a.sections={...i,variants:l},B.mutate({blockKey:n,data:a},{onSuccess:()=>k?.(),onError:B.reportError})},xn(g))},gr=t=>{ee(t);const n=t?Ao(t,u):{__resolveType:Zr(u)};se(t?n:{}),hr(n)},vr=t=>{const n=t;se(n);const s=Y?{__resolveType:Y,...n}:{...n};hr(s)},In=async(t,n,s)=>{const o=pc(n,t);if(!o.ok)return o.reason==="conflict"&&H.info(t.kind==="experiments"?c("sectionsEditor.namedRulePicker.conflictTests"):c("sectionsEditor.namedRulePicker.conflictCampaigns"),xo),null;const a={};if(s){const i=s(o.rule);if(!i)return null;a[i.blockKey]=i.data}return o.blockWrite&&(a[o.blockWrite.blockKey]=o.blockWrite.block),Object.keys(a).length>0&&!(await Ls.apply({writes:a})).ok?null:(o.blockWrite&&H.success(t.kind==="experiments"?c("sectionsEditor.namedRulePicker.createdTest",{name:t.name.trim()}):c("sectionsEditor.namedRulePicker.createdCampaign",{name:t.name.trim()}),{...xo,description:c("sectionsEditor.namedRulePicker.createdHint")}),{rule:o.rule,projected:{...n,...a}})},yr=Ht.length>0?{kinds:Ht,load:Gs,prepare:async t=>(await In(t,re.current.decofile,void 0))?.rule??null,ensureBlock:async t=>{const n=Cl(re.current.decofile,t);return n.kind==="saved"?!0:n.kind==="conflict"?!1:(await Ls.apply({writes:{[Pl(t).blockKey]:n.block}})).ok}}:null,Sr=async t=>{St();const{activePageKey:n,decofile:s,variantIndex:o}=re.current;if(!n)return;const a=await In(t,s,f=>{const R=s[n],h=R?.sections;if(!h||typeof h!="object"||Array.isArray(h))return null;const j=h;if(!Array.isArray(j.variants))return null;const E=[...j.variants],M=E[o];return M?(E[o]={...M,rule:f},{blockKey:n,data:{...R,sections:{...j,variants:E}}}):null});if(!a)return;const{resolveType:i,formValue:l}=Ut(a.rule,a.projected,u??void 0);ee(i),se(l),k?.()},br=async t=>{St();const{activePageKey:n,decofile:s,variantIndex:o}=re.current;if(!n)return;const a=s[n],i=a?.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const l=i;if(!Array.isArray(l.variants))return;const f=[...l.variants],R=f[o];if(!R)return;const h=Dt(R.rule,s,u),j=cn(t);f[o]={...R,rule:j};const E={...s,[n]:{...a,sections:{...l,variants:f}}},{resolveType:M,formValue:z}=Ut(j,E,u??void 0);ee(M),se(z);try{await B.mutateAsync({blockKey:n,data:E[n]}),h&&h!==t&&await qt(h,E),k?.()}catch(ne){H.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Kt(c,Mt(ne))})}},xr=t=>{vt.current&&clearTimeout(vt.current);const{selectedSectionIndex:n,sectionVariantIndex:s}=re.current;n!==null&&(vt.current=setTimeout(()=>{const{rawSections:o,parsedSections:a,decofile:i,activePageKey:l,pageVariants:f,variantIndex:R}=re.current;if(!l)return;const h=o[n],j=a[n];if(!h||!j?.isMultivariate)return;const E=pt(h,j);if(!E)return;const z=(E.variants??[])[s]?.rule;if(Jt(z,i,u)){const Q=z?.__resolveType??"",be=i[Q],Ie=typeof be?.name=="string"?be.name:Q,{__resolveType:he,...ue}=t;B.mutate({blockKey:Q,data:Ft(he??"",ue,Ie)},{onSuccess:()=>k?.(),onError:B.reportError});return}const ne=xs(E,s,t),J=[...o];J[n]=Bt(h,j,ne);const Ne=ln(i,l,J,R,f);B.mutate({blockKey:l,data:Ne},{onSuccess:()=>k?.(),onError:B.reportError})},xn(g)))},Ta=t=>{qe(t);const n=t?Ao(t,u):{__resolveType:Zr(u)};Fe(t?n:{}),xr(n)},Aa=t=>{const n=t;Fe(n);const s=Zt?{__resolveType:Zt,...n}:{...n};xr(s)},Na=async t=>{St();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:o,parsedSections:a,decofile:i,activePageKey:l,pageVariants:f,variantIndex:R}=re.current;if(n===null||!l)return;const h=await In(t,i,M=>{const z=o[n],ne=a[n];if(!z||!ne?.isMultivariate)return null;const J=pt(z,ne);if(!J)return null;const Ne=[...o];return Ne[n]=Bt(z,ne,xs(J,s,M)),{blockKey:l,data:ln(i,l,Ne,R,f)}});if(!h)return;const{resolveType:j,formValue:E}=Ut(h.rule,h.projected,u??void 0);qe(j),Fe(E),k?.()},Ca=async t=>{St();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:o,parsedSections:a,decofile:i,activePageKey:l,pageVariants:f,variantIndex:R}=re.current;if(n===null||!l)return;const h=o[n],j=a[n];if(!h||!j?.isMultivariate)return;const E=pt(h,j);if(!E)return;const M=E.variants??[],z=Dt(M[s]?.rule,i,u),ne=cn(t),J=xs(E,s,ne),Ne=[...o];Ne[n]=Bt(h,j,J);const Q=ln(i,l,Ne,R,f),be={...i,[l]:Q},{resolveType:Ie,formValue:he}=Ut(ne,be,u??void 0);qe(Ie),Fe(he);try{await B.mutateAsync({blockKey:l,data:Q}),z&&z!==t&&await qt(z,be),k?.()}catch(ue){H.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Kt(c,Mt(ue))})}};if(!q&&!oe)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.noPageFound",{currentPath:V})});if(q&&!rs)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.globalBlockNotFound")});const Re=m!==null?ce[m]??null:null,_r=m!==null?K[m]:null,kr=_r&&Re?.isMultivariate?pt(_r,Re):null,Vt=kr?Qr(kr,we,g):[],Ln=Math.min(De,Math.max(Vt.length-1,0)),kt=Vt[Ln]??null,Tt=Re?.isMultivariate===!0,ps=m!==null&&Re!==null,At=ps&&(Tt||!!(Fn&&Xe)),Pa=At&&!q&&Re?.isSavedBlock===!0,ft=q||Pa,wr=q?Us:Re?.label??"",Ba=Zt&&u?Gn(Zt,u):null,jr=(t,n)=>n&&X?`${t} · ${n}`:t,Rr=Re?Re.variantOf??Re.label:"",Ka=(()=>{const t=Tt&&kt?kt.label:null;return t?X?[jr(Rr,t)]:[Re.label,t]:[Re?.label??""]})(),hs=jr(oe?.name??"",yt?Se?.label:null),On=At&&(!q||D.length>0)?q?[Us,...D]:[hs,...Ka,...D]:[],Er=je&&oe?[oe.name,"SEO",...Ms]:[],Vr=c("sectionsEditor.pageVariantTabs.variantsLabel"),Tr=Qt&&oe?[oe.name,Vr]:Lt&&oe&&Re?[hs,Rr,Vr]:[],zn=Tr.length>0?Tr:Er.length>0?Er:ft?On.length>0?On:[wr]:On.length>0?On:[hs],Ar=ps&&!Tt&&!Re?.isHidden&&!!y,Ma=ft||!q&&yt&&!!Se||Ar,Da=ps&&!Tt&&!q&&D.length===0&&!!Re&&Mo(Re)&&!!y,Fa=X&&At&&!Lt&&Tt&&D.length===0&&!!kt,Nr=X&&D.length>0?co(D[D.length-1]):null,Ia=D.length>1?co(D[D.length-2]):null,Cr=ft?wr:At?Re?.label??"":oe?.name??"",La=Qt||Lt?c("sectionsEditor.pageVariantTabs.variantsLabel"):je?c("sectionsEditor.panelSections.seo"):Nr??Cr,Pr=Lt?Re?.variantOf??Re?.label??"":Qt||je?oe?.name??"":Nr?Ia??Cr:ft?c("sectionsEditor.sectionsEditor.globalSectionSubtitle"):At?oe?.name??"":oe?.path??"",gs=!Qt&&!Lt&&!je&&!At&&!ft,Oa=!X&&!je&&!q&&Tt&&D.length===0,bn=()=>{if(!y)return;St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const t=d[y],n=vc(t.sections,K,u,g);if(!n)return;const{sections:s,newVariantIndex:o}=n;B.mutate({blockKey:y,data:{...t,sections:s}},{onSuccess:()=>{fe(o),L(null),A(null),W(null),T([]),se(null),ee(null)},onError:B.reportError})},$n=(t,n,s)=>{if(!y)return;St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const o=d[y],a=o.sections;if(!a||typeof a!="object"||Array.isArray(a))return;const i=a;if(!Array.isArray(i.variants))return;const l=t([...i.variants]);if(!l)return;const f=yc(i,l),R={...d,[y]:{...o,sections:f}};B.mutate({blockKey:y,data:R[y]},{onSuccess:()=>{n?.();const h=typeof s=="string"?[s]:s??[];(async()=>{for(const j of h)await qt(j,R)})()},onError:B.reportError})},Br=(t,n)=>{if(t===n)return;let s=te;te===t?s=n:t<te&&n>=te?s=te-1:t>te&&n<=te&&(s=te+1),fe(s);const o=Yn(pe.map(a=>({rule:a.rule})),t,n);is(o,s),$n(a=>Yn(a,t,n))},Kr=t=>{const n=pe[t]?.rule,s=Dt(n,d??{},u??void 0);$n(o=>o.length<=1?null:(o.splice(t,1),o),()=>{pe.length-1===1?fe(0):t<te?fe(te-1):t===te&&fe(Math.max(0,t-1)),L(null),A(null),W(null),T([]),se(null),ee(null)},s)},za=()=>{const t=pe.map((n,s)=>({variant:n,index:s})).filter(({variant:n})=>!wi(n.rule)).map(({variant:n})=>Dt(n.rule,d??{},u??void 0)).filter(n=>!!n);$n(n=>{const s=Oi({variants:n}),o=n[s];return o?[{...o,rule:zi(u)}]:null},()=>{fe(0),L(null),A(null),W(null),T([]),se(null),ee(null),Vn(!1)},t)},Mr=t=>{let n=t+1;$n(s=>(n=Xr(s,t,g),bc(s,t,g)),()=>{fe(n),L(null),A(null),W(null),T([]),se(null),ee(null)})},$a=async(t,n)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const s=re.current.activePageKey,o=re.current.decofile;if(!s)return;const a=o[s],i=a.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const l=i;if(!Array.isArray(l.variants))return;const f=[...l.variants],R=f[t];if(!R?.rule||typeof R.rule!="object"){H.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const h=R.rule,j=n.trim();en(!0);try{if(!j){if(!Jt(h,o,u)){F(null);return}const Q=h.__resolveType??"";f[t]={...R,rule:Ts(h,o,u)};const be={...o,[s]:{...a,sections:{...l,variants:f}}};await B.mutateAsync({blockKey:s,data:be[s]}),await qt(Q,be),F(null),k?.();return}const E=As(h,o,u);if(!E){H.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(E.blockKey){await B.mutateAsync({blockKey:E.blockKey,data:Ft(E.resolveType,E.data,j)}),F(null),k?.();return}const M=Jn(j),z=Qn(M,o,u);if(z){H.error(z);return}const ne=Ft(E.resolveType,E.data,j);let J=null,Ne=!1;try{const Q=await B.mutateAsync({blockKey:M,data:ne,create:!0});Ne=Un(Q),J=Ne?null:M,f[t]={...R,rule:cn(M)},await B.mutateAsync({blockKey:s,data:{...a,sections:{...l,variants:f}}}),J=null}catch(Q){throw J&&await Pn.mutateAsync({blockKey:J}).catch(()=>{}),Q}F(null),Ne||H.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:j})),k?.()}catch(E){H.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Kt(c,Mt(E))})}finally{en(!1)}},Wa=async(t,n)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{selectedSectionIndex:s,rawSections:o,parsedSections:a,decofile:i,activePageKey:l,pageVariants:f,variantIndex:R}=re.current;if(s===null||!l)return;const h=o[s],j=a[s];if(!h||!j?.isMultivariate)return;const E=pt(h,j);if(!E)return;const M=E.variants??[],z=M[t];if(!z?.rule||typeof z.rule!="object"){H.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const ne=z.rule,J=n.trim();en(!0);const Ne=async Q=>{const be={...E,variants:Q},Ie=[...o];Ie[s]=Bt(h,j,be);const he=ln(i,l,Ie,R,f);return await B.mutateAsync({blockKey:l,data:he}),{...i,[l]:he}};try{if(!J){if(!Jt(ne,i,u)){O(null);return}const Ze=ne.__resolveType??"",Nt=[...M];Nt[t]={...z,rule:Ts(ne,i,u)};const Ct=await Ne(Nt);await qt(Ze,Ct),O(null),k?.();return}const Q=As(ne,i,u);if(!Q){H.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(Q.blockKey){await B.mutateAsync({blockKey:Q.blockKey,data:Ft(Q.resolveType,Q.data,J)}),O(null),k?.();return}const be=Jn(J),Ie=Qn(be,i,u);if(Ie){H.error(Ie);return}const he=Ft(Q.resolveType,Q.data,J);let ue=null,Ge=!1;try{const Ze=await B.mutateAsync({blockKey:be,data:he,create:!0});Ge=Un(Ze),ue=Ge?null:be;const Nt=[...M];Nt[t]={...z,rule:cn(be)},await Ne(Nt),ue=null}catch(Ze){throw ue&&await Pn.mutateAsync({blockKey:ue}).catch(()=>{}),Ze}O(null),Ge||H.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:J})),k?.()}catch(Q){H.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Kt(c,Mt(Q))})}finally{en(!1)}},Dr=async(t,n,s)=>{A(s);try{await B.mutateAsync({blockKey:t,data:s})}catch(o){throw A(a=>a===s?n:a),o}},Ha={rename:async(t,n,s)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{activePageKey:o,decofile:a}=re.current;if(!o)return;const i=Array.isArray(t.variants)?[...t.variants]:[],l=i[n],f=l?.rule&&typeof l.rule=="object"?l.rule:void 0,R=async j=>{const E={...t,variants:j};return await Dr(o,t,E),{...a,[o]:E}},h=Mc(f,s,a,u);if(h.kind!=="noop"){if(h.kind==="error"){H.error(h.reason==="no-matcher-rule"?c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):h.reason==="unreadable-rule"?c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):h.message??c("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}en(!0);try{if(h.kind==="inline"){const M=[...i];M[n]={...l,rule:h.inlinedRule};const z=await R(M);await qt(h.blockKey,z),k?.();return}if(h.kind==="updateBlock"){await B.mutateAsync({blockKey:h.blockKey,data:h.blockData}),k?.();return}let j=null,E=!1;try{const M=await B.mutateAsync({blockKey:h.blockId,data:h.blockData,create:!0});E=Un(M),j=E?null:h.blockId;const z=[...i];z[n]={...l,rule:h.reference},await R(z),j=null}catch(M){throw j&&await Pn.mutateAsync({blockKey:j}).catch(()=>{}),M}E||H.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:s.trim()})),k?.()}catch(j){H.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Kt(c,Mt(j))})}finally{en(!1)}}},selectGlobal:async(t,n,s)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{activePageKey:o,decofile:a}=re.current;if(!o)return;const i=Array.isArray(t.variants)?[...t.variants]:[],l=i[n];if(!l)return;const f=Dt(l.rule,a,u);i[n]={...l,rule:cn(s)};const R={...t,variants:i},h={...a,[o]:R};try{await Dr(o,t,R),f&&f!==s&&await qt(f,h),k?.()}catch(j){H.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Kt(c,Mt(j))})}},selectNamedRule:async(t,n,s)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{activePageKey:o,decofile:a}=re.current;if(!o)return;let i=null;!await In(s,a,f=>{const R=Array.isArray(t.variants)?[...t.variants]:[],h=R[n];return h?(R[n]={...h,rule:f},i={...t,variants:R},{blockKey:o,data:i}):null})||!i||(A(i),k?.())}},Fr=()=>{Wt(),g&&$t(null,-1,0)},Ir=t=>{dn(t),ds({inner:t})},Lr=t=>{An(t),ds({raw:t})},Or=()=>{dn(null),Ot([])},zr=()=>Yt(t=>t+1),$r=()=>{fn.flush(),un(!1),dn(null),An(void 0),Ot([]),Yt(t=>t+1),ge?.()},qa=()=>{Vn(!1),Tn(!1),L(null),un(!0)},Ga=()=>{je&&$r(),L(null),Vn(!0)},Ua=()=>Tn(!0),vs=t=>{if(Qt&&t===0){Vn(!1);return}if(Lt&&t<2){Tn(!1),t===0&&L(null);return}if(je){if(t===0){$r();return}if(t===1){Ot([]),Yt(s=>s+1);return}Ot(Ms.slice(0,t-1)),Yt(s=>s+1);return}if(q){T(D.slice(0,t)),$(s=>s+1);return}if(t===0){Fr();return}if(t===1){T([]),$(s=>s+1);return}const n=!X&&Tt&&kt?1:0;if(n===1&&t===2){T([]),$(s=>s+1);return}T(D.slice(0,t-1-n))},ys=zn.length>1?r.jsx("button",{type:"button",onClick:()=>vs(gl(zn.length,{isMultivariateSectionTop:Oa})),title:c("sectionsEditor.sectionsEditor.back"),"aria-label":c("sectionsEditor.sectionsEditor.back"),className:le("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",ft?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:r.jsx(Ui,{className:"size-4"})}):null,Ja=ft||At||je?Ma&&r.jsxs("div",{className:le("border-b px-3 py-2.5",ft&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[r.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!q&&yt&&Se&&r.jsxs("button",{type:"button",onClick:Fr,title:c("sectionsEditor.sectionsEditor.editingInVariant",{variant:Se.label}),className:le("shrink-0 inline-flex items-center gap-1 rounded-lg h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",cl),children:[r.jsx(ll,{rule:js(Se.rule,d??{},u??void 0),matchers:sn}),r.jsx("span",{className:"max-w-[160px] truncate",children:Se.label})]}),r.jsx("div",{className:"flex-1"}),ft&&r.jsxs(jt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Zn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(Et,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Ar&&r.jsx(qn,{onClick:()=>Sn()})]}),ft&&r.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:c("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):r.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[r.jsx("div",{className:"flex-1 min-w-0",children:r.jsx(uo,{pageKey:y,initialName:oe.name,initialPath:oe.path,onFieldChange:lr,variant:"header"})}),r.jsxs(jt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:()=>un(!0),children:r.jsx(io,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),r.jsxs(jt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>Le&&y?Le():bt(!0),children:r.jsx(lo,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]}),r.jsx(qn,{onClick:bn})]}),Qa=r.jsxs(r.Fragment,{children:[yt&&y&&r.jsx(fo,{listKey:y,variants:pe,activeIndex:te,decofile:d??{},meta:u,matchers:sn,onSelect:cs,onReorder:Br,onRename:F,onDuplicate:Mr,onDelete:Kr,onAdd:bn}),yt&&Y!==null&&r.jsx(mo,{className:"mt-3",children:r.jsx("div",{className:le("space-y-3",Xt&&"pointer-events-none opacity-50"),children:r.jsx(ks,{currentRt:Y,currentLabel:_n(Se?.rule,d??{},we,u??void 0),currentGlobalKey:Dt(Se?.rule,d??{},u??void 0)??void 0,matchers:sn,globals:fs,onSelect:gr,onSelectGlobal:br,named:ms(Se?.rule,Sr),namedRow:ws(Se?.rule,Ht),rule:Se?.rule,schema:pr,formValue:Ke,onChange:vr,formKey:`${te}:${Y??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:d,onSaveReferencedBlock:mn,sandbox:gn})})})]}),Wr=r.jsxs(r.Fragment,{children:[r.jsx(ul,{listKey:`${y??""}:${m??""}`,variants:Vt.map((t,n)=>({index:n,label:t.label})),selectedIndex:Ln,onSelect:ur,onRename:O,onDuplicate:Ra,onDelete:ja,onRemoveAll:dr,onReorder:Ea,onAdd:()=>Sn()}),r.jsx(mo,{children:r.jsx(ks,{currentRt:Zt??"",currentLabel:_n(kt?.rule,d??{},we,u??void 0),currentGlobalKey:Dt(kt?.rule,d??{},u??void 0)??void 0,matchers:sn,globals:fs,onSelect:Ta,onSelectGlobal:Ca,named:ms(kt?.rule,Na),namedRow:ws(kt?.rule,Ht),rule:kt?.rule,schema:Ba,formValue:Ho,onChange:Aa,formKey:`${m??"none"}:${Ln}:${Zt??""}`,formWrapperClassName:"pt-1",meta:u??void 0,decofile:d,onSaveReferencedBlock:mn,sandbox:gn})})]}),Hr=r.jsx("div",{className:le(X?"px-2":"p-2 pt-3"),children:r.jsx(Bc,{listKey:`${y??""}-${te}`,rawSections:K,sections:ce,meta:u,decofile:d,selectedIndex:m,onSelect:t=>{ga(t),Je?.(t)},onReorder:va,onDelete:ya,onDuplicate:Sa,onMakeReusable:Ve,onToggleHidden:ba,onToggleLazy:rt?xa:void 0,onAddVariant:Sn,onDetach:_a,onAddSection:()=>He(!0),canAddSection:mr})}),Ya=r.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[y&&oe&&r.jsx(uo,{pageKey:y,initialName:oe.name,initialPath:oe.path,onFieldChange:lr}),nn&&y?r.jsx(Vo,{rawSeo:Kn,innerSeo:as,defaultResolveType:Qs,seoTypesLoading:g&&!u,seoSchema:Ys,activeResolveType:Mn,seoTypeOptions:Js,formResetKey:Ds,siteDefaultSeo:Zs,onBreadcrumbChange:Ot,onPersistRaw:Lr,onInnerChange:Ir,onClearForm:Or,onBumpFormKey:zr,asyncRenderAvailable:rt}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),Za=r.jsx(an,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:r.jsx("div",{className:"mx-auto max-w-2xl",children:nn&&y?r.jsx(Vo,{rawSeo:Kn,innerSeo:as,defaultResolveType:Qs,seoTypesLoading:g&&!u,seoSchema:Ys,activeResolveType:Mn,seoTypeOptions:Js,formResetKey:Ds,siteDefaultSeo:Zs,onBreadcrumbChange:Ot,onPersistRaw:Lr,onInnerChange:Ir,onClearForm:Or,onBumpFormKey:zr,asyncRenderAvailable:rt}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),Xa=r.jsxs(an,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[yt&&y&&r.jsx(fo,{listKey:y,variants:pe,activeIndex:te,decofile:d??{},meta:u,matchers:sn,onSelect:cs,onReorder:Br,onRename:F,onDuplicate:Mr,onDelete:Kr,onAdd:bn}),yt&&Y!==null&&r.jsxs("div",{className:le("px-3 border-b",En?"pt-3 pb-5 space-y-3":"py-2"),children:[r.jsxs("button",{type:"button",onClick:()=>$o(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-[var(--studio-control-radius,var(--radius-sm))] py-0.5 hover:bg-accent","aria-expanded":En,children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c("sectionsEditor.sectionsEditor.variantRule")}),En?r.jsx(Ji,{className:"size-3.5 shrink-0 text-muted-foreground"}):r.jsx(Gi,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),En&&r.jsx("div",{className:le("space-y-3",Xt&&"pointer-events-none opacity-50"),children:r.jsx(ks,{currentRt:Y,currentLabel:_n(Se?.rule,d??{},we,u??void 0),currentGlobalKey:Dt(Se?.rule,d??{},u??void 0)??void 0,matchers:sn,globals:fs,onSelect:gr,onSelectGlobal:br,named:ms(Se?.rule,Sr),namedRow:ws(Se?.rule,Ht),rule:Se?.rule,schema:pr,formValue:Ke,onChange:vr,formKey:`${te}:${Y??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:d,onSaveReferencedBlock:mn,sandbox:gn})})]}),Hr]},"editor-section-list");return r.jsx(ic,{value:g,children:r.jsx(dl,{children:r.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!X&&ys&&r.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:ys}),(X||zn.length>1)&&r.jsx(Wi,{crumbs:zn,onSelect:vs,onSelectRoot:()=>{fn.flush(),Ue?Ue():vs(0)}}),r.jsx("div",{className:"shrink-0",children:X?r.jsxs("div",{className:le("flex items-center gap-2 border-b px-3 py-2.5",ft&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[X&&ys,ft&&r.jsxs(jt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Zn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(Et,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),r.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[r.jsx("span",{className:"truncate text-sm font-semibold",children:La}),Pr&&r.jsx("span",{className:"truncate text-xs text-muted-foreground",children:Pr})]}),gs&&yt&&Se&&r.jsx(po,{variants:pe,activeIndex:te,onSelect:cs,onManage:Ga,onRemoveAll:za}),Fa&&r.jsx(po,{variants:Vt,activeIndex:Ln,onSelect:ur,onManage:Ua,onRemoveAll:dr}),gs&&!yt&&r.jsx(qn,{onClick:bn}),Da&&r.jsx(qn,{onClick:()=>Sn()}),r.jsx(fl,{}),gs&&r.jsxs(r.Fragment,{children:[r.jsxs(jt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"outline",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:qa,children:r.jsx(io,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),!Le&&r.jsxs(jt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"outline",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>bt(!0),children:r.jsx(lo,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):Ja}),ut&&r.jsx(mi,{open:!0,fields:pi(ut.plan,ut.target.schema),choices:ut.choices,changedAgain:ut.changedAgain,author:Ws??null,authorPending:Ws===void 0,fieldsAsLabeled:$s!==null,fresh:ut.fresh,keepTyping:g,onChoose:(t,n)=>ha({...ut.choices,[t]:n}),onApply:pa},Ic(ut.formBase)),Lt?r.jsx(ho,{onAdd:()=>Sn(),children:Wr},"editor-section-variants"):At?r.jsxs(an,{viewportRef:me,onBlur:nr,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!X&&Tt&&Vt.length>0&&D.length===0&&Wr,r.jsx(To,{value:yr,children:r.jsx(go,{value:q&&g?Be:null,children:r.jsx(vo,{activeSchema:Fn,formValue:Xe,formResetKey:Me,onFormChange:ir,onBreadcrumbChange:T,breadcrumbPath:D,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:u,decofile:d,onSaveReferencedBlock:mn,sandbox:gn,previewBaseUrl:st,onRequestAddSection:cr,onVariantMatcherOp:q?Ha:void 0})})})]},"editor-section-form"):q?r.jsx(an,{viewportRef:me,onBlur:nr,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx(To,{value:yr,children:r.jsx(go,{value:q&&g?Be:null,children:r.jsx(vo,{activeSchema:Fn,formValue:Xe,formResetKey:Me,onFormChange:ir,onBreadcrumbChange:T,breadcrumbPath:D,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:u,decofile:d,onSaveReferencedBlock:mn,sandbox:gn,previewBaseUrl:st,onRequestAddSection:cr})})})},"editor-global-block"):je?X?r.jsx(an,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"p-3",children:Ya})},"editor-seo"):Za:Qt?r.jsx(ho,{onAdd:bn,children:Qa},"editor-variants"):X?r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[r.jsx(an,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"py-2",children:Hr})}),r.jsx("div",{className:"shrink-0 border-t p-2",children:r.jsx(Ns,{canAddSection:mr,onAddSection:()=>He(!0)})})]},"editor-section-list"):Xa,r.jsx(ml,{open:ie!==null,onOpenChange:t=>{t||Ve(null)},defaultBlockId:ie!==null?Jn(ce[ie]?.label??""):"",isPending:B.isPending,onSubmit:Va}),ot&&r.jsx(ec,{open:Ae,onOpenChange:t=>{He(t),t||(Rn.current=null)},meta:u,decofile:d,previewBaseUrl:st,onSelect:wa}),ht&&y&&d&&r.jsx(nc,{open:ht,onOpenChange:bt,pageKey:y,decofile:d}),Te!==null&&r.jsx(yo,{open:!0,initialName:Jt(pe[Te]?.rule,d??{},u??void 0)?_n(pe[Te]?.rule,d??{},we,u??void 0):"",autoLabel:we(js(pe[Te]?.rule,d??{},u??void 0)),isPending:Xt,onSubmit:async t=>{await $a(Te,t)},onOpenChange:t=>{!t&&!Xt&&F(null)}}),tt!==null&&r.jsx(yo,{open:!0,initialName:Jt(Vt[tt]?.rule,d??{},u??void 0)?_n(Vt[tt]?.rule,d??{},we,u??void 0):"",autoLabel:we(js(Vt[tt]?.rule,d??{},u??void 0)),isPending:Xt,onSubmit:async t=>{await Wa(tt,t)},onOpenChange:t=>{!t&&!Xt&&O(null)}})]})})})}export{Of as SectionsEditor};
@@ -1 +1 @@
1
- import{r as d,b_ as rt,b$ as _e,j as c,c0 as st,c1 as Ie,c2 as k,c3 as lt,c4 as j,c5 as N,c6 as $,c7 as at,c8 as Ee,c9 as Re,ca as it,cb as ct,cc as dt,cd as ut,ce as pt,cf as ft,cg as mt,ch as ht,ci as vt,cj as gt,ck as xt,cl as St,c as ee,m as oe,aW as wt}from"./index-DLuam-oO.js";import{c as Ne}from"./index-BdQq_4o_.js";import{V as Ct}from"./index-DKfNWn49.js";import{t as je}from"./ChevronDown-rYBqLYZM.js";import{n as yt}from"./ChevronUp-DH1sZis7.js";var bt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,Tt]=it(J),[ne]=vt(J,[Tt,Re]),pe=Re(),[_t,G]=ne(J),[Nt,Pt]=ne(J),Me=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:l,value:s,defaultValue:a,onValueChange:i,dir:u,name:f,autoComplete:m,disabled:w,required:C,form:S}=r,p=pe(e),[g,y]=d.useState(null),[v,x]=d.useState(null),[F,M]=d.useState(!1),re=rt(u),[P,O]=_e({prop:o,defaultProp:n??!1,onChange:l,caller:J}),[U,q]=_e({prop:s,defaultProp:a,onChange:i,caller:J}),L=d.useRef(null),B=g?S||!!g.closest("form"):!0,[W,V]=d.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return c.jsx(st,{...p,children:c.jsxs(_t,{required:C,scope:e,trigger:g,onTriggerChange:y,valueNode:v,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:Ie(),value:U,onValueChange:q,open:P,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:w,children:[c.jsx(de.Provider,{scope:e,children:c.jsx(Nt,{scope:r.__scopeSelect,onNativeOptionAdd:d.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:d.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?c.jsxs(et,{"aria-hidden":!0,required:C,tabIndex:-1,name:f,autoComplete:m,value:U,onChange:E=>q(E.target.value),disabled:w,form:S,children:[U===void 0?c.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};Me.displayName=J;var Ae="SelectTrigger",Oe=d.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,l=pe(t),s=G(Ae,t),a=s.disabled||o,i=k(e,s.onTriggerChange),u=ue(t),f=d.useRef("touch"),[m,w,C]=ot(p=>{const g=u().filter(x=>!x.disabled),y=g.find(x=>x.value===s.value),v=nt(g,p,y);v!==void 0&&s.onValueChange(v.value)}),S=p=>{a||(s.onOpenChange(!0),C()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return c.jsx(lt,{asChild:!0,...l,children:c.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":tt(s.value)?"":void 0,...n,ref:i,onClick:N(n.onClick,p=>{p.currentTarget.focus(),f.current!=="mouse"&&S(p)}),onPointerDown:N(n.onPointerDown,p=>{f.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:N(n.onKeyDown,p=>{const g=m.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&w(p.key),!(g&&p.key===" ")&&bt.includes(p.key)&&(S(),p.preventDefault())})})})});Oe.displayName=Ae;var De="SelectValue",ke=d.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:l,placeholder:s="",...a}=r,i=G(De,t),{onValueNodeHasChildrenChange:u}=i,f=l!==void 0,m=k(e,i.onValueNodeChange);return $(()=>{u(f)},[u,f]),c.jsx(j.span,{...a,ref:m,style:{pointerEvents:"none"},children:tt(i.value)?c.jsx(c.Fragment,{children:s}):l})});ke.displayName=De;var Et="SelectIcon",Le=d.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return c.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});Le.displayName=Et;var Rt="SelectPortal",Be=r=>c.jsx(at,{asChild:!0,...r});Be.displayName=Rt;var Q="SelectContent",Ve=d.forwardRef((r,e)=>{const t=G(Q,r.__scopeSelect),[o,n]=d.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const l=o;return l?Ee.createPortal(c.jsx(He,{scope:r.__scopeSelect,children:c.jsx(de.Slot,{scope:r.__scopeSelect,children:c.jsx("div",{children:r.children})})}),l):null}return c.jsx(ze,{...r,ref:e})});Ve.displayName=Q;var A=10,[He,Y]=ne(Q),jt="SelectContentImpl",Mt=gt("SelectContent.RemoveScroll"),ze=d.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:l,onPointerDownOutside:s,side:a,sideOffset:i,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:w,collisionPadding:C,sticky:S,hideWhenDetached:p,avoidCollisions:g,...y}=r,v=G(Q,t),[x,F]=d.useState(null),[M,re]=d.useState(null),P=k(e,h=>F(h)),[O,U]=d.useState(null),[q,L]=d.useState(null),B=ue(t),[W,V]=d.useState(!1),H=d.useRef(!1);d.useEffect(()=>{if(x)return ut(x)},[x]),pt();const E=d.useCallback(h=>{const[T,...R]=B().map(_=>_.ref.current),[b]=R.slice(-1),I=document.activeElement;for(const _ of h)if(_===I||(_?.scrollIntoView({block:"nearest"}),_===T&&M&&(M.scrollTop=0),_===b&&M&&(M.scrollTop=M.scrollHeight),_?.focus(),document.activeElement!==I))return},[B,M]),D=d.useCallback(()=>E([O,x]),[E,O,x]);d.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=v;d.useEffect(()=>{if(x){let h={x:0,y:0};const T=b=>{h={x:Math.abs(Math.round(b.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(b.pageY)-(K.current?.y??0))}},R=b=>{h.x<=10&&h.y<=10?b.preventDefault():x.contains(b.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),d.useEffect(()=>{const h=()=>z(!1);return window.addEventListener("blur",h),window.addEventListener("resize",h),()=>{window.removeEventListener("blur",h),window.removeEventListener("resize",h)}},[z]);const[fe,ae]=ot(h=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),b=nt(T,h,R);b&&setTimeout(()=>b.ref.current.focus())}),me=d.useCallback((h,T,R)=>{const b=!H.current&&!R;(v.value!==void 0&&v.value===T||b)&&(U(h),b&&(H.current=!0))},[v.value]),he=d.useCallback(()=>x?.focus(),[x]),te=d.useCallback((h,T,R)=>{const b=!H.current&&!R;(v.value!==void 0&&v.value===T||b)&&L(h)},[v.value]),ie=o==="popper"?Se:Fe,se=ie===Se?{side:a,sideOffset:i,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:w,collisionPadding:C,sticky:S,hideWhenDetached:p,avoidCollisions:g}:{};return c.jsx(He,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:c.jsx(ft,{as:Mt,allowPinchZoom:!0,children:c.jsx(mt,{asChild:!0,trapped:v.open,onMountAutoFocus:h=>{h.preventDefault()},onUnmountAutoFocus:N(n,h=>{v.trigger?.focus({preventScroll:!0}),h.preventDefault()}),children:c.jsx(ht,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:h=>h.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:c.jsx(ie,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:h=>h.preventDefault(),...y,...se,onPlaced:()=>V(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:N(y.onKeyDown,h=>{const T=h.ctrlKey||h.altKey||h.metaKey;if(h.key==="Tab"&&h.preventDefault(),!T&&h.key.length===1&&ae(h.key),["ArrowUp","ArrowDown","Home","End"].includes(h.key)){let b=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(h.key)&&(b=b.slice().reverse()),["ArrowUp","ArrowDown"].includes(h.key)){const I=h.target,_=b.indexOf(I);b=b.slice(_+1)}setTimeout(()=>E(b)),h.preventDefault()}})})})})})})});ze.displayName=jt;var At="SelectItemAlignedPosition",Fe=d.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,l=G(Q,t),s=Y(Q,t),[a,i]=d.useState(null),[u,f]=d.useState(null),m=k(e,P=>f(P)),w=ue(t),C=d.useRef(!1),S=d.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:y,focusSelectedItem:v}=s,x=d.useCallback(()=>{if(l.trigger&&l.valueNode&&a&&u&&p&&g&&y){const P=l.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=l.valueNode.getBoundingClientRect(),q=y.getBoundingClientRect();if(l.dir!=="rtl"){const I=q.left-O.left,_=U.left-I,X=P.left-_,Z=P.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(_,[A,Math.max(A,ge-ve)]);a.style.minWidth=Z+"px",a.style.left=xe+"px"}else{const I=O.right-q.right,_=window.innerWidth-U.right-I,X=window.innerWidth-P.right-_,Z=P.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(_,[A,Math.max(A,ge-ve)]);a.style.minWidth=Z+"px",a.style.right=xe+"px"}const L=w(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(g.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=P.top+P.height/2-A,ie=B-te,se=g.offsetHeight/2,h=g.offsetTop+se,T=H+E+h,R=K-T;if(T<=te){const I=L.length>0&&g===L[L.length-1].ref.current;a.style.bottom="0px";const _=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ie,se+(I?he:0)+_+D),Z=T+X;a.style.height=Z+"px"}else{const I=L.length>0&&g===L[0].ref.current;a.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;a.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}a.style.margin=`${A}px 0`,a.style.minHeight=fe+"px",a.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>C.current=!0)}},[w,l.trigger,l.valueNode,a,u,p,g,y,l.dir,o]);$(()=>x(),[x]);const[F,M]=d.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=d.useCallback(P=>{P&&S.current===!0&&(x(),v?.(),S.current=!1)},[x,v]);return c.jsx(Dt,{scope:t,contentWrapper:a,shouldExpandOnScrollRef:C,onScrollButtonChange:re,children:c.jsx("div",{ref:i,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:c.jsx(j.div,{...n,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});Fe.displayName=At;var Ot="SelectPopperPosition",Se=d.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...l}=r,s=pe(t);return c.jsx(xt,{...s,...l,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=Ot;var[Dt,Te]=ne(Q,{}),we="SelectViewport",Ue=d.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,l=Y(we,t),s=Te(we,t),a=k(e,l.onViewportChange),i=d.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),c.jsx(de.Slot,{scope:t,children:c.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:N(n.onScroll,u=>{const f=u.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:w}=s;if(w?.current&&m){const C=Math.abs(i.current-f.scrollTop);if(C>0){const S=window.innerHeight-A*2,p=parseFloat(m.style.minHeight),g=parseFloat(m.style.height),y=Math.max(p,g);if(y<S){const v=y+C,x=Math.min(S,v),F=v-x;m.style.height=x+"px",m.style.bottom==="0px"&&(f.scrollTop=F>0?F:0,m.style.justifyContent="flex-end")}}}i.current=f.scrollTop})})})]})});Ue.displayName=we;var We="SelectGroup",[kt,Lt]=ne(We),Bt=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=Ie();return c.jsx(kt,{scope:t,id:n,children:c.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Bt.displayName=We;var Ke="SelectLabel",Vt=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=Lt(Ke,t);return c.jsx(j.div,{id:n.id,...o,ref:e})});Vt.displayName=Ke;var ce="SelectItem",[Ht,$e]=ne(ce),Ge=d.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:l,...s}=r,a=G(ce,t),i=Y(ce,t),u=a.value===o,[f,m]=d.useState(l??""),[w,C]=d.useState(!1),S=k(e,v=>i.itemRefCallback?.(v,o,n)),p=Ie(),g=d.useRef("touch"),y=()=>{n||(a.onValueChange(o),a.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(Ht,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:d.useCallback(v=>{m(x=>x||(v?.textContent??"").trim())},[]),children:c.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:f,children:c.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":w?"":void 0,"aria-selected":u&&w,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:N(s.onFocus,()=>C(!0)),onBlur:N(s.onBlur,()=>C(!1)),onClick:N(s.onClick,()=>{g.current!=="mouse"&&y()}),onPointerUp:N(s.onPointerUp,()=>{g.current==="mouse"&&y()}),onPointerDown:N(s.onPointerDown,v=>{g.current=v.pointerType}),onPointerMove:N(s.onPointerMove,v=>{g.current=v.pointerType,n?i.onItemLeave?.():g.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(s.onPointerLeave,v=>{v.currentTarget===document.activeElement&&i.onItemLeave?.()}),onKeyDown:N(s.onKeyDown,v=>{i.searchRef?.current!==""&&v.key===" "||(It.includes(v.key)&&y(),v.key===" "&&v.preventDefault())})})})})});Ge.displayName=ce;var le="SelectItemText",Ye=d.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...l}=r,s=G(le,t),a=Y(le,t),i=$e(le,t),u=Pt(le,t),[f,m]=d.useState(null),w=k(e,y=>m(y),i.onItemTextChange,y=>a.itemTextRefCallback?.(y,i.value,i.disabled)),C=f?.textContent,S=d.useMemo(()=>c.jsx("option",{value:i.value,disabled:i.disabled,children:C},i.value),[i.disabled,i.value,C]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=u;return $(()=>(p(S),()=>g(S)),[p,g,S]),c.jsxs(c.Fragment,{children:[c.jsx(j.span,{id:i.textId,...l,ref:w}),i.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ee.createPortal(l.children,s.valueNode):null]})});Ye.displayName=le;var qe="SelectItemIndicator",Xe=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return $e(qe,t).isSelected?c.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});Xe.displayName=qe;var Ce="SelectScrollUpButton",Ze=d.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,l]=d.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let a=function(){const u=i.scrollTop>0;l(u)};const i=t.viewport;return a(),i.addEventListener("scroll",a),()=>i.removeEventListener("scroll",a)}},[t.viewport,t.isPositioned]),n?c.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:i}=t;a&&i&&(a.scrollTop=a.scrollTop-i.offsetHeight)}}):null});Ze.displayName=Ce;var ye="SelectScrollDownButton",Je=d.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,l]=d.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let a=function(){const u=i.scrollHeight-i.clientHeight,f=Math.ceil(i.scrollTop)<u;l(f)};const i=t.viewport;return a(),i.addEventListener("scroll",a),()=>i.removeEventListener("scroll",a)}},[t.viewport,t.isPositioned]),n?c.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:i}=t;a&&i&&(a.scrollTop=a.scrollTop+i.offsetHeight)}}):null});Je.displayName=ye;var Qe=d.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,l=Y("SelectScrollButton",t),s=d.useRef(null),a=ue(t),i=d.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return d.useEffect(()=>()=>i(),[i]),$(()=>{a().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),c.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:N(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:N(n.onPointerMove,()=>{l.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:N(n.onPointerLeave,()=>{i()})})}),zt="SelectSeparator",Ft=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return c.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});Ft.displayName=zt;var be="SelectArrow",Ut=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),l=G(be,t),s=Y(be,t);return l.open&&s.position==="popper"?c.jsx(St,{...n,...o,ref:e}):null});Ut.displayName=be;var Wt="SelectBubbleInput",et=d.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=d.useRef(null),l=k(o,n),s=ct(e);return d.useEffect(()=>{const a=n.current;if(!a)return;const i=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(i,"value").set;if(s!==e&&f){const m=new Event("change",{bubbles:!0});f.call(a,e),a.dispatchEvent(m)}},[s,e]),c.jsx(j.select,{...t,style:{...Ct,...t.style},ref:l,defaultValue:e})});et.displayName=Wt;function tt(r){return r===""||r===void 0}function ot(r){const e=dt(r),t=d.useRef(""),o=d.useRef(0),n=d.useCallback(s=>{const a=t.current+s;e(a),(function i(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>i(""),1e3))})(a)},[e]),l=d.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,l]}function nt(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,l=t?r.indexOf(t):-1;let s=Kt(r,Math.max(l,0));n.length===1&&(s=s.filter(u=>u!==t));const i=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return i!==t?i:void 0}function Kt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var $t=Me,Gt=Oe,Yt=ke,qt=Le,Xt=Be,Zt=Ve,Jt=Ue,Qt=Ge,Pe=Ye,eo=Xe,to=Ze,oo=Je;function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=c.jsx($t,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=c.jsx(Yt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function fo(r){const e=ee.c(15);let t,o,n,l,s;e[0]!==r?({className:o,size:l,variant:s,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=l,e[5]=s):(t=e[1],o=e[2],n=e[3],l=e[4],s=e[5]);const a=l===void 0?"default":l,i=s===void 0?"outline":s;let u;e[6]!==o?(u=oe("data-[placeholder]:text-subtle-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-ring aria-invalid:bg-destructive/10 aria-invalid:shadow-[inset_0_0_0_1px_var(--destructive)] flex w-fit items-center justify-between gap-1.5 px-3 text-sm whitespace-nowrap transition-[color,background-color,box-shadow] outline-none disabled:text-subtle-foreground disabled:pointer-events-none","data-[variant=outline]:rounded-[var(--studio-control-radius,var(--radius-lg))] data-[variant=outline]:bg-[var(--studio-input-background)] data-[variant=outline]:shadow-edge data-[variant=outline]:hover:bg-sidebar","data-[variant=filled]:rounded-full data-[variant=filled]:bg-muted data-[variant=filled]:hover:bg-secondary-hover","data-[variant=pill]:rounded-full data-[variant=pill]:bg-card data-[variant=pill]:shadow-edge data-[variant=pill]:hover:bg-[var(--studio-outline-hover-background)]","data-[size=default]:h-[var(--studio-control-height,2.25rem)] data-[size=default]:pl-4 data-[size=sm]:h-8 data-[size=xs]:h-7 data-[size=xs]:px-2.5 data-[size=xs]:text-xs data-[size=xs]:font-medium","*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",o),e[6]=o,e[7]=u):u=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=c.jsx(qt,{asChild:!0,children:c.jsx(je,{className:"size-3.5 stroke-[1.5]"})}),e[8]=f):f=e[8];let m;return e[9]!==t||e[10]!==n||e[11]!==a||e[12]!==u||e[13]!==i?(m=c.jsxs(Gt,{"data-slot":"select-trigger","data-size":a,"data-variant":i,className:u,...n,children:[t,f]}),e[9]=t,e[10]=n,e[11]=a,e[12]=u,e[13]=i,e[14]=m):m=e[14],m}function mo(r){const e=ee.c(25);let t,o,n,l,s;e[0]!==r?({className:o,children:t,position:l,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=l,e[5]=s):(t=e[1],o=e[2],n=e[3],l=e[4],s=e[5]);const a=l===void 0?"popper":l,i=s===void 0?!1:s,u=a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let f;e[6]!==o||e[7]!==u?(f=oe("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-[var(--studio-surface-radius,var(--radius-lg))] border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=f):f=e[8];let m;e[9]!==i?(m=!i&&c.jsx(no,{}),e[9]=i,e[10]=m):m=e[10];const w=a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let C;e[11]!==w?(C=oe("p-1",w),e[11]=w,e[12]=C):C=e[12];let S;e[13]!==t||e[14]!==C?(S=c.jsx(Jt,{className:C,children:t}),e[13]=t,e[14]=C,e[15]=S):S=e[15];let p;e[16]!==i?(p=!i&&c.jsx(ro,{}),e[16]=i,e[17]=p):p=e[17];let g;return e[18]!==a||e[19]!==n||e[20]!==f||e[21]!==m||e[22]!==S||e[23]!==p?(g=c.jsx(Xt,{children:c.jsxs(Zt,{"data-slot":"select-content",translate:"no",className:f,position:a,...n,children:[m,S,p]})}),e[18]=a,e[19]=n,e[20]=f,e[21]=m,e[22]=S,e[23]=p,e[24]=g):g=e[24],g}function ho(r){const e=ee.c(19);let t,o,n,l,s;e[0]!==r?({className:o,children:t,description:n,hideCheck:s,...l}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=l,e[5]=s):(t=e[1],o=e[2],n=e[3],l=e[4],s=e[5]);const a=s===void 0?!1:s,i=n&&"items-start py-2";let u;e[6]!==o||e[7]!==i?(u=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",i,o),e[6]=o,e[7]=i,e[8]=u):u=e[8];let f;e[9]!==a?(f=!a&&c.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:c.jsx(eo,{children:c.jsx(wt,{className:"size-4"})})}),e[9]=a,e[10]=f):f=e[10];let m;e[11]!==t||e[12]!==n?(m=n?c.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[c.jsx(Pe,{children:t}),c.jsx("span",{className:"text-xs text-muted-foreground whitespace-normal",children:n})]}):c.jsx(Pe,{children:t}),e[11]=t,e[12]=n,e[13]=m):m=e[13];let w;return e[14]!==l||e[15]!==u||e[16]!==f||e[17]!==m?(w=c.jsxs(Qt,{"data-slot":"select-item",className:u,...l,children:[f,m]}),e[14]=l,e[15]=u,e[16]=f,e[17]=m,e[18]=w):w=e[18],w}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsx(yt,{className:"size-4"}),e[5]=l):l=e[5];let s;return e[6]!==o||e[7]!==n?(s=c.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:l}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsx(je,{className:"size-4"}),e[5]=l):l=e[5];let s;return e[6]!==o||e[7]!==n?(s=c.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:l}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{uo as S,po as a,fo as b,ho as c,mo as d};
1
+ import{r as d,b_ as rt,b$ as _e,j as c,c0 as st,c1 as Ie,c2 as k,c3 as lt,c4 as j,c5 as N,c6 as $,c7 as at,c8 as Ee,c9 as Re,ca as it,cb as ct,cc as dt,cd as ut,ce as pt,cf as ft,cg as mt,ch as ht,ci as vt,cj as gt,ck as xt,cl as St,c as ee,m as oe,aW as wt}from"./index-7zGhlT8r.js";import{c as Ne}from"./index-BdQq_4o_.js";import{V as Ct}from"./index-Dpa0nN_7.js";import{t as je}from"./ChevronDown-Cgrp93vj.js";import{n as yt}from"./ChevronUp-CY-2sTeM.js";var bt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,Tt]=it(J),[ne]=vt(J,[Tt,Re]),pe=Re(),[_t,G]=ne(J),[Nt,Pt]=ne(J),Me=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:l,value:s,defaultValue:a,onValueChange:i,dir:u,name:f,autoComplete:m,disabled:w,required:C,form:S}=r,p=pe(e),[g,y]=d.useState(null),[v,x]=d.useState(null),[F,M]=d.useState(!1),re=rt(u),[P,O]=_e({prop:o,defaultProp:n??!1,onChange:l,caller:J}),[U,q]=_e({prop:s,defaultProp:a,onChange:i,caller:J}),L=d.useRef(null),B=g?S||!!g.closest("form"):!0,[W,V]=d.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return c.jsx(st,{...p,children:c.jsxs(_t,{required:C,scope:e,trigger:g,onTriggerChange:y,valueNode:v,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:Ie(),value:U,onValueChange:q,open:P,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:w,children:[c.jsx(de.Provider,{scope:e,children:c.jsx(Nt,{scope:r.__scopeSelect,onNativeOptionAdd:d.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:d.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?c.jsxs(et,{"aria-hidden":!0,required:C,tabIndex:-1,name:f,autoComplete:m,value:U,onChange:E=>q(E.target.value),disabled:w,form:S,children:[U===void 0?c.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};Me.displayName=J;var Ae="SelectTrigger",Oe=d.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,l=pe(t),s=G(Ae,t),a=s.disabled||o,i=k(e,s.onTriggerChange),u=ue(t),f=d.useRef("touch"),[m,w,C]=ot(p=>{const g=u().filter(x=>!x.disabled),y=g.find(x=>x.value===s.value),v=nt(g,p,y);v!==void 0&&s.onValueChange(v.value)}),S=p=>{a||(s.onOpenChange(!0),C()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return c.jsx(lt,{asChild:!0,...l,children:c.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":tt(s.value)?"":void 0,...n,ref:i,onClick:N(n.onClick,p=>{p.currentTarget.focus(),f.current!=="mouse"&&S(p)}),onPointerDown:N(n.onPointerDown,p=>{f.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:N(n.onKeyDown,p=>{const g=m.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&w(p.key),!(g&&p.key===" ")&&bt.includes(p.key)&&(S(),p.preventDefault())})})})});Oe.displayName=Ae;var De="SelectValue",ke=d.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:l,placeholder:s="",...a}=r,i=G(De,t),{onValueNodeHasChildrenChange:u}=i,f=l!==void 0,m=k(e,i.onValueNodeChange);return $(()=>{u(f)},[u,f]),c.jsx(j.span,{...a,ref:m,style:{pointerEvents:"none"},children:tt(i.value)?c.jsx(c.Fragment,{children:s}):l})});ke.displayName=De;var Et="SelectIcon",Le=d.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return c.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});Le.displayName=Et;var Rt="SelectPortal",Be=r=>c.jsx(at,{asChild:!0,...r});Be.displayName=Rt;var Q="SelectContent",Ve=d.forwardRef((r,e)=>{const t=G(Q,r.__scopeSelect),[o,n]=d.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const l=o;return l?Ee.createPortal(c.jsx(He,{scope:r.__scopeSelect,children:c.jsx(de.Slot,{scope:r.__scopeSelect,children:c.jsx("div",{children:r.children})})}),l):null}return c.jsx(ze,{...r,ref:e})});Ve.displayName=Q;var A=10,[He,Y]=ne(Q),jt="SelectContentImpl",Mt=gt("SelectContent.RemoveScroll"),ze=d.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:l,onPointerDownOutside:s,side:a,sideOffset:i,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:w,collisionPadding:C,sticky:S,hideWhenDetached:p,avoidCollisions:g,...y}=r,v=G(Q,t),[x,F]=d.useState(null),[M,re]=d.useState(null),P=k(e,h=>F(h)),[O,U]=d.useState(null),[q,L]=d.useState(null),B=ue(t),[W,V]=d.useState(!1),H=d.useRef(!1);d.useEffect(()=>{if(x)return ut(x)},[x]),pt();const E=d.useCallback(h=>{const[T,...R]=B().map(_=>_.ref.current),[b]=R.slice(-1),I=document.activeElement;for(const _ of h)if(_===I||(_?.scrollIntoView({block:"nearest"}),_===T&&M&&(M.scrollTop=0),_===b&&M&&(M.scrollTop=M.scrollHeight),_?.focus(),document.activeElement!==I))return},[B,M]),D=d.useCallback(()=>E([O,x]),[E,O,x]);d.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=v;d.useEffect(()=>{if(x){let h={x:0,y:0};const T=b=>{h={x:Math.abs(Math.round(b.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(b.pageY)-(K.current?.y??0))}},R=b=>{h.x<=10&&h.y<=10?b.preventDefault():x.contains(b.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),d.useEffect(()=>{const h=()=>z(!1);return window.addEventListener("blur",h),window.addEventListener("resize",h),()=>{window.removeEventListener("blur",h),window.removeEventListener("resize",h)}},[z]);const[fe,ae]=ot(h=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),b=nt(T,h,R);b&&setTimeout(()=>b.ref.current.focus())}),me=d.useCallback((h,T,R)=>{const b=!H.current&&!R;(v.value!==void 0&&v.value===T||b)&&(U(h),b&&(H.current=!0))},[v.value]),he=d.useCallback(()=>x?.focus(),[x]),te=d.useCallback((h,T,R)=>{const b=!H.current&&!R;(v.value!==void 0&&v.value===T||b)&&L(h)},[v.value]),ie=o==="popper"?Se:Fe,se=ie===Se?{side:a,sideOffset:i,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:w,collisionPadding:C,sticky:S,hideWhenDetached:p,avoidCollisions:g}:{};return c.jsx(He,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:c.jsx(ft,{as:Mt,allowPinchZoom:!0,children:c.jsx(mt,{asChild:!0,trapped:v.open,onMountAutoFocus:h=>{h.preventDefault()},onUnmountAutoFocus:N(n,h=>{v.trigger?.focus({preventScroll:!0}),h.preventDefault()}),children:c.jsx(ht,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:h=>h.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:c.jsx(ie,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:h=>h.preventDefault(),...y,...se,onPlaced:()=>V(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:N(y.onKeyDown,h=>{const T=h.ctrlKey||h.altKey||h.metaKey;if(h.key==="Tab"&&h.preventDefault(),!T&&h.key.length===1&&ae(h.key),["ArrowUp","ArrowDown","Home","End"].includes(h.key)){let b=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(h.key)&&(b=b.slice().reverse()),["ArrowUp","ArrowDown"].includes(h.key)){const I=h.target,_=b.indexOf(I);b=b.slice(_+1)}setTimeout(()=>E(b)),h.preventDefault()}})})})})})})});ze.displayName=jt;var At="SelectItemAlignedPosition",Fe=d.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,l=G(Q,t),s=Y(Q,t),[a,i]=d.useState(null),[u,f]=d.useState(null),m=k(e,P=>f(P)),w=ue(t),C=d.useRef(!1),S=d.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:y,focusSelectedItem:v}=s,x=d.useCallback(()=>{if(l.trigger&&l.valueNode&&a&&u&&p&&g&&y){const P=l.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=l.valueNode.getBoundingClientRect(),q=y.getBoundingClientRect();if(l.dir!=="rtl"){const I=q.left-O.left,_=U.left-I,X=P.left-_,Z=P.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(_,[A,Math.max(A,ge-ve)]);a.style.minWidth=Z+"px",a.style.left=xe+"px"}else{const I=O.right-q.right,_=window.innerWidth-U.right-I,X=window.innerWidth-P.right-_,Z=P.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(_,[A,Math.max(A,ge-ve)]);a.style.minWidth=Z+"px",a.style.right=xe+"px"}const L=w(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(g.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=P.top+P.height/2-A,ie=B-te,se=g.offsetHeight/2,h=g.offsetTop+se,T=H+E+h,R=K-T;if(T<=te){const I=L.length>0&&g===L[L.length-1].ref.current;a.style.bottom="0px";const _=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ie,se+(I?he:0)+_+D),Z=T+X;a.style.height=Z+"px"}else{const I=L.length>0&&g===L[0].ref.current;a.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;a.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}a.style.margin=`${A}px 0`,a.style.minHeight=fe+"px",a.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>C.current=!0)}},[w,l.trigger,l.valueNode,a,u,p,g,y,l.dir,o]);$(()=>x(),[x]);const[F,M]=d.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=d.useCallback(P=>{P&&S.current===!0&&(x(),v?.(),S.current=!1)},[x,v]);return c.jsx(Dt,{scope:t,contentWrapper:a,shouldExpandOnScrollRef:C,onScrollButtonChange:re,children:c.jsx("div",{ref:i,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:c.jsx(j.div,{...n,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});Fe.displayName=At;var Ot="SelectPopperPosition",Se=d.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...l}=r,s=pe(t);return c.jsx(xt,{...s,...l,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=Ot;var[Dt,Te]=ne(Q,{}),we="SelectViewport",Ue=d.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,l=Y(we,t),s=Te(we,t),a=k(e,l.onViewportChange),i=d.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),c.jsx(de.Slot,{scope:t,children:c.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:N(n.onScroll,u=>{const f=u.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:w}=s;if(w?.current&&m){const C=Math.abs(i.current-f.scrollTop);if(C>0){const S=window.innerHeight-A*2,p=parseFloat(m.style.minHeight),g=parseFloat(m.style.height),y=Math.max(p,g);if(y<S){const v=y+C,x=Math.min(S,v),F=v-x;m.style.height=x+"px",m.style.bottom==="0px"&&(f.scrollTop=F>0?F:0,m.style.justifyContent="flex-end")}}}i.current=f.scrollTop})})})]})});Ue.displayName=we;var We="SelectGroup",[kt,Lt]=ne(We),Bt=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=Ie();return c.jsx(kt,{scope:t,id:n,children:c.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Bt.displayName=We;var Ke="SelectLabel",Vt=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=Lt(Ke,t);return c.jsx(j.div,{id:n.id,...o,ref:e})});Vt.displayName=Ke;var ce="SelectItem",[Ht,$e]=ne(ce),Ge=d.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:l,...s}=r,a=G(ce,t),i=Y(ce,t),u=a.value===o,[f,m]=d.useState(l??""),[w,C]=d.useState(!1),S=k(e,v=>i.itemRefCallback?.(v,o,n)),p=Ie(),g=d.useRef("touch"),y=()=>{n||(a.onValueChange(o),a.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(Ht,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:d.useCallback(v=>{m(x=>x||(v?.textContent??"").trim())},[]),children:c.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:f,children:c.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":w?"":void 0,"aria-selected":u&&w,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:N(s.onFocus,()=>C(!0)),onBlur:N(s.onBlur,()=>C(!1)),onClick:N(s.onClick,()=>{g.current!=="mouse"&&y()}),onPointerUp:N(s.onPointerUp,()=>{g.current==="mouse"&&y()}),onPointerDown:N(s.onPointerDown,v=>{g.current=v.pointerType}),onPointerMove:N(s.onPointerMove,v=>{g.current=v.pointerType,n?i.onItemLeave?.():g.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(s.onPointerLeave,v=>{v.currentTarget===document.activeElement&&i.onItemLeave?.()}),onKeyDown:N(s.onKeyDown,v=>{i.searchRef?.current!==""&&v.key===" "||(It.includes(v.key)&&y(),v.key===" "&&v.preventDefault())})})})})});Ge.displayName=ce;var le="SelectItemText",Ye=d.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...l}=r,s=G(le,t),a=Y(le,t),i=$e(le,t),u=Pt(le,t),[f,m]=d.useState(null),w=k(e,y=>m(y),i.onItemTextChange,y=>a.itemTextRefCallback?.(y,i.value,i.disabled)),C=f?.textContent,S=d.useMemo(()=>c.jsx("option",{value:i.value,disabled:i.disabled,children:C},i.value),[i.disabled,i.value,C]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=u;return $(()=>(p(S),()=>g(S)),[p,g,S]),c.jsxs(c.Fragment,{children:[c.jsx(j.span,{id:i.textId,...l,ref:w}),i.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ee.createPortal(l.children,s.valueNode):null]})});Ye.displayName=le;var qe="SelectItemIndicator",Xe=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return $e(qe,t).isSelected?c.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});Xe.displayName=qe;var Ce="SelectScrollUpButton",Ze=d.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,l]=d.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let a=function(){const u=i.scrollTop>0;l(u)};const i=t.viewport;return a(),i.addEventListener("scroll",a),()=>i.removeEventListener("scroll",a)}},[t.viewport,t.isPositioned]),n?c.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:i}=t;a&&i&&(a.scrollTop=a.scrollTop-i.offsetHeight)}}):null});Ze.displayName=Ce;var ye="SelectScrollDownButton",Je=d.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,l]=d.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let a=function(){const u=i.scrollHeight-i.clientHeight,f=Math.ceil(i.scrollTop)<u;l(f)};const i=t.viewport;return a(),i.addEventListener("scroll",a),()=>i.removeEventListener("scroll",a)}},[t.viewport,t.isPositioned]),n?c.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:i}=t;a&&i&&(a.scrollTop=a.scrollTop+i.offsetHeight)}}):null});Je.displayName=ye;var Qe=d.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,l=Y("SelectScrollButton",t),s=d.useRef(null),a=ue(t),i=d.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return d.useEffect(()=>()=>i(),[i]),$(()=>{a().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),c.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:N(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:N(n.onPointerMove,()=>{l.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:N(n.onPointerLeave,()=>{i()})})}),zt="SelectSeparator",Ft=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return c.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});Ft.displayName=zt;var be="SelectArrow",Ut=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),l=G(be,t),s=Y(be,t);return l.open&&s.position==="popper"?c.jsx(St,{...n,...o,ref:e}):null});Ut.displayName=be;var Wt="SelectBubbleInput",et=d.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=d.useRef(null),l=k(o,n),s=ct(e);return d.useEffect(()=>{const a=n.current;if(!a)return;const i=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(i,"value").set;if(s!==e&&f){const m=new Event("change",{bubbles:!0});f.call(a,e),a.dispatchEvent(m)}},[s,e]),c.jsx(j.select,{...t,style:{...Ct,...t.style},ref:l,defaultValue:e})});et.displayName=Wt;function tt(r){return r===""||r===void 0}function ot(r){const e=dt(r),t=d.useRef(""),o=d.useRef(0),n=d.useCallback(s=>{const a=t.current+s;e(a),(function i(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>i(""),1e3))})(a)},[e]),l=d.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,l]}function nt(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,l=t?r.indexOf(t):-1;let s=Kt(r,Math.max(l,0));n.length===1&&(s=s.filter(u=>u!==t));const i=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return i!==t?i:void 0}function Kt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var $t=Me,Gt=Oe,Yt=ke,qt=Le,Xt=Be,Zt=Ve,Jt=Ue,Qt=Ge,Pe=Ye,eo=Xe,to=Ze,oo=Je;function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=c.jsx($t,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=c.jsx(Yt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function fo(r){const e=ee.c(15);let t,o,n,l,s;e[0]!==r?({className:o,size:l,variant:s,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=l,e[5]=s):(t=e[1],o=e[2],n=e[3],l=e[4],s=e[5]);const a=l===void 0?"default":l,i=s===void 0?"outline":s;let u;e[6]!==o?(u=oe("data-[placeholder]:text-subtle-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-ring aria-invalid:bg-destructive/10 aria-invalid:shadow-[inset_0_0_0_1px_var(--destructive)] flex w-fit items-center justify-between gap-1.5 px-3 text-sm whitespace-nowrap transition-[color,background-color,box-shadow] outline-none disabled:text-subtle-foreground disabled:pointer-events-none","data-[variant=outline]:rounded-[var(--studio-control-radius,var(--radius-lg))] data-[variant=outline]:bg-[var(--studio-input-background)] data-[variant=outline]:shadow-edge data-[variant=outline]:hover:bg-sidebar","data-[variant=filled]:rounded-full data-[variant=filled]:bg-muted data-[variant=filled]:hover:bg-secondary-hover","data-[variant=pill]:rounded-full data-[variant=pill]:bg-card data-[variant=pill]:shadow-edge data-[variant=pill]:hover:bg-[var(--studio-outline-hover-background)]","data-[size=default]:h-[var(--studio-control-height,2.25rem)] data-[size=default]:pl-4 data-[size=sm]:h-8 data-[size=xs]:h-7 data-[size=xs]:px-2.5 data-[size=xs]:text-xs data-[size=xs]:font-medium","*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",o),e[6]=o,e[7]=u):u=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=c.jsx(qt,{asChild:!0,children:c.jsx(je,{className:"size-3.5 stroke-[1.5]"})}),e[8]=f):f=e[8];let m;return e[9]!==t||e[10]!==n||e[11]!==a||e[12]!==u||e[13]!==i?(m=c.jsxs(Gt,{"data-slot":"select-trigger","data-size":a,"data-variant":i,className:u,...n,children:[t,f]}),e[9]=t,e[10]=n,e[11]=a,e[12]=u,e[13]=i,e[14]=m):m=e[14],m}function mo(r){const e=ee.c(25);let t,o,n,l,s;e[0]!==r?({className:o,children:t,position:l,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=l,e[5]=s):(t=e[1],o=e[2],n=e[3],l=e[4],s=e[5]);const a=l===void 0?"popper":l,i=s===void 0?!1:s,u=a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let f;e[6]!==o||e[7]!==u?(f=oe("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-[var(--studio-surface-radius,var(--radius-lg))] border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=f):f=e[8];let m;e[9]!==i?(m=!i&&c.jsx(no,{}),e[9]=i,e[10]=m):m=e[10];const w=a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let C;e[11]!==w?(C=oe("p-1",w),e[11]=w,e[12]=C):C=e[12];let S;e[13]!==t||e[14]!==C?(S=c.jsx(Jt,{className:C,children:t}),e[13]=t,e[14]=C,e[15]=S):S=e[15];let p;e[16]!==i?(p=!i&&c.jsx(ro,{}),e[16]=i,e[17]=p):p=e[17];let g;return e[18]!==a||e[19]!==n||e[20]!==f||e[21]!==m||e[22]!==S||e[23]!==p?(g=c.jsx(Xt,{children:c.jsxs(Zt,{"data-slot":"select-content",translate:"no",className:f,position:a,...n,children:[m,S,p]})}),e[18]=a,e[19]=n,e[20]=f,e[21]=m,e[22]=S,e[23]=p,e[24]=g):g=e[24],g}function ho(r){const e=ee.c(19);let t,o,n,l,s;e[0]!==r?({className:o,children:t,description:n,hideCheck:s,...l}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=l,e[5]=s):(t=e[1],o=e[2],n=e[3],l=e[4],s=e[5]);const a=s===void 0?!1:s,i=n&&"items-start py-2";let u;e[6]!==o||e[7]!==i?(u=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",i,o),e[6]=o,e[7]=i,e[8]=u):u=e[8];let f;e[9]!==a?(f=!a&&c.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:c.jsx(eo,{children:c.jsx(wt,{className:"size-4"})})}),e[9]=a,e[10]=f):f=e[10];let m;e[11]!==t||e[12]!==n?(m=n?c.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[c.jsx(Pe,{children:t}),c.jsx("span",{className:"text-xs text-muted-foreground whitespace-normal",children:n})]}):c.jsx(Pe,{children:t}),e[11]=t,e[12]=n,e[13]=m):m=e[13];let w;return e[14]!==l||e[15]!==u||e[16]!==f||e[17]!==m?(w=c.jsxs(Qt,{"data-slot":"select-item",className:u,...l,children:[f,m]}),e[14]=l,e[15]=u,e[16]=f,e[17]=m,e[18]=w):w=e[18],w}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsx(yt,{className:"size-4"}),e[5]=l):l=e[5];let s;return e[6]!==o||e[7]!==n?(s=c.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:l}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsx(je,{className:"size-4"}),e[5]=l):l=e[5];let s;return e[6]!==o||e[7]!==n?(s=c.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:l}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{uo as S,po as a,fo as b,ho as c,mo as d};
@@ -1 +1 @@
1
- import{c as $,b as A,r as R,m as G,j as s,B as H,s as J,x as K,v as Q,D as U}from"./index-DLuam-oO.js";import{d as V,b as W,a as X,D as Y}from"./drawer-CN3NEJqY.js";import{u as Z}from"./use-mobile-B6Glooki.js";import{d as ee}from"./chat-context-BNZ_9-8I.js";import{S as F,a as se,M as le,c as te}from"./index-CV1w3jjI.js";function me(L){const e=$.c(48),{variant:o,className:t,placeholder:n,model:l,isLoading:I,credentialId:P,onCredentialChange:k,onModelChange:b,filterModels:E}=L,z=o===void 0?"borderless":o,w=n===void 0?"Select model":n,r=A(),[a,S]=R.useState(!1),i=b!==void 0,q=Z(),O=z==="borderless"?"ghost":"outline",_=z==="borderless"&&"md:border-none";let d;e[0]!==t||e[1]!==_?(d=G("text-sm hover:bg-accent py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group min-w-0 shrink justify-start overflow-hidden",_,t),e[0]=t,e[1]=_,e[2]=d):d=e[2];let c;e[3]!==I||e[4]!==l||e[5]!==w||e[6]!==i?(c=i?s.jsx(F,{model:l??null,placeholder:w,isLoading:I}):s.jsx(ne,{placeholder:w}),e[3]=I,e[4]=l,e[5]=w,e[6]=i,e[7]=c):c=e[7];let D;e[8]!==O||e[9]!==d||e[10]!==c?(D=s.jsx(H,{variant:O,size:"sm",className:d,children:c}),e[8]=O,e[9]=d,e[10]=c,e[11]=D):D=e[11];const m=D;let y;e[12]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(se,{}),e[12]=y):y=e[12];let N;e[13]!==P||e[14]!==E||e[15]!==l||e[16]!==k||e[17]!==b||e[18]!==i?(N=s.jsx(R.Suspense,{fallback:y,children:i?s.jsx(le,{onClose:()=>S(!1),credentialId:P??null,onCredentialChange:k??oe,selectedModel:l??null,onModelChange:b,filterModels:E}):s.jsx(te,{onClose:()=>S(!1)})}),e[13]=P,e[14]=E,e[15]=l,e[16]=k,e[17]=b,e[18]=i,e[19]=N):N=e[19];const f=N;if(q){let g;e[20]!==m?(g=s.jsx(V,{asChild:!0,children:m}),e[20]=m,e[21]=g):g=e[21];let j;e[22]!==r?(j=r("chat.selectModel.selectModel"),e[22]=r,e[23]=j):j=e[23];let M;e[24]!==j?(M=s.jsx(W,{className:"sr-only",children:j}),e[24]=j,e[25]=M):M=e[25];let C;e[26]!==f?(C=s.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:f}),e[26]=f,e[27]=C):C=e[27];let v;e[28]!==M||e[29]!==C?(v=s.jsxs(X,{className:"p-0 flex flex-col max-h-[95vh]",children:[M,C]}),e[28]=M,e[29]=C,e[30]=v):v=e[30];let T;return e[31]!==a||e[32]!==g||e[33]!==v?(T=s.jsxs(Y,{open:a,onOpenChange:S,children:[g,v]}),e[31]=a,e[32]=g,e[33]=v,e[34]=T):T=e[34],T}let h;e[35]!==m?(h=s.jsx(J,{asChild:!0,children:m}),e[35]=m,e[36]=h):h=e[36];let x;e[37]!==r?(x=r("chat.selectModel.selectModel"),e[37]=r,e[38]=x):x=e[38];let p;e[39]!==x?(p=s.jsx(K,{className:"sr-only",children:x}),e[39]=x,e[40]=p):p=e[40];let u;e[41]!==f||e[42]!==p?(u=s.jsxs(Q,{className:"p-0 gap-0 sm:max-w-fit overflow-hidden h-[100dvh] sm:h-auto max-h-[100dvh] sm:max-h-[85vh] w-full max-w-full sm:max-w-fit rounded-none sm:rounded-xl border-0 sm:border",closeButtonClassName:"top-3.5 right-3.5 z-20",children:[p,f]}),e[41]=f,e[42]=p,e[43]=u):u=e[43];let B;return e[44]!==a||e[45]!==h||e[46]!==u?(B=s.jsxs(U,{open:a,onOpenChange:S,children:[h,u]}),e[44]=a,e[45]=h,e[46]=u,e[47]=B):B=e[47],B}function oe(){}function ne(L){const e=$.c(4),{placeholder:o}=L,{selectedModel:t,isModelsLoading:n}=ee();let l;return e[0]!==n||e[1]!==t||e[2]!==o?(l=s.jsx(F,{model:t,placeholder:o,isLoading:n}),e[0]=n,e[1]=t,e[2]=o,e[3]=l):l=e[3],l}export{me as M};
1
+ import{c as $,b as A,r as R,m as G,j as s,B as H,s as J,x as K,v as Q,D as U}from"./index-7zGhlT8r.js";import{d as V,b as W,a as X,D as Y}from"./drawer-DEXSNHC1.js";import{u as Z}from"./use-mobile-2AsEzLf2.js";import{d as ee}from"./chat-context-BZCgTb_I.js";import{S as F,a as se,M as le,c as te}from"./index-BkSYM2mK.js";function me(L){const e=$.c(48),{variant:o,className:t,placeholder:n,model:l,isLoading:I,credentialId:P,onCredentialChange:k,onModelChange:b,filterModels:E}=L,z=o===void 0?"borderless":o,w=n===void 0?"Select model":n,r=A(),[a,S]=R.useState(!1),i=b!==void 0,q=Z(),O=z==="borderless"?"ghost":"outline",_=z==="borderless"&&"md:border-none";let d;e[0]!==t||e[1]!==_?(d=G("text-sm hover:bg-accent py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group min-w-0 shrink justify-start overflow-hidden",_,t),e[0]=t,e[1]=_,e[2]=d):d=e[2];let c;e[3]!==I||e[4]!==l||e[5]!==w||e[6]!==i?(c=i?s.jsx(F,{model:l??null,placeholder:w,isLoading:I}):s.jsx(ne,{placeholder:w}),e[3]=I,e[4]=l,e[5]=w,e[6]=i,e[7]=c):c=e[7];let D;e[8]!==O||e[9]!==d||e[10]!==c?(D=s.jsx(H,{variant:O,size:"sm",className:d,children:c}),e[8]=O,e[9]=d,e[10]=c,e[11]=D):D=e[11];const m=D;let y;e[12]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(se,{}),e[12]=y):y=e[12];let N;e[13]!==P||e[14]!==E||e[15]!==l||e[16]!==k||e[17]!==b||e[18]!==i?(N=s.jsx(R.Suspense,{fallback:y,children:i?s.jsx(le,{onClose:()=>S(!1),credentialId:P??null,onCredentialChange:k??oe,selectedModel:l??null,onModelChange:b,filterModels:E}):s.jsx(te,{onClose:()=>S(!1)})}),e[13]=P,e[14]=E,e[15]=l,e[16]=k,e[17]=b,e[18]=i,e[19]=N):N=e[19];const f=N;if(q){let g;e[20]!==m?(g=s.jsx(V,{asChild:!0,children:m}),e[20]=m,e[21]=g):g=e[21];let j;e[22]!==r?(j=r("chat.selectModel.selectModel"),e[22]=r,e[23]=j):j=e[23];let M;e[24]!==j?(M=s.jsx(W,{className:"sr-only",children:j}),e[24]=j,e[25]=M):M=e[25];let C;e[26]!==f?(C=s.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:f}),e[26]=f,e[27]=C):C=e[27];let v;e[28]!==M||e[29]!==C?(v=s.jsxs(X,{className:"p-0 flex flex-col max-h-[95vh]",children:[M,C]}),e[28]=M,e[29]=C,e[30]=v):v=e[30];let T;return e[31]!==a||e[32]!==g||e[33]!==v?(T=s.jsxs(Y,{open:a,onOpenChange:S,children:[g,v]}),e[31]=a,e[32]=g,e[33]=v,e[34]=T):T=e[34],T}let h;e[35]!==m?(h=s.jsx(J,{asChild:!0,children:m}),e[35]=m,e[36]=h):h=e[36];let x;e[37]!==r?(x=r("chat.selectModel.selectModel"),e[37]=r,e[38]=x):x=e[38];let p;e[39]!==x?(p=s.jsx(K,{className:"sr-only",children:x}),e[39]=x,e[40]=p):p=e[40];let u;e[41]!==f||e[42]!==p?(u=s.jsxs(Q,{className:"p-0 gap-0 sm:max-w-fit overflow-hidden h-[100dvh] sm:h-auto max-h-[100dvh] sm:max-h-[85vh] w-full max-w-full sm:max-w-fit rounded-none sm:rounded-xl border-0 sm:border",closeButtonClassName:"top-3.5 right-3.5 z-20",children:[p,f]}),e[41]=f,e[42]=p,e[43]=u):u=e[43];let B;return e[44]!==a||e[45]!==h||e[46]!==u?(B=s.jsxs(U,{open:a,onOpenChange:S,children:[h,u]}),e[44]=a,e[45]=h,e[46]=u,e[47]=B):B=e[47],B}function oe(){}function ne(L){const e=$.c(4),{placeholder:o}=L,{selectedModel:t,isModelsLoading:n}=ee();let l;return e[0]!==n||e[1]!==t||e[2]!==o?(l=s.jsx(F,{model:t,placeholder:o,isLoading:n}),e[0]=n,e[1]=t,e[2]=o,e[3]=l):l=e[3],l}export{me as M};