decocms 3.28.2 → 3.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-B6c8Mzjf.js → AlertCircle-BNPFaifB.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-Be3IVNc7.js → ArrowUpRight-BL0DEL84.js} +1 -1
- package/dist/client/assets/{Check-DEXo-WUm.js → Check-DrpXvTEH.js} +1 -1
- package/dist/client/assets/{CheckCircle-yjUP9-a4.js → CheckCircle-BRPlg-YS.js} +1 -1
- package/dist/client/assets/{ChevronDown-DgK4vNiI.js → ChevronDown-BbOS4qL1.js} +1 -1
- package/dist/client/assets/{ChevronLeft-CgTd6CqD.js → ChevronLeft-BpkGVyIf.js} +1 -1
- package/dist/client/assets/{ChevronRight-BEkEaTTX.js → ChevronRight-1rvQ8kzv.js} +1 -1
- package/dist/client/assets/{ChevronUp-DhNf5w7O.js → ChevronUp-CLLQjGPH.js} +1 -1
- package/dist/client/assets/{Container-BzJpoAXT.js → Container-DNQQpFor.js} +1 -1
- package/dist/client/assets/{DotsVertical-BN7_sSEx.js → DotsVertical-DUknPLwi.js} +1 -1
- package/dist/client/assets/{Eye-DM_PzU0M.js → Eye-BsjlkKrA.js} +1 -1
- package/dist/client/assets/{FilterLines-1aeFf44G.js → FilterLines-B6SlOcKg.js} +1 -1
- package/dist/client/assets/{Globe01-B4QIOBGm.js → Globe01-DWblfsLy.js} +1 -1
- package/dist/client/assets/{HardDrive-B2vsnJ8B.js → HardDrive-q2X_Nb8t.js} +1 -1
- package/dist/client/assets/{Key01-fLbeh11d.js → Key01-DwMnV9mY.js} +1 -1
- package/dist/client/assets/{LayoutLeft-ZzAJDsr6.js → LayoutLeft-Dx-_kOsA.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CPGJkHHm.js → LinkExternal01-CRlWoCgj.js} +1 -1
- package/dist/client/assets/{Monitor01-B3onVx2m.js → Monitor01-BhOhPfHt.js} +1 -1
- package/dist/client/assets/{Palette-C2hbhyQk.js → Palette-DW672x4H.js} +1 -1
- package/dist/client/assets/{Play-CwQc-EwD.js → Play-Bk01tNYj.js} +1 -1
- package/dist/client/assets/{Plus-De-E-6wD.js → Plus-6fOxce1R.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-DA9Xrix-.js → RefreshCcw01-Cw6L6yvU.js} +1 -1
- package/dist/client/assets/{SearchMd-DY7m-PLn.js → SearchMd-BSOoJwVy.js} +1 -1
- package/dist/client/assets/{Settings02-DkTBIaKB.js → Settings02-DSIsXaL0.js} +1 -1
- package/dist/client/assets/{Shield01-TzaLPX1T.js → Shield01-BbBJX92i.js} +1 -1
- package/dist/client/assets/{Star01-CBGrpf0P.js → Star01-DNvLVa3Y.js} +1 -1
- package/dist/client/assets/{Stars01-BEQtiGHr.js → Stars01-BSMT1emK.js} +1 -1
- package/dist/client/assets/{Stars02-RdMaq57_.js → Stars02-CyFrQLIw.js} +1 -1
- package/dist/client/assets/{Sun-TUQeTj5x.js → Sun-Bs2RhCiD.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-WnVHCaWd.js → SwitchHorizontal01-C1EL6vOb.js} +1 -1
- package/dist/client/assets/{Tool01-B-ijPyq1.js → Tool01-BQunivVZ.js} +1 -1
- package/dist/client/assets/{Trash01-N2sNvlm0.js → Trash01-BnAZS_Kz.js} +1 -1
- package/dist/client/assets/{Upload01-qnabD6hi.js → Upload01-TgqRGsOi.js} +1 -1
- package/dist/client/assets/{User01-Ca-HpbAW.js → User01-WnyHG7nS.js} +1 -1
- package/dist/client/assets/{Users01-Dg21emev.js → Users01-1NXz500j.js} +1 -1
- package/dist/client/assets/{Users03-D5HhQ8-f.js → Users03-k-A54IOH.js} +1 -1
- package/dist/client/assets/{X-Bm7MIJC_.js → X-CvL6b4Pc.js} +1 -1
- package/dist/client/assets/{XCircle-DyhEmEPQ.js → XCircle-CNfzmy9y.js} +1 -1
- package/dist/client/assets/{XClose-C7dvFGMb.js → XClose-DUODm8E1.js} +1 -1
- package/dist/client/assets/{Zap-CiEBAZr5.js → Zap-DI_LpzmZ.js} +1 -1
- package/dist/client/assets/{ZapSquare-Ci4u2Dbd.js → ZapSquare-BcblBp8N.js} +1 -1
- package/dist/client/assets/{ZoomOut-B_V9tlGR.js → ZoomOut-BMRPpVVp.js} +1 -1
- package/dist/client/assets/{access-gate-AFUxhae7.js → access-gate-BKEXX39N.js} +1 -1
- package/dist/client/assets/{accordion-Da3zFuxg.js → accordion-LcZJ6q9A.js} +1 -1
- package/dist/client/assets/add-section-modal-BV8ziFhe.js +1 -0
- package/dist/client/assets/{agent-capabilities-CSc3kMFs.js → agent-capabilities-SrpkJP1V.js} +1 -1
- package/dist/client/assets/{agent-icon-DYE5DbAQ.js → agent-icon-BLOU6m2j.js} +1 -1
- package/dist/client/assets/{agent-icons-MhoNvYvr.js → agent-icons-Bw0JIHVQ.js} +1 -1
- package/dist/client/assets/{agents-list-eboFrdNp.js → agents-list-qZtSjVrZ.js} +1 -1
- package/dist/client/assets/{ai-providers-Hd6N5Dg7.js → ai-providers-D_A9cagK.js} +1 -1
- package/dist/client/assets/{alert-uqHdn9i8.js → alert-C-XO8sSB.js} +1 -1
- package/dist/client/assets/{alert-dialog-C9cdjnL0.js → alert-dialog-fA1zBV_W.js} +1 -1
- package/dist/client/assets/app-editor-CTXjDbcJ.js +1 -0
- package/dist/client/assets/{auth-catchall-OmbGtgeI.js → auth-catchall-C53s1f1A.js} +1 -1
- package/dist/client/assets/{auth-split-layout-Bpfi3pdc.js → auth-split-layout-D2PZigso.js} +1 -1
- package/dist/client/assets/{automation-list-row-CSwJoL82.js → automation-list-row-Cc0gLtvB.js} +1 -1
- package/dist/client/assets/{automation-runs-CGUqiG0Y.js → automation-runs-6EirMrvT.js} +1 -1
- package/dist/client/assets/{automations-DCOSUtQK.js → automations-C2mD2p-l.js} +1 -1
- package/dist/client/assets/{avatar-BpsMlRfh.js → avatar-CRWrFSGJ.js} +1 -1
- package/dist/client/assets/{badge-CQSCbvCa.js → badge-CqdaMAGB.js} +1 -1
- package/dist/client/assets/{brand-context-B5YGrmN9.js → brand-context-DeURbIil.js} +1 -1
- package/dist/client/assets/{buckets-DzXTUBob.js → buckets-DisassmN.js} +1 -1
- package/dist/client/assets/{calendar-C1JN4fZ4.js → calendar-RwY1IDnr.js} +1 -1
- package/dist/client/assets/{capability-load-error-Qrxb3fC3.js → capability-load-error-BdSLB25T.js} +1 -1
- package/dist/client/assets/{card-COSTikSG.js → card-BOUQVYfQ.js} +1 -1
- package/dist/client/assets/{chat-context-BscCS8g4.js → chat-context-D9R3AfMM.js} +1 -1
- package/dist/client/assets/{checkbox-CoBSTPCe.js → checkbox-D2tUwyI5.js} +1 -1
- package/dist/client/assets/{cli-auth-success-vIf0zYeU.js → cli-auth-success-CycZAlC-.js} +1 -1
- package/dist/client/assets/{collection-detail-DODGgTuG.js → collection-detail-Fycs266d.js} +1 -1
- package/dist/client/assets/{collection-display-button-BdCE4pbC.js → collection-display-button-DWt-2c4u.js} +1 -1
- package/dist/client/assets/{collection-search-D_do7MXe.js → collection-search-BYl845BX.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-B7P7HtOs.js → collection-table-wrapper-DyJUufvz.js} +1 -1
- package/dist/client/assets/{collection-tabs-D63EAfII.js → collection-tabs-DTE_U5mO.js} +1 -1
- package/dist/client/assets/{collections-ChXxHzy2.js → collections-DCdFHZSz.js} +1 -1
- package/dist/client/assets/{command-DqsdlU-_.js → command-BsoNMAvV.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-DD4FC2LO.js → connect-desktop-dialog-DadDOzGO.js} +1 -1
- package/dist/client/assets/{connection-card-FeZLlrxk.js → connection-card-B7BzhYVX.js} +1 -1
- package/dist/client/assets/{connection-detail-DCn8042t.js → connection-detail-BPLZDd46.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-DCKn60Ne.js → connection-form-helpers-D-PwvKkg.js} +1 -1
- package/dist/client/assets/{connections-o-0jNCSa.js → connections-ZwBkUMk0.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-CuFOPenZ.js → decopilot-sse-pool-BYOU54VM.js} +1 -1
- package/dist/client/assets/{dialog-Djt1LVnY.js → dialog-CNF9zctd.js} +1 -1
- package/dist/client/assets/{domain-settings-C4eGu4uE.js → domain-settings-oTidnKk2.js} +1 -1
- package/dist/client/assets/{drawer-BXoh2EmM.js → drawer-_yfB4-ZD.js} +1 -1
- package/dist/client/assets/{dropdown-menu-DXIoF-ie.js → dropdown-menu-C9j4QtMB.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-D9cjPPaH.js → dynamic-plugin-layout-Cx2pm4aZ.js} +1 -1
- package/dist/client/assets/{empty-state-BzLetnGS.js → empty-state-BA4rBosJ.js} +1 -1
- package/dist/client/assets/{empty-state-KuzDCMb7.js → empty-state-BhsSTbUq.js} +1 -1
- package/dist/client/assets/{extract-connection-data-D69tCcU1.js → extract-connection-data-B1fVllrS.js} +1 -1
- package/dist/client/assets/{features-Cb4qaYzX.js → features-1-yXKS0I.js} +1 -1
- package/dist/client/assets/file-explorer-CYo33LG0.js +2 -0
- package/dist/client/assets/{file-type-icon-ChKGrOZW.js → file-type-icon-FQGEIw0w.js} +1 -1
- package/dist/client/assets/{files-6rw8QzWq.js → files-C-efMRuS.js} +1 -1
- package/dist/client/assets/{form-ysJDiLJp.js → form-B92x9z3r.js} +1 -1
- package/dist/client/assets/{general-Dv9vAPXk.js → general-DDuKH_f_.js} +1 -1
- package/dist/client/assets/{generate-id-_ulkjF89.js → generate-id-D7qzLdbZ.js} +1 -1
- package/dist/client/assets/{github-repo-picker-l9ETUtxe.js → github-repo-picker-C6c_6U2Z.js} +1 -1
- package/dist/client/assets/{header-tab-button-D8qoVrcx.js → header-tab-button-GFj8rCuU.js} +1 -1
- package/dist/client/assets/{hover-card-DfE_o4wO.js → hover-card-BP4kmnzg.js} +1 -1
- package/dist/client/assets/{image-field-Degasm7F.js → image-field-Coe4I69A.js} +1 -1
- package/dist/client/assets/{index-DJYPL6kR.js → index-BC7TxDgg.js} +1 -1
- package/dist/client/assets/{index-RgNRvF6I.js → index-BGzmEjyE.js} +1 -1
- package/dist/client/assets/index-BfFSIKM_.js +1 -0
- package/dist/client/assets/{index-CUxRowbV.js → index-Bt9QJCM8.js} +1 -1
- package/dist/client/assets/{index-C9SESVla.js → index-CLJRWvFc.js} +1 -1
- package/dist/client/assets/{index-C4IhCWyO.js → index-CdUa-4z6.js} +1 -1
- package/dist/client/assets/{index-CqAKxsqM.js → index-CiCm6VoW.js} +1 -1
- package/dist/client/assets/{index-DZVqlilk.js → index-D0mCKPyO.js} +3 -3
- package/dist/client/assets/{index-B8Bi8NJZ.js → index-DjdFtBpV.js} +1 -1
- package/dist/client/assets/{index-BHcS935F.js → index-DvmtvMeE.js} +4 -4
- package/dist/client/assets/{index-D01UVldp.js → index-G1XPZDFt.js} +1 -1
- package/dist/client/assets/{index-DmTxFLmc.js → index-S-3IFo67.js} +1 -1
- package/dist/client/assets/{index-Dhq_DEcM.js → index-Xs4q53_A.js} +1 -1
- package/dist/client/assets/index-dnG3qfnG.js +1 -0
- package/dist/client/assets/{index-CcqodNxi.js → index-mj0uegHm.js} +1 -1
- package/dist/client/assets/{index-redirect-HsspJKwZ.js → index-redirect-BOBo36gE.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-BXUJR-m_.js → infiniteQueryObserver-D44cttPN.js} +1 -1
- package/dist/client/assets/{input-DBD7EP80.js → input-D8tMlH9u.js} +1 -1
- package/dist/client/assets/{integration-icon-DtSS6HBc.js → integration-icon-Dc6yh7Ef.js} +1 -1
- package/dist/client/assets/{label-lUAV486p.js → label-gsYRU7Jg.js} +1 -1
- package/dist/client/assets/{layout-DPGG4lFH.js → layout-D1w5nyXY.js} +1 -1
- package/dist/client/assets/{login-CJbg6F72.js → login-CpzQHyiE.js} +1 -1
- package/dist/client/assets/{members-BFaRysnE.js → members-B2ZTxuFo.js} +1 -1
- package/dist/client/assets/{monaco-editor-Df-1kT53.js → monaco-editor-BU-Z9KtP.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-Cke4-C4Q.js → monitoring-stats-row-VpPUwtcG.js} +1 -1
- package/dist/client/assets/{oauth-callback-CWaYzShH.js → oauth-callback-Cs0FymWS.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CVU_6XoI.js → oauth-callback-ai-provider-DjcifW3c.js} +1 -1
- package/dist/client/assets/{onboarding-DtcBh6IN.js → onboarding-CRiRQ3io.js} +1 -1
- package/dist/client/assets/{org-install-B8vx3o6J.js → org-install-D0V_6jU2.js} +1 -1
- package/dist/client/assets/{org-layout-DFjbzZe-.js → org-layout-DZihETtF.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-ujVugVBv.js → org-plugin-layout-CP2VdM5r.js} +1 -1
- package/dist/client/assets/{page-seo-form-C39mph4U.js → page-seo-form-AVswM06G.js} +1 -1
- package/dist/client/assets/page-seo-sheet-CNZ31spc.js +1 -0
- package/dist/client/assets/{pair-kflzrV9V.js → pair--IK4A8CV.js} +12 -12
- package/dist/client/assets/{plugin-empty-state-BMQMfb3Z.js → plugin-empty-state-DKlkn97k.js} +1 -1
- package/dist/client/assets/{plugin-header-BqYNlEDz.js → plugin-header-CHZ0dwZR.js} +1 -1
- package/dist/client/assets/{plugin-layout-ZbYmXJ__.js → plugin-layout-7DTUlS1_.js} +1 -1
- package/dist/client/assets/{popover-Bd6Xh0lT.js → popover-BSLgCJyu.js} +1 -1
- package/dist/client/assets/{post-editor-CHXAXevV.js → post-editor-Vq6CZ815.js} +1 -1
- package/dist/client/assets/{primitives-BuDZr_Qi.js → primitives-C3ICFbKN.js} +1 -1
- package/dist/client/assets/{profile-DtWRKs0n.js → profile-DvG46TPv.js} +1 -1
- package/dist/client/assets/project-app-view-D1_DE5R7.js +1 -0
- package/dist/client/assets/record-editor-C9qZvfqE.js +1 -0
- package/dist/client/assets/registry-Da2Ptro5.js +2 -0
- package/dist/client/assets/{registry-layout-CSR5UI7D.js → registry-layout-Ba4dg5x-.js} +1 -1
- package/dist/client/assets/{require-capability-B3QssSGk.js → require-capability-ClpsQHD3.js} +1 -1
- package/dist/client/assets/{required-auth-layout-B2L6564M.js → required-auth-layout-w913LK3H.js} +1 -1
- package/dist/client/assets/{reset-password-DEiTip2p.js → reset-password-a572kA7g.js} +1 -1
- package/dist/client/assets/{resizable-C-INMWq5.js → resizable-CK1U7aAj.js} +1 -1
- package/dist/client/assets/{roles-DpyZ2WwE.js → roles-CkMlnWZR.js} +1 -1
- package/dist/client/assets/save-referenced-block-Cx1MKLEL.js +1 -0
- package/dist/client/assets/{save-status-BVd_ZeVF.js → save-status-DeDBmVj-.js} +1 -1
- package/dist/client/assets/{schema-form-Cax0S_eT.js → schema-form-C0GFhgme.js} +1 -1
- package/dist/client/assets/{scroll-area-DOzWTBh7.js → scroll-area-Dteh4SNR.js} +1 -1
- package/dist/client/assets/{search-input-Crg-aeBG.js → search-input-CbpfpsEc.js} +1 -1
- package/dist/client/assets/{secrets-uFh6R-ci.js → secrets-DM5n46rv.js} +1 -1
- package/dist/client/assets/{sections-editor-UFBEsvbR.js → sections-editor-C9F-HtTm.js} +1 -1
- package/dist/client/assets/{select-C_Mscmor.js → select-BaScWEqk.js} +1 -1
- package/dist/client/assets/{select-model-DE0CMGaf.js → select-model-ClQTPhkl.js} +1 -1
- package/dist/client/assets/seo-editor-F8wyTexL.js +1 -0
- package/dist/client/assets/{settings-layout-DthSzMuE.js → settings-layout-DbR_-nZp.js} +1 -1
- package/dist/client/assets/{settings-section-ebZtWbZG.js → settings-section-CQPr7_UG.js} +1 -1
- package/dist/client/assets/{sheet-CsGV1Xbn.js → sheet-C4ZjzK5K.js} +1 -1
- package/dist/client/assets/{shell-controls-C0KG-cpK.js → shell-controls-BCGbZxxE.js} +1 -1
- package/dist/client/assets/{shell-layout-BVLB8W09.js → shell-layout-B5K9gA8c.js} +1 -1
- package/dist/client/assets/shell-route-loading-D4ZO-IqH.js +1 -0
- package/dist/client/assets/{sidebar-HV--ufCF.js → sidebar-DqTSNy5t.js} +1 -1
- package/dist/client/assets/{skeleton-DpKw4LgQ.js → skeleton-B8hTUDSD.js} +1 -1
- package/dist/client/assets/{sortable.esm-5Nlwg3lH.js → sortable.esm-CaiMWpSf.js} +1 -1
- package/dist/client/assets/{spinner-DO0j02hL.js → spinner-D6A-1uH-.js} +1 -1
- package/dist/client/assets/{sso-Bv5wunQY.js → sso-BfBX9IJx.js} +1 -1
- package/dist/client/assets/{store-ChRTg37n.js → store-DLbreoeL.js} +1 -1
- package/dist/client/assets/store-registry-DIdOg5Lm.js +2 -0
- package/dist/client/assets/{studio-tools-CDcv-T4t.js → studio-tools-C02pf_S5.js} +1 -1
- package/dist/client/assets/{switch-Bp9oqtUU.js → switch-5KPQojOQ.js} +1 -1
- package/dist/client/assets/{tab-id-DyuDI05_.js → tab-id-C6tXdX9B.js} +6 -6
- package/dist/client/assets/{table-DKw0lSKO.js → table-B4YH5xGC.js} +1 -1
- package/dist/client/assets/{tabs-CFrGCHeV.js → tabs-BLgEhFEi.js} +1 -1
- package/dist/client/assets/{task-status-t9G7Wzk6.js → task-status-Ck00VBz7.js} +1 -1
- package/dist/client/assets/{textarea-AwJH2K49.js → textarea-hnK41FQH.js} +1 -1
- package/dist/client/assets/{toggle-group-B04XV8AA.js → toggle-group-rBRjhb0Y.js} +1 -1
- package/dist/client/assets/{toolbar-Cdyl5x0h.js → toolbar-BC9cl3RF.js} +1 -1
- package/dist/client/assets/{tools-list-De_R_ovM.js → tools-list-BqjZyX8c.js} +1 -1
- package/dist/client/assets/{tooltip-o8huGjQ9.js → tooltip-D6Vf8YNB.js} +1 -1
- package/dist/client/assets/{types-BCqGwsfz.js → types-CmPYuuRP.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BmLD_kea.js → use-ai-providers-CRnxErDB.js} +1 -1
- package/dist/client/assets/{use-automations-gsGrmr6p.js → use-automations-doi7gcXe.js} +1 -1
- package/dist/client/assets/{use-capability-BOerylhE.js → use-capability-k9zs5tx2.js} +1 -1
- package/dist/client/assets/use-clock-tick-CAGblZUQ.js +1 -0
- package/dist/client/assets/{use-collections-DAjOo5ZC.js → use-collections-bwzSex3G.js} +1 -1
- package/dist/client/assets/{use-connection-CJMDVK6k.js → use-connection-CtW_052_.js} +1 -1
- package/dist/client/assets/{use-copy-CtSTNwqj.js → use-copy-qVd9Xng4.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-B8GHWYat.js → use-create-virtual-mcp-DstSXBt0.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-Cwedmf4F.js → use-debounced-autosave-CL_f8Yy-.js} +1 -1
- package/dist/client/assets/{use-delete-connection-6GOeNbO9.js → use-delete-connection-DOHJzMeH.js} +1 -1
- package/dist/client/assets/{use-file-configs-C-GZ1zYT.js → use-file-configs-B-RshlbZ.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BPlykMTx.js → use-infinite-scroll-D-8mrx_o.js} +1 -1
- package/dist/client/assets/{use-list-state-C8tIIEc4.js → use-list-state-Bj54seFv.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DjPdtjSs.js → use-mcp-client-MPq4XlBz.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-DM6AjLx2.js → use-mcp-prompts-Ae20a5x9.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-9PGjSkaC.js → use-mcp-tools-CY2-6M6b.js} +1 -1
- package/dist/client/assets/{use-members-CIIGwcs8.js → use-members-BdpfnA7t.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-BbWgCfUr.js → use-navigate-to-agent-DarIuRjO.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BMuOsWDB.js → use-org-auth-client-BqST5FmU.js} +1 -1
- package/dist/client/assets/{use-org-sso-Bl3aNvhm.js → use-org-sso-BHLHLvBG.js} +1 -1
- package/dist/client/assets/{use-organization-roles-C2RYGhuk.js → use-organization-roles-DQJpmynS.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Cyri9Ne9.js → use-organization-settings-DWi876ez.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CzgZApvz.js → use-registry-connections-Cx751qaO.js} +1 -1
- package/dist/client/assets/{use-secrets-BAsLQ9g5.js → use-secrets-De9xmTBY.js} +1 -1
- package/dist/client/assets/{use-status-sounds-C7w_UeRC.js → use-status-sounds-DudsyYJb.js} +1 -1
- package/dist/client/assets/{use-view-mode-inE-bb4X.js → use-view-mode-DKmFfjyA.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-BCFYBYWC.js → use-virtual-mcp-csLU6-XA.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DeDGRiE3.js +1 -0
- package/dist/client/assets/{useRouterState-CisnF5dB.js → useRouterState-D0ZYxlbz.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BP8m7T_j.js +1 -0
- package/dist/client/assets/{user-BTbaSGqz.js → user-BCJ_labN.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BdWmb5J5.js → view-mode-toggle-_-Ou21AO.js} +1 -1
- package/dist/client/assets/{workflow-Bsf3r4QI.js → workflow-DJWDym4T.js} +1 -1
- package/dist/client/assets/workflow-detail-CA0UH76u.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +2 -2
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/add-section-modal-CEIE0uWq.js +0 -1
- package/dist/client/assets/app-editor-DsnQiQ_A.js +0 -1
- package/dist/client/assets/file-explorer-BN4rVlQG.js +0 -2
- package/dist/client/assets/format-time-Cy7tTmZp.js +0 -1
- package/dist/client/assets/index-BztnWKji.js +0 -1
- package/dist/client/assets/index-DcfA7ZVf.js +0 -1
- package/dist/client/assets/page-seo-sheet-uq6K114l.js +0 -1
- package/dist/client/assets/project-app-view-cN6-gSdM.js +0 -1
- package/dist/client/assets/record-editor-B5Wiwh_y.js +0 -1
- package/dist/client/assets/registry-CR-2JPTt.js +0 -2
- package/dist/client/assets/save-referenced-block-BVBEwHPT.js +0 -1
- package/dist/client/assets/seo-editor-BwGR-eTN.js +0 -1
- package/dist/client/assets/shell-route-loading-5hUNb_fO.js +0 -1
- package/dist/client/assets/store-registry-V6sbFCwB.js +0 -2
- package/dist/client/assets/useInfiniteQuery-B4_CPL_3.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-D9iKUrNx.js +0 -1
- package/dist/client/assets/workflow-detail-B0lUdclZ.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as z,j as i,r as Q,B as ue,c as De,o as ge}from"./index-DZVqlilk.js";import{aa as et,v as tt,aq as we,H as Se}from"./agent-icon-DYE5DbAQ.js";import{C as nt}from"./calendar-C1JN4fZ4.js";import{I as re}from"./input-DBD7EP80.js";import{L as q}from"./label-lUAV486p.js";import{a as rt,b as st,P as it}from"./popover-Bd6Xh0lT.js";import{T as lt}from"./textarea-AwJH2K49.js";import{S as ot}from"./switch-Bp9oqtUU.js";import{c as Le,S as Ee,a as Pe,b as Ve,d as Me}from"./select-C_Mscmor.js";import{d as at}from"./ZoomOut-B_V9tlGR.js";import{s as ct}from"./Plus-De-E-6wD.js";import{s as ze}from"./Trash01-N2sNvlm0.js";import{D as ut,a as ft,b as dt,c as pt}from"./dropdown-menu-DXIoF-ie.js";import{e as Ue,u as mt,L as ht,F as yt,I as Ae}from"./image-field-Degasm7F.js";import{l as Ke,i as fe,W as me,S as gt,P as xt,X as be,Y as de,Z as Ce,m as vt,_ as bt,$ as jt,a0 as Nt,a1 as Tt}from"./index-BHcS935F.js";import{t as We}from"./ChevronDown-DgK4vNiI.js";import{i as He}from"./ChevronRight-BEkEaTTX.js";import{i as kt}from"./Globe01-B4QIOBGm.js";import{T as _t,b as wt,a as St}from"./tooltip-o8huGjQ9.js";import{i as At}from"./Upload01-qnabD6hi.js";import{c as Ct}from"./use-file-configs-C-GZ1zYT.js";function It(t){if(t?.trim())try{const e=new URL(t);return e.protocol!=="https:"?void 0:e.href}catch{return}}function Ot(t){if(Array.isArray(t.variants)){const e=t.variants,n=e.find(l=>l.rule?.__resolveType?.includes("always"));if(typeof n?.value=="string")return n.value;const r=e.find(l=>typeof l.value=="string");if(r)return r.value}if(typeof t.src=="string")return t.src;if(typeof t.url=="string")return t.url;if(typeof t.value=="string")return t.value}function Ye(t){if(typeof t=="string"||t==null||typeof t!="object")return t;if(Array.isArray(t))return t.map(Ye);const e=t;return e.__resolveType?Ot(e)??t:Ge(e)}function Ge(t){const e={};for(const[n,r]of Object.entries(t))e[n]=Ye(r);return e}function Rt(t,e){return e.split(".").reduce((n,r)=>{if(!(n==null||typeof n!="object"))return n[r]},t)}function Xe(t){return t==null?"":Array.isArray(t)?t.map(Xe).filter(Boolean).join(","):typeof t=="object"?"":String(t)}function je(t,e){if(!t.includes("{"))return;const n=Ge(e);return t.replace(/\{\{\{([^}]+)\}\}\}|\{\{([^}]+)\}\}/g,(l,s,o)=>{const c=(s??o??"").trim();return Xe(Rt(n,c))}).trim()||void 0}function $t(t,e){if(e.includes("{"))return je(e,t);const n=t[e];if(typeof n=="string"&&n)return n;if(Array.isArray(n)){const r=n.map(l=>l==null?"":String(l)).filter(Boolean).join(",");if(r)return r}}function se(t,e,n){if(typeof t=="string")return t||`Item ${e+1}`;if(typeof t=="number"||typeof t=="boolean")return String(t);if(t&&typeof t=="object"&&!Array.isArray(t)){const r=t;if(n?.titleBy){const s=$t(r,n.titleBy);if(s)return s}for(const s of["name","label","title","alt","text","href","id"]){const o=r[s];if(typeof o=="string"&&o)return o;if(Array.isArray(o)){const c=o.map(a=>a==null?"":String(a)).filter(Boolean).join(",");if(c)return c}}const l=r.__resolveType;if(typeof l=="string"&&l)return Ke(l);if(n?.title){const s=je(n.title,r);if(s)return s;if(!n.title.includes("{"))return n.title}}return`Item ${e+1}`}function Ft(t){if(!t)return;if(typeof t.image=="string"&&t.image.includes("{"))return t.image;const e=t.properties?.image;if(!e)return;if(e.format==="image-uri")return"{{{image}}}";const n=e.properties;return n?.mobile?"{{{image.mobile}}}":n?.desktop?"{{{image.desktop}}}":"{{{image}}}"}function Bt(t,e){if(!t||typeof t!="object"||Array.isArray(t))return;const n=Ft(e);if(!n)return;const r=je(n,t);if(!r)return;const l=Ue(r)||r;return It(l)}function Ze(t){return t===gt||t===xt}function he(t,e){if(!Object.hasOwn(e,t))return null;const n=e[t]??{},r=n.__resolveType??t;return{data:{...n},resolveType:r}}function pe(t,e){const n=t.__resolveType??"";if(!n)return null;if(fe(n)){const r=t.section??{};return Qe(r,e)}if(Ze(n)){const r=t.variants?.[0]?.value;return r?pe(r,e):null}return!me(n)||!Object.hasOwn(e,n)?{data:{...t},resolveType:n}:he(n,e)}function Qe(t,e){const n=t.__resolveType??"";if(!n)return null;if(Ze(n)){const r=t.variants?.[0]?.value;return r?pe(r,e):null}return!me(n)||!Object.hasOwn(e,n)?{data:{...t},resolveType:n}:he(n,e)}function Dt(t,e){if(!t||typeof t!="object"||Array.isArray(t))return null;const r=t.__resolveType;if(typeof r!="string"||!me(r)||!Object.hasOwn(e,r))return null;const l=he(r,e);return l?{blockKey:r,...l}:null}function Gn(t,e,n){if(e.isMultivariate)return null;if(e.isSavedBlock){const r=e.isLazy?t.section?.__resolveType??t.__resolveType:t.__resolveType;return he(r,n)}if(e.isHidden){const s=(fe(t.__resolveType)?t.section:t)?.variants?.[0]?.value??t;return pe(s,n)}if(e.isLazy||fe(t.__resolveType)){const r=t.section??{};return Qe(r,n)}return pe(t,n)}const ee=t=>String(t).padStart(2,"0"),Lt="1900-01-01",Et="2099-12-31",Pt="1900-01-01T00:00",Vt="2099-12-31T23:59";function Mt(t){if(!t)return"";const e=t.slice(0,10);if(/^\d{4}-\d{2}-\d{2}$/.test(e))return e;const n=new Date(t);return Number.isNaN(n.getTime())?"":`${n.getUTCFullYear()}-${ee(n.getUTCMonth()+1)}-${ee(n.getUTCDate())}`}function zt(t){return!t||!/^\d{4}-\d{2}-\d{2}$/.test(t)?"":`${t}T00:00:00.000Z`}function Ut(t){if(!t)return"";const e=new Date(t);return Number.isNaN(e.getTime())?"":`${e.getFullYear()}-${ee(e.getMonth()+1)}-${ee(e.getDate())}T${ee(e.getHours())}:${ee(e.getMinutes())}`}function Kt(t){if(!t)return"";const e=new Date(t);return Number.isNaN(e.getTime())?"":e.toISOString()}function Wt(t){const e=z.c(29),{id:n,withTime:r,value:l,onChange:s}=t,[o,c]=Q.useState(!1);let a;e[0]!==l||e[1]!==r?(a=r?Ut(l):Mt(l),e[0]=l,e[1]=r,e[2]=a):a=e[2];const d=a;let y;e[3]!==s||e[4]!==r?(y=k=>{s(r?Kt(k.target.value):zt(k.target.value))},e[3]=s,e[4]=r,e[5]=y):y=e[5];const m=y;let f;if(e[6]!==l){const k=l?new Date(l):null;f=k&&!Number.isNaN(k.getTime())?k:null,e[6]=l,e[7]=f}else f=e[7];const p=f;let h;e[8]!==s||e[9]!==p||e[10]!==r?(h=k=>{k&&(r&&p?k.setHours(p.getHours(),p.getMinutes(),0,0):k.setHours(0,0,0,0),s(k.toISOString()),c(!1))},e[8]=s,e[9]=p,e[10]=r,e[11]=h):h=e[11];const u=h,g=r?"datetime-local":"date",x=r?Pt:Lt,v=r?Vt:Et;let b;e[12]!==m||e[13]!==n||e[14]!==d||e[15]!==g||e[16]!==x||e[17]!==v?(b=i.jsx(re,{id:n,type:g,min:x,max:v,value:d,onChange:m,className:"h-10 flex-1 [&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-calendar-picker-indicator]:opacity-0"}),e[12]=m,e[13]=n,e[14]=d,e[15]=g,e[16]=x,e[17]=v,e[18]=b):b=e[18];let A;e[19]===Symbol.for("react.memo_cache_sentinel")?(A=i.jsx(rt,{asChild:!0,children:i.jsx(ue,{type:"button",variant:"outline",size:"icon",className:"h-10 w-10 shrink-0","aria-label":"Open calendar",children:i.jsx(et,{className:"h-4 w-4"})})}),e[19]=A):A=e[19];const j=p??void 0;let N;e[20]!==u||e[21]!==j?(N=i.jsx(st,{className:"w-auto p-0",align:"end",children:i.jsx(nt,{mode:"single",selected:j,onSelect:u,initialFocus:!0})}),e[20]=u,e[21]=j,e[22]=N):N=e[22];let T;e[23]!==o||e[24]!==N?(T=i.jsxs(it,{open:o,onOpenChange:c,children:[A,N]}),e[23]=o,e[24]=N,e[25]=T):T=e[25];let R;return e[26]!==T||e[27]!==b?(R=i.jsxs("div",{className:"flex gap-1",children:[b,T]}),e[26]=T,e[27]=b,e[28]=R):R=e[28],R}function ae(t){const e=z.c(8),{htmlFor:n,label:r,description:l}=t;let s;e[0]!==n||e[1]!==r?(s=i.jsx(q,{htmlFor:n,children:r}),e[0]=n,e[1]=r,e[2]=s):s=e[2];let o;e[3]!==l?(o=l&&i.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:l}),e[3]=l,e[4]=o):o=e[4];let c;return e[5]!==s||e[6]!==o?(c=i.jsxs("div",{className:"space-y-0.5",children:[s,o]}),e[5]=s,e[6]=o,e[7]=c):c=e[7],c}function ce(t){const e=z.c(61),{schema:n,value:r,onChange:l,path:s,label:o}=t,c=typeof r=="string"?r:"",a=n.format;if(a==="textarea"||a==="rich-text"||a==="rich-text-inline"||a==="markdown"){let u;e[0]!==o||e[1]!==s||e[2]!==n.description?(u=i.jsx(ae,{htmlFor:s,label:o,description:n.description}),e[0]=o,e[1]=s,e[2]=n.description,e[3]=u):u=e[3];let g;e[4]!==l?(g=b=>l(b.target.value),e[4]=l,e[5]=g):g=e[5];let x;e[6]!==s||e[7]!==c||e[8]!==g?(x=i.jsx(lt,{id:s,value:c,onChange:g,rows:4}),e[6]=s,e[7]=c,e[8]=g,e[9]=x):x=e[9];let v;return e[10]!==u||e[11]!==x?(v=i.jsxs("div",{className:"space-y-2",children:[u,x]}),e[10]=u,e[11]=x,e[12]=v):v=e[12],v}if(a==="date"||a==="date-time"){let u;e[13]!==o||e[14]!==s||e[15]!==n.description?(u=i.jsx(ae,{htmlFor:s,label:o,description:n.description}),e[13]=o,e[14]=s,e[15]=n.description,e[16]=u):u=e[16];const g=a==="date-time";let x;e[17]!==l||e[18]!==s||e[19]!==c||e[20]!==g?(x=i.jsx(Wt,{id:s,withTime:g,value:c,onChange:l}),e[17]=l,e[18]=s,e[19]=c,e[20]=g,e[21]=x):x=e[21];let v;return e[22]!==u||e[23]!==x?(v=i.jsxs("div",{className:"space-y-2",children:[u,x]}),e[22]=u,e[23]=x,e[24]=v):v=e[24],v}if(a==="color-input"){let u;e[25]!==o||e[26]!==s||e[27]!==n.description?(u=i.jsx(ae,{htmlFor:s,label:o,description:n.description}),e[25]=o,e[26]=s,e[27]=n.description,e[28]=u):u=e[28];const g=c||"#000000";let x;e[29]!==l?(x=T=>l(T.target.value),e[29]=l,e[30]=x):x=e[30];let v;e[31]!==g||e[32]!==x?(v=i.jsx("input",{type:"color",value:g,onChange:x,className:"h-10 w-10 cursor-pointer rounded-lg border border-border bg-background p-1"}),e[31]=g,e[32]=x,e[33]=v):v=e[33];let b;e[34]!==l?(b=T=>l(T.target.value),e[34]=l,e[35]=b):b=e[35];let A;e[36]!==s||e[37]!==c||e[38]!==b?(A=i.jsx(re,{id:s,value:c,onChange:b,placeholder:"#000000",className:"h-10 flex-1"}),e[36]=s,e[37]=c,e[38]=b,e[39]=A):A=e[39];let j;e[40]!==v||e[41]!==A?(j=i.jsxs("div",{className:"flex items-center gap-2",children:[v,A]}),e[40]=v,e[41]=A,e[42]=j):j=e[42];let N;return e[43]!==u||e[44]!==j?(N=i.jsxs("div",{className:"space-y-2",children:[u,j]}),e[43]=u,e[44]=j,e[45]=N):N=e[45],N}let d;e[46]!==o||e[47]!==s||e[48]!==n.description?(d=i.jsx(ae,{htmlFor:s,label:o,description:n.description}),e[46]=o,e[47]=s,e[48]=n.description,e[49]=d):d=e[49];const y=a==="url"?"url":"text";let m;e[50]!==l?(m=u=>l(u.target.value),e[50]=l,e[51]=m):m=e[51];const f=n.default!=null?String(n.default):void 0;let p;e[52]!==s||e[53]!==c||e[54]!==y||e[55]!==m||e[56]!==f?(p=i.jsx(re,{id:s,type:y,value:c,onChange:m,placeholder:f,className:"h-10"}),e[52]=s,e[53]=c,e[54]=y,e[55]=m,e[56]=f,e[57]=p):p=e[57];let h;return e[58]!==d||e[59]!==p?(h=i.jsxs("div",{className:"space-y-2",children:[d,p]}),e[58]=d,e[59]=p,e[60]=h):h=e[60],h}function Ht(t){const e=z.c(17),{schema:n,value:r,onChange:l,path:s,label:o}=t,c=typeof r=="number"?r:"";let a;e[0]!==o||e[1]!==s?(a=i.jsx(q,{htmlFor:s,children:o}),e[0]=o,e[1]=s,e[2]=a):a=e[2];let d;e[3]!==n.description?(d=n.description&&i.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:n.description}),e[3]=n.description,e[4]=d):d=e[4];let y;e[5]!==a||e[6]!==d?(y=i.jsxs("div",{className:"space-y-0.5",children:[a,d]}),e[5]=a,e[6]=d,e[7]=y):y=e[7];let m;e[8]!==l?(m=h=>{const u=h.target.value;l(u===""?void 0:Number(u))},e[8]=l,e[9]=m):m=e[9];let f;e[10]!==c||e[11]!==s||e[12]!==m?(f=i.jsx(re,{id:s,type:"number",value:c,onChange:m,className:"h-10"}),e[10]=c,e[11]=s,e[12]=m,e[13]=f):f=e[13];let p;return e[14]!==y||e[15]!==f?(p=i.jsxs("div",{className:"space-y-2",children:[y,f]}),e[14]=y,e[15]=f,e[16]=p):p=e[16],p}function Yt(t){const e=z.c(17),{value:n,onChange:r,path:l,label:s,schema:o}=t,c=typeof n=="boolean"?n:!1;let a;e[0]!==s||e[1]!==l?(a=i.jsx(q,{htmlFor:l,children:s}),e[0]=s,e[1]=l,e[2]=a):a=e[2];let d;e[3]!==o.description?(d=o.description&&i.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:o.description}),e[3]=o.description,e[4]=d):d=e[4];let y;e[5]!==a||e[6]!==d?(y=i.jsxs("div",{className:"space-y-0.5",children:[a,d]}),e[5]=a,e[6]=d,e[7]=y):y=e[7];let m;e[8]!==r?(m=h=>r(h),e[8]=r,e[9]=m):m=e[9];let f;e[10]!==c||e[11]!==l||e[12]!==m?(f=i.jsx(ot,{id:l,checked:c,onCheckedChange:m}),e[10]=c,e[11]=l,e[12]=m,e[13]=f):f=e[13];let p;return e[14]!==y||e[15]!==f?(p=i.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y,f]}),e[14]=y,e[15]=f,e[16]=p):p=e[16],p}const Ne="__enum_empty__";function Te(t){return t===""?Ne:String(t)}function Gt(t,e){if(t===Ne)return"";const n=e.find(r=>Te(r)===t);return n!==void 0?n:t}function Xt(t,e){return t==null?e.some(n=>n==="")?Ne:void 0:Te(t)}function Zt(t){return t===""?"":String(t)}function Qt(t){const e=z.c(28),{schema:n,value:r,onChange:l,path:s,label:o}=t;let c;e[0]!==n.enum?(c=n.enum??[],e[0]=n.enum,e[1]=c):c=e[1];const a=c;let d;e[2]!==a||e[3]!==r?(d=Xt(r,a),e[2]=a,e[3]=r,e[4]=d):d=e[4];const y=d;let m;e[5]!==o||e[6]!==s?(m=i.jsx(q,{htmlFor:s,children:o}),e[5]=o,e[6]=s,e[7]=m):m=e[7];let f;e[8]!==n.description?(f=n.description&&i.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:n.description}),e[8]=n.description,e[9]=f):f=e[9];let p;e[10]!==m||e[11]!==f?(p=i.jsxs("div",{className:"space-y-0.5",children:[m,f]}),e[10]=m,e[11]=f,e[12]=p):p=e[12];let h;e[13]!==l||e[14]!==a?(h=A=>l(Gt(A,a)),e[13]=l,e[14]=a,e[15]=h):h=e[15];let u;e[16]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(Ee,{className:"h-10",children:i.jsx(Pe,{placeholder:"Select..."})}),e[16]=u):u=e[16];let g;e[17]!==a?(g=a.map(qt),e[17]=a,e[18]=g):g=e[18];let x;e[19]!==g?(x=i.jsx(Ve,{children:g}),e[19]=g,e[20]=x):x=e[20];let v;e[21]!==y||e[22]!==h||e[23]!==x?(v=i.jsxs(Me,{value:y,onValueChange:h,children:[u,x]}),e[21]=y,e[22]=h,e[23]=x,e[24]=v):v=e[24];let b;return e[25]!==v||e[26]!==p?(b=i.jsxs("div",{className:"space-y-2",children:[p,v]}),e[25]=v,e[26]=p,e[27]=b):b=e[27],b}function qt(t){const e=Te(t);return i.jsx(Le,{value:e,children:Zt(t)},e)}function Jt(t){return t.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[_-]/g," ").replace(/^\w/,e=>e.toUpperCase())}function ve(t,e){return e.title??Jt(t)}function Ie(t){return t.type==="array"&&t.items?!0:be(t)}function en(t){return t!=null&&typeof t=="object"&&!Array.isArray(t)?t:{}}function ie(t,e,n,r){if(r.length===0)return null;const l=r[0];for(const s of t){const o=e[s];if(!o||!Ie(o))continue;const c=ve(s,o);if(l===c||l===s)return s}for(const s of t){const o=e[s];if(!o||!Ie(o))continue;const c=n[s];if(!Array.isArray(c))continue;const a=o.items;for(let d=0;d<c.length;d++)if(se(c[d],d,a)===l)return s}for(const s of t){const o=e[s];if(o?.type!=="object"||!o.properties)continue;const c=Object.keys(o.properties),a=en(n[s]),d=ve(s,o);if(ie(c,o.properties,a,r)||(l===d||l===s)&&ie(c,o.properties,a,r.slice(1)))return s}return null}function tn(t,e,n,r){return ie(t,e,n,r)}function nn(t,e,n,r,l){if(l.length===0||!n.properties)return!1;const s=Object.keys(n.properties);if(ie(s,n.properties,r,l))return!0;const o=l[0];return o!==e&&o!==t?!1:l.length>1||ie(s,n.properties,r,l.slice(1))!==null}function rn(t,e,n,r){if(e.length===0)return null;for(let s=0;s<e.length;s++){const o=e[s],c=n.findIndex((a,d)=>se(a,d,r)===o);if(c>=0)return{index:c,innerPath:e.slice(s+1)}}const l=e.indexOf(t);if(l>=0&&e.length>l+1){const s=e[l+1],o=n.findIndex((c,a)=>se(c,a,r)===s);if(o>=0)return{index:o,innerPath:e.slice(l+2)}}return null}function xe(t){const e=z.c(47),{schema:n,value:r,onChange:l,path:s,label:o,breadcrumbPath:c,onBreadcrumbChange:a,meta:d,decofile:y,onSaveReferencedBlock:m}=t;let f,p,h,u,g,x,v;if(e[0]!==y||e[1]!==o||e[2]!==d||e[3]!==a||e[4]!==l||e[5]!==m||e[6]!==s||e[7]!==n.items||e[8]!==c||e[9]!==r){v=Symbol.for("react.early_return_sentinel");e:{const _=c===void 0?[]:c;u=Array.isArray(r)?r:[],h=n.items;const C=rn(o,_,u,h),S=C?.index??null;let V;e[17]!==h?(V=(w,F)=>se(w,F,h),e[17]=h,e[18]=V):V=e[18],p=V,g=w=>{const F=p(u[w],w);a?.([..._,F])},f=()=>{const w=h?.type,F=h?.default!==void 0?h.default:w==="object"?{}:w==="block-ref"?(()=>{const E=h?.anyOfRefs?.[0]?.resolveType;return typeof E!="string"||de(E)?{}:{__resolveType:E}})():w==="number"||w==="integer"?0:w==="boolean"?!1:w==="array"?[]:"",I=[...u,F];l(I);const P=I.length-1,O=se(F,P,h);a?.([..._,O])},x=w=>{if(l(u.filter((F,I)=>I!==w)),S===w){const F=p(u[w],w),I=_.indexOf(F);a?.(I>=0?_.slice(0,I):[])}};const U=(w,F)=>{const I=[...u];if(I[w]=F,l(I),S===w){const P=p(u[w],w),O=p(F,w),E=_.indexOf(P);if(E>=0){const K=[..._];K[E]=O,a?.(K);return}a?.([..._,O])}};if(S!==null&&S<u.length){const w=u[S],F=()=>{const O=p(w,S),E=_.indexOf(O);return E>=0?_.slice(0,E+1):[..._,O]},I=h?.type==="object"&&h.properties?i.jsx(_e,{schema:h,value:w,onChange:O=>U(S,O),basePath:`${s}.${S}`,breadcrumbPath:C?.innerPath??[],onBreadcrumbChange:O=>{a?.([...F(),...O])},meta:d,decofile:y,onSaveReferencedBlock:m}):h?qe({schema:h,value:w,onChange:O=>U(S,O),path:`${s}.${S}`,label:h.title??`Item ${S+1}`,breadcrumbPath:C?.innerPath??[],onBreadcrumbChange:O=>{a?.([...F(),...O])},meta:d,decofile:y,onSaveReferencedBlock:m}):null;let P;e[19]!==I?(P=i.jsx("div",{className:"min-w-0",children:I}),e[19]=I,e[20]=P):P=e[20],v=P;break e}}e[0]=y,e[1]=o,e[2]=d,e[3]=a,e[4]=l,e[5]=m,e[6]=s,e[7]=n.items,e[8]=c,e[9]=r,e[10]=f,e[11]=p,e[12]=h,e[13]=u,e[14]=g,e[15]=x,e[16]=v}else f=e[10],p=e[11],h=e[12],u=e[13],g=e[14],x=e[15],v=e[16];if(v!==Symbol.for("react.early_return_sentinel"))return v;let b;e[21]!==o?(b=i.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:o}),e[21]=o,e[22]=b):b=e[22];let A;e[23]!==u.length?(A=u.length>0&&i.jsx("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-xs font-medium text-muted-foreground",children:u.length}),e[23]=u.length,e[24]=A):A=e[24];let j;e[25]!==b||e[26]!==A?(j=i.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[b,A]}),e[25]=b,e[26]=A,e[27]=j):j=e[27];let N;e[28]!==n.description?(N=n.description&&i.jsx("p",{className:"break-words text-xs leading-normal text-muted-foreground",children:n.description}),e[28]=n.description,e[29]=N):N=e[29];let T;e[30]!==j||e[31]!==N?(T=i.jsxs("div",{className:"min-w-0 space-y-0.5",children:[j,N]}),e[30]=j,e[31]=N,e[32]=T):T=e[32];let R;e[33]!==p||e[34]!==h||e[35]!==u||e[36]!==g||e[37]!==s||e[38]!==x?(R=u.length>0&&i.jsx("div",{className:"min-w-0 overflow-hidden rounded-xl border border-border/50 p-1.5",children:u.map((_,C)=>{const S=p(_,C),V=Bt(_,h);return i.jsxs("div",{className:"group flex min-w-0 items-center gap-2.5 rounded-lg px-2 py-2.5 hover:bg-accent hover:text-accent-foreground",children:[i.jsx(at,{className:"size-3.5 shrink-0 cursor-grab text-muted-foreground/40"}),i.jsxs("button",{type:"button",onClick:()=>g(C),className:"flex min-w-0 flex-1 items-center gap-2.5 text-left text-sm",title:S,children:[V&&i.jsx("img",{src:V,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),i.jsx("span",{className:"min-w-0 truncate",children:S})]}),i.jsxs(ut,{children:[i.jsx(ft,{asChild:!0,children:i.jsx(ue,{type:"button",variant:"ghost",size:"icon","aria-label":`Open actions for ${S}`,className:"size-6 opacity-0 transition-opacity group-hover:opacity-100",onClick:sn,children:i.jsx(tt,{size:14})})}),i.jsx(dt,{align:"end",children:i.jsxs(pt,{className:"text-destructive focus:text-destructive",onClick:()=>x(C),children:[i.jsx(ze,{size:14}),"Delete"]})})]})]},`${s}.${C}`)})}),e[33]=p,e[34]=h,e[35]=u,e[36]=g,e[37]=s,e[38]=x,e[39]=R):R=e[39];let k;e[40]===Symbol.for("react.memo_cache_sentinel")?(k=i.jsx(ct,{size:14}),e[40]=k):k=e[40];let L;e[41]!==f?(L=i.jsxs("button",{type:"button",onClick:f,className:"flex w-full items-center justify-center gap-1.5 rounded-xl border border-dashed border-border/60 py-2.5 text-sm text-muted-foreground transition-colors hover:border-border hover:bg-muted/30",children:[k,"Add item"]}),e[41]=f,e[42]=L):L=e[42];let $;return e[43]!==L||e[44]!==T||e[45]!==R?($=i.jsxs("div",{className:"space-y-2",children:[T,R,L]}),e[43]=L,e[44]=T,e[45]=R,e[46]=$):$=e[46],$}function sn(t){return t.stopPropagation()}function ln(t){const e=z.c(40),{schema:n,value:r,onChange:l,path:s,label:o,breadcrumbPath:c,onBreadcrumbChange:a,meta:d,decofile:y,onSaveReferencedBlock:m}=t;let f;e[0]!==c?(f=c===void 0?[]:c,e[0]=c,e[1]=f):f=e[1];const p=f,[h,u]=Q.useState(!1);let g;e[2]!==r?(g=r!=null&&typeof r=="object"&&!Array.isArray(r)?r:{},e[2]=r,e[3]=g):g=e[3];const x=g;if(!n.properties)return null;let v;e[4]!==s?(v=s.split(".").pop()??s,e[4]=s,e[5]=v):v=e[5];const b=v;let A;e[6]!==p||e[7]!==b||e[8]!==o||e[9]!==x||e[10]!==n?(A=nn(b,o,n,x,p),e[6]=p,e[7]=b,e[8]=o,e[9]=x,e[10]=n,e[11]=A):A=e[11];const N=h||A,T=`${s}-fields`;let R;e[12]===Symbol.for("react.memo_cache_sentinel")?(R=()=>u(on),e[12]=R):R=e[12];let k;e[13]!==N?(k=i.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors group-hover:text-accent-foreground",children:N?i.jsx(We,{size:16}):i.jsx(He,{size:16})}),e[13]=N,e[14]=k):k=e[14];let L;e[15]!==o?(L=i.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:o}),e[15]=o,e[16]=L):L=e[16];let $;e[17]!==T||e[18]!==N||e[19]!==k||e[20]!==L?($=i.jsxs("button",{type:"button","aria-expanded":N,"aria-controls":T,onClick:R,className:"group flex w-full min-w-0 items-center gap-2 rounded-md py-1.5 pr-2 text-left transition-colors hover:bg-accent hover:text-accent-foreground",children:[k,L]}),e[17]=T,e[18]=N,e[19]=k,e[20]=L,e[21]=$):$=e[21];let _;e[22]!==n.description?(_=n.description&&i.jsx("p",{className:"break-words pl-9 text-xs leading-normal text-muted-foreground",children:n.description}),e[22]=n.description,e[23]=_):_=e[23];let C;e[24]!==p||e[25]!==T||e[26]!==y||e[27]!==N||e[28]!==d||e[29]!==x||e[30]!==a||e[31]!==l||e[32]!==m||e[33]!==s||e[34]!==n?(C=N&&i.jsx("div",{id:T,className:"ml-3 min-w-0 max-w-full overflow-hidden border-l border-border/80 pl-5",children:i.jsx(_e,{schema:n,value:x,onChange:l,basePath:s,breadcrumbPath:p,onBreadcrumbChange:a,meta:d,decofile:y,onSaveReferencedBlock:m})}),e[24]=p,e[25]=T,e[26]=y,e[27]=N,e[28]=d,e[29]=x,e[30]=a,e[31]=l,e[32]=m,e[33]=s,e[34]=n,e[35]=C):C=e[35];let S;return e[36]!==_||e[37]!==C||e[38]!==$?(S=i.jsxs("div",{className:"min-w-0 space-y-2",children:[$,_,C]}),e[36]=_,e[37]=C,e[38]=$,e[39]=S):S=e[39],S}function on(t){return!t}function ke(t){const e=t.__resolveType;if(typeof e!="string")return null;if(fe(e)){const r=t.section?.__resolveType;return typeof r=="string"?r:e}return e}function an(t){return t.includes("flags/multivariate")}function cn(t){return Ke(t)}function un(t,e){const n=[...t],r=new Set(n.map(s=>s.resolveType)),l=(s,o)=>{!s||r.has(s)||(r.add(s),n.push({resolveType:s,title:o??cn(s)}))};if(e.savedBlockKey&&l(e.savedBlockKey,e.savedBlockKey),e.editorValue&&typeof e.editorValue=="object"&&!Array.isArray(e.editorValue)){const s=ke(e.editorValue);s?.includes("/")&&l(s)}return n}function fn(t,e,n){const r=e[0]?.resolveType??"";if(n)return n;if(!t||typeof t!="object"||Array.isArray(t))return r;const l=t,s=l.__resolveType;if(typeof s=="string"){if(me(s)){const m=e.find(f=>f.resolveType===s);return m?m.resolveType:s}const d=e.find(m=>Ce(m.resolveType,s));if(d)return d.resolveType;const y=e.find(m=>m.resolveType===s);if(y)return y.resolveType;if(s.includes("/"))return s}const o=typeof l.type=="string"?l.type:void 0;if(o){const d=e.find(y=>y.discriminatorValue===o||y.resolveType===o||Ce(y.resolveType,o));if(d)return d.resolveType}let c=r,a=-1;for(const d of e){if(!d.schema?.properties)continue;const m=Object.keys(d.schema.properties).filter(f=>!f.startsWith("__")&&f!=="@type"&&f!=="action"&&f!=="alt").filter(f=>l[f]!==void 0).length;m>0&&m>a&&(a=m,c=d.resolveType)}return a>0,c}function Oe(t,e,n){if(!t||typeof t!="object"||Array.isArray(t))return n??null;const r=ke(t);if(!r)return n??null;if(!e)return r.includes("/")?null:n??null;const l=vt(r,e);return l||(r.includes("/")?null:n??null)}function dn(t,e){if(!t?.properties||!e)return t??null;if(!(e in t.properties))return t;const n={...t.properties};return delete n[e],{...t,properties:n}}function pn(t,e){if(e)return!0;if(!t||typeof t!="object"||Array.isArray(t))return!1;const n=t,r=ke(n);return r&&an(r)?Array.isArray(n.variants)&&n.variants.length>0:Object.keys(n).some(l=>!l.startsWith("__")&&l!=="@type")}function mn(t){if(!t?.properties)return{};const e={};for(const[n,r]of Object.entries(t.properties))n.startsWith("__")||n==="@type"||(r.default!==void 0?e[n]=r.default:r.type==="boolean"?e[n]=!1:r.type==="string"?e[n]="":r.type==="number"||r.type==="integer"?e[n]=0:r.type==="object"&&(e[n]={}));return e}function hn(t){const e=z.c(3),{blockKey:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(_t,{asChild:!0,children:i.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-global-section/14 px-1.5 py-0.5 text-[11px] font-medium text-global-section-fg dark:text-global-section-fg-dark",children:[i.jsx(kt,{size:11}),"Global"]})}),e[0]=r):r=e[0];let l;return e[1]!==n?(l=i.jsxs(wt,{children:[r,i.jsxs(St,{side:"top",className:"max-w-[260px]",children:["Edits the saved block “",n,"”. Changes apply everywhere this loader is referenced on your site."]})]}),e[1]=n,e[2]=l):l=e[2],l}function yn(t){const e=z.c(28),{path:n,open:r,onOpenChange:l,title:s,nested:o,nestedBlockRef:c,globalBlockKey:a}=t,d=`${n}-loader-config`,y=c&&"ml-1";let m;e[0]!==y?(m=De("rounded-lg border border-border/80 bg-muted/30",y),e[0]=y,e[1]=m):m=e[1];let f;e[2]!==l||e[3]!==r?(f=()=>l(!r),e[2]=l,e[3]=r,e[4]=f):f=e[4];let p;e[5]!==r?(p=i.jsx("span",{className:"flex size-6 shrink-0 items-center justify-center text-muted-foreground transition-colors group-hover:text-foreground",children:r?i.jsx(We,{size:16}):i.jsx(He,{size:16})}),e[5]=r,e[6]=p):p=e[6];let h;e[7]!==s?(h=i.jsx("span",{className:"truncate text-xs font-medium tracking-wide text-muted-foreground uppercase",children:s}),e[7]=s,e[8]=h):h=e[8];let u;e[9]!==a?(u=a&&i.jsx(hn,{blockKey:a}),e[9]=a,e[10]=u):u=e[10];let g;e[11]!==h||e[12]!==u?(g=i.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[h,u]}),e[11]=h,e[12]=u,e[13]=g):g=e[13];let x;e[14]!==d||e[15]!==r||e[16]!==f||e[17]!==p||e[18]!==g?(x=i.jsxs("button",{type:"button","aria-expanded":r,"aria-controls":d,onClick:f,className:"group flex w-full min-w-0 items-center gap-2 rounded-lg px-3 py-2.5 text-left transition-colors hover:bg-accent/50",children:[p,g]}),e[14]=d,e[15]=r,e[16]=f,e[17]=p,e[18]=g,e[19]=x):x=e[19];let v;e[20]!==d||e[21]!==o||e[22]!==r?(v=r&&i.jsx("div",{id:d,className:"border-t border-border/60 px-4 pb-4 pt-3",children:i.jsx("div",{className:"border-l border-border/80 pl-4",children:o})}),e[20]=d,e[21]=o,e[22]=r,e[23]=v):v=e[23];let b;return e[24]!==m||e[25]!==x||e[26]!==v?(b=i.jsxs("div",{className:m,children:[x,v]}),e[24]=m,e[25]=x,e[26]=v,e[27]=b):b=e[27],b}function Re(t){const e=z.c(30),{schema:n,value:r,onChange:l,path:s,label:o,breadcrumbPath:c,onBreadcrumbChange:a,meta:d,decofile:y,onSaveReferencedBlock:m}=t,f=(n.anyOfRefs??[]).filter(vn),p=y&&r?Dt(r,y):null,h=p?.data??r,u=un(f,{savedBlockKey:p?.blockKey,editorValue:h}),g=u.length>0?fn(h,u,p?.blockKey):u[0]?.resolveType??"",[x,v]=Q.useState(g),[b,A]=Q.useState(g);b!==g&&(A(g),v(g));const[j,N]=Q.useState(()=>pn(h,p?.blockKey));if(u.length>0){const S=x||g;let V;e[0]!==S?(V=B=>B.resolveType===S,e[0]=S,e[1]=V):V=e[1];const U=u.find(V),w=Oe(h,d,U?.schema),F=dn(w??U?.schema??null,n.discriminatorKey),I=n.discriminatorKey,P=B=>{v(B);const D=u.find(ne=>ne.resolveType===B),M=Oe(h,d,D?.schema),J=new Set(Object.keys((M??D?.schema)?.properties??{})),te=r!==null&&typeof r=="object"&&!Array.isArray(r)?r:{},oe=Object.fromEntries(Object.entries(te).filter(ne=>{const[Je]=ne;return J.has(Je)})),ye={...mn(D?.schema),...oe};if(I){const ne=D?.discriminatorValue??B;l({...ye,[I]:ne});return}if(de(B)){l(ye);return}l({...ye,__resolveType:B})};let O;e[2]!==S||e[3]!==I||e[4]!==l?(O=B=>{if(I||!de(S)||B===null||typeof B!="object"||Array.isArray(B)){l(B);return}const{__resolveType:D,...M}=B;l(M)},e[2]=S,e[3]=I,e[4]=l,e[5]=O):O=e[5];const E=O,K=F?.properties?i.jsx(_e,{schema:F,value:h,onChange:B=>{if(p&&m){m(p.blockKey,B);return}E(B)},basePath:s,breadcrumbPath:c,onBreadcrumbChange:a,meta:d,decofile:y,onSaveReferencedBlock:m}):null,Z=n.type==="block-ref"&&u.some(xn);let W;e[6]!==s?(W=s.includes("."),e[6]=s,e[7]=W):W=e[7];const G=W;let H;e[8]!==o||e[9]!==s?(H=i.jsx(q,{htmlFor:s,children:o}),e[8]=o,e[9]=s,e[10]=H):H=e[10];let Y;e[11]===Symbol.for("react.memo_cache_sentinel")?(Y=i.jsx(Ee,{children:i.jsx(Pe,{placeholder:"Select..."})}),e[11]=Y):Y=e[11];let X;return e[12]!==n.description?(X=n.description&&i.jsx("p",{className:"text-xs text-muted-foreground",children:n.description}),e[12]=n.description,e[13]=X):X=e[13],i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"space-y-1.5",children:[H,i.jsxs(Me,{value:S||void 0,onValueChange:P,children:[Y,i.jsx(Ve,{children:u.map(gn)})]}),X]}),K&&(Z?i.jsx(yn,{path:s,open:j,onOpenChange:N,title:G?"Configuration":"Loader configuration",nested:K,nestedBlockRef:G,globalBlockKey:p?.blockKey}):K)]})}if(n.anyOfRefs&&n.anyOfRefs.length>0)return null;let T;e[14]!==o||e[15]!==s?(T=i.jsx(q,{htmlFor:s,children:o}),e[14]=o,e[15]=s,e[16]=T):T=e[16];const R=r!=null?String(r):"";let k;e[17]!==l?(k=S=>l(S.target.value),e[17]=l,e[18]=k):k=e[18];const L=n.description??"";let $;e[19]!==s||e[20]!==R||e[21]!==k||e[22]!==L?($=i.jsx("input",{id:s,type:"text",value:R,onChange:k,className:"w-full rounded-md border bg-background px-3 py-1.5 text-sm",placeholder:L}),e[19]=s,e[20]=R,e[21]=k,e[22]=L,e[23]=$):$=e[23];let _;e[24]!==n.description?(_=n.description&&i.jsx("p",{className:"text-xs text-muted-foreground",children:n.description}),e[24]=n.description,e[25]=_):_=e[25];let C;return e[26]!==T||e[27]!==$||e[28]!==_?(C=i.jsxs("div",{className:"space-y-1.5",children:[T,$,_]}),e[26]=T,e[27]=$,e[28]=_,e[29]=C):C=e[29],C}function gn(t){return i.jsx(Le,{value:t.resolveType,children:t.title??bt(t.resolveType)??t.resolveType},t.resolveType)}function xn(t){return t.resolveType.includes("/")&&!de(t.resolveType)}function vn(t){return t.resolveType!==""}function $e(t){const e=z.c(2),{ext:n}=t;if(!n)return null;let r;return e[0]!==n?(r=i.jsx("span",{className:"shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium uppercase text-muted-foreground",children:n}),e[0]=n,e[1]=r):r=e[1],r}function bn(t){try{const e=new URL(t).pathname;return decodeURIComponent(e.split("/").pop()??t)}catch{return t.split("/").pop()??t}}function jn(t){const e=t.lastIndexOf(".");return e<0||e===t.length-1?"":t.slice(e+1).toLowerCase()}function Fe(t){const e=z.c(72),{schema:n,value:r,onChange:l,path:s,label:o}=t,c=n.format==="video-uri",a=Ue(r),[d,y]=Q.useState(!1),[m,f]=Q.useState(!1),p=a?bn(a):"",h=p?jn(p):"",u=Ct(),g=mt();let x;e[0]!==u.data?.configs?(x=function(){const D=u.data?.configs??[];if(D.length===1)return D[0].id;if(D.length===0)return null;const M=typeof window<"u"?window.localStorage.getItem(ht):null;return D.some(J=>J.id===M)?M:null},e[0]=u.data?.configs,e[1]=x):x=e[1];const v=x;let b;e[2]!==c||e[3]!==l||e[4]!==v||e[5]!==y||e[6]!==g?(b=async function(D){if(!D)return;let M=Array.from(D);if(M.length===0)return;if(c&&(M=M.filter(Nn),M.length===0)){ge.error("Please drop a video file (mp4, webm, …).");return}const J=v();if(!J){y(!0);return}try{const te=await g.mutateAsync({configId:J,file:M[0]});l(te.publicUrl),M.length>1&&ge.info(`Uploaded ${M[0].name}; extra files were ignored (single-select field).`)}catch(te){const oe=te;ge.error(oe instanceof Error?oe.message:"Upload failed")}},e[2]=c,e[3]=l,e[4]=v,e[5]=y,e[6]=g,e[7]=b):b=e[7];const A=b;let j;e[8]!==f?(j=function(D){D.preventDefault(),D.dataTransfer.types.includes("Files")&&f(!0)},e[8]=f,e[9]=j):j=e[9];const N=j;let T;e[10]!==f?(T=function(D){D.currentTarget===D.target&&f(!1)},e[10]=f,e[11]=T):T=e[11];const R=T;let k;e[12]!==A||e[13]!==f?(k=function(D){D.preventDefault(),f(!1),A(D.dataTransfer.files)},e[12]=A,e[13]=f,e[14]=k):k=e[14];const L=k;let $;e[15]!==o||e[16]!==s?($=i.jsx(q,{htmlFor:s,className:"text-muted-foreground",children:o}),e[15]=o,e[16]=s,e[17]=$):$=e[17];let _;e[18]!==n.description?(_=n.description&&i.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:n.description}),e[18]=n.description,e[19]=_):_=e[19];let C;e[20]!==$||e[21]!==_?(C=i.jsxs("div",{className:"min-w-0 space-y-0.5",children:[$,_]}),e[20]=$,e[21]=_,e[22]=C):C=e[22];const S=m&&"border-primary ring-2 ring-primary/30",V=g.isPending&&"pointer-events-none opacity-60";let U;e[23]!==V||e[24]!==S?(U=De("group relative w-full overflow-hidden rounded-xl border border-border/60 bg-muted/30 transition",S,V),e[23]=V,e[24]=S,e[25]=U):U=e[25];let w;e[26]!==h||e[27]!==p||e[28]!==c||e[29]!==y||e[30]!==a||e[31]!==g.isPending?(w=a?c?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"relative h-40 w-full overflow-hidden bg-black",children:i.jsx("video",{src:a,preload:"metadata",className:"h-full w-full object-contain"},a)}),i.jsxs("div",{className:"flex items-center gap-2 border-t border-border/60 bg-background/50 px-3 py-2",children:[i.jsx(we,{size:14,className:"shrink-0 text-muted-foreground"}),i.jsx("p",{className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:p}),i.jsx($e,{ext:h})]})]}):i.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5",children:[i.jsx("div",{className:"flex size-10 shrink-0 items-center justify-center rounded-md bg-background",children:i.jsx(Se,{size:18,className:"text-muted-foreground"})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("p",{className:"truncate text-sm font-medium",children:p}),i.jsx("p",{className:"truncate text-xs text-muted-foreground",children:a})]}),i.jsx($e,{ext:h})]}):i.jsxs("button",{type:"button",onClick:()=>y(!0),className:"flex w-full flex-col items-center justify-center gap-2 py-8 text-sm text-muted-foreground hover:bg-muted/60 hover:text-foreground",children:[c?i.jsx(we,{size:20}):i.jsx(Se,{size:20}),i.jsx("span",{className:"text-sm font-medium",children:g.isPending?"Uploading…":c?"Drop a video here or click to browse":"Drop a file or click to browse"}),i.jsx("span",{className:"text-xs text-muted-foreground",children:"Up to 100 MB"})]}),e[26]=h,e[27]=p,e[28]=c,e[29]=y,e[30]=a,e[31]=g.isPending,e[32]=w):w=e[32];let F;e[33]!==m?(F=m&&i.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center bg-primary/10 backdrop-blur-[1px]",children:i.jsx("span",{className:"rounded-md bg-background px-3 py-1.5 text-xs font-medium shadow",children:"Drop to upload"})}),e[33]=m,e[34]=F):F=e[34];let I;e[35]!==R||e[36]!==N||e[37]!==L||e[38]!==U||e[39]!==w||e[40]!==F?(I=i.jsxs("div",{onDragOver:N,onDragLeave:R,onDrop:L,className:U,children:[w,F]}),e[35]=R,e[36]=N,e[37]=L,e[38]=U,e[39]=w,e[40]=F,e[41]=I):I=e[41];let P;e[42]!==l?(P=B=>l(B.target.value),e[42]=l,e[43]=P):P=e[43];let O;e[44]!==s||e[45]!==a||e[46]!==P?(O=i.jsx(re,{id:s,type:"url",value:a,onChange:P,placeholder:"https://...",className:"h-9 min-w-0 flex-1"}),e[44]=s,e[45]=a,e[46]=P,e[47]=O):O=e[47];let E;e[48]!==y?(E=()=>y(!0),e[48]=y,e[49]=E):E=e[49];let K;e[50]===Symbol.for("react.memo_cache_sentinel")?(K=i.jsx(At,{size:14}),e[50]=K):K=e[50];const le=a?"Replace":"Browse";let Z;e[51]!==E||e[52]!==le?(Z=i.jsxs(ue,{type:"button",variant:"outline",size:"sm",onClick:E,className:"h-9 shrink-0",children:[K,le]}),e[51]=E,e[52]=le,e[53]=Z):Z=e[53];let W;e[54]!==l||e[55]!==a?(W=a&&i.jsx(ue,{type:"button",variant:"ghost",size:"sm",onClick:()=>l(""),className:"h-9 shrink-0","aria-label":"Remove file",children:i.jsx(ze,{size:14})}),e[54]=l,e[55]=a,e[56]=W):W=e[56];let G;e[57]!==O||e[58]!==Z||e[59]!==W?(G=i.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[O,Z,W]}),e[57]=O,e[58]=Z,e[59]=W,e[60]=G):G=e[60];let H;e[61]!==l?(H=B=>l(B),e[61]=l,e[62]=H):H=e[62];let Y;e[63]!==d||e[64]!==y||e[65]!==H?(Y=i.jsx(yt,{open:d,onOpenChange:y,mode:"any",onSelect:H}),e[63]=d,e[64]=y,e[65]=H,e[66]=Y):Y=e[66];let X;return e[67]!==I||e[68]!==G||e[69]!==Y||e[70]!==C?(X=i.jsxs("div",{className:"grid w-full min-w-0 grid-cols-[minmax(0,1fr)] gap-2",children:[C,I,G,Y]}),e[67]=I,e[68]=G,e[69]=Y,e[70]=C,e[71]=X):X=e[71],X}function Nn(t){return t.type.startsWith("video/")}const Tn=new Set(["__resolveType","@type"]);function kn(t){if(t.type!=="block-ref"||!t.anyOfRefs?.length||t.anyOfRefs.length!==1)return null;const e=t.anyOfRefs[0].resolveType;return e.endsWith("/multivariate/image.ts")?"image":e.endsWith("/multivariate/video.ts")||e.endsWith("/multivariate/file.ts")?"file":null}function _n(t){if(be(t))for(const e of t.anyOfRefs??[]){const l=e.schema?.properties?.variants?.items?.properties?.value;if(l?.type==="array"&&l.items)return l.items}}function Be(t){if(t.type==="array"&&t.items)return t;const e=t.items??_n(t);return e?{...t,type:"array",items:e}:null}function wn(t,e){if(e!==void 0)return e;switch(t){case"string":return"";case"number":case"integer":return 0;case"boolean":return!1;case"array":return[];case"object":return{};default:return null}}function qe(t){const{schema:e,value:n}=t;if(jt(n)){const o=Nt(n),c=Be(e);if(o!==null&&c)return i.jsx(xe,{...t,schema:c,value:o,onChange:a=>t.onChange(Tt(n,a))},t.path)}if(Array.isArray(n)&&e.type==="block-ref"&&be(e)){const o=Be(e);if(o)return i.jsx(xe,{...t,schema:o,value:n,onChange:t.onChange},t.path)}if(e.type==="block-ref"||n!==null&&typeof n=="object"&&!Array.isArray(n)&&typeof n.__resolveType=="string"&&e.anyOfRefs){const o=kn(e);return o==="image"?i.jsx(Ae,{...t},t.path):o==="file"?i.jsx(Fe,{...t},t.path):e.anyOfRefs?i.jsx(Re,{...t},t.path):null}if(e.format==="image-uri")return i.jsx(Ae,{...t},t.path);if(e.format==="file-uri"||e.format==="video-uri")return i.jsx(Fe,{...t},t.path);if(e.enum&&e.enum.length>0)return i.jsx(Qt,{...t},t.path);if(e.type==="anyOf")return i.jsx(Re,{...t},t.path);const r=n??wn(e.type,e.default);if(r==null)return null;const l={...t,value:r},s=n==null?e.type??typeof r:Array.isArray(r)?"array":typeof r;if(s==="array"||Array.isArray(r))return i.jsx(xe,{...l},t.path);switch(s){case"boolean":return i.jsx(Yt,{...l},t.path);case"number":case"integer":return i.jsx(Ht,{...l},t.path);case"string":{const o=e.format;return o==="color-input"?i.jsx(ce,{...l},t.path):o==="textarea"||o==="rich-text"||o==="html"?i.jsx(ce,{...l},t.path):i.jsx(ce,{...l},t.path)}case"object":return r!==null&&typeof r=="object"&&!Array.isArray(r)?i.jsx(ln,{...l},t.path):null;default:return i.jsx(ce,{...l},t.path)}}function _e(t){const e=z.c(12),{schema:n,value:r,onChange:l,basePath:s,breadcrumbPath:o,onBreadcrumbChange:c,meta:a,decofile:d,onSaveReferencedBlock:y}=t;let m,f;if(e[0]!==s||e[1]!==d||e[2]!==a||e[3]!==c||e[4]!==l||e[5]!==y||e[6]!==n.properties||e[7]!==o||e[8]!==r){f=Symbol.for("react.early_return_sentinel");e:{const p=o===void 0?[]:o,h=n.properties;if(!h){f=null;break e}const u=r!=null&&typeof r=="object"&&!Array.isArray(r)?r:{},g=Object.keys(h).filter(j=>!Tn.has(j)&&h[j]?.hidden!==!0);if(g.length===0){let j;e[11]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"No editable fields on this section."}),e[11]=j):j=e[11],f=j;break e}const x=(j,N)=>{l({...u,[j]:N})},v=p.length>0?tn(g,h,u,p):null,b=v?h[v]:null,A=v&&b?[v]:g;m=i.jsx("div",{className:"min-w-0 space-y-6",children:A.map(j=>{const N=h[j];if(!N)return null;const T=s?`${s}.${j}`:j,R=ve(j,N);return qe({schema:N,value:u[j],onChange:k=>x(j,k),path:T,label:R,breadcrumbPath:p,onBreadcrumbChange:c,meta:a,decofile:d,onSaveReferencedBlock:y})})})}e[0]=s,e[1]=d,e[2]=a,e[3]=c,e[4]=l,e[5]=y,e[6]=n.properties,e[7]=o,e[8]=r,e[9]=m,e[10]=f}else m=e[9],f=e[10];return f!==Symbol.for("react.early_return_sentinel")?f:m}export{_e as S,qe as a,ce as b,je as r,It as s,Gn as u};
|
|
1
|
+
import{e as z,j as i,r as Q,B as ue,c as De,o as ge}from"./index-D0mCKPyO.js";import{aa as et,v as tt,aq as we,H as Se}from"./agent-icon-BLOU6m2j.js";import{C as nt}from"./calendar-RwY1IDnr.js";import{I as re}from"./input-D8tMlH9u.js";import{L as q}from"./label-gsYRU7Jg.js";import{a as rt,b as st,P as it}from"./popover-BSLgCJyu.js";import{T as lt}from"./textarea-hnK41FQH.js";import{S as ot}from"./switch-5KPQojOQ.js";import{c as Le,S as Ee,a as Pe,b as Ve,d as Me}from"./select-BaScWEqk.js";import{d as at}from"./ZoomOut-BMRPpVVp.js";import{s as ct}from"./Plus-6fOxce1R.js";import{s as ze}from"./Trash01-BnAZS_Kz.js";import{D as ut,a as ft,b as dt,c as pt}from"./dropdown-menu-C9j4QtMB.js";import{e as Ue,u as mt,L as ht,F as yt,I as Ae}from"./image-field-Coe4I69A.js";import{l as Ke,i as fe,W as me,S as gt,P as xt,X as be,Y as de,Z as Ce,m as vt,_ as bt,$ as jt,a0 as Nt,a1 as Tt}from"./index-DvmtvMeE.js";import{t as We}from"./ChevronDown-BbOS4qL1.js";import{i as He}from"./ChevronRight-1rvQ8kzv.js";import{i as kt}from"./Globe01-DWblfsLy.js";import{T as _t,b as wt,a as St}from"./tooltip-D6Vf8YNB.js";import{i as At}from"./Upload01-TgqRGsOi.js";import{c as Ct}from"./use-file-configs-B-RshlbZ.js";function It(t){if(t?.trim())try{const e=new URL(t);return e.protocol!=="https:"?void 0:e.href}catch{return}}function Ot(t){if(Array.isArray(t.variants)){const e=t.variants,n=e.find(l=>l.rule?.__resolveType?.includes("always"));if(typeof n?.value=="string")return n.value;const r=e.find(l=>typeof l.value=="string");if(r)return r.value}if(typeof t.src=="string")return t.src;if(typeof t.url=="string")return t.url;if(typeof t.value=="string")return t.value}function Ye(t){if(typeof t=="string"||t==null||typeof t!="object")return t;if(Array.isArray(t))return t.map(Ye);const e=t;return e.__resolveType?Ot(e)??t:Ge(e)}function Ge(t){const e={};for(const[n,r]of Object.entries(t))e[n]=Ye(r);return e}function Rt(t,e){return e.split(".").reduce((n,r)=>{if(!(n==null||typeof n!="object"))return n[r]},t)}function Xe(t){return t==null?"":Array.isArray(t)?t.map(Xe).filter(Boolean).join(","):typeof t=="object"?"":String(t)}function je(t,e){if(!t.includes("{"))return;const n=Ge(e);return t.replace(/\{\{\{([^}]+)\}\}\}|\{\{([^}]+)\}\}/g,(l,s,o)=>{const c=(s??o??"").trim();return Xe(Rt(n,c))}).trim()||void 0}function $t(t,e){if(e.includes("{"))return je(e,t);const n=t[e];if(typeof n=="string"&&n)return n;if(Array.isArray(n)){const r=n.map(l=>l==null?"":String(l)).filter(Boolean).join(",");if(r)return r}}function se(t,e,n){if(typeof t=="string")return t||`Item ${e+1}`;if(typeof t=="number"||typeof t=="boolean")return String(t);if(t&&typeof t=="object"&&!Array.isArray(t)){const r=t;if(n?.titleBy){const s=$t(r,n.titleBy);if(s)return s}for(const s of["name","label","title","alt","text","href","id"]){const o=r[s];if(typeof o=="string"&&o)return o;if(Array.isArray(o)){const c=o.map(a=>a==null?"":String(a)).filter(Boolean).join(",");if(c)return c}}const l=r.__resolveType;if(typeof l=="string"&&l)return Ke(l);if(n?.title){const s=je(n.title,r);if(s)return s;if(!n.title.includes("{"))return n.title}}return`Item ${e+1}`}function Ft(t){if(!t)return;if(typeof t.image=="string"&&t.image.includes("{"))return t.image;const e=t.properties?.image;if(!e)return;if(e.format==="image-uri")return"{{{image}}}";const n=e.properties;return n?.mobile?"{{{image.mobile}}}":n?.desktop?"{{{image.desktop}}}":"{{{image}}}"}function Bt(t,e){if(!t||typeof t!="object"||Array.isArray(t))return;const n=Ft(e);if(!n)return;const r=je(n,t);if(!r)return;const l=Ue(r)||r;return It(l)}function Ze(t){return t===gt||t===xt}function he(t,e){if(!Object.hasOwn(e,t))return null;const n=e[t]??{},r=n.__resolveType??t;return{data:{...n},resolveType:r}}function pe(t,e){const n=t.__resolveType??"";if(!n)return null;if(fe(n)){const r=t.section??{};return Qe(r,e)}if(Ze(n)){const r=t.variants?.[0]?.value;return r?pe(r,e):null}return!me(n)||!Object.hasOwn(e,n)?{data:{...t},resolveType:n}:he(n,e)}function Qe(t,e){const n=t.__resolveType??"";if(!n)return null;if(Ze(n)){const r=t.variants?.[0]?.value;return r?pe(r,e):null}return!me(n)||!Object.hasOwn(e,n)?{data:{...t},resolveType:n}:he(n,e)}function Dt(t,e){if(!t||typeof t!="object"||Array.isArray(t))return null;const r=t.__resolveType;if(typeof r!="string"||!me(r)||!Object.hasOwn(e,r))return null;const l=he(r,e);return l?{blockKey:r,...l}:null}function Gn(t,e,n){if(e.isMultivariate)return null;if(e.isSavedBlock){const r=e.isLazy?t.section?.__resolveType??t.__resolveType:t.__resolveType;return he(r,n)}if(e.isHidden){const s=(fe(t.__resolveType)?t.section:t)?.variants?.[0]?.value??t;return pe(s,n)}if(e.isLazy||fe(t.__resolveType)){const r=t.section??{};return Qe(r,n)}return pe(t,n)}const ee=t=>String(t).padStart(2,"0"),Lt="1900-01-01",Et="2099-12-31",Pt="1900-01-01T00:00",Vt="2099-12-31T23:59";function Mt(t){if(!t)return"";const e=t.slice(0,10);if(/^\d{4}-\d{2}-\d{2}$/.test(e))return e;const n=new Date(t);return Number.isNaN(n.getTime())?"":`${n.getUTCFullYear()}-${ee(n.getUTCMonth()+1)}-${ee(n.getUTCDate())}`}function zt(t){return!t||!/^\d{4}-\d{2}-\d{2}$/.test(t)?"":`${t}T00:00:00.000Z`}function Ut(t){if(!t)return"";const e=new Date(t);return Number.isNaN(e.getTime())?"":`${e.getFullYear()}-${ee(e.getMonth()+1)}-${ee(e.getDate())}T${ee(e.getHours())}:${ee(e.getMinutes())}`}function Kt(t){if(!t)return"";const e=new Date(t);return Number.isNaN(e.getTime())?"":e.toISOString()}function Wt(t){const e=z.c(29),{id:n,withTime:r,value:l,onChange:s}=t,[o,c]=Q.useState(!1);let a;e[0]!==l||e[1]!==r?(a=r?Ut(l):Mt(l),e[0]=l,e[1]=r,e[2]=a):a=e[2];const d=a;let y;e[3]!==s||e[4]!==r?(y=k=>{s(r?Kt(k.target.value):zt(k.target.value))},e[3]=s,e[4]=r,e[5]=y):y=e[5];const m=y;let f;if(e[6]!==l){const k=l?new Date(l):null;f=k&&!Number.isNaN(k.getTime())?k:null,e[6]=l,e[7]=f}else f=e[7];const p=f;let h;e[8]!==s||e[9]!==p||e[10]!==r?(h=k=>{k&&(r&&p?k.setHours(p.getHours(),p.getMinutes(),0,0):k.setHours(0,0,0,0),s(k.toISOString()),c(!1))},e[8]=s,e[9]=p,e[10]=r,e[11]=h):h=e[11];const u=h,g=r?"datetime-local":"date",x=r?Pt:Lt,v=r?Vt:Et;let b;e[12]!==m||e[13]!==n||e[14]!==d||e[15]!==g||e[16]!==x||e[17]!==v?(b=i.jsx(re,{id:n,type:g,min:x,max:v,value:d,onChange:m,className:"h-10 flex-1 [&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-calendar-picker-indicator]:opacity-0"}),e[12]=m,e[13]=n,e[14]=d,e[15]=g,e[16]=x,e[17]=v,e[18]=b):b=e[18];let A;e[19]===Symbol.for("react.memo_cache_sentinel")?(A=i.jsx(rt,{asChild:!0,children:i.jsx(ue,{type:"button",variant:"outline",size:"icon",className:"h-10 w-10 shrink-0","aria-label":"Open calendar",children:i.jsx(et,{className:"h-4 w-4"})})}),e[19]=A):A=e[19];const j=p??void 0;let N;e[20]!==u||e[21]!==j?(N=i.jsx(st,{className:"w-auto p-0",align:"end",children:i.jsx(nt,{mode:"single",selected:j,onSelect:u,initialFocus:!0})}),e[20]=u,e[21]=j,e[22]=N):N=e[22];let T;e[23]!==o||e[24]!==N?(T=i.jsxs(it,{open:o,onOpenChange:c,children:[A,N]}),e[23]=o,e[24]=N,e[25]=T):T=e[25];let R;return e[26]!==T||e[27]!==b?(R=i.jsxs("div",{className:"flex gap-1",children:[b,T]}),e[26]=T,e[27]=b,e[28]=R):R=e[28],R}function ae(t){const e=z.c(8),{htmlFor:n,label:r,description:l}=t;let s;e[0]!==n||e[1]!==r?(s=i.jsx(q,{htmlFor:n,children:r}),e[0]=n,e[1]=r,e[2]=s):s=e[2];let o;e[3]!==l?(o=l&&i.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:l}),e[3]=l,e[4]=o):o=e[4];let c;return e[5]!==s||e[6]!==o?(c=i.jsxs("div",{className:"space-y-0.5",children:[s,o]}),e[5]=s,e[6]=o,e[7]=c):c=e[7],c}function ce(t){const e=z.c(61),{schema:n,value:r,onChange:l,path:s,label:o}=t,c=typeof r=="string"?r:"",a=n.format;if(a==="textarea"||a==="rich-text"||a==="rich-text-inline"||a==="markdown"){let u;e[0]!==o||e[1]!==s||e[2]!==n.description?(u=i.jsx(ae,{htmlFor:s,label:o,description:n.description}),e[0]=o,e[1]=s,e[2]=n.description,e[3]=u):u=e[3];let g;e[4]!==l?(g=b=>l(b.target.value),e[4]=l,e[5]=g):g=e[5];let x;e[6]!==s||e[7]!==c||e[8]!==g?(x=i.jsx(lt,{id:s,value:c,onChange:g,rows:4}),e[6]=s,e[7]=c,e[8]=g,e[9]=x):x=e[9];let v;return e[10]!==u||e[11]!==x?(v=i.jsxs("div",{className:"space-y-2",children:[u,x]}),e[10]=u,e[11]=x,e[12]=v):v=e[12],v}if(a==="date"||a==="date-time"){let u;e[13]!==o||e[14]!==s||e[15]!==n.description?(u=i.jsx(ae,{htmlFor:s,label:o,description:n.description}),e[13]=o,e[14]=s,e[15]=n.description,e[16]=u):u=e[16];const g=a==="date-time";let x;e[17]!==l||e[18]!==s||e[19]!==c||e[20]!==g?(x=i.jsx(Wt,{id:s,withTime:g,value:c,onChange:l}),e[17]=l,e[18]=s,e[19]=c,e[20]=g,e[21]=x):x=e[21];let v;return e[22]!==u||e[23]!==x?(v=i.jsxs("div",{className:"space-y-2",children:[u,x]}),e[22]=u,e[23]=x,e[24]=v):v=e[24],v}if(a==="color-input"){let u;e[25]!==o||e[26]!==s||e[27]!==n.description?(u=i.jsx(ae,{htmlFor:s,label:o,description:n.description}),e[25]=o,e[26]=s,e[27]=n.description,e[28]=u):u=e[28];const g=c||"#000000";let x;e[29]!==l?(x=T=>l(T.target.value),e[29]=l,e[30]=x):x=e[30];let v;e[31]!==g||e[32]!==x?(v=i.jsx("input",{type:"color",value:g,onChange:x,className:"h-10 w-10 cursor-pointer rounded-lg border border-border bg-background p-1"}),e[31]=g,e[32]=x,e[33]=v):v=e[33];let b;e[34]!==l?(b=T=>l(T.target.value),e[34]=l,e[35]=b):b=e[35];let A;e[36]!==s||e[37]!==c||e[38]!==b?(A=i.jsx(re,{id:s,value:c,onChange:b,placeholder:"#000000",className:"h-10 flex-1"}),e[36]=s,e[37]=c,e[38]=b,e[39]=A):A=e[39];let j;e[40]!==v||e[41]!==A?(j=i.jsxs("div",{className:"flex items-center gap-2",children:[v,A]}),e[40]=v,e[41]=A,e[42]=j):j=e[42];let N;return e[43]!==u||e[44]!==j?(N=i.jsxs("div",{className:"space-y-2",children:[u,j]}),e[43]=u,e[44]=j,e[45]=N):N=e[45],N}let d;e[46]!==o||e[47]!==s||e[48]!==n.description?(d=i.jsx(ae,{htmlFor:s,label:o,description:n.description}),e[46]=o,e[47]=s,e[48]=n.description,e[49]=d):d=e[49];const y=a==="url"?"url":"text";let m;e[50]!==l?(m=u=>l(u.target.value),e[50]=l,e[51]=m):m=e[51];const f=n.default!=null?String(n.default):void 0;let p;e[52]!==s||e[53]!==c||e[54]!==y||e[55]!==m||e[56]!==f?(p=i.jsx(re,{id:s,type:y,value:c,onChange:m,placeholder:f,className:"h-10"}),e[52]=s,e[53]=c,e[54]=y,e[55]=m,e[56]=f,e[57]=p):p=e[57];let h;return e[58]!==d||e[59]!==p?(h=i.jsxs("div",{className:"space-y-2",children:[d,p]}),e[58]=d,e[59]=p,e[60]=h):h=e[60],h}function Ht(t){const e=z.c(17),{schema:n,value:r,onChange:l,path:s,label:o}=t,c=typeof r=="number"?r:"";let a;e[0]!==o||e[1]!==s?(a=i.jsx(q,{htmlFor:s,children:o}),e[0]=o,e[1]=s,e[2]=a):a=e[2];let d;e[3]!==n.description?(d=n.description&&i.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:n.description}),e[3]=n.description,e[4]=d):d=e[4];let y;e[5]!==a||e[6]!==d?(y=i.jsxs("div",{className:"space-y-0.5",children:[a,d]}),e[5]=a,e[6]=d,e[7]=y):y=e[7];let m;e[8]!==l?(m=h=>{const u=h.target.value;l(u===""?void 0:Number(u))},e[8]=l,e[9]=m):m=e[9];let f;e[10]!==c||e[11]!==s||e[12]!==m?(f=i.jsx(re,{id:s,type:"number",value:c,onChange:m,className:"h-10"}),e[10]=c,e[11]=s,e[12]=m,e[13]=f):f=e[13];let p;return e[14]!==y||e[15]!==f?(p=i.jsxs("div",{className:"space-y-2",children:[y,f]}),e[14]=y,e[15]=f,e[16]=p):p=e[16],p}function Yt(t){const e=z.c(17),{value:n,onChange:r,path:l,label:s,schema:o}=t,c=typeof n=="boolean"?n:!1;let a;e[0]!==s||e[1]!==l?(a=i.jsx(q,{htmlFor:l,children:s}),e[0]=s,e[1]=l,e[2]=a):a=e[2];let d;e[3]!==o.description?(d=o.description&&i.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:o.description}),e[3]=o.description,e[4]=d):d=e[4];let y;e[5]!==a||e[6]!==d?(y=i.jsxs("div",{className:"space-y-0.5",children:[a,d]}),e[5]=a,e[6]=d,e[7]=y):y=e[7];let m;e[8]!==r?(m=h=>r(h),e[8]=r,e[9]=m):m=e[9];let f;e[10]!==c||e[11]!==l||e[12]!==m?(f=i.jsx(ot,{id:l,checked:c,onCheckedChange:m}),e[10]=c,e[11]=l,e[12]=m,e[13]=f):f=e[13];let p;return e[14]!==y||e[15]!==f?(p=i.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y,f]}),e[14]=y,e[15]=f,e[16]=p):p=e[16],p}const Ne="__enum_empty__";function Te(t){return t===""?Ne:String(t)}function Gt(t,e){if(t===Ne)return"";const n=e.find(r=>Te(r)===t);return n!==void 0?n:t}function Xt(t,e){return t==null?e.some(n=>n==="")?Ne:void 0:Te(t)}function Zt(t){return t===""?"":String(t)}function Qt(t){const e=z.c(28),{schema:n,value:r,onChange:l,path:s,label:o}=t;let c;e[0]!==n.enum?(c=n.enum??[],e[0]=n.enum,e[1]=c):c=e[1];const a=c;let d;e[2]!==a||e[3]!==r?(d=Xt(r,a),e[2]=a,e[3]=r,e[4]=d):d=e[4];const y=d;let m;e[5]!==o||e[6]!==s?(m=i.jsx(q,{htmlFor:s,children:o}),e[5]=o,e[6]=s,e[7]=m):m=e[7];let f;e[8]!==n.description?(f=n.description&&i.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:n.description}),e[8]=n.description,e[9]=f):f=e[9];let p;e[10]!==m||e[11]!==f?(p=i.jsxs("div",{className:"space-y-0.5",children:[m,f]}),e[10]=m,e[11]=f,e[12]=p):p=e[12];let h;e[13]!==l||e[14]!==a?(h=A=>l(Gt(A,a)),e[13]=l,e[14]=a,e[15]=h):h=e[15];let u;e[16]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(Ee,{className:"h-10",children:i.jsx(Pe,{placeholder:"Select..."})}),e[16]=u):u=e[16];let g;e[17]!==a?(g=a.map(qt),e[17]=a,e[18]=g):g=e[18];let x;e[19]!==g?(x=i.jsx(Ve,{children:g}),e[19]=g,e[20]=x):x=e[20];let v;e[21]!==y||e[22]!==h||e[23]!==x?(v=i.jsxs(Me,{value:y,onValueChange:h,children:[u,x]}),e[21]=y,e[22]=h,e[23]=x,e[24]=v):v=e[24];let b;return e[25]!==v||e[26]!==p?(b=i.jsxs("div",{className:"space-y-2",children:[p,v]}),e[25]=v,e[26]=p,e[27]=b):b=e[27],b}function qt(t){const e=Te(t);return i.jsx(Le,{value:e,children:Zt(t)},e)}function Jt(t){return t.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[_-]/g," ").replace(/^\w/,e=>e.toUpperCase())}function ve(t,e){return e.title??Jt(t)}function Ie(t){return t.type==="array"&&t.items?!0:be(t)}function en(t){return t!=null&&typeof t=="object"&&!Array.isArray(t)?t:{}}function ie(t,e,n,r){if(r.length===0)return null;const l=r[0];for(const s of t){const o=e[s];if(!o||!Ie(o))continue;const c=ve(s,o);if(l===c||l===s)return s}for(const s of t){const o=e[s];if(!o||!Ie(o))continue;const c=n[s];if(!Array.isArray(c))continue;const a=o.items;for(let d=0;d<c.length;d++)if(se(c[d],d,a)===l)return s}for(const s of t){const o=e[s];if(o?.type!=="object"||!o.properties)continue;const c=Object.keys(o.properties),a=en(n[s]),d=ve(s,o);if(ie(c,o.properties,a,r)||(l===d||l===s)&&ie(c,o.properties,a,r.slice(1)))return s}return null}function tn(t,e,n,r){return ie(t,e,n,r)}function nn(t,e,n,r,l){if(l.length===0||!n.properties)return!1;const s=Object.keys(n.properties);if(ie(s,n.properties,r,l))return!0;const o=l[0];return o!==e&&o!==t?!1:l.length>1||ie(s,n.properties,r,l.slice(1))!==null}function rn(t,e,n,r){if(e.length===0)return null;for(let s=0;s<e.length;s++){const o=e[s],c=n.findIndex((a,d)=>se(a,d,r)===o);if(c>=0)return{index:c,innerPath:e.slice(s+1)}}const l=e.indexOf(t);if(l>=0&&e.length>l+1){const s=e[l+1],o=n.findIndex((c,a)=>se(c,a,r)===s);if(o>=0)return{index:o,innerPath:e.slice(l+2)}}return null}function xe(t){const e=z.c(47),{schema:n,value:r,onChange:l,path:s,label:o,breadcrumbPath:c,onBreadcrumbChange:a,meta:d,decofile:y,onSaveReferencedBlock:m}=t;let f,p,h,u,g,x,v;if(e[0]!==y||e[1]!==o||e[2]!==d||e[3]!==a||e[4]!==l||e[5]!==m||e[6]!==s||e[7]!==n.items||e[8]!==c||e[9]!==r){v=Symbol.for("react.early_return_sentinel");e:{const _=c===void 0?[]:c;u=Array.isArray(r)?r:[],h=n.items;const C=rn(o,_,u,h),S=C?.index??null;let V;e[17]!==h?(V=(w,F)=>se(w,F,h),e[17]=h,e[18]=V):V=e[18],p=V,g=w=>{const F=p(u[w],w);a?.([..._,F])},f=()=>{const w=h?.type,F=h?.default!==void 0?h.default:w==="object"?{}:w==="block-ref"?(()=>{const E=h?.anyOfRefs?.[0]?.resolveType;return typeof E!="string"||de(E)?{}:{__resolveType:E}})():w==="number"||w==="integer"?0:w==="boolean"?!1:w==="array"?[]:"",I=[...u,F];l(I);const P=I.length-1,O=se(F,P,h);a?.([..._,O])},x=w=>{if(l(u.filter((F,I)=>I!==w)),S===w){const F=p(u[w],w),I=_.indexOf(F);a?.(I>=0?_.slice(0,I):[])}};const U=(w,F)=>{const I=[...u];if(I[w]=F,l(I),S===w){const P=p(u[w],w),O=p(F,w),E=_.indexOf(P);if(E>=0){const K=[..._];K[E]=O,a?.(K);return}a?.([..._,O])}};if(S!==null&&S<u.length){const w=u[S],F=()=>{const O=p(w,S),E=_.indexOf(O);return E>=0?_.slice(0,E+1):[..._,O]},I=h?.type==="object"&&h.properties?i.jsx(_e,{schema:h,value:w,onChange:O=>U(S,O),basePath:`${s}.${S}`,breadcrumbPath:C?.innerPath??[],onBreadcrumbChange:O=>{a?.([...F(),...O])},meta:d,decofile:y,onSaveReferencedBlock:m}):h?qe({schema:h,value:w,onChange:O=>U(S,O),path:`${s}.${S}`,label:h.title??`Item ${S+1}`,breadcrumbPath:C?.innerPath??[],onBreadcrumbChange:O=>{a?.([...F(),...O])},meta:d,decofile:y,onSaveReferencedBlock:m}):null;let P;e[19]!==I?(P=i.jsx("div",{className:"min-w-0",children:I}),e[19]=I,e[20]=P):P=e[20],v=P;break e}}e[0]=y,e[1]=o,e[2]=d,e[3]=a,e[4]=l,e[5]=m,e[6]=s,e[7]=n.items,e[8]=c,e[9]=r,e[10]=f,e[11]=p,e[12]=h,e[13]=u,e[14]=g,e[15]=x,e[16]=v}else f=e[10],p=e[11],h=e[12],u=e[13],g=e[14],x=e[15],v=e[16];if(v!==Symbol.for("react.early_return_sentinel"))return v;let b;e[21]!==o?(b=i.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:o}),e[21]=o,e[22]=b):b=e[22];let A;e[23]!==u.length?(A=u.length>0&&i.jsx("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-xs font-medium text-muted-foreground",children:u.length}),e[23]=u.length,e[24]=A):A=e[24];let j;e[25]!==b||e[26]!==A?(j=i.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[b,A]}),e[25]=b,e[26]=A,e[27]=j):j=e[27];let N;e[28]!==n.description?(N=n.description&&i.jsx("p",{className:"break-words text-xs leading-normal text-muted-foreground",children:n.description}),e[28]=n.description,e[29]=N):N=e[29];let T;e[30]!==j||e[31]!==N?(T=i.jsxs("div",{className:"min-w-0 space-y-0.5",children:[j,N]}),e[30]=j,e[31]=N,e[32]=T):T=e[32];let R;e[33]!==p||e[34]!==h||e[35]!==u||e[36]!==g||e[37]!==s||e[38]!==x?(R=u.length>0&&i.jsx("div",{className:"min-w-0 overflow-hidden rounded-xl border border-border/50 p-1.5",children:u.map((_,C)=>{const S=p(_,C),V=Bt(_,h);return i.jsxs("div",{className:"group flex min-w-0 items-center gap-2.5 rounded-lg px-2 py-2.5 hover:bg-accent hover:text-accent-foreground",children:[i.jsx(at,{className:"size-3.5 shrink-0 cursor-grab text-muted-foreground/40"}),i.jsxs("button",{type:"button",onClick:()=>g(C),className:"flex min-w-0 flex-1 items-center gap-2.5 text-left text-sm",title:S,children:[V&&i.jsx("img",{src:V,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),i.jsx("span",{className:"min-w-0 truncate",children:S})]}),i.jsxs(ut,{children:[i.jsx(ft,{asChild:!0,children:i.jsx(ue,{type:"button",variant:"ghost",size:"icon","aria-label":`Open actions for ${S}`,className:"size-6 opacity-0 transition-opacity group-hover:opacity-100",onClick:sn,children:i.jsx(tt,{size:14})})}),i.jsx(dt,{align:"end",children:i.jsxs(pt,{className:"text-destructive focus:text-destructive",onClick:()=>x(C),children:[i.jsx(ze,{size:14}),"Delete"]})})]})]},`${s}.${C}`)})}),e[33]=p,e[34]=h,e[35]=u,e[36]=g,e[37]=s,e[38]=x,e[39]=R):R=e[39];let k;e[40]===Symbol.for("react.memo_cache_sentinel")?(k=i.jsx(ct,{size:14}),e[40]=k):k=e[40];let L;e[41]!==f?(L=i.jsxs("button",{type:"button",onClick:f,className:"flex w-full items-center justify-center gap-1.5 rounded-xl border border-dashed border-border/60 py-2.5 text-sm text-muted-foreground transition-colors hover:border-border hover:bg-muted/30",children:[k,"Add item"]}),e[41]=f,e[42]=L):L=e[42];let $;return e[43]!==L||e[44]!==T||e[45]!==R?($=i.jsxs("div",{className:"space-y-2",children:[T,R,L]}),e[43]=L,e[44]=T,e[45]=R,e[46]=$):$=e[46],$}function sn(t){return t.stopPropagation()}function ln(t){const e=z.c(40),{schema:n,value:r,onChange:l,path:s,label:o,breadcrumbPath:c,onBreadcrumbChange:a,meta:d,decofile:y,onSaveReferencedBlock:m}=t;let f;e[0]!==c?(f=c===void 0?[]:c,e[0]=c,e[1]=f):f=e[1];const p=f,[h,u]=Q.useState(!1);let g;e[2]!==r?(g=r!=null&&typeof r=="object"&&!Array.isArray(r)?r:{},e[2]=r,e[3]=g):g=e[3];const x=g;if(!n.properties)return null;let v;e[4]!==s?(v=s.split(".").pop()??s,e[4]=s,e[5]=v):v=e[5];const b=v;let A;e[6]!==p||e[7]!==b||e[8]!==o||e[9]!==x||e[10]!==n?(A=nn(b,o,n,x,p),e[6]=p,e[7]=b,e[8]=o,e[9]=x,e[10]=n,e[11]=A):A=e[11];const N=h||A,T=`${s}-fields`;let R;e[12]===Symbol.for("react.memo_cache_sentinel")?(R=()=>u(on),e[12]=R):R=e[12];let k;e[13]!==N?(k=i.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors group-hover:text-accent-foreground",children:N?i.jsx(We,{size:16}):i.jsx(He,{size:16})}),e[13]=N,e[14]=k):k=e[14];let L;e[15]!==o?(L=i.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:o}),e[15]=o,e[16]=L):L=e[16];let $;e[17]!==T||e[18]!==N||e[19]!==k||e[20]!==L?($=i.jsxs("button",{type:"button","aria-expanded":N,"aria-controls":T,onClick:R,className:"group flex w-full min-w-0 items-center gap-2 rounded-md py-1.5 pr-2 text-left transition-colors hover:bg-accent hover:text-accent-foreground",children:[k,L]}),e[17]=T,e[18]=N,e[19]=k,e[20]=L,e[21]=$):$=e[21];let _;e[22]!==n.description?(_=n.description&&i.jsx("p",{className:"break-words pl-9 text-xs leading-normal text-muted-foreground",children:n.description}),e[22]=n.description,e[23]=_):_=e[23];let C;e[24]!==p||e[25]!==T||e[26]!==y||e[27]!==N||e[28]!==d||e[29]!==x||e[30]!==a||e[31]!==l||e[32]!==m||e[33]!==s||e[34]!==n?(C=N&&i.jsx("div",{id:T,className:"ml-3 min-w-0 max-w-full overflow-hidden border-l border-border/80 pl-5",children:i.jsx(_e,{schema:n,value:x,onChange:l,basePath:s,breadcrumbPath:p,onBreadcrumbChange:a,meta:d,decofile:y,onSaveReferencedBlock:m})}),e[24]=p,e[25]=T,e[26]=y,e[27]=N,e[28]=d,e[29]=x,e[30]=a,e[31]=l,e[32]=m,e[33]=s,e[34]=n,e[35]=C):C=e[35];let S;return e[36]!==_||e[37]!==C||e[38]!==$?(S=i.jsxs("div",{className:"min-w-0 space-y-2",children:[$,_,C]}),e[36]=_,e[37]=C,e[38]=$,e[39]=S):S=e[39],S}function on(t){return!t}function ke(t){const e=t.__resolveType;if(typeof e!="string")return null;if(fe(e)){const r=t.section?.__resolveType;return typeof r=="string"?r:e}return e}function an(t){return t.includes("flags/multivariate")}function cn(t){return Ke(t)}function un(t,e){const n=[...t],r=new Set(n.map(s=>s.resolveType)),l=(s,o)=>{!s||r.has(s)||(r.add(s),n.push({resolveType:s,title:o??cn(s)}))};if(e.savedBlockKey&&l(e.savedBlockKey,e.savedBlockKey),e.editorValue&&typeof e.editorValue=="object"&&!Array.isArray(e.editorValue)){const s=ke(e.editorValue);s?.includes("/")&&l(s)}return n}function fn(t,e,n){const r=e[0]?.resolveType??"";if(n)return n;if(!t||typeof t!="object"||Array.isArray(t))return r;const l=t,s=l.__resolveType;if(typeof s=="string"){if(me(s)){const m=e.find(f=>f.resolveType===s);return m?m.resolveType:s}const d=e.find(m=>Ce(m.resolveType,s));if(d)return d.resolveType;const y=e.find(m=>m.resolveType===s);if(y)return y.resolveType;if(s.includes("/"))return s}const o=typeof l.type=="string"?l.type:void 0;if(o){const d=e.find(y=>y.discriminatorValue===o||y.resolveType===o||Ce(y.resolveType,o));if(d)return d.resolveType}let c=r,a=-1;for(const d of e){if(!d.schema?.properties)continue;const m=Object.keys(d.schema.properties).filter(f=>!f.startsWith("__")&&f!=="@type"&&f!=="action"&&f!=="alt").filter(f=>l[f]!==void 0).length;m>0&&m>a&&(a=m,c=d.resolveType)}return a>0,c}function Oe(t,e,n){if(!t||typeof t!="object"||Array.isArray(t))return n??null;const r=ke(t);if(!r)return n??null;if(!e)return r.includes("/")?null:n??null;const l=vt(r,e);return l||(r.includes("/")?null:n??null)}function dn(t,e){if(!t?.properties||!e)return t??null;if(!(e in t.properties))return t;const n={...t.properties};return delete n[e],{...t,properties:n}}function pn(t,e){if(e)return!0;if(!t||typeof t!="object"||Array.isArray(t))return!1;const n=t,r=ke(n);return r&&an(r)?Array.isArray(n.variants)&&n.variants.length>0:Object.keys(n).some(l=>!l.startsWith("__")&&l!=="@type")}function mn(t){if(!t?.properties)return{};const e={};for(const[n,r]of Object.entries(t.properties))n.startsWith("__")||n==="@type"||(r.default!==void 0?e[n]=r.default:r.type==="boolean"?e[n]=!1:r.type==="string"?e[n]="":r.type==="number"||r.type==="integer"?e[n]=0:r.type==="object"&&(e[n]={}));return e}function hn(t){const e=z.c(3),{blockKey:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(_t,{asChild:!0,children:i.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-global-section/14 px-1.5 py-0.5 text-[11px] font-medium text-global-section-fg dark:text-global-section-fg-dark",children:[i.jsx(kt,{size:11}),"Global"]})}),e[0]=r):r=e[0];let l;return e[1]!==n?(l=i.jsxs(wt,{children:[r,i.jsxs(St,{side:"top",className:"max-w-[260px]",children:["Edits the saved block “",n,"”. Changes apply everywhere this loader is referenced on your site."]})]}),e[1]=n,e[2]=l):l=e[2],l}function yn(t){const e=z.c(28),{path:n,open:r,onOpenChange:l,title:s,nested:o,nestedBlockRef:c,globalBlockKey:a}=t,d=`${n}-loader-config`,y=c&&"ml-1";let m;e[0]!==y?(m=De("rounded-lg border border-border/80 bg-muted/30",y),e[0]=y,e[1]=m):m=e[1];let f;e[2]!==l||e[3]!==r?(f=()=>l(!r),e[2]=l,e[3]=r,e[4]=f):f=e[4];let p;e[5]!==r?(p=i.jsx("span",{className:"flex size-6 shrink-0 items-center justify-center text-muted-foreground transition-colors group-hover:text-foreground",children:r?i.jsx(We,{size:16}):i.jsx(He,{size:16})}),e[5]=r,e[6]=p):p=e[6];let h;e[7]!==s?(h=i.jsx("span",{className:"truncate text-xs font-medium tracking-wide text-muted-foreground uppercase",children:s}),e[7]=s,e[8]=h):h=e[8];let u;e[9]!==a?(u=a&&i.jsx(hn,{blockKey:a}),e[9]=a,e[10]=u):u=e[10];let g;e[11]!==h||e[12]!==u?(g=i.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[h,u]}),e[11]=h,e[12]=u,e[13]=g):g=e[13];let x;e[14]!==d||e[15]!==r||e[16]!==f||e[17]!==p||e[18]!==g?(x=i.jsxs("button",{type:"button","aria-expanded":r,"aria-controls":d,onClick:f,className:"group flex w-full min-w-0 items-center gap-2 rounded-lg px-3 py-2.5 text-left transition-colors hover:bg-accent/50",children:[p,g]}),e[14]=d,e[15]=r,e[16]=f,e[17]=p,e[18]=g,e[19]=x):x=e[19];let v;e[20]!==d||e[21]!==o||e[22]!==r?(v=r&&i.jsx("div",{id:d,className:"border-t border-border/60 px-4 pb-4 pt-3",children:i.jsx("div",{className:"border-l border-border/80 pl-4",children:o})}),e[20]=d,e[21]=o,e[22]=r,e[23]=v):v=e[23];let b;return e[24]!==m||e[25]!==x||e[26]!==v?(b=i.jsxs("div",{className:m,children:[x,v]}),e[24]=m,e[25]=x,e[26]=v,e[27]=b):b=e[27],b}function Re(t){const e=z.c(30),{schema:n,value:r,onChange:l,path:s,label:o,breadcrumbPath:c,onBreadcrumbChange:a,meta:d,decofile:y,onSaveReferencedBlock:m}=t,f=(n.anyOfRefs??[]).filter(vn),p=y&&r?Dt(r,y):null,h=p?.data??r,u=un(f,{savedBlockKey:p?.blockKey,editorValue:h}),g=u.length>0?fn(h,u,p?.blockKey):u[0]?.resolveType??"",[x,v]=Q.useState(g),[b,A]=Q.useState(g);b!==g&&(A(g),v(g));const[j,N]=Q.useState(()=>pn(h,p?.blockKey));if(u.length>0){const S=x||g;let V;e[0]!==S?(V=B=>B.resolveType===S,e[0]=S,e[1]=V):V=e[1];const U=u.find(V),w=Oe(h,d,U?.schema),F=dn(w??U?.schema??null,n.discriminatorKey),I=n.discriminatorKey,P=B=>{v(B);const D=u.find(ne=>ne.resolveType===B),M=Oe(h,d,D?.schema),J=new Set(Object.keys((M??D?.schema)?.properties??{})),te=r!==null&&typeof r=="object"&&!Array.isArray(r)?r:{},oe=Object.fromEntries(Object.entries(te).filter(ne=>{const[Je]=ne;return J.has(Je)})),ye={...mn(D?.schema),...oe};if(I){const ne=D?.discriminatorValue??B;l({...ye,[I]:ne});return}if(de(B)){l(ye);return}l({...ye,__resolveType:B})};let O;e[2]!==S||e[3]!==I||e[4]!==l?(O=B=>{if(I||!de(S)||B===null||typeof B!="object"||Array.isArray(B)){l(B);return}const{__resolveType:D,...M}=B;l(M)},e[2]=S,e[3]=I,e[4]=l,e[5]=O):O=e[5];const E=O,K=F?.properties?i.jsx(_e,{schema:F,value:h,onChange:B=>{if(p&&m){m(p.blockKey,B);return}E(B)},basePath:s,breadcrumbPath:c,onBreadcrumbChange:a,meta:d,decofile:y,onSaveReferencedBlock:m}):null,Z=n.type==="block-ref"&&u.some(xn);let W;e[6]!==s?(W=s.includes("."),e[6]=s,e[7]=W):W=e[7];const G=W;let H;e[8]!==o||e[9]!==s?(H=i.jsx(q,{htmlFor:s,children:o}),e[8]=o,e[9]=s,e[10]=H):H=e[10];let Y;e[11]===Symbol.for("react.memo_cache_sentinel")?(Y=i.jsx(Ee,{children:i.jsx(Pe,{placeholder:"Select..."})}),e[11]=Y):Y=e[11];let X;return e[12]!==n.description?(X=n.description&&i.jsx("p",{className:"text-xs text-muted-foreground",children:n.description}),e[12]=n.description,e[13]=X):X=e[13],i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"space-y-1.5",children:[H,i.jsxs(Me,{value:S||void 0,onValueChange:P,children:[Y,i.jsx(Ve,{children:u.map(gn)})]}),X]}),K&&(Z?i.jsx(yn,{path:s,open:j,onOpenChange:N,title:G?"Configuration":"Loader configuration",nested:K,nestedBlockRef:G,globalBlockKey:p?.blockKey}):K)]})}if(n.anyOfRefs&&n.anyOfRefs.length>0)return null;let T;e[14]!==o||e[15]!==s?(T=i.jsx(q,{htmlFor:s,children:o}),e[14]=o,e[15]=s,e[16]=T):T=e[16];const R=r!=null?String(r):"";let k;e[17]!==l?(k=S=>l(S.target.value),e[17]=l,e[18]=k):k=e[18];const L=n.description??"";let $;e[19]!==s||e[20]!==R||e[21]!==k||e[22]!==L?($=i.jsx("input",{id:s,type:"text",value:R,onChange:k,className:"w-full rounded-md border bg-background px-3 py-1.5 text-sm",placeholder:L}),e[19]=s,e[20]=R,e[21]=k,e[22]=L,e[23]=$):$=e[23];let _;e[24]!==n.description?(_=n.description&&i.jsx("p",{className:"text-xs text-muted-foreground",children:n.description}),e[24]=n.description,e[25]=_):_=e[25];let C;return e[26]!==T||e[27]!==$||e[28]!==_?(C=i.jsxs("div",{className:"space-y-1.5",children:[T,$,_]}),e[26]=T,e[27]=$,e[28]=_,e[29]=C):C=e[29],C}function gn(t){return i.jsx(Le,{value:t.resolveType,children:t.title??bt(t.resolveType)??t.resolveType},t.resolveType)}function xn(t){return t.resolveType.includes("/")&&!de(t.resolveType)}function vn(t){return t.resolveType!==""}function $e(t){const e=z.c(2),{ext:n}=t;if(!n)return null;let r;return e[0]!==n?(r=i.jsx("span",{className:"shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium uppercase text-muted-foreground",children:n}),e[0]=n,e[1]=r):r=e[1],r}function bn(t){try{const e=new URL(t).pathname;return decodeURIComponent(e.split("/").pop()??t)}catch{return t.split("/").pop()??t}}function jn(t){const e=t.lastIndexOf(".");return e<0||e===t.length-1?"":t.slice(e+1).toLowerCase()}function Fe(t){const e=z.c(72),{schema:n,value:r,onChange:l,path:s,label:o}=t,c=n.format==="video-uri",a=Ue(r),[d,y]=Q.useState(!1),[m,f]=Q.useState(!1),p=a?bn(a):"",h=p?jn(p):"",u=Ct(),g=mt();let x;e[0]!==u.data?.configs?(x=function(){const D=u.data?.configs??[];if(D.length===1)return D[0].id;if(D.length===0)return null;const M=typeof window<"u"?window.localStorage.getItem(ht):null;return D.some(J=>J.id===M)?M:null},e[0]=u.data?.configs,e[1]=x):x=e[1];const v=x;let b;e[2]!==c||e[3]!==l||e[4]!==v||e[5]!==y||e[6]!==g?(b=async function(D){if(!D)return;let M=Array.from(D);if(M.length===0)return;if(c&&(M=M.filter(Nn),M.length===0)){ge.error("Please drop a video file (mp4, webm, …).");return}const J=v();if(!J){y(!0);return}try{const te=await g.mutateAsync({configId:J,file:M[0]});l(te.publicUrl),M.length>1&&ge.info(`Uploaded ${M[0].name}; extra files were ignored (single-select field).`)}catch(te){const oe=te;ge.error(oe instanceof Error?oe.message:"Upload failed")}},e[2]=c,e[3]=l,e[4]=v,e[5]=y,e[6]=g,e[7]=b):b=e[7];const A=b;let j;e[8]!==f?(j=function(D){D.preventDefault(),D.dataTransfer.types.includes("Files")&&f(!0)},e[8]=f,e[9]=j):j=e[9];const N=j;let T;e[10]!==f?(T=function(D){D.currentTarget===D.target&&f(!1)},e[10]=f,e[11]=T):T=e[11];const R=T;let k;e[12]!==A||e[13]!==f?(k=function(D){D.preventDefault(),f(!1),A(D.dataTransfer.files)},e[12]=A,e[13]=f,e[14]=k):k=e[14];const L=k;let $;e[15]!==o||e[16]!==s?($=i.jsx(q,{htmlFor:s,className:"text-muted-foreground",children:o}),e[15]=o,e[16]=s,e[17]=$):$=e[17];let _;e[18]!==n.description?(_=n.description&&i.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:n.description}),e[18]=n.description,e[19]=_):_=e[19];let C;e[20]!==$||e[21]!==_?(C=i.jsxs("div",{className:"min-w-0 space-y-0.5",children:[$,_]}),e[20]=$,e[21]=_,e[22]=C):C=e[22];const S=m&&"border-primary ring-2 ring-primary/30",V=g.isPending&&"pointer-events-none opacity-60";let U;e[23]!==V||e[24]!==S?(U=De("group relative w-full overflow-hidden rounded-xl border border-border/60 bg-muted/30 transition",S,V),e[23]=V,e[24]=S,e[25]=U):U=e[25];let w;e[26]!==h||e[27]!==p||e[28]!==c||e[29]!==y||e[30]!==a||e[31]!==g.isPending?(w=a?c?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"relative h-40 w-full overflow-hidden bg-black",children:i.jsx("video",{src:a,preload:"metadata",className:"h-full w-full object-contain"},a)}),i.jsxs("div",{className:"flex items-center gap-2 border-t border-border/60 bg-background/50 px-3 py-2",children:[i.jsx(we,{size:14,className:"shrink-0 text-muted-foreground"}),i.jsx("p",{className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:p}),i.jsx($e,{ext:h})]})]}):i.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5",children:[i.jsx("div",{className:"flex size-10 shrink-0 items-center justify-center rounded-md bg-background",children:i.jsx(Se,{size:18,className:"text-muted-foreground"})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("p",{className:"truncate text-sm font-medium",children:p}),i.jsx("p",{className:"truncate text-xs text-muted-foreground",children:a})]}),i.jsx($e,{ext:h})]}):i.jsxs("button",{type:"button",onClick:()=>y(!0),className:"flex w-full flex-col items-center justify-center gap-2 py-8 text-sm text-muted-foreground hover:bg-muted/60 hover:text-foreground",children:[c?i.jsx(we,{size:20}):i.jsx(Se,{size:20}),i.jsx("span",{className:"text-sm font-medium",children:g.isPending?"Uploading…":c?"Drop a video here or click to browse":"Drop a file or click to browse"}),i.jsx("span",{className:"text-xs text-muted-foreground",children:"Up to 100 MB"})]}),e[26]=h,e[27]=p,e[28]=c,e[29]=y,e[30]=a,e[31]=g.isPending,e[32]=w):w=e[32];let F;e[33]!==m?(F=m&&i.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center bg-primary/10 backdrop-blur-[1px]",children:i.jsx("span",{className:"rounded-md bg-background px-3 py-1.5 text-xs font-medium shadow",children:"Drop to upload"})}),e[33]=m,e[34]=F):F=e[34];let I;e[35]!==R||e[36]!==N||e[37]!==L||e[38]!==U||e[39]!==w||e[40]!==F?(I=i.jsxs("div",{onDragOver:N,onDragLeave:R,onDrop:L,className:U,children:[w,F]}),e[35]=R,e[36]=N,e[37]=L,e[38]=U,e[39]=w,e[40]=F,e[41]=I):I=e[41];let P;e[42]!==l?(P=B=>l(B.target.value),e[42]=l,e[43]=P):P=e[43];let O;e[44]!==s||e[45]!==a||e[46]!==P?(O=i.jsx(re,{id:s,type:"url",value:a,onChange:P,placeholder:"https://...",className:"h-9 min-w-0 flex-1"}),e[44]=s,e[45]=a,e[46]=P,e[47]=O):O=e[47];let E;e[48]!==y?(E=()=>y(!0),e[48]=y,e[49]=E):E=e[49];let K;e[50]===Symbol.for("react.memo_cache_sentinel")?(K=i.jsx(At,{size:14}),e[50]=K):K=e[50];const le=a?"Replace":"Browse";let Z;e[51]!==E||e[52]!==le?(Z=i.jsxs(ue,{type:"button",variant:"outline",size:"sm",onClick:E,className:"h-9 shrink-0",children:[K,le]}),e[51]=E,e[52]=le,e[53]=Z):Z=e[53];let W;e[54]!==l||e[55]!==a?(W=a&&i.jsx(ue,{type:"button",variant:"ghost",size:"sm",onClick:()=>l(""),className:"h-9 shrink-0","aria-label":"Remove file",children:i.jsx(ze,{size:14})}),e[54]=l,e[55]=a,e[56]=W):W=e[56];let G;e[57]!==O||e[58]!==Z||e[59]!==W?(G=i.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[O,Z,W]}),e[57]=O,e[58]=Z,e[59]=W,e[60]=G):G=e[60];let H;e[61]!==l?(H=B=>l(B),e[61]=l,e[62]=H):H=e[62];let Y;e[63]!==d||e[64]!==y||e[65]!==H?(Y=i.jsx(yt,{open:d,onOpenChange:y,mode:"any",onSelect:H}),e[63]=d,e[64]=y,e[65]=H,e[66]=Y):Y=e[66];let X;return e[67]!==I||e[68]!==G||e[69]!==Y||e[70]!==C?(X=i.jsxs("div",{className:"grid w-full min-w-0 grid-cols-[minmax(0,1fr)] gap-2",children:[C,I,G,Y]}),e[67]=I,e[68]=G,e[69]=Y,e[70]=C,e[71]=X):X=e[71],X}function Nn(t){return t.type.startsWith("video/")}const Tn=new Set(["__resolveType","@type"]);function kn(t){if(t.type!=="block-ref"||!t.anyOfRefs?.length||t.anyOfRefs.length!==1)return null;const e=t.anyOfRefs[0].resolveType;return e.endsWith("/multivariate/image.ts")?"image":e.endsWith("/multivariate/video.ts")||e.endsWith("/multivariate/file.ts")?"file":null}function _n(t){if(be(t))for(const e of t.anyOfRefs??[]){const l=e.schema?.properties?.variants?.items?.properties?.value;if(l?.type==="array"&&l.items)return l.items}}function Be(t){if(t.type==="array"&&t.items)return t;const e=t.items??_n(t);return e?{...t,type:"array",items:e}:null}function wn(t,e){if(e!==void 0)return e;switch(t){case"string":return"";case"number":case"integer":return 0;case"boolean":return!1;case"array":return[];case"object":return{};default:return null}}function qe(t){const{schema:e,value:n}=t;if(jt(n)){const o=Nt(n),c=Be(e);if(o!==null&&c)return i.jsx(xe,{...t,schema:c,value:o,onChange:a=>t.onChange(Tt(n,a))},t.path)}if(Array.isArray(n)&&e.type==="block-ref"&&be(e)){const o=Be(e);if(o)return i.jsx(xe,{...t,schema:o,value:n,onChange:t.onChange},t.path)}if(e.type==="block-ref"||n!==null&&typeof n=="object"&&!Array.isArray(n)&&typeof n.__resolveType=="string"&&e.anyOfRefs){const o=kn(e);return o==="image"?i.jsx(Ae,{...t},t.path):o==="file"?i.jsx(Fe,{...t},t.path):e.anyOfRefs?i.jsx(Re,{...t},t.path):null}if(e.format==="image-uri")return i.jsx(Ae,{...t},t.path);if(e.format==="file-uri"||e.format==="video-uri")return i.jsx(Fe,{...t},t.path);if(e.enum&&e.enum.length>0)return i.jsx(Qt,{...t},t.path);if(e.type==="anyOf")return i.jsx(Re,{...t},t.path);const r=n??wn(e.type,e.default);if(r==null)return null;const l={...t,value:r},s=n==null?e.type??typeof r:Array.isArray(r)?"array":typeof r;if(s==="array"||Array.isArray(r))return i.jsx(xe,{...l},t.path);switch(s){case"boolean":return i.jsx(Yt,{...l},t.path);case"number":case"integer":return i.jsx(Ht,{...l},t.path);case"string":{const o=e.format;return o==="color-input"?i.jsx(ce,{...l},t.path):o==="textarea"||o==="rich-text"||o==="html"?i.jsx(ce,{...l},t.path):i.jsx(ce,{...l},t.path)}case"object":return r!==null&&typeof r=="object"&&!Array.isArray(r)?i.jsx(ln,{...l},t.path):null;default:return i.jsx(ce,{...l},t.path)}}function _e(t){const e=z.c(12),{schema:n,value:r,onChange:l,basePath:s,breadcrumbPath:o,onBreadcrumbChange:c,meta:a,decofile:d,onSaveReferencedBlock:y}=t;let m,f;if(e[0]!==s||e[1]!==d||e[2]!==a||e[3]!==c||e[4]!==l||e[5]!==y||e[6]!==n.properties||e[7]!==o||e[8]!==r){f=Symbol.for("react.early_return_sentinel");e:{const p=o===void 0?[]:o,h=n.properties;if(!h){f=null;break e}const u=r!=null&&typeof r=="object"&&!Array.isArray(r)?r:{},g=Object.keys(h).filter(j=>!Tn.has(j)&&h[j]?.hidden!==!0);if(g.length===0){let j;e[11]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"No editable fields on this section."}),e[11]=j):j=e[11],f=j;break e}const x=(j,N)=>{l({...u,[j]:N})},v=p.length>0?tn(g,h,u,p):null,b=v?h[v]:null,A=v&&b?[v]:g;m=i.jsx("div",{className:"min-w-0 space-y-6",children:A.map(j=>{const N=h[j];if(!N)return null;const T=s?`${s}.${j}`:j,R=ve(j,N);return qe({schema:N,value:u[j],onChange:k=>x(j,k),path:T,label:R,breadcrumbPath:p,onBreadcrumbChange:c,meta:a,decofile:d,onSaveReferencedBlock:y})})})}e[0]=s,e[1]=d,e[2]=a,e[3]=c,e[4]=l,e[5]=y,e[6]=n.properties,e[7]=o,e[8]=r,e[9]=m,e[10]=f}else m=e[9],f=e[10];return f!==Symbol.for("react.early_return_sentinel")?f:m}export{_e as S,qe as a,ce as b,je as r,It as s,Gn as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as w,dG as $l,bF as ju,j as O,aU as Hu,b5 as St,dH as Wu,a7 as it,a8 as Qe,bk as On,bh as Uu,bi as qu,bx as Mt,dA as Fl,ag as _l,bg as Ku,ad as ut,e as Vl,c as jl}from"./index-DZVqlilk.js";import{e as Ju}from"./select-C_Mscmor.js";function Q(n){this.content=n}Q.prototype={constructor:Q,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,s=r.find(n),i=r.content.slice();return s==-1?i.push(t||n,e):(i[s+1]=e,t&&(i[s]=t)),new Q(i)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Q(t)},addToStart:function(n,e){return new Q([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new Q(t)},addBefore:function(n,e,t){var r=this.remove(e),s=r.content.slice(),i=r.find(n);return s.splice(i==-1?s.length:i,0,e,t),new Q(s)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=Q.from(n),n.size?new Q(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=Q.from(n),n.size?new Q(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=Q.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};Q.from=function(n){if(n instanceof Q)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Q(e)};function Hl(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let s=n.child(r),i=e.child(r);if(s==i){t+=s.nodeSize;continue}if(!s.sameMarkup(i))return t;if(s.isText&&s.text!=i.text){for(let o=0;s.text[o]==i.text[o];o++)t++;return t}if(s.content.size||i.content.size){let o=Hl(s.content,i.content,t+1);if(o!=null)return o}t+=s.nodeSize}}function Wl(n,e,t,r){for(let s=n.childCount,i=e.childCount;;){if(s==0||i==0)return s==i?null:{a:t,b:r};let o=n.child(--s),l=e.child(--i),a=o.nodeSize;if(o==l){t-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:t,b:r};if(o.isText&&o.text!=l.text){let c=0,u=Math.min(o.text.length,l.text.length);for(;c<u&&o.text[o.text.length-c-1]==l.text[l.text.length-c-1];)c++,t--,r--;return{a:t,b:r}}if(o.content.size||l.content.size){let c=Wl(o.content,l.content,t-1,r-1);if(c)return c}t-=a,r-=a}}class k{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,s=0,i){for(let o=0,l=0;l<t;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,s+l,i||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,s+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,s){let i="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,s=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(r)&&(s[s.length-1]=t.withText(t.text+r.text),i=1);i<e.content.length;i++)s.push(e.content[i]);return new k(s,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],s=0;if(t>e)for(let i=0,o=0;o<t;i++){let l=this.content[i],a=o+l.nodeSize;a>e&&((o<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),r.push(l),s+=l.nodeSize),o=a}return new k(r,s)}cutByIndex(e,t){return e==t?k.empty:e==0&&t==this.content.length?this:new k(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let s=this.content.slice(),i=this.size+t.nodeSize-r.nodeSize;return s[e]=t,new k(s,i)}addToStart(e){return new k([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new k(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let s=this.content[t];e(s,r,t),r+=s.nodeSize}}findDiffStart(e,t=0){return Hl(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Wl(this,e,t,r)}findIndex(e){if(e==0)return Ln(0,e);if(e==this.size)return Ln(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let s=this.child(t),i=r+s.nodeSize;if(i>=e)return i==e?Ln(t+1,i):Ln(t,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return k.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new k(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return k.empty;let t,r=0;for(let s=0;s<e.length;s++){let i=e[s];r+=i.nodeSize,s&&i.isText&&e[s-1].sameMarkup(i)?(t||(t=e.slice(0,s)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new k(t||e,r)}static from(e){if(!e)return k.empty;if(e instanceof k)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new k([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}k.empty=new k([],0);const ls={index:0,offset:0};function Ln(n,e){return ls.index=n,ls.offset=e,ls}function Qn(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!Qn(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Qn(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let z=class Ps{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let s=0;s<e.length;s++){let i=e[s];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,s));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,s)),t.push(this),r=!0),t&&t.push(i)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Qn(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let s=r.create(t.attrs);return r.checkAttrs(s.attrs),s}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Ps.none;if(e instanceof Ps)return[e];let t=e.slice();return t.sort((r,s)=>r.type.rank-s.type.rank),t}};z.none=[];class Zn extends Error{}class v{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=ql(this.content,e+this.openStart,t);return r&&new v(r,this.openStart,this.openEnd)}removeBetween(e,t){return new v(Ul(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return v.empty;let r=t.openStart||0,s=t.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new v(k.fromJSON(e,t.content),r,s)}static maxOpen(e,t=!0){let r=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)s++;return new v(e,r,s)}}v.empty=new v(k.empty,0,0);function Ul(n,e,t){let{index:r,offset:s}=n.findIndex(e),i=n.maybeChild(r),{index:o,offset:l}=n.findIndex(t);if(s==e||i.isText){if(l!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,i.copy(Ul(i.content,e-s-1,t-s-1)))}function ql(n,e,t,r){let{index:s,offset:i}=n.findIndex(e),o=n.maybeChild(s);if(i==e||o.isText)return r&&!r.canReplace(s,s,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=ql(o.content,e-i-1,t,o);return l&&n.replaceChild(s,o.copy(l))}function Gu(n,e,t){if(t.openStart>n.depth)throw new Zn("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new Zn("Inconsistent open depths");return Kl(n,e,t,0)}function Kl(n,e,t,r){let s=n.index(r),i=n.node(r);if(s==e.index(r)&&r<n.depth-t.openStart){let o=Kl(n,e,t,r+1);return i.copy(i.content.replaceChild(s,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let o=n.parent,l=o.content;return yt(o,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=Yu(t,n);return yt(i,Gl(n,o,l,e,r))}else return yt(i,er(n,e,r))}function Jl(n,e){if(!e.type.compatibleContent(n.type))throw new Zn("Cannot join "+e.type.name+" onto "+n.type.name)}function Ls(n,e,t){let r=n.node(t);return Jl(r,e.node(t)),r}function gt(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function an(n,e,t,r){let s=(e||n).node(t),i=0,o=e?e.index(t):s.childCount;n&&(i=n.index(t),n.depth>t?i++:n.textOffset&&(gt(n.nodeAfter,r),i++));for(let l=i;l<o;l++)gt(s.child(l),r);e&&e.depth==t&&e.textOffset&>(e.nodeBefore,r)}function yt(n,e){return n.type.checkContent(e),n.copy(e)}function Gl(n,e,t,r,s){let i=n.depth>s&&Ls(n,e,s+1),o=r.depth>s&&Ls(t,r,s+1),l=[];return an(null,n,s,l),i&&o&&e.index(s)==t.index(s)?(Jl(i,o),gt(yt(i,Gl(n,e,t,r,s+1)),l)):(i&>(yt(i,er(n,e,s+1)),l),an(e,t,s,l),o&>(yt(o,er(t,r,s+1)),l)),an(r,null,s,l),new k(l)}function er(n,e,t){let r=[];if(an(null,n,t,r),n.depth>t){let s=Ls(n,e,t+1);gt(yt(s,er(n,e,t+1)),r)}return an(e,null,t,r),new k(r)}function Yu(n,e){let t=e.depth-n.openStart,s=e.node(t).copy(n.content);for(let i=t-1;i>=0;i--)s=e.node(i).copy(k.from(s));return{start:s.resolveNoCache(n.openStart+t),end:s.resolveNoCache(s.content.size-n.openEnd-t)}}class kn{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(t);return r?e.child(t).cut(r):s}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],s=t==0?0:this.path[t*3-1]+1;for(let i=0;i<e;i++)s+=r.child(i).nodeSize;return s}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return z.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),s=e.maybeChild(t);if(!r){let l=r;r=s,s=l}let i=r.marks;for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!s||!i[o].isInSet(s.marks))&&(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,s=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!s||!r[i].isInSet(s.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new tr(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],s=0,i=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(i),c=i-a;if(r.push(o,l,s+a),!c||(o=o.child(l),o.isText))break;i=c-1,s+=a+1}return new kn(t,r,i)}static resolveCached(e,t){let r=so.get(e);if(r)for(let i=0;i<r.elts.length;i++){let o=r.elts[i];if(o.pos==t)return o}else so.set(e,r=new Xu);let s=r.elts[r.i]=kn.resolve(e,t);return r.i=(r.i+1)%Qu,s}}class Xu{constructor(){this.elts=[],this.i=0}}const Qu=12,so=new WeakMap;class tr{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Zu=Object.create(null);class Ee{constructor(e,t,r,s=z.none){this.type=e,this.attrs=t,this.marks=s,this.content=r||k.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,s=0){this.content.nodesBetween(e,t,r,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,s){return this.content.textBetween(e,t,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&Qn(this.attrs,t||e.defaultAttrs||Zu)&&z.sameSet(this.marks,r||z.none)}copy(e=null){return e==this.content?this:new Ee(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Ee(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return v.empty;let s=this.resolve(e),i=this.resolve(t),o=r?0:s.sharedDepth(t),l=s.start(o),c=s.node(o).content.cut(s.pos-l,i.pos-l);return new v(c,s.depth-o,i.depth-o)}replace(e,t,r){return Gu(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:s}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(s==e||t.isText)return t;e-=s+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let s=this.content.child(t-1);return{node:s,index:t-1,offset:r-s.nodeSize}}resolve(e){return kn.resolveCached(this,e)}resolveNoCache(e){return kn.resolve(this,e)}rangeHasMark(e,t,r){let s=!1;return t>e&&this.nodesBetween(e,t,i=>(r.isInSet(i.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Yl(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=k.empty,s=0,i=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,s,i),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=s;a<i;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,t,r,s){if(s&&!this.type.allowsMarks(s))return!1;let i=this.contentMatchAt(e).matchType(r),o=i&&i.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=z.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!z.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let s=k.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,s,r);return i.type.checkAttrs(i.attrs),i}}Ee.prototype.text=void 0;class nr extends Ee{constructor(e,t,r,s){if(super(e,t,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Yl(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new nr(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new nr(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Yl(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class wt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new ed(e,t);if(r.next==null)return wt.empty;let s=Xl(r);r.next&&r.err("Unexpected trailing text");let i=ld(od(s));return ad(i,r),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let s=this;for(let i=t;s&&i<r;i++)s=s.matchType(e.child(i).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let s=[this];function i(o,l){let a=o.matchFragment(e,r);if(a&&(!t||a.validEnd))return k.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(d)==-1){s.push(d);let f=i(d,l.concat(u));if(f)return f}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),i=s.match;if(i.matchType(e)){let o=[];for(let l=s;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<i.next.length;o++){let{type:l,next:a}=i.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!s.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:s}),t[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&t(r.next[s].next)}return t(this),e.map((r,s)=>{let i=s+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)i+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return i}).join(`
|
|
1
|
+
import{r as w,dG as $l,bF as ju,j as O,aU as Hu,b5 as St,dH as Wu,a7 as it,a8 as Qe,bk as On,bh as Uu,bi as qu,bx as Mt,dA as Fl,ag as _l,bg as Ku,ad as ut,e as Vl,c as jl}from"./index-D0mCKPyO.js";import{e as Ju}from"./select-BaScWEqk.js";function Q(n){this.content=n}Q.prototype={constructor:Q,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,s=r.find(n),i=r.content.slice();return s==-1?i.push(t||n,e):(i[s+1]=e,t&&(i[s]=t)),new Q(i)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Q(t)},addToStart:function(n,e){return new Q([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new Q(t)},addBefore:function(n,e,t){var r=this.remove(e),s=r.content.slice(),i=r.find(n);return s.splice(i==-1?s.length:i,0,e,t),new Q(s)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=Q.from(n),n.size?new Q(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=Q.from(n),n.size?new Q(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=Q.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};Q.from=function(n){if(n instanceof Q)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Q(e)};function Hl(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let s=n.child(r),i=e.child(r);if(s==i){t+=s.nodeSize;continue}if(!s.sameMarkup(i))return t;if(s.isText&&s.text!=i.text){for(let o=0;s.text[o]==i.text[o];o++)t++;return t}if(s.content.size||i.content.size){let o=Hl(s.content,i.content,t+1);if(o!=null)return o}t+=s.nodeSize}}function Wl(n,e,t,r){for(let s=n.childCount,i=e.childCount;;){if(s==0||i==0)return s==i?null:{a:t,b:r};let o=n.child(--s),l=e.child(--i),a=o.nodeSize;if(o==l){t-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:t,b:r};if(o.isText&&o.text!=l.text){let c=0,u=Math.min(o.text.length,l.text.length);for(;c<u&&o.text[o.text.length-c-1]==l.text[l.text.length-c-1];)c++,t--,r--;return{a:t,b:r}}if(o.content.size||l.content.size){let c=Wl(o.content,l.content,t-1,r-1);if(c)return c}t-=a,r-=a}}class k{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,s=0,i){for(let o=0,l=0;l<t;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,s+l,i||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,s+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,s){let i="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,s=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(r)&&(s[s.length-1]=t.withText(t.text+r.text),i=1);i<e.content.length;i++)s.push(e.content[i]);return new k(s,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],s=0;if(t>e)for(let i=0,o=0;o<t;i++){let l=this.content[i],a=o+l.nodeSize;a>e&&((o<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),r.push(l),s+=l.nodeSize),o=a}return new k(r,s)}cutByIndex(e,t){return e==t?k.empty:e==0&&t==this.content.length?this:new k(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let s=this.content.slice(),i=this.size+t.nodeSize-r.nodeSize;return s[e]=t,new k(s,i)}addToStart(e){return new k([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new k(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let s=this.content[t];e(s,r,t),r+=s.nodeSize}}findDiffStart(e,t=0){return Hl(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Wl(this,e,t,r)}findIndex(e){if(e==0)return Ln(0,e);if(e==this.size)return Ln(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let s=this.child(t),i=r+s.nodeSize;if(i>=e)return i==e?Ln(t+1,i):Ln(t,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return k.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new k(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return k.empty;let t,r=0;for(let s=0;s<e.length;s++){let i=e[s];r+=i.nodeSize,s&&i.isText&&e[s-1].sameMarkup(i)?(t||(t=e.slice(0,s)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new k(t||e,r)}static from(e){if(!e)return k.empty;if(e instanceof k)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new k([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}k.empty=new k([],0);const ls={index:0,offset:0};function Ln(n,e){return ls.index=n,ls.offset=e,ls}function Qn(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!Qn(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Qn(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let z=class Ps{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let s=0;s<e.length;s++){let i=e[s];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,s));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,s)),t.push(this),r=!0),t&&t.push(i)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Qn(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let s=r.create(t.attrs);return r.checkAttrs(s.attrs),s}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Ps.none;if(e instanceof Ps)return[e];let t=e.slice();return t.sort((r,s)=>r.type.rank-s.type.rank),t}};z.none=[];class Zn extends Error{}class v{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=ql(this.content,e+this.openStart,t);return r&&new v(r,this.openStart,this.openEnd)}removeBetween(e,t){return new v(Ul(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return v.empty;let r=t.openStart||0,s=t.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new v(k.fromJSON(e,t.content),r,s)}static maxOpen(e,t=!0){let r=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)s++;return new v(e,r,s)}}v.empty=new v(k.empty,0,0);function Ul(n,e,t){let{index:r,offset:s}=n.findIndex(e),i=n.maybeChild(r),{index:o,offset:l}=n.findIndex(t);if(s==e||i.isText){if(l!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,i.copy(Ul(i.content,e-s-1,t-s-1)))}function ql(n,e,t,r){let{index:s,offset:i}=n.findIndex(e),o=n.maybeChild(s);if(i==e||o.isText)return r&&!r.canReplace(s,s,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=ql(o.content,e-i-1,t,o);return l&&n.replaceChild(s,o.copy(l))}function Gu(n,e,t){if(t.openStart>n.depth)throw new Zn("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new Zn("Inconsistent open depths");return Kl(n,e,t,0)}function Kl(n,e,t,r){let s=n.index(r),i=n.node(r);if(s==e.index(r)&&r<n.depth-t.openStart){let o=Kl(n,e,t,r+1);return i.copy(i.content.replaceChild(s,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let o=n.parent,l=o.content;return yt(o,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=Yu(t,n);return yt(i,Gl(n,o,l,e,r))}else return yt(i,er(n,e,r))}function Jl(n,e){if(!e.type.compatibleContent(n.type))throw new Zn("Cannot join "+e.type.name+" onto "+n.type.name)}function Ls(n,e,t){let r=n.node(t);return Jl(r,e.node(t)),r}function gt(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function an(n,e,t,r){let s=(e||n).node(t),i=0,o=e?e.index(t):s.childCount;n&&(i=n.index(t),n.depth>t?i++:n.textOffset&&(gt(n.nodeAfter,r),i++));for(let l=i;l<o;l++)gt(s.child(l),r);e&&e.depth==t&&e.textOffset&>(e.nodeBefore,r)}function yt(n,e){return n.type.checkContent(e),n.copy(e)}function Gl(n,e,t,r,s){let i=n.depth>s&&Ls(n,e,s+1),o=r.depth>s&&Ls(t,r,s+1),l=[];return an(null,n,s,l),i&&o&&e.index(s)==t.index(s)?(Jl(i,o),gt(yt(i,Gl(n,e,t,r,s+1)),l)):(i&>(yt(i,er(n,e,s+1)),l),an(e,t,s,l),o&>(yt(o,er(t,r,s+1)),l)),an(r,null,s,l),new k(l)}function er(n,e,t){let r=[];if(an(null,n,t,r),n.depth>t){let s=Ls(n,e,t+1);gt(yt(s,er(n,e,t+1)),r)}return an(e,null,t,r),new k(r)}function Yu(n,e){let t=e.depth-n.openStart,s=e.node(t).copy(n.content);for(let i=t-1;i>=0;i--)s=e.node(i).copy(k.from(s));return{start:s.resolveNoCache(n.openStart+t),end:s.resolveNoCache(s.content.size-n.openEnd-t)}}class kn{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(t);return r?e.child(t).cut(r):s}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],s=t==0?0:this.path[t*3-1]+1;for(let i=0;i<e;i++)s+=r.child(i).nodeSize;return s}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return z.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),s=e.maybeChild(t);if(!r){let l=r;r=s,s=l}let i=r.marks;for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!s||!i[o].isInSet(s.marks))&&(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,s=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!s||!r[i].isInSet(s.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new tr(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],s=0,i=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(i),c=i-a;if(r.push(o,l,s+a),!c||(o=o.child(l),o.isText))break;i=c-1,s+=a+1}return new kn(t,r,i)}static resolveCached(e,t){let r=so.get(e);if(r)for(let i=0;i<r.elts.length;i++){let o=r.elts[i];if(o.pos==t)return o}else so.set(e,r=new Xu);let s=r.elts[r.i]=kn.resolve(e,t);return r.i=(r.i+1)%Qu,s}}class Xu{constructor(){this.elts=[],this.i=0}}const Qu=12,so=new WeakMap;class tr{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Zu=Object.create(null);class Ee{constructor(e,t,r,s=z.none){this.type=e,this.attrs=t,this.marks=s,this.content=r||k.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,s=0){this.content.nodesBetween(e,t,r,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,s){return this.content.textBetween(e,t,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&Qn(this.attrs,t||e.defaultAttrs||Zu)&&z.sameSet(this.marks,r||z.none)}copy(e=null){return e==this.content?this:new Ee(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Ee(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return v.empty;let s=this.resolve(e),i=this.resolve(t),o=r?0:s.sharedDepth(t),l=s.start(o),c=s.node(o).content.cut(s.pos-l,i.pos-l);return new v(c,s.depth-o,i.depth-o)}replace(e,t,r){return Gu(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:s}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(s==e||t.isText)return t;e-=s+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let s=this.content.child(t-1);return{node:s,index:t-1,offset:r-s.nodeSize}}resolve(e){return kn.resolveCached(this,e)}resolveNoCache(e){return kn.resolve(this,e)}rangeHasMark(e,t,r){let s=!1;return t>e&&this.nodesBetween(e,t,i=>(r.isInSet(i.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Yl(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=k.empty,s=0,i=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,s,i),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=s;a<i;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,t,r,s){if(s&&!this.type.allowsMarks(s))return!1;let i=this.contentMatchAt(e).matchType(r),o=i&&i.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=z.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!z.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let s=k.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,s,r);return i.type.checkAttrs(i.attrs),i}}Ee.prototype.text=void 0;class nr extends Ee{constructor(e,t,r,s){if(super(e,t,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Yl(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new nr(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new nr(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Yl(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class wt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new ed(e,t);if(r.next==null)return wt.empty;let s=Xl(r);r.next&&r.err("Unexpected trailing text");let i=ld(od(s));return ad(i,r),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let s=this;for(let i=t;s&&i<r;i++)s=s.matchType(e.child(i).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let s=[this];function i(o,l){let a=o.matchFragment(e,r);if(a&&(!t||a.validEnd))return k.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(d)==-1){s.push(d);let f=i(d,l.concat(u));if(f)return f}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),i=s.match;if(i.matchType(e)){let o=[];for(let l=s;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<i.next.length;o++){let{type:l,next:a}=i.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!s.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:s}),t[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&t(r.next[s].next)}return t(this),e.map((r,s)=>{let i=s+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)i+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return i}).join(`
|
|
2
2
|
`)}}wt.empty=new wt(!0);class ed{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Xl(n){let e=[];do e.push(td(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function td(n){let e=[];do e.push(nd(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function nd(n){let e=id(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=rd(n,e);else break;return e}function io(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function rd(n,e){let t=io(n),r=t;return n.eat(",")&&(n.next!="}"?r=io(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function sd(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let s=[];for(let i in t){let o=t[i];o.isInGroup(e)&&s.push(o)}return s.length==0&&n.err("No node type or group '"+e+"' found"),s}function id(n){if(n.eat("(")){let e=Xl(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=sd(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function od(n){let e=[[]];return s(i(n,0),t()),e;function t(){return e.push([])-1}function r(o,l,a){let c={term:a,to:l};return e[o].push(c),c}function s(o,l){o.forEach(a=>a.to=l)}function i(o,l){if(o.type=="choice")return o.exprs.reduce((a,c)=>a.concat(i(c,l)),[]);if(o.type=="seq")for(let a=0;;a++){let c=i(o.exprs[a],l);if(a==o.exprs.length-1)return c;s(c,l=t())}else if(o.type=="star"){let a=t();return r(l,a),s(i(o.expr,a),a),[r(a)]}else if(o.type=="plus"){let a=t();return s(i(o.expr,l),a),s(i(o.expr,a),a),[r(a)]}else{if(o.type=="opt")return[r(l)].concat(i(o.expr,l));if(o.type=="range"){let a=l;for(let c=0;c<o.min;c++){let u=t();s(i(o.expr,a),u),a=u}if(o.max==-1)s(i(o.expr,a),a);else for(let c=o.min;c<o.max;c++){let u=t();r(a,u),s(i(o.expr,a),u),a=u}return[r(a)]}else{if(o.type=="name")return[r(l,void 0,o.value)];throw new Error("Unknown expr type")}}}}function Ql(n,e){return e-n}function oo(n,e){let t=[];return r(e),t.sort(Ql);function r(s){let i=n[s];if(i.length==1&&!i[0].term)return r(i[0].to);t.push(s);for(let o=0;o<i.length;o++){let{term:l,to:a}=i[o];!l&&t.indexOf(a)==-1&&r(a)}}}function ld(n){let e=Object.create(null);return t(oo(n,0));function t(r){let s=[];r.forEach(o=>{n[o].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u<s.length;u++)s[u][0]==l&&(c=s[u][1]);oo(n,a).forEach(u=>{c||s.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=e[r.join(",")]=new wt(r.indexOf(n.length-1)>-1);for(let o=0;o<s.length;o++){let l=s[o][1].sort(Ql);i.next.push({type:s[o][0],next:e[l.join(",")]||t(l)})}return i}}function ad(n,e){for(let t=0,r=[n];t<r.length;t++){let s=r[t],i=!s.validEnd,o=[];for(let l=0;l<s.next.length;l++){let{type:a,next:c}=s.next[l];o.push(a.name),i&&!(a.isText||a.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Zl(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function ea(n,e){let t=Object.create(null);for(let r in n){let s=e&&e[r];if(s===void 0){let i=n[r];if(i.hasDefault)s=i.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=s}return t}function ta(n,e,t,r){for(let s in e)if(!(s in n))throw new RangeError(`Unsupported attribute ${s} for ${t} of type ${s}`);for(let s in n){let i=n[s];i.validate&&i.validate(e[s])}}function na(n,e){let t=Object.create(null);if(e)for(let r in e)t[r]=new ud(n,r,e[r]);return t}let lo=class ra{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=na(e,r.attrs),this.defaultAttrs=Zl(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==wt.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:ea(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Ee(this,this.computeAttrs(e),k.from(t),z.setFrom(r))}createChecked(e=null,t,r){return t=k.from(t),this.checkContent(t),new Ee(this,this.computeAttrs(e),t,z.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=k.from(t),t.size){let o=this.contentMatch.fillBefore(t);if(!o)return null;t=o.append(t)}let s=this.contentMatch.matchFragment(t),i=s&&s.fillBefore(k.empty,!0);return i?new Ee(this,e,t.append(i),z.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){ta(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:z.none:e}static compile(e,t){let r=Object.create(null);e.forEach((i,o)=>r[i]=new ra(i,t,o));let s=t.spec.topNode||"doc";if(!r[s])throw new RangeError("Schema is missing its top node type ('"+s+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function cd(n,e,t){let r=t.split("|");return s=>{let i=s===null?"null":typeof s;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${i}`)}}class ud{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?cd(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class jr{constructor(e,t,r,s){this.name=e,this.rank=t,this.schema=r,this.spec=s,this.attrs=na(e,s.attrs),this.excluded=null;let i=Zl(this.attrs);this.instance=i?new z(this,i):null}create(e=null){return!e&&this.instance?this.instance:new z(this,ea(this.attrs,e))}static compile(e,t){let r=Object.create(null),s=0;return e.forEach((i,o)=>r[i]=new jr(i,s++,t,o)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){ta(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class sa{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let s in e)t[s]=e[s];t.nodes=Q.from(e.nodes),t.marks=Q.from(e.marks||{}),this.nodes=lo.compile(this.spec.nodes,this),this.marks=jr.compile(this.spec.marks,this);let r=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");let i=this.nodes[s],o=i.spec.content||"",l=i.spec.marks;if(i.contentMatch=r[o]||(r[o]=wt.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=l=="_"?null:l?ao(this,l.split(" ")):l==""||!i.inlineContent?[]:null}for(let s in this.marks){let i=this.marks[s],o=i.spec.excludes;i.excluded=o==null?[i]:o==""?[]:ao(this,o.split(" "))}this.nodeFromJSON=s=>Ee.fromJSON(this,s),this.markFromJSON=s=>z.fromJSON(this,s),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,s){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof lo){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,s)}text(e,t){let r=this.nodes.text;return new nr(r,r.defaultAttrs,e,z.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function ao(n,e){let t=[];for(let r=0;r<e.length;r++){let s=e[r],i=n.marks[s],o=i;if(i)t.push(i);else for(let l in n.marks){let a=n.marks[l];(s=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(s)>-1)&&t.push(o=a)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function dd(n){return n.tag!=null}function fd(n){return n.style!=null}class Ze{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(s=>{if(dd(s))this.tags.push(s);else if(fd(s)){let i=/[^=]*/.exec(s.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(s)}}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let i=e.nodes[s.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let r=new uo(this,t,!1);return r.addAll(e,z.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new uo(this,t,!0);return r.addAll(e,z.none,t.from,t.to),v.maxOpen(r.finish())}matchTag(e,t,r){for(let s=r?this.tags.indexOf(r)+1:0;s<this.tags.length;s++){let i=this.tags[s];if(md(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||t.matchesContext(i.context))){if(i.getAttrs){let o=i.getAttrs(e);if(o===!1)continue;i.attrs=o||void 0}return i}}}matchStyle(e,t,r,s){for(let i=s?this.styles.indexOf(s)+1:0;i<this.styles.length;i++){let o=this.styles[i],l=o.style;if(!(l.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let t=[];function r(s){let i=s.priority==null?50:s.priority,o=0;for(;o<t.length;o++){let l=t[o];if((l.priority==null?50:l.priority)<i)break}t.splice(o,0,s)}for(let s in e.marks){let i=e.marks[s].spec.parseDOM;i&&i.forEach(o=>{r(o=fo(o)),o.mark||o.ignore||o.clearMark||(o.mark=s)})}for(let s in e.nodes){let i=e.nodes[s].spec.parseDOM;i&&i.forEach(o=>{r(o=fo(o)),o.node||o.ignore||o.mark||(o.node=s)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Ze(e,Ze.schemaRules(e)))}}const ia={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},hd={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},oa={ol:!0,ul:!0},xn=1,Bs=2,cn=4;function co(n,e,t){return e!=null?(e?xn:0)|(e==="full"?Bs:0):n&&n.whitespace=="pre"?xn|Bs:t&~cn}class Bn{constructor(e,t,r,s,i,o){this.type=e,this.attrs=t,this.marks=r,this.solid=s,this.options=o,this.content=[],this.activeMarks=z.none,this.match=i||(o&cn?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(k.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,s;return(s=r.findWrapping(e.type))?(this.match=r,s):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&xn)){let r=this.content[this.content.length-1],s;if(r&&r.isText&&(s=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==s[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-s[0].length))}}let t=k.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(k.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!ia.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class uo{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let s=t.topNode,i,o=co(null,t.preserveWhitespace,0)|(r?cn:0);s?i=new Bn(s.type,s.attrs,z.none,!0,t.topMatch||s.type.contentMatch,o):r?i=new Bn(null,null,z.none,!0,null,o):i=new Bn(e.schema.topNodeType,null,z.none,!0,null,o),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,s=this.top,i=s.options&Bs?"full":this.localPreserveWS||(s.options&xn)>0,{schema:o}=this.parser;if(i==="full"||s.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)if(i==="full")r=r.replace(/\r\n?/g,`
|
|
3
3
|
`);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let a=0;a<l.length;a++)a&&this.insertNode(o.linebreakReplacement.create(),t,!0),l[a]&&this.insertNode(o.text(l[a]),t,!/\S/.test(l[a]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let l=s.content[s.content.length-1],a=e.previousSibling;(!l||a&&a.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(r=r.slice(1))}r&&this.insertNode(o.text(r),t,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let s=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),l;oa.hasOwnProperty(o)&&this.parser.normalizeLists&&pd(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(a?a.ignore:hd.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let c,u=this.needsBlock;if(ia.hasOwnProperty(o))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),c=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let d=a&&a.skip?t:this.readStyles(e,t);d&&this.addAll(e,d),c&&this.sync(i),this.needsBlock=u}else{let c=this.readStyles(e,t);c&&this.addElementByRule(e,a,c,a.consuming===!1?l:void 0)}this.localPreserveWS=s}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
4
4
|
`),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let r=e.style;if(r&&r.length)for(let s=0;s<this.parser.matchedStyles.length;s++){let i=this.parser.matchedStyles[s],o=r.getPropertyValue(i);if(o)for(let l=void 0;;){let a=this.parser.matchStyle(i,o,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?t=t.filter(c=>!a.clearMark(c)):t=t.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return t}addElementByRule(e,t,r,s){let i,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let a=this.enter(o,t.attrs||null,r,t.preserveWhitespace);a&&(i=!0,r=a)}else{let a=this.parser.schema.marks[t.mark];r=r.concat(a.create(t.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(s)this.addElement(e,r,s);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}i&&this.sync(l)&&this.open--}addAll(e,t,r,s){let i=r||0;for(let o=r?e.childNodes[r]:e.firstChild,l=s==null?null:e.childNodes[s];o!=l;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o,t);this.findAtPoint(e,i)}findPlace(e,t,r){let s,i;for(let o=this.open,l=0;o>=0;o--){let a=this.nodes[o],c=a.findWrapping(e);if(c&&(!s||s.length>c.length+l)&&(s=c,i=a,!c.length))break;if(a.solid){if(r)break;l+=2}}if(!s)return null;this.sync(i);for(let o=0;o<s.length;o++)t=this.enterInner(s[o],null,t,!1);return t}insertNode(e,t,r){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(t=this.enterInner(i,null,t))}let s=this.findPlace(e,t,r);if(s){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let o=z.none;for(let l of s.concat(e.marks))(i.type?i.type.allowsMarkType(l.type):ho(l.type,e.type))&&(o=l.addToSet(o));return i.content.push(e.mark(o)),!0}return!1}enter(e,t,r,s){let i=this.findPlace(e.create(t),r,!1);return i&&(i=this.enterInner(e,t,r,!0,s)),i}enterInner(e,t,r,s=!1,i){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let l=co(e,i,o.options);o.options&cn&&o.content.length==0&&(l|=cn);let a=z.none;return r=r.filter(c=>(o.type?o.type.allowsMarkType(c.type):ho(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new Bn(e,t,a,s,null,l)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=xn)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let s=r.length-1;s>=0;s--)e+=r[s].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let s=0;s<this.find.length;s++)this.find[s].pos==null&&e.nodeType==1&&e.contains(this.find[s].node)&&t.compareDocumentPosition(this.find[s].node)&(r?2:4)&&(this.find[s].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,s=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(s?0:1),o=(l,a)=>{for(;l>=0;l--){let c=t[l];if(c==""){if(l==t.length-1||l==0)continue;for(;a>=i;a--)if(o(l-1,a))return!0;return!1}else{let u=a>0||a==0&&s?this.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;a--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}}function pd(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&oa.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function md(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function fo(n){let e={};for(let t in n)e[t]=n[t];return e}function ho(n,e){let t=e.schema.nodes;for(let r in t){let s=t[r];if(!s.allowsMarkType(n))continue;let i=[],o=l=>{i.push(l);for(let a=0;a<l.edgeCount;a++){let{type:c,next:u}=l.edge(a);if(c==e||i.indexOf(u)<0&&o(u))return!0}};if(o(s.contentMatch))return!0}}class At{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=as(t).createDocumentFragment());let s=r,i=[];return e.forEach(o=>{if(i.length||o.marks.length){let l=0,a=0;for(;l<i.length&&a<o.marks.length;){let c=o.marks[a];if(!this.marks[c.type.name]){a++;continue}if(!c.eq(i[l][0])||c.type.spec.spanning===!1)break;l++,a++}for(;l<i.length;)s=i.pop()[1];for(;a<o.marks.length;){let c=o.marks[a++],u=this.serializeMark(c,o.isInline,t);u&&(i.push([c,s]),s.appendChild(u.dom),s=u.contentDOM||u.dom)}}s.appendChild(this.serializeNodeInner(o,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:s}=Kn(as(t),this.nodes[e.type.name](e),null,e.attrs);if(s){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,s)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let s=e.marks.length-1;s>=0;s--){let i=this.serializeMark(e.marks[s],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,t,r={}){let s=this.marks[e.type.name];return s&&Kn(as(r),s(e,t),null,e.attrs)}static renderSpec(e,t,r=null,s){return Kn(e,t,r,s)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new At(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=po(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return po(e.marks)}}function po(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function as(n){return n.document||window.document}const mo=new WeakMap;function gd(n){let e=mo.get(n);return e===void 0&&mo.set(n,e=yd(n)),e}function yd(n){let e=null;function t(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let s=0;s<r.length;s++)t(r[s]);else for(let s in r)t(r[s])}return t(n),e}function Kn(n,e,t,r){if(typeof e=="string")return{dom:n.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let s=e[0],i;if(typeof s!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=gd(r))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=s.indexOf(" ");o>0&&(t=s.slice(0,o),s=s.slice(o+1));let l,a=t?n.createElementNS(t,s):n.createElement(s),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):d=="style"&&a.style?a.style.cssText=c[d]:a.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let f=e[d];if(f===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:h,contentDOM:p}=Kn(n,f,t,r);if(a.appendChild(h),p){if(l)throw new RangeError("Multiple content holes");l=p}}}return{dom:a,contentDOM:l}}const la=65535,aa=Math.pow(2,16);function bd(n,e){return n+e*aa}function go(n){return n&la}function kd(n){return(n-(n&la))/aa}const ca=1,ua=2,Jn=4,da=8;class zs{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&da)>0}get deletedBefore(){return(this.delInfo&(ca|Jn))>0}get deletedAfter(){return(this.delInfo&(ua|Jn))>0}get deletedAcross(){return(this.delInfo&Jn)>0}}class fe{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&fe.empty)return fe.empty}recover(e){let t=0,r=go(e);if(!this.inverted)for(let s=0;s<r;s++)t+=this.ranges[s*3+2]-this.ranges[s*3+1];return this.ranges[r*3]+t+kd(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let s=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?s:0);if(a>e)break;let c=this.ranges[l+i],u=this.ranges[l+o],d=a+c;if(e<=d){let f=c?e==a?-1:e==d?1:t:t,h=a+s+(f<0?0:u);if(r)return h;let p=e==(t<0?a:d)?null:bd(l/3,e-a),m=e==a?ua:e==d?ca:Jn;return(t<0?e!=a:e!=d)&&(m|=da),new zs(h,m,p)}s+=u-c}return r?e+s:new zs(e+s,0,null)}touches(e,t){let r=0,s=go(t),i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?r:0);if(a>e)break;let c=this.ranges[l+i],u=a+c;if(e<=u&&l==s*3)return!0;r+=this.ranges[l+o]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let s=0,i=0;s<this.ranges.length;s+=3){let o=this.ranges[s],l=o-(this.inverted?i:0),a=o+(this.inverted?0:i),c=this.ranges[s+t],u=this.ranges[s+r];e(l,l+c,a,a+u),i+=u-c}}invert(){return new fe(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?fe.empty:new fe(e<0?[0,-e,0]:[0,0,e])}}fe.empty=new fe([]);class Sn{constructor(e,t,r=0,s=e?e.length:0){this.mirror=t,this.from=r,this.to=s,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new Sn(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,r=this._maps.length;t<e._maps.length;t++){let s=e.getMirror(t);this.appendMap(e._maps[t],s!=null&&s<t?r+s:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this._maps.length+e._maps.length;t>=0;t--){let s=e.getMirror(t);this.appendMap(e._maps[t].invert(),s!=null&&s>t?r-s-1:void 0)}}invert(){let e=new Sn;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let s=0;for(let i=this.from;i<this.to;i++){let o=this._maps[i],l=o.mapResult(e,t);if(l.recover!=null){let a=this.getMirror(i);if(a!=null&&a>i&&a<this.to){i=a,e=this._maps[a].recover(l.recover);continue}}s|=l.delInfo,e=l.pos}return r?e:new zs(e,s,null)}}const cs=Object.create(null);class se{getMap(){return fe.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=cs[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in cs)throw new RangeError("Duplicate use of step JSON ID "+e);return cs[e]=t,t.prototype.jsonID=e,t}}class q{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new q(e,null)}static fail(e){return new q(null,e)}static fromReplace(e,t,r,s){try{return q.ok(e.replace(t,r,s))}catch(i){if(i instanceof Zn)return q.fail(i.message);throw i}}}function di(n,e,t){let r=[];for(let s=0;s<n.childCount;s++){let i=n.child(s);i.content.size&&(i=i.copy(di(i.content,e,i))),i.isInline&&(i=e(i,t,s)),r.push(i)}return k.fromArray(r)}class Ge extends se{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),s=r.node(r.sharedDepth(this.to)),i=new v(di(t.content,(o,l)=>!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),s),t.openStart,t.openEnd);return q.fromReplace(e,this.from,this.to,i)}invert(){return new ve(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Ge(t.pos,r.pos,this.mark)}merge(e){return e instanceof Ge&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ge(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ge(t.from,t.to,e.markFromJSON(t.mark))}}se.jsonID("addMark",Ge);class ve extends se{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new v(di(t.content,s=>s.mark(this.mark.removeFromSet(s.marks)),e),t.openStart,t.openEnd);return q.fromReplace(e,this.from,this.to,r)}invert(){return new Ge(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new ve(t.pos,r.pos,this.mark)}merge(e){return e instanceof ve&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ve(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new ve(t.from,t.to,e.markFromJSON(t.mark))}}se.jsonID("removeMark",ve);class Ye extends se{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return q.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return q.fromReplace(e,this.pos,this.pos+1,new v(k.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let s=0;s<t.marks.length;s++)if(!t.marks[s].isInSet(r))return new Ye(this.pos,t.marks[s]);return new Ye(this.pos,this.mark)}}return new Ct(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Ye(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Ye(t.pos,e.markFromJSON(t.mark))}}se.jsonID("addNodeMark",Ye);class Ct extends se{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return q.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return q.fromReplace(e,this.pos,this.pos+1,new v(k.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Ye(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Ct(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Ct(t.pos,e.markFromJSON(t.mark))}}se.jsonID("removeNodeMark",Ct);class U extends se{constructor(e,t,r,s=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=s}apply(e){return this.structure&&$s(e,this.from,this.to)?q.fail("Structure replace would overwrite content"):q.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new fe([this.from,this.to-this.from,this.slice.size])}invert(e){return new U(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.to,-1),r=this.from==this.to&&U.MAP_BIAS<0?t:e.mapResult(this.from,1);return r.deletedAcross&&t.deletedAcross?null:new U(r.pos,Math.max(r.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof U)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?v.empty:new v(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new U(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?v.empty:new v(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new U(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new U(t.from,t.to,v.fromJSON(e,t.slice),!!t.structure)}}U.MAP_BIAS=1;se.jsonID("replace",U);class Y extends se{constructor(e,t,r,s,i,o,l=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=s,this.slice=i,this.insert=o,this.structure=l}apply(e){if(this.structure&&($s(e,this.from,this.gapFrom)||$s(e,this.gapTo,this.to)))return q.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return q.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?q.fromReplace(e,this.from,this.to,r):q.fail("Content does not fit in gap")}getMap(){return new fe([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new Y(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),s=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||s<t.pos||i>r.pos?null:new Y(t.pos,r.pos,s,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Y(t.from,t.to,t.gapFrom,t.gapTo,v.fromJSON(e,t.slice),t.insert,!!t.structure)}}se.jsonID("replaceAround",Y);function $s(n,e,t){let r=n.resolve(e),s=t-e,i=r.depth;for(;s>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,s--;if(s>0){let o=r.node(i).maybeChild(r.indexAfter(i));for(;s>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,s--}}return!1}function xd(n,e,t,r){let s=[],i=[],o,l;n.doc.nodesBetween(e,t,(a,c,u)=>{if(!a.isInline)return;let d=a.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),h=Math.min(c+a.nodeSize,t),p=r.addToSet(d);for(let m=0;m<d.length;m++)d[m].isInSet(p)||(o&&o.to==f&&o.mark.eq(d[m])?o.to=h:s.push(o=new ve(f,h,d[m])));l&&l.to==f?l.to=h:i.push(l=new Ge(f,h,r))}}),s.forEach(a=>n.step(a)),i.forEach(a=>n.step(a))}function Sd(n,e,t,r){let s=[],i=0;n.doc.nodesBetween(e,t,(o,l)=>{if(!o.isInline)return;i++;let a=null;if(r instanceof jr){let c=o.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(o.marks)&&(a=[r]):a=o.marks;if(a&&a.length){let c=Math.min(l+o.nodeSize,t);for(let u=0;u<a.length;u++){let d=a[u],f;for(let h=0;h<s.length;h++){let p=s[h];p.step==i-1&&d.eq(s[h].style)&&(f=p)}f?(f.to=c,f.step=i):s.push({style:d,from:Math.max(l,e),to:c,step:i})}}}),s.forEach(o=>n.step(new ve(o.from,o.to,o.style)))}function fi(n,e,t,r=t.contentMatch,s=!0){let i=n.doc.nodeAt(e),o=[],l=e+1;for(let a=0;a<i.childCount;a++){let c=i.child(a),u=l+c.nodeSize,d=r.matchType(c.type);if(!d)o.push(new U(l,u,v.empty));else{r=d;for(let f=0;f<c.marks.length;f++)t.allowsMarkType(c.marks[f].type)||n.step(new ve(l,u,c.marks[f]));if(s&&c.isText&&t.whitespace!="pre"){let f,h=/\r?\n|\r/g,p;for(;f=h.exec(c.text);)p||(p=new v(k.from(t.schema.text(" ",t.allowedMarks(c.marks))),0,0)),o.push(new U(l+f.index,l+f.index+f[0].length,p))}}l=u}if(!r.validEnd){let a=r.fillBefore(k.empty,!0);n.replace(l,l,new v(a,0,0))}for(let a=o.length-1;a>=0;a--)n.step(o[a])}function wd(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Yt(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth,s=0,i=0;;--r){let o=n.$from.node(r),l=n.$from.index(r)+s,a=n.$to.indexAfter(r)-i;if(r<n.depth&&o.canReplace(l,a,t))return r;if(r==0||o.type.spec.isolating||!wd(o,l,a))break;l&&(s=1),a<o.childCount&&(i=1)}return null}function Cd(n,e,t){let{$from:r,$to:s,depth:i}=e,o=r.before(i+1),l=s.after(i+1),a=o,c=l,u=k.empty,d=0;for(let p=i,m=!1;p>t;p--)m||r.index(p)>0?(m=!0,u=k.from(r.node(p).copy(u)),d++):a--;let f=k.empty,h=0;for(let p=i,m=!1;p>t;p--)m||s.after(p+1)<s.end(p)?(m=!0,f=k.from(s.node(p).copy(f)),h++):c++;n.step(new Y(a,c,o,l,new v(u.append(f),d,h),u.size-d,!0))}function hi(n,e,t=null,r=n){let s=vd(n,e),i=s&&Ed(r,e);return i?s.map(yo).concat({type:e,attrs:t}).concat(i.map(yo)):null}function yo(n){return{type:n,attrs:null}}function vd(n,e){let{parent:t,startIndex:r,endIndex:s}=n,i=t.contentMatchAt(r).findWrapping(e);if(!i)return null;let o=i.length?i[0]:e;return t.canReplaceWith(r,s,o)?i:null}function Ed(n,e){let{parent:t,startIndex:r,endIndex:s}=n,i=t.child(r),o=e.contentMatch.findWrapping(i.type);if(!o)return null;let a=(o.length?o[o.length-1]:e).contentMatch;for(let c=r;a&&c<s;c++)a=a.matchType(t.child(c).type);return!a||!a.validEnd?null:o}function Td(n,e,t){let r=k.empty;for(let o=t.length-1;o>=0;o--){if(r.size){let l=t[o].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=k.from(t[o].type.create(t[o].attrs,r))}let s=e.start,i=e.end;n.step(new Y(s,i,s,i,new v(r,0,0),t.length,!0))}function Md(n,e,t,r,s){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=n.steps.length;n.doc.nodesBetween(e,t,(o,l)=>{let a=typeof s=="function"?s(o):s;if(o.isTextblock&&!o.hasMarkup(r,a)&&Ad(n.doc,n.mapping.slice(i).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!p?c=!1:!h&&p&&(c=!0)}c===!1&&ha(n,o,l,i),fi(n,n.mapping.slice(i).map(l,1),r,void 0,c===null);let u=n.mapping.slice(i),d=u.map(l,1),f=u.map(l+o.nodeSize,1);return n.step(new Y(d,f,d+1,f-1,new v(k.from(r.create(a,null,o.marks)),0,0),1,!0)),c===!0&&fa(n,o,l,i),!1}})}function fa(n,e,t,r){e.forEach((s,i)=>{if(s.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(s.text);){let a=n.mapping.slice(r).map(t+1+i+o.index);n.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function ha(n,e,t,r){e.forEach((s,i)=>{if(s.type==s.type.schema.linebreakReplacement){let o=n.mapping.slice(r).map(t+1+i);n.replaceWith(o,o+1,e.type.schema.text(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as b,c as w,j as a,l as j}from"./index-
|
|
1
|
+
import{e as b,c as w,j as a,l as j}from"./index-D0mCKPyO.js";import{i as N}from"./SearchMd-BSOoJwVy.js";function S(f){const e=b.c(17),{value:l,onChange:c,placeholder:g,onKeyDown:d,className:u,isSearching:p,disabled:i}=f,m=g===void 0?"Search...":g,x=i&&"pointer-events-none opacity-50";let t;e[0]!==u||e[1]!==x?(t=w("flex items-center gap-4 rounded-lg bg-background dark:bg-input/30 px-3 h-8 card-shadow","focus-within:border-ring focus-within:ring-ring/20 focus-within:ring-[2px]","transition-[color,box-shadow]",x,u),e[0]=u,e[1]=x,e[2]=t):t=e[2];let n;e[3]!==p?(n=p?a.jsx(j,{size:16,className:"animate-spin text-muted-foreground/75 shrink-0"}):a.jsx(N,{size:16,className:"text-muted-foreground/75 shrink-0"}),e[3]=p,e[4]=n):n=e[4];let s;e[5]!==c?(s=h=>c(h.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==i||e[8]!==d||e[9]!==m||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:d,placeholder:m,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=i,e[8]=d,e[9]=m,e[10]=s,e[11]=l,e[12]=o):o=e[12];let r;return e[13]!==t||e[14]!==n||e[15]!==o?(r=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=r):r=e[16],r}export{S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as p,j as t,E as P,r as j,F as w,B as S,o as y}from"./index-
|
|
1
|
+
import{e as p,j as t,E as P,r as j,F as w,B as S,o as y}from"./index-D0mCKPyO.js";import{i as k}from"./AlertCircle-BNPFaifB.js";import{s as z}from"./Plus-6fOxce1R.js";import{s as F}from"./User01-WnyHG7nS.js";import{t as E}from"./Users01-1NXz500j.js";import{D as $,a as I,b as O,c as A,e as R,d as T}from"./dialog-CNF9zctd.js";import{I as N}from"./input-D8tMlH9u.js";import{L as g}from"./label-gsYRU7Jg.js";import{d as B,S as V,a as L,b as q,c as C}from"./select-BaScWEqk.js";import{S as H}from"./skeleton-B8hTUDSD.js";import{T as K}from"./textarea-hnK41FQH.js";import{P as b}from"./index-DjdFtBpV.js";import{c as W}from"./settings-section-CQPr7_UG.js";import{u as Y,a as G}from"./use-secrets-De9xmTBY.js";import{R as J}from"./require-capability-ClpsQHD3.js";import"./X-CvL6b4Pc.js";import"./tooltip-D6Vf8YNB.js";import"./Check-DrpXvTEH.js";import"./ChevronDown-BbOS4qL1.js";import"./ChevronUp-CLLQjGPH.js";import"./sidebar-DqTSNy5t.js";import"./LayoutLeft-Dx-_kOsA.js";import"./sheet-C4ZjzK5K.js";import"./card-BOUQVYfQ.js";import"./ArrowUpRight-BL0DEL84.js";import"./studio-tools-C02pf_S5.js";import"./use-capability-k9zs5tx2.js";import"./access-gate-BKEXX39N.js";import"./capability-load-error-BdSLB25T.js";function M(s){const e=p.c(3),{error:r}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(k,{size:16}),e[0]=o):o=e[0];let n;return e[1]!==r.message?(n=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[o,t.jsxs("span",{className:"text-sm font-medium",children:["Failed to load secrets: ",r.message]})]}),e[1]=r.message,e[2]=n):n=e[2],n}function Q(s){const e=p.c(5),{scope:r}=s,o=r==="user"?F:E,n=r==="user"?"Private":"Organization";let i;e[0]!==o?(i=t.jsx(o,{size:12}),e[0]=o,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=t.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[i,n]}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function D(s){const e=p.c(20),{secret:r}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(w,{size:16,className:"text-muted-foreground"})}),e[0]=o):o=e[0];let n;e[1]!==r.name?(n=t.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=n):n=e[2];let i;e[3]!==r.scope?(i=t.jsx(Q,{scope:r.scope}),e[3]=r.scope,e[4]=i):i=e[4];let a;e[5]!==n||e[6]!==i?(a=t.jsxs("div",{className:"flex items-center gap-2",children:[n,i]}),e[5]=n,e[6]=i,e[7]=a):a=e[7];let d;e[8]!==r.description?(d=r.description?t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=d):d=e[9];let u;e[10]!==a||e[11]!==d?(u=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[o,t.jsxs("div",{className:"min-w-0",children:[a,d]})]}),e[10]=a,e[11]=d,e[12]=u):u=e[12];let l;e[13]!==r.createdAt?(l=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=l):l=e[14];let c;e[15]!==l?(c=t.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:l}),e[15]=l,e[16]=c):c=e[16];let x;return e[17]!==u||e[18]!==c?(x=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[u,c]}),e[17]=u,e[18]=c,e[19]=x):x=e[19],x}function U(s){const e=p.c(5),{onCreate:r}=s;let o,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(w,{size:20,className:"text-muted-foreground"})}),n=t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-sm",children:"No secrets yet"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Store API keys, tokens, and other sensitive values. Values are encrypted at rest and never returned over the API."})]}),e[0]=o,e[1]=n):(o=e[0],n=e[1]);let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(z,{size:14}),e[2]=i):i=e[2];let a;return e[3]!==r?(a=t.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[o,n,t.jsxs(S,{onClick:r,size:"sm",className:"mt-2",children:[i,"New secret"]})]}),e[3]=r,e[4]=a):a=e[4],a}function _({open:s,onOpenChange:e}){const[r,o]=j.useState("organization"),[n,i]=j.useState(""),[a,d]=j.useState(""),[u,l]=j.useState(""),c=G();function x(){o("organization"),i(""),d(""),l("")}function f(){x(),e(!1)}async function h(m){if(m.preventDefault(),!(!n.trim()||!a))try{await c.mutateAsync({scope:r,name:n.trim(),value:a,description:u.trim()||void 0}),y.success(`Secret "${n.trim()}" created`),f()}catch(v){y.error(v instanceof Error?v.message:"Failed to create secret")}}return t.jsx($,{open:s,onOpenChange:m=>{m?e(m):f()},children:t.jsxs(I,{className:"sm:max-w-lg",children:[t.jsxs(O,{children:[t.jsx(A,{children:"New secret"}),t.jsx(R,{children:"Stored encrypted in the credential vault. Choose who can read it."})]}),t.jsxs("form",{onSubmit:h,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-scope",children:"Scope"}),t.jsxs(B,{value:r,onValueChange:m=>o(m),children:[t.jsx(V,{id:"secret-scope",children:t.jsx(L,{})}),t.jsxs(q,{children:[t.jsx(C,{value:"organization",children:"Organization — visible to all members"}),t.jsx(C,{value:"user",children:"Private — only visible to me"})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-name",children:"Name"}),t.jsx(N,{id:"secret-name",value:n,onChange:m=>i(m.target.value),placeholder:"STRIPE_API_KEY",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Letters, digits, underscore, dot, hyphen. Case-insensitive within its scope."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-value",children:"Value"}),t.jsx(N,{id:"secret-value",type:"password",value:a,onChange:m=>d(m.target.value),autoComplete:"new-password",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-description",children:"Description (optional)"}),t.jsx(K,{id:"secret-description",value:u,onChange:m=>l(m.target.value),rows:2,placeholder:"What is this secret used for?"})]}),t.jsxs(T,{children:[t.jsx(S,{type:"button",variant:"outline",onClick:f,disabled:c.isPending,children:"Cancel"}),t.jsx(S,{type:"submit",disabled:c.isPending||!n.trim()||!a,children:c.isPending?"Creating…":"Create secret"})]})]})]})})}function X(){const s=p.c(21),e=Y(),[r,o]=j.useState(!1);if(e.length===0){let l;s[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(U,{onCreate:()=>o(!0)}),s[0]=l):l=s[0];let c;return s[1]!==r?(c=t.jsxs(t.Fragment,{children:[l,t.jsx(_,{open:r,onOpenChange:o})]}),s[1]=r,s[2]=c):c=s[2],c}let n,i,a;if(s[3]!==e){const l=e.filter(se),c=e.filter(te),x=e.length===1?"":"s";let f;s[7]!==e.length||s[8]!==x?(f=t.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length," secret",x," stored"]}),s[7]=e.length,s[8]=x,s[9]=f):f=s[9];let h;s[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>o(!0),s[10]=h):h=s[10];let m;s[11]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs(S,{onClick:h,size:"sm",children:[t.jsx(z,{size:14}),"New secret"]}),s[11]=m):m=s[11],s[12]!==f?(n=t.jsxs("div",{className:"flex items-center justify-between",children:[f,m]}),s[12]=f,s[13]=n):n=s[13],i=l.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Organization"}),t.jsx("div",{children:l.map(ee)})]}):null,a=c.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Private to me"}),t.jsx("div",{children:c.map(Z)})]}):null,s[3]=e,s[4]=n,s[5]=i,s[6]=a}else n=s[4],i=s[5],a=s[6];let d;s[14]!==r?(d=t.jsx(_,{open:r,onOpenChange:o}),s[14]=r,s[15]=d):d=s[15];let u;return s[16]!==n||s[17]!==i||s[18]!==a||s[19]!==d?(u=t.jsxs(t.Fragment,{children:[n,i,a,d]}),s[16]=n,s[17]=i,s[18]=a,s[19]=d,s[20]=u):u=s[20],u}function Z(s){return t.jsx(D,{secret:s},s.id)}function ee(s){return t.jsx(D,{secret:s},s.id)}function te(s){return s.scope==="user"}function se(s){return s.scope==="organization"}function re(){const s=p.c(2);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(b.Title,{children:"Secrets"}),s[0]=e):e=s[0];let r;return s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(b,{children:t.jsx(b.Content,{children:t.jsx(b.Body,{children:t.jsxs(W,{children:[e,t.jsx(P,{fallback:ne,children:t.jsx(j.Suspense,{fallback:t.jsx(H,{className:"h-32 w-full"}),children:t.jsx(X,{})})})]})})})}),s[1]=r):r=s[1],r}function ne(s){const{error:e}=s;return t.jsx(M,{error:e??new Error("Failed to load secrets")})}function Ie(){const s=p.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(J,{capability:"secrets:manage",area:"secrets",children:t.jsx(re,{})}),s[0]=e):e=s[0],e}export{Ie as default};
|