decocms 4.76.74 → 4.76.76
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.
- package/dist/client/assets/{AlertCircle-6zWXlWWO.js → AlertCircle-BVlB73Gd.js} +1 -1
- package/dist/client/assets/{AreaChart-D3KK_s0U.js → AreaChart-C1SgmDdh.js} +1 -1
- package/dist/client/assets/{ArrowUp-CkrQwyeD.js → ArrowUp-BcoNWaDn.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-BDFzLPlp.js → ArrowUpRight-COlnzfbE.js} +1 -1
- package/dist/client/assets/{Check-ewaBC-Xf.js → Check-ylcp47jh.js} +1 -1
- package/dist/client/assets/{CheckCircle-DYUwE7QR.js → CheckCircle-jaIqf58w.js} +1 -1
- package/dist/client/assets/{ChevronDown-DWvyGtmb.js → ChevronDown-DorDM-K-.js} +1 -1
- package/dist/client/assets/{ChevronRight-D0B422F4.js → ChevronRight-NJ1RHqa7.js} +1 -1
- package/dist/client/assets/{ChevronUp-BHzgT0EG.js → ChevronUp-C85SxyPM.js} +1 -1
- package/dist/client/assets/{Circle-FDyAnvXS.js → Circle-BGJOKhru.js} +1 -1
- package/dist/client/assets/{Copy01-BUrLo-T8.js → Copy01-C5M0y3sD.js} +1 -1
- package/dist/client/assets/{DotsVertical-D_kT6jkL.js → DotsVertical-Ckk9mZsT.js} +1 -1
- package/dist/client/assets/{Eye-B1rqgwn3.js → Eye-ByzbJOuX.js} +1 -1
- package/dist/client/assets/{FilterLines-Dg2jORl1.js → FilterLines-hGzDxUbQ.js} +1 -1
- package/dist/client/assets/{Flag01-DKt-7ylw.js → Flag01-D6FA8Gqb.js} +1 -1
- package/dist/client/assets/{Globe01-DJ7RE_eO.js → Globe01-DwjnaG3m.js} +1 -1
- package/dist/client/assets/{Globe04-YhxTm_oy.js → Globe04-KMRfe3Ap.js} +1 -1
- package/dist/client/assets/{HardDrive-BgIpLKbz.js → HardDrive-BLW7r-EP.js} +1 -1
- package/dist/client/assets/{Image01-KZoeqBBJ.js → Image01-DID7YK1H.js} +1 -1
- package/dist/client/assets/{Key01-CGnJsDpv.js → Key01-BNdv9d9e.js} +1 -1
- package/dist/client/assets/{LayoutLeft-Cf-QGAH8.js → LayoutLeft-DP-M8mno.js} +1 -1
- package/dist/client/assets/{LinkExternal01-B3Xr63OW.js → LinkExternal01-CJELREUW.js} +1 -1
- package/dist/client/assets/{List-1506yk-t.js → List-B6zsWjbc.js} +1 -1
- package/dist/client/assets/{Monitor01-osmutGlP.js → Monitor01-DGMiqS2G.js} +1 -1
- package/dist/client/assets/{Package-CYGhsbZ3.js → Package-Cys9wdnk.js} +1 -1
- package/dist/client/assets/{Palette-Dun1_uhn.js → Palette-CjpYx7Ii.js} +1 -1
- package/dist/client/assets/{Play-DbhZvlX2.js → Play-BIDZ3Qx4.js} +1 -1
- package/dist/client/assets/{Plus-BVHqtbgP.js → Plus-OGxa0fdn.js} +1 -1
- package/dist/client/assets/{SearchLg-DGcmsyj8.js → SearchLg-BkGBAC6u.js} +1 -1
- package/dist/client/assets/{SearchMd-C-4B4tGP.js → SearchMd-DhGVvJ2r.js} +1 -1
- package/dist/client/assets/{Settings02-hQvL1H-i.js → Settings02-s4dN6VnR.js} +1 -1
- package/dist/client/assets/{Shield01-geyvMWzv.js → Shield01-C2gwqyT0.js} +1 -1
- package/dist/client/assets/{Star01-CGhoqrlg.js → Star01-CdWOUCGL.js} +1 -1
- package/dist/client/assets/{Stars01-Bgh6qQ-r.js → Stars01-Ce7N7beA.js} +1 -1
- package/dist/client/assets/{Stars02-B3PqPWGp.js → Stars02-Brbdnmc2.js} +1 -1
- package/dist/client/assets/{Sun-DHI8BrfB.js → Sun-DrhefHVP.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DGjl8QrL.js → SwitchHorizontal01-CQC-VHSM.js} +1 -1
- package/dist/client/assets/{Tool01-DSDzjstu.js → Tool01-CQ5Yi4Y5.js} +1 -1
- package/dist/client/assets/{Tool02-_z3O1aGg.js → Tool02-B5mtXP4w.js} +1 -1
- package/dist/client/assets/{Trash01-swADtIx6.js → Trash01-9Yhy1NDp.js} +1 -1
- package/dist/client/assets/{TrendUp01-DsI7mGbW.js → TrendUp01-CUYb4fKq.js} +1 -1
- package/dist/client/assets/{Upload01-D3XDbLtc.js → Upload01-BGaIkl8C.js} +1 -1
- package/dist/client/assets/{User01-CEBwHOWX.js → User01-DY8EdPzH.js} +1 -1
- package/dist/client/assets/{UserPlus01-C3iEGwSH.js → UserPlus01-ByXfLuOW.js} +1 -1
- package/dist/client/assets/{Users01-INg4sBKL.js → Users01-DnUyZ4sc.js} +1 -1
- package/dist/client/assets/{Users03-CM7aaEHp.js → Users03-DQHSM-ip.js} +1 -1
- package/dist/client/assets/{X-8BLLt1XW.js → X-8dZUy9dd.js} +1 -1
- package/dist/client/assets/{XCircle-DwxRLgWl.js → XCircle-DY5ehXOb.js} +1 -1
- package/dist/client/assets/{XClose-DgejVw6e.js → XClose-IT2oT79e.js} +1 -1
- package/dist/client/assets/{Zap-CXklKZD8.js → Zap-UNZ6wjOU.js} +1 -1
- package/dist/client/assets/{ZapSquare-OG-fiid8.js → ZapSquare-CIT8HcpR.js} +1 -1
- package/dist/client/assets/{ZoomOut-DHfhZNsb.js → ZoomOut-DoDMe5dD.js} +1 -1
- package/dist/client/assets/{access-gate-g09XRVRp.js → access-gate-BjqlcKiO.js} +1 -1
- package/dist/client/assets/{add-section-modal-ZG8fy660.js → add-section-modal-C8E813YY.js} +1 -1
- package/dist/client/assets/{agent-icon-BxLuMAgr.js → agent-icon-DCK7PpQ3.js} +1 -1
- package/dist/client/assets/{agents-list-Bh85641T.js → agents-list-Bwjyc61n.js} +1 -1
- package/dist/client/assets/{ai-providers-DZua1wyO.js → ai-providers-peEIA4y0.js} +1 -1
- package/dist/client/assets/{alert-DnEW_5v9.js → alert-CMPxdRHq.js} +1 -1
- package/dist/client/assets/{alert-dialog-BY6SHGdK.js → alert-dialog-iGippWYX.js} +1 -1
- package/dist/client/assets/{app-editor-CIxwuMld.js → app-editor-CuUlGlJd.js} +1 -1
- package/dist/client/assets/{auth-B8aXfOp1.js → auth-BBryGktV.js} +1 -1
- package/dist/client/assets/{auth-catchall-CsTIy_7B.js → auth-catchall-CVb1uch8.js} +1 -1
- package/dist/client/assets/{auth-entry-9xdqWRMb.js → auth-entry-C6Y1Coh9.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BHeI10fA.js → auth-split-layout-C7bMt_tF.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-V3HnUVSM.js → authenticate-and-persist-oauth-BVhm4ZHQ.js} +1 -1
- package/dist/client/assets/{automation-list-row-Duk1FieL.js → automation-list-row-CW2Mr4ne.js} +1 -1
- package/dist/client/assets/{automation-runs-CLSyqJR8.js → automation-runs-DtF_plhA.js} +1 -1
- package/dist/client/assets/automations-TF-uE_JU.js +1 -0
- package/dist/client/assets/{autosend-I_xNKHio.js → autosend-YOQ-CO-z.js} +1 -1
- package/dist/client/assets/{avatar-ueCwEfND.js → avatar-6ZpKSJQ1.js} +1 -1
- package/dist/client/assets/{badge-GP7ytYHS.js → badge-Brm7dRFm.js} +1 -1
- package/dist/client/assets/{block-document-CIlzSNgh.js → block-document-BE7E93rt.js} +1 -1
- package/dist/client/assets/{brand-context-D3r2b9aK.js → brand-context-CMCsnbCM.js} +1 -1
- package/dist/client/assets/{buckets-BpVGcq66.js → buckets-sTBT-mWR.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-Cx7BKASy.js → bulk-category-panel-CnXvOLen.js} +1 -1
- package/dist/client/assets/{calendar-wOlIv-By.js → calendar-C8mrI2UH.js} +1 -1
- package/dist/client/assets/{capability-load-error-viD7A7T1.js → capability-load-error-u8-vFMPG.js} +1 -1
- package/dist/client/assets/{card-CGyKyODi.js → card-DmJEBNvh.js} +1 -1
- package/dist/client/assets/{category-editor-ChtRew3E.js → category-editor-BS7auS6b.js} +1 -1
- package/dist/client/assets/{chat-context-ORrqnOYE.js → chat-context-DeX0VT17.js} +1 -1
- package/dist/client/assets/{checkbox-vEs343Du.js → checkbox-YjFOYgvp.js} +1 -1
- package/dist/client/assets/{cli-auth-success-D_th7Wpn.js → cli-auth-success-CYFaZSY8.js} +1 -1
- package/dist/client/assets/{collection-detail-NokWTCZ0.js → collection-detail-DM2ekT5E.js} +1 -1
- package/dist/client/assets/{collection-display-button-Bl4FoBcD.js → collection-display-button-B5vJJ8M2.js} +1 -1
- package/dist/client/assets/{collection-search-0dDiawvQ.js → collection-search-BebQySxJ.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-VtfdVGWs.js → collection-table-wrapper-D1lST78v.js} +1 -1
- package/dist/client/assets/{collection-tabs-Bav5nGoj.js → collection-tabs-DhPjZGgE.js} +1 -1
- package/dist/client/assets/{command-ydSS1VRq.js → command-DgNLNLpt.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-BYNEMhlk.js → commerce-onboarding-Di2Fzvlr.js} +1 -1
- package/dist/client/assets/{companions-core-7uo-nW0M.js → companions-core-BXSVQzy2.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-ClPriClw.js → connect-desktop-dialog-BFe8wpxN.js} +1 -1
- package/dist/client/assets/{connection-card-DW2LSC7t.js → connection-card-B0Odymge.js} +1 -1
- package/dist/client/assets/{connection-detail-CxgkPGjz.js → connection-detail-B00fRni_.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CHmhP67D.js → connection-form-helpers-Cfzc9ntz.js} +1 -1
- package/dist/client/assets/{connections-DFv8ggpz.js → connections-CDGkbkgV.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DPDPqdGF.js → decopilot-sse-pool-DpwU6Fnw.js} +1 -1
- package/dist/client/assets/{dialog-CXU2DuDs.js → dialog-C6_0qLBU.js} +1 -1
- package/dist/client/assets/{domain-settings-Ct43uzcU.js → domain-settings-Bhf5R19l.js} +1 -1
- package/dist/client/assets/{drawer-eT6vv02u.js → drawer-BtRJAb0M.js} +1 -1
- package/dist/client/assets/{dropdown-menu-C1_c49r-.js → dropdown-menu-96rpJkjm.js} +1 -1
- package/dist/client/assets/{empty-state-D1i7YTnx.js → empty-state-jjn-bhGa.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BOVe8Maa.js → extract-connection-data-BKfZXo3n.js} +1 -1
- package/dist/client/assets/{file-explorer-Cefdz0bx.js → file-explorer-CeKeprFE.js} +1 -1
- package/dist/client/assets/{file-type-icon-B6pkitt3.js → file-type-icon-cPIVgg9x.js} +1 -1
- package/dist/client/assets/{files-DcDT-3yw.js → files-Bn3ru1FT.js} +1 -1
- package/dist/client/assets/{form-BSlL1YES.js → form-BLqlEubb.js} +1 -1
- package/dist/client/assets/{general-DSahdpek.js → general-CKz0uKhP.js} +1 -1
- package/dist/client/assets/{github-repo-picker-B8ov8Udz.js → github-repo-picker-CiS_eOYq.js} +1 -1
- package/dist/client/assets/{hooks-DhipJZPl.js → hooks-B5swj9vo.js} +1 -1
- package/dist/client/assets/{index-DIs_Ascu.js → index-BUWOf6-H.js} +3 -3
- package/dist/client/assets/{index-_uik6TVj.js → index-BYdleGn4.js} +1 -1
- package/dist/client/assets/{index-DePzCjlh.js → index-Bb3luPLV.js} +1 -1
- package/dist/client/assets/{index-DatDUdui.js → index-BdUl5bJN.js} +1 -1
- package/dist/client/assets/{index-C_szOdE8.js → index-C9TMdwOy.js} +1 -1
- package/dist/client/assets/{index-7I_F_6OP.js → index-CM-AY9Fy.js} +1 -1
- package/dist/client/assets/{index-C4-3ZavC.js → index-CWxmaANj.js} +1 -1
- package/dist/client/assets/{index-BMPF_gXy.js → index-C_fgqMB7.js} +2 -2
- package/dist/client/assets/{index-D3fVdOq0.js → index-CqkHhPgZ.js} +1 -1
- package/dist/client/assets/{index-BHpIzqyo.js → index-DPSWF_0V.js} +1 -1
- package/dist/client/assets/{index-B_bfMDNk.js → index-Dliz359x.js} +1 -1
- package/dist/client/assets/{index-wWOQNqzU.js → index-Qvw8OnY1.js} +1 -1
- package/dist/client/assets/{index-bA6IdBZH.js → index-_AfOMAmM.js} +1 -1
- package/dist/client/assets/{index-CxlY6aPa.js → index-gNz_kq5D.js} +28 -28
- package/dist/client/assets/{index-redirect-B0zUxwKB.js → index-redirect-CmPVrw8O.js} +1 -1
- package/dist/client/assets/{input-BGzDddR2.js → input-C2XNQcRH.js} +1 -1
- package/dist/client/assets/{integration-icon-CS_kTF8n.js → integration-icon-IezBYdjm.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-BRtbtJbY.js → invite-member-dialog-DdEYWFzF.js} +1 -1
- package/dist/client/assets/{label-CXj1p-Ay.js → label-CK1XiDPB.js} +1 -1
- package/dist/client/assets/{layout-CTcP-zM0.js → layout-DdW7yJtW.js} +1 -1
- package/dist/client/assets/{login-plemg_0I.js → login-dKsCPJDm.js} +1 -1
- package/dist/client/assets/{mcp-oauth-B-z-ndXj.js → mcp-oauth-BtnOcT8N.js} +1 -1
- package/dist/client/assets/{members-B1jq8hOx.js → members-OHD_cH5V.js} +1 -1
- package/dist/client/assets/{monaco-editor-Cx9Kzv4m.js → monaco-editor-45RX9-wa.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CXNlsFK8.js → monitoring-stats-row-Pf0PyiYb.js} +1 -1
- package/dist/client/assets/{multi-select-fCQiRwjf.js → multi-select-B1IegP8Y.js} +1 -1
- package/dist/client/assets/{oauth-callback-CtMlWqqo.js → oauth-callback-NJnfVzCp.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-OSGIsdYX.js → oauth-callback-ai-provider-CTrqu6Je.js} +1 -1
- package/dist/client/assets/{onboarding-D7Ix44AD.js → onboarding-VNgiRiDL.js} +1 -1
- package/dist/client/assets/{org-install-DDLn231v.js → org-install-DH3udQUZ.js} +1 -1
- package/dist/client/assets/{org-layout-DAZLPd8s.js → org-layout-BwVt-wlI.js} +1 -1
- package/dist/client/assets/{organization-choice-DXVVH-0b.js → organization-choice-CA519nnl.js} +1 -1
- package/dist/client/assets/{orgs-DGcgod1w.js → orgs-CyzbToZq.js} +1 -1
- package/dist/client/assets/{page-seo-form-CG1zAgLl.js → page-seo-form-txb12Kn3.js} +1 -1
- package/dist/client/assets/page-seo-sheet-B7-vAcY0.js +1 -0
- package/dist/client/assets/{popover-CgYfhhYK.js → popover-B2zk9niv.js} +1 -1
- package/dist/client/assets/{post-editor-BL7YRgRU.js → post-editor-DrrNmiiH.js} +1 -1
- package/dist/client/assets/{primitives-DSxqyzBO.js → primitives-DlChEJzy.js} +1 -1
- package/dist/client/assets/{profile-toS7W1Qo.js → profile-Ds0StJLd.js} +1 -1
- package/dist/client/assets/project-app-view-Dtfecj3R.js +1 -0
- package/dist/client/assets/record-editor-5g7SCJ1d.js +1 -0
- package/dist/client/assets/redirect-editor-BVp57v49.js +1 -0
- package/dist/client/assets/registry-ddiHAuZI.js +2 -0
- package/dist/client/assets/{registry-layout-TayaZ_8m.js → registry-layout-Dalyr-dX.js} +1 -1
- package/dist/client/assets/{reports-DjYozE7G.js → reports-zmHYxym4.js} +1 -1
- package/dist/client/assets/{require-capability-JLOfkIXp.js → require-capability-qkGmH7NG.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DianHx6F.js → required-auth-layout-DJSVKequ.js} +1 -1
- package/dist/client/assets/{reset-password-BDR8__td.js → reset-password-BQvQW_Yc.js} +1 -1
- package/dist/client/assets/{roles-BukgkIoV.js → roles-BO1zYp8H.js} +1 -1
- package/dist/client/assets/{search-input-BpUfp6hr.js → search-input-DoQewDAM.js} +1 -1
- package/dist/client/assets/{secrets-B-j2YWOb.js → secrets-CwEm2qB4.js} +1 -1
- package/dist/client/assets/{sections-editor-avtThttP.js → sections-editor-CeZVcic7.js} +1 -1
- package/dist/client/assets/{select-D6aEQ2Nd.js → select-BVg_AKhS.js} +1 -1
- package/dist/client/assets/{select-model-ZyAvNzn7.js → select-model-w8ZEBOqQ.js} +1 -1
- package/dist/client/assets/{self-tool-result-CKYiDL9q.js → self-tool-result-8XOi1iaO.js} +1 -1
- package/dist/client/assets/{seo-editor-rg1HXPGB.js → seo-editor-Ctu5yT8I.js} +1 -1
- package/dist/client/assets/{settings-layout-D243K0GG.js → settings-layout-Dpo54nzI.js} +1 -1
- package/dist/client/assets/{settings-section-DNF3Oykf.js → settings-section-Cd7MHbmE.js} +1 -1
- package/dist/client/assets/{shell-controls-BC9GfPMq.js → shell-controls-IB_xzFFr.js} +1 -1
- package/dist/client/assets/{shell-layout-DtNvv7VT.js → shell-layout-BDvpeGAX.js} +1 -1
- package/dist/client/assets/{sidebar-ONo6fK60.js → sidebar-Bg21lFNS.js} +1 -1
- package/dist/client/assets/{skeleton-DG-RQf3P.js → skeleton-JjNP43lD.js} +1 -1
- package/dist/client/assets/{sso-RuAkZnv-.js → sso-C_5vX52P.js} +1 -1
- package/dist/client/assets/{store-BwQCMpNP.js → store-DDBShmzT.js} +1 -1
- package/dist/client/assets/store-registry-D43DIoAy.js +2 -0
- package/dist/client/assets/{studio-tools-CfHMRgsU.js → studio-tools-JGMjsS9V.js} +1 -1
- package/dist/client/assets/{switch-Bw1NJozE.js → switch-Dbe5CgqQ.js} +1 -1
- package/dist/client/assets/{table-GxF24ep_.js → table-kChvW90I.js} +1 -1
- package/dist/client/assets/{tabs-CrN4zklU.js → tabs-D6exMqkv.js} +1 -1
- package/dist/client/assets/{textarea-CvFrlZfb.js → textarea-C-upgcvq.js} +1 -1
- package/dist/client/assets/{toggle-group-CP4Znts2.js → toggle-group-CSfYzN1e.js} +1 -1
- package/dist/client/assets/{toolbar-CEqLs77O.js → toolbar-CdhDSP7U.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-D178PpcP.js → toolbar-icon-button--2c5nPA5.js} +1 -1
- package/dist/client/assets/{tooltip-DpARBZYH.js → tooltip-cXMPTvhQ.js} +1 -1
- package/dist/client/assets/{use-ai-providers-DsyJ0d_R.js → use-ai-providers-cFLtai6A.js} +1 -1
- package/dist/client/assets/{use-automations-BDvg1ajN.js → use-automations-ljR2TnPA.js} +1 -1
- package/dist/client/assets/{use-autosave-wsBdMI6m.js → use-autosave-hI5b40ec.js} +1 -1
- package/dist/client/assets/{use-capability-CfAAo2c3.js → use-capability-BI2Ao-_m.js} +1 -1
- package/dist/client/assets/{use-clock-tick-CRESYNg6.js → use-clock-tick-BJ7X5vRI.js} +1 -1
- package/dist/client/assets/{use-collections-Cjcv282I.js → use-collections-7ERyEkIU.js} +1 -1
- package/dist/client/assets/{use-connection-DKzOdGGz.js → use-connection-CD2Fnptb.js} +1 -1
- package/dist/client/assets/{use-copy-6r_b7eLi.js → use-copy-BhzNp8tf.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-Ds-92M9L.js → use-create-virtual-mcp-C-AFRt9S.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-Cp5wCv5x.js → use-debounced-autosave-CZ0xTx2w.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CGt_I2zf.js → use-debounced-value-B52whIH7.js} +1 -1
- package/dist/client/assets/{use-deco-credits-Ds8yWRGv.js → use-deco-credits-Cfgq3ZjW.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-D1MFl1iZ.js → use-decopilot-events-BNjf3dpu.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DRe_seiC.js → use-delete-connection-zsTP85HZ.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-B42Njf3A.js → use-deployment-admin-C6GJURpg.js} +1 -1
- package/dist/client/assets/{use-file-configs-eaG35PmB.js → use-file-configs-1u4ZUq9F.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CXFvo-N2.js → use-infinite-scroll-DiSaAQPl.js} +1 -1
- package/dist/client/assets/{use-join-requests-DfdNGSCy.js → use-join-requests-U5r9xSzr.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-CtGE-4a9.js → use-mcp-auth-status-dq4wRd85.js} +1 -1
- package/dist/client/assets/{use-mcp-client-CuBQePEu.js → use-mcp-client-qnk43eG1.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DzdfZudZ.js → use-mcp-tools-SncKc9ct.js} +1 -1
- package/dist/client/assets/{use-members-CFZT7Pcx.js → use-members-Dey3M7mC.js} +1 -1
- package/dist/client/assets/{use-mobile-rcq0LpWr.js → use-mobile-oSorlQMv.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-Djoo2Imi.js → use-navigate-to-agent-7gJqLFkE.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-Cbfj7vjD.js → use-org-auth-client-aAeyG-Cs.js} +1 -1
- package/dist/client/assets/{use-org-sso-D46Vv8Sj.js → use-org-sso-De26T__u.js} +1 -1
- package/dist/client/assets/{use-organization-roles-D87U9zm1.js → use-organization-roles-DNlG9eUj.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BEE_UCT_.js → use-organization-settings-DrhRsJWG.js} +1 -1
- package/dist/client/assets/{use-registry-connections-BD3CWyc3.js → use-registry-connections-CmItta1b.js} +1 -1
- package/dist/client/assets/{use-secrets-pPvZ_A9x.js → use-secrets-DDzz0qxd.js} +1 -1
- package/dist/client/assets/{use-status-sounds-IEfB1KLr.js → use-status-sounds-4kB8txsU.js} +1 -1
- package/dist/client/assets/{use-view-mode-BkkyMfRg.js → use-view-mode-CtgJ6di_.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-78cXx0vL.js → use-virtual-mcp-BJxeG1T-.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-C6UXsGIP.js +1 -0
- package/dist/client/assets/{useRouterState-BvonlWvE.js → useRouterState-DRz1wrvb.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Cn5B2KcA.js +1 -0
- package/dist/client/assets/{users-E49-XTZ5.js → users-CUTUKT6m.js} +1 -1
- package/dist/client/assets/{variant-calendar-BQP9h9Ix.js → variant-calendar-HHl2ENnf.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-CnyACsI2.js → view-mode-toggle-DqoxH_gE.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/automations-CFYRe0cG.js +0 -1
- package/dist/client/assets/page-seo-sheet-B4Wy-Roc.js +0 -1
- package/dist/client/assets/project-app-view-sieaED_H.js +0 -1
- package/dist/client/assets/record-editor-DBe5BhVX.js +0 -1
- package/dist/client/assets/redirect-editor-CfwqB8ek.js +0 -1
- package/dist/client/assets/registry-BkHIIFj_.js +0 -2
- package/dist/client/assets/store-registry-CMhacNoO.js +0 -2
- package/dist/client/assets/useInfiniteQuery-DxCcVpEy.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CO-EuP4r.js +0 -1
package/dist/client/assets/{automation-list-row-Duk1FieL.js → automation-list-row-CW2Mr4ne.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as E,r as F,l as $,j as t,B as K}from"./index-
|
|
1
|
+
import{c as E,r as F,l as $,j as t,B as K}from"./index-BUWOf6-H.js";import{b as O,d as B,e as I,g as L,c as H,A as V,a as q,f as G}from"./alert-dialog-iGippWYX.js";import{a as J,D as Q,c as U,d as W}from"./dropdown-menu-96rpJkjm.js";import{s as X}from"./Stars02-Brbdnmc2.js";import{i as Y}from"./DotsVertical-Ckk9mZsT.js";import{s as Z}from"./Trash01-9Yhy1NDp.js";import{i as ee}from"./Zap-UNZ6wjOU.js";import{a as te}from"./use-virtual-mcp-BJxeG1T-.js";import{A as se}from"./agent-icon-DCK7PpQ3.js";import{u as ne}from"./use-automations-ljR2TnPA.js";function he(a){const e=E.c(53),{automation:s,showAgent:n,onClick:r}=a,{remove:i}=ne(),[P,S]=F.useState(!1),o=te(n?s.virtual_mcp_id:void 0);let D;e[0]!==s.id||e[1]!==i?(D=()=>{i.mutate(s.id),S(!1)},e[0]=s.id,e[1]=i,e[2]=D):D=e[2];const z=D;let A;e[3]!==r?(A=l=>{l.target===l.currentTarget&&(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),r())},e[3]=r,e[4]=A):A=e[4];const T=A,M=s.active&&s.trigger_count>0?"bg-success":"bg-muted-foreground/40";let c;e[5]!==M?(c=$("inline-block size-2 rounded-full shrink-0",M),e[5]=M,e[6]=c):c=e[6];const R=s.active&&s.trigger_count>0?"Active":s.active?"No triggers configured":"Paused";let m;e[7]!==c||e[8]!==R?(m=t.jsx("span",{className:c,"aria-label":R}),e[7]=c,e[8]=R,e[9]=m):m=e[9];let u;e[10]!==o?.icon||e[11]!==o?.title||e[12]!==s.name||e[13]!==n?(u=n&&t.jsx(se,{icon:o?.icon??null,name:o?.title??s.name,size:"xs",className:"shrink-0"}),e[10]=o?.icon,e[11]=o?.title,e[12]=s.name,e[13]=n,e[14]=u):u=e[14];let d;e[15]!==s.name?(d=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:s.name}),e[15]=s.name,e[16]=d):d=e[16];let g;e[17]!==o||e[18]!==n?(g=n&&o&&t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["· ",o.title]}),e[17]=o,e[18]=n,e[19]=g):g=e[19];let f;e[20]!==d||e[21]!==g?(f=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d,g]}),e[20]=d,e[21]=g,e[22]=f):f=e[22];let x;e[23]!==s.nearest_next_run_at||e[24]!==s.trigger_count?(x=t.jsx(oe,{triggerCount:s.trigger_count,nextRunAt:s.nearest_next_run_at}),e[23]=s.nearest_next_run_at,e[24]=s.trigger_count,e[25]=x):x=e[25];let p;e[26]!==f||e[27]!==x?(p=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[f,x]}),e[26]=f,e[27]=x,e[28]=p):p=e[28];let N;e[29]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(J,{asChild:!0,children:t.jsx(K,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100 transition-opacity",children:t.jsx(Y,{size:16})})}),e[29]=N):N=e[29];let y;e[30]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("div",{onClick:ie,onKeyDown:re,role:"presentation",className:"shrink-0",children:t.jsxs(Q,{children:[N,t.jsx(U,{align:"end",children:t.jsxs(W,{variant:"destructive",onClick:l=>{l.stopPropagation(),S(!0)},children:[t.jsx(Z,{size:16}),"Delete"]})})]})}),e[30]=y):y=e[30];let h;e[31]!==T||e[32]!==r||e[33]!==p||e[34]!==m||e[35]!==u?(h=t.jsxs("div",{role:"button",tabIndex:0,onClick:r,onKeyDown:T,className:"group w-full flex items-center gap-3 px-4 py-3 border-b border-border text-left hover:bg-muted/50 transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[m,u,p,y]}),e[31]=T,e[32]=r,e[33]=p,e[34]=m,e[35]=u,e[36]=h):h=e[36];let w;e[37]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(H,{children:"Delete automation?"}),e[37]=w):w=e[37];let j;e[38]!==s.name?(j=t.jsxs(O,{children:[w,t.jsxs(B,{children:["This removes"," ",t.jsx("span",{className:"font-medium text-foreground",children:s.name})," ","and all of its triggers. This action cannot be undone."]})]}),e[38]=s.name,e[39]=j):j=e[39];let C;e[40]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(V,{children:"Cancel"}),e[40]=C):C=e[40];let _;e[41]!==z||e[42]!==i.isPending?(_=t.jsxs(I,{children:[C,t.jsx(L,{onClick:z,disabled:i.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[41]=z,e[42]=i.isPending,e[43]=_):_=e[43];let v;e[44]!==j||e[45]!==_?(v=t.jsxs(q,{children:[j,_]}),e[44]=j,e[45]=_,e[46]=v):v=e[46];let b;e[47]!==P||e[48]!==v?(b=t.jsx(G,{open:P,onOpenChange:S,children:v}),e[47]=P,e[48]=v,e[49]=b):b=e[49];let k;return e[50]!==h||e[51]!==b?(k=t.jsxs(t.Fragment,{children:[h,b]}),e[50]=h,e[51]=b,e[52]=k):k=e[52],k}function re(a){return a.stopPropagation()}function ie(a){return a.stopPropagation()}function oe(a){const e=E.c(4),{triggerCount:s,nextRunAt:n}=a;if(s===0){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("span",{className:"text-xs text-muted-foreground",children:"No triggers configured"}),e[0]=i):i=e[0],i}let r;return e[1]!==n||e[2]!==s?(r=t.jsx("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground min-w-0",children:n?t.jsxs(t.Fragment,{children:[t.jsx(X,{size:12,className:"shrink-0"}),t.jsxs("span",{className:"truncate",children:["Next run ",new Date(n).toLocaleString()]})]}):t.jsxs(t.Fragment,{children:[t.jsx(ee,{size:12,className:"shrink-0"}),t.jsxs("span",{className:"truncate",children:[s," trigger",s===1?"":"s"]})]})}),e[1]=n,e[2]=s,e[3]=r):r=e[3],r}export{he as A};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as E,c as _,J as Kh,j as p,B as un,I as ra,H as Jh,M as Gh,bJ as Kc,bK as Xh,at as Yh,aM as dn,bL as Qh,l as ee,p as Zh,aR as ep,aO as Ut,aV as tp,aU as _t,ba as Nr,aS as kn,bM as Jc,aQ as Gc,C as Ct,n as np,d as rp,K as Qe,t as Xo,m as Mr,b as Vn,E as Xc,aL as Yc,bN as Bi,aT as sp,bO as Qt}from"./index-DIs_Ascu.js";import{e as op}from"./select-D6aEQ2Nd.js";import{u as Qc}from"./useInfiniteQuery-DxCcVpEy.js";import{a as Zc,u as ip}from"./use-connection-DKzOdGGz.js";import{c as lp,u as Fi}from"./use-mcp-client-CuBQePEu.js";import{u as ap}from"./use-virtual-mcp-78cXx0vL.js";import{b as cp,i as up,a as dp,S as fp}from"./constants-D_FQAPnt.js";import{C as hp}from"./card-CGyKyODi.js";import{o as eu,m as tu,p as Hi,q as Vi}from"./sidebar-ONo6fK60.js";import{c as nu,d as ru,a as Ks,e as Je,b as su,T as Ge}from"./table-GxF24ep_.js";import{E as Yo}from"./empty-state-D1i7YTnx.js";import{u as Wi}from"./use-infinite-scroll-CXFvo-N2.js";import{u as pp}from"./use-members-CFZT7Pcx.js";import{u as ou,S as Rn}from"./use-clock-tick-CRESYNg6.js";import{e as mp}from"./use-automations-BDvg1ajN.js";import{u as iu}from"./studio-tools-CfHMRgsU.js";import{u as gp}from"./useSuspenseInfiniteQuery-CO-EuP4r.js";import{A as lu}from"./avatar-ueCwEfND.js";import{t as Zr}from"./ChevronDown-DWvyGtmb.js";import{n as Qo}from"./ChevronUp-BHzgT0EG.js";import{t as xp,a as au,n as Ui}from"./Tool02-_z3O1aGg.js";import{e as yp,ao as bp,ap as kp,U as Sp,u as vp,aq as wp,$ as Cp,ae as Tp,j as Np,am as cu,ar as Mp,as as Ep,A as uu,at as ut,au as Ap}from"./agent-icon-BxLuMAgr.js";import{t as Js}from"./Stars01-Bgh6qQ-r.js";import{i as du,b as Or}from"./XCircle-DwxRLgWl.js";import{i as qi}from"./Check-ewaBC-Xf.js";import{i as sa}from"./ChevronRight-D0B422F4.js";import{a as fu}from"./Copy01-BUrLo-T8.js";import{b as Ht,t as Ki,c as oa}from"./format-time-BnbuEtat.js";import{u as hu}from"./use-copy-6r_b7eLi.js";import{T as fn,a as hn,b as pn}from"./tooltip-DpARBZYH.js";import{M as Ji,I as pu,F as jp}from"./file-type-icon-B6pkitt3.js";import{R as Ip,c as Op,r as Rp,g as Dp}from"./hooks-DhipJZPl.js";import{S as Pp,h as Wn,m as Lp,c as Gi,d as _p,b as $p}from"./chat-context-ORrqnOYE.js";import{c as zp}from"./monaco-editor-Cx9Kzv4m.js";import{g as mu,M as Bp}from"./index-B_bfMDNk.js";import{f as Fp,n as Hp,o as Vp}from"./tab-id-BijBBRwE.js";import{i as gu}from"./AlertCircle-6zWXlWWO.js";import{s as Wp}from"./Eye-B1rqgwn3.js";import{s as es,t as xu}from"./Star01-CGhoqrlg.js";import{s as Up}from"./XClose-DgejVw6e.js";import{n as Zo}from"./ZapSquare-OG-fiid8.js";import{n as yu,i as qp}from"./Globe01-DJ7RE_eO.js";import{c as Kp,b as Jp}from"./Tool01-DSDzjstu.js";import{i as ia,a as Gp}from"./ZoomOut-DHfhZNsb.js";import{i as nr}from"./Monitor01-osmutGlP.js";import{i as Xp}from"./SearchMd-C-4B4tGP.js";import{i as Yp}from"./Upload01-D3XDbLtc.js";import{u as Qp,a as Zp}from"./shell-layout-DtNvv7VT.js";import{a as Rr}from"./Image01-KZoeqBBJ.js";import{n as bu}from"./LinkExternal01-B3Xr63OW.js";import{I as qt}from"./integration-icon-CS_kTF8n.js";import{i as em}from"./ArrowUpRight-BDFzLPlp.js";import{a as Xi}from"./Users03-CM7aaEHp.js";import{a as dt}from"./Palette-Dun1_uhn.js";import{c as ku}from"./use-navigate-to-agent-Djoo2Imi.js";import{a as tm}from"./Stars02-B3PqPWGp.js";import{g as nm}from"./AreaChart-D3KK_s0U.js";import{a as rm,D as sm,c as om,d as im,e as lm}from"./dialog-CXU2DuDs.js";import{a as am,F as cm,b as um,c as dm,d as fm,f as hm}from"./form-BSlL1YES.js";import{I as pm}from"./input-BGzDddR2.js";import{i as mm}from"./UserPlus01-C3iEGwSH.js";const gm={openrouter:n=>{const e=n?.openrouter;return typeof e=="object"&&e!==null&&"usage"in e&&typeof e.usage=="object"&&e.usage!==null&&"cost"in e.usage&&typeof e.usage.cost=="number"?e.usage.cost:null}};function Su(n){if(!n?.providerMetadata)return 0;for(const e of Object.values(gm)){const t=e(n.providerMetadata);if(t!==null)return t}return 0}function vu(){return{inputTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,cost:0,cacheReadTokens:0,cacheWriteTokens:0}}function wu(n,e){if(!e)return n;const t=e.inputTokenDetails?.cacheReadTokens??e.cachedInputTokens??0,r=e.inputTokenDetails?.cacheWriteTokens??0;return{inputTokens:n.inputTokens+(e.inputTokens??0),outputTokens:n.outputTokens+(e.outputTokens??0),reasoningTokens:n.reasoningTokens+(e.reasoningTokens??0),totalTokens:n.totalTokens+(e.totalTokens??0),cost:n.cost+Su(e),cacheReadTokens:n.cacheReadTokens+t,cacheWriteTokens:n.cacheWriteTokens+r}}function KC(n){return n.reduce((e,t)=>wu(e,t.metadata?.usage),vu())}const xm={damping:.7,stiffness:.05,mass:1.25},ym=70,bm=1e3/60,km=350;let Gs=!1;globalThis.document?.addEventListener("mousedown",()=>{Gs=!0});globalThis.document?.addEventListener("mouseup",()=>{Gs=!1});globalThis.document?.addEventListener("click",()=>{Gs=!1});const Sm=(n={})=>{const[e,t]=E.useState(!1),[r,s]=E.useState(n.initial!==!1),[o,i]=E.useState(!1),l=E.useRef(null);l.current=n;const a=E.useCallback(()=>{if(!Gs)return!1;const b=window.getSelection();if(!b||!b.rangeCount)return!1;const k=b.getRangeAt(0);return k.commonAncestorContainer.contains(x.current)||x.current?.contains(k.commonAncestorContainer)},[]),c=E.useCallback(b=>{d.isAtBottom=b,s(b)},[]),u=E.useCallback(b=>{d.escapedFromLock=b,t(b)},[]),d=E.useMemo(()=>{let b;return{escapedFromLock:e,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return x.current?.scrollTop??0},set scrollTop(k){if(x.current){const{scrollBehavior:S}=getComputedStyle(x.current);S!=="auto"&&(x.current.style.scrollBehavior="auto"),x.current.scrollTop=k,d.ignoreScrollToTop=x.current.scrollTop,S!=="auto"&&(x.current.style.scrollBehavior=S)}},get targetScrollTop(){return!x.current||!y.current?0:x.current.scrollHeight-1-x.current.clientHeight},get calculatedTargetScrollTop(){if(!x.current||!y.current)return 0;const{targetScrollTop:k}=this;if(!n.targetScrollTop)return k;if(b?.targetScrollTop===k)return b.calculatedScrollTop;const S=Math.max(Math.min(n.targetScrollTop(k,{scrollElement:x.current,contentElement:y.current}),k),0);return b={targetScrollTop:k,calculatedScrollTop:S},requestAnimationFrame(()=>{b=void 0}),S},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=ym}}},[]),f=E.useCallback((b={})=>{typeof b=="string"&&(b={animation:b}),b.preserveScrollPosition||c(!0);const k=Date.now()+(Number(b.wait)||0),S=bo(l.current,b.animation),{ignoreEscapes:v=!1}=b;let w,C=d.calculatedTargetScrollTop;b.duration instanceof Promise?b.duration.finally(()=>{w=Date.now()}):w=k+(b.duration??0);const T=async()=>{const N=new Promise(requestAnimationFrame).then(()=>{if(!d.isAtBottom)return d.animation=void 0,!1;const{scrollTop:M}=d,j=performance.now(),R=(j-(d.lastTick??j))/bm;if(d.animation||(d.animation={behavior:S,promise:N,ignoreEscapes:v}),d.animation.behavior===S&&(d.lastTick=j),a()||k>Date.now())return T();if(M<Math.min(C,d.calculatedTargetScrollTop)){if(d.animation?.behavior===S){if(S==="instant")return d.scrollTop=d.calculatedTargetScrollTop,T();d.velocity=(S.damping*d.velocity+S.stiffness*d.scrollDifference)/S.mass,d.accumulated+=d.velocity*R,d.scrollTop+=d.accumulated,d.scrollTop!==M&&(d.accumulated=0)}return T()}return w>Date.now()?(C=d.calculatedTargetScrollTop,T()):(d.animation=void 0,d.scrollTop<d.calculatedTargetScrollTop?f({animation:bo(l.current,l.current.resize),ignoreEscapes:v,duration:Math.max(0,w-Date.now())||void 0}):d.isAtBottom)});return N.then(M=>(requestAnimationFrame(()=>{d.animation||(d.lastTick=void 0,d.velocity=0)}),M))};return b.wait!==!0&&(d.animation=void 0),d.animation?.behavior===S?d.animation.promise:T()},[c,a,d]),h=E.useCallback(()=>{u(!0),c(!1)},[u,c]),m=E.useCallback(({target:b})=>{if(b!==x.current)return;const{scrollTop:k,ignoreScrollToTop:S}=d;let{lastScrollTop:v=k}=d;d.lastScrollTop=k,d.ignoreScrollToTop=void 0,S&&S>k&&(v=S),i(d.isNearBottom),setTimeout(()=>{if(d.resizeDifference||k===S)return;if(a()){u(!0),c(!1);return}const w=k>v,C=k<v;if(d.animation?.ignoreEscapes){d.scrollTop=v;return}C&&(u(!0),c(!1)),w&&u(!1),!d.escapedFromLock&&d.isNearBottom&&c(!0)},1)},[u,c,a,d]),g=E.useCallback(({target:b,deltaY:k})=>{let S=b;for(;!["scroll","auto"].includes(getComputedStyle(S).overflow);){if(!S.parentElement)return;S=S.parentElement}S===x.current&&k<0&&x.current.scrollHeight>x.current.clientHeight&&!d.animation?.ignoreEscapes&&(u(!0),c(!1))},[u,c,d]),x=la(b=>{x.current?.removeEventListener("scroll",m),x.current?.removeEventListener("wheel",g),b?.addEventListener("scroll",m,{passive:!0}),b?.addEventListener("wheel",g,{passive:!0})},[]),y=la(b=>{if(d.resizeObserver?.disconnect(),d.resizeObserver=void 0,!b)return;let k;d.resizeObserver=new ResizeObserver(([S])=>{const{height:v}=S.contentRect,w=v-(k??v);if(d.resizeDifference=w,d.scrollTop>d.targetScrollTop&&(d.scrollTop=d.targetScrollTop),i(d.isNearBottom),w>=0){const C=bo(l.current,k?l.current.resize:l.current.initial);f({animation:C,wait:!0,preserveScrollPosition:!0,duration:C==="instant"?void 0:km})}else d.isNearBottom&&(u(!1),c(!0));k=v,requestAnimationFrame(()=>{setTimeout(()=>{d.resizeDifference===w&&(d.resizeDifference=0)},1)})}),d.resizeObserver?.observe(b)},[]);return{contentRef:y,scrollRef:x,scrollToBottom:f,stopScroll:h,isAtBottom:r||o,isNearBottom:o,escapedFromLock:e,state:d}};function la(n,e){const t=E.useCallback(r=>(t.current=r,n(r)),e);return t}const yo=new Map;function bo(...n){const e={...xm};let t=!1;for(const s of n){if(s==="instant"){t=!0;continue}typeof s=="object"&&(t=!1,e.damping=s.damping??e.damping,e.stiffness=s.stiffness??e.stiffness,e.mass=s.mass??e.mass)}const r=JSON.stringify(e);return yo.has(r)||yo.set(r,Object.freeze(e)),t?"instant":yo.get(r)}function vm(n){return n.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function Yi(n){if(n&&typeof n=="object"&&"gatewayClientId"in n&&typeof n.gatewayClientId=="string")return n.gatewayClientId}function Qi(n,e){if(!e)return n;const t=`${vm(e)}_`;return n.startsWith(t)?n.slice(t.length):n}function wm(n,e){return Qi(n,e).replace(/[_-]/g," ").toLowerCase()}function Cm(n){const e={};for(const t of n?.arguments??[])e[t.name]=t.required?ra().min(1,"Required"):ra();return Jh(e)}function Tm(n,e){const t={};for(const r of n.arguments??[])t[r.name]=e?.[r.name]??"";return t}function Nm(n){const e=_.c(67),{prompt:t,setPrompt:r,onSubmit:s,defaultValues:o}=n,i=E.useId();let l,a;if(e[0]!==t){const L=Cm(t);a=Gh,l=Kh(L),e[0]=t,e[1]=l,e[2]=a}else l=e[1],a=e[2];let c;e[3]!==o||e[4]!==t?(c=t?Tm(t,o):{},e[3]=o,e[4]=t,e[5]=c):c=e[5];let u;e[6]!==l||e[7]!==c?(u={resolver:l,defaultValues:c,mode:"onChange"},e[6]=l,e[7]=c,e[8]=u):u=e[8];const d=a(u);let f;e[9]!==t?.arguments?(f=t?.arguments??[],e[9]=t?.arguments,e[10]=f):f=e[10];const h=f;let m;e[11]!==d||e[12]!==s||e[13]!==r?(m=async L=>{await s(L),r(null),d.reset()},e[11]=d,e[12]=s,e[13]=r,e[14]=m):m=e[14];const g=m;let x;e[15]!==d||e[16]!==r?(x=L=>{L||(d.reset(),r(null))},e[15]=d,e[16]=r,e[17]=x):x=e[17];const y=x;if(!t)return null;let b;e[18]!==t._meta||e[19]!==t.name||e[20]!==t.title?(b=t.title||wm(t.name,Yi(t._meta)),e[18]=t._meta,e[19]=t.name,e[20]=t.title,e[21]=b):b=e[21];let k;e[22]!==b?(k=p.jsx(rm,{children:p.jsx("span",{className:"capitalize",children:b})}),e[22]=b,e[23]=k):k=e[23];let S;e[24]!==t.description?(S=t.description&&p.jsx("p",{className:"text-sm text-muted-foreground",children:t.description}),e[24]=t.description,e[25]=S):S=e[25];let v;e[26]!==S||e[27]!==k?(v=p.jsxs(sm,{children:[k,S]}),e[26]=S,e[27]=k,e[28]=v):v=e[28];let w;e[29]!==d||e[30]!==g?(w=L=>{L.stopPropagation(),d.handleSubmit(g)(L)},e[29]=d,e[30]=g,e[31]=w):w=e[31];let C;if(e[32]!==h||e[33]!==d.control||e[34]!==d.formState.isSubmitting){let L;e[36]!==d.control||e[37]!==d.formState.isSubmitting?(L=z=>p.jsx(cm,{control:d.control,name:z.name,render:F=>{const{field:U}=F;return p.jsxs(um,{children:[p.jsxs(dm,{className:"text-xs",children:[z.name,z.required?null:p.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ","(optional)"]})]}),p.jsx(fm,{children:p.jsx(pm,{...U,value:U.value??"",required:z.required,placeholder:z.description??"",className:"h-9",disabled:d.formState.isSubmitting})}),p.jsx(hm,{})]})}},z.name),e[36]=d.control,e[37]=d.formState.isSubmitting,e[38]=L):L=e[38],C=h.map(L),e[32]=h,e[33]=d.control,e[34]=d.formState.isSubmitting,e[35]=C}else C=e[35];let T;e[39]!==y?(T=()=>y(!1),e[39]=y,e[40]=T):T=e[40];let N;e[41]!==d.formState.isSubmitting||e[42]!==T?(N=p.jsx(un,{type:"button",variant:"ghost",onClick:T,disabled:d.formState.isSubmitting,children:"Cancel"}),e[41]=d.formState.isSubmitting,e[42]=T,e[43]=N):N=e[43];let M;e[44]!==d.formState.isSubmitting?(M=d.formState.isSubmitting?p.jsxs("span",{className:"flex items-center gap-2",children:[p.jsx(Pp,{size:"xs"}),"Loading..."]}):"Use prompt",e[44]=d.formState.isSubmitting,e[45]=M):M=e[45];let j;e[46]!==d.formState.isSubmitting||e[47]!==i||e[48]!==M?(j=p.jsx(un,{type:"submit",form:i,disabled:d.formState.isSubmitting,children:M}),e[46]=d.formState.isSubmitting,e[47]=i,e[48]=M,e[49]=j):j=e[49];let R;e[50]!==N||e[51]!==j?(R=p.jsxs(om,{children:[N,j]}),e[50]=N,e[51]=j,e[52]=R):R=e[52];let A;e[53]!==i||e[54]!==w||e[55]!==C||e[56]!==R?(A=p.jsxs("form",{id:i,className:"space-y-4 py-4",autoComplete:"off",onSubmit:w,children:[C,R]}),e[53]=i,e[54]=w,e[55]=C,e[56]=R,e[57]=A):A=e[57];let D;e[58]!==d||e[59]!==A?(D=p.jsx(am,{...d,children:A}),e[58]=d,e[59]=A,e[60]=D):D=e[60];let I;e[61]!==v||e[62]!==D?(I=p.jsxs(im,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[v,D]}),e[61]=v,e[62]=D,e[63]=I):I=e[63];let $;return e[64]!==y||e[65]!==I?($=p.jsx(lm,{open:!0,onOpenChange:y,children:I}),e[64]=y,e[65]=I,e[66]=$):$=e[66],$}function Cu(n){return n?n.replace(/[_-]/g," ").toLowerCase().split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "):""}function ot(n,e){return n==="output-error"||n==="output-denied"?"error":n==="approval-requested"?"approval":n==="input-streaming"||n==="input-available"||n==="output-available"&&e===!0?"loading":"idle"}function Un(n){if(n==null||typeof n!="object")return;const e=n;if(e.structuredContent&&typeof e.structuredContent=="object")return e.structuredContent;if(Array.isArray(e.content)){const t=e.content[0];if(t?.type==="text"&&typeof t.text=="string")try{return JSON.parse(t.text)}catch{return}return}return n}function Ne(n){this.content=n}Ne.prototype={constructor:Ne,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,s=r.find(n),o=r.content.slice();return s==-1?o.push(t||n,e):(o[s+1]=e,t&&(o[s]=t)),new Ne(o)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Ne(t)},addToStart:function(n,e){return new Ne([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new Ne(t)},addBefore:function(n,e,t){var r=this.remove(e),s=r.content.slice(),o=r.find(n);return s.splice(o==-1?s.length:o,0,e,t),new Ne(s)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=Ne.from(n),n.size?new Ne(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=Ne.from(n),n.size?new Ne(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=Ne.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};Ne.from=function(n){if(n instanceof Ne)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Ne(e)};function Tu(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let s=n.child(r),o=e.child(r);if(s==o){t+=s.nodeSize;continue}if(!s.sameMarkup(o))return t;if(s.isText&&s.text!=o.text){for(let i=0;s.text[i]==o.text[i];i++)t++;return t}if(s.content.size||o.content.size){let i=Tu(s.content,o.content,t+1);if(i!=null)return i}t+=s.nodeSize}}function Nu(n,e,t,r){for(let s=n.childCount,o=e.childCount;;){if(s==0||o==0)return s==o?null:{a:t,b:r};let i=n.child(--s),l=e.child(--o),a=i.nodeSize;if(i==l){t-=a,r-=a;continue}if(!i.sameMarkup(l))return{a:t,b:r};if(i.isText&&i.text!=l.text){let c=0,u=Math.min(i.text.length,l.text.length);for(;c<u&&i.text[i.text.length-c-1]==l.text[l.text.length-c-1];)c++,t--,r--;return{a:t,b:r}}if(i.content.size||l.content.size){let c=Nu(i.content,l.content,t-1,r-1);if(c)return c}t-=a,r-=a}}class O{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,s=0,o){for(let i=0,l=0;l<t;i++){let a=this.content[i],c=l+a.nodeSize;if(c>e&&r(a,s+l,o||null,i)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,s+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,s){let o="",i=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(i?i=!1:o+=r),o+=c},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,s=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(s[s.length-1]=t.withText(t.text+r.text),o=1);o<e.content.length;o++)s.push(e.content[o]);return new O(s,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],s=0;if(t>e)for(let o=0,i=0;i<t;o++){let l=this.content[o],a=i+l.nodeSize;a>e&&((i<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-i),Math.min(l.text.length,t-i)):l=l.cut(Math.max(0,e-i-1),Math.min(l.content.size,t-i-1))),r.push(l),s+=l.nodeSize),i=a}return new O(r,s)}cutByIndex(e,t){return e==t?O.empty:e==0&&t==this.content.length?this:new O(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let s=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return s[e]=t,new O(s,o)}addToStart(e){return new O([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new O(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let s=this.content[t];e(s,r,t),r+=s.nodeSize}}findDiffStart(e,t=0){return Tu(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Nu(this,e,t,r)}findIndex(e){if(e==0)return Dr(0,e);if(e==this.size)return Dr(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let s=this.child(t),o=r+s.nodeSize;if(o>=e)return o==e?Dr(t+1,o):Dr(t,r);r=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return O.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new O(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return O.empty;let t,r=0;for(let s=0;s<e.length;s++){let o=e[s];r+=o.nodeSize,s&&o.isText&&e[s-1].sameMarkup(o)?(t||(t=e.slice(0,s)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new O(t||e,r)}static from(e){if(!e)return O.empty;if(e instanceof O)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new O([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}O.empty=new O([],0);const ko={index:0,offset:0};function Dr(n,e){return ko.index=n,ko.offset=e,ko}function ts(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!ts(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!ts(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let le=class ei{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let s=0;s<e.length;s++){let o=e[s];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,s));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,s)),t.push(this),r=!0),t&&t.push(o)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&ts(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let s=r.create(t.attrs);return r.checkAttrs(s.attrs),s}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return ei.none;if(e instanceof ei)return[e];let t=e.slice();return t.sort((r,s)=>r.type.rank-s.type.rank),t}};le.none=[];class ns extends Error{}class B{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=Eu(this.content,e+this.openStart,t);return r&&new B(r,this.openStart,this.openEnd)}removeBetween(e,t){return new B(Mu(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return B.empty;let r=t.openStart||0,s=t.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new B(O.fromJSON(e,t.content),r,s)}static maxOpen(e,t=!0){let r=0,s=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)s++;return new B(e,r,s)}}B.empty=new B(O.empty,0,0);function Mu(n,e,t){let{index:r,offset:s}=n.findIndex(e),o=n.maybeChild(r),{index:i,offset:l}=n.findIndex(t);if(s==e||o.isText){if(l!=t&&!n.child(i).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=i)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(Mu(o.content,e-s-1,t-s-1)))}function Eu(n,e,t,r){let{index:s,offset:o}=n.findIndex(e),i=n.maybeChild(s);if(o==e||i.isText)return r&&!r.canReplace(s,s,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=Eu(i.content,e-o-1,t,i);return l&&n.replaceChild(s,i.copy(l))}function Mm(n,e,t){if(t.openStart>n.depth)throw new ns("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new ns("Inconsistent open depths");return Au(n,e,t,0)}function Au(n,e,t,r){let s=n.index(r),o=n.node(r);if(s==e.index(r)&&r<n.depth-t.openStart){let i=Au(n,e,t,r+1);return o.copy(o.content.replaceChild(s,i))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let i=n.parent,l=i.content;return on(i,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:i,end:l}=Em(t,n);return on(o,Iu(n,i,l,e,r))}else return on(o,rs(n,e,r))}function ju(n,e){if(!e.type.compatibleContent(n.type))throw new ns("Cannot join "+e.type.name+" onto "+n.type.name)}function ti(n,e,t){let r=n.node(t);return ju(r,e.node(t)),r}function sn(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function rr(n,e,t,r){let s=(e||n).node(t),o=0,i=e?e.index(t):s.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(sn(n.nodeAfter,r),o++));for(let l=o;l<i;l++)sn(s.child(l),r);e&&e.depth==t&&e.textOffset&&sn(e.nodeBefore,r)}function on(n,e){return n.type.checkContent(e),n.copy(e)}function Iu(n,e,t,r,s){let o=n.depth>s&&ti(n,e,s+1),i=r.depth>s&&ti(t,r,s+1),l=[];return rr(null,n,s,l),o&&i&&e.index(s)==t.index(s)?(ju(o,i),sn(on(o,Iu(n,e,t,r,s+1)),l)):(o&&sn(on(o,rs(n,e,s+1)),l),rr(e,t,s,l),i&&sn(on(i,rs(t,r,s+1)),l)),rr(r,null,s,l),new O(l)}function rs(n,e,t){let r=[];if(rr(null,n,t,r),n.depth>t){let s=ti(n,e,t+1);sn(on(s,rs(n,e,t+1)),r)}return rr(e,null,t,r),new O(r)}function Em(n,e){let t=e.depth-n.openStart,s=e.node(t).copy(n.content);for(let o=t-1;o>=0;o--)s=e.node(o).copy(O.from(s));return{start:s.resolveNoCache(n.openStart+t),end:s.resolveNoCache(s.content.size-n.openEnd-t)}}class pr{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(t);return r?e.child(t).cut(r):s}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],s=t==0?0:this.path[t*3-1]+1;for(let o=0;o<e;o++)s+=r.child(o).nodeSize;return s}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return le.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),s=e.maybeChild(t);if(!r){let l=r;r=s,s=l}let o=r.marks;for(var i=0;i<o.length;i++)o[i].type.spec.inclusive===!1&&(!s||!o[i].isInSet(s.marks))&&(o=o[i--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,s=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!s||!r[o].isInSet(s.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new ss(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],s=0,o=t;for(let i=e;;){let{index:l,offset:a}=i.content.findIndex(o),c=o-a;if(r.push(i,l,s+a),!c||(i=i.child(l),i.isText))break;o=c-1,s+=a+1}return new pr(t,r,o)}static resolveCached(e,t){let r=aa.get(e);if(r)for(let o=0;o<r.elts.length;o++){let i=r.elts[o];if(i.pos==t)return i}else aa.set(e,r=new Am);let s=r.elts[r.i]=pr.resolve(e,t);return r.i=(r.i+1)%jm,s}}class Am{constructor(){this.elts=[],this.i=0}}const jm=12,aa=new WeakMap;class ss{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Im=Object.create(null);class st{constructor(e,t,r,s=le.none){this.type=e,this.attrs=t,this.marks=s,this.content=r||O.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,s=0){this.content.nodesBetween(e,t,r,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,s){return this.content.textBetween(e,t,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&ts(this.attrs,t||e.defaultAttrs||Im)&&le.sameSet(this.marks,r||le.none)}copy(e=null){return e==this.content?this:new st(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new st(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return B.empty;let s=this.resolve(e),o=this.resolve(t),i=r?0:s.sharedDepth(t),l=s.start(i),c=s.node(i).content.cut(s.pos-l,o.pos-l);return new B(c,s.depth-i,o.depth-i)}replace(e,t,r){return Mm(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:s}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(s==e||t.isText)return t;e-=s+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let s=this.content.child(t-1);return{node:s,index:t-1,offset:r-s.nodeSize}}resolve(e){return pr.resolveCached(this,e)}resolveNoCache(e){return pr.resolve(this,e)}rangeHasMark(e,t,r){let s=!1;return t>e&&this.nodesBetween(e,t,o=>(r.isInSet(o.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Ou(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=O.empty,s=0,o=r.childCount){let i=this.contentMatchAt(e).matchFragment(r,s,o),l=i&&i.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=s;a<o;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,t,r,s){if(s&&!this.type.allowsMarks(s))return!1;let o=this.contentMatchAt(e).matchType(r),i=o&&o.matchFragment(this.content,t);return i?i.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=le.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!le.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let s=O.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,s,r);return o.type.checkAttrs(o.attrs),o}}st.prototype.text=void 0;class is extends st{constructor(e,t,r,s){if(super(e,t,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Ou(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new is(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new is(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Ou(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class mn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Om(e,t);if(r.next==null)return mn.empty;let s=Ru(r);r.next&&r.err("Unexpected trailing text");let o=zm($m(s));return Bm(o,r),o}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let s=this;for(let o=t;s&&o<r;o++)s=s.matchType(e.child(o).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let s=[this];function o(i,l){let a=i.matchFragment(e,r);if(a&&(!t||a.validEnd))return O.from(l.map(c=>c.createAndFill()));for(let c=0;c<i.next.length;c++){let{type:u,next:d}=i.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(d)==-1){s.push(d);let f=o(d,l.concat(u));if(f)return f}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),o=s.match;if(o.matchType(e)){let i=[];for(let l=s;l.type;l=l.via)i.push(l.type);return i.reverse()}for(let i=0;i<o.next.length;i++){let{type:l,next:a}=o.next[i];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!s.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:s}),t[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&t(r.next[s].next)}return t(this),e.map((r,s)=>{let o=s+(r.validEnd?"*":" ")+" ";for(let i=0;i<r.next.length;i++)o+=(i?", ":"")+r.next[i].type.name+"->"+e.indexOf(r.next[i].next);return o}).join(`
|
|
1
|
+
import{r as E,c as _,J as Kh,j as p,B as un,I as ra,H as Jh,M as Gh,bJ as Kc,bK as Xh,at as Yh,aM as dn,bL as Qh,l as ee,p as Zh,aR as ep,aO as Ut,aV as tp,aU as _t,ba as Nr,aS as kn,bM as Jc,aQ as Gc,C as Ct,n as np,d as rp,K as Qe,t as Xo,m as Mr,b as Vn,E as Xc,aL as Yc,bN as Bi,aT as sp,bO as Qt}from"./index-BUWOf6-H.js";import{e as op}from"./select-BVg_AKhS.js";import{u as Qc}from"./useInfiniteQuery-C6UXsGIP.js";import{a as Zc,u as ip}from"./use-connection-CD2Fnptb.js";import{c as lp,u as Fi}from"./use-mcp-client-qnk43eG1.js";import{u as ap}from"./use-virtual-mcp-BJxeG1T-.js";import{b as cp,i as up,a as dp,S as fp}from"./constants-D_FQAPnt.js";import{C as hp}from"./card-DmJEBNvh.js";import{o as eu,m as tu,p as Hi,q as Vi}from"./sidebar-Bg21lFNS.js";import{c as nu,d as ru,a as Ks,e as Je,b as su,T as Ge}from"./table-kChvW90I.js";import{E as Yo}from"./empty-state-jjn-bhGa.js";import{u as Wi}from"./use-infinite-scroll-DiSaAQPl.js";import{u as pp}from"./use-members-Dey3M7mC.js";import{u as ou,S as Rn}from"./use-clock-tick-BJ7X5vRI.js";import{e as mp}from"./use-automations-ljR2TnPA.js";import{u as iu}from"./studio-tools-JGMjsS9V.js";import{u as gp}from"./useSuspenseInfiniteQuery-Cn5B2KcA.js";import{A as lu}from"./avatar-6ZpKSJQ1.js";import{t as Zr}from"./ChevronDown-DorDM-K-.js";import{n as Qo}from"./ChevronUp-C85SxyPM.js";import{t as xp,a as au,n as Ui}from"./Tool02-B5mtXP4w.js";import{e as yp,ao as bp,ap as kp,U as Sp,u as vp,aq as wp,$ as Cp,ae as Tp,j as Np,am as cu,ar as Mp,as as Ep,A as uu,at as ut,au as Ap}from"./agent-icon-DCK7PpQ3.js";import{t as Js}from"./Stars01-Ce7N7beA.js";import{i as du,b as Or}from"./XCircle-DY5ehXOb.js";import{i as qi}from"./Check-ylcp47jh.js";import{i as sa}from"./ChevronRight-NJ1RHqa7.js";import{a as fu}from"./Copy01-C5M0y3sD.js";import{b as Ht,t as Ki,c as oa}from"./format-time-BnbuEtat.js";import{u as hu}from"./use-copy-BhzNp8tf.js";import{T as fn,a as hn,b as pn}from"./tooltip-cXMPTvhQ.js";import{M as Ji,I as pu,F as jp}from"./file-type-icon-cPIVgg9x.js";import{R as Ip,c as Op,r as Rp,g as Dp}from"./hooks-B5swj9vo.js";import{S as Pp,h as Wn,m as Lp,c as Gi,d as _p,b as $p}from"./chat-context-DeX0VT17.js";import{c as zp}from"./monaco-editor-45RX9-wa.js";import{g as mu,M as Bp}from"./index-Dliz359x.js";import{f as Fp,n as Hp,o as Vp}from"./tab-id-BijBBRwE.js";import{i as gu}from"./AlertCircle-BVlB73Gd.js";import{s as Wp}from"./Eye-ByzbJOuX.js";import{s as es,t as xu}from"./Star01-CdWOUCGL.js";import{s as Up}from"./XClose-IT2oT79e.js";import{n as Zo}from"./ZapSquare-CIT8HcpR.js";import{n as yu,i as qp}from"./Globe01-DwjnaG3m.js";import{c as Kp,b as Jp}from"./Tool01-CQ5Yi4Y5.js";import{i as ia,a as Gp}from"./ZoomOut-DoDMe5dD.js";import{i as nr}from"./Monitor01-DGMiqS2G.js";import{i as Xp}from"./SearchMd-DhGVvJ2r.js";import{i as Yp}from"./Upload01-BGaIkl8C.js";import{u as Qp,a as Zp}from"./shell-layout-BDvpeGAX.js";import{a as Rr}from"./Image01-DID7YK1H.js";import{n as bu}from"./LinkExternal01-CJELREUW.js";import{I as qt}from"./integration-icon-IezBYdjm.js";import{i as em}from"./ArrowUpRight-COlnzfbE.js";import{a as Xi}from"./Users03-DQHSM-ip.js";import{a as dt}from"./Palette-CjpYx7Ii.js";import{c as ku}from"./use-navigate-to-agent-7gJqLFkE.js";import{a as tm}from"./Stars02-Brbdnmc2.js";import{g as nm}from"./AreaChart-C1SgmDdh.js";import{a as rm,D as sm,c as om,d as im,e as lm}from"./dialog-C6_0qLBU.js";import{a as am,F as cm,b as um,c as dm,d as fm,f as hm}from"./form-BLqlEubb.js";import{I as pm}from"./input-C2XNQcRH.js";import{i as mm}from"./UserPlus01-ByXfLuOW.js";const gm={openrouter:n=>{const e=n?.openrouter;return typeof e=="object"&&e!==null&&"usage"in e&&typeof e.usage=="object"&&e.usage!==null&&"cost"in e.usage&&typeof e.usage.cost=="number"?e.usage.cost:null}};function Su(n){if(!n?.providerMetadata)return 0;for(const e of Object.values(gm)){const t=e(n.providerMetadata);if(t!==null)return t}return 0}function vu(){return{inputTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,cost:0,cacheReadTokens:0,cacheWriteTokens:0}}function wu(n,e){if(!e)return n;const t=e.inputTokenDetails?.cacheReadTokens??e.cachedInputTokens??0,r=e.inputTokenDetails?.cacheWriteTokens??0;return{inputTokens:n.inputTokens+(e.inputTokens??0),outputTokens:n.outputTokens+(e.outputTokens??0),reasoningTokens:n.reasoningTokens+(e.reasoningTokens??0),totalTokens:n.totalTokens+(e.totalTokens??0),cost:n.cost+Su(e),cacheReadTokens:n.cacheReadTokens+t,cacheWriteTokens:n.cacheWriteTokens+r}}function KC(n){return n.reduce((e,t)=>wu(e,t.metadata?.usage),vu())}const xm={damping:.7,stiffness:.05,mass:1.25},ym=70,bm=1e3/60,km=350;let Gs=!1;globalThis.document?.addEventListener("mousedown",()=>{Gs=!0});globalThis.document?.addEventListener("mouseup",()=>{Gs=!1});globalThis.document?.addEventListener("click",()=>{Gs=!1});const Sm=(n={})=>{const[e,t]=E.useState(!1),[r,s]=E.useState(n.initial!==!1),[o,i]=E.useState(!1),l=E.useRef(null);l.current=n;const a=E.useCallback(()=>{if(!Gs)return!1;const b=window.getSelection();if(!b||!b.rangeCount)return!1;const k=b.getRangeAt(0);return k.commonAncestorContainer.contains(x.current)||x.current?.contains(k.commonAncestorContainer)},[]),c=E.useCallback(b=>{d.isAtBottom=b,s(b)},[]),u=E.useCallback(b=>{d.escapedFromLock=b,t(b)},[]),d=E.useMemo(()=>{let b;return{escapedFromLock:e,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return x.current?.scrollTop??0},set scrollTop(k){if(x.current){const{scrollBehavior:S}=getComputedStyle(x.current);S!=="auto"&&(x.current.style.scrollBehavior="auto"),x.current.scrollTop=k,d.ignoreScrollToTop=x.current.scrollTop,S!=="auto"&&(x.current.style.scrollBehavior=S)}},get targetScrollTop(){return!x.current||!y.current?0:x.current.scrollHeight-1-x.current.clientHeight},get calculatedTargetScrollTop(){if(!x.current||!y.current)return 0;const{targetScrollTop:k}=this;if(!n.targetScrollTop)return k;if(b?.targetScrollTop===k)return b.calculatedScrollTop;const S=Math.max(Math.min(n.targetScrollTop(k,{scrollElement:x.current,contentElement:y.current}),k),0);return b={targetScrollTop:k,calculatedScrollTop:S},requestAnimationFrame(()=>{b=void 0}),S},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=ym}}},[]),f=E.useCallback((b={})=>{typeof b=="string"&&(b={animation:b}),b.preserveScrollPosition||c(!0);const k=Date.now()+(Number(b.wait)||0),S=bo(l.current,b.animation),{ignoreEscapes:v=!1}=b;let w,C=d.calculatedTargetScrollTop;b.duration instanceof Promise?b.duration.finally(()=>{w=Date.now()}):w=k+(b.duration??0);const T=async()=>{const N=new Promise(requestAnimationFrame).then(()=>{if(!d.isAtBottom)return d.animation=void 0,!1;const{scrollTop:M}=d,j=performance.now(),R=(j-(d.lastTick??j))/bm;if(d.animation||(d.animation={behavior:S,promise:N,ignoreEscapes:v}),d.animation.behavior===S&&(d.lastTick=j),a()||k>Date.now())return T();if(M<Math.min(C,d.calculatedTargetScrollTop)){if(d.animation?.behavior===S){if(S==="instant")return d.scrollTop=d.calculatedTargetScrollTop,T();d.velocity=(S.damping*d.velocity+S.stiffness*d.scrollDifference)/S.mass,d.accumulated+=d.velocity*R,d.scrollTop+=d.accumulated,d.scrollTop!==M&&(d.accumulated=0)}return T()}return w>Date.now()?(C=d.calculatedTargetScrollTop,T()):(d.animation=void 0,d.scrollTop<d.calculatedTargetScrollTop?f({animation:bo(l.current,l.current.resize),ignoreEscapes:v,duration:Math.max(0,w-Date.now())||void 0}):d.isAtBottom)});return N.then(M=>(requestAnimationFrame(()=>{d.animation||(d.lastTick=void 0,d.velocity=0)}),M))};return b.wait!==!0&&(d.animation=void 0),d.animation?.behavior===S?d.animation.promise:T()},[c,a,d]),h=E.useCallback(()=>{u(!0),c(!1)},[u,c]),m=E.useCallback(({target:b})=>{if(b!==x.current)return;const{scrollTop:k,ignoreScrollToTop:S}=d;let{lastScrollTop:v=k}=d;d.lastScrollTop=k,d.ignoreScrollToTop=void 0,S&&S>k&&(v=S),i(d.isNearBottom),setTimeout(()=>{if(d.resizeDifference||k===S)return;if(a()){u(!0),c(!1);return}const w=k>v,C=k<v;if(d.animation?.ignoreEscapes){d.scrollTop=v;return}C&&(u(!0),c(!1)),w&&u(!1),!d.escapedFromLock&&d.isNearBottom&&c(!0)},1)},[u,c,a,d]),g=E.useCallback(({target:b,deltaY:k})=>{let S=b;for(;!["scroll","auto"].includes(getComputedStyle(S).overflow);){if(!S.parentElement)return;S=S.parentElement}S===x.current&&k<0&&x.current.scrollHeight>x.current.clientHeight&&!d.animation?.ignoreEscapes&&(u(!0),c(!1))},[u,c,d]),x=la(b=>{x.current?.removeEventListener("scroll",m),x.current?.removeEventListener("wheel",g),b?.addEventListener("scroll",m,{passive:!0}),b?.addEventListener("wheel",g,{passive:!0})},[]),y=la(b=>{if(d.resizeObserver?.disconnect(),d.resizeObserver=void 0,!b)return;let k;d.resizeObserver=new ResizeObserver(([S])=>{const{height:v}=S.contentRect,w=v-(k??v);if(d.resizeDifference=w,d.scrollTop>d.targetScrollTop&&(d.scrollTop=d.targetScrollTop),i(d.isNearBottom),w>=0){const C=bo(l.current,k?l.current.resize:l.current.initial);f({animation:C,wait:!0,preserveScrollPosition:!0,duration:C==="instant"?void 0:km})}else d.isNearBottom&&(u(!1),c(!0));k=v,requestAnimationFrame(()=>{setTimeout(()=>{d.resizeDifference===w&&(d.resizeDifference=0)},1)})}),d.resizeObserver?.observe(b)},[]);return{contentRef:y,scrollRef:x,scrollToBottom:f,stopScroll:h,isAtBottom:r||o,isNearBottom:o,escapedFromLock:e,state:d}};function la(n,e){const t=E.useCallback(r=>(t.current=r,n(r)),e);return t}const yo=new Map;function bo(...n){const e={...xm};let t=!1;for(const s of n){if(s==="instant"){t=!0;continue}typeof s=="object"&&(t=!1,e.damping=s.damping??e.damping,e.stiffness=s.stiffness??e.stiffness,e.mass=s.mass??e.mass)}const r=JSON.stringify(e);return yo.has(r)||yo.set(r,Object.freeze(e)),t?"instant":yo.get(r)}function vm(n){return n.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function Yi(n){if(n&&typeof n=="object"&&"gatewayClientId"in n&&typeof n.gatewayClientId=="string")return n.gatewayClientId}function Qi(n,e){if(!e)return n;const t=`${vm(e)}_`;return n.startsWith(t)?n.slice(t.length):n}function wm(n,e){return Qi(n,e).replace(/[_-]/g," ").toLowerCase()}function Cm(n){const e={};for(const t of n?.arguments??[])e[t.name]=t.required?ra().min(1,"Required"):ra();return Jh(e)}function Tm(n,e){const t={};for(const r of n.arguments??[])t[r.name]=e?.[r.name]??"";return t}function Nm(n){const e=_.c(67),{prompt:t,setPrompt:r,onSubmit:s,defaultValues:o}=n,i=E.useId();let l,a;if(e[0]!==t){const L=Cm(t);a=Gh,l=Kh(L),e[0]=t,e[1]=l,e[2]=a}else l=e[1],a=e[2];let c;e[3]!==o||e[4]!==t?(c=t?Tm(t,o):{},e[3]=o,e[4]=t,e[5]=c):c=e[5];let u;e[6]!==l||e[7]!==c?(u={resolver:l,defaultValues:c,mode:"onChange"},e[6]=l,e[7]=c,e[8]=u):u=e[8];const d=a(u);let f;e[9]!==t?.arguments?(f=t?.arguments??[],e[9]=t?.arguments,e[10]=f):f=e[10];const h=f;let m;e[11]!==d||e[12]!==s||e[13]!==r?(m=async L=>{await s(L),r(null),d.reset()},e[11]=d,e[12]=s,e[13]=r,e[14]=m):m=e[14];const g=m;let x;e[15]!==d||e[16]!==r?(x=L=>{L||(d.reset(),r(null))},e[15]=d,e[16]=r,e[17]=x):x=e[17];const y=x;if(!t)return null;let b;e[18]!==t._meta||e[19]!==t.name||e[20]!==t.title?(b=t.title||wm(t.name,Yi(t._meta)),e[18]=t._meta,e[19]=t.name,e[20]=t.title,e[21]=b):b=e[21];let k;e[22]!==b?(k=p.jsx(rm,{children:p.jsx("span",{className:"capitalize",children:b})}),e[22]=b,e[23]=k):k=e[23];let S;e[24]!==t.description?(S=t.description&&p.jsx("p",{className:"text-sm text-muted-foreground",children:t.description}),e[24]=t.description,e[25]=S):S=e[25];let v;e[26]!==S||e[27]!==k?(v=p.jsxs(sm,{children:[k,S]}),e[26]=S,e[27]=k,e[28]=v):v=e[28];let w;e[29]!==d||e[30]!==g?(w=L=>{L.stopPropagation(),d.handleSubmit(g)(L)},e[29]=d,e[30]=g,e[31]=w):w=e[31];let C;if(e[32]!==h||e[33]!==d.control||e[34]!==d.formState.isSubmitting){let L;e[36]!==d.control||e[37]!==d.formState.isSubmitting?(L=z=>p.jsx(cm,{control:d.control,name:z.name,render:F=>{const{field:U}=F;return p.jsxs(um,{children:[p.jsxs(dm,{className:"text-xs",children:[z.name,z.required?null:p.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ","(optional)"]})]}),p.jsx(fm,{children:p.jsx(pm,{...U,value:U.value??"",required:z.required,placeholder:z.description??"",className:"h-9",disabled:d.formState.isSubmitting})}),p.jsx(hm,{})]})}},z.name),e[36]=d.control,e[37]=d.formState.isSubmitting,e[38]=L):L=e[38],C=h.map(L),e[32]=h,e[33]=d.control,e[34]=d.formState.isSubmitting,e[35]=C}else C=e[35];let T;e[39]!==y?(T=()=>y(!1),e[39]=y,e[40]=T):T=e[40];let N;e[41]!==d.formState.isSubmitting||e[42]!==T?(N=p.jsx(un,{type:"button",variant:"ghost",onClick:T,disabled:d.formState.isSubmitting,children:"Cancel"}),e[41]=d.formState.isSubmitting,e[42]=T,e[43]=N):N=e[43];let M;e[44]!==d.formState.isSubmitting?(M=d.formState.isSubmitting?p.jsxs("span",{className:"flex items-center gap-2",children:[p.jsx(Pp,{size:"xs"}),"Loading..."]}):"Use prompt",e[44]=d.formState.isSubmitting,e[45]=M):M=e[45];let j;e[46]!==d.formState.isSubmitting||e[47]!==i||e[48]!==M?(j=p.jsx(un,{type:"submit",form:i,disabled:d.formState.isSubmitting,children:M}),e[46]=d.formState.isSubmitting,e[47]=i,e[48]=M,e[49]=j):j=e[49];let R;e[50]!==N||e[51]!==j?(R=p.jsxs(om,{children:[N,j]}),e[50]=N,e[51]=j,e[52]=R):R=e[52];let A;e[53]!==i||e[54]!==w||e[55]!==C||e[56]!==R?(A=p.jsxs("form",{id:i,className:"space-y-4 py-4",autoComplete:"off",onSubmit:w,children:[C,R]}),e[53]=i,e[54]=w,e[55]=C,e[56]=R,e[57]=A):A=e[57];let D;e[58]!==d||e[59]!==A?(D=p.jsx(am,{...d,children:A}),e[58]=d,e[59]=A,e[60]=D):D=e[60];let I;e[61]!==v||e[62]!==D?(I=p.jsxs(im,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[v,D]}),e[61]=v,e[62]=D,e[63]=I):I=e[63];let $;return e[64]!==y||e[65]!==I?($=p.jsx(lm,{open:!0,onOpenChange:y,children:I}),e[64]=y,e[65]=I,e[66]=$):$=e[66],$}function Cu(n){return n?n.replace(/[_-]/g," ").toLowerCase().split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "):""}function ot(n,e){return n==="output-error"||n==="output-denied"?"error":n==="approval-requested"?"approval":n==="input-streaming"||n==="input-available"||n==="output-available"&&e===!0?"loading":"idle"}function Un(n){if(n==null||typeof n!="object")return;const e=n;if(e.structuredContent&&typeof e.structuredContent=="object")return e.structuredContent;if(Array.isArray(e.content)){const t=e.content[0];if(t?.type==="text"&&typeof t.text=="string")try{return JSON.parse(t.text)}catch{return}return}return n}function Ne(n){this.content=n}Ne.prototype={constructor:Ne,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,s=r.find(n),o=r.content.slice();return s==-1?o.push(t||n,e):(o[s+1]=e,t&&(o[s]=t)),new Ne(o)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Ne(t)},addToStart:function(n,e){return new Ne([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new Ne(t)},addBefore:function(n,e,t){var r=this.remove(e),s=r.content.slice(),o=r.find(n);return s.splice(o==-1?s.length:o,0,e,t),new Ne(s)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=Ne.from(n),n.size?new Ne(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=Ne.from(n),n.size?new Ne(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=Ne.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};Ne.from=function(n){if(n instanceof Ne)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Ne(e)};function Tu(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let s=n.child(r),o=e.child(r);if(s==o){t+=s.nodeSize;continue}if(!s.sameMarkup(o))return t;if(s.isText&&s.text!=o.text){for(let i=0;s.text[i]==o.text[i];i++)t++;return t}if(s.content.size||o.content.size){let i=Tu(s.content,o.content,t+1);if(i!=null)return i}t+=s.nodeSize}}function Nu(n,e,t,r){for(let s=n.childCount,o=e.childCount;;){if(s==0||o==0)return s==o?null:{a:t,b:r};let i=n.child(--s),l=e.child(--o),a=i.nodeSize;if(i==l){t-=a,r-=a;continue}if(!i.sameMarkup(l))return{a:t,b:r};if(i.isText&&i.text!=l.text){let c=0,u=Math.min(i.text.length,l.text.length);for(;c<u&&i.text[i.text.length-c-1]==l.text[l.text.length-c-1];)c++,t--,r--;return{a:t,b:r}}if(i.content.size||l.content.size){let c=Nu(i.content,l.content,t-1,r-1);if(c)return c}t-=a,r-=a}}class O{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,s=0,o){for(let i=0,l=0;l<t;i++){let a=this.content[i],c=l+a.nodeSize;if(c>e&&r(a,s+l,o||null,i)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,s+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,s){let o="",i=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(i?i=!1:o+=r),o+=c},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,s=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(s[s.length-1]=t.withText(t.text+r.text),o=1);o<e.content.length;o++)s.push(e.content[o]);return new O(s,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],s=0;if(t>e)for(let o=0,i=0;i<t;o++){let l=this.content[o],a=i+l.nodeSize;a>e&&((i<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-i),Math.min(l.text.length,t-i)):l=l.cut(Math.max(0,e-i-1),Math.min(l.content.size,t-i-1))),r.push(l),s+=l.nodeSize),i=a}return new O(r,s)}cutByIndex(e,t){return e==t?O.empty:e==0&&t==this.content.length?this:new O(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let s=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return s[e]=t,new O(s,o)}addToStart(e){return new O([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new O(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let s=this.content[t];e(s,r,t),r+=s.nodeSize}}findDiffStart(e,t=0){return Tu(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Nu(this,e,t,r)}findIndex(e){if(e==0)return Dr(0,e);if(e==this.size)return Dr(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let s=this.child(t),o=r+s.nodeSize;if(o>=e)return o==e?Dr(t+1,o):Dr(t,r);r=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return O.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new O(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return O.empty;let t,r=0;for(let s=0;s<e.length;s++){let o=e[s];r+=o.nodeSize,s&&o.isText&&e[s-1].sameMarkup(o)?(t||(t=e.slice(0,s)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new O(t||e,r)}static from(e){if(!e)return O.empty;if(e instanceof O)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new O([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}O.empty=new O([],0);const ko={index:0,offset:0};function Dr(n,e){return ko.index=n,ko.offset=e,ko}function ts(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!ts(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!ts(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let le=class ei{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let s=0;s<e.length;s++){let o=e[s];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,s));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,s)),t.push(this),r=!0),t&&t.push(o)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&ts(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let s=r.create(t.attrs);return r.checkAttrs(s.attrs),s}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return ei.none;if(e instanceof ei)return[e];let t=e.slice();return t.sort((r,s)=>r.type.rank-s.type.rank),t}};le.none=[];class ns extends Error{}class B{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=Eu(this.content,e+this.openStart,t);return r&&new B(r,this.openStart,this.openEnd)}removeBetween(e,t){return new B(Mu(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return B.empty;let r=t.openStart||0,s=t.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new B(O.fromJSON(e,t.content),r,s)}static maxOpen(e,t=!0){let r=0,s=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)s++;return new B(e,r,s)}}B.empty=new B(O.empty,0,0);function Mu(n,e,t){let{index:r,offset:s}=n.findIndex(e),o=n.maybeChild(r),{index:i,offset:l}=n.findIndex(t);if(s==e||o.isText){if(l!=t&&!n.child(i).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=i)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(Mu(o.content,e-s-1,t-s-1)))}function Eu(n,e,t,r){let{index:s,offset:o}=n.findIndex(e),i=n.maybeChild(s);if(o==e||i.isText)return r&&!r.canReplace(s,s,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=Eu(i.content,e-o-1,t,i);return l&&n.replaceChild(s,i.copy(l))}function Mm(n,e,t){if(t.openStart>n.depth)throw new ns("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new ns("Inconsistent open depths");return Au(n,e,t,0)}function Au(n,e,t,r){let s=n.index(r),o=n.node(r);if(s==e.index(r)&&r<n.depth-t.openStart){let i=Au(n,e,t,r+1);return o.copy(o.content.replaceChild(s,i))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let i=n.parent,l=i.content;return on(i,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:i,end:l}=Em(t,n);return on(o,Iu(n,i,l,e,r))}else return on(o,rs(n,e,r))}function ju(n,e){if(!e.type.compatibleContent(n.type))throw new ns("Cannot join "+e.type.name+" onto "+n.type.name)}function ti(n,e,t){let r=n.node(t);return ju(r,e.node(t)),r}function sn(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function rr(n,e,t,r){let s=(e||n).node(t),o=0,i=e?e.index(t):s.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(sn(n.nodeAfter,r),o++));for(let l=o;l<i;l++)sn(s.child(l),r);e&&e.depth==t&&e.textOffset&&sn(e.nodeBefore,r)}function on(n,e){return n.type.checkContent(e),n.copy(e)}function Iu(n,e,t,r,s){let o=n.depth>s&&ti(n,e,s+1),i=r.depth>s&&ti(t,r,s+1),l=[];return rr(null,n,s,l),o&&i&&e.index(s)==t.index(s)?(ju(o,i),sn(on(o,Iu(n,e,t,r,s+1)),l)):(o&&sn(on(o,rs(n,e,s+1)),l),rr(e,t,s,l),i&&sn(on(i,rs(t,r,s+1)),l)),rr(r,null,s,l),new O(l)}function rs(n,e,t){let r=[];if(rr(null,n,t,r),n.depth>t){let s=ti(n,e,t+1);sn(on(s,rs(n,e,t+1)),r)}return rr(e,null,t,r),new O(r)}function Em(n,e){let t=e.depth-n.openStart,s=e.node(t).copy(n.content);for(let o=t-1;o>=0;o--)s=e.node(o).copy(O.from(s));return{start:s.resolveNoCache(n.openStart+t),end:s.resolveNoCache(s.content.size-n.openEnd-t)}}class pr{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(t);return r?e.child(t).cut(r):s}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],s=t==0?0:this.path[t*3-1]+1;for(let o=0;o<e;o++)s+=r.child(o).nodeSize;return s}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return le.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),s=e.maybeChild(t);if(!r){let l=r;r=s,s=l}let o=r.marks;for(var i=0;i<o.length;i++)o[i].type.spec.inclusive===!1&&(!s||!o[i].isInSet(s.marks))&&(o=o[i--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,s=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!s||!r[o].isInSet(s.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new ss(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],s=0,o=t;for(let i=e;;){let{index:l,offset:a}=i.content.findIndex(o),c=o-a;if(r.push(i,l,s+a),!c||(i=i.child(l),i.isText))break;o=c-1,s+=a+1}return new pr(t,r,o)}static resolveCached(e,t){let r=aa.get(e);if(r)for(let o=0;o<r.elts.length;o++){let i=r.elts[o];if(i.pos==t)return i}else aa.set(e,r=new Am);let s=r.elts[r.i]=pr.resolve(e,t);return r.i=(r.i+1)%jm,s}}class Am{constructor(){this.elts=[],this.i=0}}const jm=12,aa=new WeakMap;class ss{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Im=Object.create(null);class st{constructor(e,t,r,s=le.none){this.type=e,this.attrs=t,this.marks=s,this.content=r||O.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,s=0){this.content.nodesBetween(e,t,r,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,s){return this.content.textBetween(e,t,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&ts(this.attrs,t||e.defaultAttrs||Im)&&le.sameSet(this.marks,r||le.none)}copy(e=null){return e==this.content?this:new st(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new st(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return B.empty;let s=this.resolve(e),o=this.resolve(t),i=r?0:s.sharedDepth(t),l=s.start(i),c=s.node(i).content.cut(s.pos-l,o.pos-l);return new B(c,s.depth-i,o.depth-i)}replace(e,t,r){return Mm(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:s}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(s==e||t.isText)return t;e-=s+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let s=this.content.child(t-1);return{node:s,index:t-1,offset:r-s.nodeSize}}resolve(e){return pr.resolveCached(this,e)}resolveNoCache(e){return pr.resolve(this,e)}rangeHasMark(e,t,r){let s=!1;return t>e&&this.nodesBetween(e,t,o=>(r.isInSet(o.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Ou(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=O.empty,s=0,o=r.childCount){let i=this.contentMatchAt(e).matchFragment(r,s,o),l=i&&i.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=s;a<o;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,t,r,s){if(s&&!this.type.allowsMarks(s))return!1;let o=this.contentMatchAt(e).matchType(r),i=o&&o.matchFragment(this.content,t);return i?i.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=le.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!le.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let s=O.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,s,r);return o.type.checkAttrs(o.attrs),o}}st.prototype.text=void 0;class is extends st{constructor(e,t,r,s){if(super(e,t,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Ou(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new is(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new is(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Ou(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class mn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Om(e,t);if(r.next==null)return mn.empty;let s=Ru(r);r.next&&r.err("Unexpected trailing text");let o=zm($m(s));return Bm(o,r),o}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let s=this;for(let o=t;s&&o<r;o++)s=s.matchType(e.child(o).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let s=[this];function o(i,l){let a=i.matchFragment(e,r);if(a&&(!t||a.validEnd))return O.from(l.map(c=>c.createAndFill()));for(let c=0;c<i.next.length;c++){let{type:u,next:d}=i.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(d)==-1){s.push(d);let f=o(d,l.concat(u));if(f)return f}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),o=s.match;if(o.matchType(e)){let i=[];for(let l=s;l.type;l=l.via)i.push(l.type);return i.reverse()}for(let i=0;i<o.next.length;i++){let{type:l,next:a}=o.next[i];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!s.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:s}),t[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&t(r.next[s].next)}return t(this),e.map((r,s)=>{let o=s+(r.validEnd?"*":" ")+" ";for(let i=0;i<r.next.length;i++)o+=(i?", ":"")+r.next[i].type.name+"->"+e.indexOf(r.next[i].next);return o}).join(`
|
|
2
2
|
`)}}mn.empty=new mn(!0);class Om{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Ru(n){let e=[];do e.push(Rm(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Rm(n){let e=[];do e.push(Dm(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Dm(n){let e=_m(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=Pm(n,e);else break;return e}function ca(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function Pm(n,e){let t=ca(n),r=t;return n.eat(",")&&(n.next!="}"?r=ca(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function Lm(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let s=[];for(let o in t){let i=t[o];i.isInGroup(e)&&s.push(i)}return s.length==0&&n.err("No node type or group '"+e+"' found"),s}function _m(n){if(n.eat("(")){let e=Ru(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=Lm(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function $m(n){let e=[[]];return s(o(n,0),t()),e;function t(){return e.push([])-1}function r(i,l,a){let c={term:a,to:l};return e[i].push(c),c}function s(i,l){i.forEach(a=>a.to=l)}function o(i,l){if(i.type=="choice")return i.exprs.reduce((a,c)=>a.concat(o(c,l)),[]);if(i.type=="seq")for(let a=0;;a++){let c=o(i.exprs[a],l);if(a==i.exprs.length-1)return c;s(c,l=t())}else if(i.type=="star"){let a=t();return r(l,a),s(o(i.expr,a),a),[r(a)]}else if(i.type=="plus"){let a=t();return s(o(i.expr,l),a),s(o(i.expr,a),a),[r(a)]}else{if(i.type=="opt")return[r(l)].concat(o(i.expr,l));if(i.type=="range"){let a=l;for(let c=0;c<i.min;c++){let u=t();s(o(i.expr,a),u),a=u}if(i.max==-1)s(o(i.expr,a),a);else for(let c=i.min;c<i.max;c++){let u=t();r(a,u),s(o(i.expr,a),u),a=u}return[r(a)]}else{if(i.type=="name")return[r(l,void 0,i.value)];throw new Error("Unknown expr type")}}}}function Du(n,e){return e-n}function ua(n,e){let t=[];return r(e),t.sort(Du);function r(s){let o=n[s];if(o.length==1&&!o[0].term)return r(o[0].to);t.push(s);for(let i=0;i<o.length;i++){let{term:l,to:a}=o[i];!l&&t.indexOf(a)==-1&&r(a)}}}function zm(n){let e=Object.create(null);return t(ua(n,0));function t(r){let s=[];r.forEach(i=>{n[i].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u<s.length;u++)s[u][0]==l&&(c=s[u][1]);ua(n,a).forEach(u=>{c||s.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let o=e[r.join(",")]=new mn(r.indexOf(n.length-1)>-1);for(let i=0;i<s.length;i++){let l=s[i][1].sort(Du);o.next.push({type:s[i][0],next:e[l.join(",")]||t(l)})}return o}}function Bm(n,e){for(let t=0,r=[n];t<r.length;t++){let s=r[t],o=!s.validEnd,i=[];for(let l=0;l<s.next.length;l++){let{type:a,next:c}=s.next[l];i.push(a.name),o&&!(a.isText||a.hasRequiredAttrs())&&(o=!1),r.indexOf(c)==-1&&r.push(c)}o&&e.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Pu(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function Lu(n,e){let t=Object.create(null);for(let r in n){let s=e&&e[r];if(s===void 0){let o=n[r];if(o.hasDefault)s=o.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=s}return t}function _u(n,e,t,r){for(let s in e)if(!(s in n))throw new RangeError(`Unsupported attribute ${s} for ${t} of type ${s}`);for(let s in n){let o=n[s];o.validate&&o.validate(e[s])}}function $u(n,e){let t=Object.create(null);if(e)for(let r in e)t[r]=new Hm(n,r,e[r]);return t}let da=class zu{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=$u(e,r.attrs),this.defaultAttrs=Pu(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==mn.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Lu(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new st(this,this.computeAttrs(e),O.from(t),le.setFrom(r))}createChecked(e=null,t,r){return t=O.from(t),this.checkContent(t),new st(this,this.computeAttrs(e),t,le.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=O.from(t),t.size){let i=this.contentMatch.fillBefore(t);if(!i)return null;t=i.append(t)}let s=this.contentMatch.matchFragment(t),o=s&&s.fillBefore(O.empty,!0);return o?new st(this,e,t.append(o),le.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){_u(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:le.none:e}static compile(e,t){let r=Object.create(null);e.forEach((o,i)=>r[o]=new zu(o,t,i));let s=t.spec.topNode||"doc";if(!r[s])throw new RangeError("Schema is missing its top node type ('"+s+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function Fm(n,e,t){let r=t.split("|");return s=>{let o=s===null?"null":typeof s;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${o}`)}}class Hm{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Fm(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Xs{constructor(e,t,r,s){this.name=e,this.rank=t,this.schema=r,this.spec=s,this.attrs=$u(e,s.attrs),this.excluded=null;let o=Pu(this.attrs);this.instance=o?new le(this,o):null}create(e=null){return!e&&this.instance?this.instance:new le(this,Lu(this.attrs,e))}static compile(e,t){let r=Object.create(null),s=0;return e.forEach((o,i)=>r[o]=new Xs(o,s++,t,i)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){_u(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Bu{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let s in e)t[s]=e[s];t.nodes=Ne.from(e.nodes),t.marks=Ne.from(e.marks||{}),this.nodes=da.compile(this.spec.nodes,this),this.marks=Xs.compile(this.spec.marks,this);let r=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");let o=this.nodes[s],i=o.spec.content||"",l=o.spec.marks;if(o.contentMatch=r[i]||(r[i]=mn.parse(i,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=l=="_"?null:l?fa(this,l.split(" ")):l==""||!o.inlineContent?[]:null}for(let s in this.marks){let o=this.marks[s],i=o.spec.excludes;o.excluded=i==null?[o]:i==""?[]:fa(this,i.split(" "))}this.nodeFromJSON=s=>st.fromJSON(this,s),this.markFromJSON=s=>le.fromJSON(this,s),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,s){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof da){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,s)}text(e,t){let r=this.nodes.text;return new is(r,r.defaultAttrs,e,le.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function fa(n,e){let t=[];for(let r=0;r<e.length;r++){let s=e[r],o=n.marks[s],i=o;if(o)t.push(o);else for(let l in n.marks){let a=n.marks[l];(s=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(s)>-1)&&t.push(i=a)}if(!i)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function Vm(n){return n.tag!=null}function Wm(n){return n.style!=null}class $t{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(s=>{if(Vm(s))this.tags.push(s);else if(Wm(s)){let o=/[^=]*/.exec(s.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(s)}}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let o=e.nodes[s.node];return o.contentMatch.matchType(o)})}parse(e,t={}){let r=new pa(this,t,!1);return r.addAll(e,le.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new pa(this,t,!0);return r.addAll(e,le.none,t.from,t.to),B.maxOpen(r.finish())}matchTag(e,t,r){for(let s=r?this.tags.indexOf(r)+1:0;s<this.tags.length;s++){let o=this.tags[s];if(Km(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||t.matchesContext(o.context))){if(o.getAttrs){let i=o.getAttrs(e);if(i===!1)continue;o.attrs=i||void 0}return o}}}matchStyle(e,t,r,s){for(let o=s?this.styles.indexOf(s)+1:0;o<this.styles.length;o++){let i=this.styles[o],l=i.style;if(!(l.indexOf(e)!=0||i.context&&!r.matchesContext(i.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(i.getAttrs){let a=i.getAttrs(t);if(a===!1)continue;i.attrs=a||void 0}return i}}}static schemaRules(e){let t=[];function r(s){let o=s.priority==null?50:s.priority,i=0;for(;i<t.length;i++){let l=t[i];if((l.priority==null?50:l.priority)<o)break}t.splice(i,0,s)}for(let s in e.marks){let o=e.marks[s].spec.parseDOM;o&&o.forEach(i=>{r(i=ma(i)),i.mark||i.ignore||i.clearMark||(i.mark=s)})}for(let s in e.nodes){let o=e.nodes[s].spec.parseDOM;o&&o.forEach(i=>{r(i=ma(i)),i.node||i.ignore||i.mark||(i.node=s)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new $t(e,$t.schemaRules(e)))}}const Fu={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Um={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Hu={ol:!0,ul:!0},mr=1,ni=2,sr=4;function ha(n,e,t){return e!=null?(e?mr:0)|(e==="full"?ni:0):n&&n.whitespace=="pre"?mr|ni:t&~sr}class Pr{constructor(e,t,r,s,o,i){this.type=e,this.attrs=t,this.marks=r,this.solid=s,this.options=i,this.content=[],this.activeMarks=le.none,this.match=o||(i&sr?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(O.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,s;return(s=r.findWrapping(e.type))?(this.match=r,s):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&mr)){let r=this.content[this.content.length-1],s;if(r&&r.isText&&(s=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==s[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-s[0].length))}}let t=O.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(O.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Fu.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class pa{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let s=t.topNode,o,i=ha(null,t.preserveWhitespace,0)|(r?sr:0);s?o=new Pr(s.type,s.attrs,le.none,!0,t.topMatch||s.type.contentMatch,i):r?o=new Pr(null,null,le.none,!0,null,i):o=new Pr(e.schema.topNodeType,null,le.none,!0,null,i),this.nodes=[o],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,s=this.top,o=s.options&ni?"full":this.localPreserveWS||(s.options&mr)>0,{schema:i}=this.parser;if(o==="full"||s.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o)if(o==="full")r=r.replace(/\r\n?/g,`
|
|
3
3
|
`);else if(i.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(i.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let a=0;a<l.length;a++)a&&this.insertNode(i.linebreakReplacement.create(),t,!0),l[a]&&this.insertNode(i.text(l[a]),t,!/\S/.test(l[a]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let l=s.content[s.content.length-1],a=e.previousSibling;(!l||a&&a.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(r=r.slice(1))}r&&this.insertNode(i.text(r),t,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let s=this.localPreserveWS,o=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let i=e.nodeName.toLowerCase(),l;Hu.hasOwnProperty(i)&&this.parser.normalizeLists&&qm(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(a?a.ignore:Um.hasOwnProperty(i))this.findInside(e),this.ignoreFallback(e,t);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let c,u=this.needsBlock;if(Fu.hasOwnProperty(i))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),c=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let d=a&&a.skip?t:this.readStyles(e,t);d&&this.addAll(e,d),c&&this.sync(o),this.needsBlock=u}else{let c=this.readStyles(e,t);c&&this.addElementByRule(e,a,c,a.consuming===!1?l:void 0)}this.localPreserveWS=s}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
4
4
|
`),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let r=e.style;if(r&&r.length)for(let s=0;s<this.parser.matchedStyles.length;s++){let o=this.parser.matchedStyles[s],i=r.getPropertyValue(o);if(i)for(let l=void 0;;){let a=this.parser.matchStyle(o,i,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?t=t.filter(c=>!a.clearMark(c)):t=t.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return t}addElementByRule(e,t,r,s){let o,i;if(t.node)if(i=this.parser.schema.nodes[t.node],i.isLeaf)this.insertNode(i.create(t.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let a=this.enter(i,t.attrs||null,r,t.preserveWhitespace);a&&(o=!0,r=a)}else{let a=this.parser.schema.marks[t.mark];r=r.concat(a.create(t.attrs))}let l=this.top;if(i&&i.isLeaf)this.findInside(e);else if(s)this.addElement(e,r,s);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}o&&this.sync(l)&&this.open--}addAll(e,t,r,s){let o=r||0;for(let i=r?e.childNodes[r]:e.firstChild,l=s==null?null:e.childNodes[s];i!=l;i=i.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(i,t);this.findAtPoint(e,o)}findPlace(e,t,r){let s,o;for(let i=this.open,l=0;i>=0;i--){let a=this.nodes[i],c=a.findWrapping(e);if(c&&(!s||s.length>c.length+l)&&(s=c,o=a,!c.length))break;if(a.solid){if(r)break;l+=2}}if(!s)return null;this.sync(o);for(let i=0;i<s.length;i++)t=this.enterInner(s[i],null,t,!1);return t}insertNode(e,t,r){if(e.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(t=this.enterInner(o,null,t))}let s=this.findPlace(e,t,r);if(s){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(e.type));let i=le.none;for(let l of s.concat(e.marks))(o.type?o.type.allowsMarkType(l.type):ga(l.type,e.type))&&(i=l.addToSet(i));return o.content.push(e.mark(i)),!0}return!1}enter(e,t,r,s){let o=this.findPlace(e.create(t),r,!1);return o&&(o=this.enterInner(e,t,r,!0,s)),o}enterInner(e,t,r,s=!1,o){this.closeExtra();let i=this.top;i.match=i.match&&i.match.matchType(e);let l=ha(e,o,i.options);i.options&sr&&i.content.length==0&&(l|=sr);let a=le.none;return r=r.filter(c=>(i.type?i.type.allowsMarkType(c.type):ga(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new Pr(e,t,a,s,null,l)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=mr)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let s=r.length-1;s>=0;s--)e+=r[s].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let s=0;s<this.find.length;s++)this.find[s].pos==null&&e.nodeType==1&&e.contains(this.find[s].node)&&t.compareDocumentPosition(this.find[s].node)&(r?2:4)&&(this.find[s].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,s=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(s?0:1),i=(l,a)=>{for(;l>=0;l--){let c=t[l];if(c==""){if(l==t.length-1||l==0)continue;for(;a>=o;a--)if(i(l-1,a))return!0;return!1}else{let u=a>0||a==0&&s?this.nodes[a].type:r&&a>=o?r.node(a-o).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;a--}}return!0};return i(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}}function qm(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Hu.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function Km(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function ma(n){let e={};for(let t in n)e[t]=n[t];return e}function ga(n,e){let t=e.schema.nodes;for(let r in t){let s=t[r];if(!s.allowsMarkType(n))continue;let o=[],i=l=>{o.push(l);for(let a=0;a<l.edgeCount;a++){let{type:c,next:u}=l.edge(a);if(c==e||o.indexOf(u)<0&&i(u))return!0}};if(i(s.contentMatch))return!0}}class Sn{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=So(t).createDocumentFragment());let s=r,o=[];return e.forEach(i=>{if(o.length||i.marks.length){let l=0,a=0;for(;l<o.length&&a<i.marks.length;){let c=i.marks[a];if(!this.marks[c.type.name]){a++;continue}if(!c.eq(o[l][0])||c.type.spec.spanning===!1)break;l++,a++}for(;l<o.length;)s=o.pop()[1];for(;a<i.marks.length;){let c=i.marks[a++],u=this.serializeMark(c,i.isInline,t);u&&(o.push([c,s]),s.appendChild(u.dom),s=u.contentDOM||u.dom)}}s.appendChild(this.serializeNodeInner(i,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:s}=Jr(So(t),this.nodes[e.type.name](e),null,e.attrs);if(s){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,s)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let s=e.marks.length-1;s>=0;s--){let o=this.serializeMark(e.marks[s],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,t,r={}){let s=this.marks[e.type.name];return s&&Jr(So(r),s(e,t),null,e.attrs)}static renderSpec(e,t,r=null,s){return Jr(e,t,r,s)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Sn(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=xa(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return xa(e.marks)}}function xa(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function So(n){return n.document||window.document}const ya=new WeakMap;function Jm(n){let e=ya.get(n);return e===void 0&&ya.set(n,e=Gm(n)),e}function Gm(n){let e=null;function t(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let s=0;s<r.length;s++)t(r[s]);else for(let s in r)t(r[s])}return t(n),e}function Jr(n,e,t,r){if(typeof e=="string")return{dom:n.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let s=e[0],o;if(typeof s!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=Jm(r))&&o.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let i=s.indexOf(" ");i>0&&(t=s.slice(0,i),s=s.slice(i+1));let l,a=t?n.createElementNS(t,s):n.createElement(s),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):d=="style"&&a.style?a.style.cssText=c[d]:a.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let f=e[d];if(f===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:h,contentDOM:m}=Jr(n,f,t,r);if(a.appendChild(h),m){if(l)throw new RangeError("Multiple content holes");l=m}}}return{dom:a,contentDOM:l}}const Vu=65535,Wu=Math.pow(2,16);function Xm(n,e){return n+e*Wu}function ba(n){return n&Vu}function Ym(n){return(n-(n&Vu))/Wu}const Uu=1,qu=2,Gr=4,Ku=8;class ri{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&Ku)>0}get deletedBefore(){return(this.delInfo&(Uu|Gr))>0}get deletedAfter(){return(this.delInfo&(qu|Gr))>0}get deletedAcross(){return(this.delInfo&Gr)>0}}class We{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&We.empty)return We.empty}recover(e){let t=0,r=ba(e);if(!this.inverted)for(let s=0;s<r;s++)t+=this.ranges[s*3+2]-this.ranges[s*3+1];return this.ranges[r*3]+t+Ym(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let s=0,o=this.inverted?2:1,i=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?s:0);if(a>e)break;let c=this.ranges[l+o],u=this.ranges[l+i],d=a+c;if(e<=d){let f=c?e==a?-1:e==d?1:t:t,h=a+s+(f<0?0:u);if(r)return h;let m=e==(t<0?a:d)?null:Xm(l/3,e-a),g=e==a?qu:e==d?Uu:Gr;return(t<0?e!=a:e!=d)&&(g|=Ku),new ri(h,g,m)}s+=u-c}return r?e+s:new ri(e+s,0,null)}touches(e,t){let r=0,s=ba(t),o=this.inverted?2:1,i=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?r:0);if(a>e)break;let c=this.ranges[l+o],u=a+c;if(e<=u&&l==s*3)return!0;r+=this.ranges[l+i]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let s=0,o=0;s<this.ranges.length;s+=3){let i=this.ranges[s],l=i-(this.inverted?o:0),a=i+(this.inverted?0:o),c=this.ranges[s+t],u=this.ranges[s+r];e(l,l+c,a,a+u),o+=u-c}}invert(){return new We(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?We.empty:new We(e<0?[0,-e,0]:[0,0,e])}}We.empty=new We([]);class gr{constructor(e,t,r=0,s=e?e.length:0){this.mirror=t,this.from=r,this.to=s,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new gr(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,r=this._maps.length;t<e._maps.length;t++){let s=e.getMirror(t);this.appendMap(e._maps[t],s!=null&&s<t?r+s:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this._maps.length+e._maps.length;t>=0;t--){let s=e.getMirror(t);this.appendMap(e._maps[t].invert(),s!=null&&s>t?r-s-1:void 0)}}invert(){let e=new gr;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let s=0;for(let o=this.from;o<this.to;o++){let i=this._maps[o],l=i.mapResult(e,t);if(l.recover!=null){let a=this.getMirror(o);if(a!=null&&a>o&&a<this.to){o=a,e=this._maps[a].recover(l.recover);continue}}s|=l.delInfo,e=l.pos}return r?e:new ri(e,s,null)}}const vo=Object.create(null);class Re{getMap(){return We.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=vo[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in vo)throw new RangeError("Duplicate use of step JSON ID "+e);return vo[e]=t,t.prototype.jsonID=e,t}}class be{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new be(e,null)}static fail(e){return new be(null,e)}static fromReplace(e,t,r,s){try{return be.ok(e.replace(t,r,s))}catch(o){if(o instanceof ns)return be.fail(o.message);throw o}}}function Zi(n,e,t){let r=[];for(let s=0;s<n.childCount;s++){let o=n.child(s);o.content.size&&(o=o.copy(Zi(o.content,e,o))),o.isInline&&(o=e(o,t,s)),r.push(o)}return O.fromArray(r)}class Dt extends Re{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),s=r.node(r.sharedDepth(this.to)),o=new B(Zi(t.content,(i,l)=>!i.isAtom||!l.type.allowsMarkType(this.mark.type)?i:i.mark(this.mark.addToSet(i.marks)),s),t.openStart,t.openEnd);return be.fromReplace(e,this.from,this.to,o)}invert(){return new rt(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Dt(t.pos,r.pos,this.mark)}merge(e){return e instanceof Dt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Dt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Dt(t.from,t.to,e.markFromJSON(t.mark))}}Re.jsonID("addMark",Dt);class rt extends Re{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new B(Zi(t.content,s=>s.mark(this.mark.removeFromSet(s.marks)),e),t.openStart,t.openEnd);return be.fromReplace(e,this.from,this.to,r)}invert(){return new Dt(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new rt(t.pos,r.pos,this.mark)}merge(e){return e instanceof rt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new rt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new rt(t.from,t.to,e.markFromJSON(t.mark))}}Re.jsonID("removeMark",rt);class Pt extends Re{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return be.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return be.fromReplace(e,this.pos,this.pos+1,new B(O.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let s=0;s<t.marks.length;s++)if(!t.marks[s].isInSet(r))return new Pt(this.pos,t.marks[s]);return new Pt(this.pos,this.mark)}}return new gn(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Pt(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Pt(t.pos,e.markFromJSON(t.mark))}}Re.jsonID("addNodeMark",Pt);class gn extends Re{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return be.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return be.fromReplace(e,this.pos,this.pos+1,new B(O.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Pt(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new gn(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new gn(t.pos,e.markFromJSON(t.mark))}}Re.jsonID("removeNodeMark",gn);class ye extends Re{constructor(e,t,r,s=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=s}apply(e){return this.structure&&si(e,this.from,this.to)?be.fail("Structure replace would overwrite content"):be.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new We([this.from,this.to-this.from,this.slice.size])}invert(e){return new ye(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.to,-1),r=this.from==this.to&&ye.MAP_BIAS<0?t:e.mapResult(this.from,1);return r.deletedAcross&&t.deletedAcross?null:new ye(r.pos,Math.max(r.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof ye)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?B.empty:new B(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new ye(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?B.empty:new B(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new ye(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new ye(t.from,t.to,B.fromJSON(e,t.slice),!!t.structure)}}ye.MAP_BIAS=1;Re.jsonID("replace",ye);class we extends Re{constructor(e,t,r,s,o,i,l=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=s,this.slice=o,this.insert=i,this.structure=l}apply(e){if(this.structure&&(si(e,this.from,this.gapFrom)||si(e,this.gapTo,this.to)))return be.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return be.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?be.fromReplace(e,this.from,this.to,r):be.fail("Content does not fit in gap")}getMap(){return new We([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new we(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),s=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||s<t.pos||o>r.pos?null:new we(t.pos,r.pos,s,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new we(t.from,t.to,t.gapFrom,t.gapTo,B.fromJSON(e,t.slice),t.insert,!!t.structure)}}Re.jsonID("replaceAround",we);function si(n,e,t){let r=n.resolve(e),s=t-e,o=r.depth;for(;s>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,s--;if(s>0){let i=r.node(o).maybeChild(r.indexAfter(o));for(;s>0;){if(!i||i.isLeaf)return!0;i=i.firstChild,s--}}return!1}function Qm(n,e,t,r){let s=[],o=[],i,l;n.doc.nodesBetween(e,t,(a,c,u)=>{if(!a.isInline)return;let d=a.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),h=Math.min(c+a.nodeSize,t),m=r.addToSet(d);for(let g=0;g<d.length;g++)d[g].isInSet(m)||(i&&i.to==f&&i.mark.eq(d[g])?i.to=h:s.push(i=new rt(f,h,d[g])));l&&l.to==f?l.to=h:o.push(l=new Dt(f,h,r))}}),s.forEach(a=>n.step(a)),o.forEach(a=>n.step(a))}function Zm(n,e,t,r){let s=[],o=0;n.doc.nodesBetween(e,t,(i,l)=>{if(!i.isInline)return;o++;let a=null;if(r instanceof Xs){let c=i.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(i.marks)&&(a=[r]):a=i.marks;if(a&&a.length){let c=Math.min(l+i.nodeSize,t);for(let u=0;u<a.length;u++){let d=a[u],f;for(let h=0;h<s.length;h++){let m=s[h];m.step==o-1&&d.eq(s[h].style)&&(f=m)}f?(f.to=c,f.step=o):s.push({style:d,from:Math.max(l,e),to:c,step:o})}}}),s.forEach(i=>n.step(new rt(i.from,i.to,i.style)))}function el(n,e,t,r=t.contentMatch,s=!0){let o=n.doc.nodeAt(e),i=[],l=e+1;for(let a=0;a<o.childCount;a++){let c=o.child(a),u=l+c.nodeSize,d=r.matchType(c.type);if(!d)i.push(new ye(l,u,B.empty));else{r=d;for(let f=0;f<c.marks.length;f++)t.allowsMarkType(c.marks[f].type)||n.step(new rt(l,u,c.marks[f]));if(s&&c.isText&&t.whitespace!="pre"){let f,h=/\r?\n|\r/g,m;for(;f=h.exec(c.text);)m||(m=new B(O.from(t.schema.text(" ",t.allowedMarks(c.marks))),0,0)),i.push(new ye(l+f.index,l+f.index+f[0].length,m))}}l=u}if(!r.validEnd){let a=r.fillBefore(O.empty,!0);n.replace(l,l,new B(a,0,0))}for(let a=i.length-1;a>=0;a--)n.step(i[a])}function eg(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function qn(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth,s=0,o=0;;--r){let i=n.$from.node(r),l=n.$from.index(r)+s,a=n.$to.indexAfter(r)-o;if(r<n.depth&&i.canReplace(l,a,t))return r;if(r==0||i.type.spec.isolating||!eg(i,l,a))break;l&&(s=1),a<i.childCount&&(o=1)}return null}function tg(n,e,t){let{$from:r,$to:s,depth:o}=e,i=r.before(o+1),l=s.after(o+1),a=i,c=l,u=O.empty,d=0;for(let m=o,g=!1;m>t;m--)g||r.index(m)>0?(g=!0,u=O.from(r.node(m).copy(u)),d++):a--;let f=O.empty,h=0;for(let m=o,g=!1;m>t;m--)g||s.after(m+1)<s.end(m)?(g=!0,f=O.from(s.node(m).copy(f)),h++):c++;n.step(new we(a,c,i,l,new B(u.append(f),d,h),u.size-d,!0))}function tl(n,e,t=null,r=n){let s=ng(n,e),o=s&&rg(r,e);return o?s.map(ka).concat({type:e,attrs:t}).concat(o.map(ka)):null}function ka(n){return{type:n,attrs:null}}function ng(n,e){let{parent:t,startIndex:r,endIndex:s}=n,o=t.contentMatchAt(r).findWrapping(e);if(!o)return null;let i=o.length?o[0]:e;return t.canReplaceWith(r,s,i)?o:null}function rg(n,e){let{parent:t,startIndex:r,endIndex:s}=n,o=t.child(r),i=e.contentMatch.findWrapping(o.type);if(!i)return null;let a=(i.length?i[i.length-1]:e).contentMatch;for(let c=r;a&&c<s;c++)a=a.matchType(t.child(c).type);return!a||!a.validEnd?null:i}function sg(n,e,t){let r=O.empty;for(let i=t.length-1;i>=0;i--){if(r.size){let l=t[i].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=O.from(t[i].type.create(t[i].attrs,r))}let s=e.start,o=e.end;n.step(new we(s,o,s,o,new B(r,0,0),t.length,!0))}function og(n,e,t,r,s){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=n.steps.length;n.doc.nodesBetween(e,t,(i,l)=>{let a=typeof s=="function"?s(i):s;if(i.isTextblock&&!i.hasMarkup(r,a)&&ig(n.doc,n.mapping.slice(o).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!m?c=!1:!h&&m&&(c=!0)}c===!1&&Gu(n,i,l,o),el(n,n.mapping.slice(o).map(l,1),r,void 0,c===null);let u=n.mapping.slice(o),d=u.map(l,1),f=u.map(l+i.nodeSize,1);return n.step(new we(d,f,d+1,f-1,new B(O.from(r.create(a,null,i.marks)),0,0),1,!0)),c===!0&&Ju(n,i,l,o),!1}})}function Ju(n,e,t,r){e.forEach((s,o)=>{if(s.isText){let i,l=/\r?\n|\r/g;for(;i=l.exec(s.text);){let a=n.mapping.slice(r).map(t+1+o+i.index);n.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function Gu(n,e,t,r){e.forEach((s,o)=>{if(s.type==s.type.schema.linebreakReplacement){let i=n.mapping.slice(r).map(t+1+o);n.replaceWith(i,i+1,e.type.schema.text(`
|
|
@@ -0,0 +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-BUWOf6-H.js";import{s as q}from"./Plus-OGxa0fdn.js";import{i as S}from"./Zap-UNZ6wjOU.js";import{S as D}from"./search-input-DoQewDAM.js";import{P as l}from"./index-BdUl5bJN.js";import{E as b}from"./empty-state-jjn-bhGa.js";import{c as O}from"./use-automations-ljR2TnPA.js";import{c as V}from"./use-navigate-to-agent-7gJqLFkE.js";import{A as F}from"./automation-list-row-CW2Mr4ne.js";import{f as G}from"./constants-D_FQAPnt.js";import{u as H}from"./use-virtual-mcp-BJxeG1T-.js";import{R as J}from"./require-capability-qkGmH7NG.js";import"./SearchMd-DhGVvJ2r.js";import"./sidebar-Bg21lFNS.js";import"./LayoutLeft-DP-M8mno.js";import"./use-mobile-oSorlQMv.js";import"./X-8dZUy9dd.js";import"./tooltip-cXMPTvhQ.js";import"./use-mcp-client-qnk43eG1.js";import"./auth-BBryGktV.js";import"./studio-tools-JGMjsS9V.js";import"./hooks-B5swj9vo.js";import"./decopilot-sse-pool-DpwU6Fnw.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./alert-dialog-iGippWYX.js";import"./dropdown-menu-96rpJkjm.js";import"./Check-ylcp47jh.js";import"./ChevronRight-NJ1RHqa7.js";import"./Circle-BGJOKhru.js";import"./Stars02-Brbdnmc2.js";import"./DotsVertical-Ckk9mZsT.js";import"./Trash01-9Yhy1NDp.js";import"./agent-icon-DCK7PpQ3.js";import"./AlertCircle-BVlB73Gd.js";import"./UserPlus01-ByXfLuOW.js";import"./Tool01-CQ5Yi4Y5.js";import"./ArrowUp-BcoNWaDn.js";import"./Settings02-s4dN6VnR.js";import"./Tool02-B5mtXP4w.js";import"./XCircle-DY5ehXOb.js";import"./ArrowUpRight-COlnzfbE.js";import"./TrendUp01-CUYb4fKq.js";import"./ZapSquare-CIT8HcpR.js";import"./ZoomOut-DoDMe5dD.js";import"./Users03-DQHSM-ip.js";import"./CheckCircle-jaIqf58w.js";import"./ChevronDown-DorDM-K-.js";import"./ChevronUp-C85SxyPM.js";import"./Copy01-C5M0y3sD.js";import"./Globe01-DwjnaG3m.js";import"./Eye-ByzbJOuX.js";import"./FilterLines-hGzDxUbQ.js";import"./Flag01-D6FA8Gqb.js";import"./Star01-CdWOUCGL.js";import"./Globe04-KMRfe3Ap.js";import"./SwitchHorizontal01-CQC-VHSM.js";import"./HardDrive-BLW7r-EP.js";import"./Image01-DID7YK1H.js";import"./Key01-BNdv9d9e.js";import"./LinkExternal01-CJELREUW.js";import"./List-B6zsWjbc.js";import"./Monitor01-DGMiqS2G.js";import"./Sun-DrhefHVP.js";import"./Package-Cys9wdnk.js";import"./Palette-CjpYx7Ii.js";import"./Play-BIDZ3Qx4.js";import"./SearchLg-BkGBAC6u.js";import"./Shield01-C2gwqyT0.js";import"./Stars01-Ce7N7beA.js";import"./Upload01-BGaIkl8C.js";import"./User01-DY8EdPzH.js";import"./Users01-DnUyZ4sc.js";import"./XClose-IT2oT79e.js";import"./use-collections-7ERyEkIU.js";import"./use-capability-BI2Ao-_m.js";import"./access-gate-BjqlcKiO.js";import"./capability-load-error-u8-vFMPG.js";function K(){const t=B.c(16),{org:e}=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(i=>{if(!g||i.name.toLowerCase().includes(g))return!0;if(i.virtual_mcp_id){const a=y.get(i.virtual_mcp_id);if(a&&a.title.toLowerCase().includes(g))return!0}return!1}),P=(i,a)=>{const A=a&&y.has(a)?a:G(e.id);N("automations_list_row_clicked",{automation_id:i,agent_id:A,source:"settings_automations"}),k(A,{search:{main:"automation:"+i}})};let n;t[0]!==d||t[1]!==e.slug?(n=()=>{N("automations_empty_state_browse_agents_clicked"),d({to:"/$org/settings/agents",params:{org:e.slug}})},t[0]=d,t[1]=e.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(i=>o.jsx(F,{automation:i,showAgent:!0,onClick:()=>P(i.id,i.virtual_mcp_id)},i.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 vo(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(J,{capability:"automations:manage",area:"automations",children:o.jsx(K,{})}),t[0]=e):e=t[0],e}export{vo as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as a}from"./index-
|
|
1
|
+
import{D as a}from"./index-BUWOf6-H.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-
|
|
1
|
+
import{c as k,j as i,l as m,bC as R,cI as S,cJ as V,cK as $}from"./index-BUWOf6-H.js";import{s as O}from"./User01-DY8EdPzH.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-
|
|
1
|
+
import{c as l,l as u,j as g,bd as v,bC as b}from"./index-BUWOf6-H.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 _,r as q,l as Q,j as o}from"./index-DIs_Ascu.js";import{C as Ne,I as ke,D as Se,E as we,r as Ae,S as Be,F as _e,H as Ie,J as Te,K as $e,L as ue,M as Re,P as Le,N as Pe,O as De,Q as Ee,R as Oe,T as ze,U as Ue}from"./index-CxlY6aPa.js";import{Q as Fe,y as He,a1 as Je,a2 as Me,a3 as Ge}from"./agent-icon-BxLuMAgr.js";import{s as ve}from"./Plus-BVHqtbgP.js";import{e as fe,a as Ve,b as qe,C as Qe,d as Ke,c as Ye}from"./command-ydSS1VRq.js";import{P as We,a as Xe,b as Ze}from"./popover-CgYfhhYK.js";import{a as et}from"./Copy01-BUrLo-T8.js";import{b as tt}from"./ZoomOut-DHfhZNsb.js";import{s as ae}from"./Trash01-swADtIx6.js";import{b as lt}from"./XCircle-DwxRLgWl.js";import{u as st,o as ot,p as rt}from"./automation-runs-CLSyqJR8.js";import{I as O,F as de,T as se,s as w,p as W,R as X,A as K}from"./primitives-DSxqyzBO.js";import{i as nt}from"./Check-ewaBC-Xf.js";import{L as le}from"./label-CXj1p-Ay.js";const oe=g=>typeof g=="string"?g:"",it=/\/blog\.tsx?$/;function ye(g,e){for(const[t,i]of Object.entries(g)){if(t.includes("/")||!i||typeof i!="object"||Array.isArray(i))continue;const l=i;if(typeof l.__resolveType!="string"||!it.test(l.__resolveType))continue;const c=oe(l[e]);if(c)return c}return null}function at(g){return ye(g,"pageSlug")}function ct(g){return ye(g,"categorySlug")}function dt(g){const e=g.categories;if(!Array.isArray(e)||e.length===0)return"";const t=e[0];return oe(t?.slug)}function ut(g,e){let t=g;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 ft=/:(?:categorySlug|category|slug)\??/,mt=/:(?:categorySlug|category|slug)\??/g;function pt(g,e){return ft.test(g)?e?g.replace(mt,encodeURIComponent(e)):null:g}function pl({decofile:g,category:e,previewBaseUrl:t}){if(!t)return null;const i=ct(g);if(!i)return null;const l=pt(i,oe(e.slug));if(!l)return null;try{return new URL(l,t).href}catch{return null}}function gl({decofile:g,post:e,previewBaseUrl:t}){if(!t)return null;const i=at(g);if(!i)return null;const l=ut(i,{category:dt(e),slug:oe(e.slug)});if(!l)return null;try{return new URL(l,t).href}catch{return null}}const me={app:"Blocks",site:"Custom blocks"};function gt(g){const e=_.c(6),{iconName:t,iconUrl:i,alt:l}=g;let c;e[0]!==t?(c=He(t)??Fe,e[0]=t,e[1]=c):c=e[1];const p=c;let f;return e[2]!==p||e[3]!==l||e[4]!==i?(f=o.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-md border bg-muted",children:i?o.jsx("img",{src:i,alt:l,className:"size-5 object-contain"}):o.jsx(p,{size:16,className:"text-muted-foreground"})}),e[2]=p,e[3]=l,e[4]=i,e[5]=f):f=e[5],f}function pe(g){const e=_.c(19),{type:t,onInsert:i}=g,l=`${t.title} ${t.resolveType} ${t.description??""}`;let c;e[0]!==i||e[1]!==t.resolveType?(c=()=>i(t.resolveType),e[0]=i,e[1]=t.resolveType,e[2]=c):c=e[2];let p;e[3]!==t.iconName||e[4]!==t.iconUrl||e[5]!==t.title?(p=o.jsx(gt,{iconName:t.iconName,iconUrl:t.iconUrl,alt:t.title}),e[3]=t.iconName,e[4]=t.iconUrl,e[5]=t.title,e[6]=p):p=e[6];let f;e[7]!==t.title?(f=o.jsx("span",{className:"text-sm font-medium",children:t.title}),e[7]=t.title,e[8]=f):f=e[8];let a;e[9]!==t.description?(a=t.description&&o.jsx("span",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[9]=t.description,e[10]=a):a=e[10];let m;e[11]!==f||e[12]!==a?(m=o.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[f,a]}),e[11]=f,e[12]=a,e[13]=m):m=e[13];let d;return e[14]!==l||e[15]!==c||e[16]!==p||e[17]!==m?(d=o.jsxs(Ve,{value:l,onSelect:c,className:"flex items-center gap-2.5",children:[p,m]}),e[14]=l,e[15]=c,e[16]=p,e[17]=m,e[18]=d):d=e[18],d}function ge(g){const e=_.c(28),{blockTypes:t,onInsert:i,alwaysShow:l}=g,c=l===void 0?!1:l,[p,f]=q.useState(!1);let a,m;if(e[0]!==t){a=[],m=[];for(const S of t)(S.source==="site"?m:a).push(S);e[0]=t,e[1]=a,e[2]=m}else a=e[1],m=e[2];let d;e[3]!==i?(d=S=>{i(S),f(!1)},e[3]=i,e[4]=d):d=e[4];const h=d,s=a.length>0&&m.length>0,r=c?"h-10":"";let n;e[5]!==r?(n=Q("group/insert relative flex h-6 items-center justify-center",r),e[5]=r,e[6]=n):n=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=o.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 x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(We,{asChild:!0,children:o.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:o.jsx(ve,{size:14})})}),e[8]=x):x=e[8];let b;e[9]===Symbol.for("react.memo_cache_sentinel")?(b=o.jsx(qe,{placeholder:"Search blocks…"}),e[9]=b):b=e[9];let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y=o.jsx(Qe,{children:"No blocks found."}),e[10]=y):y=e[10];let v;e[11]!==h||e[12]!==s||e[13]!==m?(v=m.length>0&&o.jsx(fe,{heading:s?me.site:void 0,children:m.map(S=>o.jsx(pe,{type:S,onInsert:h},S.resolveType))}),e[11]=h,e[12]=s,e[13]=m,e[14]=v):v=e[14];let j;e[15]!==a||e[16]!==h||e[17]!==s?(j=a.length>0&&o.jsx(fe,{heading:s?me.app:void 0,children:a.map(S=>o.jsx(pe,{type:S,onInsert:h},S.resolveType))}),e[15]=a,e[16]=h,e[17]=s,e[18]=j):j=e[18];let k;e[19]!==j||e[20]!==v?(k=o.jsx(Xe,{className:"w-80 p-0",align:"center",children:o.jsxs(Ke,{children:[b,o.jsxs(Ye,{className:"max-h-80",children:[y,v,j]})]})}),e[19]=j,e[20]=v,e[21]=k):k=e[21];let C;e[22]!==p||e[23]!==k?(C=o.jsxs(Ze,{open:p,onOpenChange:f,children:[x,k]}),e[22]=p,e[23]=k,e[24]=C):C=e[24];let N;return e[25]!==C||e[26]!==n?(N=o.jsxs("div",{className:n,children:[u,C]}),e[25]=C,e[26]=n,e[27]=N):N=e[27],N}function xt({html:g,placeholder:e,onChange:t}){const i=q.useRef(t);i.current=t;const l=st({extensions:[ot.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,bulletList:!1,orderedList:!1,listItem:!1,dropcursor:!1,gapcursor:!1}),Ne.configure({placeholder:e??"Write something…"})],content:g||"",editorProps:{attributes:{class:Q("prose prose-sm dark:prose-invert max-w-none focus:outline-none","leading-relaxed [&_p]:my-0")}},onUpdate:({editor:c})=>{const p=c.getHTML();i.current(p==="<p></p>"?"":p)}});return l?o.jsxs("div",{className:"relative",children:[l.isFocused&&o.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:[o.jsx(te,{active:l.isActive("bold"),label:"Bold",onClick:()=>l.chain().focus().toggleBold().run(),children:o.jsx(Je,{size:14})}),o.jsx(te,{active:l.isActive("italic"),label:"Italic",onClick:()=>l.chain().focus().toggleItalic().run(),children:o.jsx(Me,{size:14})}),o.jsx(te,{active:l.isActive("underline"),label:"Underline",onClick:()=>l.chain().focus().toggleUnderline().run(),children:o.jsx(Ge,{size:14})}),o.jsx(te,{active:l.isActive("link"),label:"Link",onClick:()=>{const c=l.getAttributes("link").href,p=window.prompt("Link URL",c??"https://");p!==null&&(p===""?l.chain().focus().unsetLink().run():l.chain().focus().setLink({href:p}).run())},children:o.jsx(lt,{size:14})})]}),o.jsx(rt,{editor:l,className:"text-[15px] text-foreground"})]}):null}function te(g){const e=_.c(8),{active:t,label:i,onClick:l,children:c}=g,p=t?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let f;e[0]!==p?(f=Q("flex h-7 w-7 items-center justify-center rounded transition-colors cursor-pointer",p),e[0]=p,e[1]=f):f=e[1];let a;return e[2]!==t||e[3]!==c||e[4]!==i||e[5]!==l||e[6]!==f?(a=o.jsx("button",{type:"button","aria-label":i,"aria-pressed":t,onMouseDown:ht,onClick:l,className:f,children:c}),e[2]=t,e[3]=c,e[4]=i,e[5]=l,e[6]=f,e[7]=a):a=e[7],a}function ht(g){return g.preventDefault()}const bt=["1","2","3"],xe={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 vt(g){const e=_.c(19),{text:t,level:i,onChange:l}=g,[c,p]=q.useState(!1),f=i||"2";let a;e[0]!==c||e[1]!==f||e[2]!==l||e[3]!==t?(a=c&&o.jsx(de,{children:bt.map(x=>o.jsxs(se,{active:f===x,label:`Heading ${x}`,onClick:()=>l({text:t,level:x}),children:["H",x]},x))}),e[0]=c,e[1]=f,e[2]=l,e[3]=t,e[4]=a):a=e[4];let m;e[5]!==f||e[6]!==l?(m=x=>l({text:x,level:f}),e[5]=f,e[6]=l,e[7]=m):m=e[7];let d,h;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=()=>p(!0),h=()=>p(!1),e[8]=d,e[9]=h):(d=e[8],h=e[9]);const s=xe[f]??xe[2];let r;e[10]!==s?(r=Q("text-foreground",s),e[10]=s,e[11]=r):r=e[11];let n;e[12]!==m||e[13]!==r||e[14]!==t?(n=o.jsx(O,{value:t,onChange:m,onFocus:d,onBlur:h,placeholder:"Heading",className:r}),e[12]=m,e[13]=r,e[14]=t,e[15]=n):n=e[15];let u;return e[16]!==a||e[17]!==n?(u=o.jsxs("div",{className:"relative",children:[a,n]}),e[16]=a,e[17]=n,e[18]=u):u=e[18],u}function yt(g){const e=_.c(3),{quote:t,onChange:i}=g;let l;return e[0]!==i||e[1]!==t?(l=o.jsx("div",{className:"border-l-2 border-foreground/30 pl-4",children:o.jsx(O,{value:t,onChange:i,placeholder:"Quote",className:"text-lg italic text-foreground/90"})}),e[0]=i,e[1]=t,e[2]=l):l=e[2],l}function jt(g){const e=_.c(15),{code:t,language:i,onChange:l}=g;let c;e[0]!==t||e[1]!==l?(c=d=>l({code:t,language:d.target.value}),e[0]=t,e[1]=l,e[2]=c):c=e[2];let p;e[3]!==i||e[4]!==c?(p=o.jsx("input",{value:i,onChange:c,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]=i,e[4]=c,e[5]=p):p=e[5];let f;e[6]!==i||e[7]!==l?(f=d=>l({code:d,language:i}),e[6]=i,e[7]=l,e[8]=f):f=e[8];let a;e[9]!==t||e[10]!==f?(a=o.jsx(O,{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]=a):a=e[11];let m;return e[12]!==p||e[13]!==a?(m=o.jsxs("div",{className:"overflow-hidden rounded-md border bg-muted/50",children:[p,a]}),e[12]=p,e[13]=a,e[14]=m):m=e[14],m}function Ct(g){const e=_.c(17),{items:t,style:i,onChange:l}=g,c=i==="ordered",p=t.length?t.split(`
|
|
1
|
+
import{c as _,r as q,l as Q,j as o}from"./index-BUWOf6-H.js";import{C as Ne,I as ke,D as Se,E as we,r as Ae,S as Be,F as _e,H as Ie,J as Te,K as $e,L as ue,M as Re,P as Le,N as Pe,O as De,Q as Ee,R as Oe,T as ze,U as Ue}from"./index-gNz_kq5D.js";import{Q as Fe,y as He,a1 as Je,a2 as Me,a3 as Ge}from"./agent-icon-DCK7PpQ3.js";import{s as ve}from"./Plus-OGxa0fdn.js";import{e as fe,a as Ve,b as qe,C as Qe,d as Ke,c as Ye}from"./command-DgNLNLpt.js";import{P as We,a as Xe,b as Ze}from"./popover-B2zk9niv.js";import{a as et}from"./Copy01-C5M0y3sD.js";import{b as tt}from"./ZoomOut-DoDMe5dD.js";import{s as ae}from"./Trash01-9Yhy1NDp.js";import{b as lt}from"./XCircle-DY5ehXOb.js";import{u as st,o as ot,p as rt}from"./automation-runs-DtF_plhA.js";import{I as O,F as de,T as se,s as w,p as W,R as X,A as K}from"./primitives-DlChEJzy.js";import{i as nt}from"./Check-ylcp47jh.js";import{L as le}from"./label-CK1XiDPB.js";const oe=g=>typeof g=="string"?g:"",it=/\/blog\.tsx?$/;function ye(g,e){for(const[t,i]of Object.entries(g)){if(t.includes("/")||!i||typeof i!="object"||Array.isArray(i))continue;const l=i;if(typeof l.__resolveType!="string"||!it.test(l.__resolveType))continue;const c=oe(l[e]);if(c)return c}return null}function at(g){return ye(g,"pageSlug")}function ct(g){return ye(g,"categorySlug")}function dt(g){const e=g.categories;if(!Array.isArray(e)||e.length===0)return"";const t=e[0];return oe(t?.slug)}function ut(g,e){let t=g;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 ft=/:(?:categorySlug|category|slug)\??/,mt=/:(?:categorySlug|category|slug)\??/g;function pt(g,e){return ft.test(g)?e?g.replace(mt,encodeURIComponent(e)):null:g}function pl({decofile:g,category:e,previewBaseUrl:t}){if(!t)return null;const i=ct(g);if(!i)return null;const l=pt(i,oe(e.slug));if(!l)return null;try{return new URL(l,t).href}catch{return null}}function gl({decofile:g,post:e,previewBaseUrl:t}){if(!t)return null;const i=at(g);if(!i)return null;const l=ut(i,{category:dt(e),slug:oe(e.slug)});if(!l)return null;try{return new URL(l,t).href}catch{return null}}const me={app:"Blocks",site:"Custom blocks"};function gt(g){const e=_.c(6),{iconName:t,iconUrl:i,alt:l}=g;let c;e[0]!==t?(c=He(t)??Fe,e[0]=t,e[1]=c):c=e[1];const p=c;let f;return e[2]!==p||e[3]!==l||e[4]!==i?(f=o.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-md border bg-muted",children:i?o.jsx("img",{src:i,alt:l,className:"size-5 object-contain"}):o.jsx(p,{size:16,className:"text-muted-foreground"})}),e[2]=p,e[3]=l,e[4]=i,e[5]=f):f=e[5],f}function pe(g){const e=_.c(19),{type:t,onInsert:i}=g,l=`${t.title} ${t.resolveType} ${t.description??""}`;let c;e[0]!==i||e[1]!==t.resolveType?(c=()=>i(t.resolveType),e[0]=i,e[1]=t.resolveType,e[2]=c):c=e[2];let p;e[3]!==t.iconName||e[4]!==t.iconUrl||e[5]!==t.title?(p=o.jsx(gt,{iconName:t.iconName,iconUrl:t.iconUrl,alt:t.title}),e[3]=t.iconName,e[4]=t.iconUrl,e[5]=t.title,e[6]=p):p=e[6];let f;e[7]!==t.title?(f=o.jsx("span",{className:"text-sm font-medium",children:t.title}),e[7]=t.title,e[8]=f):f=e[8];let a;e[9]!==t.description?(a=t.description&&o.jsx("span",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[9]=t.description,e[10]=a):a=e[10];let m;e[11]!==f||e[12]!==a?(m=o.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[f,a]}),e[11]=f,e[12]=a,e[13]=m):m=e[13];let d;return e[14]!==l||e[15]!==c||e[16]!==p||e[17]!==m?(d=o.jsxs(Ve,{value:l,onSelect:c,className:"flex items-center gap-2.5",children:[p,m]}),e[14]=l,e[15]=c,e[16]=p,e[17]=m,e[18]=d):d=e[18],d}function ge(g){const e=_.c(28),{blockTypes:t,onInsert:i,alwaysShow:l}=g,c=l===void 0?!1:l,[p,f]=q.useState(!1);let a,m;if(e[0]!==t){a=[],m=[];for(const S of t)(S.source==="site"?m:a).push(S);e[0]=t,e[1]=a,e[2]=m}else a=e[1],m=e[2];let d;e[3]!==i?(d=S=>{i(S),f(!1)},e[3]=i,e[4]=d):d=e[4];const h=d,s=a.length>0&&m.length>0,r=c?"h-10":"";let n;e[5]!==r?(n=Q("group/insert relative flex h-6 items-center justify-center",r),e[5]=r,e[6]=n):n=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=o.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 x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(We,{asChild:!0,children:o.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:o.jsx(ve,{size:14})})}),e[8]=x):x=e[8];let b;e[9]===Symbol.for("react.memo_cache_sentinel")?(b=o.jsx(qe,{placeholder:"Search blocks…"}),e[9]=b):b=e[9];let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y=o.jsx(Qe,{children:"No blocks found."}),e[10]=y):y=e[10];let v;e[11]!==h||e[12]!==s||e[13]!==m?(v=m.length>0&&o.jsx(fe,{heading:s?me.site:void 0,children:m.map(S=>o.jsx(pe,{type:S,onInsert:h},S.resolveType))}),e[11]=h,e[12]=s,e[13]=m,e[14]=v):v=e[14];let j;e[15]!==a||e[16]!==h||e[17]!==s?(j=a.length>0&&o.jsx(fe,{heading:s?me.app:void 0,children:a.map(S=>o.jsx(pe,{type:S,onInsert:h},S.resolveType))}),e[15]=a,e[16]=h,e[17]=s,e[18]=j):j=e[18];let k;e[19]!==j||e[20]!==v?(k=o.jsx(Xe,{className:"w-80 p-0",align:"center",children:o.jsxs(Ke,{children:[b,o.jsxs(Ye,{className:"max-h-80",children:[y,v,j]})]})}),e[19]=j,e[20]=v,e[21]=k):k=e[21];let C;e[22]!==p||e[23]!==k?(C=o.jsxs(Ze,{open:p,onOpenChange:f,children:[x,k]}),e[22]=p,e[23]=k,e[24]=C):C=e[24];let N;return e[25]!==C||e[26]!==n?(N=o.jsxs("div",{className:n,children:[u,C]}),e[25]=C,e[26]=n,e[27]=N):N=e[27],N}function xt({html:g,placeholder:e,onChange:t}){const i=q.useRef(t);i.current=t;const l=st({extensions:[ot.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,bulletList:!1,orderedList:!1,listItem:!1,dropcursor:!1,gapcursor:!1}),Ne.configure({placeholder:e??"Write something…"})],content:g||"",editorProps:{attributes:{class:Q("prose prose-sm dark:prose-invert max-w-none focus:outline-none","leading-relaxed [&_p]:my-0")}},onUpdate:({editor:c})=>{const p=c.getHTML();i.current(p==="<p></p>"?"":p)}});return l?o.jsxs("div",{className:"relative",children:[l.isFocused&&o.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:[o.jsx(te,{active:l.isActive("bold"),label:"Bold",onClick:()=>l.chain().focus().toggleBold().run(),children:o.jsx(Je,{size:14})}),o.jsx(te,{active:l.isActive("italic"),label:"Italic",onClick:()=>l.chain().focus().toggleItalic().run(),children:o.jsx(Me,{size:14})}),o.jsx(te,{active:l.isActive("underline"),label:"Underline",onClick:()=>l.chain().focus().toggleUnderline().run(),children:o.jsx(Ge,{size:14})}),o.jsx(te,{active:l.isActive("link"),label:"Link",onClick:()=>{const c=l.getAttributes("link").href,p=window.prompt("Link URL",c??"https://");p!==null&&(p===""?l.chain().focus().unsetLink().run():l.chain().focus().setLink({href:p}).run())},children:o.jsx(lt,{size:14})})]}),o.jsx(rt,{editor:l,className:"text-[15px] text-foreground"})]}):null}function te(g){const e=_.c(8),{active:t,label:i,onClick:l,children:c}=g,p=t?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let f;e[0]!==p?(f=Q("flex h-7 w-7 items-center justify-center rounded transition-colors cursor-pointer",p),e[0]=p,e[1]=f):f=e[1];let a;return e[2]!==t||e[3]!==c||e[4]!==i||e[5]!==l||e[6]!==f?(a=o.jsx("button",{type:"button","aria-label":i,"aria-pressed":t,onMouseDown:ht,onClick:l,className:f,children:c}),e[2]=t,e[3]=c,e[4]=i,e[5]=l,e[6]=f,e[7]=a):a=e[7],a}function ht(g){return g.preventDefault()}const bt=["1","2","3"],xe={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 vt(g){const e=_.c(19),{text:t,level:i,onChange:l}=g,[c,p]=q.useState(!1),f=i||"2";let a;e[0]!==c||e[1]!==f||e[2]!==l||e[3]!==t?(a=c&&o.jsx(de,{children:bt.map(x=>o.jsxs(se,{active:f===x,label:`Heading ${x}`,onClick:()=>l({text:t,level:x}),children:["H",x]},x))}),e[0]=c,e[1]=f,e[2]=l,e[3]=t,e[4]=a):a=e[4];let m;e[5]!==f||e[6]!==l?(m=x=>l({text:x,level:f}),e[5]=f,e[6]=l,e[7]=m):m=e[7];let d,h;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=()=>p(!0),h=()=>p(!1),e[8]=d,e[9]=h):(d=e[8],h=e[9]);const s=xe[f]??xe[2];let r;e[10]!==s?(r=Q("text-foreground",s),e[10]=s,e[11]=r):r=e[11];let n;e[12]!==m||e[13]!==r||e[14]!==t?(n=o.jsx(O,{value:t,onChange:m,onFocus:d,onBlur:h,placeholder:"Heading",className:r}),e[12]=m,e[13]=r,e[14]=t,e[15]=n):n=e[15];let u;return e[16]!==a||e[17]!==n?(u=o.jsxs("div",{className:"relative",children:[a,n]}),e[16]=a,e[17]=n,e[18]=u):u=e[18],u}function yt(g){const e=_.c(3),{quote:t,onChange:i}=g;let l;return e[0]!==i||e[1]!==t?(l=o.jsx("div",{className:"border-l-2 border-foreground/30 pl-4",children:o.jsx(O,{value:t,onChange:i,placeholder:"Quote",className:"text-lg italic text-foreground/90"})}),e[0]=i,e[1]=t,e[2]=l):l=e[2],l}function jt(g){const e=_.c(15),{code:t,language:i,onChange:l}=g;let c;e[0]!==t||e[1]!==l?(c=d=>l({code:t,language:d.target.value}),e[0]=t,e[1]=l,e[2]=c):c=e[2];let p;e[3]!==i||e[4]!==c?(p=o.jsx("input",{value:i,onChange:c,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]=i,e[4]=c,e[5]=p):p=e[5];let f;e[6]!==i||e[7]!==l?(f=d=>l({code:d,language:i}),e[6]=i,e[7]=l,e[8]=f):f=e[8];let a;e[9]!==t||e[10]!==f?(a=o.jsx(O,{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]=a):a=e[11];let m;return e[12]!==p||e[13]!==a?(m=o.jsxs("div",{className:"overflow-hidden rounded-md border bg-muted/50",children:[p,a]}),e[12]=p,e[13]=a,e[14]=m):m=e[14],m}function Ct(g){const e=_.c(17),{items:t,style:i,onChange:l}=g,c=i==="ordered",p=t.length?t.split(`
|
|
2
2
|
`):[""],[f,a]=q.useState(!1),m=q.useRef([]);let d;e[0]!==l||e[1]!==i?(d=k=>l({items:k.join(`
|
|
3
3
|
`),style:i}),e[0]=l,e[1]=i,e[2]=d):d=e[2];const h=d,s=(k,C)=>requestAnimationFrame(()=>{const N=m.current[k];if(!N)return;N.focus();const S=C==="end"?N.value.length:0;N.setSelectionRange(S,S)}),r="relative";let n,u;e[3]===Symbol.for("react.memo_cache_sentinel")?(n=()=>a(!0),u=k=>{k.currentTarget.contains(k.relatedTarget)||a(!1)},e[3]=n,e[4]=u):(n=e[3],u=e[4]);let x;e[5]!==f||e[6]!==t||e[7]!==l||e[8]!==c?(x=f&&o.jsxs(de,{children:[o.jsx(se,{active:!c,label:"Bulleted",onClick:()=>l({items:t,style:"unordered"}),children:"•"}),o.jsx(se,{active:c,label:"Numbered",onClick:()=>l({items:t,style:"ordered"}),children:"1."})]}),e[5]=f,e[6]=t,e[7]=l,e[8]=c,e[9]=x):x=e[9];const b="space-y-1",y=p.map((k,C)=>o.jsxs("li",{className:"flex items-start gap-2.5",children:[o.jsx("span",{className:"min-w-5 shrink-0 select-none pt-px text-right text-[15px] leading-relaxed text-muted-foreground tabular-nums",children:c?`${C+1}.`:"•"}),o.jsx(O,{inputRef:N=>{m.current[C]=N},value:k,onChange:N=>{const S=[...p];S[C]=N,h(S)},onKeyDown:N=>{const S=N.currentTarget;if(N.key==="Enter"){N.preventDefault();const T=[...p];T.splice(C+1,0,""),h(T),s(C+1,"start")}else N.key==="Backspace"&&k===""&&p.length>1?(N.preventDefault(),h(p.filter((T,A)=>A!==C)),s(Math.max(0,C-1),"end")):N.key==="ArrowUp"&&S.selectionStart===0&&C>0?(N.preventDefault(),s(C-1,"end")):N.key==="ArrowDown"&&S.selectionEnd===k.length&&C<p.length-1&&(N.preventDefault(),s(C+1,"end"))},placeholder:"List item",className:"text-[15px] leading-relaxed text-foreground"})]},C));let v;e[10]!==y?(v=o.jsx("ul",{className:b,children:y}),e[10]=y,e[11]=v):v=e[11];let j;return e[12]!==n||e[13]!==u||e[14]!==x||e[15]!==v?(j=o.jsxs("div",{className:r,onFocus:n,onBlur:u,children:[x,v]}),e[12]=n,e[13]=u,e[14]=x,e[15]=v,e[16]=j):j=e[16],j}function Nt(g){const e=_.c(37),{block:t,onChange:i}=g;let l;e[0]!==t.size?(l=w(t.size)||"normal",e[0]=t.size,e[1]=l):l=e[1];const c=l;let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p={type:"string",format:"image-uri",title:"Image"},e[2]=p):p=e[2];let f;e[3]!==t||e[4]!==i?(f=v=>i({...t,url:v}),e[3]=t,e[4]=i,e[5]=f):f=e[5];let a;e[6]!==t.url||e[7]!==f?(a=o.jsx(ke,{schema:p,value:t.url,onChange:f,path:"block-image-url",label:"Image"}),e[6]=t.url,e[7]=f,e[8]=a):a=e[8];let m;e[9]!==t.caption?(m=w(t.caption),e[9]=t.caption,e[10]=m):m=e[10];let d;e[11]!==t||e[12]!==i?(d=v=>i({...t,caption:v}),e[11]=t,e[12]=i,e[13]=d):d=e[13];let h;e[14]!==m||e[15]!==d?(h=o.jsx(O,{value:m,onChange:d,placeholder:"Add a caption…",className:"text-center text-sm italic text-muted-foreground"}),e[14]=m,e[15]=d,e[16]=h):h=e[16];let s;e[17]===Symbol.for("react.memo_cache_sentinel")?(s=["normal","full"],e[17]=s):s=e[17];let r;e[18]!==t||e[19]!==i||e[20]!==c?(r=o.jsx("div",{className:"flex items-center gap-1",children:s.map(v=>o.jsx("button",{type:"button",onClick:()=>i({...t,size:v}),className:Q("rounded px-2 py-0.5 transition-colors cursor-pointer",c===v?"bg-accent text-accent-foreground":"hover:bg-muted"),children:v==="full"?"Full width":"Normal"},v))}),e[18]=t,e[19]=i,e[20]=c,e[21]=r):r=e[21];let n;e[22]!==t.alt?(n=w(t.alt),e[22]=t.alt,e[23]=n):n=e[23];let u;e[24]!==t||e[25]!==i?(u=v=>i({...t,alt:v.target.value}),e[24]=t,e[25]=i,e[26]=u):u=e[26];let x;e[27]!==n||e[28]!==u?(x=o.jsx("input",{value:n,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]=n,e[28]=u,e[29]=x):x=e[29];let b;e[30]!==x||e[31]!==r?(b=o.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[r,x]}),e[30]=x,e[31]=r,e[32]=b):b=e[32];let y;return e[33]!==b||e[34]!==a||e[35]!==h?(y=o.jsxs("div",{className:"space-y-2",children:[a,h,b]}),e[33]=b,e[34]=a,e[35]=h,e[36]=y):y=e[36],y}function kt(g){const e=g.match(/(?:youtube\.com\/watch\?v=|youtu\.be\/)([\w-]{11})/);if(e)return`https://www.youtube.com/embed/${e[1]}`;const t=g.match(/vimeo\.com\/(\d+)/);return t?`https://player.vimeo.com/video/${t[1]}`:null}function St(g){const e=_.c(21),{url:t,caption:i,onChange:l}=g;let c;e[0]!==t?(c=kt(t),e[0]=t,e[1]=c):c=e[1];const p=c;let f;e[2]!==i||e[3]!==p?(f=p?o.jsx("div",{className:"relative aspect-video overflow-hidden rounded-md border bg-muted",children:o.jsx("iframe",{src:p,title:i||"Video",className:"absolute inset-0 h-full w-full border-0",allowFullScreen:!0})}):o.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]=i,e[3]=p,e[4]=f):f=e[4];let a;e[5]!==i||e[6]!==l?(a=r=>l({url:r.target.value,caption:i}),e[5]=i,e[6]=l,e[7]=a):a=e[7];let m;e[8]!==a||e[9]!==t?(m=o.jsx("input",{value:t,onChange:a,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]=a,e[9]=t,e[10]=m):m=e[10];let d;e[11]!==l||e[12]!==t?(d=r=>l({url:t,caption:r}),e[11]=l,e[12]=t,e[13]=d):d=e[13];let h;e[14]!==i||e[15]!==d?(h=o.jsx(O,{value:i,onChange:d,placeholder:"Add a caption…",className:"text-center text-sm italic text-muted-foreground"}),e[14]=i,e[15]=d,e[16]=h):h=e[16];let s;return e[17]!==f||e[18]!==m||e[19]!==h?(s=o.jsxs("div",{className:"space-y-2",children:[f,m,h]}),e[17]=f,e[18]=m,e[19]=h,e[20]=s):s=e[20],s}function wt(){const g=_.c(1);let e;return g[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx("div",{className:"flex items-center py-3","aria-label":"Divider",children:o.jsx("span",{className:"h-px flex-1 bg-border"})}),g[0]=e):e=g[0],e}function At(g){const e=_.c(16),{text:t,href:i,onChange:l}=g;let c;e[0]!==i||e[1]!==l?(c=h=>l({text:h.target.value,href:i}),e[0]=i,e[1]=l,e[2]=c):c=e[2];const p=Math.max(t.length||11,8);let f;e[3]!==c||e[4]!==p||e[5]!==t?(f=o.jsx("div",{className:"inline-flex items-center rounded-full bg-primary px-6 py-2 text-sm font-semibold text-primary-foreground",children:o.jsx("input",{value:t,onChange:c,placeholder:"Button label",size:p,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]=c,e[4]=p,e[5]=t,e[6]=f):f=e[6];let a;e[7]!==l||e[8]!==t?(a=h=>l({text:t,href:h.target.value}),e[7]=l,e[8]=t,e[9]=a):a=e[9];let m;e[10]!==i||e[11]!==a?(m=o.jsx("input",{value:i,onChange:a,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]=i,e[11]=a,e[12]=m):m=e[12];let d;return e[13]!==f||e[14]!==m?(d=o.jsxs("div",{className:"flex flex-col items-center gap-2 py-2",children:[f,m]}),e[13]=f,e[14]=m,e[15]=d):d=e[15],d}const re=[{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 Bt(g){const e=_.c(45),{title:t,body:i,variant:l,onChange:c}=g,[p,f]=q.useState(!1);let a;e[0]!==l?(a=re.find(A=>A.value===l)??re[0],e[0]=l,e[1]=a):a=e[1];const m=a;let d,h;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=()=>f(!0),h=A=>{A.currentTarget.contains(A.relatedTarget)||f(!1)},e[2]=d,e[3]=h):(d=e[2],h=e[3]);let s;e[4]!==i||e[5]!==p||e[6]!==c||e[7]!==t||e[8]!==m.value?(s=p&&o.jsx(de,{children:re.map(A=>o.jsx(se,{active:m.value===A.value,label:A.value,onClick:()=>c({title:t,body:i,variant:A.value}),children:o.jsx("span",{style:{color:A.color},children:A.icon})},A.value))}),e[4]=i,e[5]=p,e[6]=c,e[7]=t,e[8]=m.value,e[9]=s):s=e[9];const r=`3px solid ${m.color}`,n=`color-mix(in oklch, ${m.color} 8%, transparent)`;let u;e[10]!==r||e[11]!==n?(u={borderLeft:r,backgroundColor:n},e[10]=r,e[11]=n,e[12]=u):u=e[12];let x;e[13]!==m.color?(x={color:m.color},e[13]=m.color,e[14]=x):x=e[14];let b;e[15]!==m.icon?(b=o.jsx("span",{"aria-hidden":!0,className:"text-sm font-bold leading-none",children:m.icon}),e[15]=m.icon,e[16]=b):b=e[16];let y;e[17]!==i||e[18]!==c||e[19]!==l?(y=A=>c({title:A.target.value,body:i,variant:l}),e[17]=i,e[18]=c,e[19]=l,e[20]=y):y=e[20];let v;e[21]!==m.color?(v={color:m.color},e[21]=m.color,e[22]=v):v=e[22];let j;e[23]!==y||e[24]!==v||e[25]!==t?(j=o.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]=j):j=e[26];let k;e[27]!==j||e[28]!==x||e[29]!==b?(k=o.jsxs("div",{className:"mb-1.5 flex items-center gap-2",style:x,children:[b,j]}),e[27]=j,e[28]=x,e[29]=b,e[30]=k):k=e[30];let C;e[31]!==c||e[32]!==t||e[33]!==l?(C=A=>c({title:t,body:A,variant:l}),e[31]=c,e[32]=t,e[33]=l,e[34]=C):C=e[34];let N;e[35]!==i||e[36]!==C?(N=o.jsx(O,{value:i,onChange:C,placeholder:"Callout text…",className:"text-[15px] leading-relaxed text-foreground"}),e[35]=i,e[36]=C,e[37]=N):N=e[37];let S;e[38]!==k||e[39]!==N||e[40]!==u?(S=o.jsxs("div",{className:"rounded-md py-4 pl-5 pr-4",style:u,children:[k,N]}),e[38]=k,e[39]=N,e[40]=u,e[41]=S):S=e[41];let T;return e[42]!==S||e[43]!==s?(T=o.jsxs("div",{className:"relative",onFocus:d,onBlur:h,children:[s,S]}),e[42]=S,e[43]=s,e[44]=T):T=e[44],T}function _t(g){const e=_.c(25),{value:t,label:i,description:l,onChange:c}=g;let p;e[0]!==l||e[1]!==i||e[2]!==c?(p=r=>c({value:r.target.value,label:i,description:l}),e[0]=l,e[1]=i,e[2]=c,e[3]=p):p=e[3];let f;e[4]!==p||e[5]!==t?(f=o.jsx("input",{value:t,onChange:p,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]=p,e[5]=t,e[6]=f):f=e[6];let a;e[7]!==l||e[8]!==c||e[9]!==t?(a=r=>c({value:t,label:r.target.value,description:l}),e[7]=l,e[8]=c,e[9]=t,e[10]=a):a=e[10];let m;e[11]!==i||e[12]!==a?(m=o.jsx("input",{value:i,onChange:a,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]=i,e[12]=a,e[13]=m):m=e[13];let d;e[14]!==i||e[15]!==c||e[16]!==t?(d=r=>c({value:t,label:i,description:r}),e[14]=i,e[15]=c,e[16]=t,e[17]=d):d=e[17];let h;e[18]!==l||e[19]!==d?(h=o.jsx(O,{value:l,onChange:d,placeholder:"Optional description",className:"max-w-md text-center text-sm text-muted-foreground"}),e[18]=l,e[19]=d,e[20]=h):h=e[20];let s;return e[21]!==f||e[22]!==m||e[23]!==h?(s=o.jsxs("div",{className:"flex flex-col items-center gap-1.5 border-y border-border/60 py-8 text-center",children:[f,m,h]}),e[21]=f,e[22]=m,e[23]=h,e[24]=s):s=e[24],s}function It(g){const e=_.c(19),{cards:t,onChange:i}=g;let l,c,p,f,a;if(e[0]!==t||e[1]!==i){c=W(t);let s;e[7]!==i?(s=n=>i(JSON.stringify(n)),e[7]=i,e[8]=s):s=e[8],l=s;const r=(n,u)=>l(c.map((x,b)=>b===n?{...x,...u}:x));a="space-y-2",p="grid grid-cols-1 gap-3 sm:grid-cols-3",f=c.slice(0,3).map((n,u)=>o.jsxs("div",{className:"group/item relative flex flex-col gap-2 rounded-lg border bg-card p-4",children:[o.jsx("div",{className:"absolute right-1 top-1",children:o.jsx(X,{label:"Remove card",onClick:()=>l(c.filter((x,b)=>b!==u))})}),o.jsx("input",{value:w(n.icon),onChange:x=>r(u,{icon:x.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"}),o.jsx("input",{value:w(n.title),onChange:x=>r(u,{title:x.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"}),o.jsx(O,{value:w(n.body),onChange:x=>r(u,{body:x}),placeholder:"Card body",className:"text-sm text-muted-foreground"})]},u)),e[0]=t,e[1]=i,e[2]=l,e[3]=c,e[4]=p,e[5]=f,e[6]=a}else l=e[2],c=e[3],p=e[4],f=e[5],a=e[6];let m;e[9]!==p||e[10]!==f?(m=o.jsx("div",{className:p,children:f}),e[9]=p,e[10]=f,e[11]=m):m=e[11];let d;e[12]!==l||e[13]!==c?(d=c.length<3&&o.jsx(K,{label:"Add card",onClick:()=>l([...c,{title:"",body:""}])}),e[12]=l,e[13]=c,e[14]=d):d=e[14];let h;return e[15]!==a||e[16]!==m||e[17]!==d?(h=o.jsxs("div",{className:a,children:[m,d]}),e[15]=a,e[16]=m,e[17]=d,e[18]=h):h=e[18],h}function Tt(g){const e=_.c(27),{title:t,items:i,onChange:l}=g;let c,p,f,a,m;if(e[0]!==i||e[1]!==l||e[2]!==t){p=W(i);let r;e[8]!==l||e[9]!==t?(r=u=>l({title:t,items:JSON.stringify(u)}),e[8]=l,e[9]=t,e[10]=r):r=e[10],c=r,a="space-y-2";let n;e[11]!==i||e[12]!==l?(n=u=>l({title:u.target.value,items:i}),e[11]=i,e[12]=l,e[13]=n):n=e[13],e[14]!==n||e[15]!==t?(m=o.jsx("input",{value:t,onChange:n,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]=n,e[15]=t,e[16]=m):m=e[16],f=p.map((u,x)=>o.jsxs("li",{className:"group/item flex items-start gap-3 border-b border-border/50 py-2.5",children:[o.jsx("span",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center text-primary",children:o.jsx(nt,{size:15})}),o.jsx(O,{value:u,onChange:b=>c(p.map((y,v)=>v===x?b:y)),placeholder:"Checklist item",className:"text-[15px] text-foreground"}),o.jsx(X,{label:"Remove item",onClick:()=>c(p.filter((b,y)=>y!==x))})]},x)),e[0]=i,e[1]=l,e[2]=t,e[3]=c,e[4]=p,e[5]=f,e[6]=a,e[7]=m}else c=e[3],p=e[4],f=e[5],a=e[6],m=e[7];let d;e[17]!==f?(d=o.jsx("ul",{children:f}),e[17]=f,e[18]=d):d=e[18];let h;e[19]!==c||e[20]!==p?(h=o.jsx(K,{label:"Add item",onClick:()=>c([...p,""])}),e[19]=c,e[20]=p,e[21]=h):h=e[21];let s;return e[22]!==a||e[23]!==m||e[24]!==d||e[25]!==h?(s=o.jsxs("div",{className:a,children:[m,d,h]}),e[22]=a,e[23]=m,e[24]=d,e[25]=h,e[26]=s):s=e[26],s}function $t(g){const e=_.c(19),{stats:t,onChange:i}=g;let l,c,p,f,a;if(e[0]!==i||e[1]!==t){c=W(t);let s;e[7]!==i?(s=n=>i(JSON.stringify(n)),e[7]=i,e[8]=s):s=e[8],l=s;const r=(n,u)=>l(c.map((x,b)=>b===n?{...x,...u}:x));a="space-y-2",p="grid grid-cols-1 gap-3 sm:grid-cols-3",f=c.slice(0,3).map((n,u)=>o.jsxs("div",{className:"group/item relative rounded-lg border p-5 text-center",children:[o.jsx("div",{className:"absolute right-1 top-1",children:o.jsx(X,{label:"Remove stat",onClick:()=>l(c.filter((x,b)=>b!==u))})}),o.jsx("input",{value:w(n.value),onChange:x=>r(u,{value:x.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"}),o.jsx("input",{value:w(n.label),onChange:x=>r(u,{label:x.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]=i,e[1]=t,e[2]=l,e[3]=c,e[4]=p,e[5]=f,e[6]=a}else l=e[2],c=e[3],p=e[4],f=e[5],a=e[6];let m;e[9]!==p||e[10]!==f?(m=o.jsx("div",{className:p,children:f}),e[9]=p,e[10]=f,e[11]=m):m=e[11];let d;e[12]!==l||e[13]!==c?(d=c.length<3&&o.jsx(K,{label:"Add stat",onClick:()=>l([...c,{value:"",label:""}])}),e[12]=l,e[13]=c,e[14]=d):d=e[14];let h;return e[15]!==a||e[16]!==m||e[17]!==d?(h=o.jsxs("div",{className:a,children:[m,d]}),e[15]=a,e[16]=m,e[17]=d,e[18]=h):h=e[18],h}function Rt(g){const e=_.c(29),{title:t,steps:i,onChange:l}=g;let c,p,f,a,m,d;if(e[0]!==l||e[1]!==i||e[2]!==t){p=W(i);let n;e[9]!==l||e[10]!==t?(n=b=>l({title:t,steps:JSON.stringify(b)}),e[9]=l,e[10]=t,e[11]=n):n=e[11],c=n;const u=(b,y)=>c(p.map((v,j)=>j===b?{...v,...y}:v));m="space-y-2";let x;e[12]!==l||e[13]!==i?(x=b=>l({title:b.target.value,steps:i}),e[12]=l,e[13]=i,e[14]=x):x=e[14],e[15]!==x||e[16]!==t?(d=o.jsx("input",{value:t,onChange:x,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]=x,e[16]=t,e[17]=d):d=e[17],f="space-y-3",a=p.map((b,y)=>o.jsxs("li",{className:"group/item flex gap-4",children:[o.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}),o.jsxs("div",{className:"min-w-0 flex-1 space-y-1 pt-0.5",children:[o.jsx("input",{value:w(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"}),o.jsx(O,{value:w(b.description),onChange:v=>u(y,{description:v}),placeholder:"Step description",className:"text-sm text-muted-foreground"})]}),o.jsx(X,{label:"Remove step",onClick:()=>c(p.filter((v,j)=>j!==y))})]},y)),e[0]=l,e[1]=i,e[2]=t,e[3]=c,e[4]=p,e[5]=f,e[6]=a,e[7]=m,e[8]=d}else c=e[3],p=e[4],f=e[5],a=e[6],m=e[7],d=e[8];let h;e[18]!==f||e[19]!==a?(h=o.jsx("ol",{className:f,children:a}),e[18]=f,e[19]=a,e[20]=h):h=e[20];let s;e[21]!==c||e[22]!==p?(s=o.jsx(K,{label:"Add step",onClick:()=>c([...p,{title:"",description:""}])}),e[21]=c,e[22]=p,e[23]=s):s=e[23];let r;return e[24]!==m||e[25]!==d||e[26]!==h||e[27]!==s?(r=o.jsxs("div",{className:m,children:[d,h,s]}),e[24]=m,e[25]=d,e[26]=h,e[27]=s,e[28]=r):r=e[28],r}function he(g,e){try{const t=JSON.parse(g||"{}");return{title:typeof t?.title=="string"?t.title:e,items:Array.isArray(t?.items)?t.items:[]}}catch{return{title:e,items:[]}}}function Lt(g){const e=_.c(7),{left:t,right:i,onChange:l}=g;let c;if(e[0]!==t||e[1]!==l||e[2]!==i){const p={left:he(t,"Option A"),right:he(i,"Option B")},f=(h,s)=>l({left:h==="left"?JSON.stringify(s):t,right:h==="right"?JSON.stringify(s):i});let a;e[4]!==f?(a=(h,s,r)=>{const n=s.items??[];return o.jsxs("div",{className:"space-y-2 rounded-lg border p-4",children:[o.jsx("input",{value:w(s.title),onChange:u=>f(h,{...s,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"}),o.jsx("ul",{className:"space-y-1.5",children:n.map((u,x)=>o.jsxs("li",{className:"group/item flex items-start gap-2",children:[o.jsx("span",{"aria-hidden":!0,className:"mt-0.5 shrink-0 text-sm font-bold",style:{color:r},children:"✓"}),o.jsx(O,{value:u,onChange:b=>f(h,{...s,items:n.map((y,v)=>v===x?b:y)}),placeholder:"Item",className:"text-sm text-foreground"}),o.jsx(X,{label:"Remove item",onClick:()=>f(h,{...s,items:n.filter((b,y)=>y!==x)})})]},x))}),o.jsx(K,{label:"Add item",onClick:()=>f(h,{...s,items:[...n,""]})})]})},e[4]=f,e[5]=a):a=e[5];const m=a;let d;e[6]===Symbol.for("react.memo_cache_sentinel")?(d=Q("grid grid-cols-1 gap-3 sm:grid-cols-2"),e[6]=d):d=e[6],c=o.jsxs("div",{className:d,children:[m("left",p.left,"oklch(0.65 0.17 150)"),m("right",p.right,"oklch(0.75 0.15 75)")]}),e[0]=t,e[1]=l,e[2]=i,e[3]=c}else c=e[3];return c}const Pt="vtex/loaders/intelligentSearch/productList.ts";function F(g){return g&&typeof g=="object"&&!Array.isArray(g)?g:null}function ne(g){return typeof g=="string"||typeof g=="number"?String(g):""}function ie(g){const e=F(g);return!!e&&typeof e.__resolveType=="string"&&"productId"in e}function je(g){if(Array.isArray(g))return g.map(i=>ne(F(i)?.productId));const e=F(g),t=F(e?.props);return t&&Array.isArray(t.ids)?t.ids.map(ne):e&&"productId"in e?[ne(e.productId)]:[]}function Dt(g){const e=F(g)??{};return typeof e.__resolveType=="string"?e.__resolveType:Pt}function Ce(g,e){if(Array.isArray(g)){const c=g.find(ie);if(c)return e.map((p,f)=>{const a=F(g[f]);return{...ie(a)?a:{__resolveType:c.__resolveType},productId:p}})}const t=F(g);if(ie(t)&&!F(t.props)?.ids)return{...t,productId:e[0]??""};const i=F(t?.props)??{},l=Dt(g);return{...t??{},__resolveType:l,props:{...i,ids:e,simulationBehavior:i.simulationBehavior??"default"}}}function Et(g){const e=_.c(21),{ids:t,onChange:i,label:l}=g;let c;e[0]!==t||e[1]!==i?(c=(r,n)=>i(t.map((u,x)=>x===r?n:u)),e[0]=t,e[1]=i,e[2]=c):c=e[2];const p=c;let f;e[3]!==l?(f=o.jsx(le,{className:"text-xs text-muted-foreground",children:l}),e[3]=l,e[4]=f):f=e[4];let a;e[5]!==t.length?(a=t.length===0&&o.jsx("p",{className:"text-xs text-muted-foreground",children:"No product IDs yet — add one below."}),e[5]=t.length,e[6]=a):a=e[6];let m;e[7]!==t||e[8]!==i||e[9]!==p?(m=t.map((r,n)=>o.jsxs("li",{className:"group/item flex items-center gap-3",children:[o.jsx("input",{value:r,onChange:u=>p(n,u.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"}),o.jsx(X,{label:"Remove product ID",onClick:()=>i(t.filter((u,x)=>x!==n))})]},n)),e[7]=t,e[8]=i,e[9]=p,e[10]=m):m=e[10];let d;e[11]!==m?(d=o.jsx("ul",{className:"space-y-2",children:m}),e[11]=m,e[12]=d):d=e[12];let h;e[13]!==t||e[14]!==i?(h=o.jsx(K,{label:"Add product ID",onClick:()=>i([...t,""])}),e[13]=t,e[14]=i,e[15]=h):h=e[15];let s;return e[16]!==f||e[17]!==a||e[18]!==d||e[19]!==h?(s=o.jsxs("div",{className:"space-y-2",children:[f,a,d,h]}),e[16]=f,e[17]=a,e[18]=d,e[19]=h,e[20]=s):s=e[20],s}function Ot(g){const e=_.c(32),{block:t,onChange:i}=g;let l;e[0]!==t.product?(l=je(t.product),e[0]=t.product,e[1]=l):l=e[1];const p=l[0]??"";let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx("div",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Product card"}),e[2]=f):f=e[2];let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx(le,{htmlFor:"product-card-cta",className:"text-xs text-muted-foreground",children:"CTA label"}),e[3]=a):a=e[3];let m;e[4]!==t.textCta?(m=w(t.textCta),e[4]=t.textCta,e[5]=m):m=e[5];let d;e[6]!==t||e[7]!==i?(d=j=>i({...t,textCta:j.target.value}),e[6]=t,e[7]=i,e[8]=d):d=e[8];let h;e[9]!==m||e[10]!==d?(h=o.jsxs("div",{className:"space-y-2",children:[a,o.jsx("input",{id:"product-card-cta",value:m,onChange:d,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[9]=m,e[10]=d,e[11]=h):h=e[11];let s;e[12]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx(le,{htmlFor:"product-card-slug",className:"text-xs text-muted-foreground",children:"Product slug"}),e[12]=s):s=e[12];let r;e[13]!==t.productSlug?(r=w(t.productSlug),e[13]=t.productSlug,e[14]=r):r=e[14];let n;e[15]!==t||e[16]!==i?(n=j=>i({...t,productSlug:j.target.value}),e[15]=t,e[16]=i,e[17]=n):n=e[17];let u;e[18]!==r||e[19]!==n?(u=o.jsxs("div",{className:"space-y-2",children:[s,o.jsx("input",{id:"product-card-slug",value:r,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[18]=r,e[19]=n,e[20]=u):u=e[20];let x;e[21]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(le,{htmlFor:"product-card-id",className:"text-xs text-muted-foreground",children:"VTEX product ID"}),e[21]=x):x=e[21];let b;e[22]!==t||e[23]!==i?(b=j=>i({...t,product:Ce(t.product,j.target.value?[j.target.value]:[])}),e[22]=t,e[23]=i,e[24]=b):b=e[24];let y;e[25]!==p||e[26]!==b?(y=o.jsxs("div",{className:"space-y-2",children:[x,o.jsx("input",{id:"product-card-id",value:p,onChange:b,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"})]}),e[25]=p,e[26]=b,e[27]=y):y=e[27];let v;return e[28]!==u||e[29]!==y||e[30]!==h?(v=o.jsxs("div",{className:"space-y-4 rounded-lg border bg-card p-4",children:[f,h,u,y]}),e[28]=u,e[29]=y,e[30]=h,e[31]=v):v=e[31],v}function zt(g){const e=_.c(19),{block:t,onChange:i}=g;let l;e[0]!==t.products?(l=je(t.products),e[0]=t.products,e[1]=l):l=e[1];const c=l;let p;e[2]!==t.title?(p=w(t.title),e[2]=t.title,e[3]=p):p=e[3];let f;e[4]!==t||e[5]!==i?(f=s=>i({...t,title:s.target.value}),e[4]=t,e[5]=i,e[6]=f):f=e[6];let a;e[7]!==p||e[8]!==f?(a=o.jsx("input",{value:p,onChange:f,placeholder:"Shelf title",className:"w-full border-0 bg-transparent p-0 text-lg font-semibold outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[7]=p,e[8]=f,e[9]=a):a=e[9];let m;e[10]!==t||e[11]!==i?(m=s=>i({...t,products:Ce(t.products,s)}),e[10]=t,e[11]=i,e[12]=m):m=e[12];let d;e[13]!==c||e[14]!==m?(d=o.jsx(Et,{label:"VTEX product IDs",ids:c,onChange:m}),e[13]=c,e[14]=m,e[15]=d):d=e[15];let h;return e[16]!==a||e[17]!==d?(h=o.jsxs("div",{className:"space-y-4 rounded-lg border bg-card p-4",children:[a,d]}),e[16]=a,e[17]=d,e[18]=h):h=e[18],h}const Ut=2,Ft=2;function Ht(g){return W(g).map(w)}function Jt(g){return W(g).map(e=>Array.isArray(e)?e.map(w):[])}function be(g){return Array.from({length:g},()=>"")}function Mt(g){const e=_.c(42),{headers:t,rows:i,onChange:l}=g;let c,p,f,a,m,d,h,s,r;if(e[0]!==t||e[1]!==l||e[2]!==i){const N=Ht(t),S=Jt(i),T=N.length===0&&S.length===0;f=T?Ut:Math.max(N.length,...S.map(qt),1);const A=Array.from({length:f},(I,B)=>N[B]??"");a=T?Array.from({length:Ft},()=>be(f)):S.map(I=>Array.from({length:f},(B,R)=>I[R]??""));let P;e[12]!==l?(P=(I,B)=>l({headers:JSON.stringify(I.some(Vt)?I:[]),rows:JSON.stringify(B)}),e[12]=l,e[13]=P):P=e[13];const z=P,Y=(I,B)=>z(A.map((R,D)=>D===I?B:R),a),Z=(I,B,R)=>z(A,a.map((D,$)=>$===I?D.map((E,L)=>L===B?R:E):D));p=()=>z(A,[...a,be(f)]);const H=I=>z(A,a.filter((B,R)=>R!==I));c=()=>z([...A,""],a.map(Gt));const J=I=>z(A.filter((B,R)=>R!==I),a.map(B=>B.filter((R,D)=>D!==I)));r="space-y-2",s="overflow-x-auto rounded-lg border",d="w-full border-collapse";let M;e[14]===Symbol.for("react.memo_cache_sentinel")?(M=o.jsx("th",{className:"w-8 border-b"}),e[14]=M):M=e[14];const U=o.jsxs("tr",{className:"bg-muted/40",children:[A.map((I,B)=>o.jsxs("th",{className:"group/col relative border-b border-r p-0 last:border-r-0",children:[o.jsx("input",{value:I,onChange:R=>Y(B,R.target.value),placeholder:`Header ${B+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&&o.jsx("button",{type:"button","aria-label":`Remove column ${B+1}`,onClick:()=>J(B),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:o.jsx(ae,{size:12})})]},B)),M]});e[15]!==U?(h=o.jsx("thead",{children:U}),e[15]=U,e[16]=h):h=e[16],m=a.map((I,B)=>o.jsxs("tr",{className:"group/item border-b last:border-b-0",children:[I.map((R,D)=>o.jsx("td",{className:"border-r p-0 last:border-r-0",children:o.jsx("input",{value:R,onChange:$=>Z(B,D,$.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)),o.jsx("td",{className:"w-8 text-center align-middle",children:a.length>1&&o.jsx("button",{type:"button","aria-label":`Remove row ${B+1}`,onClick:()=>H(B),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:o.jsx(ae,{size:13})})})]},B)),e[0]=t,e[1]=l,e[2]=i,e[3]=c,e[4]=p,e[5]=f,e[6]=a,e[7]=m,e[8]=d,e[9]=h,e[10]=s,e[11]=r}else c=e[3],p=e[4],f=e[5],a=e[6],m=e[7],d=e[8],h=e[9],s=e[10],r=e[11];let n;e[17]!==f||e[18]!==a.length?(n=a.length===0&&o.jsx("tr",{children:o.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]=a.length,e[19]=n):n=e[19];let u;e[20]!==m||e[21]!==n?(u=o.jsxs("tbody",{children:[m,n]}),e[20]=m,e[21]=n,e[22]=u):u=e[22];let x;e[23]!==d||e[24]!==h||e[25]!==u?(x=o.jsxs("table",{className:d,children:[h,u]}),e[23]=d,e[24]=h,e[25]=u,e[26]=x):x=e[26];let b;e[27]!==s||e[28]!==x?(b=o.jsx("div",{className:s,children:x}),e[27]=s,e[28]=x,e[29]=b):b=e[29];let y;e[30]!==p?(y=o.jsx(K,{label:"Add row",onClick:p}),e[30]=p,e[31]=y):y=e[31];let v;e[32]===Symbol.for("react.memo_cache_sentinel")?(v=o.jsx(ve,{size:13}),e[32]=v):v=e[32];let j;e[33]!==c?(j=o.jsxs("button",{type:"button",onClick:c,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]=c,e[34]=j):j=e[34];let k;e[35]!==y||e[36]!==j?(k=o.jsxs("div",{className:"flex gap-2",children:[y,j]}),e[35]=y,e[36]=j,e[37]=k):k=e[37];let C;return e[38]!==k||e[39]!==r||e[40]!==b?(C=o.jsxs("div",{className:r,children:[b,k]}),e[38]=k,e[39]=r,e[40]=b,e[41]=C):C=e[41],C}function Gt(g){return[...g,""]}function Vt(g){return g.trim()!==""}function qt(g){return g.length}function Qt(g){const e=_.c(180),{block:t,meta:i,onChange:l}=g,c=t.__resolveType??"",p=Se(c);if(we(c))switch(p){case"Paragraph":{let s;e[0]!==t.html?(s=w(t.html),e[0]=t.html,e[1]=s):s=e[1];let r;e[2]!==t||e[3]!==l?(r=u=>l({...t,html:u}),e[2]=t,e[3]=l,e[4]=r):r=e[4];let n;return e[5]!==s||e[6]!==r?(n=o.jsx(xt,{html:s,placeholder:"Write something…",onChange:r}),e[5]=s,e[6]=r,e[7]=n):n=e[7],n}case"Heading":{let s;e[8]!==t.text?(s=w(t.text),e[8]=t.text,e[9]=s):s=e[9];let r;e[10]!==t.level?(r=w(t.level),e[10]=t.level,e[11]=r):r=e[11];let n;e[12]!==t||e[13]!==l?(n=x=>l({...t,...x}),e[12]=t,e[13]=l,e[14]=n):n=e[14];let u;return e[15]!==s||e[16]!==r||e[17]!==n?(u=o.jsx(vt,{text:s,level:r,onChange:n}),e[15]=s,e[16]=r,e[17]=n,e[18]=u):u=e[18],u}case"Quote":{let s;e[19]!==t.quote?(s=w(t.quote),e[19]=t.quote,e[20]=s):s=e[20];let r;e[21]!==t||e[22]!==l?(r=u=>l({...t,quote:u}),e[21]=t,e[22]=l,e[23]=r):r=e[23];let n;return e[24]!==s||e[25]!==r?(n=o.jsx(yt,{quote:s,onChange:r}),e[24]=s,e[25]=r,e[26]=n):n=e[26],n}case"Code":{let s;e[27]!==t.code?(s=w(t.code),e[27]=t.code,e[28]=s):s=e[28];let r;e[29]!==t.language?(r=w(t.language),e[29]=t.language,e[30]=r):r=e[30];let n;e[31]!==t||e[32]!==l?(n=x=>l({...t,...x}),e[31]=t,e[32]=l,e[33]=n):n=e[33];let u;return e[34]!==s||e[35]!==r||e[36]!==n?(u=o.jsx(jt,{code:s,language:r,onChange:n}),e[34]=s,e[35]=r,e[36]=n,e[37]=u):u=e[37],u}case"List":{let s;e[38]!==t.items?(s=w(t.items),e[38]=t.items,e[39]=s):s=e[39];let r;e[40]!==t.style?(r=w(t.style),e[40]=t.style,e[41]=r):r=e[41];let n;e[42]!==t||e[43]!==l?(n=x=>l({...t,...x}),e[42]=t,e[43]=l,e[44]=n):n=e[44];let u;return e[45]!==s||e[46]!==r||e[47]!==n?(u=o.jsx(Ct,{items:s,style:r,onChange:n}),e[45]=s,e[46]=r,e[47]=n,e[48]=u):u=e[48],u}case"BlockImage":{let s;return e[49]!==t||e[50]!==l?(s=o.jsx(Nt,{block:t,onChange:l}),e[49]=t,e[50]=l,e[51]=s):s=e[51],s}case"Video":{let s;e[52]!==t.url?(s=w(t.url),e[52]=t.url,e[53]=s):s=e[53];let r;e[54]!==t.caption?(r=w(t.caption),e[54]=t.caption,e[55]=r):r=e[55];let n;e[56]!==t||e[57]!==l?(n=x=>l({...t,...x}),e[56]=t,e[57]=l,e[58]=n):n=e[58];let u;return e[59]!==s||e[60]!==r||e[61]!==n?(u=o.jsx(St,{url:s,caption:r,onChange:n}),e[59]=s,e[60]=r,e[61]=n,e[62]=u):u=e[62],u}case"Divider":{let s;return e[63]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx(wt,{}),e[63]=s):s=e[63],s}case"Cta":{let s;e[64]!==t.text?(s=w(t.text),e[64]=t.text,e[65]=s):s=e[65];let r;e[66]!==t.href?(r=w(t.href),e[66]=t.href,e[67]=r):r=e[67];let n;e[68]!==t||e[69]!==l?(n=x=>l({...t,...x}),e[68]=t,e[69]=l,e[70]=n):n=e[70];let u;return e[71]!==s||e[72]!==r||e[73]!==n?(u=o.jsx(At,{text:s,href:r,onChange:n}),e[71]=s,e[72]=r,e[73]=n,e[74]=u):u=e[74],u}case"Callout":{let s;e[75]!==t.title?(s=w(t.title),e[75]=t.title,e[76]=s):s=e[76];let r;e[77]!==t.body?(r=w(t.body),e[77]=t.body,e[78]=r):r=e[78];let n;e[79]!==t.variant?(n=w(t.variant),e[79]=t.variant,e[80]=n):n=e[80];let u;e[81]!==t||e[82]!==l?(u=b=>l({...t,...b}),e[81]=t,e[82]=l,e[83]=u):u=e[83];let x;return e[84]!==s||e[85]!==r||e[86]!==n||e[87]!==u?(x=o.jsx(Bt,{title:s,body:r,variant:n,onChange:u}),e[84]=s,e[85]=r,e[86]=n,e[87]=u,e[88]=x):x=e[88],x}case"Stat":{let s;e[89]!==t.value?(s=w(t.value),e[89]=t.value,e[90]=s):s=e[90];let r;e[91]!==t.label?(r=w(t.label),e[91]=t.label,e[92]=r):r=e[92];let n;e[93]!==t.description?(n=w(t.description),e[93]=t.description,e[94]=n):n=e[94];let u;e[95]!==t||e[96]!==l?(u=b=>l({...t,...b}),e[95]=t,e[96]=l,e[97]=u):u=e[97];let x;return e[98]!==s||e[99]!==r||e[100]!==n||e[101]!==u?(x=o.jsx(_t,{value:s,label:r,description:n,onChange:u}),e[98]=s,e[99]=r,e[100]=n,e[101]=u,e[102]=x):x=e[102],x}case"StatGroup":{let s;e[103]!==t.stats?(s=w(t.stats),e[103]=t.stats,e[104]=s):s=e[104];let r;e[105]!==t||e[106]!==l?(r=u=>l({...t,stats:u}),e[105]=t,e[106]=l,e[107]=r):r=e[107];let n;return e[108]!==s||e[109]!==r?(n=o.jsx($t,{stats:s,onChange:r}),e[108]=s,e[109]=r,e[110]=n):n=e[110],n}case"CardGroup":{let s;e[111]!==t.cards?(s=typeof t.cards=="string"?t.cards:JSON.stringify(t.cards??[]),e[111]=t.cards,e[112]=s):s=e[112];let r;e[113]!==t||e[114]!==l?(r=u=>l({...t,cards:u}),e[113]=t,e[114]=l,e[115]=r):r=e[115];let n;return e[116]!==s||e[117]!==r?(n=o.jsx(It,{cards:s,onChange:r}),e[116]=s,e[117]=r,e[118]=n):n=e[118],n}case"Checklist":{let s;e[119]!==t.title?(s=w(t.title),e[119]=t.title,e[120]=s):s=e[120];let r;e[121]!==t.items?(r=w(t.items),e[121]=t.items,e[122]=r):r=e[122];let n;e[123]!==t||e[124]!==l?(n=x=>l({...t,...x}),e[123]=t,e[124]=l,e[125]=n):n=e[125];let u;return e[126]!==s||e[127]!==r||e[128]!==n?(u=o.jsx(Tt,{title:s,items:r,onChange:n}),e[126]=s,e[127]=r,e[128]=n,e[129]=u):u=e[129],u}case"Steps":{let s;e[130]!==t.title?(s=w(t.title),e[130]=t.title,e[131]=s):s=e[131];let r;e[132]!==t.steps?(r=w(t.steps),e[132]=t.steps,e[133]=r):r=e[133];let n;e[134]!==t||e[135]!==l?(n=x=>l({...t,...x}),e[134]=t,e[135]=l,e[136]=n):n=e[136];let u;return e[137]!==s||e[138]!==r||e[139]!==n?(u=o.jsx(Rt,{title:s,steps:r,onChange:n}),e[137]=s,e[138]=r,e[139]=n,e[140]=u):u=e[140],u}case"Comparison":{let s;e[141]!==t.left?(s=w(t.left),e[141]=t.left,e[142]=s):s=e[142];let r;e[143]!==t.right?(r=w(t.right),e[143]=t.right,e[144]=r):r=e[144];let n;e[145]!==t||e[146]!==l?(n=x=>l({...t,...x}),e[145]=t,e[146]=l,e[147]=n):n=e[147];let u;return e[148]!==s||e[149]!==r||e[150]!==n?(u=o.jsx(Lt,{left:s,right:r,onChange:n}),e[148]=s,e[149]=r,e[150]=n,e[151]=u):u=e[151],u}case"Table":{let s;e[152]!==t.headers?(s=typeof t.headers=="string"?t.headers:JSON.stringify(t.headers??[]),e[152]=t.headers,e[153]=s):s=e[153];let r;e[154]!==t.rows?(r=typeof t.rows=="string"?t.rows:JSON.stringify(t.rows??[]),e[154]=t.rows,e[155]=r):r=e[155];let n;e[156]!==t||e[157]!==l?(n=x=>l({...t,...x}),e[156]=t,e[157]=l,e[158]=n):n=e[158];let u;return e[159]!==s||e[160]!==r||e[161]!==n?(u=o.jsx(Mt,{headers:s,rows:r,onChange:n}),e[159]=s,e[160]=r,e[161]=n,e[162]=u):u=e[162],u}case"ProductCard":{let s;return e[163]!==t||e[164]!==l?(s=o.jsx(Ot,{block:t,onChange:l}),e[163]=t,e[164]=l,e[165]=s):s=e[165],s}case"ProductShelf":{let s;return e[166]!==t||e[167]!==l?(s=o.jsx(zt,{block:t,onChange:l}),e[166]=t,e[167]=l,e[168]=s):s=e[168],s}}let a;e[169]!==i||e[170]!==c?(a=c?Ae(c,i):null,e[169]=i,e[170]=c,e[171]=a):a=e[171];const m=a;if(!m){const s=c?` (${c})`:"";let r;return e[172]!==s?(r=o.jsxs("p",{className:"text-xs text-muted-foreground",children:["Unknown block type",s,"."]}),e[172]=s,e[173]=r):r=e[173],r}let d;e[174]!==l?(d=s=>l(s),e[174]=l,e[175]=d):d=e[175];let h;return e[176]!==t||e[177]!==m||e[178]!==d?(h=o.jsx(Be,{schema:m,value:t,onChange:d,basePath:""}),e[176]=t,e[177]=m,e[178]=d,e[179]=h):h=e[179],h}function Kt(g){const e=_.c(33),{id:t,block:i,meta:l,onChange:c,onDelete:p,onDuplicate:f}=g;let a;e[0]!==t?(a={id:t},e[0]=t,e[1]=a):a=e[1];const{attributes:m,listeners:d,setNodeRef:h,transform:s,transition:r,isDragging:n}=_e(a);let u;e[2]!==s?(u=Ie.Transform.toString(s),e[2]=s,e[3]=u):u=e[3];let x;e[4]!==u||e[5]!==r?(x={transform:u,transition:r},e[4]=u,e[5]=r,e[6]=x):x=e[6];const b=n&&"opacity-50";let y;e[7]!==b?(y=Q("group/row relative rounded-md py-1.5 pl-12 pr-2 transition-colors hover:bg-muted/40",b),e[7]=b,e[8]=y):y=e[8];let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=o.jsx(tt,{size:14}),e[9]=v):v=e[9];let j;e[10]!==m||e[11]!==d?(j=o.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",...m,...d,children:v}),e[10]=m,e[11]=d,e[12]=j):j=e[12];let k;e[13]===Symbol.for("react.memo_cache_sentinel")?(k=o.jsx(et,{size:14}),e[13]=k):k=e[13];let C;e[14]!==f?(C=o.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:k}),e[14]=f,e[15]=C):C=e[15];let N;e[16]===Symbol.for("react.memo_cache_sentinel")?(N=o.jsx(ae,{size:14}),e[16]=N):N=e[16];let S;e[17]!==p?(S=o.jsx("button",{type:"button","aria-label":"Delete block",onClick:p,className:"flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-destructive cursor-pointer",children:N}),e[17]=p,e[18]=S):S=e[18];let T;e[19]!==S||e[20]!==C?(T=o.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:[C,S]}),e[19]=S,e[20]=C,e[21]=T):T=e[21];let A;e[22]!==i||e[23]!==l||e[24]!==c?(A=o.jsx(Qt,{block:i,meta:l,onChange:c}),e[22]=i,e[23]=l,e[24]=c,e[25]=A):A=e[25];let P;return e[26]!==h||e[27]!==T||e[28]!==A||e[29]!==x||e[30]!==y||e[31]!==j?(P=o.jsxs("div",{ref:h,style:x,className:y,children:[j,T,A]}),e[26]=h,e[27]=T,e[28]=A,e[29]=x,e[30]=y,e[31]=j,e[32]=P):P=e[32],P}function xl(g){return Array.isArray(g)?g:[]}function hl(g){const e=_.c(62),{value:t,onChange:i,meta:l,emptyMessage:c}=g,p=c===void 0?"No content yet. Use ⊕ to add your first block.":c;let f;e[0]!==l?(f=Te(l),e[0]=l,e[1]=f):f=e[1];const a=f;let m;e[2]!==t?(m=()=>t.map(Zt),e[2]=t,e[3]=m):m=e[3];const[d,h]=q.useState(m);let s;e[4]!==d?(s=d.map(Xt),e[4]=d,e[5]=s):s=e[5];const r=s;let n;e[6]!==d?(n=d.map(Wt),e[6]=d,e[7]=n):n=e[7];const u=n;let x;e[8]!==i?(x=$=>{h($),i($.map(Yt))},e[8]=i,e[9]=x):x=e[9];const b=x;let y;e[10]!==d||e[11]!==b?(y=($,E)=>{const L=[...d];L.splice($,0,{id:ce(),block:{__resolveType:E}}),b(L)},e[10]=d,e[11]=b,e[12]=y):y=e[12];const v=y;let j;e[13]!==d||e[14]!==b?(j=($,E)=>{b(d.map((L,G)=>G===$?{...L,block:E}:L))},e[13]=d,e[14]=b,e[15]=j):j=e[15];const k=j;let C;e[16]!==d||e[17]!==b?(C=$=>{b(d.filter((E,L)=>L!==$))},e[16]=d,e[17]=b,e[18]=C):C=e[18];const N=C;let S;e[19]!==d||e[20]!==b?(S=$=>{const E=d[$];if(!E)return;const L=[...d];L.splice($+1,0,{id:ce(),block:structuredClone(E.block)}),b(L)},e[19]=d,e[20]=b,e[21]=S):S=e[21];const T=S;let A;e[22]===Symbol.for("react.memo_cache_sentinel")?(A={activationConstraint:{distance:6}},e[22]=A):A=e[22];let P;e[23]===Symbol.for("react.memo_cache_sentinel")?(P={coordinateGetter:Pe},e[23]=P):P=e[23];const z=$e(ue(Le,A),ue(Re,P));let Y;e[24]!==d||e[25]!==b?(Y=$=>{const{active:E,over:L}=$;if(!L||E.id===L.id)return;const G=d.findIndex(V=>V.id===String(E.id)),ee=d.findIndex(V=>V.id===String(L.id));G===-1||ee===-1||b(De(d,G,ee))},e[24]=d,e[25]=b,e[26]=Y):Y=e[26];const Z=Y;let H;e[27]!==u.length||e[28]!==p?(H=u.length===0&&o.jsx("p",{className:"py-6 text-center text-sm text-muted-foreground",children:p}),e[27]=u.length,e[28]=p,e[29]=H):H=e[29];let J;e[30]!==v?(J=$=>v(0,$),e[30]=v,e[31]=J):J=e[31];const M=u.length===0;let U;e[32]!==a||e[33]!==J||e[34]!==M?(U=o.jsx(ge,{blockTypes:a,onInsert:J,alwaysShow:M}),e[32]=a,e[33]=J,e[34]=M,e[35]=U):U=e[35];let I;if(e[36]!==d||e[37]!==a||e[38]!==T||e[39]!==v||e[40]!==l||e[41]!==N||e[42]!==k){let $;e[44]!==a||e[45]!==T||e[46]!==v||e[47]!==l||e[48]!==N||e[49]!==k?($=(E,L)=>{const{id:G,block:ee}=E;return o.jsxs("div",{children:[o.jsx(Kt,{id:G,block:ee,meta:l,onChange:V=>k(L,V),onDelete:()=>N(L),onDuplicate:()=>T(L)}),o.jsx(ge,{blockTypes:a,onInsert:V=>v(L+1,V)})]},G)},e[44]=a,e[45]=T,e[46]=v,e[47]=l,e[48]=N,e[49]=k,e[50]=$):$=e[50],I=d.map($),e[36]=d,e[37]=a,e[38]=T,e[39]=v,e[40]=l,e[41]=N,e[42]=k,e[43]=I}else I=e[43];let B;e[51]!==r||e[52]!==U||e[53]!==I?(B=o.jsxs(Ee,{items:r,strategy:Oe,children:[U,I]}),e[51]=r,e[52]=U,e[53]=I,e[54]=B):B=e[54];let R;e[55]!==Z||e[56]!==z||e[57]!==B?(R=o.jsx(ze,{sensors:z,collisionDetection:Ue,onDragEnd:Z,children:B}),e[55]=Z,e[56]=z,e[57]=B,e[58]=R):R=e[58];let D;return e[59]!==H||e[60]!==R?(D=o.jsxs("div",{className:"mt-2",children:[H,R]}),e[59]=H,e[60]=R,e[61]=D):D=e[61],D}function Yt(g){return g.block}function Wt(g){return g.block}function Xt(g){return g.id}function Zt(g){return{id:ce(),block:g}}function ce(){return crypto.randomUUID()}export{hl as B,xl as a,gl as b,pl as c};
|