decocms 4.77.2 → 4.78.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) hide show
  1. package/dist/client/assets/{AlertCircle-eG6Gc49G.js → AlertCircle-D6YyJJmm.js} +1 -1
  2. package/dist/client/assets/{AreaChart-CdRNAaTW.js → AreaChart-CXzSMWrS.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-CdLsMjki.js → ArrowUp-D3YFKg7G.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-O8BszRRp.js → ArrowUpRight-DgvFsQng.js} +1 -1
  5. package/dist/client/assets/{Check-CYLXae3M.js → Check-Bf3Fz6mT.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-tljwuhuM.js → CheckCircle-DBI4XJwz.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-Ce0JNwG8.js → ChevronDown-TeMcV6Wa.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-Bf6_HJan.js → ChevronRight-QSLgw-q7.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-Cflkeqqz.js → ChevronUp-g5JVf1F_.js} +1 -1
  10. package/dist/client/assets/{Circle-DzHZa-kj.js → Circle-Cu4ym4Ez.js} +1 -1
  11. package/dist/client/assets/{Copy01-Du_M_0KX.js → Copy01-DgzGIIpj.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-xFAtxH3A.js → DotsVertical-yY90ybrp.js} +1 -1
  13. package/dist/client/assets/{Eye-D-54suMo.js → Eye-vRl0ZCJB.js} +1 -1
  14. package/dist/client/assets/{FilterLines-BgdIIHnR.js → FilterLines-BbWZ4lL4.js} +1 -1
  15. package/dist/client/assets/{Flag01-ugYNIxEK.js → Flag01-CXRHMIef.js} +1 -1
  16. package/dist/client/assets/{Globe01-UO2cBICu.js → Globe01-B7g_9reV.js} +1 -1
  17. package/dist/client/assets/{Globe04-DzUT07Cn.js → Globe04-C3Z6OIxj.js} +1 -1
  18. package/dist/client/assets/{HardDrive-bE1MoLDy.js → HardDrive-DymMXEyR.js} +1 -1
  19. package/dist/client/assets/{Image01-DKb2muBn.js → Image01-Bx4AOGxs.js} +1 -1
  20. package/dist/client/assets/{Key01-Cq-J9mZo.js → Key01-Cmvx37G1.js} +1 -1
  21. package/dist/client/assets/{LayoutLeft-B5__5XBq.js → LayoutLeft-q_h77zns.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-BvGijEfo.js → LinkExternal01-BEoe9Fb2.js} +1 -1
  23. package/dist/client/assets/{List-CIEQZx9S.js → List-5170zK7Q.js} +1 -1
  24. package/dist/client/assets/{Monitor01-C1p3z_f5.js → Monitor01-Kb5okFQS.js} +1 -1
  25. package/dist/client/assets/{Package-BjwszD_f.js → Package-yySHtAk6.js} +1 -1
  26. package/dist/client/assets/{Palette-B-oF6tIa.js → Palette-Dacxdv_I.js} +1 -1
  27. package/dist/client/assets/{Play-D-YRWYQr.js → Play-BoazbAxP.js} +1 -1
  28. package/dist/client/assets/{Plus-CizB5jQt.js → Plus-t7Jm0GJ3.js} +1 -1
  29. package/dist/client/assets/{SearchLg-CiDD8qnw.js → SearchLg-CB9_TW_3.js} +1 -1
  30. package/dist/client/assets/{SearchMd-CcQf_5lB.js → SearchMd-B8rhT4Rt.js} +1 -1
  31. package/dist/client/assets/{Settings02-CGoVxrYE.js → Settings02-D4nrXgvn.js} +1 -1
  32. package/dist/client/assets/{Shield01-nfrTF4Mw.js → Shield01-Y3jps5Gy.js} +1 -1
  33. package/dist/client/assets/{Star01-BVrjnnC8.js → Star01-DBp7dbGs.js} +1 -1
  34. package/dist/client/assets/{Stars01-DSPE0_0T.js → Stars01-BJhn7N1A.js} +1 -1
  35. package/dist/client/assets/{Stars02-C0mePgbQ.js → Stars02-BmKcMhZX.js} +1 -1
  36. package/dist/client/assets/{Sun-3gpGRkKw.js → Sun-DWvykssV.js} +1 -1
  37. package/dist/client/assets/{SwitchHorizontal01-BoKJqR3a.js → SwitchHorizontal01-DJDXmWgC.js} +1 -1
  38. package/dist/client/assets/{Tool01-Bm90mZCD.js → Tool01-Ct7fGWUY.js} +1 -1
  39. package/dist/client/assets/{Tool02-daiZ8ZdA.js → Tool02-Cr2Rz6tq.js} +1 -1
  40. package/dist/client/assets/{Trash01-oe1NMhcg.js → Trash01-C3QDvJF1.js} +1 -1
  41. package/dist/client/assets/{TrendUp01-DvuM4A6y.js → TrendUp01-WsDlxYhZ.js} +1 -1
  42. package/dist/client/assets/{Upload01-BXr1BH_I.js → Upload01-C2W1llVr.js} +1 -1
  43. package/dist/client/assets/{User01-C7ZuARbC.js → User01-Deo29J7j.js} +1 -1
  44. package/dist/client/assets/{UserPlus01-C0VtXGyN.js → UserPlus01-C_-L6kJr.js} +1 -1
  45. package/dist/client/assets/{Users01-DZyUR8Yh.js → Users01-CLZ2kdTu.js} +1 -1
  46. package/dist/client/assets/{Users03-CHK21j2b.js → Users03-uM7w0XRw.js} +1 -1
  47. package/dist/client/assets/{X-B6u4BYeS.js → X-DYT1GSz1.js} +1 -1
  48. package/dist/client/assets/{XCircle-DGI9dgcJ.js → XCircle-C965t8pI.js} +1 -1
  49. package/dist/client/assets/{XClose-lZsBUygk.js → XClose-D8I17tPk.js} +1 -1
  50. package/dist/client/assets/{Zap-CMeneH21.js → Zap-p_vD-N15.js} +1 -1
  51. package/dist/client/assets/{ZapSquare-B3ibL8nl.js → ZapSquare-r-I1hrGR.js} +1 -1
  52. package/dist/client/assets/{ZoomOut-CKfihzl3.js → ZoomOut-CyT94sXk.js} +1 -1
  53. package/dist/client/assets/{access-gate-BKjE-W72.js → access-gate-C5tHnpFu.js} +1 -1
  54. package/dist/client/assets/{add-section-modal-9hA4zHWa.js → add-section-modal-D3vMc3LK.js} +1 -1
  55. package/dist/client/assets/{agent-icon-B1DcT15_.js → agent-icon-jLUxIfUX.js} +1 -1
  56. package/dist/client/assets/agents-list-3dntZgUX.js +1 -0
  57. package/dist/client/assets/{ai-providers-DEZ-doQX.js → ai-providers-DUfJcGkX.js} +1 -1
  58. package/dist/client/assets/{alert-CKkliWEi.js → alert-JyDMBG9Y.js} +1 -1
  59. package/dist/client/assets/{alert-dialog-BHYtfpRM.js → alert-dialog-BZCxnnaY.js} +1 -1
  60. package/dist/client/assets/app-editor-BBLUJ0bm.js +1 -0
  61. package/dist/client/assets/{auth-BbW7SMY9.js → auth-B0oxX-rw.js} +1 -1
  62. package/dist/client/assets/{auth-catchall-DXOIAmHy.js → auth-catchall-BZvzipnV.js} +1 -1
  63. package/dist/client/assets/{auth-entry-Hxc9SX52.js → auth-entry-BLM6BHE1.js} +1 -1
  64. package/dist/client/assets/{auth-split-layout-Dfl544OM.js → auth-split-layout-CsaahkY7.js} +1 -1
  65. package/dist/client/assets/{authenticate-and-persist-oauth-SPitL5yD.js → authenticate-and-persist-oauth-DxQqW3T-.js} +1 -1
  66. package/dist/client/assets/{automation-list-row-Dn4IsiQT.js → automation-list-row-f7HB0lEO.js} +1 -1
  67. package/dist/client/assets/{automation-runs-BvQ_NpzR.js → automation-runs-C0bPxXfe.js} +1 -1
  68. package/dist/client/assets/automations-CZpHalR8.js +1 -0
  69. package/dist/client/assets/{autosend-qdJpe4iq.js → autosend-pcmp17-1.js} +1 -1
  70. package/dist/client/assets/{avatar-DMDa5Fmk.js → avatar-BaaCzkz5.js} +1 -1
  71. package/dist/client/assets/{badge-DGFRrczB.js → badge-DDX6uCig.js} +1 -1
  72. package/dist/client/assets/{block-document-DU-yWhvh.js → block-document-DivAhnA1.js} +1 -1
  73. package/dist/client/assets/{brand-context-B0F8ndWt.js → brand-context-BTW63ubn.js} +1 -1
  74. package/dist/client/assets/{buckets-Bz1zL6p_.js → buckets-dkoo4cSZ.js} +1 -1
  75. package/dist/client/assets/{bulk-category-panel-CrkZD2hX.js → bulk-category-panel-BKU51QgX.js} +1 -1
  76. package/dist/client/assets/{calendar-BmG3lShW.js → calendar-CtB-1ORd.js} +1 -1
  77. package/dist/client/assets/{capability-load-error-DjfRZU4K.js → capability-load-error-BQX8z6t0.js} +1 -1
  78. package/dist/client/assets/{card-B2cV3vAA.js → card-zqYafqG3.js} +1 -1
  79. package/dist/client/assets/category-editor-DIxkWtHT.js +1 -0
  80. package/dist/client/assets/{chat-context-D0hwm5HT.js → chat-context-C_Qfrzll.js} +1 -1
  81. package/dist/client/assets/{checkbox-n-zGS588.js → checkbox-D33J0J5s.js} +1 -1
  82. package/dist/client/assets/{cli-auth-success-Cpw6906n.js → cli-auth-success-a675Crj5.js} +1 -1
  83. package/dist/client/assets/{collection-detail-CoKiA3iG.js → collection-detail-DOr4XVAb.js} +1 -1
  84. package/dist/client/assets/{collection-display-button-Dd5IEnXv.js → collection-display-button-DRpwr1d2.js} +1 -1
  85. package/dist/client/assets/{collection-search-1EZ5z6Vc.js → collection-search-BBYUHwp3.js} +1 -1
  86. package/dist/client/assets/{collection-table-wrapper-CWw6WTgV.js → collection-table-wrapper-DG4oL_XO.js} +1 -1
  87. package/dist/client/assets/{collection-tabs-G10EJ6rD.js → collection-tabs-CM7SC5Ph.js} +1 -1
  88. package/dist/client/assets/{command-Bijkf_mr.js → command-BgHIgal-.js} +1 -1
  89. package/dist/client/assets/commerce-onboarding-DEDSkHug.js +1 -0
  90. package/dist/client/assets/companions-core-BKQjoMFT.js +1 -0
  91. package/dist/client/assets/{connect-desktop-dialog-Cl6dLVAA.js → connect-desktop-dialog-C3MAVbqi.js} +1 -1
  92. package/dist/client/assets/{connection-card--smrdlwg.js → connection-card-akwzMfSt.js} +1 -1
  93. package/dist/client/assets/{connection-detail-sQv6wR_D.js → connection-detail-CRcTfmPM.js} +1 -1
  94. package/dist/client/assets/{connection-form-helpers-Det9xziz.js → connection-form-helpers-D-nDOfy5.js} +1 -1
  95. package/dist/client/assets/{connections-b4dKpHip.js → connections-BpPH-rGd.js} +1 -1
  96. package/dist/client/assets/{decopilot-sse-pool-DDyGdbf8.js → decopilot-sse-pool-_1OoFfRR.js} +1 -1
  97. package/dist/client/assets/{dialog-7JXjpLzj.js → dialog-C_G4Nj_a.js} +1 -1
  98. package/dist/client/assets/{domain-settings-9SDv1Gy2.js → domain-settings-BU3PLHXT.js} +1 -1
  99. package/dist/client/assets/{drawer-975r1xgz.js → drawer-DIzHaW1L.js} +1 -1
  100. package/dist/client/assets/{dropdown-menu-CfwadO2Z.js → dropdown-menu-C3HeQI9N.js} +1 -1
  101. package/dist/client/assets/{empty-state-C2pMk4Io.js → empty-state-Bn6jIdxN.js} +1 -1
  102. package/dist/client/assets/{extract-connection-data-xHncf4eT.js → extract-connection-data-DoTSwnq5.js} +1 -1
  103. package/dist/client/assets/file-explorer-C7jnlKJt.js +2 -0
  104. package/dist/client/assets/{file-type-icon-C9w5Ssef.js → file-type-icon-Chdi7BrE.js} +1 -1
  105. package/dist/client/assets/{files-DmBu13F5.js → files-CDQzPvRQ.js} +1 -1
  106. package/dist/client/assets/{form-CoMC4z4E.js → form-CqMXK7Rg.js} +1 -1
  107. package/dist/client/assets/{general-BZsnVBNU.js → general-BHXdL9DJ.js} +1 -1
  108. package/dist/client/assets/github-repo-picker-iGTmhvfh.js +1 -0
  109. package/dist/client/assets/github-repo-scope-DjMZbiKa.js +1 -0
  110. package/dist/client/assets/{hooks-ChQF06R2.js → hooks-B2bKZJz3.js} +1 -1
  111. package/dist/client/assets/{index-C6ZXBMKy.js → index-94TmFXEM.js} +1 -1
  112. package/dist/client/assets/{index-CqeCI00R.js → index-B5PgsjuZ.js} +1 -1
  113. package/dist/client/assets/{index-CohYEXUC.js → index-BB5lA5jj.js} +3 -3
  114. package/dist/client/assets/{index-p-NZuQLL.js → index-BKb79pgL.js} +1 -1
  115. package/dist/client/assets/index-BcGQg-Kx.js +2 -0
  116. package/dist/client/assets/{index-C_fGiia9.js → index-Bvhurd-Z.js} +28 -28
  117. package/dist/client/assets/{index-DAFuG1kQ.js → index-CuPxvnMd.js} +1 -1
  118. package/dist/client/assets/{index-UpQsgScZ.js → index-DZrgCtW9.js} +1 -1
  119. package/dist/client/assets/index-DvVn4R_K.js +1 -0
  120. package/dist/client/assets/{index-CTi2LrxD.js → index-IeYTwdqM.js} +1 -1
  121. package/dist/client/assets/{index-e-E887bU.js → index-JYMtN_ka.js} +1 -1
  122. package/dist/client/assets/{index-CVhE6SCR.js → index-OTCSzql6.js} +1 -1
  123. package/dist/client/assets/{index-B421HVEM.js → index-nfm9K1x2.js} +1 -1
  124. package/dist/client/assets/{index-redirect-C0lMrFZb.js → index-redirect-9xlH9kRG.js} +1 -1
  125. package/dist/client/assets/{index-O25bDoG2.js → index-xN4b_CkF.js} +1 -1
  126. package/dist/client/assets/{input-DooN4jkj.js → input-CcKrVAr2.js} +1 -1
  127. package/dist/client/assets/{integration-icon-DouvCAyQ.js → integration-icon-BFsmKVHF.js} +1 -1
  128. package/dist/client/assets/{invite-member-dialog-GTEEDh2Y.js → invite-member-dialog-6XRVfRTx.js} +1 -1
  129. package/dist/client/assets/{label-CHVjglvp.js → label-CW15sZLz.js} +1 -1
  130. package/dist/client/assets/{layout-BvnbP4Dr.js → layout-C1yYJmDo.js} +1 -1
  131. package/dist/client/assets/{login-Cf5hKO0l.js → login-B35xc8Gt.js} +1 -1
  132. package/dist/client/assets/{mcp-oauth-DmLpmBfh.js → mcp-oauth-Bx9msuxY.js} +1 -1
  133. package/dist/client/assets/{members-TMJ-nd-l.js → members-CtdxOI6T.js} +1 -1
  134. package/dist/client/assets/{monaco-editor-DeHPBeZj.js → monaco-editor-tITHyCTj.js} +1 -1
  135. package/dist/client/assets/{monitoring-stats-row-q_qpqwCs.js → monitoring-stats-row-5NJQerF_.js} +1 -1
  136. package/dist/client/assets/{multi-select-oNBbk1hp.js → multi-select-DjU5xocW.js} +1 -1
  137. package/dist/client/assets/{oauth-callback-DrO3rGFl.js → oauth-callback-DMSxm1aa.js} +1 -1
  138. package/dist/client/assets/{oauth-callback-ai-provider-Uc-mSRYP.js → oauth-callback-ai-provider-DNKUFr1T.js} +1 -1
  139. package/dist/client/assets/{onboarding-Es5wNRlJ.js → onboarding-DhudMezE.js} +1 -1
  140. package/dist/client/assets/{org-install-DwAkYRpj.js → org-install-BI6Tqb8M.js} +1 -1
  141. package/dist/client/assets/{org-layout-BmXupHnR.js → org-layout-BzM8m0Yo.js} +1 -1
  142. package/dist/client/assets/{organization-choice-Wkdav7l-.js → organization-choice-CLoSaGiq.js} +1 -1
  143. package/dist/client/assets/{orgs-BiuhDQqw.js → orgs-BXyQQf2t.js} +1 -1
  144. package/dist/client/assets/{page-seo-form-BITO5Cwa.js → page-seo-form-b_KQgaAh.js} +1 -1
  145. package/dist/client/assets/page-seo-sheet-ClLCRUIN.js +1 -0
  146. package/dist/client/assets/{popover-CMMyXpPK.js → popover-BhnGTRIN.js} +1 -1
  147. package/dist/client/assets/post-editor-BftvN04C.js +1 -0
  148. package/dist/client/assets/{primitives-1GpjyhXb.js → primitives-ueS43w85.js} +1 -1
  149. package/dist/client/assets/{profile-Bx6jAFG3.js → profile-BQf3SBqt.js} +1 -1
  150. package/dist/client/assets/project-app-view-DjP2PmND.js +1 -0
  151. package/dist/client/assets/provision-repo-scoped-github-connection-2iDn-wQ1.js +1 -0
  152. package/dist/client/assets/record-editor-Du8LTIQ8.js +1 -0
  153. package/dist/client/assets/redirect-editor-CZu9GWo3.js +1 -0
  154. package/dist/client/assets/registry-g2WwGfcO.js +2 -0
  155. package/dist/client/assets/{registry-layout-DoohESD-.js → registry-layout-DupWO7LC.js} +1 -1
  156. package/dist/client/assets/{reports-DdIsDSQY.js → reports-BlIjKH8H.js} +1 -1
  157. package/dist/client/assets/{require-capability-DWNo_rvi.js → require-capability-D7ZefDTd.js} +1 -1
  158. package/dist/client/assets/{required-auth-layout-DrnK06MM.js → required-auth-layout-COJ1HesY.js} +1 -1
  159. package/dist/client/assets/{reset-password-CYwCkT5L.js → reset-password-ByTmxDaH.js} +1 -1
  160. package/dist/client/assets/{roles-DUIPd2E1.js → roles-Cgr1guoV.js} +1 -1
  161. package/dist/client/assets/{search-input-gI5YpJSI.js → search-input-IdLCT-wl.js} +1 -1
  162. package/dist/client/assets/{secrets-DbP1su7D.js → secrets-DF0jWkhd.js} +1 -1
  163. package/dist/client/assets/{sections-editor-BmcqZp-u.js → sections-editor-Br2ZrjF9.js} +2 -2
  164. package/dist/client/assets/{select-DLOarQAH.js → select-BDKopoZs.js} +1 -1
  165. package/dist/client/assets/{select-model-DgC0KhDX.js → select-model-DQ3GcF2Q.js} +1 -1
  166. package/dist/client/assets/{self-tool-result-BSbws4qP.js → self-tool-result-Dehaso5-.js} +1 -1
  167. package/dist/client/assets/seo-editor-DxU1V_q7.js +1 -0
  168. package/dist/client/assets/{settings-layout-CGbNh01L.js → settings-layout-BTr-31q1.js} +1 -1
  169. package/dist/client/assets/{settings-section-CSQS_fOd.js → settings-section-Bs2y0W38.js} +1 -1
  170. package/dist/client/assets/{shell-controls-r8aLrbK0.js → shell-controls-BNwC-U3m.js} +1 -1
  171. package/dist/client/assets/{shell-layout-DtOHLb0x.js → shell-layout-DBwpg5fa.js} +1 -1
  172. package/dist/client/assets/{sidebar-fRXLoYlv.js → sidebar-BiKcuUlz.js} +1 -1
  173. package/dist/client/assets/{skeleton-DrvCYvFD.js → skeleton-DO-zgL8S.js} +1 -1
  174. package/dist/client/assets/{sso-C9Vqlw8M.js → sso-BVw4m6Is.js} +1 -1
  175. package/dist/client/assets/{store-h6xQOgKK.js → store-BBq6XldJ.js} +1 -1
  176. package/dist/client/assets/store-registry-BIIvqrwe.js +2 -0
  177. package/dist/client/assets/{studio-tools-Cmxh51BW.js → studio-tools-QgTnVt0y.js} +1 -1
  178. package/dist/client/assets/{switch-CCu5HEzP.js → switch-7KE_HjZk.js} +1 -1
  179. package/dist/client/assets/{table-TsjPt8Gf.js → table-C23nDXu-.js} +1 -1
  180. package/dist/client/assets/{tabs-BhgZ3ZmW.js → tabs-B0oOCjef.js} +1 -1
  181. package/dist/client/assets/{textarea-DDxbxAIb.js → textarea-D3iFRZ9o.js} +1 -1
  182. package/dist/client/assets/{toggle-group-gGQTQIMA.js → toggle-group-MA_94m4S.js} +1 -1
  183. package/dist/client/assets/{toolbar-icon-button-Bw7f5O1p.js → toolbar-icon-button-Be0Xxrx6.js} +1 -1
  184. package/dist/client/assets/{toolbar-D-2K0Fk5.js → toolbar-w5KxuBt-.js} +1 -1
  185. package/dist/client/assets/{tooltip-owO6Fujv.js → tooltip-LRHFL41r.js} +1 -1
  186. package/dist/client/assets/{use-ai-providers-B919C25s.js → use-ai-providers-BeYG-EjG.js} +1 -1
  187. package/dist/client/assets/{use-automations-CJdJQaET.js → use-automations-CAUzSd8j.js} +1 -1
  188. package/dist/client/assets/{use-autosave-D09qjW1V.js → use-autosave-C6ffzJDR.js} +1 -1
  189. package/dist/client/assets/{use-capability-CiXd5r1-.js → use-capability-Dch03R8X.js} +1 -1
  190. package/dist/client/assets/{use-clock-tick-Bo5nmZlI.js → use-clock-tick-CVibzfL9.js} +1 -1
  191. package/dist/client/assets/{use-collections-X_sc34If.js → use-collections-D9omaJJu.js} +1 -1
  192. package/dist/client/assets/{use-connection-DuDkpb0e.js → use-connection-hO51hV8J.js} +1 -1
  193. package/dist/client/assets/{use-copy-Bx3m2rO-.js → use-copy-tGW1Vaes.js} +1 -1
  194. package/dist/client/assets/{use-create-virtual-mcp-ByH8ooeL.js → use-create-virtual-mcp-CdWTTl06.js} +1 -1
  195. package/dist/client/assets/{use-debounced-autosave-CjuwhAVQ.js → use-debounced-autosave-cTAMJ-st.js} +1 -1
  196. package/dist/client/assets/{use-debounced-value-L3f6T_5p.js → use-debounced-value-C8BZDtz1.js} +1 -1
  197. package/dist/client/assets/{use-deco-credits-C8loT1AO.js → use-deco-credits-D8dtxTPg.js} +1 -1
  198. package/dist/client/assets/{use-decopilot-events-CynGBvUt.js → use-decopilot-events-4o9NNSez.js} +1 -1
  199. package/dist/client/assets/{use-delete-connection-C0mv8dIz.js → use-delete-connection-BqJkmcK6.js} +1 -1
  200. package/dist/client/assets/{use-deployment-admin-DabPejE5.js → use-deployment-admin-D_HkirOy.js} +1 -1
  201. package/dist/client/assets/{use-file-configs-CIujnhhg.js → use-file-configs-CZiarNuS.js} +1 -1
  202. package/dist/client/assets/{use-infinite-scroll-Y2vLF9MQ.js → use-infinite-scroll-DgcSj6JD.js} +1 -1
  203. package/dist/client/assets/{use-join-requests-BzWPX9mp.js → use-join-requests-BqCHI8Zj.js} +1 -1
  204. package/dist/client/assets/{use-mcp-auth-status-CWMnl4kQ.js → use-mcp-auth-status-CLsbHDCg.js} +1 -1
  205. package/dist/client/assets/{use-mcp-client-CM7X9MZh.js → use-mcp-client-W9fEi0Ml.js} +1 -1
  206. package/dist/client/assets/{use-mcp-tools--4fgvczm.js → use-mcp-tools-uwmJZn0p.js} +1 -1
  207. package/dist/client/assets/{use-members-D9EO1Bhw.js → use-members-B6EJ964p.js} +1 -1
  208. package/dist/client/assets/{use-mobile-CA2wukFn.js → use-mobile-BQOMgKS3.js} +1 -1
  209. package/dist/client/assets/{use-navigate-to-agent-BQJR7hS-.js → use-navigate-to-agent-DqqHYLVD.js} +1 -1
  210. package/dist/client/assets/{use-org-auth-client-BBy-fA8U.js → use-org-auth-client-Y5-GC6qM.js} +1 -1
  211. package/dist/client/assets/{use-org-sso-_-9Ndxjg.js → use-org-sso-Dqg59TFA.js} +1 -1
  212. package/dist/client/assets/{use-organization-roles-DCK1gCYk.js → use-organization-roles-CeuO8sTI.js} +1 -1
  213. package/dist/client/assets/{use-organization-settings-STRgrAfE.js → use-organization-settings-CQJ8RPRh.js} +1 -1
  214. package/dist/client/assets/use-registry-app-DVOJoUv5.js +1 -0
  215. package/dist/client/assets/{use-registry-connections-B3SITFNT.js → use-registry-connections-DdQfbjwO.js} +1 -1
  216. package/dist/client/assets/{use-secrets-DeioiR_Q.js → use-secrets-CIsNwBX2.js} +1 -1
  217. package/dist/client/assets/{use-status-sounds-MPm8b7Px.js → use-status-sounds-DFGyya-5.js} +1 -1
  218. package/dist/client/assets/{use-view-mode-B-Z3o5Ts.js → use-view-mode-DJMiJaWa.js} +1 -1
  219. package/dist/client/assets/{use-virtual-mcp-aGmJHwFC.js → use-virtual-mcp-DpSXhS0n.js} +1 -1
  220. package/dist/client/assets/useInfiniteQuery-CyvFYQl8.js +1 -0
  221. package/dist/client/assets/{useRouterState-DzpKjEia.js → useRouterState-DpJ4EK7e.js} +1 -1
  222. package/dist/client/assets/useSuspenseInfiniteQuery-C33XLke-.js +1 -0
  223. package/dist/client/assets/{users-C5ACxEJi.js → users-EWx6DB7t.js} +1 -1
  224. package/dist/client/assets/{variant-calendar-BIM35rdy.js → variant-calendar-DchPOrHH.js} +1 -1
  225. package/dist/client/assets/{view-mode-toggle-CWwEb6HJ.js → view-mode-toggle-hMQMe6tZ.js} +1 -1
  226. package/dist/client/index.html +1 -1
  227. package/dist/server/cli.js +1 -1
  228. package/dist/server/server.js +1 -1
  229. package/package.json +1 -1
  230. package/dist/client/assets/agents-list-Df8i4rGT.js +0 -1
  231. package/dist/client/assets/app-editor-Dymjomoi.js +0 -1
  232. package/dist/client/assets/automations-Qkqzours.js +0 -1
  233. package/dist/client/assets/category-editor-BPpEoMdX.js +0 -1
  234. package/dist/client/assets/commerce-onboarding-yv2iV0vu.js +0 -1
  235. package/dist/client/assets/companions-core-D65XjKFb.js +0 -1
  236. package/dist/client/assets/file-explorer-C1XUdiUA.js +0 -2
  237. package/dist/client/assets/github-repo-picker-CD1HFBLK.js +0 -1
  238. package/dist/client/assets/index-CEvMb-yW.js +0 -1
  239. package/dist/client/assets/index-cJm4RNKA.js +0 -2
  240. package/dist/client/assets/page-seo-sheet-DVGxv6BI.js +0 -1
  241. package/dist/client/assets/post-editor-QO48PKJR.js +0 -1
  242. package/dist/client/assets/project-app-view-zZm-8Y4L.js +0 -1
  243. package/dist/client/assets/provision-repo-scoped-github-connection-CB4ICKHq.js +0 -1
  244. package/dist/client/assets/record-editor-DJy-LqeK.js +0 -1
  245. package/dist/client/assets/redirect-editor-BErOiRuY.js +0 -1
  246. package/dist/client/assets/registry-QdP3QwyG.js +0 -2
  247. package/dist/client/assets/seo-editor-1B33gCbJ.js +0 -1
  248. package/dist/client/assets/store-registry-BRCiwnTn.js +0 -2
  249. package/dist/client/assets/useInfiniteQuery-BVqkvkK2.js +0 -1
  250. package/dist/client/assets/useSuspenseInfiniteQuery-BXgDSTQv.js +0 -1
