decocms 4.86.0 → 4.86.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. package/dist/client/assets/{AlertCircle-DriHvGW8.js → AlertCircle-DfZqGdIO.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BU465nht.js → AreaChart-DXIhupUU.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-BHLBiz0J.js → ArrowUp-mYUQI3ny.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-CsopTrXA.js → ArrowUpRight-D7jEUphZ.js} +1 -1
  5. package/dist/client/assets/{CheckCircle-BSSfIVDh.js → CheckCircle-BA3THiSr.js} +1 -1
  6. package/dist/client/assets/{ChevronDown-DnuZlbXl.js → ChevronDown-BpKPHxDG.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-D8z61LL4.js → ChevronRight-ByVxw7yb.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-SvG4tBeC.js → ChevronUp-DKgNoV7g.js} +1 -1
  9. package/dist/client/assets/{Copy01-8RoWdlIb.js → Copy01-AuaMhdvh.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-ByzWfjph.js → DotsVertical-Ctyi_Fcj.js} +1 -1
  11. package/dist/client/assets/{Eye-BMB6Dsvc.js → Eye-CaHkvWGU.js} +1 -1
  12. package/dist/client/assets/{FilterLines-Cb5gzr5c.js → FilterLines-B_F076bt.js} +1 -1
  13. package/dist/client/assets/{Globe01-C6g7oQ38.js → Globe01-9M3ZtnRh.js} +1 -1
  14. package/dist/client/assets/{Globe04-CYEWS6xQ.js → Globe04-BBu3oRiw.js} +1 -1
  15. package/dist/client/assets/{HardDrive-Dv77s3h5.js → HardDrive-Czo8EXKT.js} +1 -1
  16. package/dist/client/assets/{Image01-YE-JCd5P.js → Image01-C8aqMMC0.js} +1 -1
  17. package/dist/client/assets/{Key01-C9Hax98L.js → Key01-HpKP7kjq.js} +1 -1
  18. package/dist/client/assets/{LayoutLeft-CoMgIDfR.js → LayoutLeft-BZQmnN4U.js} +1 -1
  19. package/dist/client/assets/{LinkExternal01-BYMM_QSD.js → LinkExternal01-wLaoE2BO.js} +1 -1
  20. package/dist/client/assets/{Monitor01-CDUuvvya.js → Monitor01-CCqvvSCN.js} +1 -1
  21. package/dist/client/assets/{Package-BwfmB-wY.js → Package-DXwLO7TZ.js} +1 -1
  22. package/dist/client/assets/{Palette-wIBeqOmX.js → Palette-BOYYX-x4.js} +1 -1
  23. package/dist/client/assets/{Play-CmeXDhbv.js → Play-Bhc_0wGz.js} +1 -1
  24. package/dist/client/assets/{Plus-DErQhYMo.js → Plus-BFo0Fsne.js} +1 -1
  25. package/dist/client/assets/{SearchLg-BcyXaR5Z.js → SearchLg-D_s4Wx9C.js} +1 -1
  26. package/dist/client/assets/{SearchMd-B2xdLkpr.js → SearchMd-DnmtefV6.js} +1 -1
  27. package/dist/client/assets/{Settings02-BQIoToME.js → Settings02-DcvdDwJo.js} +1 -1
  28. package/dist/client/assets/{Shield01-BnV0ErmL.js → Shield01-hx04AF4i.js} +1 -1
  29. package/dist/client/assets/{Star01-BvPb97r4.js → Star01-DVFgs_0J.js} +1 -1
  30. package/dist/client/assets/{Stars01-Dq_ij1vd.js → Stars01-B5Wh8soo.js} +1 -1
  31. package/dist/client/assets/{Stars02-D0dtbcP0.js → Stars02-PuKOl8z5.js} +1 -1
  32. package/dist/client/assets/{Sun-BNn7fIcF.js → Sun-Cw5YUhig.js} +1 -1
  33. package/dist/client/assets/{SwitchHorizontal01-B5xg5r1q.js → SwitchHorizontal01-DYptKpyt.js} +1 -1
  34. package/dist/client/assets/{Tool01-1JY4WdfO.js → Tool01-CpROxlr0.js} +1 -1
  35. package/dist/client/assets/{Tool02-CJRfU6-e.js → Tool02-C8iwn6Q8.js} +1 -1
  36. package/dist/client/assets/{Trash01-D68y5OFq.js → Trash01-zPnxi6aE.js} +1 -1
  37. package/dist/client/assets/{TrendUp01-Be3cv-nx.js → TrendUp01-ryekGRAe.js} +1 -1
  38. package/dist/client/assets/{Upload01-CPQnKMdb.js → Upload01-L8Z9Doey.js} +1 -1
  39. package/dist/client/assets/{User01-BErqEcB8.js → User01-DewcmwdK.js} +1 -1
  40. package/dist/client/assets/{Users01-CdOl2233.js → Users01-Dc2haknw.js} +1 -1
  41. package/dist/client/assets/{Users03-01ZOLPet.js → Users03-DmiDj7OC.js} +1 -1
  42. package/dist/client/assets/{X-DXgmI1I4.js → X-DvSaCzV-.js} +1 -1
  43. package/dist/client/assets/{XCircle-DY497Rjn.js → XCircle-C6mRHoZP.js} +1 -1
  44. package/dist/client/assets/{XClose-C4EmtqAA.js → XClose-CnDiE4wN.js} +1 -1
  45. package/dist/client/assets/{Zap-BPdmVchQ.js → Zap-B7fiN40E.js} +1 -1
  46. package/dist/client/assets/{ZapSquare-DiXc_WiU.js → ZapSquare-BAQcu1iA.js} +1 -1
  47. package/dist/client/assets/{ZoomOut-DO1ABQMU.js → ZoomOut-shbGcJgg.js} +1 -1
  48. package/dist/client/assets/{access-gate-Du5lQEFN.js → access-gate-BQ5nV9CM.js} +1 -1
  49. package/dist/client/assets/{add-section-modal-Cj2upX49.js → add-section-modal-CDMDYlK5.js} +1 -1
  50. package/dist/client/assets/{agent-icon-D4a2yQAy.js → agent-icon-CzJVw_PS.js} +1 -1
  51. package/dist/client/assets/{agents-list-CbWCKvO8.js → agents-list-CdJFtIq2.js} +1 -1
  52. package/dist/client/assets/{ai-providers-CTkmKKCc.js → ai-providers-DluYZyyW.js} +1 -1
  53. package/dist/client/assets/{alert-dialog-C0dmYQwl.js → alert-dialog-Y1XXElMo.js} +1 -1
  54. package/dist/client/assets/{alert-ZjKFCE6g.js → alert-j08TigIF.js} +1 -1
  55. package/dist/client/assets/{app-editor-C9vstOJe.js → app-editor-D8GIAPUq.js} +1 -1
  56. package/dist/client/assets/{auth-z6bL2iLM.js → auth-DGbJKtcV.js} +1 -1
  57. package/dist/client/assets/{auth-catchall-CTUsNjBA.js → auth-catchall-CiycU9Fr.js} +1 -1
  58. package/dist/client/assets/{auth-entry-DhkhuzaY.js → auth-entry-CYNZqOOw.js} +1 -1
  59. package/dist/client/assets/{auth-split-layout-BlG-p1RQ.js → auth-split-layout-BrESDdg5.js} +1 -1
  60. package/dist/client/assets/{authenticate-and-persist-oauth-C7P5en8H.js → authenticate-and-persist-oauth-tUtbW76M.js} +1 -1
  61. package/dist/client/assets/{automation-list-row-Bu9C738j.js → automation-list-row-Ci-vo0Ok.js} +1 -1
  62. package/dist/client/assets/automation-runs-BdqIedR2.js +87 -0
  63. package/dist/client/assets/{automations-Bnj3R1rO.js → automations-B5nmIsQw.js} +1 -1
  64. package/dist/client/assets/{autosend-DViO44x-.js → autosend-C5LHLeko.js} +1 -1
  65. package/dist/client/assets/{avatar-f9PWmWko.js → avatar-DBnOObMJ.js} +1 -1
  66. package/dist/client/assets/{badge-D-j0sOs9.js → badge-C6MoaNaP.js} +1 -1
  67. package/dist/client/assets/{block-document-Bp1KtsqP.js → block-document-aXxr97-G.js} +1 -1
  68. package/dist/client/assets/{brand-context-Ce4eNHs8.js → brand-context-CtFfSAiC.js} +1 -1
  69. package/dist/client/assets/{buckets-DFmFwZCi.js → buckets-BGwcc7oD.js} +1 -1
  70. package/dist/client/assets/{bulk-category-panel-CkjZ2spD.js → bulk-category-panel-C8XqXeAU.js} +1 -1
  71. package/dist/client/assets/{calendar-CL1lHfJI.js → calendar-DX2eI8nn.js} +1 -1
  72. package/dist/client/assets/{capability-load-error-DifNtXec.js → capability-load-error-C6Zz4eJ1.js} +1 -1
  73. package/dist/client/assets/{card-D4CJeQSR.js → card-CMA-4CeN.js} +1 -1
  74. package/dist/client/assets/{category-editor-DPATJKY9.js → category-editor-C6Be1dfI.js} +1 -1
  75. package/dist/client/assets/{chat-context-0yEIHZ6c.js → chat-context-CWKEbJVu.js} +1 -1
  76. package/dist/client/assets/{checkbox-JCl8QP8q.js → checkbox-BZmlCGR-.js} +1 -1
  77. package/dist/client/assets/{cli-auth-success-BfTlukPl.js → cli-auth-success-D834jweo.js} +1 -1
  78. package/dist/client/assets/{collection-detail-Bd8G9LY3.js → collection-detail-jPNP5mzy.js} +1 -1
  79. package/dist/client/assets/{collection-display-button-DRoGXo78.js → collection-display-button-DrgpSLTZ.js} +1 -1
  80. package/dist/client/assets/{collection-search-C0RNwRHs.js → collection-search-CwZ01sWP.js} +1 -1
  81. package/dist/client/assets/{collection-table-wrapper-ByMEj5PE.js → collection-table-wrapper-DaIANWjI.js} +1 -1
  82. package/dist/client/assets/{collection-tabs-Dhx2wMNU.js → collection-tabs-BtxGuG1G.js} +1 -1
  83. package/dist/client/assets/{command-DjqCY9Vi.js → command-Sec7WA_A.js} +1 -1
  84. package/dist/client/assets/{commerce-onboarding-D5J7bOeb.js → commerce-onboarding-DOH59RlG.js} +1 -1
  85. package/dist/client/assets/{companions-core-Bn5T5Kw9.js → companions-core-CXq5b4GI.js} +1 -1
  86. package/dist/client/assets/{connect-desktop-dialog-D_e_16jN.js → connect-desktop-dialog-aCqZE31x.js} +1 -1
  87. package/dist/client/assets/{connection-card-FP7DKtbx.js → connection-card-DNDrESB-.js} +1 -1
  88. package/dist/client/assets/{connection-detail-Cr17GhO0.js → connection-detail-CPrWbBFM.js} +1 -1
  89. package/dist/client/assets/{connection-form-helpers-C7V7pVnH.js → connection-form-helpers-l_ijwaHD.js} +1 -1
  90. package/dist/client/assets/{connections-WWFvOY1G.js → connections-F5mve2lg.js} +1 -1
  91. package/dist/client/assets/{decopilot-sse-pool-BNj5yLz-.js → decopilot-sse-pool-BOQSRcee.js} +1 -1
  92. package/dist/client/assets/{dialog-pxztKdM4.js → dialog-CvsnsHc6.js} +1 -1
  93. package/dist/client/assets/{domain-settings-IJTQ43bo.js → domain-settings-B9EhJQUW.js} +1 -1
  94. package/dist/client/assets/{drawer-eINF-fuO.js → drawer-D8dHZiX8.js} +1 -1
  95. package/dist/client/assets/{dropdown-menu-CRae2C9x.js → dropdown-menu-C1qlOMZ7.js} +1 -1
  96. package/dist/client/assets/{empty-state-DvObzH8u.js → empty-state-DA8bHc-1.js} +1 -1
  97. package/dist/client/assets/{extract-connection-data-CeFGCUkk.js → extract-connection-data-CTvABTjg.js} +1 -1
  98. package/dist/client/assets/{file-explorer-3SJ4vb--.js → file-explorer-DLyQqFEm.js} +1 -1
  99. package/dist/client/assets/{file-type-icon-zSQ0dOtZ.js → file-type-icon-DnyFLF_v.js} +1 -1
  100. package/dist/client/assets/{files-CjIuQ02f.js → files-SyN3ok5O.js} +1 -1
  101. package/dist/client/assets/{form--yMAb3ro.js → form-DWLFR7nn.js} +1 -1
  102. package/dist/client/assets/{general-B9pSq-fb.js → general-CBHFRb3j.js} +1 -1
  103. package/dist/client/assets/{github-repo-picker-Cgx6amzW.js → github-repo-picker-BnPj766W.js} +1 -1
  104. package/dist/client/assets/{hooks-C8ac-vFI.js → hooks-DPnPW1Ib.js} +1 -1
  105. package/dist/client/assets/{index-Bb03HxpV.js → index-B4M08Kup.js} +1 -1
  106. package/dist/client/assets/{index-SNB4eexL.js → index-BOTjGzy-.js} +1 -1
  107. package/dist/client/assets/{index-BeXgUXox.js → index-BP1MoKqU.js} +2 -2
  108. package/dist/client/assets/{index-CDvq8kTD.js → index-BS_H3vZJ.js} +1 -1
  109. package/dist/client/assets/{index-BSVi3cEY.js → index-BvCHxsMv.js} +1 -1
  110. package/dist/client/assets/{index-32Z_4GES.js → index-C2u4siS5.js} +3 -3
  111. package/dist/client/assets/{index-CmqIldWF.js → index-C652yWgR.js} +1 -1
  112. package/dist/client/assets/{index-xVsqSBJP.js → index-C8qWG1s1.js} +1 -1
  113. package/dist/client/assets/{index-BsOcdcPy.js → index-CfPj3M1l.js} +1 -1
  114. package/dist/client/assets/{index-CyCC6Kib.js → index-Cg3sR771.js} +5 -5
  115. package/dist/client/assets/{index-Cx9R0N8d.js → index-CnYXLAS2.js} +1 -1
  116. package/dist/client/assets/{index-3nwYTcZz.js → index-CuO_-GZV.js} +1 -1
  117. package/dist/client/assets/{index-BFiY8eXY.js → index-D3xpdmzO.js} +1 -1
  118. package/dist/client/assets/{index-ZgzVcEPr.js → index-gs_-K8Xc.js} +1 -1
  119. package/dist/client/assets/{index-redirect-CiTCXVUI.js → index-redirect-B0vIbjhT.js} +1 -1
  120. package/dist/client/assets/{input-DNRaDhXk.js → input-Cb7CGqPN.js} +1 -1
  121. package/dist/client/assets/{integration-icon-Bj_L5G59.js → integration-icon-J19ZNMb3.js} +1 -1
  122. package/dist/client/assets/{invite-member-dialog-DTrnC4Ns.js → invite-member-dialog-BktkDK4v.js} +1 -1
  123. package/dist/client/assets/{label-DqJN0Zl6.js → label-DhK5GRHz.js} +1 -1
  124. package/dist/client/assets/{layout-BkG06DbR.js → layout-mvz0VkGf.js} +1 -1
  125. package/dist/client/assets/{login-C9VxLGwl.js → login-DnHBlyYy.js} +1 -1
  126. package/dist/client/assets/{mcp-oauth-ClvvvmOF.js → mcp-oauth-BC7utMST.js} +1 -1
  127. package/dist/client/assets/{members-CkIyByQ6.js → members-CtWVlKsQ.js} +1 -1
  128. package/dist/client/assets/{monaco-editor-D20TtRkQ.js → monaco-editor-BIYcRCql.js} +1 -1
  129. package/dist/client/assets/{monitoring-stats-row-DZJthgJ6.js → monitoring-stats-row-IQKypVBe.js} +1 -1
  130. package/dist/client/assets/{multi-select-DypU6S8g.js → multi-select-34xx2CMv.js} +1 -1
  131. package/dist/client/assets/{oauth-callback-CU0eKEdH.js → oauth-callback-BGOH4D8o.js} +1 -1
  132. package/dist/client/assets/{oauth-callback-ai-provider-4FUqXMlc.js → oauth-callback-ai-provider-PRHGkPfW.js} +1 -1
  133. package/dist/client/assets/{onboarding-C98UvNP1.js → onboarding-DLxx1gWn.js} +1 -1
  134. package/dist/client/assets/{org-install-DxjPueVj.js → org-install-Dwpb1igA.js} +1 -1
  135. package/dist/client/assets/{org-layout--0dYF5Rt.js → org-layout-bdr-vVje.js} +1 -1
  136. package/dist/client/assets/{organization-choice-BtDkbSqS.js → organization-choice-CIPEZcwe.js} +1 -1
  137. package/dist/client/assets/{orgs-Cau5_2Ta.js → orgs-od-Pv3L_.js} +1 -1
  138. package/dist/client/assets/{page-seo-form-DUIIg46E.js → page-seo-form-Dki7TfnI.js} +1 -1
  139. package/dist/client/assets/page-seo-sheet-IGjlhmAS.js +1 -0
  140. package/dist/client/assets/{popover-RIaRL7oB.js → popover-DfzsvCwC.js} +1 -1
  141. package/dist/client/assets/{post-editor-CSFQcBXM.js → post-editor-D9D6bmBX.js} +1 -1
  142. package/dist/client/assets/{primitives-CcasBN-m.js → primitives-BldH5G0Y.js} +1 -1
  143. package/dist/client/assets/{profile-CGP5jgHZ.js → profile-p6-RhyAf.js} +1 -1
  144. package/dist/client/assets/project-app-view-jcmOJAzs.js +1 -0
  145. package/dist/client/assets/record-editor-mYDnFPKa.js +1 -0
  146. package/dist/client/assets/redirect-editor-DDOBLKqx.js +1 -0
  147. package/dist/client/assets/registry-Cwg8k1bk.js +2 -0
  148. package/dist/client/assets/{registry-layout-DTfv4xqc.js → registry-layout-B0C8DhKi.js} +1 -1
  149. package/dist/client/assets/{reports-CGJDic-D.js → reports-zyK4duNr.js} +1 -1
  150. package/dist/client/assets/{require-capability-Dl7MMUtS.js → require-capability-1lcUjA-x.js} +1 -1
  151. package/dist/client/assets/{required-auth-layout-BN9gLlS8.js → required-auth-layout-B1JMkrdm.js} +1 -1
  152. package/dist/client/assets/{reset-password-Btk86aOM.js → reset-password-BqQSf4XO.js} +1 -1
  153. package/dist/client/assets/{roles-p1k02HxK.js → roles-lEZwMitt.js} +1 -1
  154. package/dist/client/assets/{search-input-DrcJxljH.js → search-input-CFD2CbeL.js} +1 -1
  155. package/dist/client/assets/{secrets-tpvThXzx.js → secrets-Duyv1ctC.js} +1 -1
  156. package/dist/client/assets/{sections-editor-BuHOy4hR.js → sections-editor-BvKO1Jmq.js} +1 -1
  157. package/dist/client/assets/{select-B_NF3ir8.js → select-DMy4CZEM.js} +1 -1
  158. package/dist/client/assets/{select-model-CD-bNwFP.js → select-model-CeH3eiDd.js} +1 -1
  159. package/dist/client/assets/{self-tool-result-CQ9Oidp5.js → self-tool-result-CrTztwJC.js} +1 -1
  160. package/dist/client/assets/{seo-editor-tD1KbIp4.js → seo-editor-C8dIZ0r1.js} +1 -1
  161. package/dist/client/assets/{settings-layout-CIwY5Rcg.js → settings-layout-DYLu6KAT.js} +1 -1
  162. package/dist/client/assets/{settings-section-qHo4Kia8.js → settings-section-C9wxXn_P.js} +1 -1
  163. package/dist/client/assets/{shell-controls-DJ7fzt-b.js → shell-controls-Dn6r6Au7.js} +1 -1
  164. package/dist/client/assets/{shell-layout-gqjfXR2N.js → shell-layout-BBgOrDIL.js} +1 -1
  165. package/dist/client/assets/{sidebar-ChQMKige.js → sidebar-odBC32K5.js} +1 -1
  166. package/dist/client/assets/{skeleton-TPY4BgOd.js → skeleton-BTXeFNOv.js} +1 -1
  167. package/dist/client/assets/{sso-DwXA1_HM.js → sso-_Rhk71dv.js} +1 -1
  168. package/dist/client/assets/{store-DrJy9eqh.js → store-BHQI7MeI.js} +1 -1
  169. package/dist/client/assets/store-registry-E2glxuZA.js +2 -0
  170. package/dist/client/assets/{studio-tools-n8590dlO.js → studio-tools-DScMFawl.js} +1 -1
  171. package/dist/client/assets/{switch-Vi8KqJDK.js → switch-Ds8K2Lh_.js} +1 -1
  172. package/dist/client/assets/{table-4z3VGMcV.js → table-BW9KHE3_.js} +1 -1
  173. package/dist/client/assets/{tabs-C1aAnItW.js → tabs-DVwZBWMX.js} +1 -1
  174. package/dist/client/assets/{textarea-BIQq3kPx.js → textarea-CTeZ2lal.js} +1 -1
  175. package/dist/client/assets/{toggle-group-Buak4Ijq.js → toggle-group-BSTIOzYn.js} +1 -1
  176. package/dist/client/assets/{toolbar-ChkgagFk.js → toolbar-CgZE309S.js} +1 -1
  177. package/dist/client/assets/{toolbar-icon-button-D0eZmrE1.js → toolbar-icon-button-8zS2muhz.js} +1 -1
  178. package/dist/client/assets/{tooltip-CpOqB12v.js → tooltip-DK2r83_Q.js} +1 -1
  179. package/dist/client/assets/{use-ai-providers-DcaGLvIS.js → use-ai-providers-DHwTb1GL.js} +1 -1
  180. package/dist/client/assets/{use-automations-CuxMc1af.js → use-automations-BJ1_8SDs.js} +1 -1
  181. package/dist/client/assets/{use-autosave-CKpQpnkI.js → use-autosave-CY_dkvOM.js} +1 -1
  182. package/dist/client/assets/{use-capability-x8vfxJ7c.js → use-capability-ML8qbFhc.js} +1 -1
  183. package/dist/client/assets/{use-clock-tick-BXhg46lH.js → use-clock-tick-D6R8tdxE.js} +1 -1
  184. package/dist/client/assets/{use-collections-CRs3mssF.js → use-collections-D6OYG-wc.js} +1 -1
  185. package/dist/client/assets/{use-connection-TbmZTa2Q.js → use-connection-B5YB38XE.js} +1 -1
  186. package/dist/client/assets/{use-copy-GJ89hYnU.js → use-copy-BkTOsha4.js} +1 -1
  187. package/dist/client/assets/{use-create-virtual-mcp-D4A9sXWT.js → use-create-virtual-mcp-mhzGZuKh.js} +1 -1
  188. package/dist/client/assets/{use-debounced-autosave-DxPGO2nZ.js → use-debounced-autosave-sFFdGAPI.js} +1 -1
  189. package/dist/client/assets/{use-debounced-value-D3KV6ORm.js → use-debounced-value-BWIL-1on.js} +1 -1
  190. package/dist/client/assets/{use-deco-credits-FWA0HDvb.js → use-deco-credits-Sg-ppvw1.js} +1 -1
  191. package/dist/client/assets/{use-decopilot-events-BAuSsk9W.js → use-decopilot-events-D35HEWEA.js} +1 -1
  192. package/dist/client/assets/{use-delete-connection-DP2vl3YF.js → use-delete-connection-Cv3MGM8b.js} +1 -1
  193. package/dist/client/assets/{use-deployment-admin-DxJ9HX0C.js → use-deployment-admin-C3okapNs.js} +1 -1
  194. package/dist/client/assets/{use-file-configs-CuD4x2Qa.js → use-file-configs-BCPI-hCq.js} +1 -1
  195. package/dist/client/assets/{use-infinite-scroll-DDA5AXOs.js → use-infinite-scroll-CAmtVNGd.js} +1 -1
  196. package/dist/client/assets/{use-join-requests-Bv2XJLBI.js → use-join-requests-mb4WWMEm.js} +1 -1
  197. package/dist/client/assets/{use-mcp-auth-status-DlG18-0i.js → use-mcp-auth-status-AcbyV1My.js} +1 -1
  198. package/dist/client/assets/{use-mcp-client-Y-YAGLhv.js → use-mcp-client-ioNtd9Ao.js} +1 -1
  199. package/dist/client/assets/{use-mcp-tools-UKnbu9YR.js → use-mcp-tools-DC9bMhqt.js} +1 -1
  200. package/dist/client/assets/{use-members-DSdmplcs.js → use-members-C5fA1N1j.js} +1 -1
  201. package/dist/client/assets/{use-mobile-Dfj2nxpB.js → use-mobile-Xv_R9Qvv.js} +1 -1
  202. package/dist/client/assets/{use-navigate-to-agent-DYHGQgra.js → use-navigate-to-agent-6EBjGP72.js} +1 -1
  203. package/dist/client/assets/{use-org-auth-client-DSB0aKlT.js → use-org-auth-client-17utjSn0.js} +1 -1
  204. package/dist/client/assets/{use-org-sso-e8s6CsXn.js → use-org-sso-DL3XEgfJ.js} +1 -1
  205. package/dist/client/assets/{use-organization-roles-Bq0KJEFt.js → use-organization-roles-CNET-j1d.js} +1 -1
  206. package/dist/client/assets/{use-organization-settings-Bj1mes2i.js → use-organization-settings-AW4Wtsqe.js} +1 -1
  207. package/dist/client/assets/{use-registry-app-UpQczPyM.js → use-registry-app-DboVWLxl.js} +1 -1
  208. package/dist/client/assets/{use-registry-connections-HQz0dDkM.js → use-registry-connections-Chwp5-AC.js} +1 -1
  209. package/dist/client/assets/{use-secrets-CyDme1l0.js → use-secrets-oaZoGdZ_.js} +1 -1
  210. package/dist/client/assets/{use-status-sounds-t_gRyaZh.js → use-status-sounds-DBpucGQh.js} +1 -1
  211. package/dist/client/assets/{use-view-mode-BE4pCHrP.js → use-view-mode-BVrJNwcR.js} +1 -1
  212. package/dist/client/assets/{use-virtual-mcp-1CuGEk-Q.js → use-virtual-mcp-ak6oQOpL.js} +1 -1
  213. package/dist/client/assets/useInfiniteQuery-DNnEgm4S.js +1 -0
  214. package/dist/client/assets/{useRouterState-B5TWQiWs.js → useRouterState-Dx8mQ23z.js} +1 -1
  215. package/dist/client/assets/useSuspenseInfiniteQuery-BX2_Qxr6.js +1 -0
  216. package/dist/client/assets/{users-BcJP-c4R.js → users-CCS1SYP5.js} +1 -1
  217. package/dist/client/assets/{variant-calendar-Caqpyytx.js → variant-calendar-WXrlvvRY.js} +1 -1
  218. package/dist/client/assets/{view-mode-toggle-DhFesbxw.js → view-mode-toggle-DoOv5WAT.js} +1 -1
  219. package/dist/client/index.html +1 -1
  220. package/dist/server/cli.js +195 -195
  221. package/dist/server/server.js +159 -159
  222. package/package.json +1 -1
  223. package/dist/client/assets/automation-runs-B-V_i0FR.js +0 -87
  224. package/dist/client/assets/page-seo-sheet-ta7l_YbU.js +0 -1
  225. package/dist/client/assets/project-app-view-DmcoaFOE.js +0 -1
  226. package/dist/client/assets/record-editor-Dd2x-h5p.js +0 -1
  227. package/dist/client/assets/redirect-editor-CNwZ4fIt.js +0 -1
  228. package/dist/client/assets/registry-BLbhzFCc.js +0 -2
  229. package/dist/client/assets/store-registry-Bsp3lSub.js +0 -2
  230. package/dist/client/assets/useInfiniteQuery-BYifa8Cc.js +0 -1
  231. package/dist/client/assets/useSuspenseInfiniteQuery-CgX7veRN.js +0 -1
