decocms 3.18.3 → 3.18.5

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 (231) hide show
  1. package/dist/client/assets/{AlertCircle-B-r3okdw.js → AlertCircle-CslgXeHr.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-tDPH0_4m.js → ArrowUpRight-D_DImXhK.js} +1 -1
  3. package/dist/client/assets/{Check-BhYHl6b1.js → Check-C4hca_-Y.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-CVL_FX-8.js → CheckCircle-HpSNY8ij.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-CniGrT2-.js → ChevronDown-Dxt-1uCb.js} +1 -1
  6. package/dist/client/assets/{ChevronLeft-kGfXoAV-.js → ChevronLeft-B5zdF1BR.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-COCWmVlT.js → ChevronRight-CyvrXAe0.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-DzsjrX2b.js → ChevronUp-aKq1AYju.js} +1 -1
  9. package/dist/client/assets/{Container-D1PVb_TW.js → Container-DXqMOloC.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-_gNEu7zY.js → DotsVertical-Bo9Tm-x1.js} +1 -1
  11. package/dist/client/assets/{Eye-Cja82Q7U.js → Eye-CBgMpWUe.js} +1 -1
  12. package/dist/client/assets/{FilterLines-Bel4K6qN.js → FilterLines-CWMZctUn.js} +1 -1
  13. package/dist/client/assets/{Globe01-D39kUdoP.js → Globe01-BgNeS-t5.js} +1 -1
  14. package/dist/client/assets/{HardDrive-CgdcwvGL.js → HardDrive-skQdR31x.js} +1 -1
  15. package/dist/client/assets/{Key01-DYyg_tnP.js → Key01-CxukwP00.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-CoO_xxXK.js → LayoutLeft-CmXWN8pg.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-DN-lMhNz.js → LinkExternal01-l_9oMYRN.js} +1 -1
  18. package/dist/client/assets/{Monitor01-gHlWGw8m.js → Monitor01-DIoPLr7l.js} +1 -1
  19. package/dist/client/assets/{Palette-D9uHHj9p.js → Palette-BTCzP1Gm.js} +1 -1
  20. package/dist/client/assets/{Play-RXfEurLC.js → Play-DSJB4Nw2.js} +1 -1
  21. package/dist/client/assets/{Plus-7ete7Chf.js → Plus-BUBMXRTd.js} +1 -1
  22. package/dist/client/assets/{RefreshCcw01-BcEdc8yb.js → RefreshCcw01-JqGzzm_-.js} +1 -1
  23. package/dist/client/assets/{SearchMd-CW4p_47C.js → SearchMd-CGISNeet.js} +1 -1
  24. package/dist/client/assets/{Settings02-BilcqWFp.js → Settings02-C4ziU-d4.js} +1 -1
  25. package/dist/client/assets/{Shield01-CWDizliI.js → Shield01-IwIv25Jp.js} +1 -1
  26. package/dist/client/assets/{Star01-Bc8W2nUe.js → Star01-J_T9yrd1.js} +1 -1
  27. package/dist/client/assets/{Stars01-H8xKRb3B.js → Stars01-BjgHV0Ah.js} +1 -1
  28. package/dist/client/assets/{Stars02-BG9BQfDN.js → Stars02-CUXVM8eC.js} +1 -1
  29. package/dist/client/assets/{Sun-2czCa7nh.js → Sun-BzriIyyb.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-X0-A3wlA.js → SwitchHorizontal01-CxiFSSn6.js} +1 -1
  31. package/dist/client/assets/{Tool01-C_efsdJ9.js → Tool01-BO2C1HmC.js} +1 -1
  32. package/dist/client/assets/{Trash01-D8gyPG4F.js → Trash01-DeyjRbcU.js} +1 -1
  33. package/dist/client/assets/{Upload01-CeZYEoZ8.js → Upload01-C4K5hWSL.js} +1 -1
  34. package/dist/client/assets/{User01-CfhPWLkj.js → User01-CyAUnciz.js} +1 -1
  35. package/dist/client/assets/{Users01-CwA0YZWL.js → Users01-CCUr4Yur.js} +1 -1
  36. package/dist/client/assets/{Users03-D_dEpKEB.js → Users03-Cwd2CyYY.js} +1 -1
  37. package/dist/client/assets/{X-Dlvmz5Lj.js → X-BoM0MLQn.js} +1 -1
  38. package/dist/client/assets/{XCircle-Q3LP6RaJ.js → XCircle-DZ20_zb3.js} +1 -1
  39. package/dist/client/assets/{XClose-CMlIOxQg.js → XClose-BLi9vIRd.js} +1 -1
  40. package/dist/client/assets/{Zap-C5hsI9kw.js → Zap-CrVhQ07E.js} +1 -1
  41. package/dist/client/assets/{ZapSquare-OkNAvBeL.js → ZapSquare-CqyHqTSv.js} +1 -1
  42. package/dist/client/assets/{ZoomOut-Btzzfq_K.js → ZoomOut-D1C0CDzK.js} +1 -1
  43. package/dist/client/assets/{access-gate-Uv1zLF5Y.js → access-gate-rgO__BFd.js} +1 -1
  44. package/dist/client/assets/{accordion-CoOSA6zg.js → accordion-CAJ4g4RV.js} +1 -1
  45. package/dist/client/assets/{add-section-modal-BH5ViPBB.js → add-section-modal-fGEm5qce.js} +1 -1
  46. package/dist/client/assets/agent-capabilities-Dl7XXwpG.js +3 -0
  47. package/dist/client/assets/{agent-icon-BiKNgOeT.js → agent-icon-C7paq9nL.js} +1 -1
  48. package/dist/client/assets/{agent-icons-Bt1m_ENb.js → agent-icons-hJ9xtdfo.js} +1 -1
  49. package/dist/client/assets/{agents-list-Bf5wbGTB.js → agents-list-BuXi88Zq.js} +1 -1
  50. package/dist/client/assets/{ai-providers-DRIUaAzW.js → ai-providers-C_J38hfO.js} +1 -1
  51. package/dist/client/assets/{alert-BWTI9LY5.js → alert-1jxJJFv9.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-D1sXzFR6.js → alert-dialog-DOf1CDFG.js} +1 -1
  53. package/dist/client/assets/app-editor-B9HEmwg1.js +1 -0
  54. package/dist/client/assets/{auth-catchall-p5-aZBW9.js → auth-catchall-CAKyNWmQ.js} +1 -1
  55. package/dist/client/assets/{auth-split-layout-DUM0vTfJ.js → auth-split-layout-DDzFkzzL.js} +1 -1
  56. package/dist/client/assets/{automation-list-row-Cdl3j3R5.js → automation-list-row-D730hoTt.js} +1 -1
  57. package/dist/client/assets/{automation-runs-DjKtm8sC.js → automation-runs-BeoB4dd9.js} +1 -1
  58. package/dist/client/assets/{automations-DQdCdeIY.js → automations-3aEV0B6i.js} +1 -1
  59. package/dist/client/assets/{avatar-DcRL4WFc.js → avatar-BOZs09SE.js} +1 -1
  60. package/dist/client/assets/{badge-B2isb5t4.js → badge-Cf9p2KiH.js} +1 -1
  61. package/dist/client/assets/{brand-context-BlzqcU4f.js → brand-context-70H_l0C5.js} +1 -1
  62. package/dist/client/assets/{buckets-CNaD-KsO.js → buckets-AML8oaPV.js} +1 -1
  63. package/dist/client/assets/{calendar-DleQOR6C.js → calendar-BO9tcRYu.js} +1 -1
  64. package/dist/client/assets/{capability-load-error-BIabmgVZ.js → capability-load-error-atGCCjOU.js} +1 -1
  65. package/dist/client/assets/{card-7rPQAdEb.js → card-wIb7H0Z4.js} +1 -1
  66. package/dist/client/assets/{chat-context-BpOhQo4D.js → chat-context-D4Cm-d6A.js} +1 -1
  67. package/dist/client/assets/{checkbox-DmtUHgAJ.js → checkbox-BwSTMmic.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-C8MYWV1f.js → cli-auth-success-CCe8_B5U.js} +1 -1
  69. package/dist/client/assets/{collection-detail-CClLQ75n.js → collection-detail-DS8OFm3e.js} +1 -1
  70. package/dist/client/assets/{collection-display-button-CCzBk9Sy.js → collection-display-button-DUh8mQez.js} +1 -1
  71. package/dist/client/assets/{collection-search-CmhXzxiX.js → collection-search-CUV3pFhw.js} +1 -1
  72. package/dist/client/assets/{collection-table-wrapper-C0xQn6vd.js → collection-table-wrapper-afuL1hQ0.js} +1 -1
  73. package/dist/client/assets/{collection-tabs-CyAZqj58.js → collection-tabs-CGllLoge.js} +1 -1
  74. package/dist/client/assets/{collections-D4J1DJ61.js → collections-D8RfaH_g.js} +1 -1
  75. package/dist/client/assets/{command-B-HknKNN.js → command-C-yJHbpu.js} +1 -1
  76. package/dist/client/assets/{connect-desktop-dialog-wDkcQT-i.js → connect-desktop-dialog-hVZb8AY9.js} +1 -1
  77. package/dist/client/assets/{connection-card-DiU6mNhU.js → connection-card-vgtnONDT.js} +1 -1
  78. package/dist/client/assets/{connection-detail-w_f-Stjx.js → connection-detail-3pdA1O-Y.js} +1 -1
  79. package/dist/client/assets/{connection-form-helpers-B5x3bKYp.js → connection-form-helpers-oCzpRzHj.js} +1 -1
  80. package/dist/client/assets/{connections-tTj2cPUZ.js → connections-kCOJLbco.js} +1 -1
  81. package/dist/client/assets/{constants-DpuEAZHq.js → constants-CnOnAK7r.js} +1 -1
  82. package/dist/client/assets/{decopilot-sse-pool-CLAzhWPC.js → decopilot-sse-pool-Bdv0H274.js} +1 -1
  83. package/dist/client/assets/{dialog-Co3xDPPR.js → dialog-CvEIov2R.js} +1 -1
  84. package/dist/client/assets/{domain-settings-C-YGglFw.js → domain-settings-DOArz2KT.js} +1 -1
  85. package/dist/client/assets/{drawer-B7pzzO8k.js → drawer-B_9l3ZhB.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-cIyq0nsy.js → dropdown-menu-BGgFPqgI.js} +1 -1
  87. package/dist/client/assets/{dynamic-plugin-layout-2hRmXntY.js → dynamic-plugin-layout-Bx-gzGnq.js} +1 -1
  88. package/dist/client/assets/{empty-state-BVd0NO3b.js → empty-state-BWGtqxUL.js} +1 -1
  89. package/dist/client/assets/{empty-state-BEKtdW4r.js → empty-state-Db1HVS3F.js} +1 -1
  90. package/dist/client/assets/{extract-connection-data-CV_04Mqr.js → extract-connection-data-CaeplLEr.js} +1 -1
  91. package/dist/client/assets/{features-MBg0vBXI.js → features-PxgwX_yM.js} +1 -1
  92. package/dist/client/assets/{file-explorer-DFh0G9AW.js → file-explorer-D4X9mNUX.js} +1 -1
  93. package/dist/client/assets/{file-type-icon-BUGLJdWu.js → file-type-icon-CUYwtPob.js} +1 -1
  94. package/dist/client/assets/{files-DrFFkAhA.js → files-BrehNRKw.js} +1 -1
  95. package/dist/client/assets/{form-ngFqzDUs.js → form-BRW-mO5v.js} +1 -1
  96. package/dist/client/assets/{general-CjaqrNa3.js → general-BZO56fxW.js} +1 -1
  97. package/dist/client/assets/{generate-id-B72e1YIz.js → generate-id-CdTqgONK.js} +1 -1
  98. package/dist/client/assets/{github-repo-picker-BYeMQGhG.js → github-repo-picker-hw4e_RVO.js} +1 -1
  99. package/dist/client/assets/{header-tab-button-CBrvR3rT.js → header-tab-button-IP2RhXhm.js} +1 -1
  100. package/dist/client/assets/{hover-card-HMEbmFNY.js → hover-card-BMrhboDz.js} +1 -1
  101. package/dist/client/assets/{image-field-BxdtQ-6B.js → image-field-BhWuARh_.js} +1 -1
  102. package/dist/client/assets/{index-Dx0tF1g4.js → index-37PxaG4U.js} +1 -1
  103. package/dist/client/assets/{index-CKvOOOxk.js → index-BHdQPz7N.js} +1 -1
  104. package/dist/client/assets/{index-B_bvlyHZ.js → index-Bn8JFywe.js} +1 -1
  105. package/dist/client/assets/{index-NBs1GdqN.js → index-BuKZbcmU.js} +1 -1
  106. package/dist/client/assets/{index-gacl_Tlu.js → index-BvZc_M4M.js} +4 -4
  107. package/dist/client/assets/{index-CgH2OhoV.js → index-C9Lj6Jk-.js} +1 -1
  108. package/dist/client/assets/{index-XIClfKQB.js → index-CLjpFTJZ.js} +1 -1
  109. package/dist/client/assets/{index-CsEESfyT.js → index-CNQY6k_W.js} +1 -1
  110. package/dist/client/assets/{index-BHx2Zpbq.js → index-CcJv2Spi.js} +1 -1
  111. package/dist/client/assets/{index-DMh_yIhm.js → index-Cueugb-e.js} +1 -1
  112. package/dist/client/assets/{index-CpmOG_Bg.js → index-D6_5HAZl.js} +3 -3
  113. package/dist/client/assets/{index-Bi91cUM-.js → index-XuzNc7bG.js} +1 -1
  114. package/dist/client/assets/{index-bE1s1gBY.js → index-b-XqjXTb.js} +1 -1
  115. package/dist/client/assets/{index-redirect-8hjLwAwq.js → index-redirect-CG43pYY_.js} +1 -1
  116. package/dist/client/assets/{index-DSTr5vNX.js → index-t0gLDn-a.js} +1 -1
  117. package/dist/client/assets/{index-d6i1w1J2.js → index-z0IJb09y.js} +1 -1
  118. package/dist/client/assets/{infiniteQueryObserver-BGllKZAR.js → infiniteQueryObserver-Bc9cuK8G.js} +1 -1
  119. package/dist/client/assets/{input-CUu-drFE.js → input-CL16zv3M.js} +1 -1
  120. package/dist/client/assets/{integration-icon-D6q3hp18.js → integration-icon-CQ-NchIr.js} +1 -1
  121. package/dist/client/assets/{label-BxSv953n.js → label-DjHnY7oD.js} +1 -1
  122. package/dist/client/assets/{layout-D9O0_n5-.js → layout-R7JZk0N_.js} +1 -1
  123. package/dist/client/assets/{login-BtinjvRm.js → login-vs48ss5Y.js} +1 -1
  124. package/dist/client/assets/{members-9bhWlLnl.js → members-CR6tIRQQ.js} +1 -1
  125. package/dist/client/assets/{monaco-editor-B1H6hrQ7.js → monaco-editor-DDa2PYLr.js} +1 -1
  126. package/dist/client/assets/{monitoring-stats-row-CJK7nT7g.js → monitoring-stats-row-B5tYqizL.js} +1 -1
  127. package/dist/client/assets/{oauth-callback-hNERmzi5.js → oauth-callback-By_kYLzt.js} +1 -1
  128. package/dist/client/assets/{oauth-callback-ai-provider-12bTV2K3.js → oauth-callback-ai-provider-rjNwAMeL.js} +1 -1
  129. package/dist/client/assets/{onboarding-DjpXCG4b.js → onboarding-Cp47PQJL.js} +1 -1
  130. package/dist/client/assets/{org-install-C84qwAhG.js → org-install-J4BxDvcP.js} +1 -1
  131. package/dist/client/assets/{org-layout-C1IF22AV.js → org-layout-Uzn1aBLq.js} +1 -1
  132. package/dist/client/assets/{org-plugin-layout-B-hCG8Uv.js → org-plugin-layout-DgjfQM0j.js} +1 -1
  133. package/dist/client/assets/{page-seo-form-Cl71A8BB.js → page-seo-form-bcXUoU_e.js} +1 -1
  134. package/dist/client/assets/page-seo-sheet-Ds2n8BSC.js +1 -0
  135. package/dist/client/assets/{pair-DN3rU5fI.js → pair-CBFiuxUB.js} +1 -1
  136. package/dist/client/assets/{plugin-empty-state-osfTULg-.js → plugin-empty-state-C3zoexBS.js} +1 -1
  137. package/dist/client/assets/{plugin-header-YyMZMpGs.js → plugin-header-GIzvijnl.js} +1 -1
  138. package/dist/client/assets/{plugin-layout-BKOCCklg.js → plugin-layout-Dqb60rkf.js} +1 -1
  139. package/dist/client/assets/{popover-CH95HqFo.js → popover-CS_iXBnY.js} +1 -1
  140. package/dist/client/assets/{post-editor-caWnstD2.js → post-editor-CkT9Hn5n.js} +1 -1
  141. package/dist/client/assets/{primitives-CYYfaGAN.js → primitives-CA9Kk0m9.js} +1 -1
  142. package/dist/client/assets/{profile-C9o-RNVI.js → profile-Cl9Tf5eQ.js} +1 -1
  143. package/dist/client/assets/project-app-view-QqyHF6pe.js +1 -0
  144. package/dist/client/assets/record-editor-CuWJY7pj.js +1 -0
  145. package/dist/client/assets/registry-BfO0HF8o.js +2 -0
  146. package/dist/client/assets/{registry-layout-TnzbGAE3.js → registry-layout-DMqbdOK4.js} +1 -1
  147. package/dist/client/assets/{require-capability-BIm35L6j.js → require-capability-Ca6ka1Sn.js} +1 -1
  148. package/dist/client/assets/{required-auth-layout-DxD0Fs_0.js → required-auth-layout-aQSUe2N_.js} +1 -1
  149. package/dist/client/assets/{reset-password-BUxs2XXK.js → reset-password-BT-2N_qd.js} +1 -1
  150. package/dist/client/assets/{resizable-DELp11qo.js → resizable-B-Kg7sz_.js} +1 -1
  151. package/dist/client/assets/{roles-CqFm6K9j.js → roles-BJ71aLLv.js} +1 -1
  152. package/dist/client/assets/{save-status-XWlbhoid.js → save-status-CGb2Biez.js} +1 -1
  153. package/dist/client/assets/{schema-form-BnfXp9eD.js → schema-form-BRIUengr.js} +1 -1
  154. package/dist/client/assets/{scroll-area-B_wDwopu.js → scroll-area-CpcNn-v-.js} +1 -1
  155. package/dist/client/assets/{search-input-Dy32u4Yx.js → search-input-BmjJ0rJ1.js} +1 -1
  156. package/dist/client/assets/{secrets-CwM9vgs8.js → secrets-hp_Tfdyj.js} +1 -1
  157. package/dist/client/assets/{sections-editor-DOTPiLfV.js → sections-editor-DabUHooM.js} +1 -1
  158. package/dist/client/assets/{select-C1e50dcv.js → select-C81zuvtp.js} +1 -1
  159. package/dist/client/assets/{select-model-B7fxBb8r.js → select-model-CzLBWXoY.js} +1 -1
  160. package/dist/client/assets/{seo-editor-CywpjSiB.js → seo-editor-BU2d4emZ.js} +1 -1
  161. package/dist/client/assets/{settings-layout-Dz5plwN0.js → settings-layout-Ck0n7ap9.js} +1 -1
  162. package/dist/client/assets/{settings-section-CrtDCHpp.js → settings-section-B7fIZ_m0.js} +1 -1
  163. package/dist/client/assets/{sheet-lTSOvxho.js → sheet-D9O2scBf.js} +1 -1
  164. package/dist/client/assets/{shell-controls-BzKJJ-t7.js → shell-controls-B1uFpggl.js} +1 -1
  165. package/dist/client/assets/{shell-layout-D0i8OAWU.js → shell-layout-B5mx8HCW.js} +1 -1
  166. package/dist/client/assets/{shell-route-loading-B_ai_Hb2.js → shell-route-loading-Nvrm4NyQ.js} +1 -1
  167. package/dist/client/assets/{sidebar-Cjaut6KM.js → sidebar-DELjK07K.js} +1 -1
  168. package/dist/client/assets/{skeleton-BVkQR9ek.js → skeleton-CGcndXpH.js} +1 -1
  169. package/dist/client/assets/{sortable.esm-CgNsuB5K.js → sortable.esm-Cc5wE8Md.js} +1 -1
  170. package/dist/client/assets/{spinner-BAjOwgiW.js → spinner-DPcimsxj.js} +1 -1
  171. package/dist/client/assets/{sso-Co4mP4Ha.js → sso-CgUG1GPv.js} +1 -1
  172. package/dist/client/assets/{store-HVcQT0BU.js → store-DQ2V7yio.js} +1 -1
  173. package/dist/client/assets/store-registry-6BuBNha1.js +2 -0
  174. package/dist/client/assets/{switch-B3N-67ht.js → switch-D26GKac4.js} +1 -1
  175. package/dist/client/assets/{tab-id-QoM_GeD5.js → tab-id-B_7JAjTL.js} +1 -1
  176. package/dist/client/assets/{table-CBD1Q3-l.js → table-DP9s7KR8.js} +1 -1
  177. package/dist/client/assets/{tabs-DVFYJOQB.js → tabs-Jop0evx4.js} +1 -1
  178. package/dist/client/assets/{task-status-CG4f8Ssf.js → task-status-VzGHvxK_.js} +1 -1
  179. package/dist/client/assets/{textarea-BBLzCLOA.js → textarea-C_ciKAYv.js} +1 -1
  180. package/dist/client/assets/{toggle-group-Bpw9J7_z.js → toggle-group-CQHGgo0W.js} +1 -1
  181. package/dist/client/assets/{toolbar-CspqzRI5.js → toolbar-CO7J3Qlp.js} +1 -1
  182. package/dist/client/assets/{tools-list-xaKK1ECj.js → tools-list-CNevt541.js} +1 -1
  183. package/dist/client/assets/{tooltip-DW2J8RRA.js → tooltip-DjK_xTiM.js} +1 -1
  184. package/dist/client/assets/{types-LM2jh-lQ.js → types-BRYvxHV0.js} +1 -1
  185. package/dist/client/assets/{use-ai-providers-eErv1C43.js → use-ai-providers-CfNPOGmz.js} +1 -1
  186. package/dist/client/assets/{use-automations-HnokK13N.js → use-automations-_NxkdQLG.js} +1 -1
  187. package/dist/client/assets/{use-capability-FIcb8UxS.js → use-capability-CGr-3r92.js} +1 -1
  188. package/dist/client/assets/{use-collections-CqTjT3Mq.js → use-collections-ClKr7eLP.js} +1 -1
  189. package/dist/client/assets/{use-connection-D6Cpeajq.js → use-connection-QL9Osw0s.js} +1 -1
  190. package/dist/client/assets/{use-copy-Cw1fcUIO.js → use-copy-DR1yGhlv.js} +1 -1
  191. package/dist/client/assets/{use-create-virtual-mcp-CJC57gOy.js → use-create-virtual-mcp-B7FzzrhS.js} +1 -1
  192. package/dist/client/assets/{use-debounced-autosave-CgMlJ6Br.js → use-debounced-autosave-StOJyK5k.js} +1 -1
  193. package/dist/client/assets/{use-delete-connection-Bfeg-vSl.js → use-delete-connection-ka_zCpHH.js} +1 -1
  194. package/dist/client/assets/{use-file-configs-P699ZQaF.js → use-file-configs-bSRypY4D.js} +1 -1
  195. package/dist/client/assets/{use-infinite-scroll-DiT_tcXi.js → use-infinite-scroll-D369zKBP.js} +1 -1
  196. package/dist/client/assets/{use-list-state-BNJ-tlPA.js → use-list-state-BFEd8KAZ.js} +1 -1
  197. package/dist/client/assets/{use-mcp-prompts-2--n2jev.js → use-mcp-prompts-BthLsr-5.js} +1 -1
  198. package/dist/client/assets/{use-mcp-tools-BvO9OVFB.js → use-mcp-tools-DKqH2jvx.js} +1 -1
  199. package/dist/client/assets/{use-members-B36Y5TQt.js → use-members-CARBs-BO.js} +1 -1
  200. package/dist/client/assets/{use-navigate-to-agent-dXmSFUhJ.js → use-navigate-to-agent-bL0bZjvs.js} +1 -1
  201. package/dist/client/assets/{use-org-auth-client-CAkVEUwL.js → use-org-auth-client-B-7f7gTM.js} +1 -1
  202. package/dist/client/assets/{use-org-sso-ClqqHr-X.js → use-org-sso-CQo4DX7V.js} +1 -1
  203. package/dist/client/assets/{use-organization-roles-GUTuXgpC.js → use-organization-roles-D1jilN1C.js} +1 -1
  204. package/dist/client/assets/{use-organization-settings-0_8sPkX5.js → use-organization-settings-Ba_pVlZU.js} +1 -1
  205. package/dist/client/assets/{use-registry-connections-BYyCxXS_.js → use-registry-connections-GFs4i1bK.js} +1 -1
  206. package/dist/client/assets/{use-secrets-WmW0rqmn.js → use-secrets-ChWP1SbP.js} +1 -1
  207. package/dist/client/assets/{use-status-sounds-DaqA5e9-.js → use-status-sounds-BecbYKFZ.js} +1 -1
  208. package/dist/client/assets/{use-view-mode-C3RTWiyQ.js → use-view-mode-BC-pIybW.js} +1 -1
  209. package/dist/client/assets/{use-virtual-mcp-Bpydv1NG.js → use-virtual-mcp-B_JQogr5.js} +1 -1
  210. package/dist/client/assets/useInfiniteQuery-BdAfpOZ8.js +1 -0
  211. package/dist/client/assets/{useRouterState-DK-9Hx-j.js → useRouterState-VRTDPwLh.js} +1 -1
  212. package/dist/client/assets/useSuspenseInfiniteQuery-BNJvF6Td.js +1 -0
  213. package/dist/client/assets/{user-DgFB9DGX.js → user-DFXkwuvu.js} +1 -1
  214. package/dist/client/assets/{view-mode-toggle-DwClLpGQ.js → view-mode-toggle-B2R8JuP1.js} +1 -1
  215. package/dist/client/assets/{workflow-Cfw5Ndhx.js → workflow-ChJtcD9q.js} +1 -1
  216. package/dist/client/assets/workflow-detail-soUgf3vg.js +1 -0
  217. package/dist/client/index.html +1 -1
  218. package/dist/server/cli.js +484 -478
  219. package/dist/server/migrate.js +1 -1
  220. package/dist/server/server.js +307 -307
  221. package/package.json +1 -1
  222. package/dist/client/assets/agent-capabilities-B5uA64tf.js +0 -3
  223. package/dist/client/assets/app-editor-BBElfEes.js +0 -1
  224. package/dist/client/assets/page-seo-sheet-BEHOuaNm.js +0 -1
  225. package/dist/client/assets/project-app-view-DAOiIs80.js +0 -1
  226. package/dist/client/assets/record-editor-BPzwKRSp.js +0 -1
  227. package/dist/client/assets/registry-_ZY4UYXD.js +0 -2
  228. package/dist/client/assets/store-registry-B0_EtqCG.js +0 -2
  229. package/dist/client/assets/useInfiniteQuery-8wlNRgz7.js +0 -1
  230. package/dist/client/assets/useSuspenseInfiniteQuery-Bg_jTe-C.js +0 -1
  231. package/dist/client/assets/workflow-detail-DDad04ZD.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as w,dE as $l,bF as ju,j as O,aU as Hu,b5 as St,dF as Wu,a7 as it,a8 as Qe,bk as On,bh as Uu,bi as qu,bx as Mt,dy as Fl,ag as _l,bg as Ku,ad as ut,e as Vl,c as jl}from"./index-CpmOG_Bg.js";import{e as Ju}from"./select-C1e50dcv.js";function Q(n){this.content=n}Q.prototype={constructor:Q,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,s=r.find(n),i=r.content.slice();return s==-1?i.push(t||n,e):(i[s+1]=e,t&&(i[s]=t)),new Q(i)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Q(t)},addToStart:function(n,e){return new Q([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new Q(t)},addBefore:function(n,e,t){var r=this.remove(e),s=r.content.slice(),i=r.find(n);return s.splice(i==-1?s.length:i,0,e,t),new Q(s)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=Q.from(n),n.size?new Q(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=Q.from(n),n.size?new Q(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=Q.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};Q.from=function(n){if(n instanceof Q)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Q(e)};function Hl(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let s=n.child(r),i=e.child(r);if(s==i){t+=s.nodeSize;continue}if(!s.sameMarkup(i))return t;if(s.isText&&s.text!=i.text){for(let o=0;s.text[o]==i.text[o];o++)t++;return t}if(s.content.size||i.content.size){let o=Hl(s.content,i.content,t+1);if(o!=null)return o}t+=s.nodeSize}}function Wl(n,e,t,r){for(let s=n.childCount,i=e.childCount;;){if(s==0||i==0)return s==i?null:{a:t,b:r};let o=n.child(--s),l=e.child(--i),a=o.nodeSize;if(o==l){t-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:t,b:r};if(o.isText&&o.text!=l.text){let c=0,u=Math.min(o.text.length,l.text.length);for(;c<u&&o.text[o.text.length-c-1]==l.text[l.text.length-c-1];)c++,t--,r--;return{a:t,b:r}}if(o.content.size||l.content.size){let c=Wl(o.content,l.content,t-1,r-1);if(c)return c}t-=a,r-=a}}class k{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,s=0,i){for(let o=0,l=0;l<t;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,s+l,i||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,s+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,s){let i="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,s=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(r)&&(s[s.length-1]=t.withText(t.text+r.text),i=1);i<e.content.length;i++)s.push(e.content[i]);return new k(s,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],s=0;if(t>e)for(let i=0,o=0;o<t;i++){let l=this.content[i],a=o+l.nodeSize;a>e&&((o<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),r.push(l),s+=l.nodeSize),o=a}return new k(r,s)}cutByIndex(e,t){return e==t?k.empty:e==0&&t==this.content.length?this:new k(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let s=this.content.slice(),i=this.size+t.nodeSize-r.nodeSize;return s[e]=t,new k(s,i)}addToStart(e){return new k([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new k(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let s=this.content[t];e(s,r,t),r+=s.nodeSize}}findDiffStart(e,t=0){return Hl(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Wl(this,e,t,r)}findIndex(e){if(e==0)return Ln(0,e);if(e==this.size)return Ln(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let s=this.child(t),i=r+s.nodeSize;if(i>=e)return i==e?Ln(t+1,i):Ln(t,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return k.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new k(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return k.empty;let t,r=0;for(let s=0;s<e.length;s++){let i=e[s];r+=i.nodeSize,s&&i.isText&&e[s-1].sameMarkup(i)?(t||(t=e.slice(0,s)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new k(t||e,r)}static from(e){if(!e)return k.empty;if(e instanceof k)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new k([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}k.empty=new k([],0);const ls={index:0,offset:0};function Ln(n,e){return ls.index=n,ls.offset=e,ls}function Qn(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!Qn(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Qn(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let z=class Ps{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let s=0;s<e.length;s++){let i=e[s];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,s));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,s)),t.push(this),r=!0),t&&t.push(i)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Qn(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let s=r.create(t.attrs);return r.checkAttrs(s.attrs),s}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Ps.none;if(e instanceof Ps)return[e];let t=e.slice();return t.sort((r,s)=>r.type.rank-s.type.rank),t}};z.none=[];class Zn extends Error{}class v{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=ql(this.content,e+this.openStart,t);return r&&new v(r,this.openStart,this.openEnd)}removeBetween(e,t){return new v(Ul(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return v.empty;let r=t.openStart||0,s=t.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new v(k.fromJSON(e,t.content),r,s)}static maxOpen(e,t=!0){let r=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)s++;return new v(e,r,s)}}v.empty=new v(k.empty,0,0);function Ul(n,e,t){let{index:r,offset:s}=n.findIndex(e),i=n.maybeChild(r),{index:o,offset:l}=n.findIndex(t);if(s==e||i.isText){if(l!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,i.copy(Ul(i.content,e-s-1,t-s-1)))}function ql(n,e,t,r){let{index:s,offset:i}=n.findIndex(e),o=n.maybeChild(s);if(i==e||o.isText)return r&&!r.canReplace(s,s,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=ql(o.content,e-i-1,t,o);return l&&n.replaceChild(s,o.copy(l))}function Gu(n,e,t){if(t.openStart>n.depth)throw new Zn("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new Zn("Inconsistent open depths");return Kl(n,e,t,0)}function Kl(n,e,t,r){let s=n.index(r),i=n.node(r);if(s==e.index(r)&&r<n.depth-t.openStart){let o=Kl(n,e,t,r+1);return i.copy(i.content.replaceChild(s,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let o=n.parent,l=o.content;return yt(o,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=Yu(t,n);return yt(i,Gl(n,o,l,e,r))}else return yt(i,er(n,e,r))}function Jl(n,e){if(!e.type.compatibleContent(n.type))throw new Zn("Cannot join "+e.type.name+" onto "+n.type.name)}function Ls(n,e,t){let r=n.node(t);return Jl(r,e.node(t)),r}function gt(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function an(n,e,t,r){let s=(e||n).node(t),i=0,o=e?e.index(t):s.childCount;n&&(i=n.index(t),n.depth>t?i++:n.textOffset&&(gt(n.nodeAfter,r),i++));for(let l=i;l<o;l++)gt(s.child(l),r);e&&e.depth==t&&e.textOffset&&gt(e.nodeBefore,r)}function yt(n,e){return n.type.checkContent(e),n.copy(e)}function Gl(n,e,t,r,s){let i=n.depth>s&&Ls(n,e,s+1),o=r.depth>s&&Ls(t,r,s+1),l=[];return an(null,n,s,l),i&&o&&e.index(s)==t.index(s)?(Jl(i,o),gt(yt(i,Gl(n,e,t,r,s+1)),l)):(i&&gt(yt(i,er(n,e,s+1)),l),an(e,t,s,l),o&&gt(yt(o,er(t,r,s+1)),l)),an(r,null,s,l),new k(l)}function er(n,e,t){let r=[];if(an(null,n,t,r),n.depth>t){let s=Ls(n,e,t+1);gt(yt(s,er(n,e,t+1)),r)}return an(e,null,t,r),new k(r)}function Yu(n,e){let t=e.depth-n.openStart,s=e.node(t).copy(n.content);for(let i=t-1;i>=0;i--)s=e.node(i).copy(k.from(s));return{start:s.resolveNoCache(n.openStart+t),end:s.resolveNoCache(s.content.size-n.openEnd-t)}}class kn{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(t);return r?e.child(t).cut(r):s}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],s=t==0?0:this.path[t*3-1]+1;for(let i=0;i<e;i++)s+=r.child(i).nodeSize;return s}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return z.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),s=e.maybeChild(t);if(!r){let l=r;r=s,s=l}let i=r.marks;for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!s||!i[o].isInSet(s.marks))&&(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,s=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!s||!r[i].isInSet(s.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new tr(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],s=0,i=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(i),c=i-a;if(r.push(o,l,s+a),!c||(o=o.child(l),o.isText))break;i=c-1,s+=a+1}return new kn(t,r,i)}static resolveCached(e,t){let r=so.get(e);if(r)for(let i=0;i<r.elts.length;i++){let o=r.elts[i];if(o.pos==t)return o}else so.set(e,r=new Xu);let s=r.elts[r.i]=kn.resolve(e,t);return r.i=(r.i+1)%Qu,s}}class Xu{constructor(){this.elts=[],this.i=0}}const Qu=12,so=new WeakMap;class tr{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Zu=Object.create(null);class Ee{constructor(e,t,r,s=z.none){this.type=e,this.attrs=t,this.marks=s,this.content=r||k.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,s=0){this.content.nodesBetween(e,t,r,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,s){return this.content.textBetween(e,t,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&Qn(this.attrs,t||e.defaultAttrs||Zu)&&z.sameSet(this.marks,r||z.none)}copy(e=null){return e==this.content?this:new Ee(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Ee(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return v.empty;let s=this.resolve(e),i=this.resolve(t),o=r?0:s.sharedDepth(t),l=s.start(o),c=s.node(o).content.cut(s.pos-l,i.pos-l);return new v(c,s.depth-o,i.depth-o)}replace(e,t,r){return Gu(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:s}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(s==e||t.isText)return t;e-=s+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let s=this.content.child(t-1);return{node:s,index:t-1,offset:r-s.nodeSize}}resolve(e){return kn.resolveCached(this,e)}resolveNoCache(e){return kn.resolve(this,e)}rangeHasMark(e,t,r){let s=!1;return t>e&&this.nodesBetween(e,t,i=>(r.isInSet(i.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Yl(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=k.empty,s=0,i=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,s,i),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=s;a<i;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,t,r,s){if(s&&!this.type.allowsMarks(s))return!1;let i=this.contentMatchAt(e).matchType(r),o=i&&i.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=z.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!z.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let s=k.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,s,r);return i.type.checkAttrs(i.attrs),i}}Ee.prototype.text=void 0;class nr extends Ee{constructor(e,t,r,s){if(super(e,t,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Yl(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new nr(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new nr(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Yl(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class wt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new ed(e,t);if(r.next==null)return wt.empty;let s=Xl(r);r.next&&r.err("Unexpected trailing text");let i=ld(od(s));return ad(i,r),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let s=this;for(let i=t;s&&i<r;i++)s=s.matchType(e.child(i).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let s=[this];function i(o,l){let a=o.matchFragment(e,r);if(a&&(!t||a.validEnd))return k.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(d)==-1){s.push(d);let f=i(d,l.concat(u));if(f)return f}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),i=s.match;if(i.matchType(e)){let o=[];for(let l=s;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<i.next.length;o++){let{type:l,next:a}=i.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!s.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:s}),t[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&t(r.next[s].next)}return t(this),e.map((r,s)=>{let i=s+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)i+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return i}).join(`
1
+ import{r as w,dE as $l,bF as ju,j as O,aU as Hu,b5 as St,dF as Wu,a7 as it,a8 as Qe,bk as On,bh as Uu,bi as qu,bx as Mt,dy as Fl,ag as _l,bg as Ku,ad as ut,e as Vl,c as jl}from"./index-D6_5HAZl.js";import{e as Ju}from"./select-C81zuvtp.js";function Q(n){this.content=n}Q.prototype={constructor:Q,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,s=r.find(n),i=r.content.slice();return s==-1?i.push(t||n,e):(i[s+1]=e,t&&(i[s]=t)),new Q(i)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Q(t)},addToStart:function(n,e){return new Q([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new Q(t)},addBefore:function(n,e,t){var r=this.remove(e),s=r.content.slice(),i=r.find(n);return s.splice(i==-1?s.length:i,0,e,t),new Q(s)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=Q.from(n),n.size?new Q(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=Q.from(n),n.size?new Q(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=Q.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};Q.from=function(n){if(n instanceof Q)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Q(e)};function Hl(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let s=n.child(r),i=e.child(r);if(s==i){t+=s.nodeSize;continue}if(!s.sameMarkup(i))return t;if(s.isText&&s.text!=i.text){for(let o=0;s.text[o]==i.text[o];o++)t++;return t}if(s.content.size||i.content.size){let o=Hl(s.content,i.content,t+1);if(o!=null)return o}t+=s.nodeSize}}function Wl(n,e,t,r){for(let s=n.childCount,i=e.childCount;;){if(s==0||i==0)return s==i?null:{a:t,b:r};let o=n.child(--s),l=e.child(--i),a=o.nodeSize;if(o==l){t-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:t,b:r};if(o.isText&&o.text!=l.text){let c=0,u=Math.min(o.text.length,l.text.length);for(;c<u&&o.text[o.text.length-c-1]==l.text[l.text.length-c-1];)c++,t--,r--;return{a:t,b:r}}if(o.content.size||l.content.size){let c=Wl(o.content,l.content,t-1,r-1);if(c)return c}t-=a,r-=a}}class k{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,s=0,i){for(let o=0,l=0;l<t;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,s+l,i||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,s+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,s){let i="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,s=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(r)&&(s[s.length-1]=t.withText(t.text+r.text),i=1);i<e.content.length;i++)s.push(e.content[i]);return new k(s,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],s=0;if(t>e)for(let i=0,o=0;o<t;i++){let l=this.content[i],a=o+l.nodeSize;a>e&&((o<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),r.push(l),s+=l.nodeSize),o=a}return new k(r,s)}cutByIndex(e,t){return e==t?k.empty:e==0&&t==this.content.length?this:new k(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let s=this.content.slice(),i=this.size+t.nodeSize-r.nodeSize;return s[e]=t,new k(s,i)}addToStart(e){return new k([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new k(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let s=this.content[t];e(s,r,t),r+=s.nodeSize}}findDiffStart(e,t=0){return Hl(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Wl(this,e,t,r)}findIndex(e){if(e==0)return Ln(0,e);if(e==this.size)return Ln(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let s=this.child(t),i=r+s.nodeSize;if(i>=e)return i==e?Ln(t+1,i):Ln(t,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return k.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new k(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return k.empty;let t,r=0;for(let s=0;s<e.length;s++){let i=e[s];r+=i.nodeSize,s&&i.isText&&e[s-1].sameMarkup(i)?(t||(t=e.slice(0,s)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new k(t||e,r)}static from(e){if(!e)return k.empty;if(e instanceof k)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new k([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}k.empty=new k([],0);const ls={index:0,offset:0};function Ln(n,e){return ls.index=n,ls.offset=e,ls}function Qn(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!Qn(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Qn(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let z=class Ps{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let s=0;s<e.length;s++){let i=e[s];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,s));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,s)),t.push(this),r=!0),t&&t.push(i)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Qn(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let s=r.create(t.attrs);return r.checkAttrs(s.attrs),s}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Ps.none;if(e instanceof Ps)return[e];let t=e.slice();return t.sort((r,s)=>r.type.rank-s.type.rank),t}};z.none=[];class Zn extends Error{}class v{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=ql(this.content,e+this.openStart,t);return r&&new v(r,this.openStart,this.openEnd)}removeBetween(e,t){return new v(Ul(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return v.empty;let r=t.openStart||0,s=t.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new v(k.fromJSON(e,t.content),r,s)}static maxOpen(e,t=!0){let r=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)s++;return new v(e,r,s)}}v.empty=new v(k.empty,0,0);function Ul(n,e,t){let{index:r,offset:s}=n.findIndex(e),i=n.maybeChild(r),{index:o,offset:l}=n.findIndex(t);if(s==e||i.isText){if(l!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,i.copy(Ul(i.content,e-s-1,t-s-1)))}function ql(n,e,t,r){let{index:s,offset:i}=n.findIndex(e),o=n.maybeChild(s);if(i==e||o.isText)return r&&!r.canReplace(s,s,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=ql(o.content,e-i-1,t,o);return l&&n.replaceChild(s,o.copy(l))}function Gu(n,e,t){if(t.openStart>n.depth)throw new Zn("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new Zn("Inconsistent open depths");return Kl(n,e,t,0)}function Kl(n,e,t,r){let s=n.index(r),i=n.node(r);if(s==e.index(r)&&r<n.depth-t.openStart){let o=Kl(n,e,t,r+1);return i.copy(i.content.replaceChild(s,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let o=n.parent,l=o.content;return yt(o,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=Yu(t,n);return yt(i,Gl(n,o,l,e,r))}else return yt(i,er(n,e,r))}function Jl(n,e){if(!e.type.compatibleContent(n.type))throw new Zn("Cannot join "+e.type.name+" onto "+n.type.name)}function Ls(n,e,t){let r=n.node(t);return Jl(r,e.node(t)),r}function gt(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function an(n,e,t,r){let s=(e||n).node(t),i=0,o=e?e.index(t):s.childCount;n&&(i=n.index(t),n.depth>t?i++:n.textOffset&&(gt(n.nodeAfter,r),i++));for(let l=i;l<o;l++)gt(s.child(l),r);e&&e.depth==t&&e.textOffset&&gt(e.nodeBefore,r)}function yt(n,e){return n.type.checkContent(e),n.copy(e)}function Gl(n,e,t,r,s){let i=n.depth>s&&Ls(n,e,s+1),o=r.depth>s&&Ls(t,r,s+1),l=[];return an(null,n,s,l),i&&o&&e.index(s)==t.index(s)?(Jl(i,o),gt(yt(i,Gl(n,e,t,r,s+1)),l)):(i&&gt(yt(i,er(n,e,s+1)),l),an(e,t,s,l),o&&gt(yt(o,er(t,r,s+1)),l)),an(r,null,s,l),new k(l)}function er(n,e,t){let r=[];if(an(null,n,t,r),n.depth>t){let s=Ls(n,e,t+1);gt(yt(s,er(n,e,t+1)),r)}return an(e,null,t,r),new k(r)}function Yu(n,e){let t=e.depth-n.openStart,s=e.node(t).copy(n.content);for(let i=t-1;i>=0;i--)s=e.node(i).copy(k.from(s));return{start:s.resolveNoCache(n.openStart+t),end:s.resolveNoCache(s.content.size-n.openEnd-t)}}class kn{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(t);return r?e.child(t).cut(r):s}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],s=t==0?0:this.path[t*3-1]+1;for(let i=0;i<e;i++)s+=r.child(i).nodeSize;return s}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return z.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),s=e.maybeChild(t);if(!r){let l=r;r=s,s=l}let i=r.marks;for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!s||!i[o].isInSet(s.marks))&&(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,s=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!s||!r[i].isInSet(s.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new tr(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],s=0,i=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(i),c=i-a;if(r.push(o,l,s+a),!c||(o=o.child(l),o.isText))break;i=c-1,s+=a+1}return new kn(t,r,i)}static resolveCached(e,t){let r=so.get(e);if(r)for(let i=0;i<r.elts.length;i++){let o=r.elts[i];if(o.pos==t)return o}else so.set(e,r=new Xu);let s=r.elts[r.i]=kn.resolve(e,t);return r.i=(r.i+1)%Qu,s}}class Xu{constructor(){this.elts=[],this.i=0}}const Qu=12,so=new WeakMap;class tr{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Zu=Object.create(null);class Ee{constructor(e,t,r,s=z.none){this.type=e,this.attrs=t,this.marks=s,this.content=r||k.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,s=0){this.content.nodesBetween(e,t,r,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,s){return this.content.textBetween(e,t,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&Qn(this.attrs,t||e.defaultAttrs||Zu)&&z.sameSet(this.marks,r||z.none)}copy(e=null){return e==this.content?this:new Ee(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Ee(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return v.empty;let s=this.resolve(e),i=this.resolve(t),o=r?0:s.sharedDepth(t),l=s.start(o),c=s.node(o).content.cut(s.pos-l,i.pos-l);return new v(c,s.depth-o,i.depth-o)}replace(e,t,r){return Gu(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:s}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(s==e||t.isText)return t;e-=s+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let s=this.content.child(t-1);return{node:s,index:t-1,offset:r-s.nodeSize}}resolve(e){return kn.resolveCached(this,e)}resolveNoCache(e){return kn.resolve(this,e)}rangeHasMark(e,t,r){let s=!1;return t>e&&this.nodesBetween(e,t,i=>(r.isInSet(i.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Yl(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=k.empty,s=0,i=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,s,i),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=s;a<i;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,t,r,s){if(s&&!this.type.allowsMarks(s))return!1;let i=this.contentMatchAt(e).matchType(r),o=i&&i.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=z.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!z.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let s=k.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,s,r);return i.type.checkAttrs(i.attrs),i}}Ee.prototype.text=void 0;class nr extends Ee{constructor(e,t,r,s){if(super(e,t,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Yl(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new nr(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new nr(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Yl(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class wt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new ed(e,t);if(r.next==null)return wt.empty;let s=Xl(r);r.next&&r.err("Unexpected trailing text");let i=ld(od(s));return ad(i,r),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let s=this;for(let i=t;s&&i<r;i++)s=s.matchType(e.child(i).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let s=[this];function i(o,l){let a=o.matchFragment(e,r);if(a&&(!t||a.validEnd))return k.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(d)==-1){s.push(d);let f=i(d,l.concat(u));if(f)return f}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),i=s.match;if(i.matchType(e)){let o=[];for(let l=s;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<i.next.length;o++){let{type:l,next:a}=i.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!s.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:s}),t[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&t(r.next[s].next)}return t(this),e.map((r,s)=>{let i=s+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)i+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return i}).join(`
2
2
  `)}}wt.empty=new wt(!0);class ed{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Xl(n){let e=[];do e.push(td(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function td(n){let e=[];do e.push(nd(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function nd(n){let e=id(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=rd(n,e);else break;return e}function io(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function rd(n,e){let t=io(n),r=t;return n.eat(",")&&(n.next!="}"?r=io(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function sd(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let s=[];for(let i in t){let o=t[i];o.isInGroup(e)&&s.push(o)}return s.length==0&&n.err("No node type or group '"+e+"' found"),s}function id(n){if(n.eat("(")){let e=Xl(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=sd(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function od(n){let e=[[]];return s(i(n,0),t()),e;function t(){return e.push([])-1}function r(o,l,a){let c={term:a,to:l};return e[o].push(c),c}function s(o,l){o.forEach(a=>a.to=l)}function i(o,l){if(o.type=="choice")return o.exprs.reduce((a,c)=>a.concat(i(c,l)),[]);if(o.type=="seq")for(let a=0;;a++){let c=i(o.exprs[a],l);if(a==o.exprs.length-1)return c;s(c,l=t())}else if(o.type=="star"){let a=t();return r(l,a),s(i(o.expr,a),a),[r(a)]}else if(o.type=="plus"){let a=t();return s(i(o.expr,l),a),s(i(o.expr,a),a),[r(a)]}else{if(o.type=="opt")return[r(l)].concat(i(o.expr,l));if(o.type=="range"){let a=l;for(let c=0;c<o.min;c++){let u=t();s(i(o.expr,a),u),a=u}if(o.max==-1)s(i(o.expr,a),a);else for(let c=o.min;c<o.max;c++){let u=t();r(a,u),s(i(o.expr,a),u),a=u}return[r(a)]}else{if(o.type=="name")return[r(l,void 0,o.value)];throw new Error("Unknown expr type")}}}}function Ql(n,e){return e-n}function oo(n,e){let t=[];return r(e),t.sort(Ql);function r(s){let i=n[s];if(i.length==1&&!i[0].term)return r(i[0].to);t.push(s);for(let o=0;o<i.length;o++){let{term:l,to:a}=i[o];!l&&t.indexOf(a)==-1&&r(a)}}}function ld(n){let e=Object.create(null);return t(oo(n,0));function t(r){let s=[];r.forEach(o=>{n[o].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u<s.length;u++)s[u][0]==l&&(c=s[u][1]);oo(n,a).forEach(u=>{c||s.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=e[r.join(",")]=new wt(r.indexOf(n.length-1)>-1);for(let o=0;o<s.length;o++){let l=s[o][1].sort(Ql);i.next.push({type:s[o][0],next:e[l.join(",")]||t(l)})}return i}}function ad(n,e){for(let t=0,r=[n];t<r.length;t++){let s=r[t],i=!s.validEnd,o=[];for(let l=0;l<s.next.length;l++){let{type:a,next:c}=s.next[l];o.push(a.name),i&&!(a.isText||a.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Zl(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function ea(n,e){let t=Object.create(null);for(let r in n){let s=e&&e[r];if(s===void 0){let i=n[r];if(i.hasDefault)s=i.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=s}return t}function ta(n,e,t,r){for(let s in e)if(!(s in n))throw new RangeError(`Unsupported attribute ${s} for ${t} of type ${s}`);for(let s in n){let i=n[s];i.validate&&i.validate(e[s])}}function na(n,e){let t=Object.create(null);if(e)for(let r in e)t[r]=new ud(n,r,e[r]);return t}let lo=class ra{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=na(e,r.attrs),this.defaultAttrs=Zl(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==wt.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:ea(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Ee(this,this.computeAttrs(e),k.from(t),z.setFrom(r))}createChecked(e=null,t,r){return t=k.from(t),this.checkContent(t),new Ee(this,this.computeAttrs(e),t,z.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=k.from(t),t.size){let o=this.contentMatch.fillBefore(t);if(!o)return null;t=o.append(t)}let s=this.contentMatch.matchFragment(t),i=s&&s.fillBefore(k.empty,!0);return i?new Ee(this,e,t.append(i),z.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){ta(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:z.none:e}static compile(e,t){let r=Object.create(null);e.forEach((i,o)=>r[i]=new ra(i,t,o));let s=t.spec.topNode||"doc";if(!r[s])throw new RangeError("Schema is missing its top node type ('"+s+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function cd(n,e,t){let r=t.split("|");return s=>{let i=s===null?"null":typeof s;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${i}`)}}class ud{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?cd(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class jr{constructor(e,t,r,s){this.name=e,this.rank=t,this.schema=r,this.spec=s,this.attrs=na(e,s.attrs),this.excluded=null;let i=Zl(this.attrs);this.instance=i?new z(this,i):null}create(e=null){return!e&&this.instance?this.instance:new z(this,ea(this.attrs,e))}static compile(e,t){let r=Object.create(null),s=0;return e.forEach((i,o)=>r[i]=new jr(i,s++,t,o)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){ta(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class sa{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let s in e)t[s]=e[s];t.nodes=Q.from(e.nodes),t.marks=Q.from(e.marks||{}),this.nodes=lo.compile(this.spec.nodes,this),this.marks=jr.compile(this.spec.marks,this);let r=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");let i=this.nodes[s],o=i.spec.content||"",l=i.spec.marks;if(i.contentMatch=r[o]||(r[o]=wt.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=l=="_"?null:l?ao(this,l.split(" ")):l==""||!i.inlineContent?[]:null}for(let s in this.marks){let i=this.marks[s],o=i.spec.excludes;i.excluded=o==null?[i]:o==""?[]:ao(this,o.split(" "))}this.nodeFromJSON=s=>Ee.fromJSON(this,s),this.markFromJSON=s=>z.fromJSON(this,s),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,s){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof lo){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,s)}text(e,t){let r=this.nodes.text;return new nr(r,r.defaultAttrs,e,z.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function ao(n,e){let t=[];for(let r=0;r<e.length;r++){let s=e[r],i=n.marks[s],o=i;if(i)t.push(i);else for(let l in n.marks){let a=n.marks[l];(s=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(s)>-1)&&t.push(o=a)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function dd(n){return n.tag!=null}function fd(n){return n.style!=null}class Ze{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(s=>{if(dd(s))this.tags.push(s);else if(fd(s)){let i=/[^=]*/.exec(s.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(s)}}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let i=e.nodes[s.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let r=new uo(this,t,!1);return r.addAll(e,z.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new uo(this,t,!0);return r.addAll(e,z.none,t.from,t.to),v.maxOpen(r.finish())}matchTag(e,t,r){for(let s=r?this.tags.indexOf(r)+1:0;s<this.tags.length;s++){let i=this.tags[s];if(md(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||t.matchesContext(i.context))){if(i.getAttrs){let o=i.getAttrs(e);if(o===!1)continue;i.attrs=o||void 0}return i}}}matchStyle(e,t,r,s){for(let i=s?this.styles.indexOf(s)+1:0;i<this.styles.length;i++){let o=this.styles[i],l=o.style;if(!(l.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let t=[];function r(s){let i=s.priority==null?50:s.priority,o=0;for(;o<t.length;o++){let l=t[o];if((l.priority==null?50:l.priority)<i)break}t.splice(o,0,s)}for(let s in e.marks){let i=e.marks[s].spec.parseDOM;i&&i.forEach(o=>{r(o=fo(o)),o.mark||o.ignore||o.clearMark||(o.mark=s)})}for(let s in e.nodes){let i=e.nodes[s].spec.parseDOM;i&&i.forEach(o=>{r(o=fo(o)),o.node||o.ignore||o.mark||(o.node=s)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Ze(e,Ze.schemaRules(e)))}}const ia={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},hd={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},oa={ol:!0,ul:!0},xn=1,Bs=2,cn=4;function co(n,e,t){return e!=null?(e?xn:0)|(e==="full"?Bs:0):n&&n.whitespace=="pre"?xn|Bs:t&~cn}class Bn{constructor(e,t,r,s,i,o){this.type=e,this.attrs=t,this.marks=r,this.solid=s,this.options=o,this.content=[],this.activeMarks=z.none,this.match=i||(o&cn?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(k.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,s;return(s=r.findWrapping(e.type))?(this.match=r,s):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&xn)){let r=this.content[this.content.length-1],s;if(r&&r.isText&&(s=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==s[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-s[0].length))}}let t=k.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(k.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!ia.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class uo{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let s=t.topNode,i,o=co(null,t.preserveWhitespace,0)|(r?cn:0);s?i=new Bn(s.type,s.attrs,z.none,!0,t.topMatch||s.type.contentMatch,o):r?i=new Bn(null,null,z.none,!0,null,o):i=new Bn(e.schema.topNodeType,null,z.none,!0,null,o),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,s=this.top,i=s.options&Bs?"full":this.localPreserveWS||(s.options&xn)>0,{schema:o}=this.parser;if(i==="full"||s.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)if(i==="full")r=r.replace(/\r\n?/g,`
3
3
  `);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let a=0;a<l.length;a++)a&&this.insertNode(o.linebreakReplacement.create(),t,!0),l[a]&&this.insertNode(o.text(l[a]),t,!/\S/.test(l[a]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let l=s.content[s.content.length-1],a=e.previousSibling;(!l||a&&a.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(r=r.slice(1))}r&&this.insertNode(o.text(r),t,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let s=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),l;oa.hasOwnProperty(o)&&this.parser.normalizeLists&&pd(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(a?a.ignore:hd.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let c,u=this.needsBlock;if(ia.hasOwnProperty(o))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),c=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let d=a&&a.skip?t:this.readStyles(e,t);d&&this.addAll(e,d),c&&this.sync(i),this.needsBlock=u}else{let c=this.readStyles(e,t);c&&this.addElementByRule(e,a,c,a.consuming===!1?l:void 0)}this.localPreserveWS=s}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
4
4
  `),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let r=e.style;if(r&&r.length)for(let s=0;s<this.parser.matchedStyles.length;s++){let i=this.parser.matchedStyles[s],o=r.getPropertyValue(i);if(o)for(let l=void 0;;){let a=this.parser.matchStyle(i,o,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?t=t.filter(c=>!a.clearMark(c)):t=t.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return t}addElementByRule(e,t,r,s){let i,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let a=this.enter(o,t.attrs||null,r,t.preserveWhitespace);a&&(i=!0,r=a)}else{let a=this.parser.schema.marks[t.mark];r=r.concat(a.create(t.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(s)this.addElement(e,r,s);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}i&&this.sync(l)&&this.open--}addAll(e,t,r,s){let i=r||0;for(let o=r?e.childNodes[r]:e.firstChild,l=s==null?null:e.childNodes[s];o!=l;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o,t);this.findAtPoint(e,i)}findPlace(e,t,r){let s,i;for(let o=this.open,l=0;o>=0;o--){let a=this.nodes[o],c=a.findWrapping(e);if(c&&(!s||s.length>c.length+l)&&(s=c,i=a,!c.length))break;if(a.solid){if(r)break;l+=2}}if(!s)return null;this.sync(i);for(let o=0;o<s.length;o++)t=this.enterInner(s[o],null,t,!1);return t}insertNode(e,t,r){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(t=this.enterInner(i,null,t))}let s=this.findPlace(e,t,r);if(s){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let o=z.none;for(let l of s.concat(e.marks))(i.type?i.type.allowsMarkType(l.type):ho(l.type,e.type))&&(o=l.addToSet(o));return i.content.push(e.mark(o)),!0}return!1}enter(e,t,r,s){let i=this.findPlace(e.create(t),r,!1);return i&&(i=this.enterInner(e,t,r,!0,s)),i}enterInner(e,t,r,s=!1,i){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let l=co(e,i,o.options);o.options&cn&&o.content.length==0&&(l|=cn);let a=z.none;return r=r.filter(c=>(o.type?o.type.allowsMarkType(c.type):ho(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new Bn(e,t,a,s,null,l)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=xn)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let s=r.length-1;s>=0;s--)e+=r[s].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let s=0;s<this.find.length;s++)this.find[s].pos==null&&e.nodeType==1&&e.contains(this.find[s].node)&&t.compareDocumentPosition(this.find[s].node)&(r?2:4)&&(this.find[s].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,s=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(s?0:1),o=(l,a)=>{for(;l>=0;l--){let c=t[l];if(c==""){if(l==t.length-1||l==0)continue;for(;a>=i;a--)if(o(l-1,a))return!0;return!1}else{let u=a>0||a==0&&s?this.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;a--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}}function pd(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&oa.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function md(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function fo(n){let e={};for(let t in n)e[t]=n[t];return e}function ho(n,e){let t=e.schema.nodes;for(let r in t){let s=t[r];if(!s.allowsMarkType(n))continue;let i=[],o=l=>{i.push(l);for(let a=0;a<l.edgeCount;a++){let{type:c,next:u}=l.edge(a);if(c==e||i.indexOf(u)<0&&o(u))return!0}};if(o(s.contentMatch))return!0}}class At{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=as(t).createDocumentFragment());let s=r,i=[];return e.forEach(o=>{if(i.length||o.marks.length){let l=0,a=0;for(;l<i.length&&a<o.marks.length;){let c=o.marks[a];if(!this.marks[c.type.name]){a++;continue}if(!c.eq(i[l][0])||c.type.spec.spanning===!1)break;l++,a++}for(;l<i.length;)s=i.pop()[1];for(;a<o.marks.length;){let c=o.marks[a++],u=this.serializeMark(c,o.isInline,t);u&&(i.push([c,s]),s.appendChild(u.dom),s=u.contentDOM||u.dom)}}s.appendChild(this.serializeNodeInner(o,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:s}=Kn(as(t),this.nodes[e.type.name](e),null,e.attrs);if(s){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,s)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let s=e.marks.length-1;s>=0;s--){let i=this.serializeMark(e.marks[s],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,t,r={}){let s=this.marks[e.type.name];return s&&Kn(as(r),s(e,t),null,e.attrs)}static renderSpec(e,t,r=null,s){return Kn(e,t,r,s)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new At(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=po(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return po(e.marks)}}function po(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function as(n){return n.document||window.document}const mo=new WeakMap;function gd(n){let e=mo.get(n);return e===void 0&&mo.set(n,e=yd(n)),e}function yd(n){let e=null;function t(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let s=0;s<r.length;s++)t(r[s]);else for(let s in r)t(r[s])}return t(n),e}function Kn(n,e,t,r){if(typeof e=="string")return{dom:n.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let s=e[0],i;if(typeof s!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=gd(r))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=s.indexOf(" ");o>0&&(t=s.slice(0,o),s=s.slice(o+1));let l,a=t?n.createElementNS(t,s):n.createElement(s),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):d=="style"&&a.style?a.style.cssText=c[d]:a.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let f=e[d];if(f===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:h,contentDOM:p}=Kn(n,f,t,r);if(a.appendChild(h),p){if(l)throw new RangeError("Multiple content holes");l=p}}}return{dom:a,contentDOM:l}}const la=65535,aa=Math.pow(2,16);function bd(n,e){return n+e*aa}function go(n){return n&la}function kd(n){return(n-(n&la))/aa}const ca=1,ua=2,Jn=4,da=8;class zs{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&da)>0}get deletedBefore(){return(this.delInfo&(ca|Jn))>0}get deletedAfter(){return(this.delInfo&(ua|Jn))>0}get deletedAcross(){return(this.delInfo&Jn)>0}}class fe{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&fe.empty)return fe.empty}recover(e){let t=0,r=go(e);if(!this.inverted)for(let s=0;s<r;s++)t+=this.ranges[s*3+2]-this.ranges[s*3+1];return this.ranges[r*3]+t+kd(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let s=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?s:0);if(a>e)break;let c=this.ranges[l+i],u=this.ranges[l+o],d=a+c;if(e<=d){let f=c?e==a?-1:e==d?1:t:t,h=a+s+(f<0?0:u);if(r)return h;let p=e==(t<0?a:d)?null:bd(l/3,e-a),m=e==a?ua:e==d?ca:Jn;return(t<0?e!=a:e!=d)&&(m|=da),new zs(h,m,p)}s+=u-c}return r?e+s:new zs(e+s,0,null)}touches(e,t){let r=0,s=go(t),i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?r:0);if(a>e)break;let c=this.ranges[l+i],u=a+c;if(e<=u&&l==s*3)return!0;r+=this.ranges[l+o]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let s=0,i=0;s<this.ranges.length;s+=3){let o=this.ranges[s],l=o-(this.inverted?i:0),a=o+(this.inverted?0:i),c=this.ranges[s+t],u=this.ranges[s+r];e(l,l+c,a,a+u),i+=u-c}}invert(){return new fe(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?fe.empty:new fe(e<0?[0,-e,0]:[0,0,e])}}fe.empty=new fe([]);class Sn{constructor(e,t,r=0,s=e?e.length:0){this.mirror=t,this.from=r,this.to=s,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new Sn(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,r=this._maps.length;t<e._maps.length;t++){let s=e.getMirror(t);this.appendMap(e._maps[t],s!=null&&s<t?r+s:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this._maps.length+e._maps.length;t>=0;t--){let s=e.getMirror(t);this.appendMap(e._maps[t].invert(),s!=null&&s>t?r-s-1:void 0)}}invert(){let e=new Sn;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let s=0;for(let i=this.from;i<this.to;i++){let o=this._maps[i],l=o.mapResult(e,t);if(l.recover!=null){let a=this.getMirror(i);if(a!=null&&a>i&&a<this.to){i=a,e=this._maps[a].recover(l.recover);continue}}s|=l.delInfo,e=l.pos}return r?e:new zs(e,s,null)}}const cs=Object.create(null);class se{getMap(){return fe.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=cs[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in cs)throw new RangeError("Duplicate use of step JSON ID "+e);return cs[e]=t,t.prototype.jsonID=e,t}}class q{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new q(e,null)}static fail(e){return new q(null,e)}static fromReplace(e,t,r,s){try{return q.ok(e.replace(t,r,s))}catch(i){if(i instanceof Zn)return q.fail(i.message);throw i}}}function di(n,e,t){let r=[];for(let s=0;s<n.childCount;s++){let i=n.child(s);i.content.size&&(i=i.copy(di(i.content,e,i))),i.isInline&&(i=e(i,t,s)),r.push(i)}return k.fromArray(r)}class Ge extends se{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),s=r.node(r.sharedDepth(this.to)),i=new v(di(t.content,(o,l)=>!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),s),t.openStart,t.openEnd);return q.fromReplace(e,this.from,this.to,i)}invert(){return new ve(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Ge(t.pos,r.pos,this.mark)}merge(e){return e instanceof Ge&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ge(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ge(t.from,t.to,e.markFromJSON(t.mark))}}se.jsonID("addMark",Ge);class ve extends se{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new v(di(t.content,s=>s.mark(this.mark.removeFromSet(s.marks)),e),t.openStart,t.openEnd);return q.fromReplace(e,this.from,this.to,r)}invert(){return new Ge(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new ve(t.pos,r.pos,this.mark)}merge(e){return e instanceof ve&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ve(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new ve(t.from,t.to,e.markFromJSON(t.mark))}}se.jsonID("removeMark",ve);class Ye extends se{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return q.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return q.fromReplace(e,this.pos,this.pos+1,new v(k.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let s=0;s<t.marks.length;s++)if(!t.marks[s].isInSet(r))return new Ye(this.pos,t.marks[s]);return new Ye(this.pos,this.mark)}}return new Ct(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Ye(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Ye(t.pos,e.markFromJSON(t.mark))}}se.jsonID("addNodeMark",Ye);class Ct extends se{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return q.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return q.fromReplace(e,this.pos,this.pos+1,new v(k.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Ye(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Ct(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Ct(t.pos,e.markFromJSON(t.mark))}}se.jsonID("removeNodeMark",Ct);class U extends se{constructor(e,t,r,s=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=s}apply(e){return this.structure&&$s(e,this.from,this.to)?q.fail("Structure replace would overwrite content"):q.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new fe([this.from,this.to-this.from,this.slice.size])}invert(e){return new U(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.to,-1),r=this.from==this.to&&U.MAP_BIAS<0?t:e.mapResult(this.from,1);return r.deletedAcross&&t.deletedAcross?null:new U(r.pos,Math.max(r.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof U)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?v.empty:new v(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new U(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?v.empty:new v(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new U(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new U(t.from,t.to,v.fromJSON(e,t.slice),!!t.structure)}}U.MAP_BIAS=1;se.jsonID("replace",U);class Y extends se{constructor(e,t,r,s,i,o,l=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=s,this.slice=i,this.insert=o,this.structure=l}apply(e){if(this.structure&&($s(e,this.from,this.gapFrom)||$s(e,this.gapTo,this.to)))return q.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return q.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?q.fromReplace(e,this.from,this.to,r):q.fail("Content does not fit in gap")}getMap(){return new fe([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new Y(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),s=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||s<t.pos||i>r.pos?null:new Y(t.pos,r.pos,s,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Y(t.from,t.to,t.gapFrom,t.gapTo,v.fromJSON(e,t.slice),t.insert,!!t.structure)}}se.jsonID("replaceAround",Y);function $s(n,e,t){let r=n.resolve(e),s=t-e,i=r.depth;for(;s>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,s--;if(s>0){let o=r.node(i).maybeChild(r.indexAfter(i));for(;s>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,s--}}return!1}function xd(n,e,t,r){let s=[],i=[],o,l;n.doc.nodesBetween(e,t,(a,c,u)=>{if(!a.isInline)return;let d=a.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),h=Math.min(c+a.nodeSize,t),p=r.addToSet(d);for(let m=0;m<d.length;m++)d[m].isInSet(p)||(o&&o.to==f&&o.mark.eq(d[m])?o.to=h:s.push(o=new ve(f,h,d[m])));l&&l.to==f?l.to=h:i.push(l=new Ge(f,h,r))}}),s.forEach(a=>n.step(a)),i.forEach(a=>n.step(a))}function Sd(n,e,t,r){let s=[],i=0;n.doc.nodesBetween(e,t,(o,l)=>{if(!o.isInline)return;i++;let a=null;if(r instanceof jr){let c=o.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(o.marks)&&(a=[r]):a=o.marks;if(a&&a.length){let c=Math.min(l+o.nodeSize,t);for(let u=0;u<a.length;u++){let d=a[u],f;for(let h=0;h<s.length;h++){let p=s[h];p.step==i-1&&d.eq(s[h].style)&&(f=p)}f?(f.to=c,f.step=i):s.push({style:d,from:Math.max(l,e),to:c,step:i})}}}),s.forEach(o=>n.step(new ve(o.from,o.to,o.style)))}function fi(n,e,t,r=t.contentMatch,s=!0){let i=n.doc.nodeAt(e),o=[],l=e+1;for(let a=0;a<i.childCount;a++){let c=i.child(a),u=l+c.nodeSize,d=r.matchType(c.type);if(!d)o.push(new U(l,u,v.empty));else{r=d;for(let f=0;f<c.marks.length;f++)t.allowsMarkType(c.marks[f].type)||n.step(new ve(l,u,c.marks[f]));if(s&&c.isText&&t.whitespace!="pre"){let f,h=/\r?\n|\r/g,p;for(;f=h.exec(c.text);)p||(p=new v(k.from(t.schema.text(" ",t.allowedMarks(c.marks))),0,0)),o.push(new U(l+f.index,l+f.index+f[0].length,p))}}l=u}if(!r.validEnd){let a=r.fillBefore(k.empty,!0);n.replace(l,l,new v(a,0,0))}for(let a=o.length-1;a>=0;a--)n.step(o[a])}function wd(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Yt(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth,s=0,i=0;;--r){let o=n.$from.node(r),l=n.$from.index(r)+s,a=n.$to.indexAfter(r)-i;if(r<n.depth&&o.canReplace(l,a,t))return r;if(r==0||o.type.spec.isolating||!wd(o,l,a))break;l&&(s=1),a<o.childCount&&(i=1)}return null}function Cd(n,e,t){let{$from:r,$to:s,depth:i}=e,o=r.before(i+1),l=s.after(i+1),a=o,c=l,u=k.empty,d=0;for(let p=i,m=!1;p>t;p--)m||r.index(p)>0?(m=!0,u=k.from(r.node(p).copy(u)),d++):a--;let f=k.empty,h=0;for(let p=i,m=!1;p>t;p--)m||s.after(p+1)<s.end(p)?(m=!0,f=k.from(s.node(p).copy(f)),h++):c++;n.step(new Y(a,c,o,l,new v(u.append(f),d,h),u.size-d,!0))}function hi(n,e,t=null,r=n){let s=vd(n,e),i=s&&Ed(r,e);return i?s.map(yo).concat({type:e,attrs:t}).concat(i.map(yo)):null}function yo(n){return{type:n,attrs:null}}function vd(n,e){let{parent:t,startIndex:r,endIndex:s}=n,i=t.contentMatchAt(r).findWrapping(e);if(!i)return null;let o=i.length?i[0]:e;return t.canReplaceWith(r,s,o)?i:null}function Ed(n,e){let{parent:t,startIndex:r,endIndex:s}=n,i=t.child(r),o=e.contentMatch.findWrapping(i.type);if(!o)return null;let a=(o.length?o[o.length-1]:e).contentMatch;for(let c=r;a&&c<s;c++)a=a.matchType(t.child(c).type);return!a||!a.validEnd?null:o}function Td(n,e,t){let r=k.empty;for(let o=t.length-1;o>=0;o--){if(r.size){let l=t[o].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=k.from(t[o].type.create(t[o].attrs,r))}let s=e.start,i=e.end;n.step(new Y(s,i,s,i,new v(r,0,0),t.length,!0))}function Md(n,e,t,r,s){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=n.steps.length;n.doc.nodesBetween(e,t,(o,l)=>{let a=typeof s=="function"?s(o):s;if(o.isTextblock&&!o.hasMarkup(r,a)&&Ad(n.doc,n.mapping.slice(i).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!p?c=!1:!h&&p&&(c=!0)}c===!1&&ha(n,o,l,i),fi(n,n.mapping.slice(i).map(l,1),r,void 0,c===null);let u=n.mapping.slice(i),d=u.map(l,1),f=u.map(l+o.nodeSize,1);return n.step(new Y(d,f,d+1,f-1,new v(k.from(r.create(a,null,o.marks)),0,0),1,!0)),c===!0&&fa(n,o,l,i),!1}})}function fa(n,e,t,r){e.forEach((s,i)=>{if(s.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(s.text);){let a=n.mapping.slice(r).map(t+1+i+o.index);n.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function ha(n,e,t,r){e.forEach((s,i)=>{if(s.type==s.type.schema.linebreakReplacement){let o=n.mapping.slice(r).map(t+1+i);n.replaceWith(o,o+1,e.type.schema.text(`
@@ -1 +1 @@
1
- import{e as b,c as w,j as a,l as j}from"./index-CpmOG_Bg.js";import{i as N}from"./SearchMd-CW4p_47C.js";function S(f){const e=b.c(17),{value:l,onChange:c,placeholder:g,onKeyDown:d,className:u,isSearching:p,disabled:i}=f,m=g===void 0?"Search...":g,x=i&&"pointer-events-none opacity-50";let t;e[0]!==u||e[1]!==x?(t=w("flex items-center gap-4 rounded-lg bg-background dark:bg-input/30 px-3 h-8 card-shadow","focus-within:border-ring focus-within:ring-ring/20 focus-within:ring-[2px]","transition-[color,box-shadow]",x,u),e[0]=u,e[1]=x,e[2]=t):t=e[2];let n;e[3]!==p?(n=p?a.jsx(j,{size:16,className:"animate-spin text-muted-foreground/75 shrink-0"}):a.jsx(N,{size:16,className:"text-muted-foreground/75 shrink-0"}),e[3]=p,e[4]=n):n=e[4];let s;e[5]!==c?(s=h=>c(h.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==i||e[8]!==d||e[9]!==m||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:d,placeholder:m,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=i,e[8]=d,e[9]=m,e[10]=s,e[11]=l,e[12]=o):o=e[12];let r;return e[13]!==t||e[14]!==n||e[15]!==o?(r=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=r):r=e[16],r}export{S};
1
+ import{e as b,c as w,j as a,l as j}from"./index-D6_5HAZl.js";import{i as N}from"./SearchMd-CGISNeet.js";function S(f){const e=b.c(17),{value:l,onChange:c,placeholder:g,onKeyDown:d,className:u,isSearching:p,disabled:i}=f,m=g===void 0?"Search...":g,x=i&&"pointer-events-none opacity-50";let t;e[0]!==u||e[1]!==x?(t=w("flex items-center gap-4 rounded-lg bg-background dark:bg-input/30 px-3 h-8 card-shadow","focus-within:border-ring focus-within:ring-ring/20 focus-within:ring-[2px]","transition-[color,box-shadow]",x,u),e[0]=u,e[1]=x,e[2]=t):t=e[2];let n;e[3]!==p?(n=p?a.jsx(j,{size:16,className:"animate-spin text-muted-foreground/75 shrink-0"}):a.jsx(N,{size:16,className:"text-muted-foreground/75 shrink-0"}),e[3]=p,e[4]=n):n=e[4];let s;e[5]!==c?(s=h=>c(h.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==i||e[8]!==d||e[9]!==m||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:d,placeholder:m,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=i,e[8]=d,e[9]=m,e[10]=s,e[11]=l,e[12]=o):o=e[12];let r;return e[13]!==t||e[14]!==n||e[15]!==o?(r=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=r):r=e[16],r}export{S};
@@ -1 +1 @@
1
- import{e as f,j as t,E as P,r as j,F as w,B as S,o as y}from"./index-CpmOG_Bg.js";import{i as k}from"./AlertCircle-B-r3okdw.js";import{s as z}from"./Plus-7ete7Chf.js";import{s as F}from"./User01-CfhPWLkj.js";import{t as E}from"./Users01-CwA0YZWL.js";import{D as $,a as I,b as O,c as A,e as R,d as T}from"./dialog-Co3xDPPR.js";import{I as N}from"./input-CUu-drFE.js";import{L as g}from"./label-BxSv953n.js";import{d as B,S as V,a as L,b as q,c as C}from"./select-C1e50dcv.js";import{S as H}from"./skeleton-BVkQR9ek.js";import{T as K}from"./textarea-BBLzCLOA.js";import{P as b}from"./index-CsEESfyT.js";import{c as W}from"./settings-section-CrtDCHpp.js";import{u as Y,a as G}from"./use-secrets-WmW0rqmn.js";import{R as J}from"./require-capability-BIm35L6j.js";import"./X-Dlvmz5Lj.js";import"./tooltip-DW2J8RRA.js";import"./Check-BhYHl6b1.js";import"./ChevronDown-CniGrT2-.js";import"./ChevronUp-DzsjrX2b.js";import"./sidebar-Cjaut6KM.js";import"./LayoutLeft-CoO_xxXK.js";import"./sheet-lTSOvxho.js";import"./card-7rPQAdEb.js";import"./ArrowUpRight-tDPH0_4m.js";import"./constants-DpuEAZHq.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-capability-FIcb8UxS.js";import"./access-gate-Uv1zLF5Y.js";import"./capability-load-error-BIabmgVZ.js";function M(s){const e=f.c(3),{error:r}=s;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(k,{size:16}),e[0]=a):a=e[0];let n;return e[1]!==r.message?(n=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[a,t.jsxs("span",{className:"text-sm font-medium",children:["Failed to load secrets: ",r.message]})]}),e[1]=r.message,e[2]=n):n=e[2],n}function Q(s){const e=f.c(5),{scope:r}=s,a=r==="user"?F:E,n=r==="user"?"Private":"Organization";let i;e[0]!==a?(i=t.jsx(a,{size:12}),e[0]=a,e[1]=i):i=e[1];let o;return e[2]!==n||e[3]!==i?(o=t.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[i,n]}),e[2]=n,e[3]=i,e[4]=o):o=e[4],o}function D(s){const e=f.c(20),{secret:r}=s;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(w,{size:16,className:"text-muted-foreground"})}),e[0]=a):a=e[0];let n;e[1]!==r.name?(n=t.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=n):n=e[2];let i;e[3]!==r.scope?(i=t.jsx(Q,{scope:r.scope}),e[3]=r.scope,e[4]=i):i=e[4];let o;e[5]!==n||e[6]!==i?(o=t.jsxs("div",{className:"flex items-center gap-2",children:[n,i]}),e[5]=n,e[6]=i,e[7]=o):o=e[7];let d;e[8]!==r.description?(d=r.description?t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=d):d=e[9];let u;e[10]!==o||e[11]!==d?(u=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[a,t.jsxs("div",{className:"min-w-0",children:[o,d]})]}),e[10]=o,e[11]=d,e[12]=u):u=e[12];let l;e[13]!==r.createdAt?(l=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=l):l=e[14];let c;e[15]!==l?(c=t.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:l}),e[15]=l,e[16]=c):c=e[16];let x;return e[17]!==u||e[18]!==c?(x=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[u,c]}),e[17]=u,e[18]=c,e[19]=x):x=e[19],x}function U(s){const e=f.c(5),{onCreate:r}=s;let a,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(w,{size:20,className:"text-muted-foreground"})}),n=t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-sm",children:"No secrets yet"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Store API keys, tokens, and other sensitive values. Values are encrypted at rest and never returned over the API."})]}),e[0]=a,e[1]=n):(a=e[0],n=e[1]);let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(z,{size:14}),e[2]=i):i=e[2];let o;return e[3]!==r?(o=t.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[a,n,t.jsxs(S,{onClick:r,size:"sm",className:"mt-2",children:[i,"New secret"]})]}),e[3]=r,e[4]=o):o=e[4],o}function _({open:s,onOpenChange:e}){const[r,a]=j.useState("organization"),[n,i]=j.useState(""),[o,d]=j.useState(""),[u,l]=j.useState(""),c=G();function x(){a("organization"),i(""),d(""),l("")}function p(){x(),e(!1)}async function h(m){if(m.preventDefault(),!(!n.trim()||!o))try{await c.mutateAsync({scope:r,name:n.trim(),value:o,description:u.trim()||void 0}),y.success(`Secret "${n.trim()}" created`),p()}catch(v){y.error(v instanceof Error?v.message:"Failed to create secret")}}return t.jsx($,{open:s,onOpenChange:m=>{m?e(m):p()},children:t.jsxs(I,{className:"sm:max-w-lg",children:[t.jsxs(O,{children:[t.jsx(A,{children:"New secret"}),t.jsx(R,{children:"Stored encrypted in the credential vault. Choose who can read it."})]}),t.jsxs("form",{onSubmit:h,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-scope",children:"Scope"}),t.jsxs(B,{value:r,onValueChange:m=>a(m),children:[t.jsx(V,{id:"secret-scope",children:t.jsx(L,{})}),t.jsxs(q,{children:[t.jsx(C,{value:"organization",children:"Organization — visible to all members"}),t.jsx(C,{value:"user",children:"Private — only visible to me"})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-name",children:"Name"}),t.jsx(N,{id:"secret-name",value:n,onChange:m=>i(m.target.value),placeholder:"STRIPE_API_KEY",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Letters, digits, underscore, dot, hyphen. Case-insensitive within its scope."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-value",children:"Value"}),t.jsx(N,{id:"secret-value",type:"password",value:o,onChange:m=>d(m.target.value),autoComplete:"new-password",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-description",children:"Description (optional)"}),t.jsx(K,{id:"secret-description",value:u,onChange:m=>l(m.target.value),rows:2,placeholder:"What is this secret used for?"})]}),t.jsxs(T,{children:[t.jsx(S,{type:"button",variant:"outline",onClick:p,disabled:c.isPending,children:"Cancel"}),t.jsx(S,{type:"submit",disabled:c.isPending||!n.trim()||!o,children:c.isPending?"Creating…":"Create secret"})]})]})]})})}function X(){const s=f.c(21),e=Y(),[r,a]=j.useState(!1);if(e.length===0){let l;s[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(U,{onCreate:()=>a(!0)}),s[0]=l):l=s[0];let c;return s[1]!==r?(c=t.jsxs(t.Fragment,{children:[l,t.jsx(_,{open:r,onOpenChange:a})]}),s[1]=r,s[2]=c):c=s[2],c}let n,i,o;if(s[3]!==e){const l=e.filter(se),c=e.filter(te),x=e.length===1?"":"s";let p;s[7]!==e.length||s[8]!==x?(p=t.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length," secret",x," stored"]}),s[7]=e.length,s[8]=x,s[9]=p):p=s[9];let h;s[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>a(!0),s[10]=h):h=s[10];let m;s[11]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs(S,{onClick:h,size:"sm",children:[t.jsx(z,{size:14}),"New secret"]}),s[11]=m):m=s[11],s[12]!==p?(n=t.jsxs("div",{className:"flex items-center justify-between",children:[p,m]}),s[12]=p,s[13]=n):n=s[13],i=l.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Organization"}),t.jsx("div",{children:l.map(ee)})]}):null,o=c.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Private to me"}),t.jsx("div",{children:c.map(Z)})]}):null,s[3]=e,s[4]=n,s[5]=i,s[6]=o}else n=s[4],i=s[5],o=s[6];let d;s[14]!==r?(d=t.jsx(_,{open:r,onOpenChange:a}),s[14]=r,s[15]=d):d=s[15];let u;return s[16]!==n||s[17]!==i||s[18]!==o||s[19]!==d?(u=t.jsxs(t.Fragment,{children:[n,i,o,d]}),s[16]=n,s[17]=i,s[18]=o,s[19]=d,s[20]=u):u=s[20],u}function Z(s){return t.jsx(D,{secret:s},s.id)}function ee(s){return t.jsx(D,{secret:s},s.id)}function te(s){return s.scope==="user"}function se(s){return s.scope==="organization"}function re(){const s=f.c(2);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(b.Title,{children:"Secrets"}),s[0]=e):e=s[0];let r;return s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(b,{children:t.jsx(b.Content,{children:t.jsx(b.Body,{children:t.jsxs(W,{children:[e,t.jsx(P,{fallback:ne,children:t.jsx(j.Suspense,{fallback:t.jsx(H,{className:"h-32 w-full"}),children:t.jsx(X,{})})})]})})})}),s[1]=r):r=s[1],r}function ne(s){const{error:e}=s;return t.jsx(M,{error:e??new Error("Failed to load secrets")})}function Oe(){const s=f.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(J,{capability:"secrets:manage",area:"secrets",children:t.jsx(re,{})}),s[0]=e):e=s[0],e}export{Oe as default};
1
+ import{e as f,j as t,E as P,r as j,F as w,B as S,o as y}from"./index-D6_5HAZl.js";import{i as k}from"./AlertCircle-CslgXeHr.js";import{s as z}from"./Plus-BUBMXRTd.js";import{s as F}from"./User01-CyAUnciz.js";import{t as E}from"./Users01-CCUr4Yur.js";import{D as $,a as I,b as O,c as A,e as R,d as T}from"./dialog-CvEIov2R.js";import{I as N}from"./input-CL16zv3M.js";import{L as g}from"./label-DjHnY7oD.js";import{d as B,S as V,a as L,b as q,c as C}from"./select-C81zuvtp.js";import{S as H}from"./skeleton-CGcndXpH.js";import{T as K}from"./textarea-C_ciKAYv.js";import{P as b}from"./index-CNQY6k_W.js";import{c as W}from"./settings-section-B7fIZ_m0.js";import{u as Y,a as G}from"./use-secrets-ChWP1SbP.js";import{R as J}from"./require-capability-Ca6ka1Sn.js";import"./X-BoM0MLQn.js";import"./tooltip-DjK_xTiM.js";import"./Check-C4hca_-Y.js";import"./ChevronDown-Dxt-1uCb.js";import"./ChevronUp-aKq1AYju.js";import"./sidebar-DELjK07K.js";import"./LayoutLeft-CmXWN8pg.js";import"./sheet-D9O2scBf.js";import"./card-wIb7H0Z4.js";import"./ArrowUpRight-D_DImXhK.js";import"./constants-CnOnAK7r.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-capability-CGr-3r92.js";import"./access-gate-rgO__BFd.js";import"./capability-load-error-atGCCjOU.js";function M(s){const e=f.c(3),{error:r}=s;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(k,{size:16}),e[0]=a):a=e[0];let n;return e[1]!==r.message?(n=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[a,t.jsxs("span",{className:"text-sm font-medium",children:["Failed to load secrets: ",r.message]})]}),e[1]=r.message,e[2]=n):n=e[2],n}function Q(s){const e=f.c(5),{scope:r}=s,a=r==="user"?F:E,n=r==="user"?"Private":"Organization";let i;e[0]!==a?(i=t.jsx(a,{size:12}),e[0]=a,e[1]=i):i=e[1];let o;return e[2]!==n||e[3]!==i?(o=t.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[i,n]}),e[2]=n,e[3]=i,e[4]=o):o=e[4],o}function D(s){const e=f.c(20),{secret:r}=s;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(w,{size:16,className:"text-muted-foreground"})}),e[0]=a):a=e[0];let n;e[1]!==r.name?(n=t.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=n):n=e[2];let i;e[3]!==r.scope?(i=t.jsx(Q,{scope:r.scope}),e[3]=r.scope,e[4]=i):i=e[4];let o;e[5]!==n||e[6]!==i?(o=t.jsxs("div",{className:"flex items-center gap-2",children:[n,i]}),e[5]=n,e[6]=i,e[7]=o):o=e[7];let d;e[8]!==r.description?(d=r.description?t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=d):d=e[9];let u;e[10]!==o||e[11]!==d?(u=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[a,t.jsxs("div",{className:"min-w-0",children:[o,d]})]}),e[10]=o,e[11]=d,e[12]=u):u=e[12];let l;e[13]!==r.createdAt?(l=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=l):l=e[14];let c;e[15]!==l?(c=t.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:l}),e[15]=l,e[16]=c):c=e[16];let x;return e[17]!==u||e[18]!==c?(x=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[u,c]}),e[17]=u,e[18]=c,e[19]=x):x=e[19],x}function U(s){const e=f.c(5),{onCreate:r}=s;let a,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(w,{size:20,className:"text-muted-foreground"})}),n=t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-sm",children:"No secrets yet"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Store API keys, tokens, and other sensitive values. Values are encrypted at rest and never returned over the API."})]}),e[0]=a,e[1]=n):(a=e[0],n=e[1]);let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(z,{size:14}),e[2]=i):i=e[2];let o;return e[3]!==r?(o=t.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[a,n,t.jsxs(S,{onClick:r,size:"sm",className:"mt-2",children:[i,"New secret"]})]}),e[3]=r,e[4]=o):o=e[4],o}function _({open:s,onOpenChange:e}){const[r,a]=j.useState("organization"),[n,i]=j.useState(""),[o,d]=j.useState(""),[u,l]=j.useState(""),c=G();function x(){a("organization"),i(""),d(""),l("")}function p(){x(),e(!1)}async function h(m){if(m.preventDefault(),!(!n.trim()||!o))try{await c.mutateAsync({scope:r,name:n.trim(),value:o,description:u.trim()||void 0}),y.success(`Secret "${n.trim()}" created`),p()}catch(v){y.error(v instanceof Error?v.message:"Failed to create secret")}}return t.jsx($,{open:s,onOpenChange:m=>{m?e(m):p()},children:t.jsxs(I,{className:"sm:max-w-lg",children:[t.jsxs(O,{children:[t.jsx(A,{children:"New secret"}),t.jsx(R,{children:"Stored encrypted in the credential vault. Choose who can read it."})]}),t.jsxs("form",{onSubmit:h,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-scope",children:"Scope"}),t.jsxs(B,{value:r,onValueChange:m=>a(m),children:[t.jsx(V,{id:"secret-scope",children:t.jsx(L,{})}),t.jsxs(q,{children:[t.jsx(C,{value:"organization",children:"Organization — visible to all members"}),t.jsx(C,{value:"user",children:"Private — only visible to me"})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-name",children:"Name"}),t.jsx(N,{id:"secret-name",value:n,onChange:m=>i(m.target.value),placeholder:"STRIPE_API_KEY",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Letters, digits, underscore, dot, hyphen. Case-insensitive within its scope."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-value",children:"Value"}),t.jsx(N,{id:"secret-value",type:"password",value:o,onChange:m=>d(m.target.value),autoComplete:"new-password",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-description",children:"Description (optional)"}),t.jsx(K,{id:"secret-description",value:u,onChange:m=>l(m.target.value),rows:2,placeholder:"What is this secret used for?"})]}),t.jsxs(T,{children:[t.jsx(S,{type:"button",variant:"outline",onClick:p,disabled:c.isPending,children:"Cancel"}),t.jsx(S,{type:"submit",disabled:c.isPending||!n.trim()||!o,children:c.isPending?"Creating…":"Create secret"})]})]})]})})}function X(){const s=f.c(21),e=Y(),[r,a]=j.useState(!1);if(e.length===0){let l;s[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(U,{onCreate:()=>a(!0)}),s[0]=l):l=s[0];let c;return s[1]!==r?(c=t.jsxs(t.Fragment,{children:[l,t.jsx(_,{open:r,onOpenChange:a})]}),s[1]=r,s[2]=c):c=s[2],c}let n,i,o;if(s[3]!==e){const l=e.filter(se),c=e.filter(te),x=e.length===1?"":"s";let p;s[7]!==e.length||s[8]!==x?(p=t.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length," secret",x," stored"]}),s[7]=e.length,s[8]=x,s[9]=p):p=s[9];let h;s[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>a(!0),s[10]=h):h=s[10];let m;s[11]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs(S,{onClick:h,size:"sm",children:[t.jsx(z,{size:14}),"New secret"]}),s[11]=m):m=s[11],s[12]!==p?(n=t.jsxs("div",{className:"flex items-center justify-between",children:[p,m]}),s[12]=p,s[13]=n):n=s[13],i=l.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Organization"}),t.jsx("div",{children:l.map(ee)})]}):null,o=c.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Private to me"}),t.jsx("div",{children:c.map(Z)})]}):null,s[3]=e,s[4]=n,s[5]=i,s[6]=o}else n=s[4],i=s[5],o=s[6];let d;s[14]!==r?(d=t.jsx(_,{open:r,onOpenChange:a}),s[14]=r,s[15]=d):d=s[15];let u;return s[16]!==n||s[17]!==i||s[18]!==o||s[19]!==d?(u=t.jsxs(t.Fragment,{children:[n,i,o,d]}),s[16]=n,s[17]=i,s[18]=o,s[19]=d,s[20]=u):u=s[20],u}function Z(s){return t.jsx(D,{secret:s},s.id)}function ee(s){return t.jsx(D,{secret:s},s.id)}function te(s){return s.scope==="user"}function se(s){return s.scope==="organization"}function re(){const s=f.c(2);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(b.Title,{children:"Secrets"}),s[0]=e):e=s[0];let r;return s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(b,{children:t.jsx(b.Content,{children:t.jsx(b.Body,{children:t.jsxs(W,{children:[e,t.jsx(P,{fallback:ne,children:t.jsx(j.Suspense,{fallback:t.jsx(H,{className:"h-32 w-full"}),children:t.jsx(X,{})})})]})})})}),s[1]=r):r=s[1],r}function ne(s){const{error:e}=s;return t.jsx(M,{error:e??new Error("Failed to load secrets")})}function Oe(){const s=f.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(J,{capability:"secrets:manage",area:"secrets",children:t.jsx(re,{})}),s[0]=e):e=s[0],e}export{Oe as default};
@@ -1,2 +1,2 @@
1
- import{e as $e,r as N,j as t,B as Ve,l as Yt,c as de,G as ea,o as xe,K as ta}from"./index-CpmOG_Bg.js";import{t as $n}from"./ChevronDown-CniGrT2-.js";import{i as na}from"./ChevronRight-COCWmVlT.js";import{n as sa}from"./ChevronUp-DzsjrX2b.js";import{D as qt,u as Wt,g as bt,E as aa,F as ra,J as oa}from"./agent-icon-BiKNgOeT.js";import{i as ia}from"./Globe01-D39kUdoP.js";import{S as ft}from"./scroll-area-B_wDwopu.js";import{T as rt,a as ot,b as it}from"./tooltip-DW2J8RRA.js";import{c as On,b as Ln,e as zn,d as In,a as Fn,D as Bn}from"./dialog-Co3xDPPR.js";import{I as Kn}from"./input-CUu-drFE.js";import{r as la,i as Xe,P as Hn,S as Un,N as ca,l as Ke,G as ua,a as da,b as gt,u as ma,c as fa,d as pa,e as ha,f as ga,g as va,h as xa,j as pt,k as $t,m as Ze,p as jn,n as kn,o as ya,q as Ot,s as ba,t as Sa,v as _a,w as ja,x as ka,y as Na,z as wa,A as Ta,B as ht,C as Ca,D as Ra,E as Da,F as Aa,H as Pa,I as Ma,J as Lt,K as Ea,L as Va,M as $a,O as zt,Q as Oa,R as La,T as Nn}from"./index-gacl_Tlu.js";import{s as za,a as Yn}from"./Eye-Cja82Q7U.js";import{d as Ia}from"./ZoomOut-Btzzfq_K.js";import{a as Fa}from"./RefreshCcw01-BcEdc8yb.js";import{s as Ht}from"./Plus-7ete7Chf.js";import{s as St}from"./Trash01-D8gyPG4F.js";import{i as Ba}from"./Zap-C5hsI9kw.js";import{a as Gt,c as Qe,D as Jt,b as Zt,d as Ka}from"./dropdown-menu-cIyq0nsy.js";import{u as qn,a as vt,K as Wn,P as Gn,b as Jn,C as Zn,s as Qn,d as xt,D as Xn,c as es,S as ts,v as Ha,e as ns,h as Ua}from"./sortable.esm-CgNsuB5K.js";import{r as Ya,s as qa,S as Ut}from"./schema-form-BnfXp9eD.js";import{r as wn,u as Wa,d as Ga,a as Ja,i as Za,f as Qa,P as Xa,b as er,S as tr}from"./page-seo-form-Cl71A8BB.js";import{c as nr,C as sr,e as Tn,d as ar,a as rr,g as or}from"./command-B-HknKNN.js";import{i as ir}from"./FilterLines-Bel4K6qN.js";import{i as lr}from"./Tool01-C_efsdJ9.js";import{AddSectionModal as cr}from"./add-section-modal-BH5ViPBB.js";import"./AlertCircle-B-r3okdw.js";import"./SwitchHorizontal01-X0-A3wlA.js";import"./XCircle-Q3LP6RaJ.js";import"./ArrowUpRight-tDPH0_4m.js";import"./ZapSquare-OkNAvBeL.js";import"./Users03-D_dEpKEB.js";import"./CheckCircle-CVL_FX-8.js";import"./Check-BhYHl6b1.js";import"./ChevronLeft-kGfXoAV-.js";import"./DotsVertical-_gNEu7zY.js";import"./Container-D1PVb_TW.js";import"./Star01-Bc8W2nUe.js";import"./Palette-D9uHHj9p.js";import"./HardDrive-CgdcwvGL.js";import"./Stars02-BG9BQfDN.js";import"./Key01-DYyg_tnP.js";import"./LayoutLeft-CoO_xxXK.js";import"./LinkExternal01-DN-lMhNz.js";import"./Monitor01-gHlWGw8m.js";import"./Sun-2czCa7nh.js";import"./Play-RXfEurLC.js";import"./SearchMd-CW4p_47C.js";import"./Settings02-BilcqWFp.js";import"./Shield01-CWDizliI.js";import"./Stars01-H8xKRb3B.js";import"./Upload01-CeZYEoZ8.js";import"./User01-CfhPWLkj.js";import"./Users01-CwA0YZWL.js";import"./XClose-CMlIOxQg.js";import"./X-Dlvmz5Lj.js";import"./select-C1e50dcv.js";import"./agent-capabilities-B5uA64tf.js";import"./pair-DN3rU5fI.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Cw1fcUIO.js";import"./file-type-icon-BUGLJdWu.js";import"./content-blocks-o63cs2vh.js";import"./types-LM2jh-lQ.js";import"./constants-DpuEAZHq.js";import"./chat-context-BpOhQo4D.js";import"./tab-id-QoM_GeD5.js";import"./decopilot-sse-pool-CLAzhWPC.js";import"./create-sse-subscription-BS5983N4.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-virtual-mcp-Bpydv1NG.js";import"./use-collections-CqTjT3Mq.js";import"./use-ai-providers-eErv1C43.js";import"./use-organization-settings-0_8sPkX5.js";import"./shell-layout-D0i8OAWU.js";import"./avatar-DcRL4WFc.js";import"./required-auth-layout-DxD0Fs_0.js";import"./useRouterState-DK-9Hx-j.js";import"./use-org-sso-ClqqHr-X.js";import"./integration-icon-D6q3hp18.js";import"./use-navigate-to-agent-dXmSFUhJ.js";import"./use-connection-D6Cpeajq.js";import"./use-mcp-prompts-2--n2jev.js";import"./form-ngFqzDUs.js";import"./label-BxSv953n.js";import"./spinner-BAjOwgiW.js";import"./drawer-B7pzzO8k.js";import"./collection-search-CmhXzxiX.js";import"./tabs-DVFYJOQB.js";import"./toggle-group-Bpw9J7_z.js";import"./connect-desktop-dialog-wDkcQT-i.js";import"./agent-icons-Bt1m_ENb.js";import"./checkbox-DmtUHgAJ.js";import"./skeleton-BVkQR9ek.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CrtDCHpp.js";import"./card-7rPQAdEb.js";import"./popover-CH95HqFo.js";import"./useInfiniteQuery-8wlNRgz7.js";import"./infiniteQueryObserver-BGllKZAR.js";import"./index-B_bvlyHZ.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-B_ai_Hb2.js";import"./sidebar-Cjaut6KM.js";import"./sheet-lTSOvxho.js";import"./toolbar-CspqzRI5.js";import"./use-create-virtual-mcp-CJC57gOy.js";import"./github-repo-picker-BYeMQGhG.js";import"./use-mcp-tools-BvO9OVFB.js";import"./extract-connection-data-CV_04Mqr.js";import"./generate-id-B72e1YIz.js";import"./collections-D4J1DJ61.js";import"./alert-dialog-D1sXzFR6.js";import"./index-d6i1w1J2.js";import"./use-org-auth-client-CAkVEUwL.js";import"./hover-card-HMEbmFNY.js";import"./task-status-CG4f8Ssf.js";import"./use-status-sounds-DaqA5e9-.js";import"./empty-state-BEKtdW4r.js";import"./resizable-DELp11qo.js";import"./use-capability-FIcb8UxS.js";import"./header-tab-button-CBrvR3rT.js";import"./index-Dx0tF1g4.js";import"./textarea-BBLzCLOA.js";import"./user-DgFB9DGX.js";import"./tools-list-xaKK1ECj.js";import"./badge-B2isb5t4.js";import"./connection-slug-eyAPH6o3.js";import"./switch-B3N-67ht.js";import"./use-debounced-autosave-CgMlJ6Br.js";import"./index-CsEESfyT.js";import"./search-input-Dy32u4Yx.js";import"./collection-tabs-CyAZqj58.js";import"./use-secrets-WmW0rqmn.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-CoOSA6zg.js";import"./view-mode-toggle-DwClLpGQ.js";import"./select-model-B7fxBb8r.js";import"./use-automations-HnokK13N.js";import"./monaco-editor-B1H6hrQ7.js";import"./automation-runs-DjKtm8sC.js";import"./table-CBD1Q3-l.js";import"./use-infinite-scroll-DiT_tcXi.js";import"./use-members-B36Y5TQt.js";import"./useSuspenseInfiniteQuery-Bg_jTe-C.js";import"./automation-list-row-Cdl3j3R5.js";import"./connection-card-DiU6mNhU.js";import"./use-registry-connections-BYyCxXS_.js";import"./connection-form-helpers-B5x3bKYp.js";import"./calendar-DleQOR6C.js";import"./image-field-BxdtQ-6B.js";import"./use-file-configs-P699ZQaF.js";import"./index-Bi91cUM-.js";function ur(a){const e=$e.c(38),{open:n,initialName:r,autoLabel:o,isPending:u,onSubmit:h,onOpenChange:d}=a,i=u===void 0?!1:u,[g,v]=N.useState(r),[x,b]=N.useState(n);n!==x&&(b(n),n&&v(r));let S;e[0]!==i||e[1]!==d?(S=T=>{!T&&!i&&d(!1)},e[0]=i,e[1]=d,e[2]=S):S=e[2];const l=S;let _;e[3]!==i||e[4]!==g||e[5]!==h?(_=async T=>{T.preventDefault(),!i&&await h(g.trim())},e[3]=i,e[4]=g,e[5]=h,e[6]=_):_=e[6];const p=_;let R;e[7]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(On,{children:"Rename variant"}),e[7]=R):R=e[7];const f=o||"the rule";let w;e[8]!==f?(w=t.jsxs(Ln,{children:[R,t.jsxs(zn,{children:["Save this matcher as a global block with a custom label. Leave empty to inline the matcher again and fall back to"," ",t.jsx("span",{className:"font-medium",children:f}),"."]})]}),e[8]=f,e[9]=w):w=e[9];let D;e[10]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[10]=D):D=e[10];let j;e[11]===Symbol.for("react.memo_cache_sentinel")?(j=T=>v(T.target.value),e[11]=j):j=e[11];let V;e[12]!==o||e[13]!==i||e[14]!==g?(V=t.jsxs("div",{className:"space-y-1.5 py-4",children:[D,t.jsx(Kn,{id:"variant-rename-name",value:g,onChange:j,placeholder:o,autoFocus:!0,disabled:i})]}),e[12]=o,e[13]=i,e[14]=g,e[15]=V):V=e[15];let k;e[16]!==d?(k=()=>d(!1),e[16]=d,e[17]=k):k=e[17];let $;e[18]!==i||e[19]!==k?($=t.jsx(Ve,{type:"button",variant:"outline",onClick:k,disabled:i,children:"Cancel"}),e[18]=i,e[19]=k,e[20]=$):$=e[20];let C;e[21]!==i?(C=i?t.jsxs(t.Fragment,{children:[t.jsx(Yt,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=i,e[22]=C):C=e[22];let A;e[23]!==i||e[24]!==C?(A=t.jsx(Ve,{type:"submit",disabled:i,children:C}),e[23]=i,e[24]=C,e[25]=A):A=e[25];let z;e[26]!==$||e[27]!==A?(z=t.jsxs(In,{children:[$,A]}),e[26]=$,e[27]=A,e[28]=z):z=e[28];let O;e[29]!==p||e[30]!==z||e[31]!==w||e[32]!==V?(O=t.jsx(Fn,{className:"sm:max-w-md",children:t.jsxs("form",{onSubmit:p,children:[w,V,z]})}),e[29]=p,e[30]=z,e[31]=w,e[32]=V,e[33]=O):O=e[33];let E;return e[34]!==l||e[35]!==n||e[36]!==O?(E=t.jsx(Bn,{open:n,onOpenChange:l,children:O}),e[34]=l,e[35]=n,e[36]=O,e[37]=E):E=e[37],E}function It(a,e,n,r,o){const u={...a[e]};if(o.length>1){const h=u.sections,d=[...h?.variants??[]];d[r]&&(d[r]={...d[r],value:n}),u.sections={...h,variants:d}}else u.sections=n;return u}function dr(a){return structuredClone(a)}function mr(a){return!a.isSavedBlock&&!a.isMultivariate}function Cn(a){const e=a.replace(/[^A-Za-z0-9_-]/g,"");return/^[A-Za-z]/.test(e)?e:e?`Block${e}`:""}function Rn(a,e){const n=a.trim();return n?n.includes("/")?"Block name cannot contain slashes.":Object.hasOwn(e,n)?"A block with this name already exists.":/^[A-Za-z][A-Za-z0-9_-]*$/.test(n)?null:"Use letters, numbers, hyphens, or underscores. Must start with a letter.":"Block name is required."}function fr(a){return a.schema?.definitions??a.schema?.$defs??{}}function pr(a,e){const n=fr(e),r=n[btoa(a)];if(!r)return;let o=typeof r.image=="string"?r.image:void 0;if(!o&&Array.isArray(r.allOf)){const u=r.allOf.find(h=>typeof h.$ref=="string")?.$ref;if(typeof u=="string"){const h=u.replace("#/definitions/",""),d=n[h];o=typeof d?.image=="string"?d.image:void 0}}if(o?.includes("{{{"))return o}function hr(a,e){if(!e)return;const n=la(a);if(!n)return;const r=pr(n.resolveType,e);if(!r)return;const o=Ya(r,n.data);if(o)return qa(o)}function Ft(a,e){return a.map((n,r)=>{const o=n.__resolveType??"",u=Xe(o);if(!u&&o!==""&&!o.includes("/")&&o in e){const g=e[o],v=typeof g?.name=="string"&&g.name||o.replace(/[-_]/g," ").replace(/\b\w/g,x=>x.toUpperCase())||`Section ${r+1}`;return{index:r,resolveType:o,label:v,isLazy:!1,isSavedBlock:!0}}const h=u?n.section:void 0,d=u?h?.__resolveType??"":o;if(d===Hn||d===Un){const g=u?h:n,v=Array.isArray(g?.variants)?g.variants:[];if(v.length===1&&(v[0]?.rule?.__resolveType??"")===ca){const S=v[0]?.value??{};let l=S.__resolveType??"";const _=Xe(l);return _&&(l=S.section?.__resolveType??l),{index:r,resolveType:o,label:Ke(l)||`Section ${r+1}`,isHidden:!0,isLazy:_}}const x=v[0]?.value?.__resolveType,b=x?Ke(x):"Section";return{index:r,resolveType:o,label:`Variants of ${b}`,isMultivariate:!0,isLazy:u}}const i=u?n.section?.__resolveType??o:o;if(u&&i!==""&&!i.includes("/")&&i in e){const g=e[i],v=typeof g?.name=="string"&&g.name||i.replace(/[-_]/g," ").replace(/\b\w/g,x=>x.toUpperCase())||`Section ${r+1}`;return{index:r,resolveType:o,label:v,isLazy:!0,isSavedBlock:!0}}return{index:r,resolveType:o,label:Ke(i)||`Section ${r+1}`,isLazy:u}})}const gr="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",vr="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 Dn(a){return Array.from({length:a},(e,n)=>({id:crypto.randomUUID(),index:n}))}function ss(a){return a.map((e,n)=>({...e,index:n}))}function xr(a,e){if(e===a.length)return a;if(e<a.length)return ss(a.slice(0,e));const n=Array.from({length:e-a.length},(r,o)=>({id:crypto.randomUUID(),index:a.length+o}));return[...a,...n]}function as(a){const e=$e.c(20),{section:n,raw:r,meta:o}=a,u=n.isSavedBlock===!0,h=n.isMultivariate===!0;let d;e[0]!==o||e[1]!==r?(d=r&&o?hr(r,o):void 0,e[0]=o,e[1]=r,e[2]=d):d=e[2];const i=d;let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Ia,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=g):g=e[3];let v;e[4]!==i?(v=i&&t.jsx("img",{src:i,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=i,e[5]=v):v=e[5];let x;e[6]!==h||e[7]!==u?(x=u?{color:ua}:h?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=h,e[7]=u,e[8]=x):x=e[8];let b;e[9]!==x?(b=t.jsx(qt,{className:"h-4 w-4 shrink-0",style:x}),e[9]=x,e[10]=b):b=e[10];const S=n.isHidden&&"line-through opacity-50";let l;e[11]!==S?(l=de("min-w-0 flex-1 truncate text-sm font-medium",S),e[11]=S,e[12]=l):l=e[12];let _;e[13]!==n.label||e[14]!==l?(_=t.jsx("span",{className:l,children:n.label}),e[13]=n.label,e[14]=l,e[15]=_):_=e[15];let p;return e[16]!==v||e[17]!==b||e[18]!==_?(p=t.jsxs(t.Fragment,{children:[g,v,b,_]}),e[16]=v,e[17]=b,e[18]=_,e[19]=p):p=e[19],p}function rs(a,e){const n=a.isSavedBlock===!0,r=a.isMultivariate===!0;return de("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":n?gr:r?"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 yr(a){const e=$e.c(53),{section:n,raw:r,meta:o,sortableId:u,selected:h,onSelect:d,onDelete:i,onDuplicate:g,onMakeReusable:v,onToggleHidden:x,onToggleLazy:b}=a,S=r?Xe(r.__resolveType??""):!1;let l;e[0]!==u?(l={id:u,animateLayoutChanges:kr},e[0]=u,e[1]=l):l=e[1];const{attributes:_,listeners:p,setNodeRef:R,transform:f,isDragging:w}=Jn(l);let D;e[2]!==f?(D=Zn.Transform.toString(f?{...f,x:0}:null),e[2]=f,e[3]=D):D=e[3];const j=w?0:void 0;let V;e[4]!==D||e[5]!==j?(V={transform:D,opacity:j},e[4]=D,e[5]=j,e[6]=V):V=e[6];const k=V;let $;e[7]!==n?($=mr(n),e[7]=n,e[8]=$):$=e[8];const C=$,A="button",z=0;let O;e[9]!==d?(O=H=>{(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),d())},e[9]=d,e[10]=O):O=e[10];const E=w?"cursor-grabbing":"cursor-pointer";let T;e[11]!==n||e[12]!==h||e[13]!==E?(T=de("touch-none transition-colors",E,rs(n,h)),e[11]=n,e[12]=h,e[13]=E,e[14]=T):T=e[14];let Y;e[15]!==o||e[16]!==r||e[17]!==n?(Y=t.jsx(as,{section:n,raw:r,meta:o}),e[15]=o,e[16]=r,e[17]=n,e[18]=Y):Y=e[18];const oe=!n.isMultivariate&&t.jsx(Ve,{type:"button",variant:"ghost",size:"icon","aria-label":S?"Disable async render":"Enable async render",className:de("h-7 w-7 shrink-0",S?"":"opacity-0 group-hover:opacity-100"),onClick:H=>{H.stopPropagation(),b()},onPointerDown:jr,children:t.jsx(Ba,{className:de("h-3.5 w-3.5",S&&"text-yellow-500")})});let I;e[19]!==x||e[20]!==n.isHidden||e[21]!==n.isMultivariate?(I=!n.isMultivariate&&t.jsx(Ve,{type:"button",variant:"ghost",size:"icon","aria-label":n.isHidden?"Show section":"Hide section",className:de("h-7 w-7 shrink-0",n.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:H=>{H.stopPropagation(),x()},onPointerDown:_r,children:n.isHidden?t.jsx(Fa,{className:"h-3.5 w-3.5"}):t.jsx(za,{className:"h-3.5 w-3.5"})}),e[19]=x,e[20]=n.isHidden,e[21]=n.isMultivariate,e[22]=I):I=e[22];let ie;e[23]===Symbol.for("react.memo_cache_sentinel")?(ie=t.jsx(Gt,{asChild:!0,children:t.jsx(Ve,{type:"button",variant:"ghost",size:"icon","aria-label":"Section actions",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:Sr,onPointerDown:br,children:t.jsx(Wt,{className:"h-3.5 w-3.5"})})}),e[23]=ie):ie=e[23];let K;e[24]!==g?(K=H=>{H.stopPropagation(),g()},e[24]=g,e[25]=K):K=e[25];let X;e[26]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx(Yn,{className:"h-4 w-4"}),e[26]=X):X=e[26];let ae;e[27]!==K?(ae=t.jsxs(Qe,{onClick:K,children:[X,"Duplicate"]}),e[27]=K,e[28]=ae):ae=e[28];let te;e[29]!==C||e[30]!==v?(te=C&&t.jsxs(Qe,{className:vr,onClick:H=>{H.stopPropagation(),v()},children:[t.jsx(qt,{className:"h-4 w-4"}),"Make reusable"]}),e[29]=C,e[30]=v,e[31]=te):te=e[31];let W;e[32]!==i?(W=H=>{H.stopPropagation(),i()},e[32]=i,e[33]=W):W=e[33];let G;e[34]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(St,{className:"h-4 w-4"}),e[34]=G):G=e[34];let q;e[35]!==W?(q=t.jsxs(Qe,{className:"text-destructive focus:text-destructive",onClick:W,children:[G,"Delete"]}),e[35]=W,e[36]=q):q=e[36];let J;e[37]!==ae||e[38]!==te||e[39]!==q?(J=t.jsxs(Jt,{children:[ie,t.jsxs(Zt,{align:"end",className:"w-44",children:[ae,te,q]})]}),e[37]=ae,e[38]=te,e[39]=q,e[40]=J):J=e[40];let Z;return e[41]!==_||e[42]!==p||e[43]!==d||e[44]!==R||e[45]!==k||e[46]!==T||e[47]!==Y||e[48]!==oe||e[49]!==I||e[50]!==J||e[51]!==O?(Z=t.jsxs("div",{ref:R,style:k,..._,...p,role:A,tabIndex:z,onClick:d,onKeyDown:O,className:T,children:[Y,oe,I,J]}),e[41]=_,e[42]=p,e[43]=d,e[44]=R,e[45]=k,e[46]=T,e[47]=Y,e[48]=oe,e[49]=I,e[50]=J,e[51]=O,e[52]=Z):Z=e[52],Z}function br(a){return a.stopPropagation()}function Sr(a){return a.stopPropagation()}function _r(a){return a.stopPropagation()}function jr(a){return a.stopPropagation()}function kr(){return!1}function Nr(a){const e=$e.c(88),{listKey:n,rawSections:r,sections:o,meta:u,selectedIndex:h,onSelect:d,onReorder:i,onDelete:g,onDuplicate:v,onMakeReusable:x,onToggleHidden:b,onToggleLazy:S,onAddSection:l,canAddSection:_}=a,p=_===void 0?!0:_;let R;e[0]!==o.length?(R=()=>Dn(o.length),e[0]=o.length,e[1]=R):R=e[1];const[f,w]=N.useState(R),[D,j]=N.useState(null),[V,k]=N.useState(n),[$,C]=N.useState(o.length),A=N.useRef(!1);V!==n?(k(n),C(o.length),w(Dn(o.length))):$!==o.length&&(C(o.length),w(le=>xr(le,o.length)));let z;e[2]===Symbol.for("react.memo_cache_sentinel")?(z={activationConstraint:{distance:8}},e[2]=z):z=e[2];let O;e[3]===Symbol.for("react.memo_cache_sentinel")?(O={coordinateGetter:Qn},e[3]=O):O=e[3];const E=qn(vt(Gn,z),vt(Wn,O));let T;e[4]!==f?(T=f.map(wr),e[4]=f,e[5]=T):T=e[5];const Y=T;let oe;e[6]===Symbol.for("react.memo_cache_sentinel")?(oe=le=>{j(String(le.active.id))},e[6]=oe):oe=e[6];const I=oe;let ie;e[7]!==Y||e[8]!==i?(ie=le=>{j(null);const{active:P,over:U}=le;if(!U||P.id===U.id)return;const Me=Y.indexOf(String(P.id)),Oe=Y.indexOf(String(U.id));Me===-1||Oe===-1||(w(He=>ss(xt([...He],Me,Oe))),A.current=!0,requestAnimationFrame(()=>{A.current=!1}),i?.(Me,Oe))},e[7]=Y,e[8]=i,e[9]=ie):ie=e[9];const K=ie;let X;e[10]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{j(null)},e[10]=X):X=e[10];const ae=X;let te,W,G,q,J,Z,H,we,ee,ye,be,Te,_e,Se,Ce;if(e[11]!==D||e[12]!==p||e[13]!==f||e[14]!==Y||e[15]!==K||e[16]!==u||e[17]!==l||e[18]!==g||e[19]!==v||e[20]!==x||e[21]!==d||e[22]!==b||e[23]!==S||e[24]!==r||e[25]!==o||e[26]!==h||e[27]!==E){Se=Symbol.for("react.early_return_sentinel");e:{const le=P=>{A.current||d(P)};if(e[43]!==D||e[44]!==p||e[45]!==f||e[46]!==l||e[47]!==r||e[48]!==o){const P=D?f.find(U=>U.id===D):null;if(q=P!=null?o[P.index]:null,G=P!=null?r[P.index]:void 0,f.length===0){let U;e[52]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No sections in this page."}),e[52]=U):U=e[52];const Me=!p;let Oe;e[53]===Symbol.for("react.memo_cache_sentinel")?(Oe=t.jsx(Ht,{size:14}),e[53]=Oe):Oe=e[53];let He;e[54]!==l||e[55]!==Me?(He=t.jsxs("div",{className:"space-y-2",children:[U,t.jsxs(Ve,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Me,onClick:l,children:[Oe,"Add section"]})]}),e[54]=l,e[55]=Me,e[56]=He):He=e[56],Se=He;break e}_e=de(P&&"cursor-grabbing"),e[43]=D,e[44]=p,e[45]=f,e[46]=l,e[47]=r,e[48]=o,e[49]=G,e[50]=q,e[51]=_e}else G=e[49],q=e[50],_e=e[51];W=Xn,we=E,ee=es,ye=I,be=K,Te=ae,te=ts,Z=Y,H=Ha,Ce="space-y-1",J=f.map(P=>{const U=o[P.index];return U?t.jsx(yr,{sortableId:P.id,section:U,raw:r[P.index],meta:u,selected:h===P.index,onSelect:()=>le(P.index),onDelete:()=>g(P.index),onDuplicate:()=>v(P.index),onMakeReusable:()=>x(P.index),onToggleHidden:()=>b(P.index),onToggleLazy:()=>S(P.index)},P.id):null})}e[11]=D,e[12]=p,e[13]=f,e[14]=Y,e[15]=K,e[16]=u,e[17]=l,e[18]=g,e[19]=v,e[20]=x,e[21]=d,e[22]=b,e[23]=S,e[24]=r,e[25]=o,e[26]=h,e[27]=E,e[28]=te,e[29]=W,e[30]=G,e[31]=q,e[32]=J,e[33]=Z,e[34]=H,e[35]=we,e[36]=ee,e[37]=ye,e[38]=be,e[39]=Te,e[40]=_e,e[41]=Se,e[42]=Ce}else te=e[28],W=e[29],G=e[30],q=e[31],J=e[32],Z=e[33],H=e[34],we=e[35],ee=e[36],ye=e[37],be=e[38],Te=e[39],_e=e[40],Se=e[41],Ce=e[42];if(Se!==Symbol.for("react.early_return_sentinel"))return Se;let je;e[57]!==J||e[58]!==Ce?(je=t.jsx("div",{className:Ce,children:J}),e[57]=J,e[58]=Ce,e[59]=je):je=e[59];let Re;e[60]!==te||e[61]!==Z||e[62]!==H||e[63]!==je?(Re=t.jsx(te,{items:Z,strategy:H,children:je}),e[60]=te,e[61]=Z,e[62]=H,e[63]=je,e[64]=Re):Re=e[64];let me;e[65]!==G||e[66]!==q||e[67]!==u?(me=q?t.jsx("div",{className:de("cursor-grabbing shadow-lg ring-1 ring-border/60",rs(q,!1)),children:t.jsx(as,{section:q,raw:G,meta:u})}):null,e[65]=G,e[66]=q,e[67]=u,e[68]=me):me=e[68];let ze;e[69]!==me?(ze=t.jsx(ns,{dropAnimation:null,children:me}),e[69]=me,e[70]=ze):ze=e[70];let ke;e[71]!==W||e[72]!==we||e[73]!==ee||e[74]!==ye||e[75]!==be||e[76]!==Te||e[77]!==Re||e[78]!==ze?(ke=t.jsxs(W,{sensors:we,collisionDetection:ee,onDragStart:ye,onDragEnd:be,onDragCancel:Te,children:[Re,ze]}),e[71]=W,e[72]=we,e[73]=ee,e[74]=ye,e[75]=be,e[76]=Te,e[77]=Re,e[78]=ze,e[79]=ke):ke=e[79];const Ne=!p;let fe;e[80]===Symbol.for("react.memo_cache_sentinel")?(fe=t.jsx(Ht,{size:14}),e[80]=fe):fe=e[80];let De;e[81]!==l||e[82]!==Ne?(De=t.jsxs(Ve,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:Ne,onClick:l,children:[fe,"Add section"]}),e[81]=l,e[82]=Ne,e[83]=De):De=e[83];let re;return e[84]!==_e||e[85]!==ke||e[86]!==De?(re=t.jsxs("div",{className:_e,children:[ke,De]}),e[84]=_e,e[85]=ke,e[86]=De,e[87]=re):re=e[87],re}function wr(a){return a.id}function os(a){return a===Un||a===Hn}function Qt(a,e){if(!(a in e))return null;const n=e[a]??{},r=n.__resolveType??a;return{data:{...n},resolveType:r}}function yt(a,e){const n=a.__resolveType??"";if(!n)return null;if(Xe(n)){const r=a.section??{};return is(r,e)}if(os(n)){const r=a.variants?.[0]?.value;return r?yt(r,e):null}return!n.includes("/")&&n in e?Qt(n,e):{data:{...a},resolveType:n}}function is(a,e){const n=a.__resolveType??"";if(!n)return null;if(os(n)){const r=a.variants?.[0]?.value;return r?yt(r,e):null}return!n.includes("/")&&n in e?Qt(n,e):{data:{...a},resolveType:n}}function at(a,e,n){if(e.isMultivariate)return null;if(e.isSavedBlock){const r=e.isLazy?a.section?.__resolveType??a.__resolveType:a.__resolveType;return Qt(r,n)}if(e.isHidden){const u=(Xe(a.__resolveType)?a.section:a)?.variants?.[0]?.value??a;return yt(u,n)}if(e.isLazy||Xe(a.__resolveType)){const r=a.section??{};return is(r,n)}return yt(a,n)}const Tr=[[/always|matchalways/i,"Users03"],[/device|matchdevice/i,"Phone02"],[/date|matchdate/i,"Calendar"],[/random|matchrandom/i,"Shuffle01"],[/host|matchhost/i,"Globe02"],[/location|matchlocation/i,"MarkerPin01"],[/pathname/i,"Link03"],[/cron|matchcron/i,"Clock"],[/multi|matchmulti/i,"FilterLines"],[/never|matchnever/i,"EyeOff"],[/environment|matchenvironment/i,"Cloud01"],[/eq\.ts|\/eq$/i,"Brackets"],[/user|requser|isdecouser/i,"User01"],[/site|template/i,"LayoutAlt01"]],Cr={"device-mobile":"Phone02","device-desktop":"Monitor01","device-tablet":"Tablet01","calendar-event":"Calendar","calendar-month":"Calendar",clock:"Clock","current-location":"MarkerPin01","map-2":"MarkerPin01","world-search":"Globe02",shuffle:"Shuffle01",filter:"FilterLines","eye-off":"EyeOff",flask:"Beaker02",link:"Link03","git-merge":"GitBranch01",users:"Users03",flag:"Flag01","cloud-storm":"Cloud01",campaign:"Announcement01",experiment:"Beaker02",language:"Globe02","hand-click":"CursorClick01"};function Bt(a){return bt(a)!==void 0}function Xt(a,e){if(e){if(Bt(e))return e;const n=Cr[e];if(n&&Bt(n))return n}for(const[n,r]of Tr)if(n.test(a)&&Bt(r))return r;return"FilterLines"}function Rr(a){return bt(a)??ir}function An(a){const e=$e.c(11),{iconName:n,size:r,className:o}=a,u=r===void 0?"md":r;let h;e[0]!==n?(h=Rr(n),e[0]=n,e[1]=h):h=e[1];const d=h,i=u==="sm"?"size-7":"size-9",g=u==="sm"?16:18;let v;e[2]!==i||e[3]!==o?(v=de("flex shrink-0 items-center justify-center rounded-full bg-muted",i,o),e[2]=i,e[3]=o,e[4]=v):v=e[4];let x;e[5]!==d||e[6]!==g?(x=t.jsx(d,{size:g,className:"text-muted-foreground"}),e[5]=d,e[6]=g,e[7]=x):x=e[7];let b;return e[8]!==v||e[9]!==x?(b=t.jsx("div",{className:v,children:x}),e[8]=v,e[9]=x,e[10]=b):b=e[10],b}const ls="Users03";function Dr(a){const e=a.manifest?.blocks??{},n=[];for(const[r,o]of Object.entries(e))if(r.includes("matchers"))for(const u of Object.keys(o)){if(u.includes("always"))continue;const h=da(u,a);n.push({resolveType:u,title:h.title??Ke(u),description:h.description,iconName:Xt(u,h.icon)})}return n}function Ar(a,e){if(!a)return ls;const n=e.find(r=>r.resolveType===a);return n?n.iconName:Xt(a)}function Pn(a){const e=$e.c(41),{currentRt:n,currentLabel:r,matchers:o,onSelect:u}=a,[h,d]=N.useState(!1);let i;if(e[0]!==n||e[1]!==o){const E=Ar(n,o);i=bt(E),e[0]=n,e[1]=o,e[2]=i}else i=e[2];const g=i;let v;e[3]!==u?(v=E=>{u(E),d(!1)},e[3]=u,e[4]=v):v=e[4];const x=v;let b;e[5]===Symbol.for("react.memo_cache_sentinel")?(b=()=>d(!0),e[5]=b):b=e[5];let S;e[6]!==g?(S=g&&t.jsx(g,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),e[6]=g,e[7]=S):S=e[7];let l;e[8]!==r?(l=t.jsx("span",{className:"flex-1 truncate",children:r}),e[8]=r,e[9]=l):l=e[9];let _;e[10]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx($n,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),e[10]=_):_=e[10];let p;e[11]!==S||e[12]!==l?(p=t.jsxs("button",{type:"button",onClick:b,className:"flex h-10 w-full items-center gap-2 rounded-md border border-input bg-transparent px-3 text-left text-sm shadow-xs transition-colors hover:bg-accent/40 cursor-pointer",children:[S,l,_]}),e[11]=S,e[12]=l,e[13]=p):p=e[13];let R;e[14]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(nr,{placeholder:"Search rules..."}),e[14]=R):R=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(sr,{children:"No rules found."}),e[15]=f):f=e[15];let w;e[16]!==x?(w=()=>x(""),e[16]=x,e[17]=w):w=e[17];const D=!n&&"bg-accent/60";let j;e[18]!==D?(j=de("gap-2.5",D),e[18]=D,e[19]=j):j=e[19];let V;e[20]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(An,{iconName:ls,size:"sm"}),e[20]=V):V=e[20];let k;e[21]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[t.jsx("span",{className:"text-sm",children:"Always"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:"Target all users"})]}),e[21]=k):k=e[21];let $;e[22]!==w||e[23]!==j?($=t.jsxs(Tn,{value:"always Target all users",onSelect:w,className:j,children:[V,k]}),e[22]=w,e[23]=j,e[24]=$):$=e[24];let C;if(e[25]!==n||e[26]!==x||e[27]!==o){let E;e[29]!==n||e[30]!==x?(E=T=>t.jsxs(Tn,{value:`${T.title} ${T.resolveType} ${T.description??""}`,onSelect:()=>x(T.resolveType),className:de("gap-2.5",n===T.resolveType&&"bg-accent/60"),children:[t.jsx(An,{iconName:T.iconName,size:"sm"}),t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[t.jsx("span",{className:"text-sm",children:T.title}),T.description&&t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:T.description})]})]},T.resolveType),e[29]=n,e[30]=x,e[31]=E):E=e[31],C=o.map(E),e[25]=n,e[26]=x,e[27]=o,e[28]=C}else C=e[28];let A;e[32]!==$||e[33]!==C?(A=t.jsxs(ar,{children:[f,t.jsxs(rr,{children:[$,C]})]}),e[32]=$,e[33]=C,e[34]=A):A=e[34];let z;e[35]!==h||e[36]!==A?(z=t.jsxs(or,{open:h,onOpenChange:d,title:"Choose a rule",description:"Pick how to target users for this variant",className:"sm:max-w-lg",children:[R,A]}),e[35]=h,e[36]=A,e[37]=z):z=e[37];let O;return e[38]!==z||e[39]!==p?(O=t.jsxs(t.Fragment,{children:[p,z]}),e[38]=z,e[39]=p,e[40]=O):O=e[40],O}const Pr="oklch(0.65 0.15 160)",cs="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 en(a){const e=$e.c(5),{rule:n,matchers:r}=a,o=n?.__resolveType??"";let u;if(e[0]!==r||e[1]!==o){const g=r.find(v=>v.resolveType===o)?.iconName??Xt(o);u=bt(g),e[0]=r,e[1]=o,e[2]=u}else u=e[2];const h=u;if(!h)return null;let d;return e[3]!==h?(d=t.jsx(h,{size:14,className:"shrink-0"}),e[3]=h,e[4]=d):d=e[4],d}function Mn(a){return a.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
1
+ import{e as $e,r as N,j as t,B as Ve,l as Yt,c as de,G as ea,o as xe,K as ta}from"./index-D6_5HAZl.js";import{t as $n}from"./ChevronDown-Dxt-1uCb.js";import{i as na}from"./ChevronRight-CyvrXAe0.js";import{n as sa}from"./ChevronUp-aKq1AYju.js";import{D as qt,u as Wt,g as bt,E as aa,F as ra,J as oa}from"./agent-icon-C7paq9nL.js";import{i as ia}from"./Globe01-BgNeS-t5.js";import{S as ft}from"./scroll-area-CpcNn-v-.js";import{T as rt,a as ot,b as it}from"./tooltip-DjK_xTiM.js";import{c as On,b as Ln,e as zn,d as In,a as Fn,D as Bn}from"./dialog-CvEIov2R.js";import{I as Kn}from"./input-CL16zv3M.js";import{r as la,i as Xe,P as Hn,S as Un,N as ca,l as Ke,G as ua,a as da,b as gt,u as ma,c as fa,d as pa,e as ha,f as ga,g as va,h as xa,j as pt,k as $t,m as Ze,p as jn,n as kn,o as ya,q as Ot,s as ba,t as Sa,v as _a,w as ja,x as ka,y as Na,z as wa,A as Ta,B as ht,C as Ca,D as Ra,E as Da,F as Aa,H as Pa,I as Ma,J as Lt,K as Ea,L as Va,M as $a,O as zt,Q as Oa,R as La,T as Nn}from"./index-BvZc_M4M.js";import{s as za,a as Yn}from"./Eye-CBgMpWUe.js";import{d as Ia}from"./ZoomOut-D1C0CDzK.js";import{a as Fa}from"./RefreshCcw01-JqGzzm_-.js";import{s as Ht}from"./Plus-BUBMXRTd.js";import{s as St}from"./Trash01-DeyjRbcU.js";import{i as Ba}from"./Zap-CrVhQ07E.js";import{a as Gt,c as Qe,D as Jt,b as Zt,d as Ka}from"./dropdown-menu-BGgFPqgI.js";import{u as qn,a as vt,K as Wn,P as Gn,b as Jn,C as Zn,s as Qn,d as xt,D as Xn,c as es,S as ts,v as Ha,e as ns,h as Ua}from"./sortable.esm-Cc5wE8Md.js";import{r as Ya,s as qa,S as Ut}from"./schema-form-BRIUengr.js";import{r as wn,u as Wa,d as Ga,a as Ja,i as Za,f as Qa,P as Xa,b as er,S as tr}from"./page-seo-form-bcXUoU_e.js";import{c as nr,C as sr,e as Tn,d as ar,a as rr,g as or}from"./command-C-yJHbpu.js";import{i as ir}from"./FilterLines-CWMZctUn.js";import{i as lr}from"./Tool01-BO2C1HmC.js";import{AddSectionModal as cr}from"./add-section-modal-fGEm5qce.js";import"./AlertCircle-CslgXeHr.js";import"./SwitchHorizontal01-CxiFSSn6.js";import"./XCircle-DZ20_zb3.js";import"./ArrowUpRight-D_DImXhK.js";import"./ZapSquare-CqyHqTSv.js";import"./Users03-Cwd2CyYY.js";import"./CheckCircle-HpSNY8ij.js";import"./Check-C4hca_-Y.js";import"./ChevronLeft-B5zdF1BR.js";import"./DotsVertical-Bo9Tm-x1.js";import"./Container-DXqMOloC.js";import"./Star01-J_T9yrd1.js";import"./Palette-BTCzP1Gm.js";import"./HardDrive-skQdR31x.js";import"./Stars02-CUXVM8eC.js";import"./Key01-CxukwP00.js";import"./LayoutLeft-CmXWN8pg.js";import"./LinkExternal01-l_9oMYRN.js";import"./Monitor01-DIoPLr7l.js";import"./Sun-BzriIyyb.js";import"./Play-DSJB4Nw2.js";import"./SearchMd-CGISNeet.js";import"./Settings02-C4ziU-d4.js";import"./Shield01-IwIv25Jp.js";import"./Stars01-BjgHV0Ah.js";import"./Upload01-C4K5hWSL.js";import"./User01-CyAUnciz.js";import"./Users01-CCUr4Yur.js";import"./XClose-BLi9vIRd.js";import"./X-BoM0MLQn.js";import"./select-C81zuvtp.js";import"./agent-capabilities-Dl7XXwpG.js";import"./pair-CBFiuxUB.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DR1yGhlv.js";import"./file-type-icon-CUYwtPob.js";import"./content-blocks-o63cs2vh.js";import"./types-BRYvxHV0.js";import"./constants-CnOnAK7r.js";import"./chat-context-D4Cm-d6A.js";import"./tab-id-B_7JAjTL.js";import"./decopilot-sse-pool-Bdv0H274.js";import"./create-sse-subscription-BS5983N4.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-virtual-mcp-B_JQogr5.js";import"./use-collections-ClKr7eLP.js";import"./use-ai-providers-CfNPOGmz.js";import"./use-organization-settings-Ba_pVlZU.js";import"./shell-layout-B5mx8HCW.js";import"./avatar-BOZs09SE.js";import"./required-auth-layout-aQSUe2N_.js";import"./useRouterState-VRTDPwLh.js";import"./use-org-sso-CQo4DX7V.js";import"./integration-icon-CQ-NchIr.js";import"./use-navigate-to-agent-bL0bZjvs.js";import"./use-connection-QL9Osw0s.js";import"./use-mcp-prompts-BthLsr-5.js";import"./form-BRW-mO5v.js";import"./label-DjHnY7oD.js";import"./spinner-DPcimsxj.js";import"./drawer-B_9l3ZhB.js";import"./collection-search-CUV3pFhw.js";import"./tabs-Jop0evx4.js";import"./toggle-group-CQHGgo0W.js";import"./connect-desktop-dialog-hVZb8AY9.js";import"./agent-icons-hJ9xtdfo.js";import"./checkbox-BwSTMmic.js";import"./skeleton-CGcndXpH.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-B7fIZ_m0.js";import"./card-wIb7H0Z4.js";import"./popover-CS_iXBnY.js";import"./useInfiniteQuery-BdAfpOZ8.js";import"./infiniteQueryObserver-Bc9cuK8G.js";import"./index-Bn8JFywe.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-Nvrm4NyQ.js";import"./sidebar-DELjK07K.js";import"./sheet-D9O2scBf.js";import"./toolbar-CO7J3Qlp.js";import"./use-create-virtual-mcp-B7FzzrhS.js";import"./github-repo-picker-hw4e_RVO.js";import"./use-mcp-tools-DKqH2jvx.js";import"./extract-connection-data-CaeplLEr.js";import"./generate-id-CdTqgONK.js";import"./collections-D8RfaH_g.js";import"./alert-dialog-DOf1CDFG.js";import"./index-z0IJb09y.js";import"./use-org-auth-client-B-7f7gTM.js";import"./hover-card-BMrhboDz.js";import"./task-status-VzGHvxK_.js";import"./use-status-sounds-BecbYKFZ.js";import"./empty-state-Db1HVS3F.js";import"./resizable-B-Kg7sz_.js";import"./use-capability-CGr-3r92.js";import"./header-tab-button-IP2RhXhm.js";import"./index-37PxaG4U.js";import"./textarea-C_ciKAYv.js";import"./user-DFXkwuvu.js";import"./tools-list-CNevt541.js";import"./badge-Cf9p2KiH.js";import"./connection-slug-eyAPH6o3.js";import"./switch-D26GKac4.js";import"./use-debounced-autosave-StOJyK5k.js";import"./index-CNQY6k_W.js";import"./search-input-BmjJ0rJ1.js";import"./collection-tabs-CGllLoge.js";import"./use-secrets-ChWP1SbP.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-CAJ4g4RV.js";import"./view-mode-toggle-B2R8JuP1.js";import"./select-model-CzLBWXoY.js";import"./use-automations-_NxkdQLG.js";import"./monaco-editor-DDa2PYLr.js";import"./automation-runs-BeoB4dd9.js";import"./table-DP9s7KR8.js";import"./use-infinite-scroll-D369zKBP.js";import"./use-members-CARBs-BO.js";import"./useSuspenseInfiniteQuery-BNJvF6Td.js";import"./automation-list-row-D730hoTt.js";import"./connection-card-vgtnONDT.js";import"./use-registry-connections-GFs4i1bK.js";import"./connection-form-helpers-oCzpRzHj.js";import"./calendar-BO9tcRYu.js";import"./image-field-BhWuARh_.js";import"./use-file-configs-bSRypY4D.js";import"./index-XuzNc7bG.js";function ur(a){const e=$e.c(38),{open:n,initialName:r,autoLabel:o,isPending:u,onSubmit:h,onOpenChange:d}=a,i=u===void 0?!1:u,[g,v]=N.useState(r),[x,b]=N.useState(n);n!==x&&(b(n),n&&v(r));let S;e[0]!==i||e[1]!==d?(S=T=>{!T&&!i&&d(!1)},e[0]=i,e[1]=d,e[2]=S):S=e[2];const l=S;let _;e[3]!==i||e[4]!==g||e[5]!==h?(_=async T=>{T.preventDefault(),!i&&await h(g.trim())},e[3]=i,e[4]=g,e[5]=h,e[6]=_):_=e[6];const p=_;let R;e[7]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(On,{children:"Rename variant"}),e[7]=R):R=e[7];const f=o||"the rule";let w;e[8]!==f?(w=t.jsxs(Ln,{children:[R,t.jsxs(zn,{children:["Save this matcher as a global block with a custom label. Leave empty to inline the matcher again and fall back to"," ",t.jsx("span",{className:"font-medium",children:f}),"."]})]}),e[8]=f,e[9]=w):w=e[9];let D;e[10]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[10]=D):D=e[10];let j;e[11]===Symbol.for("react.memo_cache_sentinel")?(j=T=>v(T.target.value),e[11]=j):j=e[11];let V;e[12]!==o||e[13]!==i||e[14]!==g?(V=t.jsxs("div",{className:"space-y-1.5 py-4",children:[D,t.jsx(Kn,{id:"variant-rename-name",value:g,onChange:j,placeholder:o,autoFocus:!0,disabled:i})]}),e[12]=o,e[13]=i,e[14]=g,e[15]=V):V=e[15];let k;e[16]!==d?(k=()=>d(!1),e[16]=d,e[17]=k):k=e[17];let $;e[18]!==i||e[19]!==k?($=t.jsx(Ve,{type:"button",variant:"outline",onClick:k,disabled:i,children:"Cancel"}),e[18]=i,e[19]=k,e[20]=$):$=e[20];let C;e[21]!==i?(C=i?t.jsxs(t.Fragment,{children:[t.jsx(Yt,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=i,e[22]=C):C=e[22];let A;e[23]!==i||e[24]!==C?(A=t.jsx(Ve,{type:"submit",disabled:i,children:C}),e[23]=i,e[24]=C,e[25]=A):A=e[25];let z;e[26]!==$||e[27]!==A?(z=t.jsxs(In,{children:[$,A]}),e[26]=$,e[27]=A,e[28]=z):z=e[28];let O;e[29]!==p||e[30]!==z||e[31]!==w||e[32]!==V?(O=t.jsx(Fn,{className:"sm:max-w-md",children:t.jsxs("form",{onSubmit:p,children:[w,V,z]})}),e[29]=p,e[30]=z,e[31]=w,e[32]=V,e[33]=O):O=e[33];let E;return e[34]!==l||e[35]!==n||e[36]!==O?(E=t.jsx(Bn,{open:n,onOpenChange:l,children:O}),e[34]=l,e[35]=n,e[36]=O,e[37]=E):E=e[37],E}function It(a,e,n,r,o){const u={...a[e]};if(o.length>1){const h=u.sections,d=[...h?.variants??[]];d[r]&&(d[r]={...d[r],value:n}),u.sections={...h,variants:d}}else u.sections=n;return u}function dr(a){return structuredClone(a)}function mr(a){return!a.isSavedBlock&&!a.isMultivariate}function Cn(a){const e=a.replace(/[^A-Za-z0-9_-]/g,"");return/^[A-Za-z]/.test(e)?e:e?`Block${e}`:""}function Rn(a,e){const n=a.trim();return n?n.includes("/")?"Block name cannot contain slashes.":Object.hasOwn(e,n)?"A block with this name already exists.":/^[A-Za-z][A-Za-z0-9_-]*$/.test(n)?null:"Use letters, numbers, hyphens, or underscores. Must start with a letter.":"Block name is required."}function fr(a){return a.schema?.definitions??a.schema?.$defs??{}}function pr(a,e){const n=fr(e),r=n[btoa(a)];if(!r)return;let o=typeof r.image=="string"?r.image:void 0;if(!o&&Array.isArray(r.allOf)){const u=r.allOf.find(h=>typeof h.$ref=="string")?.$ref;if(typeof u=="string"){const h=u.replace("#/definitions/",""),d=n[h];o=typeof d?.image=="string"?d.image:void 0}}if(o?.includes("{{{"))return o}function hr(a,e){if(!e)return;const n=la(a);if(!n)return;const r=pr(n.resolveType,e);if(!r)return;const o=Ya(r,n.data);if(o)return qa(o)}function Ft(a,e){return a.map((n,r)=>{const o=n.__resolveType??"",u=Xe(o);if(!u&&o!==""&&!o.includes("/")&&o in e){const g=e[o],v=typeof g?.name=="string"&&g.name||o.replace(/[-_]/g," ").replace(/\b\w/g,x=>x.toUpperCase())||`Section ${r+1}`;return{index:r,resolveType:o,label:v,isLazy:!1,isSavedBlock:!0}}const h=u?n.section:void 0,d=u?h?.__resolveType??"":o;if(d===Hn||d===Un){const g=u?h:n,v=Array.isArray(g?.variants)?g.variants:[];if(v.length===1&&(v[0]?.rule?.__resolveType??"")===ca){const S=v[0]?.value??{};let l=S.__resolveType??"";const _=Xe(l);return _&&(l=S.section?.__resolveType??l),{index:r,resolveType:o,label:Ke(l)||`Section ${r+1}`,isHidden:!0,isLazy:_}}const x=v[0]?.value?.__resolveType,b=x?Ke(x):"Section";return{index:r,resolveType:o,label:`Variants of ${b}`,isMultivariate:!0,isLazy:u}}const i=u?n.section?.__resolveType??o:o;if(u&&i!==""&&!i.includes("/")&&i in e){const g=e[i],v=typeof g?.name=="string"&&g.name||i.replace(/[-_]/g," ").replace(/\b\w/g,x=>x.toUpperCase())||`Section ${r+1}`;return{index:r,resolveType:o,label:v,isLazy:!0,isSavedBlock:!0}}return{index:r,resolveType:o,label:Ke(i)||`Section ${r+1}`,isLazy:u}})}const gr="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",vr="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 Dn(a){return Array.from({length:a},(e,n)=>({id:crypto.randomUUID(),index:n}))}function ss(a){return a.map((e,n)=>({...e,index:n}))}function xr(a,e){if(e===a.length)return a;if(e<a.length)return ss(a.slice(0,e));const n=Array.from({length:e-a.length},(r,o)=>({id:crypto.randomUUID(),index:a.length+o}));return[...a,...n]}function as(a){const e=$e.c(20),{section:n,raw:r,meta:o}=a,u=n.isSavedBlock===!0,h=n.isMultivariate===!0;let d;e[0]!==o||e[1]!==r?(d=r&&o?hr(r,o):void 0,e[0]=o,e[1]=r,e[2]=d):d=e[2];const i=d;let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Ia,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=g):g=e[3];let v;e[4]!==i?(v=i&&t.jsx("img",{src:i,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=i,e[5]=v):v=e[5];let x;e[6]!==h||e[7]!==u?(x=u?{color:ua}:h?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=h,e[7]=u,e[8]=x):x=e[8];let b;e[9]!==x?(b=t.jsx(qt,{className:"h-4 w-4 shrink-0",style:x}),e[9]=x,e[10]=b):b=e[10];const S=n.isHidden&&"line-through opacity-50";let l;e[11]!==S?(l=de("min-w-0 flex-1 truncate text-sm font-medium",S),e[11]=S,e[12]=l):l=e[12];let _;e[13]!==n.label||e[14]!==l?(_=t.jsx("span",{className:l,children:n.label}),e[13]=n.label,e[14]=l,e[15]=_):_=e[15];let p;return e[16]!==v||e[17]!==b||e[18]!==_?(p=t.jsxs(t.Fragment,{children:[g,v,b,_]}),e[16]=v,e[17]=b,e[18]=_,e[19]=p):p=e[19],p}function rs(a,e){const n=a.isSavedBlock===!0,r=a.isMultivariate===!0;return de("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":n?gr:r?"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 yr(a){const e=$e.c(53),{section:n,raw:r,meta:o,sortableId:u,selected:h,onSelect:d,onDelete:i,onDuplicate:g,onMakeReusable:v,onToggleHidden:x,onToggleLazy:b}=a,S=r?Xe(r.__resolveType??""):!1;let l;e[0]!==u?(l={id:u,animateLayoutChanges:kr},e[0]=u,e[1]=l):l=e[1];const{attributes:_,listeners:p,setNodeRef:R,transform:f,isDragging:w}=Jn(l);let D;e[2]!==f?(D=Zn.Transform.toString(f?{...f,x:0}:null),e[2]=f,e[3]=D):D=e[3];const j=w?0:void 0;let V;e[4]!==D||e[5]!==j?(V={transform:D,opacity:j},e[4]=D,e[5]=j,e[6]=V):V=e[6];const k=V;let $;e[7]!==n?($=mr(n),e[7]=n,e[8]=$):$=e[8];const C=$,A="button",z=0;let O;e[9]!==d?(O=H=>{(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),d())},e[9]=d,e[10]=O):O=e[10];const E=w?"cursor-grabbing":"cursor-pointer";let T;e[11]!==n||e[12]!==h||e[13]!==E?(T=de("touch-none transition-colors",E,rs(n,h)),e[11]=n,e[12]=h,e[13]=E,e[14]=T):T=e[14];let Y;e[15]!==o||e[16]!==r||e[17]!==n?(Y=t.jsx(as,{section:n,raw:r,meta:o}),e[15]=o,e[16]=r,e[17]=n,e[18]=Y):Y=e[18];const oe=!n.isMultivariate&&t.jsx(Ve,{type:"button",variant:"ghost",size:"icon","aria-label":S?"Disable async render":"Enable async render",className:de("h-7 w-7 shrink-0",S?"":"opacity-0 group-hover:opacity-100"),onClick:H=>{H.stopPropagation(),b()},onPointerDown:jr,children:t.jsx(Ba,{className:de("h-3.5 w-3.5",S&&"text-yellow-500")})});let I;e[19]!==x||e[20]!==n.isHidden||e[21]!==n.isMultivariate?(I=!n.isMultivariate&&t.jsx(Ve,{type:"button",variant:"ghost",size:"icon","aria-label":n.isHidden?"Show section":"Hide section",className:de("h-7 w-7 shrink-0",n.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:H=>{H.stopPropagation(),x()},onPointerDown:_r,children:n.isHidden?t.jsx(Fa,{className:"h-3.5 w-3.5"}):t.jsx(za,{className:"h-3.5 w-3.5"})}),e[19]=x,e[20]=n.isHidden,e[21]=n.isMultivariate,e[22]=I):I=e[22];let ie;e[23]===Symbol.for("react.memo_cache_sentinel")?(ie=t.jsx(Gt,{asChild:!0,children:t.jsx(Ve,{type:"button",variant:"ghost",size:"icon","aria-label":"Section actions",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:Sr,onPointerDown:br,children:t.jsx(Wt,{className:"h-3.5 w-3.5"})})}),e[23]=ie):ie=e[23];let K;e[24]!==g?(K=H=>{H.stopPropagation(),g()},e[24]=g,e[25]=K):K=e[25];let X;e[26]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx(Yn,{className:"h-4 w-4"}),e[26]=X):X=e[26];let ae;e[27]!==K?(ae=t.jsxs(Qe,{onClick:K,children:[X,"Duplicate"]}),e[27]=K,e[28]=ae):ae=e[28];let te;e[29]!==C||e[30]!==v?(te=C&&t.jsxs(Qe,{className:vr,onClick:H=>{H.stopPropagation(),v()},children:[t.jsx(qt,{className:"h-4 w-4"}),"Make reusable"]}),e[29]=C,e[30]=v,e[31]=te):te=e[31];let W;e[32]!==i?(W=H=>{H.stopPropagation(),i()},e[32]=i,e[33]=W):W=e[33];let G;e[34]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(St,{className:"h-4 w-4"}),e[34]=G):G=e[34];let q;e[35]!==W?(q=t.jsxs(Qe,{className:"text-destructive focus:text-destructive",onClick:W,children:[G,"Delete"]}),e[35]=W,e[36]=q):q=e[36];let J;e[37]!==ae||e[38]!==te||e[39]!==q?(J=t.jsxs(Jt,{children:[ie,t.jsxs(Zt,{align:"end",className:"w-44",children:[ae,te,q]})]}),e[37]=ae,e[38]=te,e[39]=q,e[40]=J):J=e[40];let Z;return e[41]!==_||e[42]!==p||e[43]!==d||e[44]!==R||e[45]!==k||e[46]!==T||e[47]!==Y||e[48]!==oe||e[49]!==I||e[50]!==J||e[51]!==O?(Z=t.jsxs("div",{ref:R,style:k,..._,...p,role:A,tabIndex:z,onClick:d,onKeyDown:O,className:T,children:[Y,oe,I,J]}),e[41]=_,e[42]=p,e[43]=d,e[44]=R,e[45]=k,e[46]=T,e[47]=Y,e[48]=oe,e[49]=I,e[50]=J,e[51]=O,e[52]=Z):Z=e[52],Z}function br(a){return a.stopPropagation()}function Sr(a){return a.stopPropagation()}function _r(a){return a.stopPropagation()}function jr(a){return a.stopPropagation()}function kr(){return!1}function Nr(a){const e=$e.c(88),{listKey:n,rawSections:r,sections:o,meta:u,selectedIndex:h,onSelect:d,onReorder:i,onDelete:g,onDuplicate:v,onMakeReusable:x,onToggleHidden:b,onToggleLazy:S,onAddSection:l,canAddSection:_}=a,p=_===void 0?!0:_;let R;e[0]!==o.length?(R=()=>Dn(o.length),e[0]=o.length,e[1]=R):R=e[1];const[f,w]=N.useState(R),[D,j]=N.useState(null),[V,k]=N.useState(n),[$,C]=N.useState(o.length),A=N.useRef(!1);V!==n?(k(n),C(o.length),w(Dn(o.length))):$!==o.length&&(C(o.length),w(le=>xr(le,o.length)));let z;e[2]===Symbol.for("react.memo_cache_sentinel")?(z={activationConstraint:{distance:8}},e[2]=z):z=e[2];let O;e[3]===Symbol.for("react.memo_cache_sentinel")?(O={coordinateGetter:Qn},e[3]=O):O=e[3];const E=qn(vt(Gn,z),vt(Wn,O));let T;e[4]!==f?(T=f.map(wr),e[4]=f,e[5]=T):T=e[5];const Y=T;let oe;e[6]===Symbol.for("react.memo_cache_sentinel")?(oe=le=>{j(String(le.active.id))},e[6]=oe):oe=e[6];const I=oe;let ie;e[7]!==Y||e[8]!==i?(ie=le=>{j(null);const{active:P,over:U}=le;if(!U||P.id===U.id)return;const Me=Y.indexOf(String(P.id)),Oe=Y.indexOf(String(U.id));Me===-1||Oe===-1||(w(He=>ss(xt([...He],Me,Oe))),A.current=!0,requestAnimationFrame(()=>{A.current=!1}),i?.(Me,Oe))},e[7]=Y,e[8]=i,e[9]=ie):ie=e[9];const K=ie;let X;e[10]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{j(null)},e[10]=X):X=e[10];const ae=X;let te,W,G,q,J,Z,H,we,ee,ye,be,Te,_e,Se,Ce;if(e[11]!==D||e[12]!==p||e[13]!==f||e[14]!==Y||e[15]!==K||e[16]!==u||e[17]!==l||e[18]!==g||e[19]!==v||e[20]!==x||e[21]!==d||e[22]!==b||e[23]!==S||e[24]!==r||e[25]!==o||e[26]!==h||e[27]!==E){Se=Symbol.for("react.early_return_sentinel");e:{const le=P=>{A.current||d(P)};if(e[43]!==D||e[44]!==p||e[45]!==f||e[46]!==l||e[47]!==r||e[48]!==o){const P=D?f.find(U=>U.id===D):null;if(q=P!=null?o[P.index]:null,G=P!=null?r[P.index]:void 0,f.length===0){let U;e[52]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No sections in this page."}),e[52]=U):U=e[52];const Me=!p;let Oe;e[53]===Symbol.for("react.memo_cache_sentinel")?(Oe=t.jsx(Ht,{size:14}),e[53]=Oe):Oe=e[53];let He;e[54]!==l||e[55]!==Me?(He=t.jsxs("div",{className:"space-y-2",children:[U,t.jsxs(Ve,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Me,onClick:l,children:[Oe,"Add section"]})]}),e[54]=l,e[55]=Me,e[56]=He):He=e[56],Se=He;break e}_e=de(P&&"cursor-grabbing"),e[43]=D,e[44]=p,e[45]=f,e[46]=l,e[47]=r,e[48]=o,e[49]=G,e[50]=q,e[51]=_e}else G=e[49],q=e[50],_e=e[51];W=Xn,we=E,ee=es,ye=I,be=K,Te=ae,te=ts,Z=Y,H=Ha,Ce="space-y-1",J=f.map(P=>{const U=o[P.index];return U?t.jsx(yr,{sortableId:P.id,section:U,raw:r[P.index],meta:u,selected:h===P.index,onSelect:()=>le(P.index),onDelete:()=>g(P.index),onDuplicate:()=>v(P.index),onMakeReusable:()=>x(P.index),onToggleHidden:()=>b(P.index),onToggleLazy:()=>S(P.index)},P.id):null})}e[11]=D,e[12]=p,e[13]=f,e[14]=Y,e[15]=K,e[16]=u,e[17]=l,e[18]=g,e[19]=v,e[20]=x,e[21]=d,e[22]=b,e[23]=S,e[24]=r,e[25]=o,e[26]=h,e[27]=E,e[28]=te,e[29]=W,e[30]=G,e[31]=q,e[32]=J,e[33]=Z,e[34]=H,e[35]=we,e[36]=ee,e[37]=ye,e[38]=be,e[39]=Te,e[40]=_e,e[41]=Se,e[42]=Ce}else te=e[28],W=e[29],G=e[30],q=e[31],J=e[32],Z=e[33],H=e[34],we=e[35],ee=e[36],ye=e[37],be=e[38],Te=e[39],_e=e[40],Se=e[41],Ce=e[42];if(Se!==Symbol.for("react.early_return_sentinel"))return Se;let je;e[57]!==J||e[58]!==Ce?(je=t.jsx("div",{className:Ce,children:J}),e[57]=J,e[58]=Ce,e[59]=je):je=e[59];let Re;e[60]!==te||e[61]!==Z||e[62]!==H||e[63]!==je?(Re=t.jsx(te,{items:Z,strategy:H,children:je}),e[60]=te,e[61]=Z,e[62]=H,e[63]=je,e[64]=Re):Re=e[64];let me;e[65]!==G||e[66]!==q||e[67]!==u?(me=q?t.jsx("div",{className:de("cursor-grabbing shadow-lg ring-1 ring-border/60",rs(q,!1)),children:t.jsx(as,{section:q,raw:G,meta:u})}):null,e[65]=G,e[66]=q,e[67]=u,e[68]=me):me=e[68];let ze;e[69]!==me?(ze=t.jsx(ns,{dropAnimation:null,children:me}),e[69]=me,e[70]=ze):ze=e[70];let ke;e[71]!==W||e[72]!==we||e[73]!==ee||e[74]!==ye||e[75]!==be||e[76]!==Te||e[77]!==Re||e[78]!==ze?(ke=t.jsxs(W,{sensors:we,collisionDetection:ee,onDragStart:ye,onDragEnd:be,onDragCancel:Te,children:[Re,ze]}),e[71]=W,e[72]=we,e[73]=ee,e[74]=ye,e[75]=be,e[76]=Te,e[77]=Re,e[78]=ze,e[79]=ke):ke=e[79];const Ne=!p;let fe;e[80]===Symbol.for("react.memo_cache_sentinel")?(fe=t.jsx(Ht,{size:14}),e[80]=fe):fe=e[80];let De;e[81]!==l||e[82]!==Ne?(De=t.jsxs(Ve,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:Ne,onClick:l,children:[fe,"Add section"]}),e[81]=l,e[82]=Ne,e[83]=De):De=e[83];let re;return e[84]!==_e||e[85]!==ke||e[86]!==De?(re=t.jsxs("div",{className:_e,children:[ke,De]}),e[84]=_e,e[85]=ke,e[86]=De,e[87]=re):re=e[87],re}function wr(a){return a.id}function os(a){return a===Un||a===Hn}function Qt(a,e){if(!(a in e))return null;const n=e[a]??{},r=n.__resolveType??a;return{data:{...n},resolveType:r}}function yt(a,e){const n=a.__resolveType??"";if(!n)return null;if(Xe(n)){const r=a.section??{};return is(r,e)}if(os(n)){const r=a.variants?.[0]?.value;return r?yt(r,e):null}return!n.includes("/")&&n in e?Qt(n,e):{data:{...a},resolveType:n}}function is(a,e){const n=a.__resolveType??"";if(!n)return null;if(os(n)){const r=a.variants?.[0]?.value;return r?yt(r,e):null}return!n.includes("/")&&n in e?Qt(n,e):{data:{...a},resolveType:n}}function at(a,e,n){if(e.isMultivariate)return null;if(e.isSavedBlock){const r=e.isLazy?a.section?.__resolveType??a.__resolveType:a.__resolveType;return Qt(r,n)}if(e.isHidden){const u=(Xe(a.__resolveType)?a.section:a)?.variants?.[0]?.value??a;return yt(u,n)}if(e.isLazy||Xe(a.__resolveType)){const r=a.section??{};return is(r,n)}return yt(a,n)}const Tr=[[/always|matchalways/i,"Users03"],[/device|matchdevice/i,"Phone02"],[/date|matchdate/i,"Calendar"],[/random|matchrandom/i,"Shuffle01"],[/host|matchhost/i,"Globe02"],[/location|matchlocation/i,"MarkerPin01"],[/pathname/i,"Link03"],[/cron|matchcron/i,"Clock"],[/multi|matchmulti/i,"FilterLines"],[/never|matchnever/i,"EyeOff"],[/environment|matchenvironment/i,"Cloud01"],[/eq\.ts|\/eq$/i,"Brackets"],[/user|requser|isdecouser/i,"User01"],[/site|template/i,"LayoutAlt01"]],Cr={"device-mobile":"Phone02","device-desktop":"Monitor01","device-tablet":"Tablet01","calendar-event":"Calendar","calendar-month":"Calendar",clock:"Clock","current-location":"MarkerPin01","map-2":"MarkerPin01","world-search":"Globe02",shuffle:"Shuffle01",filter:"FilterLines","eye-off":"EyeOff",flask:"Beaker02",link:"Link03","git-merge":"GitBranch01",users:"Users03",flag:"Flag01","cloud-storm":"Cloud01",campaign:"Announcement01",experiment:"Beaker02",language:"Globe02","hand-click":"CursorClick01"};function Bt(a){return bt(a)!==void 0}function Xt(a,e){if(e){if(Bt(e))return e;const n=Cr[e];if(n&&Bt(n))return n}for(const[n,r]of Tr)if(n.test(a)&&Bt(r))return r;return"FilterLines"}function Rr(a){return bt(a)??ir}function An(a){const e=$e.c(11),{iconName:n,size:r,className:o}=a,u=r===void 0?"md":r;let h;e[0]!==n?(h=Rr(n),e[0]=n,e[1]=h):h=e[1];const d=h,i=u==="sm"?"size-7":"size-9",g=u==="sm"?16:18;let v;e[2]!==i||e[3]!==o?(v=de("flex shrink-0 items-center justify-center rounded-full bg-muted",i,o),e[2]=i,e[3]=o,e[4]=v):v=e[4];let x;e[5]!==d||e[6]!==g?(x=t.jsx(d,{size:g,className:"text-muted-foreground"}),e[5]=d,e[6]=g,e[7]=x):x=e[7];let b;return e[8]!==v||e[9]!==x?(b=t.jsx("div",{className:v,children:x}),e[8]=v,e[9]=x,e[10]=b):b=e[10],b}const ls="Users03";function Dr(a){const e=a.manifest?.blocks??{},n=[];for(const[r,o]of Object.entries(e))if(r.includes("matchers"))for(const u of Object.keys(o)){if(u.includes("always"))continue;const h=da(u,a);n.push({resolveType:u,title:h.title??Ke(u),description:h.description,iconName:Xt(u,h.icon)})}return n}function Ar(a,e){if(!a)return ls;const n=e.find(r=>r.resolveType===a);return n?n.iconName:Xt(a)}function Pn(a){const e=$e.c(41),{currentRt:n,currentLabel:r,matchers:o,onSelect:u}=a,[h,d]=N.useState(!1);let i;if(e[0]!==n||e[1]!==o){const E=Ar(n,o);i=bt(E),e[0]=n,e[1]=o,e[2]=i}else i=e[2];const g=i;let v;e[3]!==u?(v=E=>{u(E),d(!1)},e[3]=u,e[4]=v):v=e[4];const x=v;let b;e[5]===Symbol.for("react.memo_cache_sentinel")?(b=()=>d(!0),e[5]=b):b=e[5];let S;e[6]!==g?(S=g&&t.jsx(g,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),e[6]=g,e[7]=S):S=e[7];let l;e[8]!==r?(l=t.jsx("span",{className:"flex-1 truncate",children:r}),e[8]=r,e[9]=l):l=e[9];let _;e[10]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx($n,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),e[10]=_):_=e[10];let p;e[11]!==S||e[12]!==l?(p=t.jsxs("button",{type:"button",onClick:b,className:"flex h-10 w-full items-center gap-2 rounded-md border border-input bg-transparent px-3 text-left text-sm shadow-xs transition-colors hover:bg-accent/40 cursor-pointer",children:[S,l,_]}),e[11]=S,e[12]=l,e[13]=p):p=e[13];let R;e[14]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(nr,{placeholder:"Search rules..."}),e[14]=R):R=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(sr,{children:"No rules found."}),e[15]=f):f=e[15];let w;e[16]!==x?(w=()=>x(""),e[16]=x,e[17]=w):w=e[17];const D=!n&&"bg-accent/60";let j;e[18]!==D?(j=de("gap-2.5",D),e[18]=D,e[19]=j):j=e[19];let V;e[20]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(An,{iconName:ls,size:"sm"}),e[20]=V):V=e[20];let k;e[21]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[t.jsx("span",{className:"text-sm",children:"Always"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:"Target all users"})]}),e[21]=k):k=e[21];let $;e[22]!==w||e[23]!==j?($=t.jsxs(Tn,{value:"always Target all users",onSelect:w,className:j,children:[V,k]}),e[22]=w,e[23]=j,e[24]=$):$=e[24];let C;if(e[25]!==n||e[26]!==x||e[27]!==o){let E;e[29]!==n||e[30]!==x?(E=T=>t.jsxs(Tn,{value:`${T.title} ${T.resolveType} ${T.description??""}`,onSelect:()=>x(T.resolveType),className:de("gap-2.5",n===T.resolveType&&"bg-accent/60"),children:[t.jsx(An,{iconName:T.iconName,size:"sm"}),t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[t.jsx("span",{className:"text-sm",children:T.title}),T.description&&t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:T.description})]})]},T.resolveType),e[29]=n,e[30]=x,e[31]=E):E=e[31],C=o.map(E),e[25]=n,e[26]=x,e[27]=o,e[28]=C}else C=e[28];let A;e[32]!==$||e[33]!==C?(A=t.jsxs(ar,{children:[f,t.jsxs(rr,{children:[$,C]})]}),e[32]=$,e[33]=C,e[34]=A):A=e[34];let z;e[35]!==h||e[36]!==A?(z=t.jsxs(or,{open:h,onOpenChange:d,title:"Choose a rule",description:"Pick how to target users for this variant",className:"sm:max-w-lg",children:[R,A]}),e[35]=h,e[36]=A,e[37]=z):z=e[37];let O;return e[38]!==z||e[39]!==p?(O=t.jsxs(t.Fragment,{children:[p,z]}),e[38]=z,e[39]=p,e[40]=O):O=e[40],O}const Pr="oklch(0.65 0.15 160)",cs="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 en(a){const e=$e.c(5),{rule:n,matchers:r}=a,o=n?.__resolveType??"";let u;if(e[0]!==r||e[1]!==o){const g=r.find(v=>v.resolveType===o)?.iconName??Xt(o);u=bt(g),e[0]=r,e[1]=o,e[2]=u}else u=e[2];const h=u;if(!h)return null;let d;return e[3]!==h?(d=t.jsx(h,{size:14,className:"shrink-0"}),e[3]=h,e[4]=d):d=e[4],d}function Mn(a){return a.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
2
2
  `)}function Kt(a){return a.map((e,n)=>({id:crypto.randomUUID(),index:n,variant:e}))}function Mr(a){return a.map((e,n)=>({...e,index:n}))}function Er(a){const e=$e.c(51),{entry:n,sortableId:r,isActive:o,canDelete:u,decofile:h,meta:d,matchers:i,onSelect:g,onRename:v,onDelete:x}=a;let b;e[0]!==r?(b={id:r,animateLayoutChanges:Or},e[0]=r,e[1]=b):b=e[1];const{attributes:S,listeners:l,setNodeRef:_,transform:p,isDragging:R}=Jn(b);let f;e[2]!==p?(f=Zn.Transform.toString(p?{...p,y:0}:null),e[2]=p,e[3]=f):f=e[3];const w=R?0:void 0;let D;e[4]!==f||e[5]!==w?(D={transform:f,opacity:w},e[4]=f,e[5]=w,e[6]=D):D=e[6];const j=D,V=d??void 0;let k;e[7]!==h||e[8]!==n.variant.rule||e[9]!==V?(k=gt(n.variant.rule,h,V),e[7]=h,e[8]=n.variant.rule,e[9]=V,e[10]=k):k=e[10];const $=k,C=o?cs:"text-muted-foreground hover:bg-muted hover:text-foreground",A=R?"cursor-grabbing":"cursor-grab";let z;e[11]!==C||e[12]!==A?(z=de("group shrink-0 inline-flex items-center rounded-md transition-colors touch-none",C,A),e[11]=C,e[12]=A,e[13]=z):z=e[13];let O;e[14]!==$||e[15]!==i?(O=t.jsx(en,{rule:$,matchers:i}),e[14]=$,e[15]=i,e[16]=O):O=e[16];let E;e[17]!==n.variant.label?(E=t.jsx("span",{className:"truncate",children:n.variant.label}),e[17]=n.variant.label,e[18]=E):E=e[18];let T;e[19]!==S||e[20]!==l||e[21]!==g||e[22]!==O||e[23]!==E?(T=t.jsxs("button",{type:"button",...S,...l,onClick:g,className:"inline-flex items-center gap-1.5 h-8 pl-3 pr-1.5 text-sm font-medium cursor-[inherit]",children:[O,E]}),e[19]=S,e[20]=l,e[21]=g,e[22]=O,e[23]=E,e[24]=T):T=e[24];const Y=`Actions for ${n.variant.label}`,oe=o&&"opacity-100";let I;e[25]!==oe?(I=de("inline-flex h-8 w-6 items-center justify-center pr-1 cursor-pointer transition-opacity","opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100",oe),e[25]=oe,e[26]=I):I=e[26];let ie;e[27]===Symbol.for("react.memo_cache_sentinel")?(ie=t.jsx(Wt,{size:12}),e[27]=ie):ie=e[27];let K;e[28]!==Y||e[29]!==I?(K=t.jsx(Gt,{asChild:!0,children:t.jsx("button",{type:"button","aria-label":Y,onClick:$r,onPointerDown:Vr,className:I,children:ie})}),e[28]=Y,e[29]=I,e[30]=K):K=e[30];let X;e[31]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx(lr,{size:14}),e[31]=X):X=e[31];let ae;e[32]!==v?(ae=t.jsxs(Qe,{onClick:v,children:[X,"Rename"]}),e[32]=v,e[33]=ae):ae=e[33];let te;e[34]===Symbol.for("react.memo_cache_sentinel")?(te=t.jsx(Ka,{}),e[34]=te):te=e[34];const W=!u;let G;e[35]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(St,{size:14}),e[35]=G):G=e[35];let q;e[36]!==x||e[37]!==W?(q=t.jsxs(Qe,{variant:"destructive",disabled:W,onClick:x,children:[G,"Delete"]}),e[36]=x,e[37]=W,e[38]=q):q=e[38];let J;e[39]!==ae||e[40]!==q?(J=t.jsxs(Zt,{align:"start",className:"w-36",children:[ae,te,q]}),e[39]=ae,e[40]=q,e[41]=J):J=e[41];let Z;e[42]!==K||e[43]!==J?(Z=t.jsxs(Jt,{children:[K,J]}),e[42]=K,e[43]=J,e[44]=Z):Z=e[44];let H;return e[45]!==_||e[46]!==j||e[47]!==T||e[48]!==Z||e[49]!==z?(H=t.jsxs("div",{ref:_,style:j,className:z,children:[T,Z]}),e[45]=_,e[46]=j,e[47]=T,e[48]=Z,e[49]=z,e[50]=H):H=e[50],H}function Vr(a){return a.stopPropagation()}function $r(a){return a.stopPropagation()}function Or(){return!1}function Lr(a){const e=$e.c(13),{variant:n,decofile:r,meta:o,matchers:u}=a,h=o??void 0;let d;e[0]!==r||e[1]!==h||e[2]!==n.rule?(d=gt(n.rule,r,h),e[0]=r,e[1]=h,e[2]=n.rule,e[3]=d):d=e[3];const i=d;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=de("inline-flex items-center gap-1.5 h-8 pl-3 pr-3 text-sm font-medium rounded-md shadow-lg ring-1 ring-border/60 cursor-grabbing",cs),e[4]=g):g=e[4];let v;e[5]!==i||e[6]!==u?(v=t.jsx(en,{rule:i,matchers:u}),e[5]=i,e[6]=u,e[7]=v):v=e[7];let x;e[8]!==n.label?(x=t.jsx("span",{className:"truncate",children:n.label}),e[8]=n.label,e[9]=x):x=e[9];let b;return e[10]!==v||e[11]!==x?(b=t.jsxs("div",{className:g,children:[v,x]}),e[10]=v,e[11]=x,e[12]=b):b=e[12],b}function zr(a){const e=$e.c(77),{listKey:n,variants:r,activeIndex:o,decofile:u,meta:h,matchers:d,onSelect:i,onReorder:g,onRename:v,onDelete:x,onAdd:b}=a;let S;e[0]!==r?(S=()=>Kt(r),e[0]=r,e[1]=S):S=e[1];const[l,_]=N.useState(S),[p,R]=N.useState(null),[f,w]=N.useState(n),[D,j]=N.useState(r.length);let V;e[2]!==r?(V=()=>Mn(r),e[2]=r,e[3]=V):V=e[3];const[k,$]=N.useState(V),C=N.useRef(!1),A=Mn(r);f!==n?(w(n),j(r.length),$(A),_(Kt(r))):D!==r.length?(j(r.length),$(A),_(Kt(r))):k!==A&&($(A),_(le=>r.map((P,U)=>({id:le[U]?.id??crypto.randomUUID(),index:U,variant:P}))));let z;e[4]===Symbol.for("react.memo_cache_sentinel")?(z={activationConstraint:{distance:8}},e[4]=z):z=e[4];let O;e[5]===Symbol.for("react.memo_cache_sentinel")?(O={coordinateGetter:Qn},e[5]=O):O=e[5];const E=qn(vt(Gn,z),vt(Wn,O));let T;e[6]!==l?(T=l.map(Ir),e[6]=l,e[7]=T):T=e[7];const Y=T,oe=r.length>1;let I;e[8]!==l?(I=le=>{const P=String(le.active.id);R(l.find(U=>U.id===P)??null)},e[8]=l,e[9]=I):I=e[9];const ie=I;let K;e[10]!==Y||e[11]!==g?(K=le=>{R(null);const{active:P,over:U}=le;if(!U||P.id===U.id)return;const Me=Y.indexOf(String(P.id)),Oe=Y.indexOf(String(U.id));Me===-1||Oe===-1||(_(He=>Mr(xt([...He],Me,Oe))),C.current=!0,requestAnimationFrame(()=>{C.current=!1}),g(Me,Oe))},e[10]=Y,e[11]=g,e[12]=K):K=e[12];const X=K;let ae;e[13]===Symbol.for("react.memo_cache_sentinel")?(ae=()=>{R(null)},e[13]=ae):ae=e[13];const te=ae;let W,G,q,J,Z,H,we,ee,ye,be,Te,_e;if(e[14]!==p||e[15]!==o||e[16]!==oe||e[17]!==u||e[18]!==l||e[19]!==Y||e[20]!==X||e[21]!==ie||e[22]!==d||e[23]!==h||e[24]!==x||e[25]!==v||e[26]!==i||e[27]!==E){const le=U=>{C.current||i(U)};Te="flex items-center border-b shrink-0";const P=p&&"cursor-grabbing";e[40]!==P?(be=de("flex flex-1 min-w-0 items-center gap-1.5 pl-3 pr-2 py-2 overflow-x-auto",P),e[40]=P,e[41]=be):be=e[41],G=Xn,Z=E,H=es,we=ie,ee=X,ye=te,W=ts,_e=Y,q=Ua,J=l.map(U=>t.jsx(Er,{sortableId:U.id,entry:U,isActive:U.index===o,canDelete:oe,decofile:u,meta:h,matchers:d,onSelect:()=>le(U.index),onRename:()=>v(U.index),onDelete:()=>x(U.index)},U.id)),e[14]=p,e[15]=o,e[16]=oe,e[17]=u,e[18]=l,e[19]=Y,e[20]=X,e[21]=ie,e[22]=d,e[23]=h,e[24]=x,e[25]=v,e[26]=i,e[27]=E,e[28]=W,e[29]=G,e[30]=q,e[31]=J,e[32]=Z,e[33]=H,e[34]=we,e[35]=ee,e[36]=ye,e[37]=be,e[38]=Te,e[39]=_e}else W=e[28],G=e[29],q=e[30],J=e[31],Z=e[32],H=e[33],we=e[34],ee=e[35],ye=e[36],be=e[37],Te=e[38],_e=e[39];let Se;e[42]!==W||e[43]!==q||e[44]!==J||e[45]!==_e?(Se=t.jsx(W,{items:_e,strategy:q,children:J}),e[42]=W,e[43]=q,e[44]=J,e[45]=_e,e[46]=Se):Se=e[46];let Ce;e[47]!==p||e[48]!==u||e[49]!==d||e[50]!==h?(Ce=p?t.jsx(Lr,{variant:p.variant,decofile:u,meta:h,matchers:d}):null,e[47]=p,e[48]=u,e[49]=d,e[50]=h,e[51]=Ce):Ce=e[51];let je;e[52]!==Ce?(je=t.jsx(ns,{dropAnimation:null,children:Ce}),e[52]=Ce,e[53]=je):je=e[53];let Re;e[54]!==G||e[55]!==Z||e[56]!==H||e[57]!==we||e[58]!==ee||e[59]!==ye||e[60]!==Se||e[61]!==je?(Re=t.jsxs(G,{sensors:Z,collisionDetection:H,onDragStart:we,onDragEnd:ee,onDragCancel:ye,children:[Se,je]}),e[54]=G,e[55]=Z,e[56]=H,e[57]=we,e[58]=ee,e[59]=ye,e[60]=Se,e[61]=je,e[62]=Re):Re=e[62];let me;e[63]!==be||e[64]!==Re?(me=t.jsx("div",{className:be,children:Re}),e[63]=be,e[64]=Re,e[65]=me):me=e[65];let ze;e[66]===Symbol.for("react.memo_cache_sentinel")?(ze={color:Pr},e[66]=ze):ze=e[66];let ke;e[67]===Symbol.for("react.memo_cache_sentinel")?(ke=t.jsx(Ht,{size:14}),e[67]=ke):ke=e[67];let Ne;e[68]!==b?(Ne=t.jsx(rt,{asChild:!0,children:t.jsx(Ve,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-8 shrink-0 cursor-pointer",style:ze,onClick:b,children:ke})}),e[68]=b,e[69]=Ne):Ne=e[69];let fe;e[70]===Symbol.for("react.memo_cache_sentinel")?(fe=t.jsx(ot,{side:"bottom",children:"Add variant"}),e[70]=fe):fe=e[70];let De;e[71]!==Ne?(De=t.jsx("div",{className:"shrink-0 pr-3 pl-1 py-2",children:t.jsxs(it,{children:[Ne,fe]})}),e[71]=Ne,e[72]=De):De=e[72];let re;return e[73]!==Te||e[74]!==me||e[75]!==De?(re=t.jsxs("div",{className:Te,children:[me,De]}),e[73]=Te,e[74]=me,e[75]=De,e[76]=re):re=e[76],re}function Ir(a){return a.id}function Fr(a){const e=$e.c(37),{open:n,onOpenChange:r,defaultBlockId:o,isPending:u,onSubmit:h}=a,d=o===void 0?"":o,i=u===void 0?!1:u,[g,v]=N.useState(d),[x,b]=N.useState(n);n!==x&&(b(n),n&&v(d));let S;e[0]!==i||e[1]!==r?(S=E=>{!E&&!i&&r(!1)},e[0]=i,e[1]=r,e[2]=S):S=e[2];const l=S;let _;e[3]!==g||e[4]!==i||e[5]!==h?(_=async E=>{E.preventDefault();const T=g.trim();!T||i||await h(T)},e[3]=g,e[4]=i,e[5]=h,e[6]=_):_=e[6];const p=_;let R;e[7]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsxs(Ln,{children:[t.jsx(On,{children:"Save as global"}),t.jsx(zn,{children:"Save this section as a global block so it can be reused on other pages."})]}),e[7]=R):R=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("label",{htmlFor:"block-id",className:"text-sm font-medium",children:"Block name"}),e[8]=f):f=e[8];let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=E=>v(E.target.value),e[9]=w):w=e[9];let D;e[10]!==g||e[11]!==i?(D=t.jsxs("div",{className:"py-4 space-y-2",children:[f,t.jsx(Kn,{id:"block-id",value:g,onChange:w,placeholder:"MyNewBlock",autoFocus:!0,disabled:i})]}),e[10]=g,e[11]=i,e[12]=D):D=e[12];let j;e[13]!==r?(j=()=>r(!1),e[13]=r,e[14]=j):j=e[14];let V;e[15]!==i||e[16]!==j?(V=t.jsx(Ve,{type:"button",variant:"outline",onClick:j,disabled:i,children:"Cancel"}),e[15]=i,e[16]=j,e[17]=V):V=e[17];let k;e[18]!==g||e[19]!==i?(k=!g.trim()||i,e[18]=g,e[19]=i,e[20]=k):k=e[20];let $;e[21]!==i?($=i?t.jsxs(t.Fragment,{children:[t.jsx(Yt,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=i,e[22]=$):$=e[22];let C;e[23]!==k||e[24]!==$?(C=t.jsx(Ve,{type:"submit",disabled:k,children:$}),e[23]=k,e[24]=$,e[25]=C):C=e[25];let A;e[26]!==V||e[27]!==C?(A=t.jsxs(In,{children:[V,C]}),e[26]=V,e[27]=C,e[28]=A):A=e[28];let z;e[29]!==p||e[30]!==A||e[31]!==D?(z=t.jsx(Fn,{className:"sm:max-w-md",children:t.jsxs("form",{onSubmit:p,children:[R,D,A]})}),e[29]=p,e[30]=A,e[31]=D,e[32]=z):z=e[32];let O;return e[33]!==l||e[34]!==n||e[35]!==z?(O=t.jsx(Bn,{open:n,onOpenChange:l,children:z}),e[33]=l,e[34]=n,e[35]=z,e[36]=O):O=e[36],O}const Br="oklch(0.65 0.15 160)",Kr="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)]",Hr="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 Ur(a){const e=$e.c(33),{variant:n,selected:r,canDelete:o,onSelect:u,onDuplicate:h,onDelete:d}=a;let i;e[0]!==u?(i=A=>{A.target===A.currentTarget&&(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),u())},e[0]=u,e[1]=i):i=e[1];const g=r?Hr:Kr;let v;e[2]!==g?(v=de("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors cursor-pointer",g),e[2]=g,e[3]=v):v=e[3];let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(qt,{className:"h-4 w-4 shrink-0",style:{color:Br}}),e[4]=x):x=e[4];let b;e[5]!==n.label?(b=t.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:n.label}),e[5]=n.label,e[6]=b):b=e[6];const S=`Open actions for ${n.label}`;let l;e[7]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Wt,{size:14}),e[7]=l):l=e[7];let _;e[8]!==S?(_=t.jsx(Gt,{asChild:!0,children:t.jsx(Ve,{type:"button",variant:"ghost",size:"icon","aria-label":S,className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:qr,onPointerDown:Yr,children:l})}),e[8]=S,e[9]=_):_=e[9];let p;e[10]!==h?(p=A=>{A.stopPropagation(),h()},e[10]=h,e[11]=p):p=e[11];let R;e[12]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(Yn,{size:14}),e[12]=R):R=e[12];let f;e[13]!==p?(f=t.jsxs(Qe,{onClick:p,children:[R,"Duplicate"]}),e[13]=p,e[14]=f):f=e[14];const w=!o;let D;e[15]!==d?(D=A=>{A.stopPropagation(),d()},e[15]=d,e[16]=D):D=e[16];let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(St,{size:14}),e[17]=j):j=e[17];let V;e[18]!==w||e[19]!==D?(V=t.jsxs(Qe,{variant:"destructive",disabled:w,onClick:D,children:[j,"Delete"]}),e[18]=w,e[19]=D,e[20]=V):V=e[20];let k;e[21]!==f||e[22]!==V?(k=t.jsxs(Zt,{align:"end",children:[f,V]}),e[21]=f,e[22]=V,e[23]=k):k=e[23];let $;e[24]!==k||e[25]!==_?($=t.jsxs(Jt,{children:[_,k]}),e[24]=k,e[25]=_,e[26]=$):$=e[26];let C;return e[27]!==u||e[28]!==i||e[29]!==$||e[30]!==v||e[31]!==b?(C=t.jsxs("div",{role:"button",tabIndex:0,onClick:u,onKeyDown:i,className:v,children:[x,b,$]}),e[27]=u,e[28]=i,e[29]=$,e[30]=v,e[31]=b,e[32]=C):C=e[32],C}function Yr(a){return a.stopPropagation()}function qr(a){return a.stopPropagation()}function Wr(a){const e=$e.c(25),{variants:n,selectedIndex:r,onSelect:o,onDuplicate:u,onDelete:h,onRemoveAll:d}=a,i=n.length>1;let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variants"}),e[0]=g):g=e[0];let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(St,{size:14}),e[1]=v):v=e[1];let x;e[2]!==d?(x=t.jsx(rt,{asChild:!0,children:t.jsx(Ve,{type:"button",variant:"ghost",size:"icon","aria-label":"Remove all variants",className:"size-6 text-muted-foreground hover:text-destructive",onClick:d,children:v})}),e[2]=d,e[3]=x):x=e[3];let b;e[4]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(ot,{children:"Remove all variants"}),e[4]=b):b=e[4];let S;e[5]!==x?(S=t.jsxs("div",{className:"flex items-center justify-between",children:[g,t.jsxs(it,{children:[x,b]})]}),e[5]=x,e[6]=S):S=e[6];let l;if(e[7]!==i||e[8]!==h||e[9]!==u||e[10]!==o||e[11]!==r||e[12]!==n){let R;e[14]!==i||e[15]!==h||e[16]!==u||e[17]!==o||e[18]!==r?(R=f=>t.jsx(Ur,{variant:f,selected:f.index===r,canDelete:i,onSelect:()=>o(f.index),onDuplicate:()=>u(f.index),onDelete:()=>h(f.index)},`${f.label}-${f.index}`),e[14]=i,e[15]=h,e[16]=u,e[17]=o,e[18]=r,e[19]=R):R=e[19],l=n.map(R),e[7]=i,e[8]=h,e[9]=u,e[10]=o,e[11]=r,e[12]=n,e[13]=l}else l=e[13];let _;e[20]!==l?(_=t.jsx("div",{className:"space-y-0.5",children:l}),e[20]=l,e[21]=_):_=e[21];let p;return e[22]!==S||e[23]!==_?(p=t.jsxs("div",{className:"space-y-1 border-b p-2",children:[S,_]}),e[22]=S,e[23]=_,e[24]=p):p=e[24],p}function En(a){const e=$e.c(14),{activeSchema:n,formValue:r,formResetKey:o,onFormChange:u,onBreadcrumbChange:h,emptyMessage:d,beforeForm:i,seoResolveType:g,siteDefaultSeo:v}=a;let x;e[0]!==n||e[1]!==o||e[2]!==r||e[3]!==h||e[4]!==u||e[5]!==g||e[6]!==v?(x=n&&r?g?t.jsx(tr,{schema:n,resolveType:g,value:r,formResetKey:o,onChange:u,onBreadcrumbChange:h,siteDefaultSeo:v}):t.jsx(Ut,{schema:n,value:r,onChange:u,basePath:"",breadcrumbPath:[],onBreadcrumbChange:h},o):null,e[0]=n,e[1]=o,e[2]=r,e[3]=h,e[4]=u,e[5]=g,e[6]=v,e[7]=x):x=e[7];const b=x;let S;e[8]!==d||e[9]!==b?(S=b??t.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:d}),e[8]=d,e[9]=b,e[10]=S):S=e[10];let l;return e[11]!==i||e[12]!==S?(l=t.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:t.jsxs("div",{className:"mx-auto max-w-2xl",children:[i,S]})}),e[11]=i,e[12]=S,e[13]=l):l=e[13],l}const Gr="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)]",Jr=a=>a.charAt(0).toUpperCase()+a.slice(1).toLowerCase();function Vn(a){const{start:e,end:n}=a,r=typeof e=="string"?e:"",o=typeof n=="string"?n:"";if(!r&&!o)return null;const u=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"}),h=g=>{if(!g)return null;const v=new Date(g);return Number.isNaN(v.getTime())?null:u.format(v)},d=h(r),i=h(o);return d&&i?`${d} → ${i}`:d?`From ${d}`:i?`Until ${i}`:null}function We(a){if(!a)return"Default";const e=a.__resolveType??"";if(["website/matchers/always.ts","$live/matchers/MatchAlways.ts"].includes(e)||e==="")return"Default";switch(e){case"website/matchers/never.ts":return"Hidden";case"website/matchers/device.ts":case"$live/matchers/MatchDevice.ts":{const{mobile:r,tablet:o,desktop:u,devices:h=[]}=a,d=[...h];return r&&d.push("Mobile"),o&&d.push("Tablet"),u&&d.push("Desktop"),d.length>0?d.map(Jr).join(" & "):Ke(e)}case"website/matchers/date.ts":case"$live/matchers/MatchDate.ts":return Vn(a)??Ke(e);case"website/matchers/random.ts":case"$live/matchers/MatchRandom.ts":{const{traffic:r}=a;return typeof r=="number"?`${Math.ceil(r*100)}% of sessions`:Ke(e)}case"website/matchers/host.ts":case"$live/matchers/MatchHost.ts":{const{includes:r,match:o}=a,u=[];return r&&u.push(r),o&&u.push(o),u.length>0?u.join(" - "):Ke(e)}case"website/matchers/pathname.ts":{const r=a.case,{type:o,pathname:u}=r??{};return o&&u?`Pathname ${o} ${u}`:Ke(e)}case"website/matchers/location.ts":case"$live/matchers/MatchLocation.ts":{const{includeLocations:r,excludeLocations:o}=a,u=i=>[i.city,i.regionCode,i.country].filter(Boolean).join(" - "),h=r?.[0];if(h){const i=(r?.length??0)-1;return`${u(h)}${i>0?` +${i}`:""}`}const d=o?.[0];if(d){const i=(o?.length??0)-1;return`Except ${u(d)}${i>0?` +${i}`:""}`}return"Any location"}case"website/matchers/multi.ts":case"$live/matchers/MatchMulti.ts":{const{matchers:r,op:o="AND"}=a;return r&&r.length>0?r.map(We).join(` ${o} `):Ke(e)}default:{const r=Vn(a);return r||Ke(e)||"Default"}}}function Zr(a,e){return Sa(a,e,We)}function Qr(a){const e=$e.c(13),{pageKey:n,initialName:r,initialPath:o,onFieldChange:u}=a,[h,d]=N.useState(r),[i,g]=N.useState(o),[v,x]=N.useState(n);v!==n&&(x(n),d(r),g(o));let b;e[0]!==u?(b=R=>{d(R.target.value),u("name",R.target.value)},e[0]=u,e[1]=b):b=e[1];let S;e[2]!==h||e[3]!==b?(S=t.jsx("input",{type:"text",value:h,onChange:b,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]=h,e[3]=b,e[4]=S):S=e[4];let l;e[5]!==u?(l=R=>{g(R.target.value),u("path",R.target.value)},e[5]=u,e[6]=l):l=e[6];let _;e[7]!==i||e[8]!==l?(_=t.jsx("input",{type:"text",value:i,onChange:l,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]=i,e[8]=l,e[9]=_):_=e[9];let p;return e[10]!==S||e[11]!==_?(p=t.jsxs("div",{className:"space-y-1",children:[S,_]}),e[10]=S,e[11]=_,e[12]=p):p=e[12],p}function Yl({orgSlug:a,virtualMcpId:e,branch:n,previewReady:r=!0,previewUrl:o,currentPath:u,activePageBlockKey:h=null,activeGlobalBlockKey:d=null,externalSelectedIndex:i,onSaved:g,initialEditSeo:v=!1,onExitSeo:x,onViewJsonFile:b}){const S=r?{orgSlug:a,virtualMcpId:e,branch:n}:null,{data:l,isLoading:_}=ma(S),{data:p,isLoading:R}=fa(S),[f,w]=N.useState(null),[D,j]=N.useState(null),[V,k]=N.useState(null),[$,C]=N.useState(0),[A,z]=N.useState(void 0),[O,E]=N.useState(null),[T,Y]=N.useState(null),[oe,I]=N.useState([]),[ie,K]=N.useState(0),[X,ae]=N.useState(null),[te,W]=N.useState(null),[G,q]=N.useState(!0),[J,Z]=N.useState(!1),[H,we]=N.useState(!1),[ee,ye]=N.useState(v),[be,Te]=N.useState(v);v&&!be&&(Te(!0),ye(!0),w(null),j(null),k(null),I([])),!v&&be&&Te(!1);const[_e,Se]=N.useState(null),[Ce,je]=N.useState(void 0),[Re,me]=N.useState([]),[ze,ke]=N.useState(0),[Ne,fe]=N.useState(0),[De,re]=N.useState(null),[le,P]=N.useState(null),[U,Me]=N.useState(null),Oe=ea(),He=`${a}/${e}/${n}`,_t=pa({orgSlug:a,virtualMcpId:e,branch:n}),[us,ds]=N.useState(u),[ms,fs]=N.useState(h),[ps,hs]=N.useState(d);(us!==u||ms!==h||ps!==d)&&(queueMicrotask(()=>_t.flush()),ds(u),fs(h),hs(d),w(null),j(null),k(null),C(0),E(null),Y(null),fe(0),re(null),P(null),I([]),K(s=>s+1),ye(!1),Se(null),je(void 0),me([]),ke(s=>s+1));const Ee=ha({orgSlug:a,virtualMcpId:e,branch:n}),tn=ga({orgSlug:a,virtualMcpId:e,branch:n}),[jt,nn]=N.useState(!1),kt=N.useRef(null),et=N.useRef(null),tt=N.useRef(null),Nt=N.useRef({}),Ye=N.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!r||_||R)return t.jsx("div",{className:"h-full w-full flex items-center justify-center",children:t.jsx(Yt,{size:20,className:"animate-spin text-muted-foreground"})});if(!l||!p)return t.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Could not load site data."});const sn=va(l),an=ba,pe=!!d,Ie=pe?null:h?sn.find(s=>s.key===h)??null:sn.find(s=>an(s.path)===an(u))??null,L=pe?d:Ie?.key??null,wt=pe&&d?l[d]:void 0,rn=pe&&d&&wt?xa(d,wt):pe&&d?d:"",Tt=!pe&&L&&l[L]?l[L]:null,Ct=ee&&l&&p&&L&&Ie?wn(l,{kind:"page",pageKey:L,pageName:String(Ie.name??""),path:String(Ie.path??"")},p):null,gs=ee?Tt?.seo:void 0,Rt=Ce!==void 0?Ce:gs,vs=ee?Wa(Rt):void 0,xs=Ct?.seoTypeOptions??[],ys=ee&&p?Ga(p):"",on=_e??vs??{},Dt=ee&&Ct?Ja(on,Ct):null,bs=ee&&Dt&&Za(Rt)?pt(Dt,p):null,Ss=ee?Qa(l,p)?.seoData:void 0,Fe=pe?[{label:"Default",sections:[{__resolveType:d}]}]:Zr(Tt?.sections,l??{}),ut=Fe.length>1,Ae=Math.min($,Fe.length-1),Ge=Fe[Ae],ne=Ge?.sections??[],Le=Ft(ne,l);if(pe&&d&&U!==d){Me(d);const s=ne[0],c=Le[0];if(s&&c){w(0),fe(0),I([]);const m=at(s,c,l);m&&(j(m.data),k(m.resolveType),P(null),re(null))}}!pe&&U!==null&&Me(null),Ye.current={rawSections:ne,parsedSections:Le,decofile:l??{},activePageKey:L,pageVariants:Fe,variantIndex:Ae,sectionVariantIndex:Ne,selectedSectionIndex:f};const nt=(s,c,m)=>{const y=Ze(s,c);if(!y){j(null),k(null),P(null),re(null);return}const B=jn(y,We)[m];if(!B){j(null),k(null),P(null),re(null);return}const F=_a(B.value,l);j(F?.data??null),k(F?.resolveType??null);const{resolveType:se,formValue:ce}=$t(B.rule,l,p??void 0);P(se),re(ce)};if(i!==void 0&&i!==A&&(z(i??null),typeof i=="number")){const s=ne[i],c=Le[i];if(s&&c)if(w(i),fe(0),I([]),K(m=>m+1),c.isMultivariate)nt(s,c,0);else{const m=at(s,c,l);m?(j(m.data),k(m.resolveType)):(j(null),k(null)),P(null),re(null)}}const At=V&&p?pt(V,p):null,Ue=(s,c)=>{if(!L)return;const m=It(l,L,s,Ae,Fe);Ee.mutate({blockKey:L,data:m},{onSuccess:()=>c?.onSuccess?.()??g?.(),onError:y=>xe.error(`Save failed: ${y.message}`)})},lt=()=>{w(null),j(null),k(null),fe(0),re(null),P(null),I([]),K(s=>s+1)},_s=(s,c)=>{kt.current&&clearTimeout(kt.current);const m=Ye.current.sectionVariantIndex;kt.current=setTimeout(()=>{const{rawSections:y,parsedSections:M,decofile:B,activePageKey:F,pageVariants:se,variantIndex:ce}=Ye.current,Q=y[c];if(!Q)return;const ue=M[c];if(!ue)return;if(ue.isSavedBlock){const ge=ue.isLazy?Q.section?.__resolveType??Q.__resolveType:Q.__resolveType;Ee.mutate({blockKey:ge,data:s},{onSuccess:()=>g?.(),onError:ve=>xe.error(`Save failed: ${ve.message}`)});return}if(!F)return;const he={...B[F]},Pe=[...y];if(ue.isMultivariate){const ge=Ze(Q,ue);if(!ge||!F)return;const ve=Oa(ge,m,s);Pe[c]=ht(Q,ue,ve)}else if(ue.isHidden){const ge=Xe(Q.__resolveType),ve=ge?{...Q.section}:{...Q},Be=Array.isArray(ve.variants)?[...ve.variants]:[];Be[0]&&(Be[0]={...Be[0],value:s}),ve.variants=Be,ge?Pe[c]={...Q,section:ve}:Pe[c]=ve}else ue.isLazy?Pe[c]={...Q,section:s}:Pe[c]=s;if(se.length>1){const ge=he.sections,ve=[...ge?.variants??[]];ve[ce]&&(ve[ce]={...ve[ce],value:Pe}),he.sections={...ge,variants:ve}}else he.sections=Pe;Ee.mutate({blockKey:F,data:he},{onSuccess:()=>g?.(),onError:ge=>xe.error(`Save failed: ${ge.message}`)})},zt)},js=s=>{w(s),fe(0),I([]),K(M=>M+1);const c=ne[s],m=Le[s];if(!c||!m)return;if(m.isMultivariate){nt(c,m,0);return}const y=at(c,m,l);if(!y){j(null),k(null),P(null),re(null);return}j(y.data),k(y.resolveType),P(null),re(null)},ln=s=>{const c=s;j(c),f!==null&&_s(c,f)},Pt=s=>{if(!L||!l||!p||!Ie)return;const c={kind:"page",pageKey:L,pageName:String(Ie.name??""),path:String(Ie.path??"")},m=wn(l,c,p);m&&_t.save(L,()=>{const y=Oe.getQueryData(ta.decofile(He))?.[L];if(!y||typeof y!="object"||y===null||Array.isArray(y))return null;const M={...y,...Nt.current};return Nt.current={},s?.raw!==void 0?{...M,seo:s.raw}:s?.inner!==void 0?er(c,m,M,s.inner):M})},ks=(s,c)=>{L&&(Nt.current[s]=c,Pt())},Ns=(s,c)=>{if(!L)return;const m=xt([...ne],s,c);f!==null&&(f===s?w(c):s<f&&c>=f?w(f-1):s>f&&c<=f&&w(f+1)),Ue(m)},ws=s=>{if(!L)return;const c=ne.filter((m,y)=>y!==s);f===s?lt():f!==null&&f>s&&w(f-1),Ue(c)},Ts=s=>{if(!L)return;const c=ne[s];if(!c)return;const m=[...ne];m.splice(s+1,0,dr(c)),f!==null&&f>s&&w(f+1),Ue(m)},Cs=s=>{if(!L)return;const c=ne[s],m=Le[s];if(!c||!m||m.isMultivariate)return;const y=m.isHidden?Da(c):Aa(c);if(!y)return;const M=[...ne];M[s]=y,f===s&&lt(),Ue(M)},Rs=s=>{if(!L)return;const c=ne[s],m=Le[s];if(!c||!m||m.isMultivariate)return;const y=Ra(c);if(!y)return;const M=[...ne];M[s]=y,f===s&&lt(),Ue(M)},Ds=s=>{if(!L)return;const c=[...ne,{__resolveType:s.resolveType}],m=c.length-1;Ue(c,{onSuccess:()=>{Z(!1),w(m),fe(0),I([]),K(F=>F+1);const y=c[m],M=Ft(c,l)[m];if(!y||!M)return;if(M.isMultivariate){nt(y,M,0);return}const B=at(y,M,l);if(!B){j(null),k(null),P(null),re(null);return}j(B.data),k(B.resolveType),P(null),re(null)}})},As=s=>{if(f===null)return;const c=ne[f],m=Le[f];!c||!m?.isMultivariate||(fe(s),I([]),K(y=>y+1),nt(c,m,s))},Ps=s=>{if(f===null||!L)return;const c=ne[f],m=Le[f];if(!c||!m?.isMultivariate)return;const y=Ze(c,m);if(!y)return;const M=Ta(y,s);if(!M){xe.error("Cannot delete the only variant.");return}const B=[...ne];B[f]=ht(c,m,M);const F=M.variants;let se=Ne;s===Ne?se=Math.min(s,F.length-1):s<Ne&&(se=Ne-1),fe(se),I([]),K(ce=>ce+1),nt(B[f],m,se),Ue(B)},Ms=s=>{if(f===null||!L)return;const c=ne[f],m=Le[f];if(!c||!m?.isMultivariate)return;const y=Ze(c,m);if(!y)return;const M=Ca(y,s),B=[...ne];B[f]=ht(c,m,M);const F=s+1;fe(F),I([]),K(se=>se+1),nt(B[f],m,F),Ue(B)},Es=()=>{if(f===null||!L)return;const s=ne[f],c=Le[f];if(!s||!c?.isMultivariate)return;const m=Ze(s,c);if(!m)return;const y=wa(s,c,m);if(!y){xe.error("Could not remove variants.");return}const M=[...ne];M[f]=y;const B=Ft(M,l)[f];if(!B)return;fe(0),P(null),re(null),I([]),K(se=>se+1);const F=at(y,B,l);F?(j(F.data),k(F.resolveType)):(j(null),k(null)),Ue(M)},Vs=async s=>{if(X===null||!L)return;const c=Rn(s,l);if(c){xe.error(c);return}const m=ne[X],y=Le[X];if(!m||!y)return;const M=at(m,y,l);if(!M){xe.error("This section cannot be saved as global.");return}const B={...M.data,name:s};try{await Ee.mutateAsync({blockKey:s,data:B});const F=[...ne];F[X]={__resolveType:s},await Ee.mutateAsync({blockKey:L,data:It(l,L,F,Ae,Fe)}),f===X&&lt(),ae(null),xe.success(`Saved global block "${s}"`),g?.()}catch(F){xe.error(F instanceof Error?F.message:"Failed to save global block")}},cn=Ge?.rule;if(ut&&f===null&&T===null&&cn){const{resolveType:s,formValue:c}=$t(cn,l??{},p??void 0);Y(s),E(c)}const dt=p?Dr(p):[],$s=!pe&&!!(o&&p&&l),un=T&&p?pt(T,p):null,Os=()=>{et.current&&(clearTimeout(et.current),et.current=null),tt.current&&(clearTimeout(tt.current),tt.current=null)},dn=async(s,c)=>{if(!(La(c,s,p)>0))try{await tn.mutateAsync({blockKey:s})}catch(m){xe.error(m instanceof Error?m.message:"Could not delete matcher block")}},mn=s=>{et.current&&clearTimeout(et.current),et.current=setTimeout(()=>{const{activePageKey:c,decofile:m,variantIndex:y}=Ye.current;if(!c)return;const M={...m[c]},B={...M.sections},F=[...B.variants??[]],se=F[y],ce=se?.rule;if(Ot(ce,m,p)){const Q=ce?.__resolveType??"",ue=m[Q],he=typeof ue?.name=="string"?ue.name:Q,{__resolveType:Pe,...ge}=s;Ee.mutate({blockKey:Q,data:Lt(Pe??"",ge,he)},{onSuccess:()=>g?.(),onError:ve=>xe.error(`Save failed: ${ve.message}`)});return}se&&(F[y]={...se,rule:s}),M.sections={...B,variants:F},Ee.mutate({blockKey:c,data:M},{onSuccess:()=>g?.(),onError:Q=>xe.error(`Save failed: ${Q.message}`)})},zt)},Ls=s=>{Y(s);const c=s?{__resolveType:s}:{__resolveType:Nn};E({}),mn(c)},zs=s=>{const c=s;E(c);const m=T?{__resolveType:T,...c}:{...c};mn(m)},fn=s=>{tt.current&&clearTimeout(tt.current);const{selectedSectionIndex:c,sectionVariantIndex:m}=Ye.current;c!==null&&(tt.current=setTimeout(()=>{const{rawSections:y,parsedSections:M,decofile:B,activePageKey:F,pageVariants:se,variantIndex:ce}=Ye.current;if(!F)return;const Q=y[c],ue=M[c];if(!Q||!ue?.isMultivariate)return;const he=Ze(Q,ue);if(!he)return;const Pe=$a(he,m,s),ge=[...y];ge[c]=ht(Q,ue,Pe);const ve=It(B,F,ge,ce,se);Ee.mutate({blockKey:F,data:ve},{onSuccess:()=>g?.(),onError:Be=>xe.error(`Save failed: ${Be.message}`)})},zt))},Is=s=>{P(s),re({}),fn(s?{__resolveType:s}:{__resolveType:Nn})},Fs=s=>{const c=s;re(c);const m=le?{__resolveType:le,...c}:{...c};fn(m)};if(!pe&&!Ie)return t.jsxs("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:["No page found for ",u]});if(pe&&!wt)return t.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Global block not found"});const Je=f!==null?Le[f]??null:null,pn=f!==null?ne[f]:null,hn=pn&&Je?.isMultivariate?Ze(pn,Je):null,mt=hn?jn(hn,We):[],gn=Math.min(Ne,Math.max(mt.length-1,0)),Mt=mt[gn]??null,st=Je?.isMultivariate===!0,ct=f!==null&&Je!==null&&(st||!!(At&&D)),Bs=ct&&!pe&&Je?.isSavedBlock===!0,qe=pe||Bs,Ks=pe?rn:Je?.label??"",vn=le&&p?pt(le,p):null,Et=ct&&(!pe||oe.length>0)?pe?[rn,...oe]:[Ie.name,Je.label,...st&&Mt?[Mt.label]:[],...oe]:[],Hs=ee&&Ie?[Ie.name,"SEO",...Re]:[],xn=ee?Hs:qe?Et.length>0?Et:[Ks]:Et,yn=()=>{if(!L)return;const s=l[L],c=ja(s.sections,ne);if(!c)return;const m=ka(c);Ee.mutate({blockKey:L,data:{...s,sections:c}},{onSuccess:()=>{C(m),w(null),j(null),k(null),I([]),E(null),Y(null)},onError:y=>xe.error(`Save failed: ${y.message}`)})},bn=(s,c,m)=>{if(!L)return;const y=l[L],M=y.sections;if(!M||typeof M!="object"||Array.isArray(M))return;const B=M;if(!Array.isArray(B.variants))return;const F=s([...B.variants]);if(!F)return;const se=Va(B,F),ce={...l,[L]:{...y,sections:se}};Ee.mutate({blockKey:L,data:ce[L]},{onSuccess:()=>{c?.(),m&&dn(m,ce)},onError:Q=>xe.error(`Save failed: ${Q.message}`)})},Us=s=>{W(null),C(s),w(null),j(null),k(null),I([]);const c=Fe[s]?.rule,{resolveType:m,formValue:y}=$t(c,l??{},p??void 0);Y(m),E(y)},Ys=(s,c)=>{s!==c&&(Ae===s?C(c):s<Ae&&c>=Ae?C(Ae-1):s>Ae&&c<=Ae&&C(Ae+1),bn(m=>xt(m,s,c)))},qs=s=>{const c=Fe[s]?.rule,m=Na(c,l??{},p??void 0);bn(y=>y.length<=1?null:(y.splice(s,1),y),()=>{Fe.length-1===1?C(0):s<Ae?C(Ae-1):s===Ae&&C(Math.max(0,s-1)),w(null),j(null),k(null),I([]),E(null),Y(null)},m)},Ws=async(s,c)=>{Os();const m=Ye.current.activePageKey,y=Ye.current.decofile;if(!m)return;const M=y[m],B=M.sections;if(!B||typeof B!="object"||Array.isArray(B))return;const F=B;if(!Array.isArray(F.variants))return;const se=[...F.variants],ce=se[s];if(!ce?.rule||typeof ce.rule!="object"){xe.error("This variant has no matcher rule to rename.");return}const Q=ce.rule,ue=c.trim();nn(!0);try{if(!ue){if(!Ot(Q,y,p)){W(null);return}const Vt=Q.__resolveType??"";se[s]={...ce,rule:Pa(Q,y,p)};const _n={...y,[m]:{...M,sections:{...F,variants:se}}};await Ee.mutateAsync({blockKey:m,data:_n[m]}),await dn(Vt,_n),W(null),g?.();return}const he=Ma(Q,y,p);if(!he){xe.error("Could not read this variant's matcher rule.");return}if(he.blockKey){await Ee.mutateAsync({blockKey:he.blockKey,data:Lt(he.resolveType,he.data,ue)}),W(null),g?.();return}const Pe=Cn(ue),ge=Rn(Pe,y);if(ge){xe.error(ge);return}const ve=Lt(he.resolveType,he.data,ue);let Be=null;try{await Ee.mutateAsync({blockKey:Pe,data:ve}),Be=Pe,se[s]={...ce,rule:Ea(Pe)},await Ee.mutateAsync({blockKey:m,data:{...M,sections:{...F,variants:se}}}),Be=null}catch(Vt){throw Be&&await tn.mutateAsync({blockKey:Be}).catch(()=>{}),Vt}W(null),xe.success(`Saved matcher as global block "${ue}"`),g?.()}catch(he){xe.error(he instanceof Error?he.message:"Failed to rename variant")}finally{nn(!1)}},Sn=()=>{lt()},Gs=s=>{Se(s),Pt({inner:s})},Js=s=>{je(s),Pt({raw:s})},Zs=()=>{Se(null),me([])},Qs=()=>ke(s=>s+1),Xs=s=>{if(ee){if(s===0){_t.flush(),ye(!1),Se(null),je(void 0),me([]),ke(m=>m+1),x?.();return}if(s===1){me([]),ke(m=>m+1);return}me(Re.slice(0,s-1)),ke(m=>m+1);return}if(pe){I(oe.slice(0,s)),K(m=>m+1);return}if(s===0){Sn();return}if(s===1){I([]),K(m=>m+1);return}if(st&&s===2){I([]),K(m=>m+1);return}const c=st?2:1;I(oe.slice(0,s-c))};return t.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[t.jsx("div",{className:"shrink-0",children:qe||ct||ee?t.jsxs("div",{className:de("border-b px-3 py-2.5",qe&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!pe&&ut&&Ge&&t.jsxs("button",{type:"button",onClick:Sn,title:`Editing in variant: ${Ge.label}`,className:de("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",Gr),children:[t.jsx(en,{rule:gt(Ge.rule,l??{},p??void 0),matchers:dt}),t.jsx("span",{className:"max-w-[160px] truncate",children:Ge.label})]}),t.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:xn.map((s,c)=>{const m=c===xn.length-1;return t.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[c>0&&t.jsx(na,{className:"size-3 shrink-0 text-muted-foreground/60"}),t.jsx("button",{type:"button",onClick:()=>Xs(c),title:s,className:de("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",m?qe?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":qe?"text-foreground/80":"text-muted-foreground",qe?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:s})]},`${s}-${c}`)})}),qe&&t.jsxs(it,{children:[t.jsx(rt,{asChild:!0,children:t.jsx("span",{className:"shrink-0 cursor-help",children:t.jsx(ia,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),t.jsx(ot,{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."})]})]}),qe&&t.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."})]}):t.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx(Qr,{pageKey:L,initialName:Ie.name,initialPath:Ie.path,onFieldChange:ks})}),t.jsxs(it,{children:[t.jsx(rt,{asChild:!0,children:t.jsx(Ve,{type:"button",variant:"ghost",size:"icon","aria-label":"Edit SEO",className:"size-7 shrink-0",onClick:()=>ye(!0),children:t.jsx(aa,{size:14})})}),t.jsx(ot,{side:"bottom",children:"Edit SEO"})]}),t.jsxs(it,{children:[t.jsx(rt,{asChild:!0,children:t.jsx(Ve,{type:"button",variant:"ghost",size:"icon","aria-label":"View JSON",className:"size-7 shrink-0",onClick:()=>b&&L?b(L):we(!0),children:t.jsx(ra,{size:14})})}),t.jsx(ot,{side:"bottom",children:"View JSON"})]}),t.jsxs(it,{children:[t.jsx(rt,{asChild:!0,children:t.jsx(Ve,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-7 shrink-0",style:{color:"oklch(0.65 0.15 160)"},onClick:yn,children:t.jsx(oa,{size:14})})}),t.jsx(ot,{side:"bottom",children:"Add variant"})]})]})}),ut&&!ct&&!ee&&L&&t.jsx(zr,{listKey:L,variants:Fe,activeIndex:Ae,decofile:l??{},meta:p,matchers:dt,onSelect:Us,onReorder:Ys,onRename:W,onDelete:qs,onAdd:yn}),ee?t.jsx(ft,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:t.jsx("div",{className:"mx-auto max-w-2xl",children:Tt&&L?t.jsx(Xa,{rawSeo:Rt,innerSeo:on,defaultResolveType:ys,seoSchema:bs,activeResolveType:Dt,seoTypeOptions:xs,formResetKey:ze,siteDefaultSeo:Ss,onBreadcrumbChange:me,onPersistRaw:Js,onInnerChange:Gs,onClearForm:Zs,onBumpFormKey:Qs}):t.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"SEO schema not found for this site."})})})}):ct?t.jsxs(ft,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[st&&mt.length>0&&t.jsxs(t.Fragment,{children:[t.jsx(Wr,{variants:mt.map((s,c)=>({index:c,label:s.label})),selectedIndex:gn,onSelect:As,onDuplicate:Ms,onDelete:Ps,onRemoveAll:Es}),st&&t.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),t.jsx(Pn,{currentRt:le??"",currentLabel:We(Mt?.rule),matchers:dt,onSelect:Is}),vn&&De&&t.jsx("div",{className:"pt-1",children:t.jsx(Ut,{schema:vn,value:De,onChange:Fs,basePath:""})})]})]}),t.jsx(En,{activeSchema:At,formValue:D,formResetKey:ie,onFormChange:ln,onBreadcrumbChange:I,emptyMessage:"No editable fields for this variant."})]}):pe?t.jsx(ft,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx(En,{activeSchema:At,formValue:D,formResetKey:ie,onFormChange:ln,onBreadcrumbChange:I,emptyMessage:"No editable fields for this global block."})}):t.jsxs(ft,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ut&&T!==null&&t.jsxs("div",{className:de("px-3 border-b",G?"pt-3 pb-5 space-y-3":"py-2"),children:[t.jsxs("button",{type:"button",onClick:()=>q(s=>!s),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":G,children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),G?t.jsx(sa,{className:"size-3.5 shrink-0 text-muted-foreground"}):t.jsx($n,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),G&&t.jsxs("div",{className:de("space-y-3",jt&&"pointer-events-none opacity-50"),children:[t.jsx(Pn,{currentRt:T,currentLabel:kn(Ge?.rule,l??{},We,p??void 0),matchers:dt,onSelect:Ls}),un&&O&&t.jsx("div",{className:"space-y-3",children:t.jsx(Ut,{schema:un,value:O,onChange:zs,basePath:""})})]})]}),t.jsx("div",{className:"p-2 pt-3",children:t.jsx(Nr,{listKey:`${L??""}-${Ae}`,rawSections:ne,sections:Le,meta:p,selectedIndex:f,onSelect:js,onReorder:Ns,onDelete:ws,onDuplicate:Ts,onMakeReusable:ae,onToggleHidden:Cs,onToggleLazy:Rs,onAddSection:()=>Z(!0),canAddSection:$s})})]}),t.jsx(Fr,{open:X!==null,onOpenChange:s=>{s||ae(null)},defaultBlockId:X!==null?Cn(Le[X]?.label??""):"",isPending:Ee.isPending,onSubmit:Vs}),o&&t.jsx(cr,{open:J,onOpenChange:Z,meta:p,decofile:l,previewBaseUrl:o,onSelect:Ds}),H&&L&&l&&t.jsx(ya,{open:H,onOpenChange:we,pageKey:L,decofile:l}),te!==null&&t.jsx(ur,{open:!0,initialName:Ot(Fe[te]?.rule,l??{},p??void 0)?kn(Fe[te]?.rule,l??{},We,p??void 0):"",autoLabel:We(gt(Fe[te]?.rule,l??{},p??void 0)),isPending:jt,onSubmit:async s=>{await Ws(te,s)},onOpenChange:s=>{!s&&!jt&&W(null)}})]})}export{Yl as SectionsEditor};