@@ -1,2 +1,2 @@
1
- import{c as He,r as w,l as Ee,j as n,B as We,i as Hn,n as Ss,t as G,K as xs}from"./index-CohYEXUC.js";import{X as ys,Y as bs,Z as _s,K as Un,L as zt,M as Gn,P as Wn,i as qn,_ as js,F as Yn,H as Jn,$ as ks,G as ws,a0 as Rs,N as Qn,O as Rt,T as Xn,U as Zn,Q as ea,R as ta,a1 as na,a2 as Ns,a3 as Nt,a4 as Ds,S as aa,a5 as tt,a6 as Cs,a7 as Vs,a8 as Ts,e as Ps,k as As,a9 as Ms,aa as Es,ab as Ks,ac as $s,r as Ot,ad as Bt,ae as Os,af as ut,ag as jt,ah as Bs,ai as Ls,aj as Je,ak as Vn,al as Fs,am as Tn,an as kt,ao as Lt,ap as Is,aq as sn,ar as zs,as as xt,at as Hs,au as Us,av as Gs,aw as Ws,ax as qs,ay as dt,az as Ys,aA as Js,aB as Qs,aC as Pn,aD as wt,m as Xs,aE as Zs,aF as er,aG as tr,aH as nr,aI as rn,aJ as An,aK as Mn,aL as yt,aM as Ft,aN as En,aO as ar,aP as sr,aQ as on,aR as rr,aS as or,aT as Kn,aU as ir}from"./index-C_fGiia9.js";import{t as lr}from"./ChevronDown-Ce0JNwG8.js";import{a as sa,n as ra}from"./UserPlus01-C0VtXGyN.js";import{i as oa}from"./ChevronRight-Bf6_HJan.js";import{n as cr}from"./ChevronUp-Cflkeqqz.js";import{S as cn,y as ur,T as dr,U as mr}from"./agent-icon-B1DcT15_.js";import{i as fr}from"./Globe01-UO2cBICu.js";import{A as It}from"./automation-runs-BvQ_NpzR.js";import{b as mt,T as ft,a as pt}from"./tooltip-owO6Fujv.js";import{a as pr,D as hr,h as gr,c as vr,d as Sr,e as xr}from"./dialog-7JXjpLzj.js";import{I as yr}from"./input-DooN4jkj.js";import{a as ia}from"./Copy01-Du_M_0KX.js";import{b as br}from"./ZoomOut-CKfihzl3.js";import{i as _r}from"./Settings02-CGoVxrYE.js";import{s as jr}from"./Eye-D-54suMo.js";import{s as la}from"./Flag01-ugYNIxEK.js";import{s as un}from"./Plus-CizB5jQt.js";import{s as ca}from"./Trash01-oe1NMhcg.js";import{i as kr}from"./Zap-CMeneH21.js";import{d as it,a as ua,D as da,c as ma,j as wr}from"./dropdown-menu-CfwadO2Z.js";import{S as Rr,r as $n,a as Nr,d as Dr,b as Cr,i as Vr,f as Tr,P as Pr,c as Ar}from"./page-seo-form-BITO5Cwa.js";import{b as Mr}from"./Tool01-Bm90mZCD.js";import{A as Er}from"./add-section-modal-9hA4zHWa.js";import"./ArrowUp-CdLsMjki.js";import"./chat-context-D0hwm5HT.js";import"./autosend-qdJpe4iq.js";import"./hooks-ChQF06R2.js";import"./use-mcp-client-CM7X9MZh.js";import"./constants-D_FQAPnt.js";import"./auth-BbW7SMY9.js";import"./decopilot-sse-pool-DDyGdbf8.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-Cmxh51BW.js";import"./use-virtual-mcp-aGmJHwFC.js";import"./use-collections-X_sc34If.js";import"./use-ai-providers-B919C25s.js";import"./use-decopilot-events-CynGBvUt.js";import"./tab-id-BijBBRwE.js";import"./use-organization-settings-STRgrAfE.js";import"./drawer-975r1xgz.js";import"./collection-search-1EZ5z6Vc.js";import"./SearchMd-CcQf_5lB.js";import"./use-mobile-CA2wukFn.js";import"./AreaChart-CdRNAaTW.js";import"./index-O25bDoG2.js";import"./X-B6u4BYeS.js";import"./shell-layout-DtOHLb0x.js";import"./avatar-DMDa5Fmk.js";import"./User01-C7ZuARbC.js";import"./Users03-CHK21j2b.js";import"./SearchLg-CiDD8qnw.js";import"./Stars02-C0mePgbQ.js";import"./XClose-lZsBUygk.js";import"./CheckCircle-tljwuhuM.js";import"./FilterLines-BgdIIHnR.js";import"./alert-dialog-BHYtfpRM.js";import"./required-auth-layout-DrnK06MM.js";import"./use-org-sso-_-9Ndxjg.js";import"./ZapSquare-B3ibL8nl.js";import"./Check-CYLXae3M.js";import"./Star01-BVrjnnC8.js";import"./Image01-DKb2muBn.js";import"./Upload01-BXr1BH_I.js";import"./AlertCircle-eG6Gc49G.js";import"./form-CoMC4z4E.js";import"./label-CHVjglvp.js";import"./select-DLOarQAH.js";import"./XCircle-DGI9dgcJ.js";import"./tabs-BhgZ3ZmW.js";import"./Tool02-daiZ8ZdA.js";import"./toggle-group-gGQTQIMA.js";import"./use-deco-credits-C8loT1AO.js";import"./extract-connection-data-xHncf4eT.js";import"./connection-card--smrdlwg.js";import"./use-registry-connections-B3SITFNT.js";import"./use-connection-DuDkpb0e.js";import"./useInfiniteQuery-BVqkvkK2.js";import"./use-infinite-scroll-Y2vLF9MQ.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-B2cV3vAA.js";import"./integration-icon-DouvCAyQ.js";import"./textarea-DDxbxAIb.js";import"./connection-form-helpers-Det9xziz.js";import"./authenticate-and-persist-oauth-SPitL5yD.js";import"./mcp-oauth-DmLpmBfh.js";import"./collection-tabs-G10EJ6rD.js";import"./badge-DGFRrczB.js";import"./useSuspenseInfiniteQuery-BXgDSTQv.js";import"./Monitor01-C1p3z_f5.js";import"./connect-desktop-dialog-Cl6dLVAA.js";import"./select-model-DgC0KhDX.js";import"./checkbox-n-zGS588.js";import"./skeleton-DrvCYvFD.js";import"./Key01-Cq-J9mZo.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CSQS_fOd.js";import"./ArrowUpRight-O8BszRRp.js";import"./Stars01-DSPE0_0T.js";import"./command-Bijkf_mr.js";import"./index-CVhE6SCR.js";import"./popover-CMMyXpPK.js";import"./index-e-E887bU.js";import"./Palette-B-oF6tIa.js";import"./file-type-icon-C9w5Ssef.js";import"./toolbar-D-2K0Fk5.js";import"./Package-BjwszD_f.js";import"./use-debounced-value-L3f6T_5p.js";import"./LinkExternal01-BvGijEfo.js";import"./index-UpQsgScZ.js";import"./LayoutLeft-B5__5XBq.js";import"./DotsVertical-xFAtxH3A.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-MPm8b7Px.js";import"./empty-state-C2pMk4Io.js";import"./use-mcp-tools--4fgvczm.js";import"./use-capability-CiXd5r1-.js";import"./Play-D-YRWYQr.js";import"./use-debounced-autosave-CjuwhAVQ.js";import"./index-DAFuG1kQ.js";import"./sidebar-fRXLoYlv.js";import"./search-input-gI5YpJSI.js";import"./use-mcp-auth-status-CWMnl4kQ.js";import"./switch-CCu5HEzP.js";import"./github-repo-picker-CD1HFBLK.js";import"./use-navigate-to-agent-BQJR7hS-.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-CB4ICKHq.js";import"./Users01-DZyUR8Yh.js";import"./use-secrets-DeioiR_Q.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./companions-core-D65XjKFb.js";import"./format-time-BnbuEtat.js";import"./TrendUp01-DvuM4A6y.js";import"./use-members-D9EO1Bhw.js";import"./use-org-auth-client-BBy-fA8U.js";import"./index-cJm4RNKA.js";import"./get-initials-D-f_fDFw.js";import"./List-CIEQZx9S.js";import"./Circle-DzHZa-kj.js";import"./calendar-BmG3lShW.js";import"./use-copy-Bx3m2rO-.js";import"./toolbar-icon-button-Bw7f5O1p.js";import"./SwitchHorizontal01-BoKJqR3a.js";import"./monaco-editor-DeHPBeZj.js";import"./use-file-configs-CIujnhhg.js";import"./use-automations-CJdJQaET.js";import"./automation-list-row-Dn4IsiQT.js";import"./Globe04-DzUT07Cn.js";import"./HardDrive-bE1MoLDy.js";import"./Sun-3gpGRkKw.js";import"./Shield01-nfrTF4Mw.js";import"./table-TsjPt8Gf.js";import"./use-clock-tick-Bo5nmZlI.js";function Kr(m){return m.schema?.definitions??m.schema?.$defs??{}}function $r(m,e){const r=Kr(e),c=r[btoa(m)];if(!c)return;let d=typeof c.image=="string"?c.image:void 0;if(!d&&Array.isArray(c.allOf)){const h=c.allOf.find(S=>typeof S.$ref=="string")?.$ref;if(typeof h=="string"){const S=h.replace("#/definitions/",""),p=r[S];d=typeof p?.image=="string"?p.image:void 0}}if(d?.includes("{{{"))return d}function Or(m,e){if(!e)return;const r=ys(m);if(!r)return;const c=$r(r.resolveType,e);if(!c)return;const d=bs(c,r.data);if(d)return _s(d)}const Br="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Lr="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function On(m){return Array.from({length:m},(e,r)=>({id:crypto.randomUUID(),index:r}))}function fa(m){return m.map((e,r)=>({...e,index:r}))}function Fr(m,e){if(e===m.length)return m;if(e<m.length)return fa(m.slice(0,e));const r=Array.from({length:e-m.length},(c,d)=>({id:crypto.randomUUID(),index:m.length+d}));return[...m,...r]}function pa(m){const e=He.c(20),{section:r,raw:c,meta:d}=m,h=r.isSavedBlock===!0,S=r.isMultivariate===!0;let p;e[0]!==d||e[1]!==c?(p=c&&d?Or(c,d):void 0,e[0]=d,e[1]=c,e[2]=p):p=e[2];const v=p;let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(br,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=g):g=e[3];let b;e[4]!==v?(b=v&&n.jsx("img",{src:v,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=v,e[5]=b):b=e[5];let V;e[6]!==S||e[7]!==h?(V=h?{color:ws}:S?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=S,e[7]=h,e[8]=V):V=e[8];let R;e[9]!==V?(R=n.jsx(cn,{className:"h-4 w-4 shrink-0",style:V}),e[9]=V,e[10]=R):R=e[10];const _=r.isHidden&&"line-through opacity-50";let k;e[11]!==_?(k=Ee("min-w-0 flex-1 truncate text-sm font-medium",_),e[11]=_,e[12]=k):k=e[12];let o;e[13]!==r.label||e[14]!==k?(o=n.jsx("span",{className:k,children:r.label}),e[13]=r.label,e[14]=k,e[15]=o):o=e[15];let N;return e[16]!==b||e[17]!==R||e[18]!==o?(N=n.jsxs(n.Fragment,{children:[g,b,R,o]}),e[16]=b,e[17]=R,e[18]=o,e[19]=N):N=e[19],N}function ha(m,e){const r=m.isSavedBlock===!0,c=m.isMultivariate===!0;return Ee("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":r?Br:c?"text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]":"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Ir(m){const e=He.c(64),{section:r,raw:c,meta:d,sortableId:h,selected:S,onSelect:p,onDelete:v,onDuplicate:g,onMakeReusable:b,onToggleHidden:V,onToggleLazy:R,onAddVariant:_,onDetach:k}=m,o=c?qn(c.__resolveType??""):!1;let N;e[0]!==r?(N=js(r),e[0]=r,e[1]=N):N=e[1];const l=N;let J;e[2]!==h?(J={id:h,animateLayoutChanges:Wr},e[2]=h,e[3]=J):J=e[3];const{attributes:H,listeners:K,setNodeRef:u,transform:T,isDragging:se}=Yn(J);let P;e[4]!==T?(P=Jn.Transform.toString(T?{...T,x:0}:null),e[4]=T,e[5]=P):P=e[5];const pe=se?0:void 0;let D;e[6]!==P||e[7]!==pe?(D={transform:P,opacity:pe},e[6]=P,e[7]=pe,e[8]=D):D=e[8];const ce=D;let B;e[9]!==r?(B=ks(r),e[9]=r,e[10]=B):B=e[10];const te=B,oe="button",Ve=0;let E;e[11]!==p?(E=$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),p())},e[11]=p,e[12]=E):E=e[12];const ue=se?"cursor-grabbing":"cursor-pointer";let ie;e[13]!==r||e[14]!==S||e[15]!==ue?(ie=Ee("touch-none transition-colors",ue,ha(r,S)),e[13]=r,e[14]=S,e[15]=ue,e[16]=ie):ie=e[16];let je;e[17]!==d||e[18]!==c||e[19]!==r?(je=n.jsx(pa,{section:r,raw:c,meta:d}),e[17]=d,e[18]=c,e[19]=r,e[20]=je):je=e[20];const M=!r.isMultivariate&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":o?"Disable async render":"Enable async render",className:Ee("h-7 w-7 shrink-0",o?"":"opacity-0 group-hover:opacity-100"),onClick:$=>{$.stopPropagation(),R()},onPointerDown:Gr,children:n.jsx(kr,{className:Ee("h-3.5 w-3.5",o&&"text-yellow-500")})})}),n.jsx(pt,{side:"bottom",children:o?"Disable async render":"Enable async render"})]});let Ae;e[21]!==V||e[22]!==r.isHidden||e[23]!==r.isMultivariate?(Ae=!r.isMultivariate&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":r.isHidden?"Show section":"Hide section",className:Ee("h-7 w-7 shrink-0",r.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:$=>{$.stopPropagation(),V()},onPointerDown:Ur,children:r.isHidden?n.jsx(_r,{className:"h-3.5 w-3.5"}):n.jsx(jr,{className:"h-3.5 w-3.5"})})}),n.jsx(pt,{side:"bottom",children:r.isHidden?"Show section":"Hide section"})]}),e[21]=V,e[22]=r.isHidden,e[23]=r.isMultivariate,e[24]=Ae):Ae=e[24];let X;e[25]===Symbol.for("react.memo_cache_sentinel")?(X=n.jsx(ua,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":"Section actions",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:Hr,onPointerDown:zr,children:n.jsx(sa,{className:"h-3.5 w-3.5"})})}),e[25]=X):X=e[25];let De;e[26]!==g?(De=$=>{$.stopPropagation(),g()},e[26]=g,e[27]=De):De=e[27];let ve;e[28]===Symbol.for("react.memo_cache_sentinel")?(ve=n.jsx(ia,{className:"h-4 w-4"}),e[28]=ve):ve=e[28];let re;e[29]!==De?(re=n.jsxs(it,{onClick:De,children:[ve,"Duplicate"]}),e[29]=De,e[30]=re):re=e[30];let W;e[31]!==l||e[32]!==_?(W=l&&n.jsxs(it,{className:Rs,onClick:$=>{$.stopPropagation(),_()},children:[n.jsx(la,{className:"h-4 w-4"}),"Add variant"]}),e[31]=l,e[32]=_,e[33]=W):W=e[33];let q;e[34]!==te||e[35]!==b?(q=te&&n.jsxs(it,{className:Lr,onClick:$=>{$.stopPropagation(),b()},children:[n.jsx(cn,{className:"h-4 w-4"}),"Make reusable"]}),e[34]=te,e[35]=b,e[36]=q):q=e[36];let ne;e[37]!==k||e[38]!==r.isMultivariate||e[39]!==r.isSavedBlock?(ne=r.isSavedBlock===!0&&!r.isMultivariate&&n.jsxs(it,{onClick:$=>{$.stopPropagation(),k()},children:[n.jsx(cn,{className:"h-4 w-4"}),"Detach"]}),e[37]=k,e[38]=r.isMultivariate,e[39]=r.isSavedBlock,e[40]=ne):ne=e[40];let le;e[41]!==v?(le=$=>{$.stopPropagation(),v()},e[41]=v,e[42]=le):le=e[42];let ke;e[43]===Symbol.for("react.memo_cache_sentinel")?(ke=n.jsx(ca,{className:"h-4 w-4"}),e[43]=ke):ke=e[43];let Se;e[44]!==le?(Se=n.jsxs(it,{className:"text-destructive focus:text-destructive",onClick:le,children:[ke,"Delete"]}),e[44]=le,e[45]=Se):Se=e[45];let de;e[46]!==re||e[47]!==W||e[48]!==q||e[49]!==ne||e[50]!==Se?(de=n.jsxs(da,{children:[X,n.jsxs(ma,{align:"end",className:"w-44",children:[re,W,q,ne,Se]})]}),e[46]=re,e[47]=W,e[48]=q,e[49]=ne,e[50]=Se,e[51]=de):de=e[51];let be;return e[52]!==H||e[53]!==K||e[54]!==p||e[55]!==u||e[56]!==ce||e[57]!==ie||e[58]!==je||e[59]!==M||e[60]!==Ae||e[61]!==de||e[62]!==E?(be=n.jsxs("div",{ref:u,style:ce,...H,...K,role:oe,tabIndex:Ve,onClick:p,onKeyDown:E,className:ie,children:[je,M,Ae,de]}),e[52]=H,e[53]=K,e[54]=p,e[55]=u,e[56]=ce,e[57]=ie,e[58]=je,e[59]=M,e[60]=Ae,e[61]=de,e[62]=E,e[63]=be):be=e[63],be}function zr(m){return m.stopPropagation()}function Hr(m){return m.stopPropagation()}function Ur(m){return m.stopPropagation()}function Gr(m){return m.stopPropagation()}function Wr(){return!1}function qr(m){const e=He.c(90),{listKey:r,rawSections:c,sections:d,meta:h,selectedIndex:S,onSelect:p,onReorder:v,onDelete:g,onDuplicate:b,onMakeReusable:V,onToggleHidden:R,onToggleLazy:_,onAddVariant:k,onDetach:o,onAddSection:N,canAddSection:l}=m,J=l===void 0?!0:l;let H;e[0]!==d.length?(H=()=>On(d.length),e[0]=d.length,e[1]=H):H=e[1];const[K,u]=w.useState(H),[T,se]=w.useState(null),[P,pe]=w.useState(r),[D,ce]=w.useState(d.length),B=w.useRef(!1);P!==r?(pe(r),ce(d.length),u(On(d.length))):D!==d.length&&(ce(d.length),u(L=>Fr(L,d.length)));let te;e[2]===Symbol.for("react.memo_cache_sentinel")?(te={activationConstraint:{distance:8}},e[2]=te):te=e[2];let oe;e[3]===Symbol.for("react.memo_cache_sentinel")?(oe={coordinateGetter:Qn},e[3]=oe):oe=e[3];const Ve=Un(zt(Wn,te),zt(Gn,oe));let E;e[4]!==K?(E=K.map(Yr),e[4]=K,e[5]=E):E=e[5];const ue=E;let ie;e[6]===Symbol.for("react.memo_cache_sentinel")?(ie=L=>{se(String(L.active.id))},e[6]=ie):ie=e[6];const je=ie;let M;e[7]!==ue||e[8]!==v?(M=L=>{se(null);const{active:ae,over:Q}=L;if(!Q||ae.id===Q.id)return;const Ie=ue.indexOf(String(ae.id)),he=ue.indexOf(String(Q.id));Ie===-1||he===-1||(u(Qe=>fa(Rt([...Qe],Ie,he))),B.current=!0,requestAnimationFrame(()=>{B.current=!1}),v?.(Ie,he))},e[7]=ue,e[8]=v,e[9]=M):M=e[9];const Ae=M;let X;e[10]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{se(null)},e[10]=X):X=e[10];const De=X;let ve,re,W,q,ne,le,ke,Se,de,be,$,Z,we,Ke,$e;if(e[11]!==T||e[12]!==J||e[13]!==K||e[14]!==ue||e[15]!==Ae||e[16]!==h||e[17]!==N||e[18]!==k||e[19]!==g||e[20]!==o||e[21]!==b||e[22]!==V||e[23]!==p||e[24]!==R||e[25]!==_||e[26]!==c||e[27]!==d||e[28]!==S||e[29]!==Ve){Ke=Symbol.for("react.early_return_sentinel");e:{const L=ae=>{B.current||p(ae)};if(e[45]!==T||e[46]!==J||e[47]!==K||e[48]!==N||e[49]!==c||e[50]!==d){const ae=T?K.find(Q=>Q.id===T):null;if(q=ae!=null?d[ae.index]:null,W=ae!=null?c[ae.index]:void 0,K.length===0){let Q;e[54]===Symbol.for("react.memo_cache_sentinel")?(Q=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No sections in this page."}),e[54]=Q):Q=e[54];const Ie=!J;let he;e[55]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx(un,{size:14}),e[55]=he):he=e[55];let Qe;e[56]!==N||e[57]!==Ie?(Qe=n.jsxs("div",{className:"space-y-2",children:[Q,n.jsxs(We,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Ie,onClick:N,children:[he,"Add section"]})]}),e[56]=N,e[57]=Ie,e[58]=Qe):Qe=e[58],Ke=Qe;break e}we=Ee(ae&&"cursor-grabbing"),e[45]=T,e[46]=J,e[47]=K,e[48]=N,e[49]=c,e[50]=d,e[51]=W,e[52]=q,e[53]=we}else W=e[51],q=e[52],we=e[53];re=Xn,Se=Ve,de=Zn,be=je,$=Ae,Z=De,ve=ea,le=ue,ke=ta,$e="space-y-1",ne=K.map(ae=>{const Q=d[ae.index];return Q?n.jsx(Ir,{sortableId:ae.id,section:Q,raw:c[ae.index],meta:h,selected:S===ae.index,onSelect:()=>L(ae.index),onDelete:()=>g(ae.index),onDuplicate:()=>b(ae.index),onMakeReusable:()=>V(ae.index),onToggleHidden:()=>R(ae.index),onToggleLazy:()=>_(ae.index),onAddVariant:()=>k(ae.index),onDetach:()=>o(ae.index)},ae.id):null})}e[11]=T,e[12]=J,e[13]=K,e[14]=ue,e[15]=Ae,e[16]=h,e[17]=N,e[18]=k,e[19]=g,e[20]=o,e[21]=b,e[22]=V,e[23]=p,e[24]=R,e[25]=_,e[26]=c,e[27]=d,e[28]=S,e[29]=Ve,e[30]=ve,e[31]=re,e[32]=W,e[33]=q,e[34]=ne,e[35]=le,e[36]=ke,e[37]=Se,e[38]=de,e[39]=be,e[40]=$,e[41]=Z,e[42]=we,e[43]=Ke,e[44]=$e}else ve=e[30],re=e[31],W=e[32],q=e[33],ne=e[34],le=e[35],ke=e[36],Se=e[37],de=e[38],be=e[39],$=e[40],Z=e[41],we=e[42],Ke=e[43],$e=e[44];if(Ke!==Symbol.for("react.early_return_sentinel"))return Ke;let Le;e[59]!==ne||e[60]!==$e?(Le=n.jsx("div",{className:$e,children:ne}),e[59]=ne,e[60]=$e,e[61]=Le):Le=e[61];let Te;e[62]!==ve||e[63]!==le||e[64]!==ke||e[65]!==Le?(Te=n.jsx(ve,{items:le,strategy:ke,children:Le}),e[62]=ve,e[63]=le,e[64]=ke,e[65]=Le,e[66]=Te):Te=e[66];let Oe;e[67]!==W||e[68]!==q||e[69]!==h?(Oe=q?n.jsx("div",{className:Ee("cursor-grabbing shadow-lg ring-1 ring-border/60",ha(q,!1)),children:n.jsx(pa,{section:q,raw:W,meta:h})}):null,e[67]=W,e[68]=q,e[69]=h,e[70]=Oe):Oe=e[70];let Fe;e[71]!==Oe?(Fe=n.jsx(na,{dropAnimation:null,children:Oe}),e[71]=Oe,e[72]=Fe):Fe=e[72];let Me;e[73]!==re||e[74]!==Se||e[75]!==de||e[76]!==be||e[77]!==$||e[78]!==Z||e[79]!==Te||e[80]!==Fe?(Me=n.jsxs(re,{sensors:Se,collisionDetection:de,onDragStart:be,onDragEnd:$,onDragCancel:Z,children:[Te,Fe]}),e[73]=re,e[74]=Se,e[75]=de,e[76]=be,e[77]=$,e[78]=Z,e[79]=Te,e[80]=Fe,e[81]=Me):Me=e[81];const xe=!J;let Re;e[82]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(un,{size:14}),e[82]=Re):Re=e[82];let me;e[83]!==N||e[84]!==xe?(me=n.jsxs(We,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:xe,onClick:N,children:[Re,"Add section"]}),e[83]=N,e[84]=xe,e[85]=me):me=e[85];let ee;return e[86]!==we||e[87]!==Me||e[88]!==me?(ee=n.jsxs("div",{className:we,children:[Me,me]}),e[86]=we,e[87]=Me,e[88]=me,e[89]=ee):ee=e[89],ee}function Yr(m){return m.id}function Bn(m){const e=He.c(38),{open:r,initialName:c,autoLabel:d,isPending:h,onSubmit:S,onOpenChange:p}=m,v=h===void 0?!1:h,[g,b]=w.useState(c),[V,R]=w.useState(r);r!==V&&(R(r),r&&b(c));let _;e[0]!==v||e[1]!==p?(_=oe=>{!oe&&!v&&p(!1)},e[0]=v,e[1]=p,e[2]=_):_=e[2];const k=_;let o;e[3]!==v||e[4]!==g||e[5]!==S?(o=async oe=>{oe.preventDefault(),!v&&await S(g.trim())},e[3]=v,e[4]=g,e[5]=S,e[6]=o):o=e[6];const N=o;let l;e[7]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(pr,{children:"Rename variant"}),e[7]=l):l=e[7];const J=d||"the rule";let H;e[8]!==J?(H=n.jsxs(hr,{children:[l,n.jsxs(gr,{children:["Save this matcher as a global block with a custom label. Leave empty to inline the matcher again and fall back to"," ",n.jsx("span",{className:"font-medium",children:J}),"."]})]}),e[8]=J,e[9]=H):H=e[9];let K;e[10]===Symbol.for("react.memo_cache_sentinel")?(K=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[10]=K):K=e[10];let u;e[11]===Symbol.for("react.memo_cache_sentinel")?(u=oe=>b(oe.target.value),e[11]=u):u=e[11];let T;e[12]!==d||e[13]!==v||e[14]!==g?(T=n.jsxs("div",{className:"space-y-1.5 py-4",children:[K,n.jsx(yr,{id:"variant-rename-name",value:g,onChange:u,placeholder:d,autoFocus:!0,disabled:v})]}),e[12]=d,e[13]=v,e[14]=g,e[15]=T):T=e[15];let se;e[16]!==p?(se=()=>p(!1),e[16]=p,e[17]=se):se=e[17];let P;e[18]!==v||e[19]!==se?(P=n.jsx(We,{type:"button",variant:"outline",onClick:se,disabled:v,children:"Cancel"}),e[18]=v,e[19]=se,e[20]=P):P=e[20];let pe;e[21]!==v?(pe=v?n.jsxs(n.Fragment,{children:[n.jsx(Hn,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=v,e[22]=pe):pe=e[22];let D;e[23]!==v||e[24]!==pe?(D=n.jsx(We,{type:"submit",disabled:v,children:pe}),e[23]=v,e[24]=pe,e[25]=D):D=e[25];let ce;e[26]!==P||e[27]!==D?(ce=n.jsxs(vr,{children:[P,D]}),e[26]=P,e[27]=D,e[28]=ce):ce=e[28];let B;e[29]!==N||e[30]!==ce||e[31]!==H||e[32]!==T?(B=n.jsx(Sr,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:N,children:[H,T,ce]})}),e[29]=N,e[30]=ce,e[31]=H,e[32]=T,e[33]=B):B=e[33];let te;return e[34]!==k||e[35]!==r||e[36]!==B?(te=n.jsx(xr,{open:r,onOpenChange:k,children:B}),e[34]=k,e[35]=r,e[36]=B,e[37]=te):te=e[37],te}const Jr="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]",ga="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.2)]";function va(m){const e=He.c(5),{rule:r,matchers:c}=m,d=r?.__resolveType??"";let h;if(e[0]!==c||e[1]!==d){const g=c.find(b=>b.resolveType===d)?.iconName??Ns(d);h=ur(g),e[0]=c,e[1]=d,e[2]=h}else h=e[2];const S=h;if(!S)return null;let p;return e[3]!==S?(p=n.jsx(S,{size:14,className:"shrink-0"}),e[3]=S,e[4]=p):p=e[4],p}function Ln(m){return m.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
2
- `)}function ln(m){return m.map((e,r)=>({id:crypto.randomUUID(),index:r,variant:e}))}function Qr(m){return m.map((e,r)=>({...e,index:r}))}function Sa(m){const e=He.c(16),{label:r,effectiveRule:c,matchers:d,canDelete:h,dragging:S,onRename:p,onDuplicate:v,onDelete:g}=m;let b;e[0]!==c||e[1]!==d?(b=n.jsx(va,{rule:c,matchers:d}),e[0]=c,e[1]=d,e[2]=b):b=e[2];let V;e[3]!==r?(V=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:r}),e[3]=r,e[4]=V):V=e[4];let R;e[5]!==h||e[6]!==S||e[7]!==r||e[8]!==g||e[9]!==v||e[10]!==p?(R=!S&&n.jsxs(da,{children:[n.jsx(ua,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":`Actions for ${r}`,className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:Zr,onPointerDown:Xr,children:n.jsx(sa,{size:14})})}),n.jsxs(ma,{align:"end",className:"w-36",children:[n.jsxs(it,{onClick:k=>{k.stopPropagation(),p?.()},children:[n.jsx(Mr,{size:14}),"Rename"]}),n.jsxs(it,{onClick:k=>{k.stopPropagation(),v?.()},children:[n.jsx(ia,{size:14}),"Duplicate"]}),n.jsx(wr,{}),n.jsxs(it,{variant:"destructive",disabled:!h,onClick:k=>{k.stopPropagation(),g?.()},children:[n.jsx(ca,{size:14}),"Delete"]})]})]}),e[5]=h,e[6]=S,e[7]=r,e[8]=g,e[9]=v,e[10]=p,e[11]=R):R=e[11];let _;return e[12]!==b||e[13]!==V||e[14]!==R?(_=n.jsxs(n.Fragment,{children:[b,V,R]}),e[12]=b,e[13]=V,e[14]=R,e[15]=_):_=e[15],_}function Xr(m){return m.stopPropagation()}function Zr(m){return m.stopPropagation()}function eo(m){const e=He.c(33),{entry:r,sortableId:c,isActive:d,canDelete:h,decofile:S,meta:p,matchers:v,onSelect:g,onRename:b,onDuplicate:V,onDelete:R}=m;let _;e[0]!==c?(_={id:c,animateLayoutChanges:to},e[0]=c,e[1]=_):_=e[1];const{attributes:k,listeners:o,setNodeRef:N,transform:l,isDragging:J}=Yn(_);let H;e[2]!==l?(H=Jn.Transform.toString(l?{...l,x:0}:null),e[2]=l,e[3]=H):H=e[3];const K=J?0:void 0;let u;e[4]!==H||e[5]!==K?(u={transform:H,opacity:K},e[4]=H,e[5]=K,e[6]=u):u=e[6];const T=u,se=p??void 0;let P;e[7]!==S||e[8]!==r.variant.rule||e[9]!==se?(P=Nt(r.variant.rule,S,se),e[7]=S,e[8]=r.variant.rule,e[9]=se,e[10]=P):P=e[10];const pe=P;let D;e[11]!==g?(D=E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),g())},e[11]=g,e[12]=D):D=e[12];const ce=J?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",B=d?ga:Jr;let te;e[13]!==ce||e[14]!==B?(te=Ee("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",ce,B),e[13]=ce,e[14]=B,e[15]=te):te=e[15];let oe;e[16]!==h||e[17]!==pe||e[18]!==r.variant.label||e[19]!==v||e[20]!==R||e[21]!==V||e[22]!==b?(oe=n.jsx(Sa,{label:r.variant.label,effectiveRule:pe,matchers:v,canDelete:h,onRename:b,onDuplicate:V,onDelete:R}),e[16]=h,e[17]=pe,e[18]=r.variant.label,e[19]=v,e[20]=R,e[21]=V,e[22]=b,e[23]=oe):oe=e[23];let Ve;return e[24]!==k||e[25]!==o||e[26]!==g||e[27]!==N||e[28]!==T||e[29]!==te||e[30]!==oe||e[31]!==D?(Ve=n.jsx("div",{ref:N,style:T,...k,...o,onClick:g,onKeyDown:D,className:te,children:oe}),e[24]=k,e[25]=o,e[26]=g,e[27]=N,e[28]=T,e[29]=te,e[30]=oe,e[31]=D,e[32]=Ve):Ve=e[32],Ve}function to(){return!1}function no(m){const e=He.c(9),{variant:r,decofile:c,meta:d,matchers:h}=m,S=d??void 0;let p;e[0]!==c||e[1]!==S||e[2]!==r.rule?(p=Nt(r.rule,c,S),e[0]=c,e[1]=S,e[2]=r.rule,e[3]=p):p=e[3];const v=p;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=Ee("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",ga),e[4]=g):g=e[4];let b;return e[5]!==v||e[6]!==h||e[7]!==r.label?(b=n.jsx("div",{className:g,children:n.jsx(Sa,{label:r.label,effectiveRule:v,matchers:h,canDelete:!1,dragging:!0})}),e[5]=v,e[6]=h,e[7]=r.label,e[8]=b):b=e[8],b}function ao(m){const e=He.c(77),{listKey:r,variants:c,activeIndex:d,decofile:h,meta:S,matchers:p,onSelect:v,onReorder:g,onRename:b,onDuplicate:V,onDelete:R,onAdd:_}=m;let k;e[0]!==c?(k=()=>ln(c),e[0]=c,e[1]=k):k=e[1];const[o,N]=w.useState(k),[l,J]=w.useState(null),[H,K]=w.useState(r),[u,T]=w.useState(c.length);let se;e[2]!==c?(se=()=>Ln(c),e[2]=c,e[3]=se):se=e[3];const[P,pe]=w.useState(se),D=w.useRef(!1),ce=Ln(c);H!==r?(K(r),T(c.length),pe(ce),N(ln(c))):u!==c.length?(T(c.length),pe(ce),N(ln(c))):P!==ce&&(pe(ce),N(Me=>c.map((xe,Re)=>({id:Me[Re]?.id??crypto.randomUUID(),index:Re,variant:xe}))));let B;e[4]===Symbol.for("react.memo_cache_sentinel")?(B={activationConstraint:{distance:8}},e[4]=B):B=e[4];let te;e[5]===Symbol.for("react.memo_cache_sentinel")?(te={coordinateGetter:Qn},e[5]=te):te=e[5];const oe=Un(zt(Wn,B),zt(Gn,te));let Ve;e[6]!==o?(Ve=o.map(so),e[6]=o,e[7]=Ve):Ve=e[7];const E=Ve,ue=c.length>1;let ie;e[8]!==o?(ie=Me=>{const xe=String(Me.active.id);J(o.find(Re=>Re.id===xe)??null)},e[8]=o,e[9]=ie):ie=e[9];const je=ie;let M;e[10]!==E||e[11]!==g?(M=Me=>{J(null);const{active:xe,over:Re}=Me;if(!Re||xe.id===Re.id)return;const me=E.indexOf(String(xe.id)),ee=E.indexOf(String(Re.id));me===-1||ee===-1||(N(L=>Qr(Rt([...L],me,ee))),D.current=!0,requestAnimationFrame(()=>{D.current=!1}),g(me,ee))},e[10]=E,e[11]=g,e[12]=M):M=e[12];const Ae=M;let X;e[13]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{J(null)},e[13]=X):X=e[13];const De=X;let ve,re,W,q,ne,le,ke,Se,de,be,$,Z,we;if(e[14]!==d||e[15]!==ue||e[16]!==h||e[17]!==o||e[18]!==E||e[19]!==Ae||e[20]!==je||e[21]!==p||e[22]!==S||e[23]!==_||e[24]!==R||e[25]!==V||e[26]!==b||e[27]!==v||e[28]!==oe){const Me=L=>{D.current||v(L)};$="space-y-1 border-b p-2";let xe;e[42]===Symbol.for("react.memo_cache_sentinel")?(xe=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variants"}),e[42]=xe):xe=e[42];let Re;e[43]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(un,{size:14}),e[43]=Re):Re=e[43];let me;e[44]!==_?(me=n.jsx(ft,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-6",onClick:_,children:Re})}),e[44]=_,e[45]=me):me=e[45];let ee;e[46]===Symbol.for("react.memo_cache_sentinel")?(ee=n.jsx(pt,{children:"Add variant"}),e[46]=ee):ee=e[46],e[47]!==me?(Z=n.jsxs("div",{className:"flex items-center justify-between",children:[xe,n.jsxs(mt,{children:[me,ee]})]}),e[47]=me,e[48]=Z):Z=e[48],re=Xn,le=oe,ke=Zn,Se=je,de=Ae,be=De,ve=ea,q=E,ne=ta,we="space-y-0.5",W=o.map(L=>n.jsx(eo,{sortableId:L.id,entry:L,isActive:L.index===d,canDelete:ue,decofile:h,meta:S,matchers:p,onSelect:()=>Me(L.index),onRename:()=>b(L.index),onDuplicate:()=>V(L.index),onDelete:()=>R(L.index)},L.id)),e[14]=d,e[15]=ue,e[16]=h,e[17]=o,e[18]=E,e[19]=Ae,e[20]=je,e[21]=p,e[22]=S,e[23]=_,e[24]=R,e[25]=V,e[26]=b,e[27]=v,e[28]=oe,e[29]=ve,e[30]=re,e[31]=W,e[32]=q,e[33]=ne,e[34]=le,e[35]=ke,e[36]=Se,e[37]=de,e[38]=be,e[39]=$,e[40]=Z,e[41]=we}else ve=e[29],re=e[30],W=e[31],q=e[32],ne=e[33],le=e[34],ke=e[35],Se=e[36],de=e[37],be=e[38],$=e[39],Z=e[40],we=e[41];let Ke;e[49]!==W||e[50]!==we?(Ke=n.jsx("div",{className:we,children:W}),e[49]=W,e[50]=we,e[51]=Ke):Ke=e[51];let $e;e[52]!==ve||e[53]!==q||e[54]!==ne||e[55]!==Ke?($e=n.jsx(ve,{items:q,strategy:ne,children:Ke}),e[52]=ve,e[53]=q,e[54]=ne,e[55]=Ke,e[56]=$e):$e=e[56];let Le;e[57]!==l||e[58]!==h||e[59]!==p||e[60]!==S?(Le=l?n.jsx(no,{variant:l.variant,decofile:h,meta:S,matchers:p}):null,e[57]=l,e[58]=h,e[59]=p,e[60]=S,e[61]=Le):Le=e[61];let Te;e[62]!==Le?(Te=n.jsx(na,{dropAnimation:null,children:Le}),e[62]=Le,e[63]=Te):Te=e[63];let Oe;e[64]!==re||e[65]!==le||e[66]!==ke||e[67]!==Se||e[68]!==de||e[69]!==be||e[70]!==$e||e[71]!==Te?(Oe=n.jsxs(re,{sensors:le,collisionDetection:ke,onDragStart:Se,onDragEnd:de,onDragCancel:be,children:[$e,Te]}),e[64]=re,e[65]=le,e[66]=ke,e[67]=Se,e[68]=de,e[69]=be,e[70]=$e,e[71]=Te,e[72]=Oe):Oe=e[72];let Fe;return e[73]!==$||e[74]!==Z||e[75]!==Oe?(Fe=n.jsxs("div",{className:$,children:[Z,Oe]}),e[73]=$,e[74]=Z,e[75]=Oe,e[76]=Fe):Fe=e[76],Fe}function so(m){return m.id}function Fn(m){const e=He.c(15),{schema:r,value:c,onChange:d,meta:h,decofile:S,onSaveReferencedBlock:p,sandbox:v}=m;let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];const[b,V]=w.useState(g);let R;e[1]!==b?(R=b.length>0&&n.jsxs("nav",{"aria-label":"Variant rule breadcrumb",className:"flex min-w-0 items-center gap-1 overflow-hidden text-xs",children:[n.jsx("button",{type:"button",onClick:()=>V([]),className:"flex shrink-0 items-center gap-0.5 rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",title:"Back to rule",children:n.jsx(ra,{className:"size-3.5"})}),b.map((o,N)=>{const l=N===b.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[N>0&&n.jsx(oa,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>V(b.slice(0,N+1)),title:o,className:Ee("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",l?"font-medium text-foreground":"text-muted-foreground"),children:o})]},`${o}-${N}`)})]}),e[1]=b,e[2]=R):R=e[2];let _;e[3]!==b||e[4]!==S||e[5]!==h||e[6]!==d||e[7]!==p||e[8]!==v||e[9]!==r||e[10]!==c?(_=n.jsx(aa,{schema:r,value:c,onChange:d,basePath:"",breadcrumbPath:b,onBreadcrumbChange:V,meta:h,decofile:S,onSaveReferencedBlock:p,sandbox:v}),e[3]=b,e[4]=S,e[5]=h,e[6]=d,e[7]=p,e[8]=v,e[9]=r,e[10]=c,e[11]=_):_=e[11];let k;return e[12]!==R||e[13]!==_?(k=n.jsxs("div",{className:"space-y-2",children:[R,_]}),e[12]=R,e[13]=_,e[14]=k):k=e[14],k}function In(m){const e=He.c(21),{activeSchema:r,formValue:c,formResetKey:d,onFormChange:h,onBreadcrumbChange:S,breadcrumbPath:p,emptyMessage:v,beforeForm:g,seoResolveType:b,siteDefaultSeo:V,meta:R,decofile:_,onSaveReferencedBlock:k,sandbox:o}=m;let N;e[0]!==p?(N=p===void 0?[]:p,e[0]=p,e[1]=N):N=e[1];const l=N;let J;e[2]!==r||e[3]!==l||e[4]!==_||e[5]!==d||e[6]!==c||e[7]!==R||e[8]!==S||e[9]!==h||e[10]!==k||e[11]!==o||e[12]!==b||e[13]!==V?(J=r&&c?b?n.jsx(Rr,{schema:r,resolveType:b,value:c,formResetKey:d,onChange:h,onBreadcrumbChange:S,siteDefaultSeo:V}):n.jsx(aa,{schema:r,value:c,onChange:h,basePath:"",breadcrumbPath:l,onBreadcrumbChange:S,meta:R,decofile:_,onSaveReferencedBlock:k,sandbox:o},d):null,e[2]=r,e[3]=l,e[4]=_,e[5]=d,e[6]=c,e[7]=R,e[8]=S,e[9]=h,e[10]=k,e[11]=o,e[12]=b,e[13]=V,e[14]=J):J=e[14];const H=J;let K;e[15]!==v||e[16]!==H?(K=H??n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:v}),e[15]=v,e[16]=H,e[17]=K):K=e[17];let u;return e[18]!==g||e[19]!==K?(u=n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsxs("div",{className:"mx-auto max-w-2xl",children:[g,K]})}),e[18]=g,e[19]=K,e[20]=u):u=e[20],u}const ro="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.22)]";function oo(m,e){return Ds(m,e,tt)}function io(m){const e=He.c(13),{pageKey:r,initialName:c,initialPath:d,onFieldChange:h}=m,[S,p]=w.useState(c),[v,g]=w.useState(d),[b,V]=w.useState(r);b!==r&&(V(r),p(c),g(d));let R;e[0]!==h?(R=l=>{p(l.target.value),h("name",l.target.value)},e[0]=h,e[1]=R):R=e[1];let _;e[2]!==S||e[3]!==R?(_=n.jsx("input",{type:"text",value:S,onChange:R,className:"w-full bg-transparent text-sm font-semibold truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"Page name"}),e[2]=S,e[3]=R,e[4]=_):_=e[4];let k;e[5]!==h?(k=l=>{g(l.target.value),h("path",l.target.value)},e[5]=h,e[6]=k):k=e[6];let o;e[7]!==v||e[8]!==k?(o=n.jsx("input",{type:"text",value:v,onChange:k,className:"w-full bg-transparent text-xs text-muted-foreground truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"/path"}),e[7]=v,e[8]=k,e[9]=o):o=e[9];let N;return e[10]!==_||e[11]!==o?(N=n.jsxs("div",{className:"space-y-1",children:[_,o]}),e[10]=_,e[11]=o,e[12]=N):N=e[12],N}function zn(m){const e=He.c(6),{onClick:r}=m;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(la,{size:14}),e[0]=c):c=e[0];let d;e[1]!==r?(d=n.jsx(ft,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:r,children:c})}),e[1]=r,e[2]=d):d=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(pt,{side:"bottom",children:"Add variant"}),e[3]=h):h=e[3];let S;return e[4]!==d?(S=n.jsxs(mt,{children:[d,h]}),e[4]=d,e[5]=S):S=e[5],S}function sc({orgSlug:m,virtualMcpId:e,branch:r,previewReady:c=!0,previewUrl:d,currentPath:h,activePageBlockKey:S=null,activeGlobalBlockKey:p=null,externalSelectedIndex:v,onSaved:g,initialEditSeo:b=!1,onExitSeo:V,onViewJsonFile:R,onVariantPreviewOverride:_}){const k=c?{orgSlug:m,virtualMcpId:e,branch:r,previewUrl:d}:null,{data:o,isLoading:N}=Cs(k),{data:l,isLoading:J}=Vs(k),H=Ts(),K=H?.entity?.id===e?H.entity.metadata?.siteSlug??null:null,[u,T]=w.useState(null),[se,P]=w.useState(null),[pe,D]=w.useState(null),[ce,B]=w.useState(0),[te,oe]=w.useState(void 0),[Ve,E]=w.useState(null),[ue,ie]=w.useState(null),[je,M]=w.useState([]),[Ae,X]=w.useState(0),[De,ve]=w.useState(null),[re,W]=w.useState(null),[q,ne]=w.useState(null),[le,ke]=w.useState(!0),[Se,de]=w.useState(!1),[be,$]=w.useState(!1),[Z,we]=w.useState(b),[Ke,$e]=w.useState(b);b&&!Ke&&($e(!0),we(!0),T(null),P(null),D(null),M([])),!b&&Ke&&$e(!1);const[Le,Te]=w.useState(null),[Oe,Fe]=w.useState(void 0),[Me,xe]=w.useState([]),[Re,me]=w.useState(0),[ee,L]=w.useState(0),[ae,Q]=w.useState(null),[Ie,he]=w.useState(null),[Qe,dn]=w.useState(null),xa=Ss(),ya=`${m}/${e}/${r}`,Ht=Ps({orgSlug:m,virtualMcpId:e,branch:r}),[ba,_a]=w.useState(h),[ja,ka]=w.useState(S),[wa,Ra]=w.useState(p);(ba!==h||ja!==S||wa!==p)&&(queueMicrotask(()=>Ht.flush()),_a(h),ka(S),Ra(p),T(null),P(null),D(null),B(0),E(null),ie(null),L(0),Q(null),he(null),M([]),X(t=>t+1),we(!1),Te(null),Fe(void 0),xe([]),me(t=>t+1));const ye=As({orgSlug:m,virtualMcpId:e,branch:r}),Dt=Xs((t,a)=>{ye.mutate({blockKey:t,data:a},{onSuccess:()=>g?.(),onError:s=>G.error(`Save failed: ${s.message}`)})}),Ut=Ms({orgSlug:m,virtualMcpId:e,branch:r}),[bt,Ct]=w.useState(!1),Gt=w.useRef(null),ht=w.useRef(null),gt=w.useRef(null),Wt=w.useRef({}),qe=w.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!c||N||J)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(Hn,{size:20,className:"animate-spin text-muted-foreground"})});if(!o||!l)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Could not load site data."});const Na=Es(o),_e=!!p,ze=_e?null:Ks(Na,h,S),j=_e?p:ze?.key??null,qt=_e&&p?o[p]:void 0,mn=_e&&p&&qt?$s(p,qt):_e&&p?p:"",Vt=!_e&&j&&o[j]?o[j]:null,Yt=Z&&o&&l&&j&&ze?$n(o,{kind:"page",pageKey:j,pageName:String(ze.name??""),path:String(ze.path??"")},l):null,Da=Z?Vt?.seo:void 0,Jt=Oe!==void 0?Oe:Da,Ca=Z?Nr(Jt):void 0,Va=Yt?.seoTypeOptions??[],Ta=Z&&l?Dr(l):"",fn=Le??Ca??{},Qt=Z&&Yt?Cr(fn,Yt):null,Pa=Z&&Qt&&Vr(Jt)?Ot(Qt,l):null,Aa=Z?Tr(o,l)?.seoData:void 0,Be=_e?[{label:"Default",sections:[{__resolveType:p}]}]:oo(Vt?.sections,o??{}),Tt=Be.length>1,Ce=Math.min(ce,Be.length-1),nt=Be[Ce],I=nt?.sections??[],Pe=Bt(I,o),pn=!_e&&Os(Vt?.sections);if(_e&&p&&Qe!==p){dn(p);const t=I[0],a=Pe[0];if(t&&a){T(0),L(0),M([]);const s=ut(t,a,o);s&&(P(s.data),D(s.resolveType),he(null),Q(null))}}!_e&&Qe!==null&&dn(null),qe.current={rawSections:I,parsedSections:Pe,decofile:o??{},activePageKey:j,pageVariants:Be,variantIndex:Ce,sectionVariantIndex:ee,selectedSectionIndex:u};const Ma=()=>({multivariate:pn,index:Ce,variants:Be.map(t=>({rule:t.rule}))}),hn=(t,a)=>{if(!_)return;if(!j||!pn||t.length<=1){_(null);return}const s=En(j,{multivariate:!0,index:a,variants:t},o,l);_(s.length>0?s:null)},vt=(t,a,s)=>{if(!_)return;if(!j){_(null);return}const i=Ma(),f=En(j,i,o,l);if(!t||a<0){_(f.length>0?f:null);return}const y=ar({pageKey:j,page:i,sectionIndex:a,sectionLazy:Pe[a]?.isLazy??!1,mvObj:t,selectedVariantIndex:s,decofile:o,meta:l}),x=[...f,...y];_(x.length>0?x:null)},at=(t,a,s,i=u??-1,f=!1)=>{const y=Je(t,a);if(!y){P(null),D(null),he(null),Q(null),f&&vt(null,i,s);return}const C=Vn(y,tt)[s];if(!C){P(null),D(null),he(null),Q(null),f&&vt(null,i,s);return}const Y=Hs(C.value,o);P(Y?.data??null),D(Y?.resolveType??null);const{resolveType:A,formValue:O}=jt(C.rule,o,l??void 0);he(A),Q(O),f&&vt(y,i,s)};if(v!==void 0&&v!==te&&(oe(v??null),typeof v=="number")){const t=I[v],a=Pe[v];if(t&&a)if(T(v),L(0),M([]),X(s=>s+1),a.isMultivariate)at(t,a,0,v);else{const s=ut(t,a,o);s?(P(s.data),D(s.resolveType)):(P(null),D(null)),he(null),Q(null)}}const Pt={orgSlug:m,virtualMcpId:e,branch:r,previewUrl:d??void 0,siteSlug:K},Xt=pe&&l?Ot(pe,l):null,Ue=(t,a)=>{if(!j)return;const s=wt(o,j,t,Ce,Be);ye.mutate({blockKey:j,data:s},{onSuccess:()=>a?.onSuccess?.()??g?.(),onError:i=>G.error(`Save failed: ${i.message}`)})},St=()=>{T(null),P(null),D(null),L(0),Q(null),he(null),M([]),X(t=>t+1)},Ea=(t,a)=>{Gt.current&&clearTimeout(Gt.current);const s=qe.current.sectionVariantIndex;Gt.current=setTimeout(()=>{const{rawSections:i,parsedSections:f,decofile:y,activePageKey:x,pageVariants:C,variantIndex:Y}=qe.current,A=i[a];if(!A)return;const O=f[a];if(!O)return;if(O.isSavedBlock){const z=O.isLazy?A.section?.__resolveType??A.__resolveType:A.__resolveType;ye.mutate({blockKey:z,data:t},{onSuccess:()=>g?.(),onError:U=>G.error(`Save failed: ${U.message}`)});return}if(!x)return;const F={...y[x]},ge=[...i];if(O.isMultivariate){const z=Je(A,O);if(!z||!x)return;const U=rr(z,s,t);ge[a]=dt(A,O,U)}else if(O.isHidden){const z=qn(A.__resolveType),U=z?{...A.section}:{...A},Ne=Array.isArray(U.variants)?[...U.variants]:[];Ne[0]&&(Ne[0]={...Ne[0],value:t}),U.variants=Ne,z?ge[a]={...A,section:U}:ge[a]=U}else O.isLazy?ge[a]={...A,section:t}:ge[a]=t;if(C.length>1){const z=F.sections,U=[...z?.variants??[]];U[Y]&&(U[Y]={...U[Y],value:ge}),F.sections={...z,variants:U}}else F.sections=ge;ye.mutate({blockKey:x,data:F},{onSuccess:()=>g?.(),onError:z=>G.error(`Save failed: ${z.message}`)})},on)},Ka=t=>{T(t),L(0),M([]),X(f=>f+1);const a=I[t],s=Pe[t];if(!a||!s)return;if(s.isMultivariate){at(a,s,0,t);return}const i=ut(a,s,o);if(!i){P(null),D(null),he(null),Q(null),vt(null,t,0);return}P(i.data),D(i.resolveType),he(null),Q(null),vt(null,t,0)},gn=t=>{const a=t;P(a),u!==null&&Ea(a,u)},Zt=t=>{if(!j||!o||!l||!ze)return;const a={kind:"page",pageKey:j,pageName:String(ze.name??""),path:String(ze.path??"")},s=$n(o,a,l);s&&Ht.save(j,()=>{const i=xa.getQueryData(xs.decofile(ya))?.[j];if(!i||typeof i!="object"||i===null||Array.isArray(i))return null;const f={...i,...Wt.current};return Wt.current={},t?.raw!==void 0?{...f,seo:t.raw}:t?.inner!==void 0?Ar(a,s,f,t.inner):f})},$a=(t,a)=>{j&&(Wt.current[t]=a,Zt())},Oa=(t,a)=>{if(!j)return;const s=Rt([...I],t,a);u!==null&&(u===t?T(a):t<u&&a>=u?T(u-1):t>u&&a<=u&&T(u+1)),Ue(s)},Ba=t=>{if(!j)return;const a=I.filter((s,i)=>i!==t);u===t?St():u!==null&&u>t&&T(u-1),Ue(a)},La=t=>{if(!j)return;const a=I[t];if(!a)return;const s=[...I];s.splice(t+1,0,nr(a)),u!==null&&u>t&&T(u+1),Ue(s)},Fa=t=>{if(!j)return;const a=I[t],s=Pe[t];if(!a||!s||s.isMultivariate)return;const i=s.isHidden?er(a):tr(a);if(!i)return;const f=[...I];f[t]=i,u===t&&St(),Ue(f)},Ia=t=>{if(!j)return;const a=I[t],s=Pe[t];if(!a||!s||s.isMultivariate)return;const i=Zs(a);if(!i)return;const f=[...I];f[t]=i,u===t&&St(),Ue(f)},za=t=>{if(!j)return;const a=I[t],s=Pe[t];if(!a||!s?.isSavedBlock)return;const i=ut(a,s,o);if(!i?.data)return;const{name:f,...y}=i.data,x=[...I];s.isLazy?x[t]={...a,section:y}:x[t]=y,u===t&&St(),Ue(x)},Ha=t=>{if(!j)return;const a=[...I,{__resolveType:t.resolveType}],s=a.length-1;Ue(a,{onSuccess:()=>{de(!1),T(s),L(0),M([]),X(x=>x+1);const i=a[s],f=Bt(a,o)[s];if(!i||!f)return;if(f.isMultivariate){at(i,f,0);return}const y=ut(i,f,o);if(!y){P(null),D(null),he(null),Q(null);return}P(y.data),D(y.resolveType),he(null),Q(null)}})},Ua=t=>{if(u===null)return;const a=I[u],s=Pe[u];!a||!s?.isMultivariate||(L(t),M([]),X(i=>i+1),at(a,s,t,u,!0))},Ga=t=>{if(u===null||!j)return;const a=I[u],s=Pe[u];if(!a||!s?.isMultivariate)return;const i=Je(a,s);if(!i)return;const f=Js(i,t);if(!f){G.error("Cannot delete the only variant.");return}const y=[...I];y[u]=dt(a,s,f);const x=f.variants;let C=ee;t===ee?C=Math.min(t,x.length-1):t<ee&&(C=ee-1),L(C),M([]),X(Y=>Y+1),at(y[u],s,C),Ue(y)},Wa=t=>{if(u===null||!j)return;const a=I[u],s=Pe[u];if(!a||!s?.isMultivariate)return;const i=Je(a,s);if(!i)return;const f=Qs(i,t),y=[...I];y[u]=dt(a,s,f);const x=t+1;L(x),M([]),X(C=>C+1),at(y[u],s,x),Ue(y)},qa=(t,a)=>{if(u===null||!j||t===a)return;const s=I[u],i=Pe[u];if(!s||!i?.isMultivariate)return;const f=Je(s,i);if(!f)return;const y=qs(f,t,a),x=[...I];x[u]=dt(s,i,y);let C=ee;ee===t?C=a:t<ee&&a>=ee?C=ee-1:t>ee&&a<=ee&&(C=ee+1),L(C),at(x[u],i,C),Ue(x)},en=t=>{const a=t??u;if(a===null||!j)return;const s=I[a],i=Pe[a];if(!s||!i)return;const f=Us(s,i);if(!f){G.error("This section cannot have variants.");return}const y=[...I];y[a]=f.section;const x=Bt(y,o)[a];if(!x?.isMultivariate){G.error("Could not add variant.");return}T(a),L(f.newVariantIndex),M([]),X(C=>C+1),at(f.section,x,f.newVariantIndex,a),Ue(y)},Ya=()=>{if(u===null||!j)return;const t=I[u],a=Pe[u];if(!t||!a?.isMultivariate)return;const s=Je(t,a);if(!s)return;const i=Ys(t,a,s);if(!i){G.error("Could not remove variants.");return}const f=[...I];f[u]=i;const y=Bt(f,o)[u];if(!y)return;L(0),he(null),Q(null),M([]),X(C=>C+1);const x=ut(i,y,o);x?(P(x.data),D(x.resolveType)):(P(null),D(null)),vt(null,u,0),Ue(f)},Ja=async t=>{if(De===null||!j)return;const a=rn(t,o);if(a){G.error(a);return}const s=I[De],i=Pe[De];if(!s||!i)return;const f=ut(s,i,o);if(!f){G.error("This section cannot be saved as global.");return}const y={...f.data,name:t};try{await ye.mutateAsync({blockKey:t,data:y});const x=[...I];x[De]={__resolveType:t},await ye.mutateAsync({blockKey:j,data:wt(o,j,x,Ce,Be)}),u===De&&St(),ve(null),G.success(`Saved global block "${t}"`),g?.()}catch(x){G.error(x instanceof Error?x.message:"Failed to save global block")}},vn=nt?.rule;if(Tt&&u===null&&ue===null&&vn){const{resolveType:t,formValue:a}=jt(vn,o??{},l??void 0);ie(t),E(a)}const At=l?Bs(l):[],Sn=l&&o?Ls(l,o):[],Qa=!_e&&!!(d&&l&&o),xn=ue&&l?Ot(ue,l):null,Mt=()=>{ht.current&&(clearTimeout(ht.current),ht.current=null),gt.current&&(clearTimeout(gt.current),gt.current=null)},_t=async(t,a)=>{if(!(sr(a,t,l)>0))try{await Ut.mutateAsync({blockKey:t})}catch(s){G.error(s instanceof Error?s.message:"Could not delete matcher block")}},yn=t=>{ht.current&&clearTimeout(ht.current),ht.current=setTimeout(()=>{const{activePageKey:a,decofile:s,variantIndex:i}=qe.current;if(!a)return;const f={...s[a]},y={...f.sections},x=[...y.variants??[]],C=x[i],Y=C?.rule;if(xt(Y,s,l)){const A=Y?.__resolveType??"",O=s[A],F=typeof O?.name=="string"?O.name:A,{__resolveType:ge,...z}=t;ye.mutate({blockKey:A,data:yt(ge??"",z,F)},{onSuccess:()=>g?.(),onError:U=>G.error(`Save failed: ${U.message}`)});return}C&&(x[i]={...C,rule:t}),f.sections={...y,variants:x},ye.mutate({blockKey:a,data:f},{onSuccess:()=>g?.(),onError:A=>G.error(`Save failed: ${A.message}`)})},on)},Xa=t=>{ie(t);const a=t?{__resolveType:t}:{__resolveType:Kn};E({}),yn(a)},Za=t=>{const a=t;E(a);const s=ue?{__resolveType:ue,...a}:{...a};yn(s)},es=async t=>{Mt();const{activePageKey:a,decofile:s,variantIndex:i}=qe.current;if(!a)return;const f=s[a],y=f?.sections;if(!y||typeof y!="object"||Array.isArray(y))return;const x=y;if(!Array.isArray(x.variants))return;const C=[...x.variants],Y=C[i];if(!Y)return;const A=kt(Y.rule,s,l),O=Ft(t);C[i]={...Y,rule:O};const F={...s,[a]:{...f,sections:{...x,variants:C}}},{resolveType:ge,formValue:z}=jt(O,F,l??void 0);ie(ge),E(z);try{await ye.mutateAsync({blockKey:a,data:F[a]}),A&&A!==t&&await _t(A,F),g?.()}catch(U){G.error(U instanceof Error?U.message:"Could not apply saved rule")}},bn=t=>{gt.current&&clearTimeout(gt.current);const{selectedSectionIndex:a,sectionVariantIndex:s}=qe.current;a!==null&&(gt.current=setTimeout(()=>{const{rawSections:i,parsedSections:f,decofile:y,activePageKey:x,pageVariants:C,variantIndex:Y}=qe.current;if(!x)return;const A=i[a],O=f[a];if(!A||!O?.isMultivariate)return;const F=Je(A,O);if(!F)return;const z=(F.variants??[])[s]?.rule;if(xt(z,y,l)){const fe=z?.__resolveType??"",Ge=y[fe],Ze=typeof Ge?.name=="string"?Ge.name:fe,{__resolveType:rt,...et}=t;ye.mutate({blockKey:fe,data:yt(rt??"",et,Ze)},{onSuccess:()=>g?.(),onError:ot=>G.error(`Save failed: ${ot.message}`)});return}const U=Pn(F,s,t),Ne=[...i];Ne[a]=dt(A,O,U);const Ye=wt(y,x,Ne,Y,C);ye.mutate({blockKey:x,data:Ye},{onSuccess:()=>g?.(),onError:fe=>G.error(`Save failed: ${fe.message}`)})},on))},ts=t=>{he(t),Q({}),bn(t?{__resolveType:t}:{__resolveType:Kn})},ns=t=>{const a=t;Q(a);const s=Ie?{__resolveType:Ie,...a}:{...a};bn(s)},as=async t=>{Mt();const{selectedSectionIndex:a,sectionVariantIndex:s,rawSections:i,parsedSections:f,decofile:y,activePageKey:x,pageVariants:C,variantIndex:Y}=qe.current;if(a===null||!x)return;const A=i[a],O=f[a];if(!A||!O?.isMultivariate)return;const F=Je(A,O);if(!F)return;const ge=F.variants??[],z=kt(ge[s]?.rule,y,l),U=Ft(t),Ne=Pn(F,s,U),Ye=[...i];Ye[a]=dt(A,O,Ne);const fe=wt(y,x,Ye,Y,C),Ge={...y,[x]:fe},{resolveType:Ze,formValue:rt}=jt(U,Ge,l??void 0);he(Ze),Q(rt);try{await ye.mutateAsync({blockKey:x,data:fe}),z&&z!==t&&await _t(z,Ge),g?.()}catch(et){G.error(et instanceof Error?et.message:"Could not apply saved rule")}};if(!_e&&!ze)return n.jsxs("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:["No page found for ",h]});if(_e&&!qt)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Global block not found"});const st=u!==null?Pe[u]??null:null,_n=u!==null?I[u]:null,jn=_n&&st?.isMultivariate?Je(_n,st):null,lt=jn?Vn(jn,tt):[],tn=Math.min(ee,Math.max(lt.length-1,0)),Et=lt[tn]??null,ct=st?.isMultivariate===!0,kn=u!==null&&st!==null,Kt=kn&&(ct||!!(Xt&&se)),ss=Kt&&!_e&&st?.isSavedBlock===!0,Xe=_e||ss,rs=_e?mn:st?.label??"",wn=Ie&&l?Ot(Ie,l):null,nn=Kt&&(!_e||je.length>0)?_e?[mn,...je]:[ze.name,st.label,...ct&&Et?[Et.label]:[],...je]:[],os=Z&&ze?[ze.name,"SEO",...Me]:[],$t=Z?os:Xe?nn.length>0?nn:[rs]:nn,Rn=()=>{if(!j)return;const t=o[j],a=Gs(t.sections,I);if(!a)return;const s=Ws(a);ye.mutate({blockKey:j,data:{...t,sections:a}},{onSuccess:()=>{B(s),T(null),P(null),D(null),M([]),E(null),ie(null)},onError:i=>G.error(`Save failed: ${i.message}`)})},an=(t,a,s)=>{if(!j)return;const i=o[j],f=i.sections;if(!f||typeof f!="object"||Array.isArray(f))return;const y=f;if(!Array.isArray(y.variants))return;const x=t([...y.variants]);if(!x)return;const C=or(y,x),Y={...o,[j]:{...i,sections:C}};ye.mutate({blockKey:j,data:Y[j]},{onSuccess:()=>{a?.(),s&&_t(s,Y)},onError:A=>G.error(`Save failed: ${A.message}`)})},is=t=>{W(null),B(t),T(null),P(null),D(null),M([]);const a=Be[t]?.rule,{resolveType:s,formValue:i}=jt(a,o??{},l??void 0);ie(s),E(i),hn(Be.map(f=>({rule:f.rule})),t)},ls=(t,a)=>{if(t===a)return;let s=Ce;Ce===t?s=a:t<Ce&&a>=Ce?s=Ce-1:t>Ce&&a<=Ce&&(s=Ce+1),B(s);const i=Rt(Be.map(f=>({rule:f.rule})),t,a);hn(i,s),an(f=>Rt(f,t,a))},cs=t=>{const a=Be[t]?.rule,s=kt(a,o??{},l??void 0);an(i=>i.length<=1?null:(i.splice(t,1),i),()=>{Be.length-1===1?B(0):t<Ce?B(Ce-1):t===Ce&&B(Math.max(0,t-1)),T(null),P(null),D(null),M([]),E(null),ie(null)},s)},us=t=>{an(a=>ir(a,t),()=>{B(t+1),T(null),P(null),D(null),M([]),E(null),ie(null)})},ds=async(t,a)=>{Mt();const s=qe.current.activePageKey,i=qe.current.decofile;if(!s)return;const f=i[s],y=f.sections;if(!y||typeof y!="object"||Array.isArray(y))return;const x=y;if(!Array.isArray(x.variants))return;const C=[...x.variants],Y=C[t];if(!Y?.rule||typeof Y.rule!="object"){G.error("This variant has no matcher rule to rename.");return}const A=Y.rule,O=a.trim();Ct(!0);try{if(!O){if(!xt(A,i,l)){W(null);return}const Ye=A.__resolveType??"";C[t]={...Y,rule:An(A,i,l)};const fe={...i,[s]:{...f,sections:{...x,variants:C}}};await ye.mutateAsync({blockKey:s,data:fe[s]}),await _t(Ye,fe),W(null),g?.();return}const F=Mn(A,i,l);if(!F){G.error("Could not read this variant's matcher rule.");return}if(F.blockKey){await ye.mutateAsync({blockKey:F.blockKey,data:yt(F.resolveType,F.data,O)}),W(null),g?.();return}const ge=sn(O),z=rn(ge,i);if(z){G.error(z);return}const U=yt(F.resolveType,F.data,O);let Ne=null;try{await ye.mutateAsync({blockKey:ge,data:U}),Ne=ge,C[t]={...Y,rule:Ft(ge)},await ye.mutateAsync({blockKey:s,data:{...f,sections:{...x,variants:C}}}),Ne=null}catch(Ye){throw Ne&&await Ut.mutateAsync({blockKey:Ne}).catch(()=>{}),Ye}W(null),G.success(`Saved matcher as global block "${O}"`),g?.()}catch(F){G.error(F instanceof Error?F.message:"Failed to rename variant")}finally{Ct(!1)}},ms=async(t,a)=>{Mt();const{selectedSectionIndex:s,rawSections:i,parsedSections:f,decofile:y,activePageKey:x,pageVariants:C,variantIndex:Y}=qe.current;if(s===null||!x)return;const A=i[s],O=f[s];if(!A||!O?.isMultivariate)return;const F=Je(A,O);if(!F)return;const ge=F.variants??[],z=ge[t];if(!z?.rule||typeof z.rule!="object"){G.error("This variant has no matcher rule to rename.");return}const U=z.rule,Ne=a.trim();Ct(!0);const Ye=async fe=>{const Ge={...F,variants:fe},Ze=[...i];Ze[s]=dt(A,O,Ge);const rt=wt(y,x,Ze,Y,C);return await ye.mutateAsync({blockKey:x,data:rt}),{...y,[x]:rt}};try{if(!Ne){if(!xt(U,y,l)){ne(null);return}const ot=U.__resolveType??"",Cn=[...ge];Cn[t]={...z,rule:An(U,y,l)};const vs=await Ye(Cn);await _t(ot,vs),ne(null),g?.();return}const fe=Mn(U,y,l);if(!fe){G.error("Could not read this variant's matcher rule.");return}if(fe.blockKey){await ye.mutateAsync({blockKey:fe.blockKey,data:yt(fe.resolveType,fe.data,Ne)}),ne(null),g?.();return}const Ge=sn(Ne),Ze=rn(Ge,y);if(Ze){G.error(Ze);return}const rt=yt(fe.resolveType,fe.data,Ne);let et=null;try{await ye.mutateAsync({blockKey:Ge,data:rt}),et=Ge;const ot=[...ge];ot[t]={...z,rule:Ft(Ge)},await Ye(ot),et=null}catch(ot){throw et&&await Ut.mutateAsync({blockKey:et}).catch(()=>{}),ot}ne(null),G.success(`Saved matcher as global block "${Ne}"`),g?.()}catch(fe){G.error(fe instanceof Error?fe.message:"Failed to rename variant")}finally{Ct(!1)}},Nn=()=>{St()},fs=t=>{Te(t),Zt({inner:t})},ps=t=>{Fe(t),Zt({raw:t})},hs=()=>{Te(null),xe([])},gs=()=>me(t=>t+1),Dn=t=>{if(Z){if(t===0){Ht.flush(),we(!1),Te(null),Fe(void 0),xe([]),me(s=>s+1),V?.();return}if(t===1){xe([]),me(s=>s+1);return}xe(Me.slice(0,t-1)),me(s=>s+1);return}if(_e){M(je.slice(0,t)),X(s=>s+1);return}if(t===0){Nn();return}if(t===1){M([]),X(s=>s+1);return}if(ct&&t===2){M([]),X(s=>s+1);return}const a=ct?2:1;M(je.slice(0,t-a))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:Xe||Kt||Z?n.jsxs("div",{className:Ee("border-b px-3 py-2.5",Xe&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[$t.length>1&&n.jsx("button",{type:"button",onClick:()=>Dn($t.length-2),title:"Back","aria-label":"Back",className:Ee("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",Xe?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(ra,{className:"size-4"})}),!_e&&Tt&&nt&&n.jsxs("button",{type:"button",onClick:Nn,title:`Editing in variant: ${nt.label}`,className:Ee("shrink-0 inline-flex items-center gap-1 rounded-md h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",ro),children:[n.jsx(va,{rule:Nt(nt.rule,o??{},l??void 0),matchers:At}),n.jsx("span",{className:"max-w-[160px] truncate",children:nt.label})]}),n.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:$t.map((t,a)=>{const s=a===$t.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[a>0&&n.jsx(oa,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Dn(a),title:t,className:Ee("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",s?Xe?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":Xe?"text-foreground/80":"text-muted-foreground",Xe?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${a}`)})}),Xe&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(fr,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(pt,{side:"bottom",className:"max-w-[260px]",children:"A global section is a reusable block shared across your site. Editing it here updates it everywhere it's used."})]}),kn&&!ct&&!st?.isHidden&&j&&n.jsx(zn,{onClick:()=>en()})]}),Xe&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:"This is a global section. Changes apply everywhere this section is used across your site."})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(io,{pageKey:j,initialName:ze.name,initialPath:ze.path,onFieldChange:$a})}),n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":"Edit SEO",className:"size-7 shrink-0",onClick:()=>we(!0),children:n.jsx(dr,{size:14})})}),n.jsx(pt,{side:"bottom",children:"Edit SEO"})]}),n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":"View JSON",className:"size-7 shrink-0",onClick:()=>R&&j?R(j):$(!0),children:n.jsx(mr,{size:14})})}),n.jsx(pt,{side:"bottom",children:"View JSON"})]}),n.jsx(zn,{onClick:Rn})]})}),Z?n.jsx(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Vt&&j?n.jsx(Pr,{rawSeo:Jt,innerSeo:fn,defaultResolveType:Ta,seoSchema:Pa,activeResolveType:Qt,seoTypeOptions:Va,formResetKey:Re,siteDefaultSeo:Aa,onBreadcrumbChange:xe,onPersistRaw:ps,onInnerChange:fs,onClearForm:hs,onBumpFormKey:gs}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"SEO schema not found for this site."})})})}):Kt?n.jsxs(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ct&&lt.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Fs,{listKey:`${j??""}:${u??""}`,variants:lt.map((t,a)=>({index:a,label:t.label})),selectedIndex:tn,onSelect:Ua,onRename:ne,onDuplicate:Wa,onDelete:Ga,onRemoveAll:Ya,onReorder:qa,onAdd:()=>en()}),ct&&n.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),n.jsx(Tn,{currentRt:Ie??"",currentLabel:Lt(Et?.rule,o??{},tt,l??void 0),currentGlobalKey:kt(Et?.rule,o??{},l??void 0)??void 0,matchers:At,globals:Sn,onSelect:ts,onSelectGlobal:as}),wn&&ae&&n.jsx("div",{className:"pt-1",children:n.jsx(Fn,{schema:wn,value:ae,onChange:ns,meta:l??void 0,decofile:o,onSaveReferencedBlock:Dt,sandbox:Pt},`${u??"none"}:${tn}:${Ie??""}`)})]})]}),n.jsx(In,{activeSchema:Xt,formValue:se,formResetKey:Ae,onFormChange:gn,onBreadcrumbChange:M,breadcrumbPath:je,emptyMessage:"No editable fields for this variant.",meta:l,decofile:o,onSaveReferencedBlock:Dt,sandbox:Pt})]}):_e?n.jsx(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(In,{activeSchema:Xt,formValue:se,formResetKey:Ae,onFormChange:gn,onBreadcrumbChange:M,breadcrumbPath:je,emptyMessage:"No editable fields for this global block.",meta:l,decofile:o,onSaveReferencedBlock:Dt,sandbox:Pt})}):n.jsxs(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Tt&&j&&n.jsx(ao,{listKey:j,variants:Be,activeIndex:Ce,decofile:o??{},meta:l,matchers:At,onSelect:is,onReorder:ls,onRename:W,onDuplicate:us,onDelete:cs,onAdd:Rn}),Tt&&ue!==null&&n.jsxs("div",{className:Ee("px-3 border-b",le?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>ke(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-sm py-0.5 hover:bg-muted/40","aria-expanded":le,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),le?n.jsx(cr,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(lr,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),le&&n.jsxs("div",{className:Ee("space-y-3",bt&&"pointer-events-none opacity-50"),children:[n.jsx(Tn,{currentRt:ue,currentLabel:Lt(nt?.rule,o??{},tt,l??void 0),currentGlobalKey:kt(nt?.rule,o??{},l??void 0)??void 0,matchers:At,globals:Sn,onSelect:Xa,onSelectGlobal:es}),xn&&Ve&&n.jsx("div",{className:"space-y-3",children:n.jsx(Fn,{schema:xn,value:Ve,onChange:Za,meta:l??void 0,decofile:o,onSaveReferencedBlock:Dt,sandbox:Pt},`${Ce}:${ue??""}`)})]})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(qr,{listKey:`${j??""}-${Ce}`,rawSections:I,sections:Pe,meta:l,selectedIndex:u,onSelect:Ka,onReorder:Oa,onDelete:Ba,onDuplicate:La,onMakeReusable:ve,onToggleHidden:Fa,onToggleLazy:Ia,onAddVariant:en,onDetach:za,onAddSection:()=>de(!0),canAddSection:Qa})})]}),n.jsx(Is,{open:De!==null,onOpenChange:t=>{t||ve(null)},defaultBlockId:De!==null?sn(Pe[De]?.label??""):"",isPending:ye.isPending,onSubmit:Ja}),d&&n.jsx(Er,{open:Se,onOpenChange:de,meta:l,decofile:o,previewBaseUrl:d,onSelect:Ha}),be&&j&&o&&n.jsx(zs,{open:be,onOpenChange:$,pageKey:j,decofile:o}),re!==null&&n.jsx(Bn,{open:!0,initialName:xt(Be[re]?.rule,o??{},l??void 0)?Lt(Be[re]?.rule,o??{},tt,l??void 0):"",autoLabel:tt(Nt(Be[re]?.rule,o??{},l??void 0)),isPending:bt,onSubmit:async t=>{await ds(re,t)},onOpenChange:t=>{!t&&!bt&&W(null)}}),q!==null&&n.jsx(Bn,{open:!0,initialName:xt(lt[q]?.rule,o??{},l??void 0)?Lt(lt[q]?.rule,o??{},tt,l??void 0):"",autoLabel:tt(Nt(lt[q]?.rule,o??{},l??void 0)),isPending:bt,onSubmit:async t=>{await ms(q,t)},onOpenChange:t=>{!t&&!bt&&ne(null)}})]})}export{sc as SectionsEditor};
1
+ import{c as He,r as w,l as Ee,j as n,B as We,i as Hn,n as Ss,t as G,K as xs}from"./index-BB5lA5jj.js";import{X as ys,Y as bs,Z as _s,K as Un,L as zt,M as Gn,P as Wn,i as qn,_ as js,F as Yn,H as Jn,$ as ks,G as ws,a0 as Rs,N as Qn,O as Rt,T as Xn,U as Zn,Q as ea,R as ta,a1 as na,a2 as Ns,a3 as Nt,a4 as Ds,S as aa,a5 as tt,a6 as Cs,a7 as Vs,a8 as Ts,e as Ps,k as As,a9 as Ms,aa as Es,ab as Ks,ac as $s,r as Ot,ad as Bt,ae as Os,af as ut,ag as jt,ah as Bs,ai as Ls,aj as Je,ak as Vn,al as Fs,am as Tn,an as kt,ao as Lt,ap as Is,aq as sn,ar as zs,as as xt,at as Hs,au as Us,av as Gs,aw as Ws,ax as qs,ay as dt,az as Ys,aA as Js,aB as Qs,aC as Pn,aD as wt,m as Xs,aE as Zs,aF as er,aG as tr,aH as nr,aI as rn,aJ as An,aK as Mn,aL as yt,aM as Ft,aN as En,aO as ar,aP as sr,aQ as on,aR as rr,aS as or,aT as Kn,aU as ir}from"./index-Bvhurd-Z.js";import{t as lr}from"./ChevronDown-TeMcV6Wa.js";import{a as sa,n as ra}from"./UserPlus01-C_-L6kJr.js";import{i as oa}from"./ChevronRight-QSLgw-q7.js";import{n as cr}from"./ChevronUp-g5JVf1F_.js";import{S as cn,y as ur,T as dr,U as mr}from"./agent-icon-jLUxIfUX.js";import{i as fr}from"./Globe01-B7g_9reV.js";import{A as It}from"./automation-runs-C0bPxXfe.js";import{b as mt,T as ft,a as pt}from"./tooltip-LRHFL41r.js";import{a as pr,D as hr,h as gr,c as vr,d as Sr,e as xr}from"./dialog-C_G4Nj_a.js";import{I as yr}from"./input-CcKrVAr2.js";import{a as ia}from"./Copy01-DgzGIIpj.js";import{b as br}from"./ZoomOut-CyT94sXk.js";import{i as _r}from"./Settings02-D4nrXgvn.js";import{s as jr}from"./Eye-vRl0ZCJB.js";import{s as la}from"./Flag01-CXRHMIef.js";import{s as un}from"./Plus-t7Jm0GJ3.js";import{s as ca}from"./Trash01-C3QDvJF1.js";import{i as kr}from"./Zap-p_vD-N15.js";import{d as it,a as ua,D as da,c as ma,j as wr}from"./dropdown-menu-C3HeQI9N.js";import{S as Rr,r as $n,a as Nr,d as Dr,b as Cr,i as Vr,f as Tr,P as Pr,c as Ar}from"./page-seo-form-b_KQgaAh.js";import{b as Mr}from"./Tool01-Ct7fGWUY.js";import{A as Er}from"./add-section-modal-D3vMc3LK.js";import"./ArrowUp-D3YFKg7G.js";import"./chat-context-C_Qfrzll.js";import"./autosend-pcmp17-1.js";import"./hooks-B2bKZJz3.js";import"./use-mcp-client-W9fEi0Ml.js";import"./constants-D_FQAPnt.js";import"./auth-B0oxX-rw.js";import"./decopilot-sse-pool-_1OoFfRR.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-QgTnVt0y.js";import"./use-virtual-mcp-DpSXhS0n.js";import"./use-collections-D9omaJJu.js";import"./use-ai-providers-BeYG-EjG.js";import"./use-decopilot-events-4o9NNSez.js";import"./tab-id-BijBBRwE.js";import"./use-organization-settings-CQJ8RPRh.js";import"./drawer-DIzHaW1L.js";import"./collection-search-BBYUHwp3.js";import"./SearchMd-B8rhT4Rt.js";import"./use-mobile-BQOMgKS3.js";import"./AreaChart-CXzSMWrS.js";import"./index-xN4b_CkF.js";import"./X-DYT1GSz1.js";import"./shell-layout-DBwpg5fa.js";import"./avatar-BaaCzkz5.js";import"./User01-Deo29J7j.js";import"./Users03-uM7w0XRw.js";import"./SearchLg-CB9_TW_3.js";import"./Stars02-BmKcMhZX.js";import"./XClose-D8I17tPk.js";import"./CheckCircle-DBI4XJwz.js";import"./FilterLines-BbWZ4lL4.js";import"./alert-dialog-BZCxnnaY.js";import"./required-auth-layout-COJ1HesY.js";import"./use-org-sso-Dqg59TFA.js";import"./ZapSquare-r-I1hrGR.js";import"./Check-Bf3Fz6mT.js";import"./Star01-DBp7dbGs.js";import"./Image01-Bx4AOGxs.js";import"./Upload01-C2W1llVr.js";import"./AlertCircle-D6YyJJmm.js";import"./form-CqMXK7Rg.js";import"./label-CW15sZLz.js";import"./select-BDKopoZs.js";import"./XCircle-C965t8pI.js";import"./tabs-B0oOCjef.js";import"./Tool02-Cr2Rz6tq.js";import"./toggle-group-MA_94m4S.js";import"./use-deco-credits-D8dtxTPg.js";import"./extract-connection-data-DoTSwnq5.js";import"./connection-card-akwzMfSt.js";import"./use-registry-connections-DdQfbjwO.js";import"./use-connection-hO51hV8J.js";import"./useInfiniteQuery-CyvFYQl8.js";import"./use-infinite-scroll-DgcSj6JD.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-zqYafqG3.js";import"./integration-icon-BFsmKVHF.js";import"./textarea-D3iFRZ9o.js";import"./connection-form-helpers-D-nDOfy5.js";import"./authenticate-and-persist-oauth-DxQqW3T-.js";import"./mcp-oauth-Bx9msuxY.js";import"./collection-tabs-CM7SC5Ph.js";import"./badge-DDX6uCig.js";import"./useSuspenseInfiniteQuery-C33XLke-.js";import"./Monitor01-Kb5okFQS.js";import"./connect-desktop-dialog-C3MAVbqi.js";import"./select-model-DQ3GcF2Q.js";import"./checkbox-D33J0J5s.js";import"./skeleton-DO-zgL8S.js";import"./Key01-Cmvx37G1.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-Bs2y0W38.js";import"./ArrowUpRight-DgvFsQng.js";import"./Stars01-BJhn7N1A.js";import"./command-BgHIgal-.js";import"./index-OTCSzql6.js";import"./popover-BhnGTRIN.js";import"./index-JYMtN_ka.js";import"./Palette-Dacxdv_I.js";import"./file-type-icon-Chdi7BrE.js";import"./toolbar-w5KxuBt-.js";import"./Package-yySHtAk6.js";import"./use-debounced-value-C8BZDtz1.js";import"./LinkExternal01-BEoe9Fb2.js";import"./index-DZrgCtW9.js";import"./LayoutLeft-q_h77zns.js";import"./DotsVertical-yY90ybrp.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DFGyya-5.js";import"./empty-state-Bn6jIdxN.js";import"./use-mcp-tools-uwmJZn0p.js";import"./use-capability-Dch03R8X.js";import"./Play-BoazbAxP.js";import"./use-debounced-autosave-cTAMJ-st.js";import"./index-CuPxvnMd.js";import"./sidebar-BiKcuUlz.js";import"./search-input-IdLCT-wl.js";import"./use-mcp-auth-status-CLsbHDCg.js";import"./switch-7KE_HjZk.js";import"./use-registry-app-DVOJoUv5.js";import"./github-repo-picker-iGTmhvfh.js";import"./use-navigate-to-agent-DqqHYLVD.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./github-repo-scope-DjMZbiKa.js";import"./Users01-CLZ2kdTu.js";import"./use-secrets-CIsNwBX2.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./companions-core-BKQjoMFT.js";import"./format-time-BnbuEtat.js";import"./TrendUp01-WsDlxYhZ.js";import"./index-BcGQg-Kx.js";import"./get-initials-D-f_fDFw.js";import"./List-5170zK7Q.js";import"./use-members-B6EJ964p.js";import"./use-org-auth-client-Y5-GC6qM.js";import"./Circle-Cu4ym4Ez.js";import"./calendar-CtB-1ORd.js";import"./use-copy-tGW1Vaes.js";import"./toolbar-icon-button-Be0Xxrx6.js";import"./SwitchHorizontal01-DJDXmWgC.js";import"./monaco-editor-tITHyCTj.js";import"./use-file-configs-CZiarNuS.js";import"./use-automations-CAUzSd8j.js";import"./automation-list-row-f7HB0lEO.js";import"./Globe04-C3Z6OIxj.js";import"./HardDrive-DymMXEyR.js";import"./Sun-DWvykssV.js";import"./Shield01-Y3jps5Gy.js";import"./table-C23nDXu-.js";import"./use-clock-tick-CVibzfL9.js";function Kr(m){return m.schema?.definitions??m.schema?.$defs??{}}function $r(m,e){const r=Kr(e),c=r[btoa(m)];if(!c)return;let d=typeof c.image=="string"?c.image:void 0;if(!d&&Array.isArray(c.allOf)){const h=c.allOf.find(S=>typeof S.$ref=="string")?.$ref;if(typeof h=="string"){const S=h.replace("#/definitions/",""),p=r[S];d=typeof p?.image=="string"?p.image:void 0}}if(d?.includes("{{{"))return d}function Or(m,e){if(!e)return;const r=ys(m);if(!r)return;const c=$r(r.resolveType,e);if(!c)return;const d=bs(c,r.data);if(d)return _s(d)}const Br="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Lr="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function On(m){return Array.from({length:m},(e,r)=>({id:crypto.randomUUID(),index:r}))}function fa(m){return m.map((e,r)=>({...e,index:r}))}function Fr(m,e){if(e===m.length)return m;if(e<m.length)return fa(m.slice(0,e));const r=Array.from({length:e-m.length},(c,d)=>({id:crypto.randomUUID(),index:m.length+d}));return[...m,...r]}function pa(m){const e=He.c(20),{section:r,raw:c,meta:d}=m,h=r.isSavedBlock===!0,S=r.isMultivariate===!0;let p;e[0]!==d||e[1]!==c?(p=c&&d?Or(c,d):void 0,e[0]=d,e[1]=c,e[2]=p):p=e[2];const v=p;let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(br,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=g):g=e[3];let b;e[4]!==v?(b=v&&n.jsx("img",{src:v,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=v,e[5]=b):b=e[5];let V;e[6]!==S||e[7]!==h?(V=h?{color:ws}:S?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=S,e[7]=h,e[8]=V):V=e[8];let R;e[9]!==V?(R=n.jsx(cn,{className:"h-4 w-4 shrink-0",style:V}),e[9]=V,e[10]=R):R=e[10];const _=r.isHidden&&"line-through opacity-50";let k;e[11]!==_?(k=Ee("min-w-0 flex-1 truncate text-sm font-medium",_),e[11]=_,e[12]=k):k=e[12];let o;e[13]!==r.label||e[14]!==k?(o=n.jsx("span",{className:k,children:r.label}),e[13]=r.label,e[14]=k,e[15]=o):o=e[15];let N;return e[16]!==b||e[17]!==R||e[18]!==o?(N=n.jsxs(n.Fragment,{children:[g,b,R,o]}),e[16]=b,e[17]=R,e[18]=o,e[19]=N):N=e[19],N}function ha(m,e){const r=m.isSavedBlock===!0,c=m.isMultivariate===!0;return Ee("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":r?Br:c?"text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]":"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Ir(m){const e=He.c(64),{section:r,raw:c,meta:d,sortableId:h,selected:S,onSelect:p,onDelete:v,onDuplicate:g,onMakeReusable:b,onToggleHidden:V,onToggleLazy:R,onAddVariant:_,onDetach:k}=m,o=c?qn(c.__resolveType??""):!1;let N;e[0]!==r?(N=js(r),e[0]=r,e[1]=N):N=e[1];const l=N;let J;e[2]!==h?(J={id:h,animateLayoutChanges:Wr},e[2]=h,e[3]=J):J=e[3];const{attributes:H,listeners:K,setNodeRef:u,transform:T,isDragging:se}=Yn(J);let P;e[4]!==T?(P=Jn.Transform.toString(T?{...T,x:0}:null),e[4]=T,e[5]=P):P=e[5];const pe=se?0:void 0;let D;e[6]!==P||e[7]!==pe?(D={transform:P,opacity:pe},e[6]=P,e[7]=pe,e[8]=D):D=e[8];const ce=D;let B;e[9]!==r?(B=ks(r),e[9]=r,e[10]=B):B=e[10];const te=B,oe="button",Ve=0;let E;e[11]!==p?(E=$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),p())},e[11]=p,e[12]=E):E=e[12];const ue=se?"cursor-grabbing":"cursor-pointer";let ie;e[13]!==r||e[14]!==S||e[15]!==ue?(ie=Ee("touch-none transition-colors",ue,ha(r,S)),e[13]=r,e[14]=S,e[15]=ue,e[16]=ie):ie=e[16];let je;e[17]!==d||e[18]!==c||e[19]!==r?(je=n.jsx(pa,{section:r,raw:c,meta:d}),e[17]=d,e[18]=c,e[19]=r,e[20]=je):je=e[20];const M=!r.isMultivariate&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":o?"Disable async render":"Enable async render",className:Ee("h-7 w-7 shrink-0",o?"":"opacity-0 group-hover:opacity-100"),onClick:$=>{$.stopPropagation(),R()},onPointerDown:Gr,children:n.jsx(kr,{className:Ee("h-3.5 w-3.5",o&&"text-yellow-500")})})}),n.jsx(pt,{side:"bottom",children:o?"Disable async render":"Enable async render"})]});let Ae;e[21]!==V||e[22]!==r.isHidden||e[23]!==r.isMultivariate?(Ae=!r.isMultivariate&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":r.isHidden?"Show section":"Hide section",className:Ee("h-7 w-7 shrink-0",r.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:$=>{$.stopPropagation(),V()},onPointerDown:Ur,children:r.isHidden?n.jsx(_r,{className:"h-3.5 w-3.5"}):n.jsx(jr,{className:"h-3.5 w-3.5"})})}),n.jsx(pt,{side:"bottom",children:r.isHidden?"Show section":"Hide section"})]}),e[21]=V,e[22]=r.isHidden,e[23]=r.isMultivariate,e[24]=Ae):Ae=e[24];let X;e[25]===Symbol.for("react.memo_cache_sentinel")?(X=n.jsx(ua,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":"Section actions",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:Hr,onPointerDown:zr,children:n.jsx(sa,{className:"h-3.5 w-3.5"})})}),e[25]=X):X=e[25];let De;e[26]!==g?(De=$=>{$.stopPropagation(),g()},e[26]=g,e[27]=De):De=e[27];let ve;e[28]===Symbol.for("react.memo_cache_sentinel")?(ve=n.jsx(ia,{className:"h-4 w-4"}),e[28]=ve):ve=e[28];let re;e[29]!==De?(re=n.jsxs(it,{onClick:De,children:[ve,"Duplicate"]}),e[29]=De,e[30]=re):re=e[30];let W;e[31]!==l||e[32]!==_?(W=l&&n.jsxs(it,{className:Rs,onClick:$=>{$.stopPropagation(),_()},children:[n.jsx(la,{className:"h-4 w-4"}),"Add variant"]}),e[31]=l,e[32]=_,e[33]=W):W=e[33];let q;e[34]!==te||e[35]!==b?(q=te&&n.jsxs(it,{className:Lr,onClick:$=>{$.stopPropagation(),b()},children:[n.jsx(cn,{className:"h-4 w-4"}),"Make reusable"]}),e[34]=te,e[35]=b,e[36]=q):q=e[36];let ne;e[37]!==k||e[38]!==r.isMultivariate||e[39]!==r.isSavedBlock?(ne=r.isSavedBlock===!0&&!r.isMultivariate&&n.jsxs(it,{onClick:$=>{$.stopPropagation(),k()},children:[n.jsx(cn,{className:"h-4 w-4"}),"Detach"]}),e[37]=k,e[38]=r.isMultivariate,e[39]=r.isSavedBlock,e[40]=ne):ne=e[40];let le;e[41]!==v?(le=$=>{$.stopPropagation(),v()},e[41]=v,e[42]=le):le=e[42];let ke;e[43]===Symbol.for("react.memo_cache_sentinel")?(ke=n.jsx(ca,{className:"h-4 w-4"}),e[43]=ke):ke=e[43];let Se;e[44]!==le?(Se=n.jsxs(it,{className:"text-destructive focus:text-destructive",onClick:le,children:[ke,"Delete"]}),e[44]=le,e[45]=Se):Se=e[45];let de;e[46]!==re||e[47]!==W||e[48]!==q||e[49]!==ne||e[50]!==Se?(de=n.jsxs(da,{children:[X,n.jsxs(ma,{align:"end",className:"w-44",children:[re,W,q,ne,Se]})]}),e[46]=re,e[47]=W,e[48]=q,e[49]=ne,e[50]=Se,e[51]=de):de=e[51];let be;return e[52]!==H||e[53]!==K||e[54]!==p||e[55]!==u||e[56]!==ce||e[57]!==ie||e[58]!==je||e[59]!==M||e[60]!==Ae||e[61]!==de||e[62]!==E?(be=n.jsxs("div",{ref:u,style:ce,...H,...K,role:oe,tabIndex:Ve,onClick:p,onKeyDown:E,className:ie,children:[je,M,Ae,de]}),e[52]=H,e[53]=K,e[54]=p,e[55]=u,e[56]=ce,e[57]=ie,e[58]=je,e[59]=M,e[60]=Ae,e[61]=de,e[62]=E,e[63]=be):be=e[63],be}function zr(m){return m.stopPropagation()}function Hr(m){return m.stopPropagation()}function Ur(m){return m.stopPropagation()}function Gr(m){return m.stopPropagation()}function Wr(){return!1}function qr(m){const e=He.c(90),{listKey:r,rawSections:c,sections:d,meta:h,selectedIndex:S,onSelect:p,onReorder:v,onDelete:g,onDuplicate:b,onMakeReusable:V,onToggleHidden:R,onToggleLazy:_,onAddVariant:k,onDetach:o,onAddSection:N,canAddSection:l}=m,J=l===void 0?!0:l;let H;e[0]!==d.length?(H=()=>On(d.length),e[0]=d.length,e[1]=H):H=e[1];const[K,u]=w.useState(H),[T,se]=w.useState(null),[P,pe]=w.useState(r),[D,ce]=w.useState(d.length),B=w.useRef(!1);P!==r?(pe(r),ce(d.length),u(On(d.length))):D!==d.length&&(ce(d.length),u(L=>Fr(L,d.length)));let te;e[2]===Symbol.for("react.memo_cache_sentinel")?(te={activationConstraint:{distance:8}},e[2]=te):te=e[2];let oe;e[3]===Symbol.for("react.memo_cache_sentinel")?(oe={coordinateGetter:Qn},e[3]=oe):oe=e[3];const Ve=Un(zt(Wn,te),zt(Gn,oe));let E;e[4]!==K?(E=K.map(Yr),e[4]=K,e[5]=E):E=e[5];const ue=E;let ie;e[6]===Symbol.for("react.memo_cache_sentinel")?(ie=L=>{se(String(L.active.id))},e[6]=ie):ie=e[6];const je=ie;let M;e[7]!==ue||e[8]!==v?(M=L=>{se(null);const{active:ae,over:Q}=L;if(!Q||ae.id===Q.id)return;const Ie=ue.indexOf(String(ae.id)),he=ue.indexOf(String(Q.id));Ie===-1||he===-1||(u(Qe=>fa(Rt([...Qe],Ie,he))),B.current=!0,requestAnimationFrame(()=>{B.current=!1}),v?.(Ie,he))},e[7]=ue,e[8]=v,e[9]=M):M=e[9];const Ae=M;let X;e[10]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{se(null)},e[10]=X):X=e[10];const De=X;let ve,re,W,q,ne,le,ke,Se,de,be,$,Z,we,Ke,$e;if(e[11]!==T||e[12]!==J||e[13]!==K||e[14]!==ue||e[15]!==Ae||e[16]!==h||e[17]!==N||e[18]!==k||e[19]!==g||e[20]!==o||e[21]!==b||e[22]!==V||e[23]!==p||e[24]!==R||e[25]!==_||e[26]!==c||e[27]!==d||e[28]!==S||e[29]!==Ve){Ke=Symbol.for("react.early_return_sentinel");e:{const L=ae=>{B.current||p(ae)};if(e[45]!==T||e[46]!==J||e[47]!==K||e[48]!==N||e[49]!==c||e[50]!==d){const ae=T?K.find(Q=>Q.id===T):null;if(q=ae!=null?d[ae.index]:null,W=ae!=null?c[ae.index]:void 0,K.length===0){let Q;e[54]===Symbol.for("react.memo_cache_sentinel")?(Q=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No sections in this page."}),e[54]=Q):Q=e[54];const Ie=!J;let he;e[55]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx(un,{size:14}),e[55]=he):he=e[55];let Qe;e[56]!==N||e[57]!==Ie?(Qe=n.jsxs("div",{className:"space-y-2",children:[Q,n.jsxs(We,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Ie,onClick:N,children:[he,"Add section"]})]}),e[56]=N,e[57]=Ie,e[58]=Qe):Qe=e[58],Ke=Qe;break e}we=Ee(ae&&"cursor-grabbing"),e[45]=T,e[46]=J,e[47]=K,e[48]=N,e[49]=c,e[50]=d,e[51]=W,e[52]=q,e[53]=we}else W=e[51],q=e[52],we=e[53];re=Xn,Se=Ve,de=Zn,be=je,$=Ae,Z=De,ve=ea,le=ue,ke=ta,$e="space-y-1",ne=K.map(ae=>{const Q=d[ae.index];return Q?n.jsx(Ir,{sortableId:ae.id,section:Q,raw:c[ae.index],meta:h,selected:S===ae.index,onSelect:()=>L(ae.index),onDelete:()=>g(ae.index),onDuplicate:()=>b(ae.index),onMakeReusable:()=>V(ae.index),onToggleHidden:()=>R(ae.index),onToggleLazy:()=>_(ae.index),onAddVariant:()=>k(ae.index),onDetach:()=>o(ae.index)},ae.id):null})}e[11]=T,e[12]=J,e[13]=K,e[14]=ue,e[15]=Ae,e[16]=h,e[17]=N,e[18]=k,e[19]=g,e[20]=o,e[21]=b,e[22]=V,e[23]=p,e[24]=R,e[25]=_,e[26]=c,e[27]=d,e[28]=S,e[29]=Ve,e[30]=ve,e[31]=re,e[32]=W,e[33]=q,e[34]=ne,e[35]=le,e[36]=ke,e[37]=Se,e[38]=de,e[39]=be,e[40]=$,e[41]=Z,e[42]=we,e[43]=Ke,e[44]=$e}else ve=e[30],re=e[31],W=e[32],q=e[33],ne=e[34],le=e[35],ke=e[36],Se=e[37],de=e[38],be=e[39],$=e[40],Z=e[41],we=e[42],Ke=e[43],$e=e[44];if(Ke!==Symbol.for("react.early_return_sentinel"))return Ke;let Le;e[59]!==ne||e[60]!==$e?(Le=n.jsx("div",{className:$e,children:ne}),e[59]=ne,e[60]=$e,e[61]=Le):Le=e[61];let Te;e[62]!==ve||e[63]!==le||e[64]!==ke||e[65]!==Le?(Te=n.jsx(ve,{items:le,strategy:ke,children:Le}),e[62]=ve,e[63]=le,e[64]=ke,e[65]=Le,e[66]=Te):Te=e[66];let Oe;e[67]!==W||e[68]!==q||e[69]!==h?(Oe=q?n.jsx("div",{className:Ee("cursor-grabbing shadow-lg ring-1 ring-border/60",ha(q,!1)),children:n.jsx(pa,{section:q,raw:W,meta:h})}):null,e[67]=W,e[68]=q,e[69]=h,e[70]=Oe):Oe=e[70];let Fe;e[71]!==Oe?(Fe=n.jsx(na,{dropAnimation:null,children:Oe}),e[71]=Oe,e[72]=Fe):Fe=e[72];let Me;e[73]!==re||e[74]!==Se||e[75]!==de||e[76]!==be||e[77]!==$||e[78]!==Z||e[79]!==Te||e[80]!==Fe?(Me=n.jsxs(re,{sensors:Se,collisionDetection:de,onDragStart:be,onDragEnd:$,onDragCancel:Z,children:[Te,Fe]}),e[73]=re,e[74]=Se,e[75]=de,e[76]=be,e[77]=$,e[78]=Z,e[79]=Te,e[80]=Fe,e[81]=Me):Me=e[81];const xe=!J;let Re;e[82]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(un,{size:14}),e[82]=Re):Re=e[82];let me;e[83]!==N||e[84]!==xe?(me=n.jsxs(We,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:xe,onClick:N,children:[Re,"Add section"]}),e[83]=N,e[84]=xe,e[85]=me):me=e[85];let ee;return e[86]!==we||e[87]!==Me||e[88]!==me?(ee=n.jsxs("div",{className:we,children:[Me,me]}),e[86]=we,e[87]=Me,e[88]=me,e[89]=ee):ee=e[89],ee}function Yr(m){return m.id}function Bn(m){const e=He.c(38),{open:r,initialName:c,autoLabel:d,isPending:h,onSubmit:S,onOpenChange:p}=m,v=h===void 0?!1:h,[g,b]=w.useState(c),[V,R]=w.useState(r);r!==V&&(R(r),r&&b(c));let _;e[0]!==v||e[1]!==p?(_=oe=>{!oe&&!v&&p(!1)},e[0]=v,e[1]=p,e[2]=_):_=e[2];const k=_;let o;e[3]!==v||e[4]!==g||e[5]!==S?(o=async oe=>{oe.preventDefault(),!v&&await S(g.trim())},e[3]=v,e[4]=g,e[5]=S,e[6]=o):o=e[6];const N=o;let l;e[7]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(pr,{children:"Rename variant"}),e[7]=l):l=e[7];const J=d||"the rule";let H;e[8]!==J?(H=n.jsxs(hr,{children:[l,n.jsxs(gr,{children:["Save this matcher as a global block with a custom label. Leave empty to inline the matcher again and fall back to"," ",n.jsx("span",{className:"font-medium",children:J}),"."]})]}),e[8]=J,e[9]=H):H=e[9];let K;e[10]===Symbol.for("react.memo_cache_sentinel")?(K=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[10]=K):K=e[10];let u;e[11]===Symbol.for("react.memo_cache_sentinel")?(u=oe=>b(oe.target.value),e[11]=u):u=e[11];let T;e[12]!==d||e[13]!==v||e[14]!==g?(T=n.jsxs("div",{className:"space-y-1.5 py-4",children:[K,n.jsx(yr,{id:"variant-rename-name",value:g,onChange:u,placeholder:d,autoFocus:!0,disabled:v})]}),e[12]=d,e[13]=v,e[14]=g,e[15]=T):T=e[15];let se;e[16]!==p?(se=()=>p(!1),e[16]=p,e[17]=se):se=e[17];let P;e[18]!==v||e[19]!==se?(P=n.jsx(We,{type:"button",variant:"outline",onClick:se,disabled:v,children:"Cancel"}),e[18]=v,e[19]=se,e[20]=P):P=e[20];let pe;e[21]!==v?(pe=v?n.jsxs(n.Fragment,{children:[n.jsx(Hn,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=v,e[22]=pe):pe=e[22];let D;e[23]!==v||e[24]!==pe?(D=n.jsx(We,{type:"submit",disabled:v,children:pe}),e[23]=v,e[24]=pe,e[25]=D):D=e[25];let ce;e[26]!==P||e[27]!==D?(ce=n.jsxs(vr,{children:[P,D]}),e[26]=P,e[27]=D,e[28]=ce):ce=e[28];let B;e[29]!==N||e[30]!==ce||e[31]!==H||e[32]!==T?(B=n.jsx(Sr,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:N,children:[H,T,ce]})}),e[29]=N,e[30]=ce,e[31]=H,e[32]=T,e[33]=B):B=e[33];let te;return e[34]!==k||e[35]!==r||e[36]!==B?(te=n.jsx(xr,{open:r,onOpenChange:k,children:B}),e[34]=k,e[35]=r,e[36]=B,e[37]=te):te=e[37],te}const Jr="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]",ga="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.2)]";function va(m){const e=He.c(5),{rule:r,matchers:c}=m,d=r?.__resolveType??"";let h;if(e[0]!==c||e[1]!==d){const g=c.find(b=>b.resolveType===d)?.iconName??Ns(d);h=ur(g),e[0]=c,e[1]=d,e[2]=h}else h=e[2];const S=h;if(!S)return null;let p;return e[3]!==S?(p=n.jsx(S,{size:14,className:"shrink-0"}),e[3]=S,e[4]=p):p=e[4],p}function Ln(m){return m.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
2
+ `)}function ln(m){return m.map((e,r)=>({id:crypto.randomUUID(),index:r,variant:e}))}function Qr(m){return m.map((e,r)=>({...e,index:r}))}function Sa(m){const e=He.c(16),{label:r,effectiveRule:c,matchers:d,canDelete:h,dragging:S,onRename:p,onDuplicate:v,onDelete:g}=m;let b;e[0]!==c||e[1]!==d?(b=n.jsx(va,{rule:c,matchers:d}),e[0]=c,e[1]=d,e[2]=b):b=e[2];let V;e[3]!==r?(V=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:r}),e[3]=r,e[4]=V):V=e[4];let R;e[5]!==h||e[6]!==S||e[7]!==r||e[8]!==g||e[9]!==v||e[10]!==p?(R=!S&&n.jsxs(da,{children:[n.jsx(ua,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":`Actions for ${r}`,className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:Zr,onPointerDown:Xr,children:n.jsx(sa,{size:14})})}),n.jsxs(ma,{align:"end",className:"w-36",children:[n.jsxs(it,{onClick:k=>{k.stopPropagation(),p?.()},children:[n.jsx(Mr,{size:14}),"Rename"]}),n.jsxs(it,{onClick:k=>{k.stopPropagation(),v?.()},children:[n.jsx(ia,{size:14}),"Duplicate"]}),n.jsx(wr,{}),n.jsxs(it,{variant:"destructive",disabled:!h,onClick:k=>{k.stopPropagation(),g?.()},children:[n.jsx(ca,{size:14}),"Delete"]})]})]}),e[5]=h,e[6]=S,e[7]=r,e[8]=g,e[9]=v,e[10]=p,e[11]=R):R=e[11];let _;return e[12]!==b||e[13]!==V||e[14]!==R?(_=n.jsxs(n.Fragment,{children:[b,V,R]}),e[12]=b,e[13]=V,e[14]=R,e[15]=_):_=e[15],_}function Xr(m){return m.stopPropagation()}function Zr(m){return m.stopPropagation()}function eo(m){const e=He.c(33),{entry:r,sortableId:c,isActive:d,canDelete:h,decofile:S,meta:p,matchers:v,onSelect:g,onRename:b,onDuplicate:V,onDelete:R}=m;let _;e[0]!==c?(_={id:c,animateLayoutChanges:to},e[0]=c,e[1]=_):_=e[1];const{attributes:k,listeners:o,setNodeRef:N,transform:l,isDragging:J}=Yn(_);let H;e[2]!==l?(H=Jn.Transform.toString(l?{...l,x:0}:null),e[2]=l,e[3]=H):H=e[3];const K=J?0:void 0;let u;e[4]!==H||e[5]!==K?(u={transform:H,opacity:K},e[4]=H,e[5]=K,e[6]=u):u=e[6];const T=u,se=p??void 0;let P;e[7]!==S||e[8]!==r.variant.rule||e[9]!==se?(P=Nt(r.variant.rule,S,se),e[7]=S,e[8]=r.variant.rule,e[9]=se,e[10]=P):P=e[10];const pe=P;let D;e[11]!==g?(D=E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),g())},e[11]=g,e[12]=D):D=e[12];const ce=J?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",B=d?ga:Jr;let te;e[13]!==ce||e[14]!==B?(te=Ee("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",ce,B),e[13]=ce,e[14]=B,e[15]=te):te=e[15];let oe;e[16]!==h||e[17]!==pe||e[18]!==r.variant.label||e[19]!==v||e[20]!==R||e[21]!==V||e[22]!==b?(oe=n.jsx(Sa,{label:r.variant.label,effectiveRule:pe,matchers:v,canDelete:h,onRename:b,onDuplicate:V,onDelete:R}),e[16]=h,e[17]=pe,e[18]=r.variant.label,e[19]=v,e[20]=R,e[21]=V,e[22]=b,e[23]=oe):oe=e[23];let Ve;return e[24]!==k||e[25]!==o||e[26]!==g||e[27]!==N||e[28]!==T||e[29]!==te||e[30]!==oe||e[31]!==D?(Ve=n.jsx("div",{ref:N,style:T,...k,...o,onClick:g,onKeyDown:D,className:te,children:oe}),e[24]=k,e[25]=o,e[26]=g,e[27]=N,e[28]=T,e[29]=te,e[30]=oe,e[31]=D,e[32]=Ve):Ve=e[32],Ve}function to(){return!1}function no(m){const e=He.c(9),{variant:r,decofile:c,meta:d,matchers:h}=m,S=d??void 0;let p;e[0]!==c||e[1]!==S||e[2]!==r.rule?(p=Nt(r.rule,c,S),e[0]=c,e[1]=S,e[2]=r.rule,e[3]=p):p=e[3];const v=p;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=Ee("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",ga),e[4]=g):g=e[4];let b;return e[5]!==v||e[6]!==h||e[7]!==r.label?(b=n.jsx("div",{className:g,children:n.jsx(Sa,{label:r.label,effectiveRule:v,matchers:h,canDelete:!1,dragging:!0})}),e[5]=v,e[6]=h,e[7]=r.label,e[8]=b):b=e[8],b}function ao(m){const e=He.c(77),{listKey:r,variants:c,activeIndex:d,decofile:h,meta:S,matchers:p,onSelect:v,onReorder:g,onRename:b,onDuplicate:V,onDelete:R,onAdd:_}=m;let k;e[0]!==c?(k=()=>ln(c),e[0]=c,e[1]=k):k=e[1];const[o,N]=w.useState(k),[l,J]=w.useState(null),[H,K]=w.useState(r),[u,T]=w.useState(c.length);let se;e[2]!==c?(se=()=>Ln(c),e[2]=c,e[3]=se):se=e[3];const[P,pe]=w.useState(se),D=w.useRef(!1),ce=Ln(c);H!==r?(K(r),T(c.length),pe(ce),N(ln(c))):u!==c.length?(T(c.length),pe(ce),N(ln(c))):P!==ce&&(pe(ce),N(Me=>c.map((xe,Re)=>({id:Me[Re]?.id??crypto.randomUUID(),index:Re,variant:xe}))));let B;e[4]===Symbol.for("react.memo_cache_sentinel")?(B={activationConstraint:{distance:8}},e[4]=B):B=e[4];let te;e[5]===Symbol.for("react.memo_cache_sentinel")?(te={coordinateGetter:Qn},e[5]=te):te=e[5];const oe=Un(zt(Wn,B),zt(Gn,te));let Ve;e[6]!==o?(Ve=o.map(so),e[6]=o,e[7]=Ve):Ve=e[7];const E=Ve,ue=c.length>1;let ie;e[8]!==o?(ie=Me=>{const xe=String(Me.active.id);J(o.find(Re=>Re.id===xe)??null)},e[8]=o,e[9]=ie):ie=e[9];const je=ie;let M;e[10]!==E||e[11]!==g?(M=Me=>{J(null);const{active:xe,over:Re}=Me;if(!Re||xe.id===Re.id)return;const me=E.indexOf(String(xe.id)),ee=E.indexOf(String(Re.id));me===-1||ee===-1||(N(L=>Qr(Rt([...L],me,ee))),D.current=!0,requestAnimationFrame(()=>{D.current=!1}),g(me,ee))},e[10]=E,e[11]=g,e[12]=M):M=e[12];const Ae=M;let X;e[13]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{J(null)},e[13]=X):X=e[13];const De=X;let ve,re,W,q,ne,le,ke,Se,de,be,$,Z,we;if(e[14]!==d||e[15]!==ue||e[16]!==h||e[17]!==o||e[18]!==E||e[19]!==Ae||e[20]!==je||e[21]!==p||e[22]!==S||e[23]!==_||e[24]!==R||e[25]!==V||e[26]!==b||e[27]!==v||e[28]!==oe){const Me=L=>{D.current||v(L)};$="space-y-1 border-b p-2";let xe;e[42]===Symbol.for("react.memo_cache_sentinel")?(xe=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variants"}),e[42]=xe):xe=e[42];let Re;e[43]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(un,{size:14}),e[43]=Re):Re=e[43];let me;e[44]!==_?(me=n.jsx(ft,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-6",onClick:_,children:Re})}),e[44]=_,e[45]=me):me=e[45];let ee;e[46]===Symbol.for("react.memo_cache_sentinel")?(ee=n.jsx(pt,{children:"Add variant"}),e[46]=ee):ee=e[46],e[47]!==me?(Z=n.jsxs("div",{className:"flex items-center justify-between",children:[xe,n.jsxs(mt,{children:[me,ee]})]}),e[47]=me,e[48]=Z):Z=e[48],re=Xn,le=oe,ke=Zn,Se=je,de=Ae,be=De,ve=ea,q=E,ne=ta,we="space-y-0.5",W=o.map(L=>n.jsx(eo,{sortableId:L.id,entry:L,isActive:L.index===d,canDelete:ue,decofile:h,meta:S,matchers:p,onSelect:()=>Me(L.index),onRename:()=>b(L.index),onDuplicate:()=>V(L.index),onDelete:()=>R(L.index)},L.id)),e[14]=d,e[15]=ue,e[16]=h,e[17]=o,e[18]=E,e[19]=Ae,e[20]=je,e[21]=p,e[22]=S,e[23]=_,e[24]=R,e[25]=V,e[26]=b,e[27]=v,e[28]=oe,e[29]=ve,e[30]=re,e[31]=W,e[32]=q,e[33]=ne,e[34]=le,e[35]=ke,e[36]=Se,e[37]=de,e[38]=be,e[39]=$,e[40]=Z,e[41]=we}else ve=e[29],re=e[30],W=e[31],q=e[32],ne=e[33],le=e[34],ke=e[35],Se=e[36],de=e[37],be=e[38],$=e[39],Z=e[40],we=e[41];let Ke;e[49]!==W||e[50]!==we?(Ke=n.jsx("div",{className:we,children:W}),e[49]=W,e[50]=we,e[51]=Ke):Ke=e[51];let $e;e[52]!==ve||e[53]!==q||e[54]!==ne||e[55]!==Ke?($e=n.jsx(ve,{items:q,strategy:ne,children:Ke}),e[52]=ve,e[53]=q,e[54]=ne,e[55]=Ke,e[56]=$e):$e=e[56];let Le;e[57]!==l||e[58]!==h||e[59]!==p||e[60]!==S?(Le=l?n.jsx(no,{variant:l.variant,decofile:h,meta:S,matchers:p}):null,e[57]=l,e[58]=h,e[59]=p,e[60]=S,e[61]=Le):Le=e[61];let Te;e[62]!==Le?(Te=n.jsx(na,{dropAnimation:null,children:Le}),e[62]=Le,e[63]=Te):Te=e[63];let Oe;e[64]!==re||e[65]!==le||e[66]!==ke||e[67]!==Se||e[68]!==de||e[69]!==be||e[70]!==$e||e[71]!==Te?(Oe=n.jsxs(re,{sensors:le,collisionDetection:ke,onDragStart:Se,onDragEnd:de,onDragCancel:be,children:[$e,Te]}),e[64]=re,e[65]=le,e[66]=ke,e[67]=Se,e[68]=de,e[69]=be,e[70]=$e,e[71]=Te,e[72]=Oe):Oe=e[72];let Fe;return e[73]!==$||e[74]!==Z||e[75]!==Oe?(Fe=n.jsxs("div",{className:$,children:[Z,Oe]}),e[73]=$,e[74]=Z,e[75]=Oe,e[76]=Fe):Fe=e[76],Fe}function so(m){return m.id}function Fn(m){const e=He.c(15),{schema:r,value:c,onChange:d,meta:h,decofile:S,onSaveReferencedBlock:p,sandbox:v}=m;let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];const[b,V]=w.useState(g);let R;e[1]!==b?(R=b.length>0&&n.jsxs("nav",{"aria-label":"Variant rule breadcrumb",className:"flex min-w-0 items-center gap-1 overflow-hidden text-xs",children:[n.jsx("button",{type:"button",onClick:()=>V([]),className:"flex shrink-0 items-center gap-0.5 rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",title:"Back to rule",children:n.jsx(ra,{className:"size-3.5"})}),b.map((o,N)=>{const l=N===b.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[N>0&&n.jsx(oa,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>V(b.slice(0,N+1)),title:o,className:Ee("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",l?"font-medium text-foreground":"text-muted-foreground"),children:o})]},`${o}-${N}`)})]}),e[1]=b,e[2]=R):R=e[2];let _;e[3]!==b||e[4]!==S||e[5]!==h||e[6]!==d||e[7]!==p||e[8]!==v||e[9]!==r||e[10]!==c?(_=n.jsx(aa,{schema:r,value:c,onChange:d,basePath:"",breadcrumbPath:b,onBreadcrumbChange:V,meta:h,decofile:S,onSaveReferencedBlock:p,sandbox:v}),e[3]=b,e[4]=S,e[5]=h,e[6]=d,e[7]=p,e[8]=v,e[9]=r,e[10]=c,e[11]=_):_=e[11];let k;return e[12]!==R||e[13]!==_?(k=n.jsxs("div",{className:"space-y-2",children:[R,_]}),e[12]=R,e[13]=_,e[14]=k):k=e[14],k}function In(m){const e=He.c(21),{activeSchema:r,formValue:c,formResetKey:d,onFormChange:h,onBreadcrumbChange:S,breadcrumbPath:p,emptyMessage:v,beforeForm:g,seoResolveType:b,siteDefaultSeo:V,meta:R,decofile:_,onSaveReferencedBlock:k,sandbox:o}=m;let N;e[0]!==p?(N=p===void 0?[]:p,e[0]=p,e[1]=N):N=e[1];const l=N;let J;e[2]!==r||e[3]!==l||e[4]!==_||e[5]!==d||e[6]!==c||e[7]!==R||e[8]!==S||e[9]!==h||e[10]!==k||e[11]!==o||e[12]!==b||e[13]!==V?(J=r&&c?b?n.jsx(Rr,{schema:r,resolveType:b,value:c,formResetKey:d,onChange:h,onBreadcrumbChange:S,siteDefaultSeo:V}):n.jsx(aa,{schema:r,value:c,onChange:h,basePath:"",breadcrumbPath:l,onBreadcrumbChange:S,meta:R,decofile:_,onSaveReferencedBlock:k,sandbox:o},d):null,e[2]=r,e[3]=l,e[4]=_,e[5]=d,e[6]=c,e[7]=R,e[8]=S,e[9]=h,e[10]=k,e[11]=o,e[12]=b,e[13]=V,e[14]=J):J=e[14];const H=J;let K;e[15]!==v||e[16]!==H?(K=H??n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:v}),e[15]=v,e[16]=H,e[17]=K):K=e[17];let u;return e[18]!==g||e[19]!==K?(u=n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsxs("div",{className:"mx-auto max-w-2xl",children:[g,K]})}),e[18]=g,e[19]=K,e[20]=u):u=e[20],u}const ro="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.22)]";function oo(m,e){return Ds(m,e,tt)}function io(m){const e=He.c(13),{pageKey:r,initialName:c,initialPath:d,onFieldChange:h}=m,[S,p]=w.useState(c),[v,g]=w.useState(d),[b,V]=w.useState(r);b!==r&&(V(r),p(c),g(d));let R;e[0]!==h?(R=l=>{p(l.target.value),h("name",l.target.value)},e[0]=h,e[1]=R):R=e[1];let _;e[2]!==S||e[3]!==R?(_=n.jsx("input",{type:"text",value:S,onChange:R,className:"w-full bg-transparent text-sm font-semibold truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"Page name"}),e[2]=S,e[3]=R,e[4]=_):_=e[4];let k;e[5]!==h?(k=l=>{g(l.target.value),h("path",l.target.value)},e[5]=h,e[6]=k):k=e[6];let o;e[7]!==v||e[8]!==k?(o=n.jsx("input",{type:"text",value:v,onChange:k,className:"w-full bg-transparent text-xs text-muted-foreground truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"/path"}),e[7]=v,e[8]=k,e[9]=o):o=e[9];let N;return e[10]!==_||e[11]!==o?(N=n.jsxs("div",{className:"space-y-1",children:[_,o]}),e[10]=_,e[11]=o,e[12]=N):N=e[12],N}function zn(m){const e=He.c(6),{onClick:r}=m;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(la,{size:14}),e[0]=c):c=e[0];let d;e[1]!==r?(d=n.jsx(ft,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:r,children:c})}),e[1]=r,e[2]=d):d=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(pt,{side:"bottom",children:"Add variant"}),e[3]=h):h=e[3];let S;return e[4]!==d?(S=n.jsxs(mt,{children:[d,h]}),e[4]=d,e[5]=S):S=e[5],S}function oc({orgSlug:m,virtualMcpId:e,branch:r,previewReady:c=!0,previewUrl:d,currentPath:h,activePageBlockKey:S=null,activeGlobalBlockKey:p=null,externalSelectedIndex:v,onSaved:g,initialEditSeo:b=!1,onExitSeo:V,onViewJsonFile:R,onVariantPreviewOverride:_}){const k=c?{orgSlug:m,virtualMcpId:e,branch:r,previewUrl:d}:null,{data:o,isLoading:N}=Cs(k),{data:l,isLoading:J}=Vs(k),H=Ts(),K=H?.entity?.id===e?H.entity.metadata?.siteSlug??null:null,[u,T]=w.useState(null),[se,P]=w.useState(null),[pe,D]=w.useState(null),[ce,B]=w.useState(0),[te,oe]=w.useState(void 0),[Ve,E]=w.useState(null),[ue,ie]=w.useState(null),[je,M]=w.useState([]),[Ae,X]=w.useState(0),[De,ve]=w.useState(null),[re,W]=w.useState(null),[q,ne]=w.useState(null),[le,ke]=w.useState(!0),[Se,de]=w.useState(!1),[be,$]=w.useState(!1),[Z,we]=w.useState(b),[Ke,$e]=w.useState(b);b&&!Ke&&($e(!0),we(!0),T(null),P(null),D(null),M([])),!b&&Ke&&$e(!1);const[Le,Te]=w.useState(null),[Oe,Fe]=w.useState(void 0),[Me,xe]=w.useState([]),[Re,me]=w.useState(0),[ee,L]=w.useState(0),[ae,Q]=w.useState(null),[Ie,he]=w.useState(null),[Qe,dn]=w.useState(null),xa=Ss(),ya=`${m}/${e}/${r}`,Ht=Ps({orgSlug:m,virtualMcpId:e,branch:r}),[ba,_a]=w.useState(h),[ja,ka]=w.useState(S),[wa,Ra]=w.useState(p);(ba!==h||ja!==S||wa!==p)&&(queueMicrotask(()=>Ht.flush()),_a(h),ka(S),Ra(p),T(null),P(null),D(null),B(0),E(null),ie(null),L(0),Q(null),he(null),M([]),X(t=>t+1),we(!1),Te(null),Fe(void 0),xe([]),me(t=>t+1));const ye=As({orgSlug:m,virtualMcpId:e,branch:r}),Dt=Xs((t,a)=>{ye.mutate({blockKey:t,data:a},{onSuccess:()=>g?.(),onError:s=>G.error(`Save failed: ${s.message}`)})}),Ut=Ms({orgSlug:m,virtualMcpId:e,branch:r}),[bt,Ct]=w.useState(!1),Gt=w.useRef(null),ht=w.useRef(null),gt=w.useRef(null),Wt=w.useRef({}),qe=w.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!c||N||J)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(Hn,{size:20,className:"animate-spin text-muted-foreground"})});if(!o||!l)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Could not load site data."});const Na=Es(o),_e=!!p,ze=_e?null:Ks(Na,h,S),j=_e?p:ze?.key??null,qt=_e&&p?o[p]:void 0,mn=_e&&p&&qt?$s(p,qt):_e&&p?p:"",Vt=!_e&&j&&o[j]?o[j]:null,Yt=Z&&o&&l&&j&&ze?$n(o,{kind:"page",pageKey:j,pageName:String(ze.name??""),path:String(ze.path??"")},l):null,Da=Z?Vt?.seo:void 0,Jt=Oe!==void 0?Oe:Da,Ca=Z?Nr(Jt):void 0,Va=Yt?.seoTypeOptions??[],Ta=Z&&l?Dr(l):"",fn=Le??Ca??{},Qt=Z&&Yt?Cr(fn,Yt):null,Pa=Z&&Qt&&Vr(Jt)?Ot(Qt,l):null,Aa=Z?Tr(o,l)?.seoData:void 0,Be=_e?[{label:"Default",sections:[{__resolveType:p}]}]:oo(Vt?.sections,o??{}),Tt=Be.length>1,Ce=Math.min(ce,Be.length-1),nt=Be[Ce],I=nt?.sections??[],Pe=Bt(I,o),pn=!_e&&Os(Vt?.sections);if(_e&&p&&Qe!==p){dn(p);const t=I[0],a=Pe[0];if(t&&a){T(0),L(0),M([]);const s=ut(t,a,o);s&&(P(s.data),D(s.resolveType),he(null),Q(null))}}!_e&&Qe!==null&&dn(null),qe.current={rawSections:I,parsedSections:Pe,decofile:o??{},activePageKey:j,pageVariants:Be,variantIndex:Ce,sectionVariantIndex:ee,selectedSectionIndex:u};const Ma=()=>({multivariate:pn,index:Ce,variants:Be.map(t=>({rule:t.rule}))}),hn=(t,a)=>{if(!_)return;if(!j||!pn||t.length<=1){_(null);return}const s=En(j,{multivariate:!0,index:a,variants:t},o,l);_(s.length>0?s:null)},vt=(t,a,s)=>{if(!_)return;if(!j){_(null);return}const i=Ma(),f=En(j,i,o,l);if(!t||a<0){_(f.length>0?f:null);return}const y=ar({pageKey:j,page:i,sectionIndex:a,sectionLazy:Pe[a]?.isLazy??!1,mvObj:t,selectedVariantIndex:s,decofile:o,meta:l}),x=[...f,...y];_(x.length>0?x:null)},at=(t,a,s,i=u??-1,f=!1)=>{const y=Je(t,a);if(!y){P(null),D(null),he(null),Q(null),f&&vt(null,i,s);return}const C=Vn(y,tt)[s];if(!C){P(null),D(null),he(null),Q(null),f&&vt(null,i,s);return}const Y=Hs(C.value,o);P(Y?.data??null),D(Y?.resolveType??null);const{resolveType:A,formValue:O}=jt(C.rule,o,l??void 0);he(A),Q(O),f&&vt(y,i,s)};if(v!==void 0&&v!==te&&(oe(v??null),typeof v=="number")){const t=I[v],a=Pe[v];if(t&&a)if(T(v),L(0),M([]),X(s=>s+1),a.isMultivariate)at(t,a,0,v);else{const s=ut(t,a,o);s?(P(s.data),D(s.resolveType)):(P(null),D(null)),he(null),Q(null)}}const Pt={orgSlug:m,virtualMcpId:e,branch:r,previewUrl:d??void 0,siteSlug:K},Xt=pe&&l?Ot(pe,l):null,Ue=(t,a)=>{if(!j)return;const s=wt(o,j,t,Ce,Be);ye.mutate({blockKey:j,data:s},{onSuccess:()=>a?.onSuccess?.()??g?.(),onError:i=>G.error(`Save failed: ${i.message}`)})},St=()=>{T(null),P(null),D(null),L(0),Q(null),he(null),M([]),X(t=>t+1)},Ea=(t,a)=>{Gt.current&&clearTimeout(Gt.current);const s=qe.current.sectionVariantIndex;Gt.current=setTimeout(()=>{const{rawSections:i,parsedSections:f,decofile:y,activePageKey:x,pageVariants:C,variantIndex:Y}=qe.current,A=i[a];if(!A)return;const O=f[a];if(!O)return;if(O.isSavedBlock){const z=O.isLazy?A.section?.__resolveType??A.__resolveType:A.__resolveType;ye.mutate({blockKey:z,data:t},{onSuccess:()=>g?.(),onError:U=>G.error(`Save failed: ${U.message}`)});return}if(!x)return;const F={...y[x]},ge=[...i];if(O.isMultivariate){const z=Je(A,O);if(!z||!x)return;const U=rr(z,s,t);ge[a]=dt(A,O,U)}else if(O.isHidden){const z=qn(A.__resolveType),U=z?{...A.section}:{...A},Ne=Array.isArray(U.variants)?[...U.variants]:[];Ne[0]&&(Ne[0]={...Ne[0],value:t}),U.variants=Ne,z?ge[a]={...A,section:U}:ge[a]=U}else O.isLazy?ge[a]={...A,section:t}:ge[a]=t;if(C.length>1){const z=F.sections,U=[...z?.variants??[]];U[Y]&&(U[Y]={...U[Y],value:ge}),F.sections={...z,variants:U}}else F.sections=ge;ye.mutate({blockKey:x,data:F},{onSuccess:()=>g?.(),onError:z=>G.error(`Save failed: ${z.message}`)})},on)},Ka=t=>{T(t),L(0),M([]),X(f=>f+1);const a=I[t],s=Pe[t];if(!a||!s)return;if(s.isMultivariate){at(a,s,0,t);return}const i=ut(a,s,o);if(!i){P(null),D(null),he(null),Q(null),vt(null,t,0);return}P(i.data),D(i.resolveType),he(null),Q(null),vt(null,t,0)},gn=t=>{const a=t;P(a),u!==null&&Ea(a,u)},Zt=t=>{if(!j||!o||!l||!ze)return;const a={kind:"page",pageKey:j,pageName:String(ze.name??""),path:String(ze.path??"")},s=$n(o,a,l);s&&Ht.save(j,()=>{const i=xa.getQueryData(xs.decofile(ya))?.[j];if(!i||typeof i!="object"||i===null||Array.isArray(i))return null;const f={...i,...Wt.current};return Wt.current={},t?.raw!==void 0?{...f,seo:t.raw}:t?.inner!==void 0?Ar(a,s,f,t.inner):f})},$a=(t,a)=>{j&&(Wt.current[t]=a,Zt())},Oa=(t,a)=>{if(!j)return;const s=Rt([...I],t,a);u!==null&&(u===t?T(a):t<u&&a>=u?T(u-1):t>u&&a<=u&&T(u+1)),Ue(s)},Ba=t=>{if(!j)return;const a=I.filter((s,i)=>i!==t);u===t?St():u!==null&&u>t&&T(u-1),Ue(a)},La=t=>{if(!j)return;const a=I[t];if(!a)return;const s=[...I];s.splice(t+1,0,nr(a)),u!==null&&u>t&&T(u+1),Ue(s)},Fa=t=>{if(!j)return;const a=I[t],s=Pe[t];if(!a||!s||s.isMultivariate)return;const i=s.isHidden?er(a):tr(a);if(!i)return;const f=[...I];f[t]=i,u===t&&St(),Ue(f)},Ia=t=>{if(!j)return;const a=I[t],s=Pe[t];if(!a||!s||s.isMultivariate)return;const i=Zs(a);if(!i)return;const f=[...I];f[t]=i,u===t&&St(),Ue(f)},za=t=>{if(!j)return;const a=I[t],s=Pe[t];if(!a||!s?.isSavedBlock)return;const i=ut(a,s,o);if(!i?.data)return;const{name:f,...y}=i.data,x=[...I];s.isLazy?x[t]={...a,section:y}:x[t]=y,u===t&&St(),Ue(x)},Ha=t=>{if(!j)return;const a=[...I,{__resolveType:t.resolveType}],s=a.length-1;Ue(a,{onSuccess:()=>{de(!1),T(s),L(0),M([]),X(x=>x+1);const i=a[s],f=Bt(a,o)[s];if(!i||!f)return;if(f.isMultivariate){at(i,f,0);return}const y=ut(i,f,o);if(!y){P(null),D(null),he(null),Q(null);return}P(y.data),D(y.resolveType),he(null),Q(null)}})},Ua=t=>{if(u===null)return;const a=I[u],s=Pe[u];!a||!s?.isMultivariate||(L(t),M([]),X(i=>i+1),at(a,s,t,u,!0))},Ga=t=>{if(u===null||!j)return;const a=I[u],s=Pe[u];if(!a||!s?.isMultivariate)return;const i=Je(a,s);if(!i)return;const f=Js(i,t);if(!f){G.error("Cannot delete the only variant.");return}const y=[...I];y[u]=dt(a,s,f);const x=f.variants;let C=ee;t===ee?C=Math.min(t,x.length-1):t<ee&&(C=ee-1),L(C),M([]),X(Y=>Y+1),at(y[u],s,C),Ue(y)},Wa=t=>{if(u===null||!j)return;const a=I[u],s=Pe[u];if(!a||!s?.isMultivariate)return;const i=Je(a,s);if(!i)return;const f=Qs(i,t),y=[...I];y[u]=dt(a,s,f);const x=t+1;L(x),M([]),X(C=>C+1),at(y[u],s,x),Ue(y)},qa=(t,a)=>{if(u===null||!j||t===a)return;const s=I[u],i=Pe[u];if(!s||!i?.isMultivariate)return;const f=Je(s,i);if(!f)return;const y=qs(f,t,a),x=[...I];x[u]=dt(s,i,y);let C=ee;ee===t?C=a:t<ee&&a>=ee?C=ee-1:t>ee&&a<=ee&&(C=ee+1),L(C),at(x[u],i,C),Ue(x)},en=t=>{const a=t??u;if(a===null||!j)return;const s=I[a],i=Pe[a];if(!s||!i)return;const f=Us(s,i);if(!f){G.error("This section cannot have variants.");return}const y=[...I];y[a]=f.section;const x=Bt(y,o)[a];if(!x?.isMultivariate){G.error("Could not add variant.");return}T(a),L(f.newVariantIndex),M([]),X(C=>C+1),at(f.section,x,f.newVariantIndex,a),Ue(y)},Ya=()=>{if(u===null||!j)return;const t=I[u],a=Pe[u];if(!t||!a?.isMultivariate)return;const s=Je(t,a);if(!s)return;const i=Ys(t,a,s);if(!i){G.error("Could not remove variants.");return}const f=[...I];f[u]=i;const y=Bt(f,o)[u];if(!y)return;L(0),he(null),Q(null),M([]),X(C=>C+1);const x=ut(i,y,o);x?(P(x.data),D(x.resolveType)):(P(null),D(null)),vt(null,u,0),Ue(f)},Ja=async t=>{if(De===null||!j)return;const a=rn(t,o);if(a){G.error(a);return}const s=I[De],i=Pe[De];if(!s||!i)return;const f=ut(s,i,o);if(!f){G.error("This section cannot be saved as global.");return}const y={...f.data,name:t};try{await ye.mutateAsync({blockKey:t,data:y});const x=[...I];x[De]={__resolveType:t},await ye.mutateAsync({blockKey:j,data:wt(o,j,x,Ce,Be)}),u===De&&St(),ve(null),G.success(`Saved global block "${t}"`),g?.()}catch(x){G.error(x instanceof Error?x.message:"Failed to save global block")}},vn=nt?.rule;if(Tt&&u===null&&ue===null&&vn){const{resolveType:t,formValue:a}=jt(vn,o??{},l??void 0);ie(t),E(a)}const At=l?Bs(l):[],Sn=l&&o?Ls(l,o):[],Qa=!_e&&!!(d&&l&&o),xn=ue&&l?Ot(ue,l):null,Mt=()=>{ht.current&&(clearTimeout(ht.current),ht.current=null),gt.current&&(clearTimeout(gt.current),gt.current=null)},_t=async(t,a)=>{if(!(sr(a,t,l)>0))try{await Ut.mutateAsync({blockKey:t})}catch(s){G.error(s instanceof Error?s.message:"Could not delete matcher block")}},yn=t=>{ht.current&&clearTimeout(ht.current),ht.current=setTimeout(()=>{const{activePageKey:a,decofile:s,variantIndex:i}=qe.current;if(!a)return;const f={...s[a]},y={...f.sections},x=[...y.variants??[]],C=x[i],Y=C?.rule;if(xt(Y,s,l)){const A=Y?.__resolveType??"",O=s[A],F=typeof O?.name=="string"?O.name:A,{__resolveType:ge,...z}=t;ye.mutate({blockKey:A,data:yt(ge??"",z,F)},{onSuccess:()=>g?.(),onError:U=>G.error(`Save failed: ${U.message}`)});return}C&&(x[i]={...C,rule:t}),f.sections={...y,variants:x},ye.mutate({blockKey:a,data:f},{onSuccess:()=>g?.(),onError:A=>G.error(`Save failed: ${A.message}`)})},on)},Xa=t=>{ie(t);const a=t?{__resolveType:t}:{__resolveType:Kn};E({}),yn(a)},Za=t=>{const a=t;E(a);const s=ue?{__resolveType:ue,...a}:{...a};yn(s)},es=async t=>{Mt();const{activePageKey:a,decofile:s,variantIndex:i}=qe.current;if(!a)return;const f=s[a],y=f?.sections;if(!y||typeof y!="object"||Array.isArray(y))return;const x=y;if(!Array.isArray(x.variants))return;const C=[...x.variants],Y=C[i];if(!Y)return;const A=kt(Y.rule,s,l),O=Ft(t);C[i]={...Y,rule:O};const F={...s,[a]:{...f,sections:{...x,variants:C}}},{resolveType:ge,formValue:z}=jt(O,F,l??void 0);ie(ge),E(z);try{await ye.mutateAsync({blockKey:a,data:F[a]}),A&&A!==t&&await _t(A,F),g?.()}catch(U){G.error(U instanceof Error?U.message:"Could not apply saved rule")}},bn=t=>{gt.current&&clearTimeout(gt.current);const{selectedSectionIndex:a,sectionVariantIndex:s}=qe.current;a!==null&&(gt.current=setTimeout(()=>{const{rawSections:i,parsedSections:f,decofile:y,activePageKey:x,pageVariants:C,variantIndex:Y}=qe.current;if(!x)return;const A=i[a],O=f[a];if(!A||!O?.isMultivariate)return;const F=Je(A,O);if(!F)return;const z=(F.variants??[])[s]?.rule;if(xt(z,y,l)){const fe=z?.__resolveType??"",Ge=y[fe],Ze=typeof Ge?.name=="string"?Ge.name:fe,{__resolveType:rt,...et}=t;ye.mutate({blockKey:fe,data:yt(rt??"",et,Ze)},{onSuccess:()=>g?.(),onError:ot=>G.error(`Save failed: ${ot.message}`)});return}const U=Pn(F,s,t),Ne=[...i];Ne[a]=dt(A,O,U);const Ye=wt(y,x,Ne,Y,C);ye.mutate({blockKey:x,data:Ye},{onSuccess:()=>g?.(),onError:fe=>G.error(`Save failed: ${fe.message}`)})},on))},ts=t=>{he(t),Q({}),bn(t?{__resolveType:t}:{__resolveType:Kn})},ns=t=>{const a=t;Q(a);const s=Ie?{__resolveType:Ie,...a}:{...a};bn(s)},as=async t=>{Mt();const{selectedSectionIndex:a,sectionVariantIndex:s,rawSections:i,parsedSections:f,decofile:y,activePageKey:x,pageVariants:C,variantIndex:Y}=qe.current;if(a===null||!x)return;const A=i[a],O=f[a];if(!A||!O?.isMultivariate)return;const F=Je(A,O);if(!F)return;const ge=F.variants??[],z=kt(ge[s]?.rule,y,l),U=Ft(t),Ne=Pn(F,s,U),Ye=[...i];Ye[a]=dt(A,O,Ne);const fe=wt(y,x,Ye,Y,C),Ge={...y,[x]:fe},{resolveType:Ze,formValue:rt}=jt(U,Ge,l??void 0);he(Ze),Q(rt);try{await ye.mutateAsync({blockKey:x,data:fe}),z&&z!==t&&await _t(z,Ge),g?.()}catch(et){G.error(et instanceof Error?et.message:"Could not apply saved rule")}};if(!_e&&!ze)return n.jsxs("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:["No page found for ",h]});if(_e&&!qt)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Global block not found"});const st=u!==null?Pe[u]??null:null,_n=u!==null?I[u]:null,jn=_n&&st?.isMultivariate?Je(_n,st):null,lt=jn?Vn(jn,tt):[],tn=Math.min(ee,Math.max(lt.length-1,0)),Et=lt[tn]??null,ct=st?.isMultivariate===!0,kn=u!==null&&st!==null,Kt=kn&&(ct||!!(Xt&&se)),ss=Kt&&!_e&&st?.isSavedBlock===!0,Xe=_e||ss,rs=_e?mn:st?.label??"",wn=Ie&&l?Ot(Ie,l):null,nn=Kt&&(!_e||je.length>0)?_e?[mn,...je]:[ze.name,st.label,...ct&&Et?[Et.label]:[],...je]:[],os=Z&&ze?[ze.name,"SEO",...Me]:[],$t=Z?os:Xe?nn.length>0?nn:[rs]:nn,Rn=()=>{if(!j)return;const t=o[j],a=Gs(t.sections,I);if(!a)return;const s=Ws(a);ye.mutate({blockKey:j,data:{...t,sections:a}},{onSuccess:()=>{B(s),T(null),P(null),D(null),M([]),E(null),ie(null)},onError:i=>G.error(`Save failed: ${i.message}`)})},an=(t,a,s)=>{if(!j)return;const i=o[j],f=i.sections;if(!f||typeof f!="object"||Array.isArray(f))return;const y=f;if(!Array.isArray(y.variants))return;const x=t([...y.variants]);if(!x)return;const C=or(y,x),Y={...o,[j]:{...i,sections:C}};ye.mutate({blockKey:j,data:Y[j]},{onSuccess:()=>{a?.(),s&&_t(s,Y)},onError:A=>G.error(`Save failed: ${A.message}`)})},is=t=>{W(null),B(t),T(null),P(null),D(null),M([]);const a=Be[t]?.rule,{resolveType:s,formValue:i}=jt(a,o??{},l??void 0);ie(s),E(i),hn(Be.map(f=>({rule:f.rule})),t)},ls=(t,a)=>{if(t===a)return;let s=Ce;Ce===t?s=a:t<Ce&&a>=Ce?s=Ce-1:t>Ce&&a<=Ce&&(s=Ce+1),B(s);const i=Rt(Be.map(f=>({rule:f.rule})),t,a);hn(i,s),an(f=>Rt(f,t,a))},cs=t=>{const a=Be[t]?.rule,s=kt(a,o??{},l??void 0);an(i=>i.length<=1?null:(i.splice(t,1),i),()=>{Be.length-1===1?B(0):t<Ce?B(Ce-1):t===Ce&&B(Math.max(0,t-1)),T(null),P(null),D(null),M([]),E(null),ie(null)},s)},us=t=>{an(a=>ir(a,t),()=>{B(t+1),T(null),P(null),D(null),M([]),E(null),ie(null)})},ds=async(t,a)=>{Mt();const s=qe.current.activePageKey,i=qe.current.decofile;if(!s)return;const f=i[s],y=f.sections;if(!y||typeof y!="object"||Array.isArray(y))return;const x=y;if(!Array.isArray(x.variants))return;const C=[...x.variants],Y=C[t];if(!Y?.rule||typeof Y.rule!="object"){G.error("This variant has no matcher rule to rename.");return}const A=Y.rule,O=a.trim();Ct(!0);try{if(!O){if(!xt(A,i,l)){W(null);return}const Ye=A.__resolveType??"";C[t]={...Y,rule:An(A,i,l)};const fe={...i,[s]:{...f,sections:{...x,variants:C}}};await ye.mutateAsync({blockKey:s,data:fe[s]}),await _t(Ye,fe),W(null),g?.();return}const F=Mn(A,i,l);if(!F){G.error("Could not read this variant's matcher rule.");return}if(F.blockKey){await ye.mutateAsync({blockKey:F.blockKey,data:yt(F.resolveType,F.data,O)}),W(null),g?.();return}const ge=sn(O),z=rn(ge,i);if(z){G.error(z);return}const U=yt(F.resolveType,F.data,O);let Ne=null;try{await ye.mutateAsync({blockKey:ge,data:U}),Ne=ge,C[t]={...Y,rule:Ft(ge)},await ye.mutateAsync({blockKey:s,data:{...f,sections:{...x,variants:C}}}),Ne=null}catch(Ye){throw Ne&&await Ut.mutateAsync({blockKey:Ne}).catch(()=>{}),Ye}W(null),G.success(`Saved matcher as global block "${O}"`),g?.()}catch(F){G.error(F instanceof Error?F.message:"Failed to rename variant")}finally{Ct(!1)}},ms=async(t,a)=>{Mt();const{selectedSectionIndex:s,rawSections:i,parsedSections:f,decofile:y,activePageKey:x,pageVariants:C,variantIndex:Y}=qe.current;if(s===null||!x)return;const A=i[s],O=f[s];if(!A||!O?.isMultivariate)return;const F=Je(A,O);if(!F)return;const ge=F.variants??[],z=ge[t];if(!z?.rule||typeof z.rule!="object"){G.error("This variant has no matcher rule to rename.");return}const U=z.rule,Ne=a.trim();Ct(!0);const Ye=async fe=>{const Ge={...F,variants:fe},Ze=[...i];Ze[s]=dt(A,O,Ge);const rt=wt(y,x,Ze,Y,C);return await ye.mutateAsync({blockKey:x,data:rt}),{...y,[x]:rt}};try{if(!Ne){if(!xt(U,y,l)){ne(null);return}const ot=U.__resolveType??"",Cn=[...ge];Cn[t]={...z,rule:An(U,y,l)};const vs=await Ye(Cn);await _t(ot,vs),ne(null),g?.();return}const fe=Mn(U,y,l);if(!fe){G.error("Could not read this variant's matcher rule.");return}if(fe.blockKey){await ye.mutateAsync({blockKey:fe.blockKey,data:yt(fe.resolveType,fe.data,Ne)}),ne(null),g?.();return}const Ge=sn(Ne),Ze=rn(Ge,y);if(Ze){G.error(Ze);return}const rt=yt(fe.resolveType,fe.data,Ne);let et=null;try{await ye.mutateAsync({blockKey:Ge,data:rt}),et=Ge;const ot=[...ge];ot[t]={...z,rule:Ft(Ge)},await Ye(ot),et=null}catch(ot){throw et&&await Ut.mutateAsync({blockKey:et}).catch(()=>{}),ot}ne(null),G.success(`Saved matcher as global block "${Ne}"`),g?.()}catch(fe){G.error(fe instanceof Error?fe.message:"Failed to rename variant")}finally{Ct(!1)}},Nn=()=>{St()},fs=t=>{Te(t),Zt({inner:t})},ps=t=>{Fe(t),Zt({raw:t})},hs=()=>{Te(null),xe([])},gs=()=>me(t=>t+1),Dn=t=>{if(Z){if(t===0){Ht.flush(),we(!1),Te(null),Fe(void 0),xe([]),me(s=>s+1),V?.();return}if(t===1){xe([]),me(s=>s+1);return}xe(Me.slice(0,t-1)),me(s=>s+1);return}if(_e){M(je.slice(0,t)),X(s=>s+1);return}if(t===0){Nn();return}if(t===1){M([]),X(s=>s+1);return}if(ct&&t===2){M([]),X(s=>s+1);return}const a=ct?2:1;M(je.slice(0,t-a))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:Xe||Kt||Z?n.jsxs("div",{className:Ee("border-b px-3 py-2.5",Xe&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[$t.length>1&&n.jsx("button",{type:"button",onClick:()=>Dn($t.length-2),title:"Back","aria-label":"Back",className:Ee("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",Xe?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(ra,{className:"size-4"})}),!_e&&Tt&&nt&&n.jsxs("button",{type:"button",onClick:Nn,title:`Editing in variant: ${nt.label}`,className:Ee("shrink-0 inline-flex items-center gap-1 rounded-md h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",ro),children:[n.jsx(va,{rule:Nt(nt.rule,o??{},l??void 0),matchers:At}),n.jsx("span",{className:"max-w-[160px] truncate",children:nt.label})]}),n.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:$t.map((t,a)=>{const s=a===$t.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[a>0&&n.jsx(oa,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Dn(a),title:t,className:Ee("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",s?Xe?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":Xe?"text-foreground/80":"text-muted-foreground",Xe?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${a}`)})}),Xe&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(fr,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(pt,{side:"bottom",className:"max-w-[260px]",children:"A global section is a reusable block shared across your site. Editing it here updates it everywhere it's used."})]}),kn&&!ct&&!st?.isHidden&&j&&n.jsx(zn,{onClick:()=>en()})]}),Xe&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:"This is a global section. Changes apply everywhere this section is used across your site."})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(io,{pageKey:j,initialName:ze.name,initialPath:ze.path,onFieldChange:$a})}),n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":"Edit SEO",className:"size-7 shrink-0",onClick:()=>we(!0),children:n.jsx(dr,{size:14})})}),n.jsx(pt,{side:"bottom",children:"Edit SEO"})]}),n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":"View JSON",className:"size-7 shrink-0",onClick:()=>R&&j?R(j):$(!0),children:n.jsx(mr,{size:14})})}),n.jsx(pt,{side:"bottom",children:"View JSON"})]}),n.jsx(zn,{onClick:Rn})]})}),Z?n.jsx(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Vt&&j?n.jsx(Pr,{rawSeo:Jt,innerSeo:fn,defaultResolveType:Ta,seoSchema:Pa,activeResolveType:Qt,seoTypeOptions:Va,formResetKey:Re,siteDefaultSeo:Aa,onBreadcrumbChange:xe,onPersistRaw:ps,onInnerChange:fs,onClearForm:hs,onBumpFormKey:gs}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"SEO schema not found for this site."})})})}):Kt?n.jsxs(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ct&&lt.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Fs,{listKey:`${j??""}:${u??""}`,variants:lt.map((t,a)=>({index:a,label:t.label})),selectedIndex:tn,onSelect:Ua,onRename:ne,onDuplicate:Wa,onDelete:Ga,onRemoveAll:Ya,onReorder:qa,onAdd:()=>en()}),ct&&n.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),n.jsx(Tn,{currentRt:Ie??"",currentLabel:Lt(Et?.rule,o??{},tt,l??void 0),currentGlobalKey:kt(Et?.rule,o??{},l??void 0)??void 0,matchers:At,globals:Sn,onSelect:ts,onSelectGlobal:as}),wn&&ae&&n.jsx("div",{className:"pt-1",children:n.jsx(Fn,{schema:wn,value:ae,onChange:ns,meta:l??void 0,decofile:o,onSaveReferencedBlock:Dt,sandbox:Pt},`${u??"none"}:${tn}:${Ie??""}`)})]})]}),n.jsx(In,{activeSchema:Xt,formValue:se,formResetKey:Ae,onFormChange:gn,onBreadcrumbChange:M,breadcrumbPath:je,emptyMessage:"No editable fields for this variant.",meta:l,decofile:o,onSaveReferencedBlock:Dt,sandbox:Pt})]}):_e?n.jsx(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(In,{activeSchema:Xt,formValue:se,formResetKey:Ae,onFormChange:gn,onBreadcrumbChange:M,breadcrumbPath:je,emptyMessage:"No editable fields for this global block.",meta:l,decofile:o,onSaveReferencedBlock:Dt,sandbox:Pt})}):n.jsxs(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Tt&&j&&n.jsx(ao,{listKey:j,variants:Be,activeIndex:Ce,decofile:o??{},meta:l,matchers:At,onSelect:is,onReorder:ls,onRename:W,onDuplicate:us,onDelete:cs,onAdd:Rn}),Tt&&ue!==null&&n.jsxs("div",{className:Ee("px-3 border-b",le?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>ke(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-sm py-0.5 hover:bg-muted/40","aria-expanded":le,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),le?n.jsx(cr,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(lr,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),le&&n.jsxs("div",{className:Ee("space-y-3",bt&&"pointer-events-none opacity-50"),children:[n.jsx(Tn,{currentRt:ue,currentLabel:Lt(nt?.rule,o??{},tt,l??void 0),currentGlobalKey:kt(nt?.rule,o??{},l??void 0)??void 0,matchers:At,globals:Sn,onSelect:Xa,onSelectGlobal:es}),xn&&Ve&&n.jsx("div",{className:"space-y-3",children:n.jsx(Fn,{schema:xn,value:Ve,onChange:Za,meta:l??void 0,decofile:o,onSaveReferencedBlock:Dt,sandbox:Pt},`${Ce}:${ue??""}`)})]})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(qr,{listKey:`${j??""}-${Ce}`,rawSections:I,sections:Pe,meta:l,selectedIndex:u,onSelect:Ka,onReorder:Oa,onDelete:Ba,onDuplicate:La,onMakeReusable:ve,onToggleHidden:Fa,onToggleLazy:Ia,onAddVariant:en,onDetach:za,onAddSection:()=>de(!0),canAddSection:Qa})})]}),n.jsx(Is,{open:De!==null,onOpenChange:t=>{t||ve(null)},defaultBlockId:De!==null?sn(Pe[De]?.label??""):"",isPending:ye.isPending,onSubmit:Ja}),d&&n.jsx(Er,{open:Se,onOpenChange:de,meta:l,decofile:o,previewBaseUrl:d,onSelect:Ha}),be&&j&&o&&n.jsx(zs,{open:be,onOpenChange:$,pageKey:j,decofile:o}),re!==null&&n.jsx(Bn,{open:!0,initialName:xt(Be[re]?.rule,o??{},l??void 0)?Lt(Be[re]?.rule,o??{},tt,l??void 0):"",autoLabel:tt(Nt(Be[re]?.rule,o??{},l??void 0)),isPending:bt,onSubmit:async t=>{await ds(re,t)},onOpenChange:t=>{!t&&!bt&&W(null)}}),q!==null&&n.jsx(Bn,{open:!0,initialName:xt(lt[q]?.rule,o??{},l??void 0)?Lt(lt[q]?.rule,o??{},tt,l??void 0):"",autoLabel:tt(Nt(lt[q]?.rule,o??{},l??void 0)),isPending:bt,onSubmit:async t=>{await ms(q,t)},onOpenChange:t=>{!t&&!bt&&ne(null)}})]})}export{oc as SectionsEditor};
@@ -1 +1 @@
1
- import{r as i,aT as nt,aR as Pe,j as d,cR as rt,aV as be,aS as k,cS as st,aO as j,aU as _,bM as $,cT as lt,at as Ne,cU as Ee,aP as at,bI as ct,bO as it,c_ as dt,c$ as ut,d0 as pt,d1 as ft,cV as mt,aQ as ht,d2 as vt,cW as gt,cY as xt,c as ee,l as oe}from"./index-CohYEXUC.js";import{V as St}from"./tooltip-owO6Fujv.js";import{i as wt}from"./Check-CYLXae3M.js";import{t as Re}from"./ChevronDown-Ce0JNwG8.js";import{n as Ct}from"./ChevronUp-Cflkeqqz.js";function _e(r,[e,t]){return Math.min(t,Math.max(e,r))}var yt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],Q="Select",[de,ue,bt]=at(Q),[ne]=ht(Q,[bt,Ee]),pe=Ee(),[Tt,G]=ne(Q),[Pt,_t]=ne(Q),je=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:c,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:b,required:w,form:S}=r,p=pe(e),[v,C]=i.useState(null),[m,x]=i.useState(null),[U,M]=i.useState(!1),re=nt(u),[N,O]=Pe({prop:o,defaultProp:n??!1,onChange:c,caller:Q}),[F,q]=Pe({prop:s,defaultProp:l,onChange:a,caller:Q}),L=i.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=i.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(rt,{...p,children:d.jsxs(Tt,{required:w,scope:e,trigger:v,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:U,onValueNodeHasChildrenChange:M,contentId:be(),value:F,onValueChange:q,open:N,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:b,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Pt,{scope:r.__scopeSelect,onNativeOptionAdd:i.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:i.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?d.jsxs(Je,{"aria-hidden":!0,required:w,tabIndex:-1,name:h,autoComplete:g,value:F,onChange:E=>q(E.target.value),disabled:b,form:S,children:[F===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=Q;var Me="SelectTrigger",Ae=i.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,c=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=i.useRef("touch"),[g,b,w]=tt(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===s.value),m=ot(v,p,C);m!==void 0&&s.onValueChange(m.value)}),S=p=>{l||(s.onOpenChange(!0),w()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(st,{asChild:!0,...c,children:d.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:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...n,ref:a,onClick:_(n.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:_(n.onPointerDown,p=>{h.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:_(n.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&b(p.key),!(v&&p.key===" ")&&yt.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:c,placeholder:s="",...l}=r,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=c!==void 0,g=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):c})});De.displayName=Oe;var Nt="SelectIcon",ke=i.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return d.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});ke.displayName=Nt;var Et="SelectPortal",Le=r=>d.jsx(lt,{asChild:!0,...r});Le.displayName=Et;var J="SelectContent",Be=i.forwardRef((r,e)=>{const t=G(J,r.__scopeSelect),[o,n]=i.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const c=o;return c?Ne.createPortal(d.jsx(Ve,{scope:r.__scopeSelect,children:d.jsx(de.Slot,{scope:r.__scopeSelect,children:d.jsx("div",{children:r.children})})}),c):null}return d.jsx(He,{...r,ref:e})});Be.displayName=J;var A=10,[Ve,Y]=ne(J),Rt="SelectContentImpl",jt=vt("SelectContent.RemoveScroll"),He=i.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:c,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=r,m=G(J,t),[x,U]=i.useState(null),[M,re]=i.useState(null),N=k(e,f=>U(f)),[O,F]=i.useState(null),[q,L]=i.useState(null),B=ue(t),[W,V]=i.useState(!1),H=i.useRef(!1);i.useEffect(()=>{if(x)return dt(x)},[x]),ut();const E=i.useCallback(f=>{const[T,...R]=B().map(P=>P.ref.current),[y]=R.slice(-1),I=document.activeElement;for(const P of f)if(P===I||(P?.scrollIntoView({block:"nearest"}),P===T&&M&&(M.scrollTop=0),P===y&&M&&(M.scrollTop=M.scrollHeight),P?.focus(),document.activeElement!==I))return},[B,M]),D=i.useCallback(()=>E([O,x]),[E,O,x]);i.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;i.useEffect(()=>{if(x){let f={x:0,y:0};const T=y=>{f={x:Math.abs(Math.round(y.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(y.pageY)-(K.current?.y??0))}},R=y=>{f.x<=10&&f.y<=10?y.preventDefault():x.contains(y.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]),i.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=tt(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),y=ot(T,f,R);y&&setTimeout(()=>y.ref.current.focus())}),me=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&(F(f),y&&(H.current=!0))},[m.value]),he=i.useCallback(()=>x?.focus(),[x]),te=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&L(f)},[m.value]),ce=o==="popper"?Se:ze,se=ce===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return d.jsx(Ve,{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:d.jsx(pt,{as:jt,allowPinchZoom:!0,children:d.jsx(ft,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:_(n,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(mt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ce,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:_(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let y=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(y=y.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,P=y.indexOf(I);y=y.slice(P+1)}setTimeout(()=>E(y)),f.preventDefault()}})})})})})})});He.displayName=Rt;var Mt="SelectItemAlignedPosition",ze=i.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,c=G(J,t),s=Y(J,t),[l,a]=i.useState(null),[u,h]=i.useState(null),g=k(e,N=>h(N)),b=ue(t),w=i.useRef(!1),S=i.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:m}=s,x=i.useCallback(()=>{if(c.trigger&&c.valueNode&&l&&u&&p&&v&&C){const N=c.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),F=c.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(c.dir!=="rtl"){const I=q.left-O.left,P=F.left-I,X=N.left-P,Z=N.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=_e(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,P=window.innerWidth-F.right-I,X=window.innerWidth-N.right-P,Z=N.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=_e(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=b(),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(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=N.top+N.height/2-A,ce=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const P=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ce,se+(I?he:0)+P+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&v===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>w.current=!0)}},[b,c.trigger,c.valueNode,l,u,p,v,C,c.dir,o]);$(()=>x(),[x]);const[U,M]=i.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=i.useCallback(N=>{N&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(Ot,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:w,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:U},children:d.jsx(j.div,{...n,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=i.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...c}=r,s=pe(t);return d.jsx(gt,{...s,...c,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...c.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=At;var[Ot,Te]=ne(J,{}),we="SelectViewport",Ue=i.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,c=Y(we,t),s=Te(we,t),l=k(e,c.onViewportChange),a=i.useRef(0);return d.jsxs(d.Fragment,{children:[d.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}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:_(n.onScroll,u=>{const h=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:b}=s;if(b?.current&&g){const w=Math.abs(a.current-h.scrollTop);if(w>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const m=C+w,x=Math.min(S,m),U=m-x;g.style.height=x+"px",g.style.bottom==="0px"&&(h.scrollTop=U>0?U:0,g.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Ue.displayName=we;var Fe="SelectGroup",[Dt,kt]=ne(Fe),Lt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=be();return d.jsx(Dt,{scope:t,id:n,children:d.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Lt.displayName=Fe;var We="SelectLabel",Bt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=kt(We,t);return d.jsx(j.div,{id:n.id,...o,ref:e})});Bt.displayName=We;var ie="SelectItem",[Vt,Ke]=ne(ie),$e=i.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:c,...s}=r,l=G(ie,t),a=Y(ie,t),u=l.value===o,[h,g]=i.useState(c??""),[b,w]=i.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,n)),p=be(),v=i.useRef("touch"),C=()=>{n||(l.onValueChange(o),l.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 d.jsx(Vt,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:i.useCallback(m=>{g(x=>x||(m?.textContent??"").trim())},[]),children:d.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:h,children:d.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":b?"":void 0,"aria-selected":u&&b,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:_(s.onFocus,()=>w(!0)),onBlur:_(s.onBlur,()=>w(!1)),onClick:_(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:_(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:_(s.onPointerDown,m=>{v.current=m.pointerType}),onPointerMove:_(s.onPointerMove,m=>{v.current=m.pointerType,n?a.onItemLeave?.():v.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:_(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(It.includes(m.key)&&C(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ie;var le="SelectItemText",Ge=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...c}=r,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=_t(le,t),[h,g]=i.useState(null),b=k(e,C=>g(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),w=h?.textContent,S=i.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:w},a.value),[a.disabled,a.value,w]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...c,ref:b}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ne.createPortal(c.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});qe.displayName=Ye;var Ce="SelectScrollUpButton",Xe=i.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;c(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});Xe.displayName=Ce;var ye="SelectScrollDownButton",Ze=i.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;c(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=ye;var Qe=i.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,c=Y("SelectScrollButton",t),s=i.useRef(null),l=ue(t),a=i.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return i.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:_(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:_(n.onPointerMove,()=>{c.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:_(n.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});zt.displayName=Ht;var Ie="SelectArrow",Ut=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),c=G(Ie,t),s=Y(Ie,t);return c.open&&s.position==="popper"?d.jsx(xt,{...n,...o,ref:e}):null});Ut.displayName=Ie;var Ft="SelectBubbleInput",Je=i.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=i.useRef(null),c=k(o,n),s=ct(e);return i.useEffect(()=>{const l=n.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const g=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(j.select,{...t,style:{...St,...t.style},ref:c,defaultValue:e})});Je.displayName=Ft;function et(r){return r===""||r===void 0}function tt(r){const e=it(r),t=i.useRef(""),o=i.useRef(0),n=i.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),c=i.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return i.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,c]}function ot(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,c=t?r.indexOf(t):-1;let s=Wt(r,Math.max(c,0));n.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return a!==t?a:void 0}function Wt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var Kt=je,$t=Ae,Gt=De,Yt=ke,qt=Le,Xt=Be,Zt=Ue,Qt=$e,Jt=Ge,eo=qe,to=Xe,oo=Ze;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=d.jsx(Kt,{"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=d.jsx(Gt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function fo(r){const e=ee.c(13);let t,o,n,c;e[0]!==r?({className:o,size:c,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?"default":c;let l;e[5]!==o?(l=oe("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg bg-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=xs]:h-6 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *: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-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Yt,{asChild:!0,children:d.jsx(Re,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==s||e[11]!==l?(u=d.jsxs($t,{"data-slot":"select-trigger","data-size":s,className:l,...n,children:[t,a]}),e[8]=t,e[9]=n,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function mo(r){const e=ee.c(25);let t,o,n,c,s;e[0]!==r?({className:o,children:t,position:c,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c,e[5]=s):(t=e[1],o=e[2],n=e[3],c=e[4],s=e[5]);const l=c===void 0?"popper":c,a=s===void 0?!1:s,u=l==="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 h;e[6]!==o||e[7]!==u?(h=oe("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-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=h):h=e[8];let g;e[9]!==a?(g=!a&&d.jsx(no,{}),e[9]=a,e[10]=g):g=e[10];const b=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let w;e[11]!==b?(w=oe("p-1",b),e[11]=b,e[12]=w):w=e[12];let S;e[13]!==t||e[14]!==w?(S=d.jsx(Zt,{className:w,children:t}),e[13]=t,e[14]=w,e[15]=S):S=e[15];let p;e[16]!==a?(p=!a&&d.jsx(ro,{}),e[16]=a,e[17]=p):p=e[17];let v;return e[18]!==l||e[19]!==n||e[20]!==h||e[21]!==g||e[22]!==S||e[23]!==p?(v=d.jsx(qt,{children:d.jsxs(Xt,{"data-slot":"select-content",className:h,position:l,...n,children:[g,S,p]})}),e[18]=l,e[19]=n,e[20]=h,e[21]=g,e[22]=S,e[23]=p,e[24]=v):v=e[24],v}function ho(r){const e=ee.c(16);let t,o,n,c;e[0]!==r?({className:o,children:t,hideCheck:c,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?!1:c;let l;e[5]!==o?(l=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",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(eo,{children:d.jsx(wt,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Jt,{children:t}),e[9]=t,e[10]=u):u=e[10];let h;return e[11]!==n||e[12]!==l||e[13]!==a||e[14]!==u?(h=d.jsxs(Qt,{"data-slot":"select-item",className:l,...n,children:[a,u]}),e[11]=n,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}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 c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Ct,{className:"size-4"}),e[5]=c):c=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:c}),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 c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Re,{className:"size-4"}),e[5]=c):c=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:c}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{uo as S,fo as a,po as b,mo as c,ho as d,_e as e};
1
+ import{r as i,aT as nt,aR as Pe,j as d,cR as rt,aV as be,aS as k,cS as st,aO as j,aU as _,bM as $,cT as lt,at as Ne,cU as Ee,aP as at,bI as ct,bO as it,c_ as dt,c$ as ut,d0 as pt,d1 as ft,cV as mt,aQ as ht,d2 as vt,cW as gt,cY as xt,c as ee,l as oe}from"./index-BB5lA5jj.js";import{V as St}from"./tooltip-LRHFL41r.js";import{i as wt}from"./Check-Bf3Fz6mT.js";import{t as Re}from"./ChevronDown-TeMcV6Wa.js";import{n as Ct}from"./ChevronUp-g5JVf1F_.js";function _e(r,[e,t]){return Math.min(t,Math.max(e,r))}var yt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],Q="Select",[de,ue,bt]=at(Q),[ne]=ht(Q,[bt,Ee]),pe=Ee(),[Tt,G]=ne(Q),[Pt,_t]=ne(Q),je=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:c,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:b,required:w,form:S}=r,p=pe(e),[v,C]=i.useState(null),[m,x]=i.useState(null),[U,M]=i.useState(!1),re=nt(u),[N,O]=Pe({prop:o,defaultProp:n??!1,onChange:c,caller:Q}),[F,q]=Pe({prop:s,defaultProp:l,onChange:a,caller:Q}),L=i.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=i.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(rt,{...p,children:d.jsxs(Tt,{required:w,scope:e,trigger:v,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:U,onValueNodeHasChildrenChange:M,contentId:be(),value:F,onValueChange:q,open:N,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:b,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Pt,{scope:r.__scopeSelect,onNativeOptionAdd:i.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:i.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?d.jsxs(Je,{"aria-hidden":!0,required:w,tabIndex:-1,name:h,autoComplete:g,value:F,onChange:E=>q(E.target.value),disabled:b,form:S,children:[F===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=Q;var Me="SelectTrigger",Ae=i.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,c=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=i.useRef("touch"),[g,b,w]=tt(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===s.value),m=ot(v,p,C);m!==void 0&&s.onValueChange(m.value)}),S=p=>{l||(s.onOpenChange(!0),w()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(st,{asChild:!0,...c,children:d.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:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...n,ref:a,onClick:_(n.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:_(n.onPointerDown,p=>{h.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:_(n.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&b(p.key),!(v&&p.key===" ")&&yt.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:c,placeholder:s="",...l}=r,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=c!==void 0,g=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):c})});De.displayName=Oe;var Nt="SelectIcon",ke=i.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return d.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});ke.displayName=Nt;var Et="SelectPortal",Le=r=>d.jsx(lt,{asChild:!0,...r});Le.displayName=Et;var J="SelectContent",Be=i.forwardRef((r,e)=>{const t=G(J,r.__scopeSelect),[o,n]=i.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const c=o;return c?Ne.createPortal(d.jsx(Ve,{scope:r.__scopeSelect,children:d.jsx(de.Slot,{scope:r.__scopeSelect,children:d.jsx("div",{children:r.children})})}),c):null}return d.jsx(He,{...r,ref:e})});Be.displayName=J;var A=10,[Ve,Y]=ne(J),Rt="SelectContentImpl",jt=vt("SelectContent.RemoveScroll"),He=i.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:c,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=r,m=G(J,t),[x,U]=i.useState(null),[M,re]=i.useState(null),N=k(e,f=>U(f)),[O,F]=i.useState(null),[q,L]=i.useState(null),B=ue(t),[W,V]=i.useState(!1),H=i.useRef(!1);i.useEffect(()=>{if(x)return dt(x)},[x]),ut();const E=i.useCallback(f=>{const[T,...R]=B().map(P=>P.ref.current),[y]=R.slice(-1),I=document.activeElement;for(const P of f)if(P===I||(P?.scrollIntoView({block:"nearest"}),P===T&&M&&(M.scrollTop=0),P===y&&M&&(M.scrollTop=M.scrollHeight),P?.focus(),document.activeElement!==I))return},[B,M]),D=i.useCallback(()=>E([O,x]),[E,O,x]);i.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;i.useEffect(()=>{if(x){let f={x:0,y:0};const T=y=>{f={x:Math.abs(Math.round(y.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(y.pageY)-(K.current?.y??0))}},R=y=>{f.x<=10&&f.y<=10?y.preventDefault():x.contains(y.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]),i.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=tt(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),y=ot(T,f,R);y&&setTimeout(()=>y.ref.current.focus())}),me=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&(F(f),y&&(H.current=!0))},[m.value]),he=i.useCallback(()=>x?.focus(),[x]),te=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&L(f)},[m.value]),ce=o==="popper"?Se:ze,se=ce===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return d.jsx(Ve,{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:d.jsx(pt,{as:jt,allowPinchZoom:!0,children:d.jsx(ft,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:_(n,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(mt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ce,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:_(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let y=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(y=y.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,P=y.indexOf(I);y=y.slice(P+1)}setTimeout(()=>E(y)),f.preventDefault()}})})})})})})});He.displayName=Rt;var Mt="SelectItemAlignedPosition",ze=i.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,c=G(J,t),s=Y(J,t),[l,a]=i.useState(null),[u,h]=i.useState(null),g=k(e,N=>h(N)),b=ue(t),w=i.useRef(!1),S=i.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:m}=s,x=i.useCallback(()=>{if(c.trigger&&c.valueNode&&l&&u&&p&&v&&C){const N=c.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),F=c.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(c.dir!=="rtl"){const I=q.left-O.left,P=F.left-I,X=N.left-P,Z=N.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=_e(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,P=window.innerWidth-F.right-I,X=window.innerWidth-N.right-P,Z=N.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=_e(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=b(),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(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=N.top+N.height/2-A,ce=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const P=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ce,se+(I?he:0)+P+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&v===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>w.current=!0)}},[b,c.trigger,c.valueNode,l,u,p,v,C,c.dir,o]);$(()=>x(),[x]);const[U,M]=i.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=i.useCallback(N=>{N&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(Ot,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:w,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:U},children:d.jsx(j.div,{...n,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=i.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...c}=r,s=pe(t);return d.jsx(gt,{...s,...c,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...c.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=At;var[Ot,Te]=ne(J,{}),we="SelectViewport",Ue=i.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,c=Y(we,t),s=Te(we,t),l=k(e,c.onViewportChange),a=i.useRef(0);return d.jsxs(d.Fragment,{children:[d.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}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:_(n.onScroll,u=>{const h=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:b}=s;if(b?.current&&g){const w=Math.abs(a.current-h.scrollTop);if(w>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const m=C+w,x=Math.min(S,m),U=m-x;g.style.height=x+"px",g.style.bottom==="0px"&&(h.scrollTop=U>0?U:0,g.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Ue.displayName=we;var Fe="SelectGroup",[Dt,kt]=ne(Fe),Lt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=be();return d.jsx(Dt,{scope:t,id:n,children:d.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Lt.displayName=Fe;var We="SelectLabel",Bt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=kt(We,t);return d.jsx(j.div,{id:n.id,...o,ref:e})});Bt.displayName=We;var ie="SelectItem",[Vt,Ke]=ne(ie),$e=i.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:c,...s}=r,l=G(ie,t),a=Y(ie,t),u=l.value===o,[h,g]=i.useState(c??""),[b,w]=i.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,n)),p=be(),v=i.useRef("touch"),C=()=>{n||(l.onValueChange(o),l.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 d.jsx(Vt,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:i.useCallback(m=>{g(x=>x||(m?.textContent??"").trim())},[]),children:d.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:h,children:d.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":b?"":void 0,"aria-selected":u&&b,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:_(s.onFocus,()=>w(!0)),onBlur:_(s.onBlur,()=>w(!1)),onClick:_(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:_(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:_(s.onPointerDown,m=>{v.current=m.pointerType}),onPointerMove:_(s.onPointerMove,m=>{v.current=m.pointerType,n?a.onItemLeave?.():v.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:_(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(It.includes(m.key)&&C(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ie;var le="SelectItemText",Ge=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...c}=r,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=_t(le,t),[h,g]=i.useState(null),b=k(e,C=>g(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),w=h?.textContent,S=i.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:w},a.value),[a.disabled,a.value,w]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...c,ref:b}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ne.createPortal(c.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});qe.displayName=Ye;var Ce="SelectScrollUpButton",Xe=i.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;c(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});Xe.displayName=Ce;var ye="SelectScrollDownButton",Ze=i.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;c(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=ye;var Qe=i.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,c=Y("SelectScrollButton",t),s=i.useRef(null),l=ue(t),a=i.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return i.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:_(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:_(n.onPointerMove,()=>{c.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:_(n.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});zt.displayName=Ht;var Ie="SelectArrow",Ut=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),c=G(Ie,t),s=Y(Ie,t);return c.open&&s.position==="popper"?d.jsx(xt,{...n,...o,ref:e}):null});Ut.displayName=Ie;var Ft="SelectBubbleInput",Je=i.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=i.useRef(null),c=k(o,n),s=ct(e);return i.useEffect(()=>{const l=n.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const g=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(j.select,{...t,style:{...St,...t.style},ref:c,defaultValue:e})});Je.displayName=Ft;function et(r){return r===""||r===void 0}function tt(r){const e=it(r),t=i.useRef(""),o=i.useRef(0),n=i.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),c=i.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return i.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,c]}function ot(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,c=t?r.indexOf(t):-1;let s=Wt(r,Math.max(c,0));n.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return a!==t?a:void 0}function Wt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var Kt=je,$t=Ae,Gt=De,Yt=ke,qt=Le,Xt=Be,Zt=Ue,Qt=$e,Jt=Ge,eo=qe,to=Xe,oo=Ze;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=d.jsx(Kt,{"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=d.jsx(Gt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function fo(r){const e=ee.c(13);let t,o,n,c;e[0]!==r?({className:o,size:c,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?"default":c;let l;e[5]!==o?(l=oe("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg bg-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=xs]:h-6 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *: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-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Yt,{asChild:!0,children:d.jsx(Re,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==s||e[11]!==l?(u=d.jsxs($t,{"data-slot":"select-trigger","data-size":s,className:l,...n,children:[t,a]}),e[8]=t,e[9]=n,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function mo(r){const e=ee.c(25);let t,o,n,c,s;e[0]!==r?({className:o,children:t,position:c,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c,e[5]=s):(t=e[1],o=e[2],n=e[3],c=e[4],s=e[5]);const l=c===void 0?"popper":c,a=s===void 0?!1:s,u=l==="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 h;e[6]!==o||e[7]!==u?(h=oe("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-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=h):h=e[8];let g;e[9]!==a?(g=!a&&d.jsx(no,{}),e[9]=a,e[10]=g):g=e[10];const b=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let w;e[11]!==b?(w=oe("p-1",b),e[11]=b,e[12]=w):w=e[12];let S;e[13]!==t||e[14]!==w?(S=d.jsx(Zt,{className:w,children:t}),e[13]=t,e[14]=w,e[15]=S):S=e[15];let p;e[16]!==a?(p=!a&&d.jsx(ro,{}),e[16]=a,e[17]=p):p=e[17];let v;return e[18]!==l||e[19]!==n||e[20]!==h||e[21]!==g||e[22]!==S||e[23]!==p?(v=d.jsx(qt,{children:d.jsxs(Xt,{"data-slot":"select-content",className:h,position:l,...n,children:[g,S,p]})}),e[18]=l,e[19]=n,e[20]=h,e[21]=g,e[22]=S,e[23]=p,e[24]=v):v=e[24],v}function ho(r){const e=ee.c(16);let t,o,n,c;e[0]!==r?({className:o,children:t,hideCheck:c,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?!1:c;let l;e[5]!==o?(l=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",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(eo,{children:d.jsx(wt,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Jt,{children:t}),e[9]=t,e[10]=u):u=e[10];let h;return e[11]!==n||e[12]!==l||e[13]!==a||e[14]!==u?(h=d.jsxs(Qt,{"data-slot":"select-item",className:l,...n,children:[a,u]}),e[11]=n,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}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 c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Ct,{className:"size-4"}),e[5]=c):c=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:c}),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 c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Re,{className:"size-4"}),e[5]=c):c=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:c}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{uo as S,fo as a,po as b,mo as c,ho as d,_e as e};