@@ -1 +1 @@
1
- import{c as B,j as o,C as L,b as T,r as $,B as M,p as N}from"./index-32Z_4GES.js";import{s as q}from"./Plus-DErQhYMo.js";import{i as S}from"./Zap-BPdmVchQ.js";import{S as D}from"./search-input-DrcJxljH.js";import{P as l}from"./index-BFiY8eXY.js";import{E as b}from"./empty-state-DvObzH8u.js";import{c as O}from"./use-automations-CuxMc1af.js";import{c as V}from"./use-navigate-to-agent-DYHGQgra.js";import{A as F}from"./automation-list-row-Bu9C738j.js";import{q as G}from"./use-mcp-client-Y-YAGLhv.js";import{u as H}from"./use-virtual-mcp-1CuGEk-Q.js";import{R as J}from"./require-capability-Dl7MMUtS.js";import"./SearchMd-B2xdLkpr.js";import"./sidebar-ChQMKige.js";import"./LayoutLeft-CoMgIDfR.js";import"./use-mobile-Dfj2nxpB.js";import"./X-DXgmI1I4.js";import"./tooltip-CpOqB12v.js";import"./studio-tools-n8590dlO.js";import"./hooks-C8ac-vFI.js";import"./decopilot-sse-pool-BNj5yLz-.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./alert-dialog-C0dmYQwl.js";import"./dropdown-menu-CRae2C9x.js";import"./ChevronUp-SvG4tBeC.js";import"./ChevronRight-D8z61LL4.js";import"./DotsVertical-ByzWfjph.js";import"./Stars02-D0dtbcP0.js";import"./Trash01-D68y5OFq.js";import"./agent-icon-D4a2yQAy.js";import"./AlertCircle-DriHvGW8.js";import"./Tool01-1JY4WdfO.js";import"./ArrowUp-BHLBiz0J.js";import"./Settings02-BQIoToME.js";import"./Tool02-CJRfU6-e.js";import"./XCircle-DY497Rjn.js";import"./ArrowUpRight-CsopTrXA.js";import"./TrendUp01-Be3cv-nx.js";import"./ZapSquare-DiXc_WiU.js";import"./ZoomOut-DO1ABQMU.js";import"./Users03-01ZOLPet.js";import"./CheckCircle-BSSfIVDh.js";import"./ChevronDown-DnuZlbXl.js";import"./Copy01-8RoWdlIb.js";import"./Globe01-C6g7oQ38.js";import"./Eye-BMB6Dsvc.js";import"./FilterLines-Cb5gzr5c.js";import"./Star01-BvPb97r4.js";import"./Globe04-CYEWS6xQ.js";import"./SwitchHorizontal01-B5xg5r1q.js";import"./HardDrive-Dv77s3h5.js";import"./Image01-YE-JCd5P.js";import"./Key01-C9Hax98L.js";import"./LinkExternal01-BYMM_QSD.js";import"./Monitor01-CDUuvvya.js";import"./Sun-BNn7fIcF.js";import"./Package-BwfmB-wY.js";import"./Palette-wIBeqOmX.js";import"./Play-CmeXDhbv.js";import"./SearchLg-BcyXaR5Z.js";import"./Shield01-BnV0ErmL.js";import"./Stars01-Dq_ij1vd.js";import"./Upload01-CPQnKMdb.js";import"./User01-BErqEcB8.js";import"./Users01-CdOl2233.js";import"./XClose-C4EmtqAA.js";import"./auth-z6bL2iLM.js";import"./use-collections-CRs3mssF.js";import"./use-capability-x8vfxJ7c.js";import"./access-gate-Du5lQEFN.js";import"./capability-load-error-DifNtXec.js";function K(){const t=B.c(16),{org:i}=L(),{data:w}=O(void 0),u=w===void 0?[]:w,R=H(),k=V(),d=T(),[f,E]=$.useState(""),g=f.toLowerCase(),y=new Map(R.map(Q)),C=u.filter(e=>{if(!g||e.name.toLowerCase().includes(g))return!0;if(e.virtual_mcp_id){const a=y.get(e.virtual_mcp_id);if(a&&a.title.toLowerCase().includes(g))return!0}return!1}),P=(e,a)=>{const A=a&&y.has(a)?a:G(i.id);N("automations_list_row_clicked",{automation_id:e,agent_id:A,source:"settings_automations"}),k(A,{search:{main:"automation:"+e}})};let n;t[0]!==d||t[1]!==i.slug?(n=()=>{N("automations_empty_state_browse_agents_clicked"),d({to:"/$org/settings/agents",params:{org:i.slug}})},t[0]=d,t[1]=i.slug,t[2]=n):n=t[2];const z=n,x=l,h=l,j=l;let p;t[3]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(l.Title,{children:"Automations"}),t[3]=p):p=t[3];const _=u.length>0&&o.jsx(D,{value:f,onChange:E,placeholder:"Search automations...",className:"w-full md:w-[375px]"});let r;t[4]!==_?(r=o.jsxs("div",{className:"flex flex-col gap-6",children:[p,_]}),t[4]=_,t[5]=r):r=t[5];const v=u.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations yet",description:"Automations are created per agent. Open an agent and add one from its Automations tab.",actions:o.jsxs(M,{size:"sm",onClick:z,children:[o.jsx(q,{size:14}),"Browse agents"]})})}):C.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations found",description:`No automations match "${f}"`})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:C.map(e=>o.jsx(F,{automation:e,showAgent:!0,onClick:()=>P(e.id,e.virtual_mcp_id)},e.id))});let s;t[6]!==j.Body||t[7]!==r||t[8]!==v?(s=o.jsxs(j.Body,{children:[r,v]}),t[6]=j.Body,t[7]=r,t[8]=v,t[9]=s):s=t[9];let m;t[10]!==h.Content||t[11]!==s?(m=o.jsx(h.Content,{children:s}),t[10]=h.Content,t[11]=s,t[12]=m):m=t[12];let c;return t[13]!==x||t[14]!==m?(c=o.jsx(x,{children:m}),t[13]=x,t[14]=m,t[15]=c):c=t[15],c}function Q(t){return[t.id,t]}function fo(){const t=B.c(1);let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(J,{capability:"automations:manage",area:"automations",children:o.jsx(K,{})}),t[0]=i):i=t[0],i}export{fo as default};
1
+ import{c as B,j as o,C as L,b as T,r as $,B as M,p as N}from"./index-C2u4siS5.js";import{s as q}from"./Plus-BFo0Fsne.js";import{i as S}from"./Zap-B7fiN40E.js";import{S as D}from"./search-input-CFD2CbeL.js";import{P as l}from"./index-D3xpdmzO.js";import{E as b}from"./empty-state-DA8bHc-1.js";import{c as O}from"./use-automations-BJ1_8SDs.js";import{c as V}from"./use-navigate-to-agent-6EBjGP72.js";import{A as F}from"./automation-list-row-Ci-vo0Ok.js";import{q as G}from"./use-mcp-client-ioNtd9Ao.js";import{u as H}from"./use-virtual-mcp-ak6oQOpL.js";import{R as J}from"./require-capability-1lcUjA-x.js";import"./SearchMd-DnmtefV6.js";import"./sidebar-odBC32K5.js";import"./LayoutLeft-BZQmnN4U.js";import"./use-mobile-Xv_R9Qvv.js";import"./X-DvSaCzV-.js";import"./tooltip-DK2r83_Q.js";import"./studio-tools-DScMFawl.js";import"./hooks-DPnPW1Ib.js";import"./decopilot-sse-pool-BOQSRcee.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./alert-dialog-Y1XXElMo.js";import"./dropdown-menu-C1qlOMZ7.js";import"./ChevronUp-DKgNoV7g.js";import"./ChevronRight-ByVxw7yb.js";import"./DotsVertical-Ctyi_Fcj.js";import"./Stars02-PuKOl8z5.js";import"./Trash01-zPnxi6aE.js";import"./agent-icon-CzJVw_PS.js";import"./AlertCircle-DfZqGdIO.js";import"./Tool01-CpROxlr0.js";import"./ArrowUp-mYUQI3ny.js";import"./Settings02-DcvdDwJo.js";import"./Tool02-C8iwn6Q8.js";import"./XCircle-C6mRHoZP.js";import"./ArrowUpRight-D7jEUphZ.js";import"./TrendUp01-ryekGRAe.js";import"./ZapSquare-BAQcu1iA.js";import"./ZoomOut-shbGcJgg.js";import"./Users03-DmiDj7OC.js";import"./CheckCircle-BA3THiSr.js";import"./ChevronDown-BpKPHxDG.js";import"./Copy01-AuaMhdvh.js";import"./Globe01-9M3ZtnRh.js";import"./Eye-CaHkvWGU.js";import"./FilterLines-B_F076bt.js";import"./Star01-DVFgs_0J.js";import"./Globe04-BBu3oRiw.js";import"./SwitchHorizontal01-DYptKpyt.js";import"./HardDrive-Czo8EXKT.js";import"./Image01-C8aqMMC0.js";import"./Key01-HpKP7kjq.js";import"./LinkExternal01-wLaoE2BO.js";import"./Monitor01-CCqvvSCN.js";import"./Sun-Cw5YUhig.js";import"./Package-DXwLO7TZ.js";import"./Palette-BOYYX-x4.js";import"./Play-Bhc_0wGz.js";import"./SearchLg-D_s4Wx9C.js";import"./Shield01-hx04AF4i.js";import"./Stars01-B5Wh8soo.js";import"./Upload01-L8Z9Doey.js";import"./User01-DewcmwdK.js";import"./Users01-Dc2haknw.js";import"./XClose-CnDiE4wN.js";import"./auth-DGbJKtcV.js";import"./use-collections-D6OYG-wc.js";import"./use-capability-ML8qbFhc.js";import"./access-gate-BQ5nV9CM.js";import"./capability-load-error-C6Zz4eJ1.js";function K(){const t=B.c(16),{org:i}=L(),{data:w}=O(void 0),u=w===void 0?[]:w,R=H(),k=V(),d=T(),[f,E]=$.useState(""),g=f.toLowerCase(),y=new Map(R.map(Q)),C=u.filter(e=>{if(!g||e.name.toLowerCase().includes(g))return!0;if(e.virtual_mcp_id){const a=y.get(e.virtual_mcp_id);if(a&&a.title.toLowerCase().includes(g))return!0}return!1}),P=(e,a)=>{const A=a&&y.has(a)?a:G(i.id);N("automations_list_row_clicked",{automation_id:e,agent_id:A,source:"settings_automations"}),k(A,{search:{main:"automation:"+e}})};let n;t[0]!==d||t[1]!==i.slug?(n=()=>{N("automations_empty_state_browse_agents_clicked"),d({to:"/$org/settings/agents",params:{org:i.slug}})},t[0]=d,t[1]=i.slug,t[2]=n):n=t[2];const z=n,x=l,h=l,j=l;let p;t[3]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(l.Title,{children:"Automations"}),t[3]=p):p=t[3];const _=u.length>0&&o.jsx(D,{value:f,onChange:E,placeholder:"Search automations...",className:"w-full md:w-[375px]"});let r;t[4]!==_?(r=o.jsxs("div",{className:"flex flex-col gap-6",children:[p,_]}),t[4]=_,t[5]=r):r=t[5];const v=u.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations yet",description:"Automations are created per agent. Open an agent and add one from its Automations tab.",actions:o.jsxs(M,{size:"sm",onClick:z,children:[o.jsx(q,{size:14}),"Browse agents"]})})}):C.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations found",description:`No automations match "${f}"`})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:C.map(e=>o.jsx(F,{automation:e,showAgent:!0,onClick:()=>P(e.id,e.virtual_mcp_id)},e.id))});let s;t[6]!==j.Body||t[7]!==r||t[8]!==v?(s=o.jsxs(j.Body,{children:[r,v]}),t[6]=j.Body,t[7]=r,t[8]=v,t[9]=s):s=t[9];let m;t[10]!==h.Content||t[11]!==s?(m=o.jsx(h.Content,{children:s}),t[10]=h.Content,t[11]=s,t[12]=m):m=t[12];let c;return t[13]!==x||t[14]!==m?(c=o.jsx(x,{children:m}),t[13]=x,t[14]=m,t[15]=c):c=t[15],c}function Q(t){return[t.id,t]}function fo(){const t=B.c(1);let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(J,{capability:"automations:manage",area:"automations",children:o.jsx(K,{})}),t[0]=i):i=t[0],i}export{fo as default};
@@ -1 +1 @@
1
- import{D as a}from"./index-32Z_4GES.js";const i=1e4,m="true";function s(e,t){return a.chatAutosend(e,t)}function d(e){return e==="pending"||e==="sending"}function c(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}return!t||typeof t!="object"||typeof t.createdAt!="number"||typeof t.message!="object"||!d(t.status)?null:t}function A(e,t,r,o,u=Date.now()){const n={message:o,createdAt:u,status:"pending"};return e.setItem(s(t,r),JSON.stringify(n)),n}function f(e,t,r){const o=s(t,r),u=c(e.getItem(o));return u||(e.removeItem(o),null)}function S(e,t,r,o=Date.now()){const u=s(t,r),n=f(e,t,r);return!n||n.status!=="pending"?null:o-n.createdAt>=i?(e.removeItem(u),null):(e.setItem(u,JSON.stringify({...n,status:"sending"})),{message:n.message,createdAt:n.createdAt})}function p(e,t,r){e.removeItem(s(t,r))}export{m as A,p as a,S as c,A as w};
1
+ import{D as a}from"./index-C2u4siS5.js";const i=1e4,m="true";function s(e,t){return a.chatAutosend(e,t)}function d(e){return e==="pending"||e==="sending"}function c(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}return!t||typeof t!="object"||typeof t.createdAt!="number"||typeof t.message!="object"||!d(t.status)?null:t}function A(e,t,r,o,u=Date.now()){const n={message:o,createdAt:u,status:"pending"};return e.setItem(s(t,r),JSON.stringify(n)),n}function f(e,t,r){const o=s(t,r),u=c(e.getItem(o));return u||(e.removeItem(o),null)}function S(e,t,r,o=Date.now()){const u=s(t,r),n=f(e,t,r);return!n||n.status!=="pending"?null:o-n.createdAt>=i?(e.removeItem(u),null):(e.setItem(u,JSON.stringify({...n,status:"sending"})),{message:n.message,createdAt:n.createdAt})}function p(e,t,r){e.removeItem(s(t,r))}export{m as A,p as a,S as c,A as w};
@@ -1 +1 @@
1
- import{c as k,j as i,l as m,bC as R,cI as S,cJ as V,cK as $}from"./index-32Z_4GES.js";import{s as O}from"./User01-BErqEcB8.js";function U(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("relative flex size-8 shrink-0 overflow-hidden rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx($,{"data-slot":"avatar",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function E(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("aspect-square size-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(S,{"data-slot":"avatar-image",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function M(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("bg-muted flex size-full items-center justify-center rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(V,{"data-slot":"avatar-fallback",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}const C=["drop-shadow-lg bg-gradient-to-br from-red-100 to-red-300 text-red-800 shadow-lg shadow-red-300/40 ring-1 ring-red-300/30","drop-shadow-lg bg-gradient-to-br from-lime-100 to-lime-300 text-lime-800 shadow-lg shadow-lime-300/40 ring-1 ring-lime-300/30","drop-shadow-lg bg-gradient-to-br from-emerald-100 to-emerald-300 text-emerald-800 shadow-lg shadow-emerald-300/40 ring-1 ring-emerald-300/30","drop-shadow-lg bg-gradient-to-br from-orange-100 to-orange-300 text-orange-800 shadow-lg shadow-orange-300/40 ring-1 ring-orange-300/30","drop-shadow-lg bg-gradient-to-br from-amber-100 to-amber-300 text-amber-800 shadow-lg shadow-amber-300/40 ring-1 ring-amber-300/30","drop-shadow-lg bg-gradient-to-br from-yellow-100 to-yellow-300 text-yellow-800 shadow-lg shadow-yellow-300/40 ring-1 ring-yellow-300/30","drop-shadow-lg bg-gradient-to-br from-green-100 to-green-300 text-green-800 shadow-lg shadow-green-300/40 ring-1 ring-green-300/30","drop-shadow-lg bg-gradient-to-br from-teal-100 to-teal-300 text-teal-800 shadow-lg shadow-teal-300/40 ring-1 ring-teal-300/30","drop-shadow-lg bg-gradient-to-br from-cyan-100 to-cyan-300 text-cyan-800 shadow-lg shadow-cyan-300/40 ring-1 ring-cyan-300/30","drop-shadow-lg bg-gradient-to-br from-sky-100 to-sky-300 text-sky-800 shadow-lg shadow-sky-300/40 ring-1 ring-sky-300/30","drop-shadow-lg bg-gradient-to-br from-blue-100 to-blue-300 text-blue-800 shadow-lg shadow-blue-300/40 ring-1 ring-blue-300/30","drop-shadow-lg bg-gradient-to-br from-indigo-100 to-indigo-300 text-indigo-800 shadow-lg shadow-indigo-300/40 ring-1 ring-indigo-300/30","drop-shadow-lg bg-gradient-to-br from-violet-100 to-violet-300 text-violet-800 shadow-lg shadow-violet-300/40 ring-1 ring-violet-300/30","drop-shadow-lg bg-gradient-to-br from-purple-100 to-purple-300 text-purple-800 shadow-lg shadow-purple-300/40 ring-1 ring-purple-300/30","drop-shadow-lg bg-gradient-to-br from-fuchsia-100 to-fuchsia-300 text-fuchsia-800 shadow-lg shadow-fuchsia-300/40 ring-1 ring-fuchsia-300/30","drop-shadow-lg bg-gradient-to-br from-pink-100 to-pink-300 text-pink-800 shadow-lg shadow-pink-300/40 ring-1 ring-pink-300/30","drop-shadow-lg bg-gradient-to-br from-rose-100 to-rose-300 text-rose-800 shadow-lg shadow-rose-300/40 ring-1 ring-rose-300/30"],L="drop-shadow-lg text-muted-foreground bg-muted shadow-lg";function T(r){let e=0;for(let t=0;t<r.length;t++)e=r.charCodeAt(t)+((e<<5)-e);const s=Math.abs(e)%C.length;return C[s]}const I=R("border border-border",{variants:{shape:{circle:"rounded-full",square:""},size:{"3xs":"w-3 h-3 text-[7px] font-semibold","2xs":"w-4 h-4 text-[9px] font-semibold",xs:"w-6 h-6 text-sm font-semibold",sm:"w-8 h-8 text-lg font-semibold",base:"w-10 h-10 text-2xl font-semibold",lg:"w-12 h-12 text-3xl font-semibold",xl:"w-16 h-16 text-4xl font-semibold","2xl":"w-20 h-20 text-5xl font-semibold","3xl":"w-32 h-32 text-7xl font-semibold"}},compoundVariants:[{shape:"square",size:"xs",class:"rounded-lg"},{shape:"square",size:"sm",class:"rounded-xl"},{shape:"square",size:"base",class:"rounded-xl"},{shape:"square",size:"lg",class:"rounded-xl"},{shape:"square",size:"xl",class:"rounded-2xl"},{shape:"square",size:"2xl",class:"rounded-3xl"},{shape:"square",size:"3xl",class:"rounded-[40px]"}],defaultVariants:{shape:"square",size:"base"}}),_=R("",{variants:{objectFit:{contain:"object-contain",cover:"object-cover"}},defaultVariants:{objectFit:"cover"}}),D=r=>{const e={"3xs":8,"2xs":8,xs:12,sm:16,base:24,lg:28,xl:36,"2xl":48,"3xl":80};return e[r]||e.base};function J(r){const e=k.c(34);let s,t,o,a,n,d,g,l;e[0]!==r?({url:l,fallback:t,shape:a,size:n,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g;let x;e:{if(typeof t=="string"){let c;e[9]!==t?(c=t.trim().slice(0,2).toUpperCase(),e[9]=t,e[10]=c):c=e[10],x=c;break e}x=t}const f=x;let y;e:{if(j){y=L;break e}if(typeof t=="string"){let c;e[11]!==t?(c=T(t),e[11]=t,e[12]=c):c=e[12],y=c;break e}y=C[0]}const z=y;let N;e[13]!==l?(N=l?.startsWith("icon://"),e[13]=l,e[14]=N):N=e[14];const p=N;let q;e[15]!==p||e[16]!==l?(q=p?l?.replace("icon://",""):void 0,e[15]=p,e[16]=l,e[17]=q):q=e[17];const F=q;let w;e[18]!==s||e[19]!==b||e[20]!==h?(w=m(I({shape:b,size:h}),s),e[18]=s,e[19]=b,e[20]=h,e[21]=w):w=e[21];let v;e[22]!==z||e[23]!==f||e[24]!==F||e[25]!==p||e[26]!==u||e[27]!==h||e[28]!==l?(v=p&&F?i.jsx("div",{className:m("flex items-center justify-center w-full h-full",z),children:i.jsx(O,{size:D(h)})}):i.jsxs(i.Fragment,{children:[l&&i.jsx(E,{src:l,loading:"lazy",alt:"Avatar",className:m(_({objectFit:u}))}),i.jsx(M,{className:m(z,"rounded-none"),delayMs:l?600:0,children:f})]}),e[22]=z,e[23]=f,e[24]=F,e[25]=p,e[26]=u,e[27]=h,e[28]=l,e[29]=v):v=e[29];let A;return e[30]!==o||e[31]!==v||e[32]!==w?(A=i.jsx(U,{className:w,...o,children:v}),e[30]=o,e[31]=v,e[32]=w,e[33]=A):A=e[33],A}function K(r){const e=k.c(18);let s,t,o,a,n,d,g,l;e[0]!==r?({shape:a,size:n,url:l,fallback:t,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g,x=h??"base";let f;return e[9]!==s||e[10]!==t||e[11]!==j||e[12]!==u||e[13]!==o||e[14]!==b||e[15]!==x||e[16]!==l?(f=i.jsx(J,{shape:b,url:l,fallback:t,size:x,objectFit:u,className:s,muted:j,...o}),e[9]=s,e[10]=t,e[11]=j,e[12]=u,e[13]=o,e[14]=b,e[15]=x,e[16]=l,e[17]=f):f=e[17],f}K.Skeleton=function({shape:e="square",size:s="base",className:t}){return i.jsx("div",{className:m(I({shape:e,size:s}),"bg-muted animate-pulse",t)})};export{K as A};
1
+ import{c as k,j as i,l as m,bC as R,cI as S,cJ as V,cK as $}from"./index-C2u4siS5.js";import{s as O}from"./User01-DewcmwdK.js";function U(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("relative flex size-8 shrink-0 overflow-hidden rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx($,{"data-slot":"avatar",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function E(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("aspect-square size-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(S,{"data-slot":"avatar-image",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function M(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("bg-muted flex size-full items-center justify-center rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(V,{"data-slot":"avatar-fallback",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}const C=["drop-shadow-lg bg-gradient-to-br from-red-100 to-red-300 text-red-800 shadow-lg shadow-red-300/40 ring-1 ring-red-300/30","drop-shadow-lg bg-gradient-to-br from-lime-100 to-lime-300 text-lime-800 shadow-lg shadow-lime-300/40 ring-1 ring-lime-300/30","drop-shadow-lg bg-gradient-to-br from-emerald-100 to-emerald-300 text-emerald-800 shadow-lg shadow-emerald-300/40 ring-1 ring-emerald-300/30","drop-shadow-lg bg-gradient-to-br from-orange-100 to-orange-300 text-orange-800 shadow-lg shadow-orange-300/40 ring-1 ring-orange-300/30","drop-shadow-lg bg-gradient-to-br from-amber-100 to-amber-300 text-amber-800 shadow-lg shadow-amber-300/40 ring-1 ring-amber-300/30","drop-shadow-lg bg-gradient-to-br from-yellow-100 to-yellow-300 text-yellow-800 shadow-lg shadow-yellow-300/40 ring-1 ring-yellow-300/30","drop-shadow-lg bg-gradient-to-br from-green-100 to-green-300 text-green-800 shadow-lg shadow-green-300/40 ring-1 ring-green-300/30","drop-shadow-lg bg-gradient-to-br from-teal-100 to-teal-300 text-teal-800 shadow-lg shadow-teal-300/40 ring-1 ring-teal-300/30","drop-shadow-lg bg-gradient-to-br from-cyan-100 to-cyan-300 text-cyan-800 shadow-lg shadow-cyan-300/40 ring-1 ring-cyan-300/30","drop-shadow-lg bg-gradient-to-br from-sky-100 to-sky-300 text-sky-800 shadow-lg shadow-sky-300/40 ring-1 ring-sky-300/30","drop-shadow-lg bg-gradient-to-br from-blue-100 to-blue-300 text-blue-800 shadow-lg shadow-blue-300/40 ring-1 ring-blue-300/30","drop-shadow-lg bg-gradient-to-br from-indigo-100 to-indigo-300 text-indigo-800 shadow-lg shadow-indigo-300/40 ring-1 ring-indigo-300/30","drop-shadow-lg bg-gradient-to-br from-violet-100 to-violet-300 text-violet-800 shadow-lg shadow-violet-300/40 ring-1 ring-violet-300/30","drop-shadow-lg bg-gradient-to-br from-purple-100 to-purple-300 text-purple-800 shadow-lg shadow-purple-300/40 ring-1 ring-purple-300/30","drop-shadow-lg bg-gradient-to-br from-fuchsia-100 to-fuchsia-300 text-fuchsia-800 shadow-lg shadow-fuchsia-300/40 ring-1 ring-fuchsia-300/30","drop-shadow-lg bg-gradient-to-br from-pink-100 to-pink-300 text-pink-800 shadow-lg shadow-pink-300/40 ring-1 ring-pink-300/30","drop-shadow-lg bg-gradient-to-br from-rose-100 to-rose-300 text-rose-800 shadow-lg shadow-rose-300/40 ring-1 ring-rose-300/30"],L="drop-shadow-lg text-muted-foreground bg-muted shadow-lg";function T(r){let e=0;for(let t=0;t<r.length;t++)e=r.charCodeAt(t)+((e<<5)-e);const s=Math.abs(e)%C.length;return C[s]}const I=R("border border-border",{variants:{shape:{circle:"rounded-full",square:""},size:{"3xs":"w-3 h-3 text-[7px] font-semibold","2xs":"w-4 h-4 text-[9px] font-semibold",xs:"w-6 h-6 text-sm font-semibold",sm:"w-8 h-8 text-lg font-semibold",base:"w-10 h-10 text-2xl font-semibold",lg:"w-12 h-12 text-3xl font-semibold",xl:"w-16 h-16 text-4xl font-semibold","2xl":"w-20 h-20 text-5xl font-semibold","3xl":"w-32 h-32 text-7xl font-semibold"}},compoundVariants:[{shape:"square",size:"xs",class:"rounded-lg"},{shape:"square",size:"sm",class:"rounded-xl"},{shape:"square",size:"base",class:"rounded-xl"},{shape:"square",size:"lg",class:"rounded-xl"},{shape:"square",size:"xl",class:"rounded-2xl"},{shape:"square",size:"2xl",class:"rounded-3xl"},{shape:"square",size:"3xl",class:"rounded-[40px]"}],defaultVariants:{shape:"square",size:"base"}}),_=R("",{variants:{objectFit:{contain:"object-contain",cover:"object-cover"}},defaultVariants:{objectFit:"cover"}}),D=r=>{const e={"3xs":8,"2xs":8,xs:12,sm:16,base:24,lg:28,xl:36,"2xl":48,"3xl":80};return e[r]||e.base};function J(r){const e=k.c(34);let s,t,o,a,n,d,g,l;e[0]!==r?({url:l,fallback:t,shape:a,size:n,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g;let x;e:{if(typeof t=="string"){let c;e[9]!==t?(c=t.trim().slice(0,2).toUpperCase(),e[9]=t,e[10]=c):c=e[10],x=c;break e}x=t}const f=x;let y;e:{if(j){y=L;break e}if(typeof t=="string"){let c;e[11]!==t?(c=T(t),e[11]=t,e[12]=c):c=e[12],y=c;break e}y=C[0]}const z=y;let N;e[13]!==l?(N=l?.startsWith("icon://"),e[13]=l,e[14]=N):N=e[14];const p=N;let q;e[15]!==p||e[16]!==l?(q=p?l?.replace("icon://",""):void 0,e[15]=p,e[16]=l,e[17]=q):q=e[17];const F=q;let w;e[18]!==s||e[19]!==b||e[20]!==h?(w=m(I({shape:b,size:h}),s),e[18]=s,e[19]=b,e[20]=h,e[21]=w):w=e[21];let v;e[22]!==z||e[23]!==f||e[24]!==F||e[25]!==p||e[26]!==u||e[27]!==h||e[28]!==l?(v=p&&F?i.jsx("div",{className:m("flex items-center justify-center w-full h-full",z),children:i.jsx(O,{size:D(h)})}):i.jsxs(i.Fragment,{children:[l&&i.jsx(E,{src:l,loading:"lazy",alt:"Avatar",className:m(_({objectFit:u}))}),i.jsx(M,{className:m(z,"rounded-none"),delayMs:l?600:0,children:f})]}),e[22]=z,e[23]=f,e[24]=F,e[25]=p,e[26]=u,e[27]=h,e[28]=l,e[29]=v):v=e[29];let A;return e[30]!==o||e[31]!==v||e[32]!==w?(A=i.jsx(U,{className:w,...o,children:v}),e[30]=o,e[31]=v,e[32]=w,e[33]=A):A=e[33],A}function K(r){const e=k.c(18);let s,t,o,a,n,d,g,l;e[0]!==r?({shape:a,size:n,url:l,fallback:t,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g,x=h??"base";let f;return e[9]!==s||e[10]!==t||e[11]!==j||e[12]!==u||e[13]!==o||e[14]!==b||e[15]!==x||e[16]!==l?(f=i.jsx(J,{shape:b,url:l,fallback:t,size:x,objectFit:u,className:s,muted:j,...o}),e[9]=s,e[10]=t,e[11]=j,e[12]=u,e[13]=o,e[14]=b,e[15]=x,e[16]=l,e[17]=f):f=e[17],f}K.Skeleton=function({shape:e="square",size:s="base",className:t}){return i.jsx("div",{className:m(I({shape:e,size:s}),"bg-muted animate-pulse",t)})};export{K as A};
@@ -1 +1 @@
1
- import{c as l,l as u,j as g,bd as v,bC as b}from"./index-32Z_4GES.js";const f=b("inline-flex items-center justify-center rounded-full border text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",warning:"border-transparent bg-warning text-warning-foreground [a&]:hover:bg-warning/90 focus-visible:ring-warning/20 dark:focus-visible:ring-warning/40",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"},size:{default:"px-2 py-0.5",icon:"size-5"}},defaultVariants:{variant:"default",size:"default"}});function h(c){const e=l.c(14);let r,s,i,n,t;e[0]!==c?({className:r,variant:t,size:i,asChild:n,...s}=c,e[0]=c,e[1]=r,e[2]=s,e[3]=i,e[4]=n,e[5]=t):(r=e[1],s=e[2],i=e[3],n=e[4],t=e[5]);const d=(n===void 0?!1:n)?v:"span";let a;e[6]!==r||e[7]!==i||e[8]!==t?(a=u(f({variant:t,size:i}),r),e[6]=r,e[7]=i,e[8]=t,e[9]=a):a=e[9];let o;return e[10]!==d||e[11]!==s||e[12]!==a?(o=g.jsx(d,{"data-slot":"badge",className:a,...s}),e[10]=d,e[11]=s,e[12]=a,e[13]=o):o=e[13],o}export{h as B};
1
+ import{c as l,l as u,j as g,bd as v,bC as b}from"./index-C2u4siS5.js";const f=b("inline-flex items-center justify-center rounded-full border text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",warning:"border-transparent bg-warning text-warning-foreground [a&]:hover:bg-warning/90 focus-visible:ring-warning/20 dark:focus-visible:ring-warning/40",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"},size:{default:"px-2 py-0.5",icon:"size-5"}},defaultVariants:{variant:"default",size:"default"}});function h(c){const e=l.c(14);let r,s,i,n,t;e[0]!==c?({className:r,variant:t,size:i,asChild:n,...s}=c,e[0]=c,e[1]=r,e[2]=s,e[3]=i,e[4]=n,e[5]=t):(r=e[1],s=e[2],i=e[3],n=e[4],t=e[5]);const d=(n===void 0?!1:n)?v:"span";let a;e[6]!==r||e[7]!==i||e[8]!==t?(a=u(f({variant:t,size:i}),r),e[6]=r,e[7]=i,e[8]=t,e[9]=a):a=e[9];let o;return e[10]!==d||e[11]!==s||e[12]!==a?(o=g.jsx(d,{"data-slot":"badge",className:a,...s}),e[10]=d,e[11]=s,e[12]=a,e[13]=o):o=e[13],o}export{h as B};
@@ -1,3 +1,3 @@
1
- import{c as T,r as V,l as Y,j as l,K as xe,m as he,B as rt}from"./index-32Z_4GES.js";import{D as ot,T as ce,R as nt,I as it,E as at,F as Le,H as ie,K as Be,P as Ee,J as Pe,L as Re,M as De,N as ct,O as Oe,Q as ze,U as Fe,V as Ue,W as dt,X as ut,r as ft,S as mt,Y as pt,Z as gt}from"./index-CyCC6Kib.js";import{V as xt,C as ht,a6 as bt,a7 as yt,a8 as vt,e as be,w as jt}from"./agent-icon-D4a2yQAy.js";import{s as Ve}from"./Plus-DErQhYMo.js";import{e as je,a as Nt,b as Ct,C as kt,d as St,c as wt}from"./command-DjqCY9Vi.js";import{P as _t,a as At,b as Tt}from"./popover-RIaRL7oB.js";import{a as $t}from"./Copy01-8RoWdlIb.js";import{b as He}from"./ZoomOut-DO1ABQMU.js";import{s as me}from"./Trash01-D68y5OFq.js";import{u as It,f as Lt,d as Bt}from"./calendar-CL1lHfJI.js";import{c as Et}from"./automation-runs-B-V_i0FR.js";import{I as X,F as ye,T as re,s as A,p as se,R as ee,A as te}from"./primitives-CcasBN-m.js";import{i as qe}from"./ChevronUp-SvG4tBeC.js";import{a as Pt}from"./Image01-YE-JCd5P.js";import{a as Rt}from"./Package-BwfmB-wY.js";import{s as Dt}from"./XClose-C4EmtqAA.js";import{L as ne}from"./label-DqJN0Zl6.js";import{S as Me}from"./chat-context-0yEIHZ6c.js";import{D as Ot,a as zt,d as Ft,e as Ut}from"./dialog-pxztKdM4.js";import{I as pe}from"./input-DNRaDhXk.js";const ae=m=>typeof m=="string"?m:"",Vt=/\/blog\.tsx?$/;function Ge(m,e){for(const[t,r]of Object.entries(m)){if(t.includes("/")||!r||typeof r!="object"||Array.isArray(r))continue;const s=r;if(typeof s.__resolveType!="string"||!Vt.test(s.__resolveType))continue;const i=ae(s[e]);if(i)return i}return null}function Ht(m){return Ge(m,"pageSlug")}function qt(m){return Ge(m,"categorySlug")}function Mt(m){const e=m.categories;if(!Array.isArray(e)||e.length===0)return"";const t=e[0];return ae(t?.slug)}function Gt(m,e){let t=m;if(/:category\??/.test(t)){if(!e.category)return null;t=t.replace(/:category\??/g,encodeURIComponent(e.category))}if(/:slug\??/.test(t)){if(!e.slug)return null;t=t.replace(/:slug\??/g,encodeURIComponent(e.slug))}return t}const Jt=/:(?:categorySlug|category|slug)\??/,Kt=/:(?:categorySlug|category|slug)\??/g;function Yt(m,e){return Jt.test(m)?e?m.replace(Kt,encodeURIComponent(e)):null:m}function Cl({decofile:m,category:e,previewBaseUrl:t}){if(!t)return null;const r=qt(m);if(!r)return null;const s=Yt(r,ae(e.slug));if(!s)return null;try{return new URL(s,t).href}catch{return null}}function kl({decofile:m,post:e,previewBaseUrl:t}){if(!t)return null;const r=Ht(m);if(!r)return null;const s=Gt(r,{category:Mt(e),slug:ae(e.slug)});if(!s)return null;try{return new URL(s,t).href}catch{return null}}const Ne={app:"Blocks",site:"Custom blocks"};function Xt(m){const e=T.c(6),{iconName:t,iconUrl:r,alt:s}=m;let i;e[0]!==t?(i=ht(t)??xt,e[0]=t,e[1]=i):i=e[1];const n=i;let f;return e[2]!==n||e[3]!==s||e[4]!==r?(f=l.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-md border bg-muted",children:r?l.jsx("img",{src:r,alt:s,className:"size-5 object-contain"}):l.jsx(n,{size:16,className:"text-muted-foreground"})}),e[2]=n,e[3]=s,e[4]=r,e[5]=f):f=e[5],f}function Ce(m){const e=T.c(19),{type:t,onInsert:r}=m,s=`${t.title} ${t.resolveType} ${t.description??""}`;let i;e[0]!==r||e[1]!==t.resolveType?(i=()=>r(t.resolveType),e[0]=r,e[1]=t.resolveType,e[2]=i):i=e[2];let n;e[3]!==t.iconName||e[4]!==t.iconUrl||e[5]!==t.title?(n=l.jsx(Xt,{iconName:t.iconName,iconUrl:t.iconUrl,alt:t.title}),e[3]=t.iconName,e[4]=t.iconUrl,e[5]=t.title,e[6]=n):n=e[6];let f;e[7]!==t.title?(f=l.jsx("span",{className:"text-sm font-medium",children:t.title}),e[7]=t.title,e[8]=f):f=e[8];let d;e[9]!==t.description?(d=t.description&&l.jsx("span",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[9]=t.description,e[10]=d):d=e[10];let c;e[11]!==f||e[12]!==d?(c=l.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[f,d]}),e[11]=f,e[12]=d,e[13]=c):c=e[13];let x;return e[14]!==s||e[15]!==i||e[16]!==n||e[17]!==c?(x=l.jsxs(Nt,{value:s,onSelect:i,className:"flex items-center gap-2.5",children:[n,c]}),e[14]=s,e[15]=i,e[16]=n,e[17]=c,e[18]=x):x=e[18],x}function ke(m){const e=T.c(28),{blockTypes:t,onInsert:r,alwaysShow:s}=m,i=s===void 0?!1:s,[n,f]=V.useState(!1);let d,c;if(e[0]!==t){d=[],c=[];for(const k of t)(k.source==="site"?c:d).push(k);e[0]=t,e[1]=d,e[2]=c}else d=e[1],c=e[2];let x;e[3]!==r?(x=k=>{r(k),f(!1)},e[3]=r,e[4]=x):x=e[4];const g=x,h=d.length>0&&c.length>0,o=i?"h-10":"";let a;e[5]!==o?(a=Y("group/insert relative flex h-6 items-center justify-center",o),e[5]=o,e[6]=a):a=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=l.jsx("div",{className:"absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-border"}),e[7]=u):u=e[7];let p;e[8]===Symbol.for("react.memo_cache_sentinel")?(p=l.jsx(_t,{asChild:!0,children:l.jsx("button",{type:"button","aria-label":"Insert block",className:"relative z-10 flex h-6 w-6 items-center justify-center rounded-full border bg-background text-muted-foreground transition-all hover:border-primary hover:text-primary cursor-pointer",children:l.jsx(Ve,{size:14})})}),e[8]=p):p=e[8];let b;e[9]===Symbol.for("react.memo_cache_sentinel")?(b=l.jsx(Ct,{placeholder:"Search blocks…"}),e[9]=b):b=e[9];let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y=l.jsx(kt,{children:"No blocks found."}),e[10]=y):y=e[10];let v;e[11]!==g||e[12]!==h||e[13]!==c?(v=c.length>0&&l.jsx(je,{heading:h?Ne.site:void 0,children:c.map(k=>l.jsx(Ce,{type:k,onInsert:g},k.resolveType))}),e[11]=g,e[12]=h,e[13]=c,e[14]=v):v=e[14];let N;e[15]!==d||e[16]!==g||e[17]!==h?(N=d.length>0&&l.jsx(je,{heading:h?Ne.app:void 0,children:d.map(k=>l.jsx(Ce,{type:k,onInsert:g},k.resolveType))}),e[15]=d,e[16]=g,e[17]=h,e[18]=N):N=e[18];let j;e[19]!==N||e[20]!==v?(j=l.jsx(At,{className:"w-80 p-0",align:"center",children:l.jsxs(St,{children:[b,l.jsxs(wt,{className:"max-h-80",children:[y,v,N]})]})}),e[19]=N,e[20]=v,e[21]=j):j=e[21];let C;e[22]!==n||e[23]!==j?(C=l.jsxs(Tt,{open:n,onOpenChange:f,children:[p,j]}),e[22]=n,e[23]=j,e[24]=C):C=e[24];let S;return e[25]!==C||e[26]!==a?(S=l.jsxs("div",{className:a,children:[u,C]}),e[25]=C,e[26]=a,e[27]=S):S=e[27],S}function Qt({html:m,placeholder:e,onChange:t}){const r=V.useRef(t);r.current=t;const[s,i]=V.useState(!1),n=It({extensions:[Et.configure({link:{HTMLAttributes:{}},heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,bulletList:!1,orderedList:!1,listItem:!1,dropcursor:!1,gapcursor:!1}),ot.configure({placeholder:e??"Write something…"})],content:m||"",editorProps:{attributes:{class:Y("prose prose-sm dark:prose-invert max-w-none focus:outline-none","leading-relaxed [&_p]:my-0")}},onUpdate:({editor:d})=>{const c=d.getHTML();r.current(c==="<p></p>"?"":c)}}),f=Lt({editor:n,selector:({editor:d})=>({isFocused:d?.isFocused??!1,bold:d?.isActive("bold")??!1,italic:d?.isActive("italic")??!1,underline:d?.isActive("underline")??!1,link:d?.isActive("link")??!1})});return n?l.jsxs("div",{className:"relative",children:[(f.isFocused||s)&&l.jsxs("div",{className:"absolute -top-9 left-0 z-10 flex items-center gap-0.5 rounded-md border bg-popover p-0.5 shadow-md",children:[l.jsx(ce,{active:f.bold,label:"Bold",onClick:()=>n.chain().focus().toggleBold().run(),children:l.jsx(bt,{size:14})}),l.jsx(ce,{active:f.italic,label:"Italic",onClick:()=>n.chain().focus().toggleItalic().run(),children:l.jsx(yt,{size:14})}),l.jsx(ce,{active:f.underline,label:"Underline",onClick:()=>n.chain().focus().toggleUnderline().run(),children:l.jsx(vt,{size:14})}),l.jsx(nt,{editor:n,active:f.link,open:s,onOpenChange:i})]}),l.jsx(Bt,{editor:n,className:"text-[15px] text-foreground"})]}):null}const Wt=["1","2","3"],Se={1:"text-3xl font-bold",2:"text-2xl font-bold",3:"text-xl font-semibold",4:"text-lg font-semibold",5:"text-base font-semibold",6:"text-sm font-semibold"};function Zt(m){const e=T.c(19),{text:t,level:r,onChange:s}=m,[i,n]=V.useState(!1),f=r||"2";let d;e[0]!==i||e[1]!==f||e[2]!==s||e[3]!==t?(d=i&&l.jsx(ye,{children:Wt.map(p=>l.jsxs(re,{active:f===p,label:`Heading ${p}`,onClick:()=>s({text:t,level:p}),children:["H",p]},p))}),e[0]=i,e[1]=f,e[2]=s,e[3]=t,e[4]=d):d=e[4];let c;e[5]!==f||e[6]!==s?(c=p=>s({text:p,level:f}),e[5]=f,e[6]=s,e[7]=c):c=e[7];let x,g;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=()=>n(!0),g=()=>n(!1),e[8]=x,e[9]=g):(x=e[8],g=e[9]);const h=Se[f]??Se[2];let o;e[10]!==h?(o=Y("text-foreground",h),e[10]=h,e[11]=o):o=e[11];let a;e[12]!==c||e[13]!==o||e[14]!==t?(a=l.jsx(X,{value:t,onChange:c,onFocus:x,onBlur:g,placeholder:"Heading",className:o}),e[12]=c,e[13]=o,e[14]=t,e[15]=a):a=e[15];let u;return e[16]!==d||e[17]!==a?(u=l.jsxs("div",{className:"relative",children:[d,a]}),e[16]=d,e[17]=a,e[18]=u):u=e[18],u}function es(m){const e=T.c(3),{quote:t,onChange:r}=m;let s;return e[0]!==r||e[1]!==t?(s=l.jsx("div",{className:"border-l-2 border-foreground/30 pl-4",children:l.jsx(X,{value:t,onChange:r,placeholder:"Quote",className:"text-lg italic text-foreground/90"})}),e[0]=r,e[1]=t,e[2]=s):s=e[2],s}function ts(m){const e=T.c(15),{code:t,language:r,onChange:s}=m;let i;e[0]!==t||e[1]!==s?(i=x=>s({code:t,language:x.target.value}),e[0]=t,e[1]=s,e[2]=i):i=e[2];let n;e[3]!==r||e[4]!==i?(n=l.jsx("input",{value:r,onChange:i,placeholder:"language",className:"w-full border-b bg-transparent px-3 py-1.5 font-mono text-xs text-muted-foreground outline-none placeholder:text-muted-foreground/50"}),e[3]=r,e[4]=i,e[5]=n):n=e[5];let f;e[6]!==r||e[7]!==s?(f=x=>s({code:x,language:r}),e[6]=r,e[7]=s,e[8]=f):f=e[8];let d;e[9]!==t||e[10]!==f?(d=l.jsx(X,{value:t,onChange:f,placeholder:"Code",spellCheck:!1,className:"px-3 py-2.5 font-mono text-sm text-foreground"}),e[9]=t,e[10]=f,e[11]=d):d=e[11];let c;return e[12]!==n||e[13]!==d?(c=l.jsxs("div",{className:"overflow-hidden rounded-md border bg-muted/50",children:[n,d]}),e[12]=n,e[13]=d,e[14]=c):c=e[14],c}function ss(m){const e=T.c(17),{items:t,style:r,onChange:s}=m,i=r==="ordered",n=t.length?t.split(`
1
+ import{c as T,r as V,l as Y,j as l,K as xe,m as he,B as rt}from"./index-C2u4siS5.js";import{D as ot,T as ce,R as nt,I as it,E as at,F as Le,H as ie,K as Be,P as Ee,J as Pe,L as Re,M as De,N as ct,O as Oe,Q as ze,U as Fe,V as Ue,W as dt,X as ut,r as ft,S as mt,Y as pt,Z as gt}from"./index-Cg3sR771.js";import{V as xt,C as ht,a6 as bt,a7 as yt,a8 as vt,e as be,w as jt}from"./agent-icon-CzJVw_PS.js";import{s as Ve}from"./Plus-BFo0Fsne.js";import{e as je,a as Nt,b as Ct,C as kt,d as St,c as wt}from"./command-Sec7WA_A.js";import{P as _t,a as At,b as Tt}from"./popover-DfzsvCwC.js";import{a as $t}from"./Copy01-AuaMhdvh.js";import{b as He}from"./ZoomOut-shbGcJgg.js";import{s as me}from"./Trash01-zPnxi6aE.js";import{u as It,f as Lt,d as Bt}from"./calendar-DX2eI8nn.js";import{c as Et}from"./automation-runs-BdqIedR2.js";import{I as X,F as ye,T as re,s as A,p as se,R as ee,A as te}from"./primitives-BldH5G0Y.js";import{i as qe}from"./ChevronUp-DKgNoV7g.js";import{a as Pt}from"./Image01-C8aqMMC0.js";import{a as Rt}from"./Package-DXwLO7TZ.js";import{s as Dt}from"./XClose-CnDiE4wN.js";import{L as ne}from"./label-DhK5GRHz.js";import{S as Me}from"./chat-context-CWKEbJVu.js";import{D as Ot,a as zt,d as Ft,e as Ut}from"./dialog-CvsnsHc6.js";import{I as pe}from"./input-Cb7CGqPN.js";const ae=m=>typeof m=="string"?m:"",Vt=/\/blog\.tsx?$/;function Ge(m,e){for(const[t,r]of Object.entries(m)){if(t.includes("/")||!r||typeof r!="object"||Array.isArray(r))continue;const s=r;if(typeof s.__resolveType!="string"||!Vt.test(s.__resolveType))continue;const i=ae(s[e]);if(i)return i}return null}function Ht(m){return Ge(m,"pageSlug")}function qt(m){return Ge(m,"categorySlug")}function Mt(m){const e=m.categories;if(!Array.isArray(e)||e.length===0)return"";const t=e[0];return ae(t?.slug)}function Gt(m,e){let t=m;if(/:category\??/.test(t)){if(!e.category)return null;t=t.replace(/:category\??/g,encodeURIComponent(e.category))}if(/:slug\??/.test(t)){if(!e.slug)return null;t=t.replace(/:slug\??/g,encodeURIComponent(e.slug))}return t}const Jt=/:(?:categorySlug|category|slug)\??/,Kt=/:(?:categorySlug|category|slug)\??/g;function Yt(m,e){return Jt.test(m)?e?m.replace(Kt,encodeURIComponent(e)):null:m}function Cl({decofile:m,category:e,previewBaseUrl:t}){if(!t)return null;const r=qt(m);if(!r)return null;const s=Yt(r,ae(e.slug));if(!s)return null;try{return new URL(s,t).href}catch{return null}}function kl({decofile:m,post:e,previewBaseUrl:t}){if(!t)return null;const r=Ht(m);if(!r)return null;const s=Gt(r,{category:Mt(e),slug:ae(e.slug)});if(!s)return null;try{return new URL(s,t).href}catch{return null}}const Ne={app:"Blocks",site:"Custom blocks"};function Xt(m){const e=T.c(6),{iconName:t,iconUrl:r,alt:s}=m;let i;e[0]!==t?(i=ht(t)??xt,e[0]=t,e[1]=i):i=e[1];const n=i;let f;return e[2]!==n||e[3]!==s||e[4]!==r?(f=l.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-md border bg-muted",children:r?l.jsx("img",{src:r,alt:s,className:"size-5 object-contain"}):l.jsx(n,{size:16,className:"text-muted-foreground"})}),e[2]=n,e[3]=s,e[4]=r,e[5]=f):f=e[5],f}function Ce(m){const e=T.c(19),{type:t,onInsert:r}=m,s=`${t.title} ${t.resolveType} ${t.description??""}`;let i;e[0]!==r||e[1]!==t.resolveType?(i=()=>r(t.resolveType),e[0]=r,e[1]=t.resolveType,e[2]=i):i=e[2];let n;e[3]!==t.iconName||e[4]!==t.iconUrl||e[5]!==t.title?(n=l.jsx(Xt,{iconName:t.iconName,iconUrl:t.iconUrl,alt:t.title}),e[3]=t.iconName,e[4]=t.iconUrl,e[5]=t.title,e[6]=n):n=e[6];let f;e[7]!==t.title?(f=l.jsx("span",{className:"text-sm font-medium",children:t.title}),e[7]=t.title,e[8]=f):f=e[8];let d;e[9]!==t.description?(d=t.description&&l.jsx("span",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[9]=t.description,e[10]=d):d=e[10];let c;e[11]!==f||e[12]!==d?(c=l.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[f,d]}),e[11]=f,e[12]=d,e[13]=c):c=e[13];let x;return e[14]!==s||e[15]!==i||e[16]!==n||e[17]!==c?(x=l.jsxs(Nt,{value:s,onSelect:i,className:"flex items-center gap-2.5",children:[n,c]}),e[14]=s,e[15]=i,e[16]=n,e[17]=c,e[18]=x):x=e[18],x}function ke(m){const e=T.c(28),{blockTypes:t,onInsert:r,alwaysShow:s}=m,i=s===void 0?!1:s,[n,f]=V.useState(!1);let d,c;if(e[0]!==t){d=[],c=[];for(const k of t)(k.source==="site"?c:d).push(k);e[0]=t,e[1]=d,e[2]=c}else d=e[1],c=e[2];let x;e[3]!==r?(x=k=>{r(k),f(!1)},e[3]=r,e[4]=x):x=e[4];const g=x,h=d.length>0&&c.length>0,o=i?"h-10":"";let a;e[5]!==o?(a=Y("group/insert relative flex h-6 items-center justify-center",o),e[5]=o,e[6]=a):a=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=l.jsx("div",{className:"absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-border"}),e[7]=u):u=e[7];let p;e[8]===Symbol.for("react.memo_cache_sentinel")?(p=l.jsx(_t,{asChild:!0,children:l.jsx("button",{type:"button","aria-label":"Insert block",className:"relative z-10 flex h-6 w-6 items-center justify-center rounded-full border bg-background text-muted-foreground transition-all hover:border-primary hover:text-primary cursor-pointer",children:l.jsx(Ve,{size:14})})}),e[8]=p):p=e[8];let b;e[9]===Symbol.for("react.memo_cache_sentinel")?(b=l.jsx(Ct,{placeholder:"Search blocks…"}),e[9]=b):b=e[9];let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y=l.jsx(kt,{children:"No blocks found."}),e[10]=y):y=e[10];let v;e[11]!==g||e[12]!==h||e[13]!==c?(v=c.length>0&&l.jsx(je,{heading:h?Ne.site:void 0,children:c.map(k=>l.jsx(Ce,{type:k,onInsert:g},k.resolveType))}),e[11]=g,e[12]=h,e[13]=c,e[14]=v):v=e[14];let N;e[15]!==d||e[16]!==g||e[17]!==h?(N=d.length>0&&l.jsx(je,{heading:h?Ne.app:void 0,children:d.map(k=>l.jsx(Ce,{type:k,onInsert:g},k.resolveType))}),e[15]=d,e[16]=g,e[17]=h,e[18]=N):N=e[18];let j;e[19]!==N||e[20]!==v?(j=l.jsx(At,{className:"w-80 p-0",align:"center",children:l.jsxs(St,{children:[b,l.jsxs(wt,{className:"max-h-80",children:[y,v,N]})]})}),e[19]=N,e[20]=v,e[21]=j):j=e[21];let C;e[22]!==n||e[23]!==j?(C=l.jsxs(Tt,{open:n,onOpenChange:f,children:[p,j]}),e[22]=n,e[23]=j,e[24]=C):C=e[24];let S;return e[25]!==C||e[26]!==a?(S=l.jsxs("div",{className:a,children:[u,C]}),e[25]=C,e[26]=a,e[27]=S):S=e[27],S}function Qt({html:m,placeholder:e,onChange:t}){const r=V.useRef(t);r.current=t;const[s,i]=V.useState(!1),n=It({extensions:[Et.configure({link:{HTMLAttributes:{}},heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,bulletList:!1,orderedList:!1,listItem:!1,dropcursor:!1,gapcursor:!1}),ot.configure({placeholder:e??"Write something…"})],content:m||"",editorProps:{attributes:{class:Y("prose prose-sm dark:prose-invert max-w-none focus:outline-none","leading-relaxed [&_p]:my-0")}},onUpdate:({editor:d})=>{const c=d.getHTML();r.current(c==="<p></p>"?"":c)}}),f=Lt({editor:n,selector:({editor:d})=>({isFocused:d?.isFocused??!1,bold:d?.isActive("bold")??!1,italic:d?.isActive("italic")??!1,underline:d?.isActive("underline")??!1,link:d?.isActive("link")??!1})});return n?l.jsxs("div",{className:"relative",children:[(f.isFocused||s)&&l.jsxs("div",{className:"absolute -top-9 left-0 z-10 flex items-center gap-0.5 rounded-md border bg-popover p-0.5 shadow-md",children:[l.jsx(ce,{active:f.bold,label:"Bold",onClick:()=>n.chain().focus().toggleBold().run(),children:l.jsx(bt,{size:14})}),l.jsx(ce,{active:f.italic,label:"Italic",onClick:()=>n.chain().focus().toggleItalic().run(),children:l.jsx(yt,{size:14})}),l.jsx(ce,{active:f.underline,label:"Underline",onClick:()=>n.chain().focus().toggleUnderline().run(),children:l.jsx(vt,{size:14})}),l.jsx(nt,{editor:n,active:f.link,open:s,onOpenChange:i})]}),l.jsx(Bt,{editor:n,className:"text-[15px] text-foreground"})]}):null}const Wt=["1","2","3"],Se={1:"text-3xl font-bold",2:"text-2xl font-bold",3:"text-xl font-semibold",4:"text-lg font-semibold",5:"text-base font-semibold",6:"text-sm font-semibold"};function Zt(m){const e=T.c(19),{text:t,level:r,onChange:s}=m,[i,n]=V.useState(!1),f=r||"2";let d;e[0]!==i||e[1]!==f||e[2]!==s||e[3]!==t?(d=i&&l.jsx(ye,{children:Wt.map(p=>l.jsxs(re,{active:f===p,label:`Heading ${p}`,onClick:()=>s({text:t,level:p}),children:["H",p]},p))}),e[0]=i,e[1]=f,e[2]=s,e[3]=t,e[4]=d):d=e[4];let c;e[5]!==f||e[6]!==s?(c=p=>s({text:p,level:f}),e[5]=f,e[6]=s,e[7]=c):c=e[7];let x,g;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=()=>n(!0),g=()=>n(!1),e[8]=x,e[9]=g):(x=e[8],g=e[9]);const h=Se[f]??Se[2];let o;e[10]!==h?(o=Y("text-foreground",h),e[10]=h,e[11]=o):o=e[11];let a;e[12]!==c||e[13]!==o||e[14]!==t?(a=l.jsx(X,{value:t,onChange:c,onFocus:x,onBlur:g,placeholder:"Heading",className:o}),e[12]=c,e[13]=o,e[14]=t,e[15]=a):a=e[15];let u;return e[16]!==d||e[17]!==a?(u=l.jsxs("div",{className:"relative",children:[d,a]}),e[16]=d,e[17]=a,e[18]=u):u=e[18],u}function es(m){const e=T.c(3),{quote:t,onChange:r}=m;let s;return e[0]!==r||e[1]!==t?(s=l.jsx("div",{className:"border-l-2 border-foreground/30 pl-4",children:l.jsx(X,{value:t,onChange:r,placeholder:"Quote",className:"text-lg italic text-foreground/90"})}),e[0]=r,e[1]=t,e[2]=s):s=e[2],s}function ts(m){const e=T.c(15),{code:t,language:r,onChange:s}=m;let i;e[0]!==t||e[1]!==s?(i=x=>s({code:t,language:x.target.value}),e[0]=t,e[1]=s,e[2]=i):i=e[2];let n;e[3]!==r||e[4]!==i?(n=l.jsx("input",{value:r,onChange:i,placeholder:"language",className:"w-full border-b bg-transparent px-3 py-1.5 font-mono text-xs text-muted-foreground outline-none placeholder:text-muted-foreground/50"}),e[3]=r,e[4]=i,e[5]=n):n=e[5];let f;e[6]!==r||e[7]!==s?(f=x=>s({code:x,language:r}),e[6]=r,e[7]=s,e[8]=f):f=e[8];let d;e[9]!==t||e[10]!==f?(d=l.jsx(X,{value:t,onChange:f,placeholder:"Code",spellCheck:!1,className:"px-3 py-2.5 font-mono text-sm text-foreground"}),e[9]=t,e[10]=f,e[11]=d):d=e[11];let c;return e[12]!==n||e[13]!==d?(c=l.jsxs("div",{className:"overflow-hidden rounded-md border bg-muted/50",children:[n,d]}),e[12]=n,e[13]=d,e[14]=c):c=e[14],c}function ss(m){const e=T.c(17),{items:t,style:r,onChange:s}=m,i=r==="ordered",n=t.length?t.split(`
2
2
  `):[""],[f,d]=V.useState(!1),c=V.useRef([]);let x;e[0]!==s||e[1]!==r?(x=j=>s({items:j.join(`
3
3
  `),style:r}),e[0]=s,e[1]=r,e[2]=x):x=e[2];const g=x,h=(j,C)=>requestAnimationFrame(()=>{const S=c.current[j];if(!S)return;S.focus();const k=C==="end"?S.value.length:0;S.setSelectionRange(k,k)}),o="relative";let a,u;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=()=>d(!0),u=j=>{j.currentTarget.contains(j.relatedTarget)||d(!1)},e[3]=a,e[4]=u):(a=e[3],u=e[4]);let p;e[5]!==f||e[6]!==t||e[7]!==s||e[8]!==i?(p=f&&l.jsxs(ye,{children:[l.jsx(re,{active:!i,label:"Bulleted",onClick:()=>s({items:t,style:"unordered"}),children:"•"}),l.jsx(re,{active:i,label:"Numbered",onClick:()=>s({items:t,style:"ordered"}),children:"1."})]}),e[5]=f,e[6]=t,e[7]=s,e[8]=i,e[9]=p):p=e[9];const b="space-y-1",y=n.map((j,C)=>l.jsxs("li",{className:"flex items-start gap-2.5",children:[l.jsx("span",{className:"min-w-5 shrink-0 select-none pt-px text-right text-[15px] leading-relaxed text-muted-foreground tabular-nums",children:i?`${C+1}.`:"•"}),l.jsx(X,{inputRef:S=>{c.current[C]=S},value:j,onChange:S=>{const k=[...n];k[C]=S,g(k)},onKeyDown:S=>{const k=S.currentTarget;if(S.key==="Enter"){S.preventDefault();const _=[...n];_.splice(C+1,0,""),g(_),h(C+1,"start")}else S.key==="Backspace"&&j===""&&n.length>1?(S.preventDefault(),g(n.filter((_,w)=>w!==C)),h(Math.max(0,C-1),"end")):S.key==="ArrowUp"&&k.selectionStart===0&&C>0?(S.preventDefault(),h(C-1,"end")):S.key==="ArrowDown"&&k.selectionEnd===j.length&&C<n.length-1&&(S.preventDefault(),h(C+1,"end"))},placeholder:"List item",className:"text-[15px] leading-relaxed text-foreground"})]},C));let v;e[10]!==y?(v=l.jsx("ul",{className:b,children:y}),e[10]=y,e[11]=v):v=e[11];let N;return e[12]!==a||e[13]!==u||e[14]!==p||e[15]!==v?(N=l.jsxs("div",{className:o,onFocus:a,onBlur:u,children:[p,v]}),e[12]=a,e[13]=u,e[14]=p,e[15]=v,e[16]=N):N=e[16],N}function ls(m){const e=T.c(37),{block:t,onChange:r}=m;let s;e[0]!==t.size?(s=A(t.size)||"normal",e[0]=t.size,e[1]=s):s=e[1];const i=s;let n;e[2]===Symbol.for("react.memo_cache_sentinel")?(n={type:"string",format:"image-uri",title:"Image"},e[2]=n):n=e[2];let f;e[3]!==t||e[4]!==r?(f=v=>r({...t,url:v}),e[3]=t,e[4]=r,e[5]=f):f=e[5];let d;e[6]!==t.url||e[7]!==f?(d=l.jsx(it,{schema:n,value:t.url,onChange:f,path:"block-image-url",label:"Image"}),e[6]=t.url,e[7]=f,e[8]=d):d=e[8];let c;e[9]!==t.caption?(c=A(t.caption),e[9]=t.caption,e[10]=c):c=e[10];let x;e[11]!==t||e[12]!==r?(x=v=>r({...t,caption:v}),e[11]=t,e[12]=r,e[13]=x):x=e[13];let g;e[14]!==c||e[15]!==x?(g=l.jsx(X,{value:c,onChange:x,placeholder:"Add a caption…",className:"text-center text-sm italic text-muted-foreground"}),e[14]=c,e[15]=x,e[16]=g):g=e[16];let h;e[17]===Symbol.for("react.memo_cache_sentinel")?(h=["normal","full"],e[17]=h):h=e[17];let o;e[18]!==t||e[19]!==r||e[20]!==i?(o=l.jsx("div",{className:"flex items-center gap-1",children:h.map(v=>l.jsx("button",{type:"button",onClick:()=>r({...t,size:v}),className:Y("rounded px-2 py-0.5 transition-colors cursor-pointer",i===v?"bg-accent text-accent-foreground":"hover:bg-muted"),children:v==="full"?"Full width":"Normal"},v))}),e[18]=t,e[19]=r,e[20]=i,e[21]=o):o=e[21];let a;e[22]!==t.alt?(a=A(t.alt),e[22]=t.alt,e[23]=a):a=e[23];let u;e[24]!==t||e[25]!==r?(u=v=>r({...t,alt:v.target.value}),e[24]=t,e[25]=r,e[26]=u):u=e[26];let p;e[27]!==a||e[28]!==u?(p=l.jsx("input",{value:a,onChange:u,placeholder:"Alt text (accessibility)",className:"flex-1 border-0 bg-transparent p-0 text-xs outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[27]=a,e[28]=u,e[29]=p):p=e[29];let b;e[30]!==p||e[31]!==o?(b=l.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[o,p]}),e[30]=p,e[31]=o,e[32]=b):b=e[32];let y;return e[33]!==b||e[34]!==d||e[35]!==g?(y=l.jsxs("div",{className:"space-y-2",children:[d,g,b]}),e[33]=b,e[34]=d,e[35]=g,e[36]=y):y=e[36],y}function rs(m){const e=m.match(/(?:youtube\.com\/watch\?v=|youtu\.be\/)([\w-]{11})/);if(e)return`https://www.youtube.com/embed/${e[1]}`;const t=m.match(/vimeo\.com\/(\d+)/);return t?`https://player.vimeo.com/video/${t[1]}`:null}function os(m){const e=T.c(21),{url:t,caption:r,onChange:s}=m;let i;e[0]!==t?(i=rs(t),e[0]=t,e[1]=i):i=e[1];const n=i;let f;e[2]!==r||e[3]!==n?(f=n?l.jsx("div",{className:"relative aspect-video overflow-hidden rounded-md border bg-muted",children:l.jsx("iframe",{src:n,title:r||"Video",className:"absolute inset-0 h-full w-full border-0",allowFullScreen:!0})}):l.jsx("div",{className:"flex aspect-video items-center justify-center rounded-md border border-dashed bg-muted/40 text-xs text-muted-foreground",children:"Paste a YouTube or Vimeo URL to preview"}),e[2]=r,e[3]=n,e[4]=f):f=e[4];let d;e[5]!==r||e[6]!==s?(d=o=>s({url:o.target.value,caption:r}),e[5]=r,e[6]=s,e[7]=d):d=e[7];let c;e[8]!==d||e[9]!==t?(c=l.jsx("input",{value:t,onChange:d,placeholder:"https://youtube.com/watch?v=…",className:"h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[8]=d,e[9]=t,e[10]=c):c=e[10];let x;e[11]!==s||e[12]!==t?(x=o=>s({url:t,caption:o}),e[11]=s,e[12]=t,e[13]=x):x=e[13];let g;e[14]!==r||e[15]!==x?(g=l.jsx(X,{value:r,onChange:x,placeholder:"Add a caption…",className:"text-center text-sm italic text-muted-foreground"}),e[14]=r,e[15]=x,e[16]=g):g=e[16];let h;return e[17]!==f||e[18]!==c||e[19]!==g?(h=l.jsxs("div",{className:"space-y-2",children:[f,c,g]}),e[17]=f,e[18]=c,e[19]=g,e[20]=h):h=e[20],h}function ns(){const m=T.c(1);let e;return m[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx("div",{className:"flex items-center py-3","aria-label":"Divider",children:l.jsx("span",{className:"h-px flex-1 bg-border"})}),m[0]=e):e=m[0],e}function is(m){const e=T.c(16),{text:t,href:r,onChange:s}=m;let i;e[0]!==r||e[1]!==s?(i=g=>s({text:g.target.value,href:r}),e[0]=r,e[1]=s,e[2]=i):i=e[2];const n=Math.max(t.length||11,8);let f;e[3]!==i||e[4]!==n||e[5]!==t?(f=l.jsx("div",{className:"inline-flex items-center rounded-full bg-primary px-6 py-2 text-sm font-semibold text-primary-foreground",children:l.jsx("input",{value:t,onChange:i,placeholder:"Button label",size:n,className:"border-0 bg-transparent p-0 text-center text-sm font-semibold text-primary-foreground outline-none placeholder:text-primary-foreground/60 focus:ring-0"})}),e[3]=i,e[4]=n,e[5]=t,e[6]=f):f=e[6];let d;e[7]!==s||e[8]!==t?(d=g=>s({text:t,href:g.target.value}),e[7]=s,e[8]=t,e[9]=d):d=e[9];let c;e[10]!==r||e[11]!==d?(c=l.jsx("input",{value:r,onChange:d,placeholder:"https://destination-url.com",className:"w-full max-w-sm border-0 bg-transparent p-0 text-center text-xs text-muted-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[10]=r,e[11]=d,e[12]=c):c=e[12];let x;return e[13]!==f||e[14]!==c?(x=l.jsxs("div",{className:"flex flex-col items-center gap-2 py-2",children:[f,c]}),e[13]=f,e[14]=c,e[15]=x):x=e[15],x}const de=[{value:"info",icon:"ℹ",color:"oklch(0.62 0.19 250)"},{value:"tip",icon:"✓",color:"oklch(0.65 0.17 150)"},{value:"warning",icon:"⚠",color:"oklch(0.75 0.15 75)"},{value:"product",icon:"★",color:"oklch(0.62 0.21 300)"}];function as(m){const e=T.c(45),{title:t,body:r,variant:s,onChange:i}=m,[n,f]=V.useState(!1);let d;e[0]!==s?(d=de.find(w=>w.value===s)??de[0],e[0]=s,e[1]=d):d=e[1];const c=d;let x,g;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=()=>f(!0),g=w=>{w.currentTarget.contains(w.relatedTarget)||f(!1)},e[2]=x,e[3]=g):(x=e[2],g=e[3]);let h;e[4]!==r||e[5]!==n||e[6]!==i||e[7]!==t||e[8]!==c.value?(h=n&&l.jsx(ye,{children:de.map(w=>l.jsx(re,{active:c.value===w.value,label:w.value,onClick:()=>i({title:t,body:r,variant:w.value}),children:l.jsx("span",{style:{color:w.color},children:w.icon})},w.value))}),e[4]=r,e[5]=n,e[6]=i,e[7]=t,e[8]=c.value,e[9]=h):h=e[9];const o=`3px solid ${c.color}`,a=`color-mix(in oklch, ${c.color} 8%, transparent)`;let u;e[10]!==o||e[11]!==a?(u={borderLeft:o,backgroundColor:a},e[10]=o,e[11]=a,e[12]=u):u=e[12];let p;e[13]!==c.color?(p={color:c.color},e[13]=c.color,e[14]=p):p=e[14];let b;e[15]!==c.icon?(b=l.jsx("span",{"aria-hidden":!0,className:"text-sm font-bold leading-none",children:c.icon}),e[15]=c.icon,e[16]=b):b=e[16];let y;e[17]!==r||e[18]!==i||e[19]!==s?(y=w=>i({title:w.target.value,body:r,variant:s}),e[17]=r,e[18]=i,e[19]=s,e[20]=y):y=e[20];let v;e[21]!==c.color?(v={color:c.color},e[21]=c.color,e[22]=v):v=e[22];let N;e[23]!==y||e[24]!==v||e[25]!==t?(N=l.jsx("input",{value:t,onChange:y,placeholder:"Callout title",className:"flex-1 border-0 bg-transparent p-0 text-xs font-semibold uppercase tracking-wide outline-none focus:ring-0",style:v}),e[23]=y,e[24]=v,e[25]=t,e[26]=N):N=e[26];let j;e[27]!==N||e[28]!==p||e[29]!==b?(j=l.jsxs("div",{className:"mb-1.5 flex items-center gap-2",style:p,children:[b,N]}),e[27]=N,e[28]=p,e[29]=b,e[30]=j):j=e[30];let C;e[31]!==i||e[32]!==t||e[33]!==s?(C=w=>i({title:t,body:w,variant:s}),e[31]=i,e[32]=t,e[33]=s,e[34]=C):C=e[34];let S;e[35]!==r||e[36]!==C?(S=l.jsx(X,{value:r,onChange:C,placeholder:"Callout text…",className:"text-[15px] leading-relaxed text-foreground"}),e[35]=r,e[36]=C,e[37]=S):S=e[37];let k;e[38]!==j||e[39]!==S||e[40]!==u?(k=l.jsxs("div",{className:"rounded-md py-4 pl-5 pr-4",style:u,children:[j,S]}),e[38]=j,e[39]=S,e[40]=u,e[41]=k):k=e[41];let _;return e[42]!==k||e[43]!==h?(_=l.jsxs("div",{className:"relative",onFocus:x,onBlur:g,children:[h,k]}),e[42]=k,e[43]=h,e[44]=_):_=e[44],_}function cs(m){const e=T.c(25),{value:t,label:r,description:s,onChange:i}=m;let n;e[0]!==s||e[1]!==r||e[2]!==i?(n=o=>i({value:o.target.value,label:r,description:s}),e[0]=s,e[1]=r,e[2]=i,e[3]=n):n=e[3];let f;e[4]!==n||e[5]!==t?(f=l.jsx("input",{value:t,onChange:n,placeholder:"42%",className:"w-full border-0 bg-transparent p-0 text-center text-4xl font-bold tabular-nums text-foreground outline-none placeholder:text-muted-foreground/40 focus:ring-0"}),e[4]=n,e[5]=t,e[6]=f):f=e[6];let d;e[7]!==s||e[8]!==i||e[9]!==t?(d=o=>i({value:t,label:o.target.value,description:s}),e[7]=s,e[8]=i,e[9]=t,e[10]=d):d=e[10];let c;e[11]!==r||e[12]!==d?(c=l.jsx("input",{value:r,onChange:d,placeholder:"Label",className:"w-full border-0 bg-transparent p-0 text-center text-xs font-semibold uppercase tracking-wide text-muted-foreground outline-none placeholder:text-muted-foreground/40 focus:ring-0"}),e[11]=r,e[12]=d,e[13]=c):c=e[13];let x;e[14]!==r||e[15]!==i||e[16]!==t?(x=o=>i({value:t,label:r,description:o}),e[14]=r,e[15]=i,e[16]=t,e[17]=x):x=e[17];let g;e[18]!==s||e[19]!==x?(g=l.jsx(X,{value:s,onChange:x,placeholder:"Optional description",className:"max-w-md text-center text-sm text-muted-foreground"}),e[18]=s,e[19]=x,e[20]=g):g=e[20];let h;return e[21]!==f||e[22]!==c||e[23]!==g?(h=l.jsxs("div",{className:"flex flex-col items-center gap-1.5 border-y border-border/60 py-8 text-center",children:[f,c,g]}),e[21]=f,e[22]=c,e[23]=g,e[24]=h):h=e[24],h}function ds(m){const e=T.c(19),{cards:t,onChange:r}=m;let s,i,n,f,d;if(e[0]!==t||e[1]!==r){i=se(t);let h;e[7]!==r?(h=a=>r(JSON.stringify(a)),e[7]=r,e[8]=h):h=e[8],s=h;const o=(a,u)=>s(i.map((p,b)=>b===a?{...p,...u}:p));d="space-y-2",n="grid grid-cols-1 gap-3 sm:grid-cols-3",f=i.slice(0,3).map((a,u)=>l.jsxs("div",{className:"group/item relative flex flex-col gap-2 rounded-lg border bg-card p-4",children:[l.jsx("div",{className:"absolute right-1 top-1",children:l.jsx(ee,{label:"Remove card",onClick:()=>s(i.filter((p,b)=>b!==u))})}),l.jsx("input",{value:A(a.icon),onChange:p=>o(u,{icon:p.target.value}),placeholder:"🎴",className:"flex h-9 w-9 items-center justify-center rounded-md border bg-background text-center text-lg outline-none focus:ring-0"}),l.jsx("input",{value:A(a.title),onChange:p=>o(u,{title:p.target.value}),placeholder:"Card title",className:"border-0 bg-transparent p-0 text-[15px] font-semibold outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),l.jsx(X,{value:A(a.body),onChange:p=>o(u,{body:p}),placeholder:"Card body",className:"text-sm text-muted-foreground"})]},u)),e[0]=t,e[1]=r,e[2]=s,e[3]=i,e[4]=n,e[5]=f,e[6]=d}else s=e[2],i=e[3],n=e[4],f=e[5],d=e[6];let c;e[9]!==n||e[10]!==f?(c=l.jsx("div",{className:n,children:f}),e[9]=n,e[10]=f,e[11]=c):c=e[11];let x;e[12]!==s||e[13]!==i?(x=i.length<3&&l.jsx(te,{label:"Add card",onClick:()=>s([...i,{title:"",body:""}])}),e[12]=s,e[13]=i,e[14]=x):x=e[14];let g;return e[15]!==d||e[16]!==c||e[17]!==x?(g=l.jsxs("div",{className:d,children:[c,x]}),e[15]=d,e[16]=c,e[17]=x,e[18]=g):g=e[18],g}function us(m){const e=T.c(27),{title:t,items:r,onChange:s}=m;let i,n,f,d,c;if(e[0]!==r||e[1]!==s||e[2]!==t){n=se(r);let o;e[8]!==s||e[9]!==t?(o=u=>s({title:t,items:JSON.stringify(u)}),e[8]=s,e[9]=t,e[10]=o):o=e[10],i=o,d="space-y-2";let a;e[11]!==r||e[12]!==s?(a=u=>s({title:u.target.value,items:r}),e[11]=r,e[12]=s,e[13]=a):a=e[13],e[14]!==a||e[15]!==t?(c=l.jsx("input",{value:t,onChange:a,placeholder:"Checklist title (optional)",className:"w-full border-0 bg-transparent p-0 text-lg font-semibold outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[14]=a,e[15]=t,e[16]=c):c=e[16],f=n.map((u,p)=>l.jsxs("li",{className:"group/item flex items-start gap-3 border-b border-border/50 py-2.5",children:[l.jsx("span",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center text-primary",children:l.jsx(qe,{size:15})}),l.jsx(X,{value:u,onChange:b=>i(n.map((y,v)=>v===p?b:y)),placeholder:"Checklist item",className:"text-[15px] text-foreground"}),l.jsx(ee,{label:"Remove item",onClick:()=>i(n.filter((b,y)=>y!==p))})]},p)),e[0]=r,e[1]=s,e[2]=t,e[3]=i,e[4]=n,e[5]=f,e[6]=d,e[7]=c}else i=e[3],n=e[4],f=e[5],d=e[6],c=e[7];let x;e[17]!==f?(x=l.jsx("ul",{children:f}),e[17]=f,e[18]=x):x=e[18];let g;e[19]!==i||e[20]!==n?(g=l.jsx(te,{label:"Add item",onClick:()=>i([...n,""])}),e[19]=i,e[20]=n,e[21]=g):g=e[21];let h;return e[22]!==d||e[23]!==c||e[24]!==x||e[25]!==g?(h=l.jsxs("div",{className:d,children:[c,x,g]}),e[22]=d,e[23]=c,e[24]=x,e[25]=g,e[26]=h):h=e[26],h}function fs(m){const e=T.c(19),{stats:t,onChange:r}=m;let s,i,n,f,d;if(e[0]!==r||e[1]!==t){i=se(t);let h;e[7]!==r?(h=a=>r(JSON.stringify(a)),e[7]=r,e[8]=h):h=e[8],s=h;const o=(a,u)=>s(i.map((p,b)=>b===a?{...p,...u}:p));d="space-y-2",n="grid grid-cols-1 gap-3 sm:grid-cols-3",f=i.slice(0,3).map((a,u)=>l.jsxs("div",{className:"group/item relative rounded-lg border p-5 text-center",children:[l.jsx("div",{className:"absolute right-1 top-1",children:l.jsx(ee,{label:"Remove stat",onClick:()=>s(i.filter((p,b)=>b!==u))})}),l.jsx("input",{value:A(a.value),onChange:p=>o(u,{value:p.target.value}),placeholder:"99%",className:"w-full border-0 bg-transparent p-0 text-center text-3xl font-bold tabular-nums text-foreground outline-none placeholder:text-muted-foreground/40 focus:ring-0"}),l.jsx("input",{value:A(a.label),onChange:p=>o(u,{label:p.target.value}),placeholder:"Label",className:"mt-1 w-full border-0 bg-transparent p-0 text-center text-sm text-muted-foreground outline-none placeholder:text-muted-foreground/40 focus:ring-0"})]},u)),e[0]=r,e[1]=t,e[2]=s,e[3]=i,e[4]=n,e[5]=f,e[6]=d}else s=e[2],i=e[3],n=e[4],f=e[5],d=e[6];let c;e[9]!==n||e[10]!==f?(c=l.jsx("div",{className:n,children:f}),e[9]=n,e[10]=f,e[11]=c):c=e[11];let x;e[12]!==s||e[13]!==i?(x=i.length<3&&l.jsx(te,{label:"Add stat",onClick:()=>s([...i,{value:"",label:""}])}),e[12]=s,e[13]=i,e[14]=x):x=e[14];let g;return e[15]!==d||e[16]!==c||e[17]!==x?(g=l.jsxs("div",{className:d,children:[c,x]}),e[15]=d,e[16]=c,e[17]=x,e[18]=g):g=e[18],g}function ms(m){const e=T.c(29),{title:t,steps:r,onChange:s}=m;let i,n,f,d,c,x;if(e[0]!==s||e[1]!==r||e[2]!==t){n=se(r);let a;e[9]!==s||e[10]!==t?(a=b=>s({title:t,steps:JSON.stringify(b)}),e[9]=s,e[10]=t,e[11]=a):a=e[11],i=a;const u=(b,y)=>i(n.map((v,N)=>N===b?{...v,...y}:v));c="space-y-2";let p;e[12]!==s||e[13]!==r?(p=b=>s({title:b.target.value,steps:r}),e[12]=s,e[13]=r,e[14]=p):p=e[14],e[15]!==p||e[16]!==t?(x=l.jsx("input",{value:t,onChange:p,placeholder:"Steps title (optional)",className:"w-full border-0 bg-transparent p-0 text-lg font-semibold uppercase tracking-wide outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[15]=p,e[16]=t,e[17]=x):x=e[17],f="space-y-3",d=n.map((b,y)=>l.jsxs("li",{className:"group/item flex gap-4",children:[l.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full border text-sm font-semibold text-muted-foreground",children:y+1}),l.jsxs("div",{className:"min-w-0 flex-1 space-y-1 pt-0.5",children:[l.jsx("input",{value:A(b.title),onChange:v=>u(y,{title:v.target.value}),placeholder:"Step title",className:"w-full border-0 bg-transparent p-0 text-[15px] font-semibold outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),l.jsx(X,{value:A(b.description),onChange:v=>u(y,{description:v}),placeholder:"Step description",className:"text-sm text-muted-foreground"})]}),l.jsx(ee,{label:"Remove step",onClick:()=>i(n.filter((v,N)=>N!==y))})]},y)),e[0]=s,e[1]=r,e[2]=t,e[3]=i,e[4]=n,e[5]=f,e[6]=d,e[7]=c,e[8]=x}else i=e[3],n=e[4],f=e[5],d=e[6],c=e[7],x=e[8];let g;e[18]!==f||e[19]!==d?(g=l.jsx("ol",{className:f,children:d}),e[18]=f,e[19]=d,e[20]=g):g=e[20];let h;e[21]!==i||e[22]!==n?(h=l.jsx(te,{label:"Add step",onClick:()=>i([...n,{title:"",description:""}])}),e[21]=i,e[22]=n,e[23]=h):h=e[23];let o;return e[24]!==c||e[25]!==x||e[26]!==g||e[27]!==h?(o=l.jsxs("div",{className:c,children:[x,g,h]}),e[24]=c,e[25]=x,e[26]=g,e[27]=h,e[28]=o):o=e[28],o}function we(m,e){try{const t=JSON.parse(m||"{}");return{title:typeof t?.title=="string"?t.title:e,items:Array.isArray(t?.items)?t.items:[]}}catch{return{title:e,items:[]}}}function ps(m){const e=T.c(7),{left:t,right:r,onChange:s}=m;let i;if(e[0]!==t||e[1]!==s||e[2]!==r){const n={left:we(t,"Option A"),right:we(r,"Option B")},f=(g,h)=>s({left:g==="left"?JSON.stringify(h):t,right:g==="right"?JSON.stringify(h):r});let d;e[4]!==f?(d=(g,h,o)=>{const a=h.items??[];return l.jsxs("div",{className:"space-y-2 rounded-lg border p-4",children:[l.jsx("input",{value:A(h.title),onChange:u=>f(g,{...h,title:u.target.value}),placeholder:"Column title",className:"w-full border-0 bg-transparent p-0 text-xs font-semibold uppercase tracking-wide outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),l.jsx("ul",{className:"space-y-1.5",children:a.map((u,p)=>l.jsxs("li",{className:"group/item flex items-start gap-2",children:[l.jsx("span",{"aria-hidden":!0,className:"mt-0.5 shrink-0 text-sm font-bold",style:{color:o},children:"✓"}),l.jsx(X,{value:u,onChange:b=>f(g,{...h,items:a.map((y,v)=>v===p?b:y)}),placeholder:"Item",className:"text-sm text-foreground"}),l.jsx(ee,{label:"Remove item",onClick:()=>f(g,{...h,items:a.filter((b,y)=>y!==p)})})]},p))}),l.jsx(te,{label:"Add item",onClick:()=>f(g,{...h,items:[...a,""]})})]})},e[4]=f,e[5]=d):d=e[5];const c=d;let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=Y("grid grid-cols-1 gap-3 sm:grid-cols-2"),e[6]=x):x=e[6],i=l.jsxs("div",{className:x,children:[c("left",n.left,"oklch(0.65 0.17 150)"),c("right",n.right,"oklch(0.75 0.15 75)")]}),e[0]=t,e[1]=s,e[2]=r,e[3]=i}else i=e[3];return i}const gs="vtex/loaders/intelligentSearch/productList.ts";function Z(m){return m&&typeof m=="object"&&!Array.isArray(m)?m:null}function ue(m){return typeof m=="string"||typeof m=="number"?String(m):""}function fe(m){const e=Z(m);return!!e&&typeof e.__resolveType=="string"&&"productId"in e}function Je(m){if(Array.isArray(m))return m.map(r=>ue(Z(r)?.productId));const e=Z(m),t=Z(e?.props);return t&&Array.isArray(t.ids)?t.ids.map(ue):e&&"productId"in e?[ue(e.productId)]:[]}function xs(m){const e=Z(m)??{};return typeof e.__resolveType=="string"?e.__resolveType:gs}function Ke(m,e){if(Array.isArray(m)){const i=m.find(fe);if(i)return e.map((n,f)=>{const d=Z(m[f]);return{...fe(d)?d:{__resolveType:i.__resolveType},productId:n}})}const t=Z(m);if(fe(t)&&!Z(t.props)?.ids)return{...t,productId:e[0]??""};const r=Z(t?.props)??{},s=xs(m);return{...t??{},__resolveType:s,props:{...r,ids:e,simulationBehavior:r.simulationBehavior??"default"}}}const Ye="vtex/loaders/intelligentSearch/productList.ts",hs="vtex/loaders/categories/tree.ts",bs=24;function le(m){return m&&typeof m=="object"&&!Array.isArray(m)?m:null}function ys(m){return m.split("/").filter(Boolean).map((t,r)=>`category-${r+1}/${t}`).join("/")}function vs(m,e){const t=e.trim();if(!t)return[];const r=Ye,s=bs;if(m==="cluster")return[{resolveType:r,props:{collection:t,count:s}}];if(m==="category"){const d=ys(t);return d?[{resolveType:r,props:{facets:d,count:s}}]:[]}const i=[];/^\d+$/.test(t)&&i.push({resolveType:r,props:{ids:[t]}});const f=t.includes("-")&&!/\s/.test(t)?t.replace(/-+/g," "):t;return i.push({resolveType:r,props:{query:f,count:s}}),i}function js(){return{resolveType:hs,props:{}}}function Ns(m){return{resolveType:Ye,props:{ids:m}}}function _e(m){return typeof m=="string"||typeof m=="number"?String(m):""}function Xe(m){const e=le(m),t=Array.isArray(m)?m:Array.isArray(e?.products)?e.products:[],r=[],s=new Set;for(const i of t){const n=le(i);if(!n)continue;const f=_e(n.productID)||_e(n.sku);if(!f||s.has(f))continue;s.add(f);const d=le(n.isVariantOf),c=typeof d?.name=="string"&&d.name||typeof n.name=="string"&&n.name||f,x=Array.isArray(n.image)?le(n.image[0]):null,g=typeof x?.url=="string"?x.url:void 0;r.push({id:f,label:c,image:g})}return r}function Cs(m){if(typeof m!="string"||!m)return null;let e;try{e=new URL(m,"https://placeholder.invalid").pathname}catch{return null}return e.replace(/^\/+|\/+$/g,"")||null}function ks(m){const e=[],t=new Set,r=(s,i)=>{const n=le(s);if(!n)return;const f=typeof n.name=="string"&&n.name?n.name:"",d=f?[...i,f]:i,c=Cs(n.url);if(c&&!t.has(c)&&(t.add(c),e.push({path:c,label:d.join(" › ")||c})),Array.isArray(n.children))for(const x of n.children)r(x,d)};if(Array.isArray(m))for(const s of m)r(s,[]);return e}function Ss(m,e,t=50){const r=e.trim().toLowerCase();return(r?m.filter(i=>i.label.toLowerCase().includes(r)||i.path.toLowerCase().includes(r)):m).slice(0,t)}const ws=1e4;async function ve(m,{resolveType:e,props:t}){const r=await fetch(at(m),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...t}),signal:AbortSignal.timeout(ws)});if(!r.ok)throw new Error(`Failed to fetch (${r.status})`);return r.json()}function Qe(m,e){const t=T.c(20);let r;t[0]!==e?(r=new Set(e.filter(Boolean)),t[0]=e,t[1]=r):r=t[1];let s;t[2]!==r?(s=[...r],t[2]=r,t[3]=s):s=t[3];const i=s;let n;t[4]!==i||t[5]!==m?(n=xe.sandboxInvoke(m?`${m.orgSlug}/${m.virtualMcpId}/${m.branch}`:"none",`blog-products-by-ids:${i.join(",")}`),t[4]=i,t[5]=m,t[6]=n):n=t[6];let f;t[7]!==i||t[8]!==m?(f=()=>ve(m,Ns(i)).then(Xe),t[7]=i,t[8]=m,t[9]=f):f=t[9];const d=!!m&&i.length>0;let c;t[10]!==n||t[11]!==f||t[12]!==d?(c={queryKey:n,queryFn:f,enabled:d,staleTime:6e4,retry:1},t[10]=n,t[11]=f,t[12]=d,t[13]=c):c=t[13];const x=he(c);let g;if(t[14]!==x.data){g=new Map;for(const o of x.data??[])g.set(o.id,o);t[14]=x.data,t[15]=g}else g=t[15];let h;return t[16]!==g||t[17]!==x.isError||t[18]!==x.isLoading?(h={byId:g,isLoading:x.isLoading,isError:x.isError},t[16]=g,t[17]=x.isError,t[18]=x.isLoading,t[19]=h):h=t[19],h}const _s=[{id:"search",label:"Search"},{id:"category",label:"Category"},{id:"cluster",label:"Cluster ID"}];async function As(m,e){if(e.length===0)return[];const t=await Promise.allSettled(e.map(n=>ve(m,n))),r=t.filter(n=>n.status==="fulfilled").map(n=>n.value);if(r.length===0){const n=t.find(f=>f.status==="rejected");throw n?n.reason:new Error("Failed to fetch products")}const s=[],i=new Set;for(const n of r)for(const f of Xe(n))i.has(f.id)||(i.add(f.id),s.push(f));return s}function Ae(m){const e=T.c(6),[t,r]=V.useState(""),[s,i]=V.useState(""),n=V.useRef(null);let f;e[0]!==m?(f=x=>{r(x),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>i(x),m)},e[0]=m,e[1]=f):f=e[1];const d=f;let c;return e[2]!==s||e[3]!==d||e[4]!==t?(c={value:t,debounced:s,onChange:d},e[2]=s,e[3]=d,e[4]=t,e[5]=c):c=e[5],c}function Ts(m){const e=T.c(23),{option:t,selected:r,onToggle:s}=m,i=r?"border-primary/40 bg-primary/5":"border-transparent hover:bg-muted/60";let n;e[0]!==i?(n=Y("flex w-full items-center gap-3 rounded-md border px-2 py-2 text-left transition-colors",i),e[0]=i,e[1]=n):n=e[1];let f;e[2]!==t.image?(f=l.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:t.image?l.jsx("img",{src:t.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):l.jsx(be,{size:14,className:"text-muted-foreground"})}),e[2]=t.image,e[3]=f):f=e[3];let d;e[4]!==t.label?(d=l.jsx("span",{className:"line-clamp-2 text-sm",children:t.label}),e[4]=t.label,e[5]=d):d=e[5];let c;e[6]!==t.id?(c=l.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:["ID ",t.id]}),e[6]=t.id,e[7]=c):c=e[7];let x;e[8]!==d||e[9]!==c?(x=l.jsxs("span",{className:"min-w-0 flex-1",children:[d,c]}),e[8]=d,e[9]=c,e[10]=x):x=e[10];const g=r?"border-primary bg-primary text-primary-foreground":"border-border text-transparent";let h;e[11]!==g?(h=Y("flex h-5 w-5 shrink-0 items-center justify-center rounded-full border",g),e[11]=g,e[12]=h):h=e[12];let o;e[13]===Symbol.for("react.memo_cache_sentinel")?(o=l.jsx(qe,{size:12}),e[13]=o):o=e[13];let a;e[14]!==h?(a=l.jsx("span",{className:h,children:o}),e[14]=h,e[15]=a):a=e[15];let u;return e[16]!==s||e[17]!==r||e[18]!==a||e[19]!==n||e[20]!==f||e[21]!==x?(u=l.jsxs("button",{type:"button",onClick:s,"aria-pressed":r,className:n,children:[f,x,a]}),e[16]=s,e[17]=r,e[18]=a,e[19]=n,e[20]=f,e[21]=x,e[22]=u):u=e[22],u}function We(m){const e=T.c(6),{query:t,emptyLabel:r,loadingLabel:s}=m;if(t.isLoading){let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=l.jsx(Me,{size:"xs"}),e[0]=n):n=e[0];let f;return e[1]!==s?(f=l.jsxs("div",{className:"flex items-center gap-2 px-2 py-6 text-sm text-muted-foreground",children:[n,s]}),e[1]=s,e[2]=f):f=e[2],f}if(t.isError){let n;return e[3]===Symbol.for("react.memo_cache_sentinel")?(n=l.jsx("p",{className:"px-2 py-6 text-sm text-muted-foreground",children:"Couldn’t load — is the dev server running?"}),e[3]=n):n=e[3],n}let i;return e[4]!==r?(i=l.jsx("p",{className:"px-2 py-6 text-center text-sm text-muted-foreground",children:r}),e[4]=r,e[5]=i):i=e[5],i}function Ze(m){return`${m.orgSlug}/${m.virtualMcpId}/${m.branch}`}function $s(m){const e=T.c(33),{sandboxRef:t,open:r,selected:s,onSelect:i}=m,[n,f]=V.useState("");let d;e[0]!==t?(d=xe.sandboxInvoke(Ze(t),"blog-category-tree"),e[0]=t,e[1]=d):d=e[1];let c;e[2]!==t?(c=()=>ve(t,js()).then(ks),e[2]=t,e[3]=c):c=e[3];const x=r&&!s;let g;e[4]!==d||e[5]!==c||e[6]!==x?(g={queryKey:d,queryFn:c,enabled:x,staleTime:6e4,retry:1},e[4]=d,e[5]=c,e[6]=x,e[7]=g):g=e[7];const h=he(g);if(s){let v;e[8]!==i?(v=()=>i(null),e[8]=i,e[9]=v):v=e[9];let N;e[10]===Symbol.for("react.memo_cache_sentinel")?(N=l.jsx(jt,{size:14}),e[10]=N):N=e[10];let j;e[11]!==s.label?(j=l.jsxs("span",{className:"truncate",children:["Category: ",l.jsx("span",{className:"text-foreground",children:s.label})," — change"]}),e[11]=s.label,e[12]=j):j=e[12];let C;return e[13]!==v||e[14]!==j?(C=l.jsxs("button",{type:"button",onClick:v,className:"flex items-center gap-1.5 rounded-md px-2 py-1.5 text-sm text-muted-foreground hover:bg-muted/60 hover:text-foreground",children:[N,j]}),e[13]=v,e[14]=j,e[15]=C):C=e[15],C}let o,a,u,p;if(e[16]!==n||e[17]!==i||e[18]!==h){const v=Ss(h.data??[],n);u="space-y-2";let N;e[23]===Symbol.for("react.memo_cache_sentinel")?(N=j=>f(j.target.value),e[23]=N):N=e[23],e[24]!==n?(p=l.jsx(pe,{value:n,onChange:N,placeholder:"Filter categories…",className:"h-9"}),e[24]=n,e[25]=p):p=e[25],o="h-48 overflow-y-auto rounded-md border",a=v.length===0?l.jsx(We,{query:h,loadingLabel:"Loading categories…",emptyLabel:"No categories."}):l.jsx("div",{className:"p-1",children:v.map(j=>l.jsx("button",{type:"button",onClick:()=>i(j),className:"block w-full truncate rounded px-2 py-1.5 text-left text-sm hover:bg-muted/60",children:j.label},j.path))}),e[16]=n,e[17]=i,e[18]=h,e[19]=o,e[20]=a,e[21]=u,e[22]=p}else o=e[19],a=e[20],u=e[21],p=e[22];let b;e[26]!==o||e[27]!==a?(b=l.jsx("div",{className:o,children:a}),e[26]=o,e[27]=a,e[28]=b):b=e[28];let y;return e[29]!==u||e[30]!==p||e[31]!==b?(y=l.jsxs("div",{className:u,children:[p,b]}),e[29]=u,e[30]=p,e[31]=b,e[32]=y):y=e[32],y}function et(m){const e=T.c(73),{open:t,onOpenChange:r,sandboxRef:s,selectedIds:i,onChange:n,multiple:f}=m,d=f===void 0?!0:f,[c,x]=V.useState("search"),g=Ae(300),h=Ae(300),[o,a]=V.useState(null),u=c==="search"?g.debounced:c==="cluster"?h.debounced:o?.path??"";let p;e[0]!==c||e[1]!==u?(p=vs(c,u),e[0]=c,e[1]=u,e[2]=p):p=e[2];const b=p;let y;e[3]!==c||e[4]!==s||e[5]!==u?(y=xe.sandboxInvoke(Ze(s),`blog-product:${c}:${u}`),e[3]=c,e[4]=s,e[5]=u,e[6]=y):y=e[6];let v;e[7]!==b||e[8]!==s?(v=()=>As(s,b),e[7]=b,e[8]=s,e[9]=v):v=e[9];const N=t&&b.length>0;let j;e[10]!==y||e[11]!==v||e[12]!==N?(j={queryKey:y,queryFn:v,enabled:N,staleTime:6e4,retry:1},e[10]=y,e[11]=v,e[12]=N,e[13]=j):j=e[13];const C=he(j);let S;e[14]!==i?(S=new Set(i.filter(Boolean)),e[14]=i,e[15]=S):S=e[15];const k=S;let _;e[16]!==d||e[17]!==n||e[18]!==k||e[19]!==i?(_=z=>{if(!d){n(k.has(z)?[]:[z]);return}k.has(z)?n(i.filter(lt=>lt!==z)):n([...i.filter(Boolean),z])},e[16]=d,e[17]=n,e[18]=k,e[19]=i,e[20]=_):_=e[20];const w=_;let I;e[21]!==C.data?(I=C.data??[],e[21]=C.data,e[22]=I):I=e[22];const P=I,O=b.length===0,W=d?"Add products":"Choose a product";let K;e[23]!==W?(K=l.jsx(Ot,{className:"border-b border-border px-4 py-3",children:l.jsx(zt,{className:"text-sm font-medium",children:W})}),e[23]=W,e[24]=K):K=e[24];let H;e[25]!==c?(H=_s.map(z=>l.jsx("button",{type:"button",onClick:()=>x(z.id),className:Y("rounded-md px-2.5 py-1 text-sm transition-colors",c===z.id?"bg-muted font-medium text-foreground":"text-muted-foreground hover:text-foreground"),children:z.label},z.id)),e[25]=c,e[26]=H):H=e[26];let F;e[27]!==H?(F=l.jsx("div",{className:"flex shrink-0 items-center gap-1 border-b border-border px-4 py-2",children:H}),e[27]=H,e[28]=F):F=e[28];let M;e[29]!==c||e[30]!==g?(M=c==="search"&&l.jsx(pe,{autoFocus:!0,value:g.value,onChange:z=>g.onChange(z.target.value),placeholder:"Search products by name or ID…",className:"h-9"}),e[29]=c,e[30]=g,e[31]=M):M=e[31];let L;e[32]!==h||e[33]!==c?(L=c==="cluster"&&l.jsx(pe,{autoFocus:!0,value:h.value,onChange:z=>h.onChange(z.target.value),placeholder:"Collection / cluster ID (e.g. 2140)",className:"h-9"}),e[32]=h,e[33]=c,e[34]=L):L=e[34];let $;e[35]!==o||e[36]!==c||e[37]!==t||e[38]!==s?($=c==="category"&&l.jsx($s,{sandboxRef:s,open:t,selected:o,onSelect:a}),e[35]=o,e[36]=c,e[37]=t,e[38]=s,e[39]=$):$=e[39];let E;e[40]!==M||e[41]!==L||e[42]!==$?(E=l.jsxs("div",{className:"shrink-0 space-y-2 px-4 py-3",children:[M,L,$]}),e[40]=M,e[41]=L,e[42]=$,e[43]=E):E=e[43];let D;e[44]!==P||e[45]!==C||e[46]!==k||e[47]!==O||e[48]!==w?(D=P.length>0?P.map(z=>l.jsx(Ts,{option:z,selected:k.has(z.id),onToggle:()=>w(z.id)},z.id)):!O&&l.jsx(We,{query:C,loadingLabel:"Loading products…",emptyLabel:"No products found."}),e[44]=P,e[45]=C,e[46]=k,e[47]=O,e[48]=w,e[49]=D):D=e[49];let q;e[50]!==c||e[51]!==O?(q=O&&l.jsx("p",{className:"px-2 py-6 text-center text-sm text-muted-foreground",children:c==="category"?"Pick a category to see its products.":c==="cluster"?"Enter a collection or cluster ID.":"Type to search products."}),e[50]=c,e[51]=O,e[52]=q):q=e[52];let B;e[53]!==D||e[54]!==q?(B=l.jsxs("div",{className:"min-h-0 flex-1 space-y-1 overflow-y-auto border-t border-border px-3 py-2",children:[D,q]}),e[53]=D,e[54]=q,e[55]=B):B=e[55];const U=k.size===0?"None selected":`${k.size} selected`;let R;e[56]!==U?(R=l.jsx("span",{className:"text-xs text-muted-foreground",children:U}),e[56]=U,e[57]=R):R=e[57];let G;e[58]!==r?(G=l.jsx(rt,{size:"sm",onClick:()=>r(!1),children:"Done"}),e[58]=r,e[59]=G):G=e[59];let Q;e[60]!==R||e[61]!==G?(Q=l.jsxs("div",{className:"flex shrink-0 items-center justify-between border-t border-border px-4 py-3",children:[R,G]}),e[60]=R,e[61]=G,e[62]=Q):Q=e[62];let J;e[63]!==K||e[64]!==F||e[65]!==E||e[66]!==B||e[67]!==Q?(J=l.jsxs(Ft,{className:"flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[560px] sm:max-w-[560px]",children:[K,F,E,B,Q]}),e[63]=K,e[64]=F,e[65]=E,e[66]=B,e[67]=Q,e[68]=J):J=e[68];let oe;return e[69]!==r||e[70]!==t||e[71]!==J?(oe=l.jsx(Ut,{open:t,onOpenChange:r,children:J}),e[69]=r,e[70]=t,e[71]=J,e[72]=oe):oe=e[72],oe}const Is=["normal","h1","h2","h3"],Ls=/^<(h[1-3])>([\s\S]*)<\/\1>$/i;function Bs(m){const e=m.match(Ls);return e?{level:e[1].toLowerCase(),text:e[2]}:{level:"normal",text:m}}function Te(m,e){return e?m==="normal"?e:`<${m}>${e}</${m}>`:""}const $e={normal:"Normal",h1:"H1",h2:"H2",h3:"H3"},Es={normal:"text-lg font-semibold",h1:"text-3xl font-bold",h2:"text-2xl font-bold",h3:"text-xl font-semibold"};function Ps(m){const e=T.c(23),{value:t,onChange:r}=m;let s,i,n,f,d;e[0]!==r||e[1]!==t?({level:s,text:d}=Bs(t),f="space-y-1.5",i="flex items-center gap-0.5",n=Is.map(u=>l.jsx(re,{active:s===u,label:$e[u],onClick:()=>r(Te(u,d)),children:$e[u]},u)),e[0]=r,e[1]=t,e[2]=s,e[3]=i,e[4]=n,e[5]=f,e[6]=d):(s=e[2],i=e[3],n=e[4],f=e[5],d=e[6]);let c;e[7]!==i||e[8]!==n?(c=l.jsx("div",{className:i,children:n}),e[7]=i,e[8]=n,e[9]=c):c=e[9];let x;e[10]!==s||e[11]!==r?(x=u=>r(Te(s,u.target.value)),e[10]=s,e[11]=r,e[12]=x):x=e[12];const g=Es[s];let h;e[13]!==g?(h=Y("w-full border-0 bg-transparent p-0 outline-none placeholder:text-muted-foreground/50 focus:ring-0",g),e[13]=g,e[14]=h):h=e[14];let o;e[15]!==x||e[16]!==h||e[17]!==d?(o=l.jsx("input",{value:d,onChange:x,placeholder:"Shelf title",className:h}),e[15]=x,e[16]=h,e[17]=d,e[18]=o):o=e[18];let a;return e[19]!==f||e[20]!==c||e[21]!==o?(a=l.jsxs("div",{className:f,children:[c,o]}),e[19]=f,e[20]=c,e[21]=o,e[22]=a):a=e[22],a}function tt(m){const e=T.c(4),{label:t,onClick:r}=m;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=l.jsx(be,{size:13}),e[0]=s):s=e[0];let i;return e[1]!==t||e[2]!==r?(i=l.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 text-xs text-muted-foreground transition-colors hover:border-foreground/30 hover:text-foreground cursor-pointer",children:[s,t]}),e[1]=t,e[2]=r,e[3]=i):i=e[3],i}function st(m){const e=T.c(9),{option:t,loading:r,className:s,iconSize:i}=m,n=i===void 0?18:i;let f;e[0]!==s?(f=Y("flex items-center justify-center overflow-hidden bg-muted text-muted-foreground",s),e[0]=s,e[1]=f):f=e[1];let d;e[2]!==n||e[3]!==r||e[4]!==t?(d=t?.image?l.jsx("img",{src:t.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-contain p-1.5"}):r?l.jsx(Me,{size:"xs"}):l.jsx(Pt,{size:n}),e[2]=n,e[3]=r,e[4]=t,e[5]=d):d=e[5];let c;return e[6]!==f||e[7]!==d?(c=l.jsx("span",{className:f,children:d}),e[6]=f,e[7]=d,e[8]=c):c=e[8],c}function Rs(m){const e=T.c(36),{id:t,option:r,loading:s,onRemove:i}=m;let n;e[0]!==t?(n={id:t},e[0]=t,e[1]=n):n=e[1];const{attributes:f,listeners:d,setNodeRef:c,transform:x,transition:g,isDragging:h}=Fe(n);let o;e[2]!==x?(o=Ue.Transform.toString(x),e[2]=x,e[3]=o):o=e[3];let a;e[4]!==o||e[5]!==g?(a={transform:o,transition:g},e[4]=o,e[5]=g,e[6]=a):a=e[6];const u=h&&"z-10 opacity-60";let p;e[7]!==u?(p=Y("group/card relative flex flex-col overflow-hidden rounded-md border bg-background",u),e[7]=u,e[8]=p):p=e[8];let b;e[9]!==s||e[10]!==r?(b=l.jsx(st,{option:r,loading:s,className:"h-full w-full"}),e[9]=s,e[10]=r,e[11]=b):b=e[11];let y;e[12]===Symbol.for("react.memo_cache_sentinel")?(y=l.jsx(He,{size:13}),e[12]=y):y=e[12];let v;e[13]!==f||e[14]!==d?(v=l.jsx("button",{type:"button","aria-label":"Drag to reorder",...f,...d,className:"absolute left-1 top-1 flex h-6 w-6 cursor-grab items-center justify-center rounded bg-background/80 text-muted-foreground opacity-0 backdrop-blur-sm transition-opacity hover:text-foreground active:cursor-grabbing group-hover/card:opacity-100",children:y}),e[13]=f,e[14]=d,e[15]=v):v=e[15];let N;e[16]===Symbol.for("react.memo_cache_sentinel")?(N=l.jsx(Dt,{size:13}),e[16]=N):N=e[16];let j;e[17]!==i?(j=l.jsx("button",{type:"button","aria-label":"Remove product",onClick:i,className:"absolute right-1 top-1 flex h-6 w-6 items-center justify-center rounded bg-background/80 text-muted-foreground opacity-0 backdrop-blur-sm transition-opacity hover:text-destructive group-hover/card:opacity-100 cursor-pointer",children:N}),e[17]=i,e[18]=j):j=e[18];let C;e[19]!==j||e[20]!==b||e[21]!==v?(C=l.jsxs("div",{className:"relative aspect-square",children:[b,v,j]}),e[19]=j,e[20]=b,e[21]=v,e[22]=C):C=e[22];const S=r?.label??(s?"Loading…":`Product ${t}`);let k;e[23]!==S?(k=l.jsx("p",{className:"line-clamp-2 text-xs leading-tight text-foreground",children:S}),e[23]=S,e[24]=k):k=e[24];let _;e[25]!==t?(_=l.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["ID ",t]}),e[25]=t,e[26]=_):_=e[26];let w;e[27]!==k||e[28]!==_?(w=l.jsxs("div",{className:"flex flex-col gap-0.5 p-2",children:[k,_]}),e[27]=k,e[28]=_,e[29]=w):w=e[29];let I;return e[30]!==c||e[31]!==C||e[32]!==w||e[33]!==a||e[34]!==p?(I=l.jsxs("div",{ref:c,style:a,className:p,children:[C,w]}),e[30]=c,e[31]=C,e[32]=w,e[33]=a,e[34]=p,e[35]=I):I=e[35],I}function Ds(m){const e=T.c(21),{ids:t,lookup:r,onReorder:s,onRemove:i}=m;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={activationConstraint:{distance:6}},e[0]=n):n=e[0];let f;e[1]===Symbol.for("react.memo_cache_sentinel")?(f={coordinateGetter:Pe},e[1]=f):f=e[1];const d=Le(ie(Ee,n),ie(Be,f));let c;e[2]!==t||e[3]!==s?(c=u=>{const{active:p,over:b}=u;if(!b||p.id===b.id)return;const y=t.indexOf(String(p.id)),v=t.indexOf(String(b.id));y===-1||v===-1||s(Re(t,y,v))},e[2]=t,e[3]=s,e[4]=c):c=e[4];const x=c;let g;if(e[5]!==t||e[6]!==r||e[7]!==i){let u;e[9]!==r||e[10]!==i?(u=p=>l.jsx(Rs,{id:p,option:r.byId.get(p),loading:r.isLoading&&!r.byId.get(p),onRemove:()=>i(p)},p),e[9]=r,e[10]=i,e[11]=u):u=e[11],g=t.map(u),e[5]=t,e[6]=r,e[7]=i,e[8]=g}else g=e[8];let h;e[12]!==g?(h=l.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:g}),e[12]=g,e[13]=h):h=e[13];let o;e[14]!==t||e[15]!==h?(o=l.jsx(De,{items:t,strategy:ct,children:h}),e[14]=t,e[15]=h,e[16]=o):o=e[16];let a;return e[17]!==x||e[18]!==d||e[19]!==o?(a=l.jsx(Oe,{sensors:d,collisionDetection:ze,onDragEnd:x,children:o}),e[17]=x,e[18]=d,e[19]=o,e[20]=a):a=e[20],a}function Os(m){const e=T.c(5),{onBrowse:t}=m;let r,s,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=l.jsx("span",{className:"flex h-9 w-9 items-center justify-center rounded-full bg-muted text-muted-foreground",children:l.jsx(Rt,{size:16})}),s=l.jsx("span",{className:"text-sm font-medium text-foreground",children:"Add products"}),i=l.jsx("span",{className:"text-xs text-muted-foreground",children:"Search VTEX products, or pick a category or cluster"}),e[0]=r,e[1]=s,e[2]=i):(r=e[0],s=e[1],i=e[2]);let n;return e[3]!==t?(n=l.jsxs("button",{type:"button",onClick:t,className:"flex w-full flex-col items-center justify-center gap-1.5 rounded-lg border border-dashed py-8 text-center transition-colors hover:border-foreground/30 hover:bg-muted/40 cursor-pointer",children:[r,s,i]}),e[3]=t,e[4]=n):n=e[4],n}function zs(m){const e=T.c(19),{ids:t,onChange:r}=m;let s;e[0]!==t||e[1]!==r?(s=(h,o)=>r(t.map((a,u)=>u===h?o:a)),e[0]=t,e[1]=r,e[2]=s):s=e[2];const i=s;let n;e[3]===Symbol.for("react.memo_cache_sentinel")?(n=l.jsx(ne,{className:"text-xs text-muted-foreground",children:"VTEX product IDs"}),e[3]=n):n=e[3];let f;e[4]!==t.length?(f=t.length===0&&l.jsx("p",{className:"text-xs text-muted-foreground",children:"Start the dev server to browse products, or add SKU ids below."}),e[4]=t.length,e[5]=f):f=e[5];let d;e[6]!==t||e[7]!==r||e[8]!==i?(d=t.map((h,o)=>l.jsxs("li",{className:"group/item flex items-center gap-3",children:[l.jsx("input",{value:h,onChange:a=>i(o,a.target.value),placeholder:"151331",className:"h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),l.jsx(ee,{label:"Remove product ID",onClick:()=>r(t.filter((a,u)=>u!==o))})]},o)),e[6]=t,e[7]=r,e[8]=i,e[9]=d):d=e[9];let c;e[10]!==d?(c=l.jsx("ul",{className:"space-y-2",children:d}),e[10]=d,e[11]=c):c=e[11];let x;e[12]!==t||e[13]!==r?(x=l.jsx(te,{label:"Add product ID",onClick:()=>r([...t,""])}),e[12]=t,e[13]=r,e[14]=x):x=e[14];let g;return e[15]!==f||e[16]!==c||e[17]!==x?(g=l.jsxs("div",{className:"space-y-2",children:[n,f,c,x]}),e[15]=f,e[16]=c,e[17]=x,e[18]=g):g=e[18],g}function Fs(m){const e=T.c(31),{block:t,onChange:r,sandboxRef:s}=m;let i,n;e[0]!==t.products?(i=Je(t.products),n=new Set(i.filter(Boolean)),e[0]=t.products,e[1]=i,e[2]=n):(i=e[1],n=e[2]);let f;e[3]!==n?(f=[...n],e[3]=n,e[4]=f):f=e[4];const d=f,[c,x]=V.useState(!1),g=Qe(s,d);let h;e[5]!==t||e[6]!==r?(h=N=>r({...t,products:Ke(t.products,N)}),e[5]=t,e[6]=r,e[7]=h):h=e[7];const o=h;let a;e[8]!==t.title?(a=A(t.title),e[8]=t.title,e[9]=a):a=e[9];let u;e[10]!==t||e[11]!==r?(u=N=>r({...t,title:N}),e[10]=t,e[11]=r,e[12]=u):u=e[12];let p;e[13]!==a||e[14]!==u?(p=l.jsx(Ps,{value:a,onChange:u}),e[13]=a,e[14]=u,e[15]=p):p=e[15];let b;e[16]!==d||e[17]!==g||e[18]!==i||e[19]!==s||e[20]!==o?(b=s?l.jsxs("div",{className:"space-y-3",children:[d.length>0&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("span",{className:"text-xs font-medium text-muted-foreground",children:[d.length," ",d.length===1?"product":"products"]}),l.jsx(tt,{label:"Browse products",onClick:()=>x(!0)})]}),d.length===0?l.jsx(Os,{onBrowse:()=>x(!0)}):l.jsx(Ds,{ids:d,lookup:g,onReorder:o,onRemove:N=>o(d.filter(j=>j!==N))})]}):l.jsx(zs,{ids:i,onChange:o}),e[16]=d,e[17]=g,e[18]=i,e[19]=s,e[20]=o,e[21]=b):b=e[21];let y;e[22]!==d||e[23]!==c||e[24]!==s||e[25]!==o?(y=s&&l.jsx(et,{open:c,onOpenChange:x,sandboxRef:s,selectedIds:d,onChange:o}),e[22]=d,e[23]=c,e[24]=s,e[25]=o,e[26]=y):y=e[26];let v;return e[27]!==p||e[28]!==b||e[29]!==y?(v=l.jsxs("div",{className:"space-y-4 rounded-lg border bg-card p-4",children:[p,b,y]}),e[27]=p,e[28]=b,e[29]=y,e[30]=v):v=e[30],v}function Us(m){const e=T.c(16),{id:t,option:r,loading:s,onRemove:i}=m;let n;e[0]!==s||e[1]!==r?(n=l.jsx(st,{option:r,loading:s,className:"h-11 w-11 shrink-0 rounded",iconSize:16}),e[0]=s,e[1]=r,e[2]=n):n=e[2];const f=r?.label??(s?"Loading…":`Product ${t}`);let d;e[3]!==f?(d=l.jsx("p",{className:"truncate text-sm text-foreground",children:f}),e[3]=f,e[4]=d):d=e[4];let c;e[5]!==t?(c=l.jsxs("p",{className:"text-xs text-muted-foreground",children:["ID ",t]}),e[5]=t,e[6]=c):c=e[6];let x;e[7]!==d||e[8]!==c?(x=l.jsxs("div",{className:"min-w-0 flex-1",children:[d,c]}),e[7]=d,e[8]=c,e[9]=x):x=e[9];let g;e[10]!==i?(g=l.jsx(ee,{label:"Remove product",onClick:i}),e[10]=i,e[11]=g):g=e[11];let h;return e[12]!==n||e[13]!==x||e[14]!==g?(h=l.jsxs("div",{className:"group/item flex items-center gap-3 rounded-md border bg-background p-2",children:[n,x,g]}),e[12]=n,e[13]=x,e[14]=g,e[15]=h):h=e[15],h}function Vs(m){const e=T.c(50),{block:t,onChange:r,sandboxRef:s}=m;let i;e[0]!==t.product?(i=Je(t.product).filter(Boolean)[0]??"",e[0]=t.product,e[1]=i):i=e[1];const n=i,[f,d]=V.useState(!1);let c;e[2]!==n?(c=n?[n]:[],e[2]=n,e[3]=c):c=e[3];const x=Qe(s,c);let g;e[4]!==t||e[5]!==r?(g=O=>r({...t,product:Ke(t.product,O)}),e[4]=t,e[5]=r,e[6]=g):g=e[6];const h=g;let o;e[7]===Symbol.for("react.memo_cache_sentinel")?(o=l.jsx("div",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Product card"}),e[7]=o):o=e[7];let a;e[8]===Symbol.for("react.memo_cache_sentinel")?(a=l.jsx(ne,{htmlFor:"product-card-cta",className:"text-xs text-muted-foreground",children:"CTA label"}),e[8]=a):a=e[8];let u;e[9]!==t.textCta?(u=A(t.textCta),e[9]=t.textCta,e[10]=u):u=e[10];let p;e[11]!==t||e[12]!==r?(p=O=>r({...t,textCta:O.target.value}),e[11]=t,e[12]=r,e[13]=p):p=e[13];let b;e[14]!==u||e[15]!==p?(b=l.jsxs("div",{className:"space-y-2",children:[a,l.jsx("input",{id:"product-card-cta",value:u,onChange:p,placeholder:"Ver produto",className:"h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50 focus:ring-0"})]}),e[14]=u,e[15]=p,e[16]=b):b=e[16];let y;e[17]===Symbol.for("react.memo_cache_sentinel")?(y=l.jsx(ne,{htmlFor:"product-card-slug",className:"text-xs text-muted-foreground",children:"Product slug"}),e[17]=y):y=e[17];let v;e[18]!==t.productSlug?(v=A(t.productSlug),e[18]=t.productSlug,e[19]=v):v=e[19];let N;e[20]!==t||e[21]!==r?(N=O=>r({...t,productSlug:O.target.value}),e[20]=t,e[21]=r,e[22]=N):N=e[22];let j;e[23]!==v||e[24]!==N?(j=l.jsxs("div",{className:"space-y-2",children:[y,l.jsx("input",{id:"product-card-slug",value:v,onChange:N,placeholder:"product-slug",className:"h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50 focus:ring-0"})]}),e[23]=v,e[24]=N,e[25]=j):j=e[25];let C;e[26]===Symbol.for("react.memo_cache_sentinel")?(C=l.jsx(ne,{className:"text-xs text-muted-foreground",children:"Product"}),e[26]=C):C=e[26];let S;e[27]!==n||e[28]!==s?(S=s&&n&&l.jsx(tt,{label:"Change",onClick:()=>d(!0)}),e[27]=n,e[28]=s,e[29]=S):S=e[29];let k;e[30]!==S?(k=l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[C,S]}),e[30]=S,e[31]=k):k=e[31];let _;e[32]!==x||e[33]!==n||e[34]!==s||e[35]!==h?(_=s?n?l.jsx(Us,{id:n,option:x.byId.get(n),loading:x.isLoading,onRemove:()=>h([])}):l.jsxs("button",{type:"button",onClick:()=>d(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-md border border-dashed py-3 text-sm text-muted-foreground transition-colors hover:border-foreground/30 hover:text-foreground cursor-pointer",children:[l.jsx(be,{size:14}),"Choose a product"]}):l.jsx("input",{value:n,onChange:O=>h(O.target.value?[O.target.value]:[]),placeholder:"VTEX product ID (e.g. 151331)",className:"h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[32]=x,e[33]=n,e[34]=s,e[35]=h,e[36]=_):_=e[36];let w;e[37]!==k||e[38]!==_?(w=l.jsxs("div",{className:"space-y-2",children:[k,_]}),e[37]=k,e[38]=_,e[39]=w):w=e[39];let I;e[40]!==f||e[41]!==n||e[42]!==s||e[43]!==h?(I=s&&l.jsx(et,{open:f,onOpenChange:d,sandboxRef:s,selectedIds:n?[n]:[],onChange:h,multiple:!1}),e[40]=f,e[41]=n,e[42]=s,e[43]=h,e[44]=I):I=e[44];let P;return e[45]!==j||e[46]!==w||e[47]!==I||e[48]!==b?(P=l.jsxs("div",{className:"space-y-4 rounded-lg border bg-card p-4",children:[o,b,j,w,I]}),e[45]=j,e[46]=w,e[47]=I,e[48]=b,e[49]=P):P=e[49],P}const Hs=2,qs=2;function Ms(m){return se(m).map(A)}function Gs(m){return se(m).map(e=>Array.isArray(e)?e.map(A):[])}function Ie(m){return Array.from({length:m},()=>"")}function Js(m){const e=T.c(42),{headers:t,rows:r,onChange:s}=m;let i,n,f,d,c,x,g,h,o;if(e[0]!==t||e[1]!==s||e[2]!==r){const S=Ms(t),k=Gs(r),_=S.length===0&&k.length===0;f=_?Hs:Math.max(S.length,...k.map(Xs),1);const w=Array.from({length:f},(L,$)=>S[$]??"");d=_?Array.from({length:qs},()=>Ie(f)):k.map(L=>Array.from({length:f},($,E)=>L[E]??""));let I;e[12]!==s?(I=(L,$)=>s({headers:JSON.stringify(L.some(Ys)?L:[]),rows:JSON.stringify($)}),e[12]=s,e[13]=I):I=e[13];const P=I,O=(L,$)=>P(w.map((E,D)=>D===L?$:E),d),W=(L,$,E)=>P(w,d.map((D,q)=>q===L?D.map((B,U)=>U===$?E:B):D));n=()=>P(w,[...d,Ie(f)]);const K=L=>P(w,d.filter(($,E)=>E!==L));i=()=>P([...w,""],d.map(Ks));const H=L=>P(w.filter(($,E)=>E!==L),d.map($=>$.filter((E,D)=>D!==L)));o="space-y-2",h="overflow-x-auto rounded-lg border",x="w-full border-collapse";let F;e[14]===Symbol.for("react.memo_cache_sentinel")?(F=l.jsx("th",{className:"w-8 border-b"}),e[14]=F):F=e[14];const M=l.jsxs("tr",{className:"bg-muted/40",children:[w.map((L,$)=>l.jsxs("th",{className:"group/col relative border-b border-r p-0 last:border-r-0",children:[l.jsx("input",{value:L,onChange:E=>O($,E.target.value),placeholder:`Header ${$+1}`,className:"w-full border-0 bg-transparent py-2 pl-7 pr-3 text-xs font-semibold uppercase tracking-wide outline-none placeholder:text-muted-foreground/40 focus:bg-background focus:ring-0"}),f>1&&l.jsx("button",{type:"button","aria-label":`Remove column ${$+1}`,onClick:()=>H($),className:"absolute left-0.5 top-1/2 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded text-muted-foreground/50 opacity-0 transition-opacity hover:text-destructive group-hover/col:opacity-100 cursor-pointer",children:l.jsx(me,{size:12})})]},$)),F]});e[15]!==M?(g=l.jsx("thead",{children:M}),e[15]=M,e[16]=g):g=e[16],c=d.map((L,$)=>l.jsxs("tr",{className:"group/item border-b last:border-b-0",children:[L.map((E,D)=>l.jsx("td",{className:"border-r p-0 last:border-r-0",children:l.jsx("input",{value:E,onChange:q=>W($,D,q.target.value),placeholder:"—",className:"w-full border-0 bg-transparent px-3 py-2 text-sm outline-none placeholder:text-muted-foreground/30 focus:bg-muted/30 focus:ring-0"})},D)),l.jsx("td",{className:"w-8 text-center align-middle",children:d.length>1&&l.jsx("button",{type:"button","aria-label":`Remove row ${$+1}`,onClick:()=>K($),className:"flex h-6 w-6 items-center justify-center rounded text-muted-foreground/60 opacity-0 transition-opacity hover:text-destructive group-hover/item:opacity-100 cursor-pointer",children:l.jsx(me,{size:13})})})]},$)),e[0]=t,e[1]=s,e[2]=r,e[3]=i,e[4]=n,e[5]=f,e[6]=d,e[7]=c,e[8]=x,e[9]=g,e[10]=h,e[11]=o}else i=e[3],n=e[4],f=e[5],d=e[6],c=e[7],x=e[8],g=e[9],h=e[10],o=e[11];let a;e[17]!==f||e[18]!==d.length?(a=d.length===0&&l.jsx("tr",{children:l.jsx("td",{colSpan:f+1,className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"No rows yet — add one below."})}),e[17]=f,e[18]=d.length,e[19]=a):a=e[19];let u;e[20]!==c||e[21]!==a?(u=l.jsxs("tbody",{children:[c,a]}),e[20]=c,e[21]=a,e[22]=u):u=e[22];let p;e[23]!==x||e[24]!==g||e[25]!==u?(p=l.jsxs("table",{className:x,children:[g,u]}),e[23]=x,e[24]=g,e[25]=u,e[26]=p):p=e[26];let b;e[27]!==h||e[28]!==p?(b=l.jsx("div",{className:h,children:p}),e[27]=h,e[28]=p,e[29]=b):b=e[29];let y;e[30]!==n?(y=l.jsx(te,{label:"Add row",onClick:n}),e[30]=n,e[31]=y):y=e[31];let v;e[32]===Symbol.for("react.memo_cache_sentinel")?(v=l.jsx(Ve,{size:13}),e[32]=v):v=e[32];let N;e[33]!==i?(N=l.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-1.5 rounded-md border border-dashed px-2.5 py-1.5 text-xs text-muted-foreground transition-colors hover:border-foreground/30 hover:text-foreground cursor-pointer",children:[v,"Add column"]}),e[33]=i,e[34]=N):N=e[34];let j;e[35]!==y||e[36]!==N?(j=l.jsxs("div",{className:"flex gap-2",children:[y,N]}),e[35]=y,e[36]=N,e[37]=j):j=e[37];let C;return e[38]!==j||e[39]!==o||e[40]!==b?(C=l.jsxs("div",{className:o,children:[b,j]}),e[38]=j,e[39]=o,e[40]=b,e[41]=C):C=e[41],C}function Ks(m){return[...m,""]}function Ys(m){return m.trim()!==""}function Xs(m){return m.length}function Qs(m){const e=T.c(182),{block:t,meta:r,onChange:s,sandboxRef:i}=m,n=t.__resolveType??"",f=dt(n);if(ut(n))switch(f){case"Paragraph":{let o;e[0]!==t.html?(o=A(t.html),e[0]=t.html,e[1]=o):o=e[1];let a;e[2]!==t||e[3]!==s?(a=p=>s({...t,html:p}),e[2]=t,e[3]=s,e[4]=a):a=e[4];let u;return e[5]!==o||e[6]!==a?(u=l.jsx(Qt,{html:o,placeholder:"Write something…",onChange:a}),e[5]=o,e[6]=a,e[7]=u):u=e[7],u}case"Heading":{let o;e[8]!==t.text?(o=A(t.text),e[8]=t.text,e[9]=o):o=e[9];let a;e[10]!==t.level?(a=A(t.level),e[10]=t.level,e[11]=a):a=e[11];let u;e[12]!==t||e[13]!==s?(u=b=>s({...t,...b}),e[12]=t,e[13]=s,e[14]=u):u=e[14];let p;return e[15]!==o||e[16]!==a||e[17]!==u?(p=l.jsx(Zt,{text:o,level:a,onChange:u}),e[15]=o,e[16]=a,e[17]=u,e[18]=p):p=e[18],p}case"Quote":{let o;e[19]!==t.quote?(o=A(t.quote),e[19]=t.quote,e[20]=o):o=e[20];let a;e[21]!==t||e[22]!==s?(a=p=>s({...t,quote:p}),e[21]=t,e[22]=s,e[23]=a):a=e[23];let u;return e[24]!==o||e[25]!==a?(u=l.jsx(es,{quote:o,onChange:a}),e[24]=o,e[25]=a,e[26]=u):u=e[26],u}case"Code":{let o;e[27]!==t.code?(o=A(t.code),e[27]=t.code,e[28]=o):o=e[28];let a;e[29]!==t.language?(a=A(t.language),e[29]=t.language,e[30]=a):a=e[30];let u;e[31]!==t||e[32]!==s?(u=b=>s({...t,...b}),e[31]=t,e[32]=s,e[33]=u):u=e[33];let p;return e[34]!==o||e[35]!==a||e[36]!==u?(p=l.jsx(ts,{code:o,language:a,onChange:u}),e[34]=o,e[35]=a,e[36]=u,e[37]=p):p=e[37],p}case"List":{let o;e[38]!==t.items?(o=A(t.items),e[38]=t.items,e[39]=o):o=e[39];let a;e[40]!==t.style?(a=A(t.style),e[40]=t.style,e[41]=a):a=e[41];let u;e[42]!==t||e[43]!==s?(u=b=>s({...t,...b}),e[42]=t,e[43]=s,e[44]=u):u=e[44];let p;return e[45]!==o||e[46]!==a||e[47]!==u?(p=l.jsx(ss,{items:o,style:a,onChange:u}),e[45]=o,e[46]=a,e[47]=u,e[48]=p):p=e[48],p}case"BlockImage":{let o;return e[49]!==t||e[50]!==s?(o=l.jsx(ls,{block:t,onChange:s}),e[49]=t,e[50]=s,e[51]=o):o=e[51],o}case"Video":{let o;e[52]!==t.url?(o=A(t.url),e[52]=t.url,e[53]=o):o=e[53];let a;e[54]!==t.caption?(a=A(t.caption),e[54]=t.caption,e[55]=a):a=e[55];let u;e[56]!==t||e[57]!==s?(u=b=>s({...t,...b}),e[56]=t,e[57]=s,e[58]=u):u=e[58];let p;return e[59]!==o||e[60]!==a||e[61]!==u?(p=l.jsx(os,{url:o,caption:a,onChange:u}),e[59]=o,e[60]=a,e[61]=u,e[62]=p):p=e[62],p}case"Divider":{let o;return e[63]===Symbol.for("react.memo_cache_sentinel")?(o=l.jsx(ns,{}),e[63]=o):o=e[63],o}case"Cta":{let o;e[64]!==t.text?(o=A(t.text),e[64]=t.text,e[65]=o):o=e[65];let a;e[66]!==t.href?(a=A(t.href),e[66]=t.href,e[67]=a):a=e[67];let u;e[68]!==t||e[69]!==s?(u=b=>s({...t,...b}),e[68]=t,e[69]=s,e[70]=u):u=e[70];let p;return e[71]!==o||e[72]!==a||e[73]!==u?(p=l.jsx(is,{text:o,href:a,onChange:u}),e[71]=o,e[72]=a,e[73]=u,e[74]=p):p=e[74],p}case"Callout":{let o;e[75]!==t.title?(o=A(t.title),e[75]=t.title,e[76]=o):o=e[76];let a;e[77]!==t.body?(a=A(t.body),e[77]=t.body,e[78]=a):a=e[78];let u;e[79]!==t.variant?(u=A(t.variant),e[79]=t.variant,e[80]=u):u=e[80];let p;e[81]!==t||e[82]!==s?(p=y=>s({...t,...y}),e[81]=t,e[82]=s,e[83]=p):p=e[83];let b;return e[84]!==o||e[85]!==a||e[86]!==u||e[87]!==p?(b=l.jsx(as,{title:o,body:a,variant:u,onChange:p}),e[84]=o,e[85]=a,e[86]=u,e[87]=p,e[88]=b):b=e[88],b}case"Stat":{let o;e[89]!==t.value?(o=A(t.value),e[89]=t.value,e[90]=o):o=e[90];let a;e[91]!==t.label?(a=A(t.label),e[91]=t.label,e[92]=a):a=e[92];let u;e[93]!==t.description?(u=A(t.description),e[93]=t.description,e[94]=u):u=e[94];let p;e[95]!==t||e[96]!==s?(p=y=>s({...t,...y}),e[95]=t,e[96]=s,e[97]=p):p=e[97];let b;return e[98]!==o||e[99]!==a||e[100]!==u||e[101]!==p?(b=l.jsx(cs,{value:o,label:a,description:u,onChange:p}),e[98]=o,e[99]=a,e[100]=u,e[101]=p,e[102]=b):b=e[102],b}case"StatGroup":{let o;e[103]!==t.stats?(o=A(t.stats),e[103]=t.stats,e[104]=o):o=e[104];let a;e[105]!==t||e[106]!==s?(a=p=>s({...t,stats:p}),e[105]=t,e[106]=s,e[107]=a):a=e[107];let u;return e[108]!==o||e[109]!==a?(u=l.jsx(fs,{stats:o,onChange:a}),e[108]=o,e[109]=a,e[110]=u):u=e[110],u}case"CardGroup":{let o;e[111]!==t.cards?(o=typeof t.cards=="string"?t.cards:JSON.stringify(t.cards??[]),e[111]=t.cards,e[112]=o):o=e[112];let a;e[113]!==t||e[114]!==s?(a=p=>s({...t,cards:p}),e[113]=t,e[114]=s,e[115]=a):a=e[115];let u;return e[116]!==o||e[117]!==a?(u=l.jsx(ds,{cards:o,onChange:a}),e[116]=o,e[117]=a,e[118]=u):u=e[118],u}case"Checklist":{let o;e[119]!==t.title?(o=A(t.title),e[119]=t.title,e[120]=o):o=e[120];let a;e[121]!==t.items?(a=A(t.items),e[121]=t.items,e[122]=a):a=e[122];let u;e[123]!==t||e[124]!==s?(u=b=>s({...t,...b}),e[123]=t,e[124]=s,e[125]=u):u=e[125];let p;return e[126]!==o||e[127]!==a||e[128]!==u?(p=l.jsx(us,{title:o,items:a,onChange:u}),e[126]=o,e[127]=a,e[128]=u,e[129]=p):p=e[129],p}case"Steps":{let o;e[130]!==t.title?(o=A(t.title),e[130]=t.title,e[131]=o):o=e[131];let a;e[132]!==t.steps?(a=A(t.steps),e[132]=t.steps,e[133]=a):a=e[133];let u;e[134]!==t||e[135]!==s?(u=b=>s({...t,...b}),e[134]=t,e[135]=s,e[136]=u):u=e[136];let p;return e[137]!==o||e[138]!==a||e[139]!==u?(p=l.jsx(ms,{title:o,steps:a,onChange:u}),e[137]=o,e[138]=a,e[139]=u,e[140]=p):p=e[140],p}case"Comparison":{let o;e[141]!==t.left?(o=A(t.left),e[141]=t.left,e[142]=o):o=e[142];let a;e[143]!==t.right?(a=A(t.right),e[143]=t.right,e[144]=a):a=e[144];let u;e[145]!==t||e[146]!==s?(u=b=>s({...t,...b}),e[145]=t,e[146]=s,e[147]=u):u=e[147];let p;return e[148]!==o||e[149]!==a||e[150]!==u?(p=l.jsx(ps,{left:o,right:a,onChange:u}),e[148]=o,e[149]=a,e[150]=u,e[151]=p):p=e[151],p}case"Table":{let o;e[152]!==t.headers?(o=typeof t.headers=="string"?t.headers:JSON.stringify(t.headers??[]),e[152]=t.headers,e[153]=o):o=e[153];let a;e[154]!==t.rows?(a=typeof t.rows=="string"?t.rows:JSON.stringify(t.rows??[]),e[154]=t.rows,e[155]=a):a=e[155];let u;e[156]!==t||e[157]!==s?(u=b=>s({...t,...b}),e[156]=t,e[157]=s,e[158]=u):u=e[158];let p;return e[159]!==o||e[160]!==a||e[161]!==u?(p=l.jsx(Js,{headers:o,rows:a,onChange:u}),e[159]=o,e[160]=a,e[161]=u,e[162]=p):p=e[162],p}case"ProductCard":{let o;return e[163]!==t||e[164]!==s||e[165]!==i?(o=l.jsx(Vs,{block:t,onChange:s,sandboxRef:i}),e[163]=t,e[164]=s,e[165]=i,e[166]=o):o=e[166],o}case"ProductShelf":{let o;return e[167]!==t||e[168]!==s||e[169]!==i?(o=l.jsx(Fs,{block:t,onChange:s,sandboxRef:i}),e[167]=t,e[168]=s,e[169]=i,e[170]=o):o=e[170],o}}let c;e[171]!==r||e[172]!==n?(c=n?ft(n,r):null,e[171]=r,e[172]=n,e[173]=c):c=e[173];const x=c;if(!x){const o=n?` (${n})`:"";let a;return e[174]!==o?(a=l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Unknown block type",o,"."]}),e[174]=o,e[175]=a):a=e[175],a}let g;e[176]!==s?(g=o=>s(o),e[176]=s,e[177]=g):g=e[177];let h;return e[178]!==t||e[179]!==x||e[180]!==g?(h=l.jsx(mt,{schema:x,value:t,onChange:g,basePath:""}),e[178]=t,e[179]=x,e[180]=g,e[181]=h):h=e[181],h}function Ws(m){const e=T.c(34),{id:t,block:r,meta:s,onChange:i,onDelete:n,onDuplicate:f,sandboxRef:d}=m;let c;e[0]!==t?(c={id:t},e[0]=t,e[1]=c):c=e[1];const{attributes:x,listeners:g,setNodeRef:h,transform:o,transition:a,isDragging:u}=Fe(c);let p;e[2]!==o?(p=Ue.Transform.toString(o),e[2]=o,e[3]=p):p=e[3];let b;e[4]!==p||e[5]!==a?(b={transform:p,transition:a},e[4]=p,e[5]=a,e[6]=b):b=e[6];const y=u&&"opacity-50";let v;e[7]!==y?(v=Y("group/row relative rounded-md py-1.5 pl-12 pr-2 transition-colors hover:bg-muted/40",y),e[7]=y,e[8]=v):v=e[8];let N;e[9]===Symbol.for("react.memo_cache_sentinel")?(N=l.jsx(He,{size:14}),e[9]=N):N=e[9];let j;e[10]!==x||e[11]!==g?(j=l.jsx("button",{type:"button","aria-label":"Drag to reorder",className:"absolute left-1 top-1.5 flex h-6 w-6 cursor-grab items-center justify-center rounded text-muted-foreground opacity-0 transition-opacity hover:bg-muted hover:text-foreground active:cursor-grabbing group-hover/row:opacity-100",...x,...g,children:N}),e[10]=x,e[11]=g,e[12]=j):j=e[12];let C;e[13]===Symbol.for("react.memo_cache_sentinel")?(C=l.jsx($t,{size:14}),e[13]=C):C=e[13];let S;e[14]!==f?(S=l.jsx("button",{type:"button","aria-label":"Duplicate block",onClick:f,className:"flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground cursor-pointer",children:C}),e[14]=f,e[15]=S):S=e[15];let k;e[16]===Symbol.for("react.memo_cache_sentinel")?(k=l.jsx(me,{size:14}),e[16]=k):k=e[16];let _;e[17]!==n?(_=l.jsx("button",{type:"button","aria-label":"Delete block",onClick:n,className:"flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-destructive cursor-pointer",children:k}),e[17]=n,e[18]=_):_=e[18];let w;e[19]!==_||e[20]!==S?(w=l.jsxs("div",{className:"absolute right-1 top-1 z-10 flex flex-row gap-0.5 rounded-md bg-background/80 opacity-0 backdrop-blur-sm transition-opacity group-hover/row:opacity-100",children:[S,_]}),e[19]=_,e[20]=S,e[21]=w):w=e[21];let I;e[22]!==r||e[23]!==s||e[24]!==i||e[25]!==d?(I=l.jsx(Qs,{block:r,meta:s,onChange:i,sandboxRef:d}),e[22]=r,e[23]=s,e[24]=i,e[25]=d,e[26]=I):I=e[26];let P;return e[27]!==h||e[28]!==w||e[29]!==I||e[30]!==b||e[31]!==v||e[32]!==j?(P=l.jsxs("div",{ref:h,style:b,className:v,children:[j,w,I]}),e[27]=h,e[28]=w,e[29]=I,e[30]=b,e[31]=v,e[32]=j,e[33]=P):P=e[33],P}function Sl(m){return Array.isArray(m)?m:[]}function wl(m){const e=T.c(64),{value:t,onChange:r,meta:s,sandboxRef:i,emptyMessage:n}=m,f=n===void 0?"No content yet. Use ⊕ to add your first block.":n;let d;e[0]!==s?(d=pt(s),e[0]=s,e[1]=d):d=e[1];const c=d;let x;e[2]!==t?(x=()=>t.map(sl),e[2]=t,e[3]=x):x=e[3];const[g,h]=V.useState(x);let o;e[4]!==g?(o=g.map(tl),e[4]=g,e[5]=o):o=e[5];const a=o;let u;e[6]!==g?(u=g.map(el),e[6]=g,e[7]=u):u=e[7];const p=u;let b;e[8]!==r?(b=B=>{h(B),r(B.map(Zs))},e[8]=r,e[9]=b):b=e[9];const y=b;let v;e[10]!==g||e[11]!==y?(v=(B,U)=>{const R=[...g];R.splice(B,0,{id:ge(),block:{__resolveType:U}}),y(R)},e[10]=g,e[11]=y,e[12]=v):v=e[12];const N=v;let j;e[13]!==g||e[14]!==y?(j=(B,U)=>{y(g.map((R,G)=>G===B?{...R,block:U}:R))},e[13]=g,e[14]=y,e[15]=j):j=e[15];const C=j;let S;e[16]!==g||e[17]!==y?(S=B=>{y(g.filter((U,R)=>R!==B))},e[16]=g,e[17]=y,e[18]=S):S=e[18];const k=S;let _;e[19]!==g||e[20]!==y?(_=B=>{const U=g[B];if(!U)return;const R=[...g];R.splice(B+1,0,{id:ge(),block:structuredClone(U.block)}),y(R)},e[19]=g,e[20]=y,e[21]=_):_=e[21];const w=_;let I;e[22]===Symbol.for("react.memo_cache_sentinel")?(I={activationConstraint:{distance:6}},e[22]=I):I=e[22];let P;e[23]===Symbol.for("react.memo_cache_sentinel")?(P={coordinateGetter:Pe},e[23]=P):P=e[23];const O=Le(ie(Ee,I),ie(Be,P));let W;e[24]!==g||e[25]!==y?(W=B=>{const{active:U,over:R}=B;if(!R||U.id===R.id)return;const G=g.findIndex(J=>J.id===String(U.id)),Q=g.findIndex(J=>J.id===String(R.id));G===-1||Q===-1||y(Re(g,G,Q))},e[24]=g,e[25]=y,e[26]=W):W=e[26];const K=W;let H;e[27]!==p.length||e[28]!==f?(H=p.length===0&&l.jsx("p",{className:"py-6 text-center text-sm text-muted-foreground",children:f}),e[27]=p.length,e[28]=f,e[29]=H):H=e[29];let F;e[30]!==N?(F=B=>N(0,B),e[30]=N,e[31]=F):F=e[31];const M=p.length===0;let L;e[32]!==c||e[33]!==F||e[34]!==M?(L=l.jsx(ke,{blockTypes:c,onInsert:F,alwaysShow:M}),e[32]=c,e[33]=F,e[34]=M,e[35]=L):L=e[35];let $;if(e[36]!==g||e[37]!==c||e[38]!==w||e[39]!==N||e[40]!==s||e[41]!==k||e[42]!==i||e[43]!==C){let B;e[45]!==c||e[46]!==w||e[47]!==N||e[48]!==s||e[49]!==k||e[50]!==i||e[51]!==C?(B=(U,R)=>{const{id:G,block:Q}=U;return l.jsxs("div",{children:[l.jsx(Ws,{id:G,block:Q,meta:s,onChange:J=>C(R,J),onDelete:()=>k(R),onDuplicate:()=>w(R),sandboxRef:i}),l.jsx(ke,{blockTypes:c,onInsert:J=>N(R+1,J)})]},G)},e[45]=c,e[46]=w,e[47]=N,e[48]=s,e[49]=k,e[50]=i,e[51]=C,e[52]=B):B=e[52],$=g.map(B),e[36]=g,e[37]=c,e[38]=w,e[39]=N,e[40]=s,e[41]=k,e[42]=i,e[43]=C,e[44]=$}else $=e[44];let E;e[53]!==a||e[54]!==L||e[55]!==$?(E=l.jsxs(De,{items:a,strategy:gt,children:[L,$]}),e[53]=a,e[54]=L,e[55]=$,e[56]=E):E=e[56];let D;e[57]!==K||e[58]!==O||e[59]!==E?(D=l.jsx(Oe,{sensors:O,collisionDetection:ze,onDragEnd:K,children:E}),e[57]=K,e[58]=O,e[59]=E,e[60]=D):D=e[60];let q;return e[61]!==H||e[62]!==D?(q=l.jsxs("div",{className:"mt-2",children:[H,D]}),e[61]=H,e[62]=D,e[63]=q):q=e[63],q}function Zs(m){return m.block}function el(m){return m.block}function tl(m){return m.id}function sl(m){return{id:ge(),block:m}}function ge(){return crypto.randomUUID()}export{wl as B,Sl as a,kl as b,Cl as c};
@@ -1 +1 @@
1
- import{c as K,r as Ae,j as n,B as Te,ah as fe,l as _e,am as ze,C as Ie,n as Le,K as Oe,m as Ke,d as ge,p as H,t as L,M as Ue}from"./index-32Z_4GES.js";import{t as Xe}from"./ChevronDown-DnuZlbXl.js";import{i as He}from"./ChevronRight-D8z61LL4.js";import{s as Re}from"./Plus-DErQhYMo.js";import{s as qe,t as Me}from"./Star01-BvPb97r4.js";import{s as Ve}from"./Trash01-D68y5OFq.js";import{c as Qe,b as Ge,d as Ye,A as Je,g as We,e as Ze,a as et,f as tt}from"./alert-dialog-C0dmYQwl.js";import{P as Ne}from"./index-BFiY8eXY.js";import{u as $e}from"./studio-tools-n8590dlO.js";import{u as st}from"./use-debounced-autosave-DxPGO2nZ.js";import{n as nt}from"./LinkExternal01-BYMM_QSD.js";import{i as lt}from"./Zap-BPdmVchQ.js";import{I as ue}from"./input-DNRaDhXk.js";import{T as ot}from"./textarea-BIQq3kPx.js";import{R as rt}from"./require-capability-Dl7MMUtS.js";import"./sidebar-ChQMKige.js";import"./LayoutLeft-CoMgIDfR.js";import"./use-mobile-Dfj2nxpB.js";import"./X-DXgmI1I4.js";import"./tooltip-CpOqB12v.js";import"./use-capability-x8vfxJ7c.js";import"./access-gate-Du5lQEFN.js";import"./capability-load-error-DifNtXec.js";function we(t){const e=K.c(8),{title:s,children:o,className:l}=t;let r;e[0]!==l?(r=_e("rounded-2xl border border-border/60 bg-background p-5",l),e[0]=l,e[1]=r):r=e[1];let c;e[2]!==s?(c=n.jsx("div",{className:"mb-4",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s})}),e[2]=s,e[3]=c):c=e[3];let f;return e[4]!==o||e[5]!==r||e[6]!==c?(f=n.jsxs("div",{className:r,children:[c,o]}),e[4]=o,e[5]=r,e[6]=c,e[7]=f):f=e[7],f}function at(t){const e=K.c(25),{onExtract:s,isExtracting:o}=t,[l,r]=Ae.useState("");let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-primary/10",children:n.jsx(lt,{size:18,className:"text-primary"})}),e[0]=c):c=e[0];let f,g;e[1]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx("p",{className:"text-sm font-medium text-foreground",children:"Auto-extract brand context"}),g=n.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Enter your website URL and we'll automatically extract your brand colors, fonts, logos, and company overview."}),e[1]=f,e[2]=g):(f=e[1],g=e[2]);let b;e[3]===Symbol.for("react.memo_cache_sentinel")?(b=m=>r(m.target.value),e[3]=b):b=e[3];let p;e[4]!==l||e[5]!==o||e[6]!==s?(p=m=>{m.key==="Enter"&&l.trim()&&!o&&s(l.trim())},e[4]=l,e[5]=o,e[6]=s,e[7]=p):p=e[7];let d;e[8]!==l||e[9]!==p?(d=n.jsx(ue,{placeholder:"acme.com",value:l,onChange:b,className:"max-w-xs",onKeyDown:p}),e[8]=l,e[9]=p,e[10]=d):d=e[10];let a;e[11]!==l||e[12]!==o?(a=!l.trim()||o,e[11]=l,e[12]=o,e[13]=a):a=e[13];let i;e[14]!==l||e[15]!==s?(i=()=>s(l.trim()),e[14]=l,e[15]=s,e[16]=i):i=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(qe,{size:14}),e[17]=u):u=e[17];const h=o?"Extracting...":"Extract";let x;e[18]!==h||e[19]!==a||e[20]!==i?(x=n.jsxs(Te,{variant:"outline",disabled:a,onClick:i,children:[u,h]}),e[18]=h,e[19]=a,e[20]=i,e[21]=x):x=e[21];let v;return e[22]!==x||e[23]!==d?(v=n.jsx("div",{className:"rounded-2xl border border-dashed border-border bg-muted/30 p-5",children:n.jsxs("div",{className:"flex items-start gap-4",children:[c,n.jsxs("div",{className:"flex-1",children:[f,g,n.jsxs("div",{className:"mt-3 flex gap-2",children:[d,x]})]})]})}),e[22]=x,e[23]=d,e[24]=v):v=e[24],v}function it(t){const e=K.c(36),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s?(r=s.watch("domain"),e[0]=s,e[1]=r):r=e[1];const c=r;let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:"Company name"}),e[2]=f):f=e[2];let g;e[3]!==o||e[4]!==l?(g=D=>{const{field:y}=D;return n.jsx(ue,{...y,onChange:_=>{y.onChange(_),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"Acme Corp"})},e[3]=o,e[4]=l,e[5]=g):g=e[5];let b;e[6]!==s.control||e[7]!==g?(b=n.jsxs("div",{children:[f,n.jsx(fe,{control:s.control,name:"name",render:g})]}),e[6]=s.control,e[7]=g,e[8]=b):b=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx("span",{children:"Domain"}),e[9]=p):p=e[9];let d;e[10]!==c?(d=c&&n.jsxs("a",{href:`https://${c}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 transition-colors hover:text-foreground",children:[n.jsx(nt,{size:10}),"open"]}),e[10]=c,e[11]=d):d=e[11];let a;e[12]!==d?(a=n.jsxs("label",{className:"mb-1 flex items-center justify-between text-xs text-muted-foreground",children:[p,d]}),e[12]=d,e[13]=a):a=e[13];let i;e[14]!==o||e[15]!==l?(i=D=>{const{field:y}=D;return n.jsx(ue,{...y,onChange:_=>{y.onChange(_),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"acme.com"})},e[14]=o,e[15]=l,e[16]=i):i=e[16];let u;e[17]!==s.control||e[18]!==i?(u=n.jsx(fe,{control:s.control,name:"domain",render:i}),e[17]=s.control,e[18]=i,e[19]=u):u=e[19];let h;e[20]!==a||e[21]!==u?(h=n.jsxs("div",{children:[a,u]}),e[20]=a,e[21]=u,e[22]=h):h=e[22];let x;e[23]!==h||e[24]!==b?(x=n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[b,h]}),e[23]=h,e[24]=b,e[25]=x):x=e[25];let v;e[26]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:"Overview"}),e[26]=v):v=e[26];let m;e[27]!==o||e[28]!==l?(m=D=>{const{field:y}=D;return n.jsx(ot,{...y,onChange:_=>{y.onChange(_),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"Brief description of what the company does...",rows:3})},e[27]=o,e[28]=l,e[29]=m):m=e[29];let C;e[30]!==s.control||e[31]!==m?(C=n.jsxs("div",{children:[v,n.jsx(fe,{control:s.control,name:"overview",render:m})]}),e[30]=s.control,e[31]=m,e[32]=C):C=e[32];let k;return e[33]!==x||e[34]!==C?(k=n.jsx(we,{title:"Company Overview",children:n.jsxs("div",{className:"space-y-3",children:[x,C]})}),e[33]=x,e[34]=C,e[35]=k):k=e[35],k}const ct={backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"8px 8px",backgroundPosition:"0 0, 4px 4px",backgroundColor:"#fff"};function Se(t){const e=K.c(22),{form:s,name:o,label:l,imgClassName:r,onFieldChange:c,onFieldCommit:f}=t,g=r===void 0?"h-full w-full object-contain p-3":r;let b;e[0]!==s||e[1]!==o?(b=s.watch(o),e[0]=s,e[1]=o,e[2]=b):b=e[2];const p=b;let d;e[3]!==g||e[4]!==l||e[5]!==p?(d=n.jsx("div",{className:"flex aspect-video w-28 shrink-0 items-center justify-center overflow-hidden rounded-xl",style:ct,children:p?n.jsx("img",{src:p,alt:l,className:g,loading:"lazy"}):n.jsxs("span",{className:"text-[10px] text-muted-foreground/70",children:["No ",l.toLowerCase()]})}),e[3]=g,e[4]=l,e[5]=p,e[6]=d):d=e[6];let a;e[7]!==l?(a=n.jsxs("label",{className:"mb-1 block text-xs text-muted-foreground",children:[l," URL"]}),e[7]=l,e[8]=a):a=e[8];let i;e[9]!==c||e[10]!==f?(i=v=>{const{field:m}=v;return n.jsx(ue,{...m,onChange:C=>{m.onChange(C),c()},onBlur:()=>{m.onBlur(),f()},placeholder:"https://..."})},e[9]=c,e[10]=f,e[11]=i):i=e[11];let u;e[12]!==s.control||e[13]!==o||e[14]!==i?(u=n.jsx(fe,{control:s.control,name:o,render:i}),e[12]=s.control,e[13]=o,e[14]=i,e[15]=u):u=e[15];let h;e[16]!==a||e[17]!==u?(h=n.jsxs("div",{className:"flex-1",children:[a,u]}),e[16]=a,e[17]=u,e[18]=h):h=e[18];let x;return e[19]!==d||e[20]!==h?(x=n.jsxs("div",{className:"flex items-start gap-3",children:[d,h]}),e[19]=d,e[20]=h,e[21]=x):x=e[21],x}function dt(t){const e=K.c(4),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;return e[0]!==s||e[1]!==o||e[2]!==l?(r=n.jsx(we,{title:"Logos & Images",children:n.jsxs("div",{className:"space-y-3",children:[n.jsx(Se,{form:s,name:"logo",label:"Logo",onFieldChange:o,onFieldCommit:l}),n.jsx(Se,{form:s,name:"favicon",label:"Favicon",imgClassName:"h-12 w-12 object-contain",onFieldChange:o,onFieldCommit:l}),n.jsx(Se,{form:s,name:"ogImage",label:"SEO / OG image",imgClassName:"h-full w-full object-contain",onFieldChange:o,onFieldCommit:l})]})}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3],r}const mt=[{key:"heading",label:"Headings"},{key:"body",label:"Body"},{key:"code",label:"Code"}];function ft(t){const e=K.c(6),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s||e[1]!==o||e[2]!==l?(r=mt.map(f=>{const{key:g,label:b}=f,p=`fonts.${g}`,d=s.watch(p);return n.jsxs("div",{children:[n.jsxs("label",{className:"mb-1 flex items-center gap-3 text-xs text-muted-foreground",children:[n.jsx("span",{className:"w-7 text-base font-medium leading-none text-foreground",children:"Aa"}),n.jsx("span",{children:b}),d&&n.jsx("span",{className:"ml-auto truncate text-foreground",style:{fontFamily:d},children:d})]}),n.jsx(fe,{control:s.control,name:p,render:a=>{const{field:i}=a;return n.jsx(ue,{...i,value:i.value??"",onChange:u=>{i.onChange(u),o()},onBlur:()=>{i.onBlur(),l()},placeholder:`Font family for ${b.toLowerCase()}`})}})]},g)}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3];let c;return e[4]!==r?(c=n.jsx(we,{title:"Fonts",children:n.jsx("div",{className:"space-y-2",children:r})}),e[4]=r,e[5]=c):c=e[5],c}const ut=[{key:"primary",label:"Primary"},{key:"secondary",label:"Secondary"},{key:"accent",label:"Accent"},{key:"background",label:"Background"},{key:"foreground",label:"Foreground"}];function xt(t){const e=K.c(6),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s||e[1]!==o||e[2]!==l?(r=ut.map(f=>{const{key:g,label:b}=f,p=`colors.${g}`;return n.jsx(fe,{control:s.control,name:p,render:d=>{const{field:a}=d;return n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"color",value:a.value??"#000000",onChange:i=>{a.onChange(i.target.value),o()},onBlur:()=>{a.onBlur(),l()},className:"h-9 w-9 shrink-0 cursor-pointer rounded-lg border border-border bg-transparent p-0.5"}),n.jsx(ue,{value:a.value??"",onChange:i=>{a.onChange(i.target.value),o()},onBlur:()=>{a.onBlur(),l()},placeholder:"#000000",className:"w-28"}),n.jsx("span",{className:"flex-1 text-xs text-muted-foreground",children:b})]})}},g)}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3];let c;return e[4]!==r?(c=n.jsx(we,{title:"Colors",children:n.jsx("div",{className:"space-y-2",children:r})}),e[4]=r,e[5]=c):c=e[5],c}function gt(t){const e=K.c(127),{brand:s,onChanged:o}=t,l=$e(),[r,c]=Ae.useState(s.isDefault??!1),[f,g]=Ae.useState(!1),b=s.name??"",p=s.domain??"",d=s.overview??"",a=s.logo??"",i=s.favicon??"",u=s.ogImage??"";let h;e[0]!==s.fonts?(h=s.fonts??{},e[0]=s.fonts,e[1]=h):h=e[1];let x;e[2]!==s.colors?(x=s.colors??{},e[2]=s.colors,e[3]=x):x=e[3];let v;e[4]!==b||e[5]!==p||e[6]!==d||e[7]!==a||e[8]!==i||e[9]!==u||e[10]!==h||e[11]!==x?(v={values:{name:b,domain:p,overview:d,logo:a,favicon:i,ogImage:u,fonts:h,colors:x}},e[4]=b,e[5]=p,e[6]=d,e[7]=a,e[8]=i,e[9]=u,e[10]=h,e[11]=x,e[12]=v):v=e[12];const m=Ue(v);let C;e[13]!==s.id||e[14]!==l?(C={mutationFn:async j=>{const ve=Object.values(j.fonts).some(wt),Ce=Object.values(j.colors).some(_t);await l.call("BRAND_CONTEXT_UPDATE",{id:s.id,name:j.name,domain:j.domain,overview:j.overview,logo:j.logo||null,favicon:j.favicon||null,ogImage:j.ogImage||null,fonts:ve?j.fonts:null,colors:Ce?j.colors:null})},onError:Nt},e[13]=s.id,e[14]=l,e[15]=C):C=e[15];const k=ge(C);let D;e[16]!==s.id||e[17]!==m||e[18]!==o||e[19]!==k?(D={delayMs:500,save:async()=>{const j=m.control._formState.dirtyFields,ve=Object.keys(j);if(ve.length===0)return;const Ce=m.getValues(),Pe=m.control._defaultValues;m.reset(Ce,{keepValues:!0});try{await k.mutateAsync(Ce),H("brand_updated",{brand_id:s.id,fields:ve}),L.success("Brand context updated successfully"),o()}catch{m.reset(Pe,{keepValues:!0})}}},e[16]=s.id,e[17]=m,e[18]=o,e[19]=k,e[20]=D):D=e[20];const{schedule:y,flush:_}=st(D);let $;e[21]!==s.id||e[22]!==l?($=async()=>{await l.call("BRAND_CONTEXT_DELETE",{id:s.id})},e[21]=s.id,e[22]=l,e[23]=$):$=e[23];let P;e[24]!==s.id||e[25]!==o?(P=()=>{H("brand_deleted",{brand_id:s.id}),g(!1),o(),L.success("Brand deleted")},e[24]=s.id,e[25]=o,e[26]=P):P=e[26];let q;e[27]!==$||e[28]!==P?(q={mutationFn:$,onSuccess:P,onError:Ct},e[27]=$,e[28]=P,e[29]=q):q=e[29];const{mutate:U,isPending:N}=ge(q);let A;e[30]!==s.id||e[31]!==s.isDefault||e[32]!==l?(A=async()=>{await l.call("BRAND_CONTEXT_UPDATE",{id:s.id,isDefault:!s.isDefault})},e[30]=s.id,e[31]=s.isDefault,e[32]=l,e[33]=A):A=e[33];let B;e[34]!==s.id||e[35]!==s.isDefault||e[36]!==o?(B=()=>{H(s.isDefault?"brand_unset_as_default":"brand_set_as_default",{brand_id:s.id}),o(),L.success(s.isDefault?"Removed as default brand":"Set as default brand")},e[34]=s.id,e[35]=s.isDefault,e[36]=o,e[37]=B):B=e[37];let T;e[38]!==A||e[39]!==B?(T={mutationFn:A,onSuccess:B,onError:vt},e[38]=A,e[39]=B,e[40]=T):T=e[40];const{mutate:X}=ge(T),xe=s.isDefault?"border-primary/30":"border-border/60";let O;e[41]!==xe?(O=_e("rounded-2xl border bg-background",xe),e[41]=xe,e[42]=O):O=e[42];let z;e[43]!==r?(z=()=>c(!r),e[43]=r,e[44]=z):z=e[44];let E;e[45]!==r?(E=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:r?n.jsx(Xe,{size:14}):n.jsx(He,{size:14})}),e[45]=r,e[46]=E):E=e[46];let F;e[47]!==s.logo||e[48]!==s.name?(F=s.logo?n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-lg",style:{backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"6px 6px",backgroundPosition:"0 0, 3px 3px",backgroundColor:"#fff"},children:n.jsx("img",{src:s.logo,alt:"",className:"h-full w-full object-contain p-1",onError:yt})}):n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-muted",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s.name?.charAt(0)?.toUpperCase()||"?"})}),e[47]=s.logo,e[48]=s.name,e[49]=F):F=e[49];const I=s.name||"Untitled Brand";let S;e[50]!==I?(S=n.jsx("span",{className:"text-sm font-medium text-foreground",children:I}),e[50]=I,e[51]=S):S=e[51];let R;e[52]!==s.domain?(R=s.domain&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:s.domain}),e[52]=s.domain,e[53]=R):R=e[53];let w;e[54]!==S||e[55]!==R?(w=n.jsxs("div",{className:"flex flex-1 flex-col items-start gap-0.5 overflow-hidden text-left",children:[S,R]}),e[54]=S,e[55]=R,e[56]=w):w=e[56];let M;e[57]!==s.colors||e[58]!==r?(M=!r&&s.colors&&Object.values(s.colors).some(jt)&&n.jsx("div",{className:"flex shrink-0 gap-1",children:Object.entries(s.colors).filter(bt).map(pt)}),e[57]=s.colors,e[58]=r,e[59]=M):M=e[59];let V;e[60]!==s.fonts||e[61]!==r?(V=!r&&s.fonts&&Object.values(s.fonts).some(ht)&&n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Object.values(s.fonts).filter(Boolean).join(", ")}),e[60]=s.fonts,e[61]=r,e[62]=V):V=e[62];const De=s.isDefault?"opacity-100":"opacity-0 hover:bg-muted group-hover:opacity-100";let Q;e[63]!==De?(Q=_e("flex h-7 w-7 shrink-0 items-center justify-center rounded-lg transition-opacity",De),e[63]=De,e[64]=Q):Q=e[64];let G,Y;e[65]!==X?(G=j=>{j.stopPropagation(),X()},Y=j=>{j.key==="Enter"&&(j.stopPropagation(),X())},e[65]=X,e[66]=G,e[67]=Y):(G=e[66],Y=e[67]);const ke=s.isDefault?"Unset as default":"Set as default",Be=s.isDefault?"text-primary fill-primary":"text-muted-foreground";let J;e[68]!==Be?(J=_e(Be),e[68]=Be,e[69]=J):J=e[69];let W;e[70]!==J?(W=n.jsx(Me,{size:13,className:J}),e[70]=J,e[71]=W):W=e[71];let Z;e[72]!==Q||e[73]!==G||e[74]!==Y||e[75]!==ke||e[76]!==W?(Z=n.jsx("span",{role:"button",tabIndex:0,className:Q,onClick:G,onKeyDown:Y,title:ke,children:W}),e[72]=Q,e[73]=G,e[74]=Y,e[75]=ke,e[76]=W,e[77]=Z):Z=e[77];let he,pe;e[78]===Symbol.for("react.memo_cache_sentinel")?(he=j=>{j.stopPropagation(),g(!0)},pe=j=>{j.key==="Enter"&&(j.stopPropagation(),g(!0))},e[78]=he,e[79]=pe):(he=e[78],pe=e[79]);let be;e[80]===Symbol.for("react.memo_cache_sentinel")?(be=n.jsx("span",{role:"button",tabIndex:0,className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg opacity-0 transition-opacity hover:bg-destructive/10 group-hover:opacity-100",onClick:he,onKeyDown:pe,title:"Delete brand",children:n.jsx(Ve,{size:13,className:"text-muted-foreground"})}),e[80]=be):be=e[80];let ee;e[81]!==z||e[82]!==E||e[83]!==F||e[84]!==w||e[85]!==M||e[86]!==V||e[87]!==Z?(ee=n.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 p-5",onClick:z,children:[E,F,w,M,V,Z,be]}),e[81]=z,e[82]=E,e[83]=F,e[84]=w,e[85]=M,e[86]=V,e[87]=Z,e[88]=ee):ee=e[88];let te;e[89]!==r||e[90]!==_||e[91]!==m||e[92]!==y?(te=r&&n.jsxs("div",{className:"space-y-3 px-5 pb-5",children:[n.jsx(it,{form:m,onFieldChange:y,onFieldCommit:_}),n.jsx(dt,{form:m,onFieldChange:y,onFieldCommit:_}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx(xt,{form:m,onFieldChange:y,onFieldCommit:_}),n.jsx(ft,{form:m,onFieldChange:y,onFieldCommit:_})]})]}),e[89]=r,e[90]=_,e[91]=m,e[92]=y,e[93]=te):te=e[93];let se;e[94]!==N?(se=j=>{!j&&!N&&g(!1)},e[94]=N,e[95]=se):se=e[95];let je;e[96]===Symbol.for("react.memo_cache_sentinel")?(je=n.jsx(Qe,{children:"Delete brand?"}),e[96]=je):je=e[96];const Ee=s.name||"this brand";let ne;e[97]!==Ee?(ne=n.jsxs("p",{children:["This will permanently delete"," ",n.jsx("span",{className:"font-medium text-foreground",children:Ee}),". This action cannot be undone."]}),e[97]=Ee,e[98]=ne):ne=e[98];let le;e[99]!==s.isDefault?(le=s.isDefault&&n.jsxs("p",{className:"mt-2 rounded-lg border border-destructive/30 bg-destructive/5 p-2 text-destructive",children:[n.jsx("span",{className:"font-medium",children:"Heads up:"})," this is your organization's default brand. Deleting it will leave your organization without a default brand until you set another."]}),e[99]=s.isDefault,e[100]=le):le=e[100];let oe;e[101]!==ne||e[102]!==le?(oe=n.jsxs(Ge,{children:[je,n.jsx(Ye,{asChild:!0,children:n.jsxs("div",{children:[ne,le]})})]}),e[101]=ne,e[102]=le,e[103]=oe):oe=e[103];let re;e[104]!==N?(re=n.jsx(Je,{disabled:N,children:"Cancel"}),e[104]=N,e[105]=re):re=e[105];let ae;e[106]!==U?(ae=j=>{j.preventDefault(),U()},e[106]=U,e[107]=ae):ae=e[107];const Fe=N?"Deleting...":"Delete";let ie;e[108]!==N||e[109]!==ae||e[110]!==Fe?(ie=n.jsx(We,{onClick:ae,disabled:N,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Fe}),e[108]=N,e[109]=ae,e[110]=Fe,e[111]=ie):ie=e[111];let ce;e[112]!==re||e[113]!==ie?(ce=n.jsxs(Ze,{children:[re,ie]}),e[112]=re,e[113]=ie,e[114]=ce):ce=e[114];let de;e[115]!==oe||e[116]!==ce?(de=n.jsxs(et,{children:[oe,ce]}),e[115]=oe,e[116]=ce,e[117]=de):de=e[117];let me;e[118]!==f||e[119]!==se||e[120]!==de?(me=n.jsx(tt,{open:f,onOpenChange:se,children:de}),e[118]=f,e[119]=se,e[120]=de,e[121]=me):me=e[121];let ye;return e[122]!==O||e[123]!==ee||e[124]!==te||e[125]!==me?(ye=n.jsxs("div",{className:O,children:[ee,te,me]}),e[122]=O,e[123]=ee,e[124]=te,e[125]=me,e[126]=ye):ye=e[126],ye}function ht(t){return t}function pt(t){const[e,s]=t;return n.jsx("div",{className:"h-5 w-5 rounded-full border border-border/40",style:{backgroundColor:s},title:`${e}: ${s}`},e)}function bt(t){const[,e]=t;return e}function jt(t){return t}function yt(t){t.target.style.display="none"}function vt(){return L.error("Failed to update default brand")}function Ct(){return L.error("Failed to delete brand")}function Nt(){return L.error("Failed to save brand context")}function _t(t){return t?.trim()}function wt(t){return t?.trim()}function Dt(){const t=K.c(53),{brandExtractEnabled:e}=ze(),{org:s}=Ie(),o=$e(),l=Le();let r;t[0]!==s.id?(r=Oe.brandContext(s.id),t[0]=s.id,t[1]=r):r=t[1];let c;t[2]!==o?(c=async()=>{const{items:w}=await o.call("BRAND_CONTEXT_LIST",{includeArchived:!1});return w},t[2]=o,t[3]=c):c=t[3];let f;t[4]!==r||t[5]!==c?(f={queryKey:r,queryFn:c},t[4]=r,t[5]=c,t[6]=f):f=t[6];const{data:g}=Ke(f),p=(g===void 0?[]:g).filter(Et);let d;t[7]!==s.id||t[8]!==l?(d=()=>l.invalidateQueries({queryKey:Oe.brandContext(s.id),refetchType:"all"}),t[7]=s.id,t[8]=l,t[9]=d):d=t[9];const a=d;let i;t[10]!==o?(i=async()=>{await o.call("BRAND_CONTEXT_CREATE",{name:"New Brand",domain:"example.com",overview:""})},t[10]=o,t[11]=i):i=t[11];let u;t[12]!==a?(u=()=>{H("brand_created"),a(),L.success("Brand created")},t[12]=a,t[13]=u):u=t[13];let h;t[14]!==i||t[15]!==u?(h={mutationFn:i,onSuccess:u,onError:Bt},t[14]=i,t[15]=u,t[16]=h):h=t[16];const{mutate:x,isPending:v}=ge(h);let m;t[17]!==o?(m=async w=>{H("brand_extract_started",{domain:w}),await o.call("BRAND_CONTEXT_EXTRACT",{domain:w})},t[17]=o,t[18]=m):m=t[18];let C;t[19]!==a?(C=()=>{H("brand_extract_succeeded"),a(),L.success("Brand extracted successfully")},t[19]=a,t[20]=C):C=t[20];let k;t[21]!==m||t[22]!==C?(k={mutationFn:m,onSuccess:C,onError:kt},t[21]=m,t[22]=C,t[23]=k):k=t[23];const{mutate:D,isPending:y}=ge(k),_=Ne,$=Ne,P=Ne,q="flex flex-col gap-6";let U;t[24]===Symbol.for("react.memo_cache_sentinel")?(U=n.jsxs("div",{children:[n.jsx(Ne.Title,{children:"Brand Context"}),n.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Define your brand profiles. Each brand is available as an MCP prompt for AI clients."})]}),t[24]=U):U=t[24];let N;t[25]!==x?(N=()=>x(),t[25]=x,t[26]=N):N=t[26];let A;t[27]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx(Re,{size:14}),t[27]=A):A=t[27];let B;t[28]!==v||t[29]!==N?(B=n.jsxs("div",{className:"flex items-center justify-between",children:[U,n.jsxs(Te,{variant:"outline",onClick:N,disabled:v,children:[A,"Add Brand"]})]}),t[28]=v,t[29]=N,t[30]=B):B=t[30];let T;t[31]!==e||t[32]!==D||t[33]!==y?(T=e&&n.jsx(at,{onExtract:w=>D(w),isExtracting:y}),t[31]=e,t[32]=D,t[33]=y,t[34]=T):T=t[34];const X=p.length===0&&n.jsxs("div",{className:"rounded-2xl border border-dashed border-border bg-muted/30 p-8 text-center",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:"No brands configured yet."}),n.jsxs(Te,{variant:"outline",size:"sm",className:"mt-3",onClick:()=>x(),disabled:v,children:[n.jsx(Re,{size:14}),"Add your first brand"]})]}),xe="group space-y-3";let O;t[35]!==a?(O=w=>n.jsx(gt,{brand:w,onChanged:a},w.id),t[35]=a,t[36]=O):O=t[36];const z=p.map(O);let E;t[37]!==z?(E=n.jsx("div",{className:xe,children:z}),t[37]=z,t[38]=E):E=t[38];let F;t[39]!==B||t[40]!==T||t[41]!==X||t[42]!==E?(F=n.jsxs("div",{className:q,children:[B,T,X,E]}),t[39]=B,t[40]=T,t[41]=X,t[42]=E,t[43]=F):F=t[43];let I;t[44]!==P.Body||t[45]!==F?(I=n.jsx(P.Body,{children:F}),t[44]=P.Body,t[45]=F,t[46]=I):I=t[46];let S;t[47]!==$.Content||t[48]!==I?(S=n.jsx($.Content,{children:I}),t[47]=$.Content,t[48]=I,t[49]=S):S=t[49];let R;return t[50]!==_||t[51]!==S?(R=n.jsx(_,{children:S}),t[50]=_,t[51]=S,t[52]=R):R=t[52],R}function kt(t){H("brand_extract_failed",{error:t instanceof Error?t.message:"unknown"}),L.error(t instanceof Error?t.message:"Failed to extract brand")}function Bt(){return L.error("Failed to create brand")}function Et(t){return!t.archivedAt}function Zt(){const t=K.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(rt,{capability:"org:manage",area:"brand context",children:n.jsx(Dt,{})}),t[0]=e):e=t[0],e}export{Zt as default};
1
+ import{c as K,r as Ae,j as n,B as Te,ah as fe,l as _e,am as ze,C as Ie,n as Le,K as Oe,m as Ke,d as ge,p as H,t as L,M as Ue}from"./index-C2u4siS5.js";import{t as Xe}from"./ChevronDown-BpKPHxDG.js";import{i as He}from"./ChevronRight-ByVxw7yb.js";import{s as Re}from"./Plus-BFo0Fsne.js";import{s as qe,t as Me}from"./Star01-DVFgs_0J.js";import{s as Ve}from"./Trash01-zPnxi6aE.js";import{c as Qe,b as Ge,d as Ye,A as Je,g as We,e as Ze,a as et,f as tt}from"./alert-dialog-Y1XXElMo.js";import{P as Ne}from"./index-D3xpdmzO.js";import{u as $e}from"./studio-tools-DScMFawl.js";import{u as st}from"./use-debounced-autosave-sFFdGAPI.js";import{n as nt}from"./LinkExternal01-wLaoE2BO.js";import{i as lt}from"./Zap-B7fiN40E.js";import{I as ue}from"./input-Cb7CGqPN.js";import{T as ot}from"./textarea-CTeZ2lal.js";import{R as rt}from"./require-capability-1lcUjA-x.js";import"./sidebar-odBC32K5.js";import"./LayoutLeft-BZQmnN4U.js";import"./use-mobile-Xv_R9Qvv.js";import"./X-DvSaCzV-.js";import"./tooltip-DK2r83_Q.js";import"./use-capability-ML8qbFhc.js";import"./access-gate-BQ5nV9CM.js";import"./capability-load-error-C6Zz4eJ1.js";function we(t){const e=K.c(8),{title:s,children:o,className:l}=t;let r;e[0]!==l?(r=_e("rounded-2xl border border-border/60 bg-background p-5",l),e[0]=l,e[1]=r):r=e[1];let c;e[2]!==s?(c=n.jsx("div",{className:"mb-4",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s})}),e[2]=s,e[3]=c):c=e[3];let f;return e[4]!==o||e[5]!==r||e[6]!==c?(f=n.jsxs("div",{className:r,children:[c,o]}),e[4]=o,e[5]=r,e[6]=c,e[7]=f):f=e[7],f}function at(t){const e=K.c(25),{onExtract:s,isExtracting:o}=t,[l,r]=Ae.useState("");let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-primary/10",children:n.jsx(lt,{size:18,className:"text-primary"})}),e[0]=c):c=e[0];let f,g;e[1]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx("p",{className:"text-sm font-medium text-foreground",children:"Auto-extract brand context"}),g=n.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Enter your website URL and we'll automatically extract your brand colors, fonts, logos, and company overview."}),e[1]=f,e[2]=g):(f=e[1],g=e[2]);let b;e[3]===Symbol.for("react.memo_cache_sentinel")?(b=m=>r(m.target.value),e[3]=b):b=e[3];let p;e[4]!==l||e[5]!==o||e[6]!==s?(p=m=>{m.key==="Enter"&&l.trim()&&!o&&s(l.trim())},e[4]=l,e[5]=o,e[6]=s,e[7]=p):p=e[7];let d;e[8]!==l||e[9]!==p?(d=n.jsx(ue,{placeholder:"acme.com",value:l,onChange:b,className:"max-w-xs",onKeyDown:p}),e[8]=l,e[9]=p,e[10]=d):d=e[10];let a;e[11]!==l||e[12]!==o?(a=!l.trim()||o,e[11]=l,e[12]=o,e[13]=a):a=e[13];let i;e[14]!==l||e[15]!==s?(i=()=>s(l.trim()),e[14]=l,e[15]=s,e[16]=i):i=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(qe,{size:14}),e[17]=u):u=e[17];const h=o?"Extracting...":"Extract";let x;e[18]!==h||e[19]!==a||e[20]!==i?(x=n.jsxs(Te,{variant:"outline",disabled:a,onClick:i,children:[u,h]}),e[18]=h,e[19]=a,e[20]=i,e[21]=x):x=e[21];let v;return e[22]!==x||e[23]!==d?(v=n.jsx("div",{className:"rounded-2xl border border-dashed border-border bg-muted/30 p-5",children:n.jsxs("div",{className:"flex items-start gap-4",children:[c,n.jsxs("div",{className:"flex-1",children:[f,g,n.jsxs("div",{className:"mt-3 flex gap-2",children:[d,x]})]})]})}),e[22]=x,e[23]=d,e[24]=v):v=e[24],v}function it(t){const e=K.c(36),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s?(r=s.watch("domain"),e[0]=s,e[1]=r):r=e[1];const c=r;let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:"Company name"}),e[2]=f):f=e[2];let g;e[3]!==o||e[4]!==l?(g=D=>{const{field:y}=D;return n.jsx(ue,{...y,onChange:_=>{y.onChange(_),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"Acme Corp"})},e[3]=o,e[4]=l,e[5]=g):g=e[5];let b;e[6]!==s.control||e[7]!==g?(b=n.jsxs("div",{children:[f,n.jsx(fe,{control:s.control,name:"name",render:g})]}),e[6]=s.control,e[7]=g,e[8]=b):b=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx("span",{children:"Domain"}),e[9]=p):p=e[9];let d;e[10]!==c?(d=c&&n.jsxs("a",{href:`https://${c}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 transition-colors hover:text-foreground",children:[n.jsx(nt,{size:10}),"open"]}),e[10]=c,e[11]=d):d=e[11];let a;e[12]!==d?(a=n.jsxs("label",{className:"mb-1 flex items-center justify-between text-xs text-muted-foreground",children:[p,d]}),e[12]=d,e[13]=a):a=e[13];let i;e[14]!==o||e[15]!==l?(i=D=>{const{field:y}=D;return n.jsx(ue,{...y,onChange:_=>{y.onChange(_),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"acme.com"})},e[14]=o,e[15]=l,e[16]=i):i=e[16];let u;e[17]!==s.control||e[18]!==i?(u=n.jsx(fe,{control:s.control,name:"domain",render:i}),e[17]=s.control,e[18]=i,e[19]=u):u=e[19];let h;e[20]!==a||e[21]!==u?(h=n.jsxs("div",{children:[a,u]}),e[20]=a,e[21]=u,e[22]=h):h=e[22];let x;e[23]!==h||e[24]!==b?(x=n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[b,h]}),e[23]=h,e[24]=b,e[25]=x):x=e[25];let v;e[26]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:"Overview"}),e[26]=v):v=e[26];let m;e[27]!==o||e[28]!==l?(m=D=>{const{field:y}=D;return n.jsx(ot,{...y,onChange:_=>{y.onChange(_),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"Brief description of what the company does...",rows:3})},e[27]=o,e[28]=l,e[29]=m):m=e[29];let C;e[30]!==s.control||e[31]!==m?(C=n.jsxs("div",{children:[v,n.jsx(fe,{control:s.control,name:"overview",render:m})]}),e[30]=s.control,e[31]=m,e[32]=C):C=e[32];let k;return e[33]!==x||e[34]!==C?(k=n.jsx(we,{title:"Company Overview",children:n.jsxs("div",{className:"space-y-3",children:[x,C]})}),e[33]=x,e[34]=C,e[35]=k):k=e[35],k}const ct={backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"8px 8px",backgroundPosition:"0 0, 4px 4px",backgroundColor:"#fff"};function Se(t){const e=K.c(22),{form:s,name:o,label:l,imgClassName:r,onFieldChange:c,onFieldCommit:f}=t,g=r===void 0?"h-full w-full object-contain p-3":r;let b;e[0]!==s||e[1]!==o?(b=s.watch(o),e[0]=s,e[1]=o,e[2]=b):b=e[2];const p=b;let d;e[3]!==g||e[4]!==l||e[5]!==p?(d=n.jsx("div",{className:"flex aspect-video w-28 shrink-0 items-center justify-center overflow-hidden rounded-xl",style:ct,children:p?n.jsx("img",{src:p,alt:l,className:g,loading:"lazy"}):n.jsxs("span",{className:"text-[10px] text-muted-foreground/70",children:["No ",l.toLowerCase()]})}),e[3]=g,e[4]=l,e[5]=p,e[6]=d):d=e[6];let a;e[7]!==l?(a=n.jsxs("label",{className:"mb-1 block text-xs text-muted-foreground",children:[l," URL"]}),e[7]=l,e[8]=a):a=e[8];let i;e[9]!==c||e[10]!==f?(i=v=>{const{field:m}=v;return n.jsx(ue,{...m,onChange:C=>{m.onChange(C),c()},onBlur:()=>{m.onBlur(),f()},placeholder:"https://..."})},e[9]=c,e[10]=f,e[11]=i):i=e[11];let u;e[12]!==s.control||e[13]!==o||e[14]!==i?(u=n.jsx(fe,{control:s.control,name:o,render:i}),e[12]=s.control,e[13]=o,e[14]=i,e[15]=u):u=e[15];let h;e[16]!==a||e[17]!==u?(h=n.jsxs("div",{className:"flex-1",children:[a,u]}),e[16]=a,e[17]=u,e[18]=h):h=e[18];let x;return e[19]!==d||e[20]!==h?(x=n.jsxs("div",{className:"flex items-start gap-3",children:[d,h]}),e[19]=d,e[20]=h,e[21]=x):x=e[21],x}function dt(t){const e=K.c(4),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;return e[0]!==s||e[1]!==o||e[2]!==l?(r=n.jsx(we,{title:"Logos & Images",children:n.jsxs("div",{className:"space-y-3",children:[n.jsx(Se,{form:s,name:"logo",label:"Logo",onFieldChange:o,onFieldCommit:l}),n.jsx(Se,{form:s,name:"favicon",label:"Favicon",imgClassName:"h-12 w-12 object-contain",onFieldChange:o,onFieldCommit:l}),n.jsx(Se,{form:s,name:"ogImage",label:"SEO / OG image",imgClassName:"h-full w-full object-contain",onFieldChange:o,onFieldCommit:l})]})}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3],r}const mt=[{key:"heading",label:"Headings"},{key:"body",label:"Body"},{key:"code",label:"Code"}];function ft(t){const e=K.c(6),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s||e[1]!==o||e[2]!==l?(r=mt.map(f=>{const{key:g,label:b}=f,p=`fonts.${g}`,d=s.watch(p);return n.jsxs("div",{children:[n.jsxs("label",{className:"mb-1 flex items-center gap-3 text-xs text-muted-foreground",children:[n.jsx("span",{className:"w-7 text-base font-medium leading-none text-foreground",children:"Aa"}),n.jsx("span",{children:b}),d&&n.jsx("span",{className:"ml-auto truncate text-foreground",style:{fontFamily:d},children:d})]}),n.jsx(fe,{control:s.control,name:p,render:a=>{const{field:i}=a;return n.jsx(ue,{...i,value:i.value??"",onChange:u=>{i.onChange(u),o()},onBlur:()=>{i.onBlur(),l()},placeholder:`Font family for ${b.toLowerCase()}`})}})]},g)}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3];let c;return e[4]!==r?(c=n.jsx(we,{title:"Fonts",children:n.jsx("div",{className:"space-y-2",children:r})}),e[4]=r,e[5]=c):c=e[5],c}const ut=[{key:"primary",label:"Primary"},{key:"secondary",label:"Secondary"},{key:"accent",label:"Accent"},{key:"background",label:"Background"},{key:"foreground",label:"Foreground"}];function xt(t){const e=K.c(6),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s||e[1]!==o||e[2]!==l?(r=ut.map(f=>{const{key:g,label:b}=f,p=`colors.${g}`;return n.jsx(fe,{control:s.control,name:p,render:d=>{const{field:a}=d;return n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"color",value:a.value??"#000000",onChange:i=>{a.onChange(i.target.value),o()},onBlur:()=>{a.onBlur(),l()},className:"h-9 w-9 shrink-0 cursor-pointer rounded-lg border border-border bg-transparent p-0.5"}),n.jsx(ue,{value:a.value??"",onChange:i=>{a.onChange(i.target.value),o()},onBlur:()=>{a.onBlur(),l()},placeholder:"#000000",className:"w-28"}),n.jsx("span",{className:"flex-1 text-xs text-muted-foreground",children:b})]})}},g)}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3];let c;return e[4]!==r?(c=n.jsx(we,{title:"Colors",children:n.jsx("div",{className:"space-y-2",children:r})}),e[4]=r,e[5]=c):c=e[5],c}function gt(t){const e=K.c(127),{brand:s,onChanged:o}=t,l=$e(),[r,c]=Ae.useState(s.isDefault??!1),[f,g]=Ae.useState(!1),b=s.name??"",p=s.domain??"",d=s.overview??"",a=s.logo??"",i=s.favicon??"",u=s.ogImage??"";let h;e[0]!==s.fonts?(h=s.fonts??{},e[0]=s.fonts,e[1]=h):h=e[1];let x;e[2]!==s.colors?(x=s.colors??{},e[2]=s.colors,e[3]=x):x=e[3];let v;e[4]!==b||e[5]!==p||e[6]!==d||e[7]!==a||e[8]!==i||e[9]!==u||e[10]!==h||e[11]!==x?(v={values:{name:b,domain:p,overview:d,logo:a,favicon:i,ogImage:u,fonts:h,colors:x}},e[4]=b,e[5]=p,e[6]=d,e[7]=a,e[8]=i,e[9]=u,e[10]=h,e[11]=x,e[12]=v):v=e[12];const m=Ue(v);let C;e[13]!==s.id||e[14]!==l?(C={mutationFn:async j=>{const ve=Object.values(j.fonts).some(wt),Ce=Object.values(j.colors).some(_t);await l.call("BRAND_CONTEXT_UPDATE",{id:s.id,name:j.name,domain:j.domain,overview:j.overview,logo:j.logo||null,favicon:j.favicon||null,ogImage:j.ogImage||null,fonts:ve?j.fonts:null,colors:Ce?j.colors:null})},onError:Nt},e[13]=s.id,e[14]=l,e[15]=C):C=e[15];const k=ge(C);let D;e[16]!==s.id||e[17]!==m||e[18]!==o||e[19]!==k?(D={delayMs:500,save:async()=>{const j=m.control._formState.dirtyFields,ve=Object.keys(j);if(ve.length===0)return;const Ce=m.getValues(),Pe=m.control._defaultValues;m.reset(Ce,{keepValues:!0});try{await k.mutateAsync(Ce),H("brand_updated",{brand_id:s.id,fields:ve}),L.success("Brand context updated successfully"),o()}catch{m.reset(Pe,{keepValues:!0})}}},e[16]=s.id,e[17]=m,e[18]=o,e[19]=k,e[20]=D):D=e[20];const{schedule:y,flush:_}=st(D);let $;e[21]!==s.id||e[22]!==l?($=async()=>{await l.call("BRAND_CONTEXT_DELETE",{id:s.id})},e[21]=s.id,e[22]=l,e[23]=$):$=e[23];let P;e[24]!==s.id||e[25]!==o?(P=()=>{H("brand_deleted",{brand_id:s.id}),g(!1),o(),L.success("Brand deleted")},e[24]=s.id,e[25]=o,e[26]=P):P=e[26];let q;e[27]!==$||e[28]!==P?(q={mutationFn:$,onSuccess:P,onError:Ct},e[27]=$,e[28]=P,e[29]=q):q=e[29];const{mutate:U,isPending:N}=ge(q);let A;e[30]!==s.id||e[31]!==s.isDefault||e[32]!==l?(A=async()=>{await l.call("BRAND_CONTEXT_UPDATE",{id:s.id,isDefault:!s.isDefault})},e[30]=s.id,e[31]=s.isDefault,e[32]=l,e[33]=A):A=e[33];let B;e[34]!==s.id||e[35]!==s.isDefault||e[36]!==o?(B=()=>{H(s.isDefault?"brand_unset_as_default":"brand_set_as_default",{brand_id:s.id}),o(),L.success(s.isDefault?"Removed as default brand":"Set as default brand")},e[34]=s.id,e[35]=s.isDefault,e[36]=o,e[37]=B):B=e[37];let T;e[38]!==A||e[39]!==B?(T={mutationFn:A,onSuccess:B,onError:vt},e[38]=A,e[39]=B,e[40]=T):T=e[40];const{mutate:X}=ge(T),xe=s.isDefault?"border-primary/30":"border-border/60";let O;e[41]!==xe?(O=_e("rounded-2xl border bg-background",xe),e[41]=xe,e[42]=O):O=e[42];let z;e[43]!==r?(z=()=>c(!r),e[43]=r,e[44]=z):z=e[44];let E;e[45]!==r?(E=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:r?n.jsx(Xe,{size:14}):n.jsx(He,{size:14})}),e[45]=r,e[46]=E):E=e[46];let F;e[47]!==s.logo||e[48]!==s.name?(F=s.logo?n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-lg",style:{backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"6px 6px",backgroundPosition:"0 0, 3px 3px",backgroundColor:"#fff"},children:n.jsx("img",{src:s.logo,alt:"",className:"h-full w-full object-contain p-1",onError:yt})}):n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-muted",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s.name?.charAt(0)?.toUpperCase()||"?"})}),e[47]=s.logo,e[48]=s.name,e[49]=F):F=e[49];const I=s.name||"Untitled Brand";let S;e[50]!==I?(S=n.jsx("span",{className:"text-sm font-medium text-foreground",children:I}),e[50]=I,e[51]=S):S=e[51];let R;e[52]!==s.domain?(R=s.domain&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:s.domain}),e[52]=s.domain,e[53]=R):R=e[53];let w;e[54]!==S||e[55]!==R?(w=n.jsxs("div",{className:"flex flex-1 flex-col items-start gap-0.5 overflow-hidden text-left",children:[S,R]}),e[54]=S,e[55]=R,e[56]=w):w=e[56];let M;e[57]!==s.colors||e[58]!==r?(M=!r&&s.colors&&Object.values(s.colors).some(jt)&&n.jsx("div",{className:"flex shrink-0 gap-1",children:Object.entries(s.colors).filter(bt).map(pt)}),e[57]=s.colors,e[58]=r,e[59]=M):M=e[59];let V;e[60]!==s.fonts||e[61]!==r?(V=!r&&s.fonts&&Object.values(s.fonts).some(ht)&&n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Object.values(s.fonts).filter(Boolean).join(", ")}),e[60]=s.fonts,e[61]=r,e[62]=V):V=e[62];const De=s.isDefault?"opacity-100":"opacity-0 hover:bg-muted group-hover:opacity-100";let Q;e[63]!==De?(Q=_e("flex h-7 w-7 shrink-0 items-center justify-center rounded-lg transition-opacity",De),e[63]=De,e[64]=Q):Q=e[64];let G,Y;e[65]!==X?(G=j=>{j.stopPropagation(),X()},Y=j=>{j.key==="Enter"&&(j.stopPropagation(),X())},e[65]=X,e[66]=G,e[67]=Y):(G=e[66],Y=e[67]);const ke=s.isDefault?"Unset as default":"Set as default",Be=s.isDefault?"text-primary fill-primary":"text-muted-foreground";let J;e[68]!==Be?(J=_e(Be),e[68]=Be,e[69]=J):J=e[69];let W;e[70]!==J?(W=n.jsx(Me,{size:13,className:J}),e[70]=J,e[71]=W):W=e[71];let Z;e[72]!==Q||e[73]!==G||e[74]!==Y||e[75]!==ke||e[76]!==W?(Z=n.jsx("span",{role:"button",tabIndex:0,className:Q,onClick:G,onKeyDown:Y,title:ke,children:W}),e[72]=Q,e[73]=G,e[74]=Y,e[75]=ke,e[76]=W,e[77]=Z):Z=e[77];let he,pe;e[78]===Symbol.for("react.memo_cache_sentinel")?(he=j=>{j.stopPropagation(),g(!0)},pe=j=>{j.key==="Enter"&&(j.stopPropagation(),g(!0))},e[78]=he,e[79]=pe):(he=e[78],pe=e[79]);let be;e[80]===Symbol.for("react.memo_cache_sentinel")?(be=n.jsx("span",{role:"button",tabIndex:0,className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg opacity-0 transition-opacity hover:bg-destructive/10 group-hover:opacity-100",onClick:he,onKeyDown:pe,title:"Delete brand",children:n.jsx(Ve,{size:13,className:"text-muted-foreground"})}),e[80]=be):be=e[80];let ee;e[81]!==z||e[82]!==E||e[83]!==F||e[84]!==w||e[85]!==M||e[86]!==V||e[87]!==Z?(ee=n.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 p-5",onClick:z,children:[E,F,w,M,V,Z,be]}),e[81]=z,e[82]=E,e[83]=F,e[84]=w,e[85]=M,e[86]=V,e[87]=Z,e[88]=ee):ee=e[88];let te;e[89]!==r||e[90]!==_||e[91]!==m||e[92]!==y?(te=r&&n.jsxs("div",{className:"space-y-3 px-5 pb-5",children:[n.jsx(it,{form:m,onFieldChange:y,onFieldCommit:_}),n.jsx(dt,{form:m,onFieldChange:y,onFieldCommit:_}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx(xt,{form:m,onFieldChange:y,onFieldCommit:_}),n.jsx(ft,{form:m,onFieldChange:y,onFieldCommit:_})]})]}),e[89]=r,e[90]=_,e[91]=m,e[92]=y,e[93]=te):te=e[93];let se;e[94]!==N?(se=j=>{!j&&!N&&g(!1)},e[94]=N,e[95]=se):se=e[95];let je;e[96]===Symbol.for("react.memo_cache_sentinel")?(je=n.jsx(Qe,{children:"Delete brand?"}),e[96]=je):je=e[96];const Ee=s.name||"this brand";let ne;e[97]!==Ee?(ne=n.jsxs("p",{children:["This will permanently delete"," ",n.jsx("span",{className:"font-medium text-foreground",children:Ee}),". This action cannot be undone."]}),e[97]=Ee,e[98]=ne):ne=e[98];let le;e[99]!==s.isDefault?(le=s.isDefault&&n.jsxs("p",{className:"mt-2 rounded-lg border border-destructive/30 bg-destructive/5 p-2 text-destructive",children:[n.jsx("span",{className:"font-medium",children:"Heads up:"})," this is your organization's default brand. Deleting it will leave your organization without a default brand until you set another."]}),e[99]=s.isDefault,e[100]=le):le=e[100];let oe;e[101]!==ne||e[102]!==le?(oe=n.jsxs(Ge,{children:[je,n.jsx(Ye,{asChild:!0,children:n.jsxs("div",{children:[ne,le]})})]}),e[101]=ne,e[102]=le,e[103]=oe):oe=e[103];let re;e[104]!==N?(re=n.jsx(Je,{disabled:N,children:"Cancel"}),e[104]=N,e[105]=re):re=e[105];let ae;e[106]!==U?(ae=j=>{j.preventDefault(),U()},e[106]=U,e[107]=ae):ae=e[107];const Fe=N?"Deleting...":"Delete";let ie;e[108]!==N||e[109]!==ae||e[110]!==Fe?(ie=n.jsx(We,{onClick:ae,disabled:N,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Fe}),e[108]=N,e[109]=ae,e[110]=Fe,e[111]=ie):ie=e[111];let ce;e[112]!==re||e[113]!==ie?(ce=n.jsxs(Ze,{children:[re,ie]}),e[112]=re,e[113]=ie,e[114]=ce):ce=e[114];let de;e[115]!==oe||e[116]!==ce?(de=n.jsxs(et,{children:[oe,ce]}),e[115]=oe,e[116]=ce,e[117]=de):de=e[117];let me;e[118]!==f||e[119]!==se||e[120]!==de?(me=n.jsx(tt,{open:f,onOpenChange:se,children:de}),e[118]=f,e[119]=se,e[120]=de,e[121]=me):me=e[121];let ye;return e[122]!==O||e[123]!==ee||e[124]!==te||e[125]!==me?(ye=n.jsxs("div",{className:O,children:[ee,te,me]}),e[122]=O,e[123]=ee,e[124]=te,e[125]=me,e[126]=ye):ye=e[126],ye}function ht(t){return t}function pt(t){const[e,s]=t;return n.jsx("div",{className:"h-5 w-5 rounded-full border border-border/40",style:{backgroundColor:s},title:`${e}: ${s}`},e)}function bt(t){const[,e]=t;return e}function jt(t){return t}function yt(t){t.target.style.display="none"}function vt(){return L.error("Failed to update default brand")}function Ct(){return L.error("Failed to delete brand")}function Nt(){return L.error("Failed to save brand context")}function _t(t){return t?.trim()}function wt(t){return t?.trim()}function Dt(){const t=K.c(53),{brandExtractEnabled:e}=ze(),{org:s}=Ie(),o=$e(),l=Le();let r;t[0]!==s.id?(r=Oe.brandContext(s.id),t[0]=s.id,t[1]=r):r=t[1];let c;t[2]!==o?(c=async()=>{const{items:w}=await o.call("BRAND_CONTEXT_LIST",{includeArchived:!1});return w},t[2]=o,t[3]=c):c=t[3];let f;t[4]!==r||t[5]!==c?(f={queryKey:r,queryFn:c},t[4]=r,t[5]=c,t[6]=f):f=t[6];const{data:g}=Ke(f),p=(g===void 0?[]:g).filter(Et);let d;t[7]!==s.id||t[8]!==l?(d=()=>l.invalidateQueries({queryKey:Oe.brandContext(s.id),refetchType:"all"}),t[7]=s.id,t[8]=l,t[9]=d):d=t[9];const a=d;let i;t[10]!==o?(i=async()=>{await o.call("BRAND_CONTEXT_CREATE",{name:"New Brand",domain:"example.com",overview:""})},t[10]=o,t[11]=i):i=t[11];let u;t[12]!==a?(u=()=>{H("brand_created"),a(),L.success("Brand created")},t[12]=a,t[13]=u):u=t[13];let h;t[14]!==i||t[15]!==u?(h={mutationFn:i,onSuccess:u,onError:Bt},t[14]=i,t[15]=u,t[16]=h):h=t[16];const{mutate:x,isPending:v}=ge(h);let m;t[17]!==o?(m=async w=>{H("brand_extract_started",{domain:w}),await o.call("BRAND_CONTEXT_EXTRACT",{domain:w})},t[17]=o,t[18]=m):m=t[18];let C;t[19]!==a?(C=()=>{H("brand_extract_succeeded"),a(),L.success("Brand extracted successfully")},t[19]=a,t[20]=C):C=t[20];let k;t[21]!==m||t[22]!==C?(k={mutationFn:m,onSuccess:C,onError:kt},t[21]=m,t[22]=C,t[23]=k):k=t[23];const{mutate:D,isPending:y}=ge(k),_=Ne,$=Ne,P=Ne,q="flex flex-col gap-6";let U;t[24]===Symbol.for("react.memo_cache_sentinel")?(U=n.jsxs("div",{children:[n.jsx(Ne.Title,{children:"Brand Context"}),n.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Define your brand profiles. Each brand is available as an MCP prompt for AI clients."})]}),t[24]=U):U=t[24];let N;t[25]!==x?(N=()=>x(),t[25]=x,t[26]=N):N=t[26];let A;t[27]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx(Re,{size:14}),t[27]=A):A=t[27];let B;t[28]!==v||t[29]!==N?(B=n.jsxs("div",{className:"flex items-center justify-between",children:[U,n.jsxs(Te,{variant:"outline",onClick:N,disabled:v,children:[A,"Add Brand"]})]}),t[28]=v,t[29]=N,t[30]=B):B=t[30];let T;t[31]!==e||t[32]!==D||t[33]!==y?(T=e&&n.jsx(at,{onExtract:w=>D(w),isExtracting:y}),t[31]=e,t[32]=D,t[33]=y,t[34]=T):T=t[34];const X=p.length===0&&n.jsxs("div",{className:"rounded-2xl border border-dashed border-border bg-muted/30 p-8 text-center",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:"No brands configured yet."}),n.jsxs(Te,{variant:"outline",size:"sm",className:"mt-3",onClick:()=>x(),disabled:v,children:[n.jsx(Re,{size:14}),"Add your first brand"]})]}),xe="group space-y-3";let O;t[35]!==a?(O=w=>n.jsx(gt,{brand:w,onChanged:a},w.id),t[35]=a,t[36]=O):O=t[36];const z=p.map(O);let E;t[37]!==z?(E=n.jsx("div",{className:xe,children:z}),t[37]=z,t[38]=E):E=t[38];let F;t[39]!==B||t[40]!==T||t[41]!==X||t[42]!==E?(F=n.jsxs("div",{className:q,children:[B,T,X,E]}),t[39]=B,t[40]=T,t[41]=X,t[42]=E,t[43]=F):F=t[43];let I;t[44]!==P.Body||t[45]!==F?(I=n.jsx(P.Body,{children:F}),t[44]=P.Body,t[45]=F,t[46]=I):I=t[46];let S;t[47]!==$.Content||t[48]!==I?(S=n.jsx($.Content,{children:I}),t[47]=$.Content,t[48]=I,t[49]=S):S=t[49];let R;return t[50]!==_||t[51]!==S?(R=n.jsx(_,{children:S}),t[50]=_,t[51]=S,t[52]=R):R=t[52],R}function kt(t){H("brand_extract_failed",{error:t instanceof Error?t.message:"unknown"}),L.error(t instanceof Error?t.message:"Failed to extract brand")}function Bt(){return L.error("Failed to create brand")}function Et(t){return!t.archivedAt}function Zt(){const t=K.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(rt,{capability:"org:manage",area:"brand context",children:n.jsx(Dt,{})}),t[0]=e):e=t[0],e}export{Zt as default};
@@ -1 +1 @@
1
- import{c as D,j as t,E as V,r as v,B as F,t as _}from"./index-32Z_4GES.js";import{i as J}from"./AlertCircle-DriHvGW8.js";import{i as O}from"./HardDrive-Dv77s3h5.js";import{s as L}from"./Plus-DErQhYMo.js";import{s as Q}from"./Trash01-D68y5OFq.js";import{A as X,g as Y,c as Z,b as ee,d as te,e as se,a as ie,f as re}from"./alert-dialog-C0dmYQwl.js";import{e as ne,d as le,D as ae,a as oe,h as ce,c as de}from"./dialog-pxztKdM4.js";import{I as N}from"./input-DNRaDhXk.js";import{L as C}from"./label-DqJN0Zl6.js";import{S as me,a as ue,b as fe,c as pe,d as q}from"./select-B_NF3ir8.js";import{S as xe}from"./switch-Vi8KqJDK.js";import{S as he}from"./skeleton-TPY4BgOd.js";import{T as ge}from"./textarea-BIQq3kPx.js";import{P}from"./index-BFiY8eXY.js";import{c as je}from"./settings-section-qHo4Kia8.js";import{u as ye,b as be,c as ve}from"./use-file-configs-CuD4x2Qa.js";import{R as Se}from"./require-capability-Dl7MMUtS.js";import"./X-DXgmI1I4.js";import"./tooltip-CpOqB12v.js";import"./ChevronUp-SvG4tBeC.js";import"./ChevronDown-DnuZlbXl.js";import"./sidebar-ChQMKige.js";import"./LayoutLeft-CoMgIDfR.js";import"./use-mobile-Dfj2nxpB.js";import"./card-D4CJeQSR.js";import"./ArrowUpRight-CsopTrXA.js";import"./studio-tools-n8590dlO.js";import"./use-capability-x8vfxJ7c.js";import"./access-gate-Du5lQEFN.js";import"./capability-load-error-DifNtXec.js";function Ce(s,e){if(!(s instanceof Error))return e;const i=s.message.match(/\[\s*\{[\s\S]*\}\s*\]/);if(i)try{const r=JSON.parse(i[0])[0];if(r?.message){const l=r.path?.join(".");return l?`${l}: ${r.message}`:r.message}}catch{}return s.message||e}function ke(s){const e=D.c(3),{error:i}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(J,{size:16}),e[0]=n):n=e[0];let r;return e[1]!==i.message?(r=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[n,t.jsxs("span",{className:"text-sm font-medium",children:["Failed to load file configurations: ",i.message]})]}),e[1]=i.message,e[2]=r):r=e[2],r}function Ne(s){const e=D.c(44),{config:i,onDelete:n}=s;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(O,{size:16,className:"text-muted-foreground"})}),e[0]=r):r=e[0];let l;e[1]!==i.name?(l=t.jsx("span",{className:"font-medium text-sm truncate",children:i.name}),e[1]=i.name,e[2]=l):l=e[2];let o;e[3]!==i.credentialType?(o=i.credentialType==="sts-session"?t.jsx("span",{className:"text-[10px] uppercase tracking-wide font-medium px-1.5 py-0.5 rounded bg-muted text-muted-foreground shrink-0",children:"STS"}):i.credentialType==="managed"?t.jsx("span",{className:"text-[10px] uppercase tracking-wide font-medium px-1.5 py-0.5 rounded bg-muted text-muted-foreground shrink-0",children:"Managed"}):null,e[3]=i.credentialType,e[4]=o):o=e[4];let g;e[5]!==i.bucket||e[6]!==i.region?(g=t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:[i.bucket," · ",i.region]}),e[5]=i.bucket,e[6]=i.region,e[7]=g):g=e[7];let c;e[8]!==l||e[9]!==o||e[10]!==g?(c=t.jsxs("div",{className:"flex items-center gap-2",children:[l,o,g]}),e[8]=l,e[9]=o,e[10]=g,e[11]=c):c=e[11];let b;e[12]!==i.description?(b=i.description?t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:i.description}):null,e[12]=i.description,e[13]=b):b=e[13];let j;e[14]!==i.endpoint||e[15]!==i.forcePathStyle?(j=i.endpoint?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:[i.endpoint,i.forcePathStyle?" (path-style)":""]}):null,e[14]=i.endpoint,e[15]=i.forcePathStyle,e[16]=j):j=e[16];let d;e[17]!==i.prefix?(d=i.prefix?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:["prefix: ",i.prefix]}):null,e[17]=i.prefix,e[18]=d):d=e[18];let m;e[19]!==i.publicUrlBase?(m=i.publicUrlBase?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:["public: ",i.publicUrlBase]}):null,e[19]=i.publicUrlBase,e[20]=m):m=e[20];let y;e[21]!==c||e[22]!==b||e[23]!==j||e[24]!==d||e[25]!==m?(y=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[r,t.jsxs("div",{className:"min-w-0",children:[c,b,j,d,m]})]}),e[21]=c,e[22]=b,e[23]=j,e[24]=d,e[25]=m,e[26]=y):y=e[26];let f;e[27]!==i.createdAt?(f=new Date(i.createdAt).toLocaleDateString(),e[27]=i.createdAt,e[28]=f):f=e[28];let u;e[29]!==f?(u=t.jsx("span",{className:"text-xs text-muted-foreground",children:f}),e[29]=f,e[30]=u):u=e[30];let p;e[31]!==i||e[32]!==n?(p=()=>n(i),e[31]=i,e[32]=n,e[33]=p):p=e[33];const x=`Delete ${i.name}`;let h;e[34]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(Q,{size:14}),e[34]=h):h=e[34];let k;e[35]!==p||e[36]!==x?(k=t.jsx(F,{variant:"ghost",size:"sm",onClick:p,"aria-label":x,children:h}),e[35]=p,e[36]=x,e[37]=k):k=e[37];let S;e[38]!==u||e[39]!==k?(S=t.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[u,k]}),e[38]=u,e[39]=k,e[40]=S):S=e[40];let A;return e[41]!==y||e[42]!==S?(A=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[y,S]}),e[41]=y,e[42]=S,e[43]=A):A=e[43],A}function Ae(s){const e=D.c(5),{onCreate:i}=s;let n,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(O,{size:20,className:"text-muted-foreground"})}),r=t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-sm",children:"No buckets configured"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Add an S3-compatible bucket (AWS S3, Cloudflare R2, Google Cloud Storage, MinIO). Access keys are encrypted at rest and never returned over the API."})]}),e[0]=n,e[1]=r):(n=e[0],r=e[1]);let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(L,{size:14}),e[2]=l):l=e[2];let o;return e[3]!==i?(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:[n,r,t.jsxs(F,{onClick:i,size:"sm",className:"mt-2",children:[l,"Add bucket"]})]}),e[3]=i,e[4]=o):o=e[4],o}function K({open:s,onOpenChange:e}){const[i,n]=v.useState(""),[r,l]=v.useState(""),[o,g]=v.useState(""),[c,b]=v.useState(""),[j,d]=v.useState(""),[m,y]=v.useState(!1),[f,u]=v.useState(""),[p,x]=v.useState(""),[h,k]=v.useState("static"),[S,A]=v.useState(""),[R,I]=v.useState(""),[T,U]=v.useState(""),[B,E]=v.useState(""),w=be();function $(){n(""),l(""),g(""),b(""),d(""),y(!1),u(""),x(""),k("static"),A(""),I(""),U(""),E("")}const z=h==="sts-session"?!!(T.trim()&&B.trim()):!!(S&&R);async function M(a){if(a.preventDefault(),!i.trim()||!o.trim()||!c.trim()||!z)return;const W=h==="sts-session"?{credentialType:"sts-session",refreshUrl:T.trim(),apiKey:B.trim()}:{credentialType:"static",accessKeyId:S,secretAccessKey:R};try{await w.mutateAsync({name:i.trim(),description:r.trim()||void 0,bucket:o.trim(),region:c.trim(),endpoint:j.trim()||void 0,forcePathStyle:m,prefix:f.trim()||void 0,publicUrlBase:p.trim()||void 0,...W}),_.success(`Bucket "${i.trim()}" added`),$(),e(!1)}catch(H){_.error(Ce(H,"Failed to add bucket"))}}const G=w.isPending||!i.trim()||!o.trim()||!c.trim()||!z;return t.jsx(ne,{open:s,onOpenChange:e,children:t.jsxs(le,{className:"sm:max-w-lg max-h-[90vh] overflow-y-auto",children:[t.jsxs(ae,{children:[t.jsx(oe,{children:"Add S3 bucket"}),t.jsx(ce,{children:"Credentials are encrypted at rest and never returned over the API. For Cloudflare R2, Google Cloud Storage, or MinIO, set a custom endpoint."})]}),t.jsxs("form",{onSubmit:M,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-name",children:"Name"}),t.jsx(N,{id:"file-config-name",value:i,onChange:a=>n(a.target.value),placeholder:"production-uploads",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Letters, digits, underscore, dot, hyphen. Unique within the organization."})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-bucket",children:"Bucket"}),t.jsx(N,{id:"file-config-bucket",value:o,onChange:a=>g(a.target.value),placeholder:"my-bucket",autoComplete:"off",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-region",children:"Region"}),t.jsx(N,{id:"file-config-region",value:c,onChange:a=>b(a.target.value),placeholder:"us-east-1",autoComplete:"off",required:!0})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-endpoint",children:"Endpoint (optional)"}),t.jsx(N,{id:"file-config-endpoint",type:"url",value:j,onChange:a=>d(a.target.value),placeholder:"https://<account>.r2.cloudflarestorage.com",autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Required for non-AWS providers (R2, GCS, MinIO)."})]}),t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-border/60 p-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx(C,{htmlFor:"file-config-path-style",className:"text-sm",children:"Force path-style URLs"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Required for Google Cloud Storage and most MinIO setups."})]}),t.jsx(xe,{id:"file-config-path-style",checked:m,onCheckedChange:y})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-prefix",children:"Key prefix (optional)"}),t.jsx(N,{id:"file-config-prefix",value:f,onChange:a=>u(a.target.value),placeholder:"tenants/acme/",autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"All object keys are written under this prefix. Useful for multi-tenant buckets or credentials scoped to a sub-path. A trailing slash is added automatically."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-public-url-base",children:"Public URL base (optional)"}),t.jsx(N,{id:"file-config-public-url-base",type:"url",value:p,onChange:a=>x(a.target.value),placeholder:"https://pub-xxxx.r2.dev or https://cdn.example.com",autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Host used to build public URLs returned by the picker (R2 dev domain, CDN, custom host). Leave blank to use the bucket's S3 host (AWS default)."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-credential-type",children:"Credentials"}),t.jsxs(me,{value:h,onValueChange:a=>k(a),children:[t.jsx(ue,{id:"file-config-credential-type",className:"w-full",children:t.jsx(fe,{})}),t.jsxs(pe,{children:[t.jsx(q,{value:"static",children:"Static key pair (long-lived)"}),t.jsx(q,{value:"sts-session",children:"Temporary session (STS, auto-refreshed)"})]})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:h==="sts-session"?"Stores only a refresh endpoint + API key; short-lived credentials are fetched on demand and refreshed automatically.":"A long-lived access key ID and secret, used as-is."})]}),h==="static"?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-access-key",children:"Access key ID"}),t.jsx(N,{id:"file-config-access-key",value:S,onChange:a=>A(a.target.value),autoComplete:"off",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-secret-key",children:"Secret access key"}),t.jsx(N,{id:"file-config-secret-key",type:"password",value:R,onChange:a=>I(a.target.value),autoComplete:"new-password",required:!0})]})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-refresh-url",children:"Refresh URL"}),t.jsx(N,{id:"file-config-refresh-url",type:"url",value:T,onChange:a=>U(a.target.value),placeholder:"https://admin.example.com/api/acme/s3-credentials",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Endpoint POSTed (with the API key below) to vend temporary credentials. Must return accessKeyId, secretAccessKey, sessionToken, and expiration."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-api-key",children:"API key"}),t.jsx(N,{id:"file-config-api-key",type:"password",value:B,onChange:a=>E(a.target.value),autoComplete:"new-password",required:!0}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Sent as the ",t.jsx("code",{children:"x-api-key"})," header on each refresh call."]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-description",children:"Description (optional)"}),t.jsx(ge,{id:"file-config-description",value:r,onChange:a=>l(a.target.value),rows:2,placeholder:"What is this bucket used for?"})]}),t.jsxs(de,{children:[t.jsx(F,{type:"button",variant:"outline",onClick:()=>{$(),e(!1)},disabled:w.isPending,children:"Cancel"}),t.jsx(F,{type:"submit",disabled:G,children:w.isPending?"Adding…":"Add bucket"})]})]})]})})}function De(s){const e=D.c(25),{config:i,onClose:n}=s,r=ve();let l;e[0]!==i||e[1]!==r||e[2]!==n?(l=async function(){if(i)try{await r.mutateAsync(i.id),_.success(`Bucket "${i.name}" removed`),n()}catch(k){const S=k;_.error(S instanceof Error?S.message:"Failed to remove bucket")}},e[0]=i,e[1]=r,e[2]=n,e[3]=l):l=e[3];const o=l,g=i!==null;let c;e[4]!==n?(c=h=>!h&&n(),e[4]=n,e[5]=c):c=e[5];let b;e[6]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(Z,{children:"Remove bucket configuration?"}),e[6]=b):b=e[6];const j=i?.name;let d;e[7]!==j?(d=t.jsxs(ee,{children:[b,t.jsxs(te,{children:["This deletes the encrypted credentials for"," ",t.jsx("span",{className:"font-medium",children:j}),". The bucket itself is not affected. This cannot be undone."]})]}),e[7]=j,e[8]=d):d=e[8];let m;e[9]!==r.isPending?(m=t.jsx(X,{disabled:r.isPending,children:"Cancel"}),e[9]=r.isPending,e[10]=m):m=e[10];const y=r.isPending?"Removing…":"Remove";let f;e[11]!==r.isPending||e[12]!==o||e[13]!==y?(f=t.jsx(Y,{onClick:o,disabled:r.isPending,children:y}),e[11]=r.isPending,e[12]=o,e[13]=y,e[14]=f):f=e[14];let u;e[15]!==m||e[16]!==f?(u=t.jsxs(se,{children:[m,f]}),e[15]=m,e[16]=f,e[17]=u):u=e[17];let p;e[18]!==u||e[19]!==d?(p=t.jsxs(ie,{children:[d,u]}),e[18]=u,e[19]=d,e[20]=p):p=e[20];let x;return e[21]!==p||e[22]!==g||e[23]!==c?(x=t.jsx(re,{open:g,onOpenChange:c,children:p}),e[21]=p,e[22]=g,e[23]=c,e[24]=x):x=e[24],x}function Fe(){const s=D.c(25),e=ye(),[i,n]=v.useState(!1),[r,l]=v.useState(null);if(e.length===0){let x;s[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(Ae,{onCreate:()=>n(!0)}),s[0]=x):x=s[0];let h;return s[1]!==i?(h=t.jsxs(t.Fragment,{children:[x,t.jsx(K,{open:i,onOpenChange:n})]}),s[1]=i,s[2]=h):h=s[2],h}const o=e.length===1?"":"s";let g;s[3]!==e.length||s[4]!==o?(g=t.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length," bucket",o," configured"]}),s[3]=e.length,s[4]=o,s[5]=g):g=s[5];let c;s[6]===Symbol.for("react.memo_cache_sentinel")?(c=()=>n(!0),s[6]=c):c=s[6];let b;s[7]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsxs(F,{onClick:c,size:"sm",children:[t.jsx(L,{size:14}),"Add bucket"]}),s[7]=b):b=s[7];let j;s[8]!==g?(j=t.jsxs("div",{className:"flex items-center justify-between",children:[g,b]}),s[8]=g,s[9]=j):j=s[9];let d;if(s[10]!==e){let x;s[12]===Symbol.for("react.memo_cache_sentinel")?(x=h=>t.jsx(Ne,{config:h,onDelete:l},h.id),s[12]=x):x=s[12],d=e.map(x),s[10]=e,s[11]=d}else d=s[11];let m;s[13]!==d?(m=t.jsx("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:t.jsx("div",{children:d})}),s[13]=d,s[14]=m):m=s[14];let y;s[15]!==i?(y=t.jsx(K,{open:i,onOpenChange:n}),s[15]=i,s[16]=y):y=s[16];let f;s[17]===Symbol.for("react.memo_cache_sentinel")?(f=()=>l(null),s[17]=f):f=s[17];let u;s[18]!==r?(u=t.jsx(De,{config:r,onClose:f}),s[18]=r,s[19]=u):u=s[19];let p;return s[20]!==j||s[21]!==m||s[22]!==y||s[23]!==u?(p=t.jsxs(t.Fragment,{children:[j,m,y,u]}),s[20]=j,s[21]=m,s[22]=y,s[23]=u,s[24]=p):p=s[24],p}function we(){const s=D.c(2);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(P.Title,{children:"Buckets"}),s[0]=e):e=s[0];let i;return s[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(P,{children:t.jsx(P.Content,{children:t.jsx(P.Body,{children:t.jsxs(je,{children:[e,t.jsx(V,{fallback:Pe,children:t.jsx(v.Suspense,{fallback:t.jsx(he,{className:"h-32 w-full"}),children:t.jsx(Fe,{})})})]})})})}),s[1]=i):i=s[1],i}function Pe(s){const{error:e}=s;return t.jsx(ke,{error:e??new Error("Failed to load file configs")})}function at(){const s=D.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Se,{capability:"file-configs:manage",area:"files",children:t.jsx(we,{})}),s[0]=e):e=s[0],e}export{at as default};
1
+ import{c as D,j as t,E as V,r as v,B as F,t as _}from"./index-C2u4siS5.js";import{i as J}from"./AlertCircle-DfZqGdIO.js";import{i as O}from"./HardDrive-Czo8EXKT.js";import{s as L}from"./Plus-BFo0Fsne.js";import{s as Q}from"./Trash01-zPnxi6aE.js";import{A as X,g as Y,c as Z,b as ee,d as te,e as se,a as ie,f as re}from"./alert-dialog-Y1XXElMo.js";import{e as ne,d as le,D as ae,a as oe,h as ce,c as de}from"./dialog-CvsnsHc6.js";import{I as N}from"./input-Cb7CGqPN.js";import{L as C}from"./label-DhK5GRHz.js";import{S as me,a as ue,b as fe,c as pe,d as q}from"./select-DMy4CZEM.js";import{S as xe}from"./switch-Ds8K2Lh_.js";import{S as he}from"./skeleton-BTXeFNOv.js";import{T as ge}from"./textarea-CTeZ2lal.js";import{P}from"./index-D3xpdmzO.js";import{c as je}from"./settings-section-C9wxXn_P.js";import{u as ye,b as be,c as ve}from"./use-file-configs-BCPI-hCq.js";import{R as Se}from"./require-capability-1lcUjA-x.js";import"./X-DvSaCzV-.js";import"./tooltip-DK2r83_Q.js";import"./ChevronUp-DKgNoV7g.js";import"./ChevronDown-BpKPHxDG.js";import"./sidebar-odBC32K5.js";import"./LayoutLeft-BZQmnN4U.js";import"./use-mobile-Xv_R9Qvv.js";import"./card-CMA-4CeN.js";import"./ArrowUpRight-D7jEUphZ.js";import"./studio-tools-DScMFawl.js";import"./use-capability-ML8qbFhc.js";import"./access-gate-BQ5nV9CM.js";import"./capability-load-error-C6Zz4eJ1.js";function Ce(s,e){if(!(s instanceof Error))return e;const i=s.message.match(/\[\s*\{[\s\S]*\}\s*\]/);if(i)try{const r=JSON.parse(i[0])[0];if(r?.message){const l=r.path?.join(".");return l?`${l}: ${r.message}`:r.message}}catch{}return s.message||e}function ke(s){const e=D.c(3),{error:i}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(J,{size:16}),e[0]=n):n=e[0];let r;return e[1]!==i.message?(r=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[n,t.jsxs("span",{className:"text-sm font-medium",children:["Failed to load file configurations: ",i.message]})]}),e[1]=i.message,e[2]=r):r=e[2],r}function Ne(s){const e=D.c(44),{config:i,onDelete:n}=s;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(O,{size:16,className:"text-muted-foreground"})}),e[0]=r):r=e[0];let l;e[1]!==i.name?(l=t.jsx("span",{className:"font-medium text-sm truncate",children:i.name}),e[1]=i.name,e[2]=l):l=e[2];let o;e[3]!==i.credentialType?(o=i.credentialType==="sts-session"?t.jsx("span",{className:"text-[10px] uppercase tracking-wide font-medium px-1.5 py-0.5 rounded bg-muted text-muted-foreground shrink-0",children:"STS"}):i.credentialType==="managed"?t.jsx("span",{className:"text-[10px] uppercase tracking-wide font-medium px-1.5 py-0.5 rounded bg-muted text-muted-foreground shrink-0",children:"Managed"}):null,e[3]=i.credentialType,e[4]=o):o=e[4];let g;e[5]!==i.bucket||e[6]!==i.region?(g=t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:[i.bucket," · ",i.region]}),e[5]=i.bucket,e[6]=i.region,e[7]=g):g=e[7];let c;e[8]!==l||e[9]!==o||e[10]!==g?(c=t.jsxs("div",{className:"flex items-center gap-2",children:[l,o,g]}),e[8]=l,e[9]=o,e[10]=g,e[11]=c):c=e[11];let b;e[12]!==i.description?(b=i.description?t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:i.description}):null,e[12]=i.description,e[13]=b):b=e[13];let j;e[14]!==i.endpoint||e[15]!==i.forcePathStyle?(j=i.endpoint?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:[i.endpoint,i.forcePathStyle?" (path-style)":""]}):null,e[14]=i.endpoint,e[15]=i.forcePathStyle,e[16]=j):j=e[16];let d;e[17]!==i.prefix?(d=i.prefix?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:["prefix: ",i.prefix]}):null,e[17]=i.prefix,e[18]=d):d=e[18];let m;e[19]!==i.publicUrlBase?(m=i.publicUrlBase?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:["public: ",i.publicUrlBase]}):null,e[19]=i.publicUrlBase,e[20]=m):m=e[20];let y;e[21]!==c||e[22]!==b||e[23]!==j||e[24]!==d||e[25]!==m?(y=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[r,t.jsxs("div",{className:"min-w-0",children:[c,b,j,d,m]})]}),e[21]=c,e[22]=b,e[23]=j,e[24]=d,e[25]=m,e[26]=y):y=e[26];let f;e[27]!==i.createdAt?(f=new Date(i.createdAt).toLocaleDateString(),e[27]=i.createdAt,e[28]=f):f=e[28];let u;e[29]!==f?(u=t.jsx("span",{className:"text-xs text-muted-foreground",children:f}),e[29]=f,e[30]=u):u=e[30];let p;e[31]!==i||e[32]!==n?(p=()=>n(i),e[31]=i,e[32]=n,e[33]=p):p=e[33];const x=`Delete ${i.name}`;let h;e[34]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(Q,{size:14}),e[34]=h):h=e[34];let k;e[35]!==p||e[36]!==x?(k=t.jsx(F,{variant:"ghost",size:"sm",onClick:p,"aria-label":x,children:h}),e[35]=p,e[36]=x,e[37]=k):k=e[37];let S;e[38]!==u||e[39]!==k?(S=t.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[u,k]}),e[38]=u,e[39]=k,e[40]=S):S=e[40];let A;return e[41]!==y||e[42]!==S?(A=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[y,S]}),e[41]=y,e[42]=S,e[43]=A):A=e[43],A}function Ae(s){const e=D.c(5),{onCreate:i}=s;let n,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(O,{size:20,className:"text-muted-foreground"})}),r=t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-sm",children:"No buckets configured"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Add an S3-compatible bucket (AWS S3, Cloudflare R2, Google Cloud Storage, MinIO). Access keys are encrypted at rest and never returned over the API."})]}),e[0]=n,e[1]=r):(n=e[0],r=e[1]);let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(L,{size:14}),e[2]=l):l=e[2];let o;return e[3]!==i?(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:[n,r,t.jsxs(F,{onClick:i,size:"sm",className:"mt-2",children:[l,"Add bucket"]})]}),e[3]=i,e[4]=o):o=e[4],o}function K({open:s,onOpenChange:e}){const[i,n]=v.useState(""),[r,l]=v.useState(""),[o,g]=v.useState(""),[c,b]=v.useState(""),[j,d]=v.useState(""),[m,y]=v.useState(!1),[f,u]=v.useState(""),[p,x]=v.useState(""),[h,k]=v.useState("static"),[S,A]=v.useState(""),[R,I]=v.useState(""),[T,U]=v.useState(""),[B,E]=v.useState(""),w=be();function $(){n(""),l(""),g(""),b(""),d(""),y(!1),u(""),x(""),k("static"),A(""),I(""),U(""),E("")}const z=h==="sts-session"?!!(T.trim()&&B.trim()):!!(S&&R);async function M(a){if(a.preventDefault(),!i.trim()||!o.trim()||!c.trim()||!z)return;const W=h==="sts-session"?{credentialType:"sts-session",refreshUrl:T.trim(),apiKey:B.trim()}:{credentialType:"static",accessKeyId:S,secretAccessKey:R};try{await w.mutateAsync({name:i.trim(),description:r.trim()||void 0,bucket:o.trim(),region:c.trim(),endpoint:j.trim()||void 0,forcePathStyle:m,prefix:f.trim()||void 0,publicUrlBase:p.trim()||void 0,...W}),_.success(`Bucket "${i.trim()}" added`),$(),e(!1)}catch(H){_.error(Ce(H,"Failed to add bucket"))}}const G=w.isPending||!i.trim()||!o.trim()||!c.trim()||!z;return t.jsx(ne,{open:s,onOpenChange:e,children:t.jsxs(le,{className:"sm:max-w-lg max-h-[90vh] overflow-y-auto",children:[t.jsxs(ae,{children:[t.jsx(oe,{children:"Add S3 bucket"}),t.jsx(ce,{children:"Credentials are encrypted at rest and never returned over the API. For Cloudflare R2, Google Cloud Storage, or MinIO, set a custom endpoint."})]}),t.jsxs("form",{onSubmit:M,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-name",children:"Name"}),t.jsx(N,{id:"file-config-name",value:i,onChange:a=>n(a.target.value),placeholder:"production-uploads",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Letters, digits, underscore, dot, hyphen. Unique within the organization."})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-bucket",children:"Bucket"}),t.jsx(N,{id:"file-config-bucket",value:o,onChange:a=>g(a.target.value),placeholder:"my-bucket",autoComplete:"off",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-region",children:"Region"}),t.jsx(N,{id:"file-config-region",value:c,onChange:a=>b(a.target.value),placeholder:"us-east-1",autoComplete:"off",required:!0})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-endpoint",children:"Endpoint (optional)"}),t.jsx(N,{id:"file-config-endpoint",type:"url",value:j,onChange:a=>d(a.target.value),placeholder:"https://<account>.r2.cloudflarestorage.com",autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Required for non-AWS providers (R2, GCS, MinIO)."})]}),t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-border/60 p-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx(C,{htmlFor:"file-config-path-style",className:"text-sm",children:"Force path-style URLs"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Required for Google Cloud Storage and most MinIO setups."})]}),t.jsx(xe,{id:"file-config-path-style",checked:m,onCheckedChange:y})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-prefix",children:"Key prefix (optional)"}),t.jsx(N,{id:"file-config-prefix",value:f,onChange:a=>u(a.target.value),placeholder:"tenants/acme/",autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"All object keys are written under this prefix. Useful for multi-tenant buckets or credentials scoped to a sub-path. A trailing slash is added automatically."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-public-url-base",children:"Public URL base (optional)"}),t.jsx(N,{id:"file-config-public-url-base",type:"url",value:p,onChange:a=>x(a.target.value),placeholder:"https://pub-xxxx.r2.dev or https://cdn.example.com",autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Host used to build public URLs returned by the picker (R2 dev domain, CDN, custom host). Leave blank to use the bucket's S3 host (AWS default)."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-credential-type",children:"Credentials"}),t.jsxs(me,{value:h,onValueChange:a=>k(a),children:[t.jsx(ue,{id:"file-config-credential-type",className:"w-full",children:t.jsx(fe,{})}),t.jsxs(pe,{children:[t.jsx(q,{value:"static",children:"Static key pair (long-lived)"}),t.jsx(q,{value:"sts-session",children:"Temporary session (STS, auto-refreshed)"})]})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:h==="sts-session"?"Stores only a refresh endpoint + API key; short-lived credentials are fetched on demand and refreshed automatically.":"A long-lived access key ID and secret, used as-is."})]}),h==="static"?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-access-key",children:"Access key ID"}),t.jsx(N,{id:"file-config-access-key",value:S,onChange:a=>A(a.target.value),autoComplete:"off",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-secret-key",children:"Secret access key"}),t.jsx(N,{id:"file-config-secret-key",type:"password",value:R,onChange:a=>I(a.target.value),autoComplete:"new-password",required:!0})]})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-refresh-url",children:"Refresh URL"}),t.jsx(N,{id:"file-config-refresh-url",type:"url",value:T,onChange:a=>U(a.target.value),placeholder:"https://admin.example.com/api/acme/s3-credentials",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Endpoint POSTed (with the API key below) to vend temporary credentials. Must return accessKeyId, secretAccessKey, sessionToken, and expiration."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-api-key",children:"API key"}),t.jsx(N,{id:"file-config-api-key",type:"password",value:B,onChange:a=>E(a.target.value),autoComplete:"new-password",required:!0}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Sent as the ",t.jsx("code",{children:"x-api-key"})," header on each refresh call."]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-description",children:"Description (optional)"}),t.jsx(ge,{id:"file-config-description",value:r,onChange:a=>l(a.target.value),rows:2,placeholder:"What is this bucket used for?"})]}),t.jsxs(de,{children:[t.jsx(F,{type:"button",variant:"outline",onClick:()=>{$(),e(!1)},disabled:w.isPending,children:"Cancel"}),t.jsx(F,{type:"submit",disabled:G,children:w.isPending?"Adding…":"Add bucket"})]})]})]})})}function De(s){const e=D.c(25),{config:i,onClose:n}=s,r=ve();let l;e[0]!==i||e[1]!==r||e[2]!==n?(l=async function(){if(i)try{await r.mutateAsync(i.id),_.success(`Bucket "${i.name}" removed`),n()}catch(k){const S=k;_.error(S instanceof Error?S.message:"Failed to remove bucket")}},e[0]=i,e[1]=r,e[2]=n,e[3]=l):l=e[3];const o=l,g=i!==null;let c;e[4]!==n?(c=h=>!h&&n(),e[4]=n,e[5]=c):c=e[5];let b;e[6]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(Z,{children:"Remove bucket configuration?"}),e[6]=b):b=e[6];const j=i?.name;let d;e[7]!==j?(d=t.jsxs(ee,{children:[b,t.jsxs(te,{children:["This deletes the encrypted credentials for"," ",t.jsx("span",{className:"font-medium",children:j}),". The bucket itself is not affected. This cannot be undone."]})]}),e[7]=j,e[8]=d):d=e[8];let m;e[9]!==r.isPending?(m=t.jsx(X,{disabled:r.isPending,children:"Cancel"}),e[9]=r.isPending,e[10]=m):m=e[10];const y=r.isPending?"Removing…":"Remove";let f;e[11]!==r.isPending||e[12]!==o||e[13]!==y?(f=t.jsx(Y,{onClick:o,disabled:r.isPending,children:y}),e[11]=r.isPending,e[12]=o,e[13]=y,e[14]=f):f=e[14];let u;e[15]!==m||e[16]!==f?(u=t.jsxs(se,{children:[m,f]}),e[15]=m,e[16]=f,e[17]=u):u=e[17];let p;e[18]!==u||e[19]!==d?(p=t.jsxs(ie,{children:[d,u]}),e[18]=u,e[19]=d,e[20]=p):p=e[20];let x;return e[21]!==p||e[22]!==g||e[23]!==c?(x=t.jsx(re,{open:g,onOpenChange:c,children:p}),e[21]=p,e[22]=g,e[23]=c,e[24]=x):x=e[24],x}function Fe(){const s=D.c(25),e=ye(),[i,n]=v.useState(!1),[r,l]=v.useState(null);if(e.length===0){let x;s[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(Ae,{onCreate:()=>n(!0)}),s[0]=x):x=s[0];let h;return s[1]!==i?(h=t.jsxs(t.Fragment,{children:[x,t.jsx(K,{open:i,onOpenChange:n})]}),s[1]=i,s[2]=h):h=s[2],h}const o=e.length===1?"":"s";let g;s[3]!==e.length||s[4]!==o?(g=t.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length," bucket",o," configured"]}),s[3]=e.length,s[4]=o,s[5]=g):g=s[5];let c;s[6]===Symbol.for("react.memo_cache_sentinel")?(c=()=>n(!0),s[6]=c):c=s[6];let b;s[7]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsxs(F,{onClick:c,size:"sm",children:[t.jsx(L,{size:14}),"Add bucket"]}),s[7]=b):b=s[7];let j;s[8]!==g?(j=t.jsxs("div",{className:"flex items-center justify-between",children:[g,b]}),s[8]=g,s[9]=j):j=s[9];let d;if(s[10]!==e){let x;s[12]===Symbol.for("react.memo_cache_sentinel")?(x=h=>t.jsx(Ne,{config:h,onDelete:l},h.id),s[12]=x):x=s[12],d=e.map(x),s[10]=e,s[11]=d}else d=s[11];let m;s[13]!==d?(m=t.jsx("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:t.jsx("div",{children:d})}),s[13]=d,s[14]=m):m=s[14];let y;s[15]!==i?(y=t.jsx(K,{open:i,onOpenChange:n}),s[15]=i,s[16]=y):y=s[16];let f;s[17]===Symbol.for("react.memo_cache_sentinel")?(f=()=>l(null),s[17]=f):f=s[17];let u;s[18]!==r?(u=t.jsx(De,{config:r,onClose:f}),s[18]=r,s[19]=u):u=s[19];let p;return s[20]!==j||s[21]!==m||s[22]!==y||s[23]!==u?(p=t.jsxs(t.Fragment,{children:[j,m,y,u]}),s[20]=j,s[21]=m,s[22]=y,s[23]=u,s[24]=p):p=s[24],p}function we(){const s=D.c(2);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(P.Title,{children:"Buckets"}),s[0]=e):e=s[0];let i;return s[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(P,{children:t.jsx(P.Content,{children:t.jsx(P.Body,{children:t.jsxs(je,{children:[e,t.jsx(V,{fallback:Pe,children:t.jsx(v.Suspense,{fallback:t.jsx(he,{className:"h-32 w-full"}),children:t.jsx(Fe,{})})})]})})})}),s[1]=i):i=s[1],i}function Pe(s){const{error:e}=s;return t.jsx(ke,{error:e??new Error("Failed to load file configs")})}function at(){const s=D.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Se,{capability:"file-configs:manage",area:"files",children:t.jsx(we,{})}),s[0]=e):e=s[0],e}export{at as default};
@@ -1 +1 @@
1
- import{c as Q,l as Y,j as s,r as W,B as J,i as le}from"./index-32Z_4GES.js";import{c as Z}from"./ZoomOut-DO1ABQMU.js";import{i as ae}from"./X-DXgmI1I4.js";import{L as O}from"./label-DqJN0Zl6.js";import{I as ie,R as oe,a as re}from"./index-3nwYTcZz.js";import{a as ce}from"./DotsVertical-ByzWfjph.js";import{S as ne,a as de,b as me,c as xe,d as pe}from"./select-B_NF3ir8.js";import{T as fe,a as ue,b as he}from"./tooltip-CpOqB12v.js";import"./ChevronUp-SvG4tBeC.js";import"./ChevronDown-DnuZlbXl.js";function ge(a){const e=Q.c(8);let i,t;e[0]!==a?({className:i,...t}=a,e[0]=a,e[1]=i,e[2]=t):(i=e[1],t=e[2]);let o;e[3]!==i?(o=Y("grid gap-3",i),e[3]=i,e[4]=o):o=e[4];let l;return e[5]!==t||e[6]!==o?(l=s.jsx(oe,{"data-slot":"radio-group",className:o,...t}),e[5]=t,e[6]=o,e[7]=l):l=e[7],l}function X(a){const e=Q.c(9);let i,t;e[0]!==a?({className:i,...t}=a,e[0]=a,e[1]=i,e[2]=t):(i=e[1],t=e[2]);let o;e[3]!==i?(o=Y("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[2px] disabled:opacity-50",i),e[3]=i,e[4]=o):o=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(re,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:s.jsx(ce,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})}),e[5]=l):l=e[5];let c;return e[6]!==t||e[7]!==o?(c=s.jsx(ie,{"data-slot":"radio-group-item",className:o,...t,children:l}),e[6]=t,e[7]=o,e[8]=c):c=e[8],c}function ze(a){const e=Q.c(69),{posts:i,categories:t,initialSlug:o,isPending:l,onApply:c,onClose:m}=a,[n,ee]=W.useState(o&&t.some(d=>d.slug===o)?o:t[0]?.slug??""),[x,se]=W.useState("add");let T;if(e[0]!==t||e[1]!==n){let d;e[3]!==n?(d=te=>te.slug===n,e[3]=n,e[4]=d):d=e[4],T=t.find(d),e[0]=t,e[1]=n,e[2]=T}else T=e[2];const p=T,r=i.length,K=r===1?"post":"posts";let f;e[5]!==r||e[6]!==K?(f=s.jsxs("span",{className:"truncate text-sm font-medium",children:[r," ",K," selected"]}),e[5]=r,e[6]=K,e[7]=f):f=e[7];let E;e[8]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(ae,{size:14}),e[8]=E):E=e[8];let u;e[9]!==l||e[10]!==m?(u=s.jsx(fe,{asChild:!0,children:s.jsx(J,{type:"button",variant:"ghost",size:"icon",disabled:l,onClick:m,"aria-label":"Exit selection",children:E})}),e[9]=l,e[10]=m,e[11]=u):u=e[11];let I;e[12]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(ue,{side:"bottom",children:"Exit selection"}),e[12]=I):I=e[12];let h;e[13]!==u?(h=s.jsxs(he,{children:[u,I]}),e[13]=u,e[14]=h):h=e[14];let g;e[15]!==f||e[16]!==h?(g=s.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[f,h]}),e[15]=f,e[16]=h,e[17]=g):g=e[17];let A;e[18]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx("h2",{className:"text-2xl font-bold text-foreground",children:"Update category"}),e[18]=A):A=e[18];const M=r===0?"Select posts from the list to choose what this update applies to.":`Choose a category to apply to ${r} ${r===1?"post":"posts"}.`;let j;e[19]!==M?(j=s.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:M}),e[19]=M,e[20]=j):j=e[20];let B;e[21]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(O,{children:"Category"}),e[21]=B):B=e[21];let b;e[22]!==t||e[23]!==n?(b=s.jsxs("div",{className:"space-y-2",children:[B,t.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No categories yet — create one in the Categories collection."}):s.jsxs(ne,{value:n,onValueChange:ee,children:[s.jsx(de,{className:"w-full",children:s.jsx(me,{placeholder:"Select a category"})}),s.jsx(xe,{children:t.map(be)})]})]}),e[22]=t,e[23]=n,e[24]=b):b=e[24];let F;e[25]===Symbol.for("react.memo_cache_sentinel")?(F=d=>se(d),e[25]=F):F=e[25];let V;e[26]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsx(X,{value:"add",id:"cat-mode-add",className:"mt-0.5"}),e[26]=V):V=e[26];let G;e[27]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsxs(O,{htmlFor:"cat-mode-add",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[V,s.jsxs("span",{className:"space-y-0.5",children:[s.jsx("span",{className:"block text-sm font-medium",children:"Add category"}),s.jsx("span",{className:"block text-xs text-muted-foreground",children:"Keep existing categories and add this one."})]})]}),e[27]=G):G=e[27];let L;e[28]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(X,{value:"replace",id:"cat-mode-replace",className:"mt-0.5"}),e[28]=L):L=e[28];let P;e[29]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsxs(O,{htmlFor:"cat-mode-replace",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[L,s.jsxs("span",{className:"space-y-0.5",children:[s.jsx("span",{className:"block text-sm font-medium",children:"Replace category"}),s.jsx("span",{className:"block text-xs text-muted-foreground",children:"Remove all current categories and set only this one."})]})]}),e[29]=P):P=e[29];let y;e[30]!==x?(y=s.jsxs(ge,{value:x,onValueChange:F,className:"gap-2",children:[G,P]}),e[30]=x,e[31]=y):y=e[31];let N;e[32]!==l||e[33]!==m?(N=s.jsx(J,{type:"button",variant:"outline",onClick:m,disabled:l,children:"Cancel"}),e[32]=l,e[33]=m,e[34]=N):N=e[34];const D=!p||l||r===0;let v;e[35]!==x||e[36]!==c||e[37]!==p?(v=()=>p&&c(x,{name:p.name,slug:p.slug}),e[35]=x,e[36]=c,e[37]=p,e[38]=v):v=e[38];let S;e[39]!==l?(S=l?s.jsxs(s.Fragment,{children:[s.jsx(le,{size:14,className:"animate-spin"}),"Updating…"]}):"Apply",e[39]=l,e[40]=S):S=e[40];let _;e[41]!==D||e[42]!==v||e[43]!==S?(_=s.jsx(J,{type:"button",disabled:D,onClick:v,children:S}),e[41]=D,e[42]=v,e[43]=S,e[44]=_):_=e[44];let k;e[45]!==N||e[46]!==_?(k=s.jsxs("div",{className:"flex justify-end gap-2",children:[N,_]}),e[45]=N,e[46]=_,e[47]=k):k=e[47];let C;e[48]!==b||e[49]!==y||e[50]!==k?(C=s.jsxs("div",{className:"mt-6 space-y-4",children:[b,y,k]}),e[48]=b,e[49]=y,e[50]=k,e[51]=C):C=e[51];let U;e[52]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(Z,{size:16,className:"shrink-0 text-muted-foreground"}),e[52]=U):U=e[52];const H=r===1?"post":"posts";let w;e[53]!==r||e[54]!==H?(w=s.jsxs("div",{className:"flex items-center gap-2 px-4 py-3",children:[U,s.jsxs("span",{className:"text-sm",children:[r," selected ",H]})]}),e[53]=r,e[54]=H,e[55]=w):w=e[55];let R;e[56]!==r||e[57]!==i?(R=r===0?s.jsx("p",{className:"border-t bg-background px-4 py-3 text-sm text-muted-foreground",children:"No posts selected yet — pick them from the list on the left."}):s.jsx("ul",{className:"divide-y border-t bg-background",children:i.map(je)}),e[56]=r,e[57]=i,e[58]=R):R=e[58];let $;e[59]!==w||e[60]!==R?($=s.jsxs("div",{className:"mt-8 overflow-hidden rounded-lg border bg-muted/30",children:[w,R]}),e[59]=w,e[60]=R,e[61]=$):$=e[61];let z;e[62]!==j||e[63]!==C||e[64]!==$?(z=s.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:s.jsxs("div",{className:"mx-auto max-w-2xl px-8 py-8",children:[A,j,C,$]})}),e[62]=j,e[63]=C,e[64]=$,e[65]=z):z=e[65];let q;return e[66]!==z||e[67]!==g?(q=s.jsxs("div",{className:"flex h-full flex-col",children:[g,z]}),e[66]=z,e[67]=g,e[68]=q):q=e[68],q}function je(a){return s.jsxs("li",{className:"flex items-center gap-2.5 px-4 py-2.5",children:[s.jsx(Z,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-sm",children:a.title}),a.slug&&s.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:a.slug})]})]},a.key)}function be(a){return s.jsx(pe,{value:a.slug,children:s.jsx("span",{className:"truncate",children:a.name})},a.slug)}export{ze as BulkCategoryPanel};
1
+ import{c as Q,l as Y,j as s,r as W,B as J,i as le}from"./index-C2u4siS5.js";import{c as Z}from"./ZoomOut-shbGcJgg.js";import{i as ae}from"./X-DvSaCzV-.js";import{L as O}from"./label-DhK5GRHz.js";import{I as ie,R as oe,a as re}from"./index-CuO_-GZV.js";import{a as ce}from"./DotsVertical-Ctyi_Fcj.js";import{S as ne,a as de,b as me,c as xe,d as pe}from"./select-DMy4CZEM.js";import{T as fe,a as ue,b as he}from"./tooltip-DK2r83_Q.js";import"./ChevronUp-DKgNoV7g.js";import"./ChevronDown-BpKPHxDG.js";function ge(a){const e=Q.c(8);let i,t;e[0]!==a?({className:i,...t}=a,e[0]=a,e[1]=i,e[2]=t):(i=e[1],t=e[2]);let o;e[3]!==i?(o=Y("grid gap-3",i),e[3]=i,e[4]=o):o=e[4];let l;return e[5]!==t||e[6]!==o?(l=s.jsx(oe,{"data-slot":"radio-group",className:o,...t}),e[5]=t,e[6]=o,e[7]=l):l=e[7],l}function X(a){const e=Q.c(9);let i,t;e[0]!==a?({className:i,...t}=a,e[0]=a,e[1]=i,e[2]=t):(i=e[1],t=e[2]);let o;e[3]!==i?(o=Y("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[2px] disabled:opacity-50",i),e[3]=i,e[4]=o):o=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(re,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:s.jsx(ce,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})}),e[5]=l):l=e[5];let c;return e[6]!==t||e[7]!==o?(c=s.jsx(ie,{"data-slot":"radio-group-item",className:o,...t,children:l}),e[6]=t,e[7]=o,e[8]=c):c=e[8],c}function ze(a){const e=Q.c(69),{posts:i,categories:t,initialSlug:o,isPending:l,onApply:c,onClose:m}=a,[n,ee]=W.useState(o&&t.some(d=>d.slug===o)?o:t[0]?.slug??""),[x,se]=W.useState("add");let T;if(e[0]!==t||e[1]!==n){let d;e[3]!==n?(d=te=>te.slug===n,e[3]=n,e[4]=d):d=e[4],T=t.find(d),e[0]=t,e[1]=n,e[2]=T}else T=e[2];const p=T,r=i.length,K=r===1?"post":"posts";let f;e[5]!==r||e[6]!==K?(f=s.jsxs("span",{className:"truncate text-sm font-medium",children:[r," ",K," selected"]}),e[5]=r,e[6]=K,e[7]=f):f=e[7];let E;e[8]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(ae,{size:14}),e[8]=E):E=e[8];let u;e[9]!==l||e[10]!==m?(u=s.jsx(fe,{asChild:!0,children:s.jsx(J,{type:"button",variant:"ghost",size:"icon",disabled:l,onClick:m,"aria-label":"Exit selection",children:E})}),e[9]=l,e[10]=m,e[11]=u):u=e[11];let I;e[12]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(ue,{side:"bottom",children:"Exit selection"}),e[12]=I):I=e[12];let h;e[13]!==u?(h=s.jsxs(he,{children:[u,I]}),e[13]=u,e[14]=h):h=e[14];let g;e[15]!==f||e[16]!==h?(g=s.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[f,h]}),e[15]=f,e[16]=h,e[17]=g):g=e[17];let A;e[18]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx("h2",{className:"text-2xl font-bold text-foreground",children:"Update category"}),e[18]=A):A=e[18];const M=r===0?"Select posts from the list to choose what this update applies to.":`Choose a category to apply to ${r} ${r===1?"post":"posts"}.`;let j;e[19]!==M?(j=s.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:M}),e[19]=M,e[20]=j):j=e[20];let B;e[21]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(O,{children:"Category"}),e[21]=B):B=e[21];let b;e[22]!==t||e[23]!==n?(b=s.jsxs("div",{className:"space-y-2",children:[B,t.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No categories yet — create one in the Categories collection."}):s.jsxs(ne,{value:n,onValueChange:ee,children:[s.jsx(de,{className:"w-full",children:s.jsx(me,{placeholder:"Select a category"})}),s.jsx(xe,{children:t.map(be)})]})]}),e[22]=t,e[23]=n,e[24]=b):b=e[24];let F;e[25]===Symbol.for("react.memo_cache_sentinel")?(F=d=>se(d),e[25]=F):F=e[25];let V;e[26]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsx(X,{value:"add",id:"cat-mode-add",className:"mt-0.5"}),e[26]=V):V=e[26];let G;e[27]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsxs(O,{htmlFor:"cat-mode-add",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[V,s.jsxs("span",{className:"space-y-0.5",children:[s.jsx("span",{className:"block text-sm font-medium",children:"Add category"}),s.jsx("span",{className:"block text-xs text-muted-foreground",children:"Keep existing categories and add this one."})]})]}),e[27]=G):G=e[27];let L;e[28]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(X,{value:"replace",id:"cat-mode-replace",className:"mt-0.5"}),e[28]=L):L=e[28];let P;e[29]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsxs(O,{htmlFor:"cat-mode-replace",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[L,s.jsxs("span",{className:"space-y-0.5",children:[s.jsx("span",{className:"block text-sm font-medium",children:"Replace category"}),s.jsx("span",{className:"block text-xs text-muted-foreground",children:"Remove all current categories and set only this one."})]})]}),e[29]=P):P=e[29];let y;e[30]!==x?(y=s.jsxs(ge,{value:x,onValueChange:F,className:"gap-2",children:[G,P]}),e[30]=x,e[31]=y):y=e[31];let N;e[32]!==l||e[33]!==m?(N=s.jsx(J,{type:"button",variant:"outline",onClick:m,disabled:l,children:"Cancel"}),e[32]=l,e[33]=m,e[34]=N):N=e[34];const D=!p||l||r===0;let v;e[35]!==x||e[36]!==c||e[37]!==p?(v=()=>p&&c(x,{name:p.name,slug:p.slug}),e[35]=x,e[36]=c,e[37]=p,e[38]=v):v=e[38];let S;e[39]!==l?(S=l?s.jsxs(s.Fragment,{children:[s.jsx(le,{size:14,className:"animate-spin"}),"Updating…"]}):"Apply",e[39]=l,e[40]=S):S=e[40];let _;e[41]!==D||e[42]!==v||e[43]!==S?(_=s.jsx(J,{type:"button",disabled:D,onClick:v,children:S}),e[41]=D,e[42]=v,e[43]=S,e[44]=_):_=e[44];let k;e[45]!==N||e[46]!==_?(k=s.jsxs("div",{className:"flex justify-end gap-2",children:[N,_]}),e[45]=N,e[46]=_,e[47]=k):k=e[47];let C;e[48]!==b||e[49]!==y||e[50]!==k?(C=s.jsxs("div",{className:"mt-6 space-y-4",children:[b,y,k]}),e[48]=b,e[49]=y,e[50]=k,e[51]=C):C=e[51];let U;e[52]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(Z,{size:16,className:"shrink-0 text-muted-foreground"}),e[52]=U):U=e[52];const H=r===1?"post":"posts";let w;e[53]!==r||e[54]!==H?(w=s.jsxs("div",{className:"flex items-center gap-2 px-4 py-3",children:[U,s.jsxs("span",{className:"text-sm",children:[r," selected ",H]})]}),e[53]=r,e[54]=H,e[55]=w):w=e[55];let R;e[56]!==r||e[57]!==i?(R=r===0?s.jsx("p",{className:"border-t bg-background px-4 py-3 text-sm text-muted-foreground",children:"No posts selected yet — pick them from the list on the left."}):s.jsx("ul",{className:"divide-y border-t bg-background",children:i.map(je)}),e[56]=r,e[57]=i,e[58]=R):R=e[58];let $;e[59]!==w||e[60]!==R?($=s.jsxs("div",{className:"mt-8 overflow-hidden rounded-lg border bg-muted/30",children:[w,R]}),e[59]=w,e[60]=R,e[61]=$):$=e[61];let z;e[62]!==j||e[63]!==C||e[64]!==$?(z=s.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:s.jsxs("div",{className:"mx-auto max-w-2xl px-8 py-8",children:[A,j,C,$]})}),e[62]=j,e[63]=C,e[64]=$,e[65]=z):z=e[65];let q;return e[66]!==z||e[67]!==g?(q=s.jsxs("div",{className:"flex h-full flex-col",children:[g,z]}),e[66]=z,e[67]=g,e[68]=q):q=e[68],q}function je(a){return s.jsxs("li",{className:"flex items-center gap-2.5 px-4 py-2.5",children:[s.jsx(Z,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-sm",children:a.title}),a.slug&&s.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:a.slug})]})]},a.key)}function be(a){return s.jsx(pe,{value:a.slug,children:s.jsx("span",{className:"truncate",children:a.name})},a.slug)}export{ze as BulkCategoryPanel};